From owner-svn-src-all@freebsd.org Sun Sep 13 01:08:19 2020 Return-Path: Delivered-To: svn-src-all@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 6D1953E6C4D; Sun, 13 Sep 2020 01:08:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Bprw32H2Zz4kGm; Sun, 13 Sep 2020 01:08:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 315301E099; Sun, 13 Sep 2020 01:08:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08D18JGr093657; Sun, 13 Sep 2020 01:08:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08D18Ioe093655; Sun, 13 Sep 2020 01:08:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009130108.08D18Ioe093655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 13 Sep 2020 01:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365680 - stable/11/usr.sbin/certctl X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/usr.sbin/certctl X-SVN-Commit-Revision: 365680 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 01:08:19 -0000 Author: kevans Date: Sun Sep 13 01:08:18 2020 New Revision: 365680 URL: https://svnweb.freebsd.org/changeset/base/365680 Log: MFC r361397, r361655, r361683: certctl(8) unprivileged & HISTORY correction r361397: Add an unprivileged mode where calls to install are passed appropriate flags. For ease of integration, use the same flags as install: -U unprivileged mode -D Specify DESTDIR (overrides the environment) -M Full path to METALOG file r361655: certctl.8: Correct the HISTORY section. certctl was merged to stable/12 after 12.1 was branched. r361683: certctl: fix test syntax test doesn't understand &&, but it does understand -a. PR: 246190 Modified: stable/11/usr.sbin/certctl/certctl.8 stable/11/usr.sbin/certctl/certctl.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/certctl/certctl.8 ============================================================================== --- stable/11/usr.sbin/certctl/certctl.8 Sun Sep 13 00:17:04 2020 (r365679) +++ stable/11/usr.sbin/certctl/certctl.8 Sun Sep 13 01:08:18 2020 (r365680) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2019 +.Dd May 30, 2020 .Dt CERTCTL 8 .Os .Sh NAME @@ -40,7 +40,9 @@ .Op Fl v .Ic blacklisted .Nm -.Op Fl nv +.Op Fl nUv +.Op Fl D Ar destdir +.Op Fl M Ar metalog .Ic rehash .Nm .Op Fl nv @@ -56,10 +58,17 @@ applications that use OpenSSL. .Pp Flags: .Bl -tag -width 4n +.It Fl D Ar destdir +Specify the DESTDIR (overriding values from the environment). +.It Fl M Ar metalog +Specify the path of the METALOG file (default: $DESTDIR/METALOG). .It Fl n No-Op mode, do not actually perform any actions. .It Fl v be verbose, print details about actions before performing them. +.It Fl U +Unprivileged mode, do not change the ownership of created links. +Do record the ownership in the METALOG file. .El .Pp Primary command functions: @@ -114,6 +123,6 @@ Default: *.pem *.crt *.cer *.crl *.0 .Sh HISTORY .Nm first appeared in -.Fx 12.0 +.Fx 12.2 .Sh AUTHORS .An Allan Jude Aq Mt allanjude@freebsd.org Modified: stable/11/usr.sbin/certctl/certctl.sh ============================================================================== --- stable/11/usr.sbin/certctl/certctl.sh Sun Sep 13 00:17:04 2020 (r365679) +++ stable/11/usr.sbin/certctl/certctl.sh Sun Sep 13 01:08:18 2020 (r365680) @@ -30,10 +30,6 @@ ############################################################ CONFIGURATION : ${DESTDIR:=} -: ${TRUSTPATH:=${DESTDIR}/usr/share/certs/trusted:${DESTDIR}/usr/local/share/certs:${DESTDIR}/usr/local/etc/ssl/certs} -: ${BLACKLISTPATH:=${DESTDIR}/usr/share/certs/blacklisted:${DESTDIR}/usr/local/etc/ssl/blacklisted} -: ${CERTDESTDIR:=${DESTDIR}/etc/ssl/certs} -: ${BLACKLISTDESTDIR:=${DESTDIR}/etc/ssl/blacklisted} : ${FILEPAT:="\.pem$|\.crt$|\.cer$|\.crl$|\.0$"} : ${VERBOSE:=0} @@ -42,6 +38,7 @@ SCRIPTNAME="${0##*/}" ERRORS=0 NOOP=0 +UNPRIV=0 ############################################################ FUNCTIONS @@ -69,7 +66,7 @@ create_trusted_link() return 1 fi [ $VERBOSE -gt 0 ] && echo "Adding $hash.0 to trust store" - [ $NOOP -eq 0 ] && install -lrs $(realpath "$1") "$CERTDESTDIR/$hash.0" + [ $NOOP -eq 0 ] && install ${INSTALLFLAGS} -lrs $(realpath "$1") "$CERTDESTDIR/$hash.0" } create_blacklisted() @@ -88,7 +85,7 @@ create_blacklisted() return fi [ $VERBOSE -gt 0 ] && echo "Adding $filename to blacklist" - [ $NOOP -eq 0 ] && install -lrs "$srcfile" "$BLACKLISTDESTDIR/$filename" + [ $NOOP -eq 0 ] && install ${INSTALLFLAGS} -lrs "$srcfile" "$BLACKLISTDESTDIR/$filename" } do_scan() @@ -105,7 +102,7 @@ do_scan() [ -d "$CPATH" ] || continue echo "Scanning $CPATH for certificates..." for CFILE in $(ls -1 "${CPATH}" | grep -Ee "${FILEPAT}"); do - [ -e "$CPATH/$CFILE" ] || continue + [ -e "$CPATH/$CFILE" -a $UNPRIV -eq 0 ] || continue [ $VERBOSE -gt 0 ] && echo "Reading $CFILE" "$CFUNC" "$CPATH/$CFILE" done @@ -209,7 +206,7 @@ usage() echo " List trusted certificates" echo " $SCRIPTNAME [-v] blacklisted" echo " List blacklisted certificates" - echo " $SCRIPTNAME [-nv] rehash" + echo " $SCRIPTNAME [-nUv] [-D ] [-M ] rehash" echo " Generate hash links for all certificates" echo " $SCRIPTNAME [-nv] blacklist " echo " Add to the list of blacklisted certificates" @@ -220,13 +217,24 @@ usage() ############################################################ MAIN -while getopts nv flag; do +while getopts D:M:nUv flag; do case "$flag" in + D) DESTDIR=${OPTARG} ;; + M) METALOG=${OPTARG} ;; n) NOOP=1 ;; + U) UNPRIV=1 ;; v) VERBOSE=$(( $VERBOSE + 1 )) ;; esac done shift $(( $OPTIND - 1 )) + +: ${METALOG:=${DESTDIR}/METALOG} +INSTALLFLAGS= +[ $UNPRIV -eq 1 ] && INSTALLFLAGS=-U -M ${METALOG} -D ${DESTDIR} +: ${TRUSTPATH:=${DESTDIR}/usr/share/certs/trusted:${DESTDIR}/usr/local/share/certs:${DESTDIR}/usr/local/etc/ssl/certs} +: ${BLACKLISTPATH:=${DESTDIR}/usr/share/certs/blacklisted:${DESTDIR}/usr/local/etc/ssl/blacklisted} +: ${CERTDESTDIR:=${DESTDIR}/etc/ssl/certs} +: ${BLACKLISTDESTDIR:=${DESTDIR}/etc/ssl/blacklisted} [ $# -gt 0 ] || usage case "$1" in From owner-svn-src-all@freebsd.org Sun Sep 13 01:09:23 2020 Return-Path: Delivered-To: svn-src-all@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 10A543E70D1; Sun, 13 Sep 2020 01:09:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BprxG6fvXz4kMy; Sun, 13 Sep 2020 01:09:22 +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 C96A11DBD8; Sun, 13 Sep 2020 01:09:22 +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 08D19M3r093772; Sun, 13 Sep 2020 01:09:22 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08D19MDh093771; Sun, 13 Sep 2020 01:09:22 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009130109.08D19MDh093771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 13 Sep 2020 01:09:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365681 - in stable: 11/usr.sbin/certctl 12/usr.sbin/certctl X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/usr.sbin/certctl 12/usr.sbin/certctl X-SVN-Commit-Revision: 365681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 01:09:23 -0000 Author: kevans Date: Sun Sep 13 01:09:22 2020 New Revision: 365681 URL: https://svnweb.freebsd.org/changeset/base/365681 Log: MFC r365500: certctl: fix hashed link generation with duplicate subjects Currently, certctl rehash will just keep clobbering .0 rather than incrementing the suffix upon encountering a duplicate. Do this, and do it for blacklisted certs as well. This also improves the situation with the blacklist to be a little less flakey, comparing cert fingerprints for all certs with a matching subject hash in the blacklist to determine if the cert we're looking at can be installed. Future work needs to completely revamp the blacklist to align more with how it's described in PR 246614. In particular, /etc/ssl/blacklisted should go away to avoid potential confusion -- OpenSSL will not read it, it's basically certctl internal. PR: 246614 Modified: stable/11/usr.sbin/certctl/certctl.sh Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.sbin/certctl/certctl.sh Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.sbin/certctl/certctl.sh ============================================================================== --- stable/11/usr.sbin/certctl/certctl.sh Sun Sep 13 01:08:18 2020 (r365680) +++ stable/11/usr.sbin/certctl/certctl.sh Sun Sep 13 01:09:22 2020 (r365681) @@ -30,7 +30,7 @@ ############################################################ CONFIGURATION : ${DESTDIR:=} -: ${FILEPAT:="\.pem$|\.crt$|\.cer$|\.crl$|\.0$"} +: ${FILEPAT:="\.pem$|\.crt$|\.cer$|\.crl$"} : ${VERBOSE:=0} ############################################################ GLOBALS @@ -56,31 +56,58 @@ do_hash() fi } +get_decimal() +{ + local checkdir hash decimal + + checkdir=$1 + hash=$2 + decimal=0 + + while [ -e "$checkdir/$hash.$decimal" ]; do + decimal=$((decimal + 1)) + done + + echo ${decimal} + return 0 +} + create_trusted_link() { - local hash + local blisthash certhash hash + local suffix hash=$( do_hash "$1" ) || return - if [ -e "$BLACKLISTDESTDIR/$hash.0" ]; then - echo "Skipping blacklisted certificate $1 ($BLACKLISTDESTDIR/$hash.0)" - return 1 - fi - [ $VERBOSE -gt 0 ] && echo "Adding $hash.0 to trust store" - [ $NOOP -eq 0 ] && install ${INSTALLFLAGS} -lrs $(realpath "$1") "$CERTDESTDIR/$hash.0" + certhash=$( openssl x509 -sha1 -in "$1" -noout -fingerprint ) + for blistfile in $(find $BLACKLISTDESTDIR -name "$hash.*"); do + blisthash=$( openssl x509 -sha1 -in "$blistfile" -noout -fingerprint ) + if [ "$certhash" = "$blisthash" ]; then + echo "Skipping blacklisted certificate $1 ($blistfile)" + return 1 + fi + done + suffix=$(get_decimal "$CERTDESTDIR" "$hash") + [ $VERBOSE -gt 0 ] && echo "Adding $hash.$suffix to trust store" + [ $NOOP -eq 0 ] && \ + install ${INSTALLFLAGS} -lrs $(realpath "$1") "$CERTDESTDIR/$hash.$suffix" } create_blacklisted() { local hash srcfile filename + local suffix # If it exists as a file, we'll try that; otherwise, we'll scan if [ -e "$1" ]; then hash=$( do_hash "$1" ) || return srcfile=$(realpath "$1") - filename="$hash.0" + suffix=$(get_decimal "$BLACKLISTDESTDIR" "$hash") + filename="$hash.$suffix" elif [ -e "${CERTDESTDIR}/$1" ]; then srcfile=$(realpath "${CERTDESTDIR}/$1") - filename="$1" + hash=$(echo "$1" | sed -Ee 's/\.([0-9])+$//') + suffix=$(get_decimal "$BLACKLISTDESTDIR" "$hash") + filename="$hash.$suffix" else return fi @@ -115,7 +142,7 @@ do_list() if [ -e "$1" ]; then cd "$1" - for CFILE in *.0; do + for CFILE in *.[0-9]; do if [ ! -s "$CFILE" ]; then echo "Unable to read $CFILE" >&2 ERRORS=$(( $ERRORS + 1 )) @@ -174,14 +201,20 @@ cmd_blacklist() cmd_unblacklist() { - local BFILE hash + local BFILE blisthash certhash hash shift # verb for BFILE in "$@"; do if [ -s "$BFILE" ]; then hash=$( do_hash "$BFILE" ) - echo "Removing $hash.0 from blacklist" - [ $NOOP -eq 0 ] && rm -f "$BLACKLISTDESTDIR/$hash.0" + certhash=$( openssl x509 -sha1 -in "$BFILE" -noout -fingerprint ) + for BLISTEDFILE in $(find $BLACKLISTDESTDIR -name "$hash.*"); do + blisthash=$( openssl x509 -sha1 -in "$BLISTEDFILE" -noout -fingerprint ) + if [ "$certhash" = "$blisthash" ]; then + echo "Removing $(basename "$BLISTEDFILE") from blacklist" + [ $NOOP -eq 0 ] && rm -f $BLISTEDFILE + fi + done elif [ -e "$BLACKLISTDESTDIR/$BFILE" ]; then echo "Removing $BFILE from blacklist" [ $NOOP -eq 0 ] && rm -f "$BLACKLISTDESTDIR/$BFILE" From owner-svn-src-all@freebsd.org Sun Sep 13 01:09:23 2020 Return-Path: Delivered-To: svn-src-all@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 619673E749C; Sun, 13 Sep 2020 01:09:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BprxH20y1z4kWG; Sun, 13 Sep 2020 01:09:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 282C91DB7F; Sun, 13 Sep 2020 01:09:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08D19NiC093778; Sun, 13 Sep 2020 01:09:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08D19NE9093777; Sun, 13 Sep 2020 01:09:23 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009130109.08D19NE9093777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 13 Sep 2020 01:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365681 - in stable: 11/usr.sbin/certctl 12/usr.sbin/certctl X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/usr.sbin/certctl 12/usr.sbin/certctl X-SVN-Commit-Revision: 365681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 01:09:23 -0000 Author: kevans Date: Sun Sep 13 01:09:22 2020 New Revision: 365681 URL: https://svnweb.freebsd.org/changeset/base/365681 Log: MFC r365500: certctl: fix hashed link generation with duplicate subjects Currently, certctl rehash will just keep clobbering .0 rather than incrementing the suffix upon encountering a duplicate. Do this, and do it for blacklisted certs as well. This also improves the situation with the blacklist to be a little less flakey, comparing cert fingerprints for all certs with a matching subject hash in the blacklist to determine if the cert we're looking at can be installed. Future work needs to completely revamp the blacklist to align more with how it's described in PR 246614. In particular, /etc/ssl/blacklisted should go away to avoid potential confusion -- OpenSSL will not read it, it's basically certctl internal. PR: 246614 Modified: stable/12/usr.sbin/certctl/certctl.sh Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.sbin/certctl/certctl.sh Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.sbin/certctl/certctl.sh ============================================================================== --- stable/12/usr.sbin/certctl/certctl.sh Sun Sep 13 01:08:18 2020 (r365680) +++ stable/12/usr.sbin/certctl/certctl.sh Sun Sep 13 01:09:22 2020 (r365681) @@ -30,7 +30,7 @@ ############################################################ CONFIGURATION : ${DESTDIR:=} -: ${FILEPAT:="\.pem$|\.crt$|\.cer$|\.crl$|\.0$"} +: ${FILEPAT:="\.pem$|\.crt$|\.cer$|\.crl$"} : ${VERBOSE:=0} ############################################################ GLOBALS @@ -56,31 +56,58 @@ do_hash() fi } +get_decimal() +{ + local checkdir hash decimal + + checkdir=$1 + hash=$2 + decimal=0 + + while [ -e "$checkdir/$hash.$decimal" ]; do + decimal=$((decimal + 1)) + done + + echo ${decimal} + return 0 +} + create_trusted_link() { - local hash + local blisthash certhash hash + local suffix hash=$( do_hash "$1" ) || return - if [ -e "$BLACKLISTDESTDIR/$hash.0" ]; then - echo "Skipping blacklisted certificate $1 ($BLACKLISTDESTDIR/$hash.0)" - return 1 - fi - [ $VERBOSE -gt 0 ] && echo "Adding $hash.0 to trust store" - [ $NOOP -eq 0 ] && install ${INSTALLFLAGS} -lrs $(realpath "$1") "$CERTDESTDIR/$hash.0" + certhash=$( openssl x509 -sha1 -in "$1" -noout -fingerprint ) + for blistfile in $(find $BLACKLISTDESTDIR -name "$hash.*"); do + blisthash=$( openssl x509 -sha1 -in "$blistfile" -noout -fingerprint ) + if [ "$certhash" = "$blisthash" ]; then + echo "Skipping blacklisted certificate $1 ($blistfile)" + return 1 + fi + done + suffix=$(get_decimal "$CERTDESTDIR" "$hash") + [ $VERBOSE -gt 0 ] && echo "Adding $hash.$suffix to trust store" + [ $NOOP -eq 0 ] && \ + install ${INSTALLFLAGS} -lrs $(realpath "$1") "$CERTDESTDIR/$hash.$suffix" } create_blacklisted() { local hash srcfile filename + local suffix # If it exists as a file, we'll try that; otherwise, we'll scan if [ -e "$1" ]; then hash=$( do_hash "$1" ) || return srcfile=$(realpath "$1") - filename="$hash.0" + suffix=$(get_decimal "$BLACKLISTDESTDIR" "$hash") + filename="$hash.$suffix" elif [ -e "${CERTDESTDIR}/$1" ]; then srcfile=$(realpath "${CERTDESTDIR}/$1") - filename="$1" + hash=$(echo "$1" | sed -Ee 's/\.([0-9])+$//') + suffix=$(get_decimal "$BLACKLISTDESTDIR" "$hash") + filename="$hash.$suffix" else return fi @@ -115,7 +142,7 @@ do_list() if [ -e "$1" ]; then cd "$1" - for CFILE in *.0; do + for CFILE in *.[0-9]; do if [ ! -s "$CFILE" ]; then echo "Unable to read $CFILE" >&2 ERRORS=$(( $ERRORS + 1 )) @@ -174,14 +201,20 @@ cmd_blacklist() cmd_unblacklist() { - local BFILE hash + local BFILE blisthash certhash hash shift # verb for BFILE in "$@"; do if [ -s "$BFILE" ]; then hash=$( do_hash "$BFILE" ) - echo "Removing $hash.0 from blacklist" - [ $NOOP -eq 0 ] && rm -f "$BLACKLISTDESTDIR/$hash.0" + certhash=$( openssl x509 -sha1 -in "$BFILE" -noout -fingerprint ) + for BLISTEDFILE in $(find $BLACKLISTDESTDIR -name "$hash.*"); do + blisthash=$( openssl x509 -sha1 -in "$BLISTEDFILE" -noout -fingerprint ) + if [ "$certhash" = "$blisthash" ]; then + echo "Removing $(basename "$BLISTEDFILE") from blacklist" + [ $NOOP -eq 0 ] && rm -f $BLISTEDFILE + fi + done elif [ -e "$BLACKLISTDESTDIR/$BFILE" ]; then echo "Removing $BFILE from blacklist" [ $NOOP -eq 0 ] && rm -f "$BLACKLISTDESTDIR/$BFILE" From owner-svn-src-all@freebsd.org Sun Sep 13 01:44:33 2020 Return-Path: Delivered-To: svn-src-all@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 468153E8A8C; Sun, 13 Sep 2020 01:44:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Bpsjs14pdz4mM4; Sun, 13 Sep 2020 01:44:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 089331E56E; Sun, 13 Sep 2020 01:44:33 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08D1iWAX018549; Sun, 13 Sep 2020 01:44:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08D1iWxn018545; Sun, 13 Sep 2020 01:44:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009130144.08D1iWxn018545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 13 Sep 2020 01:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365682 - in stable/12: include lib/libc/gen lib/libc/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12: include lib/libc/gen lib/libc/sys X-SVN-Commit-Revision: 365682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 01:44:33 -0000 Author: kevans Date: Sun Sep 13 01:44:31 2020 New Revision: 365682 URL: https://svnweb.freebsd.org/changeset/base/365682 Log: MFC r365506 getlogin_r: fix the type of len getlogin_r is specified by POSIX to to take a size_t len, not int. Fix our version to do the same, bump the symbol version due to ABI change and provide compat. This was reported to break compilation of Ruby 2.8. Some discussion about the necessity of the ABI compat did take place in the review. While many 64-bit platforms would likely be passing it in a 64-bit register and zero-extended and thus, not notice ABI breakage, some do sign-extend (e.g. mips). PR: 247102 Modified: stable/12/include/unistd.h stable/12/lib/libc/gen/Symbol.map stable/12/lib/libc/gen/getlogin.c stable/12/lib/libc/sys/getlogin.2 Directory Properties: stable/12/ (props changed) Modified: stable/12/include/unistd.h ============================================================================== --- stable/12/include/unistd.h Sun Sep 13 01:09:22 2020 (r365681) +++ stable/12/include/unistd.h Sun Sep 13 01:44:31 2020 (r365682) @@ -399,7 +399,7 @@ int ftruncate(int, off_t); #endif #if __POSIX_VISIBLE >= 199506 -int getlogin_r(char *, int); +int getlogin_r(char *, size_t); #endif /* 1003.1-2001 */ Modified: stable/12/lib/libc/gen/Symbol.map ============================================================================== --- stable/12/lib/libc/gen/Symbol.map Sun Sep 13 01:09:22 2020 (r365681) +++ stable/12/lib/libc/gen/Symbol.map Sun Sep 13 01:44:31 2020 (r365682) @@ -156,7 +156,6 @@ FBSD_1.0 { gethostname; getloadavg; getlogin; - getlogin_r; setnetgrent; getnetgrent; endnetgrent; @@ -423,6 +422,7 @@ FBSD_1.5 { FBSD_1.6 { __sysctlbyname; + getlogin_r; memalign; scandir_b; sigandset; Modified: stable/12/lib/libc/gen/getlogin.c ============================================================================== --- stable/12/lib/libc/gen/getlogin.c Sun Sep 13 01:09:22 2020 (r365681) +++ stable/12/lib/libc/gen/getlogin.c Sun Sep 13 01:44:31 2020 (r365682) @@ -58,7 +58,7 @@ getlogin(void) } int -getlogin_r(char *logname, int namelen) +getlogin_r(char *logname, size_t namelen) { char tmpname[MAXLOGNAME]; int len; @@ -75,3 +75,13 @@ getlogin_r(char *logname, int namelen) strlcpy(logname, tmpname, len); return (0); } + +/* FreeBSD 12 and earlier compat. */ +int +__getlogin_r_fbsd12(char *logname, int namelen) +{ + if (namelen < 1) + return (ERANGE); + return (getlogin_r(logname, namelen)); +} +__sym_compat(getlogin_r, __getlogin_r_fbsd12, FBSD_1.0); Modified: stable/12/lib/libc/sys/getlogin.2 ============================================================================== --- stable/12/lib/libc/sys/getlogin.2 Sun Sep 13 01:09:22 2020 (r365681) +++ stable/12/lib/libc/sys/getlogin.2 Sun Sep 13 01:44:31 2020 (r365682) @@ -28,7 +28,7 @@ .\" @(#)getlogin.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd June 9, 1993 +.Dd September 9, 2020 .Dt GETLOGIN 2 .Os .Sh NAME @@ -44,7 +44,7 @@ .Fn getlogin void .In sys/param.h .Ft int -.Fn getlogin_r "char *name" "int len" +.Fn getlogin_r "char *name" "size_t len" .Ft int .Fn setlogin "const char *name" .Sh DESCRIPTION From owner-svn-src-all@freebsd.org Sun Sep 13 02:17:18 2020 Return-Path: Delivered-To: svn-src-all@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 7DEA33E9823; Sun, 13 Sep 2020 02:17:18 +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 4BptRf2Kslz4nn0; Sun, 13 Sep 2020 02:17:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34AFF1EBC9; Sun, 13 Sep 2020 02:17:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08D2HI4N036897; Sun, 13 Sep 2020 02:17:18 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08D2HIDF036896; Sun, 13 Sep 2020 02:17:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009130217.08D2HIDF036896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 13 Sep 2020 02:17:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365683 - releng/12.2/usr.sbin/certctl X-SVN-Group: releng X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: releng/12.2/usr.sbin/certctl X-SVN-Commit-Revision: 365683 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 02:17:18 -0000 Author: kevans Date: Sun Sep 13 02:17:17 2020 New Revision: 365683 URL: https://svnweb.freebsd.org/changeset/base/365683 Log: MFS r365681: certctl: fix hashed link generation with duplicate subjects Currently, certctl rehash will just keep clobbering .0 rather than incrementing the suffix upon encountering a duplicate. Do this, and do it for blacklisted certs as well. This also improves the situation with the blacklist to be a little less flakey, comparing cert fingerprints for all certs with a matching subject hash in the blacklist to determine if the cert we're looking at can be installed. Future work needs to completely revamp the blacklist to align more with how it's described in PR 246614. In particular, /etc/ssl/blacklisted should go away to avoid potential confusion -- OpenSSL will not read it, it's basically certctl internal. PR: 246614 Approved by: re (gjb) Modified: releng/12.2/usr.sbin/certctl/certctl.sh Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/usr.sbin/certctl/certctl.sh ============================================================================== --- releng/12.2/usr.sbin/certctl/certctl.sh Sun Sep 13 01:44:31 2020 (r365682) +++ releng/12.2/usr.sbin/certctl/certctl.sh Sun Sep 13 02:17:17 2020 (r365683) @@ -30,7 +30,7 @@ ############################################################ CONFIGURATION : ${DESTDIR:=} -: ${FILEPAT:="\.pem$|\.crt$|\.cer$|\.crl$|\.0$"} +: ${FILEPAT:="\.pem$|\.crt$|\.cer$|\.crl$"} : ${VERBOSE:=0} ############################################################ GLOBALS @@ -56,31 +56,58 @@ do_hash() fi } +get_decimal() +{ + local checkdir hash decimal + + checkdir=$1 + hash=$2 + decimal=0 + + while [ -e "$checkdir/$hash.$decimal" ]; do + decimal=$((decimal + 1)) + done + + echo ${decimal} + return 0 +} + create_trusted_link() { - local hash + local blisthash certhash hash + local suffix hash=$( do_hash "$1" ) || return - if [ -e "$BLACKLISTDESTDIR/$hash.0" ]; then - echo "Skipping blacklisted certificate $1 ($BLACKLISTDESTDIR/$hash.0)" - return 1 - fi - [ $VERBOSE -gt 0 ] && echo "Adding $hash.0 to trust store" - [ $NOOP -eq 0 ] && install ${INSTALLFLAGS} -lrs $(realpath "$1") "$CERTDESTDIR/$hash.0" + certhash=$( openssl x509 -sha1 -in "$1" -noout -fingerprint ) + for blistfile in $(find $BLACKLISTDESTDIR -name "$hash.*"); do + blisthash=$( openssl x509 -sha1 -in "$blistfile" -noout -fingerprint ) + if [ "$certhash" = "$blisthash" ]; then + echo "Skipping blacklisted certificate $1 ($blistfile)" + return 1 + fi + done + suffix=$(get_decimal "$CERTDESTDIR" "$hash") + [ $VERBOSE -gt 0 ] && echo "Adding $hash.$suffix to trust store" + [ $NOOP -eq 0 ] && \ + install ${INSTALLFLAGS} -lrs $(realpath "$1") "$CERTDESTDIR/$hash.$suffix" } create_blacklisted() { local hash srcfile filename + local suffix # If it exists as a file, we'll try that; otherwise, we'll scan if [ -e "$1" ]; then hash=$( do_hash "$1" ) || return srcfile=$(realpath "$1") - filename="$hash.0" + suffix=$(get_decimal "$BLACKLISTDESTDIR" "$hash") + filename="$hash.$suffix" elif [ -e "${CERTDESTDIR}/$1" ]; then srcfile=$(realpath "${CERTDESTDIR}/$1") - filename="$1" + hash=$(echo "$1" | sed -Ee 's/\.([0-9])+$//') + suffix=$(get_decimal "$BLACKLISTDESTDIR" "$hash") + filename="$hash.$suffix" else return fi @@ -115,7 +142,7 @@ do_list() if [ -e "$1" ]; then cd "$1" - for CFILE in *.0; do + for CFILE in *.[0-9]; do if [ ! -s "$CFILE" ]; then echo "Unable to read $CFILE" >&2 ERRORS=$(( $ERRORS + 1 )) @@ -174,14 +201,20 @@ cmd_blacklist() cmd_unblacklist() { - local BFILE hash + local BFILE blisthash certhash hash shift # verb for BFILE in "$@"; do if [ -s "$BFILE" ]; then hash=$( do_hash "$BFILE" ) - echo "Removing $hash.0 from blacklist" - [ $NOOP -eq 0 ] && rm -f "$BLACKLISTDESTDIR/$hash.0" + certhash=$( openssl x509 -sha1 -in "$BFILE" -noout -fingerprint ) + for BLISTEDFILE in $(find $BLACKLISTDESTDIR -name "$hash.*"); do + blisthash=$( openssl x509 -sha1 -in "$BLISTEDFILE" -noout -fingerprint ) + if [ "$certhash" = "$blisthash" ]; then + echo "Removing $(basename "$BLISTEDFILE") from blacklist" + [ $NOOP -eq 0 ] && rm -f $BLISTEDFILE + fi + done elif [ -e "$BLACKLISTDESTDIR/$BFILE" ]; then echo "Removing $BFILE from blacklist" [ $NOOP -eq 0 ] && rm -f "$BLACKLISTDESTDIR/$BFILE" From owner-svn-src-all@freebsd.org Sun Sep 13 02:17:59 2020 Return-Path: Delivered-To: svn-src-all@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 6ADCC3E9982; Sun, 13 Sep 2020 02:17:59 +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 4BptSR26NFz4pLC; Sun, 13 Sep 2020 02:17:59 +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 2BE4E1EB4F; Sun, 13 Sep 2020 02:17:59 +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 08D2HwHR036985; Sun, 13 Sep 2020 02:17:58 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08D2Hw97036981; Sun, 13 Sep 2020 02:17:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009130217.08D2Hw97036981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 13 Sep 2020 02:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365684 - in releng/12.2: include lib/libc/gen lib/libc/sys X-SVN-Group: releng X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in releng/12.2: include lib/libc/gen lib/libc/sys X-SVN-Commit-Revision: 365684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 02:17:59 -0000 Author: kevans Date: Sun Sep 13 02:17:57 2020 New Revision: 365684 URL: https://svnweb.freebsd.org/changeset/base/365684 Log: MFS r365682: getlogin_r: fix the type of len getlogin_r is specified by POSIX to to take a size_t len, not int. Fix our version to do the same, bump the symbol version due to ABI change and provide compat. This was reported to break compilation of Ruby 2.8. Some discussion about the necessity of the ABI compat did take place in the review. While many 64-bit platforms would likely be passing it in a 64-bit register and zero-extended and thus, not notice ABI breakage, some do sign-extend (e.g. mips). PR: 247102 Approved by: re (gjb) Modified: releng/12.2/include/unistd.h releng/12.2/lib/libc/gen/Symbol.map releng/12.2/lib/libc/gen/getlogin.c releng/12.2/lib/libc/sys/getlogin.2 Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/include/unistd.h ============================================================================== --- releng/12.2/include/unistd.h Sun Sep 13 02:17:17 2020 (r365683) +++ releng/12.2/include/unistd.h Sun Sep 13 02:17:57 2020 (r365684) @@ -399,7 +399,7 @@ int ftruncate(int, off_t); #endif #if __POSIX_VISIBLE >= 199506 -int getlogin_r(char *, int); +int getlogin_r(char *, size_t); #endif /* 1003.1-2001 */ Modified: releng/12.2/lib/libc/gen/Symbol.map ============================================================================== --- releng/12.2/lib/libc/gen/Symbol.map Sun Sep 13 02:17:17 2020 (r365683) +++ releng/12.2/lib/libc/gen/Symbol.map Sun Sep 13 02:17:57 2020 (r365684) @@ -156,7 +156,6 @@ FBSD_1.0 { gethostname; getloadavg; getlogin; - getlogin_r; setnetgrent; getnetgrent; endnetgrent; @@ -423,6 +422,7 @@ FBSD_1.5 { FBSD_1.6 { __sysctlbyname; + getlogin_r; memalign; scandir_b; sigandset; Modified: releng/12.2/lib/libc/gen/getlogin.c ============================================================================== --- releng/12.2/lib/libc/gen/getlogin.c Sun Sep 13 02:17:17 2020 (r365683) +++ releng/12.2/lib/libc/gen/getlogin.c Sun Sep 13 02:17:57 2020 (r365684) @@ -58,7 +58,7 @@ getlogin(void) } int -getlogin_r(char *logname, int namelen) +getlogin_r(char *logname, size_t namelen) { char tmpname[MAXLOGNAME]; int len; @@ -75,3 +75,13 @@ getlogin_r(char *logname, int namelen) strlcpy(logname, tmpname, len); return (0); } + +/* FreeBSD 12 and earlier compat. */ +int +__getlogin_r_fbsd12(char *logname, int namelen) +{ + if (namelen < 1) + return (ERANGE); + return (getlogin_r(logname, namelen)); +} +__sym_compat(getlogin_r, __getlogin_r_fbsd12, FBSD_1.0); Modified: releng/12.2/lib/libc/sys/getlogin.2 ============================================================================== --- releng/12.2/lib/libc/sys/getlogin.2 Sun Sep 13 02:17:17 2020 (r365683) +++ releng/12.2/lib/libc/sys/getlogin.2 Sun Sep 13 02:17:57 2020 (r365684) @@ -28,7 +28,7 @@ .\" @(#)getlogin.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd June 9, 1993 +.Dd September 9, 2020 .Dt GETLOGIN 2 .Os .Sh NAME @@ -44,7 +44,7 @@ .Fn getlogin void .In sys/param.h .Ft int -.Fn getlogin_r "char *name" "int len" +.Fn getlogin_r "char *name" "size_t len" .Ft int .Fn setlogin "const char *name" .Sh DESCRIPTION From owner-svn-src-all@freebsd.org Sun Sep 13 05:57:17 2020 Return-Path: Delivered-To: svn-src-all@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 3AF653EE089; Sun, 13 Sep 2020 05:57:17 +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 4BpzKT0mZTz3VmG; Sun, 13 Sep 2020 05:57:17 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from localhost (p4fd3acce.dip0.t-ipconnect.de [79.211.172.206]) (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 AE60A17090; Sun, 13 Sep 2020 05:57:16 +0000 (UTC) (envelope-from gbe@freebsd.org) Date: Sun, 13 Sep 2020 07:57:14 +0200 From: Gordon Bergling To: Niclas Zeising Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r365640 - in head: share/man/man5 share/man/man7 tools/build/options Message-ID: <20200913055714.GA94386@lion.0xfce3.net> References: <202009111809.08BI9nR9034084@repo.freebsd.org> <642a5e43-5c57-746b-7fb0-ae686a0fa19b@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <642a5e43-5c57-746b-7fb0-ae686a0fa19b@freebsd.org> X-Url: X-Operating-System: FreeBSD 12.2-STABLE amd64 X-Host-Uptime: 7:53AM up 1 day, 11:16, 3 users, load averages: 1.30, 0.81, 0.53 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 05:57:17 -0000 Hi Niclas, On Sat, Sep 12, 2020 at 09:13:33PM +0200, Niclas Zeising wrote: > On 2020-09-11 20:09, Gordon Bergling wrote: > > Author: gbe (doc committer) > > Date: Fri Sep 11 18:09:49 2020 > > New Revision: 365640 > > URL: https://svnweb.freebsd.org/changeset/base/365640 > > > > Log: > > Improvements for the src.conf(5) and build(7) man pages > > > > PR: 203863 (based on) > > Submitted by: Russell Haley > > Reviewed by: bcr, imp > > Approved by: imp > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D26343 > > > > Modified: > > head/share/man/man5/src.conf.5 > > head/share/man/man7/build.7 > > head/tools/build/options/makeman > > > > Modified: head/share/man/man5/src.conf.5 > > ============================================================================== > > --- head/share/man/man5/src.conf.5 Fri Sep 11 17:05:09 2020 (r365639) > > +++ head/share/man/man5/src.conf.5 Fri Sep 11 18:09:49 2020 (r365640) > > @@ -1,6 +1,6 @@ > > .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. > > As the comment above hints, this file is generated by a tool, and should > not be edited directly. This will be overwritten the next time someone > regenerates the manual page. You have to update the template in > tools/build/options/makeman and regenerate the manual from there. I did updated 'tools/build/options/makeman' with this commit. I justed commited the newly generated src.conf.5 alongside and not with a separate commit. > > .\" $FreeBSD$ > > -.Dd September 8, 2020 > > +.Dd September 11, 2020 > > .Dt SRC.CONF 5 > > .Os > > .Sh NAME > > @@ -9,7 +9,8 @@ > > .Sh DESCRIPTION > > The > > .Nm > > -file contains settings that will apply to every build involving the > > +file contains variables that control what components will be generated during > > +the build process of the > > .Fx > > source tree; see > > .Xr build 7 . > > > > Regards > -- > Niclas Zeising -- Gordon From owner-svn-src-all@freebsd.org Sun Sep 13 09:00:01 2020 Return-Path: Delivered-To: svn-src-all@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 620A43D1789; Sun, 13 Sep 2020 09:00:01 +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 4Bq3NK1l49z3dxk; Sun, 13 Sep 2020 09:00:01 +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 1EFF223574; Sun, 13 Sep 2020 09:00:01 +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 08D901iW084474; Sun, 13 Sep 2020 09:00:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08D900xt084472; Sun, 13 Sep 2020 09:00:00 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009130900.08D900xt084472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 13 Sep 2020 09:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365685 - head/usr.sbin/traceroute6 X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.sbin/traceroute6 X-SVN-Commit-Revision: 365685 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 09:00:01 -0000 Author: tuexen Date: Sun Sep 13 09:00:00 2020 New Revision: 365685 URL: https://svnweb.freebsd.org/changeset/base/365685 Log: Add a -t option to traceroute6 to control the traffic class used when sending probe packets. Reviewed by: rscheff MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D26410 Modified: head/usr.sbin/traceroute6/traceroute6.8 head/usr.sbin/traceroute6/traceroute6.c Modified: head/usr.sbin/traceroute6/traceroute6.8 ============================================================================== --- head/usr.sbin/traceroute6/traceroute6.8 Sun Sep 13 02:17:57 2020 (r365684) +++ head/usr.sbin/traceroute6/traceroute6.8 Sun Sep 13 09:00:00 2020 (r365685) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2019 +.Dd September 13, 2020 .Dt TRACEROUTE6 8 .Os .\" @@ -61,6 +61,9 @@ .Op Fl s Ar src .Ek .Bk -words +.Op Fl t Ar tclass +.Ek +.Bk -words .Op Fl w Ar waittime .Ek .Bk -words @@ -148,6 +151,13 @@ If .Ar datalen is up to 28, probe packets consist of a SHUTDOWN-ACK chunk possibly bundled with a PAD chunk. For larger probe packets, an INIT chunk is used. +.It Fl t Ar tclass +.Ar tclass +specifies the +.Em traffic class +used when sending probe packets. +The value must be a decimal integer in the range 0 to 255. +The default is 0. .It Fl T Use TCP segments for the probes. .It Fl U Modified: head/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- head/usr.sbin/traceroute6/traceroute6.c Sun Sep 13 02:17:57 2020 (r365684) +++ head/usr.sbin/traceroute6/traceroute6.c Sun Sep 13 09:00:00 2020 (r365685) @@ -346,6 +346,7 @@ static u_long max_hops = 30; static u_int16_t srcport; static u_int16_t port = 32768+666; /* start udp dest port # for probe packets */ static u_int16_t ident; +static int tclass = -1; static int options; /* socket options */ static int verbose; static int waittime = 5; /* time to wait for response (in seconds) */ @@ -364,7 +365,7 @@ main(int argc, char *argv[]) int ch, i, on = 1, seq, rcvcmsglen, error; struct addrinfo hints, *res; static u_char *rcvcmsgbuf; - u_long probe, hops, lport; + u_long probe, hops, lport, ltclass; struct hostent *hp; size_t size, minlen; uid_t uid; @@ -414,7 +415,7 @@ main(int argc, char *argv[]) seq = 0; ident = htons(getpid() & 0xffff); /* same as ping6 */ - while ((ch = getopt(argc, argv, "aA:df:g:Ilm:nNp:q:rs:STUvw:")) != -1) + while ((ch = getopt(argc, argv, "aA:df:g:Ilm:nNp:q:rs:St:TUvw:")) != -1) switch (ch) { case 'a': as_path = 1; @@ -531,6 +532,17 @@ main(int argc, char *argv[]) case 'S': useproto = IPPROTO_SCTP; break; + case 't': + ep = NULL; + errno = 0; + ltclass = strtoul(optarg, &ep, 0); + if (errno || !*optarg || *ep || ltclass > 255) { + fprintf(stderr, + "traceroute6: invalid traffic class.\n"); + exit(1); + } + tclass = (int)ltclass; + break; case 'T': useproto = IPPROTO_TCP; break; @@ -595,6 +607,13 @@ main(int argc, char *argv[]) exit(1); } + if (tclass != -1) { + if (setsockopt(sndsock, IPPROTO_IPV6, IPV6_TCLASS, &tclass, + sizeof(int)) == -1) { + perror("setsockopt(IPV6_TCLASS)"); + exit(7); + } + } if (argc < 1 || argc > 2) usage(); From owner-svn-src-all@freebsd.org Sun Sep 13 09:06:51 2020 Return-Path: Delivered-To: svn-src-all@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 2665E3D1842; Sun, 13 Sep 2020 09:06:51 +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 4Bq3XC08m5z3fLV; Sun, 13 Sep 2020 09:06:51 +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 DCB60237B4; Sun, 13 Sep 2020 09:06:50 +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 08D96obV090336; Sun, 13 Sep 2020 09:06:50 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08D96opc090335; Sun, 13 Sep 2020 09:06:50 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009130906.08D96opc090335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 13 Sep 2020 09:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365686 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 365686 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 09:06:51 -0000 Author: tuexen Date: Sun Sep 13 09:06:50 2020 New Revision: 365686 URL: https://svnweb.freebsd.org/changeset/base/365686 Log: Export the name of the congestion control. This will be used by sockstat and netstat. Reviewed by: rscheff MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D26412 Modified: head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Sun Sep 13 09:00:00 2020 (r365685) +++ head/sys/netinet/tcp_subr.c Sun Sep 13 09:06:50 2020 (r365686) @@ -3457,6 +3457,8 @@ tcp_inptoxtp(const struct inpcb *inp, struct xtcpcb *x bcopy(tp->t_fb->tfb_tcp_block_name, xt->xt_stack, TCP_FUNCTION_NAME_LEN_MAX); + bcopy(CC_ALGO(tp)->name, xt->xt_cc, + TCP_CA_NAME_MAX); #ifdef TCP_BLACKBOX (void)tcp_log_get_id(tp, xt->xt_logid); #endif Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Sun Sep 13 09:00:00 2020 (r365685) +++ head/sys/netinet/tcp_var.h Sun Sep 13 09:06:50 2020 (r365686) @@ -754,7 +754,8 @@ struct xtcpcb { struct xinpcb xt_inp; char xt_stack[TCP_FUNCTION_NAME_LEN_MAX]; /* (s) */ char xt_logid[TCP_LOG_ID_LEN]; /* (s) */ - int64_t spare64[8]; + char xt_cc[TCP_CA_NAME_MAX]; /* (s) */ + int64_t spare64[6]; int32_t t_state; /* (s,p) */ uint32_t t_flags; /* (s,p) */ int32_t t_sndzerowin; /* (s) */ From owner-svn-src-all@freebsd.org Sun Sep 13 09:12:26 2020 Return-Path: Delivered-To: svn-src-all@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 781623D1D4F; Sun, 13 Sep 2020 09:12:26 +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 4Bq3ff2Ytrz3fmv; Sun, 13 Sep 2020 09:12:26 +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 3B42B23D13; Sun, 13 Sep 2020 09:12:26 +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 08D9CQEJ096310; Sun, 13 Sep 2020 09:12:26 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08D9CPQT096309; Sun, 13 Sep 2020 09:12:25 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009130912.08D9CPQT096309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 13 Sep 2020 09:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365687 - head/usr.bin/sockstat X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.bin/sockstat X-SVN-Commit-Revision: 365687 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 09:12:26 -0000 Author: tuexen Date: Sun Sep 13 09:12:25 2020 New Revision: 365687 URL: https://svnweb.freebsd.org/changeset/base/365687 Log: Add a -C option to sockstat to display the congestion control for TCP connections. Reviewed by: rscheff MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D26413 Modified: head/usr.bin/sockstat/sockstat.1 head/usr.bin/sockstat/sockstat.c Modified: head/usr.bin/sockstat/sockstat.1 ============================================================================== --- head/usr.bin/sockstat/sockstat.1 Sun Sep 13 09:06:50 2020 (r365686) +++ head/usr.bin/sockstat/sockstat.1 Sun Sep 13 09:12:25 2020 (r365687) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 13, 2020 +.Dd September 13, 2020 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -35,7 +35,7 @@ .Nd list open sockets .Sh SYNOPSIS .Nm -.Op Fl 46cLlSsUuvw +.Op Fl 46CcLlSsUuvw .Op Fl j Ar jid .Op Fl p Ar ports .Op Fl P Ar protocols @@ -56,6 +56,9 @@ Show Show .Dv AF_INET6 (IPv6) sockets. +.It Fl C +Display the congestion control module, if applicable. +This is currently only implemented for TCP. .It Fl c Show connected sockets. .It Fl j Ar jail @@ -170,6 +173,10 @@ is specified (only for SCTP or TCP). .It Li STACK The protocol stack if .Fl S +is specified (only for TCP). +.It Li CC +The congestion control if +.Fl C is specified (only for TCP). .El .Pp Modified: head/usr.bin/sockstat/sockstat.c ============================================================================== --- head/usr.bin/sockstat/sockstat.c Sun Sep 13 09:06:50 2020 (r365686) +++ head/usr.bin/sockstat/sockstat.c Sun Sep 13 09:12:25 2020 (r365687) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); static int opt_4; /* Show IPv4 sockets */ static int opt_6; /* Show IPv6 sockets */ +static int opt_C; /* Show congestion control */ static int opt_c; /* Show connected sockets */ static int opt_j; /* Show specified jail */ static int opt_L; /* Don't show IPv4 or IPv6 loopback sockets */ @@ -118,6 +119,7 @@ struct sock { int state; const char *protoname; char stack[TCP_FUNCTION_NAME_LEN_MAX]; + char cc[TCP_CA_NAME_MAX]; struct addr *laddr; struct addr *faddr; struct sock *next; @@ -716,6 +718,7 @@ gather_inet(int proto) sock->state = xtp->t_state; memcpy(sock->stack, xtp->xt_stack, TCP_FUNCTION_NAME_LEN_MAX); + memcpy(sock->cc, xtp->xt_cc, TCP_CA_NAME_MAX); } sock->protoname = protoname; hash = (int)((uintptr_t)sock->socket % HASHSIZE); @@ -1130,12 +1133,24 @@ displaysock(struct sock *s, int pos) } offset += 13; } - if (opt_S && s->proto == IPPROTO_TCP) { - while (pos < offset) - pos += xprintf(" "); - xprintf("%.*s", TCP_FUNCTION_NAME_LEN_MAX, - s->stack); + if (opt_S) { + if (s->proto == IPPROTO_TCP) { + while (pos < offset) + pos += xprintf(" "); + pos += xprintf("%.*s", + TCP_FUNCTION_NAME_LEN_MAX, + s->stack); + } + offset += TCP_FUNCTION_NAME_LEN_MAX + 1; } + if (opt_C) { + if (s->proto == IPPROTO_TCP) { + while (pos < offset) + pos += xprintf(" "); + xprintf("%.*s", TCP_CA_NAME_MAX, s->cc); + } + offset += TCP_CA_NAME_MAX + 1; + } } if (laddr != NULL) laddr = laddr->next; @@ -1170,7 +1185,10 @@ display(void) printf(" %-12s", "CONN STATE"); } if (opt_S) - printf(" %.*s", TCP_FUNCTION_NAME_LEN_MAX, "STACK"); + printf(" %-*.*s", TCP_FUNCTION_NAME_LEN_MAX, + TCP_FUNCTION_NAME_LEN_MAX, "STACK"); + if (opt_C) + printf(" %-.*s", TCP_CA_NAME_MAX, "CC"); printf("\n"); } setpassent(1); @@ -1286,13 +1304,16 @@ main(int argc, char *argv[]) int o, i; opt_j = -1; - while ((o = getopt(argc, argv, "46cj:Llp:P:qSsUuvw")) != -1) + while ((o = getopt(argc, argv, "46Ccj:Llp:P:qSsUuvw")) != -1) switch (o) { case '4': opt_4 = 1; break; case '6': opt_6 = 1; + break; + case 'C': + opt_C = 1; break; case 'c': opt_c = 1; From owner-svn-src-all@freebsd.org Sun Sep 13 09:14:34 2020 Return-Path: Delivered-To: svn-src-all@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 0D1453D2230; Sun, 13 Sep 2020 09:14:34 +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 4Bq3j56X7mz3g3W; Sun, 13 Sep 2020 09:14:33 +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 C393D23CC2; Sun, 13 Sep 2020 09:14:33 +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 08D9EXgu096442; Sun, 13 Sep 2020 09:14:33 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08D9EXBk096436; Sun, 13 Sep 2020 09:14:33 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009130914.08D9EXBk096436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 13 Sep 2020 09:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365688 - head/usr.bin/netstat X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.bin/netstat X-SVN-Commit-Revision: 365688 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 09:14:34 -0000 Author: tuexen Date: Sun Sep 13 09:14:32 2020 New Revision: 365688 URL: https://svnweb.freebsd.org/changeset/base/365688 Log: Add a -C option to netstat to display the congestion control for TCP connections. Reviewed by: rscheff MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D26414 Modified: head/usr.bin/netstat/inet.c head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.1 head/usr.bin/netstat/netstat.h Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Sun Sep 13 09:12:25 2020 (r365687) +++ head/usr.bin/netstat/inet.c Sun Sep 13 09:14:32 2020 (r365688) @@ -341,6 +341,9 @@ protopr(u_long off, const char *name, int af1, int pro xo_emit(" {T:/%8.8s} {T:/%5.5s}", "flowid", "ftype"); } + if (Cflag) + xo_emit(" {T:/%-*.*s}", TCP_CA_NAME_MAX, + TCP_CA_NAME_MAX, "CC"); if (Pflag) xo_emit(" {T:/%s}", "Log ID"); xo_emit("\n"); @@ -514,9 +517,15 @@ protopr(u_long off, const char *name, int af1, int pro inp->inp_flowid, inp->inp_flowtype); } - if (istcp && Pflag) - xo_emit(" {:log-id/%s}", tp->xt_logid[0] == '\0' ? - "-" : tp->xt_logid); + if (istcp) { + if (Cflag) + xo_emit(" {:cc/%-*.*s}", TCP_CA_NAME_MAX, + TCP_CA_NAME_MAX, tp->xt_cc); + if (Pflag) + xo_emit(" {:log-id/%s}", + tp->xt_logid[0] == '\0' ? + "-" : tp->xt_logid); + } xo_emit("\n"); xo_close_instance("socket"); } Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Sun Sep 13 09:12:25 2020 (r365687) +++ head/usr.bin/netstat/main.c Sun Sep 13 09:14:32 2020 (r365688) @@ -205,6 +205,7 @@ int Aflag; /* show addresses of protocol control bloc int aflag; /* show all sockets (including servers) */ static int Bflag; /* show information about bpf consumers */ int bflag; /* show i/f total bytes in/out */ +int Cflag; /* show congestion control */ int dflag; /* show i/f dropped packets */ int gflag; /* show group (multicast) routing or stats */ int hflag; /* show counters in human readable format */ @@ -249,7 +250,7 @@ main(int argc, char *argv[]) if (argc < 0) exit(EXIT_FAILURE); - while ((ch = getopt(argc, argv, "46AaBbdF:f:ghI:iLlM:mN:noPp:Qq:RrSTsuWw:xz")) + while ((ch = getopt(argc, argv, "46AaBbCdF:f:ghI:iLlM:mN:noPp:Qq:RrSTsuWw:xz")) != -1) switch(ch) { case '4': @@ -277,6 +278,9 @@ main(int argc, char *argv[]) break; case 'b': bflag = 1; + break; + case 'C': + Cflag = 1; break; case 'd': dflag = 1; Modified: head/usr.bin/netstat/netstat.1 ============================================================================== --- head/usr.bin/netstat/netstat.1 Sun Sep 13 09:12:25 2020 (r365687) +++ head/usr.bin/netstat/netstat.1 Sun Sep 13 09:14:32 2020 (r365688) @@ -28,7 +28,7 @@ .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd July 21, 2020 +.Dd September 13, 2020 .Dt NETSTAT 1 .Os .Sh NAME @@ -39,7 +39,7 @@ .Bl -tag -width "netstat" .It Nm .Op Fl -libxo -.Op Fl 46AaLnPRSTWx +.Op Fl 46AaCLnPRSTWx .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system @@ -111,7 +111,7 @@ depending on the options for the information presented .It Xo .Bk -words .Nm -.Op Fl 46AaLnRSTWx +.Op Fl 46AaCLnRSTWx .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system @@ -172,6 +172,8 @@ associated with a socket; used for debugging. .It Fl a Show the state of all sockets; normally sockets used by server processes are not shown. +.It Fl C +Show the congestion control of TCP sockets. .It Fl L Show the size of the various listen queues. The first count shows the number of unaccepted connections, Modified: head/usr.bin/netstat/netstat.h ============================================================================== --- head/usr.bin/netstat/netstat.h Sun Sep 13 09:12:25 2020 (r365687) +++ head/usr.bin/netstat/netstat.h Sun Sep 13 09:14:32 2020 (r365688) @@ -41,6 +41,7 @@ extern int Aflag; /* show addresses of protocol control block */ extern int aflag; /* show all sockets (including servers) */ extern int bflag; /* show i/f total bytes in/out */ +extern int Cflag; /* show congestion control */ extern int dflag; /* show i/f dropped packets */ extern int gflag; /* show group (multicast) routing or stats */ extern int hflag; /* show counters in human readable format */ From owner-svn-src-all@freebsd.org Sun Sep 13 11:00:04 2020 Return-Path: Delivered-To: svn-src-all@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 267F73D51BE; Sun, 13 Sep 2020 11:00:04 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [176.58.89.161]) (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 4Bq62q5drwz42bY; Sun, 13 Sep 2020 11:00:03 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 4Bq62h0kMGz3mRL; Sun, 13 Sep 2020 10:59:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([IPv6:::1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [IPv6:::1]) (amavisd-new, port 10587) with ESMTPS id N6_PrQEMcQTa; Sun, 13 Sep 2020 10:59:55 +0000 (UTC) Received: from vivi.daemonic.se (vivi.daemonic.se [IPv6:2001:470:dca9:1200::4]) by mail.daemonic.se (Postfix) with ESMTPSA id 4Bq62g2MzCz3mQw; Sun, 13 Sep 2020 10:59:55 +0000 (UTC) Subject: Re: svn commit: r365640 - in head: share/man/man5 share/man/man7 tools/build/options To: Gordon Bergling Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202009111809.08BI9nR9034084@repo.freebsd.org> <642a5e43-5c57-746b-7fb0-ae686a0fa19b@freebsd.org> <20200913055714.GA94386@lion.0xfce3.net> From: Niclas Zeising Message-ID: <37b43dd0-beff-903f-2977-72f10da8eb3b@freebsd.org> Date: Sun, 13 Sep 2020 12:59:54 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200913055714.GA94386@lion.0xfce3.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Bq62q5drwz42bY X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:36236, ipnet:176.58.89.0/24, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 11:00:04 -0000 On 2020-09-13 07:57, Gordon Bergling wrote: > Hi Niclas, > > On Sat, Sep 12, 2020 at 09:13:33PM +0200, Niclas Zeising wrote: >> On 2020-09-11 20:09, Gordon Bergling wrote: >>> Author: gbe (doc committer) >>> Date: Fri Sep 11 18:09:49 2020 >>> New Revision: 365640 >>> URL: https://svnweb.freebsd.org/changeset/base/365640 >>> >>> Log: >>> Improvements for the src.conf(5) and build(7) man pages >>> >>> PR: 203863 (based on) >>> Submitted by: Russell Haley >>> Reviewed by: bcr, imp >>> Approved by: imp >>> MFC after: 1 week >>> Differential Revision: https://reviews.freebsd.org/D26343 >>> >>> Modified: >>> head/share/man/man5/src.conf.5 >>> head/share/man/man7/build.7 >>> head/tools/build/options/makeman >>> >>> Modified: head/share/man/man5/src.conf.5 >>> ============================================================================== >>> --- head/share/man/man5/src.conf.5 Fri Sep 11 17:05:09 2020 (r365639) >>> +++ head/share/man/man5/src.conf.5 Fri Sep 11 18:09:49 2020 (r365640) >>> @@ -1,6 +1,6 @@ >>> .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. >> >> As the comment above hints, this file is generated by a tool, and should >> not be edited directly. This will be overwritten the next time someone >> regenerates the manual page. You have to update the template in >> tools/build/options/makeman and regenerate the manual from there. > > I did updated 'tools/build/options/makeman' with this commit. I justed commited > the newly generated src.conf.5 alongside and not with a separate commit. Sorry about that, I should have seen it in the commit log. Regards -- Niclas Zeising From owner-svn-src-all@freebsd.org Sun Sep 13 16:28:29 2020 Return-Path: Delivered-To: svn-src-all@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 AA0AE3DF01E; Sun, 13 Sep 2020 16:28:29 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BqFKn4KFFz4MDv; Sun, 13 Sep 2020 16:28:29 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76FD58C42; Sun, 13 Sep 2020 16:28:29 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08DGSTId059538; Sun, 13 Sep 2020 16:28:29 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08DGSQYh059521; Sun, 13 Sep 2020 16:28:26 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <202009131628.08DGSQYh059521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 13 Sep 2020 16:28:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365689 - in stable/12: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris... X-SVN-Group: stable-12 X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: in stable/12: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/common/zfs sys/cddl/cont... X-SVN-Commit-Revision: 365689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 16:28:29 -0000 Author: allanjude Date: Sun Sep 13 16:28:25 2020 New Revision: 365689 URL: https://svnweb.freebsd.org/changeset/base/365689 Log: MFOpenZFS: Introduce read/write kstats per dataset The following patch introduces a few statistics on reads and writes grouped by dataset. These statistics are implemented as kstats (backed by aggregate sums for performance) and can be retrieved by using the dataset objset ID number. The motivation for this change is to provide some preliminary analytics on dataset usage/performance. Reviewed-by: Richard Elling Reviewed-by: Brian Behlendorf Reviewed by: Matthew Ahrens Signed-off-by: Serapheim Dimitropoulos openzfs/zfs@a448a2557ec4938ed6944c7766fe0b8e6e5f6456 Also contains parts of: MFOpenZFS: Connect dataset_kstats for FreeBSD Example output: kstat.zfs/mypool.dataset.objset-0x10b.nread: 150528 kstat.zfs/mypool.dataset.objset-0x10b.reads: 48 kstat.zfs/mypool.dataset.objset-0x10b.nwritten: 134217728 kstat.zfs/mypool.dataset.objset-0x10b.writes: 1024 kstat.zfs/mypool.dataset.objset-0x10b.dataset_name: mypool/datasetname Reviewed-by: Ryan Moeller Reviewed by: Sean Eric Fagan Reviewed-by: Serapheim Dimitropoulos Reviewed-by: Brian Behlendorf Signed-off-by: Allan Jude openzfs/zfs@4547fc4e071ceb1818b3a46c3035b923e06e5390 This is a direct commit to stable/12 because they do not exist in illumos upstream ZFS and needed to be heavily modified to work in stable/12 Relnotes: yes Sponsored by: Klara Inc. Added: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dataset_kstats.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dataset_kstats.h Modified: stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c stable/12/sys/cddl/compat/opensolaris/sys/kstat.h stable/12/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/12/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c stable/12/sys/cddl/contrib/opensolaris/uts/common/Makefile.files stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c stable/12/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg Modified: stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Sep 13 09:14:32 2020 (r365688) +++ stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Sep 13 16:28:25 2020 (r365689) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 16, 2019 +.Dd September 12, 2020 .Dt ZFS 8 .Os .Sh NAME @@ -635,6 +635,16 @@ property can be either .Cm yes or .Cm no . +.It Sy objsetid +A unique identifier for this dataset within the pool. Unlike the dataset's +.Sy guid +, the +.Sy objsetid +of a dataset is not transferred to other pools when the snapshot is copied +with a send/receive operation. +The +.Sy objsetid +can be reused (for a new datatset) after the dataset is deleted. .It Sy origin For cloned file systems or volumes, the snapshot from which the clone was created. See also the Modified: stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sun Sep 13 09:14:32 2020 (r365688) +++ stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sun Sep 13 16:28:25 2020 (r365689) @@ -687,6 +687,15 @@ will decrease while increases. .It Sy guid A unique identifier for the pool. +.It Sy load_guid +A unique identifier for the pool. +Unlike the +.Sy guid +property, this identifier is generated every time we load the pool (e.g. does +not persist across imports/exports) and never changes while the pool is loaded +(even if a +.Sy reguid +operation takes place). .It Sy health The current health of the pool. Health can be .Qq Sy ONLINE , Modified: stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c ============================================================================== --- stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c Sun Sep 13 09:14:32 2020 (r365688) +++ stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c Sun Sep 13 16:28:25 2020 (r365689) @@ -38,6 +38,17 @@ static MALLOC_DEFINE(M_KSTAT, "kstat_data", "Kernel st SYSCTL_ROOT_NODE(OID_AUTO, kstat, CTLFLAG_RW, 0, "Kernel statistics"); +static int +kstat_default_update(kstat_t *ksp, int rw) +{ + KASSERT(ksp != NULL, ("kstat=%p", ksp)); + + if (rw == KSTAT_WRITE) + return (EACCES); + + return (0); +} + kstat_t * kstat_create(char *module, int instance, char *name, char *class, uchar_t type, ulong_t ndata, uchar_t flags) @@ -56,6 +67,7 @@ kstat_create(char *module, int instance, char *name, c */ ksp = malloc(sizeof(*ksp), M_KSTAT, M_WAITOK); ksp->ks_ndata = ndata; + ksp->ks_update = kstat_default_update; /* * Create sysctl tree for those statistics: @@ -98,13 +110,38 @@ kstat_create(char *module, int instance, char *name, c static int kstat_sysctl(SYSCTL_HANDLER_ARGS) { - kstat_named_t *ksent = arg1; + kstat_t *ksp = arg1; + kstat_named_t *ksent = ksp->ks_data; uint64_t val; + /* Select the correct element */ + ksent += arg2; + /* Update the aggsums before reading */ + (void) ksp->ks_update(ksp, KSTAT_READ); val = ksent->value.ui64; + return sysctl_handle_64(oidp, &val, 0, req); } +static int +kstat_sysctl_string(SYSCTL_HANDLER_ARGS) +{ + kstat_t *ksp = arg1; + kstat_named_t *ksent = ksp->ks_data; + char *val; + uint32_t len = 0; + + /* Select the correct element */ + ksent += arg2; + /* Update the aggsums before reading */ + (void) ksp->ks_update(ksp, KSTAT_READ); + val = KSTAT_NAMED_STR_PTR(ksent); + len = KSTAT_NAMED_STR_BUFLEN(ksent); + val[len-1] = '\0'; + + return (sysctl_handle_string(oidp, val, len, req)); +} + void kstat_install(kstat_t *ksp) { @@ -113,11 +150,19 @@ kstat_install(kstat_t *ksp) ksent = ksp->ks_data; for (i = 0; i < ksp->ks_ndata; i++, ksent++) { + if (ksent->data_type == KSTAT_DATA_STRING) { + SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx, + SYSCTL_CHILDREN(ksp->ks_sysctl_root), + OID_AUTO, ksent->name, + CTLTYPE_STRING | CTLFLAG_RD, ksp, i, + kstat_sysctl_string, "A", ksent->desc); + continue; + } KASSERT(ksent->data_type == KSTAT_DATA_UINT64, ("data_type=%d", ksent->data_type)); SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx, SYSCTL_CHILDREN(ksp->ks_sysctl_root), OID_AUTO, ksent->name, - CTLTYPE_U64 | CTLFLAG_RD, ksent, sizeof(*ksent), + CTLTYPE_U64 | CTLFLAG_RD, ksp, i, kstat_sysctl, "QU", ksent->desc); } } Modified: stable/12/sys/cddl/compat/opensolaris/sys/kstat.h ============================================================================== --- stable/12/sys/cddl/compat/opensolaris/sys/kstat.h Sun Sep 13 09:14:32 2020 (r365688) +++ stable/12/sys/cddl/compat/opensolaris/sys/kstat.h Sun Sep 13 16:28:25 2020 (r365689) @@ -68,13 +68,24 @@ typedef struct kstat_named { #define KSTAT_DATA_UINT32 2 #define KSTAT_DATA_INT64 3 #define KSTAT_DATA_UINT64 4 +#define KSTAT_DATA_STRING 7 uchar_t data_type; #define KSTAT_DESCLEN 128 char desc[KSTAT_DESCLEN]; union { uint64_t ui64; + struct { + union { + char *ptr; /* NULL-term string */ + char __pad[8]; /* 64-bit padding */ + } addr; + uint32_t len; /* # bytes for strlen + '\0' */ + } string; } value; } kstat_named_t; + +#define KSTAT_NAMED_STR_PTR(knptr) ((knptr)->value.string.addr.ptr) +#define KSTAT_NAMED_STR_BUFLEN(knptr) ((knptr)->value.string.len) kstat_t *kstat_create(char *module, int instance, char *name, char *cls, uchar_t type, ulong_t ndata, uchar_t flags); Modified: stable/12/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Sun Sep 13 09:14:32 2020 (r365688) +++ stable/12/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Sun Sep 13 16:28:25 2020 (r365689) @@ -446,6 +446,8 @@ zfs_prop_init(void) ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "", "GUID"); zprop_register_number(ZFS_PROP_CREATETXG, "createtxg", 0, PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "", "CREATETXG"); + zprop_register_number(ZFS_PROP_OBJSETID, "objsetid", 0, + PROP_READONLY, ZFS_TYPE_DATASET, "", "OBJSETID"); /* inherit number properties */ zprop_register_number(ZFS_PROP_RECORDSIZE, "recordsize", @@ -472,8 +474,6 @@ zfs_prop_init(void) "USERACCOUNTING"); zprop_register_hidden(ZFS_PROP_UNIQUE, "unique", PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "UNIQUE"); - zprop_register_hidden(ZFS_PROP_OBJSETID, "objsetid", PROP_TYPE_NUMBER, - PROP_READONLY, ZFS_TYPE_DATASET, "OBJSETID"); zprop_register_hidden(ZFS_PROP_INCONSISTENT, "inconsistent", PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "INCONSISTENT"); zprop_register_hidden(ZFS_PROP_PREV_SNAP, "prevsnap", PROP_TYPE_STRING, Modified: stable/12/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c Sun Sep 13 09:14:32 2020 (r365688) +++ stable/12/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c Sun Sep 13 16:28:25 2020 (r365689) @@ -21,7 +21,7 @@ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012, 2017 by Delphix. All rights reserved. + * Copyright (c) 2012, 2017, 2018 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -96,6 +96,8 @@ zpool_prop_init(void) ZFS_TYPE_POOL, "", "CAP"); zprop_register_number(ZPOOL_PROP_GUID, "guid", 0, PROP_READONLY, ZFS_TYPE_POOL, "", "GUID"); + zprop_register_number(ZPOOL_PROP_LOAD_GUID, "load_guid", 0, + PROP_READONLY, ZFS_TYPE_POOL, "", "LOAD_GUID"); zprop_register_number(ZPOOL_PROP_HEALTH, "health", 0, PROP_READONLY, ZFS_TYPE_POOL, "", "HEALTH"); zprop_register_number(ZPOOL_PROP_DEDUPRATIO, "dedupratio", 0, Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/Makefile.files ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Sun Sep 13 09:14:32 2020 (r365688) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Sun Sep 13 16:28:25 2020 (r365689) @@ -71,6 +71,7 @@ ZFS_COMMON_OBJS += \ bptree.o \ bqueue.o \ cityhash.o \ + dataset_kstats.c \ dbuf.o \ dbuf_stats.o \ ddt.o \ Added: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dataset_kstats.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dataset_kstats.c Sun Sep 13 16:28:25 2020 (r365689) @@ -0,0 +1,185 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2018 by Delphix. All rights reserved. + */ + +#include +#include +#include +#include + +static dataset_kstat_values_t empty_dataset_kstats = { + { "dataset_name", KSTAT_DATA_STRING }, + { "writes", KSTAT_DATA_UINT64 }, + { "nwritten", KSTAT_DATA_UINT64 }, + { "reads", KSTAT_DATA_UINT64 }, + { "nread", KSTAT_DATA_UINT64 }, +}; + +static int +dataset_kstats_update(kstat_t *ksp, int rw) +{ + dataset_kstats_t *dk = ksp->ks_private; + ASSERT3P(dk->dk_kstats->ks_data, ==, ksp->ks_data); + + if (rw == KSTAT_WRITE) + return (EACCES); + + dataset_kstat_values_t *dkv = dk->dk_kstats->ks_data; + dkv->dkv_writes.value.ui64 = + aggsum_value(&dk->dk_aggsums.das_writes); + dkv->dkv_nwritten.value.ui64 = + aggsum_value(&dk->dk_aggsums.das_nwritten); + dkv->dkv_reads.value.ui64 = + aggsum_value(&dk->dk_aggsums.das_reads); + dkv->dkv_nread.value.ui64 = + aggsum_value(&dk->dk_aggsums.das_nread); + + return (0); +} + +void +dataset_kstats_create(dataset_kstats_t *dk, objset_t *objset) +{ + /* + * There should not be anything wrong with having kstats for + * snapshots. Since we are not sure how useful they would be + * though nor how much their memory overhead would matter in + * a filesystem with many snapshots, we skip them for now. + */ + if (dmu_objset_is_snapshot(objset)) + return; + + /* + * At the time of this writing, KSTAT_STRLEN is 255 in Linux, + * and the spa_name can theoretically be up to 256 characters. + * In reality though the spa_name can be 240 characters max + * [see origin directory name check in pool_namecheck()]. Thus, + * the naming scheme for the module name below should not cause + * any truncations. In the event that a truncation does happen + * though, due to some future change, we silently skip creating + * the kstat and log the event. + */ + char kstat_module_name[KSTAT_STRLEN]; + int n = snprintf(kstat_module_name, sizeof (kstat_module_name), + "zfs/%s", spa_name(dmu_objset_spa(objset))); + if (n < 0) { + zfs_dbgmsg("failed to create dataset kstat for objset %lld: " + " snprintf() for kstat module name returned %d", + (unsigned long long)dmu_objset_id(objset), n); + return; + } else if (n >= KSTAT_STRLEN) { + zfs_dbgmsg("failed to create dataset kstat for objset %lld: " + "kstat module name length (%d) exceeds limit (%d)", + (unsigned long long)dmu_objset_id(objset), + n, KSTAT_STRLEN); + return; + } + + char kstat_name[KSTAT_STRLEN]; + n = snprintf(kstat_name, sizeof (kstat_name), "objset-0x%llx", + (unsigned long long)dmu_objset_id(objset)); + if (n < 0) { + zfs_dbgmsg("failed to create dataset kstat for objset %lld: " + " snprintf() for kstat name returned %d", + (unsigned long long)dmu_objset_id(objset), n); + return; + } + ASSERT3U(n, <, KSTAT_STRLEN); + + kstat_t *kstat = kstat_create(kstat_module_name, 0, kstat_name, + "dataset", KSTAT_TYPE_NAMED, + sizeof (empty_dataset_kstats) / sizeof (kstat_named_t), + KSTAT_FLAG_VIRTUAL); + if (kstat == NULL) + return; + + dataset_kstat_values_t *dk_kstats = + kmem_alloc(sizeof (empty_dataset_kstats), KM_SLEEP); + bcopy(&empty_dataset_kstats, dk_kstats, + sizeof (empty_dataset_kstats)); + + char *ds_name = kmem_zalloc(ZFS_MAX_DATASET_NAME_LEN, KM_SLEEP); + dsl_dataset_name(objset->os_dsl_dataset, ds_name); + KSTAT_NAMED_STR_PTR(&dk_kstats->dkv_ds_name) = ds_name; + KSTAT_NAMED_STR_BUFLEN(&dk_kstats->dkv_ds_name) = + ZFS_MAX_DATASET_NAME_LEN; + + kstat->ks_data = dk_kstats; + kstat->ks_update = dataset_kstats_update; + kstat->ks_private = dk; + + kstat_install(kstat); + dk->dk_kstats = kstat; + + aggsum_init(&dk->dk_aggsums.das_writes, 0); + aggsum_init(&dk->dk_aggsums.das_nwritten, 0); + aggsum_init(&dk->dk_aggsums.das_reads, 0); + aggsum_init(&dk->dk_aggsums.das_nread, 0); +} + +void +dataset_kstats_destroy(dataset_kstats_t *dk) +{ + if (dk->dk_kstats == NULL) + return; + + dataset_kstat_values_t *dkv = dk->dk_kstats->ks_data; + kmem_free(KSTAT_NAMED_STR_PTR(&dkv->dkv_ds_name), + KSTAT_NAMED_STR_BUFLEN(&dkv->dkv_ds_name)); + kmem_free(dkv, sizeof (empty_dataset_kstats)); + + kstat_delete(dk->dk_kstats); + dk->dk_kstats = NULL; + + aggsum_fini(&dk->dk_aggsums.das_writes); + aggsum_fini(&dk->dk_aggsums.das_nwritten); + aggsum_fini(&dk->dk_aggsums.das_reads); + aggsum_fini(&dk->dk_aggsums.das_nread); +} + +void +dataset_kstats_update_write_kstats(dataset_kstats_t *dk, + int64_t nwritten) +{ + ASSERT3S(nwritten, >=, 0); + + if (dk->dk_kstats == NULL) + return; + + aggsum_add(&dk->dk_aggsums.das_writes, 1); + aggsum_add(&dk->dk_aggsums.das_nwritten, nwritten); +} + +void +dataset_kstats_update_read_kstats(dataset_kstats_t *dk, + int64_t nread) +{ + ASSERT3S(nread, >=, 0); + + if (dk->dk_kstats == NULL) + return; + + aggsum_add(&dk->dk_aggsums.das_reads, 1); + aggsum_add(&dk->dk_aggsums.das_nread, nread); +} Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Sep 13 09:14:32 2020 (r365688) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Sep 13 16:28:25 2020 (r365689) @@ -352,6 +352,9 @@ spa_prop_get_config(spa_t *spa, nvlist_t **nvp) else src = ZPROP_SRC_LOCAL; spa_prop_add_list(*nvp, ZPOOL_PROP_VERSION, NULL, version, src); + + spa_prop_add_list(*nvp, ZPOOL_PROP_LOAD_GUID, + NULL, spa_load_guid(spa), src); } if (pool != NULL) { Added: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dataset_kstats.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dataset_kstats.h Sun Sep 13 16:28:25 2020 (r365689) @@ -0,0 +1,59 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2018 by Delphix. All rights reserved. + */ + +#ifndef _SYS_DATASET_KSTATS_H +#define _SYS_DATASET_KSTATS_H + +#include +#include +#include + +typedef struct dataset_aggsum_stats_t { + aggsum_t das_writes; + aggsum_t das_nwritten; + aggsum_t das_reads; + aggsum_t das_nread; +} dataset_aggsum_stats_t; + +typedef struct dataset_kstat_values { + kstat_named_t dkv_ds_name; + kstat_named_t dkv_writes; + kstat_named_t dkv_nwritten; + kstat_named_t dkv_reads; + kstat_named_t dkv_nread; +} dataset_kstat_values_t; + +typedef struct dataset_kstats { + dataset_aggsum_stats_t dk_aggsums; + kstat_t *dk_kstats; +} dataset_kstats_t; + +void dataset_kstats_create(dataset_kstats_t *, objset_t *); +void dataset_kstats_destroy(dataset_kstats_t *); + +void dataset_kstats_update_write_kstats(dataset_kstats_t *, int64_t); +void dataset_kstats_update_read_kstats(dataset_kstats_t *, int64_t); + +#endif /* _SYS_DATASET_KSTATS_H */ Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Sun Sep 13 09:14:32 2020 (r365688) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Sun Sep 13 16:28:25 2020 (r365689) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018 by Delphix. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. */ @@ -27,6 +28,7 @@ #ifndef _SYS_FS_ZFS_VFSOPS_H #define _SYS_FS_ZFS_VFSOPS_H +#include #include #include #include @@ -80,6 +82,7 @@ struct zfsvfs { boolean_t z_use_namecache;/* make use of FreeBSD name cache */ uint64_t z_version; /* ZPL version */ uint64_t z_shares_dir; /* hidden shares dir */ + dataset_kstats_t z_kstat; /* fs kstats */ kmutex_t z_lock; uint64_t z_userquota_obj; uint64_t z_groupquota_obj; Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Sep 13 09:14:32 2020 (r365688) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Sep 13 16:28:25 2020 (r365689) @@ -1245,6 +1245,9 @@ zfsvfs_setup(zfsvfs_t *zfsvfs, boolean_t mounting) if (mounting) { boolean_t readonly; + ASSERT3P(zfsvfs->z_kstat.dk_kstats, ==, NULL); + dataset_kstats_create(&zfsvfs->z_kstat, zfsvfs->z_os); + /* * During replay we remove the read only flag to * allow replays to succeed. @@ -1333,6 +1336,7 @@ zfsvfs_free(zfsvfs_t *zfsvfs) rw_destroy(&zfsvfs->z_fuid_lock); for (i = 0; i != ZFS_OBJ_MTX_SZ; i++) mutex_destroy(&zfsvfs->z_hold_mtx[i]); + dataset_kstats_destroy(&zfsvfs->z_kstat); kmem_free(zfsvfs, sizeof (zfsvfs_t)); } Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Sep 13 09:14:32 2020 (r365688) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Sep 13 16:28:25 2020 (r365689) @@ -77,6 +77,7 @@ #include #include #include +#include /* * Programming rules. @@ -701,9 +702,10 @@ zfs_read(vnode_t *vp, uio_t *uio, int ioflag, cred_t * { znode_t *zp = VTOZ(vp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; - ssize_t n, nbytes; + ssize_t n, nbytes, start_resid; int error = 0; xuio_t *xuio = NULL; + int64_t nread; ZFS_ENTER(zfsvfs); ZFS_VERIFY_ZP(zp); @@ -764,6 +766,7 @@ zfs_read(vnode_t *vp, uio_t *uio, int ioflag, cred_t * ASSERT(uio->uio_loffset < zp->z_size); n = MIN(uio->uio_resid, zp->z_size - uio->uio_loffset); + start_resid = n; #ifdef illumos if ((uio->uio_extflg == UIO_XUIO) && @@ -820,6 +823,10 @@ zfs_read(vnode_t *vp, uio_t *uio, int ioflag, cred_t * n -= nbytes; } + + nread = start_resid - n; + dataset_kstats_update_read_kstats(&zfsvfs->z_kstat, nread); + out: rangelock_exit(lr); @@ -873,6 +880,7 @@ zfs_write(vnode_t *vp, uio_t *uio, int ioflag, cred_t int count = 0; sa_bulk_attr_t bulk[4]; uint64_t mtime[2], ctime[2]; + int64_t nwritten; /* * Fasttrack empty write @@ -1239,6 +1247,9 @@ zfs_write(vnode_t *vp, uio_t *uio, int ioflag, cred_t if (ioflag & (FSYNC | FDSYNC) || zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) zil_commit(zilog, zp->z_id); + + nwritten = start_resid - uio->uio_resid; + dataset_kstats_update_write_kstats(&zfsvfs->z_kstat, nwritten); ZFS_EXIT(zfsvfs); return (0); Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sun Sep 13 09:14:32 2020 (r365688) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sun Sep 13 16:28:25 2020 (r365689) @@ -96,6 +96,7 @@ #include #include #include +#include #include @@ -177,6 +178,7 @@ typedef struct zvol_state { list_t zv_extents; /* List of extents for dump */ rangelock_t zv_rangelock; dnode_t *zv_dn; /* dnode hold */ + dataset_kstats_t zv_kstat; /* zvol kstats */ #ifndef illumos int zv_state; int zv_volmode; /* Provide GEOM or cdev */ @@ -768,6 +770,10 @@ zvol_create_minor(const char *name) else zil_replay(os, zv, zvol_replay_vector); } + + ASSERT3P(zv->zv_kstat.dk_kstats, ==, NULL); + dataset_kstats_create(&zv->zv_kstat, zv->zv_objset); + dmu_objset_disown(os, FTAG); zv->zv_objset = NULL; @@ -823,6 +829,7 @@ zvol_remove_zv(zvol_state_t *zv) rangelock_fini(&zv->zv_rangelock); + dataset_kstats_destroy(&zv->zv_kstat); kmem_free(zv, sizeof (zvol_state_t)); #ifdef illumos ddi_soft_state_free(zfsdev_state, minor); @@ -1752,6 +1759,23 @@ unlock: bp->bio_completed = bp->bio_length - resid; if (bp->bio_completed < bp->bio_length && off > volsize) error = EINVAL; + + switch (bp->bio_cmd) { + case BIO_FLUSH: + break; + case BIO_READ: + dataset_kstats_update_read_kstats(&zv->zv_kstat, + bp->bio_completed); + break; + case BIO_WRITE: + dataset_kstats_update_write_kstats(&zv->zv_kstat, + bp->bio_completed); + break; + case BIO_DELETE: + break; + default: + break; + } if (sync) { sync: Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Sun Sep 13 09:14:32 2020 (r365688) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Sun Sep 13 16:28:25 2020 (r365689) @@ -148,7 +148,7 @@ typedef enum { ZFS_PROP_USERREFS, ZFS_PROP_LOGBIAS, ZFS_PROP_UNIQUE, /* not exposed to the user */ - ZFS_PROP_OBJSETID, /* not exposed to the user */ + ZFS_PROP_OBJSETID, ZFS_PROP_DEDUP, ZFS_PROP_MLSLABEL, ZFS_PROP_SYNC, @@ -220,6 +220,7 @@ typedef enum { ZPOOL_PROP_TNAME, ZPOOL_PROP_MAXDNODESIZE, ZPOOL_PROP_MULTIHOST, + ZPOOL_PROP_LOAD_GUID, ZPOOL_NUM_PROPS } zpool_prop_t; Modified: stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg ============================================================================== --- stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg Sun Sep 13 09:14:32 2020 (r365688) +++ stable/12/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg Sun Sep 13 16:28:25 2020 (r365689) @@ -35,6 +35,7 @@ typeset -a properties=( "altroot" "health" "guid" + "load_guid" "version" "bootfs" "delegation" From owner-svn-src-all@freebsd.org Sun Sep 13 16:42:50 2020 Return-Path: Delivered-To: svn-src-all@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 880123DF57F; Sun, 13 Sep 2020 16:42:50 +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 4BqFfL35Hxz4N86; Sun, 13 Sep 2020 16:42:50 +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 34D729358; Sun, 13 Sep 2020 16:42:50 +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 08DGgogs072104; Sun, 13 Sep 2020 16:42:50 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08DGgoSQ072103; Sun, 13 Sep 2020 16:42:50 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009131642.08DGgoSQ072103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Sun, 13 Sep 2020 16:42:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365690 - 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: 365690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 16:42:50 -0000 Author: bdragon Date: Sun Sep 13 16:42:49 2020 New Revision: 365690 URL: https://svnweb.freebsd.org/changeset/base/365690 Log: [PowerPC64] Implement pmap_mincore() for moea64 Implement pmap_mincore() for moea64. This will need some slight tweaks when large page support in HPT lands. Submitted by: Fernando Eckhardt Valle Reviewed by: bdragon Differential Revision: https://reviews.freebsd.org/D26314 Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sun Sep 13 16:28:25 2020 (r365689) +++ head/sys/powerpc/aim/mmu_oea64.c Sun Sep 13 16:42:49 2020 (r365690) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -72,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -315,6 +317,7 @@ static void *moea64_dump_pmap_init(unsigned blkpgs); #ifdef __powerpc64__ static void moea64_page_array_startup(long); #endif +static int moea64_mincore(pmap_t, vm_offset_t, vm_paddr_t *); static struct pmap_funcs moea64_methods = { .clear_modify = moea64_clear_modify, @@ -331,6 +334,7 @@ static struct pmap_funcs moea64_methods = { .is_referenced = moea64_is_referenced, .ts_referenced = moea64_ts_referenced, .map = moea64_map, + .mincore = moea64_mincore, .page_exists_quick = moea64_page_exists_quick, .page_init = moea64_page_init, .page_wired_mappings = moea64_page_wired_mappings, @@ -1219,6 +1223,51 @@ moea64_unwire(pmap_t pm, vm_offset_t sva, vm_offset_t pm->pm_stats.wired_count--; } PMAP_UNLOCK(pm); +} + +static int +moea64_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *pap) +{ + struct pvo_entry *pvo; + vm_paddr_t pa; + vm_page_t m; + int val; + bool managed; + + PMAP_LOCK(pmap); + + /* XXX Add support for superpages */ + pvo = moea64_pvo_find_va(pmap, addr); + if (pvo != NULL) { + pa = PVO_PADDR(pvo); + m = PHYS_TO_VM_PAGE(pa); + managed = (pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED; + val = MINCORE_INCORE; + } else { + PMAP_UNLOCK(pmap); + return (0); + } + + PMAP_UNLOCK(pmap); + + if (m == NULL) + return (0); + + if (managed) { + if (moea64_is_modified(m)) + val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; + + if (moea64_is_referenced(m)) + val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; + } + + if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != + (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) && + managed) { + *pap = pa; + } + + return (val); } /* From owner-svn-src-all@freebsd.org Sun Sep 13 16:46:04 2020 Return-Path: Delivered-To: svn-src-all@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 9C3373DFD9E; Sun, 13 Sep 2020 16:46: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 4BqFk43cLLz4NhX; Sun, 13 Sep 2020 16:46: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 5FEA18FCA; Sun, 13 Sep 2020 16:46:04 +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 08DGk4G8072351; Sun, 13 Sep 2020 16:46:04 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08DGk4YQ072350; Sun, 13 Sep 2020 16:46:04 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009131646.08DGk4YQ072350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Sun, 13 Sep 2020 16:46:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365691 - 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: 365691 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 16:46:04 -0000 Author: bdragon Date: Sun Sep 13 16:46:03 2020 New Revision: 365691 URL: https://svnweb.freebsd.org/changeset/base/365691 Log: [PowerPC] Implement pmap_mincore() for moea Do the same as previous for moea. Tested on G4. Modified: head/sys/powerpc/aim/mmu_oea.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Sun Sep 13 16:42:49 2020 (r365690) +++ head/sys/powerpc/aim/mmu_oea.c Sun Sep 13 16:46:03 2020 (r365691) @@ -114,6 +114,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -126,6 +127,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -291,6 +293,7 @@ boolean_t moea_is_prefaultable(pmap_t, vm_offset_t); boolean_t moea_is_referenced(vm_page_t); int moea_ts_referenced(vm_page_t); vm_offset_t moea_map(vm_offset_t *, vm_paddr_t, vm_paddr_t, int); +static int moea_mincore(pmap_t, vm_offset_t, vm_paddr_t *); boolean_t moea_page_exists_quick(pmap_t, vm_page_t); void moea_page_init(vm_page_t); int moea_page_wired_mappings(vm_page_t); @@ -354,7 +357,8 @@ static struct pmap_funcs moea_methods = { .qremove = moea_qremove, .release = moea_release, .remove = moea_remove, - .remove_all = moea_remove_all, + .remove_all = moea_remove_all, + .mincore = moea_mincore, .remove_write = moea_remove_write, .sync_icache = moea_sync_icache, .unwire = moea_unwire, @@ -1924,6 +1928,50 @@ moea_remove_all(vm_page_t m) } vm_page_aflag_clear(m, PGA_WRITEABLE); rw_wunlock(&pvh_global_lock); +} + +static int +moea_mincore(pmap_t pm, vm_offset_t va, vm_paddr_t *pap) +{ + struct pvo_entry *pvo; + vm_paddr_t pa; + vm_page_t m; + int val; + bool managed; + + PMAP_LOCK(pm); + + pvo = moea_pvo_find_va(pm, va & ~ADDR_POFF, NULL); + if (pvo != NULL) { + pa = PVO_PADDR(pvo); + m = PHYS_TO_VM_PAGE(pa); + managed = (pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED; + val = MINCORE_INCORE; + } else { + PMAP_UNLOCK(pm); + return (0); + } + + PMAP_UNLOCK(pm); + + if (m == NULL) + return (0); + + if (managed) { + if (moea_is_modified(m)) + val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; + + if (moea_is_referenced(m)) + val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; + } + + if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != + (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) && + managed) { + *pap = pa; + } + + return (val); } /* From owner-svn-src-all@freebsd.org Sun Sep 13 17:13:32 2020 Return-Path: Delivered-To: svn-src-all@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 C59FD3E0EF2; Sun, 13 Sep 2020 17:13:32 +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 4BqGKm4kfXz4QPG; Sun, 13 Sep 2020 17:13:32 +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 6C20E96B6; Sun, 13 Sep 2020 17:13:32 +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 08DHDW1g090786; Sun, 13 Sep 2020 17:13:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08DHDWka090785; Sun, 13 Sep 2020 17:13:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009131713.08DHDWka090785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 13 Sep 2020 17:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365692 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 365692 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 17:13:32 -0000 Author: emaste Date: Sun Sep 13 17:13:32 2020 New Revision: 365692 URL: https://svnweb.freebsd.org/changeset/base/365692 Log: Remove WITHOUT_BMAKE description The option was retired in r265423 and bmake is the only make in tree. Deleted: head/tools/build/options/WITHOUT_BMAKE From owner-svn-src-all@freebsd.org Sun Sep 13 17:36:44 2020 Return-Path: Delivered-To: svn-src-all@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 6A1333E1AE4; Sun, 13 Sep 2020 17:36:44 +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 4BqGrX1rmTz4Rhk; Sun, 13 Sep 2020 17:36:44 +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 225C89B28; Sun, 13 Sep 2020 17:36:44 +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 08DHaiXw003678; Sun, 13 Sep 2020 17:36:44 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08DHaiRY003677; Sun, 13 Sep 2020 17:36:44 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009131736.08DHaiRY003677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Sun, 13 Sep 2020 17:36:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365693 - head/sys/powerpc/include X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/include X-SVN-Commit-Revision: 365693 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 17:36:44 -0000 Author: bdragon Date: Sun Sep 13 17:36:43 2020 New Revision: 365693 URL: https://svnweb.freebsd.org/changeset/base/365693 Log: [PowerPC64LE] Adjust ELF definitions for LE. Set ELF_TARG_DATA correctly on PowerPC64LE. Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/powerpc/include/elf.h Modified: head/sys/powerpc/include/elf.h ============================================================================== --- head/sys/powerpc/include/elf.h Sun Sep 13 17:13:32 2020 (r365692) +++ head/sys/powerpc/include/elf.h Sun Sep 13 17:36:43 2020 (r365693) @@ -100,14 +100,17 @@ __ElfType(Auxinfo); #define R_PPC_EMB_COUNT (R_PPC_EMB_RELSDA - R_PPC_EMB_NADDR32 + 1) /* Define "machine" characteristics */ +#if BYTE_ORDER == LITTLE_ENDIAN +#define ELF_TARG_DATA ELFDATA2LSB +#else +#define ELF_TARG_DATA ELFDATA2MSB +#endif #if __ELF_WORD_SIZE == 64 #define ELF_TARG_CLASS ELFCLASS64 -#define ELF_TARG_DATA ELFDATA2MSB #define ELF_TARG_MACH EM_PPC64 #define ELF_TARG_VER 1 #else #define ELF_TARG_CLASS ELFCLASS32 -#define ELF_TARG_DATA ELFDATA2MSB #define ELF_TARG_MACH EM_PPC #define ELF_TARG_VER 1 #endif From owner-svn-src-all@freebsd.org Sun Sep 13 18:24:16 2020 Return-Path: Delivered-To: svn-src-all@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 2D6603E32A0; Sun, 13 Sep 2020 18:24:16 +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 4BqHvM6PkJz4V5V; Sun, 13 Sep 2020 18:24:15 +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 BA281A803; Sun, 13 Sep 2020 18:24:15 +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 08DIOFS4034425; Sun, 13 Sep 2020 18:24:15 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08DIOFbN034424; Sun, 13 Sep 2020 18:24:15 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009131824.08DIOFbN034424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Sun, 13 Sep 2020 18:24:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365694 - in head: include sys/modules X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: in head: include sys/modules X-SVN-Commit-Revision: 365694 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 18:24:16 -0000 Author: bdragon Date: Sun Sep 13 18:24:15 2020 New Revision: 365694 URL: https://svnweb.freebsd.org/changeset/base/365694 Log: [PowerPC64LE] Ensure nvram is built on powerpc64le. Fix some cases where conditionals that were trying to exclude powerpcspe were also excluding powerpc64le. Sponsored by: Tag1 Consulting, Inc. Modified: head/include/Makefile head/sys/modules/Makefile Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sun Sep 13 17:36:43 2020 (r365693) +++ head/include/Makefile Sun Sep 13 18:24:15 2020 (r365694) @@ -93,7 +93,7 @@ INCS+= iconv.h LSUBDIRS+= dev/usb .endif -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} != "powerpcspe" _dev_powermac_nvram= dev/powermac_nvram .endif Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Sep 13 17:36:43 2020 (r365693) +++ head/sys/modules/Makefile Sun Sep 13 18:24:15 2020 (r365694) @@ -784,7 +784,7 @@ _ipmi= ipmi _ixl= ixl _nvram= opal_nvram .endif -.if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc" +.if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} != "powerpcspe" # Don't build powermac_nvram for powerpcspe, it's never supported. _nvram+= powermac_nvram .endif From owner-svn-src-all@freebsd.org Sun Sep 13 19:11:46 2020 Return-Path: Delivered-To: svn-src-all@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 080BB3E4E94; Sun, 13 Sep 2020 19:11:46 +0000 (UTC) (envelope-from cperciva@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 4BqJy96Kc8z4Y34; Sun, 13 Sep 2020 19:11:45 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC9B9AEA6; Sun, 13 Sep 2020 19:11:45 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08DJBjwX065113; Sun, 13 Sep 2020 19:11:45 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08DJBjqI065112; Sun, 13 Sep 2020 19:11:45 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202009131911.08DJBjqI065112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Sun, 13 Sep 2020 19:11:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365695 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 365695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 19:11:46 -0000 Author: cperciva Date: Sun Sep 13 19:11:45 2020 New Revision: 365695 URL: https://svnweb.freebsd.org/changeset/base/365695 Log: Bump the size of EC2 AMIs up to 5 GB. The FreeBSD base system continues to expand. 4GB is now insufficient; we passed 3 GB in May 2019; we passed 2 GB in August 2017. Over half of the disk space used is in /usr/lib/debug/. Without this change, instances boot but are unusable, since the first thing which breaks when VM filesystems are too small is the "pkg install" in the VM building process. Modified: head/release/tools/ec2.conf Modified: head/release/tools/ec2.conf ============================================================================== --- head/release/tools/ec2.conf Sun Sep 13 18:24:15 2020 (r365694) +++ head/release/tools/ec2.conf Sun Sep 13 19:11:45 2020 (r365695) @@ -19,12 +19,12 @@ fi # Set to a list of third-party software to enable in rc.conf(5). export VM_RC_LIST="ec2_configinit ec2_fetchkey ec2_loghostkey firstboot_freebsd_update firstboot_pkgs ntpd dev_aws_disk" -# Build with a 3.9 GB UFS partition; the growfs rc.d script will expand +# Build with a 4.9 GB UFS partition; the growfs rc.d script will expand # the partition to fill the root disk after the EC2 instance is launched. # Note that if this is set to G, we will end up with an GB disk # image since VMSIZE is the size of the UFS partition, not the disk which # it resides within. -export VMSIZE=4000M +export VMSIZE=5000M # No swap space; the ec2_ephemeralswap rc.d script will allocate swap # space on EC2 ephemeral disks. (If they exist -- the T2 low-cost instances From owner-svn-src-all@freebsd.org Sun Sep 13 19:56:53 2020 Return-Path: Delivered-To: svn-src-all@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 C7BA63E6D3C; Sun, 13 Sep 2020 19:56:53 +0000 (UTC) (envelope-from cperciva@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 4BqKyF4vjmz3TGh; Sun, 13 Sep 2020 19:56:53 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CFD4B89E; Sun, 13 Sep 2020 19:56:53 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08DJurf7098029; Sun, 13 Sep 2020 19:56:53 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08DJur2Q098028; Sun, 13 Sep 2020 19:56:53 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202009131956.08DJur2Q098028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Sun, 13 Sep 2020 19:56:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365696 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 365696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 19:56:53 -0000 Author: cperciva Date: Sun Sep 13 19:56:53 2020 New Revision: 365696 URL: https://svnweb.freebsd.org/changeset/base/365696 Log: Spawn the DHCPv6 client in EC2 instances via rtsold. Prior to this commit, EC2 AMIs used a "dual-dhclient" tool which was launched in place of dhclient and spawned both the base system dhclient for IPv4 and the ISC dhclient from ports for IPv6. Now that rtsold supports the "M bit" (managed configuration), we can go back to having the base system dhclient spawned normally, and provide a script to rtsold which spawns the ISC dhclient from ports when rtsold decides that it is appropriate. Thanks to: bz MFC after: 1 week Sponsored by: https://www.patreon.com/cperciva Modified: head/release/tools/ec2.conf Modified: head/release/tools/ec2.conf ============================================================================== --- head/release/tools/ec2.conf Sun Sep 13 19:11:45 2020 (r365695) +++ head/release/tools/ec2.conf Sun Sep 13 19:56:53 2020 (r365696) @@ -6,7 +6,7 @@ # Packages to install into the image we're creating. This is a deliberately # minimalist set, providing only the packages necessary to bootstrap further # package installation as specified via EC2 user-data. -export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs dual-dhclient-daemon ebsnvme-id" +export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs isc-dhcp44-client ebsnvme-id" # Include the amazon-ssm-agent package in amd64 images, since some users want # to be able to use it on systems which are not connected to the Internet. @@ -63,9 +63,19 @@ vm_extra_pre_umount() { # via EC2 user-data. echo 'firstboot_pkgs_list="awscli"' >> ${DESTDIR}/etc/rc.conf - # Enable IPv6 on all interfaces, and use DHCP on both IPv4 and IPv6. + # Enable IPv6 on all interfaces, and spawn DHCPv6 via rtsold echo 'ipv6_activate_all_interfaces="YES"' >> ${DESTDIR}/etc/rc.conf - echo 'dhclient_program="/usr/local/sbin/dual-dhclient"' >> ${DESTDIR}/etc/rc.conf + echo 'rtsold_enable="YES"' >> ${DESTDIR}/etc/rc.conf + echo 'rtsold_flags="-M /usr/local/libexec/rtsold-M -a"' >> ${DESTDIR}/etc/rc.conf + + # Provide a script which rtsold can use to launch DHCPv6 + mkdir -p ${DESTDIR}/usr/local/libexec + cat > ${DESTDIR}/usr/local/libexec/rtsold-M <<'EOF' +#!/bin/sh + +/usr/local/sbin/dhclient -6 -nw -N -cf /dev/null $1 +EOF + chmod 755 ${DESTDIR}/usr/local/libexec/rtsold-M # The EC2 console is output-only, so while printing a backtrace can # be useful, there's no point dropping into a debugger or waiting From owner-svn-src-all@freebsd.org Sun Sep 13 21:22:40 2020 Return-Path: Delivered-To: svn-src-all@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 2B2D93E97DF; Sun, 13 Sep 2020 21:22:40 +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 4BqMsC6QQmz3Z4q; Sun, 13 Sep 2020 21:22:39 +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 BFC0FC7A4; Sun, 13 Sep 2020 21:22:39 +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 08DLMdCQ052966; Sun, 13 Sep 2020 21:22:39 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08DLMdRc052965; Sun, 13 Sep 2020 21:22:39 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009132122.08DLMdRc052965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Sun, 13 Sep 2020 21:22:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365697 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 365697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 21:22:40 -0000 Author: bdragon Date: Sun Sep 13 21:22:39 2020 New Revision: 365697 URL: https://svnweb.freebsd.org/changeset/base/365697 Log: [PowerPC64LE] Bus space prep for LE Swap the BE and LE bus_space tags when on LE, and adjust the nexus tag to match. This is prep for a a followup that makes the powerpc bus_space macros easier to maintain in the future. Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/powerpc/powerpc/bus_machdep.c head/sys/powerpc/powerpc/nexus.c Modified: head/sys/powerpc/powerpc/bus_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/bus_machdep.c Sun Sep 13 19:56:53 2020 (r365696) +++ head/sys/powerpc/powerpc/bus_machdep.c Sun Sep 13 21:22:39 2020 (r365697) @@ -790,7 +790,11 @@ bs_le_sr_8(bus_space_handle_t bsh, bus_size_t ofs, uin TODO; } +#if BYTE_ORDER == LITTLE_ENDIAN +struct bus_space bs_le_tag = { +#else struct bus_space bs_be_tag = { +#endif /* mapping/unmapping */ bs_gen_map, bs_gen_unmap, @@ -884,7 +888,11 @@ struct bus_space bs_be_tag = { bs_be_sr_8, }; +#if BYTE_ORDER == LITTLE_ENDIAN +struct bus_space bs_be_tag = { +#else struct bus_space bs_le_tag = { +#endif /* mapping/unmapping */ bs_gen_map, bs_gen_unmap, Modified: head/sys/powerpc/powerpc/nexus.c ============================================================================== --- head/sys/powerpc/powerpc/nexus.c Sun Sep 13 19:56:53 2020 (r365696) +++ head/sys/powerpc/powerpc/nexus.c Sun Sep 13 21:22:39 2020 (r365697) @@ -35,6 +35,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -173,7 +174,11 @@ static bus_space_tag_t nexus_get_bus_tag(device_t bus __unused, device_t child __unused) { +#if BYTE_ORDER == LITTLE_ENDIAN + return(&bs_le_tag); +#else return(&bs_be_tag); +#endif } static int From owner-svn-src-all@freebsd.org Sun Sep 13 21:27:30 2020 Return-Path: Delivered-To: svn-src-all@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 CE0D13E9969; Sun, 13 Sep 2020 21:27:30 +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 4BqMyp5RYvz3ZS2; Sun, 13 Sep 2020 21:27:30 +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 9D740C920; Sun, 13 Sep 2020 21:27:30 +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 08DLRUi7053214; Sun, 13 Sep 2020 21:27:30 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08DLRU18053213; Sun, 13 Sep 2020 21:27:30 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009132127.08DLRU18053213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Sun, 13 Sep 2020 21:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365698 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 365698 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 21:27:30 -0000 Author: bdragon Date: Sun Sep 13 21:27:30 2020 New Revision: 365698 URL: https://svnweb.freebsd.org/changeset/base/365698 Log: [PowerPC] bus_space cleanup part 1 - rename bs_be / bs_le functions The intention of the bus_be naming was for those to be the no-endian-swapping and for the bus_le to be endian-swapping in all the functions. This naming breaks down when we're actually are running in LE and need to use the opposite sense. As such, rename bs_be_* to native_bs_* and rename bs_le_* to swapped_bs_*. No functional change. Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/powerpc/powerpc/bus_machdep.c Modified: head/sys/powerpc/powerpc/bus_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/bus_machdep.c Sun Sep 13 21:22:39 2020 (r365697) +++ head/sys/powerpc/powerpc/bus_machdep.c Sun Sep 13 21:27:30 2020 (r365698) @@ -178,10 +178,10 @@ bs_gen_barrier(bus_space_handle_t bsh __unused, bus_si } /* - * Big-endian access functions + * Native-endian access functions */ static uint8_t -bs_be_rs_1(bus_space_handle_t bsh, bus_size_t ofs) +native_bs_rs_1(bus_space_handle_t bsh, bus_size_t ofs) { volatile uint8_t *addr; uint8_t res; @@ -194,7 +194,7 @@ bs_be_rs_1(bus_space_handle_t bsh, bus_size_t ofs) } static uint16_t -bs_be_rs_2(bus_space_handle_t bsh, bus_size_t ofs) +native_bs_rs_2(bus_space_handle_t bsh, bus_size_t ofs) { volatile uint16_t *addr; uint16_t res; @@ -207,7 +207,7 @@ bs_be_rs_2(bus_space_handle_t bsh, bus_size_t ofs) } static uint32_t -bs_be_rs_4(bus_space_handle_t bsh, bus_size_t ofs) +native_bs_rs_4(bus_space_handle_t bsh, bus_size_t ofs) { volatile uint32_t *addr; uint32_t res; @@ -220,7 +220,7 @@ bs_be_rs_4(bus_space_handle_t bsh, bus_size_t ofs) } static uint64_t -bs_be_rs_8(bus_space_handle_t bsh, bus_size_t ofs) +native_bs_rs_8(bus_space_handle_t bsh, bus_size_t ofs) { volatile uint64_t *addr; uint64_t res; @@ -232,31 +232,31 @@ bs_be_rs_8(bus_space_handle_t bsh, bus_size_t ofs) } static void -bs_be_rm_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t *addr, size_t cnt) +native_bs_rm_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t *addr, size_t cnt) { ins8(__ppc_ba(bsh, ofs), addr, cnt); } static void -bs_be_rm_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t *addr, size_t cnt) +native_bs_rm_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t *addr, size_t cnt) { ins16(__ppc_ba(bsh, ofs), addr, cnt); } static void -bs_be_rm_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t *addr, size_t cnt) +native_bs_rm_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t *addr, size_t cnt) { ins32(__ppc_ba(bsh, ofs), addr, cnt); } static void -bs_be_rm_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t *addr, size_t cnt) +native_bs_rm_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t *addr, size_t cnt) { ins64(__ppc_ba(bsh, ofs), addr, cnt); } static void -bs_be_rr_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t *addr, size_t cnt) +native_bs_rr_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t *addr, size_t cnt) { volatile uint8_t *s = __ppc_ba(bsh, ofs); @@ -266,7 +266,7 @@ bs_be_rr_1(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_rr_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t *addr, size_t cnt) +native_bs_rr_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t *addr, size_t cnt) { volatile uint16_t *s = __ppc_ba(bsh, ofs); @@ -276,7 +276,7 @@ bs_be_rr_2(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_rr_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t *addr, size_t cnt) +native_bs_rr_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t *addr, size_t cnt) { volatile uint32_t *s = __ppc_ba(bsh, ofs); @@ -286,7 +286,7 @@ bs_be_rr_4(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_rr_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t *addr, size_t cnt) +native_bs_rr_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t *addr, size_t cnt) { volatile uint64_t *s = __ppc_ba(bsh, ofs); @@ -296,7 +296,7 @@ bs_be_rr_8(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_ws_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t val) +native_bs_ws_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t val) { volatile uint8_t *addr; @@ -307,7 +307,7 @@ bs_be_ws_1(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_ws_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t val) +native_bs_ws_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t val) { volatile uint16_t *addr; @@ -318,7 +318,7 @@ bs_be_ws_2(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_ws_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t val) +native_bs_ws_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t val) { volatile uint32_t *addr; @@ -329,7 +329,7 @@ bs_be_ws_4(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_ws_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t val) +native_bs_ws_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t val) { volatile uint64_t *addr; @@ -340,35 +340,35 @@ bs_be_ws_8(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_wm_1(bus_space_handle_t bsh, bus_size_t ofs, const uint8_t *addr, +native_bs_wm_1(bus_space_handle_t bsh, bus_size_t ofs, const uint8_t *addr, bus_size_t cnt) { outsb(__ppc_ba(bsh, ofs), addr, cnt); } static void -bs_be_wm_2(bus_space_handle_t bsh, bus_size_t ofs, const uint16_t *addr, +native_bs_wm_2(bus_space_handle_t bsh, bus_size_t ofs, const uint16_t *addr, bus_size_t cnt) { outsw(__ppc_ba(bsh, ofs), addr, cnt); } static void -bs_be_wm_4(bus_space_handle_t bsh, bus_size_t ofs, const uint32_t *addr, +native_bs_wm_4(bus_space_handle_t bsh, bus_size_t ofs, const uint32_t *addr, bus_size_t cnt) { outsl(__ppc_ba(bsh, ofs), addr, cnt); } static void -bs_be_wm_8(bus_space_handle_t bsh, bus_size_t ofs, const uint64_t *addr, +native_bs_wm_8(bus_space_handle_t bsh, bus_size_t ofs, const uint64_t *addr, bus_size_t cnt) { outsll(__ppc_ba(bsh, ofs), addr, cnt); } static void -bs_be_wr_1(bus_space_handle_t bsh, bus_size_t ofs, const uint8_t *addr, +native_bs_wr_1(bus_space_handle_t bsh, bus_size_t ofs, const uint8_t *addr, size_t cnt) { volatile uint8_t *d = __ppc_ba(bsh, ofs); @@ -379,7 +379,7 @@ bs_be_wr_1(bus_space_handle_t bsh, bus_size_t ofs, con } static void -bs_be_wr_2(bus_space_handle_t bsh, bus_size_t ofs, const uint16_t *addr, +native_bs_wr_2(bus_space_handle_t bsh, bus_size_t ofs, const uint16_t *addr, size_t cnt) { volatile uint16_t *d = __ppc_ba(bsh, ofs); @@ -390,7 +390,7 @@ bs_be_wr_2(bus_space_handle_t bsh, bus_size_t ofs, con } static void -bs_be_wr_4(bus_space_handle_t bsh, bus_size_t ofs, const uint32_t *addr, +native_bs_wr_4(bus_space_handle_t bsh, bus_size_t ofs, const uint32_t *addr, size_t cnt) { volatile uint32_t *d = __ppc_ba(bsh, ofs); @@ -401,7 +401,7 @@ bs_be_wr_4(bus_space_handle_t bsh, bus_size_t ofs, con } static void -bs_be_wr_8(bus_space_handle_t bsh, bus_size_t ofs, const uint64_t *addr, +native_bs_wr_8(bus_space_handle_t bsh, bus_size_t ofs, const uint64_t *addr, size_t cnt) { volatile uint64_t *d = __ppc_ba(bsh, ofs); @@ -412,7 +412,7 @@ bs_be_wr_8(bus_space_handle_t bsh, bus_size_t ofs, con } static void -bs_be_sm_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t val, size_t cnt) +native_bs_sm_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t val, size_t cnt) { volatile uint8_t *d = __ppc_ba(bsh, ofs); @@ -422,7 +422,7 @@ bs_be_sm_1(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_sm_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t val, size_t cnt) +native_bs_sm_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t val, size_t cnt) { volatile uint16_t *d = __ppc_ba(bsh, ofs); @@ -432,7 +432,7 @@ bs_be_sm_2(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_sm_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t val, size_t cnt) +native_bs_sm_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t val, size_t cnt) { volatile uint32_t *d = __ppc_ba(bsh, ofs); @@ -442,7 +442,7 @@ bs_be_sm_4(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_sm_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t val, size_t cnt) +native_bs_sm_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t val, size_t cnt) { volatile uint64_t *d = __ppc_ba(bsh, ofs); @@ -452,7 +452,7 @@ bs_be_sm_8(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_sr_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t val, size_t cnt) +native_bs_sr_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t val, size_t cnt) { volatile uint8_t *d = __ppc_ba(bsh, ofs); @@ -462,7 +462,7 @@ bs_be_sr_1(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_sr_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t val, size_t cnt) +native_bs_sr_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t val, size_t cnt) { volatile uint16_t *d = __ppc_ba(bsh, ofs); @@ -472,7 +472,7 @@ bs_be_sr_2(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_sr_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t val, size_t cnt) +native_bs_sr_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t val, size_t cnt) { volatile uint32_t *d = __ppc_ba(bsh, ofs); @@ -482,7 +482,7 @@ bs_be_sr_4(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_be_sr_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t val, size_t cnt) +native_bs_sr_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t val, size_t cnt) { volatile uint64_t *d = __ppc_ba(bsh, ofs); @@ -492,10 +492,10 @@ bs_be_sr_8(bus_space_handle_t bsh, bus_size_t ofs, uin } /* - * Little-endian access functions + * Byteswapped access functions */ static uint8_t -bs_le_rs_1(bus_space_handle_t bsh, bus_size_t ofs) +swapped_bs_rs_1(bus_space_handle_t bsh, bus_size_t ofs) { volatile uint8_t *addr; uint8_t res; @@ -508,7 +508,7 @@ bs_le_rs_1(bus_space_handle_t bsh, bus_size_t ofs) } static uint16_t -bs_le_rs_2(bus_space_handle_t bsh, bus_size_t ofs) +swapped_bs_rs_2(bus_space_handle_t bsh, bus_size_t ofs) { volatile uint16_t *addr; uint16_t res; @@ -521,7 +521,7 @@ bs_le_rs_2(bus_space_handle_t bsh, bus_size_t ofs) } static uint32_t -bs_le_rs_4(bus_space_handle_t bsh, bus_size_t ofs) +swapped_bs_rs_4(bus_space_handle_t bsh, bus_size_t ofs) { volatile uint32_t *addr; uint32_t res; @@ -534,7 +534,7 @@ bs_le_rs_4(bus_space_handle_t bsh, bus_size_t ofs) } static uint64_t -bs_le_rs_8(bus_space_handle_t bsh, bus_size_t ofs) +swapped_bs_rs_8(bus_space_handle_t bsh, bus_size_t ofs) { volatile uint64_t *addr; uint64_t res; @@ -547,31 +547,31 @@ bs_le_rs_8(bus_space_handle_t bsh, bus_size_t ofs) } static void -bs_le_rm_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t *addr, size_t cnt) +swapped_bs_rm_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t *addr, size_t cnt) { ins8(__ppc_ba(bsh, ofs), addr, cnt); } static void -bs_le_rm_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t *addr, size_t cnt) +swapped_bs_rm_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t *addr, size_t cnt) { ins16rb(__ppc_ba(bsh, ofs), addr, cnt); } static void -bs_le_rm_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t *addr, size_t cnt) +swapped_bs_rm_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t *addr, size_t cnt) { ins32rb(__ppc_ba(bsh, ofs), addr, cnt); } static void -bs_le_rm_8(bus_space_handle_t bshh, bus_size_t ofs, uint64_t *addr, size_t cnt) +swapped_bs_rm_8(bus_space_handle_t bshh, bus_size_t ofs, uint64_t *addr, size_t cnt) { TODO; } static void -bs_le_rr_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t *addr, size_t cnt) +swapped_bs_rr_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t *addr, size_t cnt) { volatile uint8_t *s = __ppc_ba(bsh, ofs); @@ -581,7 +581,7 @@ bs_le_rr_1(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_le_rr_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t *addr, size_t cnt) +swapped_bs_rr_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t *addr, size_t cnt) { volatile uint16_t *s = __ppc_ba(bsh, ofs); @@ -591,7 +591,7 @@ bs_le_rr_2(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_le_rr_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t *addr, size_t cnt) +swapped_bs_rr_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t *addr, size_t cnt) { volatile uint32_t *s = __ppc_ba(bsh, ofs); @@ -601,13 +601,13 @@ bs_le_rr_4(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_le_rr_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t *addr, size_t cnt) +swapped_bs_rr_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t *addr, size_t cnt) { TODO; } static void -bs_le_ws_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t val) +swapped_bs_ws_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t val) { volatile uint8_t *addr; @@ -618,7 +618,7 @@ bs_le_ws_1(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_le_ws_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t val) +swapped_bs_ws_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t val) { volatile uint16_t *addr; @@ -629,7 +629,7 @@ bs_le_ws_2(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_le_ws_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t val) +swapped_bs_ws_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t val) { volatile uint32_t *addr; @@ -640,7 +640,7 @@ bs_le_ws_4(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_le_ws_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t val) +swapped_bs_ws_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t val) { volatile uint64_t *addr; @@ -651,35 +651,35 @@ bs_le_ws_8(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_le_wm_1(bus_space_handle_t bsh, bus_size_t ofs, const uint8_t *addr, +swapped_bs_wm_1(bus_space_handle_t bsh, bus_size_t ofs, const uint8_t *addr, bus_size_t cnt) { outs8(__ppc_ba(bsh, ofs), addr, cnt); } static void -bs_le_wm_2(bus_space_handle_t bsh, bus_size_t ofs, const uint16_t *addr, +swapped_bs_wm_2(bus_space_handle_t bsh, bus_size_t ofs, const uint16_t *addr, bus_size_t cnt) { outs16rb(__ppc_ba(bsh, ofs), addr, cnt); } static void -bs_le_wm_4(bus_space_handle_t bsh, bus_size_t ofs, const uint32_t *addr, +swapped_bs_wm_4(bus_space_handle_t bsh, bus_size_t ofs, const uint32_t *addr, bus_size_t cnt) { outs32rb(__ppc_ba(bsh, ofs), addr, cnt); } static void -bs_le_wm_8(bus_space_handle_t bsh, bus_size_t ofs, const uint64_t *addr, +swapped_bs_wm_8(bus_space_handle_t bsh, bus_size_t ofs, const uint64_t *addr, bus_size_t cnt) { TODO; } static void -bs_le_wr_1(bus_space_handle_t bsh, bus_size_t ofs, const uint8_t *addr, +swapped_bs_wr_1(bus_space_handle_t bsh, bus_size_t ofs, const uint8_t *addr, size_t cnt) { volatile uint8_t *d = __ppc_ba(bsh, ofs); @@ -690,7 +690,7 @@ bs_le_wr_1(bus_space_handle_t bsh, bus_size_t ofs, con } static void -bs_le_wr_2(bus_space_handle_t bsh, bus_size_t ofs, const uint16_t *addr, +swapped_bs_wr_2(bus_space_handle_t bsh, bus_size_t ofs, const uint16_t *addr, size_t cnt) { volatile uint16_t *d = __ppc_ba(bsh, ofs); @@ -701,7 +701,7 @@ bs_le_wr_2(bus_space_handle_t bsh, bus_size_t ofs, con } static void -bs_le_wr_4(bus_space_handle_t bsh, bus_size_t ofs, const uint32_t *addr, +swapped_bs_wr_4(bus_space_handle_t bsh, bus_size_t ofs, const uint32_t *addr, size_t cnt) { volatile uint32_t *d = __ppc_ba(bsh, ofs); @@ -712,14 +712,14 @@ bs_le_wr_4(bus_space_handle_t bsh, bus_size_t ofs, con } static void -bs_le_wr_8(bus_space_handle_t bsh, bus_size_t ofs, const uint64_t *addr, +swapped_bs_wr_8(bus_space_handle_t bsh, bus_size_t ofs, const uint64_t *addr, size_t cnt) { TODO; } static void -bs_le_sm_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t val, size_t cnt) +swapped_bs_sm_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t val, size_t cnt) { volatile uint8_t *d = __ppc_ba(bsh, ofs); @@ -729,7 +729,7 @@ bs_le_sm_1(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_le_sm_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t val, size_t cnt) +swapped_bs_sm_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t val, size_t cnt) { volatile uint16_t *d = __ppc_ba(bsh, ofs); @@ -739,7 +739,7 @@ bs_le_sm_2(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_le_sm_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t val, size_t cnt) +swapped_bs_sm_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t val, size_t cnt) { volatile uint32_t *d = __ppc_ba(bsh, ofs); @@ -749,13 +749,13 @@ bs_le_sm_4(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_le_sm_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t val, size_t cnt) +swapped_bs_sm_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t val, size_t cnt) { TODO; } static void -bs_le_sr_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t val, size_t cnt) +swapped_bs_sr_1(bus_space_handle_t bsh, bus_size_t ofs, uint8_t val, size_t cnt) { volatile uint8_t *d = __ppc_ba(bsh, ofs); @@ -765,7 +765,7 @@ bs_le_sr_1(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_le_sr_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t val, size_t cnt) +swapped_bs_sr_2(bus_space_handle_t bsh, bus_size_t ofs, uint16_t val, size_t cnt) { volatile uint16_t *d = __ppc_ba(bsh, ofs); @@ -775,7 +775,7 @@ bs_le_sr_2(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_le_sr_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t val, size_t cnt) +swapped_bs_sr_4(bus_space_handle_t bsh, bus_size_t ofs, uint32_t val, size_t cnt) { volatile uint32_t *d = __ppc_ba(bsh, ofs); @@ -785,7 +785,7 @@ bs_le_sr_4(bus_space_handle_t bsh, bus_size_t ofs, uin } static void -bs_le_sr_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t val, size_t cnt) +swapped_bs_sr_8(bus_space_handle_t bsh, bus_size_t ofs, uint64_t val, size_t cnt) { TODO; } @@ -808,84 +808,84 @@ struct bus_space bs_be_tag = { bs_gen_barrier, /* read (single) */ - bs_be_rs_1, - bs_be_rs_2, - bs_be_rs_4, - bs_be_rs_8, + native_bs_rs_1, + native_bs_rs_2, + native_bs_rs_4, + native_bs_rs_8, - bs_be_rs_2, - bs_be_rs_4, - bs_be_rs_8, + native_bs_rs_2, + native_bs_rs_4, + native_bs_rs_8, /* read multiple */ - bs_be_rm_1, - bs_be_rm_2, - bs_be_rm_4, - bs_be_rm_8, + native_bs_rm_1, + native_bs_rm_2, + native_bs_rm_4, + native_bs_rm_8, - bs_be_rm_2, - bs_be_rm_4, - bs_be_rm_8, + native_bs_rm_2, + native_bs_rm_4, + native_bs_rm_8, /* read region */ - bs_be_rr_1, - bs_be_rr_2, - bs_be_rr_4, - bs_be_rr_8, + native_bs_rr_1, + native_bs_rr_2, + native_bs_rr_4, + native_bs_rr_8, - bs_be_rr_2, - bs_be_rr_4, - bs_be_rr_8, + native_bs_rr_2, + native_bs_rr_4, + native_bs_rr_8, /* write (single) */ - bs_be_ws_1, - bs_be_ws_2, - bs_be_ws_4, - bs_be_ws_8, + native_bs_ws_1, + native_bs_ws_2, + native_bs_ws_4, + native_bs_ws_8, - bs_be_ws_2, - bs_be_ws_4, - bs_be_ws_8, + native_bs_ws_2, + native_bs_ws_4, + native_bs_ws_8, /* write multiple */ - bs_be_wm_1, - bs_be_wm_2, - bs_be_wm_4, - bs_be_wm_8, + native_bs_wm_1, + native_bs_wm_2, + native_bs_wm_4, + native_bs_wm_8, - bs_be_wm_2, - bs_be_wm_4, - bs_be_wm_8, + native_bs_wm_2, + native_bs_wm_4, + native_bs_wm_8, /* write region */ - bs_be_wr_1, - bs_be_wr_2, - bs_be_wr_4, - bs_be_wr_8, + native_bs_wr_1, + native_bs_wr_2, + native_bs_wr_4, + native_bs_wr_8, - bs_be_wr_2, - bs_be_wr_4, - bs_be_wr_8, + native_bs_wr_2, + native_bs_wr_4, + native_bs_wr_8, /* set multiple */ - bs_be_sm_1, - bs_be_sm_2, - bs_be_sm_4, - bs_be_sm_8, + native_bs_sm_1, + native_bs_sm_2, + native_bs_sm_4, + native_bs_sm_8, - bs_be_sm_2, - bs_be_sm_4, - bs_be_sm_8, + native_bs_sm_2, + native_bs_sm_4, + native_bs_sm_8, /* set region */ - bs_be_sr_1, - bs_be_sr_2, - bs_be_sr_4, - bs_be_sr_8, + native_bs_sr_1, + native_bs_sr_2, + native_bs_sr_4, + native_bs_sr_8, - bs_be_sr_2, - bs_be_sr_4, - bs_be_sr_8, + native_bs_sr_2, + native_bs_sr_4, + native_bs_sr_8, }; #if BYTE_ORDER == LITTLE_ENDIAN @@ -906,82 +906,82 @@ struct bus_space bs_le_tag = { bs_gen_barrier, /* read (single) */ - bs_le_rs_1, - bs_le_rs_2, - bs_le_rs_4, - bs_le_rs_8, + swapped_bs_rs_1, + swapped_bs_rs_2, + swapped_bs_rs_4, + swapped_bs_rs_8, - bs_be_rs_2, - bs_be_rs_4, - bs_be_rs_8, + native_bs_rs_2, + native_bs_rs_4, + native_bs_rs_8, /* read multiple */ - bs_le_rm_1, - bs_le_rm_2, - bs_le_rm_4, - bs_le_rm_8, + swapped_bs_rm_1, + swapped_bs_rm_2, + swapped_bs_rm_4, + swapped_bs_rm_8, - bs_be_rm_2, - bs_be_rm_4, - bs_be_rm_8, + native_bs_rm_2, + native_bs_rm_4, + native_bs_rm_8, /* read region */ - bs_le_rr_1, - bs_le_rr_2, - bs_le_rr_4, - bs_le_rr_8, + swapped_bs_rr_1, + swapped_bs_rr_2, + swapped_bs_rr_4, + swapped_bs_rr_8, - bs_be_rr_2, - bs_be_rr_4, - bs_be_rr_8, + native_bs_rr_2, + native_bs_rr_4, + native_bs_rr_8, /* write (single) */ - bs_le_ws_1, - bs_le_ws_2, - bs_le_ws_4, - bs_le_ws_8, + swapped_bs_ws_1, + swapped_bs_ws_2, + swapped_bs_ws_4, + swapped_bs_ws_8, - bs_be_ws_2, - bs_be_ws_4, - bs_be_ws_8, + native_bs_ws_2, + native_bs_ws_4, + native_bs_ws_8, /* write multiple */ - bs_le_wm_1, - bs_le_wm_2, - bs_le_wm_4, - bs_le_wm_8, + swapped_bs_wm_1, + swapped_bs_wm_2, + swapped_bs_wm_4, + swapped_bs_wm_8, - bs_be_wm_2, - bs_be_wm_4, - bs_be_wm_8, + native_bs_wm_2, + native_bs_wm_4, + native_bs_wm_8, /* write region */ - bs_le_wr_1, - bs_le_wr_2, - bs_le_wr_4, - bs_le_wr_8, + swapped_bs_wr_1, + swapped_bs_wr_2, + swapped_bs_wr_4, + swapped_bs_wr_8, - bs_be_wr_2, - bs_be_wr_4, - bs_be_wr_8, + native_bs_wr_2, + native_bs_wr_4, + native_bs_wr_8, /* set multiple */ - bs_le_sm_1, - bs_le_sm_2, - bs_le_sm_4, - bs_le_sm_8, + swapped_bs_sm_1, + swapped_bs_sm_2, + swapped_bs_sm_4, + swapped_bs_sm_8, - bs_be_sm_2, - bs_be_sm_4, - bs_be_sm_8, + native_bs_sm_2, + native_bs_sm_4, + native_bs_sm_8, /* set region */ - bs_le_sr_1, - bs_le_sr_2, - bs_le_sr_4, - bs_le_sr_8, + swapped_bs_sr_1, + swapped_bs_sr_2, + swapped_bs_sr_4, + swapped_bs_sr_8, - bs_be_sr_2, - bs_be_sr_4, - bs_be_sr_8, + native_bs_sr_2, + native_bs_sr_4, + native_bs_sr_8, }; From owner-svn-src-all@freebsd.org Sun Sep 13 21:34:33 2020 Return-Path: Delivered-To: svn-src-all@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 A2A813E9BE1; Sun, 13 Sep 2020 21:34:33 +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 4BqN6x3tQMz3ZTt; Sun, 13 Sep 2020 21:34:33 +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 69787CCAF; Sun, 13 Sep 2020 21:34:33 +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 08DLYX0h059442; Sun, 13 Sep 2020 21:34:33 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08DLYXoG059441; Sun, 13 Sep 2020 21:34:33 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009132134.08DLYXoG059441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Sun, 13 Sep 2020 21:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365699 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 365699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 21:34:33 -0000 Author: bdragon Date: Sun Sep 13 21:34:32 2020 New Revision: 365699 URL: https://svnweb.freebsd.org/changeset/base/365699 Log: [PowerPC] bus_space cleanup part 2: Convert to c99 initializers. To make it easier to work with this in the future, convert to c99 designated initializer syntax. Tested on powerpc, powerpc64, and powerpc64le. No functional change. Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/powerpc/powerpc/bus_machdep.c Modified: head/sys/powerpc/powerpc/bus_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/bus_machdep.c Sun Sep 13 21:27:30 2020 (r365698) +++ head/sys/powerpc/powerpc/bus_machdep.c Sun Sep 13 21:34:32 2020 (r365699) @@ -796,96 +796,115 @@ struct bus_space bs_le_tag = { struct bus_space bs_be_tag = { #endif /* mapping/unmapping */ - bs_gen_map, - bs_gen_unmap, - bs_gen_subregion, + .bs_map = bs_gen_map, + .bs_unmap = bs_gen_unmap, + .bs_subregion = bs_gen_subregion, /* allocation/deallocation */ - bs_gen_alloc, - bs_gen_free, + .bs_alloc = bs_gen_alloc, + .bs_free = bs_gen_free, /* barrier */ - bs_gen_barrier, + .bs_barrier = bs_gen_barrier, /* read (single) */ - native_bs_rs_1, - native_bs_rs_2, - native_bs_rs_4, - native_bs_rs_8, + .bs_r_1 = native_bs_rs_1, + .bs_r_2 = native_bs_rs_2, + .bs_r_4 = native_bs_rs_4, + .bs_r_8 = native_bs_rs_8, - native_bs_rs_2, - native_bs_rs_4, - native_bs_rs_8, + /* read (single) stream */ + .bs_r_s_2 = native_bs_rs_2, + .bs_r_s_4 = native_bs_rs_4, + .bs_r_s_8 = native_bs_rs_8, /* read multiple */ - native_bs_rm_1, - native_bs_rm_2, - native_bs_rm_4, - native_bs_rm_8, + .bs_rm_1 = native_bs_rm_1, + .bs_rm_2 = native_bs_rm_2, + .bs_rm_4 = native_bs_rm_4, + .bs_rm_8 = native_bs_rm_8, - native_bs_rm_2, - native_bs_rm_4, - native_bs_rm_8, + /* read multiple stream */ + .bs_rm_s_2 = native_bs_rm_2, + .bs_rm_s_4 = native_bs_rm_4, + .bs_rm_s_8 = native_bs_rm_8, /* read region */ - native_bs_rr_1, - native_bs_rr_2, - native_bs_rr_4, - native_bs_rr_8, + .bs_rr_1 = native_bs_rr_1, + .bs_rr_2 = native_bs_rr_2, + .bs_rr_4 = native_bs_rr_4, + .bs_rr_8 = native_bs_rr_8, - native_bs_rr_2, - native_bs_rr_4, - native_bs_rr_8, + /* read region stream */ + .bs_rr_s_2 = native_bs_rr_2, + .bs_rr_s_4 = native_bs_rr_4, + .bs_rr_s_8 = native_bs_rr_8, /* write (single) */ - native_bs_ws_1, - native_bs_ws_2, - native_bs_ws_4, - native_bs_ws_8, + .bs_w_1 = native_bs_ws_1, + .bs_w_2 = native_bs_ws_2, + .bs_w_4 = native_bs_ws_4, + .bs_w_8 = native_bs_ws_8, - native_bs_ws_2, - native_bs_ws_4, - native_bs_ws_8, + /* write (single) stream */ + .bs_w_s_2 = native_bs_ws_2, + .bs_w_s_4 = native_bs_ws_4, + .bs_w_s_8 = native_bs_ws_8, /* write multiple */ - native_bs_wm_1, - native_bs_wm_2, - native_bs_wm_4, - native_bs_wm_8, + .bs_wm_1 = native_bs_wm_1, + .bs_wm_2 = native_bs_wm_2, + .bs_wm_4 = native_bs_wm_4, + .bs_wm_8 = native_bs_wm_8, - native_bs_wm_2, - native_bs_wm_4, - native_bs_wm_8, + /* write multiple stream */ + .bs_wm_s_2 = native_bs_wm_2, + .bs_wm_s_4 = native_bs_wm_4, + .bs_wm_s_8 = native_bs_wm_8, /* write region */ - native_bs_wr_1, - native_bs_wr_2, - native_bs_wr_4, - native_bs_wr_8, + .bs_wr_1 = native_bs_wr_1, + .bs_wr_2 = native_bs_wr_2, + .bs_wr_4 = native_bs_wr_4, + .bs_wr_8 = native_bs_wr_8, - native_bs_wr_2, - native_bs_wr_4, - native_bs_wr_8, + /* write region stream */ + .bs_wr_s_2 = native_bs_wr_2, + .bs_wr_s_4 = native_bs_wr_4, + .bs_wr_s_8 = native_bs_wr_8, /* set multiple */ - native_bs_sm_1, - native_bs_sm_2, - native_bs_sm_4, - native_bs_sm_8, + .bs_sm_1 = native_bs_sm_1, + .bs_sm_2 = native_bs_sm_2, + .bs_sm_4 = native_bs_sm_4, + .bs_sm_8 = native_bs_sm_8, - native_bs_sm_2, - native_bs_sm_4, - native_bs_sm_8, + /* set multiple stream */ + .bs_sm_s_2 = native_bs_sm_2, + .bs_sm_s_4 = native_bs_sm_4, + .bs_sm_s_8 = native_bs_sm_8, /* set region */ - native_bs_sr_1, - native_bs_sr_2, - native_bs_sr_4, - native_bs_sr_8, + .bs_sr_1 = native_bs_sr_1, + .bs_sr_2 = native_bs_sr_2, + .bs_sr_4 = native_bs_sr_4, + .bs_sr_8 = native_bs_sr_8, - native_bs_sr_2, - native_bs_sr_4, - native_bs_sr_8, + /* set region stream */ + .bs_sr_s_2 = native_bs_sr_2, + .bs_sr_s_4 = native_bs_sr_4, + .bs_sr_s_8 = native_bs_sr_8, + + /* copy region */ + .bs_cr_1 = NULL, /* UNIMPLEMENTED */ + .bs_cr_2 = NULL, /* UNIMPLEMENTED */ + .bs_cr_4 = NULL, /* UNIMPLEMENTED */ + .bs_cr_8 = NULL, /* UNIMPLEMENTED */ + + /* copy region stream */ + .bs_cr_s_2 = NULL, /* UNIMPLEMENTED */ + .bs_cr_s_4 = NULL, /* UNIMPLEMENTED */ + .bs_cr_s_8 = NULL, /* UNIMPLEMENTED */ }; #if BYTE_ORDER == LITTLE_ENDIAN @@ -894,94 +913,113 @@ struct bus_space bs_be_tag = { struct bus_space bs_le_tag = { #endif /* mapping/unmapping */ - bs_gen_map, - bs_gen_unmap, - bs_gen_subregion, + .bs_map = bs_gen_map, + .bs_unmap = bs_gen_unmap, + .bs_subregion = bs_gen_subregion, /* allocation/deallocation */ - bs_gen_alloc, - bs_gen_free, + .bs_alloc = bs_gen_alloc, + .bs_free = bs_gen_free, /* barrier */ - bs_gen_barrier, + .bs_barrier = bs_gen_barrier, /* read (single) */ - swapped_bs_rs_1, - swapped_bs_rs_2, - swapped_bs_rs_4, - swapped_bs_rs_8, + .bs_r_1 = swapped_bs_rs_1, + .bs_r_2 = swapped_bs_rs_2, + .bs_r_4 = swapped_bs_rs_4, + .bs_r_8 = swapped_bs_rs_8, - native_bs_rs_2, - native_bs_rs_4, - native_bs_rs_8, + /* read (single) stream */ + .bs_r_s_2 = native_bs_rs_2, + .bs_r_s_4 = native_bs_rs_4, + .bs_r_s_8 = native_bs_rs_8, /* read multiple */ - swapped_bs_rm_1, - swapped_bs_rm_2, - swapped_bs_rm_4, - swapped_bs_rm_8, + .bs_rm_1 = swapped_bs_rm_1, + .bs_rm_2 = swapped_bs_rm_2, + .bs_rm_4 = swapped_bs_rm_4, + .bs_rm_8 = swapped_bs_rm_8, - native_bs_rm_2, - native_bs_rm_4, - native_bs_rm_8, + /* read multiple stream */ + .bs_rm_s_2 = native_bs_rm_2, + .bs_rm_s_4 = native_bs_rm_4, + .bs_rm_s_8 = native_bs_rm_8, /* read region */ - swapped_bs_rr_1, - swapped_bs_rr_2, - swapped_bs_rr_4, - swapped_bs_rr_8, + .bs_rr_1 = swapped_bs_rr_1, + .bs_rr_2 = swapped_bs_rr_2, + .bs_rr_4 = swapped_bs_rr_4, + .bs_rr_8 = swapped_bs_rr_8, - native_bs_rr_2, - native_bs_rr_4, - native_bs_rr_8, + /* read region stream */ + .bs_rr_s_2 = native_bs_rr_2, + .bs_rr_s_4 = native_bs_rr_4, + .bs_rr_s_8 = native_bs_rr_8, /* write (single) */ - swapped_bs_ws_1, - swapped_bs_ws_2, - swapped_bs_ws_4, - swapped_bs_ws_8, + .bs_w_1 = swapped_bs_ws_1, + .bs_w_2 = swapped_bs_ws_2, + .bs_w_4 = swapped_bs_ws_4, + .bs_w_8 = swapped_bs_ws_8, - native_bs_ws_2, - native_bs_ws_4, - native_bs_ws_8, + /* write (single) stream */ + .bs_w_s_2 = native_bs_ws_2, + .bs_w_s_4 = native_bs_ws_4, + .bs_w_s_8 = native_bs_ws_8, /* write multiple */ - swapped_bs_wm_1, - swapped_bs_wm_2, - swapped_bs_wm_4, - swapped_bs_wm_8, + .bs_wm_1 = swapped_bs_wm_1, + .bs_wm_2 = swapped_bs_wm_2, + .bs_wm_4 = swapped_bs_wm_4, + .bs_wm_8 = swapped_bs_wm_8, - native_bs_wm_2, - native_bs_wm_4, - native_bs_wm_8, + /* write multiple stream */ + .bs_wm_s_2 = native_bs_wm_2, + .bs_wm_s_4 = native_bs_wm_4, + .bs_wm_s_8 = native_bs_wm_8, /* write region */ - swapped_bs_wr_1, - swapped_bs_wr_2, - swapped_bs_wr_4, - swapped_bs_wr_8, + .bs_wr_1 = swapped_bs_wr_1, + .bs_wr_2 = swapped_bs_wr_2, + .bs_wr_4 = swapped_bs_wr_4, + .bs_wr_8 = swapped_bs_wr_8, - native_bs_wr_2, - native_bs_wr_4, - native_bs_wr_8, + /* write region stream */ + .bs_wr_s_2 = native_bs_wr_2, + .bs_wr_s_4 = native_bs_wr_4, + .bs_wr_s_8 = native_bs_wr_8, /* set multiple */ - swapped_bs_sm_1, - swapped_bs_sm_2, - swapped_bs_sm_4, - swapped_bs_sm_8, + .bs_sm_1 = swapped_bs_sm_1, + .bs_sm_2 = swapped_bs_sm_2, + .bs_sm_4 = swapped_bs_sm_4, + .bs_sm_8 = swapped_bs_sm_8, - native_bs_sm_2, - native_bs_sm_4, - native_bs_sm_8, + /* set multiple stream */ + .bs_sm_s_2 = native_bs_sm_2, + .bs_sm_s_4 = native_bs_sm_4, + .bs_sm_s_8 = native_bs_sm_8, /* set region */ - swapped_bs_sr_1, - swapped_bs_sr_2, - swapped_bs_sr_4, - swapped_bs_sr_8, + .bs_sr_1 = swapped_bs_sr_1, + .bs_sr_2 = swapped_bs_sr_2, + .bs_sr_4 = swapped_bs_sr_4, + .bs_sr_8 = swapped_bs_sr_8, - native_bs_sr_2, - native_bs_sr_4, - native_bs_sr_8, + /* set region stream */ + .bs_sr_s_2 = native_bs_sr_2, + .bs_sr_s_4 = native_bs_sr_4, + .bs_sr_s_8 = native_bs_sr_8, + + /* copy region */ + .bs_cr_1 = NULL, /* UNIMPLEMENTED */ + .bs_cr_2 = NULL, /* UNIMPLEMENTED */ + .bs_cr_4 = NULL, /* UNIMPLEMENTED */ + .bs_cr_8 = NULL, /* UNIMPLEMENTED */ + + /* copy region stream */ + .bs_cr_s_2 = NULL, /* UNIMPLEMENTED */ + .bs_cr_s_4 = NULL, /* UNIMPLEMENTED */ + .bs_cr_s_8 = NULL, /* UNIMPLEMENTED */ }; From owner-svn-src-all@freebsd.org Sun Sep 13 22:57:51 2020 Return-Path: Delivered-To: svn-src-all@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 7FB4D3EB8C8; Sun, 13 Sep 2020 22:57:51 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BqPz32lZJz3dXS; Sun, 13 Sep 2020 22:57:51 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28B21D56C; Sun, 13 Sep 2020 22:57:51 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08DMvp9O008375; Sun, 13 Sep 2020 22:57:51 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08DMvp7v008374; Sun, 13 Sep 2020 22:57:51 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202009132257.08DMvp7v008374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 13 Sep 2020 22:57:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365700 - head/sbin/newfs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/newfs X-SVN-Commit-Revision: 365700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 22:57:51 -0000 Author: mckusick Date: Sun Sep 13 22:57:50 2020 New Revision: 365700 URL: https://svnweb.freebsd.org/changeset/base/365700 Log: In the newfs(8) utility, use the more appropriate sbwrite() and cgwrite() libufs interfaces rather than sbput() and cgput(). No functional change. MFC after: 7 days Sponsored by: Netflix Modified: head/sbin/newfs/mkfs.c Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Sun Sep 13 21:34:32 2020 (r365699) +++ head/sbin/newfs/mkfs.c Sun Sep 13 22:57:50 2020 (r365700) @@ -556,8 +556,8 @@ restart: * Reference the summary information so it will also be written. */ sblock.fs_csp = fscs; - if (!Nflag && sbput(disk.d_fd, &disk.d_fs, 0) != 0) - err(1, "sbput: %s", disk.d_error); + if (!Nflag && sbwrite(&disk, 0) != 0) + err(1, "sbwrite: %s", disk.d_error); if (Xflag == 1) { printf("** Exiting on Xflag 1\n"); exit(0); @@ -619,8 +619,8 @@ restart: printf("** Exiting on Xflag 3\n"); exit(0); } - if (sbput(disk.d_fd, &disk.d_fs, 0) != 0) - err(1, "sbput: %s", disk.d_error); + if (sbwrite(&disk, 0) != 0) + err(1, "sbwrite: %s", disk.d_error); /* * For UFS1 filesystems with a blocksize of 64K, the first * alternate superblock resides at the location used for @@ -811,11 +811,11 @@ initcg(int cylno, time_t utime) savedactualloc = sblock.fs_sblockactualloc; sblock.fs_sblockactualloc = dbtob(fsbtodb(&sblock, cgsblock(&sblock, cylno))); - if (sbput(disk.d_fd, &disk.d_fs, 0) != 0) - err(1, "sbput: %s", disk.d_error); + if (sbwrite(&disk, 0) != 0) + err(1, "sbwrite: %s", disk.d_error); sblock.fs_sblockactualloc = savedactualloc; - if (cgput(&disk, &acg) != 0) - err(1, "initcg: cgput: %s", disk.d_error); + if (cgwrite(&disk) != 0) + err(1, "initcg: cgwrite: %s", disk.d_error); start = 0; dp1 = (struct ufs1_dinode *)(&iobuf[start]); dp2 = (struct ufs2_dinode *)(&iobuf[start]); @@ -1024,8 +1024,8 @@ goth: for (i = frag; i < sblock.fs_frag; i++) setbit(cg_blksfree(&acg), d + i); } - if (cgput(&disk, &acg) != 0) - err(1, "alloc: cgput: %s", disk.d_error); + if (cgwrite(&disk) != 0) + err(1, "alloc: cgwrite: %s", disk.d_error); return ((ufs2_daddr_t)d); } @@ -1045,8 +1045,8 @@ iput(union dinode *ip, ino_t ino) } acg.cg_cs.cs_nifree--; setbit(cg_inosused(&acg), ino); - if (cgput(&disk, &acg) != 0) - err(1, "iput: cgput: %s", disk.d_error); + if (cgwrite(&disk) != 0) + err(1, "iput: cgwrite: %s", disk.d_error); sblock.fs_cstotal.cs_nifree--; fscs[0].cs_nifree--; if (getinode(&disk, &dp, ino) == -1) { From owner-svn-src-all@freebsd.org Sun Sep 13 23:05:19 2020 Return-Path: Delivered-To: svn-src-all@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 E8C5F3EBBB1; Sun, 13 Sep 2020 23:05:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BqQ7g5rSmz3dqb; Sun, 13 Sep 2020 23:05:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABDCEDC0E; Sun, 13 Sep 2020 23:05:19 +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 08DN5J0W014362; Sun, 13 Sep 2020 23:05:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08DN5J1e014361; Sun, 13 Sep 2020 23:05:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009132305.08DN5J1e014361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 13 Sep 2020 23:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365701 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 365701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 23:05:20 -0000 Author: emaste Date: Sun Sep 13 23:05:19 2020 New Revision: 365701 URL: https://svnweb.freebsd.org/changeset/base/365701 Log: Makefile.inc1: remove more old stale depend hacks Current stale dependency hacks are in tools/build/depend-cleanup.sh. These ones were almost a year old; remove them from Makefile.inc1. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Sep 13 22:57:50 2020 (r365700) +++ head/Makefile.inc1 Sun Sep 13 23:05:19 2020 (r365701) @@ -983,34 +983,6 @@ _sanity_check: .PHONY .MAKE _cleanobj_fast_depend_hack: .PHONY @echo ">>> Deleting stale dependencies..."; sh ${.CURDIR}/tools/build/depend-cleanup.sh ${OBJTOP} -# Date SVN Rev Syscalls/Changes -# Syscall stubs rewritten in C and obsolete MD assembly implementations -# 20191009 r353340 removal of opensolaris_atomic.S (also r353381) -.if ${MACHINE} != i386 -.for f in opensolaris_atomic - @if [ -e "${OBJTOP}/cddl/lib/libzpool/.depend.${f}.o" ] && \ - egrep -qw 'opensolaris_atomic\.S' ${OBJTOP}/cddl/lib/libzpool/.depend.${f}.o; then \ - echo "Removing stale dependencies for opensolaris_atomic"; \ - rm -f ${OBJTOP}/cddl/lib/libzpool/.depend.${f}.* \ - ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/cddl/lib/libzpool/.depend.${f}.*}; \ - fi -.endfor -.endif -# 20190925 r352689 removal of obsolete i386 memchr.S -.for f in memchr - @if [ -e "${OBJTOP}/lib/libc/.depend.${f}.o" ] && \ - egrep -qw 'i386/string/memchr\.S' ${OBJTOP}/lib/libc/.depend.${f}.o; then \ - echo "Removing stale dependencies for memchr"; \ - rm -f ${OBJTOP}/lib/libc/.depend.${f}.*; \ - fi -.if defined(_LIBCOMPAT) - @if [ -e "${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.o" ] && \ - egrep -qw 'i386/string/memchr\.S' ${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.o; then \ - echo "Removing stale dependencies for memchr"; \ - rm -f ${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*; \ - fi -.endif -.endfor _worldtmp: .PHONY @echo From owner-svn-src-all@freebsd.org Sun Sep 13 23:51:08 2020 Return-Path: Delivered-To: svn-src-all@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 D61F33ECD27; Sun, 13 Sep 2020 23:51:08 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BqR8X5jFyz3y1N; Sun, 13 Sep 2020 23:51:08 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D4D1E324; Sun, 13 Sep 2020 23:51:08 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08DNp8S5039875; Sun, 13 Sep 2020 23:51:08 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08DNp74P039871; Sun, 13 Sep 2020 23:51:07 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <202009132351.08DNp74P039871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 13 Sep 2020 23:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365702 - in releng/12.2: sys/dev/virtio/block usr.sbin/bhyve X-SVN-Group: releng X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: in releng/12.2: sys/dev/virtio/block usr.sbin/bhyve X-SVN-Commit-Revision: 365702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2020 23:51:08 -0000 Author: allanjude Date: Sun Sep 13 23:51:07 2020 New Revision: 365702 URL: https://svnweb.freebsd.org/changeset/base/365702 Log: MFC r360229, r363255 MFS r365614 r360229: Add VIRTIO_BLK_T_DISCARD (TRIM) support to the bhyve virtio-blk backend This will advertise support for TRIM to the guest virtio-blk driver and perform the DIOCGDELETE ioctl on the backing storage if it supports it. Thanks to Jason King and others at Joyent and illumos for expanding on my original patch, adding improvements including better error handling and making sure to following the virtio spec. r363255: Add VIRTIO_BLK_T_DISCARD support to the virtio-blk driver If the hypervisor advertises support for the DISCARD command then the guest can perform TRIM commands, freeing space on the backing store. If VIRTIO_BLK_F_DISCARD is enabled, advertise DISKFLAG_CANDELETE Tested with FreeBSD guests on bhyve and KVM Approved by: re (gjb) Relnotes: yes Sponsored by: Klara Inc. Modified: releng/12.2/sys/dev/virtio/block/virtio_blk.c releng/12.2/sys/dev/virtio/block/virtio_blk.h releng/12.2/usr.sbin/bhyve/block_if.c releng/12.2/usr.sbin/bhyve/pci_virtio_block.c Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- releng/12.2/sys/dev/virtio/block/virtio_blk.c Sun Sep 13 23:05:19 2020 (r365701) +++ releng/12.2/sys/dev/virtio/block/virtio_blk.c Sun Sep 13 23:51:07 2020 (r365702) @@ -81,6 +81,7 @@ struct vtblk_softc { #define VTBLK_FLAG_SUSPEND 0x0008 #define VTBLK_FLAG_BARRIER 0x0010 #define VTBLK_FLAG_WC_CONFIG 0x0020 +#define VTBLK_FLAG_DISCARD 0x0040 struct virtqueue *vtblk_vq; struct sglist *vtblk_sglist; @@ -112,6 +113,7 @@ static struct virtio_feature_desc vtblk_feature_desc[] { VIRTIO_BLK_F_WCE, "WriteCache" }, { VIRTIO_BLK_F_TOPOLOGY, "Topology" }, { VIRTIO_BLK_F_CONFIG_WCE, "ConfigWCE" }, + { VIRTIO_BLK_F_DISCARD, "Discard" }, { 0, NULL } }; @@ -210,6 +212,7 @@ TUNABLE_INT("hw.vtblk.writecache_mode", &vtblk_writeca VIRTIO_BLK_F_WCE | \ VIRTIO_BLK_F_TOPOLOGY | \ VIRTIO_BLK_F_CONFIG_WCE | \ + VIRTIO_BLK_F_DISCARD | \ VIRTIO_RING_F_INDIRECT_DESC) #define VTBLK_MTX(_sc) &(_sc)->vtblk_mtx @@ -461,7 +464,7 @@ vtblk_config_change(device_t dev) vtblk_read_config(sc, &blkcfg); /* Capacity is always in 512-byte units. */ - capacity = blkcfg.capacity * 512; + capacity = blkcfg.capacity * VTBLK_BSIZE; if (sc->vtblk_disk->d_mediasize != capacity) vtblk_resize_disk(sc, capacity); @@ -546,11 +549,18 @@ vtblk_strategy(struct bio *bp) * be a better way to report our readonly'ness to GEOM above. */ if (sc->vtblk_flags & VTBLK_FLAG_READONLY && - (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_FLUSH)) { + (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_FLUSH || + bp->bio_cmd == BIO_DELETE)) { vtblk_bio_done(sc, bp, EROFS); return; } + if ((bp->bio_cmd != BIO_READ) && (bp->bio_cmd != BIO_WRITE) && + (bp->bio_cmd != BIO_FLUSH) && (bp->bio_cmd != BIO_DELETE)) { + vtblk_bio_done(sc, bp, EOPNOTSUPP); + return; + } + VTBLK_LOCK(sc); if (sc->vtblk_flags & VTBLK_FLAG_DETACH) { @@ -559,6 +569,13 @@ vtblk_strategy(struct bio *bp) return; } + if ((bp->bio_cmd == BIO_DELETE) && + !(sc->vtblk_flags & VTBLK_FLAG_DISCARD)) { + VTBLK_UNLOCK(sc); + vtblk_bio_done(sc, bp, EOPNOTSUPP); + return; + } + bioq_insert_tail(&sc->vtblk_bioq, bp); vtblk_startio(sc); @@ -594,6 +611,8 @@ vtblk_setup_features(struct vtblk_softc *sc) sc->vtblk_flags |= VTBLK_FLAG_BARRIER; if (virtio_with_feature(dev, VIRTIO_BLK_F_CONFIG_WCE)) sc->vtblk_flags |= VTBLK_FLAG_WC_CONFIG; + if (virtio_with_feature(dev, VIRTIO_BLK_F_DISCARD)) + sc->vtblk_flags |= VTBLK_FLAG_DISCARD; } static int @@ -683,12 +702,12 @@ vtblk_alloc_disk(struct vtblk_softc *sc, struct virtio dp->d_dump = vtblk_dump; /* Capacity is always in 512-byte units. */ - dp->d_mediasize = blkcfg->capacity * 512; + dp->d_mediasize = blkcfg->capacity * VTBLK_BSIZE; if (virtio_with_feature(dev, VIRTIO_BLK_F_BLK_SIZE)) dp->d_sectorsize = blkcfg->blk_size; else - dp->d_sectorsize = 512; + dp->d_sectorsize = VTBLK_BSIZE; /* * The VirtIO maximum I/O size is given in terms of segments. @@ -722,6 +741,11 @@ vtblk_alloc_disk(struct vtblk_softc *sc, struct virtio dp->d_stripesize; } + if (virtio_with_feature(dev, VIRTIO_BLK_F_DISCARD)) { + dp->d_flags |= DISKFLAG_CANDELETE; + dp->d_delmaxsize = blkcfg->max_discard_sectors * VTBLK_BSIZE; + } + if (vtblk_write_cache_enabled(sc, blkcfg) != 0) sc->vtblk_write_cache = VTBLK_CACHE_WRITEBACK; else @@ -872,12 +896,16 @@ vtblk_request_bio(struct vtblk_softc *sc) break; case BIO_READ: req->vbr_hdr.type = VIRTIO_BLK_T_IN; - req->vbr_hdr.sector = bp->bio_offset / 512; + req->vbr_hdr.sector = bp->bio_offset / VTBLK_BSIZE; break; case BIO_WRITE: req->vbr_hdr.type = VIRTIO_BLK_T_OUT; - req->vbr_hdr.sector = bp->bio_offset / 512; + req->vbr_hdr.sector = bp->bio_offset / VTBLK_BSIZE; break; + case BIO_DELETE: + req->vbr_hdr.type = VIRTIO_BLK_T_DISCARD; + req->vbr_hdr.sector = bp->bio_offset / VTBLK_BSIZE; + break; default: panic("%s: bio with unhandled cmd: %d", __func__, bp->bio_cmd); } @@ -931,6 +959,20 @@ vtblk_request_execute(struct vtblk_softc *sc, struct v /* BIO_READ means the host writes into our buffer. */ if (bp->bio_cmd == BIO_READ) writable = sg->sg_nseg - 1; + } else if (bp->bio_cmd == BIO_DELETE) { + struct virtio_blk_discard_write_zeroes *discard; + + discard = malloc(sizeof(*discard), M_DEVBUF, M_NOWAIT | M_ZERO); + if (discard == NULL) + return (ENOMEM); + discard->sector = bp->bio_offset / VTBLK_BSIZE; + discard->num_sectors = bp->bio_bcount / VTBLK_BSIZE; + bp->bio_driver1 = discard; + error = sglist_append(sg, discard, sizeof(*discard)); + if (error || sg->sg_nseg == sg->sg_maxseg) { + panic("%s: bio %p data buffer too big %d", + __func__, bp, error); + } } writable++; @@ -1091,6 +1133,11 @@ vtblk_bio_done(struct vtblk_softc *sc, struct bio *bp, bp->bio_flags |= BIO_ERROR; } + if (bp->bio_driver1 != NULL) { + free(bp->bio_driver1, M_DEVBUF); + bp->bio_driver1 = NULL; + } + biodone(bp); } @@ -1120,7 +1167,12 @@ vtblk_read_config(struct vtblk_softc *sc, struct virti VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_GEOMETRY, geometry, blkcfg); VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_BLK_SIZE, blk_size, blkcfg); VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_TOPOLOGY, topology, blkcfg); - VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_CONFIG_WCE, writeback, blkcfg); + VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_CONFIG_WCE, wce, blkcfg); + VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_DISCARD, max_discard_sectors, + blkcfg); + VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_DISCARD, max_discard_seg, blkcfg); + VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_DISCARD, discard_sector_alignment, + blkcfg); } #undef VTBLK_GET_CONFIG @@ -1278,7 +1330,7 @@ vtblk_dump_write(struct vtblk_softc *sc, void *virtual req->vbr_ack = -1; req->vbr_hdr.type = VIRTIO_BLK_T_OUT; req->vbr_hdr.ioprio = 1; - req->vbr_hdr.sector = offset / 512; + req->vbr_hdr.sector = offset / VTBLK_BSIZE; req->vbr_bp = &buf; g_reset_bio(&buf); @@ -1327,7 +1379,7 @@ vtblk_set_write_cache(struct vtblk_softc *sc, int wc) /* Set either writeback (1) or writethrough (0) mode. */ virtio_write_dev_config_1(sc->vtblk_dev, - offsetof(struct virtio_blk_config, writeback), wc); + offsetof(struct virtio_blk_config, wce), wc); } static int @@ -1342,7 +1394,7 @@ vtblk_write_cache_enabled(struct vtblk_softc *sc, if (wc >= 0 && wc < VTBLK_CACHE_MAX) vtblk_set_write_cache(sc, wc); else - wc = blkcfg->writeback; + wc = blkcfg->wce; } else wc = virtio_with_feature(sc->vtblk_dev, VIRTIO_BLK_F_WCE); Modified: releng/12.2/sys/dev/virtio/block/virtio_blk.h ============================================================================== --- releng/12.2/sys/dev/virtio/block/virtio_blk.h Sun Sep 13 23:05:19 2020 (r365701) +++ releng/12.2/sys/dev/virtio/block/virtio_blk.h Sun Sep 13 23:51:07 2020 (r365702) @@ -33,20 +33,27 @@ #ifndef _VIRTIO_BLK_H #define _VIRTIO_BLK_H +#define VTBLK_BSIZE 512 + /* Feature bits */ -#define VIRTIO_BLK_F_BARRIER 0x0001 /* Does host support barriers? */ -#define VIRTIO_BLK_F_SIZE_MAX 0x0002 /* Indicates maximum segment size */ -#define VIRTIO_BLK_F_SEG_MAX 0x0004 /* Indicates maximum # of segments */ -#define VIRTIO_BLK_F_GEOMETRY 0x0010 /* Legacy geometry available */ -#define VIRTIO_BLK_F_RO 0x0020 /* Disk is read-only */ -#define VIRTIO_BLK_F_BLK_SIZE 0x0040 /* Block size of disk is available*/ -#define VIRTIO_BLK_F_SCSI 0x0080 /* Supports scsi command passthru */ -#define VIRTIO_BLK_F_WCE 0x0200 /* Writeback mode enabled after reset */ -#define VIRTIO_BLK_F_TOPOLOGY 0x0400 /* Topology information is available */ -#define VIRTIO_BLK_F_CONFIG_WCE 0x0800 /* Writeback mode available in config */ -#define VIRTIO_BLK_ID_BYTES 20 /* ID string length */ +#define VIRTIO_BLK_F_BARRIER 0x0001 /* Does host support barriers? */ +#define VIRTIO_BLK_F_SIZE_MAX 0x0002 /* Indicates maximum segment size */ +#define VIRTIO_BLK_F_SEG_MAX 0x0004 /* Indicates maximum # of segments */ +#define VIRTIO_BLK_F_GEOMETRY 0x0010 /* Legacy geometry available */ +#define VIRTIO_BLK_F_RO 0x0020 /* Disk is read-only */ +#define VIRTIO_BLK_F_BLK_SIZE 0x0040 /* Block size of disk is available*/ +#define VIRTIO_BLK_F_SCSI 0x0080 /* Supports scsi command passthru */ +#define VIRTIO_BLK_F_FLUSH 0x0200 /* Flush command supported */ +#define VIRTIO_BLK_F_WCE 0x0200 /* Legacy alias for FLUSH */ +#define VIRTIO_BLK_F_TOPOLOGY 0x0400 /* Topology information is available */ +#define VIRTIO_BLK_F_CONFIG_WCE 0x0800 /* Writeback mode available in config */ +#define VIRTIO_BLK_F_MQ 0x1000 /* Support more than one vq */ +#define VIRTIO_BLK_F_DISCARD 0x2000 /* Trim blocks */ +#define VIRTIO_BLK_F_WRITE_ZEROES 0x4000 /* Write zeros */ +#define VIRTIO_BLK_ID_BYTES 20 /* ID string length */ + struct virtio_blk_config { /* The capacity (in 512-byte sectors). */ uint64_t capacity; @@ -66,15 +73,29 @@ struct virtio_blk_config { /* Topology of the device (if VIRTIO_BLK_F_TOPOLOGY) */ struct virtio_blk_topology { + /* Exponent for physical block per logical block. */ uint8_t physical_block_exp; + /* Alignment offset in logical blocks. */ uint8_t alignment_offset; + /* Minimum I/O size without performance penalty in logical + * blocks. */ uint16_t min_io_size; + /* Optimal sustained I/O size in logical blocks. */ uint32_t opt_io_size; } topology; /* Writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */ - uint8_t writeback; - + uint8_t wce; + uint8_t unused; + /* Number of vqs, only available when VIRTIO_BLK_F_MQ is set */ + uint16_t num_queues; + uint32_t max_discard_sectors; + uint32_t max_discard_seg; + uint32_t discard_sector_alignment; + uint32_t max_write_zeroes_sectors; + uint32_t max_write_zeroes_seg; + uint8_t write_zeroes_may_unmap; + uint8_t unused1[3]; } __packed; /* @@ -89,24 +110,35 @@ struct virtio_blk_config { */ /* These two define direction. */ -#define VIRTIO_BLK_T_IN 0 -#define VIRTIO_BLK_T_OUT 1 +#define VIRTIO_BLK_T_IN 0 +#define VIRTIO_BLK_T_OUT 1 /* This bit says it's a scsi command, not an actual read or write. */ -#define VIRTIO_BLK_T_SCSI_CMD 2 +#define VIRTIO_BLK_T_SCSI_CMD 2 +#define VIRTIO_BLK_T_SCSI_CMD_OUT 3 /* Cache flush command */ -#define VIRTIO_BLK_T_FLUSH 4 +#define VIRTIO_BLK_T_FLUSH 4 +#define VIRTIO_BLK_T_FLUSH_OUT 5 /* Get device ID command */ -#define VIRTIO_BLK_T_GET_ID 8 +#define VIRTIO_BLK_T_GET_ID 8 +/* Discard command */ +#define VIRTIO_BLK_T_DISCARD 11 + +/* Write zeros command */ +#define VIRTIO_BLK_T_WRITE_ZEROES 13 + /* Barrier before this op. */ -#define VIRTIO_BLK_T_BARRIER 0x80000000 +#define VIRTIO_BLK_T_BARRIER 0x80000000 /* ID string length */ -#define VIRTIO_BLK_ID_BYTES 20 +#define VIRTIO_BLK_ID_BYTES 20 +/* Unmap this range (only valid for write zeroes command) */ +#define VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP 0x00000001 + /* This is the first element of the read scatter-gather list. */ struct virtio_blk_outhdr { /* VIRTIO_BLK_T* */ @@ -115,6 +147,15 @@ struct virtio_blk_outhdr { uint32_t ioprio; /* Sector (ie. 512 byte offset) */ uint64_t sector; +}; + +struct virtio_blk_discard_write_zeroes { + uint64_t sector; + uint32_t num_sectors; + struct { + uint32_t unmap:1; + uint32_t reserved:31; + } flags; }; struct virtio_scsi_inhdr { Modified: releng/12.2/usr.sbin/bhyve/block_if.c ============================================================================== --- releng/12.2/usr.sbin/bhyve/block_if.c Sun Sep 13 23:05:19 2020 (r365701) +++ releng/12.2/usr.sbin/bhyve/block_if.c Sun Sep 13 23:51:07 2020 (r365702) @@ -3,6 +3,7 @@ * * Copyright (c) 2013 Peter Grehan * All rights reserved. + * Copyright 2020 Joyent, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -410,6 +411,8 @@ blockif_open(const char *optstr, const char *ident) off_t size, psectsz, psectoff; int extra, fd, i, sectsz; int nocache, sync, ro, candelete, geom, ssopt, pssopt; + int nodelete; + #ifndef WITHOUT_CAPSICUM cap_rights_t rights; cap_ioctl_t cmds[] = { DIOCGFLUSH, DIOCGDELETE }; @@ -422,6 +425,7 @@ blockif_open(const char *optstr, const char *ident) nocache = 0; sync = 0; ro = 0; + nodelete = 0; /* * The first element in the optstring is always a pathname. @@ -434,6 +438,8 @@ blockif_open(const char *optstr, const char *ident) continue; else if (!strcmp(cp, "nocache")) nocache = 1; + else if (!strcmp(cp, "nodelete")) + nodelete = 1; else if (!strcmp(cp, "sync") || !strcmp(cp, "direct")) sync = 1; else if (!strcmp(cp, "ro")) @@ -500,7 +506,7 @@ blockif_open(const char *optstr, const char *ident) ioctl(fd, DIOCGSTRIPEOFFSET, &psectoff); strlcpy(arg.name, "GEOM::candelete", sizeof(arg.name)); arg.len = sizeof(arg.value.i); - if (ioctl(fd, DIOCGATTR, &arg) == 0) + if (nodelete == 0 && ioctl(fd, DIOCGATTR, &arg) == 0) candelete = arg.value.i; if (ioctl(fd, DIOCGPROVIDERNAME, name) == 0) geom = 1; Modified: releng/12.2/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- releng/12.2/usr.sbin/bhyve/pci_virtio_block.c Sun Sep 13 23:05:19 2020 (r365701) +++ releng/12.2/usr.sbin/bhyve/pci_virtio_block.c Sun Sep 13 23:51:07 2020 (r365702) @@ -3,7 +3,7 @@ * * Copyright (c) 2011 NetApp, Inc. * All rights reserved. - * Copyright (c) 2019 Joyent, Inc. + * Copyright 2020 Joyent, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -57,26 +57,37 @@ __FBSDID("$FreeBSD$"); #include "virtio.h" #include "block_if.h" -#define VTBLK_RINGSZ 128 +#define VTBLK_BSIZE 512 +#define VTBLK_RINGSZ 128 _Static_assert(VTBLK_RINGSZ <= BLOCKIF_RING_MAX, "Each ring entry must be able to queue a request"); -#define VTBLK_S_OK 0 -#define VTBLK_S_IOERR 1 +#define VTBLK_S_OK 0 +#define VTBLK_S_IOERR 1 #define VTBLK_S_UNSUPP 2 #define VTBLK_BLK_ID_BYTES 20 + 1 /* Capability bits */ -#define VTBLK_F_SEG_MAX (1 << 2) /* Maximum request segments */ -#define VTBLK_F_BLK_SIZE (1 << 6) /* cfg block size valid */ -#define VTBLK_F_FLUSH (1 << 9) /* Cache flush support */ -#define VTBLK_F_TOPOLOGY (1 << 10) /* Optimal I/O alignment */ +#define VTBLK_F_BARRIER (1 << 0) /* Does host support barriers? */ +#define VTBLK_F_SIZE_MAX (1 << 1) /* Indicates maximum segment size */ +#define VTBLK_F_SEG_MAX (1 << 2) /* Indicates maximum # of segments */ +#define VTBLK_F_GEOMETRY (1 << 4) /* Legacy geometry available */ +#define VTBLK_F_RO (1 << 5) /* Disk is read-only */ +#define VTBLK_F_BLK_SIZE (1 << 6) /* Block size of disk is available*/ +#define VTBLK_F_SCSI (1 << 7) /* Supports scsi command passthru */ +#define VTBLK_F_FLUSH (1 << 9) /* Writeback mode enabled after reset */ +#define VTBLK_F_WCE (1 << 9) /* Legacy alias for FLUSH */ +#define VTBLK_F_TOPOLOGY (1 << 10) /* Topology information is available */ +#define VTBLK_F_CONFIG_WCE (1 << 11) /* Writeback mode available in config */ +#define VTBLK_F_MQ (1 << 12) /* Multi-Queue */ +#define VTBLK_F_DISCARD (1 << 13) /* Trim blocks */ +#define VTBLK_F_WRITE_ZEROES (1 << 14) /* Write zeros */ /* * Host capabilities */ -#define VTBLK_S_HOSTCAPS \ +#define VTBLK_S_HOSTCAPS \ ( VTBLK_F_SEG_MAX | \ VTBLK_F_BLK_SIZE | \ VTBLK_F_FLUSH | \ @@ -84,6 +95,18 @@ _Static_assert(VTBLK_RINGSZ <= BLOCKIF_RING_MAX, "Each VIRTIO_RING_F_INDIRECT_DESC ) /* indirect descriptors */ /* + * The current blockif_delete() interface only allows a single delete + * request at a time. + */ +#define VTBLK_MAX_DISCARD_SEG 1 + +/* + * An arbitrary limit to prevent excessive latency due to large + * delete requests. + */ +#define VTBLK_MAX_DISCARD_SECT ((16 << 20) / VTBLK_BSIZE) /* 16 MiB */ + +/* * Config space "registers" */ struct vtblk_config { @@ -103,6 +126,15 @@ struct vtblk_config { uint32_t opt_io_size; } vbc_topology; uint8_t vbc_writeback; + uint8_t unused0[1]; + uint16_t num_queues; + uint32_t max_discard_sectors; + uint32_t max_discard_seg; + uint32_t discard_sector_alignment; + uint32_t max_write_zeroes_sectors; + uint32_t max_write_zeroes_seg; + uint8_t write_zeroes_may_unmap; + uint8_t unused1[3]; } __packed; /* @@ -111,9 +143,14 @@ struct vtblk_config { struct virtio_blk_hdr { #define VBH_OP_READ 0 #define VBH_OP_WRITE 1 +#define VBH_OP_SCSI_CMD 2 +#define VBH_OP_SCSI_CMD_OUT 3 #define VBH_OP_FLUSH 4 #define VBH_OP_FLUSH_OUT 5 #define VBH_OP_IDENT 8 +#define VBH_OP_DISCARD 11 +#define VBH_OP_WRITE_ZEROES 13 + #define VBH_FLAG_BARRIER 0x80000000 /* OR'ed into vbh_type */ uint32_t vbh_type; uint32_t vbh_ioprio; @@ -124,8 +161,8 @@ struct virtio_blk_hdr { * Debug printf */ static int pci_vtblk_debug; -#define DPRINTF(params) if (pci_vtblk_debug) PRINTLN params -#define WPRINTF(params) PRINTLN params +#define DPRINTF(params) if (pci_vtblk_debug) PRINTLN params +#define WPRINTF(params) PRINTLN params struct pci_vtblk_ioreq { struct blockif_req io_req; @@ -134,6 +171,15 @@ struct pci_vtblk_ioreq { uint16_t io_idx; }; +struct virtio_blk_discard_write_zeroes { + uint64_t sector; + uint32_t num_sectors; + struct { + uint32_t unmap:1; + uint32_t reserved:31; + } flags; +}; + /* * Per-device softc */ @@ -142,6 +188,7 @@ struct pci_vtblk_softc { pthread_mutex_t vsc_mtx; struct vqueue_info vbsc_vq; struct vtblk_config vbsc_cfg; + struct virtio_consts vbsc_consts; struct blockif_ctxt *bc; char vbsc_ident[VTBLK_BLK_ID_BYTES]; struct pci_vtblk_ioreq vbsc_ios[VTBLK_RINGSZ]; @@ -174,9 +221,8 @@ pci_vtblk_reset(void *vsc) } static void -pci_vtblk_done(struct blockif_req *br, int err) +pci_vtblk_done_locked(struct pci_vtblk_ioreq *io, int err) { - struct pci_vtblk_ioreq *io = br->br_param; struct pci_vtblk_softc *sc = io->io_sc; /* convert errno into a virtio block error return */ @@ -191,9 +237,18 @@ pci_vtblk_done(struct blockif_req *br, int err) * Return the descriptor back to the host. * We wrote 1 byte (our status) to host. */ - pthread_mutex_lock(&sc->vsc_mtx); vq_relchain(&sc->vbsc_vq, io->io_idx, 1); vq_endchains(&sc->vbsc_vq, 0); +} + +static void +pci_vtblk_done(struct blockif_req *br, int err) +{ + struct pci_vtblk_ioreq *io = br->br_param; + struct pci_vtblk_softc *sc = io->io_sc; + + pthread_mutex_lock(&sc->vsc_mtx); + pci_vtblk_done_locked(io, err); pthread_mutex_unlock(&sc->vsc_mtx); } @@ -208,6 +263,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vque int writeop, type; struct iovec iov[BLOCKIF_IOV_MAX + 2]; uint16_t idx, flags[BLOCKIF_IOV_MAX + 2]; + struct virtio_blk_discard_write_zeroes *discard; n = vq_getchain(vq, &idx, iov, BLOCKIF_IOV_MAX + 2, flags); @@ -224,11 +280,11 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vque io = &sc->vbsc_ios[idx]; assert((flags[0] & VRING_DESC_F_WRITE) == 0); assert(iov[0].iov_len == sizeof(struct virtio_blk_hdr)); - vbh = iov[0].iov_base; + vbh = (struct virtio_blk_hdr *)iov[0].iov_base; memcpy(&io->io_req.br_iov, &iov[1], sizeof(struct iovec) * (n - 2)); io->io_req.br_iovcnt = n - 2; - io->io_req.br_offset = vbh->vbh_sector * DEV_BSIZE; - io->io_status = iov[--n].iov_base; + io->io_req.br_offset = vbh->vbh_sector * VTBLK_BSIZE; + io->io_status = (uint8_t *)iov[--n].iov_base; assert(iov[n].iov_len == 1); assert(flags[n] & VRING_DESC_F_WRITE); @@ -238,7 +294,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vque * we don't advertise the capability. */ type = vbh->vbh_type & ~VBH_FLAG_BARRIER; - writeop = (type == VBH_OP_WRITE); + writeop = (type == VBH_OP_WRITE || type == VBH_OP_DISCARD); iolen = 0; for (i = 1; i < n; i++) { @@ -254,7 +310,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vque io->io_req.br_resid = iolen; DPRINTF(("virtio-block: %s op, %zd bytes, %d segs, offset %ld", - writeop ? "write" : "read/ident", iolen, i - 1, + writeop ? "write/discard" : "read/ident", iolen, i - 1, io->io_req.br_offset)); switch (type) { @@ -264,6 +320,46 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vque case VBH_OP_WRITE: err = blockif_write(sc->bc, &io->io_req); break; + case VBH_OP_DISCARD: + /* + * We currently only support a single request, if the guest + * has submitted a request that doesn't conform to the + * requirements, we return a error. + */ + if (iov[1].iov_len != sizeof (*discard)) { + pci_vtblk_done_locked(io, EINVAL); + return; + } + + /* The segments to discard are provided rather than data */ + discard = (struct virtio_blk_discard_write_zeroes *) + iov[1].iov_base; + + /* + * virtio v1.1 5.2.6.2: + * The device MUST set the status byte to VIRTIO_BLK_S_UNSUPP + * for discard and write zeroes commands if any unknown flag is + * set. Furthermore, the device MUST set the status byte to + * VIRTIO_BLK_S_UNSUPP for discard commands if the unmap flag + * is set. + * + * Currently there are no known flags for a DISCARD request. + */ + if (discard->flags.unmap != 0 || discard->flags.reserved != 0) { + pci_vtblk_done_locked(io, ENOTSUP); + return; + } + + /* Make sure the request doesn't exceed our size limit */ + if (discard->num_sectors > VTBLK_MAX_DISCARD_SECT) { + pci_vtblk_done_locked(io, EINVAL); + return; + } + + io->io_req.br_offset = discard->sector * VTBLK_BSIZE; + io->io_req.br_resid = discard->num_sectors * VTBLK_BSIZE; + err = blockif_delete(sc->bc, &io->io_req); + break; case VBH_OP_FLUSH: case VBH_OP_FLUSH_OUT: err = blockif_flush(sc->bc, &io->io_req); @@ -274,10 +370,10 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vque memset(iov[1].iov_base, 0, iov[1].iov_len); strncpy(iov[1].iov_base, sc->vbsc_ident, MIN(iov[1].iov_len, sizeof(sc->vbsc_ident))); - pci_vtblk_done(&io->io_req, 0); + pci_vtblk_done_locked(io, 0); return; default: - pci_vtblk_done(&io->io_req, EOPNOTSUPP); + pci_vtblk_done_locked(io, EOPNOTSUPP); return; } assert(err == 0); @@ -332,10 +428,14 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst * io->io_idx = i; } + bcopy(&vtblk_vi_consts, &sc->vbsc_consts, sizeof (vtblk_vi_consts)); + if (blockif_candelete(sc->bc)) + sc->vbsc_consts.vc_hv_caps |= VTBLK_F_DISCARD; + pthread_mutex_init(&sc->vsc_mtx, NULL); /* init virtio softc and virtqueues */ - vi_softc_linkup(&sc->vbsc_vs, &vtblk_vi_consts, sc, pi, &sc->vbsc_vq); + vi_softc_linkup(&sc->vbsc_vs, &sc->vbsc_consts, sc, pi, &sc->vbsc_vq); sc->vbsc_vs.vs_mtx = &sc->vsc_mtx; sc->vbsc_vq.vq_qsize = VTBLK_RINGSZ; @@ -353,7 +453,7 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst * digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); /* setup virtio block config space */ - sc->vbsc_cfg.vbc_capacity = size / DEV_BSIZE; /* 512-byte units */ + sc->vbsc_cfg.vbc_capacity = size / VTBLK_BSIZE; /* 512-byte units */ sc->vbsc_cfg.vbc_size_max = 0; /* not negotiated */ /* @@ -375,6 +475,9 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst * sc->vbsc_cfg.vbc_topology.min_io_size = 0; sc->vbsc_cfg.vbc_topology.opt_io_size = 0; sc->vbsc_cfg.vbc_writeback = 0; + sc->vbsc_cfg.max_discard_sectors = VTBLK_MAX_DISCARD_SECT; + sc->vbsc_cfg.max_discard_seg = VTBLK_MAX_DISCARD_SEG; + sc->vbsc_cfg.discard_sector_alignment = sectsz / VTBLK_BSIZE; /* * Should we move some of this into virtio.c? Could From owner-svn-src-all@freebsd.org Mon Sep 14 00:44:51 2020 Return-Path: Delivered-To: svn-src-all@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 2B34D3EDF56; Mon, 14 Sep 2020 00:44:51 +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 4BqSLW0Hzkz412q; Mon, 14 Sep 2020 00:44:51 +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 E1827ED1F; Mon, 14 Sep 2020 00:44:50 +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 08E0iokI075596; Mon, 14 Sep 2020 00:44:50 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08E0ioU6075595; Mon, 14 Sep 2020 00:44:50 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202009140044.08E0ioU6075595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 14 Sep 2020 00:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365703 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 365703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 00:44:51 -0000 Author: rmacklem Date: Mon Sep 14 00:44:50 2020 New Revision: 365703 URL: https://svnweb.freebsd.org/changeset/base/365703 Log: Fix a case where the NFSv4.0 server might crash if delegations are enabled. asomers@ reported a crash on an NFSv4.0 server with a backtrace of: kdb_backtrace vpanic panic nfsrv_docallback nfsrv_checkgetattr nfsrvd_getattr nfsrvd_dorpc nfssvc_program svc_run_internal svc_thread_start fork_exit fork_trampoline where the panic message was "docallb", which indicates that a callback was attempted when the ClientID is unconfirmed. This would not normally occur, but it is possible to have an unconfirmed ClientID structure with delegation structure(s) chained off it if the client were to issue a SetClientID with the same "id" but different "verifier" after acquiring delegations on the previously confirmed ClientID. The bug appears to be that nfsrv_checkgetattr() failed to check for this uncommon case of an unconfirmed ClientID with a delegation structure that no longer refers to a delegation the client knows about. This patch adds a check for this case, handling it as if no delegation exists, which is the case when the above occurs. Although difficult to reproduce, this change should avoid the panic(). PR: 249127 Reported by: asomers Reviewed by: asomers MFC after: 1 week Differential Revision: https://reviews.freebbsd.org/D26342 Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Sun Sep 13 23:51:07 2020 (r365702) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Mon Sep 14 00:44:50 2020 (r365703) @@ -5707,8 +5707,14 @@ nfsrv_checkgetattr(struct nfsrv_descript *nd, vnode_t goto out; } clp = stp->ls_clp; - delegfilerev = stp->ls_filerev; + /* If the clientid is not confirmed, ignore the delegation. */ + if (clp->lc_flags & LCL_NEEDSCONFIRM) { + NFSUNLOCKSTATE(); + goto out; + } + + delegfilerev = stp->ls_filerev; /* * If the Write delegation was issued as a part of this Compound RPC * or if we have an Implied Clientid (used in a previous Op in this From owner-svn-src-all@freebsd.org Mon Sep 14 01:20:57 2020 Return-Path: Delivered-To: svn-src-all@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 D85B33EEF42; Mon, 14 Sep 2020 01:20:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BqT895R5cz423y; Mon, 14 Sep 2020 01:20:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DFC5F51D; Mon, 14 Sep 2020 01:20:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08E1Kvdt095991; Mon, 14 Sep 2020 01:20:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08E1KvAj095990; Mon, 14 Sep 2020 01:20:57 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009140120.08E1KvAj095990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 14 Sep 2020 01:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365704 - stable/12/usr.sbin/ntp/ntpd X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.sbin/ntp/ntpd X-SVN-Commit-Revision: 365704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 01:20:57 -0000 Author: emaste Date: Mon Sep 14 01:20:57 2020 New Revision: 365704 URL: https://svnweb.freebsd.org/changeset/base/365704 Log: MFC r365422: ntp: whitespace and typo fix in conf file PR: 248942 Submitted by: Jose Luis Duran (whitespace), igor (typo) Modified: stable/12/usr.sbin/ntp/ntpd/ntp.conf Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/ntp/ntpd/ntp.conf ============================================================================== --- stable/12/usr.sbin/ntp/ntpd/ntp.conf Mon Sep 14 00:44:50 2020 (r365703) +++ stable/12/usr.sbin/ntp/ntpd/ntp.conf Mon Sep 14 01:20:57 2020 (r365704) @@ -14,8 +14,8 @@ # Set the target and limit for adding servers configured via pool statements # or discovered dynamically via mechanisms such as broadcast and manycast. # Ntpd automatically adds maxclock-1 servers from configured pools, and may -# add as many as maxclock*2 if necessary to ensure that at least minclock -# servers are providing good consistant time. +# add as many as maxclock*2 if necessary to ensure that at least minclock +# servers are providing good consistent time. # tos minclock 3 maxclock 6 From owner-svn-src-all@freebsd.org Mon Sep 14 01:56:29 2020 Return-Path: Delivered-To: svn-src-all@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 BB4B53EF69D; Mon, 14 Sep 2020 01:56:29 +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 4BqTx94WlKz4399; Mon, 14 Sep 2020 01:56:29 +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 7DEE3F755; Mon, 14 Sep 2020 01:56:29 +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 08E1uT2w018788; Mon, 14 Sep 2020 01:56:29 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08E1uTLf018787; Mon, 14 Sep 2020 01:56:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009140156.08E1uTLf018787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 14 Sep 2020 01:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365705 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 365705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 01:56:29 -0000 Author: kevans Date: Mon Sep 14 01:56:29 2020 New Revision: 365705 URL: https://svnweb.freebsd.org/changeset/base/365705 Log: __FreeBSD_version bump for r365605 (crunchgen producing WARNS-clean) The change in D26397 will need a __FreeBSD_version to base off of for bootstrapping crunchgen, to avoid avoidable build failures just because the host has an outdated crunchgen. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Sep 14 01:20:57 2020 (r365704) +++ head/sys/sys/param.h Mon Sep 14 01:56:29 2020 (r365705) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300114 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300115 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Mon Sep 14 05:58:16 2020 Return-Path: Delivered-To: svn-src-all@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 09E633F3F0E; Mon, 14 Sep 2020 05:58: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 4BqbJ76vrPz4Gwc; Mon, 14 Sep 2020 05:58:15 +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 B6D1F1297C; Mon, 14 Sep 2020 05:58:15 +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 08E5wFFH066792; Mon, 14 Sep 2020 05:58:15 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08E5wCX6066778; Mon, 14 Sep 2020 05:58:12 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <202009140558.08E5wCX6066778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Mon, 14 Sep 2020 05:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365706 - in head/sys: arm/arm arm64/arm64 dev/mpr dev/mps kern mips/mips powerpc/powerpc riscv/riscv sys x86/x86 X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys: arm/arm arm64/arm64 dev/mpr dev/mps kern mips/mips powerpc/powerpc riscv/riscv sys x86/x86 X-SVN-Commit-Revision: 365706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 05:58:16 -0000 Author: scottl Date: Mon Sep 14 05:58:12 2020 New Revision: 365706 URL: https://svnweb.freebsd.org/changeset/base/365706 Log: Refine the busdma template interface. Provide tools for filling in fields that can be extended, but also ensure compile-time type checking. Refactor common code out of arch-specific implementations. Move the mpr and mps drivers to this new API. The template type remains visible to the consumer so that it can be allocated on the stack, but should be considered opaque. Modified: head/sys/arm/arm/busdma_machdep.c head/sys/arm64/arm64/busdma_machdep.c head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_pci.c head/sys/dev/mpr/mpr_user.c head/sys/dev/mps/mps.c head/sys/dev/mps/mps_pci.c head/sys/dev/mps/mps_user.c head/sys/kern/subr_bus_dma.c head/sys/mips/mips/busdma_machdep.c head/sys/powerpc/powerpc/busdma_machdep.c head/sys/riscv/riscv/busdma_machdep.c head/sys/sys/bus_dma.h head/sys/x86/x86/busdma_machdep.c Modified: head/sys/arm/arm/busdma_machdep.c ============================================================================== --- head/sys/arm/arm/busdma_machdep.c Mon Sep 14 01:56:29 2020 (r365705) +++ head/sys/arm/arm/busdma_machdep.c Mon Sep 14 05:58:12 2020 (r365706) @@ -577,38 +577,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t al } void -bus_dma_template_init(bus_dma_tag_template_t *t, bus_dma_tag_t parent) -{ - - if (t == NULL) - return; - - t->parent = parent; - t->alignment = 1; - t->boundary = 0; - t->lowaddr = t->highaddr = BUS_SPACE_MAXADDR; - t->maxsize = t->maxsegsize = BUS_SPACE_MAXSIZE; - t->nsegments = BUS_SPACE_UNRESTRICTED; - t->lockfunc = NULL; - t->lockfuncarg = NULL; - t->flags = 0; -} - -int -bus_dma_template_tag(bus_dma_tag_template_t *t, bus_dma_tag_t *dmat) -{ - - if (t == NULL || dmat == NULL) - return (EINVAL); - - return (bus_dma_tag_create(t->parent, t->alignment, t->boundary, - t->lowaddr, t->highaddr, NULL, NULL, t->maxsize, - t->nsegments, t->maxsegsize, t->flags, t->lockfunc, t->lockfuncarg, - dmat)); -} - -void -bus_dma_template_clone(bus_dma_tag_template_t *t, bus_dma_tag_t dmat) +bus_dma_template_clone(bus_dma_template_t *t, bus_dma_tag_t dmat) { if (t == NULL || dmat == NULL) Modified: head/sys/arm64/arm64/busdma_machdep.c ============================================================================== --- head/sys/arm64/arm64/busdma_machdep.c Mon Sep 14 01:56:29 2020 (r365705) +++ head/sys/arm64/arm64/busdma_machdep.c Mon Sep 14 05:58:12 2020 (r365706) @@ -215,38 +215,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t al } void -bus_dma_template_init(bus_dma_tag_template_t *t, bus_dma_tag_t parent) -{ - - if (t == NULL) - return; - - t->parent = parent; - t->alignment = 1; - t->boundary = 0; - t->lowaddr = t->highaddr = BUS_SPACE_MAXADDR; - t->maxsize = t->maxsegsize = BUS_SPACE_MAXSIZE; - t->nsegments = BUS_SPACE_UNRESTRICTED; - t->lockfunc = NULL; - t->lockfuncarg = NULL; - t->flags = 0; -} - -int -bus_dma_template_tag(bus_dma_tag_template_t *t, bus_dma_tag_t *dmat) -{ - - if (t == NULL || dmat == NULL) - return (EINVAL); - - return (bus_dma_tag_create(t->parent, t->alignment, t->boundary, - t->lowaddr, t->highaddr, NULL, NULL, t->maxsize, - t->nsegments, t->maxsegsize, t->flags, t->lockfunc, t->lockfuncarg, - dmat)); -} - -void -bus_dma_template_clone(bus_dma_tag_template_t *t, bus_dma_tag_t dmat) +bus_dma_template_clone(bus_dma_template_t *t, bus_dma_tag_t dmat) { struct bus_dma_tag_common *common; Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Mon Sep 14 01:56:29 2020 (r365705) +++ head/sys/dev/mpr/mpr.c Mon Sep 14 05:58:12 2020 (r365706) @@ -1310,7 +1310,7 @@ mpr_alloc_queues(struct mpr_softc *sc) static int mpr_alloc_hw_queues(struct mpr_softc *sc) { - bus_dma_tag_template_t t; + bus_dma_template_t t; bus_addr_t queues_busaddr; uint8_t *queues; int qsize, fqsize, pqsize; @@ -1333,10 +1333,9 @@ mpr_alloc_hw_queues(struct mpr_softc *sc) qsize = fqsize + pqsize; bus_dma_template_init(&t, sc->mpr_parent_dmat); - t.alignment = 16; - t.lowaddr = BUS_SPACE_MAXADDR_32BIT; - t.maxsize = t.maxsegsize = qsize; - t.nsegments = 1; + BUS_DMA_TEMPLATE_FILL(&t, BD_ALIGNMENT(16), BD_MAXSIZE(qsize), + BD_MAXSEGSIZE(qsize), BD_NSEGMENTS(1), + BD_LOWADDR(BUS_SPACE_MAXADDR_32BIT)); if (bus_dma_template_tag(&t, &sc->queues_dmat)) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate queues DMA tag\n"); return (ENOMEM); @@ -1365,7 +1364,7 @@ mpr_alloc_hw_queues(struct mpr_softc *sc) static int mpr_alloc_replies(struct mpr_softc *sc) { - bus_dma_tag_template_t t; + bus_dma_template_t t; int rsize, num_replies; /* Store the reply frame size in bytes rather than as 32bit words */ @@ -1380,10 +1379,9 @@ mpr_alloc_replies(struct mpr_softc *sc) rsize = sc->replyframesz * num_replies; bus_dma_template_init(&t, sc->mpr_parent_dmat); - t.alignment = 4; - t.lowaddr = BUS_SPACE_MAXADDR_32BIT; - t.maxsize = t.maxsegsize = rsize; - t.nsegments = 1; + BUS_DMA_TEMPLATE_FILL(&t, BD_ALIGNMENT(4), BD_MAXSIZE(rsize), + BD_MAXSEGSIZE(rsize), BD_NSEGMENTS(1), + BD_LOWADDR(BUS_SPACE_MAXADDR_32BIT)); if (bus_dma_template_tag(&t, &sc->reply_dmat)) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate replies DMA tag\n"); return (ENOMEM); @@ -1431,16 +1429,15 @@ mpr_load_chains_cb(void *arg, bus_dma_segment_t *segs, static int mpr_alloc_requests(struct mpr_softc *sc) { - bus_dma_tag_template_t t; + bus_dma_template_t t; struct mpr_command *cm; int i, rsize, nsegs; rsize = sc->reqframesz * sc->num_reqs; bus_dma_template_init(&t, sc->mpr_parent_dmat); - t.alignment = 16; - t.lowaddr = BUS_SPACE_MAXADDR_32BIT; - t.maxsize = t.maxsegsize = rsize; - t.nsegments = 1; + BUS_DMA_TEMPLATE_FILL(&t, BD_ALIGNMENT(16), BD_MAXSIZE(rsize), + BD_MAXSEGSIZE(rsize), BD_NSEGMENTS(1), + BD_LOWADDR(BUS_SPACE_MAXADDR_32BIT)); if (bus_dma_template_tag(&t, &sc->req_dmat)) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate request DMA tag\n"); return (ENOMEM); @@ -1464,9 +1461,8 @@ mpr_alloc_requests(struct mpr_softc *sc) } rsize = sc->chain_frame_size * sc->num_chains; bus_dma_template_init(&t, sc->mpr_parent_dmat); - t.alignment = 16; - t.maxsize = t.maxsegsize = rsize; - t.nsegments = howmany(rsize, PAGE_SIZE); + BUS_DMA_TEMPLATE_FILL(&t, BD_ALIGNMENT(16), BD_MAXSIZE(rsize), + BD_MAXSEGSIZE(rsize), BD_NSEGMENTS((howmany(rsize, PAGE_SIZE)))); if (bus_dma_template_tag(&t, &sc->chain_dmat)) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate chain DMA tag\n"); return (ENOMEM); @@ -1486,7 +1482,8 @@ mpr_alloc_requests(struct mpr_softc *sc) rsize = MPR_SENSE_LEN * sc->num_reqs; bus_dma_template_clone(&t, sc->req_dmat); - t.maxsize = t.maxsegsize = rsize; + BUS_DMA_TEMPLATE_FILL(&t, BD_ALIGNMENT(1), BD_MAXSIZE(rsize), + BD_MAXSEGSIZE(rsize)); if (bus_dma_template_tag(&t, &sc->sense_dmat)) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate sense DMA tag\n"); return (ENOMEM); @@ -1514,10 +1511,10 @@ mpr_alloc_requests(struct mpr_softc *sc) nsegs = (sc->maxio / PAGE_SIZE) + 1; bus_dma_template_init(&t, sc->mpr_parent_dmat); - t.nsegments = nsegs; - t.flags = BUS_DMA_ALLOCNOW; - t.lockfunc = busdma_lock_mutex; - t.lockfuncarg = &sc->mpr_mtx; + BUS_DMA_TEMPLATE_FILL(&t, BD_MAXSIZE(BUS_SPACE_MAXSIZE_32BIT), + BD_NSEGMENTS(nsegs), BD_MAXSEGSIZE(BUS_SPACE_MAXSIZE_32BIT), + BD_FLAGS(BUS_DMA_ALLOCNOW), BD_LOCKFUNC(busdma_lock_mutex), + BD_LOCKFUNCARG(&sc->mpr_mtx)); if (bus_dma_template_tag(&t, &sc->buffer_dmat)) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate buffer DMA tag\n"); return (ENOMEM); @@ -1571,7 +1568,7 @@ mpr_alloc_requests(struct mpr_softc *sc) static int mpr_alloc_nvme_prp_pages(struct mpr_softc *sc) { - bus_dma_tag_template_t t; + bus_dma_template_t t; struct mpr_prp_page *prp_page; int PRPs_per_page, PRPs_required, pages_required; int rsize, i; @@ -1602,10 +1599,9 @@ mpr_alloc_nvme_prp_pages(struct mpr_softc *sc) sc->prp_buffer_size = PAGE_SIZE * pages_required; rsize = sc->prp_buffer_size * NVME_QDEPTH; bus_dma_template_init(&t, sc->mpr_parent_dmat); - t.alignment = 4; - t.lowaddr = BUS_SPACE_MAXADDR_32BIT; - t.maxsize = t.maxsegsize = rsize; - t.nsegments = 1; + BUS_DMA_TEMPLATE_FILL(&t, BD_ALIGNMENT(4), BD_MAXSIZE(rsize), + BD_MAXSEGSIZE(rsize), BD_NSEGMENTS(1), + BD_LOWADDR(BUS_SPACE_MAXADDR_32BIT)); if (bus_dma_template_tag(&t, &sc->prp_page_dmat)) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate NVMe PRP DMA " "tag\n"); Modified: head/sys/dev/mpr/mpr_pci.c ============================================================================== --- head/sys/dev/mpr/mpr_pci.c Mon Sep 14 01:56:29 2020 (r365705) +++ head/sys/dev/mpr/mpr_pci.c Mon Sep 14 05:58:12 2020 (r365706) @@ -218,7 +218,7 @@ mpr_pci_probe(device_t dev) static int mpr_pci_attach(device_t dev) { - bus_dma_tag_template_t t; + bus_dma_template_t t; struct mpr_softc *sc; struct mpr_ident *m; int error, i; Modified: head/sys/dev/mpr/mpr_user.c ============================================================================== --- head/sys/dev/mpr/mpr_user.c Mon Sep 14 01:56:29 2020 (r365705) +++ head/sys/dev/mpr/mpr_user.c Mon Sep 14 05:58:12 2020 (r365706) @@ -1443,7 +1443,7 @@ static int mpr_diag_register(struct mpr_softc *sc, mpr_fw_diag_register_t *diag_register, uint32_t *return_code) { - bus_dma_tag_template_t t; + bus_dma_template_t t; mpr_fw_diagnostic_buffer_t *pBuffer; struct mpr_busdma_context *ctx; uint8_t extended_type, buffer_type, i; @@ -1507,9 +1507,9 @@ mpr_diag_register(struct mpr_softc *sc, mpr_fw_diag_re return (MPR_DIAG_FAILURE); } bus_dma_template_init(&t, sc->mpr_parent_dmat); - t.lowaddr = BUS_SPACE_MAXADDR_32BIT; - t.maxsize = t.maxsegsize = buffer_size; - t.nsegments = 1; + BUS_DMA_TEMPLATE_FILL(&t, BD_LOWADDR(BUS_SPACE_MAXADDR_32BIT), + BD_MAXSIZE(buffer_size), BD_MAXSEGSIZE(buffer_size), + BD_NSEGMENTS(1)); if (bus_dma_template_tag(&t, &sc->fw_diag_dmat)) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate FW diag buffer DMA tag\n"); Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Mon Sep 14 01:56:29 2020 (r365705) +++ head/sys/dev/mps/mps.c Mon Sep 14 05:58:12 2020 (r365706) @@ -1278,7 +1278,7 @@ mps_alloc_queues(struct mps_softc *sc) static int mps_alloc_hw_queues(struct mps_softc *sc) { - bus_dma_tag_template_t t; + bus_dma_template_t t; bus_addr_t queues_busaddr; uint8_t *queues; int qsize, fqsize, pqsize; @@ -1301,10 +1301,9 @@ mps_alloc_hw_queues(struct mps_softc *sc) qsize = fqsize + pqsize; bus_dma_template_init(&t, sc->mps_parent_dmat); - t.alignment = 16; - t.lowaddr = BUS_SPACE_MAXADDR_32BIT; - t.maxsize = t.maxsegsize = qsize; - t.nsegments = 1; + BUS_DMA_TEMPLATE_FILL(&t, BD_ALIGNMENT(16), BD_MAXSIZE(qsize), + BD_MAXSEGSIZE(qsize), BD_NSEGMENTS(1), + BD_LOWADDR(BUS_SPACE_MAXADDR_32BIT)); if (bus_dma_template_tag(&t, &sc->queues_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate queues DMA tag\n"); return (ENOMEM); @@ -1333,7 +1332,7 @@ mps_alloc_hw_queues(struct mps_softc *sc) static int mps_alloc_replies(struct mps_softc *sc) { - bus_dma_tag_template_t t; + bus_dma_template_t t; int rsize, num_replies; /* Store the reply frame size in bytes rather than as 32bit words */ @@ -1348,10 +1347,9 @@ mps_alloc_replies(struct mps_softc *sc) rsize = sc->replyframesz * num_replies; bus_dma_template_init(&t, sc->mps_parent_dmat); - t.alignment = 4; - t.lowaddr = BUS_SPACE_MAXADDR_32BIT; - t.maxsize = t.maxsegsize = rsize; - t.nsegments = 1; + BUS_DMA_TEMPLATE_FILL(&t, BD_ALIGNMENT(4), BD_MAXSIZE(rsize), + BD_MAXSEGSIZE(rsize), BD_NSEGMENTS(1), + BD_LOWADDR(BUS_SPACE_MAXADDR_32BIT)); if (bus_dma_template_tag(&t, &sc->reply_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate replies DMA tag\n"); return (ENOMEM); @@ -1400,16 +1398,15 @@ mps_load_chains_cb(void *arg, bus_dma_segment_t *segs, static int mps_alloc_requests(struct mps_softc *sc) { - bus_dma_tag_template_t t; + bus_dma_template_t t; struct mps_command *cm; int i, rsize, nsegs; rsize = sc->reqframesz * sc->num_reqs; bus_dma_template_init(&t, sc->mps_parent_dmat); - t.alignment = 16; - t.lowaddr = BUS_SPACE_MAXADDR_32BIT; - t.maxsize = t.maxsegsize = rsize; - t.nsegments = 1; + BUS_DMA_TEMPLATE_FILL(&t, BD_ALIGNMENT(16), BD_MAXSIZE(rsize), + BD_MAXSEGSIZE(rsize), BD_NSEGMENTS(1), + BD_LOWADDR(BUS_SPACE_MAXADDR_32BIT)); if (bus_dma_template_tag(&t, &sc->req_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate request DMA tag\n"); return (ENOMEM); @@ -1433,8 +1430,8 @@ mps_alloc_requests(struct mps_softc *sc) } rsize = sc->reqframesz * sc->num_chains; bus_dma_template_clone(&t, sc->req_dmat); - t.maxsize = t.maxsegsize = rsize; - t.nsegments = howmany(rsize, PAGE_SIZE); + BUS_DMA_TEMPLATE_FILL(&t, BD_MAXSIZE(rsize), BD_MAXSEGSIZE(rsize), + BD_NSEGMENTS(howmany(rsize, PAGE_SIZE))); if (bus_dma_template_tag(&t, &sc->chain_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate chain DMA tag\n"); return (ENOMEM); @@ -1454,8 +1451,8 @@ mps_alloc_requests(struct mps_softc *sc) rsize = MPS_SENSE_LEN * sc->num_reqs; bus_dma_template_clone(&t, sc->req_dmat); - t.maxsize = t.maxsegsize = rsize; - t.alignment = 1; + BUS_DMA_TEMPLATE_FILL(&t, BD_ALIGNMENT(1), BD_MAXSIZE(rsize), + BD_MAXSEGSIZE(rsize)); if (bus_dma_template_tag(&t, &sc->sense_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate sense DMA tag\n"); return (ENOMEM); @@ -1473,12 +1470,10 @@ mps_alloc_requests(struct mps_softc *sc) nsegs = (sc->maxio / PAGE_SIZE) + 1; bus_dma_template_init(&t, sc->mps_parent_dmat); - t.maxsize = BUS_SPACE_MAXSIZE_32BIT; - t.nsegments = nsegs; - t.maxsegsize = BUS_SPACE_MAXSIZE_24BIT; - t.flags = BUS_DMA_ALLOCNOW; - t.lockfunc = busdma_lock_mutex; - t.lockfuncarg = &sc->mps_mtx; + BUS_DMA_TEMPLATE_FILL(&t, BD_MAXSIZE(BUS_SPACE_MAXSIZE_32BIT), + BD_NSEGMENTS(nsegs), BD_MAXSEGSIZE(BUS_SPACE_MAXSIZE_24BIT), + BD_FLAGS(BUS_DMA_ALLOCNOW), BD_LOCKFUNC(busdma_lock_mutex), + BD_LOCKFUNCARG(&sc->mps_mtx)); if (bus_dma_template_tag(&t, &sc->buffer_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate buffer DMA tag\n"); return (ENOMEM); Modified: head/sys/dev/mps/mps_pci.c ============================================================================== --- head/sys/dev/mps/mps_pci.c Mon Sep 14 01:56:29 2020 (r365705) +++ head/sys/dev/mps/mps_pci.c Mon Sep 14 05:58:12 2020 (r365706) @@ -185,7 +185,7 @@ mps_pci_probe(device_t dev) static int mps_pci_attach(device_t dev) { - bus_dma_tag_template_t t; + bus_dma_template_t t; struct mps_softc *sc; struct mps_ident *m; int error; Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Mon Sep 14 01:56:29 2020 (r365705) +++ head/sys/dev/mps/mps_user.c Mon Sep 14 05:58:12 2020 (r365706) @@ -1346,7 +1346,7 @@ static int mps_diag_register(struct mps_softc *sc, mps_fw_diag_register_t *diag_register, uint32_t *return_code) { - bus_dma_tag_template_t t; + bus_dma_template_t t; mps_fw_diagnostic_buffer_t *pBuffer; struct mps_busdma_context *ctx; uint8_t extended_type, buffer_type, i; @@ -1410,9 +1410,8 @@ mps_diag_register(struct mps_softc *sc, mps_fw_diag_re return (MPS_DIAG_FAILURE); } bus_dma_template_init(&t, sc->mps_parent_dmat); - t.lowaddr = BUS_SPACE_MAXADDR_32BIT; - t.maxsize = t.maxsegsize = buffer_size; - t.nsegments = 1; + BUS_DMA_TEMPLATE_FILL(&t, BD_NSEGMENTS(1), BD_MAXSIZE(buffer_size), + BD_MAXSEGSIZE(buffer_size), BD_LOWADDR(BUS_SPACE_MAXADDR_32BIT)); if (bus_dma_template_tag(&t, &sc->fw_diag_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate FW diag buffer DMA tag\n"); Modified: head/sys/kern/subr_bus_dma.c ============================================================================== --- head/sys/kern/subr_bus_dma.c Mon Sep 14 01:56:29 2020 (r365705) +++ head/sys/kern/subr_bus_dma.c Mon Sep 14 05:58:12 2020 (r365706) @@ -700,3 +700,88 @@ bus_dmamap_load_crp(bus_dma_tag_t dmat, bus_dmamap_t m return (bus_dmamap_load_crp_buffer(dmat, map, &crp->crp_buf, callback, callback_arg, flags)); } + +void +bus_dma_template_init(bus_dma_template_t *t, bus_dma_tag_t parent) +{ + + if (t == NULL) + return; + + t->parent = parent; + t->alignment = 1; + t->boundary = 0; + t->lowaddr = t->highaddr = BUS_SPACE_MAXADDR; + t->maxsize = t->maxsegsize = BUS_SPACE_MAXSIZE; + t->nsegments = BUS_SPACE_UNRESTRICTED; + t->lockfunc = NULL; + t->lockfuncarg = NULL; + t->flags = 0; +} + +int +bus_dma_template_tag(bus_dma_template_t *t, bus_dma_tag_t *dmat) +{ + + if (t == NULL || dmat == NULL) + return (EINVAL); + + return (bus_dma_tag_create(t->parent, t->alignment, t->boundary, + t->lowaddr, t->highaddr, NULL, NULL, t->maxsize, + t->nsegments, t->maxsegsize, t->flags, t->lockfunc, t->lockfuncarg, + dmat)); +} + +void +bus_dma_template_fill(bus_dma_template_t *t, bus_dma_param_t *kv, u_int count) +{ + bus_dma_param_t *pkv; + + while (count) { + pkv = &kv[--count]; + switch (pkv->key) { + case BD_PARAM_PARENT: + t->parent = pkv->ptr; + break; + case BD_PARAM_ALIGNMENT: + t->alignment = pkv->num; + break; + case BD_PARAM_BOUNDARY: + t->boundary = pkv->num; + break; + case BD_PARAM_LOWADDR: + t->lowaddr = pkv->pa; + break; + case BD_PARAM_HIGHADDR: + t->highaddr = pkv->pa; + break; + case BD_PARAM_MAXSIZE: + t->maxsize = pkv->num; + break; + case BD_PARAM_NSEGMENTS: + t->nsegments = pkv->num; + break; + case BD_PARAM_MAXSEGSIZE: + t->maxsegsize = pkv->num; + break; + case BD_PARAM_FLAGS: + t->flags = pkv->num; + break; + case BD_PARAM_LOCKFUNC: + t->lockfunc = pkv->ptr; + break; + case BD_PARAM_LOCKFUNCARG: + t->lockfuncarg = pkv->ptr; + break; + case BD_PARAM_NAME: + t->name = pkv->ptr; + break; + case BD_PARAM_INVALID: + default: + KASSERT(0, ("Invalid key %d\n", pkv->key)); + break; + } + } + return; +} + Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Mon Sep 14 01:56:29 2020 (r365705) +++ head/sys/mips/mips/busdma_machdep.c Mon Sep 14 05:58:12 2020 (r365706) @@ -478,38 +478,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t al } void -bus_dma_template_init(bus_dma_tag_template_t *t, bus_dma_tag_t parent) -{ - - if (t == NULL) - return; - - t->parent = parent; - t->alignment = 1; - t->boundary = 0; - t->lowaddr = t->highaddr = BUS_SPACE_MAXADDR; - t->maxsize = t->maxsegsize = BUS_SPACE_MAXSIZE; - t->nsegments = BUS_SPACE_UNRESTRICTED; - t->lockfunc = NULL; - t->lockfuncarg = NULL; - t->flags = 0; -} - -int -bus_dma_template_tag(bus_dma_tag_template_t *t, bus_dma_tag_t *dmat) -{ - - if (t == NULL || dmat == NULL) - return (EINVAL); - - return (bus_dma_tag_create(t->parent, t->alignment, t->boundary, - t->lowaddr, t->highaddr, NULL, NULL, t->maxsize, - t->nsegments, t->maxsegsize, t->flags, t->lockfunc, t->lockfuncarg, - dmat)); -} - -void -bus_dma_template_clone(bus_dma_tag_template_t *t, bus_dma_tag_t dmat) +bus_dma_template_clone(bus_dma_template_t *t, bus_dma_tag_t dmat) { if (t == NULL || dmat == NULL) Modified: head/sys/powerpc/powerpc/busdma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/busdma_machdep.c Mon Sep 14 01:56:29 2020 (r365705) +++ head/sys/powerpc/powerpc/busdma_machdep.c Mon Sep 14 05:58:12 2020 (r365706) @@ -342,38 +342,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t al } void -bus_dma_template_init(bus_dma_tag_template_t *t, bus_dma_tag_t parent) -{ - - if (t == NULL) - return; - - t->parent = parent; - t->alignment = 1; - t->boundary = 0; - t->lowaddr = t->highaddr = BUS_SPACE_MAXADDR; - t->maxsize = t->maxsegsize = BUS_SPACE_MAXSIZE; - t->nsegments = BUS_SPACE_UNRESTRICTED; - t->lockfunc = NULL; - t->lockfuncarg = NULL; - t->flags = 0; -} - -int -bus_dma_template_tag(bus_dma_tag_template_t *t, bus_dma_tag_t *dmat) -{ - - if (t == NULL || dmat == NULL) - return (EINVAL); - - return (bus_dma_tag_create(t->parent, t->alignment, t->boundary, - t->lowaddr, t->highaddr, NULL, NULL, t->maxsize, - t->nsegments, t->maxsegsize, t->flags, t->lockfunc, t->lockfuncarg, - dmat)); -} - -void -bus_dma_template_clone(bus_dma_tag_template_t *t, bus_dma_tag_t dmat) +bus_dma_template_clone(bus_dma_template_t *t, bus_dma_tag_t dmat) { if (t == NULL || dmat == NULL) Modified: head/sys/riscv/riscv/busdma_machdep.c ============================================================================== --- head/sys/riscv/riscv/busdma_machdep.c Mon Sep 14 01:56:29 2020 (r365705) +++ head/sys/riscv/riscv/busdma_machdep.c Mon Sep 14 05:58:12 2020 (r365706) @@ -215,38 +215,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t al } void -bus_dma_template_init(bus_dma_tag_template_t *t, bus_dma_tag_t parent) -{ - - if (t == NULL) - return; - - t->parent = parent; - t->alignment = 1; - t->boundary = 0; - t->lowaddr = t->highaddr = BUS_SPACE_MAXADDR; - t->maxsize = t->maxsegsize = BUS_SPACE_MAXSIZE; - t->nsegments = BUS_SPACE_UNRESTRICTED; - t->lockfunc = NULL; - t->lockfuncarg = NULL; - t->flags = 0; -} - -int -bus_dma_template_tag(bus_dma_tag_template_t *t, bus_dma_tag_t *dmat) -{ - - if (t == NULL || dmat == NULL) - return (EINVAL); - - return (bus_dma_tag_create(t->parent, t->alignment, t->boundary, - t->lowaddr, t->highaddr, NULL, NULL, t->maxsize, - t->nsegments, t->maxsegsize, t->flags, t->lockfunc, t->lockfuncarg, - dmat)); -} - -void -bus_dma_template_clone(bus_dma_tag_template_t *t, bus_dma_tag_t dmat) +bus_dma_template_clone(bus_dma_template_t *t, bus_dma_tag_t dmat) { struct bus_dma_tag_common *common; Modified: head/sys/sys/bus_dma.h ============================================================================== --- head/sys/sys/bus_dma.h Mon Sep 14 01:56:29 2020 (r365705) +++ head/sys/sys/bus_dma.h Mon Sep 14 05:58:12 2020 (r365706) @@ -181,7 +181,13 @@ int bus_dma_tag_create(bus_dma_tag_t parent, bus_size_ bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, void *lockfuncarg, bus_dma_tag_t *dmat); -/* Functions for creating and cloning tags via a template */ +/* + * Functions for creating and cloning tags via a template, + * + * bus_dma_template_t is made avaialble publicly so it can be allocated + * from the caller stack. Its contents should be considered private, and + * should only be accessed via the documented APIs and macros + */ typedef struct { bus_dma_tag_t parent; bus_size_t alignment; @@ -194,10 +200,63 @@ typedef struct { int flags; bus_dma_lock_t *lockfunc; void *lockfuncarg; -} bus_dma_tag_template_t; -void bus_dma_template_init(bus_dma_tag_template_t *t, bus_dma_tag_t parent); -int bus_dma_template_tag(bus_dma_tag_template_t *t, bus_dma_tag_t *dmat); -void bus_dma_template_clone(bus_dma_tag_template_t *t, bus_dma_tag_t dmat); + const char *name; +} bus_dma_template_t; + +/* + * These enum values should not be re-ordered. BD_PARAM_INVALID is an + * invalid key and will trigger a panic. + */ +typedef enum { + BD_PARAM_INVALID = 0, + BD_PARAM_PARENT = 1, + BD_PARAM_ALIGNMENT = 2, + BD_PARAM_BOUNDARY = 3, + BD_PARAM_LOWADDR = 4, + BD_PARAM_HIGHADDR = 5, + BD_PARAM_MAXSIZE = 6, + BD_PARAM_NSEGMENTS = 7, + BD_PARAM_MAXSEGSIZE = 8, + BD_PARAM_FLAGS = 9, + BD_PARAM_LOCKFUNC = 10, + BD_PARAM_LOCKFUNCARG = 11, + BD_PARAM_NAME = 12 +} bus_dma_param_key_t; + +/* These contents should also be considered private */ +typedef struct { + bus_dma_param_key_t key; + union { + void *ptr; + vm_paddr_t pa; + uintmax_t num; + }; +} bus_dma_param_t; + +#define BD_PARENT(val) { BD_PARAM_PARENT, .ptr = val } +#define BD_ALIGNMENT(val) { BD_PARAM_ALIGNMENT, .num = val } +#define BD_BOUNDARY(val) { BD_PARAM_BOUNDARY, .num = val } +#define BD_LOWADDR(val) { BD_PARAM_LOWADDR, .pa = val } +#define BD_HIGHADDR(val) { BD_PARAM_HIGHADDR, .pa = val } +#define BD_MAXSIZE(val) { BD_PARAM_MAXSIZE, .num = val } +#define BD_NSEGMENTS(val) { BD_PARAM_NSEGMENTS, .num = val } +#define BD_MAXSEGSIZE(val) { BD_PARAM_MAXSEGSIZE, .num = val } +#define BD_FLAGS(val) { BD_PARAM_FLAGS, .num = val } +#define BD_LOCKFUNC(val) { BD_PARAM_LOCKFUNC, .ptr = val } +#define BD_LOCKFUNCARG(val) { BD_PARAM_LOCKFUNCARG, .ptr = val } +#define BD_NAME(val) { BD_PARAM_NAME, .ptr = val } + +#define BUS_DMA_TEMPLATE_FILL(t, kv...) \ +do { \ + bus_dma_param_t pm[] = { kv }; \ + bus_dma_template_fill(t, pm, howmany(sizeof(pm), sizeof(pm[0]))); \ +} while (0) + +void bus_dma_template_init(bus_dma_template_t *t, bus_dma_tag_t parent); +int bus_dma_template_tag(bus_dma_template_t *t, bus_dma_tag_t *dmat); +void bus_dma_template_clone(bus_dma_template_t *t, bus_dma_tag_t dmat); +void bus_dma_template_fill(bus_dma_template_t *t, bus_dma_param_t *kv, + u_int count); /* * Set the memory domain to be used for allocations. Modified: head/sys/x86/x86/busdma_machdep.c ============================================================================== --- head/sys/x86/x86/busdma_machdep.c Mon Sep 14 01:56:29 2020 (r365705) +++ head/sys/x86/x86/busdma_machdep.c Mon Sep 14 05:58:12 2020 (r365706) @@ -237,38 +237,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t al } void -bus_dma_template_init(bus_dma_tag_template_t *t, bus_dma_tag_t parent) -{ - - if (t == NULL) - return; - - t->parent = parent; - t->alignment = 1; - t->boundary = 0; - t->lowaddr = t->highaddr = BUS_SPACE_MAXADDR; - t->maxsize = t->maxsegsize = BUS_SPACE_MAXSIZE; - t->nsegments = BUS_SPACE_UNRESTRICTED; - t->lockfunc = NULL; - t->lockfuncarg = NULL; - t->flags = 0; -} - -int -bus_dma_template_tag(bus_dma_tag_template_t *t, bus_dma_tag_t *dmat) -{ - - if (t == NULL || dmat == NULL) - return (EINVAL); - - return (bus_dma_tag_create(t->parent, t->alignment, t->boundary, - t->lowaddr, t->highaddr, NULL, NULL, t->maxsize, - t->nsegments, t->maxsegsize, t->flags, t->lockfunc, t->lockfuncarg, - dmat)); -} - -void -bus_dma_template_clone(bus_dma_tag_template_t *t, bus_dma_tag_t dmat) +bus_dma_template_clone(bus_dma_template_t *t, bus_dma_tag_t dmat) { struct bus_dma_tag_common *common; From owner-svn-src-all@freebsd.org Mon Sep 14 06:26:37 2020 Return-Path: Delivered-To: svn-src-all@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 6EF393F44D3; Mon, 14 Sep 2020 06:26: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 4Bqbws2P85z4Hr4; Mon, 14 Sep 2020 06:26: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 359DE125E6; Mon, 14 Sep 2020 06:26: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 08E6QahU084922; Mon, 14 Sep 2020 06:26:36 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08E6Qam0084921; Mon, 14 Sep 2020 06:26:36 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <202009140626.08E6Qam0084921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Mon, 14 Sep 2020 06:26:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365707 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 365707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 06:26:37 -0000 Author: scottl Date: Mon Sep 14 06:26:36 2020 New Revision: 365707 URL: https://svnweb.freebsd.org/changeset/base/365707 Log: Update bus_dma.9 for the expanded template API. Add some clarifying language about the operation of parent tags in templates. Modified: head/share/man/man9/bus_dma.9 Modified: head/share/man/man9/bus_dma.9 ============================================================================== --- head/share/man/man9/bus_dma.9 Mon Sep 14 05:58:12 2020 (r365706) +++ head/share/man/man9/bus_dma.9 Mon Sep 14 06:26:36 2020 (r365707) @@ -63,6 +63,8 @@ .Nm bus_dma_template_init , .Nm bus_dma_template_tag , .Nm bus_dma_template_clone , +.Nm bus_dma_template_fill, +.Nm BUS_DMA_TEMPLATE_FILL, .Nm bus_dmamap_create , .Nm bus_dmamap_destroy , .Nm bus_dmamap_load , @@ -90,19 +92,29 @@ .Fn bus_dma_tag_destroy "bus_dma_tag_t dmat" .Ft void .Fo bus_dma_template_init -.Fa "bus_dma_template_t template" +.Fa "bus_dma_template_t *template" .Fa "bus_dma_tag_t parent" .Fc .Ft int .Fo bus_dma_template_tag -.Fa "bus_dma_template_t template" +.Fa "bus_dma_template_t *template" .Fa "bus_dma_tag_t *dmat" .Fc .Ft void .Fo bus_dma_template_clone -.Fa "bus_dma_template_t template" +.Fa "bus_dma_template_t *template" .Fa "bus_dma_tag_t dmat" .Fc +.Ft void +.Fo bus_dma_template_fill +.Fa "bus_dma_template_t *template" +.Fa "bus_dma_param_t params[]" +.Fa "u_int count" +.Fc +.Fo BUS_DMA_TEMPLATE_FILL +.Fa "bus_dma_template_t *template" +.Fa "bus_dma_param_t param ..." +.Fc .Ft int .Fn bus_dmamap_create "bus_dma_tag_t dmat" "int flags" "bus_dmamap_t *mapp" .Ft int @@ -697,8 +709,12 @@ Initializes a .Fa bus_dma_template_t structure. If the .Fa parent -argument is non-NULL, values from this tag will be copied into the template, -replacing any defaults. +argument is non-NULL, this parent tag is associated with the template and +will be compiled into the dma tag that is later created. The values +of the parent are not copied into the template. During tag creation in +.Fn bus_dma_tag_template , +any parameters from the parent tag that are more restrictive than what is +in the provided template will overwrite what goes into the new tag. .It Fn bus_dma_template_tag "*template" "*dmat" Unpacks a template into a tag, and returns the tag via the .Fa dmat . @@ -712,6 +728,31 @@ The template does not need to be initialized first. A be overwritten by the values contained in the tag. When paired with .Fn bus_dma_template_tag , this function is useful for creating copies of tags. +.It Fn bus_dma_template_fill "*template" "params[]" "count" +Fills in the selected fields of the template with the keyed values from the +.Fa params +array. This is not meant to be called directly, use +.Fn BUS_DMA_TEMPLATE_FILL +instead. +.It Fn BUS_DMA_TEMPLATE_FILL "*template" "param ..." +Fills in the selected fields of the template with a variable number of +key-value parameters. The macros listed below take an argument of the +specified type and encapsulate it into a key-value structure that is directly +usable as a parameter argument. Muliple parameters may be provided at once. +.Bd -literal + BD_PARENT() void * + BD_ALIGNMENT() uintmax_t + BD_BOUNDARY() uintmax_t + BD_LOWADDR() vm_paddr_t + BD_HIGHADDR() vm_paddr_t + BD_MAXSIZE() uintmax_t + BD_NSEGMENTS() uintmax_t + BD_MAXSEGSIZE() uintmax_t + BD_FLAGS() uintmax_t + BD_LOCKFUNC() void * + BD_LOCKFUNCARG() void * +.Ed +.Pp .It Fn bus_dmamap_create "dmat" "flags" "*mapp" Allocates and initializes a DMA map. Arguments are as follows: From owner-svn-src-all@freebsd.org Mon Sep 14 08:51:18 2020 Return-Path: Delivered-To: svn-src-all@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 C30E13F746F; Mon, 14 Sep 2020 08:51:18 +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 4Bqg7p4qstz4Qc6; Mon, 14 Sep 2020 08:51:18 +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 893B414640; Mon, 14 Sep 2020 08:51:18 +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 08E8pINS073514; Mon, 14 Sep 2020 08:51:18 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08E8pICq073513; Mon, 14 Sep 2020 08:51:18 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202009140851.08E8pICq073513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 14 Sep 2020 08:51:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365708 - head/sbin/pfctl/tests X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/sbin/pfctl/tests X-SVN-Commit-Revision: 365708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 08:51:18 -0000 Author: arichardson Date: Mon Sep 14 08:51:18 2020 New Revision: 365708 URL: https://svnweb.freebsd.org/changeset/base/365708 Log: pfctl_test: avoid 200 calls to atf_get_srcdir I have been trying to reduce the time that testsuite runs take for CheriBSD on QEMU (currently about 22 hours). One of the slowest tests is pfctl_test: Just listing the available test cases currently takes 98 seconds on a CheriBSD RISC-V system due to all the processes being spawned. This trivial patch reduces the time to 92 seconds. The better solution would be to rewrite the test in C/C++ which I may do as a follow-up change. Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D26417 Modified: head/sbin/pfctl/tests/pfctl_test.sh Modified: head/sbin/pfctl/tests/pfctl_test.sh ============================================================================== --- head/sbin/pfctl/tests/pfctl_test.sh Mon Sep 14 06:26:36 2020 (r365707) +++ head/sbin/pfctl/tests/pfctl_test.sh Mon Sep 14 08:51:18 2020 (r365708) @@ -24,21 +24,22 @@ pftests="0001 0002 0003 0004 0005 0006 0007 0008 0009 0079 0081 0082 0084 0085 0087 0088 0089 0090 0091 0092 0094 0095 0096 0097 0098 0100 0101 0102 0104 1001 1002 1003 1004 1005" -. $(atf_get_srcdir)/files/pfctl_test_descr.sh +atf_srcdir=$(atf_get_srcdir) +. "${atf_srcdir}/files/pfctl_test_descr.sh" for i in ${pftests} ; do atf_test_case "pf${i}" eval "pf${i}_head () { atf_set descr \"$(pf${i}_descr)\" ; }" eval "pf${i}_body () { \ kldstat -m pf || atf_skip \"pf(4) is not loaded\" && \ - cd $(atf_get_srcdir)/files && \ + cd ${atf_srcdir}/files && \ atf_check -o file:pf${i}.ok \ pfctl -o none -nvf - < pf${i}.in ; }" atf_test_case "selfpf${i}" eval "selfpf${i}_head () { atf_set descr \"self$(pf${i}_descr)\" ; }" eval "selfpf${i}_body () { \ - cd $(atf_get_srcdir)/files && \ + cd ${atf_srcdir}/files && \ atf_check -o file:pf${i}.ok \ pfctl -o none -nvf - < pf${i}.ok ; }" done From owner-svn-src-all@freebsd.org Mon Sep 14 08:59:16 2020 Return-Path: Delivered-To: svn-src-all@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 BBD6D3F7CF4; Mon, 14 Sep 2020 08:59:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BqgK04YVLz4R6s; Mon, 14 Sep 2020 08:59:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B6451465F; Mon, 14 Sep 2020 08:59:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08E8xGXP077196; Mon, 14 Sep 2020 08:59:16 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08E8xGSa077195; Mon, 14 Sep 2020 08:59:16 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202009140859.08E8xGSa077195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 14 Sep 2020 08:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365709 - head/sys/dev/gpio X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/gpio X-SVN-Commit-Revision: 365709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 08:59:16 -0000 Author: andrew Date: Mon Sep 14 08:59:16 2020 New Revision: 365709 URL: https://svnweb.freebsd.org/changeset/base/365709 Log: Allow for interrupts on pl061 children Add enough infrastructure for interrupts on children of the pl061 GPIO controller. As gpiobus already provided these the pl061 driver also needs to pass requests up the newbus hierarchy. Currently there are no children that expect to configure interrupts, however this is expected to change to support the ACPI Event Information interface. Sponsored by: Innovate UK Modified: head/sys/dev/gpio/pl061.c Modified: head/sys/dev/gpio/pl061.c ============================================================================== --- head/sys/dev/gpio/pl061.c Mon Sep 14 08:51:18 2020 (r365708) +++ head/sys/dev/gpio/pl061.c Mon Sep 14 08:59:16 2020 (r365709) @@ -553,6 +553,11 @@ static device_method_t pl061_methods[] = { DEVMETHOD(device_attach, pl061_attach), DEVMETHOD(device_detach, pl061_detach), + /* Bus interface */ + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + /* GPIO protocol */ DEVMETHOD(gpio_get_bus, pl061_get_bus), DEVMETHOD(gpio_pin_max, pl061_pin_max), From owner-svn-src-all@freebsd.org Mon Sep 14 09:44:25 2020 Return-Path: Delivered-To: svn-src-all@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 B662D3D0C24; Mon, 14 Sep 2020 09:44:25 +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 4BqhK54Rh6z4Sr9; Mon, 14 Sep 2020 09:44:25 +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 7BE2015495; Mon, 14 Sep 2020 09:44:25 +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 08E9iPYC008012; Mon, 14 Sep 2020 09:44:25 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08E9iPt7008010; Mon, 14 Sep 2020 09:44:25 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202009140944.08E9iPt7008010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 14 Sep 2020 09:44:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365710 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 09:44:25 -0000 Author: trasz Date: Mon Sep 14 09:44:24 2020 New Revision: 365710 URL: https://svnweb.freebsd.org/changeset/base/365710 Log: Move racct/rctl throttling from userret() to ast(). There's no reason for it to sit in the syscall fast path. Reviewed by: kib MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26368 Modified: head/sys/kern/kern_racct.c head/sys/kern/subr_trap.c Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Mon Sep 14 08:59:16 2020 (r365709) +++ head/sys/kern/kern_racct.c Mon Sep 14 09:44:24 2020 (r365710) @@ -1146,6 +1146,8 @@ racct_proc_throttle(struct proc *p, int timeout) FOREACH_THREAD_IN_PROC(p, td) { thread_lock(td); + td->td_flags |= TDF_ASTPENDING; + switch (td->td_state) { case TDS_RUNQ: /* Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Mon Sep 14 08:59:16 2020 (r365709) +++ head/sys/kern/subr_trap.c Mon Sep 14 09:44:24 2020 (r365710) @@ -206,10 +206,6 @@ userret(struct thread *td, struct trapframe *frame) __func__, td, p->p_pid, td->td_name, curvnet, (td->td_vnet_lpush != NULL) ? td->td_vnet_lpush : "N/A")); #endif -#ifdef RACCT - if (__predict_false(racct_enable && p->p_throttled != 0)) - racct_proc_throttled(p); -#endif } /* @@ -361,6 +357,11 @@ ast(struct trapframe *framep) td->td_pflags &= ~TDP_OLDMASK; kern_sigprocmask(td, SIG_SETMASK, &td->td_oldsigmask, NULL, 0); } + +#ifdef RACCT + if (__predict_false(racct_enable && p->p_throttled != 0)) + racct_proc_throttled(p); +#endif userret(td, framep); } From owner-svn-src-all@freebsd.org Mon Sep 14 10:14:04 2020 Return-Path: Delivered-To: svn-src-all@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 D471F3D1B8E; Mon, 14 Sep 2020 10:14:04 +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 4BqhzJ5L1Cz4VbG; Mon, 14 Sep 2020 10:14:04 +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 9A8A715825; Mon, 14 Sep 2020 10:14:04 +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 08EAE430026663; Mon, 14 Sep 2020 10:14:04 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EAE4qY026661; Mon, 14 Sep 2020 10:14:04 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202009141014.08EAE4qY026661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 14 Sep 2020 10:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365711 - in head/sys: geom kern X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: geom kern X-SVN-Commit-Revision: 365711 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 10:14:04 -0000 Author: trasz Date: Mon Sep 14 10:14:03 2020 New Revision: 365711 URL: https://svnweb.freebsd.org/changeset/base/365711 Log: Move TDP_GEOM check from userret() to ast(); this code path is quite infrequent. Reviewed by: kib No objections: mav Tested by: pho MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26374 Modified: head/sys/geom/geom_event.c head/sys/kern/subr_trap.c Modified: head/sys/geom/geom_event.c ============================================================================== --- head/sys/geom/geom_event.c Mon Sep 14 09:44:24 2020 (r365710) +++ head/sys/geom/geom_event.c Mon Sep 14 10:14:03 2020 (r365711) @@ -374,6 +374,9 @@ g_post_event_x(g_event_t *func, void *arg, int flag, i if (epp != NULL) *epp = ep; curthread->td_pflags |= TDP_GEOM; + thread_lock(curthread); + curthread->td_flags |= TDF_ASTPENDING; + thread_unlock(curthread); return (0); } Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Mon Sep 14 09:44:24 2020 (r365710) +++ head/sys/kern/subr_trap.c Mon Sep 14 10:14:03 2020 (r365711) @@ -138,13 +138,6 @@ userret(struct thread *td, struct trapframe *frame) MPASS(td->td_su == NULL); /* - * If this thread tickled GEOM, we need to wait for the giggling to - * stop before we return to userland - */ - if (__predict_false(td->td_pflags & TDP_GEOM)) - g_waitidle(); - - /* * Charge system time if profiling. */ if (__predict_false(p->p_flag & P_PROFIL)) @@ -285,6 +278,13 @@ ast(struct trapframe *framep) ktrcsw(0, 1, __func__); #endif } + + /* + * If this thread tickled GEOM, we need to wait for the giggling to + * stop before we return to userland + */ + if (__predict_false(td->td_pflags & TDP_GEOM)) + g_waitidle(); #ifdef DIAGNOSTIC if (p->p_numthreads == 1 && (flags & TDF_NEEDSIGCHK) == 0) { From owner-svn-src-all@freebsd.org Mon Sep 14 10:17:08 2020 Return-Path: Delivered-To: svn-src-all@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 52E5C3D17BB; Mon, 14 Sep 2020 10:17:08 +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 4Bqj2r1Rg2z4Vl5; Mon, 14 Sep 2020 10:17:08 +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 1061015828; Mon, 14 Sep 2020 10:17:08 +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 08EAH7Kj026858; Mon, 14 Sep 2020 10:17:07 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EAH71R026857; Mon, 14 Sep 2020 10:17:07 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202009141017.08EAH71R026857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 14 Sep 2020 10:17:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365712 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 10:17:08 -0000 Author: trasz Date: Mon Sep 14 10:17:07 2020 New Revision: 365712 URL: https://svnweb.freebsd.org/changeset/base/365712 Log: Move td_softdep_cleanup() from userret() to ast(); it's infrequent at best. The schedule_cleanup() function already sets TDF_ASTPENDING. Reviewed by: kib, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26375 Modified: head/sys/kern/subr_trap.c Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Mon Sep 14 10:14:03 2020 (r365711) +++ head/sys/kern/subr_trap.c Mon Sep 14 10:17:07 2020 (r365712) @@ -134,9 +134,6 @@ userret(struct thread *td, struct trapframe *frame) KTRUSERRET(td); #endif - td_softdep_cleanup(td); - MPASS(td->td_su == NULL); - /* * Charge system time if profiling. */ @@ -188,8 +185,6 @@ userret(struct thread *td, struct trapframe *frame) ("userret: Returning with preallocated vnode")); KASSERT((td->td_flags & (TDF_SBDRY | TDF_SEINTR | TDF_SERESTART)) == 0, ("userret: Returning with stop signals deferred")); - KASSERT(td->td_su == NULL, - ("userret: Returning with SU cleanup request not handled")); KASSERT(td->td_vslock_sz == 0, ("userret: Returning with vslock-wired space")); #ifdef VIMAGE @@ -278,6 +273,9 @@ ast(struct trapframe *framep) ktrcsw(0, 1, __func__); #endif } + + td_softdep_cleanup(td); + MPASS(td->td_su == NULL); /* * If this thread tickled GEOM, we need to wait for the giggling to From owner-svn-src-all@freebsd.org Mon Sep 14 10:35:40 2020 Return-Path: Delivered-To: svn-src-all@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 A40BD3D1EAF; Mon, 14 Sep 2020 10:35:40 +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 4BqjSD3shcz4WZx; Mon, 14 Sep 2020 10:35:40 +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 67FD61586E; Mon, 14 Sep 2020 10:35:40 +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 08EAZeWp038927; Mon, 14 Sep 2020 10:35:40 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EAZeBE038925; Mon, 14 Sep 2020 10:35:40 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202009141035.08EAZeBE038925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 14 Sep 2020 10:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365713 - in head: lib/libbe/tests sbin/bectl/tests X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: lib/libbe/tests sbin/bectl/tests X-SVN-Commit-Revision: 365713 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 10:35:40 -0000 Author: trasz Date: Mon Sep 14 10:35:39 2020 New Revision: 365713 URL: https://svnweb.freebsd.org/changeset/base/365713 Log: Skip armv7 bectl tests on CI; they deadlock (""KSTACK_PAGES is 2"). PR: 249229 Sponsored by: DARPA Modified: head/lib/libbe/tests/be_create.sh head/sbin/bectl/tests/bectl_test.sh Modified: head/lib/libbe/tests/be_create.sh ============================================================================== --- head/lib/libbe/tests/be_create.sh Mon Sep 14 10:17:07 2020 (r365712) +++ head/lib/libbe/tests/be_create.sh Mon Sep 14 10:35:39 2020 (r365713) @@ -93,6 +93,11 @@ libbe_create_body() atf_skip "https://bugs.freebsd.org/249055" fi + if [ "$(atf_config_get ci false)" = "true" ] && \ + [ "$(uname -p)" = "armv7" ]; then + atf_skip "https://bugs.freebsd.org/249229" + fi + cwd=$(atf_get_srcdir) zpool=$(make_zpool_name) disk=${cwd}/disk.img Modified: head/sbin/bectl/tests/bectl_test.sh ============================================================================== --- head/sbin/bectl/tests/bectl_test.sh Mon Sep 14 10:17:07 2020 (r365712) +++ head/sbin/bectl/tests/bectl_test.sh Mon Sep 14 10:35:39 2020 (r365713) @@ -98,6 +98,11 @@ bectl_create_body() atf_skip "https://bugs.freebsd.org/249055" fi + if [ "$(atf_config_get ci false)" = "true" ] && \ + [ "$(uname -p)" = "armv7" ]; then + atf_skip "https://bugs.freebsd.org/249229" + fi + cwd=$(realpath .) zpool=$(make_zpool_name) disk=${cwd}/disk.img @@ -153,6 +158,11 @@ bectl_destroy_body() atf_skip "https://bugs.freebsd.org/249055" fi + if [ "$(atf_config_get ci false)" = "true" ] && \ + [ "$(uname -p)" = "armv7" ]; then + atf_skip "https://bugs.freebsd.org/249229" + fi + cwd=$(realpath .) zpool=$(make_zpool_name) disk=${cwd}/disk.img @@ -238,6 +248,11 @@ bectl_export_import_body() atf_skip "https://bugs.freebsd.org/249055" fi + if [ "$(atf_config_get ci false)" = "true" ] && \ + [ "$(uname -p)" = "armv7" ]; then + atf_skip "https://bugs.freebsd.org/249229" + fi + cwd=$(realpath .) zpool=$(make_zpool_name) disk=${cwd}/disk.img @@ -271,6 +286,11 @@ bectl_list_body() atf_skip "https://bugs.freebsd.org/249055" fi + if [ "$(atf_config_get ci false)" = "true" ] && \ + [ "$(uname -p)" = "armv7" ]; then + atf_skip "https://bugs.freebsd.org/249229" + fi + cwd=$(realpath .) zpool=$(make_zpool_name) disk=${cwd}/disk.img @@ -311,6 +331,11 @@ bectl_mount_body() atf_skip "https://bugs.freebsd.org/249055" fi + if [ "$(atf_config_get ci false)" = "true" ] && \ + [ "$(uname -p)" = "armv7" ]; then + atf_skip "https://bugs.freebsd.org/249229" + fi + cwd=$(realpath .) zpool=$(make_zpool_name) disk=${cwd}/disk.img @@ -350,6 +375,11 @@ bectl_rename_body() atf_skip "https://bugs.freebsd.org/249055" fi + if [ "$(atf_config_get ci false)" = "true" ] && \ + [ "$(uname -p)" = "armv7" ]; then + atf_skip "https://bugs.freebsd.org/249229" + fi + cwd=$(realpath .) zpool=$(make_zpool_name) disk=${cwd}/disk.img @@ -382,6 +412,11 @@ bectl_jail_body() atf_skip "https://bugs.freebsd.org/249055" fi + if [ "$(atf_config_get ci false)" = "true" ] && \ + [ "$(uname -p)" = "armv7" ]; then + atf_skip "https://bugs.freebsd.org/249229" + fi + cwd=$(realpath .) zpool=$(make_zpool_name) disk=${cwd}/disk.img @@ -455,6 +490,11 @@ bectl_jail_cleanup() if [ "$(atf_config_get ci false)" = "true" ] && \ [ "$(uname -p)" = "i386" ]; then atf_skip "https://bugs.freebsd.org/249055" + fi + + if [ "$(atf_config_get ci false)" = "true" ] && \ + [ "$(uname -p)" = "armv7" ]; then + atf_skip "https://bugs.freebsd.org/249229" fi zpool=$(get_zpool_name) From owner-svn-src-all@freebsd.org Mon Sep 14 10:49:39 2020 Return-Path: Delivered-To: svn-src-all@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 93A253D21E3; Mon, 14 Sep 2020 10:49:39 +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 4BqjmM3QLcz4XHD; Mon, 14 Sep 2020 10:49:39 +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 5404315BD0; Mon, 14 Sep 2020 10:49:39 +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 08EAndbk045455; Mon, 14 Sep 2020 10:49:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EAndwx045454; Mon, 14 Sep 2020 10:49:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009141049.08EAndwx045454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 14 Sep 2020 10:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365714 - stable/12/libexec/rtld-elf X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/libexec/rtld-elf X-SVN-Commit-Revision: 365714 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 10:49:39 -0000 Author: kib Date: Mon Sep 14 10:49:38 2020 New Revision: 365714 URL: https://svnweb.freebsd.org/changeset/base/365714 Log: MFC r365432: rtld: pass argc/argv/env to dso inits. PR: 249162 Modified: stable/12/libexec/rtld-elf/rtld.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/rtld.c ============================================================================== --- stable/12/libexec/rtld-elf/rtld.c Mon Sep 14 10:35:39 2020 (r365713) +++ stable/12/libexec/rtld-elf/rtld.c Mon Sep 14 10:49:38 2020 (r365714) @@ -2810,7 +2810,7 @@ objlist_call_init(Objlist *list, RtldLockState *lockst (void *)elm->obj->init); LD_UTRACE(UTRACE_INIT_CALL, elm->obj, (void *)elm->obj->init, 0, 0, elm->obj->path); - call_initfini_pointer(elm->obj, elm->obj->init); + call_init_pointer(elm->obj, elm->obj->init); } init_addr = (Elf_Addr *)elm->obj->init_array; if (init_addr != NULL) { From owner-svn-src-all@freebsd.org Mon Sep 14 11:01:47 2020 Return-Path: Delivered-To: svn-src-all@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 6A4673D2567; Mon, 14 Sep 2020 11:01:47 +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 4Bqk2M2GjNz4Xyp; Mon, 14 Sep 2020 11:01:47 +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 30CD71616A; Mon, 14 Sep 2020 11:01:47 +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 08EB1lUC056586; Mon, 14 Sep 2020 11:01:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EB1lPh056585; Mon, 14 Sep 2020 11:01:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009141101.08EB1lPh056585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 14 Sep 2020 11:01:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365715 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 365715 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 11:01:47 -0000 Author: kib Date: Mon Sep 14 11:01:46 2020 New Revision: 365715 URL: https://svnweb.freebsd.org/changeset/base/365715 Log: MFC r365433: imgact_elf.c: unify check for phdr fitting into the first page. Modified: stable/12/sys/kern/imgact_elf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/imgact_elf.c ============================================================================== --- stable/12/sys/kern/imgact_elf.c Mon Sep 14 10:49:38 2020 (r365714) +++ stable/12/sys/kern/imgact_elf.c Mon Sep 14 11:01:46 2020 (r365715) @@ -438,6 +438,13 @@ __elfN(get_brandinfo)(struct image_params *imgp, const return (NULL); } +static bool +__elfN(phdr_in_zero_page)(const Elf_Ehdr *hdr) +{ + return (hdr->e_phoff <= PAGE_SIZE && + (u_int)hdr->e_phentsize * hdr->e_phnum <= PAGE_SIZE - hdr->e_phoff); +} + static int __elfN(check_header)(const Elf_Ehdr *hdr) { @@ -803,8 +810,7 @@ __elfN(load_file)(struct proc *p, const char *file, u_ } /* Only support headers that fit within first page for now */ - if ((hdr->e_phoff > PAGE_SIZE) || - (u_int)hdr->e_phentsize * hdr->e_phnum > PAGE_SIZE - hdr->e_phoff) { + if (!__elfN(phdr_in_zero_page)(hdr)) { error = ENOEXEC; goto fail; } @@ -1080,9 +1086,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i * detected an ELF file. */ - if ((hdr->e_phoff > PAGE_SIZE) || - (u_int)hdr->e_phentsize * hdr->e_phnum > PAGE_SIZE - hdr->e_phoff) { - /* Only support headers in first page for now */ + if (!__elfN(phdr_in_zero_page)(hdr)) { uprintf("Program headers not in the first page\n"); return (ENOEXEC); } From owner-svn-src-all@freebsd.org Mon Sep 14 11:02:41 2020 Return-Path: Delivered-To: svn-src-all@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 CCBD63D25EC; Mon, 14 Sep 2020 11:02: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 4Bqk3P566Lz4Y4l; Mon, 14 Sep 2020 11:02: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 9294F15EDD; Mon, 14 Sep 2020 11:02: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 08EB2f83057423; Mon, 14 Sep 2020 11:02:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EB2fa8057422; Mon, 14 Sep 2020 11:02:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009141102.08EB2fa8057422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 14 Sep 2020 11:02:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365716 - stable/11/libexec/rtld-elf X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/libexec/rtld-elf X-SVN-Commit-Revision: 365716 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 11:02:41 -0000 Author: kib Date: Mon Sep 14 11:02:41 2020 New Revision: 365716 URL: https://svnweb.freebsd.org/changeset/base/365716 Log: MFC r365432: rtld: pass argc/argv/env to dso inits. PR: 249162 Modified: stable/11/libexec/rtld-elf/rtld.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Mon Sep 14 11:01:46 2020 (r365715) +++ stable/11/libexec/rtld-elf/rtld.c Mon Sep 14 11:02:41 2020 (r365716) @@ -2786,7 +2786,7 @@ objlist_call_init(Objlist *list, RtldLockState *lockst (void *)elm->obj->init); LD_UTRACE(UTRACE_INIT_CALL, elm->obj, (void *)elm->obj->init, 0, 0, elm->obj->path); - call_initfini_pointer(elm->obj, elm->obj->init); + call_init_pointer(elm->obj, elm->obj->init); } init_addr = (Elf_Addr *)elm->obj->init_array; if (init_addr != NULL) { From owner-svn-src-all@freebsd.org Mon Sep 14 11:03:18 2020 Return-Path: Delivered-To: svn-src-all@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 F0CDF3D2CAE; Mon, 14 Sep 2020 11:03:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Bqk465wwQz4YPw; Mon, 14 Sep 2020 11:03:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA4181622A; Mon, 14 Sep 2020 11:03:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08EB3I3b057520; Mon, 14 Sep 2020 11:03:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EB3III057519; Mon, 14 Sep 2020 11:03:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009141103.08EB3III057519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 14 Sep 2020 11:03:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365717 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 365717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 11:03:19 -0000 Author: kib Date: Mon Sep 14 11:03:18 2020 New Revision: 365717 URL: https://svnweb.freebsd.org/changeset/base/365717 Log: MFC r365433: imgact_elf.c: unify check for phdr fitting into the first page. Modified: stable/11/sys/kern/imgact_elf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/imgact_elf.c ============================================================================== --- stable/11/sys/kern/imgact_elf.c Mon Sep 14 11:02:41 2020 (r365716) +++ stable/11/sys/kern/imgact_elf.c Mon Sep 14 11:03:18 2020 (r365717) @@ -389,6 +389,13 @@ __elfN(get_brandinfo)(struct image_params *imgp, const return (NULL); } +static bool +__elfN(phdr_in_zero_page)(const Elf_Ehdr *hdr) +{ + return (hdr->e_phoff <= PAGE_SIZE && + (u_int)hdr->e_phentsize * hdr->e_phnum <= PAGE_SIZE - hdr->e_phoff); +} + static int __elfN(check_header)(const Elf_Ehdr *hdr) { @@ -728,8 +735,7 @@ __elfN(load_file)(struct proc *p, const char *file, u_ } /* Only support headers that fit within first page for now */ - if ((hdr->e_phoff > PAGE_SIZE) || - (u_int)hdr->e_phentsize * hdr->e_phnum > PAGE_SIZE - hdr->e_phoff) { + if (!__elfN(phdr_in_zero_page)(hdr)) { error = ENOEXEC; goto fail; } @@ -809,9 +815,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i * detected an ELF file. */ - if ((hdr->e_phoff > PAGE_SIZE) || - (u_int)hdr->e_phentsize * hdr->e_phnum > PAGE_SIZE - hdr->e_phoff) { - /* Only support headers in first page for now */ + if (!__elfN(phdr_in_zero_page)(hdr)) { uprintf("Program headers not in the first page\n"); return (ENOEXEC); } From owner-svn-src-all@freebsd.org Mon Sep 14 12:22:20 2020 Return-Path: Delivered-To: svn-src-all@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 8A1A83D4DB6; Mon, 14 Sep 2020 12:22:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BqlqJ3861z4cT5; Mon, 14 Sep 2020 12:22:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FB0416B79; Mon, 14 Sep 2020 12:22:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ECMKHk006414; Mon, 14 Sep 2020 12:22:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ECMKu3006413; Mon, 14 Sep 2020 12:22:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009141222.08ECMKu3006413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 14 Sep 2020 12:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365718 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 365718 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 12:22:20 -0000 Author: markj Date: Mon Sep 14 12:22:19 2020 New Revision: 365718 URL: https://svnweb.freebsd.org/changeset/base/365718 Log: MFC r365437: vm_object_split(): Handle orig_object type changes. Modified: stable/12/sys/vm/vm_object.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_object.c ============================================================================== --- stable/12/sys/vm/vm_object.c Mon Sep 14 11:03:18 2020 (r365717) +++ stable/12/sys/vm/vm_object.c Mon Sep 14 12:22:19 2020 (r365718) @@ -1313,7 +1313,7 @@ vm_object_shadow( void vm_object_split(vm_map_entry_t entry) { - vm_page_t m, m_next; + vm_page_t m, m_busy, m_next; vm_object_t orig_object, new_object, source; vm_pindex_t idx, offidxstart; vm_size_t size; @@ -1370,8 +1370,14 @@ vm_object_split(vm_map_entry_t entry) ("orig_object->charge < 0")); orig_object->charge -= ptoa(size); } + m_busy = NULL; +#ifdef INVARIANTS + idx = 0; +#endif retry: m = vm_page_find_least(orig_object, offidxstart); + KASSERT(m == NULL || idx <= m->pindex - offidxstart, + ("%s: object %p was repopulated", __func__, orig_object)); for (; m != NULL && (idx = m->pindex - offidxstart) < size; m = m_next) { m_next = TAILQ_NEXT(m, listq); @@ -1417,8 +1423,16 @@ retry: */ vm_reserv_rename(m, new_object, orig_object, offidxstart); #endif - if (orig_object->type == OBJT_SWAP) + + /* + * orig_object's type may change while sleeping, so keep track + * of the beginning of the busied range. + */ + if (orig_object->type == OBJT_SWAP) { vm_page_xbusy(m); + if (m_busy == NULL) + m_busy = m; + } } if (orig_object->type == OBJT_SWAP) { /* @@ -1426,8 +1440,9 @@ retry: * and new_object's locks are released and reacquired. */ swap_pager_copy(orig_object, new_object, offidxstart, 0); - TAILQ_FOREACH(m, &new_object->memq, listq) - vm_page_xunbusy(m); + if (m_busy != NULL) + TAILQ_FOREACH_FROM(m_busy, &new_object->memq, listq) + vm_page_xunbusy(m_busy); } VM_OBJECT_WUNLOCK(orig_object); VM_OBJECT_WUNLOCK(new_object); From owner-svn-src-all@freebsd.org Mon Sep 14 14:24:55 2020 Return-Path: Delivered-To: svn-src-all@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 663A23D7D1E; Mon, 14 Sep 2020 14:24:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BqpXl27Blz3Vny; Mon, 14 Sep 2020 14:24:55 +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 2C7ED1889F; Mon, 14 Sep 2020 14:24:55 +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 08EEOtHT079710; Mon, 14 Sep 2020 14:24:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EEOtjB079709; Mon, 14 Sep 2020 14:24:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202009141424.08EEOtjB079709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 14 Sep 2020 14:24:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365719 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 365719 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 14:24:55 -0000 Author: hselasky Date: Mon Sep 14 14:24:54 2020 New Revision: 365719 URL: https://svnweb.freebsd.org/changeset/base/365719 Log: Poll statistics more frequently in mlx5en(4). This makes traffic steering algorithms more accurate. MFC after: 1 week Submitted by: gallatin @ Sponsored by: Mellanox Technologies // NVIDIA Networking 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 Mon Sep 14 12:22:19 2020 (r365718) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Sep 14 14:24:54 2020 (r365719) @@ -1073,7 +1073,7 @@ mlx5e_update_stats(void *arg) queue_work(priv->wq, &priv->update_stats_work); - callout_reset(&priv->watchdog, hz, &mlx5e_update_stats, priv); + callout_reset(&priv->watchdog, hz / 4, &mlx5e_update_stats, priv); } static void From owner-svn-src-all@freebsd.org Mon Sep 14 14:45:31 2020 Return-Path: Delivered-To: svn-src-all@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 77F3A3D85DE; Mon, 14 Sep 2020 14:45:31 +0000 (UTC) (envelope-from gordon@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 4Bqq0W2cpgz3XBJ; Mon, 14 Sep 2020 14:45:31 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 399BB18D03; Mon, 14 Sep 2020 14:45:31 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08EEjViu092565; Mon, 14 Sep 2020 14:45:31 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EEjVY5092564; Mon, 14 Sep 2020 14:45:31 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202009141445.08EEjVY5092564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Mon, 14 Sep 2020 14:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365720 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 365720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 14:45:31 -0000 Author: gordon Date: Mon Sep 14 14:45:30 2020 New Revision: 365720 URL: https://svnweb.freebsd.org/changeset/base/365720 Log: Partially revert r346018 and use the if/then construct instead of shell. There are a couple of places in the tree that directly parse the newvers.sh script looking for the BRANCH variable. I found two locations, one in release/Makefile and the other in bin/freebsd-version/Makefile. While there is a good argument that BRANCH_OVERRIDE should properly propagate in those circumstances and the new behavior is thus better, the reality is this change broke freebsd-update's ability to find timestamps in binaries and resulted in a large number of gratuitous changes. Reported by: freebsd-update Discussed with: cperciva MFC after: 1 day Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Mon Sep 14 14:24:54 2020 (r365719) +++ head/sys/conf/newvers.sh Mon Sep 14 14:45:30 2020 (r365720) @@ -54,7 +54,10 @@ TYPE="FreeBSD" REVISION="13.0" -BRANCH="${BRANCH_OVERRIDE:-CURRENT}" +BRANCH="CURRENT" +if [ -n "${BRANCH_OVERRIDE}" ]; then + BRANCH=${BRANCH_OVERRIDE} +fi RELEASE="${REVISION}-${BRANCH}" VERSION="${TYPE} ${RELEASE}" From owner-svn-src-all@freebsd.org Mon Sep 14 14:52:23 2020 Return-Path: Delivered-To: svn-src-all@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 21D413D8768; Mon, 14 Sep 2020 14:52:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Bqq8R06RSz3XdM; Mon, 14 Sep 2020 14:52:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB13218C66; Mon, 14 Sep 2020 14:52:22 +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 08EEqMLQ098487; Mon, 14 Sep 2020 14:52:22 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EEqM7R098486; Mon, 14 Sep 2020 14:52:22 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009141452.08EEqM7R098486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 14 Sep 2020 14:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365721 - in releng/12.2: contrib/llvm-project/compiler-rt/lib/builtins lib/libcompiler_rt X-SVN-Group: releng X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in releng/12.2: contrib/llvm-project/compiler-rt/lib/builtins lib/libcompiler_rt X-SVN-Commit-Revision: 365721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 14:52:23 -0000 Author: dim Date: Mon Sep 14 14:52:22 2020 New Revision: 365721 URL: https://svnweb.freebsd.org/changeset/base/365721 Log: MF12 r365661: MFC r364753: Add atomic and bswap functions to libcompiler_rt There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. Differential Revision: https://reviews.freebsd.org/D26159 MFC r364782: After r364753, there should be no need to suppress -Watomic-alignment warnings anymore for compiler-rt's atomic.c. This occurred because the IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this caused the compiler to emit a runtime call to __atomic_is_lock_free(), and that triggers the warning. MFC r365509: Follow-up r364753 by enabling compiler-rt's atomic implementation only for clang, as it uses clang specific builtins, and does not compile correctly with gcc. Note that gcc packages usually come with their own libatomic, providing these primitives. MFC r365588: Follow-up r364753 by only using arm's stdatomic.c implementation, as it already covers the functions in compiler-rt's atomic.c, leading to conflicts when linking. PR: 230888 Approved by: re (gjb) Modified: releng/12.2/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c releng/12.2/lib/libcompiler_rt/Makefile.inc Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c ============================================================================== --- releng/12.2/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Mon Sep 14 14:45:30 2020 (r365720) +++ releng/12.2/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Mon Sep 14 14:52:22 2020 (r365721) @@ -124,8 +124,8 @@ static __inline Lock *lock_for_pointer(void *ptr) { #define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2) #define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4) -/// 32 bit PowerPC doesn't support 8-byte lock_free atomics -#if !defined(__powerpc64__) && defined(__powerpc__) +/// 32 bit MIPS and PowerPC don't support 8-byte lock_free atomics +#if defined(__mips__) || (!defined(__powerpc64__) && defined(__powerpc__)) #define IS_LOCK_FREE_8 0 #else #define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8) Modified: releng/12.2/lib/libcompiler_rt/Makefile.inc ============================================================================== --- releng/12.2/lib/libcompiler_rt/Makefile.inc Mon Sep 14 14:45:30 2020 (r365720) +++ releng/12.2/lib/libcompiler_rt/Makefile.inc Mon Sep 14 14:52:22 2020 (r365721) @@ -18,6 +18,8 @@ SRCF+= ashldi3 SRCF+= ashlti3 SRCF+= ashrdi3 SRCF+= ashrti3 +SRCF+= bswapdi2 +SRCF+= bswapsi2 SRCF+= clear_cache SRCF+= clzdi2 SRCF+= clzsi2 @@ -121,6 +123,13 @@ SRCF+= umoddi3 SRCF+= umodsi3 SRCF+= umodti3 +# Enable compiler-rt's atomic implementation only for clang, as it uses clang +# specific builtins, and gcc packages usually come with their own libatomic. +# Exclude arm which has its own implementations of atomic functions, below. +.if "${COMPILER_TYPE}" == "clang" && ${MACHINE_CPUARCH} != "arm" +SRCF+= atomic +.endif + # Avoid using SSE2 instructions on i386, if unsupported. .if ${MACHINE_CPUARCH} == "i386" && empty(MACHINE_CPU:Msse2) SRCS+= floatdidf.c @@ -213,12 +222,6 @@ CFLAGS+= -DEMIT_SYNC_ATOMICS SRCF+= stdatomic .endif -.if "${COMPILER_TYPE}" == "clang" && \ - (${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe") -SRCS+= atomic.c -CFLAGS.atomic.c+= -Wno-atomic-alignment -.endif - .for file in ${SRCF} .if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) @@ -240,18 +243,9 @@ SRCS+= aeabi_memmove.S SRCS+= aeabi_memset.S SRCS+= aeabi_uidivmod.S SRCS+= aeabi_uldivmod.S -SRCS+= bswapdi2.S -SRCS+= bswapsi2.S SRCS+= switch16.S SRCS+= switch32.S SRCS+= switch8.S SRCS+= switchu8.S SRCS+= sync_synchronize.S -.endif - -# On some archs GCC-6.3 requires bswap32 built-in. -.if ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "riscv" || \ - ${MACHINE_CPUARCH} == "sparc64" -SRCS+= bswapdi2.c -SRCS+= bswapsi2.c .endif From owner-svn-src-all@freebsd.org Mon Sep 14 14:53:11 2020 Return-Path: Delivered-To: svn-src-all@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 D5A153D8C02; Mon, 14 Sep 2020 14:53:11 +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 4Bqq9M5LSgz3XqP; Mon, 14 Sep 2020 14:53:11 +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 9C25218B34; Mon, 14 Sep 2020 14:53:11 +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 08EErBPn098589; Mon, 14 Sep 2020 14:53:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EEr9u4098580; Mon, 14 Sep 2020 14:53:09 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009141453.08EEr9u4098580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 14 Sep 2020 14:53:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365722 - in releng/12.2: . contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc lib/libc/stdlib/jemalloc share/man/man5 share/mk tools/build/options X-SVN-Group: releng X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in releng/12.2: . contrib/jemalloc contrib/jemalloc/doc contrib/jemalloc/include/jemalloc lib/libc/stdlib/jemalloc share/man/man5 share/mk tools/build/options X-SVN-Commit-Revision: 365722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 14:53:11 -0000 Author: dim Date: Mon Sep 14 14:53:09 2020 New Revision: 365722 URL: https://svnweb.freebsd.org/changeset/base/365722 Log: MF12 r365662: MFC r365371: Turn MALLOC_PRODUCTION into a regular src.conf(5) option For historical reasons, defining MALLOC_PRODUCTION in /etc/make.conf has been used to turn off potentially expensive debug checks and statistics gathering in the implementation of malloc(3). It seems more consistent to turn this into a regular src.conf(5) option, e.g. WITH_MALLOC_PRODUCTION / WITHOUT_MALLOC_PRODUCTION. This can then be toggled similar to any other source build option, and turned on or off by default for e.g. stable branches. Reviewed by: imp, #manpages Differential Revision: https://reviews.freebsd.org/D26337 MFC r365373: Follow-up r365371 by removing sentences which indicate the state of the MK_MALLOC_PRODUCTION option on -CURRENT. Also, for the sake of backwards compatibility, support the old way of enabling 'production malloc', e.g. by adding a define in make.conf(5). MF12 r365671: Follow-up r365662 (MFC of r365371 and r365373) by correctly setting WITH_MALLOC_PRODUCTION for stable branches. Also add a note to UPDATING, to inform users about the new setting. Direct commit to stable/{11,12} as this does not apply to head. Noticed by: imp, Ronald Klop MF12 r365672: Follow-up r365662 (MFC of r365371 and r365373) by also removing the header hack from jemalloc_FreeBSD.h, which rendered any make.conf MALLOC_PRODUCTION or src.conf WITH/WITHOUT_MALLOC_PRODUCTION irrelevant. Direct commit to stable/{11,12} as this does not apply to head. Noticed by: kevans Approved by: re (gjb) Added: releng/12.2/tools/build/options/WITHOUT_MALLOC_PRODUCTION - copied unchanged from r365662, stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION releng/12.2/tools/build/options/WITH_MALLOC_PRODUCTION - copied unchanged from r365662, stable/12/tools/build/options/WITH_MALLOC_PRODUCTION Modified: releng/12.2/UPDATING releng/12.2/contrib/jemalloc/FREEBSD-diffs releng/12.2/contrib/jemalloc/doc/jemalloc.3 releng/12.2/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h releng/12.2/lib/libc/stdlib/jemalloc/Makefile.inc releng/12.2/share/man/man5/make.conf.5 releng/12.2/share/man/man5/src.conf.5 releng/12.2/share/mk/src.opts.mk Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/UPDATING ============================================================================== --- releng/12.2/UPDATING Mon Sep 14 14:52:22 2020 (r365721) +++ releng/12.2/UPDATING Mon Sep 14 14:53:09 2020 (r365722) @@ -16,6 +16,18 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20200912: + The make.conf(5) MALLOC_PRODUCTION variable, used for disabling and + enabling assertions and statistics gathering in malloc(3), has been + migrated to a src.conf(5) WITH/WITHOUT_MALLOC_PRODUCTION option. + + On stable branches, WITH_MALLOC_PRODUCTION is set by default, which + means that malloc(3) has assertions and statistics gathering disabled, + for improved performance. + + For backwards compatibility, the make.conf(5) MALLOC_PRODUCTION is still + honored, but it is now deprecated and undocumented. + 20200909: The resume code now notifies devd with the 'kernel' system rather than the old 'kern' subsystem to be consistent with Modified: releng/12.2/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- releng/12.2/contrib/jemalloc/FREEBSD-diffs Mon Sep 14 14:52:22 2020 (r365721) +++ releng/12.2/contrib/jemalloc/FREEBSD-diffs Mon Sep 14 14:53:09 2020 (r365722) @@ -14,7 +14,7 @@ index 1e12fd3a..c42a7e10 100644 + . + Additionally, is enabled in development + versions of FreeBSD (controlled by the -+ MALLOC_PRODUCTION make variable). ++ MK_MALLOC_PRODUCTION make variable). + Modified: releng/12.2/contrib/jemalloc/doc/jemalloc.3 ============================================================================== --- releng/12.2/contrib/jemalloc/doc/jemalloc.3 Mon Sep 14 14:52:22 2020 (r365721) +++ releng/12.2/contrib/jemalloc/doc/jemalloc.3 Mon Sep 14 14:53:09 2020 (r365722) @@ -43,7 +43,7 @@ The following configuration options are enabled in lib \fB\-\-with\-malloc\-conf=abort_conf:false\fR\&. Additionally, \fB\-\-enable\-debug\fR is enabled in development versions of FreeBSD (controlled by the -\fBMALLOC_PRODUCTION\fR +\fBMK_MALLOC_PRODUCTION\fR make variable)\&. .SH "SYNOPSIS" .sp Modified: releng/12.2/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h ============================================================================== --- releng/12.2/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Mon Sep 14 14:52:22 2020 (r365721) +++ releng/12.2/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Mon Sep 14 14:53:09 2020 (r365722) @@ -5,7 +5,7 @@ #undef JEMALLOC_OVERRIDE_VALLOC #ifndef MALLOC_PRODUCTION -#define MALLOC_PRODUCTION +#define JEMALLOC_DEBUG #endif #undef JEMALLOC_DSS Modified: releng/12.2/lib/libc/stdlib/jemalloc/Makefile.inc ============================================================================== --- releng/12.2/lib/libc/stdlib/jemalloc/Makefile.inc Mon Sep 14 14:52:22 2020 (r365721) +++ releng/12.2/lib/libc/stdlib/jemalloc/Makefile.inc Mon Sep 14 14:53:09 2020 (r365722) @@ -44,6 +44,6 @@ MLINKS+= \ jemalloc.3 nallocx.3 \ jemalloc.3 malloc.conf.5 -.if defined(MALLOC_PRODUCTION) +.if ${MK_MALLOC_PRODUCTION} != "no" || defined(MALLOC_PRODUCTION) CFLAGS+= -DMALLOC_PRODUCTION .endif Modified: releng/12.2/share/man/man5/make.conf.5 ============================================================================== --- releng/12.2/share/man/man5/make.conf.5 Mon Sep 14 14:52:22 2020 (r365721) +++ releng/12.2/share/man/man5/make.conf.5 Mon Sep 14 14:53:09 2020 (r365722) @@ -401,12 +401,6 @@ console driver to and allow access over FireWire(IEEE1394) using .Xr dconschat 8 . Currently, only i386 and amd64 are supported. -.It Va MALLOC_PRODUCTION -.Pq Vt bool -Set this to disable assertions and statistics gathering in -.Xr malloc 3 . -It also defaults the A and J runtime options to off. -Disabled by default on -CURRENT. .It Va MAN_ARCH .Pq Vt str Space-delimited list of one or more MACHINE and/or MACHINE_ARCH values Modified: releng/12.2/share/man/man5/src.conf.5 ============================================================================== --- releng/12.2/share/man/man5/src.conf.5 Mon Sep 14 14:52:22 2020 (r365721) +++ releng/12.2/share/man/man5/src.conf.5 Mon Sep 14 14:53:09 2020 (r365722) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd April 9, 2020 +.Dd September 12, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1325,6 +1325,10 @@ if executed as an unprivileged user. See .Xr tests 7 for more details. +.It Va WITHOUT_MALLOC_PRODUCTION +Set to enable assertions and statistics gathering in +.Xr malloc 3 . +It also defaults the A and J runtime options to on. .It Va WITHOUT_MAN Set to not build manual pages. When set, these options are also in effect: Modified: releng/12.2/share/mk/src.opts.mk ============================================================================== --- releng/12.2/share/mk/src.opts.mk Mon Sep 14 14:52:22 2020 (r365721) +++ releng/12.2/share/mk/src.opts.mk Mon Sep 14 14:53:09 2020 (r365722) @@ -143,6 +143,7 @@ __DEFAULT_YES_OPTIONS = \ MAIL \ MAILWRAPPER \ MAKE \ + MALLOC_PRODUCTION \ NDIS \ NETCAT \ NETGRAPH \ Copied: releng/12.2/tools/build/options/WITHOUT_MALLOC_PRODUCTION (from r365662, stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/12.2/tools/build/options/WITHOUT_MALLOC_PRODUCTION Mon Sep 14 14:53:09 2020 (r365722, copy of r365662, stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to enable assertions and statistics gathering in +.Xr malloc 3 . +It also defaults the A and J runtime options to on. Copied: releng/12.2/tools/build/options/WITH_MALLOC_PRODUCTION (from r365662, stable/12/tools/build/options/WITH_MALLOC_PRODUCTION) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/12.2/tools/build/options/WITH_MALLOC_PRODUCTION Mon Sep 14 14:53:09 2020 (r365722, copy of r365662, stable/12/tools/build/options/WITH_MALLOC_PRODUCTION) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to disable assertions and statistics gathering in +.Xr malloc 3 . +It also defaults the A and J runtime options to off. From owner-svn-src-all@freebsd.org Mon Sep 14 15:20:38 2020 Return-Path: Delivered-To: svn-src-all@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 71CD53D996A; Mon, 14 Sep 2020 15:20:38 +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 4Bqqn224n2z3bTM; Mon, 14 Sep 2020 15:20:38 +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 2AC3618FAF; Mon, 14 Sep 2020 15:20:38 +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 08EFKbc5012917; Mon, 14 Sep 2020 15:20:37 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EFKbiS012916; Mon, 14 Sep 2020 15:20:37 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009141520.08EFKbiS012916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Mon, 14 Sep 2020 15:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365723 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 365723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 15:20:38 -0000 Author: bdragon Date: Mon Sep 14 15:20:37 2020 New Revision: 365723 URL: https://svnweb.freebsd.org/changeset/base/365723 Log: [PowerPC] Make cpu frequency detection endian-independent On ibm,extended-clock-frequency, ensure we be64toh() the value. On clock-frequency, remove the right-shifting hack (which was needed due to reading a 32 bit value into a 64 bit variable) and switch to OF_getencprop() for reading (which will handle endian conversion internally.) Reviewed by: jhibbits (in irc) Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Mon Sep 14 14:53:09 2020 (r365722) +++ head/sys/powerpc/powerpc/cpu.c Mon Sep 14 15:20:37 2020 (r365723) @@ -72,6 +72,7 @@ #include #include #include +#include #include #include @@ -358,6 +359,7 @@ cpu_est_clockrate(int cpu_id, uint64_t *cps) uint16_t vers; register_t msr; phandle_t cpu, dev, root; + uint32_t freq32; int res = 0; char buf[8]; @@ -428,10 +430,11 @@ cpu_est_clockrate(int cpu_id, uint64_t *cps) return (ENOENT); if (OF_getprop(cpu, "ibm,extended-clock-frequency", cps, sizeof(*cps)) >= 0) { + *cps = be64toh(*cps); return (0); - } else if (OF_getprop(cpu, "clock-frequency", cps, - sizeof(cell_t)) >= 0) { - *cps >>= 32; + } else if (OF_getencprop(cpu, "clock-frequency", + &freq32, sizeof(freq32)) >= 0) { + *cps = freq32; return (0); } else { return (ENOENT); From owner-svn-src-all@freebsd.org Mon Sep 14 15:48:31 2020 Return-Path: Delivered-To: svn-src-all@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 77AED3DA6E1; Mon, 14 Sep 2020 15:48:31 +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 4BqrPC2gQPz3chx; Mon, 14 Sep 2020 15:48:31 +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 3FE991978F; Mon, 14 Sep 2020 15:48:31 +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 08EFmVqX030457; Mon, 14 Sep 2020 15:48:31 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EFmUxm030455; Mon, 14 Sep 2020 15:48:30 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009141548.08EFmUxm030455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Mon, 14 Sep 2020 15:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365724 - in head/stand: ficl ficl/powerpc powerpc/ofw X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: in head/stand: ficl ficl/powerpc powerpc/ofw X-SVN-Commit-Revision: 365724 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 15:48:31 -0000 Author: bdragon Date: Mon Sep 14 15:48:30 2020 New Revision: 365724 URL: https://svnweb.freebsd.org/changeset/base/365724 Log: stand/ficl 64-bit compatibility Currently, the only thing that prevents a functioning 64-bit FICL build is a few integer types that were intended to be fixed-width. Changing them to C99 integer types allows building a functioning 64-bit FICL. While this isn't applicable to the default settings of any in-tree loaders, it is necessary for a future Petitboot loader, due to the requirement that it be compiled as a 64-bit program. Reviewed by: tsoome, imp (earlier revision) Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D26364 Modified: head/stand/ficl/ficl.h head/stand/ficl/powerpc/sysdep.h head/stand/powerpc/ofw/main.c Modified: head/stand/ficl/ficl.h ============================================================================== --- head/stand/ficl/ficl.h Mon Sep 14 15:20:37 2020 (r365723) +++ head/stand/ficl/ficl.h Mon Sep 14 15:48:30 2020 (r365724) @@ -249,7 +249,7 @@ typedef struct ficl_system_info FICL_SYSTEM_INFO; ** complement of false... that unifies logical and bitwise operations ** nicely. */ -#define FICL_TRUE ((unsigned long)~(0L)) +#define FICL_TRUE ((FICL_UNS)~(0LL)) #define FICL_FALSE (0) #define FICL_BOOL(x) ((x) ? FICL_TRUE : FICL_FALSE) Modified: head/stand/ficl/powerpc/sysdep.h ============================================================================== --- head/stand/ficl/powerpc/sysdep.h Mon Sep 14 15:20:37 2020 (r365723) +++ head/stand/ficl/powerpc/sysdep.h Mon Sep 14 15:48:30 2020 (r365724) @@ -79,15 +79,15 @@ ** System dependent data type declarations... */ #if !defined INT32 -#define INT32 int +#define INT32 int32_t #endif #if !defined UNS32 -#define UNS32 unsigned int +#define UNS32 uint32_t #endif #if !defined UNS16 -#define UNS16 unsigned short +#define UNS16 uint16_t #endif #if !defined UNS8 @@ -367,6 +367,9 @@ typedef struct */ #if !defined FICL_ALIGN #define FICL_ALIGN 2 +#endif + +#if !defined FICL_ALIGN_ADD #define FICL_ALIGN_ADD ((1 << FICL_ALIGN) - 1) #endif Modified: head/stand/powerpc/ofw/main.c ============================================================================== --- head/stand/powerpc/ofw/main.c Mon Sep 14 15:20:37 2020 (r365723) +++ head/stand/powerpc/ofw/main.c Mon Sep 14 15:48:30 2020 (r365724) @@ -63,7 +63,7 @@ init_heap(void) { bzero(heap, HEAP_SIZE); - setheap(heap, (void *)((int)heap + HEAP_SIZE)); + setheap(heap, (void *)((uintptr_t)heap + HEAP_SIZE)); } uint64_t From owner-svn-src-all@freebsd.org Mon Sep 14 15:58:11 2020 Return-Path: Delivered-To: svn-src-all@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 3C7E13DAED4; Mon, 14 Sep 2020 15:58:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BqrcM0vmLz3dNp; Mon, 14 Sep 2020 15:58:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 027681964C; Mon, 14 Sep 2020 15:58:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08EFwACt036600; Mon, 14 Sep 2020 15:58:10 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EFwA7r036599; Mon, 14 Sep 2020 15:58:10 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202009141558.08EFwA7r036599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 14 Sep 2020 15:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365725 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 365725 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 15:58:11 -0000 Author: gjb Date: Mon Sep 14 15:58:10 2020 New Revision: 365725 URL: https://svnweb.freebsd.org/changeset/base/365725 Log: Fix setting RELENGDIR when release.sh is called from an external script. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Mon Sep 14 15:48:30 2020 (r365724) +++ head/release/release.sh Mon Sep 14 15:58:10 2020 (r365725) @@ -57,7 +57,9 @@ usage() { env_setup() { # The directory within which the release will be built. CHROOTDIR="/scratch" - RELENGDIR="$(dirname $(realpath ${0}))" + if [ -z "${RELENGDIR}" ]; then + export RELENGDIR="$(dirname $(realpath ${0}))" + fi # The default version control system command to obtain the sources. for _dir in /usr/bin /usr/local/bin; do From owner-svn-src-all@freebsd.org Mon Sep 14 16:12:30 2020 Return-Path: Delivered-To: svn-src-all@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 DCA633DB0F3; Mon, 14 Sep 2020 16:12:30 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Bqrwt5b4Dz3fTy; Mon, 14 Sep 2020 16:12:30 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2F7D196FD; Mon, 14 Sep 2020 16:12:30 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08EGCUmT048364; Mon, 14 Sep 2020 16:12:30 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EGCTke048354; Mon, 14 Sep 2020 16:12:29 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202009141612.08EGCTke048354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 14 Sep 2020 16:12:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365726 - in head: cddl/lib/libzfs cddl/lib/libzpool lib/libpmc share/mk sys/conf tests/sys/kern usr.bin/gcore X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head: cddl/lib/libzfs cddl/lib/libzpool lib/libpmc share/mk sys/conf tests/sys/kern usr.bin/gcore X-SVN-Commit-Revision: 365726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 16:12:30 -0000 Author: andrew Date: Mon Sep 14 16:12:28 2020 New Revision: 365726 URL: https://svnweb.freebsd.org/changeset/base/365726 Log: Use MACHINE_CPUARCH when checking for arm64 Use MACHINE_CPUARCH with arm64 (aarch64) when we build code that could run on any 64-bit Arm instruction set. This will simplify checks in downstream consumers targeting prototype instruction sets. The only place we check for MACHINE_ARCH == aarch64 is when building the device tree blobs. As these are targeting current generation ISAs. Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D26370 Modified: head/cddl/lib/libzfs/Makefile head/cddl/lib/libzpool/Makefile head/lib/libpmc/Makefile head/share/mk/bsd.endian.mk head/share/mk/bsd.sys.mk head/sys/conf/dtb.build.mk head/tests/sys/kern/Makefile head/usr.bin/gcore/Makefile Modified: head/cddl/lib/libzfs/Makefile ============================================================================== --- head/cddl/lib/libzfs/Makefile Mon Sep 14 15:58:10 2020 (r365725) +++ head/cddl/lib/libzfs/Makefile Mon Sep 14 16:12:28 2020 (r365726) @@ -82,7 +82,7 @@ CFLAGS += -DHAVE_SSE2 ARCH_C += zfs_fletcher_avx512.c CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_AVX512F .endif -.if ${MACHINE_ARCH} == "aarch64" +.if ${MACHINE_CPUARCH} == "aarch64" ARCH_C += zfs_fletcher_aarch64_neon.c .endif Modified: head/cddl/lib/libzpool/Makefile ============================================================================== --- head/cddl/lib/libzpool/Makefile Mon Sep 14 15:58:10 2020 (r365725) +++ head/cddl/lib/libzpool/Makefile Mon Sep 14 16:12:28 2020 (r365726) @@ -187,7 +187,7 @@ ARCH_C += zfs_fletcher_avx512.c CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_AVX512F \ -DHAVE_AVX512BW .endif -.if ${MACHINE_ARCH} == "aarch64" +.if ${MACHINE_CPUARCH} == "aarch64" ARCH_C += zfs_fletcher_aarch64_neon.c .endif Modified: head/lib/libpmc/Makefile ============================================================================== --- head/lib/libpmc/Makefile Mon Sep 14 15:58:10 2020 (r365725) +++ head/lib/libpmc/Makefile Mon Sep 14 16:12:28 2020 (r365726) @@ -7,10 +7,10 @@ INCS= pmc.h pmclog.h pmcformat.h CFLAGS+= -I${SRCTOP}/${RELDIR:H}/libpmcstat -.if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \ +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \ ${MACHINE_ARCH} == "i386" -.if ${MACHINE_ARCH} == "aarch64" +.if ${MACHINE_CPUARCH} == "aarch64" EVENT_ARCH="arm64" .elif ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" EVENT_ARCH="x86" Modified: head/share/mk/bsd.endian.mk ============================================================================== --- head/share/mk/bsd.endian.mk Mon Sep 14 15:58:10 2020 (r365725) +++ head/share/mk/bsd.endian.mk Mon Sep 14 16:12:28 2020 (r365726) @@ -1,6 +1,6 @@ # $FreeBSD$ -.if ${MACHINE_ARCH} == "aarch64" || \ +.if ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_ARCH} == "amd64" || \ ${MACHINE_ARCH} == "i386" || \ (${MACHINE} == "arm" && ${MACHINE_ARCH:Marm*eb*} == "") || \ Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Mon Sep 14 15:58:10 2020 (r365725) +++ head/share/mk/bsd.sys.mk Mon Sep 14 16:12:28 2020 (r365726) @@ -187,7 +187,7 @@ CWARNFLAGS+= -Wno-error=aggressive-loop-optimizations .endif # GCC's own arm_neon.h triggers various warnings -.if ${MACHINE_ARCH} == "aarch64" +.if ${MACHINE_CPUARCH} == "aarch64" CWARNFLAGS+= -Wno-system-headers .endif .endif # gcc Modified: head/sys/conf/dtb.build.mk ============================================================================== --- head/sys/conf/dtb.build.mk Mon Sep 14 15:58:10 2020 (r365725) +++ head/sys/conf/dtb.build.mk Mon Sep 14 16:12:28 2020 (r365726) @@ -22,7 +22,7 @@ SYSDIR= ${S} .for _dts in ${DTS} # DTB for aarch64 needs to preserve the immediate parent of the .dts, because # these DTS are vendored and should be installed into their vendored directory. -.if ${MACHINE_ARCH} == "aarch64" +.if ${MACHINE_CPUARCH} == "aarch64" DTB+= ${_dts:R:S/$/.dtb/} .else DTB+= ${_dts:T:R:S/$/.dtb/} Modified: head/tests/sys/kern/Makefile ============================================================================== --- head/tests/sys/kern/Makefile Mon Sep 14 15:58:10 2020 (r365725) +++ head/tests/sys/kern/Makefile Mon Sep 14 16:12:28 2020 (r365726) @@ -57,7 +57,7 @@ LIBADD.mqueue_test+= rt .if ${MACHINE_ARCH} == "amd64" || \ ${MACHINE_ARCH} == "i386" || \ - ${MACHINE_ARCH} == "aarch64" + ${MACHINE_CPUARCH} == "aarch64" ATF_TESTS_C+= libkern_crc32 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" LDADD.libkern_crc32+= ${SRCTOP}/sys/libkern/x86/crc32_sse42.c Modified: head/usr.bin/gcore/Makefile ============================================================================== --- head/usr.bin/gcore/Makefile Mon Sep 14 15:58:10 2020 (r365725) +++ head/usr.bin/gcore/Makefile Mon Sep 14 16:12:28 2020 (r365726) @@ -5,7 +5,7 @@ PROG= gcore SRCS= elfcore.c gcore.c LIBADD= sbuf util -.if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \ +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \ ${MACHINE_ARCH} == "powerpc64" SRCS+= elf32core.c .endif From owner-svn-src-all@freebsd.org Mon Sep 14 16:16:03 2020 Return-Path: Delivered-To: svn-src-all@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 780B03DB4C9; Mon, 14 Sep 2020 16:16:03 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 4Bqs0z1D40z3fh6; Mon, 14 Sep 2020 16:16:02 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from [192.168.42.12] (cpc91220-cmbg18-2-0-cust60.5-4.cable.virginm.net [81.104.142.61]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 3E1764E632; Mon, 14 Sep 2020 16:15:26 +0000 (UTC) From: Andrew Turner Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.15\)) Subject: Re: svn commit: r365726 - in head: cddl/lib/libzfs cddl/lib/libzpool lib/libpmc share/mk sys/conf tests/sys/kern usr.bin/gcore Date: Mon, 14 Sep 2020 17:15:25 +0100 References: <202009141612.08EGCTke048354@repo.freebsd.org> To: src-committers , svn-src-all , svn-src-head In-Reply-To: <202009141612.08EGCTke048354@repo.freebsd.org> Message-Id: X-Mailer: Apple Mail (2.3445.104.15) X-Rspamd-Queue-Id: 4Bqs0z1D40z3fh6 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:14061, ipnet:139.59.160.0/20, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 16:16:03 -0000 > On 14 Sep 2020, at 17:12, Andrew Turner wrote: > > Author: andrew > Date: Mon Sep 14 16:12:28 2020 > New Revision: 365726 > URL: https://svnweb.freebsd.org/changeset/base/365726 > > Log: > Use MACHINE_CPUARCH when checking for arm64 > > Use MACHINE_CPUARCH with arm64 (aarch64) when we build code that could run > on any 64-bit Arm instruction set. This will simplify checks in downstream > consumers targeting prototype instruction sets. > > The only place we check for MACHINE_ARCH == aarch64 is when building the > device tree blobs. As these are targeting current generation ISAs. > > Sponsored by: Innovate UK > Differential Revision: https://reviews.freebsd.org/D26370 I missed: Reviewed by: brooks Andrew From owner-svn-src-all@freebsd.org Mon Sep 14 16:18:54 2020 Return-Path: Delivered-To: svn-src-all@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 A106B3DB922; Mon, 14 Sep 2020 16:18:54 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Bqs4G3qlxz3fZG; Mon, 14 Sep 2020 16:18:54 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CD7F194E6; Mon, 14 Sep 2020 16:18:54 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08EGIsDi048978; Mon, 14 Sep 2020 16:18:54 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EGIrlj048975; Mon, 14 Sep 2020 16:18:53 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202009141618.08EGIrlj048975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 14 Sep 2020 16:18:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365727 - in head/usr.bin: . gprof X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/usr.bin: . gprof X-SVN-Commit-Revision: 365727 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 16:18:54 -0000 Author: andrew Date: Mon Sep 14 16:18:53 2020 New Revision: 365727 URL: https://svnweb.freebsd.org/changeset/base/365727 Log: Cleanups for gprof: * Remove identical or almost identical headers * Only build aout.c on amd64 and i386. None of the the other current architectures ever supported running a.out binaries * Enable on all architectures Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D26369 Deleted: head/usr.bin/gprof/amd64.h head/usr.bin/gprof/arm.h head/usr.bin/gprof/i386.h head/usr.bin/gprof/mips.h head/usr.bin/gprof/powerpc.h head/usr.bin/gprof/riscv.h head/usr.bin/gprof/sparc64.h Modified: head/usr.bin/Makefile head/usr.bin/gprof/Makefile head/usr.bin/gprof/gprof.h Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Mon Sep 14 16:12:28 2020 (r365726) +++ head/usr.bin/Makefile Mon Sep 14 16:18:53 2020 (r365727) @@ -262,11 +262,7 @@ SUBDIR.${MK_TOOLCHAIN}+= ctags SUBDIR.${MK_TOOLCHAIN}+= cxxfilt SUBDIR.${MK_TOOLCHAIN}+= objcopy SUBDIR.${MK_TOOLCHAIN}+= file2c -# ARM64TODO gprof does not build -# RISCVTODO gprof does not build -.if ${MACHINE_ARCH} != "aarch64" SUBDIR.${MK_TOOLCHAIN}+= gprof -.endif SUBDIR.${MK_TOOLCHAIN}+= indent SUBDIR.${MK_TOOLCHAIN}+= lex SUBDIR.${MK_TOOLCHAIN}+= mkstr Modified: head/usr.bin/gprof/Makefile ============================================================================== --- head/usr.bin/gprof/Makefile Mon Sep 14 16:12:28 2020 (r365726) +++ head/usr.bin/gprof/Makefile Mon Sep 14 16:18:53 2020 (r365727) @@ -5,8 +5,7 @@ PROG= gprof SRCS= gprof.c arcs.c dfn.c elf.c lookup.c hertz.c \ printgprof.c printlist.c kernel.c -.if ${MACHINE_ARCH} != "aarch64" && ${MACHINE_CPUARCH} != "riscv" && \ - ${MACHINE_ARCH} != "s390x" +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" SRCS+= aout.c CFLAGS+= -DWITH_AOUT .endif Modified: head/usr.bin/gprof/gprof.h ============================================================================== --- head/usr.bin/gprof/gprof.h Mon Sep 14 16:12:28 2020 (r365726) +++ head/usr.bin/gprof/gprof.h Mon Sep 14 16:18:53 2020 (r365727) @@ -39,27 +39,14 @@ #include #include -#if __amd64__ -# include "amd64.h" -#endif -#if __arm__ -# include "arm.h" -#endif -#if __i386__ -# include "i386.h" -#endif -#if __mips__ -# include "mips.h" -#endif -#if __powerpc__ -# include "powerpc.h" -#endif -#if __sparc64__ -# include "sparc64.h" -#endif -#if __riscv -# include "riscv.h" -#endif + /* + * offset (in bytes) of the code from the entry address of a routine. + * (see asgnsamples for use and explanation.) + */ +#define OFFSET_OF_CODE 0 + +enum opermodes { dummy }; +typedef enum opermodes operandenum; /* * booleans From owner-svn-src-all@freebsd.org Mon Sep 14 17:12:05 2020 Return-Path: Delivered-To: svn-src-all@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 4EC623DCD40 for ; Mon, 14 Sep 2020 17:12:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) (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 4BqtFc3xwTz40l5 for ; Mon, 14 Sep 2020 17:12:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x834.google.com with SMTP id p65so521038qtd.2 for ; Mon, 14 Sep 2020 10:12:04 -0700 (PDT) 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=Msqw7+20VOncyXRhA8kS8UVVfUicMIM7evKDhbFzRwQ=; b=I9Se05RfJcDD4DkWHD7e8Gjqg+WIUntlJ7OY9SjQvooOGFoFVAtJux6D6TdbmZO47k d/GtRNr4xYXWJdHZcHx8MKtJdRUaINkYIO0MlAmb17f1fPKFVOGI7BthCOOGDYc+UMap r8UoS9Z6nUEqkV49+KxvOW8VYteXBMYLtUQdrlOluxI+ggfJT66X8+IaJlrQWVM/gjOk lRjBkSxjE3W9kjGRNsoRhr0JaBxvqg3YDTsmYY5AT3TuMFrUfg+QFXjfuG+wUtaUs03E je8v39eQ4PYF4sq5b3HjvOxh2xpJI9amd9BDwr3iy5M8iSpzjcnDtiGq2pTlAE6kfMXq EEcQ== 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=Msqw7+20VOncyXRhA8kS8UVVfUicMIM7evKDhbFzRwQ=; b=XfPCemt4p5WI7wtVDJFw030olHeTfJ0TcfqafXjnl0shfwytH+KAey7X7wyCyHWlkO xEYG3B2maq/jB3EljxE4LvkECIPQUhnGPjWZQ2REipFeHl3RHvFXoO7jbdnq5XhUttJ5 K+IJKbr7/LP954kuiiHhDqdtcs01oZADUerREycK3mFNfbcn6WE5VcdvKji185XhaD7n OAXjCS3zbcnPBexzC5Zzb1I6blrS4y1pqgqe8xcECdAeqph23qfCFPBQbmGliuMJYzmi IX2IA5I8Ui6NF4iRBaxeZNpeRQhRUt7+kKdWMcwyYRs0Jrt6YCqQ1NamLGCSu5fChZSS 283Q== X-Gm-Message-State: AOAM533wtysYF7dLaYKwUgsD6c1hAQhLx4S8lkexsaWC/20D2VqLCC2v Ze1qKgpBc00FklsL2jCVrm6i91JDkvqYyAxNI3UdW/eZjcstGw== X-Google-Smtp-Source: ABdhPJzBFttDDGvS3UajesHnJXE8EcEx8Te2KqYId8mfm/ahFY9tqIRlySQnF/veNm5hLqy42IuYsdq6dRi9EDBJnao= X-Received: by 2002:ac8:4cd0:: with SMTP id l16mr14018466qtv.175.1600103523274; Mon, 14 Sep 2020 10:12:03 -0700 (PDT) MIME-Version: 1.0 References: <202009141445.08EEjVY5092564@repo.freebsd.org> In-Reply-To: <202009141445.08EEjVY5092564@repo.freebsd.org> From: Warner Losh Date: Mon, 14 Sep 2020 11:11:52 -0600 Message-ID: Subject: Re: svn commit: r365720 - head/sys/conf To: Gordon Tetlow Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4BqtFc3xwTz40l5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=I9Se05Rf; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::834) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.37 / 15.00]; ARC_NA(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.98)[-0.976]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.002]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.39)[-0.394]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::834:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 17:12:05 -0000 On Mon, Sep 14, 2020 at 8:45 AM Gordon Tetlow wrote: > Author: gordon > Date: Mon Sep 14 14:45:30 2020 > New Revision: 365720 > URL: https://svnweb.freebsd.org/changeset/base/365720 > > Log: > Partially revert r346018 and use the if/then construct instead of shell. > > There are a couple of places in the tree that directly parse the > newvers.sh > script looking for the BRANCH variable. I found two locations, one in > release/Makefile and the other in bin/freebsd-version/Makefile. > > While there is a good argument that BRANCH_OVERRIDE should properly > propagate in those circumstances and the new behavior is thus better, the > reality is this change broke freebsd-update's ability to find timestamps > in > binaries and resulted in a large number of gratuitous changes. > Where? I fixed all those ages ago. Warner > Reported by: freebsd-update > Discussed with: cperciva > MFC after: 1 day > > Modified: > head/sys/conf/newvers.sh > > Modified: head/sys/conf/newvers.sh > > ============================================================================== > --- head/sys/conf/newvers.sh Mon Sep 14 14:24:54 2020 (r365719) > +++ head/sys/conf/newvers.sh Mon Sep 14 14:45:30 2020 (r365720) > @@ -54,7 +54,10 @@ > > TYPE="FreeBSD" > REVISION="13.0" > -BRANCH="${BRANCH_OVERRIDE:-CURRENT}" > +BRANCH="CURRENT" > +if [ -n "${BRANCH_OVERRIDE}" ]; then > + BRANCH=${BRANCH_OVERRIDE} > +fi > RELEASE="${REVISION}-${BRANCH}" > VERSION="${TYPE} ${RELEASE}" > > From owner-svn-src-all@freebsd.org Mon Sep 14 17:21:53 2020 Return-Path: Delivered-To: svn-src-all@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 65A0E3DCFE8; Mon, 14 Sep 2020 17:21:53 +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 4BqtSx279Sz41b0; Mon, 14 Sep 2020 17:21:53 +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 2C1AF1A915; Mon, 14 Sep 2020 17:21:53 +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 08EHLqJA088645; Mon, 14 Sep 2020 17:21:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EHLqao088644; Mon, 14 Sep 2020 17:21:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009141721.08EHLqao088644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 14 Sep 2020 17:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365728 - releng/12.2/sys/vm X-SVN-Group: releng X-SVN-Commit-Author: markj X-SVN-Commit-Paths: releng/12.2/sys/vm X-SVN-Commit-Revision: 365728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 17:21:53 -0000 Author: markj Date: Mon Sep 14 17:21:52 2020 New Revision: 365728 URL: https://svnweb.freebsd.org/changeset/base/365728 Log: MFS r365718: MFC r365437: vm_object_split(): Handle orig_object type changes. Approved by: re (gjb) Modified: releng/12.2/sys/vm/vm_object.c Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/sys/vm/vm_object.c ============================================================================== --- releng/12.2/sys/vm/vm_object.c Mon Sep 14 16:18:53 2020 (r365727) +++ releng/12.2/sys/vm/vm_object.c Mon Sep 14 17:21:52 2020 (r365728) @@ -1313,7 +1313,7 @@ vm_object_shadow( void vm_object_split(vm_map_entry_t entry) { - vm_page_t m, m_next; + vm_page_t m, m_busy, m_next; vm_object_t orig_object, new_object, source; vm_pindex_t idx, offidxstart; vm_size_t size; @@ -1370,8 +1370,14 @@ vm_object_split(vm_map_entry_t entry) ("orig_object->charge < 0")); orig_object->charge -= ptoa(size); } + m_busy = NULL; +#ifdef INVARIANTS + idx = 0; +#endif retry: m = vm_page_find_least(orig_object, offidxstart); + KASSERT(m == NULL || idx <= m->pindex - offidxstart, + ("%s: object %p was repopulated", __func__, orig_object)); for (; m != NULL && (idx = m->pindex - offidxstart) < size; m = m_next) { m_next = TAILQ_NEXT(m, listq); @@ -1417,8 +1423,16 @@ retry: */ vm_reserv_rename(m, new_object, orig_object, offidxstart); #endif - if (orig_object->type == OBJT_SWAP) + + /* + * orig_object's type may change while sleeping, so keep track + * of the beginning of the busied range. + */ + if (orig_object->type == OBJT_SWAP) { vm_page_xbusy(m); + if (m_busy == NULL) + m_busy = m; + } } if (orig_object->type == OBJT_SWAP) { /* @@ -1426,8 +1440,9 @@ retry: * and new_object's locks are released and reacquired. */ swap_pager_copy(orig_object, new_object, offidxstart, 0); - TAILQ_FOREACH(m, &new_object->memq, listq) - vm_page_xunbusy(m); + if (m_busy != NULL) + TAILQ_FOREACH_FROM(m_busy, &new_object->memq, listq) + vm_page_xunbusy(m_busy); } VM_OBJECT_WUNLOCK(orig_object); VM_OBJECT_WUNLOCK(new_object); From owner-svn-src-all@freebsd.org Mon Sep 14 17:33:29 2020 Return-Path: Delivered-To: svn-src-all@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 77B283DD30A; Mon, 14 Sep 2020 17:33:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BqtkK2XP8z41X5; Mon, 14 Sep 2020 17:33:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A4041A740; Mon, 14 Sep 2020 17:33:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08EHXTCl098401; Mon, 14 Sep 2020 17:33:29 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EHXT69098400; Mon, 14 Sep 2020 17:33:29 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202009141733.08EHXT69098400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 14 Sep 2020 17:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365729 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 365729 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 17:33:29 -0000 Author: ian Date: Mon Sep 14 17:33:28 2020 New Revision: 365729 URL: https://svnweb.freebsd.org/changeset/base/365729 Log: Add product ID strings for a couple Microchip usb hubs. Also, update the vendor ID string to say just "Microchip Technology" -- the buyout of Standard Microsystems happened in 2012 and the SMC/SMSC names are pretty much retired at this point. PR: 241406 Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Sep 14 17:21:52 2020 (r365728) +++ head/sys/dev/usb/usbdevs Mon Sep 14 17:33:28 2020 (r365729) @@ -103,7 +103,7 @@ vendor CREATIVE 0x041e Creative Labs vendor NOKIA 0x0421 Nokia vendor ADI 0x0422 ADI Systems vendor CATC 0x0423 Computer Access Technology -vendor SMC2 0x0424 Microchip (Standard Microsystems) +vendor SMC2 0x0424 Microchip Technology vendor MOTOROLA_HK 0x0425 Motorola HK vendor GRAVIS 0x0428 Advanced Gravis Computer vendor CIRRUSLOGIC 0x0429 Cirrus Logic @@ -4427,13 +4427,15 @@ product SMART2 G2MEMKEY 0x1700 G2 Memory Key product SMARTBRIDGES SMARTLINK 0x0001 SmartLink USB Ethernet product SMARTBRIDGES SMARTNIC 0x0003 smartNIC 2 PnP Ethernet -/* SMC products */ +/* Microchip Technology (formerly SMC) products */ product SMC 2102USB 0x0100 10Mbps Ethernet product SMC 2202USB 0x0200 10/100 Ethernet product SMC 2206USB 0x0201 EZ Connect USB Ethernet product SMC 2862WG 0xee13 EZ Connect Wireless Adapter product SMC2 2020HUB 0x2020 USB Hub +product SMC2 2513HUB 0x2513 USB Hub product SMC2 2514HUB 0x2514 USB Hub +product SMC2 2517HUB 0x2517 USB Hub product SMC3 2662WUSB 0xa002 2662W-AR Wireless product SMC2 LAN7800_ETH 0x7800 USB/Ethernet product SMC2 LAN7801_ETH 0x7801 USB/Ethernet From owner-svn-src-all@freebsd.org Mon Sep 14 19:39:44 2020 Return-Path: Delivered-To: svn-src-all@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 9CD773E073E; Mon, 14 Sep 2020 19:39:44 +0000 (UTC) (envelope-from jmg@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 4BqxX03gzJz4FvR; Mon, 14 Sep 2020 19:39:44 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6259F1BFDD; Mon, 14 Sep 2020 19:39:44 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08EJdiBn079470; Mon, 14 Sep 2020 19:39:44 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EJdi8k079469; Mon, 14 Sep 2020 19:39:44 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <202009141939.08EJdi8k079469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Mon, 14 Sep 2020 19:39:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365730 - stable/12/sys/dev/usb/net X-SVN-Group: stable-12 X-SVN-Commit-Author: jmg X-SVN-Commit-Paths: stable/12/sys/dev/usb/net X-SVN-Commit-Revision: 365730 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 19:39:44 -0000 Author: jmg Date: Mon Sep 14 19:39:43 2020 New Revision: 365730 URL: https://svnweb.freebsd.org/changeset/base/365730 Log: MFC r365623: Don't clear reserved bits per RealTek Modified: stable/12/sys/dev/usb/net/if_ure.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/net/if_ure.c ============================================================================== --- stable/12/sys/dev/usb/net/if_ure.c Mon Sep 14 17:33:28 2020 (r365729) +++ stable/12/sys/dev/usb/net/if_ure.c Mon Sep 14 19:39:43 2020 (r365730) @@ -784,9 +784,10 @@ ure_rxfilter(struct usb_ether *ue) URE_LOCK_ASSERT(sc, MA_OWNED); - rxmode = URE_RCR_APM; - if (ifp->if_flags & IFF_BROADCAST) - rxmode |= URE_RCR_AB; + rxmode = ure_read_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA); + rxmode &= ~(URE_RCR_AAP | URE_RCR_AM); + rxmode |= URE_RCR_APM; /* accept physical match packets */ + rxmode |= URE_RCR_AB; /* always accept broadcasts */ if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { if (ifp->if_flags & IFF_PROMISC) rxmode |= URE_RCR_AAP; From owner-svn-src-all@freebsd.org Mon Sep 14 21:33:13 2020 Return-Path: Delivered-To: svn-src-all@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 8C1F43E2ED5; Mon, 14 Sep 2020 21:33:13 +0000 (UTC) (envelope-from erj@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 4Br02x3Xmdz4MYC; Mon, 14 Sep 2020 21:33:13 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C7B11DA05; Mon, 14 Sep 2020 21:33:13 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ELXDmO053114; Mon, 14 Sep 2020 21:33:13 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ELXCK2053106; Mon, 14 Sep 2020 21:33:12 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202009142133.08ELXCK2053106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 14 Sep 2020 21:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365731 - in stable/12/sys: conf contrib/dev/ice dev/ice modules/ice_ddp X-SVN-Group: stable-12 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in stable/12/sys: conf contrib/dev/ice dev/ice modules/ice_ddp X-SVN-Commit-Revision: 365731 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 21:33:13 -0000 Author: erj Date: Mon Sep 14 21:33:11 2020 New Revision: 365731 URL: https://svnweb.freebsd.org/changeset/base/365731 Log: ice: MFC commits for update to 0.26.16 These include r365332, r365550, and r365617, which update both the ice_ddp package and the ice(4) driver itself. Relnotes: yes Sponsored by: Intel Corporation Added: stable/12/sys/contrib/dev/ice/ice-1.3.16.0.pkg - copied, changed from r365332, head/sys/contrib/dev/ice/ice-1.3.16.0.pkg Deleted: stable/12/sys/contrib/dev/ice/ice-1.3.9.0.pkg Modified: stable/12/sys/conf/files.amd64 stable/12/sys/conf/files.arm64 stable/12/sys/contrib/dev/ice/README stable/12/sys/dev/ice/ice_adminq_cmd.h stable/12/sys/dev/ice/ice_bitops.h stable/12/sys/dev/ice/ice_common.c stable/12/sys/dev/ice/ice_common.h stable/12/sys/dev/ice/ice_controlq.c stable/12/sys/dev/ice/ice_controlq.h stable/12/sys/dev/ice/ice_dcb.c stable/12/sys/dev/ice/ice_dcb.h stable/12/sys/dev/ice/ice_drv_info.h stable/12/sys/dev/ice/ice_flex_pipe.c stable/12/sys/dev/ice/ice_flex_pipe.h stable/12/sys/dev/ice/ice_flex_type.h stable/12/sys/dev/ice/ice_flow.c stable/12/sys/dev/ice/ice_flow.h stable/12/sys/dev/ice/ice_hw_autogen.h stable/12/sys/dev/ice/ice_lan_tx_rx.h stable/12/sys/dev/ice/ice_lib.c stable/12/sys/dev/ice/ice_lib.h stable/12/sys/dev/ice/ice_nvm.c stable/12/sys/dev/ice/ice_nvm.h stable/12/sys/dev/ice/ice_protocol_type.h stable/12/sys/dev/ice/ice_sched.c stable/12/sys/dev/ice/ice_sched.h stable/12/sys/dev/ice/ice_status.h stable/12/sys/dev/ice/ice_strings.c stable/12/sys/dev/ice/ice_switch.c stable/12/sys/dev/ice/ice_switch.h stable/12/sys/dev/ice/ice_type.h stable/12/sys/dev/ice/if_ice_iflib.c stable/12/sys/dev/ice/virtchnl.h stable/12/sys/dev/ice/virtchnl_inline_ipsec.h stable/12/sys/modules/ice_ddp/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/files.amd64 ============================================================================== --- stable/12/sys/conf/files.amd64 Mon Sep 14 19:39:43 2020 (r365730) +++ stable/12/sys/conf/files.amd64 Mon Sep 14 21:33:11 2020 (r365731) @@ -288,7 +288,7 @@ dev/ice/ice_sriov.c optional ice pci \ dev/ice/ice_switch.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01030900 -mice_ddp -c${.TARGET}" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031000 -mice_ddp -c${.TARGET}" \ no-implicit-rule before-depend local \ clean "ice_ddp.c" ice_ddp.fwo optional ice_ddp \ @@ -297,8 +297,8 @@ ice_ddp.fwo optional ice_ddp \ no-implicit-rule \ clean "ice_ddp.fwo" ice_ddp.fw optional ice_ddp \ - dependency "$S/contrib/dev/ice/ice-1.3.9.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.9.0.pkg ice_ddp.fw" \ + dependency "$S/contrib/dev/ice/ice-1.3.16.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.16.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" dev/ioat/ioat.c optional ioat pci Modified: stable/12/sys/conf/files.arm64 ============================================================================== --- stable/12/sys/conf/files.arm64 Mon Sep 14 19:39:43 2020 (r365730) +++ stable/12/sys/conf/files.arm64 Mon Sep 14 21:33:11 2020 (r365731) @@ -254,7 +254,7 @@ dev/ice/ice_sriov.c optional ice pci \ dev/ice/ice_switch.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01030900 -mice_ddp -c${.TARGET}" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031000 -mice_ddp -c${.TARGET}" \ no-implicit-rule before-depend local \ clean "ice_ddp.c" ice_ddp.fwo optional ice_ddp \ @@ -263,8 +263,8 @@ ice_ddp.fwo optional ice_ddp \ no-implicit-rule \ clean "ice_ddp.fwo" ice_ddp.fw optional ice_ddp \ - dependency "$S/contrib/dev/ice/ice-1.3.9.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.9.0.pkg ice_ddp.fw" \ + dependency "$S/contrib/dev/ice/ice-1.3.16.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.16.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" dev/iicbus/sy8106a.c optional sy8106a fdt Modified: stable/12/sys/contrib/dev/ice/README ============================================================================== --- stable/12/sys/contrib/dev/ice/README Mon Sep 14 19:39:43 2020 (r365730) +++ stable/12/sys/contrib/dev/ice/README Mon Sep 14 21:33:11 2020 (r365731) @@ -1,6 +1,6 @@ Dynamic Device Personalization (DDP) Package ============================================ -February 21, 2020 +July 7, 2020 Contents @@ -59,6 +59,7 @@ The OS-default DDP package supports the following: - GRE - NVGRE - RoCEv2 +- MPLS (up to 5 consecutive MPLS labels in the outermost Layer 2 header group) Safe Mode Copied and modified: stable/12/sys/contrib/dev/ice/ice-1.3.16.0.pkg (from r365332, head/sys/contrib/dev/ice/ice-1.3.16.0.pkg) ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/12/sys/dev/ice/ice_adminq_cmd.h ============================================================================== --- stable/12/sys/dev/ice/ice_adminq_cmd.h Mon Sep 14 19:39:43 2020 (r365730) +++ stable/12/sys/dev/ice/ice_adminq_cmd.h Mon Sep 14 21:33:11 2020 (r365731) @@ -156,12 +156,13 @@ struct ice_aqc_list_caps_elem { #define ICE_AQC_CAPS_MSIX 0x0043 #define ICE_AQC_CAPS_MAX_MTU 0x0047 #define ICE_AQC_CAPS_NVM_VER 0x0048 +#define ICE_AQC_CAPS_OROM_VER 0x004A +#define ICE_AQC_CAPS_NET_VER 0x004C #define ICE_AQC_CAPS_CEM 0x00F2 #define ICE_AQC_CAPS_IWARP 0x0051 #define ICE_AQC_CAPS_LED 0x0061 #define ICE_AQC_CAPS_SDP 0x0062 #define ICE_AQC_CAPS_WR_CSR_PROT 0x0064 -#define ICE_AQC_CAPS_NO_DROP_POLICY 0x0065 #define ICE_AQC_CAPS_LOGI_TO_PHYSI_PORT_MAP 0x0073 #define ICE_AQC_CAPS_SKU 0x0074 #define ICE_AQC_CAPS_PORT_MAP 0x0075 @@ -281,13 +282,6 @@ struct ice_aqc_get_sw_cfg_resp_elem { #define ICE_AQC_GET_SW_CONF_RESP_IS_VF BIT(15) }; -/* The response buffer is as follows. Note that the length of the - * elements array varies with the length of the command response. - */ -struct ice_aqc_get_sw_cfg_resp { - struct ice_aqc_get_sw_cfg_resp_elem elements[1]; -}; - /* Set Port parameters, (direct, 0x0203) */ struct ice_aqc_set_port_params { __le16 cmd_flags; @@ -338,8 +332,6 @@ struct ice_aqc_set_port_params { #define ICE_AQC_RES_TYPE_SWITCH_PROF_BLDR_TCAM 0x49 #define ICE_AQC_RES_TYPE_ACL_PROF_BLDR_PROFID 0x50 #define ICE_AQC_RES_TYPE_ACL_PROF_BLDR_TCAM 0x51 -#define ICE_AQC_RES_TYPE_FD_PROF_BLDR_PROFID 0x58 -#define ICE_AQC_RES_TYPE_FD_PROF_BLDR_TCAM 0x59 #define ICE_AQC_RES_TYPE_HASH_PROF_BLDR_PROFID 0x60 #define ICE_AQC_RES_TYPE_HASH_PROF_BLDR_TCAM 0x61 /* Resource types 0x62-67 are reserved for Hash profile builder */ @@ -372,15 +364,6 @@ struct ice_aqc_get_res_resp_elem { __le16 total_free; /* Resources un-allocated/not reserved by any PF */ }; -/* Buffer for Get Resource command */ -struct ice_aqc_get_res_resp { - /* Number of resource entries to be calculated using - * datalen/sizeof(struct ice_aqc_cmd_resp)). - * Value of 'datalen' gets updated as part of response. - */ - struct ice_aqc_get_res_resp_elem elem[1]; -}; - /* Allocate Resources command (indirect 0x0208) * Free Resources command (indirect 0x0209) */ @@ -406,7 +389,7 @@ struct ice_aqc_alloc_free_res_elem { #define ICE_AQC_RES_TYPE_VSI_PRUNE_LIST_M \ (0xF << ICE_AQC_RES_TYPE_VSI_PRUNE_LIST_S) __le16 num_elems; - struct ice_aqc_res_elem elem[1]; + struct ice_aqc_res_elem elem[STRUCT_HACK_VAR_LEN]; }; /* Get Allocated Resource Descriptors Command (indirect 0x020A) */ @@ -428,10 +411,6 @@ struct ice_aqc_get_allocd_res_desc { __le32 addr_low; }; -struct ice_aqc_get_allocd_res_desc_resp { - struct ice_aqc_res_elem elem[1]; -}; - /* Add VSI (indirect 0x0210) * Update VSI (indirect 0x0211) * Get VSI (indirect 0x0212) @@ -758,7 +737,6 @@ struct ice_aqc_sw_rules { __le32 addr_low; }; -#pragma pack(1) /* Add/Update/Get/Remove lookup Rx/Tx command/response entry * This structures describes the lookup rules and associated actions. "index" * is returned as part of a response to a successful Add command, and can be @@ -841,9 +819,8 @@ struct ice_sw_rule_lkup_rx_tx { * lookup-type */ __le16 hdr_len; - u8 hdr[1]; + u8 hdr[STRUCT_HACK_VAR_LEN]; }; -#pragma pack() /* Add/Update/Remove large action command/response entry * "index" is returned as part of a response to a successful Add command, and @@ -852,7 +829,6 @@ struct ice_sw_rule_lkup_rx_tx { struct ice_sw_rule_lg_act { __le16 index; /* Index in large action table */ __le16 size; - __le32 act[1]; /* array of size for actions */ /* Max number of large actions */ #define ICE_MAX_LG_ACT 4 /* Bit 0:1 - Action type */ @@ -903,6 +879,7 @@ struct ice_sw_rule_lg_act { #define ICE_LG_ACT_STAT_COUNT 0x7 #define ICE_LG_ACT_STAT_COUNT_S 3 #define ICE_LG_ACT_STAT_COUNT_M (0x7F << ICE_LG_ACT_STAT_COUNT_S) + __le32 act[STRUCT_HACK_VAR_LEN]; /* array of size for actions */ }; /* Add/Update/Remove VSI list command/response entry @@ -912,7 +889,7 @@ struct ice_sw_rule_lg_act { struct ice_sw_rule_vsi_list { __le16 index; /* Index of VSI/Prune list */ __le16 number_vsi; - __le16 vsi[1]; /* Array of number_vsi VSI numbers */ + __le16 vsi[STRUCT_HACK_VAR_LEN]; /* Array of number_vsi VSI numbers */ }; #pragma pack(1) @@ -977,8 +954,10 @@ struct ice_aqc_set_query_pfc_mode { struct ice_aqc_set_dcb_params { u8 cmd_flags; /* unused in response */ #define ICE_AQC_LINK_UP_DCB_CFG BIT(0) +#define ICE_AQC_PERSIST_DCB_CFG BIT(1) u8 valid_flags; /* unused in response */ #define ICE_AQC_LINK_UP_DCB_CFG_VALID BIT(0) +#define ICE_AQC_PERSIST_DCB_CFG_VALID BIT(1) u8 rsvd[14]; }; @@ -1008,14 +987,6 @@ struct ice_aqc_sched_elem_cmd { __le32 addr_low; }; -/* This is the buffer for: - * Suspend Nodes (indirect 0x0409) - * Resume Nodes (indirect 0x040A) - */ -struct ice_aqc_suspend_resume_elem { - __le32 teid[1]; -}; - struct ice_aqc_txsched_move_grp_info_hdr { __le32 src_parent_teid; __le32 dest_parent_teid; @@ -1025,7 +996,7 @@ struct ice_aqc_txsched_move_grp_info_hdr { struct ice_aqc_move_elem { struct ice_aqc_txsched_move_grp_info_hdr hdr; - __le32 teid[1]; + __le32 teid[STRUCT_HACK_VAR_LEN]; }; struct ice_aqc_elem_info_bw { @@ -1078,17 +1049,9 @@ struct ice_aqc_txsched_topo_grp_info_hdr { struct ice_aqc_add_elem { struct ice_aqc_txsched_topo_grp_info_hdr hdr; - struct ice_aqc_txsched_elem_data generic[1]; + struct ice_aqc_txsched_elem_data generic[STRUCT_HACK_VAR_LEN]; }; -struct ice_aqc_conf_elem { - struct ice_aqc_txsched_elem_data generic[1]; -}; - -struct ice_aqc_get_elem { - struct ice_aqc_txsched_elem_data generic[1]; -}; - struct ice_aqc_get_topo_elem { struct ice_aqc_txsched_topo_grp_info_hdr hdr; struct ice_aqc_txsched_elem_data @@ -1097,7 +1060,7 @@ struct ice_aqc_get_topo_elem { struct ice_aqc_delete_elem { struct ice_aqc_txsched_topo_grp_info_hdr hdr; - __le32 teid[1]; + __le32 teid[STRUCT_HACK_VAR_LEN]; }; /* Query Port ETS (indirect 0x040E) @@ -1160,10 +1123,6 @@ struct ice_aqc_rl_profile_elem { __le16 rl_encode; }; -struct ice_aqc_rl_profile_generic_elem { - struct ice_aqc_rl_profile_elem generic[1]; -}; - /* Configure L2 Node CGD (indirect 0x0414) * This indirect command allows configuring a congestion domain for given L2 * node TEIDs in the scheduler topology. @@ -1181,10 +1140,6 @@ struct ice_aqc_cfg_l2_node_cgd_elem { u8 reserved[3]; }; -struct ice_aqc_cfg_l2_node_cgd_data { - struct ice_aqc_cfg_l2_node_cgd_elem elem[1]; -}; - /* Query Scheduler Resource Allocation (indirect 0x0412) * This indirect command retrieves the scheduler resources allocated by * EMP Firmware to the given PF. @@ -1330,7 +1285,7 @@ struct ice_aqc_get_phy_caps { #define ICE_PHY_TYPE_HIGH_100G_CAUI2 BIT_ULL(2) #define ICE_PHY_TYPE_HIGH_100G_AUI2_AOC_ACC BIT_ULL(3) #define ICE_PHY_TYPE_HIGH_100G_AUI2 BIT_ULL(4) -#define ICE_PHY_TYPE_HIGH_MAX_INDEX 19 +#define ICE_PHY_TYPE_HIGH_MAX_INDEX 5 struct ice_aqc_get_phy_caps_data { __le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */ @@ -1381,6 +1336,7 @@ struct ice_aqc_get_phy_caps_data { u8 module_type[ICE_MODULE_TYPE_TOTAL_BYTE]; #define ICE_AQC_MOD_TYPE_BYTE0_SFP_PLUS 0xA0 #define ICE_AQC_MOD_TYPE_BYTE0_QSFP_PLUS 0x80 +#define ICE_AQC_MOD_TYPE_IDENT 1 #define ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_PASSIVE BIT(0) #define ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_ACTIVE BIT(1) #define ICE_AQC_MOD_TYPE_BYTE1_10G_BASE_SR BIT(4) @@ -1490,6 +1446,9 @@ struct ice_aqc_get_link_status_data { #define ICE_AQ_LINK_TOPO_UNSUPP_MEDIA BIT(7) u8 link_cfg_err; #define ICE_AQ_LINK_CFG_ERR BIT(0) +#define ICE_AQ_LINK_ACT_PORT_OPT_INVAL BIT(2) +#define ICE_AQ_LINK_FEAT_ID_OR_CONFIG_ID_INVAL BIT(3) +#define ICE_AQ_LINK_TOPO_CRITICAL_SDP_ERR BIT(4) u8 link_info; #define ICE_AQ_LINK_UP BIT(0) /* Link Status */ #define ICE_AQ_LINK_FAULT BIT(1) @@ -1607,7 +1566,7 @@ struct ice_aqc_set_mac_lb { u8 reserved[15]; }; -/* DNL Get Status command (indirect 0x680) +/* DNL Get Status command (indirect 0x0680) * Structure used for the response, the command uses the generic * ice_aqc_generic struct to pass a buffer address to the FW. */ @@ -1667,7 +1626,7 @@ struct ice_aqc_dnl_get_status_data { u32 sb_iosf_clk_cntr; }; -/* DNL run command (direct 0x681) */ +/* DNL run command (direct 0x0681) */ struct ice_aqc_dnl_run_command { u8 reserved0; u8 command; @@ -1686,7 +1645,7 @@ struct ice_aqc_dnl_run_command { u8 reserved1[12]; }; -/* DNL call command (indirect 0x682) +/* DNL call command (indirect 0x0682) * Struct is used for both command and response */ struct ice_aqc_dnl_call_command { @@ -1698,14 +1657,14 @@ struct ice_aqc_dnl_call_command { __le32 addr_low; }; -/* DNL call command/response buffer (indirect 0x682) */ +/* DNL call command/response buffer (indirect 0x0682) */ struct ice_aqc_dnl_call { __le32 stores[4]; }; /* Used for both commands: - * DNL read sto command (indirect 0x683) - * DNL write sto command (indirect 0x684) + * DNL read sto command (indirect 0x0683) + * DNL write sto command (indirect 0x0684) */ struct ice_aqc_dnl_read_write_command { u8 ctx; @@ -1720,8 +1679,8 @@ struct ice_aqc_dnl_read_write_command { }; /* Used for both command responses: - * DNL read sto response (indirect 0x683) - * DNL write sto response (indirect 0x684) + * DNL read sto response (indirect 0x0683) + * DNL write sto response (indirect 0x0684) */ struct ice_aqc_dnl_read_write_response { u8 reserved; @@ -1732,14 +1691,14 @@ struct ice_aqc_dnl_read_write_response { __le32 addr_low; /* Reserved for write command */ }; -/* DNL set breakpoints command (indirect 0x686) */ +/* DNL set breakpoints command (indirect 0x0686) */ struct ice_aqc_dnl_set_breakpoints_command { __le32 reserved[2]; __le32 addr_high; __le32 addr_low; }; -/* DNL set breakpoints data buffer structure (indirect 0x686) */ +/* DNL set breakpoints data buffer structure (indirect 0x0686) */ struct ice_aqc_dnl_set_breakpoints { u8 ctx; u8 ena; /* 0- disabled, 1- enabled */ @@ -1747,7 +1706,7 @@ struct ice_aqc_dnl_set_breakpoints { __le16 activity_id; }; -/* DNL read log data command(indirect 0x687) */ +/* DNL read log data command(indirect 0x0687) */ struct ice_aqc_dnl_read_log_command { __le16 reserved0; __le16 offset; @@ -1757,7 +1716,7 @@ struct ice_aqc_dnl_read_log_command { }; -/* DNL read log data response(indirect 0x687) */ +/* DNL read log data response(indirect 0x0687) */ struct ice_aqc_dnl_read_log_response { __le16 reserved; __le16 size; @@ -1976,6 +1935,7 @@ struct ice_aqc_get_port_options { struct ice_aqc_get_port_options_elem { u8 pmd; +#define ICE_AQC_PORT_INV_PORT_OPT 4 #define ICE_AQC_PORT_OPT_PMD_COUNT_S 0 #define ICE_AQC_PORT_OPT_PMD_COUNT_M (0xF << ICE_AQC_PORT_OPT_PMD_COUNT_S) #define ICE_AQC_PORT_OPT_PMD_WIDTH_S 4 @@ -1995,13 +1955,6 @@ struct ice_aqc_get_port_options_elem { u8 phy_scid[2]; }; -/* The buffer for command 0x06EA contains port_options_count of options - * in the option array. - */ -struct ice_aqc_get_port_options_data { - struct ice_aqc_get_port_options_elem option[1]; -}; - /* Set Port Option (direct, 0x06EB) */ struct ice_aqc_set_port_option { u8 lport_num; @@ -2114,6 +2067,7 @@ struct ice_aqc_nvm { #define ICE_AQC_NVM_LINK_TOPO_NETLIST_LEN 2 /* In bytes */ #define ICE_AQC_NVM_NETLIST_NODE_COUNT_OFFSET 2 #define ICE_AQC_NVM_NETLIST_NODE_COUNT_LEN 2 /* In bytes */ +#define ICE_AQC_NVM_NETLIST_NODE_COUNT_M MAKEMASK(0x3FF, 0) #define ICE_AQC_NVM_NETLIST_ID_BLK_START_OFFSET 5 #define ICE_AQC_NVM_NETLIST_ID_BLK_LEN 0x30 /* In words */ @@ -2353,6 +2307,18 @@ struct ice_aqc_lldp_stop_start_specific_agent { u8 reserved[15]; }; +/* LLDP Filter Control (direct 0x0A0A) */ +struct ice_aqc_lldp_filter_ctrl { + u8 cmd_flags; +#define ICE_AQC_LLDP_FILTER_ACTION_M MAKEMASK(3, 0) +#define ICE_AQC_LLDP_FILTER_ACTION_ADD 0x0 +#define ICE_AQC_LLDP_FILTER_ACTION_DELETE 0x1 +#define ICE_AQC_LLDP_FILTER_ACTION_UPDATE 0x2 + u8 reserved1; + __le16 vsi_num; + u8 reserved2[12]; +}; + /* Get/Set RSS key (indirect 0x0B04/0x0B02) */ struct ice_aqc_get_set_rss_key { #define ICE_AQC_GSET_RSS_KEY_VSI_VALID BIT(15) @@ -2389,7 +2355,7 @@ struct ice_aqc_get_set_rss_keys { struct ice_aqc_get_set_rss_lut { #define ICE_AQC_GSET_RSS_LUT_VSI_VALID BIT(15) #define ICE_AQC_GSET_RSS_LUT_VSI_ID_S 0 -#define ICE_AQC_GSET_RSS_LUT_VSI_ID_M (0x1FF << ICE_AQC_GSET_RSS_LUT_VSI_ID_S) +#define ICE_AQC_GSET_RSS_LUT_VSI_ID_M (0x3FF << ICE_AQC_GSET_RSS_LUT_VSI_ID_S) __le16 vsi_id; #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_S 0 #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_M \ @@ -2450,7 +2416,7 @@ struct ice_aqc_add_tx_qgrp { __le32 parent_teid; u8 num_txqs; u8 rsvd[3]; - struct ice_aqc_add_txqs_perq txqs[1]; + struct ice_aqc_add_txqs_perq txqs[STRUCT_HACK_VAR_LEN]; }; /* Disable Tx LAN Queues (indirect 0x0C31) */ @@ -2483,24 +2449,21 @@ struct ice_aqc_dis_txqs { * added before the start of the next group, to allow correct * alignment of the parent_teid field. */ +#pragma pack(1) struct ice_aqc_dis_txq_item { __le32 parent_teid; u8 num_qs; u8 rsvd; /* The length of the q_id array varies according to num_qs */ - __le16 q_id[1]; - /* This only applies from F8 onward */ #define ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S 15 #define ICE_AQC_Q_DIS_BUF_ELEM_TYPE_LAN_Q \ (0 << ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S) #define ICE_AQC_Q_DIS_BUF_ELEM_TYPE_RDMA_QSET \ (1 << ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S) + __le16 q_id[STRUCT_HACK_VAR_LEN]; }; +#pragma pack() -struct ice_aqc_dis_txq { - struct ice_aqc_dis_txq_item qgrps[1]; -}; - /* Tx LAN Queues Cleanup Event (0x0C31) */ struct ice_aqc_txqs_cleanup { __le16 caller_opc; @@ -2540,11 +2503,11 @@ struct ice_aqc_move_txqs_elem { struct ice_aqc_move_txqs_data { __le32 src_teid; __le32 dest_teid; - struct ice_aqc_move_txqs_elem txqs[1]; + struct ice_aqc_move_txqs_elem txqs[STRUCT_HACK_VAR_LEN]; }; /* Download Package (indirect 0x0C40) */ -/* Also used for Update Package (indirect 0x0C42) */ +/* Also used for Update Package (indirect 0x0C42 and 0x0C41) */ struct ice_aqc_download_pkg { u8 flags; #define ICE_AQC_DOWNLOAD_PKG_LAST_BUF 0x01 @@ -2593,7 +2556,7 @@ struct ice_aqc_get_pkg_info { /* Get Package Info List response buffer format (0x0C43) */ struct ice_aqc_get_pkg_info_resp { __le32 count; - struct ice_aqc_get_pkg_info pkg_info[1]; + struct ice_aqc_get_pkg_info pkg_info[STRUCT_HACK_VAR_LEN]; }; /* Driver Shared Parameters (direct, 0x0C90) */ @@ -2617,6 +2580,50 @@ struct ice_aqc_event_lan_overflow { u8 reserved[8]; }; +/* Set Health Status (direct 0xFF20) */ +struct ice_aqc_set_health_status_config { + u8 event_source; +#define ICE_AQC_HEALTH_STATUS_SET_PF_SPECIFIC_MASK BIT(0) +#define ICE_AQC_HEALTH_STATUS_SET_ALL_PF_MASK BIT(1) +#define ICE_AQC_HEALTH_STATUS_SET_GLOBAL_MASK BIT(2) + u8 reserved[15]; +}; + +/* Get Health Status codes (indirect 0xFF21) */ +struct ice_aqc_get_supported_health_status_codes { + __le16 health_code_count; + u8 reserved[6]; + __le32 addr_high; + __le32 addr_low; +}; + +/* Get Health Status (indirect 0xFF22) */ +struct ice_aqc_get_health_status { + __le16 health_status_count; + u8 reserved[6]; + __le32 addr_high; + __le32 addr_low; +}; + +/* Get Health Status event buffer entry, (0xFF22) + * repeated per reported health status + */ +struct ice_aqc_health_status_elem { + __le16 health_status_code; + __le16 event_source; +#define ICE_AQC_HEALTH_STATUS_PF (0x1) +#define ICE_AQC_HEALTH_STATUS_PORT (0x2) +#define ICE_AQC_HEALTH_STATUS_GLOBAL (0x3) + __le32 internal_data1; +#define ICE_AQC_HEALTH_STATUS_UNDEFINED_DATA (0xDEADBEEF) + __le32 internal_data2; +}; + +/* Clear Health Status (direct 0xFF23) */ +struct ice_aqc_clear_health_status { + __le32 reserved[4]; +}; + /** * struct ice_aq_desc - Admin Queue (AQ) descriptor * @flags: ICE_AQ_FLAG_* flags @@ -2706,6 +2713,7 @@ struct ice_aq_desc { struct ice_aqc_lldp_start lldp_start; struct ice_aqc_lldp_set_local_mib lldp_set_mib; struct ice_aqc_lldp_stop_start_specific_agent lldp_agent_ctrl; + struct ice_aqc_lldp_filter_ctrl lldp_filter_ctrl; struct ice_aqc_get_set_rss_lut get_set_rss_lut; struct ice_aqc_get_set_rss_key get_set_rss_key; struct ice_aqc_add_txqs add_txqs; @@ -2727,6 +2735,12 @@ struct ice_aq_desc { struct ice_aqc_get_link_status get_link_status; struct ice_aqc_event_lan_overflow lan_overflow; struct ice_aqc_get_link_topo get_link_topo; + struct ice_aqc_set_health_status_config + set_health_status_config; + struct ice_aqc_get_supported_health_status_codes + get_supported_health_status_codes; + struct ice_aqc_get_health_status get_health_status; + struct ice_aqc_clear_health_status clear_health_status; } params; }; @@ -2918,6 +2932,8 @@ enum ice_adminq_opc { ice_aqc_opc_nvm_sr_dump = 0x0707, ice_aqc_opc_nvm_save_factory_settings = 0x0708, ice_aqc_opc_nvm_update_empr = 0x0709, + ice_aqc_opc_nvm_pkg_data = 0x070A, + ice_aqc_opc_nvm_pass_component_tbl = 0x070B, /* PF/VF mailbox commands */ ice_mbx_opc_send_msg_to_pf = 0x0801, @@ -2940,6 +2956,7 @@ enum ice_adminq_opc { ice_aqc_opc_get_cee_dcb_cfg = 0x0A07, ice_aqc_opc_lldp_set_local_mib = 0x0A08, ice_aqc_opc_lldp_stop_start_specific_agent = 0x0A09, + ice_aqc_opc_lldp_filter_ctrl = 0x0A0A, /* RSS commands */ ice_aqc_opc_set_rss_key = 0x0B02, @@ -2963,6 +2980,12 @@ enum ice_adminq_opc { /* Standalone Commands/Events */ ice_aqc_opc_event_lan_overflow = 0x1001, + + /* SystemDiagnostic commands */ + ice_aqc_opc_set_health_status_config = 0xFF20, + ice_aqc_opc_get_supported_health_status_codes = 0xFF21, + ice_aqc_opc_get_health_status = 0xFF22, + ice_aqc_opc_clear_health_status = 0xFF23 }; #endif /* _ICE_ADMINQ_CMD_H_ */ Modified: stable/12/sys/dev/ice/ice_bitops.h ============================================================================== --- stable/12/sys/dev/ice/ice_bitops.h Mon Sep 14 19:39:43 2020 (r365730) +++ stable/12/sys/dev/ice/ice_bitops.h Mon Sep 14 21:33:11 2020 (r365731) @@ -242,7 +242,7 @@ ice_or_bitmap(ice_bitmap_t *dst, const ice_bitmap_t *b ice_bitmap_t mask; u16 i; - /* Handle all but last chunk*/ + /* Handle all but last chunk */ for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++) dst[i] = bmp1[i] | bmp2[i]; @@ -273,7 +273,7 @@ ice_xor_bitmap(ice_bitmap_t *dst, const ice_bitmap_t * ice_bitmap_t mask; u16 i; - /* Handle all but last chunk*/ + /* Handle all but last chunk */ for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++) dst[i] = bmp1[i] ^ bmp2[i]; @@ -287,6 +287,37 @@ ice_xor_bitmap(ice_bitmap_t *dst, const ice_bitmap_t * } /** + * ice_andnot_bitmap - bitwise ANDNOT 2 bitmaps and result in dst bitmap + * @dst: Destination bitmap that receive the result of the operation + * @bmp1: The first bitmap of ANDNOT operation + * @bmp2: The second bitmap to ANDNOT operation + * @size: Size of the bitmaps in bits + * + * This function performs a bitwise ANDNOT on two "source" bitmaps of the same + * size, and stores the result to "dst" bitmap. The "dst" bitmap must be of the + * same size as the "source" bitmaps to avoid buffer overflows. + */ +static inline void +ice_andnot_bitmap(ice_bitmap_t *dst, const ice_bitmap_t *bmp1, + const ice_bitmap_t *bmp2, u16 size) +{ + ice_bitmap_t mask; + u16 i; + + /* Handle all but last chunk */ + for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++) + dst[i] = bmp1[i] & ~bmp2[i]; + + /* We want to only clear bits within the size. Furthermore, we also do + * not want to modify destination bits which are beyond the specified + * size. Use a bitmask to ensure that we only modify the bits that are + * within the specified size. + */ + mask = LAST_CHUNK_MASK(size); + dst[i] = (dst[i] & ~mask) | ((bmp1[i] & ~bmp2[i]) & mask); +} + +/** * ice_find_next_bit - Find the index of the next set bit of a bitmap * @bitmap: the bitmap to scan * @size: the size in bits of the bitmap @@ -343,6 +374,11 @@ static inline u16 ice_find_first_bit(const ice_bitmap_ return ice_find_next_bit(bitmap, size, 0); } +#define ice_for_each_set_bit(_bitpos, _addr, _maxlen) \ + for ((_bitpos) = ice_find_first_bit((_addr), (_maxlen)); \ + (_bitpos) < (_maxlen); \ + (_bitpos) = ice_find_next_bit((_addr), (_maxlen), (_bitpos) + 1)) + /** * ice_is_any_bit_set - Return true of any bit in the bitmap is set * @bitmap: the bitmap to check @@ -373,6 +409,48 @@ static inline void ice_cp_bitmap(ice_bitmap_t *dst, ic } /** + * ice_bitmap_set - set a number of bits in bitmap from a starting position + * @dst: bitmap destination + * @pos: first bit position to set + * @num_bits: number of bits to set + * + * This function sets bits in a bitmap from pos to (pos + num_bits) - 1. + * Note that this function assumes it is operating on a bitmap declared using + * ice_declare_bitmap. + */ +static inline void +ice_bitmap_set(ice_bitmap_t *dst, u16 pos, u16 num_bits) +{ + u16 i; + + for (i = pos; i < num_bits; i++) + ice_set_bit(i, dst); +} + +/** + * ice_bitmap_hweight - hamming weight of bitmap + * @bm: bitmap pointer + * @size: size of bitmap (in bits) + * + * This function determines the number of set bits in a bitmap. + * Note that this function assumes it is operating on a bitmap declared using + * ice_declare_bitmap. + */ +static inline int +ice_bitmap_hweight(ice_bitmap_t *bm, u16 size) +{ + int count = 0; + u16 bit = 0; + + while (size > (bit = ice_find_next_bit(bm, size, bit))) { + count++; + bit++; + } + + return count; +} + +/** * ice_cmp_bitmaps - compares two bitmaps. * @bmp1: the bitmap to compare * @bmp2: the bitmap to compare with bmp1 @@ -386,12 +464,12 @@ ice_cmp_bitmap(ice_bitmap_t *bmp1, ice_bitmap_t *bmp2, ice_bitmap_t mask; u16 i; - /* Handle all but last chunk*/ + /* Handle all but last chunk */ for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++) if (bmp1[i] != bmp2[i]) return false; - /* We want to only compare bits within the size.*/ + /* We want to only compare bits within the size */ mask = LAST_CHUNK_MASK(size); if ((bmp1[i] & mask) != (bmp2[i] & mask)) return false; Modified: stable/12/sys/dev/ice/ice_common.c ============================================================================== --- stable/12/sys/dev/ice/ice_common.c Mon Sep 14 19:39:43 2020 (r365730) +++ stable/12/sys/dev/ice/ice_common.c Mon Sep 14 21:33:11 2020 (r365731) @@ -115,7 +115,8 @@ enum ice_status ice_clear_pf_cfg(struct ice_hw *hw) * is returned in user specified buffer. Please interpret user specified * buffer as "manage_mac_read" response. * Response such as various MAC addresses are stored in HW struct (port.mac) - * ice_aq_discover_caps is expected to be called before this function is called. + * ice_discover_dev_caps is expected to be called before this function is + * called. */ enum ice_status ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size, @@ -180,11 +181,13 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qua u16 pcaps_size = sizeof(*pcaps); struct ice_aq_desc desc; enum ice_status status; + struct ice_hw *hw; cmd = &desc.params.get_phy; if (!pcaps || (report_mode & ~ICE_AQC_REPORT_MODE_M) || !pi) return ICE_ERR_PARAM; + hw = pi->hw; ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_phy_caps); @@ -192,11 +195,39 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qua cmd->param0 |= CPU_TO_LE16(ICE_AQC_GET_PHY_RQM); cmd->param0 |= CPU_TO_LE16(report_mode); - status = ice_aq_send_cmd(pi->hw, &desc, pcaps, pcaps_size, cd); + status = ice_aq_send_cmd(hw, &desc, pcaps, pcaps_size, cd); + ice_debug(hw, ICE_DBG_LINK, "get phy caps - report_mode = 0x%x\n", + report_mode); + ice_debug(hw, ICE_DBG_LINK, " phy_type_low = 0x%llx\n", + (unsigned long long)LE64_TO_CPU(pcaps->phy_type_low)); + ice_debug(hw, ICE_DBG_LINK, " phy_type_high = 0x%llx\n", + (unsigned long long)LE64_TO_CPU(pcaps->phy_type_high)); + ice_debug(hw, ICE_DBG_LINK, " caps = 0x%x\n", pcaps->caps); + ice_debug(hw, ICE_DBG_LINK, " low_power_ctrl_an = 0x%x\n", + pcaps->low_power_ctrl_an); + ice_debug(hw, ICE_DBG_LINK, " eee_cap = 0x%x\n", pcaps->eee_cap); + ice_debug(hw, ICE_DBG_LINK, " eeer_value = 0x%x\n", + pcaps->eeer_value); + ice_debug(hw, ICE_DBG_LINK, " link_fec_options = 0x%x\n", + pcaps->link_fec_options); + ice_debug(hw, ICE_DBG_LINK, " module_compliance_enforcement = 0x%x\n", + pcaps->module_compliance_enforcement); + ice_debug(hw, ICE_DBG_LINK, " extended_compliance_code = 0x%x\n", + pcaps->extended_compliance_code); + ice_debug(hw, ICE_DBG_LINK, " module_type[0] = 0x%x\n", + pcaps->module_type[0]); + ice_debug(hw, ICE_DBG_LINK, " module_type[1] = 0x%x\n", + pcaps->module_type[1]); + ice_debug(hw, ICE_DBG_LINK, " module_type[2] = 0x%x\n", + pcaps->module_type[2]); + if (status == ICE_SUCCESS && report_mode == ICE_AQC_REPORT_TOPO_CAP) { pi->phy.phy_type_low = LE64_TO_CPU(pcaps->phy_type_low); pi->phy.phy_type_high = LE64_TO_CPU(pcaps->phy_type_high); + ice_memcpy(pi->phy.link_info.module_type, &pcaps->module_type, + sizeof(pi->phy.link_info.module_type), + ICE_NONDMA_TO_NONDMA); } return status; @@ -269,6 +300,18 @@ static enum ice_media_type ice_get_media_type(struct i return ICE_MEDIA_UNKNOWN; if (hw_link_info->phy_type_low) { + /* 1G SGMII is a special case where some DA cable PHYs + * may show this as an option when it really shouldn't + * be since SGMII is meant to be between a MAC and a PHY + * in a backplane. Try to detect this case and handle it + */ + if (hw_link_info->phy_type_low == ICE_PHY_TYPE_LOW_1G_SGMII && + (hw_link_info->module_type[ICE_AQC_MOD_TYPE_IDENT] == + ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_ACTIVE || + hw_link_info->module_type[ICE_AQC_MOD_TYPE_IDENT] == + ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_PASSIVE)) + return ICE_MEDIA_DA; + switch (hw_link_info->phy_type_low) { case ICE_PHY_TYPE_LOW_1000BASE_SX: case ICE_PHY_TYPE_LOW_1000BASE_LX: @@ -289,6 +332,15 @@ static enum ice_media_type ice_get_media_type(struct i case ICE_PHY_TYPE_LOW_100GBASE_SR2: case ICE_PHY_TYPE_LOW_100GBASE_DR: return ICE_MEDIA_FIBER; + case ICE_PHY_TYPE_LOW_10G_SFI_AOC_ACC: + case ICE_PHY_TYPE_LOW_25G_AUI_AOC_ACC: + case ICE_PHY_TYPE_LOW_40G_XLAUI_AOC_ACC: + case ICE_PHY_TYPE_LOW_50G_LAUI2_AOC_ACC: + case ICE_PHY_TYPE_LOW_50G_AUI2_AOC_ACC: + case ICE_PHY_TYPE_LOW_50G_AUI1_AOC_ACC: + case ICE_PHY_TYPE_LOW_100G_CAUI4_AOC_ACC: + case ICE_PHY_TYPE_LOW_100G_AUI4_AOC_ACC: + return ICE_MEDIA_FIBER; case ICE_PHY_TYPE_LOW_100BASE_TX: case ICE_PHY_TYPE_LOW_1000BASE_T: case ICE_PHY_TYPE_LOW_2500BASE_T: @@ -315,7 +367,7 @@ static enum ice_media_type ice_get_media_type(struct i case ICE_PHY_TYPE_LOW_100G_AUI4: case ICE_PHY_TYPE_LOW_100G_CAUI4: if (ice_is_media_cage_present(pi)) - return ICE_MEDIA_DA; + return ICE_MEDIA_AUI; /* fall-through */ case ICE_PHY_TYPE_LOW_1000BASE_KX: case ICE_PHY_TYPE_LOW_2500BASE_KX: @@ -335,11 +387,15 @@ static enum ice_media_type ice_get_media_type(struct i } else { switch (hw_link_info->phy_type_high) { case ICE_PHY_TYPE_HIGH_100G_AUI2: + case ICE_PHY_TYPE_HIGH_100G_CAUI2: if (ice_is_media_cage_present(pi)) - return ICE_MEDIA_DA; + return ICE_MEDIA_AUI; /* fall-through */ case ICE_PHY_TYPE_HIGH_100GBASE_KR2_PAM4: return ICE_MEDIA_BACKPLANE; + case ICE_PHY_TYPE_HIGH_100G_CAUI2_AOC_ACC: + case ICE_PHY_TYPE_HIGH_100G_AUI2_AOC_ACC: + return ICE_MEDIA_FIBER; } } return ICE_MEDIA_UNKNOWN; @@ -420,18 +476,21 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool en li->lse_ena = !!(resp->cmd_flags & CPU_TO_LE16(ICE_AQ_LSE_IS_ENABLED)); - ice_debug(hw, ICE_DBG_LINK, "link_speed = 0x%x\n", li->link_speed); - ice_debug(hw, ICE_DBG_LINK, "phy_type_low = 0x%llx\n", + ice_debug(hw, ICE_DBG_LINK, "get link info\n"); + ice_debug(hw, ICE_DBG_LINK, " link_speed = 0x%x\n", li->link_speed); + ice_debug(hw, ICE_DBG_LINK, " phy_type_low = 0x%llx\n", (unsigned long long)li->phy_type_low); - ice_debug(hw, ICE_DBG_LINK, "phy_type_high = 0x%llx\n", + ice_debug(hw, ICE_DBG_LINK, " phy_type_high = 0x%llx\n", (unsigned long long)li->phy_type_high); - ice_debug(hw, ICE_DBG_LINK, "media_type = 0x%x\n", *hw_media_type); - ice_debug(hw, ICE_DBG_LINK, "link_info = 0x%x\n", li->link_info); - ice_debug(hw, ICE_DBG_LINK, "an_info = 0x%x\n", li->an_info); - ice_debug(hw, ICE_DBG_LINK, "ext_info = 0x%x\n", li->ext_info); - ice_debug(hw, ICE_DBG_LINK, "lse_ena = 0x%x\n", li->lse_ena); - ice_debug(hw, ICE_DBG_LINK, "max_frame = 0x%x\n", li->max_frame_size); - ice_debug(hw, ICE_DBG_LINK, "pacing = 0x%x\n", li->pacing); + ice_debug(hw, ICE_DBG_LINK, " media_type = 0x%x\n", *hw_media_type); + ice_debug(hw, ICE_DBG_LINK, " link_info = 0x%x\n", li->link_info); + ice_debug(hw, ICE_DBG_LINK, " an_info = 0x%x\n", li->an_info); + ice_debug(hw, ICE_DBG_LINK, " ext_info = 0x%x\n", li->ext_info); + ice_debug(hw, ICE_DBG_LINK, " fec_info = 0x%x\n", li->fec_info); + ice_debug(hw, ICE_DBG_LINK, " lse_ena = 0x%x\n", li->lse_ena); + ice_debug(hw, ICE_DBG_LINK, " max_frame = 0x%x\n", + li->max_frame_size); + ice_debug(hw, ICE_DBG_LINK, " pacing = 0x%x\n", li->pacing); /* save link status information */ if (link) @@ -444,6 +503,43 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool en } /** + * ice_fill_tx_timer_and_fc_thresh + * @hw: pointer to the HW struct + * @cmd: pointer to MAC cfg structure + * + * Add Tx timer and FC refresh threshold info to Set MAC Config AQ command + * descriptor + */ +static void +ice_fill_tx_timer_and_fc_thresh(struct ice_hw *hw, + struct ice_aqc_set_mac_cfg *cmd) +{ + u16 fc_thres_val, tx_timer_val; + u32 val; + + /* We read back the transmit timer and fc threshold value of + * LFC. Thus, we will use index = + * PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_MAX_INDEX. + * + * Also, because we are opearating on transmit timer and fc + * threshold of LFC, we don't turn on any bit in tx_tmr_priority + */ +#define IDX_OF_LFC PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_MAX_INDEX + + /* Retrieve the transmit timer */ + val = rd32(hw, PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA(IDX_OF_LFC)); + tx_timer_val = val & + PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_HSEC_CTL_TX_PAUSE_QUANTA_M; + cmd->tx_tmr_value = CPU_TO_LE16(tx_timer_val); + + /* Retrieve the fc threshold */ + val = rd32(hw, PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER(IDX_OF_LFC)); + fc_thres_val = val & PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER_M; + + cmd->fc_refresh_threshold = CPU_TO_LE16(fc_thres_val); +} + +/** * ice_aq_set_mac_cfg * @hw: pointer to the HW struct * @max_frame_size: Maximum Frame Size to be supported @@ -454,10 +550,8 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool en enum ice_status ice_aq_set_mac_cfg(struct ice_hw *hw, u16 max_frame_size, struct ice_sq_cd *cd) { - u16 fc_threshold_val, tx_timer_val; struct ice_aqc_set_mac_cfg *cmd; struct ice_aq_desc desc; - u32 reg_val; cmd = &desc.params.set_mac_cfg; @@ -468,28 +562,8 @@ ice_aq_set_mac_cfg(struct ice_hw *hw, u16 max_frame_si cmd->max_frame_size = CPU_TO_LE16(max_frame_size); - /* We read back the transmit timer and fc threshold value of - * LFC. Thus, we will use index = - * PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_MAX_INDEX. - * - * Also, because we are opearating on transmit timer and fc - * threshold of LFC, we don't turn on any bit in tx_tmr_priority - */ -#define IDX_OF_LFC PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_MAX_INDEX + ice_fill_tx_timer_and_fc_thresh(hw, cmd); - /* Retrieve the transmit timer */ - reg_val = rd32(hw, - PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA(IDX_OF_LFC)); - tx_timer_val = reg_val & - PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_HSEC_CTL_TX_PAUSE_QUANTA_M; - cmd->tx_tmr_value = CPU_TO_LE16(tx_timer_val); - - /* Retrieve the fc threshold */ - reg_val = rd32(hw, - PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER(IDX_OF_LFC)); - fc_threshold_val = reg_val & MAKEMASK(0xFFFF, 0); - cmd->fc_refresh_threshold = CPU_TO_LE16(fc_threshold_val); - return ice_aq_send_cmd(hw, &desc, NULL, 0, cd); } @@ -500,6 +574,7 @@ ice_aq_set_mac_cfg(struct ice_hw *hw, u16 max_frame_si static enum ice_status ice_init_fltr_mgmt_struct(struct ice_hw *hw) { struct ice_switch_info *sw; + enum ice_status status; hw->switch_info = (struct ice_switch_info *) ice_malloc(hw, sizeof(*hw->switch_info)); @@ -510,28 +585,38 @@ static enum ice_status ice_init_fltr_mgmt_struct(struc return ICE_ERR_NO_MEMORY; INIT_LIST_HEAD(&sw->vsi_list_map_head); + sw->prof_res_bm_init = 0; - return ice_init_def_sw_recp(hw, &hw->switch_info->recp_list); + status = ice_init_def_sw_recp(hw, &hw->switch_info->recp_list); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Sep 14 22:15:55 2020 Return-Path: Delivered-To: svn-src-all@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 2BB013E37E1; Mon, 14 Sep 2020 22:15:55 +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 4Br10C0Pg4z4PN2; Mon, 14 Sep 2020 22:15:55 +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 CB3571DDB7; Mon, 14 Sep 2020 22:15:54 +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 08EMFsvY077347; Mon, 14 Sep 2020 22:15:54 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EMFsgl077346; Mon, 14 Sep 2020 22:15:54 GMT (envelope-from np@FreeBSD.org) Message-Id: <202009142215.08EMFsgl077346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 14 Sep 2020 22:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365732 - head/sys/dev/cxgbe/common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/common X-SVN-Commit-Revision: 365732 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 22:15:55 -0000 Author: np Date: Mon Sep 14 22:15:54 2020 New Revision: 365732 URL: https://svnweb.freebsd.org/changeset/base/365732 Log: cxgbe(4): Get the count of FCS errors from the MAC and not MPS for T6 ports. The MPS register on the T6 counts something other than FCS errors despite its name. MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Mon Sep 14 21:33:11 2020 (r365731) +++ head/sys/dev/cxgbe/common/t4_hw.c Mon Sep 14 22:15:54 2020 (r365732) @@ -6853,6 +6853,7 @@ void t4_get_port_stats_offset(struct adapter *adap, in void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p) { u32 bgmap = adap2pinfo(adap, idx)->mps_bg_map; + struct link_config *lc = &adap->port[idx]->link_cfg; u32 stat_ctl = t4_read_reg(adap, A_MPS_STAT_CTL); #define GET_STAT(name) \ @@ -6902,7 +6903,6 @@ void t4_get_port_stats(struct adapter *adap, int idx, p->rx_ucast_frames = GET_STAT(RX_PORT_UCAST); p->rx_too_long = GET_STAT(RX_PORT_MTU_ERROR); p->rx_jabber = GET_STAT(RX_PORT_MTU_CRC_ERROR); - p->rx_fcs_err = GET_STAT(RX_PORT_CRC_ERROR); p->rx_len_err = GET_STAT(RX_PORT_LEN_ERROR); p->rx_symbol_err = GET_STAT(RX_PORT_SYM_ERROR); p->rx_runt = GET_STAT(RX_PORT_LESS_64B); @@ -6922,6 +6922,26 @@ void t4_get_port_stats(struct adapter *adap, int idx, p->rx_ppp6 = GET_STAT(RX_PORT_PPP6); p->rx_ppp7 = GET_STAT(RX_PORT_PPP7); + /* + * The T6's MPS's RX_PORT_CRC_ERROR register doesn't actually count CRC + * errors so get that information from the MAC instead. Which MAC is in + * use depends on speed and FEC. The MAC counters clear on reset or + * link state change so we are only reporting errors for this + * incarnation of the link here. + */ + if (chip_id(adap) != CHELSIO_T6) + p->rx_fcs_err = GET_STAT(RX_PORT_CRC_ERROR); + else if (lc->link_ok) { + if (lc->speed > 25000 || + (lc->speed == 25000 && lc->fec == FEC_RS)) { + p->rx_fcs_err = t4_read_reg64(adap, T5_PORT_REG(idx, + A_MAC_PORT_AFRAMECHECKSEQUENCEERRORS)); + } else { + p->rx_fcs_err = t4_read_reg64(adap, T5_PORT_REG(idx, + A_MAC_PORT_MTIP_1G10G_RX_CRCERRORS)); + } + } + if (chip_id(adap) >= CHELSIO_T5) { if (stat_ctl & F_COUNTPAUSESTATRX) { p->rx_frames -= p->rx_pause; @@ -10757,6 +10777,12 @@ void t4_clr_port_stats(struct adapter *adap, int idx) t4_write_reg(adap, A_MPS_STAT_RX_BG_0_MAC_TRUNC_FRAME_L + i * 8, 0); } + if (chip_id(adap) == CHELSIO_T6) { + t4_write_reg64(adap, T5_PORT_REG(idx, + A_MAC_PORT_AFRAMECHECKSEQUENCEERRORS), 0); + t4_write_reg64(adap, T5_PORT_REG(idx, + A_MAC_PORT_MTIP_1G10G_RX_CRCERRORS), 0); + } } /** From owner-svn-src-all@freebsd.org Mon Sep 14 22:42:20 2020 Return-Path: Delivered-To: svn-src-all@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 215CD3E3F6F; Mon, 14 Sep 2020 22:42:20 +0000 (UTC) (envelope-from erj@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 4Br1Zh0MC6z4Qb5; Mon, 14 Sep 2020 22:42:20 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA3351DDFD; Mon, 14 Sep 2020 22:42:19 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08EMgJdq095847; Mon, 14 Sep 2020 22:42:19 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08EMgILj095837; Mon, 14 Sep 2020 22:42:18 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202009142242.08EMgILj095837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 14 Sep 2020 22:42:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365733 - in releng/12.2: . sys/amd64/conf sys/conf sys/contrib/dev/ice sys/dev/ice sys/modules sys/modules/ice sys/modules/ice_ddp tools/kerneldoc/subsys X-SVN-Group: releng X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in releng/12.2: . sys/amd64/conf sys/conf sys/contrib/dev/ice sys/dev/ice sys/modules sys/modules/ice sys/modules/ice_ddp tools/kerneldoc/subsys X-SVN-Commit-Revision: 365733 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 22:42:20 -0000 Author: erj Date: Mon Sep 14 22:42:17 2020 New Revision: 365733 URL: https://svnweb.freebsd.org/changeset/base/365733 Log: ice(4): Add Intel 100GbE Ethernet Driver to kernel This also adds the "package" file that's loaded by the device for configuration, used in the included ice_ddp kernel module. MFS of r365612 and r365731. Approved by: re (gjb@) Relnotes: yes Sponsored by: Intel Corporation Added: releng/12.2/sys/contrib/dev/ice/ - copied from r365612, stable/12/sys/contrib/dev/ice/ releng/12.2/sys/contrib/dev/ice/ice-1.3.16.0.pkg - copied unchanged from r365731, stable/12/sys/contrib/dev/ice/ice-1.3.16.0.pkg releng/12.2/sys/dev/ice/ - copied from r365612, stable/12/sys/dev/ice/ releng/12.2/sys/modules/ice/ - copied from r365612, stable/12/sys/modules/ice/ releng/12.2/sys/modules/ice_ddp/ - copied from r365612, stable/12/sys/modules/ice_ddp/ releng/12.2/tools/kerneldoc/subsys/Doxyfile-dev_ice - copied unchanged from r365612, stable/12/tools/kerneldoc/subsys/Doxyfile-dev_ice Deleted: releng/12.2/sys/contrib/dev/ice/ice-1.3.9.0.pkg Modified: releng/12.2/MAINTAINERS releng/12.2/sys/amd64/conf/GENERIC releng/12.2/sys/amd64/conf/NOTES releng/12.2/sys/conf/files.amd64 releng/12.2/sys/conf/files.arm64 releng/12.2/sys/contrib/dev/ice/README releng/12.2/sys/dev/ice/ice_adminq_cmd.h releng/12.2/sys/dev/ice/ice_bitops.h releng/12.2/sys/dev/ice/ice_common.c releng/12.2/sys/dev/ice/ice_common.h releng/12.2/sys/dev/ice/ice_controlq.c releng/12.2/sys/dev/ice/ice_controlq.h releng/12.2/sys/dev/ice/ice_dcb.c releng/12.2/sys/dev/ice/ice_dcb.h releng/12.2/sys/dev/ice/ice_drv_info.h releng/12.2/sys/dev/ice/ice_flex_pipe.c releng/12.2/sys/dev/ice/ice_flex_pipe.h releng/12.2/sys/dev/ice/ice_flex_type.h releng/12.2/sys/dev/ice/ice_flow.c releng/12.2/sys/dev/ice/ice_flow.h releng/12.2/sys/dev/ice/ice_hw_autogen.h releng/12.2/sys/dev/ice/ice_lan_tx_rx.h releng/12.2/sys/dev/ice/ice_lib.c releng/12.2/sys/dev/ice/ice_lib.h releng/12.2/sys/dev/ice/ice_nvm.c releng/12.2/sys/dev/ice/ice_nvm.h releng/12.2/sys/dev/ice/ice_protocol_type.h releng/12.2/sys/dev/ice/ice_sched.c releng/12.2/sys/dev/ice/ice_sched.h releng/12.2/sys/dev/ice/ice_status.h releng/12.2/sys/dev/ice/ice_strings.c releng/12.2/sys/dev/ice/ice_switch.c releng/12.2/sys/dev/ice/ice_switch.h releng/12.2/sys/dev/ice/ice_type.h releng/12.2/sys/dev/ice/if_ice_iflib.c releng/12.2/sys/dev/ice/virtchnl.h releng/12.2/sys/dev/ice/virtchnl_inline_ipsec.h releng/12.2/sys/modules/Makefile releng/12.2/sys/modules/ice_ddp/Makefile Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/MAINTAINERS ============================================================================== --- releng/12.2/MAINTAINERS Mon Sep 14 22:15:54 2020 (r365732) +++ releng/12.2/MAINTAINERS Mon Sep 14 22:42:17 2020 (r365733) @@ -89,9 +89,11 @@ share/mk/*.test.mk freebsd-testing,ngie (same list as stand/forth dteske Pre-commit review requested. stand/lua kevans Pre-commit review requested sys/compat/linuxkpi hselasky If in doubt, ask. +sys/contrib/dev/ice erj Pre-commit phabricator review requested. sys/dev/e1000 erj Pre-commit phabricator review requested. sys/dev/ixgbe erj Pre-commit phabricator review requested. sys/dev/ixl erj Pre-commit phabricator review requested. +sys/dev/ice erj Pre-commit phabricator review requested. sys/dev/sound/usb hselasky If in doubt, ask. sys/dev/usb hselasky If in doubt, ask. sys/dev/xen royger Pre-commit review recommended. Modified: releng/12.2/sys/amd64/conf/GENERIC ============================================================================== --- releng/12.2/sys/amd64/conf/GENERIC Mon Sep 14 22:15:54 2020 (r365732) +++ releng/12.2/sys/amd64/conf/GENERIC Mon Sep 14 22:42:17 2020 (r365733) @@ -225,6 +225,7 @@ device ix # Intel PRO/10GbE PCIE PF Ethernet device ixv # Intel PRO/10GbE PCIE VF Ethernet device ixl # Intel 700 Series Physical Function device iavf # Intel Adaptive Virtual Function +device ice # Intel 800 Series Physical Function device vmx # VMware VMXNET3 Ethernet # PCI Ethernet NICs. Modified: releng/12.2/sys/amd64/conf/NOTES ============================================================================== --- releng/12.2/sys/amd64/conf/NOTES Mon Sep 14 22:15:54 2020 (r365732) +++ releng/12.2/sys/amd64/conf/NOTES Mon Sep 14 22:42:17 2020 (r365733) @@ -306,6 +306,8 @@ options DRM_DEBUG # Include debug printfs (slow) # ed: Western Digital and SMC 80xx; Novell NE1000 and NE2000; 3Com 3C503 # HP PC Lan+, various PC Card devices # (requires miibus) +# ice: Intel 800 Series Physical Function +# Requires the ice_ddp module for full functionality # ipw: Intel PRO/Wireless 2100 IEEE 802.11 adapter # Requires the ipw firmware module # iwi: Intel PRO/Wireless 2200BG/2225BG/2915ABG IEEE 802.11 adapters @@ -332,6 +334,8 @@ device iwi # Intel 2200BG/2225BG/2915ABG wireless NI device iwn # Intel 4965/1000/5000/6000 wireless NICs. device ixl # Intel 700 Series Physical Function device iavf # Intel Adaptive Virtual Function +device ice # Intel 800 Series Physical Function +device ice_ddp # Intel 800 Series DDP Package device mthca # Mellanox HCA InfiniBand device mlx4 # Shared code module between IB and Ethernet device mlx4ib # Mellanox ConnectX HCA InfiniBand Modified: releng/12.2/sys/conf/files.amd64 ============================================================================== --- releng/12.2/sys/conf/files.amd64 Mon Sep 14 22:15:54 2020 (r365732) +++ releng/12.2/sys/conf/files.amd64 Mon Sep 14 22:42:17 2020 (r365733) @@ -255,6 +255,52 @@ dev/imcsmb/imcsmb.c optional imcsmb dev/imcsmb/imcsmb_pci.c optional imcsmb pci dev/intel/spi.c optional intelspi dev/io/iodev.c optional io +dev/ice/if_ice_iflib.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_lib.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_osdep.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_resmgr.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_strings.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_iflib_recovery_txrx.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_iflib_txrx.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_common.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_controlq.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_dcb.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_flex_pipe.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_flow.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_nvm.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_sched.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_sriov.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_switch.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +ice_ddp.c optional ice_ddp \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031000 -mice_ddp -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "ice_ddp.c" +ice_ddp.fwo optional ice_ddp \ + dependency "ice_ddp.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "ice_ddp.fwo" +ice_ddp.fw optional ice_ddp \ + dependency "$S/contrib/dev/ice/ice-1.3.16.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.16.0.pkg ice_ddp.fw" \ + no-obj no-implicit-rule \ + clean "ice_ddp.fw" dev/ioat/ioat.c optional ioat pci dev/ioat/ioat_test.c optional ioat pci dev/ipmi/ipmi.c optional ipmi Modified: releng/12.2/sys/conf/files.arm64 ============================================================================== --- releng/12.2/sys/conf/files.arm64 Mon Sep 14 22:15:54 2020 (r365732) +++ releng/12.2/sys/conf/files.arm64 Mon Sep 14 22:42:17 2020 (r365733) @@ -221,6 +221,53 @@ dev/axgbe/xgbe-dev.c optional axgbe dev/axgbe/xgbe-drv.c optional axgbe dev/axgbe/xgbe-mdio.c optional axgbe dev/cpufreq/cpufreq_dt.c optional cpufreq fdt +dev/ice/if_ice_iflib.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_lib.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_osdep.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_resmgr.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_strings.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_iflib_recovery_txrx.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_iflib_txrx.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_common.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_controlq.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_dcb.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_flex_pipe.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_flow.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_nvm.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_sched.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_sriov.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_switch.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +ice_ddp.c optional ice_ddp \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031000 -mice_ddp -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "ice_ddp.c" +ice_ddp.fwo optional ice_ddp \ + dependency "ice_ddp.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "ice_ddp.fwo" +ice_ddp.fw optional ice_ddp \ + dependency "$S/contrib/dev/ice/ice-1.3.16.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.16.0.pkg ice_ddp.fw" \ + no-obj no-implicit-rule \ + clean "ice_ddp.fw" +dev/iicbus/sy8106a.c optional sy8106a fdt dev/iicbus/twsi/mv_twsi.c optional twsi fdt dev/iicbus/twsi/a10_twsi.c optional twsi fdt dev/iicbus/twsi/twsi.c optional twsi fdt Modified: releng/12.2/sys/contrib/dev/ice/README ============================================================================== --- stable/12/sys/contrib/dev/ice/README Thu Sep 10 20:46:16 2020 (r365612) +++ releng/12.2/sys/contrib/dev/ice/README Mon Sep 14 22:42:17 2020 (r365733) @@ -1,6 +1,6 @@ Dynamic Device Personalization (DDP) Package ============================================ -February 21, 2020 +July 7, 2020 Contents @@ -59,6 +59,7 @@ The OS-default DDP package supports the following: - GRE - NVGRE - RoCEv2 +- MPLS (up to 5 consecutive MPLS labels in the outermost Layer 2 header group) Safe Mode Copied: releng/12.2/sys/contrib/dev/ice/ice-1.3.16.0.pkg (from r365731, stable/12/sys/contrib/dev/ice/ice-1.3.16.0.pkg) ============================================================================== Binary file (source and/or target). No diff available. Modified: releng/12.2/sys/dev/ice/ice_adminq_cmd.h ============================================================================== --- stable/12/sys/dev/ice/ice_adminq_cmd.h Thu Sep 10 20:46:16 2020 (r365612) +++ releng/12.2/sys/dev/ice/ice_adminq_cmd.h Mon Sep 14 22:42:17 2020 (r365733) @@ -156,12 +156,13 @@ struct ice_aqc_list_caps_elem { #define ICE_AQC_CAPS_MSIX 0x0043 #define ICE_AQC_CAPS_MAX_MTU 0x0047 #define ICE_AQC_CAPS_NVM_VER 0x0048 +#define ICE_AQC_CAPS_OROM_VER 0x004A +#define ICE_AQC_CAPS_NET_VER 0x004C #define ICE_AQC_CAPS_CEM 0x00F2 #define ICE_AQC_CAPS_IWARP 0x0051 #define ICE_AQC_CAPS_LED 0x0061 #define ICE_AQC_CAPS_SDP 0x0062 #define ICE_AQC_CAPS_WR_CSR_PROT 0x0064 -#define ICE_AQC_CAPS_NO_DROP_POLICY 0x0065 #define ICE_AQC_CAPS_LOGI_TO_PHYSI_PORT_MAP 0x0073 #define ICE_AQC_CAPS_SKU 0x0074 #define ICE_AQC_CAPS_PORT_MAP 0x0075 @@ -281,13 +282,6 @@ struct ice_aqc_get_sw_cfg_resp_elem { #define ICE_AQC_GET_SW_CONF_RESP_IS_VF BIT(15) }; -/* The response buffer is as follows. Note that the length of the - * elements array varies with the length of the command response. - */ -struct ice_aqc_get_sw_cfg_resp { - struct ice_aqc_get_sw_cfg_resp_elem elements[1]; -}; - /* Set Port parameters, (direct, 0x0203) */ struct ice_aqc_set_port_params { __le16 cmd_flags; @@ -338,8 +332,6 @@ struct ice_aqc_set_port_params { #define ICE_AQC_RES_TYPE_SWITCH_PROF_BLDR_TCAM 0x49 #define ICE_AQC_RES_TYPE_ACL_PROF_BLDR_PROFID 0x50 #define ICE_AQC_RES_TYPE_ACL_PROF_BLDR_TCAM 0x51 -#define ICE_AQC_RES_TYPE_FD_PROF_BLDR_PROFID 0x58 -#define ICE_AQC_RES_TYPE_FD_PROF_BLDR_TCAM 0x59 #define ICE_AQC_RES_TYPE_HASH_PROF_BLDR_PROFID 0x60 #define ICE_AQC_RES_TYPE_HASH_PROF_BLDR_TCAM 0x61 /* Resource types 0x62-67 are reserved for Hash profile builder */ @@ -372,15 +364,6 @@ struct ice_aqc_get_res_resp_elem { __le16 total_free; /* Resources un-allocated/not reserved by any PF */ }; -/* Buffer for Get Resource command */ -struct ice_aqc_get_res_resp { - /* Number of resource entries to be calculated using - * datalen/sizeof(struct ice_aqc_cmd_resp)). - * Value of 'datalen' gets updated as part of response. - */ - struct ice_aqc_get_res_resp_elem elem[1]; -}; - /* Allocate Resources command (indirect 0x0208) * Free Resources command (indirect 0x0209) */ @@ -406,7 +389,7 @@ struct ice_aqc_alloc_free_res_elem { #define ICE_AQC_RES_TYPE_VSI_PRUNE_LIST_M \ (0xF << ICE_AQC_RES_TYPE_VSI_PRUNE_LIST_S) __le16 num_elems; - struct ice_aqc_res_elem elem[1]; + struct ice_aqc_res_elem elem[STRUCT_HACK_VAR_LEN]; }; /* Get Allocated Resource Descriptors Command (indirect 0x020A) */ @@ -428,10 +411,6 @@ struct ice_aqc_get_allocd_res_desc { __le32 addr_low; }; -struct ice_aqc_get_allocd_res_desc_resp { - struct ice_aqc_res_elem elem[1]; -}; - /* Add VSI (indirect 0x0210) * Update VSI (indirect 0x0211) * Get VSI (indirect 0x0212) @@ -758,7 +737,6 @@ struct ice_aqc_sw_rules { __le32 addr_low; }; -#pragma pack(1) /* Add/Update/Get/Remove lookup Rx/Tx command/response entry * This structures describes the lookup rules and associated actions. "index" * is returned as part of a response to a successful Add command, and can be @@ -841,9 +819,8 @@ struct ice_sw_rule_lkup_rx_tx { * lookup-type */ __le16 hdr_len; - u8 hdr[1]; + u8 hdr[STRUCT_HACK_VAR_LEN]; }; -#pragma pack() /* Add/Update/Remove large action command/response entry * "index" is returned as part of a response to a successful Add command, and @@ -852,7 +829,6 @@ struct ice_sw_rule_lkup_rx_tx { struct ice_sw_rule_lg_act { __le16 index; /* Index in large action table */ __le16 size; - __le32 act[1]; /* array of size for actions */ /* Max number of large actions */ #define ICE_MAX_LG_ACT 4 /* Bit 0:1 - Action type */ @@ -903,6 +879,7 @@ struct ice_sw_rule_lg_act { #define ICE_LG_ACT_STAT_COUNT 0x7 #define ICE_LG_ACT_STAT_COUNT_S 3 #define ICE_LG_ACT_STAT_COUNT_M (0x7F << ICE_LG_ACT_STAT_COUNT_S) + __le32 act[STRUCT_HACK_VAR_LEN]; /* array of size for actions */ }; /* Add/Update/Remove VSI list command/response entry @@ -912,7 +889,7 @@ struct ice_sw_rule_lg_act { struct ice_sw_rule_vsi_list { __le16 index; /* Index of VSI/Prune list */ __le16 number_vsi; - __le16 vsi[1]; /* Array of number_vsi VSI numbers */ + __le16 vsi[STRUCT_HACK_VAR_LEN]; /* Array of number_vsi VSI numbers */ }; #pragma pack(1) @@ -977,8 +954,10 @@ struct ice_aqc_set_query_pfc_mode { struct ice_aqc_set_dcb_params { u8 cmd_flags; /* unused in response */ #define ICE_AQC_LINK_UP_DCB_CFG BIT(0) +#define ICE_AQC_PERSIST_DCB_CFG BIT(1) u8 valid_flags; /* unused in response */ #define ICE_AQC_LINK_UP_DCB_CFG_VALID BIT(0) +#define ICE_AQC_PERSIST_DCB_CFG_VALID BIT(1) u8 rsvd[14]; }; @@ -1008,14 +987,6 @@ struct ice_aqc_sched_elem_cmd { __le32 addr_low; }; -/* This is the buffer for: - * Suspend Nodes (indirect 0x0409) - * Resume Nodes (indirect 0x040A) - */ -struct ice_aqc_suspend_resume_elem { - __le32 teid[1]; -}; - struct ice_aqc_txsched_move_grp_info_hdr { __le32 src_parent_teid; __le32 dest_parent_teid; @@ -1025,7 +996,7 @@ struct ice_aqc_txsched_move_grp_info_hdr { struct ice_aqc_move_elem { struct ice_aqc_txsched_move_grp_info_hdr hdr; - __le32 teid[1]; + __le32 teid[STRUCT_HACK_VAR_LEN]; }; struct ice_aqc_elem_info_bw { @@ -1078,17 +1049,9 @@ struct ice_aqc_txsched_topo_grp_info_hdr { struct ice_aqc_add_elem { struct ice_aqc_txsched_topo_grp_info_hdr hdr; - struct ice_aqc_txsched_elem_data generic[1]; + struct ice_aqc_txsched_elem_data generic[STRUCT_HACK_VAR_LEN]; }; -struct ice_aqc_conf_elem { - struct ice_aqc_txsched_elem_data generic[1]; -}; - -struct ice_aqc_get_elem { - struct ice_aqc_txsched_elem_data generic[1]; -}; - struct ice_aqc_get_topo_elem { struct ice_aqc_txsched_topo_grp_info_hdr hdr; struct ice_aqc_txsched_elem_data @@ -1097,7 +1060,7 @@ struct ice_aqc_get_topo_elem { struct ice_aqc_delete_elem { struct ice_aqc_txsched_topo_grp_info_hdr hdr; - __le32 teid[1]; + __le32 teid[STRUCT_HACK_VAR_LEN]; }; /* Query Port ETS (indirect 0x040E) @@ -1160,10 +1123,6 @@ struct ice_aqc_rl_profile_elem { __le16 rl_encode; }; -struct ice_aqc_rl_profile_generic_elem { - struct ice_aqc_rl_profile_elem generic[1]; -}; - /* Configure L2 Node CGD (indirect 0x0414) * This indirect command allows configuring a congestion domain for given L2 * node TEIDs in the scheduler topology. @@ -1181,10 +1140,6 @@ struct ice_aqc_cfg_l2_node_cgd_elem { u8 reserved[3]; }; -struct ice_aqc_cfg_l2_node_cgd_data { - struct ice_aqc_cfg_l2_node_cgd_elem elem[1]; -}; - /* Query Scheduler Resource Allocation (indirect 0x0412) * This indirect command retrieves the scheduler resources allocated by * EMP Firmware to the given PF. @@ -1330,7 +1285,7 @@ struct ice_aqc_get_phy_caps { #define ICE_PHY_TYPE_HIGH_100G_CAUI2 BIT_ULL(2) #define ICE_PHY_TYPE_HIGH_100G_AUI2_AOC_ACC BIT_ULL(3) #define ICE_PHY_TYPE_HIGH_100G_AUI2 BIT_ULL(4) -#define ICE_PHY_TYPE_HIGH_MAX_INDEX 19 +#define ICE_PHY_TYPE_HIGH_MAX_INDEX 5 struct ice_aqc_get_phy_caps_data { __le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */ @@ -1381,6 +1336,7 @@ struct ice_aqc_get_phy_caps_data { u8 module_type[ICE_MODULE_TYPE_TOTAL_BYTE]; #define ICE_AQC_MOD_TYPE_BYTE0_SFP_PLUS 0xA0 #define ICE_AQC_MOD_TYPE_BYTE0_QSFP_PLUS 0x80 +#define ICE_AQC_MOD_TYPE_IDENT 1 #define ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_PASSIVE BIT(0) #define ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_ACTIVE BIT(1) #define ICE_AQC_MOD_TYPE_BYTE1_10G_BASE_SR BIT(4) @@ -1490,6 +1446,9 @@ struct ice_aqc_get_link_status_data { #define ICE_AQ_LINK_TOPO_UNSUPP_MEDIA BIT(7) u8 link_cfg_err; #define ICE_AQ_LINK_CFG_ERR BIT(0) +#define ICE_AQ_LINK_ACT_PORT_OPT_INVAL BIT(2) +#define ICE_AQ_LINK_FEAT_ID_OR_CONFIG_ID_INVAL BIT(3) +#define ICE_AQ_LINK_TOPO_CRITICAL_SDP_ERR BIT(4) u8 link_info; #define ICE_AQ_LINK_UP BIT(0) /* Link Status */ #define ICE_AQ_LINK_FAULT BIT(1) @@ -1607,7 +1566,7 @@ struct ice_aqc_set_mac_lb { u8 reserved[15]; }; -/* DNL Get Status command (indirect 0x680) +/* DNL Get Status command (indirect 0x0680) * Structure used for the response, the command uses the generic * ice_aqc_generic struct to pass a buffer address to the FW. */ @@ -1667,7 +1626,7 @@ struct ice_aqc_dnl_get_status_data { u32 sb_iosf_clk_cntr; }; -/* DNL run command (direct 0x681) */ +/* DNL run command (direct 0x0681) */ struct ice_aqc_dnl_run_command { u8 reserved0; u8 command; @@ -1686,7 +1645,7 @@ struct ice_aqc_dnl_run_command { u8 reserved1[12]; }; -/* DNL call command (indirect 0x682) +/* DNL call command (indirect 0x0682) * Struct is used for both command and response */ struct ice_aqc_dnl_call_command { @@ -1698,14 +1657,14 @@ struct ice_aqc_dnl_call_command { __le32 addr_low; }; -/* DNL call command/response buffer (indirect 0x682) */ +/* DNL call command/response buffer (indirect 0x0682) */ struct ice_aqc_dnl_call { __le32 stores[4]; }; /* Used for both commands: - * DNL read sto command (indirect 0x683) - * DNL write sto command (indirect 0x684) + * DNL read sto command (indirect 0x0683) + * DNL write sto command (indirect 0x0684) */ struct ice_aqc_dnl_read_write_command { u8 ctx; @@ -1720,8 +1679,8 @@ struct ice_aqc_dnl_read_write_command { }; /* Used for both command responses: - * DNL read sto response (indirect 0x683) - * DNL write sto response (indirect 0x684) + * DNL read sto response (indirect 0x0683) + * DNL write sto response (indirect 0x0684) */ struct ice_aqc_dnl_read_write_response { u8 reserved; @@ -1732,14 +1691,14 @@ struct ice_aqc_dnl_read_write_response { __le32 addr_low; /* Reserved for write command */ }; -/* DNL set breakpoints command (indirect 0x686) */ +/* DNL set breakpoints command (indirect 0x0686) */ struct ice_aqc_dnl_set_breakpoints_command { __le32 reserved[2]; __le32 addr_high; __le32 addr_low; }; -/* DNL set breakpoints data buffer structure (indirect 0x686) */ +/* DNL set breakpoints data buffer structure (indirect 0x0686) */ struct ice_aqc_dnl_set_breakpoints { u8 ctx; u8 ena; /* 0- disabled, 1- enabled */ @@ -1747,7 +1706,7 @@ struct ice_aqc_dnl_set_breakpoints { __le16 activity_id; }; -/* DNL read log data command(indirect 0x687) */ +/* DNL read log data command(indirect 0x0687) */ struct ice_aqc_dnl_read_log_command { __le16 reserved0; __le16 offset; @@ -1757,7 +1716,7 @@ struct ice_aqc_dnl_read_log_command { }; -/* DNL read log data response(indirect 0x687) */ +/* DNL read log data response(indirect 0x0687) */ struct ice_aqc_dnl_read_log_response { __le16 reserved; __le16 size; @@ -1976,6 +1935,7 @@ struct ice_aqc_get_port_options { struct ice_aqc_get_port_options_elem { u8 pmd; +#define ICE_AQC_PORT_INV_PORT_OPT 4 #define ICE_AQC_PORT_OPT_PMD_COUNT_S 0 #define ICE_AQC_PORT_OPT_PMD_COUNT_M (0xF << ICE_AQC_PORT_OPT_PMD_COUNT_S) #define ICE_AQC_PORT_OPT_PMD_WIDTH_S 4 @@ -1995,13 +1955,6 @@ struct ice_aqc_get_port_options_elem { u8 phy_scid[2]; }; -/* The buffer for command 0x06EA contains port_options_count of options - * in the option array. - */ -struct ice_aqc_get_port_options_data { - struct ice_aqc_get_port_options_elem option[1]; -}; - /* Set Port Option (direct, 0x06EB) */ struct ice_aqc_set_port_option { u8 lport_num; @@ -2114,6 +2067,7 @@ struct ice_aqc_nvm { #define ICE_AQC_NVM_LINK_TOPO_NETLIST_LEN 2 /* In bytes */ #define ICE_AQC_NVM_NETLIST_NODE_COUNT_OFFSET 2 #define ICE_AQC_NVM_NETLIST_NODE_COUNT_LEN 2 /* In bytes */ +#define ICE_AQC_NVM_NETLIST_NODE_COUNT_M MAKEMASK(0x3FF, 0) #define ICE_AQC_NVM_NETLIST_ID_BLK_START_OFFSET 5 #define ICE_AQC_NVM_NETLIST_ID_BLK_LEN 0x30 /* In words */ @@ -2353,6 +2307,18 @@ struct ice_aqc_lldp_stop_start_specific_agent { u8 reserved[15]; }; +/* LLDP Filter Control (direct 0x0A0A) */ +struct ice_aqc_lldp_filter_ctrl { + u8 cmd_flags; +#define ICE_AQC_LLDP_FILTER_ACTION_M MAKEMASK(3, 0) +#define ICE_AQC_LLDP_FILTER_ACTION_ADD 0x0 +#define ICE_AQC_LLDP_FILTER_ACTION_DELETE 0x1 +#define ICE_AQC_LLDP_FILTER_ACTION_UPDATE 0x2 + u8 reserved1; + __le16 vsi_num; + u8 reserved2[12]; +}; + /* Get/Set RSS key (indirect 0x0B04/0x0B02) */ struct ice_aqc_get_set_rss_key { #define ICE_AQC_GSET_RSS_KEY_VSI_VALID BIT(15) @@ -2389,7 +2355,7 @@ struct ice_aqc_get_set_rss_keys { struct ice_aqc_get_set_rss_lut { #define ICE_AQC_GSET_RSS_LUT_VSI_VALID BIT(15) #define ICE_AQC_GSET_RSS_LUT_VSI_ID_S 0 -#define ICE_AQC_GSET_RSS_LUT_VSI_ID_M (0x1FF << ICE_AQC_GSET_RSS_LUT_VSI_ID_S) +#define ICE_AQC_GSET_RSS_LUT_VSI_ID_M (0x3FF << ICE_AQC_GSET_RSS_LUT_VSI_ID_S) __le16 vsi_id; #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_S 0 #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_M \ @@ -2450,7 +2416,7 @@ struct ice_aqc_add_tx_qgrp { __le32 parent_teid; u8 num_txqs; u8 rsvd[3]; - struct ice_aqc_add_txqs_perq txqs[1]; + struct ice_aqc_add_txqs_perq txqs[STRUCT_HACK_VAR_LEN]; }; /* Disable Tx LAN Queues (indirect 0x0C31) */ @@ -2483,24 +2449,21 @@ struct ice_aqc_dis_txqs { * added before the start of the next group, to allow correct * alignment of the parent_teid field. */ +#pragma pack(1) struct ice_aqc_dis_txq_item { __le32 parent_teid; u8 num_qs; u8 rsvd; /* The length of the q_id array varies according to num_qs */ - __le16 q_id[1]; - /* This only applies from F8 onward */ #define ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S 15 #define ICE_AQC_Q_DIS_BUF_ELEM_TYPE_LAN_Q \ (0 << ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S) #define ICE_AQC_Q_DIS_BUF_ELEM_TYPE_RDMA_QSET \ (1 << ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S) + __le16 q_id[STRUCT_HACK_VAR_LEN]; }; +#pragma pack() -struct ice_aqc_dis_txq { - struct ice_aqc_dis_txq_item qgrps[1]; -}; - /* Tx LAN Queues Cleanup Event (0x0C31) */ struct ice_aqc_txqs_cleanup { __le16 caller_opc; @@ -2540,11 +2503,11 @@ struct ice_aqc_move_txqs_elem { struct ice_aqc_move_txqs_data { __le32 src_teid; __le32 dest_teid; - struct ice_aqc_move_txqs_elem txqs[1]; + struct ice_aqc_move_txqs_elem txqs[STRUCT_HACK_VAR_LEN]; }; /* Download Package (indirect 0x0C40) */ -/* Also used for Update Package (indirect 0x0C42) */ +/* Also used for Update Package (indirect 0x0C42 and 0x0C41) */ struct ice_aqc_download_pkg { u8 flags; #define ICE_AQC_DOWNLOAD_PKG_LAST_BUF 0x01 @@ -2593,7 +2556,7 @@ struct ice_aqc_get_pkg_info { /* Get Package Info List response buffer format (0x0C43) */ struct ice_aqc_get_pkg_info_resp { __le32 count; - struct ice_aqc_get_pkg_info pkg_info[1]; + struct ice_aqc_get_pkg_info pkg_info[STRUCT_HACK_VAR_LEN]; }; /* Driver Shared Parameters (direct, 0x0C90) */ @@ -2617,6 +2580,50 @@ struct ice_aqc_event_lan_overflow { u8 reserved[8]; }; +/* Set Health Status (direct 0xFF20) */ +struct ice_aqc_set_health_status_config { + u8 event_source; +#define ICE_AQC_HEALTH_STATUS_SET_PF_SPECIFIC_MASK BIT(0) +#define ICE_AQC_HEALTH_STATUS_SET_ALL_PF_MASK BIT(1) +#define ICE_AQC_HEALTH_STATUS_SET_GLOBAL_MASK BIT(2) + u8 reserved[15]; +}; + +/* Get Health Status codes (indirect 0xFF21) */ +struct ice_aqc_get_supported_health_status_codes { + __le16 health_code_count; + u8 reserved[6]; + __le32 addr_high; + __le32 addr_low; +}; + +/* Get Health Status (indirect 0xFF22) */ +struct ice_aqc_get_health_status { + __le16 health_status_count; + u8 reserved[6]; + __le32 addr_high; + __le32 addr_low; +}; + +/* Get Health Status event buffer entry, (0xFF22) + * repeated per reported health status + */ +struct ice_aqc_health_status_elem { + __le16 health_status_code; + __le16 event_source; +#define ICE_AQC_HEALTH_STATUS_PF (0x1) +#define ICE_AQC_HEALTH_STATUS_PORT (0x2) +#define ICE_AQC_HEALTH_STATUS_GLOBAL (0x3) + __le32 internal_data1; +#define ICE_AQC_HEALTH_STATUS_UNDEFINED_DATA (0xDEADBEEF) + __le32 internal_data2; +}; + +/* Clear Health Status (direct 0xFF23) */ +struct ice_aqc_clear_health_status { + __le32 reserved[4]; +}; + /** * struct ice_aq_desc - Admin Queue (AQ) descriptor * @flags: ICE_AQ_FLAG_* flags @@ -2706,6 +2713,7 @@ struct ice_aq_desc { struct ice_aqc_lldp_start lldp_start; struct ice_aqc_lldp_set_local_mib lldp_set_mib; struct ice_aqc_lldp_stop_start_specific_agent lldp_agent_ctrl; + struct ice_aqc_lldp_filter_ctrl lldp_filter_ctrl; struct ice_aqc_get_set_rss_lut get_set_rss_lut; struct ice_aqc_get_set_rss_key get_set_rss_key; struct ice_aqc_add_txqs add_txqs; @@ -2727,6 +2735,12 @@ struct ice_aq_desc { struct ice_aqc_get_link_status get_link_status; struct ice_aqc_event_lan_overflow lan_overflow; struct ice_aqc_get_link_topo get_link_topo; + struct ice_aqc_set_health_status_config + set_health_status_config; + struct ice_aqc_get_supported_health_status_codes + get_supported_health_status_codes; + struct ice_aqc_get_health_status get_health_status; + struct ice_aqc_clear_health_status clear_health_status; } params; }; @@ -2918,6 +2932,8 @@ enum ice_adminq_opc { ice_aqc_opc_nvm_sr_dump = 0x0707, ice_aqc_opc_nvm_save_factory_settings = 0x0708, ice_aqc_opc_nvm_update_empr = 0x0709, + ice_aqc_opc_nvm_pkg_data = 0x070A, + ice_aqc_opc_nvm_pass_component_tbl = 0x070B, /* PF/VF mailbox commands */ ice_mbx_opc_send_msg_to_pf = 0x0801, @@ -2940,6 +2956,7 @@ enum ice_adminq_opc { ice_aqc_opc_get_cee_dcb_cfg = 0x0A07, ice_aqc_opc_lldp_set_local_mib = 0x0A08, ice_aqc_opc_lldp_stop_start_specific_agent = 0x0A09, + ice_aqc_opc_lldp_filter_ctrl = 0x0A0A, /* RSS commands */ ice_aqc_opc_set_rss_key = 0x0B02, @@ -2963,6 +2980,12 @@ enum ice_adminq_opc { /* Standalone Commands/Events */ ice_aqc_opc_event_lan_overflow = 0x1001, + + /* SystemDiagnostic commands */ + ice_aqc_opc_set_health_status_config = 0xFF20, + ice_aqc_opc_get_supported_health_status_codes = 0xFF21, + ice_aqc_opc_get_health_status = 0xFF22, + ice_aqc_opc_clear_health_status = 0xFF23 }; #endif /* _ICE_ADMINQ_CMD_H_ */ Modified: releng/12.2/sys/dev/ice/ice_bitops.h ============================================================================== --- stable/12/sys/dev/ice/ice_bitops.h Thu Sep 10 20:46:16 2020 (r365612) +++ releng/12.2/sys/dev/ice/ice_bitops.h Mon Sep 14 22:42:17 2020 (r365733) @@ -242,7 +242,7 @@ ice_or_bitmap(ice_bitmap_t *dst, const ice_bitmap_t *b ice_bitmap_t mask; u16 i; - /* Handle all but last chunk*/ + /* Handle all but last chunk */ for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++) dst[i] = bmp1[i] | bmp2[i]; @@ -273,7 +273,7 @@ ice_xor_bitmap(ice_bitmap_t *dst, const ice_bitmap_t * ice_bitmap_t mask; u16 i; - /* Handle all but last chunk*/ + /* Handle all but last chunk */ for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++) dst[i] = bmp1[i] ^ bmp2[i]; @@ -287,6 +287,37 @@ ice_xor_bitmap(ice_bitmap_t *dst, const ice_bitmap_t * } /** + * ice_andnot_bitmap - bitwise ANDNOT 2 bitmaps and result in dst bitmap + * @dst: Destination bitmap that receive the result of the operation + * @bmp1: The first bitmap of ANDNOT operation + * @bmp2: The second bitmap to ANDNOT operation + * @size: Size of the bitmaps in bits + * + * This function performs a bitwise ANDNOT on two "source" bitmaps of the same + * size, and stores the result to "dst" bitmap. The "dst" bitmap must be of the + * same size as the "source" bitmaps to avoid buffer overflows. + */ +static inline void +ice_andnot_bitmap(ice_bitmap_t *dst, const ice_bitmap_t *bmp1, + const ice_bitmap_t *bmp2, u16 size) +{ + ice_bitmap_t mask; + u16 i; + + /* Handle all but last chunk */ + for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++) + dst[i] = bmp1[i] & ~bmp2[i]; + + /* We want to only clear bits within the size. Furthermore, we also do + * not want to modify destination bits which are beyond the specified + * size. Use a bitmask to ensure that we only modify the bits that are + * within the specified size. + */ + mask = LAST_CHUNK_MASK(size); + dst[i] = (dst[i] & ~mask) | ((bmp1[i] & ~bmp2[i]) & mask); +} + +/** * ice_find_next_bit - Find the index of the next set bit of a bitmap * @bitmap: the bitmap to scan * @size: the size in bits of the bitmap @@ -343,6 +374,11 @@ static inline u16 ice_find_first_bit(const ice_bitmap_ return ice_find_next_bit(bitmap, size, 0); } +#define ice_for_each_set_bit(_bitpos, _addr, _maxlen) \ + for ((_bitpos) = ice_find_first_bit((_addr), (_maxlen)); \ + (_bitpos) < (_maxlen); \ + (_bitpos) = ice_find_next_bit((_addr), (_maxlen), (_bitpos) + 1)) + /** * ice_is_any_bit_set - Return true of any bit in the bitmap is set * @bitmap: the bitmap to check @@ -373,6 +409,48 @@ static inline void ice_cp_bitmap(ice_bitmap_t *dst, ic } /** + * ice_bitmap_set - set a number of bits in bitmap from a starting position + * @dst: bitmap destination + * @pos: first bit position to set + * @num_bits: number of bits to set + * + * This function sets bits in a bitmap from pos to (pos + num_bits) - 1. + * Note that this function assumes it is operating on a bitmap declared using + * ice_declare_bitmap. + */ +static inline void +ice_bitmap_set(ice_bitmap_t *dst, u16 pos, u16 num_bits) +{ + u16 i; + + for (i = pos; i < num_bits; i++) + ice_set_bit(i, dst); +} + +/** + * ice_bitmap_hweight - hamming weight of bitmap + * @bm: bitmap pointer + * @size: size of bitmap (in bits) + * + * This function determines the number of set bits in a bitmap. + * Note that this function assumes it is operating on a bitmap declared using + * ice_declare_bitmap. + */ +static inline int +ice_bitmap_hweight(ice_bitmap_t *bm, u16 size) +{ + int count = 0; + u16 bit = 0; + + while (size > (bit = ice_find_next_bit(bm, size, bit))) { + count++; + bit++; + } + + return count; +} + +/** * ice_cmp_bitmaps - compares two bitmaps. * @bmp1: the bitmap to compare * @bmp2: the bitmap to compare with bmp1 @@ -386,12 +464,12 @@ ice_cmp_bitmap(ice_bitmap_t *bmp1, ice_bitmap_t *bmp2, ice_bitmap_t mask; u16 i; - /* Handle all but last chunk*/ + /* Handle all but last chunk */ for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++) if (bmp1[i] != bmp2[i]) return false; - /* We want to only compare bits within the size.*/ + /* We want to only compare bits within the size */ mask = LAST_CHUNK_MASK(size); if ((bmp1[i] & mask) != (bmp2[i] & mask)) return false; Modified: releng/12.2/sys/dev/ice/ice_common.c ============================================================================== --- stable/12/sys/dev/ice/ice_common.c Thu Sep 10 20:46:16 2020 (r365612) +++ releng/12.2/sys/dev/ice/ice_common.c Mon Sep 14 22:42:17 2020 (r365733) @@ -115,7 +115,8 @@ enum ice_status ice_clear_pf_cfg(struct ice_hw *hw) * is returned in user specified buffer. Please interpret user specified * buffer as "manage_mac_read" response. * Response such as various MAC addresses are stored in HW struct (port.mac) - * ice_aq_discover_caps is expected to be called before this function is called. + * ice_discover_dev_caps is expected to be called before this function is + * called. */ enum ice_status ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size, @@ -180,11 +181,13 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qua u16 pcaps_size = sizeof(*pcaps); struct ice_aq_desc desc; enum ice_status status; + struct ice_hw *hw; cmd = &desc.params.get_phy; if (!pcaps || (report_mode & ~ICE_AQC_REPORT_MODE_M) || !pi) return ICE_ERR_PARAM; + hw = pi->hw; ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_phy_caps); @@ -192,11 +195,39 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qua cmd->param0 |= CPU_TO_LE16(ICE_AQC_GET_PHY_RQM); cmd->param0 |= CPU_TO_LE16(report_mode); - status = ice_aq_send_cmd(pi->hw, &desc, pcaps, pcaps_size, cd); + status = ice_aq_send_cmd(hw, &desc, pcaps, pcaps_size, cd); + ice_debug(hw, ICE_DBG_LINK, "get phy caps - report_mode = 0x%x\n", + report_mode); + ice_debug(hw, ICE_DBG_LINK, " phy_type_low = 0x%llx\n", + (unsigned long long)LE64_TO_CPU(pcaps->phy_type_low)); + ice_debug(hw, ICE_DBG_LINK, " phy_type_high = 0x%llx\n", + (unsigned long long)LE64_TO_CPU(pcaps->phy_type_high)); + ice_debug(hw, ICE_DBG_LINK, " caps = 0x%x\n", pcaps->caps); + ice_debug(hw, ICE_DBG_LINK, " low_power_ctrl_an = 0x%x\n", + pcaps->low_power_ctrl_an); + ice_debug(hw, ICE_DBG_LINK, " eee_cap = 0x%x\n", pcaps->eee_cap); + ice_debug(hw, ICE_DBG_LINK, " eeer_value = 0x%x\n", + pcaps->eeer_value); + ice_debug(hw, ICE_DBG_LINK, " link_fec_options = 0x%x\n", + pcaps->link_fec_options); + ice_debug(hw, ICE_DBG_LINK, " module_compliance_enforcement = 0x%x\n", + pcaps->module_compliance_enforcement); + ice_debug(hw, ICE_DBG_LINK, " extended_compliance_code = 0x%x\n", + pcaps->extended_compliance_code); + ice_debug(hw, ICE_DBG_LINK, " module_type[0] = 0x%x\n", + pcaps->module_type[0]); + ice_debug(hw, ICE_DBG_LINK, " module_type[1] = 0x%x\n", + pcaps->module_type[1]); + ice_debug(hw, ICE_DBG_LINK, " module_type[2] = 0x%x\n", + pcaps->module_type[2]); + if (status == ICE_SUCCESS && report_mode == ICE_AQC_REPORT_TOPO_CAP) { pi->phy.phy_type_low = LE64_TO_CPU(pcaps->phy_type_low); pi->phy.phy_type_high = LE64_TO_CPU(pcaps->phy_type_high); + ice_memcpy(pi->phy.link_info.module_type, &pcaps->module_type, + sizeof(pi->phy.link_info.module_type), + ICE_NONDMA_TO_NONDMA); } return status; @@ -269,6 +300,18 @@ static enum ice_media_type ice_get_media_type(struct i return ICE_MEDIA_UNKNOWN; if (hw_link_info->phy_type_low) { + /* 1G SGMII is a special case where some DA cable PHYs + * may show this as an option when it really shouldn't + * be since SGMII is meant to be between a MAC and a PHY + * in a backplane. Try to detect this case and handle it + */ + if (hw_link_info->phy_type_low == ICE_PHY_TYPE_LOW_1G_SGMII && + (hw_link_info->module_type[ICE_AQC_MOD_TYPE_IDENT] == + ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_ACTIVE || + hw_link_info->module_type[ICE_AQC_MOD_TYPE_IDENT] == + ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_PASSIVE)) + return ICE_MEDIA_DA; + switch (hw_link_info->phy_type_low) { case ICE_PHY_TYPE_LOW_1000BASE_SX: case ICE_PHY_TYPE_LOW_1000BASE_LX: @@ -289,6 +332,15 @@ static enum ice_media_type ice_get_media_type(struct i case ICE_PHY_TYPE_LOW_100GBASE_SR2: case ICE_PHY_TYPE_LOW_100GBASE_DR: return ICE_MEDIA_FIBER; + case ICE_PHY_TYPE_LOW_10G_SFI_AOC_ACC: + case ICE_PHY_TYPE_LOW_25G_AUI_AOC_ACC: + case ICE_PHY_TYPE_LOW_40G_XLAUI_AOC_ACC: + case ICE_PHY_TYPE_LOW_50G_LAUI2_AOC_ACC: + case ICE_PHY_TYPE_LOW_50G_AUI2_AOC_ACC: + case ICE_PHY_TYPE_LOW_50G_AUI1_AOC_ACC: + case ICE_PHY_TYPE_LOW_100G_CAUI4_AOC_ACC: + case ICE_PHY_TYPE_LOW_100G_AUI4_AOC_ACC: + return ICE_MEDIA_FIBER; case ICE_PHY_TYPE_LOW_100BASE_TX: case ICE_PHY_TYPE_LOW_1000BASE_T: case ICE_PHY_TYPE_LOW_2500BASE_T: @@ -315,7 +367,7 @@ static enum ice_media_type ice_get_media_type(struct i case ICE_PHY_TYPE_LOW_100G_AUI4: case ICE_PHY_TYPE_LOW_100G_CAUI4: if (ice_is_media_cage_present(pi)) - return ICE_MEDIA_DA; + return ICE_MEDIA_AUI; /* fall-through */ case ICE_PHY_TYPE_LOW_1000BASE_KX: case ICE_PHY_TYPE_LOW_2500BASE_KX: @@ -335,11 +387,15 @@ static enum ice_media_type ice_get_media_type(struct i } else { switch (hw_link_info->phy_type_high) { case ICE_PHY_TYPE_HIGH_100G_AUI2: + case ICE_PHY_TYPE_HIGH_100G_CAUI2: if (ice_is_media_cage_present(pi)) - return ICE_MEDIA_DA; + return ICE_MEDIA_AUI; /* fall-through */ case ICE_PHY_TYPE_HIGH_100GBASE_KR2_PAM4: return ICE_MEDIA_BACKPLANE; + case ICE_PHY_TYPE_HIGH_100G_CAUI2_AOC_ACC: + case ICE_PHY_TYPE_HIGH_100G_AUI2_AOC_ACC: + return ICE_MEDIA_FIBER; } } return ICE_MEDIA_UNKNOWN; @@ -420,18 +476,21 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool en li->lse_ena = !!(resp->cmd_flags & CPU_TO_LE16(ICE_AQ_LSE_IS_ENABLED)); - ice_debug(hw, ICE_DBG_LINK, "link_speed = 0x%x\n", li->link_speed); - ice_debug(hw, ICE_DBG_LINK, "phy_type_low = 0x%llx\n", + ice_debug(hw, ICE_DBG_LINK, "get link info\n"); + ice_debug(hw, ICE_DBG_LINK, " link_speed = 0x%x\n", li->link_speed); + ice_debug(hw, ICE_DBG_LINK, " phy_type_low = 0x%llx\n", (unsigned long long)li->phy_type_low); - ice_debug(hw, ICE_DBG_LINK, "phy_type_high = 0x%llx\n", + ice_debug(hw, ICE_DBG_LINK, " phy_type_high = 0x%llx\n", (unsigned long long)li->phy_type_high); - ice_debug(hw, ICE_DBG_LINK, "media_type = 0x%x\n", *hw_media_type); - ice_debug(hw, ICE_DBG_LINK, "link_info = 0x%x\n", li->link_info); - ice_debug(hw, ICE_DBG_LINK, "an_info = 0x%x\n", li->an_info); - ice_debug(hw, ICE_DBG_LINK, "ext_info = 0x%x\n", li->ext_info); - ice_debug(hw, ICE_DBG_LINK, "lse_ena = 0x%x\n", li->lse_ena); - ice_debug(hw, ICE_DBG_LINK, "max_frame = 0x%x\n", li->max_frame_size); - ice_debug(hw, ICE_DBG_LINK, "pacing = 0x%x\n", li->pacing); + ice_debug(hw, ICE_DBG_LINK, " media_type = 0x%x\n", *hw_media_type); + ice_debug(hw, ICE_DBG_LINK, " link_info = 0x%x\n", li->link_info); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Sep 14 23:27:51 2020 Return-Path: Delivered-To: svn-src-all@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 CD7983E4E4F; Mon, 14 Sep 2020 23:27:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Br2bC4rNVz4Sb5; Mon, 14 Sep 2020 23:27:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 857AC1EE12; Mon, 14 Sep 2020 23:27:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ENRpss020500; Mon, 14 Sep 2020 23:27:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ENRpCC020499; Mon, 14 Sep 2020 23:27:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009142327.08ENRpCC020499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 14 Sep 2020 23:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365734 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 365734 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 23:27:51 -0000 Author: imp Date: Mon Sep 14 23:27:51 2020 New Revision: 365734 URL: https://svnweb.freebsd.org/changeset/base/365734 Log: Tweak what's visible in the standalone environment. We define offsetof in stand.h typically, but when this is included we can define it multiple times. However, we don't define bool in stand.h at the moment, so allow it to be defined inside types.h when we're building for the standalone environment. MFC After: 3 days Modified: head/sys/sys/types.h Modified: head/sys/sys/types.h ============================================================================== --- head/sys/sys/types.h Mon Sep 14 22:42:17 2020 (r365733) +++ head/sys/sys/types.h Mon Sep 14 23:27:51 2020 (r365734) @@ -292,6 +292,10 @@ typedef __uint64_t uoff_t; typedef char vm_memattr_t; /* memory attribute codes */ typedef struct vm_page *vm_page_t; +#define offsetof(type, field) __offsetof(type, field) +#endif /* _KERNEL */ + +#if defined(_KERNEL) || defined(_STANDALONE) #if !defined(__bool_true_false_are_defined) && !defined(__cplusplus) #define __bool_true_false_are_defined 1 #define false 0 @@ -301,10 +305,7 @@ typedef int _Bool; #endif typedef _Bool bool; #endif /* !__bool_true_false_are_defined && !__cplusplus */ - -#define offsetof(type, field) __offsetof(type, field) - -#endif /* _KERNEL */ +#endif /* KERNEL || _STANDALONE */ /* * The following are all things that really shouldn't exist in this header, From owner-svn-src-all@freebsd.org Mon Sep 14 23:30:05 2020 Return-Path: Delivered-To: svn-src-all@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 62EE53E539B; Mon, 14 Sep 2020 23:30:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Br2dn2311z4Sx2; Mon, 14 Sep 2020 23:30:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 262CD1ED51; Mon, 14 Sep 2020 23:30:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ENU4dn020675; Mon, 14 Sep 2020 23:30:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ENU49Y020674; Mon, 14 Sep 2020 23:30:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009142330.08ENU49Y020674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 14 Sep 2020 23:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365735 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 365735 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 23:30:05 -0000 Author: imp Date: Mon Sep 14 23:30:04 2020 New Revision: 365735 URL: https://svnweb.freebsd.org/changeset/base/365735 Log: Don't do the busy dance in icee_open/close We don't need to do the busy dance for this driver. It's handled by destroy_dev() entirely. Since all we did was busy/unbusy in open/close, just delete them. We therefore don't need to track closes either. Reviewed by: ian@ Differential Revision: https://reviews.freebsd.org/D26431 Modified: head/sys/dev/iicbus/icee.c Modified: head/sys/dev/iicbus/icee.c ============================================================================== --- head/sys/dev/iicbus/icee.c Mon Sep 14 23:27:51 2020 (r365734) +++ head/sys/dev/iicbus/icee.c Mon Sep 14 23:30:04 2020 (r365735) @@ -113,17 +113,12 @@ static struct ofw_compat_data compat_data[] = { #define CDEV2SOFTC(dev) ((dev)->si_drv1) /* cdev routines */ -static d_open_t icee_open; -static d_close_t icee_close; static d_read_t icee_read; static d_write_t icee_write; static struct cdevsw icee_cdevsw = { .d_version = D_VERSION, - .d_flags = D_TRACKCLOSE, - .d_open = icee_open, - .d_close = icee_close, .d_read = icee_read, .d_write = icee_write }; @@ -227,28 +222,6 @@ icee_detach(device_t dev) struct icee_softc *sc = device_get_softc(dev); destroy_dev(sc->cdev); - return (0); -} - -static int -icee_open(struct cdev *dev, int oflags, int devtype, struct thread *td) -{ - struct icee_softc *sc; - - sc = CDEV2SOFTC(dev); - if (device_get_state(sc->dev) < DS_BUSY) - device_busy(sc->dev); - - return (0); -} - -static int -icee_close(struct cdev *dev, int fflag, int devtype, struct thread *td) -{ - struct icee_softc *sc; - - sc = CDEV2SOFTC(dev); - device_unbusy(sc->dev); return (0); } From owner-svn-src-all@freebsd.org Mon Sep 14 23:49:18 2020 Return-Path: Delivered-To: svn-src-all@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 362F13E5985; Mon, 14 Sep 2020 23:49:18 +0000 (UTC) (envelope-from erj@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 4Br33y0cyVz4TpK; Mon, 14 Sep 2020 23:49:18 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC4D11EBDB; Mon, 14 Sep 2020 23:49:17 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ENnHDZ032930; Mon, 14 Sep 2020 23:49:17 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ENnHTc032928; Mon, 14 Sep 2020 23:49:17 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202009142349.08ENnHTc032928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 14 Sep 2020 23:49:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365736 - releng/12.2/sys/dev/ixl X-SVN-Group: releng X-SVN-Commit-Author: erj X-SVN-Commit-Paths: releng/12.2/sys/dev/ixl X-SVN-Commit-Revision: 365736 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 23:49:18 -0000 Author: erj Date: Mon Sep 14 23:49:17 2020 New Revision: 365736 URL: https://svnweb.freebsd.org/changeset/base/365736 Log: MFS r365647: ixl powerpc64 fixes PR: 249254 Approved by: re (gjb@) Modified: releng/12.2/sys/dev/ixl/i40e_prototype.h releng/12.2/sys/dev/ixl/ixl_pf_main.c Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/sys/dev/ixl/i40e_prototype.h ============================================================================== --- releng/12.2/sys/dev/ixl/i40e_prototype.h Mon Sep 14 23:30:04 2020 (r365735) +++ releng/12.2/sys/dev/ixl/i40e_prototype.h Mon Sep 14 23:49:17 2020 (r365736) @@ -627,6 +627,4 @@ enum i40e_status_code i40e_read_phy_register(struct i4 enum i40e_status_code i40e_write_phy_register(struct i40e_hw *hw, u8 page, u16 reg, u8 phy_addr, u16 value); u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num); -enum i40e_status_code i40e_blink_phy_link_led(struct i40e_hw *hw, - u32 time, u32 interval); #endif /* _I40E_PROTOTYPE_H_ */ Modified: releng/12.2/sys/dev/ixl/ixl_pf_main.c ============================================================================== --- releng/12.2/sys/dev/ixl/ixl_pf_main.c Mon Sep 14 23:30:04 2020 (r365735) +++ releng/12.2/sys/dev/ixl/ixl_pf_main.c Mon Sep 14 23:49:17 2020 (r365736) @@ -729,20 +729,22 @@ ixl_switch_config(struct ixl_pf *pf) if (pf->dbg_mask & IXL_DBG_SWITCH_INFO) { device_printf(dev, "Switch config: header reported: %d in structure, %d total\n", - sw_config->header.num_reported, sw_config->header.num_total); - for (int i = 0; i < sw_config->header.num_reported; i++) { + LE16_TO_CPU(sw_config->header.num_reported), + LE16_TO_CPU(sw_config->header.num_total)); + for (int i = 0; + i < LE16_TO_CPU(sw_config->header.num_reported); i++) { device_printf(dev, "-> %d: type=%d seid=%d uplink=%d downlink=%d\n", i, sw_config->element[i].element_type, - sw_config->element[i].seid, - sw_config->element[i].uplink_seid, - sw_config->element[i].downlink_seid); + LE16_TO_CPU(sw_config->element[i].seid), + LE16_TO_CPU(sw_config->element[i].uplink_seid), + LE16_TO_CPU(sw_config->element[i].downlink_seid)); } } /* Simplified due to a single VSI */ - vsi->uplink_seid = sw_config->element[0].uplink_seid; - vsi->downlink_seid = sw_config->element[0].downlink_seid; - vsi->seid = sw_config->element[0].seid; + vsi->uplink_seid = LE16_TO_CPU(sw_config->element[0].uplink_seid); + vsi->downlink_seid = LE16_TO_CPU(sw_config->element[0].downlink_seid); + vsi->seid = LE16_TO_CPU(sw_config->element[0].seid); return (ret); } @@ -1219,12 +1221,14 @@ ixl_add_hw_filters(struct ixl_vsi *vsi, int flags, int bcopy(f->macaddr, b->mac_addr, ETHER_ADDR_LEN); if (f->vlan == IXL_VLAN_ANY) { b->vlan_tag = 0; - b->flags = I40E_AQC_MACVLAN_ADD_IGNORE_VLAN; + b->flags = CPU_TO_LE16( + I40E_AQC_MACVLAN_ADD_IGNORE_VLAN); } else { - b->vlan_tag = f->vlan; + b->vlan_tag = CPU_TO_LE16(f->vlan); b->flags = 0; } - b->flags |= I40E_AQC_MACVLAN_ADD_PERFECT_MATCH; + b->flags |= CPU_TO_LE16( + I40E_AQC_MACVLAN_ADD_PERFECT_MATCH); f->flags &= ~IXL_FILTER_ADD; j++; From owner-svn-src-all@freebsd.org Mon Sep 14 23:51:15 2020 Return-Path: Delivered-To: svn-src-all@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 49F7D3E5469; Mon, 14 Sep 2020 23:51:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Br36C14J7z4V8g; Mon, 14 Sep 2020 23:51:15 +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 07FC61EE42; Mon, 14 Sep 2020 23:51:15 +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 08ENpECA035481; Mon, 14 Sep 2020 23:51:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ENpEQd035480; Mon, 14 Sep 2020 23:51:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009142351.08ENpEQd035480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 14 Sep 2020 23:51:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365737 - head/sys/geom/eli X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/geom/eli X-SVN-Commit-Revision: 365737 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 23:51:15 -0000 Author: imp Date: Mon Sep 14 23:51:14 2020 New Revision: 365737 URL: https://svnweb.freebsd.org/changeset/base/365737 Log: We don't need the sc_ekeys_lock in standalone environment. When we bring in geli into the boot loader, we are single threaded so we don't have to worry about locking. We have no mutexes, and don't need to use them, so comment it out. MFC After: 3 days Modified: head/sys/geom/eli/g_eli.h Modified: head/sys/geom/eli/g_eli.h ============================================================================== --- head/sys/geom/eli/g_eli.h Mon Sep 14 23:49:17 2020 (r365736) +++ head/sys/geom/eli/g_eli.h Mon Sep 14 23:51:14 2020 (r365737) @@ -181,7 +181,9 @@ struct g_eli_softc { uint8_t sc_ekey[G_ELI_DATAKEYLEN]; TAILQ_HEAD(, g_eli_key) sc_ekeys_queue; RB_HEAD(g_eli_key_tree, g_eli_key) sc_ekeys_tree; +#ifndef _STANDALONE struct mtx sc_ekeys_lock; +#endif uint64_t sc_ekeys_total; uint64_t sc_ekeys_allocated; u_int sc_ealgo; From owner-svn-src-all@freebsd.org Tue Sep 15 00:22:30 2020 Return-Path: Delivered-To: svn-src-all@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 B1DFC3E66F4; Tue, 15 Sep 2020 00:22:30 +0000 (UTC) (envelope-from jmg@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 4Br3pG4J0gz4WmR; Tue, 15 Sep 2020 00:22:30 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 773661F950; Tue, 15 Sep 2020 00:22:30 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08F0MUXk056936; Tue, 15 Sep 2020 00:22:30 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08F0MUSk056920; Tue, 15 Sep 2020 00:22:30 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <202009150022.08F0MUSk056920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Tue, 15 Sep 2020 00:22:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365738 - stable/11/sys/dev/usb/net X-SVN-Group: stable-11 X-SVN-Commit-Author: jmg X-SVN-Commit-Paths: stable/11/sys/dev/usb/net X-SVN-Commit-Revision: 365738 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 00:22:30 -0000 Author: jmg Date: Tue Sep 15 00:22:30 2020 New Revision: 365738 URL: https://svnweb.freebsd.org/changeset/base/365738 Log: MFC r365623: Don't clear reserved bits per RealTek This is a direct commit as the driver is significantly different. Modified: stable/11/sys/dev/usb/net/if_ure.c Modified: stable/11/sys/dev/usb/net/if_ure.c ============================================================================== --- stable/11/sys/dev/usb/net/if_ure.c Mon Sep 14 23:51:14 2020 (r365737) +++ stable/11/sys/dev/usb/net/if_ure.c Tue Sep 15 00:22:30 2020 (r365738) @@ -710,7 +710,9 @@ ure_init(struct usb_ether *ue) ~URE_RXDY_GATED_EN); /* Set Rx mode. */ - rxmode = URE_RCR_APM; + rxmode = ure_read_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA); + rxmode &= ~URE_RCR_ACPT_ALL; + rxmode |= URE_RCR_APM; /* If we want promiscuous mode, set the allframes bit. */ if (ifp->if_flags & IFF_PROMISC) From owner-svn-src-all@freebsd.org Tue Sep 15 04:22:30 2020 Return-Path: Delivered-To: svn-src-all@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 0BC813EF320; Tue, 15 Sep 2020 04:22:30 +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 4Br9796Cvgz4my1; Tue, 15 Sep 2020 04:22:29 +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 A0008221FD; Tue, 15 Sep 2020 04:22:29 +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 08F4MTvW005294; Tue, 15 Sep 2020 04:22:29 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08F4MTLc005291; Tue, 15 Sep 2020 04:22:29 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009150422.08F4MTLc005291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Tue, 15 Sep 2020 04:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365739 - in head: share/man/man5 share/mk stand tools/build/options X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: in head: share/man/man5 share/mk stand tools/build/options X-SVN-Commit-Revision: 365739 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 04:22:30 -0000 Author: bdragon Date: Tue Sep 15 04:22:28 2020 New Revision: 365739 URL: https://svnweb.freebsd.org/changeset/base/365739 Log: [PowerPC] Remove obsolete MK_LOADER_FORCE_LE In D12421, the ability to compile stand/ in little-endian was added, with the intention to extend loader.kboot to run in Petitboot. However, no further work was done, as the kernel then gained self-execution capabilities as Petitboot was taught to load FreeBSD kernels directly. The FreeBSD installer on powerpc64 (on POWER8 and POWER9) uses /boot/etc/kboot.conf instead of loader. As this option does nothing but cause stand/ to be miscompiled and actively causes confusion, remove it. (I have a functioning petitboot loader in my local tree, however, it turned out to be quite inconvient to use due to the current petitboot plugin design so I put it on hold.) Reviewed by: emaste, imp, jhibbits Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D26430 Deleted: head/tools/build/options/WITH_LOADER_FORCE_LE Modified: head/share/man/man5/src.conf.5 head/share/mk/src.opts.mk head/stand/defs.mk Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue Sep 15 00:22:30 2020 (r365738) +++ head/share/man/man5/src.conf.5 Tue Sep 15 04:22:28 2020 (r365739) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd September 11, 2020 +.Dd September 14, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -983,9 +983,6 @@ with support for verification based on certificates ob .It Va WITH_LOADER_FIREWIRE Enable firewire support in /boot/loader on x86. This option is a nop on all other platforms. -.It Va WITH_LOADER_FORCE_LE -Set to force the powerpc boot loader to launch the kernel in little -endian mode. .It Va WITHOUT_LOADER_GELI Disable inclusion of GELI crypto support in the boot chain binaries. .Pp Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Tue Sep 15 00:22:30 2020 (r365738) +++ head/share/mk/src.opts.mk Tue Sep 15 04:22:28 2020 (r365739) @@ -211,7 +211,6 @@ __DEFAULT_NO_OPTIONS = \ HESIOD \ LIBSOFT \ LOADER_FIREWIRE \ - LOADER_FORCE_LE \ LOADER_VERBOSE \ LOADER_VERIEXEC_PASS_MANIFEST \ MALLOC_PRODUCTION \ Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Tue Sep 15 00:22:30 2020 (r365738) +++ head/stand/defs.mk Tue Sep 15 04:22:28 2020 (r365739) @@ -175,12 +175,6 @@ DD=dd ${DD_NOSTATUS} CFLAGS+= -G0 -fno-pic -mno-abicalls .endif -.if ${MK_LOADER_FORCE_LE} != "no" -.if ${MACHINE_ARCH} == "powerpc64" -CFLAGS+= -mlittle-endian -.endif -.endif - # # Have a sensible default # From owner-svn-src-all@freebsd.org Tue Sep 15 05:46:51 2020 Return-Path: Delivered-To: svn-src-all@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 C38353F15F1; Tue, 15 Sep 2020 05:46:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BrC0W4dYLz4rLl; Tue, 15 Sep 2020 05:46:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F47C230F6; Tue, 15 Sep 2020 05:46:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08F5kpvI054042; Tue, 15 Sep 2020 05:46:51 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08F5kpRe054041; Tue, 15 Sep 2020 05:46:51 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009150546.08F5kpRe054041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 15 Sep 2020 05:46:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365740 - stable/12/sys/cam/mmc X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/cam/mmc X-SVN-Commit-Revision: 365740 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 05:46:51 -0000 Author: avg Date: Tue Sep 15 05:46:51 2020 New Revision: 365740 URL: https://svnweb.freebsd.org/changeset/base/365740 Log: MFC r365446: mmc_da: fix a typo and a too long line Modified: stable/12/sys/cam/mmc/mmc_da.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/mmc/mmc_da.c ============================================================================== --- stable/12/sys/cam/mmc/mmc_da.c Tue Sep 15 04:22:28 2020 (r365739) +++ stable/12/sys/cam/mmc/mmc_da.c Tue Sep 15 05:46:51 2020 (r365740) @@ -1847,7 +1847,8 @@ sddadone(struct cam_periph *periph, union ccb *done_cc /* Process result of switching MMC partitions */ if (softc->state == SDDA_STATE_PART_SWITCH) { CAM_DEBUG(path, CAM_DEBUG_TRACE, - ("Compteting partition switch to %d\n", softc->part_requested)); + ("Completing partition switch to %d\n", + softc->part_requested)); softc->outstanding_cmds--; /* Complete partition switch */ softc->state = SDDA_STATE_NORMAL; From owner-svn-src-all@freebsd.org Tue Sep 15 05:48:55 2020 Return-Path: Delivered-To: svn-src-all@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 AB37A3F1071; Tue, 15 Sep 2020 05:48:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BrC2v464dz4rXb; Tue, 15 Sep 2020 05:48:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 700D8238D5; Tue, 15 Sep 2020 05:48:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08F5mtBB054202; Tue, 15 Sep 2020 05:48:55 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08F5mtYg054201; Tue, 15 Sep 2020 05:48:55 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009150548.08F5mtYg054201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 15 Sep 2020 05:48:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365741 - stable/12/sys/cam/mmc X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/cam/mmc X-SVN-Commit-Revision: 365741 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 05:48:55 -0000 Author: avg Date: Tue Sep 15 05:48:55 2020 New Revision: 365741 URL: https://svnweb.freebsd.org/changeset/base/365741 Log: MFC r365445: mmc_da: make sure that part_index is not used uninitialized in sddastart Modified: stable/12/sys/cam/mmc/mmc_da.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/mmc/mmc_da.c ============================================================================== --- stable/12/sys/cam/mmc/mmc_da.c Tue Sep 15 05:46:51 2020 (r365740) +++ stable/12/sys/cam/mmc/mmc_da.c Tue Sep 15 05:48:55 2020 (r365741) @@ -1696,6 +1696,7 @@ sddastart(struct cam_periph *periph, union ccb *start_ } /* Find partition that has outstanding commands. Prefer current partition. */ + part_index = softc->part_curr; part = softc->part[softc->part_curr]; bp = bioq_first(&part->bio_queue); if (bp == NULL) { From owner-svn-src-all@freebsd.org Tue Sep 15 05:51:04 2020 Return-Path: Delivered-To: svn-src-all@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 64F293F178E; Tue, 15 Sep 2020 05:51:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BrC5N1r48z4rqB; Tue, 15 Sep 2020 05:51:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 225902383E; Tue, 15 Sep 2020 05:51:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08F5p4m6054395; Tue, 15 Sep 2020 05:51:04 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08F5p3xI054394; Tue, 15 Sep 2020 05:51:03 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009150551.08F5p3xI054394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 15 Sep 2020 05:51:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365742 - stable/12/sys/cam/mmc X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/cam/mmc X-SVN-Commit-Revision: 365742 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 05:51:04 -0000 Author: avg Date: Tue Sep 15 05:51:03 2020 New Revision: 365742 URL: https://svnweb.freebsd.org/changeset/base/365742 Log: MFC r365447: mmc_da: universally use uint8_t for the partition index Modified: stable/12/sys/cam/mmc/mmc_da.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/mmc/mmc_da.c ============================================================================== --- stable/12/sys/cam/mmc/mmc_da.c Tue Sep 15 05:48:55 2020 (r365741) +++ stable/12/sys/cam/mmc/mmc_da.c Tue Sep 15 05:51:03 2020 (r365742) @@ -170,7 +170,6 @@ static void sdda_start_init(void *context, union ccb * static void sdda_start_init_task(void *context, int pending); static void sdda_process_mmc_partitions(struct cam_periph *periph, union ccb *start_ccb); static uint32_t sdda_get_host_caps(struct cam_periph *periph, union ccb *ccb); -static void sdda_init_switch_part(struct cam_periph *periph, union ccb *start_ccb, u_int part); static int mmc_select_card(struct cam_periph *periph, union ccb *ccb, uint32_t rca); static inline uint32_t mmc_get_sector_size(struct cam_periph *periph) {return MMC_SECTOR_SIZE;} @@ -1658,10 +1657,13 @@ sdda_process_mmc_partitions(struct cam_periph *periph, * This function cannot fail, instead check switch errors in sddadone(). */ static void -sdda_init_switch_part(struct cam_periph *periph, union ccb *start_ccb, u_int part) { +sdda_init_switch_part(struct cam_periph *periph, union ccb *start_ccb, + uint8_t part) +{ struct sdda_softc *sc = (struct sdda_softc *)periph->softc; uint8_t value; + KASSERT(part < MMC_PART_MAX, ("%s: invalid partition index", __func__)); sc->part_requested = part; value = (sc->raw_ext_csd[EXT_CSD_PART_CONFIG] & @@ -1685,7 +1687,7 @@ sddastart(struct cam_periph *periph, union ccb *start_ struct sdda_softc *softc = (struct sdda_softc *)periph->softc; struct sdda_part *part; struct mmc_params *mmcp = &periph->path->device->mmc_ident_data; - int part_index; + uint8_t part_index; CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("sddastart\n")); From owner-svn-src-all@freebsd.org Tue Sep 15 06:12:31 2020 Return-Path: Delivered-To: svn-src-all@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 C0ED83F1F05; Tue, 15 Sep 2020 06:12:31 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BrCZ74WPQz4tWV; Tue, 15 Sep 2020 06:12:31 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E5DE23A76; Tue, 15 Sep 2020 06:12:31 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08F6CVow072874; Tue, 15 Sep 2020 06:12:31 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08F6CV3G072873; Tue, 15 Sep 2020 06:12:31 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202009150612.08F6CV3G072873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 15 Sep 2020 06:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365743 - stable/11/sys/dev/usb/net X-SVN-Group: stable-11 X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: stable/11/sys/dev/usb/net X-SVN-Commit-Revision: 365743 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 06:12:31 -0000 Author: lwhsu Date: Tue Sep 15 06:12:30 2020 New Revision: 365743 URL: https://svnweb.freebsd.org/changeset/base/365743 Log: MFC r365606: urndis(4): Add support of Inseego/Novatel Wireless MiFi 8800/8000 PR: 245152 Submitted by: rootless@gmail.com Reviewed by: hselasky Modified: stable/11/sys/dev/usb/net/if_urndis.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/net/if_urndis.c ============================================================================== --- stable/11/sys/dev/usb/net/if_urndis.c Tue Sep 15 05:51:03 2020 (r365742) +++ stable/11/sys/dev/usb/net/if_urndis.c Tue Sep 15 06:12:30 2020 (r365743) @@ -178,6 +178,9 @@ static const STRUCT_USB_HOST_ID urndis_host_devs[] = { /* Nokia 7 plus */ {USB_IFACE_CLASS(UICLASS_IAD), USB_IFACE_SUBCLASS(0x4), USB_IFACE_PROTOCOL(UIPROTO_ACTIVESYNC)}, + /* Novatel Wireless 8800/8000/etc */ + {USB_IFACE_CLASS(UICLASS_IAD), USB_IFACE_SUBCLASS(0xef), + USB_IFACE_PROTOCOL(UIPROTO_RNDIS)}, }; DRIVER_MODULE(urndis, uhub, urndis_driver, urndis_devclass, NULL, NULL); From owner-svn-src-all@freebsd.org Tue Sep 15 06:14:00 2020 Return-Path: Delivered-To: svn-src-all@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 D76B63F1CFD; Tue, 15 Sep 2020 06:14:00 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BrCbr5M9gz4tZy; Tue, 15 Sep 2020 06:14:00 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B12923D40; Tue, 15 Sep 2020 06:14:00 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08F6E0wt073000; Tue, 15 Sep 2020 06:14:00 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08F6E0UR072999; Tue, 15 Sep 2020 06:14:00 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202009150614.08F6E0UR072999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 15 Sep 2020 06:14:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365744 - stable/12/sys/dev/usb/net X-SVN-Group: stable-12 X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: stable/12/sys/dev/usb/net X-SVN-Commit-Revision: 365744 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 06:14:00 -0000 Author: lwhsu Date: Tue Sep 15 06:14:00 2020 New Revision: 365744 URL: https://svnweb.freebsd.org/changeset/base/365744 Log: MFC r365606: urndis(4): Add support of Inseego/Novatel Wireless MiFi 8800/8000 PR: 245152 Submitted by: rootless@gmail.com Reviewed by: hselasky Modified: stable/12/sys/dev/usb/net/if_urndis.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/net/if_urndis.c ============================================================================== --- stable/12/sys/dev/usb/net/if_urndis.c Tue Sep 15 06:12:30 2020 (r365743) +++ stable/12/sys/dev/usb/net/if_urndis.c Tue Sep 15 06:14:00 2020 (r365744) @@ -178,6 +178,9 @@ static const STRUCT_USB_HOST_ID urndis_host_devs[] = { /* Nokia 7 plus */ {USB_IFACE_CLASS(UICLASS_IAD), USB_IFACE_SUBCLASS(0x4), USB_IFACE_PROTOCOL(UIPROTO_ACTIVESYNC)}, + /* Novatel Wireless 8800/8000/etc */ + {USB_IFACE_CLASS(UICLASS_IAD), USB_IFACE_SUBCLASS(0xef), + USB_IFACE_PROTOCOL(UIPROTO_RNDIS)}, }; DRIVER_MODULE(urndis, uhub, urndis_driver, urndis_devclass, NULL, NULL); From owner-svn-src-all@freebsd.org Tue Sep 15 08:52:36 2020 Return-Path: Delivered-To: svn-src-all@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 C65C43F4EAE; Tue, 15 Sep 2020 08:52:36 +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 4BrH6r5CZ8z3YwS; Tue, 15 Sep 2020 08:52:36 +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 95E5D25A76; Tue, 15 Sep 2020 08:52: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 08F8qa8E072773; Tue, 15 Sep 2020 08:52:36 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08F8qa9f072771; Tue, 15 Sep 2020 08:52:36 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202009150852.08F8qa9f072771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 15 Sep 2020 08:52:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365745 - stable/12/sbin/rcorder X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sbin/rcorder X-SVN-Commit-Revision: 365745 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 08:52:36 -0000 Author: ae Date: Tue Sep 15 08:52:36 2020 New Revision: 365745 URL: https://svnweb.freebsd.org/changeset/base/365745 Log: MFC r365449: Add a few features to rcorder: o Enhance dependency loop logging: print full chain instead of the last link competing the loop; o Add -g option to generate dependency graph suitable for GraphViz visualization, loops and other graph generation issues are highlighted automatically; o Add -p option that enables grouping items that can be processed in parallel. Submitted by: Boris Lytochkin Differential Revision: https://reviews.freebsd.org/D25389 Modified: stable/12/sbin/rcorder/rcorder.8 stable/12/sbin/rcorder/rcorder.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/rcorder/rcorder.8 ============================================================================== --- stable/12/sbin/rcorder/rcorder.8 Tue Sep 15 06:14:00 2020 (r365744) +++ stable/12/sbin/rcorder/rcorder.8 Tue Sep 15 08:52:36 2020 (r365745) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 22, 2020 +.Dd September 8, 2020 .Dt RCORDER 8 .Os .Sh NAME @@ -39,6 +39,7 @@ .Nd print a dependency ordering of interdependent files .Sh SYNOPSIS .Nm +.Op Fl gp .Op Fl k Ar keep .Op Fl s Ar skip .Ar @@ -95,6 +96,9 @@ is reached, parsing stops. .Pp The options are as follows: .Bl -tag -width "-k keep" +.It Fl g +Produce a GraphViz (.dot) of the complete dependency graph instead of +plaintext calling order list. .It Fl k Ar keep Add the specified keyword to the .Dq "keep list" . @@ -102,6 +106,9 @@ If any .Fl k option is given, only those files containing the matching keyword are listed. This option can be specified multiple times. +.It Fl p +Generate ordering suitable for parallel startup, placing files that can be +executed simultaneously on the same line. .It Fl s Ar skip Add the specified keyword to the .Dq "skip list" . @@ -178,19 +185,46 @@ The utility may print one of the following error messages and exit with a non-zero status if it encounters an error while processing the file list. .Bl -diag -.It "Requirement %s has no providers, aborting." +.It "Requirement %s in file %s has no providers." No file has a .Ql PROVIDE line corresponding to a condition present in a .Ql REQUIRE line in another file. -.It "Circular dependency on provision %s, aborting." +.It "Circular dependency on provision %s in file %s." A set of files has a circular dependency which was detected while processing the stated condition. -.It "Circular dependency on file %s, aborting." +Loop visualization follows this message. +.It "Circular dependency on file %s." A set of files has a circular dependency which was detected while processing the stated file. +.It "%s was seen in circular dependencies for %d times." +Each node that was a part of circular dependency loops reports total number of +such encounters. +Start with files having biggest counter when fighting with broken dependencies. .El +.Sh DIAGNOSTICS WITH GRAPHVIZ +Direct dependency is drawn with solid line, +.Ql BEFORE +dependency is drawn as a dashed line. +Each node of a graph represents an item from +.Ql PROVIDE +lines. +In case there are more than one file providing an item, a list of filenames +shortened with +.Xr basename 3 +is shown. +Shortened filenames are also shown in case +.Ql PROVIDE +item does not match file name. +.Pp +Edges and nodes where circular dependencies were detected are drawn bold red. +If a file has an item in +.Ql REQUIRE +or in +.Ql BEFORE +that could not be provided, +this missing provider and the requirement will be drawn bold red as well. .Sh SEE ALSO .Xr acpiconf 8 , .Xr rc 8 , Modified: stable/12/sbin/rcorder/rcorder.c ============================================================================== --- stable/12/sbin/rcorder/rcorder.c Tue Sep 15 06:14:00 2020 (r365744) +++ stable/12/sbin/rcorder/rcorder.c Tue Sep 15 08:52:36 2020 (r365745) @@ -9,6 +9,8 @@ * All rights reserved. * Copyright (c) 1998 * Perry E. Metzger. All rights reserved. + * Copyright (c) 2020 + * Boris N. Lytochkin. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -48,6 +50,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include "ealloc.h" #include "sprite.h" @@ -75,17 +79,21 @@ static int debug = 0; #define KEYWORDS_STR "# KEYWORDS:" #define KEYWORDS_LEN (sizeof(KEYWORDS_STR) - 1) +#define FAKE_PROV_NAME "fake_prov_" + static int exit_code; static int file_count; static char **file_list; -typedef int bool; #define TRUE 1 #define FALSE 0 typedef bool flag; #define SET TRUE #define RESET FALSE +static flag do_graphviz = false; +static flag do_parallel = false; + static Hash_Table provide_hash_s, *provide_hash; typedef struct provnode provnode; @@ -97,12 +105,14 @@ typedef struct strnodelist strnodelist; struct provnode { flag head; flag in_progress; + int sequence; filenode *fnode; provnode *next, *last; }; struct f_provnode { provnode *pnode; + Hash_Entry *entry; f_provnode *next; }; @@ -124,19 +134,23 @@ struct filenode { f_reqnode *req_list; f_provnode *prov_list; strnodelist *keyword_list; + int issues_count; + int sequence; }; -static filenode fn_head_s, *fn_head; +static filenode fn_head_s, *fn_head, **fn_seqlist; +static int max_sequence = 0; static strnodelist *bl_list; static strnodelist *keep_list; static strnodelist *skip_list; -static void do_file(filenode *fnode); +static void do_file(filenode *fnode, strnodelist *); static void strnode_add(strnodelist **, char *, filenode *); static int skip_ok(filenode *fnode); static int keep_ok(filenode *fnode); -static void satisfy_req(f_reqnode *rnode, char *filename); +static char *generate_loop_for_req(strnodelist *, provnode *, filenode *); +static void satisfy_req(f_reqnode *rnode, filenode *fnode, strnodelist *); static void crunch_file(char *); static void parse_require(filenode *, char *); static void parse_provide(filenode *, char *); @@ -151,6 +165,12 @@ static void insert_before(void); static Hash_Entry *make_fake_provision(filenode *); static void crunch_all_files(void); static void initialize(void); +static void generate_graphviz_header(void); +static void generate_graphviz_footer(void); +static void generate_graphviz_file_links(Hash_Entry *, filenode *); +static void generate_graphviz_providers(void); +static inline int is_fake_prov(const char *); +static int sequence_cmp(const void *, const void *); static void generate_ordering(void); int @@ -158,7 +178,7 @@ main(int argc, char *argv[]) { int ch; - while ((ch = getopt(argc, argv, "dk:s:")) != -1) + while ((ch = getopt(argc, argv, "dgk:ps:")) != -1) switch (ch) { case 'd': #ifdef DEBUG @@ -167,9 +187,15 @@ main(int argc, char *argv[]) warnx("debugging not compiled in, -d ignored"); #endif break; + case 'g': + do_graphviz = true; + break; case 'k': strnode_add(&keep_list, optarg, 0); break; + case 'p': + do_parallel = true; + break; case 's': strnode_add(&skip_list, optarg, 0); break; @@ -186,10 +212,13 @@ main(int argc, char *argv[]) DPRINTF((stderr, "parse_args\n")); initialize(); DPRINTF((stderr, "initialize\n")); + generate_graphviz_header(); crunch_all_files(); DPRINTF((stderr, "crunch_all_files\n")); + generate_graphviz_providers(); generate_ordering(); DPRINTF((stderr, "generate_ordering\n")); + generate_graphviz_footer(); exit(exit_code); } @@ -295,6 +324,7 @@ add_provide(filenode *fnode, char *s) head->head = SET; head->in_progress = RESET; head->fnode = NULL; + head->sequence = 0; head->last = head->next = NULL; Hash_SetValue(entry, head); } @@ -350,6 +380,7 @@ add_provide(filenode *fnode, char *s) f_pnode = emalloc(sizeof(*f_pnode)); f_pnode->pnode = pnode; + f_pnode->entry = entry; f_pnode->next = fnode->prov_list; fnode->prov_list = f_pnode; } @@ -522,7 +553,7 @@ make_fake_provision(filenode *node) char buffer[30]; do { - snprintf(buffer, sizeof buffer, "fake_prov_%08d", i++); + snprintf(buffer, sizeof buffer, FAKE_PROV_NAME "%08d", i++); entry = Hash_CreateEntry(provide_hash, buffer, &new); } while (new == 0); head = emalloc(sizeof(*head)); @@ -543,6 +574,7 @@ make_fake_provision(filenode *node) pnode->next->last = pnode; f_pnode = emalloc(sizeof(*f_pnode)); + f_pnode->entry = entry; f_pnode->pnode = pnode; f_pnode->next = node->prov_list; node->prov_list = f_pnode; @@ -575,6 +607,11 @@ insert_before(void) if (new == 1) warnx("file `%s' is before unknown provision `%s'", bl_list->node->filename, bl_list->s); + if (new == 1 && do_graphviz == true) + generate_graphviz_file_links( + Hash_FindEntry(provide_hash, bl_list->s), + bl_list->node); + for (pnode = Hash_GetValue(entry); pnode; pnode = pnode->next) { if (pnode->head) continue; @@ -605,7 +642,134 @@ crunch_all_files(void) insert_before(); } +static inline int +is_fake_prov(const char *name) +{ + + return (name == strstr(name, FAKE_PROV_NAME)); +} + +/* loop though provide list of vnode drawing all non-fake dependencies */ +static void +generate_graphviz_file_links(Hash_Entry *entry, filenode *fnode) +{ + char *dep_name, *fname; + provnode *head; + f_provnode *fpnode, *rfpnode; + int is_before = 0; + + dep_name = Hash_GetKey(entry); + if (is_fake_prov(dep_name)) + is_before = 1; + head = Hash_GetValue(entry); + + for (fpnode = fnode->prov_list; fpnode && fpnode->entry; + fpnode = fpnode->next) { + fname = Hash_GetKey(fpnode->entry); + if (is_fake_prov(fname)) + continue; + rfpnode = NULL; + do { + if (rfpnode) + dep_name = Hash_GetKey(rfpnode->entry); + else + dep_name = Hash_GetKey(entry); + + if (!is_fake_prov(dep_name)) { + printf("\"%s\" -> \"%s\" [%s%s];\n", + fname, dep_name, + /* edge style */ + (is_before ? "style=dashed" : "style=solid"), + /* circular dep? */ + ((head == NULL || + (head->next && head->in_progress == SET)) ? + ", color=red, penwidth=4" : "")); + if (rfpnode == NULL) + break; + } + /* dependency is solved already */ + if (head == NULL || head->next == NULL) + break; + + if (rfpnode == NULL) + rfpnode = head->next->fnode->prov_list; + else + rfpnode = rfpnode->next; + } while (rfpnode); + } +} + /* + * Walk the stack, find the looping point and generate traceback. + * NULL is returned on failure, otherwize pointer to a buffer holding + * text representation is returned, caller must run free(3) for the + * pointer. + */ +static char * +generate_loop_for_req(strnodelist *stack_tail, provnode *head, + filenode *fnode) +{ + provnode *pnode; + strnodelist *stack_ptr, *loop_entry; + char *buf, **revstack; + size_t bufsize; + int i, stack_depth; + + loop_entry = NULL; + /* fast forward stack to the component that is required now */ + for (pnode = head->next; pnode; pnode = pnode->next) { + if (loop_entry) + break; + stack_depth = 0; + for (stack_ptr = stack_tail; stack_ptr; + stack_ptr = stack_ptr->next) { + stack_depth++; + if (stack_ptr->node == pnode->fnode) { + loop_entry = stack_ptr; + break; + } + } + } + + if (loop_entry == NULL) + return (NULL); + + stack_depth += 2; /* fnode + loop_entry */ + revstack = emalloc(sizeof(char *) * stack_depth); + bzero(revstack, (sizeof(char *) * stack_depth)); + + /* reverse stack and estimate buffer size to allocate */ + bufsize = 1; /* tralining \0 */ + + revstack[stack_depth - 1] = loop_entry->node->filename; + bufsize += strlen(revstack[stack_depth - 1]); + + revstack[stack_depth - 2] = fnode->filename; + bufsize += strlen(revstack[stack_depth - 2]); + fnode->issues_count++; + + stack_ptr = stack_tail; + for (i = stack_depth - 3; i >= 0; i--) { + revstack[i] = stack_ptr->node->filename; + stack_ptr->node->issues_count++; + stack_ptr = stack_ptr->next; + bufsize += strlen(revstack[i]); + } + bufsize += strlen(" -> ") * (stack_depth - 1); + + buf = emalloc(bufsize); + bzero(buf, bufsize); + + for (i = 0; i < stack_depth; i++) { + strlcat(buf, revstack[i], bufsize); + if (i < stack_depth - 1) + strlcat(buf, " -> ", bufsize); + } + + free(revstack); + return (buf); +} +/* * below are the functions that traverse the graphs we have built * finding out the desired ordering, printing each file in turn. * if missing requirements, or cyclic graphs are detected, a @@ -621,17 +785,22 @@ crunch_all_files(void) * provision. */ static void -satisfy_req(f_reqnode *rnode, char *filename) +satisfy_req(f_reqnode *rnode, filenode *fnode, strnodelist *stack_ptr) { Hash_Entry *entry; provnode *head; + strnodelist stack_item; + char *buf; entry = rnode->entry; head = Hash_GetValue(entry); + if (do_graphviz == true) + generate_graphviz_file_links(entry, fnode); + if (head == NULL) { warnx("requirement `%s' in file `%s' has no providers.", - Hash_GetKey(entry), filename); + Hash_GetKey(entry), fnode->filename); exit_code = 1; return; } @@ -645,20 +814,34 @@ satisfy_req(f_reqnode *rnode, char *filename) * print that there is a circular dependency on it and abort */ if (head->in_progress == SET) { - warnx("Circular dependency on provision `%s' in file `%s'.", - Hash_GetKey(entry), filename); exit_code = 1; + buf = generate_loop_for_req(stack_ptr, head, + fnode); + + if (buf == NULL) { + warnx("Circular dependency on provision `%s' in " + "file `%s' (tracing has failed).", + Hash_GetKey(entry), fnode->filename); + return; + } + + warnx("Circular dependency on provision `%s': %s.", + Hash_GetKey(entry), buf); + free(buf); return; } head->in_progress = SET; + stack_item.next = stack_ptr; + stack_item.node = fnode; + /* * while provision_list is not empty * do_file(first_member_of(provision_list)); */ while (head->next != NULL) - do_file(head->next->fnode); + do_file(head->next->fnode, &stack_item); } static int @@ -701,12 +884,13 @@ keep_ok(filenode *fnode) * Circular dependencies will cause problems if we do. */ static void -do_file(filenode *fnode) +do_file(filenode *fnode, strnodelist *stack_ptr) { f_reqnode *r; f_provnode *p, *p_tmp; - provnode *pnode; + provnode *pnode, *head; int was_set; + char *dep_name; DPRINTF((stderr, "do_file on %s.\n", fnode->filename)); @@ -729,18 +913,44 @@ do_file(filenode *fnode) * satisfy_req(r, filename) */ r = fnode->req_list; + fnode->sequence = 0; while (r != NULL) { - satisfy_req(r, fnode->filename); + satisfy_req(r, fnode, stack_ptr); + /* find sequence number where all requirements are satisfied */ + head = Hash_GetValue(r->entry); + if (head && head->sequence > fnode->sequence) + fnode->sequence = head->sequence; r = r->next; } fnode->req_list = NULL; + fnode->sequence++; + /* if we've seen issues with this file - put it to the tail */ + if (fnode->issues_count) + fnode->sequence = max_sequence + 1; + + if (max_sequence < fnode->sequence) + max_sequence = fnode->sequence; + /* * for each provision of fnode -> p * remove fnode from provision list for p in hash table */ p = fnode->prov_list; while (p != NULL) { + /* mark all troublemakers on graphviz */ + if (do_graphviz == true && fnode->issues_count) { + dep_name = Hash_GetKey(p->entry); + if (!is_fake_prov(dep_name)) + printf("\"%s\" [ color=red, penwidth=4 ];\n", + dep_name); + } + + /* update sequence when provided requirements are satisfied */ + head = Hash_GetValue(p->entry); + if (head->sequence < fnode->sequence) + head->sequence = fnode->sequence; + p_tmp = p; pnode = p->pnode; if (pnode->next != NULL) { @@ -759,8 +969,11 @@ do_file(filenode *fnode) DPRINTF((stderr, "next do: ")); /* if we were already in progress, don't print again */ - if (was_set == 0 && skip_ok(fnode) && keep_ok(fnode)) - printf("%s\n", fnode->filename); + if (do_graphviz != true && was_set == 0 && skip_ok(fnode) && + keep_ok(fnode)) { + *fn_seqlist = fnode; + fn_seqlist++; + } if (fnode->next != NULL) { fnode->next->last = fnode->last; @@ -769,19 +982,103 @@ do_file(filenode *fnode) fnode->last->next = fnode->next; } + if (fnode->issues_count) + warnx("`%s' was seen in circular dependencies for %d times.", + fnode->filename, fnode->issues_count); + DPRINTF((stderr, "nuking %s\n", fnode->filename)); -#if 0 - if (was_set == 0) { - free(fnode->filename); - free(fnode); - } -#endif } static void +generate_graphviz_header() +{ + + if (do_graphviz != true) + return; + + printf("digraph rcorder {\n" + "rankdir=\"BT\";\n" + "node [style=rounded, shape=record];\n" + "graph [overlap = false];\n"); +} + +static void +generate_graphviz_footer() +{ + + if (do_graphviz == true) + printf("}\n"); +} + +static void +generate_graphviz_providers() +{ + Hash_Entry *entry; + Hash_Search psearch; + provnode *head, *pnode; + char *dep_name; + + if (do_graphviz != true) + return; + + entry = Hash_EnumFirst(provide_hash, &psearch); + if (entry == NULL) + return; + + do { + dep_name = Hash_GetKey(entry); + if (is_fake_prov(dep_name)) + continue; + head = Hash_GetValue(entry); + /* no providers for this requirement */ + if (head == NULL || head->next == NULL) { + printf("\"%s\" [label=\"{ %s | ENOENT }\", " + "style=\"rounded,filled\", color=red];\n", + dep_name, dep_name); + continue; + } + /* one PROVIDE word for one file that matches */ + if (head->next->next == NULL && + strcmp(dep_name, + basename(head->next->fnode->filename)) == 0) { + continue; + } + printf("\"%s\" [label=\"{ %s | ", dep_name, dep_name); + for (pnode = head->next; pnode; pnode = pnode->next) + printf("%s\\n", basename(pnode->fnode->filename)); + + printf("}\"];\n"); + } while (NULL != (entry = Hash_EnumNext(&psearch))); +} + +static int +sequence_cmp(const void *a, const void *b) +{ + const filenode *fna = *((const filenode * const *)a); + const filenode *fnb = *((const filenode * const *)b); + int left, right; + + /* push phantom files to the end */ + if (fna == NULL || fnb == NULL) + return ((fna < fnb) - (fna > fnb)); + + left = fna->sequence; + right = fnb->sequence; + + return ((left > right) - (left < right)); +} + +static void generate_ordering(void) { + filenode **seqlist, **psl; + int last_seq = 0; + /* Prepare order buffer, use an additional one as a list terminator */ + seqlist = emalloc(sizeof(filenode *) * (file_count + 1)); + bzero(seqlist, sizeof(filenode *) * (file_count + 1)); + fn_seqlist = seqlist; + /* * while there remain undone files{f}, * pick an arbitrary f, and do_file(f) @@ -798,6 +1095,24 @@ generate_ordering(void) */ while (fn_head->next != NULL) { DPRINTF((stderr, "generate on %s\n", fn_head->next->filename)); - do_file(fn_head->next); + do_file(fn_head->next, NULL); } + + /* Sort filenode list based on sequence */ + qsort(seqlist, file_count, sizeof(filenode *), sequence_cmp); + + for (psl = seqlist; *psl; psl++) { + printf("%s%s", + (last_seq == 0 ? "" : + (do_parallel != true || last_seq != (*psl)->sequence) ? + "\n" : " "), + (*psl)->filename); + last_seq = (*psl)->sequence; + free((*psl)->filename); + free(*psl); + } + if (last_seq) + printf("\n"); + + free(seqlist); } From owner-svn-src-all@freebsd.org Tue Sep 15 08:54:01 2020 Return-Path: Delivered-To: svn-src-all@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 44A873F5282; Tue, 15 Sep 2020 08:54:01 +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 4BrH8T17b6z3Z36; Tue, 15 Sep 2020 08:54:01 +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 0B40A25A79; Tue, 15 Sep 2020 08:54:01 +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 08F8s1id072890; Tue, 15 Sep 2020 08:54:01 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08F8s02H072889; Tue, 15 Sep 2020 08:54:00 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202009150854.08F8s02H072889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 15 Sep 2020 08:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365746 - stable/11/sbin/rcorder X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sbin/rcorder X-SVN-Commit-Revision: 365746 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 08:54:01 -0000 Author: ae Date: Tue Sep 15 08:54:00 2020 New Revision: 365746 URL: https://svnweb.freebsd.org/changeset/base/365746 Log: MFC r365449: Add a few features to rcorder: o Enhance dependency loop logging: print full chain instead of the last link competing the loop; o Add -g option to generate dependency graph suitable for GraphViz visualization, loops and other graph generation issues are highlighted automatically; o Add -p option that enables grouping items that can be processed in parallel. Submitted by: Boris Lytochkin Differential Revision: https://reviews.freebsd.org/D25389 Modified: stable/11/sbin/rcorder/rcorder.8 stable/11/sbin/rcorder/rcorder.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/rcorder/rcorder.8 ============================================================================== --- stable/11/sbin/rcorder/rcorder.8 Tue Sep 15 08:52:36 2020 (r365745) +++ stable/11/sbin/rcorder/rcorder.8 Tue Sep 15 08:54:00 2020 (r365746) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 22, 2020 +.Dd September 8, 2020 .Dt RCORDER 8 .Os .Sh NAME @@ -39,6 +39,7 @@ .Nd print a dependency ordering of interdependent files .Sh SYNOPSIS .Nm +.Op Fl gp .Op Fl k Ar keep .Op Fl s Ar skip .Ar @@ -95,6 +96,9 @@ is reached, parsing stops. .Pp The options are as follows: .Bl -tag -width "-k keep" +.It Fl g +Produce a GraphViz (.dot) of the complete dependency graph instead of +plaintext calling order list. .It Fl k Ar keep Add the specified keyword to the .Dq "keep list" . @@ -102,6 +106,9 @@ If any .Fl k option is given, only those files containing the matching keyword are listed. This option can be specified multiple times. +.It Fl p +Generate ordering suitable for parallel startup, placing files that can be +executed simultaneously on the same line. .It Fl s Ar skip Add the specified keyword to the .Dq "skip list" . @@ -178,19 +185,46 @@ The utility may print one of the following error messages and exit with a non-zero status if it encounters an error while processing the file list. .Bl -diag -.It "Requirement %s has no providers, aborting." +.It "Requirement %s in file %s has no providers." No file has a .Ql PROVIDE line corresponding to a condition present in a .Ql REQUIRE line in another file. -.It "Circular dependency on provision %s, aborting." +.It "Circular dependency on provision %s in file %s." A set of files has a circular dependency which was detected while processing the stated condition. -.It "Circular dependency on file %s, aborting." +Loop visualization follows this message. +.It "Circular dependency on file %s." A set of files has a circular dependency which was detected while processing the stated file. +.It "%s was seen in circular dependencies for %d times." +Each node that was a part of circular dependency loops reports total number of +such encounters. +Start with files having biggest counter when fighting with broken dependencies. .El +.Sh DIAGNOSTICS WITH GRAPHVIZ +Direct dependency is drawn with solid line, +.Ql BEFORE +dependency is drawn as a dashed line. +Each node of a graph represents an item from +.Ql PROVIDE +lines. +In case there are more than one file providing an item, a list of filenames +shortened with +.Xr basename 3 +is shown. +Shortened filenames are also shown in case +.Ql PROVIDE +item does not match file name. +.Pp +Edges and nodes where circular dependencies were detected are drawn bold red. +If a file has an item in +.Ql REQUIRE +or in +.Ql BEFORE +that could not be provided, +this missing provider and the requirement will be drawn bold red as well. .Sh SEE ALSO .Xr acpiconf 8 , .Xr rc 8 , Modified: stable/11/sbin/rcorder/rcorder.c ============================================================================== --- stable/11/sbin/rcorder/rcorder.c Tue Sep 15 08:52:36 2020 (r365745) +++ stable/11/sbin/rcorder/rcorder.c Tue Sep 15 08:54:00 2020 (r365746) @@ -9,6 +9,8 @@ * All rights reserved. * Copyright (c) 1998 * Perry E. Metzger. All rights reserved. + * Copyright (c) 2020 + * Boris N. Lytochkin. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -48,6 +50,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include "ealloc.h" #include "sprite.h" @@ -75,17 +79,21 @@ static int debug = 0; #define KEYWORDS_STR "# KEYWORDS:" #define KEYWORDS_LEN (sizeof(KEYWORDS_STR) - 1) +#define FAKE_PROV_NAME "fake_prov_" + static int exit_code; static int file_count; static char **file_list; -typedef int bool; #define TRUE 1 #define FALSE 0 typedef bool flag; #define SET TRUE #define RESET FALSE +static flag do_graphviz = false; +static flag do_parallel = false; + static Hash_Table provide_hash_s, *provide_hash; typedef struct provnode provnode; @@ -97,12 +105,14 @@ typedef struct strnodelist strnodelist; struct provnode { flag head; flag in_progress; + int sequence; filenode *fnode; provnode *next, *last; }; struct f_provnode { provnode *pnode; + Hash_Entry *entry; f_provnode *next; }; @@ -124,19 +134,23 @@ struct filenode { f_reqnode *req_list; f_provnode *prov_list; strnodelist *keyword_list; + int issues_count; + int sequence; }; -static filenode fn_head_s, *fn_head; +static filenode fn_head_s, *fn_head, **fn_seqlist; +static int max_sequence = 0; static strnodelist *bl_list; static strnodelist *keep_list; static strnodelist *skip_list; -static void do_file(filenode *fnode); +static void do_file(filenode *fnode, strnodelist *); static void strnode_add(strnodelist **, char *, filenode *); static int skip_ok(filenode *fnode); static int keep_ok(filenode *fnode); -static void satisfy_req(f_reqnode *rnode, char *filename); +static char *generate_loop_for_req(strnodelist *, provnode *, filenode *); +static void satisfy_req(f_reqnode *rnode, filenode *fnode, strnodelist *); static void crunch_file(char *); static void parse_require(filenode *, char *); static void parse_provide(filenode *, char *); @@ -151,6 +165,12 @@ static void insert_before(void); static Hash_Entry *make_fake_provision(filenode *); static void crunch_all_files(void); static void initialize(void); +static void generate_graphviz_header(void); +static void generate_graphviz_footer(void); +static void generate_graphviz_file_links(Hash_Entry *, filenode *); +static void generate_graphviz_providers(void); +static inline int is_fake_prov(const char *); +static int sequence_cmp(const void *, const void *); static void generate_ordering(void); int @@ -158,7 +178,7 @@ main(int argc, char *argv[]) { int ch; - while ((ch = getopt(argc, argv, "dk:s:")) != -1) + while ((ch = getopt(argc, argv, "dgk:ps:")) != -1) switch (ch) { case 'd': #ifdef DEBUG @@ -167,9 +187,15 @@ main(int argc, char *argv[]) warnx("debugging not compiled in, -d ignored"); #endif break; + case 'g': + do_graphviz = true; + break; case 'k': strnode_add(&keep_list, optarg, 0); break; + case 'p': + do_parallel = true; + break; case 's': strnode_add(&skip_list, optarg, 0); break; @@ -186,10 +212,13 @@ main(int argc, char *argv[]) DPRINTF((stderr, "parse_args\n")); initialize(); DPRINTF((stderr, "initialize\n")); + generate_graphviz_header(); crunch_all_files(); DPRINTF((stderr, "crunch_all_files\n")); + generate_graphviz_providers(); generate_ordering(); DPRINTF((stderr, "generate_ordering\n")); + generate_graphviz_footer(); exit(exit_code); } @@ -295,6 +324,7 @@ add_provide(filenode *fnode, char *s) head->head = SET; head->in_progress = RESET; head->fnode = NULL; + head->sequence = 0; head->last = head->next = NULL; Hash_SetValue(entry, head); } @@ -350,6 +380,7 @@ add_provide(filenode *fnode, char *s) f_pnode = emalloc(sizeof(*f_pnode)); f_pnode->pnode = pnode; + f_pnode->entry = entry; f_pnode->next = fnode->prov_list; fnode->prov_list = f_pnode; } @@ -522,7 +553,7 @@ make_fake_provision(filenode *node) char buffer[30]; do { - snprintf(buffer, sizeof buffer, "fake_prov_%08d", i++); + snprintf(buffer, sizeof buffer, FAKE_PROV_NAME "%08d", i++); entry = Hash_CreateEntry(provide_hash, buffer, &new); } while (new == 0); head = emalloc(sizeof(*head)); @@ -543,6 +574,7 @@ make_fake_provision(filenode *node) pnode->next->last = pnode; f_pnode = emalloc(sizeof(*f_pnode)); + f_pnode->entry = entry; f_pnode->pnode = pnode; f_pnode->next = node->prov_list; node->prov_list = f_pnode; @@ -575,6 +607,11 @@ insert_before(void) if (new == 1) warnx("file `%s' is before unknown provision `%s'", bl_list->node->filename, bl_list->s); + if (new == 1 && do_graphviz == true) + generate_graphviz_file_links( + Hash_FindEntry(provide_hash, bl_list->s), + bl_list->node); + for (pnode = Hash_GetValue(entry); pnode; pnode = pnode->next) { if (pnode->head) continue; @@ -605,7 +642,134 @@ crunch_all_files(void) insert_before(); } +static inline int +is_fake_prov(const char *name) +{ + + return (name == strstr(name, FAKE_PROV_NAME)); +} + +/* loop though provide list of vnode drawing all non-fake dependencies */ +static void +generate_graphviz_file_links(Hash_Entry *entry, filenode *fnode) +{ + char *dep_name, *fname; + provnode *head; + f_provnode *fpnode, *rfpnode; + int is_before = 0; + + dep_name = Hash_GetKey(entry); + if (is_fake_prov(dep_name)) + is_before = 1; + head = Hash_GetValue(entry); + + for (fpnode = fnode->prov_list; fpnode && fpnode->entry; + fpnode = fpnode->next) { + fname = Hash_GetKey(fpnode->entry); + if (is_fake_prov(fname)) + continue; + rfpnode = NULL; + do { + if (rfpnode) + dep_name = Hash_GetKey(rfpnode->entry); + else + dep_name = Hash_GetKey(entry); + + if (!is_fake_prov(dep_name)) { + printf("\"%s\" -> \"%s\" [%s%s];\n", + fname, dep_name, + /* edge style */ + (is_before ? "style=dashed" : "style=solid"), + /* circular dep? */ + ((head == NULL || + (head->next && head->in_progress == SET)) ? + ", color=red, penwidth=4" : "")); + if (rfpnode == NULL) + break; + } + /* dependency is solved already */ + if (head == NULL || head->next == NULL) + break; + + if (rfpnode == NULL) + rfpnode = head->next->fnode->prov_list; + else + rfpnode = rfpnode->next; + } while (rfpnode); + } +} + /* + * Walk the stack, find the looping point and generate traceback. + * NULL is returned on failure, otherwize pointer to a buffer holding + * text representation is returned, caller must run free(3) for the + * pointer. + */ +static char * +generate_loop_for_req(strnodelist *stack_tail, provnode *head, + filenode *fnode) +{ + provnode *pnode; + strnodelist *stack_ptr, *loop_entry; + char *buf, **revstack; + size_t bufsize; + int i, stack_depth; + + loop_entry = NULL; + /* fast forward stack to the component that is required now */ + for (pnode = head->next; pnode; pnode = pnode->next) { + if (loop_entry) + break; + stack_depth = 0; + for (stack_ptr = stack_tail; stack_ptr; + stack_ptr = stack_ptr->next) { + stack_depth++; + if (stack_ptr->node == pnode->fnode) { + loop_entry = stack_ptr; + break; + } + } + } + + if (loop_entry == NULL) + return (NULL); + + stack_depth += 2; /* fnode + loop_entry */ + revstack = emalloc(sizeof(char *) * stack_depth); + bzero(revstack, (sizeof(char *) * stack_depth)); + + /* reverse stack and estimate buffer size to allocate */ + bufsize = 1; /* tralining \0 */ + + revstack[stack_depth - 1] = loop_entry->node->filename; + bufsize += strlen(revstack[stack_depth - 1]); + + revstack[stack_depth - 2] = fnode->filename; + bufsize += strlen(revstack[stack_depth - 2]); + fnode->issues_count++; + + stack_ptr = stack_tail; + for (i = stack_depth - 3; i >= 0; i--) { + revstack[i] = stack_ptr->node->filename; + stack_ptr->node->issues_count++; + stack_ptr = stack_ptr->next; + bufsize += strlen(revstack[i]); + } + bufsize += strlen(" -> ") * (stack_depth - 1); + + buf = emalloc(bufsize); + bzero(buf, bufsize); + + for (i = 0; i < stack_depth; i++) { + strlcat(buf, revstack[i], bufsize); + if (i < stack_depth - 1) + strlcat(buf, " -> ", bufsize); + } + + free(revstack); + return (buf); +} +/* * below are the functions that traverse the graphs we have built * finding out the desired ordering, printing each file in turn. * if missing requirements, or cyclic graphs are detected, a @@ -621,17 +785,22 @@ crunch_all_files(void) * provision. */ static void -satisfy_req(f_reqnode *rnode, char *filename) +satisfy_req(f_reqnode *rnode, filenode *fnode, strnodelist *stack_ptr) { Hash_Entry *entry; provnode *head; + strnodelist stack_item; + char *buf; entry = rnode->entry; head = Hash_GetValue(entry); + if (do_graphviz == true) + generate_graphviz_file_links(entry, fnode); + if (head == NULL) { warnx("requirement `%s' in file `%s' has no providers.", - Hash_GetKey(entry), filename); + Hash_GetKey(entry), fnode->filename); exit_code = 1; return; } @@ -645,20 +814,34 @@ satisfy_req(f_reqnode *rnode, char *filename) * print that there is a circular dependency on it and abort */ if (head->in_progress == SET) { - warnx("Circular dependency on provision `%s' in file `%s'.", - Hash_GetKey(entry), filename); exit_code = 1; + buf = generate_loop_for_req(stack_ptr, head, + fnode); + + if (buf == NULL) { + warnx("Circular dependency on provision `%s' in " + "file `%s' (tracing has failed).", + Hash_GetKey(entry), fnode->filename); + return; + } + + warnx("Circular dependency on provision `%s': %s.", + Hash_GetKey(entry), buf); + free(buf); return; } head->in_progress = SET; + stack_item.next = stack_ptr; + stack_item.node = fnode; + /* * while provision_list is not empty * do_file(first_member_of(provision_list)); */ while (head->next != NULL) - do_file(head->next->fnode); + do_file(head->next->fnode, &stack_item); } static int @@ -701,12 +884,13 @@ keep_ok(filenode *fnode) * Circular dependencies will cause problems if we do. */ static void -do_file(filenode *fnode) +do_file(filenode *fnode, strnodelist *stack_ptr) { f_reqnode *r; f_provnode *p, *p_tmp; - provnode *pnode; + provnode *pnode, *head; int was_set; + char *dep_name; DPRINTF((stderr, "do_file on %s.\n", fnode->filename)); @@ -729,18 +913,44 @@ do_file(filenode *fnode) * satisfy_req(r, filename) */ r = fnode->req_list; + fnode->sequence = 0; while (r != NULL) { - satisfy_req(r, fnode->filename); + satisfy_req(r, fnode, stack_ptr); + /* find sequence number where all requirements are satisfied */ + head = Hash_GetValue(r->entry); + if (head && head->sequence > fnode->sequence) + fnode->sequence = head->sequence; r = r->next; } fnode->req_list = NULL; + fnode->sequence++; + /* if we've seen issues with this file - put it to the tail */ + if (fnode->issues_count) + fnode->sequence = max_sequence + 1; + + if (max_sequence < fnode->sequence) + max_sequence = fnode->sequence; + /* * for each provision of fnode -> p * remove fnode from provision list for p in hash table */ p = fnode->prov_list; while (p != NULL) { + /* mark all troublemakers on graphviz */ + if (do_graphviz == true && fnode->issues_count) { + dep_name = Hash_GetKey(p->entry); + if (!is_fake_prov(dep_name)) + printf("\"%s\" [ color=red, penwidth=4 ];\n", + dep_name); + } + + /* update sequence when provided requirements are satisfied */ + head = Hash_GetValue(p->entry); + if (head->sequence < fnode->sequence) + head->sequence = fnode->sequence; + p_tmp = p; pnode = p->pnode; if (pnode->next != NULL) { @@ -759,8 +969,11 @@ do_file(filenode *fnode) DPRINTF((stderr, "next do: ")); /* if we were already in progress, don't print again */ - if (was_set == 0 && skip_ok(fnode) && keep_ok(fnode)) - printf("%s\n", fnode->filename); + if (do_graphviz != true && was_set == 0 && skip_ok(fnode) && + keep_ok(fnode)) { + *fn_seqlist = fnode; + fn_seqlist++; + } if (fnode->next != NULL) { fnode->next->last = fnode->last; @@ -769,19 +982,103 @@ do_file(filenode *fnode) fnode->last->next = fnode->next; } + if (fnode->issues_count) + warnx("`%s' was seen in circular dependencies for %d times.", + fnode->filename, fnode->issues_count); + DPRINTF((stderr, "nuking %s\n", fnode->filename)); -#if 0 - if (was_set == 0) { - free(fnode->filename); - free(fnode); - } -#endif } static void +generate_graphviz_header() +{ + + if (do_graphviz != true) + return; + + printf("digraph rcorder {\n" + "rankdir=\"BT\";\n" + "node [style=rounded, shape=record];\n" + "graph [overlap = false];\n"); +} + +static void +generate_graphviz_footer() +{ + + if (do_graphviz == true) + printf("}\n"); +} + +static void +generate_graphviz_providers() +{ + Hash_Entry *entry; + Hash_Search psearch; + provnode *head, *pnode; + char *dep_name; + + if (do_graphviz != true) + return; + + entry = Hash_EnumFirst(provide_hash, &psearch); + if (entry == NULL) + return; + + do { + dep_name = Hash_GetKey(entry); + if (is_fake_prov(dep_name)) + continue; + head = Hash_GetValue(entry); + /* no providers for this requirement */ + if (head == NULL || head->next == NULL) { + printf("\"%s\" [label=\"{ %s | ENOENT }\", " + "style=\"rounded,filled\", color=red];\n", + dep_name, dep_name); + continue; + } + /* one PROVIDE word for one file that matches */ + if (head->next->next == NULL && + strcmp(dep_name, + basename(head->next->fnode->filename)) == 0) { + continue; + } + printf("\"%s\" [label=\"{ %s | ", dep_name, dep_name); + for (pnode = head->next; pnode; pnode = pnode->next) + printf("%s\\n", basename(pnode->fnode->filename)); + + printf("}\"];\n"); + } while (NULL != (entry = Hash_EnumNext(&psearch))); +} + +static int +sequence_cmp(const void *a, const void *b) +{ + const filenode *fna = *((const filenode * const *)a); + const filenode *fnb = *((const filenode * const *)b); + int left, right; + + /* push phantom files to the end */ + if (fna == NULL || fnb == NULL) + return ((fna < fnb) - (fna > fnb)); + + left = fna->sequence; + right = fnb->sequence; + + return ((left > right) - (left < right)); +} + +static void generate_ordering(void) { + filenode **seqlist, **psl; + int last_seq = 0; + /* Prepare order buffer, use an additional one as a list terminator */ + seqlist = emalloc(sizeof(filenode *) * (file_count + 1)); + bzero(seqlist, sizeof(filenode *) * (file_count + 1)); + fn_seqlist = seqlist; + /* * while there remain undone files{f}, * pick an arbitrary f, and do_file(f) @@ -798,6 +1095,24 @@ generate_ordering(void) */ while (fn_head->next != NULL) { DPRINTF((stderr, "generate on %s\n", fn_head->next->filename)); - do_file(fn_head->next); + do_file(fn_head->next, NULL); } + + /* Sort filenode list based on sequence */ + qsort(seqlist, file_count, sizeof(filenode *), sequence_cmp); + + for (psl = seqlist; *psl; psl++) { + printf("%s%s", + (last_seq == 0 ? "" : + (do_parallel != true || last_seq != (*psl)->sequence) ? + "\n" : " "), + (*psl)->filename); + last_seq = (*psl)->sequence; + free((*psl)->filename); + free(*psl); + } + if (last_seq) + printf("\n"); + + free(seqlist); } From owner-svn-src-all@freebsd.org Tue Sep 15 09:27:02 2020 Return-Path: Delivered-To: svn-src-all@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 48AF23F5B24; Tue, 15 Sep 2020 09:27:02 +0000 (UTC) (envelope-from gbe@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 4BrHtZ1CC9z3bh2; Tue, 15 Sep 2020 09:27:02 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C7D925F46; Tue, 15 Sep 2020 09:27:02 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08F9R1ax091392; Tue, 15 Sep 2020 09:27:01 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08F9R15U091391; Tue, 15 Sep 2020 09:27:01 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009150927.08F9R15U091391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Tue, 15 Sep 2020 09:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365747 - stable/12/usr.bin/sort X-SVN-Group: stable-12 X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: stable/12/usr.bin/sort X-SVN-Commit-Revision: 365747 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 09:27:02 -0000 Author: gbe (doc committer) Date: Tue Sep 15 09:27:01 2020 New Revision: 365747 URL: https://svnweb.freebsd.org/changeset/base/365747 Log: MFC r365458: sort(1): Remove duplicate option check Reviewed by: lwhsu, emaste Approved by: emaste Obtained from: DragonFlyBSD Differential Revision: https://reviews.freebsd.org/D23892 Modified: stable/12/usr.bin/sort/file.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/sort/file.c ============================================================================== --- stable/12/usr.bin/sort/file.c Tue Sep 15 08:54:00 2020 (r365746) +++ stable/12/usr.bin/sort/file.c Tue Sep 15 09:27:01 2020 (r365747) @@ -1236,7 +1236,7 @@ sort_list_to_file(struct sort_list *list, const char * { struct sort_mods *sm = &(keys[0].sm); - if (!(sm->Mflag) && !(sm->Rflag) && !(sm->Vflag) && !(sm->Vflag) && + if (!(sm->Mflag) && !(sm->Rflag) && !(sm->Vflag) && !(sm->gflag) && !(sm->hflag) && !(sm->nflag)) { if ((sort_opts_vals.sort_method == SORT_DEFAULT) && byte_sort) sort_opts_vals.sort_method = SORT_RADIXSORT; From owner-svn-src-all@freebsd.org Tue Sep 15 12:34:02 2020 Return-Path: Delivered-To: svn-src-all@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 7429E3D13FB; Tue, 15 Sep 2020 12:34:02 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BrN2L2D7Xz42Wj; Tue, 15 Sep 2020 12:34:02 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F0258701; Tue, 15 Sep 2020 12:34:02 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08FCY2Rb007362; Tue, 15 Sep 2020 12:34:02 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FCY29r007361; Tue, 15 Sep 2020 12:34:02 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202009151234.08FCY29r007361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 15 Sep 2020 12:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365748 - releng/12.2/sys/dev/usb/net X-SVN-Group: releng X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: releng/12.2/sys/dev/usb/net X-SVN-Commit-Revision: 365748 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 12:34:02 -0000 Author: lwhsu Date: Tue Sep 15 12:34:01 2020 New Revision: 365748 URL: https://svnweb.freebsd.org/changeset/base/365748 Log: MFC r365606 and MF12 r365744: urndis(4): Add support of Inseego/Novatel Wireless MiFi 8800/8000 PR: 245152 Submitted by: rootless@gmail.com Reviewed by: hselasky Approved by: re (gjb) Modified: releng/12.2/sys/dev/usb/net/if_urndis.c Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/sys/dev/usb/net/if_urndis.c ============================================================================== --- releng/12.2/sys/dev/usb/net/if_urndis.c Tue Sep 15 09:27:01 2020 (r365747) +++ releng/12.2/sys/dev/usb/net/if_urndis.c Tue Sep 15 12:34:01 2020 (r365748) @@ -178,6 +178,9 @@ static const STRUCT_USB_HOST_ID urndis_host_devs[] = { /* Nokia 7 plus */ {USB_IFACE_CLASS(UICLASS_IAD), USB_IFACE_SUBCLASS(0x4), USB_IFACE_PROTOCOL(UIPROTO_ACTIVESYNC)}, + /* Novatel Wireless 8800/8000/etc */ + {USB_IFACE_CLASS(UICLASS_IAD), USB_IFACE_SUBCLASS(0xef), + USB_IFACE_PROTOCOL(UIPROTO_RNDIS)}, }; DRIVER_MODULE(urndis, uhub, urndis_driver, urndis_devclass, NULL, NULL); From owner-svn-src-all@freebsd.org Tue Sep 15 13:36:20 2020 Return-Path: Delivered-To: svn-src-all@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 541ED3D309E; Tue, 15 Sep 2020 13:36:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BrPQD1cbPz44yM; Tue, 15 Sep 2020 13:36:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01FA39213; Tue, 15 Sep 2020 13:36:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08FDaJ4u044425; Tue, 15 Sep 2020 13:36:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FDaJiH044422; Tue, 15 Sep 2020 13:36:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009151336.08FDaJiH044422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 15 Sep 2020 13:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365749 - head/usr.bin/posixshmcontrol X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.bin/posixshmcontrol X-SVN-Commit-Revision: 365749 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 13:36:20 -0000 Author: markj Date: Tue Sep 15 13:36:19 2020 New Revision: 365749 URL: https://svnweb.freebsd.org/changeset/base/365749 Log: Fix some posixshmcontrol nits. - Exit with an error if no path is specified. - Man page typo. - Error message typo. Reviewed by: kib Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26376 Modified: head/usr.bin/posixshmcontrol/posixshmcontrol.1 head/usr.bin/posixshmcontrol/posixshmcontrol.c Modified: head/usr.bin/posixshmcontrol/posixshmcontrol.1 ============================================================================== --- head/usr.bin/posixshmcontrol/posixshmcontrol.1 Tue Sep 15 12:34:01 2020 (r365748) +++ head/usr.bin/posixshmcontrol/posixshmcontrol.1 Tue Sep 15 13:36:19 2020 (r365749) @@ -120,7 +120,7 @@ using name-switch services, instead the raw numeric va To show content of the shared memory segment with the path .Pa /1 , use the command -.Dl "posixshmcontrol dump /q | hexdump -C" +.Dl "posixshmcontrol dump /1 | hexdump -C" .It To create a segment with the path .Pa /2 Modified: head/usr.bin/posixshmcontrol/posixshmcontrol.c ============================================================================== --- head/usr.bin/posixshmcontrol/posixshmcontrol.c Tue Sep 15 12:34:01 2020 (r365748) +++ head/usr.bin/posixshmcontrol/posixshmcontrol.c Tue Sep 15 13:36:19 2020 (r365749) @@ -147,9 +147,14 @@ create_shm(int argc, char **argv) return (2); } } - argc -= optind; argv += optind; + + if (argc == 0) { + usage(); + return (2); + } + ret = 0; for (i = 0; i < argc; i++) { ret1 = create_one_shm(argv[i], mode, idx); @@ -179,6 +184,11 @@ delete_shm(int argc, char **argv) { int i, ret, ret1; + if (argc == 1) { + usage(); + return (2); + } + ret = 0; for (i = 1; i < argc; i++) { ret1 = delete_one_shm(argv[i]); @@ -347,6 +357,11 @@ read_shm(int argc, char **argv) { int i, ret, ret1; + if (argc == 1) { + usage(); + return (2); + } + ret = 0; for (i = 1; i < argc; i++) { ret1 = read_one_shm(argv[i]); @@ -433,6 +448,11 @@ stat_shm(int argc, char **argv) argc -= optind; argv += optind; + if (argc == 0) { + usage(); + return (2); + } + ret = 0; for (i = 0; i < argc; i++) { ret1 = stat_one_shm(argv[i], hsize, uname); @@ -473,16 +493,21 @@ truncate_shm(int argc, char **argv) switch (c) { case 's': if (expand_number(optarg, &newsize) == -1) - err(1, "size:"); + err(1, "size"); break; case '?': default: return (2); } } - argc -= optind; argv += optind; + + if (argc == 0) { + usage(); + return (2); + } + ret = 0; for (i = 0; i < argc; i++) { ret1 = truncate_one_shm(argv[i], newsize); From owner-svn-src-all@freebsd.org Tue Sep 15 14:15:05 2020 Return-Path: Delivered-To: svn-src-all@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 65B1C3D3E11; Tue, 15 Sep 2020 14:15:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BrQGx280rz47JW; Tue, 15 Sep 2020 14:15:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BC40955B; Tue, 15 Sep 2020 14:15:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08FEF5hn068755; Tue, 15 Sep 2020 14:15:05 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FEF5Mr068754; Tue, 15 Sep 2020 14:15:05 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202009151415.08FEF5Mr068754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 15 Sep 2020 14:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365750 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 365750 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 14:15:05 -0000 Author: andrew Date: Tue Sep 15 14:15:04 2020 New Revision: 365750 URL: https://svnweb.freebsd.org/changeset/base/365750 Log: Use ATTR_DEFAULT in the arm64 locore.S We can use ATTR_DEFAULT directly in locore.S as it fits within an orr instruction operand. Sponsored by: Innovate UK Modified: head/sys/arm64/arm64/locore.S Modified: head/sys/arm64/arm64/locore.S ============================================================================== --- head/sys/arm64/arm64/locore.S Tue Sep 15 13:36:19 2020 (r365749) +++ head/sys/arm64/arm64/locore.S Tue Sep 15 14:15:04 2020 (r365750) @@ -614,10 +614,7 @@ build_l1_block_pagetable: /* Build the L1 block entry */ orr x12, x7, #L1_BLOCK - orr x12, x12, #(ATTR_AF) -#ifdef SMP - orr x12, x12, ATTR_SH(ATTR_SH_IS) -#endif + orr x12, x12, #(ATTR_DEFAULT) /* Only use the output address bits */ lsr x9, x9, #L1_SHIFT @@ -655,11 +652,8 @@ build_l2_block_pagetable: /* Build the L2 block entry */ lsl x12, x7, #2 orr x12, x12, #L2_BLOCK - orr x12, x12, #(ATTR_AF) + orr x12, x12, #(ATTR_DEFAULT) orr x12, x12, #(ATTR_S1_UXN) -#ifdef SMP - orr x12, x12, ATTR_SH(ATTR_SH_IS) -#endif /* Only use the output address bits */ lsr x9, x9, #L2_SHIFT From owner-svn-src-all@freebsd.org Tue Sep 15 14:15:47 2020 Return-Path: Delivered-To: svn-src-all@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 D607A3D3A39; Tue, 15 Sep 2020 14:15:47 +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 4BrQHk29JWz47R5; Tue, 15 Sep 2020 14:15:45 +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 08FEFVeg019084 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 15 Sep 2020 17:15:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 08FEFVeg019084 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 08FEFUDI019082; Tue, 15 Sep 2020 17:15:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 15 Sep 2020 17:15:30 +0300 From: Konstantin Belousov To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, peter@holm.cc Subject: Re: svn commit: r364944 - head/sys/kern Message-ID: <20200915141530.GM94807@kib.kiev.ua> References: <202008290429.07T4TrbH007764@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202008290429.07T4TrbH007764@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: 4BrQHk29JWz47R5 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 [1.04 / 15.00]; ARC_NA(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-0.40)[-0.397]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_SPAM_MEDIUM(0.87)[0.868]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.57)[0.568]; 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-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 14:15:47 -0000 On Sat, Aug 29, 2020 at 04:29:53AM +0000, Warner Losh wrote: > Author: imp > Date: Sat Aug 29 04:29:53 2020 > New Revision: 364944 > URL: https://svnweb.freebsd.org/changeset/base/364944 > > Log: > devctl: move to using a uma zone > > Convert the memory management of devctl. Rewrite if to make better > use of memory. This eliminates several mallocs (5? worse case) needed > to send a message. It's now possible to always send a message, though > if things are really backed up the oldest message will be dropped to > free up space for the newest. > > Add a static bus_child_{location,pnpinfo}_sb to start migrating to > sbuf instead of buffer + length. Use it in the new code. Other code > will be converted later (bus_child_*_str is only used inside of > subr_bus.c, though implemented in ~100 places in the tree). > > Reviewed by: markj@ > Differential Revision: https://reviews.freebsd.org/D26140 > > Modified: > head/sys/kern/subr_bus.c > > + } else { > + /* dei can't be NULL -- we know we have at least one in the zone */ > + dei = uma_zalloc(devsoftc.zone, M_NOWAIT); > + MPASS(dei != NULL); This does not work. I believe you need to disable per-cpu cache for the zone, at least. But I am not sure it is enough. https://people.freebsd.org/~pho/stress/log/kostik1314.txt From owner-svn-src-all@freebsd.org Tue Sep 15 14:22:18 2020 Return-Path: Delivered-To: svn-src-all@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 748AF3D44D9; Tue, 15 Sep 2020 14:22:18 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (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 4BrQRF3ncQz48tb; Tue, 15 Sep 2020 14:22:17 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x731.google.com with SMTP id o5so4303652qke.12; Tue, 15 Sep 2020 07:22:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=mcxNZ9ml64+XElxVc4WQQAawt3fdhqoVo9X3d2qvLbU=; b=NDZEKvuRHOgUgGNn295MKdjU6e5zHfybHiAk6yyqvsu7qyY8PPxfr2yW9Nwu8CWyWr afJSRsogIROlZExaykKLf3GgKA2AmZ6q4j6zvOgRzCSd9AOme5YMMwiry6B+LhU2dN/F bBbnDzVCk7wYUbJlLz4V4Q+GhPhZK5CoDgiFGarEjHXqIqplbXwxZmUtiQL2L16PohCM r6HGZQN5VutMP22g5872Dw02FCsSUo8of/gNsNf0KGbIdWwYDwiRduM/BQTCpLxpN6Ix A6HomBl2ZMLWv2hHXu7k13ECu3iNvRQCj4qSSrNrYT38i9Xz0dnGsT7JPdz/Ou1D01Lo XPUQ== 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=mcxNZ9ml64+XElxVc4WQQAawt3fdhqoVo9X3d2qvLbU=; b=QXpC1Iq84DfkPWLP262ICBy+BEWkw6BR8xvcpw1RAAZlDaM6nlgNUuYbCPgpT4VGvj clx6fI1OIrJw4h+SBt+iGMfv1tEYnrmlhmPmx0363Njh8IbHA28da2hxhjcj3oY7Ar52 qUleqMHfOH2lL7lUsZJFIHzDXccOIvNWVS/pVjIU6vUyhrlx+Omilhtn/fO7t+IwND4y HeSMZDWgSEvc5boT0ilAW7J3TEzYdcz17hC/Lku/1v46u8aAWZQwm02Hp3tFjiMklbps dxxlzzK3IRek6nPwR6LssotKvxpBGxW7uVTVsLxQFEAI3JvojcH5ffvfmupYSBZ6UWXj Triw== X-Gm-Message-State: AOAM532lxg0pG+gMehowNaRvJjeRFk7PeJIPlhBgof2wmtswZI8MF96Z vS9Xql+Kv2DUznzmISF1h+s= X-Google-Smtp-Source: ABdhPJw2Gyo2VmEmWBx79TkQ0rO4aayU0g6rWvSWhERuvyqaGzYi4jNSjL6h1FuiRymC9ReVbrSUMQ== X-Received: by 2002:a37:86c1:: with SMTP id i184mr17130082qkd.14.1600179736565; Tue, 15 Sep 2020 07:22:16 -0700 (PDT) Received: from raichu (bras-vprn-toroon0560w-lp130-18-184-148-120-111.dsl.bell.ca. [184.148.120.111]) by smtp.gmail.com with ESMTPSA id z74sm17504085qkb.11.2020.09.15.07.22.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 07:22:14 -0700 (PDT) Sender: Mark Johnston Date: Tue, 15 Sep 2020 10:22:09 -0400 From: Mark Johnston To: Konstantin Belousov Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, peter@holm.cc Subject: Re: svn commit: r364944 - head/sys/kern Message-ID: <20200915142209.GA4145@raichu> References: <202008290429.07T4TrbH007764@repo.freebsd.org> <20200915141530.GM94807@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200915141530.GM94807@kib.kiev.ua> X-Rspamd-Queue-Id: 4BrQRF3ncQz48tb X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=NDZEKvuR; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::731 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-1.59 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[184.148.120.111:received]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.86)[-0.857]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.01)[0.010]; NEURAL_HAM_LONG(-1.05)[-1.048]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::731:from]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 14:22:18 -0000 On Tue, Sep 15, 2020 at 05:15:30PM +0300, Konstantin Belousov wrote: > On Sat, Aug 29, 2020 at 04:29:53AM +0000, Warner Losh wrote: > > Author: imp > > Date: Sat Aug 29 04:29:53 2020 > > New Revision: 364944 > > URL: https://svnweb.freebsd.org/changeset/base/364944 > > > > Log: > > devctl: move to using a uma zone > > > > Convert the memory management of devctl. Rewrite if to make better > > use of memory. This eliminates several mallocs (5? worse case) needed > > to send a message. It's now possible to always send a message, though > > if things are really backed up the oldest message will be dropped to > > free up space for the newest. > > > > Add a static bus_child_{location,pnpinfo}_sb to start migrating to > > sbuf instead of buffer + length. Use it in the new code. Other code > > will be converted later (bus_child_*_str is only used inside of > > subr_bus.c, though implemented in ~100 places in the tree). > > > > Reviewed by: markj@ > > Differential Revision: https://reviews.freebsd.org/D26140 > > > > Modified: > > head/sys/kern/subr_bus.c > > > > > + } else { > > + /* dei can't be NULL -- we know we have at least one in the zone */ > > + dei = uma_zalloc(devsoftc.zone, M_NOWAIT); > > + MPASS(dei != NULL); > This does not work. I believe you need to disable per-cpu cache for the > zone, at least. But I am not sure it is enough. >From the report we have: db:0:pho> show uma Zone Size Used Free Requests Sleeps Bucket Total Mem XFree DEVCTL 1024 6415164 0 6416203 0 16 6569127936 0 so it looks like the primary problem is a leak. > https://people.freebsd.org/~pho/stress/log/kostik1314.txt From owner-svn-src-all@freebsd.org Tue Sep 15 14:37:36 2020 Return-Path: Delivered-To: svn-src-all@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 459193D4C46; Tue, 15 Sep 2020 14:37:36 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) (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 4BrQmv2fvjz4B1V; Tue, 15 Sep 2020 14:37:35 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x736.google.com with SMTP id f142so4360386qke.13; Tue, 15 Sep 2020 07:37:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gPKbWKPvWRFOxn2o7DtyHRE8bInKUYbARhuwQ9P5QhA=; b=CLUunMaEU0rLPlImL/M1JI1Ae0scFUe1tzO33h/01qycjCwoK+U6o7gK6B9+IePTu6 4QHT1tW8AfFT7nA2qtk5S8SHAGjO8/8OScY/Uc2/BwvrzRy8E1K9o/17vNXq2I7GDJVd RLI4YiJwbIV5SRfqRmUvEfqjiZOM7yz0bly/ou7INHzB3k06LK8WRJzKxlFoLr+j/1zw BRp+OHjIrWUk0eY+7IOhdg+R+MoZSSMmr1ZeFdz3IXwYQgTTulzBK09MoubDo5UWfdxF bWYBxS9gbIg9Syp3MwjKfsQmrGZfKsJfBU1wO8Io6P2xPgNeiOQFsZ9S5dpaefVHOoYl gROA== 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=gPKbWKPvWRFOxn2o7DtyHRE8bInKUYbARhuwQ9P5QhA=; b=R13KdsPNgHZ5Eqb4V6a7mj4IOPQU1D9ITfjpAnmttNfD0kzc56+CzqmDMwFkpNU2O0 Lq3oE+18bmIE65IU9rKUOQocswY0malr4CojtOHHu5KrP06zbTG3Dh9E99yMAUmGoIs0 +0hctr/0NzuIOKBH99cf4dJSZdVDZ9oJ8yClkEbpvWrXaIAnwQoFvzgx7rTAPGVf7iAc 4WTK7L9/p+oP6XBI0i8wxKsW06P0MmWxsUk+KQZ2OZ3mRPDrH+CrvW5zQckQfJGuN73U vIZ6iQfrVh2+bdB2rVjefr7T9AYKbUkJTbdCu8j6Fh+MX1apE0sPqAuVIvqzw676E/1v qsqQ== X-Gm-Message-State: AOAM532hHcFHhud2B3t3GH7gGANDufbB77Ah2HUinTZ7kE7f//SvnAQ4 hzxOScEvFXxx+dl/j2VzHuc= X-Google-Smtp-Source: ABdhPJw9746+Inzk32wurWzUZ8Q+ukA/wIJ0sQohzOVS3Bmc5fLoX2zyoDZqtnZMpcR05gZMN0Rm2Q== X-Received: by 2002:a37:7785:: with SMTP id s127mr17682826qkc.386.1600180654362; Tue, 15 Sep 2020 07:37:34 -0700 (PDT) Received: from raichu (bras-vprn-toroon0560w-lp130-18-184-148-120-111.dsl.bell.ca. [184.148.120.111]) by smtp.gmail.com with ESMTPSA id m138sm17199553qke.99.2020.09.15.07.37.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 07:37:32 -0700 (PDT) Sender: Mark Johnston Date: Tue, 15 Sep 2020 10:37:30 -0400 From: Mark Johnston To: Konstantin Belousov Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, peter@holm.cc Subject: Re: svn commit: r364944 - head/sys/kern Message-ID: <20200915143730.GB4145@raichu> References: <202008290429.07T4TrbH007764@repo.freebsd.org> <20200915141530.GM94807@kib.kiev.ua> <20200915142209.GA4145@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200915142209.GA4145@raichu> X-Rspamd-Queue-Id: 4BrQmv2fvjz4B1V X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=CLUunMaE; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::736 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-1.67 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.07)[-0.067]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[184.148.120.111:received]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.86)[-0.856]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.05)[-1.048]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::736:from]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 14:37:36 -0000 On Tue, Sep 15, 2020 at 10:22:09AM -0400, Mark Johnston wrote: > On Tue, Sep 15, 2020 at 05:15:30PM +0300, Konstantin Belousov wrote: > > On Sat, Aug 29, 2020 at 04:29:53AM +0000, Warner Losh wrote: > > > Author: imp > > > Date: Sat Aug 29 04:29:53 2020 > > > New Revision: 364944 > > > URL: https://svnweb.freebsd.org/changeset/base/364944 > > > > > > Log: > > > devctl: move to using a uma zone > > > > > > Convert the memory management of devctl. Rewrite if to make better > > > use of memory. This eliminates several mallocs (5? worse case) needed > > > to send a message. It's now possible to always send a message, though > > > if things are really backed up the oldest message will be dropped to > > > free up space for the newest. > > > > > > Add a static bus_child_{location,pnpinfo}_sb to start migrating to > > > sbuf instead of buffer + length. Use it in the new code. Other code > > > will be converted later (bus_child_*_str is only used inside of > > > subr_bus.c, though implemented in ~100 places in the tree). > > > > > > Reviewed by: markj@ > > > Differential Revision: https://reviews.freebsd.org/D26140 > > > > > > Modified: > > > head/sys/kern/subr_bus.c > > > > > > > > + } else { > > > + /* dei can't be NULL -- we know we have at least one in the zone */ > > > + dei = uma_zalloc(devsoftc.zone, M_NOWAIT); > > > + MPASS(dei != NULL); > > This does not work. I believe you need to disable per-cpu cache for the > > zone, at least. But I am not sure it is enough. > > From the report we have: > > db:0:pho> show uma > Zone Size Used Free Requests Sleeps Bucket Total Mem XFree > DEVCTL 1024 6415164 0 6416203 0 16 6569127936 0 > > so it looks like the primary problem is a leak. > > > https://people.freebsd.org/~pho/stress/log/kostik1314.txt devctl_queue() does not maintain the queue length bound, so if devd goes away (due to an OOM kill in this case), we can end up with a large backlog. This hack might be sufficient. diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 19c056ab9974..91c57cdfae5b 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -635,7 +635,14 @@ devctl_queue(struct dev_event_info *dei) { mtx_lock(&devsoftc.mtx); STAILQ_INSERT_TAIL(&devsoftc.devq, dei, dei_link); - devsoftc.queued++; + if (devctl_queue_length != 0 && + devctl_queue_length == devsoftc.queued) { + dei = STAILQ_FIRST(&devsoftc.devq); + STAILQ_REMOVE_HEAD(&devsoftc.devq, dei_link); + uma_zfree(devsoftc.zone, dei); + } else { + devsoftc.queued++; + } cv_broadcast(&devsoftc.cv); KNOTE_LOCKED(&devsoftc.sel.si_note, 0); mtx_unlock(&devsoftc.mtx); From owner-svn-src-all@freebsd.org Tue Sep 15 14:39:12 2020 Return-Path: Delivered-To: svn-src-all@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 3236B3D5090 for ; Tue, 15 Sep 2020 14:39:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) (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 4BrQpl372Xz4BH5 for ; Tue, 15 Sep 2020 14:39:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x831.google.com with SMTP id n10so3338912qtv.3 for ; Tue, 15 Sep 2020 07:39:11 -0700 (PDT) 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=TP7YonQhYWQT4DUtksPNNbCClYH+7sIEhRmxHtoxeGQ=; b=lJuw7h+ZRpIShfmtV3v9w6zDXwH5aepAt58bLPrjbY7qRR5ExHnTnDml8ToyyIxChJ Y1ea6Kbp8GupK5QHRbs2jyUBVUpIp5mnzd/uvK8XlzoPYy1jOxQgfeCfbl13uLykmVIw jJvRrZ+Basl7WYgFo4M8BgjP40pK1NE8995GRI+5W8sB+04uDlkoWuSSi8y1GSyi5mZB DQsqDbH+ZwwbhNT5Y5RFIfC+h4tHdo/x1uFrkkXQqJkFWa8oUhzoOtPgMWQa7uMu/aKX as8ve6mafPeR+jLY0zxYGcXEshjx8pHb1Sp795C6BvQfbA5MrTWiGQxnIpk55ZrX4/y7 rEZw== 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=TP7YonQhYWQT4DUtksPNNbCClYH+7sIEhRmxHtoxeGQ=; b=EeWcT0eXV0bd+btno+VOt+e1cMxgTt4D7eH1VGX83kHFTUlkDYlXkNbtuVut9lM+d/ J+oMCrE/yvgfkrqhBo75VagBeeKQC9v9pXSwLSN9gRoPF1rNAtYkYDfiDIvdnQ7GFSGg CrX+9Ofdt7K0t0zJY9ZvXnvt89iRkAhSJV4cBVgpwYRjOl/RuUMqJ7zJD4+UuiZ6WP8N 8Wh1nuxKbMm+srUnOyTvUA7eUjN1nFx2yiInP0bC7a/vXORbbESJfxNYea9wk2D2eTRH 6kyGeMhmpqG7c0HJC12dAunmb24WjhBddOllbbqyVnTdLbbYvCL6XQ2CFhIZ26dhyVL8 sXIA== X-Gm-Message-State: AOAM530O0GG/JHwjLVcdr700v0iqyFWzlKAh0doQ9SLgDonl/DRRXVtw 8a5HQA9bd86D1NCnJwkfd6o8SVH1xuhXTXJDDK6MHw== X-Google-Smtp-Source: ABdhPJxPGEfc4ZQikbg/dkinyV38stUpJkF8U3pDUIasWjjkfZJsIbSsehhZukTW5XlP5qqz5TACYwZYE7TZgqxaoTo= X-Received: by 2002:ac8:4548:: with SMTP id z8mr18806358qtn.291.1600180749901; Tue, 15 Sep 2020 07:39:09 -0700 (PDT) MIME-Version: 1.0 References: <202008290429.07T4TrbH007764@repo.freebsd.org> <20200915141530.GM94807@kib.kiev.ua> <20200915142209.GA4145@raichu> In-Reply-To: <20200915142209.GA4145@raichu> From: Warner Losh Date: Tue, 15 Sep 2020 08:38:57 -0600 Message-ID: Subject: Re: svn commit: r364944 - head/sys/kern To: Mark Johnston Cc: Konstantin Belousov , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, peter@holm.cc X-Rspamd-Queue-Id: 4BrQpl372Xz4BH5 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=lJuw7h+Z; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::831) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-1.79 / 15.00]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.93)[-0.928]; NEURAL_HAM_LONG(-0.98)[-0.985]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; NEURAL_SPAM_SHORT(0.13)[0.126]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::831:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org,holm.cc]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 14:39:12 -0000 On Tue, Sep 15, 2020, 8:22 AM Mark Johnston wrote: > On Tue, Sep 15, 2020 at 05:15:30PM +0300, Konstantin Belousov wrote: > > On Sat, Aug 29, 2020 at 04:29:53AM +0000, Warner Losh wrote: > > > Author: imp > > > Date: Sat Aug 29 04:29:53 2020 > > > New Revision: 364944 > > > URL: https://svnweb.freebsd.org/changeset/base/364944 > > > > > > Log: > > > devctl: move to using a uma zone > > > > > > Convert the memory management of devctl. Rewrite if to make better > > > use of memory. This eliminates several mallocs (5? worse case) needed > > > to send a message. It's now possible to always send a message, though > > > if things are really backed up the oldest message will be dropped to > > > free up space for the newest. > > > > > > Add a static bus_child_{location,pnpinfo}_sb to start migrating to > > > sbuf instead of buffer + length. Use it in the new code. Other code > > > will be converted later (bus_child_*_str is only used inside of > > > subr_bus.c, though implemented in ~100 places in the tree). > > > > > > Reviewed by: markj@ > > > Differential Revision: https://reviews.freebsd.org/D26140 > > > > > > Modified: > > > head/sys/kern/subr_bus.c > > > > > > > > + } else { > > > + /* dei can't be NULL -- we know we have at least one in > the zone */ > > > + dei = uma_zalloc(devsoftc.zone, M_NOWAIT); > > > + MPASS(dei != NULL); > > This does not work. I believe you need to disable per-cpu cache for the > > zone, at least. But I am not sure it is enough. > > From the report we have: > > db:0:pho> show uma > Zone Size Used Free Requests Sleeps Bucket > Total Mem XFree > DEVCTL 1024 6415164 0 6416203 0 16 > 6569127936 0 > > so it looks like the primary problem is a leak. > > > https://people.freebsd.org/~pho/stress/log/kostik1314.txt I'll look into it. Warner > > From owner-svn-src-all@freebsd.org Tue Sep 15 15:20:41 2020 Return-Path: Delivered-To: svn-src-all@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 825303D626A for ; Tue, 15 Sep 2020 15:20:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) (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 4BrRkb4bwlz4FHY for ; Tue, 15 Sep 2020 15:20:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf31.google.com with SMTP id q10so1909499qvs.1 for ; Tue, 15 Sep 2020 08:20:39 -0700 (PDT) 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=VPxu8SFchIKjiN5XSqHM3N1EkkM5BiCYjn7I7gPM8XM=; b=boQitBEdyAuS6c0XKmlRIbjQVoTGYVO7nkUUbTJwM7/yyvK5Cn1b45yw2vXH5mjnJh rvB008IcdTA8JidmhaDi+hElAMHUYSRBYQPX1lYIWJ1sTqBKchtNDa0GqVnGYeQEIrGv 9PQk8lIinTq1gbAu6vTAgGh/YHNqDhk+1DY/R/LYB8gOOXQ8iPgcQqKPy/81GQfx8Pmu HmNF4gXqShcyuKtYK6ofDPEYmLeYxCmVOmNBX5lZPmjCl06SSOnM1pQcCtrK+1nD4dom LAfHhixErwtlZNNXpn3mbJX1NmpS0PluatlTxIfZ6an3soHLazq2xmrtHi2GibocVmAy VzzQ== 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=VPxu8SFchIKjiN5XSqHM3N1EkkM5BiCYjn7I7gPM8XM=; b=Ab6OKu33j0x5enLwDt12LbSwr/QIIfjHAhVeLLRaWXPlth5GdZQIOsx4V1cXAHiVQc donzos2TZp/4ac0hyIkTY3yu7tAJnKjTgVN8Gos12CzGcIEiiL67jf6HH5KjXeTU+nzR Cd1JCYRFOQAzJzVupbxjsJ6OwpOivs0eJBXYaJX+FH1exDimxsGXlhSyamZOI4T1jGDV 9yLBcCHWi1Wz6BNg7uMcjbf5r1zasto3jX6adZMRUAk99nKkg3KmdDDrPwdtoQ3SX7rd LbM0wdNQ5GMnt/RVsD8vB2WmLl/3fKXxmVlklhcZkI/i84xQgoYEJkqN0jfVr4hqy0Ex oxdg== X-Gm-Message-State: AOAM532VSbS425+1Hls+8/FyYK/K4gA86Fqjo96k88ilF23Z3cJuIZn5 FbngyhhD+7eiajCCEO3APcHoOzyDNlkfMcLx+t69dQ== X-Google-Smtp-Source: ABdhPJx/iyiXGuXDn+GOqguExXZsb3ab/Q/oH21Oq8ykyLtEDUeHsHJxhR2K9nmUO8U7XGz9wS8dpYMRLmVJIOcZPLc= X-Received: by 2002:a0c:a162:: with SMTP id d89mr19139898qva.28.1600183238420; Tue, 15 Sep 2020 08:20:38 -0700 (PDT) MIME-Version: 1.0 References: <202008290429.07T4TrbH007764@repo.freebsd.org> <20200915141530.GM94807@kib.kiev.ua> <20200915142209.GA4145@raichu> <20200915143730.GB4145@raichu> In-Reply-To: <20200915143730.GB4145@raichu> From: Warner Losh Date: Tue, 15 Sep 2020 09:20:27 -0600 Message-ID: Subject: Re: svn commit: r364944 - head/sys/kern To: Mark Johnston Cc: Konstantin Belousov , Warner Losh , src-committers , svn-src-all , svn-src-head , Peter Holm X-Rspamd-Queue-Id: 4BrRkb4bwlz4FHY X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=boQitBEd; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f31) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-1.86 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.89)[-0.889]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org,holm.cc]; NEURAL_HAM_LONG(-0.99)[-0.988]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; NEURAL_SPAM_SHORT(0.01)[0.014]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f31:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[svn-src-all] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 15:20:41 -0000 On Tue, Sep 15, 2020 at 8:37 AM Mark Johnston wrote: > On Tue, Sep 15, 2020 at 10:22:09AM -0400, Mark Johnston wrote: > > On Tue, Sep 15, 2020 at 05:15:30PM +0300, Konstantin Belousov wrote: > > > On Sat, Aug 29, 2020 at 04:29:53AM +0000, Warner Losh wrote: > > > > Author: imp > > > > Date: Sat Aug 29 04:29:53 2020 > > > > New Revision: 364944 > > > > URL: https://svnweb.freebsd.org/changeset/base/364944 > > > > > > > > Log: > > > > devctl: move to using a uma zone > > > > > > > > Convert the memory management of devctl. Rewrite if to make better > > > > use of memory. This eliminates several mallocs (5? worse case) > needed > > > > to send a message. It's now possible to always send a message, > though > > > > if things are really backed up the oldest message will be dropped > to > > > > free up space for the newest. > > > > > > > > Add a static bus_child_{location,pnpinfo}_sb to start migrating to > > > > sbuf instead of buffer + length. Use it in the new code. Other > code > > > > will be converted later (bus_child_*_str is only used inside of > > > > subr_bus.c, though implemented in ~100 places in the tree). > > > > > > > > Reviewed by: markj@ > > > > Differential Revision: https://reviews.freebsd.org/D26140 > > > > > > > > Modified: > > > > head/sys/kern/subr_bus.c > > > > > > > > > > > + } else { > > > > + /* dei can't be NULL -- we know we have at least one in > the zone */ > > > > + dei = uma_zalloc(devsoftc.zone, M_NOWAIT); > > > > + MPASS(dei != NULL); > > > This does not work. I believe you need to disable per-cpu cache for > the > > > zone, at least. But I am not sure it is enough. > > > > From the report we have: > > > > db:0:pho> show uma > > Zone Size Used Free Requests Sleeps Bucket > Total Mem XFree > > DEVCTL 1024 6415164 0 6416203 0 16 > 6569127936 0 > > > > so it looks like the primary problem is a leak. > > > > > https://people.freebsd.org/~pho/stress/log/kostik1314.txt > > devctl_queue() does not maintain the queue length bound, so if devd goes > away (due to an OOM kill in this case), we can end up with a large > backlog. This hack might be sufficient. > > diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c > index 19c056ab9974..91c57cdfae5b 100644 > --- a/sys/kern/subr_bus.c > +++ b/sys/kern/subr_bus.c > @@ -635,7 +635,14 @@ devctl_queue(struct dev_event_info *dei) > { > mtx_lock(&devsoftc.mtx); > STAILQ_INSERT_TAIL(&devsoftc.devq, dei, dei_link); > - devsoftc.queued++; > + if (devctl_queue_length != 0 && > + devctl_queue_length == devsoftc.queued) { > + dei = STAILQ_FIRST(&devsoftc.devq); > + STAILQ_REMOVE_HEAD(&devsoftc.devq, dei_link); > + uma_zfree(devsoftc.zone, dei); > + } else { > + devsoftc.queued++; > + } > cv_broadcast(&devsoftc.cv); > KNOTE_LOCKED(&devsoftc.sel.si_note, 0); > mtx_unlock(&devsoftc.mtx); > I've come to a similar conclusion... You can't queue w/o allocating... and that's where we're supposed to pop off the oldest, free it so we can allocate. So this isn't the right place for this fix, and the 'queued' name may be a bad name since it's from before. It's now supposed to be closer to 'allocated'. Warner From owner-svn-src-all@freebsd.org Tue Sep 15 15:21:29 2020 Return-Path: Delivered-To: svn-src-all@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 A19983D6441; Tue, 15 Sep 2020 15:21:29 +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 4BrRlY3vJzz4FW6; Tue, 15 Sep 2020 15:21:29 +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 6A938A2CB; Tue, 15 Sep 2020 15:21:29 +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 08FFLTle005998; Tue, 15 Sep 2020 15:21:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FFLTQD005997; Tue, 15 Sep 2020 15:21:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009151521.08FFLTQD005997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 15 Sep 2020 15:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365751 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 365751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 15:21:29 -0000 Author: imp Date: Tue Sep 15 15:21:29 2020 New Revision: 365751 URL: https://svnweb.freebsd.org/changeset/base/365751 Log: Include sys/types.h here It's included by header pollution in most of the compile environments. However, in the standalone envirnment, it's not included. Go ahead and include it always since the overhead is low and it is simpler that way. MFC After: 3 days Modified: head/sys/opencrypto/xform_aes_xts.c Modified: head/sys/opencrypto/xform_aes_xts.c ============================================================================== --- head/sys/opencrypto/xform_aes_xts.c Tue Sep 15 14:15:04 2020 (r365750) +++ head/sys/opencrypto/xform_aes_xts.c Tue Sep 15 15:21:29 2020 (r365751) @@ -50,6 +50,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include static int aes_xts_setkey(void *, const uint8_t *, int); From owner-svn-src-all@freebsd.org Tue Sep 15 16:22:06 2020 Return-Path: Delivered-To: svn-src-all@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 5325B3D7E05; Tue, 15 Sep 2020 16:22:06 +0000 (UTC) (envelope-from se@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 4BrT5V1ZQ6z4Jm2; Tue, 15 Sep 2020 16:22:06 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19607B1A4; Tue, 15 Sep 2020 16:22:06 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08FGM5l6046465; Tue, 15 Sep 2020 16:22:05 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FGM5P2046463; Tue, 15 Sep 2020 16:22:05 GMT (envelope-from se@FreeBSD.org) Message-Id: <202009151622.08FGM5P2046463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Tue, 15 Sep 2020 16:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365753 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 365753 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 16:22:06 -0000 Author: se Date: Tue Sep 15 16:22:05 2020 New Revision: 365753 URL: https://svnweb.freebsd.org/changeset/base/365753 Log: Add descriptions of the WITH_(OUT)_GH_BC options that exist in -CURRENT (default: WITH_GH_BC) and 12-STABLE (default: WITHOUT_GH_BC). Since the new implementation of bc and dc is optionally available in 12-STABLE, I intend to MFC these descriptions for inclusion in 12.2. MFC after: 3 days Added: head/tools/build/options/WITHOUT_GH_BC (contents, props changed) head/tools/build/options/WITH_GH_BC (contents, props changed) Added: head/tools/build/options/WITHOUT_GH_BC ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_GH_BC Tue Sep 15 16:22:05 2020 (r365753) @@ -0,0 +1,6 @@ +.\" $FreeBSD$ +Do not install the enhanced +.Xr bc +and +.Xr dc +programs instead of the traditional FreeBSD versions. Added: head/tools/build/options/WITH_GH_BC ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_GH_BC Tue Sep 15 16:22:05 2020 (r365753) @@ -0,0 +1,6 @@ +.\" $FreeBSD$ +Install the enhanced +.Xr bc +and +.Xr dc +programs instead of the traditional FreeBSD versions. From owner-svn-src-all@freebsd.org Tue Sep 15 16:38:44 2020 Return-Path: Delivered-To: svn-src-all@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 BA17B3D867C; Tue, 15 Sep 2020 16:38:44 +0000 (UTC) (envelope-from se@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 4BrTSh4XKYz4L0m; Tue, 15 Sep 2020 16:38:44 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8023BB1D2; Tue, 15 Sep 2020 16:38:44 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08FGciCD055361; Tue, 15 Sep 2020 16:38:44 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FGciLB055360; Tue, 15 Sep 2020 16:38:44 GMT (envelope-from se@FreeBSD.org) Message-Id: <202009151638.08FGciLB055360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Tue, 15 Sep 2020 16:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365754 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 365754 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 16:38:44 -0000 Author: se Date: Tue Sep 15 16:38:44 2020 New Revision: 365754 URL: https://svnweb.freebsd.org/changeset/base/365754 Log: src.conf.5: regen after r365753 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue Sep 15 16:22:05 2020 (r365753) +++ head/share/man/man5/src.conf.5 Tue Sep 15 16:38:44 2020 (r365754) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd September 14, 2020 +.Dd September 15, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -668,6 +668,12 @@ Set to build .Pp This is a default setting on amd64/amd64, arm/armv6, arm/armv7, i386/i386, mips/mips, mips/mips64, powerpc/powerpc and powerpc/powerpc64. +.It Va WITHOUT_GH_BC +Do not install the enhanced +.Xr bc +and +.Xr dc +programs instead of the traditional FreeBSD versions. .It Va WITHOUT_GNU_DIFF Set to not build GNU .Xr diff3 1 . From owner-svn-src-all@freebsd.org Tue Sep 15 16:39:05 2020 Return-Path: Delivered-To: svn-src-all@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 4FD5E3D8A8D for ; Tue, 15 Sep 2020 16:39:05 +0000 (UTC) (envelope-from 0100017492a24644-b4d02dca-c545-416b-a3e9-0ac680b80ca2-000000@amazonses.com) Received: from a8-30.smtp-out.amazonses.com (a8-30.smtp-out.amazonses.com [54.240.8.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BrTT35H3Zz4LF4 for ; Tue, 15 Sep 2020 16:39:03 +0000 (UTC) (envelope-from 0100017492a24644-b4d02dca-c545-416b-a3e9-0ac680b80ca2-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ice2cqyuaqfpxjikaqw26b3l4h5zgbqg; d=yourprivacybrands.com; t=1600187942; h=Date:To:From:Reply-To:Subject:Message-ID:List-Unsubscribe:MIME-Version:Content-Type; bh=4Hi/3HdNzzeEmoJ9VMomjT3JUUknEJz+NRkhQQhRULo=; b=NE1ypz/qPAVD+Z0huSCvqOai0YkR479U+8ARitVLa+iu2UNgSfDAbQBJ6kN1pkU8 nT9uRHdduvmraZAWWXOP92k3euOvuDRN91byYZ56GSgj9eJMTTN1Df2hj7mBAYM3RsD YXIXeE2IWpEEj4fMV7/MWe7HHIWTV2JYSsLbkisA= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1600187942; h=Date:To:From:Reply-To:Subject:Message-ID:List-Unsubscribe:MIME-Version:Content-Type:Feedback-ID; bh=4Hi/3HdNzzeEmoJ9VMomjT3JUUknEJz+NRkhQQhRULo=; b=CeEvRuc3zIufLEEZcxp1yQt68nNTZgcY1mMMPlcsiHZKm7IOwBinI0oTthLfLnqr CUzVWUkqsyQ/QDqiYKGZIuWAkcq1yVIA8EiA7zPW+z8O32vB8dT4Kyx4JrmYPIl4p5G JyagYO3usi4kOCw9uL5wqCLZ1+7ANNntBfQBfnLY= Date: Tue, 15 Sep 2020 16:39:02 +0000 To: svn-src-all@freebsd.org From: Lara Daston Reply-To: Lara Daston Subject: gcu-squad.org's impact on safe browsing Message-ID: <0100017492a24644-b4d02dca-c545-416b-a3e9-0ac680b80ca2-000000@email.amazonses.com> X-Mailer: Sendy (https://sendy.co) X-SES-Outgoing: 2020.09.15-54.240.8.30 Feedback-ID: 1.us-east-1.hQBEJ+PkeyYGshRYZjK5/AgME2CpEJ27qo41+/e2Vc4=:AmazonSES X-Rspamd-Queue-Id: 4BrTT35H3Zz4LF4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yourprivacybrands.com header.s=ice2cqyuaqfpxjikaqw26b3l4h5zgbqg header.b=NE1ypz/q; dkim=pass header.d=amazonses.com header.s=224i4yxa5dv7c2xz3womw6peuasteono header.b=CeEvRuc3; dmarc=pass (policy=none) header.from=yourprivacybrands.com; spf=pass (mx1.freebsd.org: domain of 0100017492a24644-b4d02dca-c545-416b-a3e9-0ac680b80ca2-000000@amazonses.com designates 54.240.8.30 as permitted sender) smtp.mailfrom=0100017492a24644-b4d02dca-c545-416b-a3e9-0ac680b80ca2-000000@amazonses.com X-Spamd-Result: default: False [-2.55 / 15.00]; HAS_REPLYTO(0.00)[lara@yourprivacybrands.com]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yourprivacybrands.com:s=ice2cqyuaqfpxjikaqw26b3l4h5zgbqg,amazonses.com:s=224i4yxa5dv7c2xz3womw6peuasteono]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[54.240.8.30:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:54.240.0.0/18]; NEURAL_HAM_LONG(-0.99)[-0.993]; TO_DN_NONE(0.00)[]; NEURAL_HAM_MEDIUM(-0.92)[-0.919]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; DKIM_TRACE(0.00)[yourprivacybrands.com:+,amazonses.com:+]; DMARC_POLICY_ALLOW(-0.50)[yourprivacybrands.com,none]; RCVD_IN_DNSWL_NONE(0.00)[54.240.8.30:from]; NEURAL_HAM_SHORT(-0.23)[-0.226]; MIME_HTML_ONLY(0.20)[]; FORGED_SENDER(0.30)[lara@yourprivacybrands.com,0100017492a24644-b4d02dca-c545-416b-a3e9-0ac680b80ca2-000000@amazonses.com]; RCVD_COUNT_ZERO(0.00)[0]; MIME_TRACE(0.00)[0:~]; ASN(0.00)[asn:14618, ipnet:54.240.8.0/21, country:US]; FROM_NEQ_ENVFROM(0.00)[lara@yourprivacybrands.com,0100017492a24644-b4d02dca-c545-416b-a3e9-0ac680b80ca2-000000@amazonses.com]; MAILMAN_DEST(0.00)[svn-src-all] MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 16:39:05 -0000 From owner-svn-src-all@freebsd.org Tue Sep 15 16:41:24 2020 Return-Path: Delivered-To: svn-src-all@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 7F7583D89B1; Tue, 15 Sep 2020 16:41:24 +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 4BrTWm2qV8z4LMn; Tue, 15 Sep 2020 16:41:24 +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 445A0B48A; Tue, 15 Sep 2020 16:41:24 +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 08FGfOPk055570; Tue, 15 Sep 2020 16:41:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FGfMeS055562; Tue, 15 Sep 2020 16:41:22 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202009151641.08FGfMeS055562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 15 Sep 2020 16:41:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365755 - in head/sys: amd64/amd64 amd64/linux amd64/linux32 arm/arm arm64/arm64 arm64/linux i386/i386 i386/linux powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/linux amd64/linux32 arm/arm arm64/arm64 arm64/linux i386/i386 i386/linux powerpc/powerpc X-SVN-Commit-Revision: 365755 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 16:41:24 -0000 Author: trasz Date: Tue Sep 15 16:41:21 2020 New Revision: 365755 URL: https://svnweb.freebsd.org/changeset/base/365755 Log: Move SV_ABI_ERRNO translation into linux-specific code, to simplify the syscall path and declutter it a bit. No functional changes intended. Reviewed by: kib (earlier version) MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26378 Modified: head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/arm/arm/vm_machdep.c head/sys/arm64/arm64/vm_machdep.c head/sys/arm64/linux/linux_sysvec.c head/sys/i386/i386/vm_machdep.c head/sys/i386/linux/linux_sysvec.c head/sys/powerpc/powerpc/exec_machdep.c Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Tue Sep 15 16:38:44 2020 (r365754) +++ head/sys/amd64/amd64/vm_machdep.c Tue Sep 15 16:41:21 2020 (r365755) @@ -543,7 +543,7 @@ cpu_set_syscall_retval(struct thread *td, int error) break; default: - frame->tf_rax = SV_ABI_ERRNO(td->td_proc, error); + frame->tf_rax = error; frame->tf_rflags |= PSL_C; break; } Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Tue Sep 15 16:38:44 2020 (r365754) +++ head/sys/amd64/linux/linux_sysvec.c Tue Sep 15 16:41:21 2020 (r365755) @@ -219,6 +219,11 @@ linux_set_syscall_retval(struct thread *td, int error) cpu_set_syscall_retval(td, error); + if (__predict_false(error != 0)) { + if (error != ERESTART && error != EJUSTRETURN) + frame->tf_rax = SV_ABI_ERRNO(td->td_proc, error); + } + /* Restore all registers. */ set_pcb_flags(td->td_pcb, PCB_FULL_IRET); } Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Tue Sep 15 16:38:44 2020 (r365754) +++ head/sys/amd64/linux32/linux32_sysvec.c Tue Sep 15 16:41:21 2020 (r365755) @@ -112,6 +112,7 @@ static void linux32_fixlimit(struct rlimit *rl, int wh static bool linux32_trans_osrel(const Elf_Note *note, int32_t *osrel); static void linux_vdso_install(void *param); static void linux_vdso_deinstall(void *param); +static void linux32_set_syscall_retval(struct thread *td, int error); #define LINUX_T_UNKNOWN 255 static int _bsd_to_linux_trapcode[] = { @@ -669,6 +670,19 @@ linux32_fetch_syscall_args(struct thread *td) return (0); } +static void +linux32_set_syscall_retval(struct thread *td, int error) +{ + struct trapframe *frame = td->td_frame; + + cpu_set_syscall_retval(td, error); + + if (__predict_false(error != 0)) { + if (error != ERESTART && error != EJUSTRETURN) + frame->tf_rax = SV_ABI_ERRNO(td->td_proc, error); + } +} + /* * Clear registers on exec * XXX copied from ia32_signal.c. @@ -906,7 +920,7 @@ struct sysentvec elf_linux_sysvec = { .sv_fixlimit = linux32_fixlimit, .sv_maxssiz = &linux32_maxssiz, .sv_flags = SV_ABI_LINUX | SV_ILP32 | SV_IA32 | SV_SHP, - .sv_set_syscall_retval = cpu_set_syscall_retval, + .sv_set_syscall_retval = linux32_set_syscall_retval, .sv_fetch_syscall_args = linux32_fetch_syscall_args, .sv_syscallnames = NULL, .sv_shared_page_base = LINUX32_SHAREDPAGE, Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Tue Sep 15 16:38:44 2020 (r365754) +++ head/sys/arm/arm/vm_machdep.c Tue Sep 15 16:41:21 2020 (r365755) @@ -219,7 +219,7 @@ cpu_set_syscall_retval(struct thread *td, int error) /* nothing to do */ break; default: - frame->tf_r0 = SV_ABI_ERRNO(td->td_proc, error); + frame->tf_r0 = error; frame->tf_spsr |= PSR_C; /* carry bit */ break; } Modified: head/sys/arm64/arm64/vm_machdep.c ============================================================================== --- head/sys/arm64/arm64/vm_machdep.c Tue Sep 15 16:38:44 2020 (r365754) +++ head/sys/arm64/arm64/vm_machdep.c Tue Sep 15 16:41:21 2020 (r365755) @@ -153,7 +153,7 @@ cpu_set_syscall_retval(struct thread *td, int error) break; default: frame->tf_spsr |= PSR_C; /* carry bit */ - frame->tf_x[0] = SV_ABI_ERRNO(td->td_proc, error); + frame->tf_x[0] = error; break; } } Modified: head/sys/arm64/linux/linux_sysvec.c ============================================================================== --- head/sys/arm64/linux/linux_sysvec.c Tue Sep 15 16:38:44 2020 (r365754) +++ head/sys/arm64/linux/linux_sysvec.c Tue Sep 15 16:41:21 2020 (r365755) @@ -141,6 +141,13 @@ linux_set_syscall_retval(struct thread *td, int error) td->td_retval[1] = td->td_frame->tf_x[1]; cpu_set_syscall_retval(td, error); + + if (__predict_false(error != 0)) { + if (error != ERESTART && error != EJUSTRETURN) { + td->td_frame->tf_x[0] = + SV_ABI_ERRNO(td->td_proc, error); + } + } } static int Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Tue Sep 15 16:38:44 2020 (r365754) +++ head/sys/i386/i386/vm_machdep.c Tue Sep 15 16:41:21 2020 (r365755) @@ -407,7 +407,7 @@ cpu_set_syscall_retval(struct thread *td, int error) break; default: - td->td_frame->tf_eax = SV_ABI_ERRNO(td->td_proc, error); + td->td_frame->tf_eax = error; td->td_frame->tf_eflags |= PSL_C; break; } Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Tue Sep 15 16:38:44 2020 (r365754) +++ head/sys/i386/linux/linux_sysvec.c Tue Sep 15 16:41:21 2020 (r365755) @@ -792,6 +792,19 @@ linux_fetch_syscall_args(struct thread *td) return (0); } +static void +linux_set_syscall_retval(struct thread *td, int error) +{ + struct trapframe *frame = td->td_frame; + + cpu_set_syscall_retval(td, error); + + if (__predict_false(error != 0)) { + if (error != ERESTART && error != EJUSTRETURN) + frame->tf_eax = SV_ABI_ERRNO(td->td_proc, error); + } +} + /* * exec_setregs may initialize some registers differently than Linux * does, thus potentially confusing Linux binaries. If necessary, we @@ -855,7 +868,7 @@ struct sysentvec linux_sysvec = { .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_LINUX | SV_AOUT | SV_IA32 | SV_ILP32, - .sv_set_syscall_retval = cpu_set_syscall_retval, + .sv_set_syscall_retval = linux_set_syscall_retval, .sv_fetch_syscall_args = linux_fetch_syscall_args, .sv_syscallnames = NULL, .sv_shared_page_base = LINUX_SHAREDPAGE, @@ -891,7 +904,7 @@ struct sysentvec elf_linux_sysvec = { .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_LINUX | SV_IA32 | SV_ILP32 | SV_SHP, - .sv_set_syscall_retval = cpu_set_syscall_retval, + .sv_set_syscall_retval = linux_set_syscall_retval, .sv_fetch_syscall_args = linux_fetch_syscall_args, .sv_syscallnames = NULL, .sv_shared_page_base = LINUX_SHAREDPAGE, Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Tue Sep 15 16:38:44 2020 (r365754) +++ head/sys/powerpc/powerpc/exec_machdep.c Tue Sep 15 16:41:21 2020 (r365755) @@ -955,7 +955,7 @@ cpu_set_syscall_retval(struct thread *td, int error) tf->srr0 -= 4; break; default: - tf->fixreg[FIRSTARG] = SV_ABI_ERRNO(p, error); + tf->fixreg[FIRSTARG] = error; tf->cr |= 0x10000000; /* Set summary overflow */ break; } From owner-svn-src-all@freebsd.org Tue Sep 15 17:13:30 2020 Return-Path: Delivered-To: svn-src-all@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 811703D9CEA; Tue, 15 Sep 2020 17:13: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 4BrVDp2wdsz4NJm; Tue, 15 Sep 2020 17:13: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 47CC1B9C9; Tue, 15 Sep 2020 17:13: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 08FHDUrk079354; Tue, 15 Sep 2020 17:13:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FHDUhD079353; Tue, 15 Sep 2020 17:13:30 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009151713.08FHDUhD079353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 15 Sep 2020 17:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365756 - head/usr.sbin/certctl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/certctl X-SVN-Commit-Revision: 365756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 17:13:30 -0000 Author: kevans Date: Tue Sep 15 17:13:29 2020 New Revision: 365756 URL: https://svnweb.freebsd.org/changeset/base/365756 Log: certctl: fix unprivileged mode The first issue was lack of quoting around INSTALLFLAGS, which set it incorrectly and produced an error on -M. The second issue was that we weren't actually doing the install in unprivileged mode, making it effectively useless. This was designed to pass through the proper metalog/unpriv flags to install(1), so just let it happen. MFC after: 3 days Modified: head/usr.sbin/certctl/certctl.sh Modified: head/usr.sbin/certctl/certctl.sh ============================================================================== --- head/usr.sbin/certctl/certctl.sh Tue Sep 15 16:41:21 2020 (r365755) +++ head/usr.sbin/certctl/certctl.sh Tue Sep 15 17:13:29 2020 (r365756) @@ -129,7 +129,7 @@ do_scan() [ -d "$CPATH" ] || continue echo "Scanning $CPATH for certificates..." for CFILE in $(ls -1 "${CPATH}" | grep -Ee "${FILEPAT}"); do - [ -e "$CPATH/$CFILE" -a $UNPRIV -eq 0 ] || continue + [ -e "$CPATH/$CFILE" ] || continue [ $VERBOSE -gt 0 ] && echo "Reading $CFILE" "$CFUNC" "$CPATH/$CFILE" done @@ -263,7 +263,7 @@ shift $(( $OPTIND - 1 )) : ${METALOG:=${DESTDIR}/METALOG} INSTALLFLAGS= -[ $UNPRIV -eq 1 ] && INSTALLFLAGS=-U -M ${METALOG} -D ${DESTDIR} +[ $UNPRIV -eq 1 ] && INSTALLFLAGS="-U -M ${METALOG} -D ${DESTDIR}" : ${TRUSTPATH:=${DESTDIR}/usr/share/certs/trusted:${DESTDIR}/usr/local/share/certs:${DESTDIR}/usr/local/etc/ssl/certs} : ${BLACKLISTPATH:=${DESTDIR}/usr/share/certs/blacklisted:${DESTDIR}/usr/local/etc/ssl/blacklisted} : ${CERTDESTDIR:=${DESTDIR}/etc/ssl/certs} From owner-svn-src-all@freebsd.org Tue Sep 15 18:55:41 2020 Return-Path: Delivered-To: svn-src-all@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 319253DCA9F; Tue, 15 Sep 2020 18:55:41 +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 4BrXVj0mlDz4Th7; Tue, 15 Sep 2020 18:55:41 +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 ED743CE8F; Tue, 15 Sep 2020 18:55:40 +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 08FIteAO040542; Tue, 15 Sep 2020 18:55:40 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FItcHO040527; Tue, 15 Sep 2020 18:55:38 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009151855.08FItcHO040527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 15 Sep 2020 18:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r365757 - in vendor/llvm-project/release-11.x: clang/include/clang/AST clang/include/clang/Basic clang/lib/AST clang/lib/Basic clang/lib/CodeGen clang/lib/Driver/ToolChains clang/lib/Dr... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/llvm-project/release-11.x: clang/include/clang/AST clang/include/clang/Basic clang/lib/AST clang/lib/Basic clang/lib/CodeGen clang/lib/Driver/ToolChains clang/lib/Driver/ToolChains/Arch clan... X-SVN-Commit-Revision: 365757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 18:55:41 -0000 Author: dim Date: Tue Sep 15 18:55:37 2020 New Revision: 365757 URL: https://svnweb.freebsd.org/changeset/base/365757 Log: Vendor import of llvm-project branch release/11.x llvmorg-11.0.0-rc2-91-g6e042866c30. Modified: vendor/llvm-project/release-11.x/clang/include/clang/AST/ASTContext.h vendor/llvm-project/release-11.x/clang/include/clang/Basic/DiagnosticSemaKinds.td vendor/llvm-project/release-11.x/clang/lib/AST/ASTContext.cpp vendor/llvm-project/release-11.x/clang/lib/AST/DeclBase.cpp vendor/llvm-project/release-11.x/clang/lib/AST/ItaniumMangle.cpp vendor/llvm-project/release-11.x/clang/lib/Basic/Targets.cpp vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGDebugInfo.cpp vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntime.cpp vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntime.h vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp vendor/llvm-project/release-11.x/clang/lib/CodeGen/CodeGenTypes.cpp vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/Arch/Sparc.cpp vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/Clang.cpp vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/OpenBSD.cpp vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/OpenBSD.h vendor/llvm-project/release-11.x/clang/lib/Format/TokenAnnotator.cpp vendor/llvm-project/release-11.x/clang/lib/Frontend/InitHeaderSearch.cpp vendor/llvm-project/release-11.x/clang/lib/Headers/altivec.h vendor/llvm-project/release-11.x/clang/lib/Sema/SemaChecking.cpp vendor/llvm-project/release-11.x/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp vendor/llvm-project/release-11.x/clang/lib/Sema/SemaType.cpp vendor/llvm-project/release-11.x/clang/lib/Serialization/ASTReaderDecl.cpp vendor/llvm-project/release-11.x/clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp vendor/llvm-project/release-11.x/clang/lib/StaticAnalyzer/Core/DynamicType.cpp vendor/llvm-project/release-11.x/compiler-rt/lib/builtins/clear_cache.c vendor/llvm-project/release-11.x/compiler-rt/lib/builtins/cpu_model.c vendor/llvm-project/release-11.x/compiler-rt/lib/profile/GCDAProfiling.c vendor/llvm-project/release-11.x/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h vendor/llvm-project/release-11.x/libunwind/src/AddressSpace.hpp vendor/llvm-project/release-11.x/lld/COFF/Writer.cpp vendor/llvm-project/release-11.x/lld/ELF/DWARF.cpp vendor/llvm-project/release-11.x/lld/ELF/DWARF.h vendor/llvm-project/release-11.x/lld/ELF/LinkerScript.cpp vendor/llvm-project/release-11.x/lld/ELF/LinkerScript.h vendor/llvm-project/release-11.x/lld/ELF/OutputSections.cpp vendor/llvm-project/release-11.x/lld/ELF/SyntheticSections.cpp vendor/llvm-project/release-11.x/lld/docs/ELF/linker_script.rst vendor/llvm-project/release-11.x/lld/docs/ReleaseNotes.rst vendor/llvm-project/release-11.x/lldb/source/Target/Target.cpp vendor/llvm-project/release-11.x/llvm/include/llvm/ADT/CoalescingBitVector.h vendor/llvm-project/release-11.x/llvm/include/llvm/Analysis/InstructionSimplify.h vendor/llvm-project/release-11.x/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h vendor/llvm-project/release-11.x/llvm/include/llvm/IR/IRBuilder.h vendor/llvm-project/release-11.x/llvm/lib/Analysis/InstructionSimplify.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/MachineCopyPropagation.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/RegAllocFast.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp vendor/llvm-project/release-11.x/llvm/lib/CodeGen/TargetLoweringBase.cpp vendor/llvm-project/release-11.x/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp vendor/llvm-project/release-11.x/llvm/lib/IR/IRBuilder.cpp vendor/llvm-project/release-11.x/llvm/lib/IR/LegacyPassManager.cpp vendor/llvm-project/release-11.x/llvm/lib/Support/X86TargetParser.cpp vendor/llvm-project/release-11.x/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp vendor/llvm-project/release-11.x/llvm/lib/Target/AArch64/SVEInstrFormats.td vendor/llvm-project/release-11.x/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp vendor/llvm-project/release-11.x/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp vendor/llvm-project/release-11.x/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h vendor/llvm-project/release-11.x/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp vendor/llvm-project/release-11.x/llvm/lib/Target/PowerPC/PPCISelLowering.cpp vendor/llvm-project/release-11.x/llvm/lib/Target/PowerPC/PPCInstr64Bit.td vendor/llvm-project/release-11.x/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp vendor/llvm-project/release-11.x/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp vendor/llvm-project/release-11.x/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp Modified: vendor/llvm-project/release-11.x/clang/include/clang/AST/ASTContext.h ============================================================================== --- vendor/llvm-project/release-11.x/clang/include/clang/AST/ASTContext.h Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/include/clang/AST/ASTContext.h Tue Sep 15 18:55:37 2020 (r365757) @@ -60,6 +60,7 @@ #include "llvm/Support/Allocator.h" #include "llvm/Support/Casting.h" #include "llvm/Support/Compiler.h" +#include "llvm/Support/TypeSize.h" #include #include #include @@ -1296,6 +1297,21 @@ class ASTContext : public RefCountedBase { /// Returns a vla type where known sizes are replaced with [*]. QualType getVariableArrayDecayedType(QualType Ty) const; + + // Convenience struct to return information about a builtin vector type. + struct BuiltinVectorTypeInfo { + QualType ElementType; + llvm::ElementCount EC; + unsigned NumVectors; + BuiltinVectorTypeInfo(QualType ElementType, llvm::ElementCount EC, + unsigned NumVectors) + : ElementType(ElementType), EC(EC), NumVectors(NumVectors) {} + }; + + /// Returns the element type, element count and number of vectors + /// (in case of tuple) for a builtin vector type. + BuiltinVectorTypeInfo + getBuiltinVectorTypeInfo(const BuiltinType *VecTy) const; /// Return the unique reference to a scalable vector type of the specified /// element type and scalable number of elements. Modified: vendor/llvm-project/release-11.x/clang/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- vendor/llvm-project/release-11.x/clang/include/clang/Basic/DiagnosticSemaKinds.td Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/include/clang/Basic/DiagnosticSemaKinds.td Tue Sep 15 18:55:37 2020 (r365757) @@ -6021,9 +6021,8 @@ def err_func_def_incomplete_result : Error< def err_atomic_specifier_bad_type : Error<"_Atomic cannot be applied to " "%select{incomplete |array |function |reference |atomic |qualified " - "|sizeless ||integer |integer }0type " - "%1 %select{|||||||which is not trivially copyable|with less than " - "1 byte of precision|with a non power of 2 precision}0">; + "|sizeless ||integer }0type " + "%1 %select{|||||||which is not trivially copyable|}0">; // Expressions. def ext_sizeof_alignof_function_type : Extension< @@ -7941,6 +7940,8 @@ def err_atomic_exclusive_builtin_pointer_size : Error< " 1,2,4 or 8 byte type (%0 invalid)">; def err_atomic_builtin_ext_int_size : Error< "Atomic memory operand must have a power-of-two size">; +def err_atomic_builtin_ext_int_prohibit : Error< + "argument to atomic builtin of type '_ExtInt' is not supported">; def err_atomic_op_needs_atomic : Error< "address argument to atomic operation must be a pointer to _Atomic " "type (%0 invalid)">; Modified: vendor/llvm-project/release-11.x/clang/lib/AST/ASTContext.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/AST/ASTContext.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/AST/ASTContext.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -3634,6 +3634,119 @@ QualType ASTContext::getIncompleteArrayType(QualType e return QualType(newType, 0); } +ASTContext::BuiltinVectorTypeInfo +ASTContext::getBuiltinVectorTypeInfo(const BuiltinType *Ty) const { +#define SVE_INT_ELTTY(BITS, ELTS, SIGNED, NUMVECTORS) \ + {getIntTypeForBitwidth(BITS, SIGNED), llvm::ElementCount(ELTS, true), \ + NUMVECTORS}; + +#define SVE_ELTTY(ELTTY, ELTS, NUMVECTORS) \ + {ELTTY, llvm::ElementCount(ELTS, true), NUMVECTORS}; + + switch (Ty->getKind()) { + default: + llvm_unreachable("Unsupported builtin vector type"); + case BuiltinType::SveInt8: + return SVE_INT_ELTTY(8, 16, true, 1); + case BuiltinType::SveUint8: + return SVE_INT_ELTTY(8, 16, false, 1); + case BuiltinType::SveInt8x2: + return SVE_INT_ELTTY(8, 16, true, 2); + case BuiltinType::SveUint8x2: + return SVE_INT_ELTTY(8, 16, false, 2); + case BuiltinType::SveInt8x3: + return SVE_INT_ELTTY(8, 16, true, 3); + case BuiltinType::SveUint8x3: + return SVE_INT_ELTTY(8, 16, false, 3); + case BuiltinType::SveInt8x4: + return SVE_INT_ELTTY(8, 16, true, 4); + case BuiltinType::SveUint8x4: + return SVE_INT_ELTTY(8, 16, false, 4); + case BuiltinType::SveInt16: + return SVE_INT_ELTTY(16, 8, true, 1); + case BuiltinType::SveUint16: + return SVE_INT_ELTTY(16, 8, false, 1); + case BuiltinType::SveInt16x2: + return SVE_INT_ELTTY(16, 8, true, 2); + case BuiltinType::SveUint16x2: + return SVE_INT_ELTTY(16, 8, false, 2); + case BuiltinType::SveInt16x3: + return SVE_INT_ELTTY(16, 8, true, 3); + case BuiltinType::SveUint16x3: + return SVE_INT_ELTTY(16, 8, false, 3); + case BuiltinType::SveInt16x4: + return SVE_INT_ELTTY(16, 8, true, 4); + case BuiltinType::SveUint16x4: + return SVE_INT_ELTTY(16, 8, false, 4); + case BuiltinType::SveInt32: + return SVE_INT_ELTTY(32, 4, true, 1); + case BuiltinType::SveUint32: + return SVE_INT_ELTTY(32, 4, false, 1); + case BuiltinType::SveInt32x2: + return SVE_INT_ELTTY(32, 4, true, 2); + case BuiltinType::SveUint32x2: + return SVE_INT_ELTTY(32, 4, false, 2); + case BuiltinType::SveInt32x3: + return SVE_INT_ELTTY(32, 4, true, 3); + case BuiltinType::SveUint32x3: + return SVE_INT_ELTTY(32, 4, false, 3); + case BuiltinType::SveInt32x4: + return SVE_INT_ELTTY(32, 4, true, 4); + case BuiltinType::SveUint32x4: + return SVE_INT_ELTTY(32, 4, false, 4); + case BuiltinType::SveInt64: + return SVE_INT_ELTTY(64, 2, true, 1); + case BuiltinType::SveUint64: + return SVE_INT_ELTTY(64, 2, false, 1); + case BuiltinType::SveInt64x2: + return SVE_INT_ELTTY(64, 2, true, 2); + case BuiltinType::SveUint64x2: + return SVE_INT_ELTTY(64, 2, false, 2); + case BuiltinType::SveInt64x3: + return SVE_INT_ELTTY(64, 2, true, 3); + case BuiltinType::SveUint64x3: + return SVE_INT_ELTTY(64, 2, false, 3); + case BuiltinType::SveInt64x4: + return SVE_INT_ELTTY(64, 2, true, 4); + case BuiltinType::SveUint64x4: + return SVE_INT_ELTTY(64, 2, false, 4); + case BuiltinType::SveBool: + return SVE_ELTTY(BoolTy, 16, 1); + case BuiltinType::SveFloat16: + return SVE_ELTTY(HalfTy, 8, 1); + case BuiltinType::SveFloat16x2: + return SVE_ELTTY(HalfTy, 8, 2); + case BuiltinType::SveFloat16x3: + return SVE_ELTTY(HalfTy, 8, 3); + case BuiltinType::SveFloat16x4: + return SVE_ELTTY(HalfTy, 8, 4); + case BuiltinType::SveFloat32: + return SVE_ELTTY(FloatTy, 4, 1); + case BuiltinType::SveFloat32x2: + return SVE_ELTTY(FloatTy, 4, 2); + case BuiltinType::SveFloat32x3: + return SVE_ELTTY(FloatTy, 4, 3); + case BuiltinType::SveFloat32x4: + return SVE_ELTTY(FloatTy, 4, 4); + case BuiltinType::SveFloat64: + return SVE_ELTTY(DoubleTy, 2, 1); + case BuiltinType::SveFloat64x2: + return SVE_ELTTY(DoubleTy, 2, 2); + case BuiltinType::SveFloat64x3: + return SVE_ELTTY(DoubleTy, 2, 3); + case BuiltinType::SveFloat64x4: + return SVE_ELTTY(DoubleTy, 2, 4); + case BuiltinType::SveBFloat16: + return SVE_ELTTY(BFloat16Ty, 8, 1); + case BuiltinType::SveBFloat16x2: + return SVE_ELTTY(BFloat16Ty, 8, 2); + case BuiltinType::SveBFloat16x3: + return SVE_ELTTY(BFloat16Ty, 8, 3); + case BuiltinType::SveBFloat16x4: + return SVE_ELTTY(BFloat16Ty, 8, 4); + } +} + /// getScalableVectorType - Return the unique reference to a scalable vector /// type of the specified element type and size. VectorType must be a built-in /// type. Modified: vendor/llvm-project/release-11.x/clang/lib/AST/DeclBase.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/AST/DeclBase.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/AST/DeclBase.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -1487,6 +1487,13 @@ static bool shouldBeHidden(NamedDecl *D) { if (FD->isFunctionTemplateSpecialization()) return true; + // Hide destructors that are invalid. There should always be one destructor, + // but if it is an invalid decl, another one is created. We need to hide the + // invalid one from places that expect exactly one destructor, like the + // serialization code. + if (isa(D) && D->isInvalidDecl()) + return true; + return false; } Modified: vendor/llvm-project/release-11.x/clang/lib/AST/ItaniumMangle.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/AST/ItaniumMangle.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/AST/ItaniumMangle.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -3248,7 +3248,7 @@ static StringRef mangleAArch64VectorBase(const Builtin case BuiltinType::Double: return "Float64"; case BuiltinType::BFloat16: - return "BFloat16"; + return "Bfloat16"; default: llvm_unreachable("Unexpected vector element base type"); } Modified: vendor/llvm-project/release-11.x/clang/lib/Basic/Targets.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/Basic/Targets.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/Basic/Targets.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -409,8 +409,6 @@ TargetInfo *AllocateTarget(const llvm::Triple &Triple, return new SolarisTargetInfo(Triple, Opts); case llvm::Triple::NetBSD: return new NetBSDTargetInfo(Triple, Opts); - case llvm::Triple::OpenBSD: - return new OpenBSDTargetInfo(Triple, Opts); case llvm::Triple::RTEMS: return new RTEMSTargetInfo(Triple, Opts); default: @@ -424,8 +422,6 @@ TargetInfo *AllocateTarget(const llvm::Triple &Triple, return new LinuxTargetInfo(Triple, Opts); case llvm::Triple::NetBSD: return new NetBSDTargetInfo(Triple, Opts); - case llvm::Triple::OpenBSD: - return new OpenBSDTargetInfo(Triple, Opts); case llvm::Triple::RTEMS: return new RTEMSTargetInfo(Triple, Opts); default: Modified: vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGDebugInfo.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGDebugInfo.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGDebugInfo.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -719,23 +719,39 @@ llvm::DIType *CGDebugInfo::CreateType(const BuiltinTyp case BuiltinType::Id: \ return getOrCreateStructPtrType("opencl_" #ExtType, Id##Ty); #include "clang/Basic/OpenCLExtensionTypes.def" - // TODO: real support for SVE types requires more infrastructure - // to be added first. The types have a variable length and are - // represented in debug info as types whose length depends on a - // target-specific pseudo register. -#define SVE_TYPE(Name, Id, SingletonId) \ - case BuiltinType::Id: + +#define SVE_TYPE(Name, Id, SingletonId) case BuiltinType::Id: #include "clang/Basic/AArch64SVEACLETypes.def" - { - unsigned DiagID = CGM.getDiags().getCustomDiagID( - DiagnosticsEngine::Error, - "cannot yet generate debug info for SVE type '%0'"); - auto Name = BT->getName(CGM.getContext().getPrintingPolicy()); - CGM.getDiags().Report(DiagID) << Name; - // Return something safe. - return CreateType(cast(CGM.getContext().IntTy)); - } + { + ASTContext::BuiltinVectorTypeInfo Info = + CGM.getContext().getBuiltinVectorTypeInfo(BT); + unsigned NumElemsPerVG = (Info.EC.Min * Info.NumVectors) / 2; + // Debuggers can't extract 1bit from a vector, so will display a + // bitpattern for svbool_t instead. + if (Info.ElementType == CGM.getContext().BoolTy) { + NumElemsPerVG /= 8; + Info.ElementType = CGM.getContext().UnsignedCharTy; + } + + auto *LowerBound = + llvm::ConstantAsMetadata::get(llvm::ConstantInt::getSigned( + llvm::Type::getInt64Ty(CGM.getLLVMContext()), 0)); + SmallVector Expr( + {llvm::dwarf::DW_OP_constu, NumElemsPerVG, llvm::dwarf::DW_OP_bregx, + /* AArch64::VG */ 46, 0, llvm::dwarf::DW_OP_mul, + llvm::dwarf::DW_OP_constu, 1, llvm::dwarf::DW_OP_minus}); + auto *UpperBound = DBuilder.createExpression(Expr); + + llvm::Metadata *Subscript = DBuilder.getOrCreateSubrange( + /*count*/ nullptr, LowerBound, UpperBound, /*stride*/ nullptr); + llvm::DINodeArray SubscriptArray = DBuilder.getOrCreateArray(Subscript); + llvm::DIType *ElemTy = + getOrCreateType(Info.ElementType, TheCU->getFile()); + auto Align = getTypeAlignIfRequired(BT, CGM.getContext()); + return DBuilder.createVectorType(/*Size*/ 0, Align, ElemTy, + SubscriptArray); + } case BuiltinType::UChar: case BuiltinType::Char_U: Encoding = llvm::dwarf::DW_ATE_unsigned_char; Modified: vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntime.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntime.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntime.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -29,7 +29,6 @@ #include "llvm/ADT/SetOperations.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Bitcode/BitcodeReader.h" -#include "llvm/Frontend/OpenMP/OMPIRBuilder.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/GlobalValue.h" @@ -1064,23 +1063,6 @@ CGOpenMPRuntime::CGOpenMPRuntime(CodeGenModule &CGM, S StringRef Separator) : CGM(CGM), FirstSeparator(FirstSeparator), Separator(Separator), OMPBuilder(CGM.getModule()), OffloadEntriesInfoManager(CGM) { - ASTContext &C = CGM.getContext(); - RecordDecl *RD = C.buildImplicitRecord("ident_t"); - QualType KmpInt32Ty = C.getIntTypeForBitwidth(/*DestWidth=*/32, /*Signed=*/1); - RD->startDefinition(); - // reserved_1 - addFieldToRecordDecl(C, RD, KmpInt32Ty); - // flags - addFieldToRecordDecl(C, RD, KmpInt32Ty); - // reserved_2 - addFieldToRecordDecl(C, RD, KmpInt32Ty); - // reserved_3 - addFieldToRecordDecl(C, RD, KmpInt32Ty); - // psource - addFieldToRecordDecl(C, RD, C.VoidPtrTy); - RD->completeDefinition(); - IdentQTy = C.getRecordType(RD); - IdentTy = CGM.getTypes().ConvertRecordDeclType(RD); KmpCriticalNameTy = llvm::ArrayType::get(CGM.Int32Ty, /*NumElements*/ 8); // Initialize Types used in OpenMPIRBuilder from OMPKinds.def @@ -1397,39 +1379,6 @@ createConstantGlobalStructAndAddToParent(CodeGenModule Fields.finishAndAddTo(Parent); } -Address CGOpenMPRuntime::getOrCreateDefaultLocation(unsigned Flags) { - CharUnits Align = CGM.getContext().getTypeAlignInChars(IdentQTy); - unsigned Reserved2Flags = getDefaultLocationReserved2Flags(); - FlagsTy FlagsKey(Flags, Reserved2Flags); - llvm::Value *Entry = OpenMPDefaultLocMap.lookup(FlagsKey); - if (!Entry) { - if (!DefaultOpenMPPSource) { - // Initialize default location for psource field of ident_t structure of - // all ident_t objects. Format is ";file;function;line;column;;". - // Taken from - // https://github.com/llvm/llvm-project/blob/master/openmp/runtime/src/kmp_str.cpp - DefaultOpenMPPSource = - CGM.GetAddrOfConstantCString(";unknown;unknown;0;0;;").getPointer(); - DefaultOpenMPPSource = - llvm::ConstantExpr::getBitCast(DefaultOpenMPPSource, CGM.Int8PtrTy); - } - - llvm::Constant *Data[] = { - llvm::ConstantInt::getNullValue(CGM.Int32Ty), - llvm::ConstantInt::get(CGM.Int32Ty, Flags), - llvm::ConstantInt::get(CGM.Int32Ty, Reserved2Flags), - llvm::ConstantInt::getNullValue(CGM.Int32Ty), DefaultOpenMPPSource}; - llvm::GlobalValue *DefaultOpenMPLocation = - createGlobalStruct(CGM, IdentQTy, isDefaultLocationConstant(), Data, "", - llvm::GlobalValue::PrivateLinkage); - DefaultOpenMPLocation->setUnnamedAddr( - llvm::GlobalValue::UnnamedAddr::Global); - - OpenMPDefaultLocMap[FlagsKey] = Entry = DefaultOpenMPLocation; - } - return Address(Entry, Align); -} - void CGOpenMPRuntime::setLocThreadIdInsertPt(CodeGenFunction &CGF, bool AtCurrentPoint) { auto &Elem = OpenMPLocThreadIDMap.FindAndConstruct(CGF.CurFn); @@ -1458,62 +1407,24 @@ void CGOpenMPRuntime::clearLocThreadIdInsertPt(CodeGen llvm::Value *CGOpenMPRuntime::emitUpdateLocation(CodeGenFunction &CGF, SourceLocation Loc, unsigned Flags) { - Flags |= OMP_IDENT_KMPC; - // If no debug info is generated - return global default location. + llvm::Constant *SrcLocStr; if (CGM.getCodeGenOpts().getDebugInfo() == codegenoptions::NoDebugInfo || - Loc.isInvalid()) - return getOrCreateDefaultLocation(Flags).getPointer(); - - assert(CGF.CurFn && "No function in current CodeGenFunction."); - - CharUnits Align = CGM.getContext().getTypeAlignInChars(IdentQTy); - Address LocValue = Address::invalid(); - auto I = OpenMPLocThreadIDMap.find(CGF.CurFn); - if (I != OpenMPLocThreadIDMap.end()) - LocValue = Address(I->second.DebugLoc, Align); - - // OpenMPLocThreadIDMap may have null DebugLoc and non-null ThreadID, if - // GetOpenMPThreadID was called before this routine. - if (!LocValue.isValid()) { - // Generate "ident_t .kmpc_loc.addr;" - Address AI = CGF.CreateMemTemp(IdentQTy, ".kmpc_loc.addr"); - auto &Elem = OpenMPLocThreadIDMap.FindAndConstruct(CGF.CurFn); - Elem.second.DebugLoc = AI.getPointer(); - LocValue = AI; - - if (!Elem.second.ServiceInsertPt) - setLocThreadIdInsertPt(CGF); - CGBuilderTy::InsertPointGuard IPG(CGF.Builder); - CGF.Builder.SetInsertPoint(Elem.second.ServiceInsertPt); - CGF.Builder.CreateMemCpy(LocValue, getOrCreateDefaultLocation(Flags), - CGF.getTypeSize(IdentQTy)); - } - - // char **psource = &.kmpc_loc_.addr.psource; - LValue Base = CGF.MakeAddrLValue(LocValue, IdentQTy); - auto Fields = cast(IdentQTy->getAsTagDecl())->field_begin(); - LValue PSource = - CGF.EmitLValueForField(Base, *std::next(Fields, IdentField_PSource)); - - llvm::Value *OMPDebugLoc = OpenMPDebugLocMap.lookup(Loc.getRawEncoding()); - if (OMPDebugLoc == nullptr) { - SmallString<128> Buffer2; - llvm::raw_svector_ostream OS2(Buffer2); - // Build debug location - PresumedLoc PLoc = CGF.getContext().getSourceManager().getPresumedLoc(Loc); - OS2 << ";" << PLoc.getFilename() << ";"; + Loc.isInvalid()) { + SrcLocStr = OMPBuilder.getOrCreateDefaultSrcLocStr(); + } else { + std::string FunctionName = ""; if (const auto *FD = dyn_cast_or_null(CGF.CurFuncDecl)) - OS2 << FD->getQualifiedNameAsString(); - OS2 << ";" << PLoc.getLine() << ";" << PLoc.getColumn() << ";;"; - OMPDebugLoc = CGF.Builder.CreateGlobalStringPtr(OS2.str()); - OpenMPDebugLocMap[Loc.getRawEncoding()] = OMPDebugLoc; + FunctionName = FD->getQualifiedNameAsString(); + PresumedLoc PLoc = CGF.getContext().getSourceManager().getPresumedLoc(Loc); + const char *FileName = PLoc.getFilename(); + unsigned Line = PLoc.getLine(); + unsigned Column = PLoc.getColumn(); + SrcLocStr = OMPBuilder.getOrCreateSrcLocStr(FunctionName.c_str(), FileName, + Line, Column); } - // *psource = ";;;;;;"; - CGF.EmitStoreOfScalar(OMPDebugLoc, PSource); - - // Our callers always pass this to a runtime function, so for - // convenience, go ahead and return a naked pointer. - return LocValue.getPointer(); + unsigned Reserved2Flags = getDefaultLocationReserved2Flags(); + return OMPBuilder.getOrCreateIdent(SrcLocStr, llvm::omp::IdentFlag(Flags), + Reserved2Flags); } llvm::Value *CGOpenMPRuntime::getThreadID(CodeGenFunction &CGF, @@ -1595,7 +1506,7 @@ void CGOpenMPRuntime::functionFinished(CodeGenFunction } llvm::Type *CGOpenMPRuntime::getIdentTyPointerTy() { - return IdentTy->getPointerTo(); + return OMPBuilder.IdentPtr; } llvm::Type *CGOpenMPRuntime::getKmpc_MicroPointerTy() { @@ -7354,6 +7265,8 @@ class MappableExprsHandler { (private) // &p, &p, sizeof(float*), TARGET_PARAM | TO | FROM // // map(p[1:24]) + // &p, &p[1], 24*sizeof(float), TARGET_PARAM | TO | FROM | PTR_AND_OBJ + // in unified shared memory mode or for local pointers // p, &p[1], 24*sizeof(float), TARGET_PARAM | TO | FROM // // map(s) @@ -7489,6 +7402,7 @@ class MappableExprsHandler { (private) // Track if the map information being generated is the first for a list of // components. bool IsExpressionFirstInfo = true; + bool FirstPointerInComplexData = false; Address BP = Address::invalid(); const Expr *AssocExpr = I->getAssociatedExpression(); const auto *AE = dyn_cast(AssocExpr); @@ -7531,10 +7445,15 @@ class MappableExprsHandler { (private) QualType Ty = I->getAssociatedDeclaration()->getType().getNonReferenceType(); if (Ty->isAnyPointerType() && std::next(I) != CE) { - BP = CGF.EmitLoadOfPointer(BP, Ty->castAs()); - - // We do not need to generate individual map information for the - // pointer, it can be associated with the combined storage. + // No need to generate individual map information for the pointer, it + // can be associated with the combined storage if shared memory mode is + // active or the base declaration is not global variable. + const auto *VD = dyn_cast(I->getAssociatedDeclaration()); + if (CGF.CGM.getOpenMPRuntime().hasRequiresUnifiedSharedMemory() || + !VD || VD->hasLocalStorage()) + BP = CGF.EmitLoadOfPointer(BP, Ty->castAs()); + else + FirstPointerInComplexData = IsCaptureFirstInfo; ++I; } } @@ -7570,8 +7489,19 @@ class MappableExprsHandler { (private) EncounteredME = dyn_cast(I->getAssociatedExpression()); // If we encounter a PTR_AND_OBJ entry from now on it should be marked // as MEMBER_OF the parent struct. - if (EncounteredME) + if (EncounteredME) { ShouldBeMemberOf = true; + // Do not emit as complex pointer if this is actually not array-like + // expression. + if (FirstPointerInComplexData) { + QualType Ty = std::prev(I) + ->getAssociatedDeclaration() + ->getType() + .getNonReferenceType(); + BP = CGF.EmitLoadOfPointer(BP, Ty->castAs()); + FirstPointerInComplexData = false; + } + } } auto Next = std::next(I); @@ -7704,10 +7634,11 @@ class MappableExprsHandler { (private) // same expression except for the first one. We also need to signal // this map is the first one that relates with the current capture // (there is a set of entries for each capture). - OpenMPOffloadMappingFlags Flags = getMapTypeBits( - MapType, MapModifiers, IsImplicit, - !IsExpressionFirstInfo || RequiresReference, - IsCaptureFirstInfo && !RequiresReference); + OpenMPOffloadMappingFlags Flags = + getMapTypeBits(MapType, MapModifiers, IsImplicit, + !IsExpressionFirstInfo || RequiresReference || + FirstPointerInComplexData, + IsCaptureFirstInfo && !RequiresReference); if (!IsExpressionFirstInfo) { // If we have a PTR_AND_OBJ pair where the OBJ is a pointer as well, @@ -7765,6 +7696,7 @@ class MappableExprsHandler { (private) IsExpressionFirstInfo = false; IsCaptureFirstInfo = false; + FirstPointerInComplexData = false; } } } @@ -7995,6 +7927,10 @@ class MappableExprsHandler { (private) // emission of that entry until the whole struct has been processed. llvm::MapVector> DeferredInfo; + MapBaseValuesArrayTy UseDevicePtrBasePointers; + MapValuesArrayTy UseDevicePtrPointers; + MapValuesArrayTy UseDevicePtrSizes; + MapFlagsArrayTy UseDevicePtrTypes; for (const auto *C : CurExecDir->getClausesOfKind()) { @@ -8011,15 +7947,27 @@ class MappableExprsHandler { (private) // We potentially have map information for this declaration already. // Look for the first set of components that refer to it. if (It != Info.end()) { - auto CI = std::find_if( - It->second.begin(), It->second.end(), [VD](const MapInfo &MI) { - return MI.Components.back().getAssociatedDeclaration() == VD; - }); + auto *CI = llvm::find_if(It->second, [VD](const MapInfo &MI) { + return MI.Components.back().getAssociatedDeclaration() == VD; + }); // If we found a map entry, signal that the pointer has to be returned // and move on to the next declaration. + // Exclude cases where the base pointer is mapped as array subscript, + // array section or array shaping. The base address is passed as a + // pointer to base in this case and cannot be used as a base for + // use_device_ptr list item. if (CI != It->second.end()) { - CI->ReturnDevicePointer = true; - continue; + auto PrevCI = std::next(CI->Components.rbegin()); + const auto *VarD = dyn_cast(VD); + if (CGF.CGM.getOpenMPRuntime().hasRequiresUnifiedSharedMemory() || + isa(IE) || + !VD->getType().getNonReferenceType()->isPointerType() || + PrevCI == CI->Components.rend() || + isa(PrevCI->getAssociatedExpression()) || !VarD || + VarD->hasLocalStorage()) { + CI->ReturnDevicePointer = true; + continue; + } } } @@ -8040,10 +7988,12 @@ class MappableExprsHandler { (private) } else { llvm::Value *Ptr = CGF.EmitLoadOfScalar(CGF.EmitLValue(IE), IE->getExprLoc()); - BasePointers.emplace_back(Ptr, VD); - Pointers.push_back(Ptr); - Sizes.push_back(llvm::Constant::getNullValue(CGF.Int64Ty)); - Types.push_back(OMP_MAP_RETURN_PARAM | OMP_MAP_TARGET_PARAM); + UseDevicePtrBasePointers.emplace_back(Ptr, VD); + UseDevicePtrPointers.push_back(Ptr); + UseDevicePtrSizes.push_back( + llvm::Constant::getNullValue(CGF.Int64Ty)); + UseDevicePtrTypes.push_back(OMP_MAP_RETURN_PARAM | + OMP_MAP_TARGET_PARAM); } } } @@ -8104,10 +8054,12 @@ class MappableExprsHandler { (private) Ptr = CGF.EmitLValue(IE).getPointer(CGF); else Ptr = CGF.EmitScalarExpr(IE); - BasePointers.emplace_back(Ptr, VD); - Pointers.push_back(Ptr); - Sizes.push_back(llvm::Constant::getNullValue(CGF.Int64Ty)); - Types.push_back(OMP_MAP_RETURN_PARAM | OMP_MAP_TARGET_PARAM); + UseDevicePtrBasePointers.emplace_back(Ptr, VD); + UseDevicePtrPointers.push_back(Ptr); + UseDevicePtrSizes.push_back( + llvm::Constant::getNullValue(CGF.Int64Ty)); + UseDevicePtrTypes.push_back(OMP_MAP_RETURN_PARAM | + OMP_MAP_TARGET_PARAM); } } } @@ -8197,6 +8149,12 @@ class MappableExprsHandler { (private) Sizes.append(CurSizes.begin(), CurSizes.end()); Types.append(CurTypes.begin(), CurTypes.end()); } + // Append data for use_device_ptr clauses. + BasePointers.append(UseDevicePtrBasePointers.begin(), + UseDevicePtrBasePointers.end()); + Pointers.append(UseDevicePtrPointers.begin(), UseDevicePtrPointers.end()); + Sizes.append(UseDevicePtrSizes.begin(), UseDevicePtrSizes.end()); + Types.append(UseDevicePtrTypes.begin(), UseDevicePtrTypes.end()); } /// Generate all the base pointers, section pointers, sizes and map types for Modified: vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntime.h ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntime.h Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntime.h Tue Sep 15 18:55:37 2020 (r365757) @@ -374,17 +374,7 @@ class CGOpenMPRuntime { (protected) private: /// An OpenMP-IR-Builder instance. llvm::OpenMPIRBuilder OMPBuilder; - /// Default const ident_t object used for initialization of all other - /// ident_t objects. - llvm::Constant *DefaultOpenMPPSource = nullptr; - using FlagsTy = std::pair; - /// Map of flags and corresponding default locations. - using OpenMPDefaultLocMapTy = llvm::DenseMap; - OpenMPDefaultLocMapTy OpenMPDefaultLocMap; - Address getOrCreateDefaultLocation(unsigned Flags); - QualType IdentQTy; - llvm::StructType *IdentTy = nullptr; /// Map for SourceLocation and OpenMP runtime library debug locations. typedef llvm::DenseMap OpenMPDebugLocMapTy; OpenMPDebugLocMapTy OpenMPDebugLocMap; Modified: vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -2857,8 +2857,12 @@ static llvm::Value *castValueToType(CodeGenFunction &C Address CastItem = CGF.CreateMemTemp(CastTy); Address ValCastItem = CGF.Builder.CreatePointerBitCastOrAddrSpaceCast( CastItem, Val->getType()->getPointerTo(CastItem.getAddressSpace())); - CGF.EmitStoreOfScalar(Val, ValCastItem, /*Volatile=*/false, ValTy); - return CGF.EmitLoadOfScalar(CastItem, /*Volatile=*/false, CastTy, Loc); + CGF.EmitStoreOfScalar(Val, ValCastItem, /*Volatile=*/false, ValTy, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); + return CGF.EmitLoadOfScalar(CastItem, /*Volatile=*/false, CastTy, Loc, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); } /// This function creates calls to one of two shuffle functions to copy @@ -2945,9 +2949,14 @@ static void shuffleAndStore(CodeGenFunction &CGF, Addr ThenBB, ExitBB); CGF.EmitBlock(ThenBB); llvm::Value *Res = createRuntimeShuffleFunction( - CGF, CGF.EmitLoadOfScalar(Ptr, /*Volatile=*/false, IntType, Loc), + CGF, + CGF.EmitLoadOfScalar(Ptr, /*Volatile=*/false, IntType, Loc, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()), IntType, Offset, Loc); - CGF.EmitStoreOfScalar(Res, ElemPtr, /*Volatile=*/false, IntType); + CGF.EmitStoreOfScalar(Res, ElemPtr, /*Volatile=*/false, IntType, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); Address LocalPtr = Bld.CreateConstGEP(Ptr, 1); Address LocalElemPtr = Bld.CreateConstGEP(ElemPtr, 1); PhiSrc->addIncoming(LocalPtr.getPointer(), ThenBB); @@ -2956,9 +2965,14 @@ static void shuffleAndStore(CodeGenFunction &CGF, Addr CGF.EmitBlock(ExitBB); } else { llvm::Value *Res = createRuntimeShuffleFunction( - CGF, CGF.EmitLoadOfScalar(Ptr, /*Volatile=*/false, IntType, Loc), + CGF, + CGF.EmitLoadOfScalar(Ptr, /*Volatile=*/false, IntType, Loc, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()), IntType, Offset, Loc); - CGF.EmitStoreOfScalar(Res, ElemPtr, /*Volatile=*/false, IntType); + CGF.EmitStoreOfScalar(Res, ElemPtr, /*Volatile=*/false, IntType, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); Ptr = Bld.CreateConstGEP(Ptr, 1); ElemPtr = Bld.CreateConstGEP(ElemPtr, 1); } @@ -3112,12 +3126,14 @@ static void emitReductionListCopy( } else { switch (CGF.getEvaluationKind(Private->getType())) { case TEK_Scalar: { - llvm::Value *Elem = - CGF.EmitLoadOfScalar(SrcElementAddr, /*Volatile=*/false, - Private->getType(), Private->getExprLoc()); + llvm::Value *Elem = CGF.EmitLoadOfScalar( + SrcElementAddr, /*Volatile=*/false, Private->getType(), + Private->getExprLoc(), LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); // Store the source element value to the dest element address. - CGF.EmitStoreOfScalar(Elem, DestElementAddr, /*Volatile=*/false, - Private->getType()); + CGF.EmitStoreOfScalar( + Elem, DestElementAddr, /*Volatile=*/false, Private->getType(), + LValueBaseInfo(AlignmentSource::Type), TBAAAccessInfo()); break; } case TEK_Complex: { @@ -3260,8 +3276,9 @@ static llvm::Value *emitInterWarpCopyFunction(CodeGenM Address AddrReduceListArg = CGF.GetAddrOfLocalVar(&ReduceListArg); Address LocalReduceList( Bld.CreatePointerBitCastOrAddrSpaceCast( - CGF.EmitLoadOfScalar(AddrReduceListArg, /*Volatile=*/false, - C.VoidPtrTy, Loc), + CGF.EmitLoadOfScalar( + AddrReduceListArg, /*Volatile=*/false, C.VoidPtrTy, Loc, + LValueBaseInfo(AlignmentSource::Type), TBAAAccessInfo()), CGF.ConvertTypeForMem(ReductionArrayTy)->getPointerTo()), CGF.getPointerAlign()); @@ -3339,10 +3356,13 @@ static llvm::Value *emitInterWarpCopyFunction(CodeGenM // elem = *elemptr //*MediumPtr = elem - llvm::Value *Elem = - CGF.EmitLoadOfScalar(ElemPtr, /*Volatile=*/false, CType, Loc); + llvm::Value *Elem = CGF.EmitLoadOfScalar( + ElemPtr, /*Volatile=*/false, CType, Loc, + LValueBaseInfo(AlignmentSource::Type), TBAAAccessInfo()); // Store the source element value to the dest element address. - CGF.EmitStoreOfScalar(Elem, MediumPtr, /*Volatile=*/true, CType); + CGF.EmitStoreOfScalar(Elem, MediumPtr, /*Volatile=*/true, CType, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); Bld.CreateBr(MergeBB); @@ -3722,8 +3742,9 @@ static llvm::Value *emitListToGlobalCopyFunction( GlobLVal.setAddress(Address(BufferPtr, GlobLVal.getAlignment())); switch (CGF.getEvaluationKind(Private->getType())) { case TEK_Scalar: { - llvm::Value *V = CGF.EmitLoadOfScalar(ElemPtr, /*Volatile=*/false, - Private->getType(), Loc); + llvm::Value *V = CGF.EmitLoadOfScalar( + ElemPtr, /*Volatile=*/false, Private->getType(), Loc, + LValueBaseInfo(AlignmentSource::Type), TBAAAccessInfo()); CGF.EmitStoreOfScalar(V, GlobLVal); break; } @@ -3926,7 +3947,9 @@ static llvm::Value *emitGlobalToListCopyFunction( switch (CGF.getEvaluationKind(Private->getType())) { case TEK_Scalar: { llvm::Value *V = CGF.EmitLoadOfScalar(GlobLVal, Loc); - CGF.EmitStoreOfScalar(V, ElemPtr, /*Volatile=*/false, Private->getType()); + CGF.EmitStoreOfScalar(V, ElemPtr, /*Volatile=*/false, Private->getType(), + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); break; } case TEK_Complex: { Modified: vendor/llvm-project/release-11.x/clang/lib/CodeGen/CodeGenTypes.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/CodeGen/CodeGenTypes.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/CodeGen/CodeGenTypes.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -533,99 +533,60 @@ llvm::Type *CodeGenTypes::ConvertType(QualType T) { case BuiltinType::OCLReserveID: ResultType = CGM.getOpenCLRuntime().convertOpenCLSpecificType(Ty); break; -#define GET_SVE_INT_VEC(BITS, ELTS) \ - llvm::ScalableVectorType::get( \ - llvm::IntegerType::get(getLLVMContext(), BITS), ELTS); case BuiltinType::SveInt8: case BuiltinType::SveUint8: - return GET_SVE_INT_VEC(8, 16); case BuiltinType::SveInt8x2: case BuiltinType::SveUint8x2: - return GET_SVE_INT_VEC(8, 32); case BuiltinType::SveInt8x3: case BuiltinType::SveUint8x3: - return GET_SVE_INT_VEC(8, 48); case BuiltinType::SveInt8x4: case BuiltinType::SveUint8x4: - return GET_SVE_INT_VEC(8, 64); case BuiltinType::SveInt16: case BuiltinType::SveUint16: - return GET_SVE_INT_VEC(16, 8); case BuiltinType::SveInt16x2: case BuiltinType::SveUint16x2: - return GET_SVE_INT_VEC(16, 16); case BuiltinType::SveInt16x3: case BuiltinType::SveUint16x3: - return GET_SVE_INT_VEC(16, 24); case BuiltinType::SveInt16x4: case BuiltinType::SveUint16x4: - return GET_SVE_INT_VEC(16, 32); case BuiltinType::SveInt32: case BuiltinType::SveUint32: - return GET_SVE_INT_VEC(32, 4); case BuiltinType::SveInt32x2: case BuiltinType::SveUint32x2: - return GET_SVE_INT_VEC(32, 8); case BuiltinType::SveInt32x3: case BuiltinType::SveUint32x3: - return GET_SVE_INT_VEC(32, 12); case BuiltinType::SveInt32x4: case BuiltinType::SveUint32x4: - return GET_SVE_INT_VEC(32, 16); case BuiltinType::SveInt64: case BuiltinType::SveUint64: - return GET_SVE_INT_VEC(64, 2); case BuiltinType::SveInt64x2: case BuiltinType::SveUint64x2: - return GET_SVE_INT_VEC(64, 4); case BuiltinType::SveInt64x3: case BuiltinType::SveUint64x3: - return GET_SVE_INT_VEC(64, 6); case BuiltinType::SveInt64x4: case BuiltinType::SveUint64x4: - return GET_SVE_INT_VEC(64, 8); case BuiltinType::SveBool: - return GET_SVE_INT_VEC(1, 16); -#undef GET_SVE_INT_VEC -#define GET_SVE_FP_VEC(TY, ISFP16, ELTS) \ - llvm::ScalableVectorType::get( \ - getTypeForFormat(getLLVMContext(), \ - Context.getFloatTypeSemantics(Context.TY), \ - /* UseNativeHalf = */ ISFP16), \ - ELTS); case BuiltinType::SveFloat16: - return GET_SVE_FP_VEC(HalfTy, true, 8); case BuiltinType::SveFloat16x2: - return GET_SVE_FP_VEC(HalfTy, true, 16); case BuiltinType::SveFloat16x3: - return GET_SVE_FP_VEC(HalfTy, true, 24); case BuiltinType::SveFloat16x4: - return GET_SVE_FP_VEC(HalfTy, true, 32); case BuiltinType::SveFloat32: - return GET_SVE_FP_VEC(FloatTy, false, 4); case BuiltinType::SveFloat32x2: - return GET_SVE_FP_VEC(FloatTy, false, 8); case BuiltinType::SveFloat32x3: - return GET_SVE_FP_VEC(FloatTy, false, 12); case BuiltinType::SveFloat32x4: - return GET_SVE_FP_VEC(FloatTy, false, 16); case BuiltinType::SveFloat64: - return GET_SVE_FP_VEC(DoubleTy, false, 2); case BuiltinType::SveFloat64x2: - return GET_SVE_FP_VEC(DoubleTy, false, 4); case BuiltinType::SveFloat64x3: - return GET_SVE_FP_VEC(DoubleTy, false, 6); case BuiltinType::SveFloat64x4: - return GET_SVE_FP_VEC(DoubleTy, false, 8); case BuiltinType::SveBFloat16: - return GET_SVE_FP_VEC(BFloat16Ty, false, 8); case BuiltinType::SveBFloat16x2: - return GET_SVE_FP_VEC(BFloat16Ty, false, 16); case BuiltinType::SveBFloat16x3: - return GET_SVE_FP_VEC(BFloat16Ty, false, 24); - case BuiltinType::SveBFloat16x4: - return GET_SVE_FP_VEC(BFloat16Ty, false, 32); -#undef GET_SVE_FP_VEC + case BuiltinType::SveBFloat16x4: { + ASTContext::BuiltinVectorTypeInfo Info = + Context.getBuiltinVectorTypeInfo(cast(Ty)); + return llvm::ScalableVectorType::get(ConvertType(Info.ElementType), + Info.EC.Min * Info.NumVectors); + } case BuiltinType::Dependent: #define BUILTIN_TYPE(Id, SingletonId) #define PLACEHOLDER_TYPE(Id, SingletonId) \ Modified: vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/Arch/Sparc.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/Arch/Sparc.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/Arch/Sparc.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -21,12 +21,19 @@ using namespace llvm::opt; const char *sparc::getSparcAsmModeForCPU(StringRef Name, const llvm::Triple &Triple) { if (Triple.getArch() == llvm::Triple::sparcv9) { + const char *DefV9CPU; + + if (Triple.isOSLinux() || Triple.isOSFreeBSD() || Triple.isOSOpenBSD()) + DefV9CPU = "-Av9a"; + else + DefV9CPU = "-Av9"; + return llvm::StringSwitch(Name) .Case("niagara", "-Av9b") .Case("niagara2", "-Av9b") .Case("niagara3", "-Av9d") .Case("niagara4", "-Av9d") - .Default("-Av9"); + .Default(DefV9CPU); } else { return llvm::StringSwitch(Name) .Case("v8", "-Av8") Modified: vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/Clang.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/Clang.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/Clang.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -498,7 +498,7 @@ static codegenoptions::DebugInfoKind DebugLevelToInfoK return codegenoptions::DebugLineTablesOnly; if (A.getOption().matches(options::OPT_gline_directives_only)) return codegenoptions::DebugDirectivesOnly; - return codegenoptions::DebugInfoConstructor; + return codegenoptions::LimitedDebugInfo; } static bool mustUseNonLeafFramePointerForTarget(const llvm::Triple &Triple) { @@ -2380,7 +2380,7 @@ static void CollectArgsForIntegratedAssembler(Compilat CmdArgs.push_back(Value.data()); } else { RenderDebugEnablingArgs(Args, CmdArgs, - codegenoptions::DebugInfoConstructor, + codegenoptions::LimitedDebugInfo, DwarfVersion, llvm::DebuggerKind::Default); } } else if (Value.startswith("-mcpu") || Value.startswith("-mfpu") || @@ -3653,7 +3653,7 @@ static void RenderDebugOptions(const ToolChain &TC, co if (const Arg *A = Args.getLastArg(options::OPT_g_Group, options::OPT_gsplit_dwarf, options::OPT_gsplit_dwarf_EQ)) { - DebugInfoKind = codegenoptions::DebugInfoConstructor; + DebugInfoKind = codegenoptions::LimitedDebugInfo; // If the last option explicitly specified a debug-info level, use it. if (checkDebugInfoOption(A, Args, D, TC) && @@ -3758,7 +3758,7 @@ static void RenderDebugOptions(const ToolChain &TC, co if (checkDebugInfoOption(A, Args, D, TC)) { if (DebugInfoKind != codegenoptions::DebugLineTablesOnly && DebugInfoKind != codegenoptions::DebugDirectivesOnly) { - DebugInfoKind = codegenoptions::DebugInfoConstructor; + DebugInfoKind = codegenoptions::LimitedDebugInfo; CmdArgs.push_back("-dwarf-ext-refs"); CmdArgs.push_back("-fmodule-format=obj"); } @@ -3778,9 +3778,7 @@ static void RenderDebugOptions(const ToolChain &TC, co TC.GetDefaultStandaloneDebug()); if (const Arg *A = Args.getLastArg(options::OPT_fstandalone_debug)) (void)checkDebugInfoOption(A, Args, D, TC); - if ((DebugInfoKind == codegenoptions::LimitedDebugInfo || - DebugInfoKind == codegenoptions::DebugInfoConstructor) && - NeedFullDebug) + if (DebugInfoKind == codegenoptions::LimitedDebugInfo && NeedFullDebug) DebugInfoKind = codegenoptions::FullDebugInfo; if (Args.hasFlag(options::OPT_gembed_source, options::OPT_gno_embed_source, @@ -6566,7 +6564,7 @@ void Clang::AddClangCLArgs(const ArgList &Args, types: options::OPT_gline_tables_only)) { *EmitCodeView = true; if (DebugInfoArg->getOption().matches(options::OPT__SLASH_Z7)) - *DebugInfoKind = codegenoptions::DebugInfoConstructor; + *DebugInfoKind = codegenoptions::LimitedDebugInfo; else *DebugInfoKind = codegenoptions::DebugLineTablesOnly; } else { @@ -6863,7 +6861,7 @@ void ClangAs::ConstructJob(Compilation &C, const JobAc // the guard for source type, however there is a test which asserts // that some assembler invocation receives no -debug-info-kind, // and it's not clear whether that test is just overly restrictive. - DebugInfoKind = (WantDebug ? codegenoptions::DebugInfoConstructor + DebugInfoKind = (WantDebug ? codegenoptions::LimitedDebugInfo : codegenoptions::NoDebugInfo); // Add the -fdebug-compilation-dir flag if needed. addDebugCompDirArg(Args, CmdArgs, C.getDriver().getVFS()); Modified: vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/OpenBSD.cpp ============================================================================== --- vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/OpenBSD.cpp Tue Sep 15 17:13:29 2020 (r365756) +++ vendor/llvm-project/release-11.x/clang/lib/Driver/ToolChains/OpenBSD.cpp Tue Sep 15 18:55:37 2020 (r365757) @@ -10,10 +10,12 @@ #include "Arch/Mips.h" #include "Arch/Sparc.h" #include "CommonArgs.h" +#include "clang/Config/config.h" #include "clang/Driver/Compilation.h" #include "clang/Driver/Options.h" #include "clang/Driver/SanitizerArgs.h" #include "llvm/Option/ArgList.h" +#include "llvm/Support/Path.h" using namespace clang::driver; using namespace clang::driver::tools; @@ -41,15 +43,6 @@ void openbsd::Assembler::ConstructJob(Compilation &C, CmdArgs.push_back("-many"); break; - case llvm::Triple::sparc: - case llvm::Triple::sparcel: { - CmdArgs.push_back("-32"); - std::string CPU = getCPUName(Args, getToolChain().getTriple()); - CmdArgs.push_back(sparc::getSparcAsmModeForCPU(CPU, getToolChain().getTriple())); - AddAssemblerKPIC(getToolChain(), Args, CmdArgs); - break; - } - case llvm::Triple::sparcv9: { CmdArgs.push_back("-64"); std::string CPU = getCPUName(Args, getToolChain().getTriple()); @@ -256,6 +249,45 @@ OpenBSD::OpenBSD(const Driver &D, const llvm::Triple & getFilePaths().push_back(getDriver().SysRoot + "/usr/lib"); } +void OpenBSD::AddClangSystemIncludeArgs( + const llvm::opt::ArgList &DriverArgs, + llvm::opt::ArgStringList &CC1Args) const { + const Driver &D = getDriver(); + + if (DriverArgs.hasArg(clang::driver::options::OPT_nostdinc)) + return; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Sep 15 18:56:15 2020 Return-Path: Delivered-To: svn-src-all@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 541B73DCD8B; Tue, 15 Sep 2020 18:56:15 +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 4BrXWM1ZyVz4V11; Tue, 15 Sep 2020 18:56:15 +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 F3C27CF75; Tue, 15 Sep 2020 18:56:14 +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 08FIuECa040729; Tue, 15 Sep 2020 18:56:14 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FIuEn4040728; Tue, 15 Sep 2020 18:56:14 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009151856.08FIuEn4040728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 15 Sep 2020 18:56:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r365758 - vendor/llvm-project/llvmorg-11.0.0-rc2-91-g6e042866c30 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm-project/llvmorg-11.0.0-rc2-91-g6e042866c30 X-SVN-Commit-Revision: 365758 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 18:56:15 -0000 Author: dim Date: Tue Sep 15 18:56:14 2020 New Revision: 365758 URL: https://svnweb.freebsd.org/changeset/base/365758 Log: Tag llvm-project branch release/11.x llvmorg-11.0.0-rc2-91-g6e042866c30. Added: vendor/llvm-project/llvmorg-11.0.0-rc2-91-g6e042866c30/ - copied from r365757, vendor/llvm-project/release-11.x/ From owner-svn-src-all@freebsd.org Tue Sep 15 19:21:34 2020 Return-Path: Delivered-To: svn-src-all@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 6D6AA3DD50C; Tue, 15 Sep 2020 19:21:34 +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 4BrY4Z2Hrkz4Vw1; Tue, 15 Sep 2020 19:21:34 +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 3289ACEE2; Tue, 15 Sep 2020 19:21:34 +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 08FJLYwn055080; Tue, 15 Sep 2020 19:21:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FJLXCS055059; Tue, 15 Sep 2020 19:21:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009151921.08FJLXCS055059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 15 Sep 2020 19:21:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365759 - 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: 365759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 19:21:34 -0000 Author: markj Date: Tue Sep 15 19:21:33 2020 New Revision: 365759 URL: https://svnweb.freebsd.org/changeset/base/365759 Log: Update unix domain socket locking comments. - Define a locking key for unpcb members. - Rewrite some of the locking protocol description to make it less verbose and avoid referencing some subroutines which will be renamed. - Reorder includes. Reviewed by: glebius, kevans, kib Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26294 Modified: head/sys/kern/uipc_usrreq.c head/sys/sys/unpcb.h Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Tue Sep 15 18:56:14 2020 (r365758) +++ head/sys/kern/uipc_usrreq.c Tue Sep 15 19:21:33 2020 (r365759) @@ -65,13 +65,13 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include /* XXX must be before */ #include +#include #include #include #include #include +#include #include #include #include @@ -106,9 +106,7 @@ __FBSDID("$FreeBSD$"); MALLOC_DECLARE(M_FILECAPS); /* - * Locking key: - * (l) Locked using list lock - * (g) Locked using linkage lock + * See unpcb.h for the locking key. */ static uma_zone_t unp_zone; @@ -196,40 +194,31 @@ SYSCTL_INT(_net_local, OID_AUTO, deferred, CTLFLAG_RD, /* * Locking and synchronization: * - * Three types of locks exist in the local domain socket implementation: a - * a global linkage rwlock, the mtxpool lock, and per-unpcb mutexes. - * The linkage lock protects the socket count, global generation number, - * and stream/datagram global lists. + * Several types of locks exist in the local domain socket implementation: + * - a global linkage lock + * - a global connection list lock + * - the mtxpool lock + * - per-unpcb mutexes * - * The mtxpool lock protects the vnode from being modified while referenced. - * Lock ordering requires that it be acquired before any unpcb locks. + * The linkage lock protects the global socket lists, the generation number + * counter and garbage collector state. * - * The unpcb lock (unp_mtx) protects all fields in the unpcb. Of particular - * note is that this includes the unp_conn field. So long as the unpcb lock - * is held the reference to the unpcb pointed to by unp_conn is valid. If we - * require that the unpcb pointed to by unp_conn remain live in cases where - * we need to drop the unp_mtx as when we need to acquire the lock for a - * second unpcb the caller must first acquire an additional reference on the - * second unpcb and then revalidate any state (typically check that unp_conn - * is non-NULL) upon requiring the initial unpcb lock. The lock ordering - * between unpcbs is the conventional ascending address order. Two helper - * routines exist for this: + * The connection list lock protects the list of referring sockets in a datagram + * socket PCB. This lock is also overloaded to protect a global list of + * sockets whose buffers contain socket references in the form of SCM_RIGHTS + * messages. To avoid recursion, such references are released by a dedicated + * thread. * - * - unp_pcb_lock2(unp, unp2) - which just acquires the two locks in the - * safe ordering. + * The mtxpool lock protects the vnode from being modified while referenced. + * Lock ordering rules require that it be acquired before any PCB locks. * - * - unp_pcb_owned_lock2(unp, unp2, freed) - the lock for unp is held - * when called. If unp is unlocked and unp2 is subsequently freed - * freed will be set to 1. - * - * The helper routines for references are: - * - * - unp_pcb_hold(unp): Can be called any time we currently hold a valid - * reference to unp. - * - * - unp_pcb_rele(unp): The caller must hold the unp lock. If we are - * releasing the last reference, detach must have been called thus - * unp->unp_socket be NULL. + * The unpcb lock (unp_mtx) protects the most commonly referenced fields in the + * unpcb. This includes the unp_conn field, which either links two connected + * PCBs together (for connected socket types) or points at the destination + * socket (for connectionless socket types). The operations of creating or + * destroying a connection therefore involve locking multiple PCBs. To avoid + * lock order reversals, in some cases this involves dropping a PCB lock and + * using a reference counter to maintain liveness. * * UNIX domain sockets each have an unpcb hung off of their so_pcb pointer, * allocated in pru_attach() and freed in pru_detach(). The validity of that Modified: head/sys/sys/unpcb.h ============================================================================== --- head/sys/sys/unpcb.h Tue Sep 15 18:56:14 2020 (r365758) +++ head/sys/sys/unpcb.h Tue Sep 15 19:21:33 2020 (r365759) @@ -65,30 +65,37 @@ typedef uint64_t unp_gen_t; * Stream sockets keep copies of receive sockbuf sb_cc and sb_mbcnt * so that changes in the sockbuf may be computed to modify * back pressure on the sender accordingly. + * + * Locking key: + * (a) Atomic + * (c) Constant + * (g) Locked using linkage lock + * (l) Locked using list lock + * (p) Locked using pcb lock */ LIST_HEAD(unp_head, unpcb); struct unpcb { /* Cache line 1 */ - struct mtx unp_mtx; /* mutex */ - struct unpcb *unp_conn; /* control block of connected socket */ - volatile u_int unp_refcount; - short unp_flags; /* flags */ - short unp_gcflag; /* Garbage collector flags. */ - struct sockaddr_un *unp_addr; /* bound address of socket */ - struct socket *unp_socket; /* pointer back to socket */ + struct mtx unp_mtx; /* PCB mutex */ + struct unpcb *unp_conn; /* (p) connected socket */ + volatile u_int unp_refcount; /* (a, p) atomic refcount */ + short unp_flags; /* (p) PCB flags */ + short unp_gcflag; /* (g) Garbage collector flags */ + struct sockaddr_un *unp_addr; /* (p) bound address of socket */ + struct socket *unp_socket; /* (c) pointer back to socket */ /* Cache line 2 */ - struct vnode *unp_vnode; /* if associated with file */ - struct xucred unp_peercred; /* peer credentials, if applicable */ - LIST_ENTRY(unpcb) unp_reflink; /* link in unp_refs list */ - LIST_ENTRY(unpcb) unp_link; /* glue on list of all PCBs */ - struct unp_head unp_refs; /* referencing socket linked list */ - unp_gen_t unp_gencnt; /* generation count of this instance */ - struct file *unp_file; /* back-pointer to file for gc. */ - u_int unp_msgcount; /* references from message queue */ - u_int unp_gcrefs; /* garbage collector refcount */ - ino_t unp_ino; /* fake inode number */ - LIST_ENTRY(unpcb) unp_dead; /* link in dead list */ + struct vnode *unp_vnode; /* (p) associated file if applicable */ + struct xucred unp_peercred; /* (p) peer credentials if applicable */ + LIST_ENTRY(unpcb) unp_reflink; /* (l) link in unp_refs list */ + LIST_ENTRY(unpcb) unp_link; /* (g) glue on list of all PCBs */ + struct unp_head unp_refs; /* (l) referencing socket linked list */ + unp_gen_t unp_gencnt; /* (g) generation count of this item */ + struct file *unp_file; /* (g) back-pointer to file for gc */ + u_int unp_msgcount; /* (g) references from message queue */ + u_int unp_gcrefs; /* (g) garbage collector refcount */ + ino_t unp_ino; /* (g) fake inode number */ + LIST_ENTRY(unpcb) unp_dead; /* (g) link in dead list */ } __aligned(CACHE_LINE_SIZE); /* From owner-svn-src-all@freebsd.org Tue Sep 15 19:21:58 2020 Return-Path: Delivered-To: svn-src-all@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 EC73C3DD72F; Tue, 15 Sep 2020 19:21:58 +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 4BrY525wY9z4WR4; Tue, 15 Sep 2020 19:21:58 +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 AE7E9CEEB; Tue, 15 Sep 2020 19:21:58 +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 08FJLwWa056707; Tue, 15 Sep 2020 19:21:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FJLwCI056706; Tue, 15 Sep 2020 19:21:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009151921.08FJLwCI056706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 15 Sep 2020 19:21:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365760 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365760 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 19:21:59 -0000 Author: markj Date: Tue Sep 15 19:21:58 2020 New Revision: 365760 URL: https://svnweb.freebsd.org/changeset/base/365760 Log: Improve unix socket PCB refcounting. - Use refcount_init(). - Define an INVARIANTS-only zone destructor to assert that various bits of PCB state aren't left dangling. - Annotate unp_pcb_rele() with __result_use_check. - Simplify control flow. Reviewed by: glebius, kevans, kib Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26295 Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Tue Sep 15 19:21:33 2020 (r365759) +++ head/sys/kern/uipc_usrreq.c Tue Sep 15 19:21:58 2020 (r365760) @@ -313,25 +313,25 @@ static void unp_process_defers(void * __unused, int); static void unp_pcb_hold(struct unpcb *unp) { - MPASS(unp->unp_refcount); - refcount_acquire(&unp->unp_refcount); + u_int old __unused; + + old = refcount_acquire(&unp->unp_refcount); + KASSERT(old > 0, ("%s: unpcb %p has no references", __func__, unp)); } -static int +static __result_use_check bool unp_pcb_rele(struct unpcb *unp) { - int freed; + bool ret; UNP_PCB_LOCK_ASSERT(unp); - MPASS(unp->unp_refcount); - if ((freed = refcount_release(&unp->unp_refcount))) { - /* we got here with having detached? */ - MPASS(unp->unp_socket == NULL); + + if ((ret = refcount_release(&unp->unp_refcount))) { UNP_PCB_UNLOCK(unp); UNP_PCB_LOCK_DESTROY(unp); uma_zfree(unp_zone, unp); } - return (freed); + return (ret); } static void @@ -514,7 +514,7 @@ uipc_attach(struct socket *so, int proto, struct threa UNP_PCB_LOCK_INIT(unp); unp->unp_socket = so; so->so_pcb = unp; - unp->unp_refcount = 1; + refcount_init(&unp->unp_refcount, 1); if ((locked = UNP_LINK_WOWNED()) == false) UNP_LINK_WLOCK(); @@ -1814,7 +1814,7 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) struct unp_head *head; struct xunpcb *xu; u_int i; - int error, freeunp, n; + int error, n; switch ((intptr_t)arg1) { case SOCK_STREAM: @@ -1891,9 +1891,10 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) for (i = 0; i < n; i++) { unp = unp_list[i]; UNP_PCB_LOCK(unp); - freeunp = unp_pcb_rele(unp); + if (unp_pcb_rele(unp)) + continue; - if (freeunp == 0 && unp->unp_gencnt <= gencnt) { + if (unp->unp_gencnt <= gencnt) { xu->xu_len = sizeof *xu; xu->xu_unpp = (uintptr_t)unp; /* @@ -1920,8 +1921,9 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) sotoxsocket(unp->unp_socket, &xu->xu_socket); UNP_PCB_UNLOCK(unp); error = SYSCTL_OUT(req, xu, sizeof *xu); - } else if (freeunp == 0) + } else { UNP_PCB_UNLOCK(unp); + } } free(xu, M_TEMP); if (!error) { @@ -2137,18 +2139,44 @@ unp_zone_change(void *tag) uma_zone_set_max(unp_zone, maxsockets); } +#ifdef INVARIANTS static void +unp_zdtor(void *mem, int size __unused, void *arg __unused) +{ + struct unpcb *unp; + + unp = mem; + + KASSERT(LIST_EMPTY(&unp->unp_refs), + ("%s: unpcb %p has lingering refs", __func__, unp)); + KASSERT(unp->unp_socket == NULL, + ("%s: unpcb %p has socket backpointer", __func__, unp)); + KASSERT(unp->unp_vnode == NULL, + ("%s: unpcb %p has vnode references", __func__, unp)); + KASSERT(unp->unp_conn == NULL, + ("%s: unpcb %p is still connected", __func__, unp)); + KASSERT(unp->unp_addr == NULL, + ("%s: unpcb %p has leaked addr", __func__, unp)); +} +#endif + +static void unp_init(void) { + uma_dtor dtor; #ifdef VIMAGE if (!IS_DEFAULT_VNET(curvnet)) return; #endif - unp_zone = uma_zcreate("unpcb", sizeof(struct unpcb), NULL, NULL, + +#ifdef INVARIANTS + dtor = unp_zdtor; +#else + dtor = NULL; +#endif + unp_zone = uma_zcreate("unpcb", sizeof(struct unpcb), NULL, dtor, NULL, NULL, UMA_ALIGN_CACHE, 0); - if (unp_zone == NULL) - panic("unp_init"); uma_zone_set_max(unp_zone, maxsockets); uma_zone_set_warning(unp_zone, "kern.ipc.maxsockets limit reached"); EVENTHANDLER_REGISTER(maxsockets_change, unp_zone_change, From owner-svn-src-all@freebsd.org Tue Sep 15 19:22:17 2020 Return-Path: Delivered-To: svn-src-all@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 5D72E3DD61F; Tue, 15 Sep 2020 19:22:17 +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 4BrY5P1k54z4WGQ; Tue, 15 Sep 2020 19:22:17 +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 04517CEEF; Tue, 15 Sep 2020 19:22:17 +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 08FJMGEE059315; Tue, 15 Sep 2020 19:22:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FJMGch059314; Tue, 15 Sep 2020 19:22:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009151922.08FJMGch059314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 15 Sep 2020 19:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365761 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365761 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 19:22:17 -0000 Author: markj Date: Tue Sep 15 19:22:16 2020 New Revision: 365761 URL: https://svnweb.freebsd.org/changeset/base/365761 Log: Rename unp_pcb_lock2(). unp_pcb_lock_pair() seems like a better name. Also make it handle the case where the two sockets are the same instead of making callers do it. No functional change intended. Reviewed by: glebius, kevans, kib Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26296 Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Tue Sep 15 19:21:58 2020 (r365760) +++ head/sys/kern/uipc_usrreq.c Tue Sep 15 19:22:16 2020 (r365761) @@ -335,13 +335,15 @@ unp_pcb_rele(struct unpcb *unp) } static void -unp_pcb_lock2(struct unpcb *unp, struct unpcb *unp2) +unp_pcb_lock_pair(struct unpcb *unp, struct unpcb *unp2) { - MPASS(unp != unp2); UNP_PCB_UNLOCK_ASSERT(unp); UNP_PCB_UNLOCK_ASSERT(unp2); - if ((uintptr_t)unp2 > (uintptr_t)unp) { + + if (unp == unp2) { UNP_PCB_LOCK(unp); + } else if ((uintptr_t)unp2 > (uintptr_t)unp) { + UNP_PCB_LOCK(unp); UNP_PCB_LOCK(unp2); } else { UNP_PCB_LOCK(unp2); @@ -349,6 +351,14 @@ unp_pcb_lock2(struct unpcb *unp, struct unpcb *unp2) } } +static void +unp_pcb_unlock_pair(struct unpcb *unp, struct unpcb *unp2) +{ + UNP_PCB_UNLOCK(unp); + if (unp != unp2) + UNP_PCB_UNLOCK(unp2); +} + static __noinline void unp_pcb_owned_lock2_slowpath(struct unpcb *unp, struct unpcb **unp2p, int *freed) @@ -738,14 +748,9 @@ uipc_connect2(struct socket *so1, struct socket *so2) KASSERT(unp != NULL, ("uipc_connect2: unp == NULL")); unp2 = so2->so_pcb; KASSERT(unp2 != NULL, ("uipc_connect2: unp2 == NULL")); - if (unp != unp2) - unp_pcb_lock2(unp, unp2); - else - UNP_PCB_LOCK(unp); + unp_pcb_lock_pair(unp, unp2); error = unp_connect2(so1, so2, PRU_CONNECT2); - if (unp != unp2) - UNP_PCB_UNLOCK(unp2); - UNP_PCB_UNLOCK(unp); + unp_pcb_unlock_pair(unp, unp2); return (error); } @@ -1640,7 +1645,7 @@ unp_connectat(int fd, struct socket *so, struct sockad goto bad2; } unp3 = sotounpcb(so2); - unp_pcb_lock2(unp2, unp3); + unp_pcb_lock_pair(unp2, unp3); if (unp2->unp_addr != NULL) { bcopy(unp2->unp_addr, sa, unp2->unp_addr->sun_len); unp3->unp_addr = (struct sockaddr_un *) sa; @@ -1662,18 +1667,13 @@ unp_connectat(int fd, struct socket *so, struct sockad mac_socketpeer_set_from_socket(so2, so); #endif } else { - if (unp == unp2) - UNP_PCB_LOCK(unp); - else - unp_pcb_lock2(unp, unp2); + unp_pcb_lock_pair(unp, unp2); } KASSERT(unp2 != NULL && so2 != NULL && unp2->unp_socket == so2 && sotounpcb(so2) == unp2, ("%s: unp2 %p so2 %p", __func__, unp2, so2)); error = unp_connect2(so, so2, PRU_CONNECT); - if (unp != unp2) - UNP_PCB_UNLOCK(unp2); - UNP_PCB_UNLOCK(unp); + unp_pcb_unlock_pair(unp, unp2); bad2: mtx_unlock(vplock); bad: From owner-svn-src-all@freebsd.org Tue Sep 15 19:22:37 2020 Return-Path: Delivered-To: svn-src-all@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 E222E3DD62F; Tue, 15 Sep 2020 19:22:37 +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 4BrY5n5kYNz4WbC; Tue, 15 Sep 2020 19:22:37 +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 A8021D3D0; Tue, 15 Sep 2020 19:22:37 +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 08FJMbEU059374; Tue, 15 Sep 2020 19:22:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FJMbnU059373; Tue, 15 Sep 2020 19:22:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009151922.08FJMbnU059373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 15 Sep 2020 19:22:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365762 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365762 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 19:22:38 -0000 Author: markj Date: Tue Sep 15 19:22:37 2020 New Revision: 365762 URL: https://svnweb.freebsd.org/changeset/base/365762 Log: Simplify unp_disconnect() callers. In all cases, PCBs are unlocked after unp_disconnect() returns. Since unp_disconnect() may release the last PCB reference, callers may have to bump the refcount before the call just so that they can release them again. Change unp_disconnect() to release PCB locks as well as connection references; this lets us remove several refcount manipulations. Tighten assertions. Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26297 Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Tue Sep 15 19:22:16 2020 (r365761) +++ head/sys/kern/uipc_usrreq.c Tue Sep 15 19:22:37 2020 (r365762) @@ -335,6 +335,15 @@ unp_pcb_rele(struct unpcb *unp) } static void +unp_pcb_rele_notlast(struct unpcb *unp) +{ + bool ret __unused; + + ret = refcount_release(&unp->unp_refcount); + KASSERT(!ret, ("%s: unpcb %p has no references", __func__, unp)); +} + +static void unp_pcb_lock_pair(struct unpcb *unp, struct unpcb *unp2) { UNP_PCB_UNLOCK_ASSERT(unp); @@ -720,18 +729,14 @@ uipc_close(struct socket *so) unp->unp_vnode = NULL; } unp2 = unp->unp_conn; - unp_pcb_hold(unp); if (__predict_false(unp == unp2)) { unp_disconnect(unp, unp2); } else if (unp2 != NULL) { - unp_pcb_hold(unp2); unp_pcb_owned_lock2(unp, unp2, freed); unp_disconnect(unp, unp2); - if (unp_pcb_rele(unp2) == 0) - UNP_PCB_UNLOCK(unp2); - } - if (unp_pcb_rele(unp) == 0) + } else { UNP_PCB_UNLOCK(unp); + } if (vp) { mtx_unlock(vplock); vrele(vp); @@ -816,14 +821,11 @@ uipc_detach(struct socket *so) unp2 = NULL; } unp_pcb_hold(unp); - if (unp2 != NULL) { - unp_pcb_hold(unp2); + if (unp2 != NULL) unp_disconnect(unp, unp2); - if (unp_pcb_rele(unp2) == 0) - UNP_PCB_UNLOCK(unp2); - } + else + UNP_PCB_UNLOCK(unp); } - UNP_PCB_UNLOCK(unp); UNP_REF_LIST_LOCK(); while (!LIST_EMPTY(&unp->unp_refs)) { struct unpcb *ref = LIST_FIRST(&unp->unp_refs); @@ -876,14 +878,8 @@ uipc_disconnect(struct socket *so) UNP_PCB_UNLOCK(unp); return (0); } - unp_pcb_hold(unp2); } - unp_pcb_hold(unp); unp_disconnect(unp, unp2); - if (unp_pcb_rele(unp) == 0) - UNP_PCB_UNLOCK(unp); - if ((unp != unp2) && unp_pcb_rele(unp2) == 0) - UNP_PCB_UNLOCK(unp2); return (0); } @@ -1122,9 +1118,8 @@ uipc_send(struct socket *so, int flags, struct mbuf *m } if (nam != NULL) unp_disconnect(unp, unp2); - if (__predict_true(unp != unp2)) - UNP_PCB_UNLOCK(unp2); - UNP_PCB_UNLOCK(unp); + else + unp_pcb_unlock_pair(unp, unp2); break; } @@ -1756,23 +1751,29 @@ static void unp_disconnect(struct unpcb *unp, struct unpcb *unp2) { struct socket *so, *so2; - int freed __unused; +#ifdef INVARIANTS + struct unpcb *unptmp; +#endif - KASSERT(unp2 != NULL, ("unp_disconnect: unp2 == NULL")); - UNP_PCB_LOCK_ASSERT(unp); UNP_PCB_LOCK_ASSERT(unp2); + KASSERT(unp->unp_conn == unp2, + ("%s: unpcb %p is not connected to %p", __func__, unp, unp2)); - if (unp->unp_conn == NULL && unp2->unp_conn == NULL) - return; - - MPASS(unp->unp_conn == unp2); unp->unp_conn = NULL; so = unp->unp_socket; so2 = unp2->unp_socket; switch (unp->unp_socket->so_type) { case SOCK_DGRAM: UNP_REF_LIST_LOCK(); +#ifdef INVARIANTS + LIST_FOREACH(unptmp, &unp2->unp_refs, unp_reflink) { + if (unptmp == unp) + break; + } + KASSERT(unptmp != NULL, + ("%s: %p not found in reflist of %p", __func__, unp, unp2)); +#endif LIST_REMOVE(unp, unp_reflink); UNP_REF_LIST_UNLOCK(); if (so) { @@ -1792,10 +1793,17 @@ unp_disconnect(struct unpcb *unp, struct unpcb *unp2) soisdisconnected(so2); break; } - freed = unp_pcb_rele(unp); - MPASS(freed == 0); - freed = unp_pcb_rele(unp2); - MPASS(freed == 0); + + if (unp == unp2) { + unp_pcb_rele_notlast(unp); + if (!unp_pcb_rele(unp)) + UNP_PCB_UNLOCK(unp); + } else { + if (!unp_pcb_rele(unp)) + UNP_PCB_UNLOCK(unp); + if (!unp_pcb_rele(unp2)) + UNP_PCB_UNLOCK(unp2); + } } /* @@ -1991,17 +1999,17 @@ unp_drop(struct unpcb *unp) if (so) so->so_error = ECONNRESET; unp2 = unp->unp_conn; + /* Last reference dropped in unp_disconnect(). */ if (unp2 == unp) { + unp_pcb_rele_notlast(unp); unp_disconnect(unp, unp2); } else if (unp2 != NULL) { - unp_pcb_hold(unp2); unp_pcb_owned_lock2(unp, unp2, freed); + unp_pcb_rele_notlast(unp); unp_disconnect(unp, unp2); - if (unp_pcb_rele(unp2) == 0) - UNP_PCB_UNLOCK(unp2); - } - if (unp_pcb_rele(unp) == 0) + } else if (!unp_pcb_rele(unp)) { UNP_PCB_UNLOCK(unp); + } } static void From owner-svn-src-all@freebsd.org Tue Sep 15 19:23:01 2020 Return-Path: Delivered-To: svn-src-all@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 EC61C3DD4C7; Tue, 15 Sep 2020 19:23:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BrY6F61jFz4WnD; Tue, 15 Sep 2020 19:23:01 +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 B2035D3D4; Tue, 15 Sep 2020 19:23:01 +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 08FJN1x6059438; Tue, 15 Sep 2020 19:23:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FJN1hu059437; Tue, 15 Sep 2020 19:23:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009151923.08FJN1hu059437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 15 Sep 2020 19:23:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365763 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365763 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 19:23:02 -0000 Author: markj Date: Tue Sep 15 19:23:01 2020 New Revision: 365763 URL: https://svnweb.freebsd.org/changeset/base/365763 Log: Avoid an unnecessary malloc() when connecting dgram sockets. The allocated memory is only required for SOCK_STREAM and SOCK_SEQPACKET sockets. Reviewed by: kevans Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26298 Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Tue Sep 15 19:22:37 2020 (r365762) +++ head/sys/kern/uipc_usrreq.c Tue Sep 15 19:23:01 2020 (r365763) @@ -1557,7 +1557,8 @@ static int unp_connectat(int fd, struct socket *so, struct sockaddr *nam, struct thread *td) { - struct sockaddr_un *soun = (struct sockaddr_un *)nam; + struct mtx *vplock; + struct sockaddr_un *soun; struct vnode *vp; struct socket *so2; struct unpcb *unp, *unp2, *unp3; @@ -1566,7 +1567,7 @@ unp_connectat(int fd, struct socket *so, struct sockad struct sockaddr *sa; cap_rights_t rights; int error, len, freed; - struct mtx *vplock; + bool connreq; if (nam->sa_family != AF_UNIX) return (EAFNOSUPPORT); @@ -1575,6 +1576,7 @@ unp_connectat(int fd, struct socket *so, struct sockad len = nam->sa_len - offsetof(struct sockaddr_un, sun_path); if (len <= 0) return (EINVAL); + soun = (struct sockaddr_un *)nam; bcopy(soun->sun_path, buf, len); buf[len] = 0; @@ -1587,7 +1589,11 @@ unp_connectat(int fd, struct socket *so, struct sockad unp->unp_flags |= UNP_CONNECTING; UNP_PCB_UNLOCK(unp); - sa = malloc(sizeof(struct sockaddr_un), M_SONAME, M_WAITOK); + connreq = (so->so_proto->pr_flags & PR_CONNREQUIRED) != 0; + if (connreq) + sa = malloc(sizeof(struct sockaddr_un), M_SONAME, M_WAITOK); + else + sa = NULL; NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF, UIO_SYSSPACE, buf, fd, cap_rights_init(&rights, CAP_CONNECTAT), td); error = namei(&nd); @@ -1628,7 +1634,7 @@ unp_connectat(int fd, struct socket *so, struct sockad error = EPROTOTYPE; goto bad2; } - if (so->so_proto->pr_flags & PR_CONNREQUIRED) { + if (connreq) { if (so2->so_options & SO_ACCEPTCONN) { CURVNET_SET(so2->so_vnet); so2 = sonewconn(so2, 0); From owner-svn-src-all@freebsd.org Tue Sep 15 19:23:23 2020 Return-Path: Delivered-To: svn-src-all@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 4D6E33DD64C; Tue, 15 Sep 2020 19:23:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BrY6g1lNlz4Wt8; Tue, 15 Sep 2020 19:23:23 +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 1F102CE7B; Tue, 15 Sep 2020 19:23:23 +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 08FJNN2I059494; Tue, 15 Sep 2020 19:23:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FJNMBf059493; Tue, 15 Sep 2020 19:23:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009151923.08FJNMBf059493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 15 Sep 2020 19:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365764 - 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: 365764 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 19:23:23 -0000 Author: markj Date: Tue Sep 15 19:23:22 2020 New Revision: 365764 URL: https://svnweb.freebsd.org/changeset/base/365764 Log: Simplify unix socket connection peer locking. unp_pcb_owned_lock2() has some sharp edges and forces callers to deal with a bunch of cases. Simplify it: - Rename to unp_pcb_lock_peer(). - Return the connected peer instead of forcing callers to load it beforehand. - Handle self-connected sockets. - In unp_connectat(), just lock the accept socket directly. It should not be possible for the nascent socket to participate in any other lock orders. - Get rid of connect_internal(). It does not provide any useful checking anymore. - Block in unp_connectat() when a different thread is concurrently attempting to lock both sides of a connection. This provides simpler semantics for callers of unp_pcb_lock_peer(). - Make unp_connectat() return EISCONN if the socket is already connected. This fixes a race[1] when multiple threads attempt to connect() to different addresses using the same datagram socket. Upper layers will disconnect a connected datagram socket before calling the protocol connect's method, but there is no synchronization between this and protocol-layer code. Reported by: syzkaller [1] Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26299 Modified: head/sys/kern/uipc_usrreq.c head/sys/sys/unpcb.h Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Tue Sep 15 19:23:01 2020 (r365763) +++ head/sys/kern/uipc_usrreq.c Tue Sep 15 19:23:22 2020 (r365764) @@ -279,6 +279,7 @@ static struct mtx unp_defers_lock; "unp", "unp", \ MTX_DUPOK|MTX_DEF) #define UNP_PCB_LOCK_DESTROY(unp) mtx_destroy(&(unp)->unp_mtx) +#define UNP_PCB_LOCKPTR(unp) (&(unp)->unp_mtx) #define UNP_PCB_LOCK(unp) mtx_lock(&(unp)->unp_mtx) #define UNP_PCB_TRYLOCK(unp) mtx_trylock(&(unp)->unp_mtx) #define UNP_PCB_UNLOCK(unp) mtx_unlock(&(unp)->unp_mtx) @@ -368,35 +369,55 @@ unp_pcb_unlock_pair(struct unpcb *unp, struct unpcb *u UNP_PCB_UNLOCK(unp2); } -static __noinline void -unp_pcb_owned_lock2_slowpath(struct unpcb *unp, struct unpcb **unp2p, - int *freed) +/* + * Try to lock the connected peer of an already locked socket. In some cases + * this requires that we unlock the current socket. The pairbusy counter is + * used to block concurrent connection attempts while the lock is dropped. The + * caller must be careful to revalidate PCB state. + */ +static struct unpcb * +unp_pcb_lock_peer(struct unpcb *unp) { struct unpcb *unp2; - unp2 = *unp2p; + UNP_PCB_LOCK_ASSERT(unp); + unp2 = unp->unp_conn; + if (__predict_false(unp2 == NULL)) + return (NULL); + if (__predict_false(unp == unp2)) + return (unp); + + UNP_PCB_UNLOCK_ASSERT(unp2); + + if (__predict_true(UNP_PCB_TRYLOCK(unp2))) + return (unp2); + if ((uintptr_t)unp2 > (uintptr_t)unp) { + UNP_PCB_LOCK(unp2); + return (unp2); + } + unp->unp_pairbusy++; unp_pcb_hold(unp2); UNP_PCB_UNLOCK(unp); + UNP_PCB_LOCK(unp2); UNP_PCB_LOCK(unp); - *freed = unp_pcb_rele(unp2); - if (*freed) - *unp2p = NULL; + KASSERT(unp->unp_conn == unp2 || unp->unp_conn == NULL, + ("%s: socket %p was reconnected", __func__, unp)); + if (--unp->unp_pairbusy == 0 && (unp->unp_flags & UNP_WAITING) != 0) { + unp->unp_flags &= ~UNP_WAITING; + wakeup(unp); + } + if (unp_pcb_rele(unp2)) { + /* unp2 is unlocked. */ + return (NULL); + } + if (unp->unp_conn == NULL) { + UNP_PCB_UNLOCK(unp2); + return (NULL); + } + return (unp2); } -#define unp_pcb_owned_lock2(unp, unp2, freed) do { \ - freed = 0; \ - UNP_PCB_LOCK_ASSERT(unp); \ - UNP_PCB_UNLOCK_ASSERT(unp2); \ - MPASS((unp) != (unp2)); \ - if (__predict_true(UNP_PCB_TRYLOCK(unp2))) \ - break; \ - else if ((uintptr_t)(unp2) > (uintptr_t)(unp)) \ - UNP_PCB_LOCK(unp2); \ - else \ - unp_pcb_owned_lock2_slowpath((unp), &(unp2), &freed); \ -} while (0) - /* * Definitions of protocols supported in the LOCAL domain. */ @@ -710,7 +731,7 @@ uipc_close(struct socket *so) struct unpcb *unp, *unp2; struct vnode *vp = NULL; struct mtx *vplock; - int freed; + unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_close: unp == NULL")); @@ -728,15 +749,10 @@ uipc_close(struct socket *so) VOP_UNP_DETACH(vp); unp->unp_vnode = NULL; } - unp2 = unp->unp_conn; - if (__predict_false(unp == unp2)) { + if ((unp2 = unp_pcb_lock_peer(unp)) != NULL) unp_disconnect(unp, unp2); - } else if (unp2 != NULL) { - unp_pcb_owned_lock2(unp, unp2, freed); - unp_disconnect(unp, unp2); - } else { + else UNP_PCB_UNLOCK(unp); - } if (vp) { mtx_unlock(vplock); vrele(vp); @@ -765,14 +781,13 @@ uipc_detach(struct socket *so) struct unpcb *unp, *unp2; struct mtx *vplock; struct vnode *vp; - int freeunp, local_unp_rights; + int local_unp_rights; unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_detach: unp == NULL")); vp = NULL; vplock = NULL; - local_unp_rights = 0; SOCK_LOCK(so); if (!SOLISTENING(so)) { @@ -811,21 +826,11 @@ uipc_detach(struct socket *so) VOP_UNP_DETACH(vp); unp->unp_vnode = NULL; } - if (__predict_false(unp == unp->unp_conn)) { - unp_disconnect(unp, unp); - unp2 = NULL; - } else { - if ((unp2 = unp->unp_conn) != NULL) { - unp_pcb_owned_lock2(unp, unp2, freeunp); - if (freeunp) - unp2 = NULL; - } - unp_pcb_hold(unp); - if (unp2 != NULL) - unp_disconnect(unp, unp2); - else - UNP_PCB_UNLOCK(unp); - } + if ((unp2 = unp_pcb_lock_peer(unp)) != NULL) + unp_disconnect(unp, unp2); + else + UNP_PCB_UNLOCK(unp); + UNP_REF_LIST_LOCK(); while (!LIST_EMPTY(&unp->unp_refs)) { struct unpcb *ref = LIST_FIRST(&unp->unp_refs); @@ -838,11 +843,9 @@ uipc_detach(struct socket *so) unp_drop(ref); UNP_REF_LIST_LOCK(); } - UNP_REF_LIST_UNLOCK(); + UNP_PCB_LOCK(unp); - freeunp = unp_pcb_rele(unp); - MPASS(freeunp == 0); local_unp_rights = unp_rights; unp->unp_socket->so_pcb = NULL; unp->unp_socket = NULL; @@ -862,24 +865,15 @@ static int uipc_disconnect(struct socket *so) { struct unpcb *unp, *unp2; - int freed; unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_disconnect: unp == NULL")); UNP_PCB_LOCK(unp); - if ((unp2 = unp->unp_conn) == NULL) { + if ((unp2 = unp_pcb_lock_peer(unp)) != NULL) + unp_disconnect(unp, unp2); + else UNP_PCB_UNLOCK(unp); - return (0); - } - if (__predict_true(unp != unp2)) { - unp_pcb_owned_lock2(unp, unp2, freed); - if (__predict_false(freed)) { - UNP_PCB_UNLOCK(unp); - return (0); - } - } - unp_disconnect(unp, unp2); return (0); } @@ -998,27 +992,6 @@ uipc_rcvd(struct socket *so, int flags) } static int -connect_internal(struct socket *so, struct sockaddr *nam, struct thread *td) -{ - int error; - struct unpcb *unp; - - unp = so->so_pcb; - if (unp->unp_conn != NULL) - return (EISCONN); - error = unp_connect(so, nam, td); - if (error) - return (error); - UNP_PCB_LOCK(unp); - if (unp->unp_conn == NULL) { - UNP_PCB_UNLOCK(unp); - if (error == 0) - error = ENOTCONN; - } - return (error); -} - -static int uipc_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, struct mbuf *control, struct thread *td) { @@ -1048,57 +1021,26 @@ uipc_send(struct socket *so, int flags, struct mbuf *m const struct sockaddr *from; if (nam != NULL) { - /* - * We return with UNP_PCB_LOCK_HELD so we know that - * the reference is live if the pointer is valid. - */ - if ((error = connect_internal(so, nam, td))) + error = unp_connect(so, nam, td); + if (error != 0) break; - MPASS(unp->unp_conn != NULL); - unp2 = unp->unp_conn; - } else { - UNP_PCB_LOCK(unp); - - /* - * Because connect() and send() are non-atomic in a sendto() - * with a target address, it's possible that the socket will - * have disconnected before the send() can run. In that case - * return the slightly counter-intuitive but otherwise - * correct error that the socket is not connected. - */ - if ((unp2 = unp->unp_conn) == NULL) { - UNP_PCB_UNLOCK(unp); - error = ENOTCONN; - break; - } } - if (__predict_false(unp == unp2)) { - if (unp->unp_socket == NULL) { - error = ENOTCONN; - break; - } - goto connect_self; - } - unp_pcb_owned_lock2(unp, unp2, freed); - if (__predict_false(freed)) { - UNP_PCB_UNLOCK(unp); - error = ENOTCONN; - break; - } + UNP_PCB_LOCK(unp); + /* - * The socket referencing unp2 may have been closed - * or unp may have been disconnected if the unp lock - * was dropped to acquire unp2. + * Because connect() and send() are non-atomic in a sendto() + * with a target address, it's possible that the socket will + * have disconnected before the send() can run. In that case + * return the slightly counter-intuitive but otherwise + * correct error that the socket is not connected. */ - if (__predict_false(unp->unp_conn == NULL) || - unp2->unp_socket == NULL) { + unp2 = unp_pcb_lock_peer(unp); + if (unp2 == NULL) { UNP_PCB_UNLOCK(unp); - if (unp_pcb_rele(unp2) == 0) - UNP_PCB_UNLOCK(unp2); error = ENOTCONN; break; } - connect_self: + if (unp2->unp_flags & UNP_WANTCRED) control = unp_addsockcred(td, control); if (unp->unp_addr != NULL) @@ -1127,36 +1069,26 @@ uipc_send(struct socket *so, int flags, struct mbuf *m case SOCK_STREAM: if ((so->so_state & SS_ISCONNECTED) == 0) { if (nam != NULL) { - error = connect_internal(so, nam, td); + error = unp_connect(so, nam, td); if (error != 0) break; } else { error = ENOTCONN; break; } - } else { - UNP_PCB_LOCK(unp); } - if ((unp2 = unp->unp_conn) == NULL) { + UNP_PCB_LOCK(unp); + if ((unp2 = unp_pcb_lock_peer(unp)) == NULL) { UNP_PCB_UNLOCK(unp); error = ENOTCONN; break; } else if (so->so_snd.sb_state & SBS_CANTSENDMORE) { - UNP_PCB_UNLOCK(unp); + unp_pcb_unlock_pair(unp, unp2); error = EPIPE; break; - } else if ((unp2 = unp->unp_conn) == NULL) { - UNP_PCB_UNLOCK(unp); - error = ENOTCONN; - break; } - unp_pcb_owned_lock2(unp, unp2, freed); UNP_PCB_UNLOCK(unp); - if (__predict_false(freed)) { - error = ENOTCONN; - break; - } if ((so2 = unp2->unp_socket) == NULL) { UNP_PCB_UNLOCK(unp2); error = ENOTCONN; @@ -1291,30 +1223,19 @@ uipc_ready(struct socket *so, struct mbuf *m, int coun ("%s: unexpected socket type for %p", __func__, so)); UNP_PCB_LOCK(unp); - if ((unp2 = unp->unp_conn) == NULL) { + if ((unp2 = unp_pcb_lock_peer(unp)) != NULL) { UNP_PCB_UNLOCK(unp); - goto search; + so2 = unp2->unp_socket; + SOCKBUF_LOCK(&so2->so_rcv); + if ((error = sbready(&so2->so_rcv, m, count)) == 0) + sorwakeup_locked(so2); + else + SOCKBUF_UNLOCK(&so2->so_rcv); + UNP_PCB_UNLOCK(unp2); + return (error); } - if (unp != unp2) { - if (UNP_PCB_TRYLOCK(unp2) == 0) { - unp_pcb_hold(unp2); - UNP_PCB_UNLOCK(unp); - UNP_PCB_LOCK(unp2); - if (unp_pcb_rele(unp2)) - goto search; - } else - UNP_PCB_UNLOCK(unp); - } - so2 = unp2->unp_socket; - SOCKBUF_LOCK(&so2->so_rcv); - if ((error = sbready(&so2->so_rcv, m, count)) == 0) - sorwakeup_locked(so2); - else - SOCKBUF_UNLOCK(&so2->so_rcv); - UNP_PCB_UNLOCK(unp2); - return (error); + UNP_PCB_UNLOCK(unp); -search: /* * The receiving socket has been disconnected, but may still be valid. * In this case, the now-ready mbufs are still present in its socket @@ -1566,7 +1487,7 @@ unp_connectat(int fd, struct socket *so, struct sockad char buf[SOCK_MAXADDRLEN]; struct sockaddr *sa; cap_rights_t rights; - int error, len, freed; + int error, len; bool connreq; if (nam->sa_family != AF_UNIX) @@ -1582,9 +1503,33 @@ unp_connectat(int fd, struct socket *so, struct sockad unp = sotounpcb(so); UNP_PCB_LOCK(unp); - if (unp->unp_flags & UNP_CONNECTING) { - UNP_PCB_UNLOCK(unp); - return (EALREADY); + for (;;) { + /* + * Wait for connection state to stabilize. If a connection + * already exists, give up. For datagram sockets, which permit + * multiple consecutive connect(2) calls, upper layers are + * responsible for disconnecting in advance of a subsequent + * connect(2), but this is not synchronized with PCB connection + * state. + * + * Also make sure that no threads are currently attempting to + * lock the peer socket, to ensure that unp_conn cannot + * transition between two valid sockets while locks are dropped. + */ + if (unp->unp_conn != NULL) { + UNP_PCB_UNLOCK(unp); + return (EISCONN); + } + if ((unp->unp_flags & UNP_CONNECTING) != 0) { + UNP_PCB_UNLOCK(unp); + return (EALREADY); + } + if (unp->unp_pairbusy > 0) { + unp->unp_flags |= UNP_WAITING; + mtx_sleep(unp, UNP_PCB_LOCKPTR(unp), 0, "unpeer", 0); + continue; + } + break; } unp->unp_flags |= UNP_CONNECTING; UNP_PCB_UNLOCK(unp); @@ -1657,12 +1602,12 @@ unp_connectat(int fd, struct socket *so, struct sockad UNP_PCB_UNLOCK(unp2); unp2 = unp3; - unp_pcb_owned_lock2(unp2, unp, freed); - if (__predict_false(freed)) { - UNP_PCB_UNLOCK(unp2); - error = ECONNREFUSED; - goto bad2; - } + + /* + * It is safe to block on the PCB lock here since unp2 is + * nascent and cannot be connected to any other sockets. + */ + UNP_PCB_LOCK(unp); #ifdef MAC mac_socketpeer_set_from_socket(so, so2); mac_socketpeer_set_from_socket(so2, so); @@ -1683,6 +1628,8 @@ bad: } free(sa, M_SONAME); UNP_PCB_LOCK(unp); + KASSERT((unp->unp_flags & UNP_CONNECTING) != 0, + ("%s: unp %p has UNP_CONNECTING clear", __func__, unp)); unp->unp_flags &= ~UNP_CONNECTING; UNP_PCB_UNLOCK(unp); return (error); @@ -1722,6 +1669,8 @@ unp_connect2(struct socket *so, struct socket *so2, in UNP_PCB_LOCK_ASSERT(unp); UNP_PCB_LOCK_ASSERT(unp2); + KASSERT(unp->unp_conn == NULL, + ("%s: socket %p is already connected", __func__, unp)); if (so2->so_type != so->so_type) return (EPROTOTYPE); @@ -1738,6 +1687,8 @@ unp_connect2(struct socket *so, struct socket *so2, in case SOCK_STREAM: case SOCK_SEQPACKET: + KASSERT(unp2->unp_conn == NULL, + ("%s: socket %p is already connected", __func__, unp2)); unp2->unp_conn = unp; if (req == PRU_CONNECT && ((unp->unp_flags | unp2->unp_flags) & UNP_CONNWAIT)) @@ -1992,25 +1943,18 @@ unp_drop(struct unpcb *unp) { struct socket *so = unp->unp_socket; struct unpcb *unp2; - int freed; /* * Regardless of whether the socket's peer dropped the connection * with this socket by aborting or disconnecting, POSIX requires * that ECONNRESET is returned. */ - /* acquire a reference so that unp isn't freed from underneath us */ UNP_PCB_LOCK(unp); if (so) so->so_error = ECONNRESET; - unp2 = unp->unp_conn; - /* Last reference dropped in unp_disconnect(). */ - if (unp2 == unp) { - unp_pcb_rele_notlast(unp); - unp_disconnect(unp, unp2); - } else if (unp2 != NULL) { - unp_pcb_owned_lock2(unp, unp2, freed); + if ((unp2 = unp_pcb_lock_peer(unp)) != NULL) { + /* Last reference dropped in unp_disconnect(). */ unp_pcb_rele_notlast(unp); unp_disconnect(unp, unp2); } else if (!unp_pcb_rele(unp)) { Modified: head/sys/sys/unpcb.h ============================================================================== --- head/sys/sys/unpcb.h Tue Sep 15 19:23:01 2020 (r365763) +++ head/sys/sys/unpcb.h Tue Sep 15 19:23:22 2020 (r365764) @@ -85,6 +85,7 @@ struct unpcb { struct sockaddr_un *unp_addr; /* (p) bound address of socket */ struct socket *unp_socket; /* (c) pointer back to socket */ /* Cache line 2 */ + u_int unp_pairbusy; /* (p) threads acquiring peer locks */ struct vnode *unp_vnode; /* (p) associated file if applicable */ struct xucred unp_peercred; /* (p) peer credentials if applicable */ LIST_ENTRY(unpcb) unp_reflink; /* (l) link in unp_refs list */ @@ -117,6 +118,7 @@ struct unpcb { */ #define UNP_CONNECTING 0x010 /* Currently connecting. */ #define UNP_BINDING 0x020 /* Currently binding. */ +#define UNP_WAITING 0x040 /* Peer state is changing. */ /* * Flags in unp_gcflag. From owner-svn-src-all@freebsd.org Tue Sep 15 19:23:42 2020 Return-Path: Delivered-To: svn-src-all@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 C4D733DD457; Tue, 15 Sep 2020 19:23:42 +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 4BrY724tWqz4X03; Tue, 15 Sep 2020 19:23:42 +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 8A93FD421; Tue, 15 Sep 2020 19:23: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 08FJNg8G059551; Tue, 15 Sep 2020 19:23:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FJNgdr059550; Tue, 15 Sep 2020 19:23:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009151923.08FJNgdr059550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 15 Sep 2020 19:23:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365765 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365765 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 19:23:42 -0000 Author: markj Date: Tue Sep 15 19:23:42 2020 New Revision: 365765 URL: https://svnweb.freebsd.org/changeset/base/365765 Log: Fix locking in uipc_accept(). This function wasn't converted to use the new locking protocol in r333744. Make it use the PCB lock for synchronizing connection state. Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26300 Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Tue Sep 15 19:23:22 2020 (r365764) +++ head/sys/kern/uipc_usrreq.c Tue Sep 15 19:23:42 2020 (r365765) @@ -499,18 +499,14 @@ uipc_accept(struct socket *so, struct sockaddr **nam) KASSERT(unp != NULL, ("uipc_accept: unp == NULL")); *nam = malloc(sizeof(struct sockaddr_un), M_SONAME, M_WAITOK); - UNP_LINK_RLOCK(); - unp2 = unp->unp_conn; - if (unp2 != NULL && unp2->unp_addr != NULL) { - UNP_PCB_LOCK(unp2); - sa = (struct sockaddr *) unp2->unp_addr; - bcopy(sa, *nam, sa->sa_len); - UNP_PCB_UNLOCK(unp2); - } else { + UNP_PCB_LOCK(unp); + unp2 = unp_pcb_lock_peer(unp); + if (unp2 != NULL && unp2->unp_addr != NULL) + sa = (struct sockaddr *)unp2->unp_addr; + else sa = &sun_noname; - bcopy(sa, *nam, sa->sa_len); - } - UNP_LINK_RUNLOCK(); + bcopy(sa, *nam, sa->sa_len); + unp_pcb_unlock_pair(unp, unp2); return (0); } From owner-svn-src-all@freebsd.org Tue Sep 15 20:22:50 2020 Return-Path: Delivered-To: svn-src-all@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 DB0B73DF403; Tue, 15 Sep 2020 20:22:50 +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 4BrZRG5Ydlz4bJm; Tue, 15 Sep 2020 20:22:50 +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 A1EFBDE26; Tue, 15 Sep 2020 20:22:50 +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 08FKMoue096690; Tue, 15 Sep 2020 20:22:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FKMoV2096689; Tue, 15 Sep 2020 20:22:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009152022.08FKMoV2096689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 15 Sep 2020 20:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365766 - head/sys/amd64/vmm/amd X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/vmm/amd X-SVN-Commit-Revision: 365766 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 20:22:50 -0000 Author: kib Date: Tue Sep 15 20:22:50 2020 New Revision: 365766 URL: https://svnweb.freebsd.org/changeset/base/365766 Log: bhyve: intercept AMD SVM instructions. Intercept and report #UD to VM on SVM/AMD in case VM tried to execute an SVM instruction. Otherwise, SVM allows execution of them, and instructions operate on host physical addresses despite being executed in guest mode. Reported by: Maxime Villard admbug: 972 CVE: CVE-2020-7467 Reviewed by: grehan, markj Differential revision: https://reviews.freebsd.org/D26313 Modified: head/sys/amd64/vmm/amd/svm.c head/sys/amd64/vmm/amd/vmcb.h Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Tue Sep 15 19:23:42 2020 (r365765) +++ head/sys/amd64/vmm/amd/svm.c Tue Sep 15 20:22:50 2020 (r365766) @@ -488,11 +488,24 @@ vmcb_init(struct svm_softc *sc, int vcpu, uint64_t iop svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_SHUTDOWN); svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_FERR_FREEZE); + svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_INVD); + svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_INVLPGA); svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_MONITOR); svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_MWAIT); /* + * Intercept SVM instructions since AMD enables them in guests otherwise. + * Non-intercepted VMMCALL causes #UD, skip it. + */ + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_VMLOAD); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_VMSAVE); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_STGI); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_CLGI); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_SKINIT); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_ICEBP); + + /* * From section "Canonicalization and Consistency Checks" in APMv2 * the VMRUN intercept bit must be set to pass the consistency check. */ @@ -1236,43 +1249,45 @@ emulate_rdmsr(struct svm_softc *sc, int vcpu, u_int nu static const char * exit_reason_to_str(uint64_t reason) { + int i; static char reasonbuf[32]; + static const struct { + int reason; + const char *str; + } reasons[] = { + { .reason = VMCB_EXIT_INVALID, .str = "invalvmcb" }, + { .reason = VMCB_EXIT_SHUTDOWN, .str = "shutdown" }, + { .reason = VMCB_EXIT_NPF, .str = "nptfault" }, + { .reason = VMCB_EXIT_PAUSE, .str = "pause" }, + { .reason = VMCB_EXIT_HLT, .str = "hlt" }, + { .reason = VMCB_EXIT_CPUID, .str = "cpuid" }, + { .reason = VMCB_EXIT_IO, .str = "inout" }, + { .reason = VMCB_EXIT_MC, .str = "mchk" }, + { .reason = VMCB_EXIT_INTR, .str = "extintr" }, + { .reason = VMCB_EXIT_NMI, .str = "nmi" }, + { .reason = VMCB_EXIT_VINTR, .str = "vintr" }, + { .reason = VMCB_EXIT_MSR, .str = "msr" }, + { .reason = VMCB_EXIT_IRET, .str = "iret" }, + { .reason = VMCB_EXIT_MONITOR, .str = "monitor" }, + { .reason = VMCB_EXIT_MWAIT, .str = "mwait" }, + { .reason = VMCB_EXIT_VMRUN, .str = "vmrun" }, + { .reason = VMCB_EXIT_VMMCALL, .str = "vmmcall" }, + { .reason = VMCB_EXIT_VMLOAD, .str = "vmload" }, + { .reason = VMCB_EXIT_VMSAVE, .str = "vmsave" }, + { .reason = VMCB_EXIT_STGI, .str = "stgi" }, + { .reason = VMCB_EXIT_CLGI, .str = "clgi" }, + { .reason = VMCB_EXIT_SKINIT, .str = "skinit" }, + { .reason = VMCB_EXIT_ICEBP, .str = "icebp" }, + { .reason = VMCB_EXIT_INVD, .str = "invd" }, + { .reason = VMCB_EXIT_INVLPGA, .str = "invlpga" }, + }; - switch (reason) { - case VMCB_EXIT_INVALID: - return ("invalvmcb"); - case VMCB_EXIT_SHUTDOWN: - return ("shutdown"); - case VMCB_EXIT_NPF: - return ("nptfault"); - case VMCB_EXIT_PAUSE: - return ("pause"); - case VMCB_EXIT_HLT: - return ("hlt"); - case VMCB_EXIT_CPUID: - return ("cpuid"); - case VMCB_EXIT_IO: - return ("inout"); - case VMCB_EXIT_MC: - return ("mchk"); - case VMCB_EXIT_INTR: - return ("extintr"); - case VMCB_EXIT_NMI: - return ("nmi"); - case VMCB_EXIT_VINTR: - return ("vintr"); - case VMCB_EXIT_MSR: - return ("msr"); - case VMCB_EXIT_IRET: - return ("iret"); - case VMCB_EXIT_MONITOR: - return ("monitor"); - case VMCB_EXIT_MWAIT: - return ("mwait"); - default: - snprintf(reasonbuf, sizeof(reasonbuf), "%#lx", reason); - return (reasonbuf); + for (i = 0; i < nitems(reasons); i++) { + if (reasons[i].reason == reason) + return (reasons[i].str); } + snprintf(reasonbuf, sizeof(reasonbuf), "%#lx", reason); + return (reasonbuf); } #endif /* KTR */ @@ -1523,6 +1538,20 @@ svm_vmexit(struct svm_softc *svm_sc, int vcpu, struct break; case VMCB_EXIT_MWAIT: vmexit->exitcode = VM_EXITCODE_MWAIT; + break; + case VMCB_EXIT_SHUTDOWN: + case VMCB_EXIT_VMRUN: + case VMCB_EXIT_VMMCALL: + case VMCB_EXIT_VMLOAD: + case VMCB_EXIT_VMSAVE: + case VMCB_EXIT_STGI: + case VMCB_EXIT_CLGI: + case VMCB_EXIT_SKINIT: + case VMCB_EXIT_ICEBP: + case VMCB_EXIT_INVD: + case VMCB_EXIT_INVLPGA: + vm_inject_ud(svm_sc->vm, vcpu); + handled = 1; break; default: vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_UNKNOWN, 1); Modified: head/sys/amd64/vmm/amd/vmcb.h ============================================================================== --- head/sys/amd64/vmm/amd/vmcb.h Tue Sep 15 19:23:42 2020 (r365765) +++ head/sys/amd64/vmm/amd/vmcb.h Tue Sep 15 20:22:50 2020 (r365766) @@ -71,8 +71,8 @@ #define VMCB_INTCPT_INVD BIT(22) #define VMCB_INTCPT_PAUSE BIT(23) #define VMCB_INTCPT_HLT BIT(24) -#define VMCB_INTCPT_INVPG BIT(25) -#define VMCB_INTCPT_INVPGA BIT(26) +#define VMCB_INTCPT_INVLPG BIT(25) +#define VMCB_INTCPT_INVLPGA BIT(26) #define VMCB_INTCPT_IO BIT(27) #define VMCB_INTCPT_MSR BIT(28) #define VMCB_INTCPT_TASK_SWITCH BIT(29) @@ -134,12 +134,21 @@ #define VMCB_EXIT_POPF 0x71 #define VMCB_EXIT_CPUID 0x72 #define VMCB_EXIT_IRET 0x74 +#define VMCB_EXIT_INVD 0x76 #define VMCB_EXIT_PAUSE 0x77 #define VMCB_EXIT_HLT 0x78 +#define VMCB_EXIT_INVLPGA 0x7A #define VMCB_EXIT_IO 0x7B #define VMCB_EXIT_MSR 0x7C #define VMCB_EXIT_SHUTDOWN 0x7F +#define VMCB_EXIT_VMRUN 0x80 +#define VMCB_EXIT_VMMCALL 0x81 +#define VMCB_EXIT_VMLOAD 0x82 #define VMCB_EXIT_VMSAVE 0x83 +#define VMCB_EXIT_STGI 0x84 +#define VMCB_EXIT_CLGI 0x85 +#define VMCB_EXIT_SKINIT 0x86 +#define VMCB_EXIT_ICEBP 0x88 #define VMCB_EXIT_MONITOR 0x8A #define VMCB_EXIT_MWAIT 0x8B #define VMCB_EXIT_NPF 0x400 From owner-svn-src-all@freebsd.org Tue Sep 15 20:25:31 2020 Return-Path: Delivered-To: svn-src-all@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 7BDBF3DEED4; Tue, 15 Sep 2020 20:25:31 +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 4BrZVM2hB5z4bk6; Tue, 15 Sep 2020 20:25:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F250DDB5; Tue, 15 Sep 2020 20:25:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08FKPVB8096881; Tue, 15 Sep 2020 20:25:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FKPUUg096879; Tue, 15 Sep 2020 20:25:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009152025.08FKPUUg096879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 15 Sep 2020 20:25:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365767 - stable/12/sys/amd64/vmm/amd X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/amd64/vmm/amd X-SVN-Commit-Revision: 365767 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 20:25:31 -0000 Author: kib Date: Tue Sep 15 20:25:30 2020 New Revision: 365767 URL: https://svnweb.freebsd.org/changeset/base/365767 Log: MFC r365766: bhyve: intercept AMD SVM instructions. CVE: CVE-2020-7467 Modified: stable/12/sys/amd64/vmm/amd/svm.c stable/12/sys/amd64/vmm/amd/vmcb.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/vmm/amd/svm.c ============================================================================== --- stable/12/sys/amd64/vmm/amd/svm.c Tue Sep 15 20:22:50 2020 (r365766) +++ stable/12/sys/amd64/vmm/amd/svm.c Tue Sep 15 20:25:30 2020 (r365767) @@ -466,11 +466,24 @@ vmcb_init(struct svm_softc *sc, int vcpu, uint64_t iop svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_SHUTDOWN); svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_FERR_FREEZE); + svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_INVD); + svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_INVLPGA); svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_MONITOR); svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_MWAIT); /* + * Intercept SVM instructions since AMD enables them in guests otherwise. + * Non-intercepted VMMCALL causes #UD, skip it. + */ + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_VMLOAD); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_VMSAVE); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_STGI); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_CLGI); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_SKINIT); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_ICEBP); + + /* * From section "Canonicalization and Consistency Checks" in APMv2 * the VMRUN intercept bit must be set to pass the consistency check. */ @@ -1214,43 +1227,45 @@ emulate_rdmsr(struct svm_softc *sc, int vcpu, u_int nu static const char * exit_reason_to_str(uint64_t reason) { + int i; static char reasonbuf[32]; + static const struct { + int reason; + const char *str; + } reasons[] = { + { .reason = VMCB_EXIT_INVALID, .str = "invalvmcb" }, + { .reason = VMCB_EXIT_SHUTDOWN, .str = "shutdown" }, + { .reason = VMCB_EXIT_NPF, .str = "nptfault" }, + { .reason = VMCB_EXIT_PAUSE, .str = "pause" }, + { .reason = VMCB_EXIT_HLT, .str = "hlt" }, + { .reason = VMCB_EXIT_CPUID, .str = "cpuid" }, + { .reason = VMCB_EXIT_IO, .str = "inout" }, + { .reason = VMCB_EXIT_MC, .str = "mchk" }, + { .reason = VMCB_EXIT_INTR, .str = "extintr" }, + { .reason = VMCB_EXIT_NMI, .str = "nmi" }, + { .reason = VMCB_EXIT_VINTR, .str = "vintr" }, + { .reason = VMCB_EXIT_MSR, .str = "msr" }, + { .reason = VMCB_EXIT_IRET, .str = "iret" }, + { .reason = VMCB_EXIT_MONITOR, .str = "monitor" }, + { .reason = VMCB_EXIT_MWAIT, .str = "mwait" }, + { .reason = VMCB_EXIT_VMRUN, .str = "vmrun" }, + { .reason = VMCB_EXIT_VMMCALL, .str = "vmmcall" }, + { .reason = VMCB_EXIT_VMLOAD, .str = "vmload" }, + { .reason = VMCB_EXIT_VMSAVE, .str = "vmsave" }, + { .reason = VMCB_EXIT_STGI, .str = "stgi" }, + { .reason = VMCB_EXIT_CLGI, .str = "clgi" }, + { .reason = VMCB_EXIT_SKINIT, .str = "skinit" }, + { .reason = VMCB_EXIT_ICEBP, .str = "icebp" }, + { .reason = VMCB_EXIT_INVD, .str = "invd" }, + { .reason = VMCB_EXIT_INVLPGA, .str = "invlpga" }, + }; - switch (reason) { - case VMCB_EXIT_INVALID: - return ("invalvmcb"); - case VMCB_EXIT_SHUTDOWN: - return ("shutdown"); - case VMCB_EXIT_NPF: - return ("nptfault"); - case VMCB_EXIT_PAUSE: - return ("pause"); - case VMCB_EXIT_HLT: - return ("hlt"); - case VMCB_EXIT_CPUID: - return ("cpuid"); - case VMCB_EXIT_IO: - return ("inout"); - case VMCB_EXIT_MC: - return ("mchk"); - case VMCB_EXIT_INTR: - return ("extintr"); - case VMCB_EXIT_NMI: - return ("nmi"); - case VMCB_EXIT_VINTR: - return ("vintr"); - case VMCB_EXIT_MSR: - return ("msr"); - case VMCB_EXIT_IRET: - return ("iret"); - case VMCB_EXIT_MONITOR: - return ("monitor"); - case VMCB_EXIT_MWAIT: - return ("mwait"); - default: - snprintf(reasonbuf, sizeof(reasonbuf), "%#lx", reason); - return (reasonbuf); + for (i = 0; i < nitems(reasons); i++) { + if (reasons[i].reason == reason) + return (reasons[i].str); } + snprintf(reasonbuf, sizeof(reasonbuf), "%#lx", reason); + return (reasonbuf); } #endif /* KTR */ @@ -1501,6 +1516,20 @@ svm_vmexit(struct svm_softc *svm_sc, int vcpu, struct break; case VMCB_EXIT_MWAIT: vmexit->exitcode = VM_EXITCODE_MWAIT; + break; + case VMCB_EXIT_SHUTDOWN: + case VMCB_EXIT_VMRUN: + case VMCB_EXIT_VMMCALL: + case VMCB_EXIT_VMLOAD: + case VMCB_EXIT_VMSAVE: + case VMCB_EXIT_STGI: + case VMCB_EXIT_CLGI: + case VMCB_EXIT_SKINIT: + case VMCB_EXIT_ICEBP: + case VMCB_EXIT_INVD: + case VMCB_EXIT_INVLPGA: + vm_inject_ud(svm_sc->vm, vcpu); + handled = 1; break; default: vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_UNKNOWN, 1); Modified: stable/12/sys/amd64/vmm/amd/vmcb.h ============================================================================== --- stable/12/sys/amd64/vmm/amd/vmcb.h Tue Sep 15 20:22:50 2020 (r365766) +++ stable/12/sys/amd64/vmm/amd/vmcb.h Tue Sep 15 20:25:30 2020 (r365767) @@ -73,8 +73,8 @@ struct svm_softc; #define VMCB_INTCPT_INVD BIT(22) #define VMCB_INTCPT_PAUSE BIT(23) #define VMCB_INTCPT_HLT BIT(24) -#define VMCB_INTCPT_INVPG BIT(25) -#define VMCB_INTCPT_INVPGA BIT(26) +#define VMCB_INTCPT_INVLPG BIT(25) +#define VMCB_INTCPT_INVLPGA BIT(26) #define VMCB_INTCPT_IO BIT(27) #define VMCB_INTCPT_MSR BIT(28) #define VMCB_INTCPT_TASK_SWITCH BIT(29) @@ -136,12 +136,21 @@ struct svm_softc; #define VMCB_EXIT_POPF 0x71 #define VMCB_EXIT_CPUID 0x72 #define VMCB_EXIT_IRET 0x74 +#define VMCB_EXIT_INVD 0x76 #define VMCB_EXIT_PAUSE 0x77 #define VMCB_EXIT_HLT 0x78 +#define VMCB_EXIT_INVLPGA 0x7A #define VMCB_EXIT_IO 0x7B #define VMCB_EXIT_MSR 0x7C #define VMCB_EXIT_SHUTDOWN 0x7F +#define VMCB_EXIT_VMRUN 0x80 +#define VMCB_EXIT_VMMCALL 0x81 +#define VMCB_EXIT_VMLOAD 0x82 #define VMCB_EXIT_VMSAVE 0x83 +#define VMCB_EXIT_STGI 0x84 +#define VMCB_EXIT_CLGI 0x85 +#define VMCB_EXIT_SKINIT 0x86 +#define VMCB_EXIT_ICEBP 0x88 #define VMCB_EXIT_MONITOR 0x8A #define VMCB_EXIT_MWAIT 0x8B #define VMCB_EXIT_NPF 0x400 From owner-svn-src-all@freebsd.org Tue Sep 15 20:25:39 2020 Return-Path: Delivered-To: svn-src-all@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 76A153DF610; Tue, 15 Sep 2020 20:25:39 +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 4BrZVW03gNz4bpK; Tue, 15 Sep 2020 20:25:38 +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 B409DDFA3; Tue, 15 Sep 2020 20:25:38 +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 08FKPctj096933; Tue, 15 Sep 2020 20:25:38 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FKPcjd096932; Tue, 15 Sep 2020 20:25:38 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009152025.08FKPcjd096932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Tue, 15 Sep 2020 20:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365768 - 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: 365768 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 20:25:39 -0000 Author: bdragon Date: Tue Sep 15 20:25:38 2020 New Revision: 365768 URL: https://svnweb.freebsd.org/changeset/base/365768 Log: [PowerPC64LE] Set up the powernv partition table correctly. The partition table is always big endian. 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 Tue Sep 15 20:25:30 2020 (r365767) +++ head/sys/powerpc/aim/moea64_native.c Tue Sep 15 20:25:38 2020 (r365768) @@ -556,9 +556,9 @@ moea64_bootstrap_native(vm_offset_t kernelstart, vm_of sizeof(struct lpteg)); if (cpu_features2 & PPC_FEATURE2_ARCH_3_00) { bzero(__DEVOLATILE(void *, moea64_part_table), PART_SIZE); - moea64_part_table[0].pagetab = + moea64_part_table[0].pagetab = htobe64( (DMAP_TO_PHYS((vm_offset_t)moea64_pteg_table)) | - (uintptr_t)(flsl((moea64_pteg_count - 1) >> 11)); + (uintptr_t)(flsl((moea64_pteg_count - 1) >> 11))); } ENABLE_TRANS(msr); From owner-svn-src-all@freebsd.org Tue Sep 15 20:26:32 2020 Return-Path: Delivered-To: svn-src-all@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 4C37E3DF690; Tue, 15 Sep 2020 20:26:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BrZWX19kqz4bvy; Tue, 15 Sep 2020 20:26:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0ADE3DE28; Tue, 15 Sep 2020 20:26:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08FKQVdZ097034; Tue, 15 Sep 2020 20:26:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FKQV9H097032; Tue, 15 Sep 2020 20:26:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009152026.08FKQV9H097032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 15 Sep 2020 20:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365769 - stable/11/sys/amd64/vmm/amd X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/amd64/vmm/amd X-SVN-Commit-Revision: 365769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 20:26:32 -0000 Author: kib Date: Tue Sep 15 20:26:31 2020 New Revision: 365769 URL: https://svnweb.freebsd.org/changeset/base/365769 Log: MFC r365766: bhyve: intercept AMD SVM instructions. CVE: CVE-2020-7467 Modified: stable/11/sys/amd64/vmm/amd/svm.c stable/11/sys/amd64/vmm/amd/vmcb.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/vmm/amd/svm.c ============================================================================== --- stable/11/sys/amd64/vmm/amd/svm.c Tue Sep 15 20:25:38 2020 (r365768) +++ stable/11/sys/amd64/vmm/amd/svm.c Tue Sep 15 20:26:31 2020 (r365769) @@ -469,11 +469,24 @@ vmcb_init(struct svm_softc *sc, int vcpu, uint64_t iop svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_SHUTDOWN); svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_FERR_FREEZE); + svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_INVD); + svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_INVLPGA); svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_MONITOR); svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_MWAIT); /* + * Intercept SVM instructions since AMD enables them in guests otherwise. + * Non-intercepted VMMCALL causes #UD, skip it. + */ + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_VMLOAD); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_VMSAVE); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_STGI); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_CLGI); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_SKINIT); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_ICEBP); + + /* * From section "Canonicalization and Consistency Checks" in APMv2 * the VMRUN intercept bit must be set to pass the consistency check. */ @@ -1217,43 +1230,45 @@ emulate_rdmsr(struct svm_softc *sc, int vcpu, u_int nu static const char * exit_reason_to_str(uint64_t reason) { + int i; static char reasonbuf[32]; + static const struct { + int reason; + const char *str; + } reasons[] = { + { .reason = VMCB_EXIT_INVALID, .str = "invalvmcb" }, + { .reason = VMCB_EXIT_SHUTDOWN, .str = "shutdown" }, + { .reason = VMCB_EXIT_NPF, .str = "nptfault" }, + { .reason = VMCB_EXIT_PAUSE, .str = "pause" }, + { .reason = VMCB_EXIT_HLT, .str = "hlt" }, + { .reason = VMCB_EXIT_CPUID, .str = "cpuid" }, + { .reason = VMCB_EXIT_IO, .str = "inout" }, + { .reason = VMCB_EXIT_MC, .str = "mchk" }, + { .reason = VMCB_EXIT_INTR, .str = "extintr" }, + { .reason = VMCB_EXIT_NMI, .str = "nmi" }, + { .reason = VMCB_EXIT_VINTR, .str = "vintr" }, + { .reason = VMCB_EXIT_MSR, .str = "msr" }, + { .reason = VMCB_EXIT_IRET, .str = "iret" }, + { .reason = VMCB_EXIT_MONITOR, .str = "monitor" }, + { .reason = VMCB_EXIT_MWAIT, .str = "mwait" }, + { .reason = VMCB_EXIT_VMRUN, .str = "vmrun" }, + { .reason = VMCB_EXIT_VMMCALL, .str = "vmmcall" }, + { .reason = VMCB_EXIT_VMLOAD, .str = "vmload" }, + { .reason = VMCB_EXIT_VMSAVE, .str = "vmsave" }, + { .reason = VMCB_EXIT_STGI, .str = "stgi" }, + { .reason = VMCB_EXIT_CLGI, .str = "clgi" }, + { .reason = VMCB_EXIT_SKINIT, .str = "skinit" }, + { .reason = VMCB_EXIT_ICEBP, .str = "icebp" }, + { .reason = VMCB_EXIT_INVD, .str = "invd" }, + { .reason = VMCB_EXIT_INVLPGA, .str = "invlpga" }, + }; - switch (reason) { - case VMCB_EXIT_INVALID: - return ("invalvmcb"); - case VMCB_EXIT_SHUTDOWN: - return ("shutdown"); - case VMCB_EXIT_NPF: - return ("nptfault"); - case VMCB_EXIT_PAUSE: - return ("pause"); - case VMCB_EXIT_HLT: - return ("hlt"); - case VMCB_EXIT_CPUID: - return ("cpuid"); - case VMCB_EXIT_IO: - return ("inout"); - case VMCB_EXIT_MC: - return ("mchk"); - case VMCB_EXIT_INTR: - return ("extintr"); - case VMCB_EXIT_NMI: - return ("nmi"); - case VMCB_EXIT_VINTR: - return ("vintr"); - case VMCB_EXIT_MSR: - return ("msr"); - case VMCB_EXIT_IRET: - return ("iret"); - case VMCB_EXIT_MONITOR: - return ("monitor"); - case VMCB_EXIT_MWAIT: - return ("mwait"); - default: - snprintf(reasonbuf, sizeof(reasonbuf), "%#lx", reason); - return (reasonbuf); + for (i = 0; i < nitems(reasons); i++) { + if (reasons[i].reason == reason) + return (reasons[i].str); } + snprintf(reasonbuf, sizeof(reasonbuf), "%#lx", reason); + return (reasonbuf); } #endif /* KTR */ @@ -1504,6 +1519,20 @@ svm_vmexit(struct svm_softc *svm_sc, int vcpu, struct break; case VMCB_EXIT_MWAIT: vmexit->exitcode = VM_EXITCODE_MWAIT; + break; + case VMCB_EXIT_SHUTDOWN: + case VMCB_EXIT_VMRUN: + case VMCB_EXIT_VMMCALL: + case VMCB_EXIT_VMLOAD: + case VMCB_EXIT_VMSAVE: + case VMCB_EXIT_STGI: + case VMCB_EXIT_CLGI: + case VMCB_EXIT_SKINIT: + case VMCB_EXIT_ICEBP: + case VMCB_EXIT_INVD: + case VMCB_EXIT_INVLPGA: + vm_inject_ud(svm_sc->vm, vcpu); + handled = 1; break; default: vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_UNKNOWN, 1); Modified: stable/11/sys/amd64/vmm/amd/vmcb.h ============================================================================== --- stable/11/sys/amd64/vmm/amd/vmcb.h Tue Sep 15 20:25:38 2020 (r365768) +++ stable/11/sys/amd64/vmm/amd/vmcb.h Tue Sep 15 20:26:31 2020 (r365769) @@ -73,8 +73,8 @@ struct svm_softc; #define VMCB_INTCPT_INVD BIT(22) #define VMCB_INTCPT_PAUSE BIT(23) #define VMCB_INTCPT_HLT BIT(24) -#define VMCB_INTCPT_INVPG BIT(25) -#define VMCB_INTCPT_INVPGA BIT(26) +#define VMCB_INTCPT_INVLPG BIT(25) +#define VMCB_INTCPT_INVLPGA BIT(26) #define VMCB_INTCPT_IO BIT(27) #define VMCB_INTCPT_MSR BIT(28) #define VMCB_INTCPT_TASK_SWITCH BIT(29) @@ -136,12 +136,21 @@ struct svm_softc; #define VMCB_EXIT_POPF 0x71 #define VMCB_EXIT_CPUID 0x72 #define VMCB_EXIT_IRET 0x74 +#define VMCB_EXIT_INVD 0x76 #define VMCB_EXIT_PAUSE 0x77 #define VMCB_EXIT_HLT 0x78 +#define VMCB_EXIT_INVLPGA 0x7A #define VMCB_EXIT_IO 0x7B #define VMCB_EXIT_MSR 0x7C #define VMCB_EXIT_SHUTDOWN 0x7F +#define VMCB_EXIT_VMRUN 0x80 +#define VMCB_EXIT_VMMCALL 0x81 +#define VMCB_EXIT_VMLOAD 0x82 #define VMCB_EXIT_VMSAVE 0x83 +#define VMCB_EXIT_STGI 0x84 +#define VMCB_EXIT_CLGI 0x85 +#define VMCB_EXIT_SKINIT 0x86 +#define VMCB_EXIT_ICEBP 0x88 #define VMCB_EXIT_MONITOR 0x8A #define VMCB_EXIT_MWAIT 0x8B #define VMCB_EXIT_NPF 0x400 From owner-svn-src-all@freebsd.org Tue Sep 15 20:47:34 2020 Return-Path: Delivered-To: svn-src-all@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 94AF93DF76E; Tue, 15 Sep 2020 20:47:34 +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 4BrZzp3KsKz4d37; Tue, 15 Sep 2020 20:47:34 +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 56777E033; Tue, 15 Sep 2020 20:47:34 +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 08FKlYIQ009559; Tue, 15 Sep 2020 20:47:34 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FKlYeU009558; Tue, 15 Sep 2020 20:47:34 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009152047.08FKlYeU009558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Tue, 15 Sep 2020 20:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365770 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 365770 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 20:47:34 -0000 Author: bdragon Date: Tue Sep 15 20:47:33 2020 New Revision: 365770 URL: https://svnweb.freebsd.org/changeset/base/365770 Log: [PowerPC64LE] Use correct in_masks table on LE to fix checksumming Due to a check that should have been an endian check being an #if 0, the wrong checksum mask table was being used on LE, which was causing extreme strangeness in DNS resolution -- *some* hosts would be resolvable, but most would not. This fixes DNS resolution. (I am committing some parts of the LE patchset ahead of time to reduce the amount of work I have to do while committing the main patchset.) Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/powerpc/powerpc/in_cksum.c Modified: head/sys/powerpc/powerpc/in_cksum.c ============================================================================== --- head/sys/powerpc/powerpc/in_cksum.c Tue Sep 15 20:26:31 2020 (r365769) +++ head/sys/powerpc/powerpc/in_cksum.c Tue Sep 15 20:47:33 2020 (r365770) @@ -42,6 +42,7 @@ #include /* RCS ID & Copyright macro defns */ +#include #include #include #include @@ -73,7 +74,7 @@ } static const u_int32_t in_masks[] = { -#if 0 +#if _BYTE_ORDER == _LITTLE_ENDIAN /*0 bytes*/ /*1 byte*/ /*2 bytes*/ /*3 bytes*/ 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF, /* offset 0 */ 0x00000000, 0x0000FF00, 0x00FFFF00, 0xFFFFFF00, /* offset 1 */ From owner-svn-src-all@freebsd.org Tue Sep 15 20:54:19 2020 Return-Path: Delivered-To: svn-src-all@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 2D3E63DFF2E; Tue, 15 Sep 2020 20:54:19 +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 4Brb7b0Lnwz4d9X; Tue, 15 Sep 2020 20:54:19 +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 DF581E536; Tue, 15 Sep 2020 20:54: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 08FKsIIq015610; Tue, 15 Sep 2020 20:54:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FKsIw9015609; Tue, 15 Sep 2020 20:54:18 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009152054.08FKsIw9015609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 15 Sep 2020 20:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365771 - head/libexec/ftpd X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/libexec/ftpd X-SVN-Commit-Revision: 365771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 20:54:19 -0000 Author: markj Date: Tue Sep 15 20:54:18 2020 New Revision: 365771 URL: https://svnweb.freebsd.org/changeset/base/365771 Log: ftpd: Exit during authentication if an error occurs after chroot(). admbug: 969 Security: CVE-2020-7468 Modified: head/libexec/ftpd/ftpd.c Modified: head/libexec/ftpd/ftpd.c ============================================================================== --- head/libexec/ftpd/ftpd.c Tue Sep 15 20:47:33 2020 (r365770) +++ head/libexec/ftpd/ftpd.c Tue Sep 15 20:54:18 2020 (r365771) @@ -1595,13 +1595,20 @@ skip: * (uid 0 has no root power over NFS if not mapped explicitly.) */ if (seteuid(pw->pw_uid) < 0) { - reply(550, "Can't set uid."); - goto bad; + if (guest || dochroot) { + fatalerror("Can't set uid."); + } else { + reply(550, "Can't set uid."); + goto bad; + } } + /* + * Do not allow the session to live if we're chroot()'ed and chdir() + * fails. Otherwise the chroot jail can be escaped. + */ if (chdir(homedir) < 0) { if (guest || dochroot) { - reply(550, "Can't change to base directory."); - goto bad; + fatalerror("Can't change to base directory."); } else { if (chdir("/") < 0) { reply(550, "Root is inaccessible."); From owner-svn-src-all@freebsd.org Tue Sep 15 20:55:14 2020 Return-Path: Delivered-To: svn-src-all@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 5A9FD3DFFA9; Tue, 15 Sep 2020 20:55:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Brb8f1mcsz4dPl; Tue, 15 Sep 2020 20:55:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 214DCE426; Tue, 15 Sep 2020 20:55:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08FKtEIn015736; Tue, 15 Sep 2020 20:55:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FKtDl6015735; Tue, 15 Sep 2020 20:55:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009152055.08FKtDl6015735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 15 Sep 2020 20:55:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365772 - stable/12/libexec/ftpd X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/libexec/ftpd X-SVN-Commit-Revision: 365772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 20:55:14 -0000 Author: markj Date: Tue Sep 15 20:55:13 2020 New Revision: 365772 URL: https://svnweb.freebsd.org/changeset/base/365772 Log: MFC r365771: ftpd: Exit during authentication if an error occurs after chroot(). admbug: 969 Security: CVE-2020-7468 Modified: stable/12/libexec/ftpd/ftpd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/ftpd/ftpd.c ============================================================================== --- stable/12/libexec/ftpd/ftpd.c Tue Sep 15 20:54:18 2020 (r365771) +++ stable/12/libexec/ftpd/ftpd.c Tue Sep 15 20:55:13 2020 (r365772) @@ -1595,13 +1595,20 @@ skip: * (uid 0 has no root power over NFS if not mapped explicitly.) */ if (seteuid(pw->pw_uid) < 0) { - reply(550, "Can't set uid."); - goto bad; + if (guest || dochroot) { + fatalerror("Can't set uid."); + } else { + reply(550, "Can't set uid."); + goto bad; + } } + /* + * Do not allow the session to live if we're chroot()'ed and chdir() + * fails. Otherwise the chroot jail can be escaped. + */ if (chdir(homedir) < 0) { if (guest || dochroot) { - reply(550, "Can't change to base directory."); - goto bad; + fatalerror("Can't change to base directory."); } else { if (chdir("/") < 0) { reply(550, "Root is inaccessible."); From owner-svn-src-all@freebsd.org Tue Sep 15 20:56:15 2020 Return-Path: Delivered-To: svn-src-all@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 898663DFFB3; Tue, 15 Sep 2020 20:56:15 +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 4Brb9q34cBz4dQP; Tue, 15 Sep 2020 20:56:15 +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 4CE29E229; Tue, 15 Sep 2020 20:56:15 +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 08FKuFMv015825; Tue, 15 Sep 2020 20:56:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FKuFbL015824; Tue, 15 Sep 2020 20:56:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009152056.08FKuFbL015824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 15 Sep 2020 20:56:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365773 - stable/11/libexec/ftpd X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/libexec/ftpd X-SVN-Commit-Revision: 365773 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 20:56:15 -0000 Author: markj Date: Tue Sep 15 20:56:14 2020 New Revision: 365773 URL: https://svnweb.freebsd.org/changeset/base/365773 Log: MFC r365771: ftpd: Exit during authentication if an error occurs after chroot(). admbug: 969 Security: CVE-2020-7468 Modified: stable/11/libexec/ftpd/ftpd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/ftpd/ftpd.c ============================================================================== --- stable/11/libexec/ftpd/ftpd.c Tue Sep 15 20:55:13 2020 (r365772) +++ stable/11/libexec/ftpd/ftpd.c Tue Sep 15 20:56:14 2020 (r365773) @@ -1593,13 +1593,20 @@ skip: * (uid 0 has no root power over NFS if not mapped explicitly.) */ if (seteuid(pw->pw_uid) < 0) { - reply(550, "Can't set uid."); - goto bad; + if (guest || dochroot) { + fatalerror("Can't set uid."); + } else { + reply(550, "Can't set uid."); + goto bad; + } } + /* + * Do not allow the session to live if we're chroot()'ed and chdir() + * fails. Otherwise the chroot jail can be escaped. + */ if (chdir(homedir) < 0) { if (guest || dochroot) { - reply(550, "Can't change to base directory."); - goto bad; + fatalerror("Can't change to base directory."); } else { if (chdir("/") < 0) { reply(550, "Root is inaccessible."); From owner-svn-src-all@freebsd.org Tue Sep 15 21:00:26 2020 Return-Path: Delivered-To: svn-src-all@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 7ADB23E0129; Tue, 15 Sep 2020 21:00:26 +0000 (UTC) (envelope-from erj@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 4BrbGf2jDTz4dfX; Tue, 15 Sep 2020 21:00:26 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40CE2E22B; Tue, 15 Sep 2020 21:00:26 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08FL0QLB016125; Tue, 15 Sep 2020 21:00:26 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FL0Q3x016124; Tue, 15 Sep 2020 21:00:26 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202009152100.08FL0Q3x016124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Tue, 15 Sep 2020 21:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365774 - head/sys/dev/e1000 X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/dev/e1000 X-SVN-Commit-Revision: 365774 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 21:00:26 -0000 Author: erj Date: Tue Sep 15 21:00:25 2020 New Revision: 365774 URL: https://svnweb.freebsd.org/changeset/base/365774 Log: igb(4): Fix define and includes with RSS option enabled This re-adds the opt_rss.h header to the driver and includes some RSS-specific headers when RSS is defined. PR: 249191 Submitted by: Milosz Kaniewski MFC after: 3 days Modified: head/sys/dev/e1000/if_em.h Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Tue Sep 15 20:56:14 2020 (r365773) +++ head/sys/dev/e1000/if_em.h Tue Sep 15 21:00:25 2020 (r365774) @@ -30,6 +30,7 @@ #include "opt_ddb.h" #include "opt_inet.h" #include "opt_inet6.h" +#include "opt_rss.h" #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_device_polling.h" @@ -69,6 +70,10 @@ #include #include #include +#ifdef RSS +#include +#include +#endif #include #include From owner-svn-src-all@freebsd.org Tue Sep 15 21:04:28 2020 Return-Path: Delivered-To: svn-src-all@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 98D183E03A5; Tue, 15 Sep 2020 21:04:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BrbMJ3Y5Nz4fSW; Tue, 15 Sep 2020 21:04:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DDCEE448; Tue, 15 Sep 2020 21:04:28 +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 08FL4SE3021953; Tue, 15 Sep 2020 21:04:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FL4SrA021951; Tue, 15 Sep 2020 21:04:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009152104.08FL4SrA021951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 15 Sep 2020 21:04:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365775 - in head/sys/amd64/vmm: amd intel X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys/amd64/vmm: amd intel X-SVN-Commit-Revision: 365775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 21:04:28 -0000 Author: emaste Date: Tue Sep 15 21:04:27 2020 New Revision: 365775 URL: https://svnweb.freebsd.org/changeset/base/365775 Log: bhyve: do not permit write access to VMCB / VMCS Reported by: Patrick Mooney Submitted by: jhb Security: CVE-2020-24718 Modified: head/sys/amd64/vmm/amd/svm.c head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Tue Sep 15 21:00:25 2020 (r365774) +++ head/sys/amd64/vmm/amd/svm.c Tue Sep 15 21:04:27 2020 (r365775) @@ -2227,8 +2227,11 @@ svm_setreg(void *arg, int vcpu, int ident, uint64_t va return (svm_modify_intr_shadow(svm_sc, vcpu, val)); } - if (vmcb_write(svm_sc, vcpu, ident, val) == 0) { - return (0); + /* Do not permit user write access to VMCB fields by offset. */ + if (!VMCB_ACCESS_OK(ident)) { + if (vmcb_write(svm_sc, vcpu, ident, val) == 0) { + return (0); + } } reg = swctx_regptr(svm_get_guest_regctx(svm_sc, vcpu), ident); Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Tue Sep 15 21:00:25 2020 (r365774) +++ head/sys/amd64/vmm/intel/vmx.c Tue Sep 15 21:04:27 2020 (r365775) @@ -3341,6 +3341,10 @@ vmx_setreg(void *arg, int vcpu, int reg, uint64_t val) if (vmxctx_setreg(&vmx->ctx[vcpu], reg, val) == 0) return (0); + /* Do not permit user write access to VMCS fields by offset. */ + if (reg < 0) + return (EINVAL); + error = vmcs_setreg(&vmx->vmcs[vcpu], running, reg, val); if (error == 0) { From owner-svn-src-all@freebsd.org Tue Sep 15 21:07:31 2020 Return-Path: Delivered-To: svn-src-all@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 235193E0630; Tue, 15 Sep 2020 21:07:31 +0000 (UTC) (envelope-from erj@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 4BrbQp6tl9z4fLc; Tue, 15 Sep 2020 21:07:30 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC8ABE6AF; Tue, 15 Sep 2020 21:07:30 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08FL7UkN022144; Tue, 15 Sep 2020 21:07:30 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FL7UiO022143; Tue, 15 Sep 2020 21:07:30 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202009152107.08FL7UiO022143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Tue, 15 Sep 2020 21:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365776 - head/sys/dev/e1000 X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/dev/e1000 X-SVN-Commit-Revision: 365776 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 21:07:31 -0000 Author: erj Date: Tue Sep 15 21:07:30 2020 New Revision: 365776 URL: https://svnweb.freebsd.org/changeset/base/365776 Log: e1000: Properly retain promisc flag From Franco: The iflib rewrite forced the promisc flag but it was not reported to the system. Noticed on a stock VM that went into unsolicited promisc mode when dhclient was started during bootup. PR: 248869 Submitted by: Franco Fichtner Reviewed by: erj@ MFC after: 3 days Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Tue Sep 15 21:04:27 2020 (r365775) +++ head/sys/dev/e1000/if_em.c Tue Sep 15 21:07:30 2020 (r365776) @@ -1342,7 +1342,7 @@ em_if_init(if_ctx_t ctx) } /* Don't lose promiscuous settings */ - em_if_set_promisc(ctx, IFF_PROMISC); + em_if_set_promisc(ctx, if_getflags(ifp)); e1000_clear_hw_cntrs_base_generic(&adapter->hw); /* MSI-X configuration for 82574 */ From owner-svn-src-all@freebsd.org Tue Sep 15 21:28:48 2020 Return-Path: Delivered-To: svn-src-all@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 A6C853E0DD8; Tue, 15 Sep 2020 21:28:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BrbvN3xKvz3RWJ; Tue, 15 Sep 2020 21:28:48 +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 6B52AE8AD; Tue, 15 Sep 2020 21:28:48 +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 08FLSmIf034130; Tue, 15 Sep 2020 21:28:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FLSmb8034129; Tue, 15 Sep 2020 21:28:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009152128.08FLSmb8034129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 15 Sep 2020 21:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365777 - in stable: 11/sys/amd64/vmm/amd 11/sys/amd64/vmm/intel 12/sys/amd64/vmm/amd 12/sys/amd64/vmm/intel X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable: 11/sys/amd64/vmm/amd 11/sys/amd64/vmm/intel 12/sys/amd64/vmm/amd 12/sys/amd64/vmm/intel X-SVN-Commit-Revision: 365777 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 21:28:48 -0000 Author: emaste Date: Tue Sep 15 21:28:47 2020 New Revision: 365777 URL: https://svnweb.freebsd.org/changeset/base/365777 Log: MFC r365775: bhyve: do not permit write access to VMCB / VMCS Reported by: Patrick Mooney Submitted by: jhb Security: CVE-2020-24718 Modified: stable/12/sys/amd64/vmm/amd/svm.c stable/12/sys/amd64/vmm/intel/vmx.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/amd64/vmm/amd/svm.c stable/11/sys/amd64/vmm/intel/vmx.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/amd64/vmm/amd/svm.c ============================================================================== --- stable/12/sys/amd64/vmm/amd/svm.c Tue Sep 15 21:07:30 2020 (r365776) +++ stable/12/sys/amd64/vmm/amd/svm.c Tue Sep 15 21:28:47 2020 (r365777) @@ -2205,8 +2205,11 @@ svm_setreg(void *arg, int vcpu, int ident, uint64_t va return (svm_modify_intr_shadow(svm_sc, vcpu, val)); } - if (vmcb_write(svm_sc, vcpu, ident, val) == 0) { - return (0); + /* Do not permit user write access to VMCB fields by offset. */ + if (!VMCB_ACCESS_OK(ident)) { + if (vmcb_write(svm_sc, vcpu, ident, val) == 0) { + return (0); + } } reg = swctx_regptr(svm_get_guest_regctx(svm_sc, vcpu), ident); Modified: stable/12/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/12/sys/amd64/vmm/intel/vmx.c Tue Sep 15 21:07:30 2020 (r365776) +++ stable/12/sys/amd64/vmm/intel/vmx.c Tue Sep 15 21:28:47 2020 (r365777) @@ -3324,6 +3324,10 @@ vmx_setreg(void *arg, int vcpu, int reg, uint64_t val) if (vmxctx_setreg(&vmx->ctx[vcpu], reg, val) == 0) return (0); + /* Do not permit user write access to VMCS fields by offset. */ + if (reg < 0) + return (EINVAL); + error = vmcs_setreg(&vmx->vmcs[vcpu], running, reg, val); if (error == 0) { From owner-svn-src-all@freebsd.org Tue Sep 15 21:28:49 2020 Return-Path: Delivered-To: svn-src-all@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 3BDDC3E0C2E; Tue, 15 Sep 2020 21:28:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BrbvP0t5Hz3RTD; Tue, 15 Sep 2020 21:28:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02931E5EF; Tue, 15 Sep 2020 21:28:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08FLSmkL034137; Tue, 15 Sep 2020 21:28:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FLSmJO034135; Tue, 15 Sep 2020 21:28:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009152128.08FLSmJO034135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 15 Sep 2020 21:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365777 - in stable: 11/sys/amd64/vmm/amd 11/sys/amd64/vmm/intel 12/sys/amd64/vmm/amd 12/sys/amd64/vmm/intel X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable: 11/sys/amd64/vmm/amd 11/sys/amd64/vmm/intel 12/sys/amd64/vmm/amd 12/sys/amd64/vmm/intel X-SVN-Commit-Revision: 365777 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 21:28:49 -0000 Author: emaste Date: Tue Sep 15 21:28:47 2020 New Revision: 365777 URL: https://svnweb.freebsd.org/changeset/base/365777 Log: MFC r365775: bhyve: do not permit write access to VMCB / VMCS Reported by: Patrick Mooney Submitted by: jhb Security: CVE-2020-24718 Modified: stable/11/sys/amd64/vmm/amd/svm.c stable/11/sys/amd64/vmm/intel/vmx.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/amd64/vmm/amd/svm.c stable/12/sys/amd64/vmm/intel/vmx.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/amd64/vmm/amd/svm.c ============================================================================== --- stable/11/sys/amd64/vmm/amd/svm.c Tue Sep 15 21:07:30 2020 (r365776) +++ stable/11/sys/amd64/vmm/amd/svm.c Tue Sep 15 21:28:47 2020 (r365777) @@ -2202,8 +2202,11 @@ svm_setreg(void *arg, int vcpu, int ident, uint64_t va return (svm_modify_intr_shadow(svm_sc, vcpu, val)); } - if (vmcb_write(svm_sc, vcpu, ident, val) == 0) { - return (0); + /* Do not permit user write access to VMCB fields by offset. */ + if (!VMCB_ACCESS_OK(ident)) { + if (vmcb_write(svm_sc, vcpu, ident, val) == 0) { + return (0); + } } reg = swctx_regptr(svm_get_guest_regctx(svm_sc, vcpu), ident); Modified: stable/11/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/11/sys/amd64/vmm/intel/vmx.c Tue Sep 15 21:07:30 2020 (r365776) +++ stable/11/sys/amd64/vmm/intel/vmx.c Tue Sep 15 21:28:47 2020 (r365777) @@ -3215,6 +3215,10 @@ vmx_setreg(void *arg, int vcpu, int reg, uint64_t val) if (vmxctx_setreg(&vmx->ctx[vcpu], reg, val) == 0) return (0); + /* Do not permit user write access to VMCS fields by offset. */ + if (reg < 0) + return (EINVAL); + error = vmcs_setreg(&vmx->vmcs[vcpu], running, reg, val); if (error == 0) { From owner-svn-src-all@freebsd.org Tue Sep 15 21:42:07 2020 Return-Path: Delivered-To: svn-src-all@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 21CBE3E0E74; Tue, 15 Sep 2020 21:42:07 +0000 (UTC) (envelope-from gordon@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 4BrcBk6Pzvz3SX0; Tue, 15 Sep 2020 21:42:06 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF16BECBA; Tue, 15 Sep 2020 21:42:06 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08FLg6P6046150; Tue, 15 Sep 2020 21:42:06 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FLg5Gn046146; Tue, 15 Sep 2020 21:42:05 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202009152142.08FLg5Gn046146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 15 Sep 2020 21:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365778 - in releng: 11.3/sys/dev/usb/net 11.4/sys/dev/usb/net 12.1/sys/dev/usb/net 12.2/sys/dev/usb/net X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.3/sys/dev/usb/net 11.4/sys/dev/usb/net 12.1/sys/dev/usb/net 12.2/sys/dev/usb/net X-SVN-Commit-Revision: 365778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 21:42:07 -0000 Author: gordon Date: Tue Sep 15 21:42:05 2020 New Revision: 365778 URL: https://svnweb.freebsd.org/changeset/base/365778 Log: Fix ure device driver susceptible to packet-in-packet attack. Approved by: so Approved by: re (implicit for releng/12.2) Security: FreeBSD-SA-20:27.ure Security: CVE-2020-7464 Modified: releng/11.3/sys/dev/usb/net/if_ure.c releng/11.4/sys/dev/usb/net/if_ure.c releng/12.1/sys/dev/usb/net/if_ure.c releng/12.2/sys/dev/usb/net/if_ure.c Modified: releng/11.3/sys/dev/usb/net/if_ure.c ============================================================================== --- releng/11.3/sys/dev/usb/net/if_ure.c Tue Sep 15 21:28:47 2020 (r365777) +++ releng/11.3/sys/dev/usb/net/if_ure.c Tue Sep 15 21:42:05 2020 (r365778) @@ -710,7 +710,9 @@ ure_init(struct usb_ether *ue) ~URE_RXDY_GATED_EN); /* Set Rx mode. */ - rxmode = URE_RCR_APM; + rxmode = ure_read_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA); + rxmode &= ~URE_RCR_ACPT_ALL; + rxmode |= URE_RCR_APM; /* If we want promiscuous mode, set the allframes bit. */ if (ifp->if_flags & IFF_PROMISC) Modified: releng/11.4/sys/dev/usb/net/if_ure.c ============================================================================== --- releng/11.4/sys/dev/usb/net/if_ure.c Tue Sep 15 21:28:47 2020 (r365777) +++ releng/11.4/sys/dev/usb/net/if_ure.c Tue Sep 15 21:42:05 2020 (r365778) @@ -710,7 +710,9 @@ ure_init(struct usb_ether *ue) ~URE_RXDY_GATED_EN); /* Set Rx mode. */ - rxmode = URE_RCR_APM; + rxmode = ure_read_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA); + rxmode &= ~URE_RCR_ACPT_ALL; + rxmode |= URE_RCR_APM; /* If we want promiscuous mode, set the allframes bit. */ if (ifp->if_flags & IFF_PROMISC) Modified: releng/12.1/sys/dev/usb/net/if_ure.c ============================================================================== --- releng/12.1/sys/dev/usb/net/if_ure.c Tue Sep 15 21:28:47 2020 (r365777) +++ releng/12.1/sys/dev/usb/net/if_ure.c Tue Sep 15 21:42:05 2020 (r365778) @@ -784,9 +784,10 @@ ure_rxfilter(struct usb_ether *ue) URE_LOCK_ASSERT(sc, MA_OWNED); - rxmode = URE_RCR_APM; - if (ifp->if_flags & IFF_BROADCAST) - rxmode |= URE_RCR_AB; + rxmode = ure_read_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA); + rxmode &= ~(URE_RCR_AAP | URE_RCR_AM); + rxmode |= URE_RCR_APM; /* accept physical match packets */ + rxmode |= URE_RCR_AB; /* always accept broadcasts */ if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { if (ifp->if_flags & IFF_PROMISC) rxmode |= URE_RCR_AAP; Modified: releng/12.2/sys/dev/usb/net/if_ure.c ============================================================================== --- releng/12.2/sys/dev/usb/net/if_ure.c Tue Sep 15 21:28:47 2020 (r365777) +++ releng/12.2/sys/dev/usb/net/if_ure.c Tue Sep 15 21:42:05 2020 (r365778) @@ -784,9 +784,10 @@ ure_rxfilter(struct usb_ether *ue) URE_LOCK_ASSERT(sc, MA_OWNED); - rxmode = URE_RCR_APM; - if (ifp->if_flags & IFF_BROADCAST) - rxmode |= URE_RCR_AB; + rxmode = ure_read_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA); + rxmode &= ~(URE_RCR_AAP | URE_RCR_AM); + rxmode |= URE_RCR_APM; /* accept physical match packets */ + rxmode |= URE_RCR_AB; /* always accept broadcasts */ if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { if (ifp->if_flags & IFF_PROMISC) rxmode |= URE_RCR_AAP; From owner-svn-src-all@freebsd.org Tue Sep 15 21:43:43 2020 Return-Path: Delivered-To: svn-src-all@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 266DE3E1158; Tue, 15 Sep 2020 21:43:43 +0000 (UTC) (envelope-from gordon@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 4BrcDb0Z8Rz3SZk; Tue, 15 Sep 2020 21:43:43 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBED1EABE; Tue, 15 Sep 2020 21:43:42 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08FLhgVR046283; Tue, 15 Sep 2020 21:43:42 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FLhfOm046275; Tue, 15 Sep 2020 21:43:41 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202009152143.08FLhfOm046275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 15 Sep 2020 21:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365779 - in releng: 11.3/sys/amd64/vmm/amd 11.3/sys/amd64/vmm/intel 11.4/sys/amd64/vmm/amd 11.4/sys/amd64/vmm/intel 12.1/sys/amd64/vmm/amd 12.1/sys/amd64/vmm/intel 12.2/sys/amd64/vmm/a... X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.3/sys/amd64/vmm/amd 11.3/sys/amd64/vmm/intel 11.4/sys/amd64/vmm/amd 11.4/sys/amd64/vmm/intel 12.1/sys/amd64/vmm/amd 12.1/sys/amd64/vmm/intel 12.2/sys/amd64/vmm/amd 12.2/sys/amd64/vmm/int... X-SVN-Commit-Revision: 365779 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 21:43:43 -0000 Author: gordon Date: Tue Sep 15 21:43:41 2020 New Revision: 365779 URL: https://svnweb.freebsd.org/changeset/base/365779 Log: Fix bhyve privilege escalation via VMCS access. Approved by: so Approved by: re (implicit for releng/12.2) Security: FreeBSD-SA-20:28.bhyve_vmcs Security: CVE-2020-24718 Modified: releng/11.3/sys/amd64/vmm/amd/svm.c releng/11.3/sys/amd64/vmm/intel/vmx.c releng/11.4/sys/amd64/vmm/amd/svm.c releng/11.4/sys/amd64/vmm/intel/vmx.c releng/12.1/sys/amd64/vmm/amd/svm.c releng/12.1/sys/amd64/vmm/intel/vmx.c releng/12.2/sys/amd64/vmm/amd/svm.c releng/12.2/sys/amd64/vmm/intel/vmx.c Modified: releng/11.3/sys/amd64/vmm/amd/svm.c ============================================================================== --- releng/11.3/sys/amd64/vmm/amd/svm.c Tue Sep 15 21:42:05 2020 (r365778) +++ releng/11.3/sys/amd64/vmm/amd/svm.c Tue Sep 15 21:43:41 2020 (r365779) @@ -469,11 +469,24 @@ vmcb_init(struct svm_softc *sc, int vcpu, uint64_t iop svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_SHUTDOWN); svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_FERR_FREEZE); + svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_INVD); + svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_INVLPGA); svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_MONITOR); svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_MWAIT); /* + * Intercept SVM instructions since AMD enables them in guests otherwise. + * Non-intercepted VMMCALL causes #UD, skip it. + */ + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_VMLOAD); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_VMSAVE); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_STGI); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_CLGI); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_SKINIT); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_ICEBP); + + /* * From section "Canonicalization and Consistency Checks" in APMv2 * the VMRUN intercept bit must be set to pass the consistency check. */ @@ -1217,43 +1230,45 @@ emulate_rdmsr(struct svm_softc *sc, int vcpu, u_int nu static const char * exit_reason_to_str(uint64_t reason) { + int i; static char reasonbuf[32]; + static const struct { + int reason; + const char *str; + } reasons[] = { + { .reason = VMCB_EXIT_INVALID, .str = "invalvmcb" }, + { .reason = VMCB_EXIT_SHUTDOWN, .str = "shutdown" }, + { .reason = VMCB_EXIT_NPF, .str = "nptfault" }, + { .reason = VMCB_EXIT_PAUSE, .str = "pause" }, + { .reason = VMCB_EXIT_HLT, .str = "hlt" }, + { .reason = VMCB_EXIT_CPUID, .str = "cpuid" }, + { .reason = VMCB_EXIT_IO, .str = "inout" }, + { .reason = VMCB_EXIT_MC, .str = "mchk" }, + { .reason = VMCB_EXIT_INTR, .str = "extintr" }, + { .reason = VMCB_EXIT_NMI, .str = "nmi" }, + { .reason = VMCB_EXIT_VINTR, .str = "vintr" }, + { .reason = VMCB_EXIT_MSR, .str = "msr" }, + { .reason = VMCB_EXIT_IRET, .str = "iret" }, + { .reason = VMCB_EXIT_MONITOR, .str = "monitor" }, + { .reason = VMCB_EXIT_MWAIT, .str = "mwait" }, + { .reason = VMCB_EXIT_VMRUN, .str = "vmrun" }, + { .reason = VMCB_EXIT_VMMCALL, .str = "vmmcall" }, + { .reason = VMCB_EXIT_VMLOAD, .str = "vmload" }, + { .reason = VMCB_EXIT_VMSAVE, .str = "vmsave" }, + { .reason = VMCB_EXIT_STGI, .str = "stgi" }, + { .reason = VMCB_EXIT_CLGI, .str = "clgi" }, + { .reason = VMCB_EXIT_SKINIT, .str = "skinit" }, + { .reason = VMCB_EXIT_ICEBP, .str = "icebp" }, + { .reason = VMCB_EXIT_INVD, .str = "invd" }, + { .reason = VMCB_EXIT_INVLPGA, .str = "invlpga" }, + }; - switch (reason) { - case VMCB_EXIT_INVALID: - return ("invalvmcb"); - case VMCB_EXIT_SHUTDOWN: - return ("shutdown"); - case VMCB_EXIT_NPF: - return ("nptfault"); - case VMCB_EXIT_PAUSE: - return ("pause"); - case VMCB_EXIT_HLT: - return ("hlt"); - case VMCB_EXIT_CPUID: - return ("cpuid"); - case VMCB_EXIT_IO: - return ("inout"); - case VMCB_EXIT_MC: - return ("mchk"); - case VMCB_EXIT_INTR: - return ("extintr"); - case VMCB_EXIT_NMI: - return ("nmi"); - case VMCB_EXIT_VINTR: - return ("vintr"); - case VMCB_EXIT_MSR: - return ("msr"); - case VMCB_EXIT_IRET: - return ("iret"); - case VMCB_EXIT_MONITOR: - return ("monitor"); - case VMCB_EXIT_MWAIT: - return ("mwait"); - default: - snprintf(reasonbuf, sizeof(reasonbuf), "%#lx", reason); - return (reasonbuf); + for (i = 0; i < nitems(reasons); i++) { + if (reasons[i].reason == reason) + return (reasons[i].str); } + snprintf(reasonbuf, sizeof(reasonbuf), "%#lx", reason); + return (reasonbuf); } #endif /* KTR */ @@ -1505,6 +1520,20 @@ svm_vmexit(struct svm_softc *svm_sc, int vcpu, struct case VMCB_EXIT_MWAIT: vmexit->exitcode = VM_EXITCODE_MWAIT; break; + case VMCB_EXIT_SHUTDOWN: + case VMCB_EXIT_VMRUN: + case VMCB_EXIT_VMMCALL: + case VMCB_EXIT_VMLOAD: + case VMCB_EXIT_VMSAVE: + case VMCB_EXIT_STGI: + case VMCB_EXIT_CLGI: + case VMCB_EXIT_SKINIT: + case VMCB_EXIT_ICEBP: + case VMCB_EXIT_INVD: + case VMCB_EXIT_INVLPGA: + vm_inject_ud(svm_sc->vm, vcpu); + handled = 1; + break; default: vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_UNKNOWN, 1); break; @@ -2173,8 +2202,11 @@ svm_setreg(void *arg, int vcpu, int ident, uint64_t va return (svm_modify_intr_shadow(svm_sc, vcpu, val)); } - if (vmcb_write(svm_sc, vcpu, ident, val) == 0) { - return (0); + /* Do not permit user write access to VMCB fields by offset. */ + if (!VMCB_ACCESS_OK(ident)) { + if (vmcb_write(svm_sc, vcpu, ident, val) == 0) { + return (0); + } } reg = swctx_regptr(svm_get_guest_regctx(svm_sc, vcpu), ident); Modified: releng/11.3/sys/amd64/vmm/intel/vmx.c ============================================================================== --- releng/11.3/sys/amd64/vmm/intel/vmx.c Tue Sep 15 21:42:05 2020 (r365778) +++ releng/11.3/sys/amd64/vmm/intel/vmx.c Tue Sep 15 21:43:41 2020 (r365779) @@ -3185,6 +3185,10 @@ vmx_setreg(void *arg, int vcpu, int reg, uint64_t val) if (vmxctx_setreg(&vmx->ctx[vcpu], reg, val) == 0) return (0); + /* Do not permit user write access to VMCS fields by offset. */ + if (reg < 0) + return (EINVAL); + error = vmcs_setreg(&vmx->vmcs[vcpu], running, reg, val); if (error == 0) { Modified: releng/11.4/sys/amd64/vmm/amd/svm.c ============================================================================== --- releng/11.4/sys/amd64/vmm/amd/svm.c Tue Sep 15 21:42:05 2020 (r365778) +++ releng/11.4/sys/amd64/vmm/amd/svm.c Tue Sep 15 21:43:41 2020 (r365779) @@ -469,11 +469,24 @@ vmcb_init(struct svm_softc *sc, int vcpu, uint64_t iop svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_SHUTDOWN); svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_FERR_FREEZE); + svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_INVD); + svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_INVLPGA); svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_MONITOR); svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_MWAIT); /* + * Intercept SVM instructions since AMD enables them in guests otherwise. + * Non-intercepted VMMCALL causes #UD, skip it. + */ + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_VMLOAD); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_VMSAVE); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_STGI); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_CLGI); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_SKINIT); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_ICEBP); + + /* * From section "Canonicalization and Consistency Checks" in APMv2 * the VMRUN intercept bit must be set to pass the consistency check. */ @@ -1217,43 +1230,45 @@ emulate_rdmsr(struct svm_softc *sc, int vcpu, u_int nu static const char * exit_reason_to_str(uint64_t reason) { + int i; static char reasonbuf[32]; + static const struct { + int reason; + const char *str; + } reasons[] = { + { .reason = VMCB_EXIT_INVALID, .str = "invalvmcb" }, + { .reason = VMCB_EXIT_SHUTDOWN, .str = "shutdown" }, + { .reason = VMCB_EXIT_NPF, .str = "nptfault" }, + { .reason = VMCB_EXIT_PAUSE, .str = "pause" }, + { .reason = VMCB_EXIT_HLT, .str = "hlt" }, + { .reason = VMCB_EXIT_CPUID, .str = "cpuid" }, + { .reason = VMCB_EXIT_IO, .str = "inout" }, + { .reason = VMCB_EXIT_MC, .str = "mchk" }, + { .reason = VMCB_EXIT_INTR, .str = "extintr" }, + { .reason = VMCB_EXIT_NMI, .str = "nmi" }, + { .reason = VMCB_EXIT_VINTR, .str = "vintr" }, + { .reason = VMCB_EXIT_MSR, .str = "msr" }, + { .reason = VMCB_EXIT_IRET, .str = "iret" }, + { .reason = VMCB_EXIT_MONITOR, .str = "monitor" }, + { .reason = VMCB_EXIT_MWAIT, .str = "mwait" }, + { .reason = VMCB_EXIT_VMRUN, .str = "vmrun" }, + { .reason = VMCB_EXIT_VMMCALL, .str = "vmmcall" }, + { .reason = VMCB_EXIT_VMLOAD, .str = "vmload" }, + { .reason = VMCB_EXIT_VMSAVE, .str = "vmsave" }, + { .reason = VMCB_EXIT_STGI, .str = "stgi" }, + { .reason = VMCB_EXIT_CLGI, .str = "clgi" }, + { .reason = VMCB_EXIT_SKINIT, .str = "skinit" }, + { .reason = VMCB_EXIT_ICEBP, .str = "icebp" }, + { .reason = VMCB_EXIT_INVD, .str = "invd" }, + { .reason = VMCB_EXIT_INVLPGA, .str = "invlpga" }, + }; - switch (reason) { - case VMCB_EXIT_INVALID: - return ("invalvmcb"); - case VMCB_EXIT_SHUTDOWN: - return ("shutdown"); - case VMCB_EXIT_NPF: - return ("nptfault"); - case VMCB_EXIT_PAUSE: - return ("pause"); - case VMCB_EXIT_HLT: - return ("hlt"); - case VMCB_EXIT_CPUID: - return ("cpuid"); - case VMCB_EXIT_IO: - return ("inout"); - case VMCB_EXIT_MC: - return ("mchk"); - case VMCB_EXIT_INTR: - return ("extintr"); - case VMCB_EXIT_NMI: - return ("nmi"); - case VMCB_EXIT_VINTR: - return ("vintr"); - case VMCB_EXIT_MSR: - return ("msr"); - case VMCB_EXIT_IRET: - return ("iret"); - case VMCB_EXIT_MONITOR: - return ("monitor"); - case VMCB_EXIT_MWAIT: - return ("mwait"); - default: - snprintf(reasonbuf, sizeof(reasonbuf), "%#lx", reason); - return (reasonbuf); + for (i = 0; i < nitems(reasons); i++) { + if (reasons[i].reason == reason) + return (reasons[i].str); } + snprintf(reasonbuf, sizeof(reasonbuf), "%#lx", reason); + return (reasonbuf); } #endif /* KTR */ @@ -1505,6 +1520,20 @@ svm_vmexit(struct svm_softc *svm_sc, int vcpu, struct case VMCB_EXIT_MWAIT: vmexit->exitcode = VM_EXITCODE_MWAIT; break; + case VMCB_EXIT_SHUTDOWN: + case VMCB_EXIT_VMRUN: + case VMCB_EXIT_VMMCALL: + case VMCB_EXIT_VMLOAD: + case VMCB_EXIT_VMSAVE: + case VMCB_EXIT_STGI: + case VMCB_EXIT_CLGI: + case VMCB_EXIT_SKINIT: + case VMCB_EXIT_ICEBP: + case VMCB_EXIT_INVD: + case VMCB_EXIT_INVLPGA: + vm_inject_ud(svm_sc->vm, vcpu); + handled = 1; + break; default: vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_UNKNOWN, 1); break; @@ -2173,8 +2202,11 @@ svm_setreg(void *arg, int vcpu, int ident, uint64_t va return (svm_modify_intr_shadow(svm_sc, vcpu, val)); } - if (vmcb_write(svm_sc, vcpu, ident, val) == 0) { - return (0); + /* Do not permit user write access to VMCB fields by offset. */ + if (!VMCB_ACCESS_OK(ident)) { + if (vmcb_write(svm_sc, vcpu, ident, val) == 0) { + return (0); + } } reg = swctx_regptr(svm_get_guest_regctx(svm_sc, vcpu), ident); Modified: releng/11.4/sys/amd64/vmm/intel/vmx.c ============================================================================== --- releng/11.4/sys/amd64/vmm/intel/vmx.c Tue Sep 15 21:42:05 2020 (r365778) +++ releng/11.4/sys/amd64/vmm/intel/vmx.c Tue Sep 15 21:43:41 2020 (r365779) @@ -3215,6 +3215,10 @@ vmx_setreg(void *arg, int vcpu, int reg, uint64_t val) if (vmxctx_setreg(&vmx->ctx[vcpu], reg, val) == 0) return (0); + /* Do not permit user write access to VMCS fields by offset. */ + if (reg < 0) + return (EINVAL); + error = vmcs_setreg(&vmx->vmcs[vcpu], running, reg, val); if (error == 0) { Modified: releng/12.1/sys/amd64/vmm/amd/svm.c ============================================================================== --- releng/12.1/sys/amd64/vmm/amd/svm.c Tue Sep 15 21:42:05 2020 (r365778) +++ releng/12.1/sys/amd64/vmm/amd/svm.c Tue Sep 15 21:43:41 2020 (r365779) @@ -469,11 +469,24 @@ vmcb_init(struct svm_softc *sc, int vcpu, uint64_t iop svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_SHUTDOWN); svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_FERR_FREEZE); + svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_INVD); + svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_INVLPGA); svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_MONITOR); svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_MWAIT); /* + * Intercept SVM instructions since AMD enables them in guests otherwise. + * Non-intercepted VMMCALL causes #UD, skip it. + */ + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_VMLOAD); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_VMSAVE); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_STGI); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_CLGI); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_SKINIT); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_ICEBP); + + /* * From section "Canonicalization and Consistency Checks" in APMv2 * the VMRUN intercept bit must be set to pass the consistency check. */ @@ -1217,43 +1230,45 @@ emulate_rdmsr(struct svm_softc *sc, int vcpu, u_int nu static const char * exit_reason_to_str(uint64_t reason) { + int i; static char reasonbuf[32]; + static const struct { + int reason; + const char *str; + } reasons[] = { + { .reason = VMCB_EXIT_INVALID, .str = "invalvmcb" }, + { .reason = VMCB_EXIT_SHUTDOWN, .str = "shutdown" }, + { .reason = VMCB_EXIT_NPF, .str = "nptfault" }, + { .reason = VMCB_EXIT_PAUSE, .str = "pause" }, + { .reason = VMCB_EXIT_HLT, .str = "hlt" }, + { .reason = VMCB_EXIT_CPUID, .str = "cpuid" }, + { .reason = VMCB_EXIT_IO, .str = "inout" }, + { .reason = VMCB_EXIT_MC, .str = "mchk" }, + { .reason = VMCB_EXIT_INTR, .str = "extintr" }, + { .reason = VMCB_EXIT_NMI, .str = "nmi" }, + { .reason = VMCB_EXIT_VINTR, .str = "vintr" }, + { .reason = VMCB_EXIT_MSR, .str = "msr" }, + { .reason = VMCB_EXIT_IRET, .str = "iret" }, + { .reason = VMCB_EXIT_MONITOR, .str = "monitor" }, + { .reason = VMCB_EXIT_MWAIT, .str = "mwait" }, + { .reason = VMCB_EXIT_VMRUN, .str = "vmrun" }, + { .reason = VMCB_EXIT_VMMCALL, .str = "vmmcall" }, + { .reason = VMCB_EXIT_VMLOAD, .str = "vmload" }, + { .reason = VMCB_EXIT_VMSAVE, .str = "vmsave" }, + { .reason = VMCB_EXIT_STGI, .str = "stgi" }, + { .reason = VMCB_EXIT_CLGI, .str = "clgi" }, + { .reason = VMCB_EXIT_SKINIT, .str = "skinit" }, + { .reason = VMCB_EXIT_ICEBP, .str = "icebp" }, + { .reason = VMCB_EXIT_INVD, .str = "invd" }, + { .reason = VMCB_EXIT_INVLPGA, .str = "invlpga" }, + }; - switch (reason) { - case VMCB_EXIT_INVALID: - return ("invalvmcb"); - case VMCB_EXIT_SHUTDOWN: - return ("shutdown"); - case VMCB_EXIT_NPF: - return ("nptfault"); - case VMCB_EXIT_PAUSE: - return ("pause"); - case VMCB_EXIT_HLT: - return ("hlt"); - case VMCB_EXIT_CPUID: - return ("cpuid"); - case VMCB_EXIT_IO: - return ("inout"); - case VMCB_EXIT_MC: - return ("mchk"); - case VMCB_EXIT_INTR: - return ("extintr"); - case VMCB_EXIT_NMI: - return ("nmi"); - case VMCB_EXIT_VINTR: - return ("vintr"); - case VMCB_EXIT_MSR: - return ("msr"); - case VMCB_EXIT_IRET: - return ("iret"); - case VMCB_EXIT_MONITOR: - return ("monitor"); - case VMCB_EXIT_MWAIT: - return ("mwait"); - default: - snprintf(reasonbuf, sizeof(reasonbuf), "%#lx", reason); - return (reasonbuf); + for (i = 0; i < nitems(reasons); i++) { + if (reasons[i].reason == reason) + return (reasons[i].str); } + snprintf(reasonbuf, sizeof(reasonbuf), "%#lx", reason); + return (reasonbuf); } #endif /* KTR */ @@ -1505,6 +1520,20 @@ svm_vmexit(struct svm_softc *svm_sc, int vcpu, struct case VMCB_EXIT_MWAIT: vmexit->exitcode = VM_EXITCODE_MWAIT; break; + case VMCB_EXIT_SHUTDOWN: + case VMCB_EXIT_VMRUN: + case VMCB_EXIT_VMMCALL: + case VMCB_EXIT_VMLOAD: + case VMCB_EXIT_VMSAVE: + case VMCB_EXIT_STGI: + case VMCB_EXIT_CLGI: + case VMCB_EXIT_SKINIT: + case VMCB_EXIT_ICEBP: + case VMCB_EXIT_INVD: + case VMCB_EXIT_INVLPGA: + vm_inject_ud(svm_sc->vm, vcpu); + handled = 1; + break; default: vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_UNKNOWN, 1); break; @@ -2179,8 +2208,11 @@ svm_setreg(void *arg, int vcpu, int ident, uint64_t va return (svm_modify_intr_shadow(svm_sc, vcpu, val)); } - if (vmcb_write(svm_sc, vcpu, ident, val) == 0) { - return (0); + /* Do not permit user write access to VMCB fields by offset. */ + if (!VMCB_ACCESS_OK(ident)) { + if (vmcb_write(svm_sc, vcpu, ident, val) == 0) { + return (0); + } } reg = swctx_regptr(svm_get_guest_regctx(svm_sc, vcpu), ident); Modified: releng/12.1/sys/amd64/vmm/intel/vmx.c ============================================================================== --- releng/12.1/sys/amd64/vmm/intel/vmx.c Tue Sep 15 21:42:05 2020 (r365778) +++ releng/12.1/sys/amd64/vmm/intel/vmx.c Tue Sep 15 21:43:41 2020 (r365779) @@ -3193,6 +3193,10 @@ vmx_setreg(void *arg, int vcpu, int reg, uint64_t val) if (vmxctx_setreg(&vmx->ctx[vcpu], reg, val) == 0) return (0); + /* Do not permit user write access to VMCS fields by offset. */ + if (reg < 0) + return (EINVAL); + error = vmcs_setreg(&vmx->vmcs[vcpu], running, reg, val); if (error == 0) { Modified: releng/12.2/sys/amd64/vmm/amd/svm.c ============================================================================== --- releng/12.2/sys/amd64/vmm/amd/svm.c Tue Sep 15 21:42:05 2020 (r365778) +++ releng/12.2/sys/amd64/vmm/amd/svm.c Tue Sep 15 21:43:41 2020 (r365779) @@ -466,11 +466,24 @@ vmcb_init(struct svm_softc *sc, int vcpu, uint64_t iop svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_SHUTDOWN); svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_FERR_FREEZE); + svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_INVD); + svm_enable_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_INVLPGA); svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_MONITOR); svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_MWAIT); /* + * Intercept SVM instructions since AMD enables them in guests otherwise. + * Non-intercepted VMMCALL causes #UD, skip it. + */ + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_VMLOAD); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_VMSAVE); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_STGI); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_CLGI); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_SKINIT); + svm_enable_intercept(sc, vcpu, VMCB_CTRL2_INTCPT, VMCB_INTCPT_ICEBP); + + /* * From section "Canonicalization and Consistency Checks" in APMv2 * the VMRUN intercept bit must be set to pass the consistency check. */ @@ -1214,43 +1227,45 @@ emulate_rdmsr(struct svm_softc *sc, int vcpu, u_int nu static const char * exit_reason_to_str(uint64_t reason) { + int i; static char reasonbuf[32]; + static const struct { + int reason; + const char *str; + } reasons[] = { + { .reason = VMCB_EXIT_INVALID, .str = "invalvmcb" }, + { .reason = VMCB_EXIT_SHUTDOWN, .str = "shutdown" }, + { .reason = VMCB_EXIT_NPF, .str = "nptfault" }, + { .reason = VMCB_EXIT_PAUSE, .str = "pause" }, + { .reason = VMCB_EXIT_HLT, .str = "hlt" }, + { .reason = VMCB_EXIT_CPUID, .str = "cpuid" }, + { .reason = VMCB_EXIT_IO, .str = "inout" }, + { .reason = VMCB_EXIT_MC, .str = "mchk" }, + { .reason = VMCB_EXIT_INTR, .str = "extintr" }, + { .reason = VMCB_EXIT_NMI, .str = "nmi" }, + { .reason = VMCB_EXIT_VINTR, .str = "vintr" }, + { .reason = VMCB_EXIT_MSR, .str = "msr" }, + { .reason = VMCB_EXIT_IRET, .str = "iret" }, + { .reason = VMCB_EXIT_MONITOR, .str = "monitor" }, + { .reason = VMCB_EXIT_MWAIT, .str = "mwait" }, + { .reason = VMCB_EXIT_VMRUN, .str = "vmrun" }, + { .reason = VMCB_EXIT_VMMCALL, .str = "vmmcall" }, + { .reason = VMCB_EXIT_VMLOAD, .str = "vmload" }, + { .reason = VMCB_EXIT_VMSAVE, .str = "vmsave" }, + { .reason = VMCB_EXIT_STGI, .str = "stgi" }, + { .reason = VMCB_EXIT_CLGI, .str = "clgi" }, + { .reason = VMCB_EXIT_SKINIT, .str = "skinit" }, + { .reason = VMCB_EXIT_ICEBP, .str = "icebp" }, + { .reason = VMCB_EXIT_INVD, .str = "invd" }, + { .reason = VMCB_EXIT_INVLPGA, .str = "invlpga" }, + }; - switch (reason) { - case VMCB_EXIT_INVALID: - return ("invalvmcb"); - case VMCB_EXIT_SHUTDOWN: - return ("shutdown"); - case VMCB_EXIT_NPF: - return ("nptfault"); - case VMCB_EXIT_PAUSE: - return ("pause"); - case VMCB_EXIT_HLT: - return ("hlt"); - case VMCB_EXIT_CPUID: - return ("cpuid"); - case VMCB_EXIT_IO: - return ("inout"); - case VMCB_EXIT_MC: - return ("mchk"); - case VMCB_EXIT_INTR: - return ("extintr"); - case VMCB_EXIT_NMI: - return ("nmi"); - case VMCB_EXIT_VINTR: - return ("vintr"); - case VMCB_EXIT_MSR: - return ("msr"); - case VMCB_EXIT_IRET: - return ("iret"); - case VMCB_EXIT_MONITOR: - return ("monitor"); - case VMCB_EXIT_MWAIT: - return ("mwait"); - default: - snprintf(reasonbuf, sizeof(reasonbuf), "%#lx", reason); - return (reasonbuf); + for (i = 0; i < nitems(reasons); i++) { + if (reasons[i].reason == reason) + return (reasons[i].str); } + snprintf(reasonbuf, sizeof(reasonbuf), "%#lx", reason); + return (reasonbuf); } #endif /* KTR */ @@ -1502,6 +1517,20 @@ svm_vmexit(struct svm_softc *svm_sc, int vcpu, struct case VMCB_EXIT_MWAIT: vmexit->exitcode = VM_EXITCODE_MWAIT; break; + case VMCB_EXIT_SHUTDOWN: + case VMCB_EXIT_VMRUN: + case VMCB_EXIT_VMMCALL: + case VMCB_EXIT_VMLOAD: + case VMCB_EXIT_VMSAVE: + case VMCB_EXIT_STGI: + case VMCB_EXIT_CLGI: + case VMCB_EXIT_SKINIT: + case VMCB_EXIT_ICEBP: + case VMCB_EXIT_INVD: + case VMCB_EXIT_INVLPGA: + vm_inject_ud(svm_sc->vm, vcpu); + handled = 1; + break; default: vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_UNKNOWN, 1); break; @@ -2176,8 +2205,11 @@ svm_setreg(void *arg, int vcpu, int ident, uint64_t va return (svm_modify_intr_shadow(svm_sc, vcpu, val)); } - if (vmcb_write(svm_sc, vcpu, ident, val) == 0) { - return (0); + /* Do not permit user write access to VMCB fields by offset. */ + if (!VMCB_ACCESS_OK(ident)) { + if (vmcb_write(svm_sc, vcpu, ident, val) == 0) { + return (0); + } } reg = swctx_regptr(svm_get_guest_regctx(svm_sc, vcpu), ident); Modified: releng/12.2/sys/amd64/vmm/intel/vmx.c ============================================================================== --- releng/12.2/sys/amd64/vmm/intel/vmx.c Tue Sep 15 21:42:05 2020 (r365778) +++ releng/12.2/sys/amd64/vmm/intel/vmx.c Tue Sep 15 21:43:41 2020 (r365779) @@ -3236,6 +3236,10 @@ vmx_setreg(void *arg, int vcpu, int reg, uint64_t val) if (vmxctx_setreg(&vmx->ctx[vcpu], reg, val) == 0) return (0); + /* Do not permit user write access to VMCS fields by offset. */ + if (reg < 0) + return (EINVAL); + error = vmcs_setreg(&vmx->vmcs[vcpu], running, reg, val); if (error == 0) { From owner-svn-src-all@freebsd.org Tue Sep 15 21:46:40 2020 Return-Path: Delivered-To: svn-src-all@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 EC41A3E1719; Tue, 15 Sep 2020 21:46:40 +0000 (UTC) (envelope-from gordon@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 4BrcJ063Khz3SyW; Tue, 15 Sep 2020 21:46:40 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B30D8EBD8; Tue, 15 Sep 2020 21:46:40 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08FLkelx046480; Tue, 15 Sep 2020 21:46:40 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FLkdb5046476; Tue, 15 Sep 2020 21:46:39 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202009152146.08FLkdb5046476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 15 Sep 2020 21:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365780 - in releng: 11.3/sys/amd64/vmm/amd 11.4/sys/amd64/vmm/amd 12.1/sys/amd64/vmm/amd 12.2/sys/amd64/vmm/amd X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.3/sys/amd64/vmm/amd 11.4/sys/amd64/vmm/amd 12.1/sys/amd64/vmm/amd 12.2/sys/amd64/vmm/amd X-SVN-Commit-Revision: 365780 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 21:46:41 -0000 Author: gordon Date: Tue Sep 15 21:46:39 2020 New Revision: 365780 URL: https://svnweb.freebsd.org/changeset/base/365780 Log: Fix bhyve SVM guest escape. This actually has a patch to sys/amd64/vmm/amd/svm.c that was accidentally committed as part of r365779. Approved by: so Approved by: re (implicit for releng/12.2) Security: FreeBSD-SA-20:29.bhyve_svm Security: CVE-2020-7467 Modified: releng/11.3/sys/amd64/vmm/amd/vmcb.h releng/11.4/sys/amd64/vmm/amd/vmcb.h releng/12.1/sys/amd64/vmm/amd/vmcb.h releng/12.2/sys/amd64/vmm/amd/vmcb.h Modified: releng/11.3/sys/amd64/vmm/amd/vmcb.h ============================================================================== --- releng/11.3/sys/amd64/vmm/amd/vmcb.h Tue Sep 15 21:43:41 2020 (r365779) +++ releng/11.3/sys/amd64/vmm/amd/vmcb.h Tue Sep 15 21:46:39 2020 (r365780) @@ -73,8 +73,8 @@ struct svm_softc; #define VMCB_INTCPT_INVD BIT(22) #define VMCB_INTCPT_PAUSE BIT(23) #define VMCB_INTCPT_HLT BIT(24) -#define VMCB_INTCPT_INVPG BIT(25) -#define VMCB_INTCPT_INVPGA BIT(26) +#define VMCB_INTCPT_INVLPG BIT(25) +#define VMCB_INTCPT_INVLPGA BIT(26) #define VMCB_INTCPT_IO BIT(27) #define VMCB_INTCPT_MSR BIT(28) #define VMCB_INTCPT_TASK_SWITCH BIT(29) @@ -136,12 +136,21 @@ struct svm_softc; #define VMCB_EXIT_POPF 0x71 #define VMCB_EXIT_CPUID 0x72 #define VMCB_EXIT_IRET 0x74 +#define VMCB_EXIT_INVD 0x76 #define VMCB_EXIT_PAUSE 0x77 #define VMCB_EXIT_HLT 0x78 +#define VMCB_EXIT_INVLPGA 0x7A #define VMCB_EXIT_IO 0x7B #define VMCB_EXIT_MSR 0x7C #define VMCB_EXIT_SHUTDOWN 0x7F +#define VMCB_EXIT_VMRUN 0x80 +#define VMCB_EXIT_VMMCALL 0x81 +#define VMCB_EXIT_VMLOAD 0x82 #define VMCB_EXIT_VMSAVE 0x83 +#define VMCB_EXIT_STGI 0x84 +#define VMCB_EXIT_CLGI 0x85 +#define VMCB_EXIT_SKINIT 0x86 +#define VMCB_EXIT_ICEBP 0x88 #define VMCB_EXIT_MONITOR 0x8A #define VMCB_EXIT_MWAIT 0x8B #define VMCB_EXIT_NPF 0x400 Modified: releng/11.4/sys/amd64/vmm/amd/vmcb.h ============================================================================== --- releng/11.4/sys/amd64/vmm/amd/vmcb.h Tue Sep 15 21:43:41 2020 (r365779) +++ releng/11.4/sys/amd64/vmm/amd/vmcb.h Tue Sep 15 21:46:39 2020 (r365780) @@ -73,8 +73,8 @@ struct svm_softc; #define VMCB_INTCPT_INVD BIT(22) #define VMCB_INTCPT_PAUSE BIT(23) #define VMCB_INTCPT_HLT BIT(24) -#define VMCB_INTCPT_INVPG BIT(25) -#define VMCB_INTCPT_INVPGA BIT(26) +#define VMCB_INTCPT_INVLPG BIT(25) +#define VMCB_INTCPT_INVLPGA BIT(26) #define VMCB_INTCPT_IO BIT(27) #define VMCB_INTCPT_MSR BIT(28) #define VMCB_INTCPT_TASK_SWITCH BIT(29) @@ -136,12 +136,21 @@ struct svm_softc; #define VMCB_EXIT_POPF 0x71 #define VMCB_EXIT_CPUID 0x72 #define VMCB_EXIT_IRET 0x74 +#define VMCB_EXIT_INVD 0x76 #define VMCB_EXIT_PAUSE 0x77 #define VMCB_EXIT_HLT 0x78 +#define VMCB_EXIT_INVLPGA 0x7A #define VMCB_EXIT_IO 0x7B #define VMCB_EXIT_MSR 0x7C #define VMCB_EXIT_SHUTDOWN 0x7F +#define VMCB_EXIT_VMRUN 0x80 +#define VMCB_EXIT_VMMCALL 0x81 +#define VMCB_EXIT_VMLOAD 0x82 #define VMCB_EXIT_VMSAVE 0x83 +#define VMCB_EXIT_STGI 0x84 +#define VMCB_EXIT_CLGI 0x85 +#define VMCB_EXIT_SKINIT 0x86 +#define VMCB_EXIT_ICEBP 0x88 #define VMCB_EXIT_MONITOR 0x8A #define VMCB_EXIT_MWAIT 0x8B #define VMCB_EXIT_NPF 0x400 Modified: releng/12.1/sys/amd64/vmm/amd/vmcb.h ============================================================================== --- releng/12.1/sys/amd64/vmm/amd/vmcb.h Tue Sep 15 21:43:41 2020 (r365779) +++ releng/12.1/sys/amd64/vmm/amd/vmcb.h Tue Sep 15 21:46:39 2020 (r365780) @@ -73,8 +73,8 @@ struct svm_softc; #define VMCB_INTCPT_INVD BIT(22) #define VMCB_INTCPT_PAUSE BIT(23) #define VMCB_INTCPT_HLT BIT(24) -#define VMCB_INTCPT_INVPG BIT(25) -#define VMCB_INTCPT_INVPGA BIT(26) +#define VMCB_INTCPT_INVLPG BIT(25) +#define VMCB_INTCPT_INVLPGA BIT(26) #define VMCB_INTCPT_IO BIT(27) #define VMCB_INTCPT_MSR BIT(28) #define VMCB_INTCPT_TASK_SWITCH BIT(29) @@ -136,12 +136,21 @@ struct svm_softc; #define VMCB_EXIT_POPF 0x71 #define VMCB_EXIT_CPUID 0x72 #define VMCB_EXIT_IRET 0x74 +#define VMCB_EXIT_INVD 0x76 #define VMCB_EXIT_PAUSE 0x77 #define VMCB_EXIT_HLT 0x78 +#define VMCB_EXIT_INVLPGA 0x7A #define VMCB_EXIT_IO 0x7B #define VMCB_EXIT_MSR 0x7C #define VMCB_EXIT_SHUTDOWN 0x7F +#define VMCB_EXIT_VMRUN 0x80 +#define VMCB_EXIT_VMMCALL 0x81 +#define VMCB_EXIT_VMLOAD 0x82 #define VMCB_EXIT_VMSAVE 0x83 +#define VMCB_EXIT_STGI 0x84 +#define VMCB_EXIT_CLGI 0x85 +#define VMCB_EXIT_SKINIT 0x86 +#define VMCB_EXIT_ICEBP 0x88 #define VMCB_EXIT_MONITOR 0x8A #define VMCB_EXIT_MWAIT 0x8B #define VMCB_EXIT_NPF 0x400 Modified: releng/12.2/sys/amd64/vmm/amd/vmcb.h ============================================================================== --- releng/12.2/sys/amd64/vmm/amd/vmcb.h Tue Sep 15 21:43:41 2020 (r365779) +++ releng/12.2/sys/amd64/vmm/amd/vmcb.h Tue Sep 15 21:46:39 2020 (r365780) @@ -73,8 +73,8 @@ struct svm_softc; #define VMCB_INTCPT_INVD BIT(22) #define VMCB_INTCPT_PAUSE BIT(23) #define VMCB_INTCPT_HLT BIT(24) -#define VMCB_INTCPT_INVPG BIT(25) -#define VMCB_INTCPT_INVPGA BIT(26) +#define VMCB_INTCPT_INVLPG BIT(25) +#define VMCB_INTCPT_INVLPGA BIT(26) #define VMCB_INTCPT_IO BIT(27) #define VMCB_INTCPT_MSR BIT(28) #define VMCB_INTCPT_TASK_SWITCH BIT(29) @@ -136,12 +136,21 @@ struct svm_softc; #define VMCB_EXIT_POPF 0x71 #define VMCB_EXIT_CPUID 0x72 #define VMCB_EXIT_IRET 0x74 +#define VMCB_EXIT_INVD 0x76 #define VMCB_EXIT_PAUSE 0x77 #define VMCB_EXIT_HLT 0x78 +#define VMCB_EXIT_INVLPGA 0x7A #define VMCB_EXIT_IO 0x7B #define VMCB_EXIT_MSR 0x7C #define VMCB_EXIT_SHUTDOWN 0x7F +#define VMCB_EXIT_VMRUN 0x80 +#define VMCB_EXIT_VMMCALL 0x81 +#define VMCB_EXIT_VMLOAD 0x82 #define VMCB_EXIT_VMSAVE 0x83 +#define VMCB_EXIT_STGI 0x84 +#define VMCB_EXIT_CLGI 0x85 +#define VMCB_EXIT_SKINIT 0x86 +#define VMCB_EXIT_ICEBP 0x88 #define VMCB_EXIT_MONITOR 0x8A #define VMCB_EXIT_MWAIT 0x8B #define VMCB_EXIT_NPF 0x400 From owner-svn-src-all@freebsd.org Tue Sep 15 21:47:45 2020 Return-Path: Delivered-To: svn-src-all@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 A47863E156C; Tue, 15 Sep 2020 21:47:45 +0000 (UTC) (envelope-from gordon@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 4BrcKF3tFlz3TFB; Tue, 15 Sep 2020 21:47:45 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68F12ED29; Tue, 15 Sep 2020 21:47:45 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08FLljtr046578; Tue, 15 Sep 2020 21:47:45 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FLliAg046574; Tue, 15 Sep 2020 21:47:44 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202009152147.08FLliAg046574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 15 Sep 2020 21:47:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365781 - in releng: 11.3/libexec/ftpd 11.4/libexec/ftpd 12.1/libexec/ftpd 12.2/libexec/ftpd X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.3/libexec/ftpd 11.4/libexec/ftpd 12.1/libexec/ftpd 12.2/libexec/ftpd X-SVN-Commit-Revision: 365781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 21:47:45 -0000 Author: gordon Date: Tue Sep 15 21:47:44 2020 New Revision: 365781 URL: https://svnweb.freebsd.org/changeset/base/365781 Log: Fix ftpd privilege escalation via ftpchroot. Approved by: so Approved by: re (implicit for releng/12.2) Security: FreeBSD-SA-20:30.ftpd Security: CVE-2020-7468 Modified: releng/11.3/libexec/ftpd/ftpd.c releng/11.4/libexec/ftpd/ftpd.c releng/12.1/libexec/ftpd/ftpd.c releng/12.2/libexec/ftpd/ftpd.c Modified: releng/11.3/libexec/ftpd/ftpd.c ============================================================================== --- releng/11.3/libexec/ftpd/ftpd.c Tue Sep 15 21:46:39 2020 (r365780) +++ releng/11.3/libexec/ftpd/ftpd.c Tue Sep 15 21:47:44 2020 (r365781) @@ -1593,13 +1593,20 @@ skip: * (uid 0 has no root power over NFS if not mapped explicitly.) */ if (seteuid(pw->pw_uid) < 0) { - reply(550, "Can't set uid."); - goto bad; + if (guest || dochroot) { + fatalerror("Can't set uid."); + } else { + reply(550, "Can't set uid."); + goto bad; + } } + /* + * Do not allow the session to live if we're chroot()'ed and chdir() + * fails. Otherwise the chroot jail can be escaped. + */ if (chdir(homedir) < 0) { if (guest || dochroot) { - reply(550, "Can't change to base directory."); - goto bad; + fatalerror("Can't change to base directory."); } else { if (chdir("/") < 0) { reply(550, "Root is inaccessible."); Modified: releng/11.4/libexec/ftpd/ftpd.c ============================================================================== --- releng/11.4/libexec/ftpd/ftpd.c Tue Sep 15 21:46:39 2020 (r365780) +++ releng/11.4/libexec/ftpd/ftpd.c Tue Sep 15 21:47:44 2020 (r365781) @@ -1593,13 +1593,20 @@ skip: * (uid 0 has no root power over NFS if not mapped explicitly.) */ if (seteuid(pw->pw_uid) < 0) { - reply(550, "Can't set uid."); - goto bad; + if (guest || dochroot) { + fatalerror("Can't set uid."); + } else { + reply(550, "Can't set uid."); + goto bad; + } } + /* + * Do not allow the session to live if we're chroot()'ed and chdir() + * fails. Otherwise the chroot jail can be escaped. + */ if (chdir(homedir) < 0) { if (guest || dochroot) { - reply(550, "Can't change to base directory."); - goto bad; + fatalerror("Can't change to base directory."); } else { if (chdir("/") < 0) { reply(550, "Root is inaccessible."); Modified: releng/12.1/libexec/ftpd/ftpd.c ============================================================================== --- releng/12.1/libexec/ftpd/ftpd.c Tue Sep 15 21:46:39 2020 (r365780) +++ releng/12.1/libexec/ftpd/ftpd.c Tue Sep 15 21:47:44 2020 (r365781) @@ -1595,13 +1595,20 @@ skip: * (uid 0 has no root power over NFS if not mapped explicitly.) */ if (seteuid(pw->pw_uid) < 0) { - reply(550, "Can't set uid."); - goto bad; + if (guest || dochroot) { + fatalerror("Can't set uid."); + } else { + reply(550, "Can't set uid."); + goto bad; + } } + /* + * Do not allow the session to live if we're chroot()'ed and chdir() + * fails. Otherwise the chroot jail can be escaped. + */ if (chdir(homedir) < 0) { if (guest || dochroot) { - reply(550, "Can't change to base directory."); - goto bad; + fatalerror("Can't change to base directory."); } else { if (chdir("/") < 0) { reply(550, "Root is inaccessible."); Modified: releng/12.2/libexec/ftpd/ftpd.c ============================================================================== --- releng/12.2/libexec/ftpd/ftpd.c Tue Sep 15 21:46:39 2020 (r365780) +++ releng/12.2/libexec/ftpd/ftpd.c Tue Sep 15 21:47:44 2020 (r365781) @@ -1595,13 +1595,20 @@ skip: * (uid 0 has no root power over NFS if not mapped explicitly.) */ if (seteuid(pw->pw_uid) < 0) { - reply(550, "Can't set uid."); - goto bad; + if (guest || dochroot) { + fatalerror("Can't set uid."); + } else { + reply(550, "Can't set uid."); + goto bad; + } } + /* + * Do not allow the session to live if we're chroot()'ed and chdir() + * fails. Otherwise the chroot jail can be escaped. + */ if (chdir(homedir) < 0) { if (guest || dochroot) { - reply(550, "Can't change to base directory."); - goto bad; + fatalerror("Can't change to base directory."); } else { if (chdir("/") < 0) { reply(550, "Root is inaccessible."); From owner-svn-src-all@freebsd.org Tue Sep 15 21:48:26 2020 Return-Path: Delivered-To: svn-src-all@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 75F793E1732; Tue, 15 Sep 2020 21:48:26 +0000 (UTC) (envelope-from gordon@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 4BrcL22YFTz3TR4; Tue, 15 Sep 2020 21:48:26 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B001EF39; Tue, 15 Sep 2020 21:48:26 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08FLmQEa046661; Tue, 15 Sep 2020 21:48:26 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FLmOYA046653; Tue, 15 Sep 2020 21:48:24 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202009152148.08FLmOYA046653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 15 Sep 2020 21:48:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365782 - in releng: 11.3 11.3/sys/conf 11.4 11.4/sys/conf 12.1 12.1/sys/conf 12.2 12.2/sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.3 11.3/sys/conf 11.4 11.4/sys/conf 12.1 12.1/sys/conf 12.2 12.2/sys/conf X-SVN-Commit-Revision: 365782 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 21:48:26 -0000 Author: gordon Date: Tue Sep 15 21:48:24 2020 New Revision: 365782 URL: https://svnweb.freebsd.org/changeset/base/365782 Log: Add UPDATING entries and bump version. Approved by: so Approved by: re (implicit for releng/12.2) Modified: releng/11.3/UPDATING releng/11.3/sys/conf/newvers.sh releng/11.4/UPDATING releng/11.4/sys/conf/newvers.sh releng/12.1/UPDATING releng/12.1/sys/conf/newvers.sh releng/12.2/UPDATING releng/12.2/sys/conf/newvers.sh Modified: releng/11.3/UPDATING ============================================================================== --- releng/11.3/UPDATING Tue Sep 15 21:47:44 2020 (r365781) +++ releng/11.3/UPDATING Tue Sep 15 21:48:24 2020 (r365782) @@ -16,6 +16,20 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20200915 p14 FreeBSD-SA-20:27.ure + FreeBSD-SA-20:28.bhyve_vmcs + FreeBSD-SA-20:29.bhyve_svm + FreeBSD-SA-20:30.ftpd + + Fix ure device driver susceptible to packet-in-packet attack. + [SA-20:27.ure] + + Fix bhyve privilege escalation via VMCS access. [SA-20:28.bhyve_vmcs] + + Fix bhyve SVM guest escape. [SA-20:29.bhyve_svm] + + Fix ftpd privilege escalation via ftpchroot. [SA-20:30.ftpd] + 20200902 p13 FreeBSD-EN-20:17.linuxthread FreeBSD-EN-20:18.getfsstat FreeBSD-SA-20:24.ipv6 Modified: releng/11.3/sys/conf/newvers.sh ============================================================================== --- releng/11.3/sys/conf/newvers.sh Tue Sep 15 21:47:44 2020 (r365781) +++ releng/11.3/sys/conf/newvers.sh Tue Sep 15 21:48:24 2020 (r365782) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.3" -BRANCH="RELEASE-p13" +BRANCH="RELEASE-p14" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/11.4/UPDATING ============================================================================== --- releng/11.4/UPDATING Tue Sep 15 21:47:44 2020 (r365781) +++ releng/11.4/UPDATING Tue Sep 15 21:48:24 2020 (r365782) @@ -16,6 +16,20 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20200915 p4 FreeBSD-SA-20:27.ure + FreeBSD-SA-20:28.bhyve_vmcs + FreeBSD-SA-20:29.bhyve_svm + FreeBSD-SA-20:30.ftpd + + Fix ure device driver susceptible to packet-in-packet attack. + [SA-20:27.ure] + + Fix bhyve privilege escalation via VMCS access. [SA-20:28.bhyve_vmcs] + + Fix bhyve SVM guest escape. [SA-20:29.bhyve_svm] + + Fix ftpd privilege escalation via ftpchroot. [SA-20:30.ftpd] + 20200902 p3 FreeBSD-EN-20:17.linuxthread FreeBSD-EN-20:18.getfsstat FreeBSD-SA-20:25.sctp Modified: releng/11.4/sys/conf/newvers.sh ============================================================================== --- releng/11.4/sys/conf/newvers.sh Tue Sep 15 21:47:44 2020 (r365781) +++ releng/11.4/sys/conf/newvers.sh Tue Sep 15 21:48:24 2020 (r365782) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.4" -BRANCH="RELEASE-p3" +BRANCH="RELEASE-p4" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/12.1/UPDATING ============================================================================== --- releng/12.1/UPDATING Tue Sep 15 21:47:44 2020 (r365781) +++ releng/12.1/UPDATING Tue Sep 15 21:48:24 2020 (r365782) @@ -16,6 +16,20 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20200915 p10 FreeBSD-SA-20:27.ure + FreeBSD-SA-20:28.bhyve_vmcs + FreeBSD-SA-20:29.bhyve_svm + FreeBSD-SA-20:30.ftpd + + Fix ure device driver susceptible to packet-in-packet attack. + [SA-20:27.ure] + + Fix bhyve privilege escalation via VMCS access. [SA-20:28.bhyve_vmcs] + + Fix bhyve SVM guest escape. [SA-20:29.bhyve_svm] + + Fix ftpd privilege escalation via ftpchroot. [SA-20:30.ftpd] + 20200902 p9 FreeBSD-EN-20:17.linuxthread FreeBSD-SA-20:25.sctp FreeBSD-SA-20:26.dhclient Modified: releng/12.1/sys/conf/newvers.sh ============================================================================== --- releng/12.1/sys/conf/newvers.sh Tue Sep 15 21:47:44 2020 (r365781) +++ releng/12.1/sys/conf/newvers.sh Tue Sep 15 21:48:24 2020 (r365782) @@ -46,7 +46,7 @@ TYPE="FreeBSD" REVISION="12.1" -BRANCH="RELEASE-p9" +BRANCH="RELEASE-p10" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/12.2/UPDATING ============================================================================== --- releng/12.2/UPDATING Tue Sep 15 21:47:44 2020 (r365781) +++ releng/12.2/UPDATING Tue Sep 15 21:48:24 2020 (r365782) @@ -16,6 +16,20 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20200915 p1 FreeBSD-SA-20:27.ure + FreeBSD-SA-20:28.bhyve_vmcs + FreeBSD-SA-20:29.bhyve_svm + FreeBSD-SA-20:30.ftpd + + Fix ure device driver susceptible to packet-in-packet attack. + [SA-20:27.ure] + + Fix bhyve privilege escalation via VMCS access. [SA-20:28.bhyve_vmcs] + + Fix bhyve SVM guest escape. [SA-20:29.bhyve_svm] + + Fix ftpd privilege escalation via ftpchroot. [SA-20:30.ftpd] + 20200912: The make.conf(5) MALLOC_PRODUCTION variable, used for disabling and enabling assertions and statistics gathering in malloc(3), has been Modified: releng/12.2/sys/conf/newvers.sh ============================================================================== --- releng/12.2/sys/conf/newvers.sh Tue Sep 15 21:47:44 2020 (r365781) +++ releng/12.2/sys/conf/newvers.sh Tue Sep 15 21:48:24 2020 (r365782) @@ -49,7 +49,7 @@ TYPE="FreeBSD" REVISION="12.2" -BRANCH=${BRANCH_OVERRIDE:-BETA1} +BRANCH=${BRANCH_OVERRIDE:-BETA1-p1} RELEASE="${REVISION}-${BRANCH}" VERSION="${TYPE} ${RELEASE}" From owner-svn-src-all@freebsd.org Tue Sep 15 21:55:23 2020 Return-Path: Delivered-To: svn-src-all@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 497B03E1B06; Tue, 15 Sep 2020 21:55:23 +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 4BrcV317KBz3TcT; Tue, 15 Sep 2020 21:55:23 +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 0B11DEBFC; Tue, 15 Sep 2020 21:55:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08FLtM71052622; Tue, 15 Sep 2020 21:55:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FLtLIX052617; Tue, 15 Sep 2020 21:55:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009152155.08FLtLIX052617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 15 Sep 2020 21:55:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365783 - in head/sys: contrib/openzfs/module/os/freebsd/zfs fs/nfs kern sys ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: contrib/openzfs/module/os/freebsd/zfs fs/nfs kern sys ufs/ffs X-SVN-Commit-Revision: 365783 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 21:55:23 -0000 Author: kib Date: Tue Sep 15 21:55:21 2020 New Revision: 365783 URL: https://svnweb.freebsd.org/changeset/base/365783 Log: Do not copy vp into f_data for DTYPE_VNODE files. The pointer to vnode is already stored into f_vnode, so f_data can be reused. Fix all found users of f_data for DTYPE_VNODE. Provide finit_vnode() helper to initialize file of DTYPE_VNODE type. Reviewed by: markj (previous version) Discussed with: freqlabs (openzfs chunk) Tested by: pho (previous version) Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D26346 Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_file_os.c head/sys/fs/nfs/nfsdport.h head/sys/kern/kern_descrip.c head/sys/kern/vfs_syscalls.c head/sys/sys/file.h head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_file_os.c ============================================================================== --- head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_file_os.c Tue Sep 15 21:48:24 2020 (r365782) +++ head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_file_os.c Tue Sep 15 21:55:21 2020 (r365783) @@ -239,7 +239,7 @@ zfs_file_fsync(zfs_file_t *fp, int flags) if (fp->f_type != DTYPE_VNODE) return (EINVAL); - v = fp->f_data; + v = fp->f_vnode; return (zfs_vop_fsync(v)); } Modified: head/sys/fs/nfs/nfsdport.h ============================================================================== --- head/sys/fs/nfs/nfsdport.h Tue Sep 15 21:48:24 2020 (r365782) +++ head/sys/fs/nfs/nfsdport.h Tue Sep 15 21:55:21 2020 (r365783) @@ -94,7 +94,7 @@ struct nfsexstuff { #define NFSLOCKHASH(f) \ (&nfslockhash[nfsrv_hashfh(f) % nfsrv_lockhashsize]) -#define NFSFPVNODE(f) ((struct vnode *)((f)->f_data)) +#define NFSFPVNODE(f) ((f)->f_vnode) #define NFSFPCRED(f) ((f)->f_cred) #define NFSFPFLAG(f) ((f)->f_flag) Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Tue Sep 15 21:48:24 2020 (r365782) +++ head/sys/kern/kern_descrip.c Tue Sep 15 21:55:21 2020 (r365783) @@ -2622,6 +2622,15 @@ finit(struct file *fp, u_int flag, short type, void *d atomic_store_rel_ptr((volatile uintptr_t *)&fp->f_ops, (uintptr_t)ops); } +void +finit_vnode(struct file *fp, u_int flag, void *data, struct fileops *ops) +{ + fp->f_seqcount[UIO_READ] = 1; + fp->f_seqcount[UIO_WRITE] = 1; + finit(fp, (flag & FMASK) | (fp->f_flag & FHASLOCK), DTYPE_VNODE, + data, ops); +} + int fget_cap_locked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, struct file **fpp, struct filecaps *havecapsp) Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Tue Sep 15 21:48:24 2020 (r365782) +++ head/sys/kern/vfs_syscalls.c Tue Sep 15 21:55:21 2020 (r365783) @@ -1163,10 +1163,7 @@ kern_openat(struct thread *td, int fd, const char *pat */ if (fp->f_ops == &badfileops) { KASSERT(vp->v_type != VFIFO, ("Unexpected fifo.")); - fp->f_seqcount[UIO_READ] = 1; - fp->f_seqcount[UIO_WRITE] = 1; - finit(fp, (flags & FMASK) | (fp->f_flag & FHASLOCK), - DTYPE_VNODE, vp, &vnops); + finit_vnode(fp, flags, NULL, &vnops); } VOP_UNLOCK(vp); @@ -4138,7 +4135,6 @@ unionread: vp = vp->v_mount->mnt_vnodecovered; VREF(vp); fp->f_vnode = vp; - fp->f_data = vp; foffset = 0; vput(tvp); goto unionread; @@ -4502,10 +4498,7 @@ sys_fhopen(struct thread *td, struct fhopen_args *uap) td->td_dupfd = 0; #endif fp->f_vnode = vp; - fp->f_seqcount[UIO_READ] = 1; - fp->f_seqcount[UIO_WRITE] = 1; - finit(fp, (fmode & FMASK) | (fp->f_flag & FHASLOCK), DTYPE_VNODE, vp, - &vnops); + finit_vnode(fp, fmode, NULL, &vnops); VOP_UNLOCK(vp); if ((fmode & O_TRUNC) != 0) { error = fo_truncate(fp, 0, td->td_ucred, td); Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Tue Sep 15 21:48:24 2020 (r365782) +++ head/sys/sys/file.h Tue Sep 15 21:55:21 2020 (r365783) @@ -268,6 +268,7 @@ fo_fill_kinfo_t vn_fill_kinfo; int vn_fill_kinfo_vnode(struct vnode *vp, struct kinfo_file *kif); void finit(struct file *, u_int, short, void *, struct fileops *); +void finit_vnode(struct file *, u_int, void *, struct fileops *); int fgetvp(struct thread *td, int fd, cap_rights_t *rightsp, struct vnode **vpp); int fgetvp_exec(struct thread *td, int fd, cap_rights_t *rightsp, Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Tue Sep 15 21:48:24 2020 (r365782) +++ head/sys/ufs/ffs/ffs_alloc.c Tue Sep 15 21:55:21 2020 (r365783) @@ -3220,7 +3220,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) if ((error = getvnode(td, cmd.handle, cap_rights_init(&rights, CAP_FSCK), &fp)) != 0) return (error); - vp = fp->f_data; + vp = fp->f_vnode; if (vp->v_type != VREG && vp->v_type != VDIR) { fdrop(fp, td); return (EINVAL); From owner-svn-src-all@freebsd.org Tue Sep 15 22:00:59 2020 Return-Path: Delivered-To: svn-src-all@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 509DF3E17FF; Tue, 15 Sep 2020 22:00:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BrccW1Vvtz3V7H; Tue, 15 Sep 2020 22:00:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16C98EDCC; Tue, 15 Sep 2020 22:00:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08FM0wOj055354; Tue, 15 Sep 2020 22:00:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FM0wqK055353; Tue, 15 Sep 2020 22:00:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009152200.08FM0wqK055353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 15 Sep 2020 22:00:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365784 - 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: 365784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 22:00:59 -0000 Author: kib Date: Tue Sep 15 22:00:58 2020 New Revision: 365784 URL: https://svnweb.freebsd.org/changeset/base/365784 Log: vfs_subr.c: export io_hold_cnt and vn_read_from_obj(). Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D26346 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 Tue Sep 15 21:55:21 2020 (r365783) +++ head/sys/kern/vfs_vnops.c Tue Sep 15 22:00:58 2020 (r365784) @@ -125,7 +125,7 @@ struct fileops vnops = { .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE }; -static const int io_hold_cnt = 16; +const u_int io_hold_cnt = 16; static int vn_io_fault_enable = 1; SYSCTL_INT(_debug, OID_AUTO, vn_io_fault_enable, CTLFLAG_RWTUN, &vn_io_fault_enable, 0, "Enable vn_io_fault lock avoidance"); @@ -848,7 +848,7 @@ get_advice(struct file *fp, struct uio *uio) return (ret); } -static int +int vn_read_from_obj(struct vnode *vp, struct uio *uio) { vm_object_t obj; Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Tue Sep 15 21:55:21 2020 (r365783) +++ head/sys/sys/vnode.h Tue Sep 15 22:00:58 2020 (r365784) @@ -392,6 +392,7 @@ MALLOC_DECLARE(M_VNODE); #endif extern u_int ncsizefactor; +extern const u_int io_hold_cnt; /* * Convert between vnode types and inode formats (since POSIX.1 @@ -734,7 +735,8 @@ int vn_rdwr_inchunks(enum uio_rw rw, struct vnode *vp, size_t len, off_t offset, enum uio_seg segflg, int ioflg, struct ucred *active_cred, struct ucred *file_cred, size_t *aresid, struct thread *td); -int vn_rlimit_fsize(const struct vnode *vn, const struct uio *uio, +int vn_read_from_obj(struct vnode *vp, struct uio *uio); +int vn_rlimit_fsize(const struct vnode *vp, const struct uio *uio, struct thread *td); int vn_start_write(struct vnode *vp, struct mount **mpp, int flags); int vn_start_secondary_write(struct vnode *vp, struct mount **mpp, From owner-svn-src-all@freebsd.org Tue Sep 15 22:06:38 2020 Return-Path: Delivered-To: svn-src-all@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 00AE03E2083; Tue, 15 Sep 2020 22:06:38 +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 4Brcl16K56z3VSD; Tue, 15 Sep 2020 22:06:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB50AEF7D; Tue, 15 Sep 2020 22:06:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08FM6bfn058848; Tue, 15 Sep 2020 22:06:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FM6axa058843; Tue, 15 Sep 2020 22:06:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009152206.08FM6axa058843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 15 Sep 2020 22:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365785 - in head/sys: kern sys ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys ufs/ufs X-SVN-Commit-Revision: 365785 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 22:06:38 -0000 Author: kib Date: Tue Sep 15 22:06:36 2020 New Revision: 365785 URL: https://svnweb.freebsd.org/changeset/base/365785 Log: Convert page cache read to VOP. There are several negative side-effects of not calling into VOP layer at all for page cache reads. The biggest is the missed activation of EVFILT_READ knotes. Also, it allows filesystem to make more fine grained decision to refuse read from page cache. Keep VIRF_PGREAD flag around, it is still useful for nullfs, and for asserts. Reviewed by: markj Tested by: pho Discussed with: mjg Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D26346 Modified: head/sys/kern/vfs_default.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_vnops.c head/sys/kern/vnode_if.src head/sys/sys/vnode.h head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Tue Sep 15 22:00:58 2020 (r365784) +++ head/sys/kern/vfs_default.c Tue Sep 15 22:06:36 2020 (r365785) @@ -90,6 +90,7 @@ static int vop_stdadd_writecount(struct vop_add_writec static int vop_stdcopy_file_range(struct vop_copy_file_range_args *ap); static int vop_stdfdatasync(struct vop_fdatasync_args *ap); static int vop_stdgetpages_async(struct vop_getpages_async_args *ap); +static int vop_stdread_pgcache(struct vop_read_pgcache_args *ap); static int vop_stdstat(struct vop_stat_args *ap); /* @@ -135,6 +136,7 @@ struct vop_vector default_vnodeops = { .vop_poll = vop_nopoll, .vop_putpages = vop_stdputpages, .vop_readlink = VOP_EINVAL, + .vop_read_pgcache = vop_stdread_pgcache, .vop_rename = vop_norename, .vop_revoke = VOP_PANIC, .vop_strategy = vop_nostrategy, @@ -1574,4 +1576,10 @@ vop_stdstat(struct vop_stat_args *a) sb->st_gen = vap->va_gen; out: return (vop_stat_helper_post(a, error)); +} + +static int +vop_stdread_pgcache(struct vop_read_pgcache_args *ap __unused) +{ + return (EJUSTRETURN); } Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Sep 15 22:00:58 2020 (r365784) +++ head/sys/kern/vfs_subr.c Tue Sep 15 22:06:36 2020 (r365785) @@ -5839,6 +5839,15 @@ vop_read_post(void *ap, int rc) } void +vop_read_pgcache_post(void *ap, int rc) +{ + struct vop_read_pgcache_args *a = ap; + + if (!rc) + VFS_KNOTE_UNLOCKED(a->a_vp, NOTE_READ); +} + +void vop_readdir_post(void *ap, int rc) { struct vop_readdir_args *a = ap; Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Tue Sep 15 22:00:58 2020 (r365784) +++ head/sys/kern/vfs_vnops.c Tue Sep 15 22:06:36 2020 (r365785) @@ -951,15 +951,6 @@ out_pip: return (uio->uio_resid == 0 ? 0 : EJUSTRETURN); } -static bool -do_vn_read_from_pgcache(struct vnode *vp, struct uio *uio, struct file *fp) -{ - return ((vp->v_irflag & (VIRF_DOOMED | VIRF_PGREAD)) == VIRF_PGREAD && - !mac_vnode_check_read_enabled() && - uio->uio_resid <= ptoa(io_hold_cnt) && uio->uio_offset >= 0 && - (fp->f_flag & O_DIRECT) == 0 && vn_io_pgcache_read_enable); -} - /* * File table vnode read routine. */ @@ -976,8 +967,19 @@ vn_read(struct file *fp, struct uio *uio, struct ucred uio->uio_td, td)); KASSERT(flags & FOF_OFFSET, ("No FOF_OFFSET")); vp = fp->f_vnode; - if (do_vn_read_from_pgcache(vp, uio, fp)) { - error = vn_read_from_obj(vp, uio); + ioflag = 0; + if (fp->f_flag & FNONBLOCK) + ioflag |= IO_NDELAY; + if (fp->f_flag & O_DIRECT) + ioflag |= IO_DIRECT; + + /* + * Try to read from page cache. VIRF_DOOMED check is racy but + * allows us to avoid unneeded work outright. + */ + if (vn_io_pgcache_read_enable && !mac_vnode_check_read_enabled() && + (vp->v_irflag & (VIRF_DOOMED | VIRF_PGREAD)) == VIRF_PGREAD) { + error = VOP_READ_PGCACHE(vp, uio, ioflag, fp->f_cred); if (error == 0) { fp->f_nextoff[UIO_READ] = uio->uio_offset; return (0); @@ -985,11 +987,7 @@ vn_read(struct file *fp, struct uio *uio, struct ucred if (error != EJUSTRETURN) return (error); } - ioflag = 0; - if (fp->f_flag & FNONBLOCK) - ioflag |= IO_NDELAY; - if (fp->f_flag & O_DIRECT) - ioflag |= IO_DIRECT; + advice = get_advice(fp, uio); vn_lock(vp, LK_SHARED | LK_RETRY); Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Tue Sep 15 22:00:58 2020 (r365784) +++ head/sys/kern/vnode_if.src Tue Sep 15 22:06:36 2020 (r365785) @@ -225,6 +225,17 @@ vop_read { }; +%% read_pgcache vp - - - +%! read_pgcache post vop_read_pgcache_post + +vop_read_pgcache { + IN struct vnode *vp; + INOUT struct uio *uio; + IN int ioflag; + IN struct ucred *cred; +}; + + %% write vp L L L %! write pre VOP_WRITE_PRE %! write post VOP_WRITE_POST Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Tue Sep 15 22:00:58 2020 (r365784) +++ head/sys/sys/vnode.h Tue Sep 15 22:06:36 2020 (r365785) @@ -852,6 +852,7 @@ void vop_mknod_pre(void *a); void vop_mknod_post(void *a, int rc); void vop_open_post(void *a, int rc); void vop_read_post(void *a, int rc); +void vop_read_pgcache_post(void *ap, int rc); void vop_readdir_post(void *a, int rc); void vop_reclaim_post(void *a, int rc); void vop_remove_pre(void *a); Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Tue Sep 15 22:00:58 2020 (r365784) +++ head/sys/ufs/ufs/ufs_vnops.c Tue Sep 15 22:06:36 2020 (r365785) @@ -2874,6 +2874,22 @@ ufs_ioctl(struct vop_ioctl_args *ap) } } +static int +ufs_read_pgcache(struct vop_read_pgcache_args *ap) +{ + struct uio *uio; + struct vnode *vp; + + uio = ap->a_uio; + vp = ap->a_vp; + MPASS((vp->v_irflag & VIRF_PGREAD) != 0); + + if (uio->uio_resid > ptoa(io_hold_cnt) || uio->uio_offset < 0 || + (ap->a_ioflag & IO_DIRECT) != 0) + return (EJUSTRETURN); + return (vn_read_from_obj(vp, uio)); +} + /* Global vfs data structures for ufs. */ struct vop_vector ufs_vnodeops = { .vop_default = &default_vnodeops, @@ -2901,6 +2917,7 @@ struct vop_vector ufs_vnodeops = { .vop_pathconf = ufs_pathconf, .vop_poll = vop_stdpoll, .vop_print = ufs_print, + .vop_read_pgcache = ufs_read_pgcache, .vop_readdir = ufs_readdir, .vop_readlink = ufs_readlink, .vop_reclaim = ufs_reclaim, From owner-svn-src-all@freebsd.org Tue Sep 15 22:13:22 2020 Return-Path: Delivered-To: svn-src-all@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 71AD53E2073; Tue, 15 Sep 2020 22:13:22 +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 4Brctp2Nh4z3VtS; Tue, 15 Sep 2020 22:13:22 +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 35D88F0AD; Tue, 15 Sep 2020 22:13:22 +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 08FMDLk8065413; Tue, 15 Sep 2020 22:13:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FMDLZv065410; Tue, 15 Sep 2020 22:13:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009152213.08FMDLZv065410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 15 Sep 2020 22:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365786 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 365786 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 22:13:22 -0000 Author: kib Date: Tue Sep 15 22:13:21 2020 New Revision: 365786 URL: https://svnweb.freebsd.org/changeset/base/365786 Log: Microoptimize tmpfs node ref/unref by using atomics. Avoid tmpfs mount and node locks when ref count is greater than zero, which is the case until node is being destroyed by unlink or unmount. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D26346 Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Tue Sep 15 22:06:36 2020 (r365785) +++ head/sys/fs/tmpfs/tmpfs.h Tue Sep 15 22:13:21 2020 (r365786) @@ -228,7 +228,7 @@ struct tmpfs_node { int tn_vpstate; /* (i) */ /* Transient refcounter on this node. */ - u_int tn_refcount; /* (m) + (i) */ + u_int tn_refcount; /* 0<->1 (m) + (i) */ /* misc data field for different tn_type node */ union { @@ -412,7 +412,6 @@ struct tmpfs_dir_cursor { */ void tmpfs_ref_node(struct tmpfs_node *node); -void tmpfs_ref_node_locked(struct tmpfs_node *node); int tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *, enum vtype, uid_t uid, gid_t gid, mode_t mode, struct tmpfs_node *, const char *, dev_t, struct tmpfs_node **); Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Tue Sep 15 22:06:36 2020 (r365785) +++ head/sys/fs/tmpfs/tmpfs_subr.c Tue Sep 15 22:13:21 2020 (r365786) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -211,23 +212,17 @@ tmpfs_pages_check_avail(struct tmpfs_mount *tmp, size_ void tmpfs_ref_node(struct tmpfs_node *node) { +#ifdef INVARIANTS + u_int old; - TMPFS_NODE_LOCK(node); - tmpfs_ref_node_locked(node); - TMPFS_NODE_UNLOCK(node); + old = +#endif + refcount_acquire(&node->tn_refcount); +#ifdef INVARIANTS + KASSERT(old > 0, ("node %p zero refcount", node)); +#endif } -void -tmpfs_ref_node_locked(struct tmpfs_node *node) -{ - - TMPFS_NODE_ASSERT_LOCKED(node); - KASSERT(node->tn_refcount > 0, ("node %p zero refcount", node)); - KASSERT(node->tn_refcount < UINT_MAX, ("node %p refcount %u", node, - node->tn_refcount)); - node->tn_refcount++; -} - /* * Allocates a new node of type 'type' inside the 'tmp' mount point, with * its owner set to 'uid', its group to 'gid' and its mode set to 'mode', @@ -370,6 +365,8 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount void tmpfs_free_node(struct tmpfs_mount *tmp, struct tmpfs_node *node) { + if (refcount_release_if_not_last(&node->tn_refcount)) + return; TMPFS_LOCK(tmp); TMPFS_NODE_LOCK(node); @@ -384,19 +381,19 @@ tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct bool detach) { vm_object_t uobj; + bool last; TMPFS_MP_ASSERT_LOCKED(tmp); TMPFS_NODE_ASSERT_LOCKED(node); - KASSERT(node->tn_refcount > 0, ("node %p refcount zero", node)); - node->tn_refcount--; - if (node->tn_attached && (detach || node->tn_refcount == 0)) { + last = refcount_release(&node->tn_refcount); + if (node->tn_attached && (detach || last)) { MPASS(tmp->tm_nodes_inuse > 0); tmp->tm_nodes_inuse--; LIST_REMOVE(node, tn_entries); node->tn_attached = false; } - if (node->tn_refcount > 0) + if (!last) return (false); #ifdef INVARIANTS @@ -596,7 +593,7 @@ tmpfs_alloc_vp(struct mount *mp, struct tmpfs_node *no error = 0; tm = VFS_TO_TMPFS(mp); TMPFS_NODE_LOCK(node); - tmpfs_ref_node_locked(node); + tmpfs_ref_node(node); loop: TMPFS_NODE_ASSERT_LOCKED(node); if ((vp = node->tn_vnode) != NULL) { Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Tue Sep 15 22:06:36 2020 (r365785) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Tue Sep 15 22:13:21 2020 (r365786) @@ -1663,7 +1663,7 @@ restart: if (tnp->tn_type != VDIR) continue; TMPFS_NODE_LOCK(tnp); - tmpfs_ref_node_locked(tnp); + tmpfs_ref_node(tnp); /* * tn_vnode cannot be instantiated while we hold the From owner-svn-src-all@freebsd.org Tue Sep 15 22:19:17 2020 Return-Path: Delivered-To: svn-src-all@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 82E4D3E2434; Tue, 15 Sep 2020 22:19: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 4Brd1d2pdWz3WBG; Tue, 15 Sep 2020 22:19: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 3F823F2A6; Tue, 15 Sep 2020 22:19:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08FMJGuV065725; Tue, 15 Sep 2020 22:19:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FMJGMw065722; Tue, 15 Sep 2020 22:19:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009152219.08FMJGMw065722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 15 Sep 2020 22:19:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365787 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 365787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 22:19:17 -0000 Author: kib Date: Tue Sep 15 22:19:16 2020 New Revision: 365787 URL: https://svnweb.freebsd.org/changeset/base/365787 Log: Add tmpfs page cache read support. Or it could be explained as lockless (for vnode lock) reads. Reads are performed from the node tn_obj object. Tmpfs regular vnode object lifecycle is significantly different from the normal OBJT_VNODE: it is alive as far as ref_count > 0. Ensure liveness of the tmpfs VREG node and consequently v_object inside VOP_READ_PGCACHE by referencing tmpfs node in tmpfs_open(). Provide custom tmpfs fo_close() method on file, to ensure that close is paired with open. Add tmpfs VOP_READ_PGCACHE that takes advantage of all tmpfs quirks. It is quite cheap in code size sense to support page-ins for read for tmpfs even if we do not own tmpfs vnode lock. Also, we can handle holes in tmpfs node without additional efforts, and do not have limitation of the transfer size. Reviewed by: markj Discussed with and benchmarked by: mjg (previous version) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D26346 Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vfsops.c head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Tue Sep 15 22:13:21 2020 (r365786) +++ head/sys/fs/tmpfs/tmpfs.h Tue Sep 15 22:19:16 2020 (r365787) @@ -287,6 +287,7 @@ struct tmpfs_node { * a position within the file is accessed. */ vm_object_t tn_aobj; /* (c) */ + struct tmpfs_mount *tn_tmp; /* (c) */ } tn_reg; } tn_spec; /* (v) */ }; @@ -415,6 +416,7 @@ void tmpfs_ref_node(struct tmpfs_node *node); int tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *, enum vtype, uid_t uid, gid_t gid, mode_t mode, struct tmpfs_node *, const char *, dev_t, struct tmpfs_node **); +int tmpfs_fo_close(struct file *fp, struct thread *td); void tmpfs_free_node(struct tmpfs_mount *, struct tmpfs_node *); bool tmpfs_free_node_locked(struct tmpfs_mount *, struct tmpfs_node *, bool); void tmpfs_free_tmp(struct tmpfs_mount *); @@ -557,6 +559,8 @@ tmpfs_update_getattr(struct vnode *vp) if (__predict_false(node->tn_status & update_flags) != 0) tmpfs_update(vp); } + +extern struct fileops tmpfs_fnops; #endif /* _KERNEL */ Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Tue Sep 15 22:13:21 2020 (r365786) +++ head/sys/fs/tmpfs/tmpfs_subr.c Tue Sep 15 22:19:16 2020 (r365787) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -340,6 +341,7 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount /* OBJ_TMPFS is set together with the setting of vp->v_object */ vm_object_set_flag(obj, OBJ_TMPFS_NODE); VM_OBJECT_WUNLOCK(obj); + nnode->tn_reg.tn_tmp = tmp; break; default: @@ -697,6 +699,7 @@ loop: vp->v_object = object; object->un_pager.swp.swp_tmpfs = vp; vm_object_set_flag(object, OBJ_TMPFS); + vp->v_irflag |= VIRF_PGREAD; VI_UNLOCK(vp); VM_OBJECT_WUNLOCK(object); break; Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Tue Sep 15 22:13:21 2020 (r365786) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Tue Sep 15 22:19:16 2020 (r365787) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -662,6 +663,8 @@ static int tmpfs_init(struct vfsconf *conf) { tmpfs_subr_init(); + memcpy(&tmpfs_fnops, &vnops, sizeof(struct fileops)); + tmpfs_fnops.fo_close = tmpfs_fo_close; return (0); } Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Tue Sep 15 22:13:21 2020 (r365786) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Tue Sep 15 22:19:16 2020 (r365787) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -276,22 +277,25 @@ tmpfs_mknod(struct vop_mknod_args *v) return tmpfs_alloc_file(dvp, vpp, vap, cnp, NULL); } +struct fileops tmpfs_fnops; + static int tmpfs_open(struct vop_open_args *v) { - struct vnode *vp = v->a_vp; - int mode = v->a_mode; - - int error; + struct vnode *vp; struct tmpfs_node *node; + struct file *fp; + int error, mode; - MPASS(VOP_ISLOCKED(vp)); - + vp = v->a_vp; + mode = v->a_mode; node = VP_TO_TMPFS_NODE(vp); - /* The file is still active but all its names have been removed + /* + * The file is still active but all its names have been removed * (e.g. by a "rmdir $(pwd)"). It cannot be opened any more as - * it is about to die. */ + * it is about to die. + */ if (node->tn_links < 1) return (ENOENT); @@ -306,8 +310,13 @@ tmpfs_open(struct vop_open_args *v) vnode_create_vobject(vp, node->tn_size, v->a_td); } - MPASS(VOP_ISLOCKED(vp)); - return error; + fp = v->a_fp; + if (error == 0 && fp != NULL && vp->v_type == VREG) { + tmpfs_ref_node(node); + finit_vnode(fp, mode, node, &tmpfs_fnops); + } + + return (error); } static int @@ -321,6 +330,19 @@ tmpfs_close(struct vop_close_args *v) return (0); } +int +tmpfs_fo_close(struct file *fp, struct thread *td) +{ + struct tmpfs_node *node; + + node = fp->f_data; + if (node != NULL) { + MPASS(node->tn_type == VREG); + tmpfs_free_node(node->tn_reg.tn_tmp, node); + } + return (vnops.fo_close(fp, td)); +} + /* * VOP_FPLOOKUP_VEXEC routines are subject to special circumstances, see * the comment above cache_fplookup for details. @@ -567,6 +589,47 @@ tmpfs_read(struct vop_read_args *v) } static int +tmpfs_read_pgcache(struct vop_read_pgcache_args *v) +{ + struct vnode *vp; + struct tmpfs_node *node; + vm_object_t object; + off_t size; + int error; + + vp = v->a_vp; + MPASS((vp->v_irflag & VIRF_PGREAD) != 0); + + if (v->a_uio->uio_offset < 0) + return (EINVAL); + + error = EJUSTRETURN; + vfs_smr_enter(); + + node = VP_TO_TMPFS_NODE_SMR(vp); + if (node == NULL) + goto out_smr; + MPASS(node->tn_type == VREG); + MPASS(node->tn_refcount >= 1); + object = node->tn_reg.tn_aobj; + if (object == NULL) + goto out_smr; + + MPASS((object->flags & (OBJ_ANON | OBJ_DEAD | OBJ_TMPFS_NODE)) == + OBJ_TMPFS_NODE); + if (!VN_IS_DOOMED(vp)) { + /* size cannot become shorter due to rangelock. */ + size = node->tn_size; + vfs_smr_exit(); + error = uiomove_object(object, size, v->a_uio); + return (error); + } +out_smr: + vfs_smr_exit(); + return (error); +} + +static int tmpfs_write(struct vop_write_args *v) { struct vnode *vp; @@ -1721,6 +1784,7 @@ struct vop_vector tmpfs_vnodeop_entries = { .vop_getattr = tmpfs_getattr, .vop_setattr = tmpfs_setattr, .vop_read = tmpfs_read, + .vop_read_pgcache = tmpfs_read_pgcache, .vop_write = tmpfs_write, .vop_fsync = tmpfs_fsync, .vop_remove = tmpfs_remove, From owner-svn-src-all@freebsd.org Tue Sep 15 23:03:57 2020 Return-Path: Delivered-To: svn-src-all@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 858D23E3590; Tue, 15 Sep 2020 23:03:57 +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 4Brf1934Mrz3YBt; Tue, 15 Sep 2020 23:03:57 +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 4D507F960; Tue, 15 Sep 2020 23:03:57 +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 08FN3vcv095634; Tue, 15 Sep 2020 23:03:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08FN3vkb095633; Tue, 15 Sep 2020 23:03:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009152303.08FN3vkb095633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 15 Sep 2020 23:03:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365788 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365788 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2020 23:03:57 -0000 Author: markj Date: Tue Sep 15 23:03:56 2020 New Revision: 365788 URL: https://svnweb.freebsd.org/changeset/base/365788 Log: Fix locking in uipc_accept(). Reported by: cy MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Tue Sep 15 22:19:16 2020 (r365787) +++ head/sys/kern/uipc_usrreq.c Tue Sep 15 23:03:56 2020 (r365788) @@ -506,7 +506,10 @@ uipc_accept(struct socket *so, struct sockaddr **nam) else sa = &sun_noname; bcopy(sa, *nam, sa->sa_len); - unp_pcb_unlock_pair(unp, unp2); + if (unp2 != NULL) + unp_pcb_unlock_pair(unp, unp2); + else + UNP_PCB_UNLOCK(unp); return (0); } From owner-svn-src-all@freebsd.org Wed Sep 16 02:25:19 2020 Return-Path: Delivered-To: svn-src-all@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 461C43EB100; Wed, 16 Sep 2020 02:25:19 +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 4BrkTW18Wtz44MZ; Wed, 16 Sep 2020 02:25:19 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06A6712188; Wed, 16 Sep 2020 02:25:19 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08G2PIBG018413; Wed, 16 Sep 2020 02:25:18 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08G2PIBr018412; Wed, 16 Sep 2020 02:25:18 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202009160225.08G2PIBr018412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 16 Sep 2020 02:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365789 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 365789 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 02:25:19 -0000 Author: rmacklem Date: Wed Sep 16 02:25:18 2020 New Revision: 365789 URL: https://svnweb.freebsd.org/changeset/base/365789 Log: Fix a LOR between the NFS server and server side krpc. Recent testing of the NFS-over-TLS code found a LOR between the mutex lock used for sessions and the sleep lock used for server side krpc socket structures. The code in nfsrv_checksequence() would call SVC_RELEASE() with the mutex held. Normally this is ok, since all that happens is SVC_RELEASE() decrements a reference count. However, if the socket has just been shut down, SVC_RELEASE() drops the reference count to 0 and acquires a sleep lock during destruction of the server side krpc structure. This patch fixes the problem by moving the SVC_RELEASE() call in nfsrv_checksequence() down a few lines to below where the mutex is released. MFC after: 1 week Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Tue Sep 15 23:03:56 2020 (r365788) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Wed Sep 16 02:25:18 2020 (r365789) @@ -6233,6 +6233,7 @@ nfsrv_checksequence(struct nfsrv_descript *nd, uint32_ * bound as well, do the implicit binding unless a * BindConnectiontoSession has already been done on the session. */ + savxprt = NULL; if (sep->sess_clp->lc_req.nr_client != NULL && sep->sess_cbsess.nfsess_xprt != nd->nd_xprt && (sep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) != 0 && @@ -6245,14 +6246,14 @@ nfsrv_checksequence(struct nfsrv_descript *nd, uint32_ sep->sess_clp->lc_req.nr_client->cl_private; nd->nd_xprt->xp_idletimeout = 0; /* Disable timeout. */ sep->sess_cbsess.nfsess_xprt = nd->nd_xprt; - if (savxprt != NULL) - SVC_RELEASE(savxprt); } *sflagsp = 0; if (sep->sess_clp->lc_req.nr_client == NULL) *sflagsp |= NFSV4SEQ_CBPATHDOWN; NFSUNLOCKSESSION(shp); + if (savxprt != NULL) + SVC_RELEASE(savxprt); if (error == NFSERR_EXPIRED) { *sflagsp |= NFSV4SEQ_EXPIREDALLSTATEREVOKED; error = 0; From owner-svn-src-all@freebsd.org Wed Sep 16 06:02:31 2020 Return-Path: Delivered-To: svn-src-all@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 23DB13EF471; Wed, 16 Sep 2020 06:02:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BrqJ708mmz4GwV; Wed, 16 Sep 2020 06:02:31 +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 DCC6914BAD; Wed, 16 Sep 2020 06:02:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08G62UbK054226; Wed, 16 Sep 2020 06:02:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08G62UFa054224; Wed, 16 Sep 2020 06:02:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009160602.08G62UFa054224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 16 Sep 2020 06:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365790 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 365790 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 06:02:31 -0000 Author: imp Date: Wed Sep 16 06:02:30 2020 New Revision: 365790 URL: https://svnweb.freebsd.org/changeset/base/365790 Log: Use standard bool type, instead of non-standard boolean_t Modified: head/sys/kern/subr_bus.c head/sys/sys/devctl.h Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Wed Sep 16 02:25:18 2020 (r365789) +++ head/sys/kern/subr_bus.c Wed Sep 16 06:02:30 2020 (r365790) @@ -584,7 +584,7 @@ filt_devctl_read(struct knote *kn, long hint) /** * @brief Return whether the userland process is running */ -boolean_t +bool devctl_process_running(void) { return (devsoftc.inuse == 1); Modified: head/sys/sys/devctl.h ============================================================================== --- head/sys/sys/devctl.h Wed Sep 16 02:25:18 2020 (r365789) +++ head/sys/sys/devctl.h Wed Sep 16 06:02:30 2020 (r365790) @@ -35,7 +35,7 @@ * devctl hooks. Typically one should use the devctl_notify * hook to send the message. */ -boolean_t devctl_process_running(void); +bool devctl_process_running(void); void devctl_notify(const char *__system, const char *__subsystem, const char *__type, const char *__data); struct sbuf; From owner-svn-src-all@freebsd.org Wed Sep 16 07:30:18 2020 Return-Path: Delivered-To: svn-src-all@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 C16AC3DB26C; Wed, 16 Sep 2020 07:30:18 +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 4BrsFQ51cbz4N7V; Wed, 16 Sep 2020 07:30:18 +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 8F25F159B5; Wed, 16 Sep 2020 07:30:18 +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 08G7UI03004177; Wed, 16 Sep 2020 07:30:18 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08G7UIO7004176; Wed, 16 Sep 2020 07:30:18 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202009160730.08G7UIO7004176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 16 Sep 2020 07:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365791 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 365791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 07:30:18 -0000 Author: bapt Date: Wed Sep 16 07:30:18 2020 New Revision: 365791 URL: https://svnweb.freebsd.org/changeset/base/365791 Log: Update to 2020.08.19 MFC after: 3 days Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Wed Sep 16 06:02:30 2020 (r365790) +++ head/share/misc/pci_vendors Wed Sep 16 07:30:18 2020 (r365791) @@ -1,9 +1,10 @@ # $FreeBSD$ +# # List of PCI ID's # -# Version: 2020.05.22 -# Date: 2020-05-22 03:15:02 +# Version: 2020.08.19 +# Date: 2020-08-19 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at https://pci-ids.ucw.cz/. @@ -43,6 +44,8 @@ 7a0b SPI Controller 7a0c LPC Controller 7a0f DMA (Direct Memory Access) Controller +# Found on some boards with two sockets + 7a10 Hyper Transport Bridge Controller 7a14 EHCI USB Controller 7a15 Vivante GPU (Graphics Processing Unit) 7a19 PCI-to-PCI Bridge @@ -92,6 +95,8 @@ 1703 ISDN Adapter (PCI Bus, DV, W) 1704 ISDN Adapter (PCI Bus, D, C) 0721 Sapphire, Inc. +0731 Jingjia Microelectronics Co Ltd + 7200 JM7200 Series GPU 0777 Ubiquiti Networks, Inc. 0795 Wired Inc. 6663 Butane II (MPEG2 encoder board) @@ -271,6 +276,9 @@ 0013 53c875a 1000 1000 LSI53C875A PCI to Ultra SCSI Controller 0014 MegaRAID Tri-Mode SAS3516 + 1000 9460 MegaRAID 9460-16i + 1000 9480 MegaRAID 9480-8i8e + 1000 9481 MegaRAID 9480-8e 1028 1f3a PERC H745 Adapter 1028 1f3b PERC H745 Front 1028 1fd4 PERC H745P MX @@ -282,10 +290,15 @@ 8086 9460 RAID Controller RSP3TD160F 8086 9480 RAID Controller RSP3MD088F 0015 MegaRAID Tri-Mode SAS3416 + 1000 9441 MegaRAID 9440-16i 1028 1f3c PERC H345 Adapter 1028 1f3d PERC H345 Front 1d49 0503 ThinkSystem RAID 530-16i PCIe 12Gb Adapter 0016 MegaRAID Tri-Mode SAS3508 + 1000 9461 MegaRAID 9460-8i + 1000 9462 MegaRAID 9460-4i + 1000 9463 MegaRAID 9365-28i + 1000 9464 MegaRAID 9365-24i 1028 1fc9 PERC H840 Adapter 1028 1fcb PERC H740P Adapter 1028 1fcd PERC H740P Mini @@ -296,6 +309,8 @@ 8086 352f Integrated RAID Module RMSP3HD080E 8086 9461 RAID Controller RSP3DD080F 0017 MegaRAID Tri-Mode SAS3408 + 1000 9440 MegaRAID 9440-8i + 1000 9442 MegaRAID 9440-4i 1d49 0500 ThinkSystem RAID 530-8i PCIe 12Gb Adapter 1d49 0502 ThinkSystem RAID 530-8i Dense Adapter 8086 3528 Integrated RAID RMSP3LD060 @@ -696,6 +711,7 @@ 00c2 SAS3324 PCI-Express Fusion-MPT SAS-3 00c3 SAS3324 PCI-Express Fusion-MPT SAS-3 00c4 SAS3224 PCI-Express Fusion-MPT SAS-3 + 1170 0002 SAS3224 PCI Express to 12Gb HBA MEZZ CARD 00c5 SAS3316 PCI-Express Fusion-MPT SAS-3 00c6 SAS3316 PCI-Express Fusion-MPT SAS-3 00c7 SAS3316 PCI-Express Fusion-MPT SAS-3 @@ -743,6 +759,10 @@ 1d49 0205 ThinkSystem 440-16i SAS/SATA PCIe Gen4 12Gb Internal HBA 1d49 0206 ThinkSystem 440-16e SAS/SATA PCIe Gen4 12Gb HBA 00e6 Fusion-MPT 12GSAS/PCIe Secure SAS38xx + 1000 4050 9500-16i Tri-Mode HBA + 1000 4060 9500-8i Tri-Mode HBA + 1000 4070 9500-16e Tri-Mode HBA + 1000 4080 9500-8e Tri-Mode HBA 1028 200b HBA355i Adapter 1028 200c HBA355i Front 1028 200d HBA355e Adapter @@ -926,7 +946,7 @@ 13e9 Ariel 1478 Navi 10 XL Upstream Port of PCI Express Switch 1479 Navi 10 XL Downstream Port of PCI Express Switch - 154c Kryptos + 154c Kryptos [Radeon RX 350] 154e Garfield 1551 Arlene 1552 Pooky @@ -1660,7 +1680,7 @@ 554a R423 [Radeon X800 XT Platinum Edition] 554b R423 [Radeon X800 GT/SE] 1002 0302 Radeon X800 SE - 554d R430 [Radeon X800 XL] + 554d R480 [Radeon X800 GTO2/XL] 1002 0322 All-In-Wonder X800 XL 1458 2124 GV-R80L256V-B (AGP) 554e R430 [All-In-Wonder X800 GT] @@ -1669,7 +1689,7 @@ 5551 R423 GL [FireGL V5100] 5569 R423 [Radeon X800 PRO] (Secondary) 556b R423 [Radeon X800 GT] (Secondary) - 556d R430 [Radeon X800 XL] (Secondary) + 556d R480 [Radeon X800 GTO2/XL] (Secondary) 1458 2125 GV-R80L256V-B (AGP) 556f R430 [Radeon X800] (Secondary) 5571 R423 GL [FireGL V5100] (Secondary) @@ -1911,6 +1931,7 @@ 103c 0b0c Bonaire [FirePro W4300] 103c 230c FirePro W5100 13cc 3d2a MXRT-5600 + 664d Bonaire [FirePro W5100 / Barco MXRT-5600] 6650 Bonaire 6651 Bonaire 6658 Bonaire XTX [Radeon R7 260X/360] @@ -2589,10 +2610,15 @@ 1462 3413 Radeon RX 480 Gaming X 8GB 1462 3416 Radeon RX 570 1462 3418 Radeon RX 580 Armor 4G OC + 1462 341b Radeon RX 570 Armor 8G OC 1462 341e Radeon RX 570 Armor 4G OC 1462 8a92 Radeon RX 580 148c 2372 Radeon RX 480 [Red Dragon] 148c 2373 Radeon RX 470 + 148c 2377 Red Devil RX 580 8G Golden +# https://www.techpowerup.com/vgabios/?manufacturer=Powercolor&model=RX+580 + 148c 2378 Radeon RX 580 + 148c 2379 Radeon RX 570 4G [Red Dragon] 1682 9470 Radeon RX 470 1682 9480 Radeon RX 480 1682 9588 Radeon RX 580 XTR @@ -2605,6 +2631,7 @@ 1849 5030 Phantom Gaming D Radeon RX580 8G OC 1da2 e353 Radeon RX 570 Pulse 4GB 1da2 e366 Nitro+ Radeon RX 570/580/590 + 1da2 e387 Radeon RX 570 Pulse 4GB 67e0 Baffin [Radeon Pro WX 4170] 103c 8270 Radeon Pro WX 4170 103c 8272 Radeon Pro WX 4170 @@ -2624,6 +2651,7 @@ 67ef Baffin [Radeon RX 460/560D / Pro 450/455/460/555/555X/560/560X] 1028 1703 RX 560D OEM OC 2 GB 103c 3421 Radeon RX 460 + 1043 0561 AREZ Radeon RX 560 106b 0160 Radeon Pro 460 106b 0166 Radeon Pro 455 106b 0167 Radeon Pro 450 @@ -2864,7 +2892,8 @@ 686c Vega 10 [Radeon Instinct MI25 MxGPU] 687f Vega 10 XL/XT [Radeon RX Vega 56/64] 1002 0b36 RX Vega64 - 1002 6b76 RX Vega56 + 1002 6b76 RX Vega64 + 1458 230c Radeon RX VEGA 56 GAMING OC 8G 6880 Lexington [Radeon HD 6550M] 103c 163c Pavilion dv6 Radeon HD 6550M 6888 Cypress XT [FirePro V8800] @@ -3483,6 +3512,7 @@ 71c1 RV535 [Radeon X1650 PRO] 174b 0880 Radeon X1700 FSC 71c2 RV530 [Radeon X1600 PRO] + 71c3 RV530 [Radeon X1600 PRO] 71c4 RV530/M56 GL [Mobility FireGL V5200] 17aa 2007 ThinkPad T60p 71c5 RV530/M56-P [Mobility Radeon X1600] @@ -3543,13 +3573,16 @@ 1043 049e Radeon R9 FURY 1043 04a0 Radeon R9 FURY X 174b e329 Radeon R9 FURY - 7310 Navi 10 + 7310 Navi 10 [Radeon Pro W5700X] 7312 Navi 10 [Radeon Pro W5700] 731f Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] + 1458 2313 Radeon RX 5700 XT Gaming OC + 1da2 e411 Radeon RX 5600 XT 7340 Navi 14 [Radeon RX 5500/5500M / Pro 5500M] 7341 Navi 14 [Radeon Pro W5500] 7347 Navi 14 [Radeon Pro W5500M] 734f Navi 14 [Radeon Pro W5300M] + 7360 Navi 12 [Radeon Pro 5600M] 7833 RS350 Host Bridge 7834 RS350 [Radeon 9100 PRO/XT IGP] 7835 RS350M [Mobility Radeon 9000 IGP] @@ -3745,6 +3778,7 @@ 9599 RV635 PRO [Radeon HD 3650 AGP] 95c0 RV620 PRO [Radeon HD 3470] 1002 95c0 Mobility Radeon HD 3470 + 1028 3243 C120D 95c2 RV620/M82 [Mobility Radeon HD 3410/3430] 95c4 RV620/M82 [Mobility Radeon HD 3450/3470] 1002 95c4 Mobility Radeon HD 3400 @@ -3762,6 +3796,7 @@ 9612 RS780M [Mobility Radeon HD 3200] 9613 RS780MC [Mobility Radeon HD 3100] 9614 RS780D [Radeon HD 3300] + 9615 RS780E [Radeon HD 3200] 9616 RS780L [Radeon 3000] 9640 Sumo [Radeon HD 6550D] 9641 Sumo [Radeon HD 6620G] @@ -3875,7 +3910,7 @@ 9917 Trinity [Radeon HD 7620G] 9918 Trinity [Radeon HD 7600G] 9919 Trinity [Radeon HD 7500G] - 991e Bishop + 991e Bishop [Xbox One S APU] 9920 Liverpool [Playstation 4 APU] 9921 Liverpool HDMI/DP Audio Controller 9922 Starshp @@ -4583,6 +4618,8 @@ 1466 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 6 1467 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 7 1468 Zeppelin Cryptographic Coprocessor NTBCCP + 1470 Vega 10 PCIe Bridge + 1471 Vega 10 PCIe Bridge 1480 Starship/Matisse Root Complex 1462 7c37 X570-A PRO motherboard 1481 Starship/Matisse IOMMU @@ -5197,6 +5234,7 @@ 0519 MGA 2064W [Millennium] 051a MGA 1064SG [Mystique] 102b 0100 MGA-1064SG Mystique + 102b 051a MGA-1164SG Mystique 220 102b 1100 MGA-1084SG Mystique 102b 1200 MGA-1084SG Mystique 1100 102b MGA-1084SG Mystique @@ -6680,24 +6718,24 @@ 105d 0009 Imagine 128 series 2e 4Mb DRAM 105d 000a Imagine 128 series 2 8Mb VRAM 105d 000b Imagine 128 series 2 8Mb H-VRAM - 11a4 000a Barco Metheus 5 Megapixel - 13cc 0000 Barco Metheus 5 Megapixel - 13cc 0004 Barco Metheus 5 Megapixel - 13cc 0005 Barco Metheus 5 Megapixel - 13cc 0006 Barco Metheus 5 Megapixel - 13cc 0008 Barco Metheus 5 Megapixel - 13cc 0009 Barco Metheus 5 Megapixel - 13cc 000a Barco Metheus 5 Megapixel - 13cc 000c Barco Metheus 5 Megapixel + 11a4 000a Metheus 5 Megapixel + 13cc 0000 Metheus 5 Megapixel + 13cc 0004 Metheus 5 Megapixel + 13cc 0005 Metheus 5 Megapixel + 13cc 0006 Metheus 5 Megapixel + 13cc 0008 Metheus 5 Megapixel + 13cc 0009 Metheus 5 Megapixel + 13cc 000a Metheus 5 Megapixel + 13cc 000c Metheus 5 Megapixel 493d Imagine 128 T2R [Ticket to Ride] - 11a4 000a Barco Metheus 5 Megapixel, Dual Head - 11a4 000b Barco Metheus 5 Megapixel, Dual Head - 13cc 0002 Barco Metheus 4 Megapixel, Dual Head - 13cc 0003 Barco Metheus 5 Megapixel, Dual Head - 13cc 0007 Barco Metheus 5 Megapixel, Dual Head - 13cc 0008 Barco Metheus 5 Megapixel, Dual Head - 13cc 0009 Barco Metheus 5 Megapixel, Dual Head - 13cc 000a Barco Metheus 5 Megapixel, Dual Head + 11a4 000a Metheus 5 Megapixel, Dual Head + 11a4 000b Metheus 5 Megapixel, Dual Head + 13cc 0002 Metheus 4 Megapixel, Dual Head + 13cc 0003 Metheus 5 Megapixel, Dual Head + 13cc 0007 Metheus 5 Megapixel, Dual Head + 13cc 0008 Metheus 5 Megapixel, Dual Head + 13cc 0009 Metheus 5 Megapixel, Dual Head + 13cc 000a Metheus 5 Megapixel, Dual Head 5348 Revolution 4 105d 0037 Revolution IV-FP AGP (For SGI 1600SW) 11a4 0028 PVS5600M @@ -10442,7 +10480,7 @@ 06eb G98M [Quadro NVS 160M] 06ec G98M [GeForce G 105M] 06ed G98 [GeForce 9600 GT / 9800 GT] - 06ee G98 [GeForce 9600 GT / 9800 GT] + 06ee G98 [GeForce 9600 GT / 9800 GT / GT 240] 06ef G98M [GeForce G 103M] 06f1 G98M [GeForce G 105M] 06f8 G98 [Quadro NVS 420] @@ -11022,6 +11060,7 @@ 0fd3 GK107M [GeForce GT 640M LE] 0fd4 GK107M [GeForce GTX 660M] 0fd5 GK107M [GeForce GT 650M Mac Edition] + 0fd6 GK107M 0fd8 GK107M [GeForce GT 640M Mac Edition] 0fd9 GK107M [GeForce GT 645M] 0fdb GK107M @@ -11038,6 +11077,7 @@ # GRID K1 USM 0fe7 GK107GL [GRID K100 vGPU] 10de 101e GRID K100 + 0fe8 GK107M 0fe9 GK107M [GeForce GT 750M Mac Edition] 0fea GK107M [GeForce GT 755M Mac Edition] 0fec GK107M [GeForce 710A] @@ -11562,6 +11602,7 @@ 11a3 GK104M [GeForce GTX 680MX] 106b 010d iMac 13,2 11a7 GK104M [GeForce GTX 675MX] + 11a9 GK104M [GeForce GTX 870M] 11af GK104GLM [GRID IceCube] 11b0 GK104GL [GRID K240Q / K260Q vGPU] 10de 101a GRID K240Q @@ -11654,8 +11695,10 @@ 1287 GK208B [GeForce GT 730] 1288 GK208B [GeForce GT 720] 1289 GK208 [GeForce GT 710] + 128a GK208B 128b GK208B [GeForce GT 710] 1043 85f7 GT710-SL-1GD5 + 128c GK208B 1290 GK208M [GeForce GT 730M] 103c 2afa GeForce GT 730A 103c 2b04 GeForce GT 730A @@ -11949,12 +11992,12 @@ 1e04 TU102 [GeForce RTX 2080 Ti] 1e07 TU102 [GeForce RTX 2080 Ti Rev. A] 1462 3715 RTX 2080 Ti GAMING X TRIO - 1e2d TU102B - 1e2e TU102B + 1e2d TU102 [GeForce RTX 2080 Ti Engineering Sample] + 1e2e TU102 [GeForce RTX 2080 Ti 12GB Engineering Sample] 1e30 TU102GL [Quadro RTX 6000/8000] 10de 129e Quadro RTX 8000 10de 12ba Quadro RTX 6000 - 1e36 TU102GL + 1e36 TU102GL [Quadro RTX 6000] 1e37 TU102GL [GRID RTX T10-4/T10-8/T10-16] 10de 1347 GRID RTX T10-8 10de 1348 GRID RTX T10-4 @@ -11988,6 +12031,7 @@ 1ed0 TU104BM [GeForce RTX 2080 Mobile] 1ed1 TU104BM [GeForce RTX 2070 SUPER Mobile / Max-Q] 1ed3 TU104BM [GeForce RTX 2080 SUPER Mobile / Max-Q] + 1ef5 TU104GLM [Quadro RTX 5000 Mobile Refresh] 1f02 TU106 [GeForce RTX 2070] 1043 8673 TURBO RTX 2070 1f04 TU106 @@ -11995,6 +12039,7 @@ 1f07 TU106 [GeForce RTX 2070 Rev. A] 1f08 TU106 [GeForce RTX 2060 Rev. A] 1f09 TU106 [GeForce GTX 1660 SUPER] + 1f0a TU106 [GeForce GTX 1650] 1f10 TU106M [GeForce RTX 2070 Mobile] 1f11 TU106M [GeForce RTX 2060 Mobile] 1f12 TU106M [GeForce RTX 2060 Max-Q] @@ -12007,22 +12052,31 @@ 1f50 TU106BM [GeForce RTX 2070 Mobile / Max-Q] 1f51 TU106BM [GeForce RTX 2060 Mobile] 1f54 TU106BM [GeForce RTX 2070 Mobile] + 1f55 TU106BM [GeForce RTX 2060 Mobile] 1f81 TU117 1f82 TU117 [GeForce GTX 1650] 1f91 TU117M [GeForce GTX 1650 Mobile / Max-Q] 1f92 TU117M [GeForce GTX 1650 Mobile] - 1f94 TU117M + 1f94 TU117M [GeForce GTX 1650 Mobile] 1f95 TU117M [GeForce GTX 1650 Ti Mobile] 1f96 TU117M [GeForce GTX 1650 Mobile / Max-Q] + 1f97 TU117M [GeForce MX450] 1f99 TU117M 1fae TU117GL 1fb8 TU117GLM [Quadro T2000 Mobile / Max-Q] 1fb9 TU117GLM [Quadro T1000 Mobile] 1fbf TU117GL + 1fd9 TU117BM [GeForce GTX 1650 Mobile Refresh] + 1ff9 TU117GLM [Quadro T1000 Mobile] + 20b0 GA100 [A100 SXM4 40GB] + 20be GA100 [GRID A100A] + 20bf GA100 [GRID A100B] + 20f1 GA100 [A100 PCIe 40GB] 2182 TU116 [GeForce GTX 1660 Ti] 2183 TU116 2184 TU116 [GeForce GTX 1660] 2187 TU116 [GeForce GTX 1650 SUPER] + 2188 TU116 [GeForce GTX 1650] 2191 TU116M [GeForce GTX 1660 Ti Mobile] 2192 TU116M [GeForce GTX 1650 Ti Mobile] 21ae TU116GL @@ -12450,6 +12504,7 @@ 3fc4 RME Digi9652 (Hammerfall) 3fc5 RME Hammerfall DSP 3fc6 RME Hammerfall DSP MADI + 5005 Alveo U250 7038 FPGA Card XC7VX690T 17aa 402f FPGA XC7VX690T-3FFG1157E 8380 Ellips ProfiXpress Profibus Master @@ -14695,6 +14750,7 @@ 0314 Model 14 Road Runner Frame Grabber 0324 Model 24 Road Runner Frame Grabber 0344 Model 44 Road Runner Frame Grabber + b04e Claxon CXP4 CoaXPress frame grabber 118e Hermstedt GmbH 118f Green Logic 1190 Tripace @@ -15822,6 +15878,7 @@ 0811 SM811 LynxE 0820 SM820 Lynx3D 0910 SM910 + 2262 SM2262/SM2262EN SSD Controller 1270 Olympus Optical Co., Ltd. 1271 GW Instruments 1272 Telematics International @@ -17015,7 +17072,7 @@ 13c9 Eaton Corporation 13ca Iomega Corporation 13cb Yano Electric Co Ltd -13cc Metheus Corporation +13cc BARCO 13cd Compatible Systems Corporation 13ce Cocom A/S 13cf Studio Audio & Video Ltd @@ -18887,6 +18944,7 @@ 16d5 BCM57407 NetXtreme-E 10GBase-T Ethernet Controller 16d6 BCM57412 NetXtreme-E 10Gb RDMA Ethernet Controller 14e4 4120 NetXtreme E-Series Advanced Dual-port 10Gb SFP+ Ethernet Network Daughter Card + 14e4 4126 NetXtreme-E Dual-port 10G SFP+ Ethernet OCP 3.0 Adapter (BCM957412N4120C) 152d 8b20 BCM57412 NetXtreme-E 10Gb RDMA Ethernet Controller 152d 8b22 BCM57412 NetXtreme-E 25Gb RDMA Ethernet Controller 16d7 BCM57414 NetXtreme-E 10Gb/25Gb RDMA Ethernet Controller @@ -18894,11 +18952,13 @@ 14e4 1402 BCM957414A4142CC 10Gb/25Gb Ethernet PCIe 14e4 1404 BCM957414M4142C OCP 2x25G Type1 wRoCE 14e4 4140 NetXtreme E-Series Advanced Dual-port 25Gb SFP28 Network Daughter Card + 14e4 4146 NetXtreme-E Dual-port 25G SFP28 Ethernet OCP 3.0 Adapter (BCM957414N4140C) 1590 020e Ethernet 25Gb 2-port 631SFP28 Adapter 1590 0211 Ethernet 25Gb 2-port 631FLR-SFP28 Adapter 16d8 BCM57416 NetXtreme-E Dual-Media 10G RDMA Ethernet Controller 1028 1feb NetXtreme-E 10Gb SFP+ Adapter - 14e4 4163 BCM957416M4163C OCP 2x10GBT Type1 wRoCE + 14e4 4163 NetXtreme-E Dual-port 10GBASE-T Ethernet OCP 2.0 Adapter (BCM957416M4163C) + 14e4 4166 NetXtreme-E Dual-port 10GBASE-T Ethernet OCP 3.0 Adapter (BCM957416N4160C) 1590 020c Ethernet 10Gb 2-port 535T Adapter 1590 0212 Ethernet 10Gb 2-port 535FLR-T Adapter 16d9 BCM57417 NetXtreme-E 10GBASE-T RDMA Ethernet Controller @@ -18915,6 +18975,7 @@ 16e7 BCM57404 NetXtreme-E Ethernet Partition 16e8 BCM57406 NetXtreme-E Ethernet Partition 16e9 BCM57407 NetXtreme-E 25Gb Ethernet Controller + 16eb BCM57412 NetXtreme-E RDMA Partition 16ec BCM57414 NetXtreme-E Ethernet Partition 16ed BCM57414 NetXtreme-E RDMA Partition 16ee BCM57416 NetXtreme-E Ethernet Partition @@ -18947,6 +19008,8 @@ 103c 30c0 Compaq 6710b 17aa 3a23 IdeaPad S10e 1750 BCM57508 NetXtreme-E 10Gb/25Gb/40Gb/50Gb/100Gb/200Gb Ethernet + 14e4 2100 NetXtreme-E Dual-port 100G QSFP56 Ethernet PCIe4.0 x16 Adapter (BCM957508-P2100G) + 14e4 5208 NetXtreme-E Dual-port 100G QSFP56 Ethernet OCP 3.0 Adapter (BCM957508-N2100G) 1751 BCM57504 NetXtreme-E 10Gb/25Gb/40Gb/50Gb/100Gb/200Gb Ethernet 1752 BCM57502 NetXtreme-E 10Gb/25Gb/40Gb/50Gb Ethernet 1806 BCM5750X NetXtreme-E Ethernet Virtual Function @@ -19126,6 +19189,8 @@ 43a1 BCM4360 802.11ac Wireless Network Adapter 43a2 BCM4360 802.11ac Wireless Network Adapter 43a3 BCM4350 802.11ac Wireless Network Adapter +# Manufactured by Foxconn for Lenovo + 17aa 075a 00JT494 43a9 BCM43217 802.11b/g/n 43aa BCM43131 802.11b/g/n 43ae BCM43162 802.11ac Wireless Network Adapter @@ -19914,6 +19979,7 @@ 0250 Spectrum-3, Flash recovery mode 0251 Spectrum-3, Secure Flash recovery mode 0252 Amos chiplet + 0253 Amos GearBox Manager 0254 Spectrum-4, Flash recovery mode 0255 Spectrum-4, Secure Flash recovery mode 0256 Ofek chiplet @@ -19994,11 +20060,13 @@ 1016 MT27710 Family [ConnectX-4 Lx Virtual Function] 1017 MT27800 Family [ConnectX-5] 15b3 0006 ConnectX®-5 EN network interface card, 100GbE single-port QSFP28, PCIe3.0 x16, tall bracket; MCX515A-CCAT + 15b3 0007 Mellanox ConnectX®-5 MCX516A-CCAT 15b3 0020 ConnectX®-5 EN network interface card, 10/25GbE dual-port SFP28, PCIe3.0 x8, tall bracket ; MCX512A-ACAT 15b3 0068 ConnectX®-5 EN network interface card for OCP2.0, Type 1, with host management, 25GbE dual-port SFP28, PCIe3.0 x8, no bracket Halogen free ; MCX542B-ACAN 1018 MT27800 Family [ConnectX-5 Virtual Function] 1019 MT28800 Family [ConnectX-5 Ex] 15b3 0008 ConnectX-5 Ex EN network interface card, 100GbE dual-port QSFP28, PCIe4.0 x16, tall bracket; MCX516A-CDAT + 15b3 0125 Tencent ConnectX-5 EN Ex network interface card for OCP 3.0, with host management, 50GbE Dual-port QSFP28, PCIe4.0 x16, Thumbscrew (pull-tab) bracket 101a MT28800 Family [ConnectX-5 Ex Virtual Function] 101b MT28908 Family [ConnectX-6] 101c MT28908 Family [ConnectX-6 Virtual Function] @@ -20414,9 +20482,14 @@ 167e ONNTO Corp. 1681 Hercules 1682 XFX Pine Group Inc. + 5701 Radeon 5700 XT Thicc III Ultra c580 Radeon RX 580 1688 CastleNet Technology Inc. 1170 WLAN 802.11b card +168a Utimaco IS GmbH + 2086 CryptoServer Se-Series Hardware Security Module + c040 CryptoServer CSe-Series Hardware Security Module + c051 CryptoServer Se-Series Gen2 Hardware Security Module # nee Atheros Communications, Inc. 168c Qualcomm Atheros 0007 AR5210 Wireless Network Adapter [AR5000 802.11a] @@ -20654,6 +20727,8 @@ 0041 QCA6164 802.11ac Wireless Network Adapter 0042 QCA9377 802.11ac Wireless Network Adapter 11ad 08a6 Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter +# compatible with Lenovo's BIOS lock + 17aa 0901 Qualcomm Atheros QCA9377 Wireless Network Adapter 0046 QCA9984 802.11ac Wave 2 Wireless Network Adapter 0050 QCA9887 802.11ac Wireless Network Adapter 0207 AR5210 Wireless Network Adapter [AR5000 802.11a] @@ -21096,8 +21171,14 @@ 0002 AGN300 802.11 a/b/g True MIMO Wireless Card 1385 6d00 WPNT511 RangeMax 240 Mbps Wireless CardBus Adapter 1737 0054 WPC54GX4 v1 802.11g Wireless-G Notebook Adapter with SRX400 + 0105 MSM8998 PCIe Root Complex + 0108 SM8150/SA8195P PCIe Root Complex + 0300 MDM9x35 LTE Modem + 0301 MDM9640 PCIe Root Complex + 0302 MDM9x55 LTE Modem [Snapdragon X12] 0400 Datacenter Technologies QDF2432 PCI Express Root Port 0401 Datacenter Technologies QDF2400 PCI Express Root Port + 1000 QCS405 PCIe Root Complex 17cc NetChip Technology, Inc 2280 USB 2.0 17cd Cadence Design Systems, Inc. @@ -21918,6 +21999,11 @@ 1966 Orad Hi-Tec Systems 1975 DVG64 family 1977 DVG128 family + 1979 3DVG/UHD3 + 1980 HDV2/UHD2 + 1234 3160 UHD2LC + 1234 3300 Legacy UHD2 + 1234 3410 UHD2 # nee Atheros Communications, Inc. nee Attansic Technology Corp. 1969 Qualcomm Atheros 1026 AR8121/AR8113/AR8114 Gigabit or Fast Ethernet @@ -22292,6 +22378,7 @@ 4254 0552 S952 v3 1ae0 Google, Inc. 0042 Compute Engine Virtual Ethernet [gVNIC] + abcd Airbrush Combined Paintbox IPU/Oscar Edge TPU [Pixel Neural Core] 1ae3 SANBlaze Technology, Inc. 1ae7 First Wise Media GmbH 0520 HFC-S PCI A [X-TENSIONS XC-520] @@ -22358,6 +22445,8 @@ 1050 Virtio GPU # virtio 1.0 1052 Virtio input +# virtio 1.0 + 1053 Virtio socket 1110 Inter-VM shared memory 1af4 1100 QEMU Virtual Machine 1af5 Netezza Corp. @@ -22375,6 +22464,7 @@ 0612 ASM1062 Serial ATA Controller 1849 0612 Motherboard 1042 ASM1042 SuperSpeed USB Host Controller + 1043 1059 K53SM motherboard 1043 8488 P8B WS Motherboard 1849 1042 Motherboard 1080 ASM1083/1085 PCIe to PCI Bridge @@ -22385,6 +22475,7 @@ 1242 ASM1142 USB 3.1 Host Controller 1343 ASM1143 USB 3.1 Host Controller 2142 ASM2142 USB 3.1 Host Controller + 3242 ASM3242 USB 3.2 Host Controller 1b26 Netcope Technologies, a.s. c132 COMBO-LXT155 c1c0 NFB-100G1-e0 @@ -22471,6 +22562,11 @@ 1028 1fe2 BOSS-S1 Adapter 1028 2010 BOSS-S2 Adapter 1d49 0300 ThinkSystem M.2 with Mirroring Enablement Kit + 1d49 0301 ThinkSystem SR630 x16 PCIE with 4 SATA ports Riser + 1d49 0302 ThinkSystem SE350 M.2 SATA 4-Bay Data RAID Mirroring Enablement Kit + 1d49 0303 ThinkSystem SE350 M.2 SATA 4-Bay Data RAID Mirroring Enablement Kit + 1d49 0304 ThinkSystem M.2 SATA 2-Bay RAID Enablement Kit + 1d49 0305 ThinkSystem 7mm SATA 2-Bay Rear RAID Enablement Kit 9235 88SE9235 PCIe 2.0 x2 4-port SATA 6 Gb/s Controller 9445 88SE9445 PCIe 2.0 x4 4-Port SAS/SATA 6 Gbps RAID Controller 9480 88SE9480 SAS/SATA 6Gb/s RAID controller @@ -22766,6 +22862,7 @@ cd01 NVMe SSD Controller ec20 Elastic Network Adapter (ENA) efa0 Elastic Fabric Adapter (EFA) + efa1 Elastic Fabric Adapter (EFA) 1d17 Zhaoxin 070f ZX-100 PCI Express Root Port 0710 ZX-100/ZX-200 PCI Express Root Port @@ -22890,9 +22987,24 @@ 1012 AR-MAN-U200 [Manitou Class Accelerator for U200] 1013 AR-MAN-U250 [Manitou Class Accelerator for U250] 1014 AR-MAN-U280 [Manitou Class Accelerator for U280] + 1015 AR-ARK-BBDEV-FX0 [Arkville 32B DPDK Baseband Device] + 1016 AR-ARK-BBDEV-FX1 [Arkville 64B DPDK Baseband Device] 4200 A5PL-E1-10GETI [10 GbE Ethernet Traffic Instrument] 1d72 Xiaomi -1d78 DERA +1d78 DERA Storage + 1512 TAI NVMe Controller + 1d78 2003 D5457 HHHL 1.6TB NVMe SSD + 1d78 2004 D5437 HHHL 2TB NVMe SSD + 1d78 2005 D5457 HHHL 3.2TB NVMe SSD + 1d78 2006 D5437 HHHL 4TB NVMe SSD + 1d78 2007 D5457 HHHL 6.4TB NVMe SSD + 1d78 2008 D5437 HHHL 8TB NVMe SSD + 1d78 2103 D5457 U.2 1.6TB NVMe SSD + 1d78 2104 D5437 U.2 2TB NVMe SSD + 1d78 2105 D5457 U.2 3.2TB NVMe SSD + 1d78 2106 D5437 U.2 4TB NVMe SSD + 1d78 2107 D5457 U.2 6.4TB NVMe SSD + 1d78 2108 D5437 U.2 8TB NVMe SSD 1d7c Aerotech, Inc. 1d82 NETINT Technologies Inc. 0101 Codensity D400 SSD @@ -22936,6 +23048,7 @@ 1d95 Graphcore Ltd 0001 Colossus GC2 [C2] 0002 Colossus GC1 [S1] +1d97 Shenzhen Longsys Electronics Co., Ltd. 1d9b Facebook, Inc. 0010 Networking DOM Engine 0011 IO Bridge @@ -22945,42 +23058,67 @@ 0001 HL-1000 AI Inference Accelerator [Goya] # PCIe accelerator card for Deep Learning training tasks 1000 HL-2000 AI Training Accelerator [Gaudi] +1db2 ATP ELECTRONICS INC 1dbb NGD Systems, Inc. 1dbf Guizhou Huaxintong Semiconductor Technology Co., Ltd 0401 StarDragon4800 PCI Express Root Port 1dc5 FADU Inc. 1dcd Liqid Inc. -1dd8 Pensando Systems Inc +1dd8 Pensando Systems 1000 DSC Capri Upstream Port 1dd8 4000 Naples 100Gb 2-port QSFP28 x16 8GB 1dd8 4001 Naples 100Gb 2-port QSFP28 x16 4GB 1dd8 4002 Naples 25Gb 2-port SFP28 x8 4GB + 1dd8 4007 DSC-25-OCP 10/25G 2-port 4G RAM 8G eMMC G1 Services Card 1dd8 4008 DSC-25 10/25G 2-port SFP28 x8 4GB RAM 8GB eMMC + 1dd8 400a DSC-100 40/100G 2-port 8G RAM 16G eMMC G1 Services Card + 1dd8 400c DSC-25 10/25G 2-port 4G RAM 8G eMMC G1 Services Card + 1dd8 400d DSP DSC-100 100G 2p QSFP28 Card 1001 DSC Virtual Downstream Port 1dd8 4000 Naples 100Gb 2-port QSFP28 x16 8GB 1dd8 4001 Naples 100Gb 2-port QSFP28 x16 4GB 1dd8 4002 Naples 25Gb 2-port SFP28 x8 4GB + 1dd8 4007 DSC-25-OCP 10/25G 2-port 4G RAM 8G eMMC G1 Services Card 1dd8 4008 DSC-25 10/25G 2-port SFP28 x8 4GB RAM 8GB eMMC + 1dd8 400a DSC-100 40/100G 2-port 8G RAM 16G eMMC G1 Services Card + 1dd8 400c DSC-25 10/25G 2-port 4G RAM 8G eMMC G1 Services Card + 1dd8 400d DSP DSC-100 100G 2p QSFP28 Card 1002 DSC Ethernet Controller 1dd8 4000 Naples 100Gb 2-port QSFP28 x16 8GB 1dd8 4001 Naples 100Gb 2-port QSFP28 x16 4GB 1dd8 4002 Naples 25Gb 2-port SFP28 x8 4GB + 1dd8 4007 DSC-25-OCP 10/25G 2-port 4G RAM 8G eMMC G1 Services Card 1dd8 4008 DSC-25 10/25G 2-port SFP28 x8 4GB RAM 8GB eMMC + 1dd8 400a DSC-100 40/100G 2-port 8G RAM 16G eMMC G1 Services Card + 1dd8 400c DSC-25 10/25G 2-port 4G RAM 8G eMMC G1 Services Card + 1dd8 400d DSP DSC-100 100G 2p QSFP28 Card 1003 DSC Ethernet Controller VF 1dd8 4000 Naples 100Gb 2-port QSFP28 x16 8GB 1dd8 4001 Naples 100Gb 2-port QSFP28 x16 4GB 1dd8 4002 Naples 25Gb 2-port SFP28 x8 4GB + 1dd8 4007 DSC-25-OCP 10/25G 2-port 4G RAM 8G eMMC G1 Services Card 1dd8 4008 DSC-25 10/25G 2-port SFP28 x8 4GB RAM 8GB eMMC + 1dd8 400a DSC-100 40/100G 2-port 8G RAM 16G eMMC G1 Services Card + 1dd8 400c DSC-25 10/25G 2-port 4G RAM 8G eMMC G1 Services Card + 1dd8 400d DSP DSC-100 100G 2p QSFP28 Card 1004 DSC Management Controller 1dd8 4000 Naples 100Gb 2-port QSFP28 x16 8GB 1dd8 4001 Naples 100Gb 2-port QSFP28 x16 4GB 1dd8 4002 Naples 25Gb 2-port SFP28 x8 4GB + 1dd8 4007 DSC-25-OCP 10/25G 2-port 4G RAM 8G eMMC G1 Services Card 1dd8 4008 DSC-25 10/25G 2-port SFP28 x8 4GB RAM 8GB eMMC + 1dd8 400a DSC-100 40/100G 2-port 8G RAM 16G eMMC G1 Services Card + 1dd8 400c DSC-25 10/25G 2-port 4G RAM 8G eMMC G1 Services Card + 1dd8 400d DSP DSC-100 100G 2p QSFP28 Card 1007 DSC Storage Accelerator 1dd8 4000 Naples 100Gb 2-port QSFP28 x16 8GB 1dd8 4001 Naples 100Gb 2-port QSFP28 x16 4GB 1dd8 4002 Naples 25Gb 2-port SFP28 x8 4GB + 1dd8 4007 DSC-25-OCP 10/25G 2-port 4G RAM 8G eMMC G1 Services Card 1dd8 4008 DSC-25 10/25G 2-port SFP28 x8 4GB RAM 8GB eMMC + 1dd8 400a DSC-100 40/100G 2-port 8G RAM 16G eMMC G1 Services Card + 1dd8 400c DSC-25 10/25G 2-port 4G RAM 8G eMMC G1 Services Card + 1dd8 400d DSP DSC-100 100G 2p QSFP28 Card 1de0 Groq 0000 Q100 Tensor Streaming Processor 1de1 Tekram Technology Co.,Ltd. @@ -22991,6 +23129,7 @@ 1de5 Eideticom, Inc 1000 IO Memory Controller 2000 NoLoad Hardware Development Kit +1dee Biwin Storage Technology Co., Ltd. 1def Ampere Computing, LLC e005 eMAG PCI Express Root Port 0 e006 eMAG PCI Express Root Port 1 @@ -23025,6 +23164,25 @@ 1181 TDM 8 Port E1/T1/J1 Adapter 1e0f KIOXIA Corporation 0007 NVMe SSD Controller Cx6 + 1028 2078 DC NVMe CD6 RI 960GB + 1028 2079 DC NVMe CD6 RI 1.92TB + 1028 207a DC NVMe CD6 RI 3.84TB + 1028 207b DC NVMe CD6 RI 7.68TB + 1028 207c DC NVMe CD6 RI 15.36TB + 1028 207e Dell Ent NVMe CM6 RI 1.92TB + 1028 207f Dell Ent NVMe CM6 RI 3.84TB + 1028 2080 Dell Ent NVMe CM6 RI 7.68TB + 1028 2081 Dell Ent NVMe CM6 RI 15.36TB + 1028 2084 Dell Ent NVMe CM6 MU 1.6TB + 1028 2085 Dell Ent NVMe CM6 MU 3.2TB + 1028 2086 Dell Ent NVMe CM6 MU 6.4TB + 1028 210a Dell Ent NVMe FIPS CM6 RI 1.92TB + 1028 210b Dell Ent NVMe FIPS CM6 RI 3.84TB + 1028 210c Dell Ent NVMe FIPS CM6 RI 7.68TB + 1028 210d Dell Ent NVMe FIPS CM6 RI15.36TB + 1028 210e Dell Ent NVMe FIPS CM6 MU 1.6TB + 1028 210f Dell Ent NVMe FIPS CM6 MU 3.2TB + 1028 2110 Dell Ent NVMe FIPS CM6 MU 6.4TB 1e17 Arnold & Richter Cine Technik GmbH & Co. Betriebs KG 1e24 Squirrels Research Labs 0101 Acorn CLE-101 @@ -23042,8 +23200,16 @@ 0001 T10 [CloudBlazer] # nee Thinci, Inc 1e38 Blaize, Inc + 0102 Xplorer X1600 1e3d Burlywood, Inc 1e49 Yangtze Memory Technologies Co.,Ltd +1e4b MAXIO Technology (Hangzhou) Ltd. + 1001 NVMe SSD Controller MAP1001 + 1002 NVMe SSD Controller MAP1002 + 1003 NVMe SSD Controller MAP1003 + 1201 NVMe SSD Controller MAP1201 + 1202 NVMe SSD Controller MAP1202 + 1601 NVMe SSD Controller MAP1601 1e4c GSI Technology # Associative Processing Unit chip 0010 Gemini [ Lida ] @@ -23240,6 +23406,7 @@ 0100 Permedia II 2D+3D 07a1 Wildcat III 6210 07a2 Sun XVR-500 Graphics Accelerator + 3d3d 1047 Sun XVR-600 Graphics Accelerator 07a3 Wildcat IV 7210 1004 Permedia 3d04 Permedia @@ -23975,6 +24142,7 @@ 02e8 Serial IO I2C Host Controller 02e9 Comet Lake Serial IO I2C Host Controller 02f0 Wireless-AC 9462 + 8086 0070 Intel(R) Wi-Fi 6 AX201 160MHz 02f9 Comet Lake Thermal Subsytem 02fc Comet Lake Integrated Sensor Solution 0309 80303 I/O Processor PCI-to-PCI Bridge @@ -24006,6 +24174,7 @@ 0406 Haswell Integrated Graphics Controller 040a Xeon E3-1200 v3 Processor Integrated Graphics Controller 0412 Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller + 103c 1998 EliteDesk 800 G1 17aa 309f ThinkCentre M83 0416 4th Gen Core Processor Integrated Graphics Controller 17aa 220e ThinkPad T440p @@ -24074,7 +24243,9 @@ 06eb Comet Lake PCH Serial IO I2C Controller #3 06ed Comet Lake USB 3.1 xHCI Host Controller 06ef Comet Lake PCH Shared SRAM - 06f0 Wi-Fi 6 AX201 + 06f0 Wireless-AC 9462/9560 + 8086 0034 Wireless-AC 9560 + 8086 02a4 Wireless-AC 9462 06f9 Comet Lake PCH Thermal Controller 06fb Comet Lake PCH Serial IO SPI Controller #2 0700 CE Media Processor A/V Bridge @@ -24548,12 +24719,18 @@ 1028 1fe8 Express Flash NVMe 2.0TB HHHL AIC (P4600) 1028 1fe9 Express Flash NVMe 4.0TB HHHL AIC (P4600) 0b60 NVMe DC SSD [3DNAND, Beta Rock Controller] + 1028 2060 NVMe SED MU U.2 1.6TB (P5600) + 1028 2061 NVMe SED MU U.2 3.2TB (P5600) + 1028 2062 NVMe SED MU U.2 6.4TB (P5600) 1028 2064 NVMe SED RI U.2 1.92TB (P5500) 1028 2065 NVMe SED RI U.2 3.84TB (P5500) 1028 2066 NVMe SED RI U.2 7.68TB (P5500) - 1028 2101 NVMe RI U.2 1.92TB (P5500) - 1028 2102 NVMe RI U.2 3.84TB (P5500) - 1028 2103 NVMe RI U.2 7.68TB (P5500) + 1028 209e NVMe MU U.2 1.6TB (P5600) + 1028 209f NVMe MU U.2 3.2TB (P5600) + 1028 2100 NVMe MU U.2 6.4TB (P5600) + 1028 2102 NVMe RI U.2 1.92TB (P5500) + 1028 2103 NVMe RI U.2 3.84TB (P5500) + 1028 2104 NVMe RI U.2 7.68TB (P5500) 0be0 Atom Processor D2xxx/N2xxx Integrated Graphics Controller 0be1 Atom Processor D2xxx/N2xxx Integrated Graphics Controller 105b 0d7c D270S/D250S Motherboard @@ -24581,6 +24758,7 @@ 0bf6 Atom Processor D2xxx/N2xxx DRAM Controller 0bf7 Atom Processor D2xxx/N2xxx DRAM Controller 0c00 4th Gen Core Processor DRAM Controller + 103c 1998 EliteDesk 800 G1 17aa 309f ThinkCentre M83 0c01 Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller 0c04 Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller @@ -24590,6 +24768,7 @@ 0c08 Xeon E3-1200 v3 Processor DRAM Controller 0c09 Xeon E3-1200 v3/4th Gen Core Processor PCI Express x4 Controller 0c0c Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller + 103c 1998 EliteDesk 800 G1 17aa 220e ThinkPad T440p 17aa 309f ThinkCentre M83 0c46 Atom Processor S1200 PCI Express Root Port 1 @@ -25751,6 +25930,7 @@ 1539 I211 Gigabit Network Connection 153a Ethernet Connection I217-LM 103c 1909 ZBook 15 + 103c 1998 EliteDesk 800 G1 17aa 220e ThinkPad T440p 17aa 309f ThinkCentre M83 153b Ethernet Connection I217-V @@ -25832,6 +26012,7 @@ 17aa 4001 ThinkServer X710-4 AnyFabric for 10GbE SFP+ 17aa 4002 ThinkServer X710-2 AnyFabric for 10GbE SFP+ 19e5 d11c Ethernet 2-port X710 10Gb SFP+ Adapter SP330 + 1bd4 0056 Ethernet Network Adapter X710-BM2 for OCP NIC 3.0 8086 0000 Ethernet Converged Network Adapter X710 8086 0001 Ethernet Converged Network Adapter X710-4 8086 0002 Ethernet Converged Network Adapter X710-4 @@ -25955,7 +26136,6 @@ 8086 0008 Ethernet Network Adapter OCP XXV710-1 8086 0009 Ethernet 25G 2P XXV710 Adapter 8086 000a Ethernet 25G 2P XXV710 OCP - 8086 000c Ethernet Network Adapter XXV710-DA2 for OCP 3.0 8086 4001 Ethernet Network Adapter XXV710-2 1591 Ethernet Controller E810-C for backplane 1592 Ethernet Controller E810-C for QSFP @@ -25966,6 +26146,7 @@ 8086 0006 Ethernet Network Adapter E810-C-Q2 for OCP3.0 8086 0009 Ethernet Network Adapter E810-C-Q1 8086 000a Ethernet Network Adapter E810-C-Q1 for OCP + 8086 000b Ethernet 100G 2P E810-C Adapter 1593 Ethernet Controller E810-C for SFP 1137 02c3 E810XXVDA4 4x25/10 GbE SFP28 PCIe NIC 8086 0002 Ethernet Network Adapter E810-L-2 @@ -25974,10 +26155,13 @@ 8086 0007 Ethernet Network Adapter E810-XXV-4 8086 0008 Ethernet Network Adapter E810-XXV-2 8086 0009 Ethernet Network Adapter E810-XXV-2 for OCP 2.0 + 8086 000a Ethernet 25G 4P E810-XXV Adapter 1599 Ethernet Controller E810-XXV for backplane 159a Ethernet Controller E810-XXV for QSFP 159b Ethernet Controller E810-XXV for SFP 1137 02be E810XXVDA2 2x25/10 GbE SFP28 PCIe NIC + 1bd4 0057 Ethernet Network Adapter E810-XXVAM2 + 1bd4 0058 Ethernet Network Adapter E810-XXVAM2 for OCP 3.0 8086 0001 Ethernet 25G 2P E810-XXV OCP 8086 0002 Ethernet 25G 2P E810-XXV Adapter 8086 0003 Ethernet Network Adapter E810-XXV-2 @@ -26129,7 +26313,7 @@ 18a0 C4xxx Series QAT 18a1 C4XXX Series QAT Virtual Function 1900 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers - 1901 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) + 1901 6th-9th Gen Core Processor PCIe Controller (x16) 1902 HD Graphics 510 1903 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem 1028 06d6 Latitude 7275 tablet @@ -29479,6 +29663,7 @@ 2ffc Xeon E7 v3/Xeon E5 v3/Core i7 System Address Decoder & Broadcast Registers 2ffd Xeon E7 v3/Xeon E5 v3/Core i7 System Address Decoder & Broadcast Registers 2ffe Xeon E7 v3/Xeon E5 v3/Core i7 System Address Decoder & Broadcast Registers + 3140 Easel/Monette Hill Image Processor [Pixel Visual Core] 3165 Wireless 3165 # Stone Peak 1x1 8086 4010 Dual Band Wireless AC 3165 @@ -29492,6 +29677,8 @@ 318e Celeron/Pentium Silver Processor NorthPeak 3192 Gemini Lake P2SB 3197 Celeron/Pentium Silver Processor PCI-default ISA-bridge + 3198 Celeron/Pentium Silver Processor High Definition Audio + 17aa 380b V130-15IGM Laptop (Lenovo) - Type 81HL 319a Celeron/Pentium Silver Processor Trusted Execution Engine Interface 31a2 Celeron/Pentium Silver Processor Integrated Sensor Solution 31ac Celeron/Pentium Silver Processor Serial IO I2C Host Controller @@ -29801,6 +29988,8 @@ 372c Xeon C5500/C3500 Reserved 373f Xeon C5500/C3500 IOxAPIC 37c8 C62x Chipset QuickAssist Technology + 8086 0001 QuickAssist Adapter 8960 + 8086 0002 QuickAssist Adapter 8970 37cc Ethernet Connection X722 37cd Ethernet Virtual Function 700 Series 37ce Ethernet Connection X722 for 10GbE backplane @@ -30212,7 +30401,7 @@ 3e18 8th Gen Core 4-core Workstation Processor Host Bridge/DRAM Registers [Coffee Lake S] 3e1f 8th Gen Core 4-core Desktop Processor Host Bridge/DRAM Registers [Coffee Lake S] 1458 5000 Z370 AORUS Gaming K3-CF - 3e30 8th Gen Core 8-core Desktop Processor Host Bridge/DRAM Registers [Coffee Lake S] + 3e30 8th/9th Gen Core 8-core Desktop Processor Host Bridge/DRAM Registers [Coffee Lake S] 3e33 8th/9th Gen Core Processor Host Bridge/DRAM Registers [Coffee Lake] 3e34 Coffee Lake HOST and DRAM Controller 3e81 8th Gen Core Processor PCIe Controller (x16) @@ -30851,6 +31040,7 @@ 8c00 8 Series/C220 Series Chipset Family 4-port SATA Controller 1 [IDE mode] 8c01 8 Series Chipset Family 4-port SATA Controller 1 [IDE mode] - Mobile 8c02 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] + 103c 1998 EliteDesk 800 G1 17aa 309f ThinkCentre M83 8c03 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] 103c 1909 ZBook 15 @@ -30864,10 +31054,12 @@ 8c0e 8 Series/C220 Series Chipset Family SATA Controller 1 [RAID mode] 8c0f 8 Series/C220 Series Chipset Family SATA Controller 1 [RAID mode] 8c10 8 Series/C220 Series Chipset Family PCI Express Root Port #1 + 103c 1998 EliteDesk 800 G1 1043 8534 ASUS H81I-PLUS 17aa 220e ThinkPad T440p 8c11 8 Series/C220 Series Chipset Family PCI Express Root Port #1 8c12 8 Series/C220 Series Chipset Family PCI Express Root Port #2 + 103c 1998 EliteDesk 800 G1 17aa 220e ThinkPad T440p 8c13 8 Series/C220 Series Chipset Family PCI Express Root Port #2 8c14 8 Series/C220 Series Chipset Family PCI Express Root Port #3 @@ -30884,38 +31076,45 @@ 8c1f 8 Series/C220 Series Chipset Family PCI Express Root Port #8 8c20 8 Series/C220 Series Chipset High Definition Audio Controller 103c 1909 ZBook 15 + 103c 1998 EliteDesk 800 G1 17aa 220e ThinkPad T440p 17aa 309f ThinkCentre M83 8c21 8 Series/C220 Series Chipset High Definition Audio Controller 8c22 8 Series/C220 Series Chipset Family SMBus Controller 103c 1909 ZBook 15 + 103c 1998 EliteDesk 800 G1 17aa 220e ThinkPad T440p 17aa 309f ThinkCentre M83 8c23 8 Series Chipset Family CHAP Counters 8c24 8 Series Chipset Family Thermal Management Controller 8c26 8 Series/C220 Series Chipset Family USB EHCI #1 103c 1909 ZBook 15 + 103c 1998 EliteDesk 800 G1 17aa 220e ThinkPad T440p 17aa 2210 ThinkPad T540p 17aa 309f ThinkCentre M83 2210 17aa ThinkPad T540p 8c2d 8 Series/C220 Series Chipset Family USB EHCI #2 103c 1909 ZBook 15 + 103c 1998 EliteDesk 800 G1 17aa 220e ThinkPad T440p 17aa 309f ThinkCentre M83 8c31 8 Series/C220 Series Chipset Family USB xHCI 103c 1909 ZBook 15 + 103c 1998 EliteDesk 800 G1 17aa 220e ThinkPad T440p 17aa 309f ThinkCentre M83 8c33 8 Series/C220 Series Chipset Family LAN Controller 8c34 8 Series/C220 Series Chipset Family NAND Controller 8c3a 8 Series/C220 Series Chipset Family MEI Controller #1 103c 1909 ZBook 15 + 103c 1998 EliteDesk 800 G1 17aa 220e ThinkPad T440p 17aa 309f ThinkCentre M83 8c3b 8 Series/C220 Series Chipset Family MEI Controller #2 8c3c 8 Series/C220 Series Chipset Family IDE-r Controller 8c3d 8 Series/C220 Series Chipset Family KT Controller + 103c 1998 EliteDesk 800 G1 8c40 8 Series/C220 Series Chipset Family LPC Controller 8c41 8 Series Chipset Family Mobile Super SKU LPC Controller 8c42 8 Series/C220 Series Chipset Family Desktop Super SKU LPC Controller @@ -30932,6 +31131,7 @@ 17aa 309f ThinkCentre M83 8c4d 8 Series/C220 Series Chipset Family LPC Controller 8c4e Q87 Express LPC Controller + 103c 1998 EliteDesk 800 G1 8c4f QM87 Express LPC Controller 103c 1909 ZBook 15 17aa 220e ThinkPad T440p @@ -31663,6 +31863,7 @@ 1028 0869 Vostro 3470 a36f Cannon Lake PCH Shared SRAM a370 Wireless-AC 9560 [Jefferson Peak] + 1a56 1552 Killer(R) Wireless-AC 1550i Wireless Network Adapter (9560NGW) a379 Cannon Lake PCH Thermal Controller 1028 0869 Vostro 3470 a620 6400/6402 Advanced Memory Buffer (AMB) From owner-svn-src-all@freebsd.org Wed Sep 16 07:53:15 2020 Return-Path: Delivered-To: svn-src-all@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 EB5CE3DBAAB; Wed, 16 Sep 2020 07:53:15 +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 4Brslv5yWtz4PFM; Wed, 16 Sep 2020 07:53:15 +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 B0B2715D5C; Wed, 16 Sep 2020 07:53:15 +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 08G7rFd8022298; Wed, 16 Sep 2020 07:53:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08G7rF3O022297; Wed, 16 Sep 2020 07:53:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009160753.08G7rF3O022297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Sep 2020 07:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365792 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 365792 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 07:53:16 -0000 Author: kib Date: Wed Sep 16 07:53:15 2020 New Revision: 365792 URL: https://svnweb.freebsd.org/changeset/base/365792 Log: MFC r365510: uipc_shm.c: Move comment where it belongs. Modified: stable/12/sys/kern/uipc_shm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/uipc_shm.c ============================================================================== --- stable/12/sys/kern/uipc_shm.c Wed Sep 16 07:30:18 2020 (r365791) +++ stable/12/sys/kern/uipc_shm.c Wed Sep 16 07:53:15 2020 (r365792) @@ -623,11 +623,6 @@ shm_access(struct shmfd *shmfd, struct ucred *ucred, i return (error); } -/* - * Dictionary management. We maintain an in-kernel dictionary to map - * paths to shmfd objects. We use the FNV hash on the path to store - * the mappings in a hash table. - */ static void shm_init(void *arg) { @@ -641,6 +636,11 @@ shm_init(void *arg) } SYSINIT(shm_init, SI_SUB_SYSV_SHM, SI_ORDER_ANY, shm_init, NULL); +/* + * Dictionary management. We maintain an in-kernel dictionary to map + * paths to shmfd objects. We use the FNV hash on the path to store + * the mappings in a hash table. + */ static struct shmfd * shm_lookup(char *path, Fnv32_t fnv) { From owner-svn-src-all@freebsd.org Wed Sep 16 09:11:17 2020 Return-Path: Delivered-To: svn-src-all@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 4D7EC3DF088 for ; Wed, 16 Sep 2020 09:11:17 +0000 (UTC) (envelope-from bounces-de@aproximeo.fr) Received: from emailing-de.aproximeo.fr (emailing-de.aproximeo.fr [212.129.33.118]) by mx1.freebsd.org (Postfix) with ESMTP id 4BrvTw0kLKz4VCG for ; Wed, 16 Sep 2020 09:11:15 +0000 (UTC) (envelope-from bounces-de@aproximeo.fr) Received: by emailing-de.aproximeo.fr (Postfix, from userid 33) id 45DB92E648F1; Wed, 16 Sep 2020 10:56:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=aproximeo.fr; s=dkim; t=1600246610; bh=yyHqNNo1BJ3zurk38Bx1EXR+Zkav5jtBQjBUAe5pslA=; h=To:Subject:Date:From:List-Help:List-Unsubscribe:List-Subscribe: List-Owner:From; b=c0kt3nLMkCIxRg1ozFok7/rejm2AtVR5zkpZun8Dl/IzshEDXx83O6+j7nzY0bEE4 uN3I08NOpEFXxsBH1zJ+f1Zl6C0YVxGdkOufhUyPVcgh4oVBBQ64csqdhhhWWtNJ0A ca9BE6n+oJup1cS3Izxv+Yu8ZzbAQxttce2MKALE= To: svn-src-all@freebsd.org Subject: Trouver des nouveaux clients X-PHP-Originating-Script: 33:class.phpmailer.php Date: Wed, 16 Sep 2020 10:56:50 +0200 From: "luc@aproximeo.fr" Message-ID: X-Priority: 3 X-Mailer: PHPMailer 5.2.9 (https://github.com/PHPMailer/PHPMailer/) X-phpList-version: 3.0.10 X-MessageID: 33 X-ListMember: svn-src-all@freebsd.org Precedence: bulk Bounces-To: bounces-de@aproximeo.fr List-Owner: MIME-Version: 1.0 X-Rspamd-Queue-Id: 4BrvTw0kLKz4VCG X-Spamd-Bar: +++++++++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=aproximeo.fr header.s=dkim header.b=c0kt3nLM; dmarc=pass (policy=none) header.from=aproximeo.fr; spf=pass (mx1.freebsd.org: domain of bounces-de@aproximeo.fr designates 212.129.33.118 as permitted sender) smtp.mailfrom=bounces-de@aproximeo.fr X-Spamd-Result: default: False [9.53 / 15.00]; GREYLIST(0.00)[pass,body]; R_SPF_ALLOW(0.00)[+a:emailing-de.aproximeo.fr]; HAS_X_POS(0.00)[]; TO_DN_NONE(0.00)[]; URI_COUNT_ODD(1.00)[11]; DKIM_TRACE(0.00)[aproximeo.fr:+]; DMARC_POLICY_ALLOW(0.00)[aproximeo.fr,none]; HAS_X_PRIO_THREE(0.00)[3]; MAILLIST(-0.18)[generic]; RCVD_COUNT_ZERO(0.00)[0]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:12876, ipnet:212.129.0.0/18, country:FR]; FROM_NEQ_ENVFROM(0.00)[luc@aproximeo.fr,bounces-de@aproximeo.fr]; ARC_NA(0.00)[]; ABUSE_SURBL(5.50)[aproximeo.fr:dkim]; R_DKIM_ALLOW(0.00)[aproximeo.fr:s=dkim]; FROM_DN_EQ_ADDR(1.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; PRECEDENCE_BULK(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; HAS_PHPMAILER_SIG(0.00)[]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; BAD_REP_POLICIES(0.10)[]; NEURAL_SPAM_MEDIUM(0.95)[0.951]; NEURAL_SPAM_SHORT(0.31)[0.312]; NEURAL_SPAM_LONG(0.95)[0.949]; RWL_MAILSPIKE_VERYGOOD(0.00)[212.129.33.118:from]; FORGED_SENDER_MAILLIST(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all] X-Spam: Yes Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 09:11:17 -0000 Bonjour, Pour votre information, vous pouvez gratuitement trouver plein de nouveaux clients en vous inscrivant sur la 1=C3=A8re plateforme de proximit=C3=A9 en cliquant ici=0A . Plus d'infos en cliquant ici=0A . Excellente journ=C3=A9e ! Luc HIDOUX Responsable Commercial=20 -- This message was sent to svn-src-all@freebsd.org by luc@aproximeo.fr To forward this message, please do not use the forward button of your email application, because this message was made specifically for you only. Instead use the forward page=0A in our newsletter system. To change your details and to choose which lists to be subscribed to, visit your personal preferences page=0A Or you can opt-out completely=0A from all future mailings. =20 -- powered by phpList, www.phplist.com -- From owner-svn-src-all@freebsd.org Wed Sep 16 09:58:16 2020 Return-Path: Delivered-To: svn-src-all@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 932813E01DF; Wed, 16 Sep 2020 09:58:16 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BrwX83Sl2z4Xdm; Wed, 16 Sep 2020 09:58:16 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A42C17631; Wed, 16 Sep 2020 09:58:16 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08G9wGSa096221; Wed, 16 Sep 2020 09:58:16 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08G9wGiQ096220; Wed, 16 Sep 2020 09:58:16 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202009160958.08G9wGiQ096220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 16 Sep 2020 09:58:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365793 - head/contrib/netbsd-tests/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/contrib/netbsd-tests/fs/tmpfs X-SVN-Commit-Revision: 365793 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 09:58:16 -0000 Author: lwhsu Date: Wed Sep 16 09:58:15 2020 New Revision: 365793 URL: https://svnweb.freebsd.org/changeset/base/365793 Log: Temporarily skip sys.fs.tmpfs.times_test.{empty,non_empty} in CI PR: 249362 Sponsored by: The FreeBSD Foundation Modified: head/contrib/netbsd-tests/fs/tmpfs/t_times.sh Modified: head/contrib/netbsd-tests/fs/tmpfs/t_times.sh ============================================================================== --- head/contrib/netbsd-tests/fs/tmpfs/t_times.sh Wed Sep 16 07:53:15 2020 (r365792) +++ head/contrib/netbsd-tests/fs/tmpfs/t_times.sh Wed Sep 16 09:58:15 2020 (r365793) @@ -36,6 +36,10 @@ empty_head() { atf_set "require.user" "root" } empty_body() { + if [ "$(atf_config_get ci false)" = "true" ]; then + atf_skip "https://bugs.freebsd.org/249362" + fi + test_mount atf_check -s eq:0 -o empty -e empty touch a @@ -68,6 +72,10 @@ non_empty_head() { atf_set "require.user" "root" } non_empty_body() { + if [ "$(atf_config_get ci false)" = "true" ]; then + atf_skip "https://bugs.freebsd.org/249362" + fi + test_mount echo foo >b || atf_fail "Non-empty creation failed" From owner-svn-src-all@freebsd.org Wed Sep 16 13:45:54 2020 Return-Path: Delivered-To: svn-src-all@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 9E76A3E5D2C; Wed, 16 Sep 2020 13:45:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Bs1Zp3hwdz3WMc; Wed, 16 Sep 2020 13:45:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EE4D1A055; Wed, 16 Sep 2020 13:45:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08GDjsn5036872; Wed, 16 Sep 2020 13:45:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GDjrLw036870; Wed, 16 Sep 2020 13:45:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009161345.08GDjrLw036870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 16 Sep 2020 13:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365794 - in stable/12/sbin/ggate: ggatec ggated X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sbin/ggate: ggatec ggated X-SVN-Commit-Revision: 365794 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 13:45:54 -0000 Author: markj Date: Wed Sep 16 13:45:53 2020 New Revision: 365794 URL: https://svnweb.freebsd.org/changeset/base/365794 Log: MFC r365502: ggate: Fix ggated/ggatec debug print of offsets. Modified: stable/12/sbin/ggate/ggatec/ggatec.c stable/12/sbin/ggate/ggated/ggated.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ggate/ggatec/ggatec.c ============================================================================== --- stable/12/sbin/ggate/ggatec/ggatec.c Wed Sep 16 09:58:15 2020 (r365793) +++ stable/12/sbin/ggate/ggatec/ggatec.c Wed Sep 16 13:45:53 2020 (r365794) @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -174,8 +175,9 @@ send_thread(void *arg __unused) pthread_kill(recvtd, SIGUSR1); break; } - g_gate_log(LOG_DEBUG, "Sent %zd bytes (offset=%llu, " - "size=%u).", data, hdr.gh_offset, hdr.gh_length); + g_gate_log(LOG_DEBUG, "Sent %zd bytes (offset=%" + PRIu64 ", length=%" PRIu32 ").", data, + hdr.gh_offset, hdr.gh_length); } } g_gate_log(LOG_DEBUG, "%s: Died.", __func__); @@ -229,9 +231,9 @@ recv_thread(void *arg __unused) pthread_kill(sendtd, SIGUSR1); break; } - g_gate_log(LOG_DEBUG, "Received %d bytes (offset=%ju, " - "size=%zu).", data, (uintmax_t)hdr.gh_offset, - (size_t)hdr.gh_length); + g_gate_log(LOG_DEBUG, "Received %d bytes (offset=%" + PRIu64 ", length=%" PRIu32 ").", data, + hdr.gh_offset, hdr.gh_length); } g_gate_ioctl(G_GATE_CMD_DONE, &ggio); Modified: stable/12/sbin/ggate/ggated/ggated.c ============================================================================== --- stable/12/sbin/ggate/ggated/ggated.c Wed Sep 16 09:58:15 2020 (r365793) +++ stable/12/sbin/ggate/ggated/ggated.c Wed Sep 16 13:45:53 2020 (r365794) @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -661,8 +662,8 @@ recv_thread(void *arg) g_gate_log(LOG_DEBUG, "Received hdr packet."); g_gate_swap2h_hdr(&req->r_hdr); - g_gate_log(LOG_DEBUG, "%s: offset=%jd length=%u", __func__, - (intmax_t)req->r_offset, (unsigned)req->r_length); + g_gate_log(LOG_DEBUG, "%s: offset=%" PRIu64 " length=%" PRIu32, + __func__, req->r_offset, req->r_length); /* * Allocate memory for data. @@ -729,8 +730,8 @@ disk_thread(void *arg) assert((req->r_offset % conn->c_sectorsize) == 0); assert((req->r_length % conn->c_sectorsize) == 0); - g_gate_log(LOG_DEBUG, "%s: offset=%jd length=%u", __func__, - (intmax_t)req->r_offset, (unsigned)req->r_length); + g_gate_log(LOG_DEBUG, "%s: offset=%" PRIu64 " length=%" PRIu32, + __func__, req->r_offset, req->r_length); /* * Do the request. @@ -803,8 +804,8 @@ send_thread(void *arg) error = pthread_mutex_unlock(&outqueue_mtx); assert(error == 0); - g_gate_log(LOG_DEBUG, "%s: offset=%jd length=%u", __func__, - (intmax_t)req->r_offset, (unsigned)req->r_length); + g_gate_log(LOG_DEBUG, "%s: offset=%" PRIu64 " length=%" PRIu32, + __func__, req->r_offset, req->r_length); /* * Send the request. @@ -823,8 +824,8 @@ send_thread(void *arg) strerror(errno)); } g_gate_log(LOG_DEBUG, - "Sent %zd bytes (offset=%ju, size=%zu).", data, - (uintmax_t)req->r_offset, (size_t)req->r_length); + "Sent %zd bytes (offset=%" PRIu64 ", size=%" PRIu32 + ").", data, req->r_offset, req->r_length); free(req->r_data); } free(req); From owner-svn-src-all@freebsd.org Wed Sep 16 13:47:02 2020 Return-Path: Delivered-To: svn-src-all@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 A36193E5D38; Wed, 16 Sep 2020 13:47:02 +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 4Bs1c64BSfz3WNR; Wed, 16 Sep 2020 13:47:02 +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 72BE11A056; Wed, 16 Sep 2020 13:47:02 +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 08GDl2kn036993; Wed, 16 Sep 2020 13:47:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GDkwEC036972; Wed, 16 Sep 2020 13:46:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009161346.08GDkwEC036972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 16 Sep 2020 13:46:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365795 - in stable/12: share/man/man4 sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/dev/mem sys/i386/i386 sys/i386/include sys/mip... X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/dev/mem sys/i386/i386 sys/i386/include sys/mips/include sys/mips/mips s... X-SVN-Commit-Revision: 365795 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 13:47:02 -0000 Author: markj Date: Wed Sep 16 13:46:58 2020 New Revision: 365795 URL: https://svnweb.freebsd.org/changeset/base/365795 Log: MFC r365265: Add the MEM_EXTRACT_PADDR ioctl to /dev/mem. Modified: stable/12/share/man/man4/mem.4 stable/12/sys/amd64/amd64/mem.c stable/12/sys/amd64/include/memdev.h stable/12/sys/arm/arm/mem.c stable/12/sys/arm/include/memdev.h stable/12/sys/arm64/arm64/mem.c stable/12/sys/arm64/include/memdev.h stable/12/sys/dev/mem/memdev.c stable/12/sys/i386/i386/mem.c stable/12/sys/i386/include/memdev.h stable/12/sys/mips/include/memdev.h stable/12/sys/mips/mips/mem.c stable/12/sys/powerpc/include/memdev.h stable/12/sys/powerpc/powerpc/mem.c stable/12/sys/riscv/include/memdev.h stable/12/sys/riscv/riscv/mem.c stable/12/sys/sys/memrange.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/mem.4 ============================================================================== --- stable/12/share/man/man4/mem.4 Wed Sep 16 13:45:53 2020 (r365794) +++ stable/12/share/man/man4/mem.4 Wed Sep 16 13:46:58 2020 (r365795) @@ -28,7 +28,7 @@ .\" @(#)mem.4 5.3 (Berkeley) 5/2/91 .\" $FreeBSD$ .\" -.Dd October 3, 2004 +.Dd August 25, 2020 .Dt MEM 4 .Os .Sh NAME @@ -54,11 +54,7 @@ in the same manner as .Pa /dev/mem . Only kernel virtual addresses that are currently mapped to memory are allowed. .Pp -On -.Tn ISA -the -.Tn I/O -memory space begins at physical address 0x000a0000 +On ISA the I/O memory space begins at physical address 0x000a0000 and runs to 0x00100000. The per-process data @@ -69,6 +65,46 @@ is long, and ends at virtual address 0xf0000000. .Sh IOCTL INTERFACE +The +.Dv MEM_EXTRACT_PADDR +ioctl can be used to look up the physical address and NUMA domain of a given +virtual address in the calling process' address space. +The request is described by +.Bd -literal +struct mem_extract { + uint64_t me_vaddr; /* input */ + uint64_t me_paddr; /* output */ + int me_domain; /* output */ + int me_state; /* output */ +}; +.Ed +.Pp +The ioctl returns an error if the address is not valid. +The information returned by +.Dv MEM_EXTRACT_PADDR +may be out of date by the time that the ioctl call returns. +Specifically, concurrent system calls, page faults, or system page reclamation +activity may have unmapped the virtual page or replaced the backing physical +page before the ioctl call returns. +Wired pages, e.g., those locked by +.Xr mlock 2 , +will not be reclaimed by the system. +.Pp +The +.Fa me_state +field provides information about the state of the virtual page: +.Bl -tag -width indent +.It Dv ME_STATE_INVALID +The virtual address is invalid. +.It Dv ME_STATE_VALID +The virtual address is valid but is not mapped at the time of the ioctl call. +.It Dv ME_STATE_MAPPED +The virtual address corresponds to a physical page mapping, and the +.Fa me_paddr +and +.Fa me_domain +fields are valid. +.Pp Several architectures allow attributes to be associated with ranges of physical memory. These attributes can be manipulated via @@ -95,12 +131,13 @@ The region cannot be written to. .El .Pp Memory ranges are described by -.Vt struct mem_range_desc : -.Bd -literal -offset indent -uint64_t mr_base; /\(** physical base address \(**/ -uint64_t mr_len; /\(** physical length of region \(**/ -int mr_flags; /\(** attributes of region \(**/ -char mr_owner[8]; +.Bd -literal +struct mem_range_desc { + uint64_t mr_base; /* physical base address */ + uint64_t mr_len; /* physical length of region */ + int mr_flags; /* attributes of region */ + char mr_owner[8]; +}; .Ed .Pp In addition to the region attributes listed above, the following flags @@ -126,10 +163,11 @@ altered. .El .Pp Operations are performed using -.Fa struct mem_range_op : -.Bd -literal -offset indent -struct mem_range_desc *mo_desc; -int mo_arg[2]; +.Bd -literal +struct mem_range_op { + struct mem_range_desc *mo_desc; + int mo_arg[2]; +}; .Ed .Pp The @@ -165,7 +203,7 @@ to remove a range. .It Bq Er EOPNOTSUPP Memory range operations are not supported on this architecture. .It Bq Er ENXIO -No memory range descriptors are available (e.g.\& firmware has not enabled +No memory range descriptors are available (e.g., firmware has not enabled any). .It Bq Er EINVAL The memory range supplied as an argument is invalid or overlaps another @@ -174,7 +212,7 @@ range in a fashion not supported by this architecture. An attempt to remove or update a range failed because the range is busy. .It Bq Er ENOSPC An attempt to create a new range failed due to a shortage of hardware -resources (e.g.\& descriptor slots). +resources (e.g., descriptor slots). .It Bq Er ENOENT An attempt to remove a range failed because no range matches the descriptor base/length supplied. Modified: stable/12/sys/amd64/amd64/mem.c ============================================================================== --- stable/12/sys/amd64/amd64/mem.c Wed Sep 16 13:45:53 2020 (r365794) +++ stable/12/sys/amd64/amd64/mem.c Wed Sep 16 13:46:58 2020 (r365795) @@ -185,9 +185,8 @@ memmmap(struct cdev *dev, vm_ooffset_t offset, vm_padd * This is basically just an ioctl shim for mem_range_attr_get * and mem_range_attr_set. */ -/* ARGSUSED */ int -memioctl(struct cdev *dev __unused, u_long cmd, caddr_t data, int flags, +memioctl_md(struct cdev *dev __unused, u_long cmd, caddr_t data, int flags, struct thread *td) { int nd, error = 0; Modified: stable/12/sys/amd64/include/memdev.h ============================================================================== --- stable/12/sys/amd64/include/memdev.h Wed Sep 16 13:45:53 2020 (r365794) +++ stable/12/sys/amd64/include/memdev.h Wed Sep 16 13:46:58 2020 (r365795) @@ -36,7 +36,7 @@ d_open_t memopen; d_read_t memrw; -d_ioctl_t memioctl; +d_ioctl_t memioctl_md; d_mmap_t memmmap; #endif /* _MACHINE_MEMDEV_H_ */ Modified: stable/12/sys/arm/arm/mem.c ============================================================================== --- stable/12/sys/arm/arm/mem.c Wed Sep 16 13:45:53 2020 (r365794) +++ stable/12/sys/arm/arm/mem.c Wed Sep 16 13:46:58 2020 (r365795) @@ -169,3 +169,10 @@ memmmap(struct cdev *dev, vm_ooffset_t offset, vm_padd } return (-1); } + +int +memioctl_md(struct cdev *dev __unused, u_long cmd __unused, + caddr_t data __unused, int flags __unused, struct thread *td __unused) +{ + return (ENOTTY); +} Modified: stable/12/sys/arm/include/memdev.h ============================================================================== --- stable/12/sys/arm/include/memdev.h Wed Sep 16 13:45:53 2020 (r365794) +++ stable/12/sys/arm/include/memdev.h Wed Sep 16 13:46:58 2020 (r365795) @@ -37,6 +37,6 @@ d_open_t memopen; d_read_t memrw; d_mmap_t memmmap; -#define memioctl (d_ioctl_t *)NULL +d_ioctl_t memioctl_md; #endif /* _MACHINE_MEMDEV_H_ */ Modified: stable/12/sys/arm64/arm64/mem.c ============================================================================== --- stable/12/sys/arm64/arm64/mem.c Wed Sep 16 13:45:53 2020 (r365794) +++ stable/12/sys/arm64/arm64/mem.c Wed Sep 16 13:46:58 2020 (r365795) @@ -129,3 +129,10 @@ memmmap(struct cdev *dev, vm_ooffset_t offset, vm_padd } return (-1); } + +int +memioctl_md(struct cdev *dev __unused, u_long cmd __unused, + caddr_t data __unused, int flags __unused, struct thread *td __unused) +{ + return (ENOTTY); +} Modified: stable/12/sys/arm64/include/memdev.h ============================================================================== --- stable/12/sys/arm64/include/memdev.h Wed Sep 16 13:45:53 2020 (r365794) +++ stable/12/sys/arm64/include/memdev.h Wed Sep 16 13:46:58 2020 (r365795) @@ -34,7 +34,7 @@ d_open_t memopen; d_read_t memrw; -#define memioctl (d_ioctl_t *)NULL +d_ioctl_t memioctl_md; d_mmap_t memmmap; #endif /* _MACHINE_MEMDEV_H_ */ Modified: stable/12/sys/dev/mem/memdev.c ============================================================================== --- stable/12/sys/dev/mem/memdev.c Wed Sep 16 13:45:53 2020 (r365794) +++ stable/12/sys/dev/mem/memdev.c Wed Sep 16 13:46:58 2020 (r365795) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -46,12 +47,19 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include +#include +#include +#include #include static struct cdev *memdev, *kmemdev; +static d_ioctl_t memioctl; + static struct cdevsw mem_cdevsw = { .d_version = D_VERSION, .d_flags = D_MEM, @@ -79,6 +87,43 @@ memopen(struct cdev *dev __unused, int flags, int fmt error = securelevel_gt(td->td_ucred, 0); } + return (error); +} + +static int +memioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, + struct thread *td) +{ + vm_map_t map; + vm_map_entry_t entry; + struct mem_extract *me; + int error; + + error = 0; + switch (cmd) { + case MEM_EXTRACT_PADDR: + me = (struct mem_extract *)data; + + map = &td->td_proc->p_vmspace->vm_map; + vm_map_lock_read(map); + if (vm_map_lookup_entry(map, me->me_vaddr, &entry)) { + me->me_paddr = pmap_extract( + &td->td_proc->p_vmspace->vm_pmap, me->me_vaddr); + if (me->me_paddr != 0) { + me->me_state = ME_STATE_MAPPED; + me->me_domain = _vm_phys_domain(me->me_paddr); + } else { + me->me_state = ME_STATE_VALID; + } + } else { + me->me_state = ME_STATE_INVALID; + } + vm_map_unlock_read(map); + break; + default: + error = memioctl_md(dev, cmd, data, flags, td); + break; + } return (error); } Modified: stable/12/sys/i386/i386/mem.c ============================================================================== --- stable/12/sys/i386/i386/mem.c Wed Sep 16 13:45:53 2020 (r365794) +++ stable/12/sys/i386/i386/mem.c Wed Sep 16 13:46:58 2020 (r365795) @@ -178,9 +178,8 @@ memmmap(struct cdev *dev, vm_ooffset_t offset, vm_padd * This is basically just an ioctl shim for mem_range_attr_get * and mem_range_attr_set. */ -/* ARGSUSED */ int -memioctl(struct cdev *dev __unused, u_long cmd, caddr_t data, int flags, +memioctl_md(struct cdev *dev __unused, u_long cmd, caddr_t data, int flags, struct thread *td) { int nd, error = 0; Modified: stable/12/sys/i386/include/memdev.h ============================================================================== --- stable/12/sys/i386/include/memdev.h Wed Sep 16 13:45:53 2020 (r365794) +++ stable/12/sys/i386/include/memdev.h Wed Sep 16 13:46:58 2020 (r365795) @@ -36,7 +36,7 @@ d_open_t memopen; d_read_t memrw; -d_ioctl_t memioctl; +d_ioctl_t memioctl_md; d_mmap_t memmmap; #endif /* _MACHINE_MEMDEV_H_ */ Modified: stable/12/sys/mips/include/memdev.h ============================================================================== --- stable/12/sys/mips/include/memdev.h Wed Sep 16 13:45:53 2020 (r365794) +++ stable/12/sys/mips/include/memdev.h Wed Sep 16 13:46:58 2020 (r365795) @@ -37,7 +37,7 @@ d_open_t memopen; d_read_t memrw; -#define memioctl (d_ioctl_t *)NULL +d_ioctl_t memioctl_md; d_mmap_t memmmap; #endif /* _MACHINE_MEMDEV_H_ */ Modified: stable/12/sys/mips/mips/mem.c ============================================================================== --- stable/12/sys/mips/mips/mem.c Wed Sep 16 13:45:53 2020 (r365794) +++ stable/12/sys/mips/mips/mem.c Wed Sep 16 13:46:58 2020 (r365795) @@ -160,3 +160,10 @@ memmmap(struct cdev *dev, vm_ooffset_t offset, vm_padd return (0); } + +int +memioctl_md(struct cdev *dev __unused, u_long cmd __unused, + caddr_t data __unused, int flags __unused, struct thread *td __unused) +{ + return (ENOTTY); +} Modified: stable/12/sys/powerpc/include/memdev.h ============================================================================== --- stable/12/sys/powerpc/include/memdev.h Wed Sep 16 13:45:53 2020 (r365794) +++ stable/12/sys/powerpc/include/memdev.h Wed Sep 16 13:46:58 2020 (r365795) @@ -36,7 +36,7 @@ d_open_t memopen; d_read_t memrw; -d_ioctl_t memioctl; +d_ioctl_t memioctl_md; d_mmap_t memmmap; #endif /* _MACHINE_MEMDEV_H_ */ Modified: stable/12/sys/powerpc/powerpc/mem.c ============================================================================== --- stable/12/sys/powerpc/powerpc/mem.c Wed Sep 16 13:45:53 2020 (r365794) +++ stable/12/sys/powerpc/powerpc/mem.c Wed Sep 16 13:46:58 2020 (r365795) @@ -263,9 +263,8 @@ ppc_mrset(struct mem_range_softc *sc, struct mem_range * This is basically just an ioctl shim for mem_range_attr_get * and mem_range_attr_set. */ -/* ARGSUSED */ int -memioctl(struct cdev *dev __unused, u_long cmd, caddr_t data, int flags, +memioctl_md(struct cdev *dev __unused, u_long cmd, caddr_t data, int flags, struct thread *td) { int nd, error = 0; Modified: stable/12/sys/riscv/include/memdev.h ============================================================================== --- stable/12/sys/riscv/include/memdev.h Wed Sep 16 13:45:53 2020 (r365794) +++ stable/12/sys/riscv/include/memdev.h Wed Sep 16 13:46:58 2020 (r365795) @@ -34,7 +34,7 @@ d_open_t memopen; d_read_t memrw; -#define memioctl (d_ioctl_t *)NULL +d_ioctl_t memioctl_md; #define memmmap (d_mmap_t *)NULL #endif /* _MACHINE_MEMDEV_H_ */ Modified: stable/12/sys/riscv/riscv/mem.c ============================================================================== --- stable/12/sys/riscv/riscv/mem.c Wed Sep 16 13:45:53 2020 (r365794) +++ stable/12/sys/riscv/riscv/mem.c Wed Sep 16 13:46:58 2020 (r365795) @@ -122,3 +122,9 @@ memrw(struct cdev *dev, struct uio *uio, int flags) return (error); } +int +memioctl_md(struct cdev *dev __unused, u_long cmd __unused, + caddr_t data __unused, int flags __unused, struct thread *td __unused) +{ + return (ENOTTY); +} Modified: stable/12/sys/sys/memrange.h ============================================================================== --- stable/12/sys/sys/memrange.h Wed Sep 16 13:45:53 2020 (r365794) +++ stable/12/sys/sys/memrange.h Wed Sep 16 13:46:58 2020 (r365795) @@ -45,6 +45,20 @@ struct mem_range_op #define MEMRANGE_GET _IOWR('m', 50, struct mem_range_op) #define MEMRANGE_SET _IOW('m', 51, struct mem_range_op) +#define ME_STATE_INVALID 0 +#define ME_STATE_VALID 1 +#define ME_STATE_MAPPED 2 + +struct mem_extract { + uint64_t me_vaddr; + uint64_t me_paddr; + int me_domain; + int me_state; + uint64_t pad1[5]; +}; + +#define MEM_EXTRACT_PADDR _IOWR('m', 52, struct mem_extract) + #ifdef _KERNEL MALLOC_DECLARE(M_MEMDESC); From owner-svn-src-all@freebsd.org Wed Sep 16 13:51:47 2020 Return-Path: Delivered-To: svn-src-all@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 EB0D83E62B1; Wed, 16 Sep 2020 13:51:47 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Bs1jb5z6Pz3X3C; Wed, 16 Sep 2020 13:51:47 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B18951A1CC; Wed, 16 Sep 2020 13:51:47 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08GDplwJ041219; Wed, 16 Sep 2020 13:51:47 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GDplfc041218; Wed, 16 Sep 2020 13:51:47 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009161351.08GDplfc041218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 16 Sep 2020 13:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365796 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 365796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 13:51:48 -0000 Author: markj Date: Wed Sep 16 13:51:47 2020 New Revision: 365796 URL: https://svnweb.freebsd.org/changeset/base/365796 Log: Move PLTs to the beginning of amd64 kernel modules. As with .text, the aim is to ensure that executable sections are segregated from the rest, to avoid creation of writeable and executable mappings. Recent versions of LLVM emit a PLT in firmware modules. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26444 Modified: head/sys/conf/ldscript.kmod.amd64 Modified: head/sys/conf/ldscript.kmod.amd64 ============================================================================== --- head/sys/conf/ldscript.kmod.amd64 Wed Sep 16 13:46:58 2020 (r365795) +++ head/sys/conf/ldscript.kmod.amd64 Wed Sep 16 13:51:47 2020 (r365796) @@ -34,6 +34,10 @@ SECTIONS { + .plt : + { + *(.plt) + } .text : { *(.text .text.*) From owner-svn-src-all@freebsd.org Wed Sep 16 14:12:58 2020 Return-Path: Delivered-To: svn-src-all@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 19C453E7055; Wed, 16 Sep 2020 14:12:58 +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 4Bs2B16zdNz3YTC; Wed, 16 Sep 2020 14:12:57 +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 D41571A3DF; Wed, 16 Sep 2020 14:12:57 +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 08GECvdg055477; Wed, 16 Sep 2020 14:12:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GECvw1055476; Wed, 16 Sep 2020 14:12:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009161412.08GECvw1055476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 16 Sep 2020 14:12:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365797 - in stable/12/sys/sparc64: include sparc64 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys/sparc64: include sparc64 X-SVN-Commit-Revision: 365797 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 14:12:58 -0000 Author: markj Date: Wed Sep 16 14:12:57 2020 New Revision: 365797 URL: https://svnweb.freebsd.org/changeset/base/365797 Log: Add a mem(4) ioctl stub for sparc64. This is a direct commit to stable/12. Reported by: Jenkins Modified: stable/12/sys/sparc64/include/memdev.h stable/12/sys/sparc64/sparc64/mem.c Modified: stable/12/sys/sparc64/include/memdev.h ============================================================================== --- stable/12/sys/sparc64/include/memdev.h Wed Sep 16 13:51:47 2020 (r365796) +++ stable/12/sys/sparc64/include/memdev.h Wed Sep 16 14:12:57 2020 (r365797) @@ -36,7 +36,7 @@ d_open_t memopen; d_read_t memrw; -#define memioctl (d_ioctl_t *)NULL +d_ioctl_t memioctl_md; #define memmmap (d_mmap_t *)NULL #endif /* _MACHINE_MEMDEV_H_ */ Modified: stable/12/sys/sparc64/sparc64/mem.c ============================================================================== --- stable/12/sys/sparc64/sparc64/mem.c Wed Sep 16 13:51:47 2020 (r365796) +++ stable/12/sys/sparc64/sparc64/mem.c Wed Sep 16 14:12:57 2020 (r365797) @@ -177,3 +177,10 @@ memrw(struct cdev *dev, struct uio *uio, int flags) kva_free(ova, PAGE_SIZE * colors); return (error); } + +int +memioctl_md(struct cdev *dev __unused, u_long cmd __unused, + caddr_t data __unused, int flags __unused, struct thread *td __unused) +{ + return (ENOTTY); +} From owner-svn-src-all@freebsd.org Wed Sep 16 14:14:28 2020 Return-Path: Delivered-To: svn-src-all@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 276FC3E751E; Wed, 16 Sep 2020 14:14: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 4Bs2Cm0FC5z3YV6; Wed, 16 Sep 2020 14:14: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 E0EEC19FFC; Wed, 16 Sep 2020 14:14:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08GEERYI055600; Wed, 16 Sep 2020 14:14:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GEEQeo055594; Wed, 16 Sep 2020 14:14:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009161414.08GEEQeo055594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Sep 2020 14:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365798 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 365798 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 14:14:28 -0000 Author: kib Date: Wed Sep 16 14:14:26 2020 New Revision: 365798 URL: https://svnweb.freebsd.org/changeset/base/365798 Log: MFC r365484: Add interruptible variant of vm_wait(9), vm_wait_intr(9). Modified: stable/12/sys/vm/uma_core.c stable/12/sys/vm/vm_domainset.c stable/12/sys/vm/vm_domainset.h stable/12/sys/vm/vm_glue.c stable/12/sys/vm/vm_page.c stable/12/sys/vm/vm_pageout.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/uma_core.c ============================================================================== --- stable/12/sys/vm/uma_core.c Wed Sep 16 14:12:57 2020 (r365797) +++ stable/12/sys/vm/uma_core.c Wed Sep 16 14:14:26 2020 (r365798) @@ -2813,7 +2813,7 @@ restart: if (rr && vm_domainset_iter_policy(&di, &domain) != 0) { if ((flags & M_WAITOK) != 0) { KEG_UNLOCK(keg); - vm_wait_doms(&keg->uk_dr.dr_policy->ds_mask); + vm_wait_doms(&keg->uk_dr.dr_policy->ds_mask, 0); KEG_LOCK(keg); goto restart; } @@ -3718,7 +3718,7 @@ uma_prealloc(uma_zone_t zone, int items) KEG_LOCK(keg); if (vm_domainset_iter_policy(&di, &domain) != 0) { KEG_UNLOCK(keg); - vm_wait_doms(&keg->uk_dr.dr_policy->ds_mask); + vm_wait_doms(&keg->uk_dr.dr_policy->ds_mask, 0); KEG_LOCK(keg); } } Modified: stable/12/sys/vm/vm_domainset.c ============================================================================== --- stable/12/sys/vm/vm_domainset.c Wed Sep 16 14:12:57 2020 (r365797) +++ stable/12/sys/vm/vm_domainset.c Wed Sep 16 14:14:26 2020 (r365798) @@ -245,7 +245,7 @@ vm_domainset_iter_page(struct vm_domainset_iter *di, s /* Wait for one of the domains to accumulate some free pages. */ if (obj != NULL) VM_OBJECT_WUNLOCK(obj); - vm_wait_doms(&di->di_domain->ds_mask); + vm_wait_doms(&di->di_domain->ds_mask, 0); if (obj != NULL) VM_OBJECT_WLOCK(obj); if ((di->di_flags & VM_ALLOC_WAITFAIL) != 0) @@ -310,7 +310,7 @@ vm_domainset_iter_policy(struct vm_domainset_iter *di, return (ENOMEM); /* Wait for one of the domains to accumulate some free pages. */ - vm_wait_doms(&di->di_domain->ds_mask); + vm_wait_doms(&di->di_domain->ds_mask, 0); /* Restart the search. */ vm_domainset_iter_first(di, domain); Modified: stable/12/sys/vm/vm_domainset.h ============================================================================== --- stable/12/sys/vm/vm_domainset.h Wed Sep 16 14:12:57 2020 (r365797) +++ stable/12/sys/vm/vm_domainset.h Wed Sep 16 14:14:26 2020 (r365798) @@ -50,6 +50,6 @@ void vm_domainset_iter_policy_init(struct vm_domainset void vm_domainset_iter_policy_ref_init(struct vm_domainset_iter *, struct domainset_ref *, int *, int *); -void vm_wait_doms(const domainset_t *); +int vm_wait_doms(const domainset_t *, int mflags); #endif /* __VM_DOMAINSET_H__ */ Modified: stable/12/sys/vm/vm_glue.c ============================================================================== --- stable/12/sys/vm/vm_glue.c Wed Sep 16 14:12:57 2020 (r365797) +++ stable/12/sys/vm/vm_glue.c Wed Sep 16 14:14:26 2020 (r365798) @@ -560,7 +560,7 @@ vm_forkproc(struct thread *td, struct proc *p2, struct } dset = td2->td_domain.dr_policy; while (vm_page_count_severe_set(&dset->ds_mask)) { - vm_wait_doms(&dset->ds_mask); + vm_wait_doms(&dset->ds_mask, 0); } if ((flags & RFMEM) == 0) { Modified: stable/12/sys/vm/vm_page.c ============================================================================== --- stable/12/sys/vm/vm_page.c Wed Sep 16 14:12:57 2020 (r365797) +++ stable/12/sys/vm/vm_page.c Wed Sep 16 14:14:26 2020 (r365798) @@ -2942,10 +2942,13 @@ vm_wait_count(void) return (vm_severe_waiters + vm_min_waiters + vm_pageproc_waiters); } -void -vm_wait_doms(const domainset_t *wdoms) +int +vm_wait_doms(const domainset_t *wdoms, int mflags) { + int error; + error = 0; + /* * We use racey wakeup synchronization to avoid expensive global * locking for the pageproc when sleeping with a non-specific vm_wait. @@ -2957,8 +2960,8 @@ vm_wait_doms(const domainset_t *wdoms) if (curproc == pageproc) { mtx_lock(&vm_domainset_lock); vm_pageproc_waiters++; - msleep(&vm_pageproc_waiters, &vm_domainset_lock, PVM | PDROP, - "pageprocwait", 1); + error = msleep(&vm_pageproc_waiters, &vm_domainset_lock, + PVM | PDROP | mflags, "pageprocwait", 1); } else { /* * XXX Ideally we would wait only until the allocation could @@ -2968,11 +2971,12 @@ vm_wait_doms(const domainset_t *wdoms) mtx_lock(&vm_domainset_lock); if (vm_page_count_min_set(wdoms)) { vm_min_waiters++; - msleep(&vm_min_domains, &vm_domainset_lock, - PVM | PDROP, "vmwait", 0); + error = msleep(&vm_min_domains, &vm_domainset_lock, + PVM | PDROP | mflags, "vmwait", 0); } else mtx_unlock(&vm_domainset_lock); } + return (error); } /* @@ -3003,20 +3007,12 @@ vm_wait_domain(int domain) panic("vm_wait in early boot"); DOMAINSET_ZERO(&wdom); DOMAINSET_SET(vmd->vmd_domain, &wdom); - vm_wait_doms(&wdom); + vm_wait_doms(&wdom, 0); } } -/* - * vm_wait: - * - * Sleep until free pages are available for allocation in the - * affinity domains of the obj. If obj is NULL, the domain set - * for the calling thread is used. - * Called in various places after failed memory allocations. - */ -void -vm_wait(vm_object_t obj) +static int +vm_wait_flags(vm_object_t obj, int mflags) { struct domainset *d; @@ -3031,7 +3027,27 @@ vm_wait(vm_object_t obj) if (d == NULL) d = curthread->td_domain.dr_policy; - vm_wait_doms(&d->ds_mask); + return (vm_wait_doms(&d->ds_mask, mflags)); +} + +/* + * vm_wait: + * + * Sleep until free pages are available for allocation in the + * affinity domains of the obj. If obj is NULL, the domain set + * for the calling thread is used. + * Called in various places after failed memory allocations. + */ +void +vm_wait(vm_object_t obj) +{ + (void)vm_wait_flags(obj, 0); +} + +int +vm_wait_intr(vm_object_t obj) +{ + return (vm_wait_flags(obj, PCATCH)); } /* Modified: stable/12/sys/vm/vm_pageout.h ============================================================================== --- stable/12/sys/vm/vm_pageout.h Wed Sep 16 14:12:57 2020 (r365797) +++ stable/12/sys/vm/vm_pageout.h Wed Sep 16 14:14:26 2020 (r365798) @@ -97,6 +97,7 @@ extern int vm_pageout_page_count; */ void vm_wait(vm_object_t obj); +int vm_wait_intr(vm_object_t obj); void vm_waitpfault(struct domainset *, int timo); void vm_wait_domain(int domain); void vm_wait_min(void); From owner-svn-src-all@freebsd.org Wed Sep 16 14:16:11 2020 Return-Path: Delivered-To: svn-src-all@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 60A1D3E74DD; Wed, 16 Sep 2020 14:16: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 4Bs2Fl1xJkz3Yst; Wed, 16 Sep 2020 14:16: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 0DE001A3E1; Wed, 16 Sep 2020 14:16: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 08GEGAFo055752; Wed, 16 Sep 2020 14:16:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GEGAa9055748; Wed, 16 Sep 2020 14:16:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009161416.08GEGAa9055748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Sep 2020 14:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365799 - in stable/12/sys: dev/ksyms dev/xen/gntdev kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: dev/ksyms dev/xen/gntdev kern X-SVN-Commit-Revision: 365799 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 14:16:11 -0000 Author: kib Date: Wed Sep 16 14:16:09 2020 New Revision: 365799 URL: https://svnweb.freebsd.org/changeset/base/365799 Log: MFC r365485: Convert allocations of the phys pager to vm_pager_allocate(). Modified: stable/12/sys/dev/ksyms/ksyms.c stable/12/sys/dev/xen/gntdev/gntdev.c stable/12/sys/kern/link_elf.c stable/12/sys/kern/link_elf_obj.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/ksyms/ksyms.c ============================================================================== --- stable/12/sys/dev/ksyms/ksyms.c Wed Sep 16 14:14:26 2020 (r365798) +++ stable/12/sys/dev/ksyms/ksyms.c Wed Sep 16 14:16:09 2020 (r365799) @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,8 @@ #include #include #include +#include +#include #include "linker_if.h" @@ -435,8 +438,8 @@ ksyms_open(struct cdev *dev, int flags, int fmt __unus ksyms_size_calc(&ts); elfsz = sizeof(struct ksyms_hdr) + ts.ts_symsz + ts.ts_strsz; - object = vm_object_allocate(OBJT_PHYS, - OFF_TO_IDX(round_page(elfsz))); + object = vm_pager_allocate(OBJT_PHYS, NULL, round_page(elfsz), + VM_PROT_ALL, 0, td->td_ucred); sc->sc_obj = object; sc->sc_objsz = elfsz; Modified: stable/12/sys/dev/xen/gntdev/gntdev.c ============================================================================== --- stable/12/sys/dev/xen/gntdev/gntdev.c Wed Sep 16 14:14:26 2020 (r365798) +++ stable/12/sys/dev/xen/gntdev/gntdev.c Wed Sep 16 14:16:09 2020 (r365799) @@ -1073,7 +1073,8 @@ mmap_gref(struct per_user_data *priv_user, struct gntd vm_object_t mem_obj; struct gntdev_gref *gref; - mem_obj = vm_object_allocate(OBJT_PHYS, size); + mem_obj = vm_pager_allocate(OBJT_PHYS, NULL, size, VM_PROT_ALL, 0, + curthread->td_ucred); if (mem_obj == NULL) return (ENOMEM); Modified: stable/12/sys/kern/link_elf.c ============================================================================== --- stable/12/sys/kern/link_elf.c Wed Sep 16 14:14:26 2020 (r365798) +++ stable/12/sys/kern/link_elf.c Wed Sep 16 14:16:09 2020 (r365799) @@ -995,7 +995,8 @@ link_elf_load_file(linker_class_t cls, const char* fil ef = (elf_file_t) lf; #ifdef SPARSE_MAPPING - ef->object = vm_object_allocate(OBJT_PHYS, atop(mapsize)); + ef->object = vm_pager_allocate(OBJT_PHYS, NULL, mapsize, VM_PROT_ALL, + 0, thread0.td_ucred); if (ef->object == NULL) { error = ENOMEM; goto out; Modified: stable/12/sys/kern/link_elf_obj.c ============================================================================== --- stable/12/sys/kern/link_elf_obj.c Wed Sep 16 14:14:26 2020 (r365798) +++ stable/12/sys/kern/link_elf_obj.c Wed Sep 16 14:16:09 2020 (r365799) @@ -34,16 +34,17 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include #include #include -#include #include -#include +#include +#include #include -#include #include @@ -53,11 +54,13 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include #include +#include +#include #include +#include +#include +#include #include @@ -888,7 +891,8 @@ link_elf_load_file(linker_class_t cls, const char *fil * This stuff needs to be in a single chunk so that profiling etc * can get the bounds and gdb can associate offsets with modules */ - ef->object = vm_object_allocate(OBJT_PHYS, atop(round_page(mapsize))); + ef->object = vm_pager_allocate(OBJT_PHYS, NULL, round_page(mapsize), + VM_PROT_ALL, 0, thread0.td_ucred); if (ef->object == NULL) { error = ENOMEM; goto out; From owner-svn-src-all@freebsd.org Wed Sep 16 14:20:46 2020 Return-Path: Delivered-To: svn-src-all@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 5390D3E79AD; Wed, 16 Sep 2020 14:20:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Bs2M21WxRz3ZGq; Wed, 16 Sep 2020 14:20:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17DA51A817; Wed, 16 Sep 2020 14:20:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08GEKjKD056055; Wed, 16 Sep 2020 14:20:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GEKj4d056054; Wed, 16 Sep 2020 14:20:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009161420.08GEKj4d056054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Sep 2020 14:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365800 - in stable/12/sys: sys vm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: sys vm X-SVN-Commit-Revision: 365800 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 14:20:46 -0000 Author: kib Date: Wed Sep 16 14:20:45 2020 New Revision: 365800 URL: https://svnweb.freebsd.org/changeset/base/365800 Log: MFC r365486: Add kern_mmap_racct_check(), a helper to verify limits in vm_mmap*(). Modified: stable/12/sys/sys/syscallsubr.h stable/12/sys/vm/vm_mmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/sys/syscallsubr.h ============================================================================== --- stable/12/sys/sys/syscallsubr.h Wed Sep 16 14:16:09 2020 (r365799) +++ stable/12/sys/sys/syscallsubr.h Wed Sep 16 14:20:45 2020 (r365800) @@ -62,6 +62,7 @@ struct sockaddr; struct stat; struct thr_param; struct uio; +struct vm_map; typedef int (*mmap_check_fp_fn)(struct file *, int, int, int); @@ -185,6 +186,8 @@ int kern_mmap(struct thread *td, uintptr_t addr, size_ int kern_mmap_fpcheck(struct thread *td, uintptr_t addr, size_t len, int prot, int flags, int fd, off_t pos, mmap_check_fp_fn check_fp_fn); +int kern_mmap_racct_check(struct thread *td, struct vm_map *map, + vm_size_t size); int kern_mprotect(struct thread *td, uintptr_t addr, size_t size, int prot); int kern_msgctl(struct thread *, int, int, struct msqid_ds *); int kern_msgrcv(struct thread *, int, void *, size_t, long, int, long *); Modified: stable/12/sys/vm/vm_mmap.c ============================================================================== --- stable/12/sys/vm/vm_mmap.c Wed Sep 16 14:16:09 2020 (r365799) +++ stable/12/sys/vm/vm_mmap.c Wed Sep 16 14:20:45 2020 (r365800) @@ -1457,6 +1457,39 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t siz return (error); } +int +kern_mmap_racct_check(struct thread *td, vm_map_t map, vm_size_t size) +{ + int error; + + RACCT_PROC_LOCK(td->td_proc); + if (map->size + size > lim_cur(td, RLIMIT_VMEM)) { + RACCT_PROC_UNLOCK(td->td_proc); + return (ENOMEM); + } + if (racct_set(td->td_proc, RACCT_VMEM, map->size + size)) { + RACCT_PROC_UNLOCK(td->td_proc); + return (ENOMEM); + } + if (!old_mlock && map->flags & MAP_WIREFUTURE) { + if (ptoa(pmap_wired_count(map->pmap)) + size > + lim_cur(td, RLIMIT_MEMLOCK)) { + racct_set_force(td->td_proc, RACCT_VMEM, map->size); + RACCT_PROC_UNLOCK(td->td_proc); + return (ENOMEM); + } + error = racct_set(td->td_proc, RACCT_MEMLOCK, + ptoa(pmap_wired_count(map->pmap)) + size); + if (error != 0) { + racct_set_force(td->td_proc, RACCT_VMEM, map->size); + RACCT_PROC_UNLOCK(td->td_proc); + return (error); + } + } + RACCT_PROC_UNLOCK(td->td_proc); + return (0); +} + /* * Internal version of mmap that maps a specific VM object into an * map. Called by mmap for MAP_ANON, vm_mmap, shm_mmap, and vn_mmap. @@ -1466,39 +1499,15 @@ vm_mmap_object(vm_map_t map, vm_offset_t *addr, vm_siz vm_prot_t maxprot, int flags, vm_object_t object, vm_ooffset_t foff, boolean_t writecounted, struct thread *td) { - boolean_t curmap, fitit; vm_offset_t max_addr; int docow, error, findspace, rv; + bool curmap, fitit; curmap = map == &td->td_proc->p_vmspace->vm_map; if (curmap) { - RACCT_PROC_LOCK(td->td_proc); - if (map->size + size > lim_cur(td, RLIMIT_VMEM)) { - RACCT_PROC_UNLOCK(td->td_proc); - return (ENOMEM); - } - if (racct_set(td->td_proc, RACCT_VMEM, map->size + size)) { - RACCT_PROC_UNLOCK(td->td_proc); - return (ENOMEM); - } - if (!old_mlock && map->flags & MAP_WIREFUTURE) { - if (ptoa(pmap_wired_count(map->pmap)) + size > - lim_cur(td, RLIMIT_MEMLOCK)) { - racct_set_force(td->td_proc, RACCT_VMEM, - map->size); - RACCT_PROC_UNLOCK(td->td_proc); - return (ENOMEM); - } - error = racct_set(td->td_proc, RACCT_MEMLOCK, - ptoa(pmap_wired_count(map->pmap)) + size); - if (error != 0) { - racct_set_force(td->td_proc, RACCT_VMEM, - map->size); - RACCT_PROC_UNLOCK(td->td_proc); - return (error); - } - } - RACCT_PROC_UNLOCK(td->td_proc); + error = kern_mmap_racct_check(td, map, size); + if (error != 0) + return (error); } /* From owner-svn-src-all@freebsd.org Wed Sep 16 14:45:17 2020 Return-Path: Delivered-To: svn-src-all@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 50B993E8104; Wed, 16 Sep 2020 14:45:17 +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 4Bs2vK1R37z3bRd; Wed, 16 Sep 2020 14:45:17 +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 15F4F1AC9F; Wed, 16 Sep 2020 14:45:17 +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 08GEjGpi073973; Wed, 16 Sep 2020 14:45:16 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GEjGFS073971; Wed, 16 Sep 2020 14:45:16 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202009161445.08GEjGFS073971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Wed, 16 Sep 2020 14:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365801 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 365801 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 14:45:17 -0000 Author: mhorne Date: Wed Sep 16 14:45:16 2020 New Revision: 365801 URL: https://svnweb.freebsd.org/changeset/base/365801 Log: if_media: definitions for 40GE LM4 ethernet media type Reviewed by: erj Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26276 Modified: head/sys/net/ieee8023ad_lacp.c head/sys/net/if_media.h Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Wed Sep 16 14:20:45 2020 (r365800) +++ head/sys/net/ieee8023ad_lacp.c Wed Sep 16 14:45:16 2020 (r365801) @@ -1213,6 +1213,7 @@ lacp_compose_key(struct lacp_port *lp) case IFM_40G_CR4: case IFM_40G_SR4: case IFM_40G_LR4: + case IFM_40G_LM4: case IFM_40G_XLPPI: case IFM_40G_KR4: case IFM_40G_XLAUI: Modified: head/sys/net/if_media.h ============================================================================== --- head/sys/net/if_media.h Wed Sep 16 14:20:45 2020 (r365800) +++ head/sys/net/if_media.h Wed Sep 16 14:45:16 2020 (r365801) @@ -258,6 +258,7 @@ uint64_t ifmedia_baudrate(int); #define IFM_400G_AUI8_AC IFM_X(116) /* 400G-AUI8 active copper/optical */ #define IFM_400G_AUI8 IFM_X(117) /* 400G-AUI8 */ #define IFM_50G_KR4 IFM_X(118) /* 50GBase-KR4 */ +#define IFM_40G_LM4 IFM_X(119) /* 40GBase-LM4 */ /* * Please update ieee8023ad_lacp.c:lacp_compose_key() @@ -456,6 +457,7 @@ struct ifmedia_description { { IFM_40G_CR4, "40Gbase-CR4" }, \ { IFM_40G_SR4, "40Gbase-SR4" }, \ { IFM_40G_LR4, "40Gbase-LR4" }, \ + { IFM_40G_LM4, "40GBase-LM4" }, \ { IFM_1000_KX, "1000Base-KX" }, \ { IFM_OTHER, "Other" }, \ { IFM_10G_KX4, "10GBase-KX4" }, \ @@ -801,6 +803,7 @@ struct ifmedia_baudrate { { IFM_ETHER | IFM_40G_CR4, IF_Gbps(40ULL) }, \ { IFM_ETHER | IFM_40G_SR4, IF_Gbps(40ULL) }, \ { IFM_ETHER | IFM_40G_LR4, IF_Gbps(40ULL) }, \ + { IFM_ETHER | IFM_40G_LM4, IF_Gbps(40ULL) }, \ { IFM_ETHER | IFM_1000_KX, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_10G_KX4, IF_Gbps(10ULL) }, \ { IFM_ETHER | IFM_10G_KR, IF_Gbps(10ULL) }, \ From owner-svn-src-all@freebsd.org Wed Sep 16 15:10:16 2020 Return-Path: Delivered-To: svn-src-all@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 D8E543E8AE2; Wed, 16 Sep 2020 15:10:16 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Bs3S859Hjz3cTp; Wed, 16 Sep 2020 15:10:16 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 907C21AEF2; Wed, 16 Sep 2020 15:10:16 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08GFAGd5086354; Wed, 16 Sep 2020 15:10:16 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GFAGOT086353; Wed, 16 Sep 2020 15:10:16 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202009161510.08GFAGOT086353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 16 Sep 2020 15:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365802 - stable/11/release/doc/share/xml X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/share/xml X-SVN-Commit-Revision: 365802 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 15:10:16 -0000 Author: gjb Date: Wed Sep 16 15:10:16 2020 New Revision: 365802 URL: https://svnweb.freebsd.org/changeset/base/365802 Log: Document SA-20:27-30. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/11/release/doc/share/xml/security.xml Modified: stable/11/release/doc/share/xml/security.xml ============================================================================== --- stable/11/release/doc/share/xml/security.xml Wed Sep 16 14:45:16 2020 (r365801) +++ stable/11/release/doc/share/xml/security.xml Wed Sep 16 15:10:16 2020 (r365802) @@ -80,6 +80,34 @@ 2 September 2020 Heap overflow + + + FreeBSD-SA-20:27.ure + 15 September 2020 + Packet-in-packet attack + + + + FreeBSD-SA-20:28.bhyve_vmcs + 15 September 2020 + Privilege escalation via VMCS + + + + FreeBSD-SA-20:29.bhyve_svm + 15 September 2020 + SVM guest escape + + + + FreeBSD-SA-20:30.ftpd + 15 September 2020 + Privilege escalation + From owner-svn-src-all@freebsd.org Wed Sep 16 15:38:24 2020 Return-Path: Delivered-To: svn-src-all@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 0D3FF3E9B51; Wed, 16 Sep 2020 15:38:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Bs44b6XQSz3fBF; Wed, 16 Sep 2020 15:38:23 +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 C3F501B804; Wed, 16 Sep 2020 15:38:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08GFcNiV004775; Wed, 16 Sep 2020 15:38:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GFcMwm004771; Wed, 16 Sep 2020 15:38:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009161538.08GFcMwm004771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Sep 2020 15:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365803 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 365803 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 15:38:24 -0000 Author: kib Date: Wed Sep 16 15:38:22 2020 New Revision: 365803 URL: https://svnweb.freebsd.org/changeset/base/365803 Log: MFC r365488: Allow consumer to customize physical pager. Modified: stable/12/sys/vm/phys_pager.c stable/12/sys/vm/vm_object.c stable/12/sys/vm/vm_object.h stable/12/sys/vm/vm_pager.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/phys_pager.c ============================================================================== --- stable/12/sys/vm/phys_pager.c Wed Sep 16 15:10:16 2020 (r365802) +++ stable/12/sys/vm/phys_pager.c Wed Sep 16 15:38:22 2020 (r365803) @@ -51,6 +51,20 @@ static struct pagerlst phys_pager_object_list; /* protect access to phys_pager_object_list */ static struct mtx phys_pager_mtx; +static int default_phys_pager_getpages(vm_object_t object, vm_page_t *m, + int count, int *rbehind, int *rahead); +static int default_phys_pager_populate(vm_object_t object, vm_pindex_t pidx, + int fault_type, vm_prot_t max_prot, vm_pindex_t *first, vm_pindex_t *last); +static boolean_t default_phys_pager_haspage(vm_object_t object, + vm_pindex_t pindex, int *before, int *after); +struct phys_pager_ops default_phys_pg_ops = { + .phys_pg_getpages = default_phys_pager_getpages, + .phys_pg_populate = default_phys_pager_populate, + .phys_pg_haspage = default_phys_pager_haspage, + .phys_pg_ctor = NULL, + .phys_pg_dtor = NULL, +}; + static void phys_pager_init(void) { @@ -59,12 +73,13 @@ phys_pager_init(void) mtx_init(&phys_pager_mtx, "phys_pager list", NULL, MTX_DEF); } -static vm_object_t -phys_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, - vm_ooffset_t foff, struct ucred *cred) +vm_object_t +phys_pager_allocate(void *handle, struct phys_pager_ops *ops, void *data, + vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t foff, struct ucred *cred) { vm_object_t object, object1; vm_pindex_t pindex; + bool init; /* * Offset should be page aligned. @@ -73,6 +88,7 @@ phys_pager_alloc(void *handle, vm_ooffset_t size, vm_p return (NULL); pindex = OFF_TO_IDX(foff + PAGE_MASK + size); + init = true; if (handle != NULL) { mtx_lock(&phys_pager_mtx); @@ -97,11 +113,15 @@ phys_pager_alloc(void *handle, vm_ooffset_t size, vm_p */ if (pindex > object->size) object->size = pindex; + init = false; } else { object = object1; object1 = NULL; object->handle = handle; - vm_object_set_flag(object, OBJ_POPULATE); + object->un_pager.phys.ops = ops; + object->un_pager.phys.data_ptr = data; + if (ops->phys_pg_populate != NULL) + vm_object_set_flag(object, OBJ_POPULATE); TAILQ_INSERT_TAIL(&phys_pager_object_list, object, pager_object_list); } @@ -113,12 +133,25 @@ phys_pager_alloc(void *handle, vm_ooffset_t size, vm_p vm_object_deallocate(object1); } else { object = vm_object_allocate(OBJT_PHYS, pindex); - vm_object_set_flag(object, OBJ_POPULATE); + object->un_pager.phys.ops = ops; + object->un_pager.phys.data_ptr = data; + if (ops->phys_pg_populate != NULL) + vm_object_set_flag(object, OBJ_POPULATE); } + if (init && ops->phys_pg_ctor != NULL) + ops->phys_pg_ctor(object, prot, foff, cred); return (object); } +static vm_object_t +phys_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, + vm_ooffset_t foff, struct ucred *ucred) +{ + return (phys_pager_allocate(handle, &default_phys_pg_ops, NULL, + size, prot, foff, ucred)); +} + static void phys_pager_dealloc(vm_object_t object) { @@ -130,16 +163,18 @@ phys_pager_dealloc(vm_object_t object) mtx_unlock(&phys_pager_mtx); VM_OBJECT_WLOCK(object); } - object->handle = NULL; object->type = OBJT_DEAD; + if (object->un_pager.phys.ops->phys_pg_dtor != NULL) + object->un_pager.phys.ops->phys_pg_dtor(object); + object->handle = NULL; } /* * Fill as many pages as vm_fault has allocated for us. */ static int -phys_pager_getpages(vm_object_t object, vm_page_t *m, int count, int *rbehind, - int *rahead) +default_phys_pager_getpages(vm_object_t object, vm_page_t *m, int count, + int *rbehind, int *rahead) { int i; @@ -162,6 +197,14 @@ phys_pager_getpages(vm_object_t object, vm_page_t *m, return (VM_PAGER_OK); } +static int +phys_pager_getpages(vm_object_t object, vm_page_t *m, int count, int *rbehind, + int *rahead) +{ + return (object->un_pager.phys.ops->phys_pg_getpages(object, m, + count, rbehind, rahead)); +} + /* * Implement a pretty aggressive clustered getpages strategy. Hint that * everything in an entire 4MB window should be prefaulted at once. @@ -186,7 +229,7 @@ SYSCTL_INT(_vm, OID_AUTO, phys_pager_cluster, CTLFLAG_ #define PHYSALLOC 16 static int -phys_pager_populate(vm_object_t object, vm_pindex_t pidx, +default_phys_pager_populate(vm_object_t object, vm_pindex_t pidx, int fault_type __unused, vm_prot_t max_prot __unused, vm_pindex_t *first, vm_pindex_t *last) { @@ -238,6 +281,14 @@ retry: return (VM_PAGER_OK); } +static int +phys_pager_populate(vm_object_t object, vm_pindex_t pidx, int fault_type, + vm_prot_t max_prot, vm_pindex_t *first, vm_pindex_t *last) +{ + return (object->un_pager.phys.ops->phys_pg_populate(object, pidx, + fault_type, max_prot, first, last)); +} + static void phys_pager_putpages(vm_object_t object, vm_page_t *m, int count, boolean_t sync, int *rtvals) @@ -247,7 +298,7 @@ phys_pager_putpages(vm_object_t object, vm_page_t *m, } static boolean_t -phys_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, +default_phys_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, int *after) { vm_pindex_t base, end; @@ -259,6 +310,14 @@ phys_pager_haspage(vm_object_t object, vm_pindex_t pin if (after != NULL) *after = end - pindex; return (TRUE); +} + +static boolean_t +phys_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, + int *after) +{ + return (object->un_pager.phys.ops->phys_pg_haspage(object, pindex, + before, after)); } struct pagerops physpagerops = { Modified: stable/12/sys/vm/vm_object.c ============================================================================== --- stable/12/sys/vm/vm_object.c Wed Sep 16 15:10:16 2020 (r365802) +++ stable/12/sys/vm/vm_object.c Wed Sep 16 15:38:22 2020 (r365803) @@ -307,6 +307,7 @@ vm_object_init(void) kernel_object->flags |= OBJ_COLORED; kernel_object->pg_color = (u_short)atop(VM_MIN_KERNEL_ADDRESS); #endif + kernel_object->un_pager.phys.ops = &default_phys_pg_ops; /* * The lock portion of struct vm_object must be type stable due Modified: stable/12/sys/vm/vm_object.h ============================================================================== --- stable/12/sys/vm/vm_object.h Wed Sep 16 15:10:16 2020 (r365802) +++ stable/12/sys/vm/vm_object.h Wed Sep 16 15:38:22 2020 (r365803) @@ -169,6 +169,17 @@ struct vm_object { struct pctrie swp_blks; vm_ooffset_t writemappings; } swp; + + /* + * Phys pager + */ + struct { + struct phys_pager_ops *ops; + union { + void *data_ptr; + uintptr_t data_val; + }; + } phys; } un_pager; struct ucred *cred; vm_ooffset_t charge; Modified: stable/12/sys/vm/vm_pager.h ============================================================================== --- stable/12/sys/vm/vm_pager.h Wed Sep 16 15:10:16 2020 (r365802) +++ stable/12/sys/vm/vm_pager.h Wed Sep 16 15:38:22 2020 (r365803) @@ -233,5 +233,22 @@ vm_object_t cdev_pager_allocate(void *handle, enum obj vm_object_t cdev_pager_lookup(void *handle); void cdev_pager_free_page(vm_object_t object, vm_page_t m); +struct phys_pager_ops { + int (*phys_pg_getpages)(vm_object_t vm_obj, vm_page_t *m, int count, + int *rbehind, int *rahead); + int (*phys_pg_populate)(vm_object_t vm_obj, vm_pindex_t pidx, + int fault_type, vm_prot_t max_prot, vm_pindex_t *first, + vm_pindex_t *last); + boolean_t (*phys_pg_haspage)(vm_object_t obj, vm_pindex_t pindex, + int *before, int *after); + void (*phys_pg_ctor)(vm_object_t vm_obj, vm_prot_t prot, + vm_ooffset_t foff, struct ucred *cred); + void (*phys_pg_dtor)(vm_object_t vm_obj); +}; +extern struct phys_pager_ops default_phys_pg_ops; +vm_object_t phys_pager_allocate(void *handle, struct phys_pager_ops *ops, + void *data, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t foff, + struct ucred *cred); + #endif /* _KERNEL */ #endif /* _VM_PAGER_ */ From owner-svn-src-all@freebsd.org Wed Sep 16 15:42:59 2020 Return-Path: Delivered-To: svn-src-all@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 510FB3EA11E; Wed, 16 Sep 2020 15:42:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Bs49v1S9Kz3fgm; Wed, 16 Sep 2020 15:42:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15CBE1B81E; Wed, 16 Sep 2020 15:42:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08GFgwiX010906; Wed, 16 Sep 2020 15:42:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GFgw7d010904; Wed, 16 Sep 2020 15:42:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009161542.08GFgw7d010904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Sep 2020 15:42:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365804 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 365804 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 15:42:59 -0000 Author: kib Date: Wed Sep 16 15:42:58 2020 New Revision: 365804 URL: https://svnweb.freebsd.org/changeset/base/365804 Log: MFC r365513: Prepare to handle non-trivial errors from vm_map_delete(). Modified: stable/12/sys/vm/vm_map.c stable/12/sys/vm/vm_mmap.c stable/12/sys/vm/vm_unix.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_map.c ============================================================================== --- stable/12/sys/vm/vm_map.c Wed Sep 16 15:38:22 2020 (r365803) +++ stable/12/sys/vm/vm_map.c Wed Sep 16 15:42:58 2020 (r365804) @@ -1742,8 +1742,11 @@ vm_map_fixed(vm_map_t map, vm_object_t object, vm_ooff ("vm_map_fixed: non-NULL backing object for stack")); vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); - if ((cow & MAP_CHECK_EXCL) == 0) - vm_map_delete(map, start, end); + if ((cow & MAP_CHECK_EXCL) == 0) { + result = vm_map_delete(map, start, end); + if (result != KERN_SUCCESS) + goto out; + } if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) != 0) { result = vm_map_stack_locked(map, start, length, sgrowsiz, prot, max, cow); @@ -1751,6 +1754,7 @@ vm_map_fixed(vm_map_t map, vm_object_t object, vm_ooff result = vm_map_insert(map, object, offset, start, end, prot, max, cow); } +out: vm_map_unlock(map); return (result); } @@ -1989,7 +1993,9 @@ again: rv = KERN_INVALID_ADDRESS; goto done; } - vm_map_delete(map, *addr, *addr + length); + rv = vm_map_delete(map, *addr, *addr + length); + if (rv != KERN_SUCCESS) + goto done; } if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) != 0) { rv = vm_map_stack_locked(map, *addr, length, sgrowsiz, prot, Modified: stable/12/sys/vm/vm_mmap.c ============================================================================== --- stable/12/sys/vm/vm_mmap.c Wed Sep 16 15:38:22 2020 (r365803) +++ stable/12/sys/vm/vm_mmap.c Wed Sep 16 15:42:58 2020 (r365804) @@ -534,6 +534,7 @@ kern_munmap(struct thread *td, uintptr_t addr0, size_t vm_offset_t addr, end; vm_size_t pageoff; vm_map_t map; + int rv; if (size == 0) return (EINVAL); @@ -571,10 +572,10 @@ kern_munmap(struct thread *td, uintptr_t addr0, size_t } } #endif - vm_map_delete(map, addr, end); + rv = vm_map_delete(map, addr, end); #ifdef HWPMC_HOOKS - if (__predict_false(pmc_handled)) { + if (rv == KERN_SUCCESS && __predict_false(pmc_handled)) { /* downgrade the lock to prevent a LOR with the pmc-sx lock */ vm_map_lock_downgrade(map); if (pkm.pm_address != (uintptr_t) NULL) @@ -584,8 +585,7 @@ kern_munmap(struct thread *td, uintptr_t addr0, size_t #endif vm_map_unlock(map); - /* vm_map_delete returns nothing but KERN_SUCCESS anyway */ - return (0); + return (vm_mmap_to_errno(rv)); } #ifndef _SYS_SYSPROTO_H_ Modified: stable/12/sys/vm/vm_unix.c ============================================================================== --- stable/12/sys/vm/vm_unix.c Wed Sep 16 15:38:22 2020 (r365803) +++ stable/12/sys/vm/vm_unix.c Wed Sep 16 15:42:58 2020 (r365804) @@ -187,7 +187,7 @@ kern_break(struct thread *td, uintptr_t *addr) rv = vm_map_wire_locked(map, old, new, VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); if (rv != KERN_SUCCESS) - vm_map_delete(map, old, new); + (void)vm_map_delete(map, old, new); } if (rv != KERN_SUCCESS) { #ifdef RACCT From owner-svn-src-all@freebsd.org Wed Sep 16 15:45:36 2020 Return-Path: Delivered-To: svn-src-all@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 D1D493E9F58; Wed, 16 Sep 2020 15:45:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Bs4Dw5BQgz3fcL; Wed, 16 Sep 2020 15:45:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 968C11B66A; Wed, 16 Sep 2020 15:45:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08GFja6w011114; Wed, 16 Sep 2020 15:45:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GFjaWS011113; Wed, 16 Sep 2020 15:45:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009161545.08GFjaWS011113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Sep 2020 15:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365805 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 365805 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 15:45:36 -0000 Author: kib Date: Wed Sep 16 15:45:35 2020 New Revision: 365805 URL: https://svnweb.freebsd.org/changeset/base/365805 Log: MFC r365516: Add vm_map_find_aligned(9). Modified: stable/12/sys/vm/vm_map.c stable/12/sys/vm/vm_map.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_map.c ============================================================================== --- stable/12/sys/vm/vm_map.c Wed Sep 16 15:42:58 2020 (r365804) +++ stable/12/sys/vm/vm_map.c Wed Sep 16 15:45:35 2020 (r365805) @@ -1856,6 +1856,19 @@ vm_map_alignspace(vm_map_t map, vm_object_t object, vm } } +int +vm_map_find_aligned(vm_map_t map, vm_offset_t *addr, vm_size_t length, + vm_offset_t max_addr, vm_offset_t alignment) +{ + /* XXXKIB ASLR eh ? */ + *addr = vm_map_findspace(map, *addr, length); + if (*addr + length > vm_map_max(map) || + (max_addr != 0 && *addr + length > max_addr)) + return (KERN_NO_SPACE); + return (vm_map_alignspace(map, NULL, 0, addr, length, max_addr, + alignment)); +} + /* * vm_map_find finds an unallocated region in the target address * map with the given length. The search is defined to be Modified: stable/12/sys/vm/vm_map.h ============================================================================== --- stable/12/sys/vm/vm_map.h Wed Sep 16 15:42:58 2020 (r365804) +++ stable/12/sys/vm/vm_map.h Wed Sep 16 15:45:35 2020 (r365805) @@ -419,6 +419,8 @@ int vm_map_find(vm_map_t, vm_object_t, vm_ooffset_t, v vm_offset_t, int, vm_prot_t, vm_prot_t, int); int vm_map_find_min(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t *, vm_size_t, vm_offset_t, vm_offset_t, int, vm_prot_t, vm_prot_t, int); +int vm_map_find_aligned(vm_map_t map, vm_offset_t *addr, vm_size_t length, + vm_offset_t max_addr, vm_offset_t alignment); int vm_map_fixed(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t, vm_size_t, vm_prot_t, vm_prot_t, int); vm_offset_t vm_map_findspace(vm_map_t, vm_offset_t, vm_size_t); From owner-svn-src-all@freebsd.org Wed Sep 16 15:48:33 2020 Return-Path: Delivered-To: svn-src-all@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 B92543EA40A; Wed, 16 Sep 2020 15:48: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 4Bs4JK4Y25z3g0n; Wed, 16 Sep 2020 15:48: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 7B23D1B7AF; Wed, 16 Sep 2020 15:48: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 08GFmXW5011292; Wed, 16 Sep 2020 15:48:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GFmXaI011290; Wed, 16 Sep 2020 15:48:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009161548.08GFmXaI011290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Sep 2020 15:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365806 - in stable/12/sys: sys vm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: sys vm X-SVN-Commit-Revision: 365806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 15:48:33 -0000 Author: kib Date: Wed Sep 16 15:48:32 2020 New Revision: 365806 URL: https://svnweb.freebsd.org/changeset/base/365806 Log: MFC r365515: Move MAP_32BIT_MAX_ADDR definition to sys/mman.h. Modified: stable/12/sys/sys/mman.h stable/12/sys/vm/vm_map.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/sys/mman.h ============================================================================== --- stable/12/sys/sys/mman.h Wed Sep 16 15:45:35 2020 (r365805) +++ stable/12/sys/sys/mman.h Wed Sep 16 15:48:32 2020 (r365806) @@ -245,6 +245,9 @@ void shm_drop(struct shmfd *shmfd); int shm_dotruncate(struct shmfd *shmfd, off_t length); extern struct fileops shm_ops; + +#define MAP_32BIT_MAX_ADDR ((vm_offset_t)1 << 31) + #else /* !_KERNEL */ __BEGIN_DECLS Modified: stable/12/sys/vm/vm_map.c ============================================================================== --- stable/12/sys/vm/vm_map.c Wed Sep 16 15:45:35 2020 (r365805) +++ stable/12/sys/vm/vm_map.c Wed Sep 16 15:48:32 2020 (r365806) @@ -1787,8 +1787,6 @@ SYSCTL_LONG(_vm, OID_AUTO, aslr_restarts, CTLFLAG_RD, &aslr_restarts, 0, "Number of aslr failures"); -#define MAP_32BIT_MAX_ADDR ((vm_offset_t)1 << 31) - /* * Searches for the specified amount of free space in the given map with the * specified alignment. Performs an address-ordered, first-fit search from From owner-svn-src-all@freebsd.org Wed Sep 16 16:58:33 2020 Return-Path: Delivered-To: svn-src-all@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 4607A3EBB99; Wed, 16 Sep 2020 16:58:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Bs5s51PXFz4131; Wed, 16 Sep 2020 16:58:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF8411C1CE; Wed, 16 Sep 2020 16:58:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08GGwWC9053339; Wed, 16 Sep 2020 16:58:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GGwTG2053324; Wed, 16 Sep 2020 16:58:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009161658.08GGwTG2053324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 16 Sep 2020 16:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365807 - in head: contrib/llvm-project/clang/include/clang/AST contrib/llvm-project/clang/include/clang/Basic contrib/llvm-project/clang/lib/AST contrib/llvm-project/clang/lib/Basic co... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/llvm-project/clang/include/clang/AST contrib/llvm-project/clang/include/clang/Basic contrib/llvm-project/clang/lib/AST contrib/llvm-project/clang/lib/Basic contrib/llvm-project/clang/... X-SVN-Commit-Revision: 365807 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 16:58:33 -0000 Author: dim Date: Wed Sep 16 16:58:29 2020 New Revision: 365807 URL: https://svnweb.freebsd.org/changeset/base/365807 Log: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp release/11.x llvmorg-11.0.0-rc2-91-g6e042866c30. MFC after: 6 weeks X-MFC-With: r364284 Modified: head/contrib/llvm-project/clang/include/clang/AST/ASTContext.h head/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td head/contrib/llvm-project/clang/lib/AST/ASTContext.cpp head/contrib/llvm-project/clang/lib/AST/DeclBase.cpp head/contrib/llvm-project/clang/lib/AST/ItaniumMangle.cpp head/contrib/llvm-project/clang/lib/Basic/Targets.cpp head/contrib/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp head/contrib/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.cpp head/contrib/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.h head/contrib/llvm-project/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp head/contrib/llvm-project/clang/lib/CodeGen/CodeGenTypes.cpp head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/Sparc.cpp head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp head/contrib/llvm-project/clang/lib/Driver/ToolChains/OpenBSD.cpp head/contrib/llvm-project/clang/lib/Driver/ToolChains/OpenBSD.h head/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp head/contrib/llvm-project/clang/lib/Frontend/InitHeaderSearch.cpp head/contrib/llvm-project/clang/lib/Headers/altivec.h head/contrib/llvm-project/clang/lib/Sema/SemaChecking.cpp head/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp head/contrib/llvm-project/clang/lib/Sema/SemaType.cpp head/contrib/llvm-project/clang/lib/Serialization/ASTReaderDecl.cpp head/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp head/contrib/llvm-project/clang/lib/StaticAnalyzer/Core/DynamicType.cpp head/contrib/llvm-project/compiler-rt/lib/builtins/clear_cache.c head/contrib/llvm-project/compiler-rt/lib/builtins/cpu_model.c head/contrib/llvm-project/compiler-rt/lib/profile/GCDAProfiling.c head/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h head/contrib/llvm-project/libunwind/src/AddressSpace.hpp head/contrib/llvm-project/lld/COFF/Writer.cpp head/contrib/llvm-project/lld/ELF/DWARF.cpp head/contrib/llvm-project/lld/ELF/DWARF.h head/contrib/llvm-project/lld/ELF/LinkerScript.cpp head/contrib/llvm-project/lld/ELF/LinkerScript.h head/contrib/llvm-project/lld/ELF/OutputSections.cpp head/contrib/llvm-project/lld/ELF/SyntheticSections.cpp head/contrib/llvm-project/lld/docs/ELF/linker_script.rst head/contrib/llvm-project/lld/docs/ReleaseNotes.rst head/contrib/llvm-project/llvm/include/llvm/Analysis/InstructionSimplify.h head/contrib/llvm-project/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h head/contrib/llvm-project/llvm/include/llvm/IR/IRBuilder.h head/contrib/llvm-project/llvm/lib/Analysis/InstructionSimplify.cpp head/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp head/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp head/contrib/llvm-project/llvm/lib/CodeGen/MachineCopyPropagation.cpp head/contrib/llvm-project/llvm/lib/CodeGen/RegAllocFast.cpp head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp head/contrib/llvm-project/llvm/lib/CodeGen/TargetLoweringBase.cpp head/contrib/llvm-project/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp head/contrib/llvm-project/llvm/lib/IR/IRBuilder.cpp head/contrib/llvm-project/llvm/lib/IR/LegacyPassManager.cpp head/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp head/contrib/llvm-project/llvm/lib/Target/AArch64/SVEInstrFormats.td head/contrib/llvm-project/llvm/lib/Target/AMDGPU/SIFoldOperands.cpp head/contrib/llvm-project/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp head/contrib/llvm-project/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp head/contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp head/contrib/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp head/lib/clang/include/VCSVersion.inc head/lib/clang/include/llvm/Support/VCSRevision.h Directory Properties: head/contrib/llvm-project/ (props changed) head/contrib/llvm-project/clang/ (props changed) head/contrib/llvm-project/compiler-rt/ (props changed) head/contrib/llvm-project/libunwind/ (props changed) head/contrib/llvm-project/lld/ (props changed) head/contrib/llvm-project/llvm/ (props changed) Modified: head/contrib/llvm-project/clang/include/clang/AST/ASTContext.h ============================================================================== --- head/contrib/llvm-project/clang/include/clang/AST/ASTContext.h Wed Sep 16 15:48:32 2020 (r365806) +++ head/contrib/llvm-project/clang/include/clang/AST/ASTContext.h Wed Sep 16 16:58:29 2020 (r365807) @@ -60,6 +60,7 @@ #include "llvm/Support/Allocator.h" #include "llvm/Support/Casting.h" #include "llvm/Support/Compiler.h" +#include "llvm/Support/TypeSize.h" #include #include #include @@ -1296,6 +1297,21 @@ class ASTContext : public RefCountedBase { /// Returns a vla type where known sizes are replaced with [*]. QualType getVariableArrayDecayedType(QualType Ty) const; + + // Convenience struct to return information about a builtin vector type. + struct BuiltinVectorTypeInfo { + QualType ElementType; + llvm::ElementCount EC; + unsigned NumVectors; + BuiltinVectorTypeInfo(QualType ElementType, llvm::ElementCount EC, + unsigned NumVectors) + : ElementType(ElementType), EC(EC), NumVectors(NumVectors) {} + }; + + /// Returns the element type, element count and number of vectors + /// (in case of tuple) for a builtin vector type. + BuiltinVectorTypeInfo + getBuiltinVectorTypeInfo(const BuiltinType *VecTy) const; /// Return the unique reference to a scalable vector type of the specified /// element type and scalable number of elements. Modified: head/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- head/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td Wed Sep 16 15:48:32 2020 (r365806) +++ head/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td Wed Sep 16 16:58:29 2020 (r365807) @@ -6021,9 +6021,8 @@ def err_func_def_incomplete_result : Error< def err_atomic_specifier_bad_type : Error<"_Atomic cannot be applied to " "%select{incomplete |array |function |reference |atomic |qualified " - "|sizeless ||integer |integer }0type " - "%1 %select{|||||||which is not trivially copyable|with less than " - "1 byte of precision|with a non power of 2 precision}0">; + "|sizeless ||integer }0type " + "%1 %select{|||||||which is not trivially copyable|}0">; // Expressions. def ext_sizeof_alignof_function_type : Extension< @@ -7941,6 +7940,8 @@ def err_atomic_exclusive_builtin_pointer_size : Error< " 1,2,4 or 8 byte type (%0 invalid)">; def err_atomic_builtin_ext_int_size : Error< "Atomic memory operand must have a power-of-two size">; +def err_atomic_builtin_ext_int_prohibit : Error< + "argument to atomic builtin of type '_ExtInt' is not supported">; def err_atomic_op_needs_atomic : Error< "address argument to atomic operation must be a pointer to _Atomic " "type (%0 invalid)">; Modified: head/contrib/llvm-project/clang/lib/AST/ASTContext.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/AST/ASTContext.cpp Wed Sep 16 15:48:32 2020 (r365806) +++ head/contrib/llvm-project/clang/lib/AST/ASTContext.cpp Wed Sep 16 16:58:29 2020 (r365807) @@ -3634,6 +3634,119 @@ QualType ASTContext::getIncompleteArrayType(QualType e return QualType(newType, 0); } +ASTContext::BuiltinVectorTypeInfo +ASTContext::getBuiltinVectorTypeInfo(const BuiltinType *Ty) const { +#define SVE_INT_ELTTY(BITS, ELTS, SIGNED, NUMVECTORS) \ + {getIntTypeForBitwidth(BITS, SIGNED), llvm::ElementCount(ELTS, true), \ + NUMVECTORS}; + +#define SVE_ELTTY(ELTTY, ELTS, NUMVECTORS) \ + {ELTTY, llvm::ElementCount(ELTS, true), NUMVECTORS}; + + switch (Ty->getKind()) { + default: + llvm_unreachable("Unsupported builtin vector type"); + case BuiltinType::SveInt8: + return SVE_INT_ELTTY(8, 16, true, 1); + case BuiltinType::SveUint8: + return SVE_INT_ELTTY(8, 16, false, 1); + case BuiltinType::SveInt8x2: + return SVE_INT_ELTTY(8, 16, true, 2); + case BuiltinType::SveUint8x2: + return SVE_INT_ELTTY(8, 16, false, 2); + case BuiltinType::SveInt8x3: + return SVE_INT_ELTTY(8, 16, true, 3); + case BuiltinType::SveUint8x3: + return SVE_INT_ELTTY(8, 16, false, 3); + case BuiltinType::SveInt8x4: + return SVE_INT_ELTTY(8, 16, true, 4); + case BuiltinType::SveUint8x4: + return SVE_INT_ELTTY(8, 16, false, 4); + case BuiltinType::SveInt16: + return SVE_INT_ELTTY(16, 8, true, 1); + case BuiltinType::SveUint16: + return SVE_INT_ELTTY(16, 8, false, 1); + case BuiltinType::SveInt16x2: + return SVE_INT_ELTTY(16, 8, true, 2); + case BuiltinType::SveUint16x2: + return SVE_INT_ELTTY(16, 8, false, 2); + case BuiltinType::SveInt16x3: + return SVE_INT_ELTTY(16, 8, true, 3); + case BuiltinType::SveUint16x3: + return SVE_INT_ELTTY(16, 8, false, 3); + case BuiltinType::SveInt16x4: + return SVE_INT_ELTTY(16, 8, true, 4); + case BuiltinType::SveUint16x4: + return SVE_INT_ELTTY(16, 8, false, 4); + case BuiltinType::SveInt32: + return SVE_INT_ELTTY(32, 4, true, 1); + case BuiltinType::SveUint32: + return SVE_INT_ELTTY(32, 4, false, 1); + case BuiltinType::SveInt32x2: + return SVE_INT_ELTTY(32, 4, true, 2); + case BuiltinType::SveUint32x2: + return SVE_INT_ELTTY(32, 4, false, 2); + case BuiltinType::SveInt32x3: + return SVE_INT_ELTTY(32, 4, true, 3); + case BuiltinType::SveUint32x3: + return SVE_INT_ELTTY(32, 4, false, 3); + case BuiltinType::SveInt32x4: + return SVE_INT_ELTTY(32, 4, true, 4); + case BuiltinType::SveUint32x4: + return SVE_INT_ELTTY(32, 4, false, 4); + case BuiltinType::SveInt64: + return SVE_INT_ELTTY(64, 2, true, 1); + case BuiltinType::SveUint64: + return SVE_INT_ELTTY(64, 2, false, 1); + case BuiltinType::SveInt64x2: + return SVE_INT_ELTTY(64, 2, true, 2); + case BuiltinType::SveUint64x2: + return SVE_INT_ELTTY(64, 2, false, 2); + case BuiltinType::SveInt64x3: + return SVE_INT_ELTTY(64, 2, true, 3); + case BuiltinType::SveUint64x3: + return SVE_INT_ELTTY(64, 2, false, 3); + case BuiltinType::SveInt64x4: + return SVE_INT_ELTTY(64, 2, true, 4); + case BuiltinType::SveUint64x4: + return SVE_INT_ELTTY(64, 2, false, 4); + case BuiltinType::SveBool: + return SVE_ELTTY(BoolTy, 16, 1); + case BuiltinType::SveFloat16: + return SVE_ELTTY(HalfTy, 8, 1); + case BuiltinType::SveFloat16x2: + return SVE_ELTTY(HalfTy, 8, 2); + case BuiltinType::SveFloat16x3: + return SVE_ELTTY(HalfTy, 8, 3); + case BuiltinType::SveFloat16x4: + return SVE_ELTTY(HalfTy, 8, 4); + case BuiltinType::SveFloat32: + return SVE_ELTTY(FloatTy, 4, 1); + case BuiltinType::SveFloat32x2: + return SVE_ELTTY(FloatTy, 4, 2); + case BuiltinType::SveFloat32x3: + return SVE_ELTTY(FloatTy, 4, 3); + case BuiltinType::SveFloat32x4: + return SVE_ELTTY(FloatTy, 4, 4); + case BuiltinType::SveFloat64: + return SVE_ELTTY(DoubleTy, 2, 1); + case BuiltinType::SveFloat64x2: + return SVE_ELTTY(DoubleTy, 2, 2); + case BuiltinType::SveFloat64x3: + return SVE_ELTTY(DoubleTy, 2, 3); + case BuiltinType::SveFloat64x4: + return SVE_ELTTY(DoubleTy, 2, 4); + case BuiltinType::SveBFloat16: + return SVE_ELTTY(BFloat16Ty, 8, 1); + case BuiltinType::SveBFloat16x2: + return SVE_ELTTY(BFloat16Ty, 8, 2); + case BuiltinType::SveBFloat16x3: + return SVE_ELTTY(BFloat16Ty, 8, 3); + case BuiltinType::SveBFloat16x4: + return SVE_ELTTY(BFloat16Ty, 8, 4); + } +} + /// getScalableVectorType - Return the unique reference to a scalable vector /// type of the specified element type and size. VectorType must be a built-in /// type. Modified: head/contrib/llvm-project/clang/lib/AST/DeclBase.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/AST/DeclBase.cpp Wed Sep 16 15:48:32 2020 (r365806) +++ head/contrib/llvm-project/clang/lib/AST/DeclBase.cpp Wed Sep 16 16:58:29 2020 (r365807) @@ -1487,6 +1487,13 @@ static bool shouldBeHidden(NamedDecl *D) { if (FD->isFunctionTemplateSpecialization()) return true; + // Hide destructors that are invalid. There should always be one destructor, + // but if it is an invalid decl, another one is created. We need to hide the + // invalid one from places that expect exactly one destructor, like the + // serialization code. + if (isa(D) && D->isInvalidDecl()) + return true; + return false; } Modified: head/contrib/llvm-project/clang/lib/AST/ItaniumMangle.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/AST/ItaniumMangle.cpp Wed Sep 16 15:48:32 2020 (r365806) +++ head/contrib/llvm-project/clang/lib/AST/ItaniumMangle.cpp Wed Sep 16 16:58:29 2020 (r365807) @@ -3248,7 +3248,7 @@ static StringRef mangleAArch64VectorBase(const Builtin case BuiltinType::Double: return "Float64"; case BuiltinType::BFloat16: - return "BFloat16"; + return "Bfloat16"; default: llvm_unreachable("Unexpected vector element base type"); } Modified: head/contrib/llvm-project/clang/lib/Basic/Targets.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Basic/Targets.cpp Wed Sep 16 15:48:32 2020 (r365806) +++ head/contrib/llvm-project/clang/lib/Basic/Targets.cpp Wed Sep 16 16:58:29 2020 (r365807) @@ -411,8 +411,6 @@ TargetInfo *AllocateTarget(const llvm::Triple &Triple, return new SolarisTargetInfo(Triple, Opts); case llvm::Triple::NetBSD: return new NetBSDTargetInfo(Triple, Opts); - case llvm::Triple::OpenBSD: - return new OpenBSDTargetInfo(Triple, Opts); case llvm::Triple::RTEMS: return new RTEMSTargetInfo(Triple, Opts); default: @@ -426,8 +424,6 @@ TargetInfo *AllocateTarget(const llvm::Triple &Triple, return new LinuxTargetInfo(Triple, Opts); case llvm::Triple::NetBSD: return new NetBSDTargetInfo(Triple, Opts); - case llvm::Triple::OpenBSD: - return new OpenBSDTargetInfo(Triple, Opts); case llvm::Triple::RTEMS: return new RTEMSTargetInfo(Triple, Opts); default: Modified: head/contrib/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp Wed Sep 16 15:48:32 2020 (r365806) +++ head/contrib/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp Wed Sep 16 16:58:29 2020 (r365807) @@ -719,23 +719,39 @@ llvm::DIType *CGDebugInfo::CreateType(const BuiltinTyp case BuiltinType::Id: \ return getOrCreateStructPtrType("opencl_" #ExtType, Id##Ty); #include "clang/Basic/OpenCLExtensionTypes.def" - // TODO: real support for SVE types requires more infrastructure - // to be added first. The types have a variable length and are - // represented in debug info as types whose length depends on a - // target-specific pseudo register. -#define SVE_TYPE(Name, Id, SingletonId) \ - case BuiltinType::Id: + +#define SVE_TYPE(Name, Id, SingletonId) case BuiltinType::Id: #include "clang/Basic/AArch64SVEACLETypes.def" - { - unsigned DiagID = CGM.getDiags().getCustomDiagID( - DiagnosticsEngine::Error, - "cannot yet generate debug info for SVE type '%0'"); - auto Name = BT->getName(CGM.getContext().getPrintingPolicy()); - CGM.getDiags().Report(DiagID) << Name; - // Return something safe. - return CreateType(cast(CGM.getContext().IntTy)); - } + { + ASTContext::BuiltinVectorTypeInfo Info = + CGM.getContext().getBuiltinVectorTypeInfo(BT); + unsigned NumElemsPerVG = (Info.EC.Min * Info.NumVectors) / 2; + // Debuggers can't extract 1bit from a vector, so will display a + // bitpattern for svbool_t instead. + if (Info.ElementType == CGM.getContext().BoolTy) { + NumElemsPerVG /= 8; + Info.ElementType = CGM.getContext().UnsignedCharTy; + } + + auto *LowerBound = + llvm::ConstantAsMetadata::get(llvm::ConstantInt::getSigned( + llvm::Type::getInt64Ty(CGM.getLLVMContext()), 0)); + SmallVector Expr( + {llvm::dwarf::DW_OP_constu, NumElemsPerVG, llvm::dwarf::DW_OP_bregx, + /* AArch64::VG */ 46, 0, llvm::dwarf::DW_OP_mul, + llvm::dwarf::DW_OP_constu, 1, llvm::dwarf::DW_OP_minus}); + auto *UpperBound = DBuilder.createExpression(Expr); + + llvm::Metadata *Subscript = DBuilder.getOrCreateSubrange( + /*count*/ nullptr, LowerBound, UpperBound, /*stride*/ nullptr); + llvm::DINodeArray SubscriptArray = DBuilder.getOrCreateArray(Subscript); + llvm::DIType *ElemTy = + getOrCreateType(Info.ElementType, TheCU->getFile()); + auto Align = getTypeAlignIfRequired(BT, CGM.getContext()); + return DBuilder.createVectorType(/*Size*/ 0, Align, ElemTy, + SubscriptArray); + } case BuiltinType::UChar: case BuiltinType::Char_U: Encoding = llvm::dwarf::DW_ATE_unsigned_char; Modified: head/contrib/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.cpp Wed Sep 16 15:48:32 2020 (r365806) +++ head/contrib/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.cpp Wed Sep 16 16:58:29 2020 (r365807) @@ -29,7 +29,6 @@ #include "llvm/ADT/SetOperations.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Bitcode/BitcodeReader.h" -#include "llvm/Frontend/OpenMP/OMPIRBuilder.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/GlobalValue.h" @@ -1064,23 +1063,6 @@ CGOpenMPRuntime::CGOpenMPRuntime(CodeGenModule &CGM, S StringRef Separator) : CGM(CGM), FirstSeparator(FirstSeparator), Separator(Separator), OMPBuilder(CGM.getModule()), OffloadEntriesInfoManager(CGM) { - ASTContext &C = CGM.getContext(); - RecordDecl *RD = C.buildImplicitRecord("ident_t"); - QualType KmpInt32Ty = C.getIntTypeForBitwidth(/*DestWidth=*/32, /*Signed=*/1); - RD->startDefinition(); - // reserved_1 - addFieldToRecordDecl(C, RD, KmpInt32Ty); - // flags - addFieldToRecordDecl(C, RD, KmpInt32Ty); - // reserved_2 - addFieldToRecordDecl(C, RD, KmpInt32Ty); - // reserved_3 - addFieldToRecordDecl(C, RD, KmpInt32Ty); - // psource - addFieldToRecordDecl(C, RD, C.VoidPtrTy); - RD->completeDefinition(); - IdentQTy = C.getRecordType(RD); - IdentTy = CGM.getTypes().ConvertRecordDeclType(RD); KmpCriticalNameTy = llvm::ArrayType::get(CGM.Int32Ty, /*NumElements*/ 8); // Initialize Types used in OpenMPIRBuilder from OMPKinds.def @@ -1397,39 +1379,6 @@ createConstantGlobalStructAndAddToParent(CodeGenModule Fields.finishAndAddTo(Parent); } -Address CGOpenMPRuntime::getOrCreateDefaultLocation(unsigned Flags) { - CharUnits Align = CGM.getContext().getTypeAlignInChars(IdentQTy); - unsigned Reserved2Flags = getDefaultLocationReserved2Flags(); - FlagsTy FlagsKey(Flags, Reserved2Flags); - llvm::Value *Entry = OpenMPDefaultLocMap.lookup(FlagsKey); - if (!Entry) { - if (!DefaultOpenMPPSource) { - // Initialize default location for psource field of ident_t structure of - // all ident_t objects. Format is ";file;function;line;column;;". - // Taken from - // https://github.com/llvm/llvm-project/blob/master/openmp/runtime/src/kmp_str.cpp - DefaultOpenMPPSource = - CGM.GetAddrOfConstantCString(";unknown;unknown;0;0;;").getPointer(); - DefaultOpenMPPSource = - llvm::ConstantExpr::getBitCast(DefaultOpenMPPSource, CGM.Int8PtrTy); - } - - llvm::Constant *Data[] = { - llvm::ConstantInt::getNullValue(CGM.Int32Ty), - llvm::ConstantInt::get(CGM.Int32Ty, Flags), - llvm::ConstantInt::get(CGM.Int32Ty, Reserved2Flags), - llvm::ConstantInt::getNullValue(CGM.Int32Ty), DefaultOpenMPPSource}; - llvm::GlobalValue *DefaultOpenMPLocation = - createGlobalStruct(CGM, IdentQTy, isDefaultLocationConstant(), Data, "", - llvm::GlobalValue::PrivateLinkage); - DefaultOpenMPLocation->setUnnamedAddr( - llvm::GlobalValue::UnnamedAddr::Global); - - OpenMPDefaultLocMap[FlagsKey] = Entry = DefaultOpenMPLocation; - } - return Address(Entry, Align); -} - void CGOpenMPRuntime::setLocThreadIdInsertPt(CodeGenFunction &CGF, bool AtCurrentPoint) { auto &Elem = OpenMPLocThreadIDMap.FindAndConstruct(CGF.CurFn); @@ -1458,62 +1407,24 @@ void CGOpenMPRuntime::clearLocThreadIdInsertPt(CodeGen llvm::Value *CGOpenMPRuntime::emitUpdateLocation(CodeGenFunction &CGF, SourceLocation Loc, unsigned Flags) { - Flags |= OMP_IDENT_KMPC; - // If no debug info is generated - return global default location. + llvm::Constant *SrcLocStr; if (CGM.getCodeGenOpts().getDebugInfo() == codegenoptions::NoDebugInfo || - Loc.isInvalid()) - return getOrCreateDefaultLocation(Flags).getPointer(); - - assert(CGF.CurFn && "No function in current CodeGenFunction."); - - CharUnits Align = CGM.getContext().getTypeAlignInChars(IdentQTy); - Address LocValue = Address::invalid(); - auto I = OpenMPLocThreadIDMap.find(CGF.CurFn); - if (I != OpenMPLocThreadIDMap.end()) - LocValue = Address(I->second.DebugLoc, Align); - - // OpenMPLocThreadIDMap may have null DebugLoc and non-null ThreadID, if - // GetOpenMPThreadID was called before this routine. - if (!LocValue.isValid()) { - // Generate "ident_t .kmpc_loc.addr;" - Address AI = CGF.CreateMemTemp(IdentQTy, ".kmpc_loc.addr"); - auto &Elem = OpenMPLocThreadIDMap.FindAndConstruct(CGF.CurFn); - Elem.second.DebugLoc = AI.getPointer(); - LocValue = AI; - - if (!Elem.second.ServiceInsertPt) - setLocThreadIdInsertPt(CGF); - CGBuilderTy::InsertPointGuard IPG(CGF.Builder); - CGF.Builder.SetInsertPoint(Elem.second.ServiceInsertPt); - CGF.Builder.CreateMemCpy(LocValue, getOrCreateDefaultLocation(Flags), - CGF.getTypeSize(IdentQTy)); - } - - // char **psource = &.kmpc_loc_.addr.psource; - LValue Base = CGF.MakeAddrLValue(LocValue, IdentQTy); - auto Fields = cast(IdentQTy->getAsTagDecl())->field_begin(); - LValue PSource = - CGF.EmitLValueForField(Base, *std::next(Fields, IdentField_PSource)); - - llvm::Value *OMPDebugLoc = OpenMPDebugLocMap.lookup(Loc.getRawEncoding()); - if (OMPDebugLoc == nullptr) { - SmallString<128> Buffer2; - llvm::raw_svector_ostream OS2(Buffer2); - // Build debug location - PresumedLoc PLoc = CGF.getContext().getSourceManager().getPresumedLoc(Loc); - OS2 << ";" << PLoc.getFilename() << ";"; + Loc.isInvalid()) { + SrcLocStr = OMPBuilder.getOrCreateDefaultSrcLocStr(); + } else { + std::string FunctionName = ""; if (const auto *FD = dyn_cast_or_null(CGF.CurFuncDecl)) - OS2 << FD->getQualifiedNameAsString(); - OS2 << ";" << PLoc.getLine() << ";" << PLoc.getColumn() << ";;"; - OMPDebugLoc = CGF.Builder.CreateGlobalStringPtr(OS2.str()); - OpenMPDebugLocMap[Loc.getRawEncoding()] = OMPDebugLoc; + FunctionName = FD->getQualifiedNameAsString(); + PresumedLoc PLoc = CGF.getContext().getSourceManager().getPresumedLoc(Loc); + const char *FileName = PLoc.getFilename(); + unsigned Line = PLoc.getLine(); + unsigned Column = PLoc.getColumn(); + SrcLocStr = OMPBuilder.getOrCreateSrcLocStr(FunctionName.c_str(), FileName, + Line, Column); } - // *psource = ";;;;;;"; - CGF.EmitStoreOfScalar(OMPDebugLoc, PSource); - - // Our callers always pass this to a runtime function, so for - // convenience, go ahead and return a naked pointer. - return LocValue.getPointer(); + unsigned Reserved2Flags = getDefaultLocationReserved2Flags(); + return OMPBuilder.getOrCreateIdent(SrcLocStr, llvm::omp::IdentFlag(Flags), + Reserved2Flags); } llvm::Value *CGOpenMPRuntime::getThreadID(CodeGenFunction &CGF, @@ -1595,7 +1506,7 @@ void CGOpenMPRuntime::functionFinished(CodeGenFunction } llvm::Type *CGOpenMPRuntime::getIdentTyPointerTy() { - return IdentTy->getPointerTo(); + return OMPBuilder.IdentPtr; } llvm::Type *CGOpenMPRuntime::getKmpc_MicroPointerTy() { @@ -7354,6 +7265,8 @@ class MappableExprsHandler { (private) // &p, &p, sizeof(float*), TARGET_PARAM | TO | FROM // // map(p[1:24]) + // &p, &p[1], 24*sizeof(float), TARGET_PARAM | TO | FROM | PTR_AND_OBJ + // in unified shared memory mode or for local pointers // p, &p[1], 24*sizeof(float), TARGET_PARAM | TO | FROM // // map(s) @@ -7489,6 +7402,7 @@ class MappableExprsHandler { (private) // Track if the map information being generated is the first for a list of // components. bool IsExpressionFirstInfo = true; + bool FirstPointerInComplexData = false; Address BP = Address::invalid(); const Expr *AssocExpr = I->getAssociatedExpression(); const auto *AE = dyn_cast(AssocExpr); @@ -7531,10 +7445,15 @@ class MappableExprsHandler { (private) QualType Ty = I->getAssociatedDeclaration()->getType().getNonReferenceType(); if (Ty->isAnyPointerType() && std::next(I) != CE) { - BP = CGF.EmitLoadOfPointer(BP, Ty->castAs()); - - // We do not need to generate individual map information for the - // pointer, it can be associated with the combined storage. + // No need to generate individual map information for the pointer, it + // can be associated with the combined storage if shared memory mode is + // active or the base declaration is not global variable. + const auto *VD = dyn_cast(I->getAssociatedDeclaration()); + if (CGF.CGM.getOpenMPRuntime().hasRequiresUnifiedSharedMemory() || + !VD || VD->hasLocalStorage()) + BP = CGF.EmitLoadOfPointer(BP, Ty->castAs()); + else + FirstPointerInComplexData = IsCaptureFirstInfo; ++I; } } @@ -7570,8 +7489,19 @@ class MappableExprsHandler { (private) EncounteredME = dyn_cast(I->getAssociatedExpression()); // If we encounter a PTR_AND_OBJ entry from now on it should be marked // as MEMBER_OF the parent struct. - if (EncounteredME) + if (EncounteredME) { ShouldBeMemberOf = true; + // Do not emit as complex pointer if this is actually not array-like + // expression. + if (FirstPointerInComplexData) { + QualType Ty = std::prev(I) + ->getAssociatedDeclaration() + ->getType() + .getNonReferenceType(); + BP = CGF.EmitLoadOfPointer(BP, Ty->castAs()); + FirstPointerInComplexData = false; + } + } } auto Next = std::next(I); @@ -7704,10 +7634,11 @@ class MappableExprsHandler { (private) // same expression except for the first one. We also need to signal // this map is the first one that relates with the current capture // (there is a set of entries for each capture). - OpenMPOffloadMappingFlags Flags = getMapTypeBits( - MapType, MapModifiers, IsImplicit, - !IsExpressionFirstInfo || RequiresReference, - IsCaptureFirstInfo && !RequiresReference); + OpenMPOffloadMappingFlags Flags = + getMapTypeBits(MapType, MapModifiers, IsImplicit, + !IsExpressionFirstInfo || RequiresReference || + FirstPointerInComplexData, + IsCaptureFirstInfo && !RequiresReference); if (!IsExpressionFirstInfo) { // If we have a PTR_AND_OBJ pair where the OBJ is a pointer as well, @@ -7765,6 +7696,7 @@ class MappableExprsHandler { (private) IsExpressionFirstInfo = false; IsCaptureFirstInfo = false; + FirstPointerInComplexData = false; } } } @@ -7995,6 +7927,10 @@ class MappableExprsHandler { (private) // emission of that entry until the whole struct has been processed. llvm::MapVector> DeferredInfo; + MapBaseValuesArrayTy UseDevicePtrBasePointers; + MapValuesArrayTy UseDevicePtrPointers; + MapValuesArrayTy UseDevicePtrSizes; + MapFlagsArrayTy UseDevicePtrTypes; for (const auto *C : CurExecDir->getClausesOfKind()) { @@ -8011,15 +7947,27 @@ class MappableExprsHandler { (private) // We potentially have map information for this declaration already. // Look for the first set of components that refer to it. if (It != Info.end()) { - auto CI = std::find_if( - It->second.begin(), It->second.end(), [VD](const MapInfo &MI) { - return MI.Components.back().getAssociatedDeclaration() == VD; - }); + auto *CI = llvm::find_if(It->second, [VD](const MapInfo &MI) { + return MI.Components.back().getAssociatedDeclaration() == VD; + }); // If we found a map entry, signal that the pointer has to be returned // and move on to the next declaration. + // Exclude cases where the base pointer is mapped as array subscript, + // array section or array shaping. The base address is passed as a + // pointer to base in this case and cannot be used as a base for + // use_device_ptr list item. if (CI != It->second.end()) { - CI->ReturnDevicePointer = true; - continue; + auto PrevCI = std::next(CI->Components.rbegin()); + const auto *VarD = dyn_cast(VD); + if (CGF.CGM.getOpenMPRuntime().hasRequiresUnifiedSharedMemory() || + isa(IE) || + !VD->getType().getNonReferenceType()->isPointerType() || + PrevCI == CI->Components.rend() || + isa(PrevCI->getAssociatedExpression()) || !VarD || + VarD->hasLocalStorage()) { + CI->ReturnDevicePointer = true; + continue; + } } } @@ -8040,10 +7988,12 @@ class MappableExprsHandler { (private) } else { llvm::Value *Ptr = CGF.EmitLoadOfScalar(CGF.EmitLValue(IE), IE->getExprLoc()); - BasePointers.emplace_back(Ptr, VD); - Pointers.push_back(Ptr); - Sizes.push_back(llvm::Constant::getNullValue(CGF.Int64Ty)); - Types.push_back(OMP_MAP_RETURN_PARAM | OMP_MAP_TARGET_PARAM); + UseDevicePtrBasePointers.emplace_back(Ptr, VD); + UseDevicePtrPointers.push_back(Ptr); + UseDevicePtrSizes.push_back( + llvm::Constant::getNullValue(CGF.Int64Ty)); + UseDevicePtrTypes.push_back(OMP_MAP_RETURN_PARAM | + OMP_MAP_TARGET_PARAM); } } } @@ -8104,10 +8054,12 @@ class MappableExprsHandler { (private) Ptr = CGF.EmitLValue(IE).getPointer(CGF); else Ptr = CGF.EmitScalarExpr(IE); - BasePointers.emplace_back(Ptr, VD); - Pointers.push_back(Ptr); - Sizes.push_back(llvm::Constant::getNullValue(CGF.Int64Ty)); - Types.push_back(OMP_MAP_RETURN_PARAM | OMP_MAP_TARGET_PARAM); + UseDevicePtrBasePointers.emplace_back(Ptr, VD); + UseDevicePtrPointers.push_back(Ptr); + UseDevicePtrSizes.push_back( + llvm::Constant::getNullValue(CGF.Int64Ty)); + UseDevicePtrTypes.push_back(OMP_MAP_RETURN_PARAM | + OMP_MAP_TARGET_PARAM); } } } @@ -8197,6 +8149,12 @@ class MappableExprsHandler { (private) Sizes.append(CurSizes.begin(), CurSizes.end()); Types.append(CurTypes.begin(), CurTypes.end()); } + // Append data for use_device_ptr clauses. + BasePointers.append(UseDevicePtrBasePointers.begin(), + UseDevicePtrBasePointers.end()); + Pointers.append(UseDevicePtrPointers.begin(), UseDevicePtrPointers.end()); + Sizes.append(UseDevicePtrSizes.begin(), UseDevicePtrSizes.end()); + Types.append(UseDevicePtrTypes.begin(), UseDevicePtrTypes.end()); } /// Generate all the base pointers, section pointers, sizes and map types for Modified: head/contrib/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.h ============================================================================== --- head/contrib/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.h Wed Sep 16 15:48:32 2020 (r365806) +++ head/contrib/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.h Wed Sep 16 16:58:29 2020 (r365807) @@ -374,17 +374,7 @@ class CGOpenMPRuntime { (protected) private: /// An OpenMP-IR-Builder instance. llvm::OpenMPIRBuilder OMPBuilder; - /// Default const ident_t object used for initialization of all other - /// ident_t objects. - llvm::Constant *DefaultOpenMPPSource = nullptr; - using FlagsTy = std::pair; - /// Map of flags and corresponding default locations. - using OpenMPDefaultLocMapTy = llvm::DenseMap; - OpenMPDefaultLocMapTy OpenMPDefaultLocMap; - Address getOrCreateDefaultLocation(unsigned Flags); - QualType IdentQTy; - llvm::StructType *IdentTy = nullptr; /// Map for SourceLocation and OpenMP runtime library debug locations. typedef llvm::DenseMap OpenMPDebugLocMapTy; OpenMPDebugLocMapTy OpenMPDebugLocMap; Modified: head/contrib/llvm-project/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp Wed Sep 16 15:48:32 2020 (r365806) +++ head/contrib/llvm-project/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp Wed Sep 16 16:58:29 2020 (r365807) @@ -2857,8 +2857,12 @@ static llvm::Value *castValueToType(CodeGenFunction &C Address CastItem = CGF.CreateMemTemp(CastTy); Address ValCastItem = CGF.Builder.CreatePointerBitCastOrAddrSpaceCast( CastItem, Val->getType()->getPointerTo(CastItem.getAddressSpace())); - CGF.EmitStoreOfScalar(Val, ValCastItem, /*Volatile=*/false, ValTy); - return CGF.EmitLoadOfScalar(CastItem, /*Volatile=*/false, CastTy, Loc); + CGF.EmitStoreOfScalar(Val, ValCastItem, /*Volatile=*/false, ValTy, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); + return CGF.EmitLoadOfScalar(CastItem, /*Volatile=*/false, CastTy, Loc, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); } /// This function creates calls to one of two shuffle functions to copy @@ -2945,9 +2949,14 @@ static void shuffleAndStore(CodeGenFunction &CGF, Addr ThenBB, ExitBB); CGF.EmitBlock(ThenBB); llvm::Value *Res = createRuntimeShuffleFunction( - CGF, CGF.EmitLoadOfScalar(Ptr, /*Volatile=*/false, IntType, Loc), + CGF, + CGF.EmitLoadOfScalar(Ptr, /*Volatile=*/false, IntType, Loc, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()), IntType, Offset, Loc); - CGF.EmitStoreOfScalar(Res, ElemPtr, /*Volatile=*/false, IntType); + CGF.EmitStoreOfScalar(Res, ElemPtr, /*Volatile=*/false, IntType, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); Address LocalPtr = Bld.CreateConstGEP(Ptr, 1); Address LocalElemPtr = Bld.CreateConstGEP(ElemPtr, 1); PhiSrc->addIncoming(LocalPtr.getPointer(), ThenBB); @@ -2956,9 +2965,14 @@ static void shuffleAndStore(CodeGenFunction &CGF, Addr CGF.EmitBlock(ExitBB); } else { llvm::Value *Res = createRuntimeShuffleFunction( - CGF, CGF.EmitLoadOfScalar(Ptr, /*Volatile=*/false, IntType, Loc), + CGF, + CGF.EmitLoadOfScalar(Ptr, /*Volatile=*/false, IntType, Loc, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()), IntType, Offset, Loc); - CGF.EmitStoreOfScalar(Res, ElemPtr, /*Volatile=*/false, IntType); + CGF.EmitStoreOfScalar(Res, ElemPtr, /*Volatile=*/false, IntType, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); Ptr = Bld.CreateConstGEP(Ptr, 1); ElemPtr = Bld.CreateConstGEP(ElemPtr, 1); } @@ -3112,12 +3126,14 @@ static void emitReductionListCopy( } else { switch (CGF.getEvaluationKind(Private->getType())) { case TEK_Scalar: { - llvm::Value *Elem = - CGF.EmitLoadOfScalar(SrcElementAddr, /*Volatile=*/false, - Private->getType(), Private->getExprLoc()); + llvm::Value *Elem = CGF.EmitLoadOfScalar( + SrcElementAddr, /*Volatile=*/false, Private->getType(), + Private->getExprLoc(), LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); // Store the source element value to the dest element address. - CGF.EmitStoreOfScalar(Elem, DestElementAddr, /*Volatile=*/false, - Private->getType()); + CGF.EmitStoreOfScalar( + Elem, DestElementAddr, /*Volatile=*/false, Private->getType(), + LValueBaseInfo(AlignmentSource::Type), TBAAAccessInfo()); break; } case TEK_Complex: { @@ -3260,8 +3276,9 @@ static llvm::Value *emitInterWarpCopyFunction(CodeGenM Address AddrReduceListArg = CGF.GetAddrOfLocalVar(&ReduceListArg); Address LocalReduceList( Bld.CreatePointerBitCastOrAddrSpaceCast( - CGF.EmitLoadOfScalar(AddrReduceListArg, /*Volatile=*/false, - C.VoidPtrTy, Loc), + CGF.EmitLoadOfScalar( + AddrReduceListArg, /*Volatile=*/false, C.VoidPtrTy, Loc, + LValueBaseInfo(AlignmentSource::Type), TBAAAccessInfo()), CGF.ConvertTypeForMem(ReductionArrayTy)->getPointerTo()), CGF.getPointerAlign()); @@ -3339,10 +3356,13 @@ static llvm::Value *emitInterWarpCopyFunction(CodeGenM // elem = *elemptr //*MediumPtr = elem - llvm::Value *Elem = - CGF.EmitLoadOfScalar(ElemPtr, /*Volatile=*/false, CType, Loc); + llvm::Value *Elem = CGF.EmitLoadOfScalar( + ElemPtr, /*Volatile=*/false, CType, Loc, + LValueBaseInfo(AlignmentSource::Type), TBAAAccessInfo()); // Store the source element value to the dest element address. - CGF.EmitStoreOfScalar(Elem, MediumPtr, /*Volatile=*/true, CType); + CGF.EmitStoreOfScalar(Elem, MediumPtr, /*Volatile=*/true, CType, + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); Bld.CreateBr(MergeBB); @@ -3722,8 +3742,9 @@ static llvm::Value *emitListToGlobalCopyFunction( GlobLVal.setAddress(Address(BufferPtr, GlobLVal.getAlignment())); switch (CGF.getEvaluationKind(Private->getType())) { case TEK_Scalar: { - llvm::Value *V = CGF.EmitLoadOfScalar(ElemPtr, /*Volatile=*/false, - Private->getType(), Loc); + llvm::Value *V = CGF.EmitLoadOfScalar( + ElemPtr, /*Volatile=*/false, Private->getType(), Loc, + LValueBaseInfo(AlignmentSource::Type), TBAAAccessInfo()); CGF.EmitStoreOfScalar(V, GlobLVal); break; } @@ -3926,7 +3947,9 @@ static llvm::Value *emitGlobalToListCopyFunction( switch (CGF.getEvaluationKind(Private->getType())) { case TEK_Scalar: { llvm::Value *V = CGF.EmitLoadOfScalar(GlobLVal, Loc); - CGF.EmitStoreOfScalar(V, ElemPtr, /*Volatile=*/false, Private->getType()); + CGF.EmitStoreOfScalar(V, ElemPtr, /*Volatile=*/false, Private->getType(), + LValueBaseInfo(AlignmentSource::Type), + TBAAAccessInfo()); break; } case TEK_Complex: { Modified: head/contrib/llvm-project/clang/lib/CodeGen/CodeGenTypes.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/CodeGen/CodeGenTypes.cpp Wed Sep 16 15:48:32 2020 (r365806) +++ head/contrib/llvm-project/clang/lib/CodeGen/CodeGenTypes.cpp Wed Sep 16 16:58:29 2020 (r365807) @@ -533,99 +533,60 @@ llvm::Type *CodeGenTypes::ConvertType(QualType T) { case BuiltinType::OCLReserveID: ResultType = CGM.getOpenCLRuntime().convertOpenCLSpecificType(Ty); break; -#define GET_SVE_INT_VEC(BITS, ELTS) \ - llvm::ScalableVectorType::get( \ - llvm::IntegerType::get(getLLVMContext(), BITS), ELTS); case BuiltinType::SveInt8: case BuiltinType::SveUint8: - return GET_SVE_INT_VEC(8, 16); case BuiltinType::SveInt8x2: case BuiltinType::SveUint8x2: - return GET_SVE_INT_VEC(8, 32); case BuiltinType::SveInt8x3: case BuiltinType::SveUint8x3: - return GET_SVE_INT_VEC(8, 48); case BuiltinType::SveInt8x4: case BuiltinType::SveUint8x4: - return GET_SVE_INT_VEC(8, 64); case BuiltinType::SveInt16: case BuiltinType::SveUint16: - return GET_SVE_INT_VEC(16, 8); case BuiltinType::SveInt16x2: case BuiltinType::SveUint16x2: - return GET_SVE_INT_VEC(16, 16); case BuiltinType::SveInt16x3: case BuiltinType::SveUint16x3: - return GET_SVE_INT_VEC(16, 24); case BuiltinType::SveInt16x4: case BuiltinType::SveUint16x4: - return GET_SVE_INT_VEC(16, 32); case BuiltinType::SveInt32: case BuiltinType::SveUint32: - return GET_SVE_INT_VEC(32, 4); case BuiltinType::SveInt32x2: case BuiltinType::SveUint32x2: - return GET_SVE_INT_VEC(32, 8); case BuiltinType::SveInt32x3: case BuiltinType::SveUint32x3: - return GET_SVE_INT_VEC(32, 12); case BuiltinType::SveInt32x4: case BuiltinType::SveUint32x4: - return GET_SVE_INT_VEC(32, 16); case BuiltinType::SveInt64: case BuiltinType::SveUint64: - return GET_SVE_INT_VEC(64, 2); case BuiltinType::SveInt64x2: case BuiltinType::SveUint64x2: - return GET_SVE_INT_VEC(64, 4); case BuiltinType::SveInt64x3: case BuiltinType::SveUint64x3: - return GET_SVE_INT_VEC(64, 6); case BuiltinType::SveInt64x4: case BuiltinType::SveUint64x4: - return GET_SVE_INT_VEC(64, 8); case BuiltinType::SveBool: - return GET_SVE_INT_VEC(1, 16); -#undef GET_SVE_INT_VEC -#define GET_SVE_FP_VEC(TY, ISFP16, ELTS) \ - llvm::ScalableVectorType::get( \ - getTypeForFormat(getLLVMContext(), \ - Context.getFloatTypeSemantics(Context.TY), \ - /* UseNativeHalf = */ ISFP16), \ - ELTS); case BuiltinType::SveFloat16: - return GET_SVE_FP_VEC(HalfTy, true, 8); case BuiltinType::SveFloat16x2: - return GET_SVE_FP_VEC(HalfTy, true, 16); case BuiltinType::SveFloat16x3: - return GET_SVE_FP_VEC(HalfTy, true, 24); case BuiltinType::SveFloat16x4: - return GET_SVE_FP_VEC(HalfTy, true, 32); case BuiltinType::SveFloat32: - return GET_SVE_FP_VEC(FloatTy, false, 4); case BuiltinType::SveFloat32x2: - return GET_SVE_FP_VEC(FloatTy, false, 8); case BuiltinType::SveFloat32x3: - return GET_SVE_FP_VEC(FloatTy, false, 12); case BuiltinType::SveFloat32x4: - return GET_SVE_FP_VEC(FloatTy, false, 16); case BuiltinType::SveFloat64: - return GET_SVE_FP_VEC(DoubleTy, false, 2); case BuiltinType::SveFloat64x2: - return GET_SVE_FP_VEC(DoubleTy, false, 4); case BuiltinType::SveFloat64x3: - return GET_SVE_FP_VEC(DoubleTy, false, 6); case BuiltinType::SveFloat64x4: - return GET_SVE_FP_VEC(DoubleTy, false, 8); case BuiltinType::SveBFloat16: - return GET_SVE_FP_VEC(BFloat16Ty, false, 8); case BuiltinType::SveBFloat16x2: - return GET_SVE_FP_VEC(BFloat16Ty, false, 16); case BuiltinType::SveBFloat16x3: - return GET_SVE_FP_VEC(BFloat16Ty, false, 24); - case BuiltinType::SveBFloat16x4: - return GET_SVE_FP_VEC(BFloat16Ty, false, 32); -#undef GET_SVE_FP_VEC + case BuiltinType::SveBFloat16x4: { + ASTContext::BuiltinVectorTypeInfo Info = + Context.getBuiltinVectorTypeInfo(cast(Ty)); + return llvm::ScalableVectorType::get(ConvertType(Info.ElementType), + Info.EC.Min * Info.NumVectors); + } case BuiltinType::Dependent: #define BUILTIN_TYPE(Id, SingletonId) #define PLACEHOLDER_TYPE(Id, SingletonId) \ Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/Sparc.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/Sparc.cpp Wed Sep 16 15:48:32 2020 (r365806) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/Sparc.cpp Wed Sep 16 16:58:29 2020 (r365807) @@ -21,12 +21,19 @@ using namespace llvm::opt; const char *sparc::getSparcAsmModeForCPU(StringRef Name, const llvm::Triple &Triple) { if (Triple.getArch() == llvm::Triple::sparcv9) { + const char *DefV9CPU; + + if (Triple.isOSLinux() || Triple.isOSFreeBSD() || Triple.isOSOpenBSD()) + DefV9CPU = "-Av9a"; + else + DefV9CPU = "-Av9"; + return llvm::StringSwitch(Name) .Case("niagara", "-Av9b") .Case("niagara2", "-Av9b") .Case("niagara3", "-Av9d") .Case("niagara4", "-Av9d") - .Default("-Av9"); + .Default(DefV9CPU); } else { return llvm::StringSwitch(Name) .Case("v8", "-Av8") Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp Wed Sep 16 15:48:32 2020 (r365806) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp Wed Sep 16 16:58:29 2020 (r365807) @@ -498,7 +498,7 @@ static codegenoptions::DebugInfoKind DebugLevelToInfoK return codegenoptions::DebugLineTablesOnly; if (A.getOption().matches(options::OPT_gline_directives_only)) return codegenoptions::DebugDirectivesOnly; - return codegenoptions::DebugInfoConstructor; + return codegenoptions::LimitedDebugInfo; } static bool mustUseNonLeafFramePointerForTarget(const llvm::Triple &Triple) { @@ -2380,7 +2380,7 @@ static void CollectArgsForIntegratedAssembler(Compilat CmdArgs.push_back(Value.data()); } else { RenderDebugEnablingArgs(Args, CmdArgs, - codegenoptions::DebugInfoConstructor, + codegenoptions::LimitedDebugInfo, DwarfVersion, llvm::DebuggerKind::Default); } } else if (Value.startswith("-mcpu") || Value.startswith("-mfpu") || @@ -3653,7 +3653,7 @@ static void RenderDebugOptions(const ToolChain &TC, co if (const Arg *A = Args.getLastArg(options::OPT_g_Group, options::OPT_gsplit_dwarf, options::OPT_gsplit_dwarf_EQ)) { - DebugInfoKind = codegenoptions::DebugInfoConstructor; + DebugInfoKind = codegenoptions::LimitedDebugInfo; // If the last option explicitly specified a debug-info level, use it. if (checkDebugInfoOption(A, Args, D, TC) && @@ -3758,7 +3758,7 @@ static void RenderDebugOptions(const ToolChain &TC, co if (checkDebugInfoOption(A, Args, D, TC)) { if (DebugInfoKind != codegenoptions::DebugLineTablesOnly && DebugInfoKind != codegenoptions::DebugDirectivesOnly) { - DebugInfoKind = codegenoptions::DebugInfoConstructor; + DebugInfoKind = codegenoptions::LimitedDebugInfo; CmdArgs.push_back("-dwarf-ext-refs"); CmdArgs.push_back("-fmodule-format=obj"); } @@ -3778,9 +3778,7 @@ static void RenderDebugOptions(const ToolChain &TC, co TC.GetDefaultStandaloneDebug()); if (const Arg *A = Args.getLastArg(options::OPT_fstandalone_debug)) (void)checkDebugInfoOption(A, Args, D, TC); - if ((DebugInfoKind == codegenoptions::LimitedDebugInfo || - DebugInfoKind == codegenoptions::DebugInfoConstructor) && - NeedFullDebug) + if (DebugInfoKind == codegenoptions::LimitedDebugInfo && NeedFullDebug) DebugInfoKind = codegenoptions::FullDebugInfo; if (Args.hasFlag(options::OPT_gembed_source, options::OPT_gno_embed_source, @@ -6566,7 +6564,7 @@ void Clang::AddClangCLArgs(const ArgList &Args, types: options::OPT_gline_tables_only)) { *EmitCodeView = true; if (DebugInfoArg->getOption().matches(options::OPT__SLASH_Z7)) - *DebugInfoKind = codegenoptions::DebugInfoConstructor; + *DebugInfoKind = codegenoptions::LimitedDebugInfo; else *DebugInfoKind = codegenoptions::DebugLineTablesOnly; } else { @@ -6863,7 +6861,7 @@ void ClangAs::ConstructJob(Compilation &C, const JobAc // the guard for source type, however there is a test which asserts // that some assembler invocation receives no -debug-info-kind, // and it's not clear whether that test is just overly restrictive. - DebugInfoKind = (WantDebug ? codegenoptions::DebugInfoConstructor + DebugInfoKind = (WantDebug ? codegenoptions::LimitedDebugInfo : codegenoptions::NoDebugInfo); // Add the -fdebug-compilation-dir flag if needed. addDebugCompDirArg(Args, CmdArgs, C.getDriver().getVFS()); Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/OpenBSD.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/OpenBSD.cpp Wed Sep 16 15:48:32 2020 (r365806) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/OpenBSD.cpp Wed Sep 16 16:58:29 2020 (r365807) @@ -10,10 +10,12 @@ #include "Arch/Mips.h" #include "Arch/Sparc.h" #include "CommonArgs.h" +#include "clang/Config/config.h" #include "clang/Driver/Compilation.h" #include "clang/Driver/Options.h" #include "clang/Driver/SanitizerArgs.h" #include "llvm/Option/ArgList.h" +#include "llvm/Support/Path.h" using namespace clang::driver; using namespace clang::driver::tools; @@ -41,15 +43,6 @@ void openbsd::Assembler::ConstructJob(Compilation &C, CmdArgs.push_back("-many"); break; - case llvm::Triple::sparc: - case llvm::Triple::sparcel: { - CmdArgs.push_back("-32"); - std::string CPU = getCPUName(Args, getToolChain().getTriple()); - CmdArgs.push_back(sparc::getSparcAsmModeForCPU(CPU, getToolChain().getTriple())); - AddAssemblerKPIC(getToolChain(), Args, CmdArgs); - break; - } - case llvm::Triple::sparcv9: { CmdArgs.push_back("-64"); std::string CPU = getCPUName(Args, getToolChain().getTriple()); @@ -256,6 +249,45 @@ OpenBSD::OpenBSD(const Driver &D, const llvm::Triple & getFilePaths().push_back(getDriver().SysRoot + "/usr/lib"); } +void OpenBSD::AddClangSystemIncludeArgs( + const llvm::opt::ArgList &DriverArgs, + llvm::opt::ArgStringList &CC1Args) const { + const Driver &D = getDriver(); + + if (DriverArgs.hasArg(clang::driver::options::OPT_nostdinc)) + return; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Sep 16 20:58:25 2020 Return-Path: Delivered-To: svn-src-all@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 054243F162C; Wed, 16 Sep 2020 20:58:25 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BsC9r6Srzz4HDH; Wed, 16 Sep 2020 20:58:24 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFB511F451; Wed, 16 Sep 2020 20:58:24 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08GKwOBq008938; Wed, 16 Sep 2020 20:58:24 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GKwOZN008937; Wed, 16 Sep 2020 20:58:24 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <202009162058.08GKwOZN008937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Wed, 16 Sep 2020 20:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365808 - stable/12/sys/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: stable/12/sys/conf X-SVN-Commit-Revision: 365808 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 20:58:25 -0000 Author: allanjude Date: Wed Sep 16 20:58:24 2020 New Revision: 365808 URL: https://svnweb.freebsd.org/changeset/base/365808 Log: Connect new ZFS source file to the kernel build This was missed in r365689 This causes compile issues when building ZFS into the kernel PR: 249311 MFC-with: r365689 Sponsored by: Klara Inc. Modified: stable/12/sys/conf/files Modified: stable/12/sys/conf/files ============================================================================== --- stable/12/sys/conf/files Wed Sep 16 16:58:29 2020 (r365807) +++ stable/12/sys/conf/files Wed Sep 16 20:58:24 2020 (r365808) @@ -163,6 +163,7 @@ cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c o cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/bqueue.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/cityhash.c optional zfs compile-with "${ZFS_C}" +cddl/contrib/opensolaris/uts/common/fs/zfs/dataset_kstats.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf_stats.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c optional zfs compile-with "${ZFS_C}" From owner-svn-src-all@freebsd.org Wed Sep 16 21:24:35 2020 Return-Path: Delivered-To: svn-src-all@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 AA61C3F1F8C; Wed, 16 Sep 2020 21:24:35 +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 4BsCm33pw1z4J6J; Wed, 16 Sep 2020 21:24:35 +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 665631FA96; Wed, 16 Sep 2020 21:24:35 +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 08GLOZ8W027365; Wed, 16 Sep 2020 21:24:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GLOZ5b027364; Wed, 16 Sep 2020 21:24:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009162124.08GLOZ5b027364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Sep 2020 21:24:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365809 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 365809 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 21:24:35 -0000 Author: kib Date: Wed Sep 16 21:24:34 2020 New Revision: 365809 URL: https://svnweb.freebsd.org/changeset/base/365809 Log: Style. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Wed Sep 16 20:58:24 2020 (r365808) +++ head/sys/fs/tmpfs/tmpfs_subr.c Wed Sep 16 21:24:34 2020 (r365809) @@ -1579,7 +1579,7 @@ tmpfs_chflags(struct vnode *vp, u_long flags, struct u /* Disallow this operation if the file system is mounted read-only. */ if (vp->v_mount->mnt_flag & MNT_RDONLY) - return EROFS; + return (EROFS); /* * Callers may only modify the file flags on objects they @@ -1702,11 +1702,11 @@ tmpfs_chown(struct vnode *vp, uid_t uid, gid_t gid, st /* Disallow this operation if the file system is mounted read-only. */ if (vp->v_mount->mnt_flag & MNT_RDONLY) - return EROFS; + return (EROFS); /* Immutable or append-only files cannot be modified, either. */ if (node->tn_flags & (IMMUTABLE | APPEND)) - return EPERM; + return (EPERM); /* * To modify the ownership of a file, must possess VADMIN for that @@ -1765,11 +1765,11 @@ tmpfs_chsize(struct vnode *vp, u_quad_t size, struct u error = 0; switch (vp->v_type) { case VDIR: - return EISDIR; + return (EISDIR); case VREG: if (vp->v_mount->mnt_flag & MNT_RDONLY) - return EROFS; + return (EROFS); break; case VBLK: @@ -1777,23 +1777,27 @@ tmpfs_chsize(struct vnode *vp, u_quad_t size, struct u case VCHR: /* FALLTHROUGH */ case VFIFO: - /* Allow modifications of special files even if in the file + /* + * Allow modifications of special files even if in the file * system is mounted read-only (we are not modifying the - * files themselves, but the objects they represent). */ - return 0; + * files themselves, but the objects they represent). + */ + return (0); default: /* Anything else is unsupported. */ - return EOPNOTSUPP; + return (EOPNOTSUPP); } /* Immutable or append-only files cannot be modified, either. */ if (node->tn_flags & (IMMUTABLE | APPEND)) - return EPERM; + return (EPERM); error = tmpfs_truncate(vp, size); - /* tmpfs_truncate will raise the NOTE_EXTEND and NOTE_ATTRIB kevents - * for us, as will update tn_status; no need to do that here. */ + /* + * tmpfs_truncate will raise the NOTE_EXTEND and NOTE_ATTRIB kevents + * for us, as will update tn_status; no need to do that here. + */ ASSERT_VOP_ELOCKED(vp, "chsize2"); @@ -1818,11 +1822,11 @@ tmpfs_chtimes(struct vnode *vp, struct vattr *vap, /* Disallow this operation if the file system is mounted read-only. */ if (vp->v_mount->mnt_flag & MNT_RDONLY) - return EROFS; + return (EROFS); /* Immutable or append-only files cannot be modified, either. */ if (node->tn_flags & (IMMUTABLE | APPEND)) - return EPERM; + return (EPERM); error = vn_utimes_perm(vp, vap, cred, l); if (error != 0) Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Wed Sep 16 20:58:24 2020 (r365808) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Wed Sep 16 21:24:34 2020 (r365809) @@ -426,7 +426,7 @@ tmpfs_access(struct vop_access_args *v) out: MPASS(VOP_ISLOCKED(vp)); - return error; + return (error); } int @@ -560,9 +560,11 @@ tmpfs_setattr(struct vop_setattr_args *v) vap->va_birthtime.tv_nsec != VNOVAL))) error = tmpfs_chtimes(vp, vap, cred, td); - /* Update the node times. We give preference to the error codes + /* + * Update the node times. We give preference to the error codes * generated by this function rather than the ones that may arise - * from tmpfs_update. */ + * from tmpfs_update. + */ tmpfs_update(vp); MPASS(VOP_ISLOCKED(vp)); @@ -746,8 +748,7 @@ tmpfs_remove(struct vop_remove_args *v) error = 0; out: - - return error; + return (error); } static int From owner-svn-src-all@freebsd.org Wed Sep 16 21:28:20 2020 Return-Path: Delivered-To: svn-src-all@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 0B5AE3F1FA9; Wed, 16 Sep 2020 21:28:20 +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 4BsCrM6YPNz4Jg9; Wed, 16 Sep 2020 21:28:19 +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 C442A1F9A4; Wed, 16 Sep 2020 21:28:19 +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 08GLSJ69027647; Wed, 16 Sep 2020 21:28:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GLSIII027644; Wed, 16 Sep 2020 21:28:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009162128.08GLSIII027644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Sep 2020 21:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365810 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 365810 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 21:28:20 -0000 Author: kib Date: Wed Sep 16 21:28:18 2020 New Revision: 365810 URL: https://svnweb.freebsd.org/changeset/base/365810 Log: tmpfs: restore atime updates for reads from page cache. Split TMPFS_NODE_ACCCESSED bit into dedicated byte that can be updated atomically without locks or (locked) atomics. tn_update_getattr() change also contains unrelated bug fix. Reported by: lwhsu PR: 249362 Reviewed by: markj (previous version) Discussed with: mjg Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D26451 Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_fifoops.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Wed Sep 16 21:24:34 2020 (r365809) +++ head/sys/fs/tmpfs/tmpfs.h Wed Sep 16 21:28:18 2020 (r365810) @@ -173,11 +173,13 @@ struct tmpfs_node { * Node's internal status. This is used by several file system * operations to do modifications to the node in a delayed * fashion. + * + * tn_accessed has a dedicated byte to allow update by store without + * using atomics. This provides a micro-optimization to e.g. + * tmpfs_read_pgcache(). */ - int tn_status; /* (vi) */ -#define TMPFS_NODE_ACCESSED (1 << 1) -#define TMPFS_NODE_MODIFIED (1 << 2) -#define TMPFS_NODE_CHANGED (1 << 3) + uint8_t tn_status; /* (vi) */ + uint8_t tn_accessed; /* unlocked */ /* * The node size. It does not necessarily match the real amount @@ -317,11 +319,16 @@ LIST_HEAD(tmpfs_node_list, tmpfs_node); #define TMPFS_ASSERT_LOCKED(node) (void)0 #endif +/* tn_vpstate */ #define TMPFS_VNODE_ALLOCATING 1 #define TMPFS_VNODE_WANT 2 #define TMPFS_VNODE_DOOMED 4 #define TMPFS_VNODE_WRECLAIM 8 +/* tn_status */ +#define TMPFS_NODE_MODIFIED 0x01 +#define TMPFS_NODE_CHANGED 0x02 + /* * Internal representation of a tmpfs mount point. */ @@ -452,6 +459,7 @@ int tmpfs_chtimes(struct vnode *, struct vattr *, stru void tmpfs_itimes(struct vnode *, const struct timespec *, const struct timespec *); +void tmpfs_set_accessed(struct tmpfs_mount *tm, struct tmpfs_node *node); void tmpfs_set_status(struct tmpfs_mount *tm, struct tmpfs_node *node, int status); int tmpfs_truncate(struct vnode *, off_t); @@ -551,12 +559,10 @@ static inline void tmpfs_update_getattr(struct vnode *vp) { struct tmpfs_node *node; - int update_flags; - update_flags = TMPFS_NODE_ACCESSED | TMPFS_NODE_MODIFIED | TMPFS_NODE_CHANGED; - node = VP_TO_TMPFS_NODE(vp); - if (__predict_false(node->tn_status & update_flags) != 0) + if (__predict_false((node->tn_status & (TMPFS_NODE_MODIFIED | + TMPFS_NODE_CHANGED)) != 0 || node->tn_accessed)) tmpfs_update(vp); } Modified: head/sys/fs/tmpfs/tmpfs_fifoops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_fifoops.c Wed Sep 16 21:24:34 2020 (r365809) +++ head/sys/fs/tmpfs/tmpfs_fifoops.c Wed Sep 16 21:28:18 2020 (r365810) @@ -56,8 +56,7 @@ tmpfs_fifo_close(struct vop_close_args *v) struct tmpfs_node *node; node = VP_TO_TMPFS_NODE(v->a_vp); - tmpfs_set_status(VFS_TO_TMPFS(v->a_vp->v_mount), node, - TMPFS_NODE_ACCESSED); + tmpfs_set_accessed(VFS_TO_TMPFS(v->a_vp->v_mount), node); tmpfs_update(v->a_vp); return (fifo_specops.vop_close(v)); } Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Wed Sep 16 21:24:34 2020 (r365809) +++ head/sys/fs/tmpfs/tmpfs_subr.c Wed Sep 16 21:28:18 2020 (r365810) @@ -88,6 +88,7 @@ tmpfs_node_ctor(void *mem, int size, void *arg, int fl node->tn_gen++; node->tn_size = 0; node->tn_status = 0; + node->tn_accessed = false; node->tn_flags = 0; node->tn_links = 0; node->tn_vnode = NULL; @@ -1098,8 +1099,8 @@ tmpfs_dir_attach(struct vnode *vp, struct tmpfs_dirent tmpfs_dir_attach_dup(dnode, &xde->ud.td_duphead, de); } dnode->tn_size += sizeof(struct tmpfs_dirent); - dnode->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | \ - TMPFS_NODE_MODIFIED; + dnode->tn_status |= TMPFS_NODE_CHANGED | TMPFS_NODE_MODIFIED; + dnode->tn_accessed = true; tmpfs_update(vp); } @@ -1145,8 +1146,8 @@ tmpfs_dir_detach(struct vnode *vp, struct tmpfs_dirent RB_REMOVE(tmpfs_dir, head, de); dnode->tn_size -= sizeof(struct tmpfs_dirent); - dnode->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | \ - TMPFS_NODE_MODIFIED; + dnode->tn_status |= TMPFS_NODE_CHANGED | TMPFS_NODE_MODIFIED; + dnode->tn_accessed = true; tmpfs_update(vp); } @@ -1199,7 +1200,7 @@ tmpfs_dir_getdotdent(struct tmpfs_mount *tm, struct tm else error = uiomove(&dent, dent.d_reclen, uio); - tmpfs_set_status(tm, node, TMPFS_NODE_ACCESSED); + tmpfs_set_accessed(tm, node); return (error); } @@ -1246,7 +1247,7 @@ tmpfs_dir_getdotdotdent(struct tmpfs_mount *tm, struct else error = uiomove(&dent, dent.d_reclen, uio); - tmpfs_set_status(tm, node, TMPFS_NODE_ACCESSED); + tmpfs_set_accessed(tm, node); return (error); } @@ -1391,8 +1392,8 @@ tmpfs_dir_getdents(struct tmpfs_mount *tm, struct tmpf node->tn_dir.tn_readdir_lastn = off; node->tn_dir.tn_readdir_lastp = de; - tmpfs_set_status(tm, node, TMPFS_NODE_ACCESSED); - return error; + tmpfs_set_accessed(tm, node); + return (error); } int @@ -1833,7 +1834,7 @@ tmpfs_chtimes(struct vnode *vp, struct vattr *vap, return (error); if (vap->va_atime.tv_sec != VNOVAL) - node->tn_status |= TMPFS_NODE_ACCESSED; + node->tn_accessed = true; if (vap->va_mtime.tv_sec != VNOVAL) node->tn_status |= TMPFS_NODE_MODIFIED; @@ -1861,6 +1862,14 @@ tmpfs_set_status(struct tmpfs_mount *tm, struct tmpfs_ TMPFS_NODE_UNLOCK(node); } +void +tmpfs_set_accessed(struct tmpfs_mount *tm, struct tmpfs_node *node) +{ + if (node->tn_accessed || tm->tm_ronly) + return; + atomic_store_8(&node->tn_accessed, true); +} + /* Sync timestamps */ void tmpfs_itimes(struct vnode *vp, const struct timespec *acc, @@ -1872,13 +1881,13 @@ tmpfs_itimes(struct vnode *vp, const struct timespec * ASSERT_VOP_LOCKED(vp, "tmpfs_itimes"); node = VP_TO_TMPFS_NODE(vp); - if ((node->tn_status & (TMPFS_NODE_ACCESSED | TMPFS_NODE_MODIFIED | - TMPFS_NODE_CHANGED)) == 0) + if (!node->tn_accessed && + (node->tn_status & (TMPFS_NODE_MODIFIED | TMPFS_NODE_CHANGED)) == 0) return; vfs_timestamp(&now); TMPFS_NODE_LOCK(node); - if (node->tn_status & TMPFS_NODE_ACCESSED) { + if (node->tn_accessed) { if (acc == NULL) acc = &now; node->tn_atime = *acc; @@ -1890,8 +1899,8 @@ tmpfs_itimes(struct vnode *vp, const struct timespec * } if (node->tn_status & TMPFS_NODE_CHANGED) node->tn_ctime = now; - node->tn_status &= ~(TMPFS_NODE_ACCESSED | TMPFS_NODE_MODIFIED | - TMPFS_NODE_CHANGED); + node->tn_status &= ~(TMPFS_NODE_MODIFIED | TMPFS_NODE_CHANGED); + node->tn_accessed = false; TMPFS_NODE_UNLOCK(node); /* XXX: FIX? The entropy here is desirable, but the harvesting may be expensive */ Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Wed Sep 16 21:24:34 2020 (r365809) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Wed Sep 16 21:28:18 2020 (r365810) @@ -586,7 +586,7 @@ tmpfs_read(struct vop_read_args *v) if (uio->uio_offset < 0) return (EINVAL); node = VP_TO_TMPFS_NODE(vp); - tmpfs_set_status(VFS_TO_TMPFS(vp->v_mount), node, TMPFS_NODE_ACCESSED); + tmpfs_set_accessed(VFS_TO_TMPFS(vp->v_mount), node); return (uiomove_object(node->tn_reg.tn_aobj, node->tn_size, uio)); } @@ -622,6 +622,7 @@ tmpfs_read_pgcache(struct vop_read_pgcache_args *v) if (!VN_IS_DOOMED(vp)) { /* size cannot become shorter due to rangelock. */ size = node->tn_size; + tmpfs_set_accessed(node->tn_reg.tn_tmp, node); vfs_smr_exit(); error = uiomove_object(object, size, v->a_uio); return (error); @@ -667,8 +668,8 @@ tmpfs_write(struct vop_write_args *v) } error = uiomove_object(node->tn_reg.tn_aobj, node->tn_size, uio); - node->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_MODIFIED | - TMPFS_NODE_CHANGED; + node->tn_status |= TMPFS_NODE_MODIFIED | TMPFS_NODE_CHANGED; + node->tn_accessed = true; if (node->tn_mode & (S_ISUID | S_ISGID)) { if (priv_check_cred(v->a_cred, PRIV_VFS_RETAINSUGID)) { newmode = node->tn_mode & ~(S_ISUID | S_ISGID); @@ -744,7 +745,8 @@ tmpfs_remove(struct vop_remove_args *v) * reclaimed. */ tmpfs_free_dirent(tmp, de); - node->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED; + node->tn_status |= TMPFS_NODE_CHANGED; + node->tn_accessed = true; error = 0; out: @@ -1317,15 +1319,15 @@ tmpfs_rmdir(struct vop_rmdir_args *v) TMPFS_NODE_LOCK(node); node->tn_links--; node->tn_dir.tn_parent = NULL; - node->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | - TMPFS_NODE_MODIFIED; + node->tn_status |= TMPFS_NODE_CHANGED | TMPFS_NODE_MODIFIED; + node->tn_accessed = true; TMPFS_NODE_UNLOCK(node); TMPFS_NODE_LOCK(dnode); dnode->tn_links--; - dnode->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | - TMPFS_NODE_MODIFIED; + dnode->tn_status |= TMPFS_NODE_CHANGED | TMPFS_NODE_MODIFIED; + dnode->tn_accessed = true; TMPFS_NODE_UNLOCK(dnode); if (tmpfs_use_nc(dvp)) { @@ -1444,7 +1446,7 @@ tmpfs_readlink(struct vop_readlink_args *v) error = uiomove(node->tn_link, MIN(node->tn_size, uio->uio_resid), uio); - tmpfs_set_status(VFS_TO_TMPFS(vp->v_mount), node, TMPFS_NODE_ACCESSED); + tmpfs_set_accessed(VFS_TO_TMPFS(vp->v_mount), node); return (error); } From owner-svn-src-all@freebsd.org Wed Sep 16 21:34:19 2020 Return-Path: Delivered-To: svn-src-all@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 A773E3F21BA; Wed, 16 Sep 2020 21:34:19 +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 4BsCzH43KZz4KJH; Wed, 16 Sep 2020 21:34:19 +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 6FAB91F941; Wed, 16 Sep 2020 21:34:19 +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 08GLYJrV033486; Wed, 16 Sep 2020 21:34:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GLYJVA033485; Wed, 16 Sep 2020 21:34:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009162134.08GLYJVA033485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Sep 2020 21:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365811 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365811 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 21:34:19 -0000 Author: kib Date: Wed Sep 16 21:34:18 2020 New Revision: 365811 URL: https://svnweb.freebsd.org/changeset/base/365811 Log: Improve ddb 'show pgrpdump' command. Use ddb pager. Make lines more compact. Eliminate unneeded casts. Print more job-control related info when reporting process group. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26416 Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed Sep 16 21:28:18 2020 (r365810) +++ head/sys/kern/kern_proc.c Wed Sep 16 21:34:18 2020 (r365811) @@ -995,6 +995,16 @@ sess_release(struct session *s) #ifdef DDB +static void +db_print_pgrp_one(struct pgrp *pgrp, struct proc *p) +{ + db_printf( + " pid %d at %p pr %d pgrp %p e %d jc %d\n", + p->p_pid, p, p->p_pptr == NULL ? -1 : p->p_pptr->p_pid, + p->p_pgrp, (p->p_treeflag & P_TREE_GRPEXITED) != 0, + p->p_pptr == NULL ? 0 : isjobproc(p->p_pptr, pgrp)); +} + DB_SHOW_COMMAND(pgrpdump, pgrpdump) { struct pgrp *pgrp; @@ -1003,19 +1013,15 @@ DB_SHOW_COMMAND(pgrpdump, pgrpdump) for (i = 0; i <= pgrphash; i++) { if (!LIST_EMPTY(&pgrphashtbl[i])) { - printf("\tindx %d\n", i); + db_printf("indx %d\n", i); LIST_FOREACH(pgrp, &pgrphashtbl[i], pg_hash) { - printf( - "\tpgrp %p, pgid %ld, sess %p, sesscnt %d, mem %p\n", - (void *)pgrp, (long)pgrp->pg_id, - (void *)pgrp->pg_session, + db_printf( + " pgrp %p, pgid %d, sess %p, sesscnt %d, mem %p\n", + pgrp, (int)pgrp->pg_id, pgrp->pg_session, pgrp->pg_session->s_count, - (void *)LIST_FIRST(&pgrp->pg_members)); - LIST_FOREACH(p, &pgrp->pg_members, p_pglist) { - printf("\t\tpid %ld addr %p pgrp %p\n", - (long)p->p_pid, (void *)p, - (void *)p->p_pgrp); - } + LIST_FIRST(&pgrp->pg_members)); + LIST_FOREACH(p, &pgrp->pg_members, p_pglist) + db_print_pgrp_one(pgrp, p); } } } From owner-svn-src-all@freebsd.org Wed Sep 16 21:38:25 2020 Return-Path: Delivered-To: svn-src-all@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 999663F2604; Wed, 16 Sep 2020 21:38:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BsD413Vv4z4KF3; Wed, 16 Sep 2020 21:38:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CF451FB25; Wed, 16 Sep 2020 21:38:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08GLcPrl033716; Wed, 16 Sep 2020 21:38:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GLcPUU033715; Wed, 16 Sep 2020 21:38:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009162138.08GLcPUU033715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Sep 2020 21:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365812 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365812 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 21:38:25 -0000 Author: kib Date: Wed Sep 16 21:38:24 2020 New Revision: 365812 URL: https://svnweb.freebsd.org/changeset/base/365812 Log: proc_realparent: if p_oppid does not match pid of the current parent for non-orphaned process, return reaper instead of init. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26416 Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Wed Sep 16 21:34:18 2020 (r365811) +++ head/sys/kern/kern_exit.c Wed Sep 16 21:38:24 2020 (r365812) @@ -104,7 +104,7 @@ proc_realparent(struct proc *child) sx_assert(&proctree_lock, SX_LOCKED); if ((child->p_treeflag & P_TREE_ORPHANED) == 0) return (child->p_pptr->p_pid == child->p_oppid ? - child->p_pptr : initproc); + child->p_pptr : child->p_reaper); for (p = child; (p->p_treeflag & P_TREE_FIRST_ORPHAN) == 0;) { /* Cannot use LIST_PREV(), since the list head is not known. */ p = __containerof(p->p_orphan.le_prev, struct proc, From owner-svn-src-all@freebsd.org Wed Sep 16 21:40:33 2020 Return-Path: Delivered-To: svn-src-all@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 5685F3F24EB; Wed, 16 Sep 2020 21:40: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 4BsD6T1g67z4Kg1; Wed, 16 Sep 2020 21:40: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 1D66C1F944; Wed, 16 Sep 2020 21:40: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 08GLeWXq033904; Wed, 16 Sep 2020 21:40:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GLeWZK033903; Wed, 16 Sep 2020 21:40:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009162140.08GLeWZK033903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Sep 2020 21:40:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365813 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365813 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 21:40:33 -0000 Author: kib Date: Wed Sep 16 21:40:32 2020 New Revision: 365813 URL: https://svnweb.freebsd.org/changeset/base/365813 Log: Assert that P_TREE_GRPEXITED is set only once. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26416 Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed Sep 16 21:38:24 2020 (r365812) +++ head/sys/kern/kern_proc.c Wed Sep 16 21:40:32 2020 (r365813) @@ -851,6 +851,7 @@ fixjobc_kill(struct proc *p) * It is marked by the flag because p is only physically * removed from its process group on wait(2). */ + MPASS((p->p_treeflag & P_TREE_GRPEXITED) == 0); p->p_treeflag |= P_TREE_GRPEXITED; /* From owner-svn-src-all@freebsd.org Wed Sep 16 21:46:58 2020 Return-Path: Delivered-To: svn-src-all@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 28F843F2926; Wed, 16 Sep 2020 21:46: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 4BsDFt0K6Lz4L49; Wed, 16 Sep 2020 21:46: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 E2CC51FAE2; Wed, 16 Sep 2020 21:46:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08GLkvjF039727; Wed, 16 Sep 2020 21:46:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GLkv15039726; Wed, 16 Sep 2020 21:46:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009162146.08GLkv15039726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Sep 2020 21:46:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365814 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365814 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 21:46:58 -0000 Author: kib Date: Wed Sep 16 21:46:57 2020 New Revision: 365814 URL: https://svnweb.freebsd.org/changeset/base/365814 Log: Fix fixjobc+orhpanage. Orphans affect job control state, we must account for them when changing pg_jobc. Instead of p_pptr, use proc_realparent() to get parent relevant for job control. Use correct calculation of the parent for exiting process. For jobc purposes, we must use realparent, but if it is also exiting, we should fall to reaper, then recursively find non-exiting reaper. Reported by: trasz PR: 249257 Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26416 Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed Sep 16 21:40:32 2020 (r365813) +++ head/sys/kern/kern_proc.c Wed Sep 16 21:46:57 2020 (r365814) @@ -645,6 +645,35 @@ isjobproc(struct proc *q, struct pgrp *pgrp) q->p_pgrp->pg_session == pgrp->pg_session); } +static struct proc * +jobc_reaper(struct proc *p) +{ + struct proc *pp; + + sx_assert(&proctree_lock, SX_LOCKED); + + for (pp = p;;) { + pp = pp->p_reaper; + if (pp->p_reaper == pp || + (pp->p_treeflag & P_TREE_GRPEXITED) == 0) + return (pp); + } +} + +static struct proc * +jobc_parent(struct proc *p) +{ + struct proc *pp; + + sx_assert(&proctree_lock, SX_LOCKED); + + pp = proc_realparent(p); + if (pp->p_pptr == NULL || + (pp->p_treeflag & P_TREE_GRPEXITED) == 0) + return (pp); + return (jobc_reaper(pp)); +} + #ifdef INVARIANTS static void check_pgrp_jobc(struct pgrp *pgrp) @@ -661,7 +690,7 @@ check_pgrp_jobc(struct pgrp *pgrp) if ((q->p_treeflag & P_TREE_GRPEXITED) != 0 || q->p_pptr == NULL) continue; - if (isjobproc(q->p_pptr, pgrp)) + if (isjobproc(jobc_parent(q), pgrp)) cnt++; } KASSERT(pgrp->pg_jobc == cnt, ("pgrp %d %p pg_jobc %d cnt %d", @@ -784,6 +813,25 @@ pgadjustjobc(struct pgrp *pgrp, bool entering) PGRP_UNLOCK(pgrp); } +static void +fixjobc_enterpgrp_q(struct pgrp *pgrp, struct proc *p, struct proc *q, bool adj) +{ + struct pgrp *childpgrp; + bool future_jobc; + + sx_assert(&proctree_lock, SX_LOCKED); + + if ((q->p_treeflag & P_TREE_GRPEXITED) != 0) + return; + childpgrp = q->p_pgrp; + future_jobc = childpgrp != pgrp && + childpgrp->pg_session == pgrp->pg_session; + + if ((adj && !isjobproc(p, childpgrp) && future_jobc) || + (!adj && isjobproc(p, childpgrp) && !future_jobc)) + pgadjustjobc(childpgrp, adj); +} + /* * Adjust pgrp jobc counters when specified process changes process group. * We count the number of processes in each process group that "qualify" @@ -798,8 +846,6 @@ static void fixjobc_enterpgrp(struct proc *p, struct pgrp *pgrp) { struct proc *q; - struct pgrp *childpgrp; - bool future_jobc; sx_assert(&proctree_lock, SX_LOCKED); PROC_LOCK_ASSERT(p, MA_NOTOWNED); @@ -809,36 +855,49 @@ fixjobc_enterpgrp(struct proc *p, struct pgrp *pgrp) if (p->p_pgrp == pgrp) return; - if (isjobproc(p->p_pptr, pgrp)) + if (isjobproc(jobc_parent(p), pgrp)) pgadjustjobc(pgrp, true); LIST_FOREACH(q, &p->p_children, p_sibling) { - if ((q->p_treeflag & P_TREE_GRPEXITED) != 0) + if ((q->p_treeflag & P_TREE_ORPHANED) != 0) continue; - childpgrp = q->p_pgrp; - future_jobc = childpgrp != pgrp && - childpgrp->pg_session == pgrp->pg_session; - if (!isjobproc(p, childpgrp) && future_jobc) - pgadjustjobc(childpgrp, true); + fixjobc_enterpgrp_q(pgrp, p, q, true); } + LIST_FOREACH(q, &p->p_orphans, p_orphan) + fixjobc_enterpgrp_q(pgrp, p, q, true); - if (isjobproc(p->p_pptr, p->p_pgrp)) + if (isjobproc(jobc_parent(p), p->p_pgrp)) pgadjustjobc(p->p_pgrp, false); LIST_FOREACH(q, &p->p_children, p_sibling) { - if ((q->p_treeflag & P_TREE_GRPEXITED) != 0) + if ((q->p_treeflag & P_TREE_ORPHANED) != 0) continue; - childpgrp = q->p_pgrp; - future_jobc = childpgrp != pgrp && - childpgrp->pg_session == pgrp->pg_session; - if (isjobproc(p, childpgrp) && !future_jobc) - pgadjustjobc(childpgrp, false); + fixjobc_enterpgrp_q(pgrp, p, q, false); } + LIST_FOREACH(q, &p->p_orphans, p_orphan) + fixjobc_enterpgrp_q(pgrp, p, q, false); } static void +fixjobc_kill_q(struct proc *p, struct proc *q, bool adj) +{ + struct pgrp *childpgrp; + + sx_assert(&proctree_lock, SX_LOCKED); + + if ((q->p_treeflag & P_TREE_GRPEXITED) != 0) + return; + childpgrp = q->p_pgrp; + + if ((adj && isjobproc(jobc_reaper(q), childpgrp) && + !isjobproc(p, childpgrp)) || (!adj && !isjobproc(jobc_reaper(q), + childpgrp) && isjobproc(p, childpgrp))) + pgadjustjobc(childpgrp, adj); +} + +static void fixjobc_kill(struct proc *p) { struct proc *q; - struct pgrp *childpgrp, *pgrp; + struct pgrp *pgrp; sx_assert(&proctree_lock, SX_LOCKED); PROC_LOCK_ASSERT(p, MA_NOTOWNED); @@ -858,7 +917,7 @@ fixjobc_kill(struct proc *p) * Check p's parent to see whether p qualifies its own process * group; if so, adjust count for p's process group. */ - if (isjobproc(p->p_pptr, pgrp)) + if (isjobproc(jobc_parent(p), pgrp)) pgadjustjobc(pgrp, false); /* @@ -867,21 +926,19 @@ fixjobc_kill(struct proc *p) * adjust counts for children's process groups. */ LIST_FOREACH(q, &p->p_children, p_sibling) { - if ((q->p_treeflag & P_TREE_GRPEXITED) != 0) + if ((q->p_treeflag & P_TREE_ORPHANED) != 0) continue; - childpgrp = q->p_pgrp; - if (isjobproc(q->p_reaper, childpgrp) && - !isjobproc(p, childpgrp)) - pgadjustjobc(childpgrp, true); + fixjobc_kill_q(p, q, true); } + LIST_FOREACH(q, &p->p_orphans, p_orphan) + fixjobc_kill_q(p, q, true); LIST_FOREACH(q, &p->p_children, p_sibling) { - if ((q->p_treeflag & P_TREE_GRPEXITED) != 0) + if ((q->p_treeflag & P_TREE_ORPHANED) != 0) continue; - childpgrp = q->p_pgrp; - if (!isjobproc(q->p_reaper, childpgrp) && - isjobproc(p, childpgrp)) - pgadjustjobc(childpgrp, false); + fixjobc_kill_q(p, q, false); } + LIST_FOREACH(q, &p->p_orphans, p_orphan) + fixjobc_kill_q(p, q, false); } void From owner-svn-src-all@freebsd.org Wed Sep 16 21:49:20 2020 Return-Path: Delivered-To: svn-src-all@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 5933C3F2C27; Wed, 16 Sep 2020 21:49:20 +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 4BsDJc1jPxz4LLd; Wed, 16 Sep 2020 21:49:20 +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 1DD071F9E2; Wed, 16 Sep 2020 21:49:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08GLnK73039897; Wed, 16 Sep 2020 21:49:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GLnJ7G039896; Wed, 16 Sep 2020 21:49:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009162149.08GLnJ7G039896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 Sep 2020 21:49:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365815 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365815 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 21:49:20 -0000 Author: kib Date: Wed Sep 16 21:49:19 2020 New Revision: 365815 URL: https://svnweb.freebsd.org/changeset/base/365815 Log: Add check_pgrp_jobc() calls into process exit path. Both before and after job control adjustments. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26416 Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed Sep 16 21:46:57 2020 (r365814) +++ head/sys/kern/kern_proc.c Wed Sep 16 21:49:19 2020 (r365815) @@ -904,6 +904,7 @@ fixjobc_kill(struct proc *p) pgrp = p->p_pgrp; PGRP_LOCK_ASSERT(pgrp, MA_NOTOWNED); SESS_LOCK_ASSERT(pgrp->pg_session, MA_NOTOWNED); + check_pgrp_jobc(pgrp); /* * p no longer affects process group orphanage for children. @@ -939,6 +940,8 @@ fixjobc_kill(struct proc *p) } LIST_FOREACH(q, &p->p_orphans, p_orphan) fixjobc_kill_q(p, q, false); + + check_pgrp_jobc(pgrp); } void From owner-svn-src-all@freebsd.org Wed Sep 16 22:36:05 2020 Return-Path: Delivered-To: svn-src-all@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 2AECF3F367E; Wed, 16 Sep 2020 22:36:05 +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 4BsFLY0gpBz4NkL; Wed, 16 Sep 2020 22:36:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE61020800; Wed, 16 Sep 2020 22:36:04 +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 08GMa4K8070586; Wed, 16 Sep 2020 22:36:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GMa4Rs070582; Wed, 16 Sep 2020 22:36:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009162236.08GMa4Rs070582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 16 Sep 2020 22:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365816 - in stable/12: sys/sys usr.sbin/crunch/crunchgen X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12: sys/sys usr.sbin/crunch/crunchgen X-SVN-Commit-Revision: 365816 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 22:36:05 -0000 Author: kevans Date: Wed Sep 16 22:36:03 2020 New Revision: 365816 URL: https://svnweb.freebsd.org/changeset/base/365816 Log: MFC outstanding crunchgen work: r350152, r364166, r364174, r364234, r364646-r364647, r365605, r365705 r350152: Remove obsolete RELEASE_CRUNCH Remove documentation of RELEASE_CRUNCH here. It's obsolete and no longer a good example. r364166: Fix crunchgen usage of mkstemp() On Glibc systems mkstemp can only be used once with the same template string since it will be modified in-place and no longer contain any 'X' chars. It is fine to reuse the same file here but we need to be explicit and use open() instead of mkstemp() on the second use. While touching this file also avoid a hardcoded /bin/pwd since that may not work when building on non-FreeBSD systems. r364174: Use env pwd instead of pwd in crunchgen.c In r364166 I changed /bin/pwd to pwd, but pwd can be shell builtin that may not correctly return a real path. To ensure that all symlinks are resolved use `env pwd -P` instead (the -P flag is part of POSIX so should be supported everywhere). r364234: crunchgen: use pwd -P without env The -P flag is required by POSIX so we don't have to care whether pwd is a shell builtin or not. This also allows removing pwd from the list of bootstrap tools since all shells we care about for building have a builtin pwd command. This effectively reverts r364190. r364646: Re-indent crunched_main.c in preparation for D25998 r364647: Correctly determine the real executable in crunched binaries This should fix cases like su setting argv[0] to _su for /bin/sh. Previously cheribsdbox (a crunched tool we use in CheriBSD to reduce the size of our minimal disk images to allow loading them onto FPGAs without waiting forever for the transfer) would complain about _su not being compiled in, but now that we also look at AT_EXECPATH it correctly invokes the sh tool. Note: we use use AT_EXECPATH instead of the KERN_PROC_PATHNAME sysctl to get the crunchgen binary name since it seems like KERN_PROC_PATHNAME just returns the last cached path for a given hardlink. When using `su`, instead of invoking /bin/csh this would invoke the last used hardlink to cheribsdbox. This caused weird test failures when running tests due to `id` being executed instead of `echo`: $ id # id is a hardlink to /bin/cheribsdbox $ su postgres -c 'echo 1' # su is also a hardlink uid=1001(postgres) gid=1001(postgres) groups=1001(postgres) r365605: crunchgen(8): fix crunched application build with WARNS=6 This was revealed by the rescue build with a patch I'm working on to default WARNS=6 everywhere. The issues resolved were: - Missing prototype for _crunched_${ident}_stub in the *_stub.c generated bits - Missing prototype for crunched_main - Incomplete prototype for _crunched_${ident}_stub in the generated parts of crunched_main - Literal strings in the stub table must drop const qualifier, unless we const'ify name - f field in struct stub didn't have a proper prototype Most of these issues are minor formalities and easily addressed. I note that if my patch to eventually raise WARNS for the rescue build lands, we'll need to bump the __FreeBSD_version requirement for bootstrapping crunchgen and wipe out the rescue .OBJDIR if it's stale, which we should be able to detect pretty easily from a couple of the issues that have been fixed here. r365705: __FreeBSD_version bump for r365605 (crunchgen producing WARNS-clean) The change in D26397 will need a __FreeBSD_version to base off of for bootstrapping crunchgen, to avoid avoidable build failures just because the host has an outdated crunchgen. Modified: stable/12/sys/sys/param.h stable/12/usr.sbin/crunch/crunchgen/crunched_main.c stable/12/usr.sbin/crunch/crunchgen/crunchgen.1 stable/12/usr.sbin/crunch/crunchgen/crunchgen.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Wed Sep 16 21:49:19 2020 (r365815) +++ stable/12/sys/sys/param.h Wed Sep 16 22:36:03 2020 (r365816) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1202501 /* Master, propagated to newvers */ +#define __FreeBSD_version 1202502 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: stable/12/usr.sbin/crunch/crunchgen/crunched_main.c ============================================================================== --- stable/12/usr.sbin/crunch/crunchgen/crunched_main.c Wed Sep 16 21:49:19 2020 (r365815) +++ stable/12/usr.sbin/crunch/crunchgen/crunched_main.c Wed Sep 16 22:36:03 2020 (r365816) @@ -23,6 +23,38 @@ * Computer Science Department * University of Maryland at College Park */ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2020 Alex Richardson + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ /* * crunched_main.c - main program for crunched binaries, it branches to a * particular subprogram based on the value of argv[0]. Also included @@ -35,82 +67,142 @@ #include __FBSDID("$FreeBSD$"); +#include +#include +#include + +#include #include #include #include +typedef int crunched_stub_t(int, char **, char **); + struct stub { - char *name; - int (*f)(); + const char *name; + crunched_stub_t *f; }; -extern char *__progname; +extern const char *__progname; extern struct stub entry_points[]; static void crunched_usage(void); +crunched_stub_t crunched_main; + +static struct stub * +find_entry_point(const char *basename) +{ + struct stub *ep = NULL; + + for (ep = entry_points; ep->name != NULL; ep++) + if (!strcmp(basename, ep->name)) + break; + + return (ep); +} + +static const char * +get_basename(const char *exe_path) +{ + const char *slash = strrchr(exe_path, '/'); + return (slash ? slash + 1 : exe_path); +} + int main(int argc, char **argv, char **envp) { - char *slash, *basename; - struct stub *ep; + struct stub *ep = NULL; + const char *basename = NULL; - if(argv[0] == NULL || *argv[0] == '\0') - crunched_usage(); + /* + * Look at __progname first (this will be set if the crunched binary is + * invoked directly). + */ + if (__progname) { + basename = get_basename(__progname); + ep = find_entry_point(basename); + } - slash = strrchr(argv[0], '/'); - basename = slash? slash+1 : argv[0]; + /* + * Otherwise try to find entry point based on argv[0] (this works for + * both symlinks as well as hardlinks). However, it does not work when + * su invokes a crunched shell because it sets argv[0] to _su when + * invoking the shell. In that case we look at AT_EXECPATH as a + * fallback. + */ + if (ep == NULL) { + basename = get_basename(argv[0]); + ep = find_entry_point(basename); + } - for(ep=entry_points; ep->name != NULL; ep++) - if(!strcmp(basename, ep->name)) break; + /* + * If we didn't find the entry point based on __progname or argv[0], + * try AT_EXECPATH to get the actual binary that was executed. + */ + if (ep == NULL) { + char buf[MAXPATHLEN]; + int error = elf_aux_info(AT_EXECPATH, &buf, sizeof(buf)); - if(ep->name) - return ep->f(argc, argv, envp); - else { - fprintf(stderr, "%s: %s not compiled in\n", EXECNAME, basename); - crunched_usage(); - } -} + if (error == 0) { + const char *exe_name = get_basename(buf); + /* + * Keep using argv[0] if AT_EXECPATH is the crunched + * binary so that symlinks to the crunched binary report + * "not compiled in" instead of invoking + * crunched_main(). + */ + if (strcmp(exe_name, EXECNAME) != 0) { + basename = exe_name; + ep = find_entry_point(basename); + } + } else { + warnc(error, "elf_aux_info(AT_EXECPATH) failed"); + } + } + if (basename == NULL || *basename == '\0') + crunched_usage(); + if (ep != NULL) { + return ep->f(argc, argv, envp); + } else { + fprintf(stderr, "%s: %s not compiled in\n", EXECNAME, basename); + crunched_usage(); + } +} + int crunched_main(int argc, char **argv, char **envp) { - char *slash; - struct stub *ep; - int columns, len; + if (argc <= 1) + crunched_usage(); - if(argc <= 1) - crunched_usage(); - - slash = strrchr(argv[1], '/'); - __progname = slash? slash+1 : argv[1]; - - return main(--argc, ++argv, envp); + __progname = get_basename(argv[1]); + return main(--argc, ++argv, envp); } - static void crunched_usage() { - int columns, len; - struct stub *ep; + int columns, len; + struct stub *ep; - fprintf(stderr, "usage: %s ..., where is one of:\n", - EXECNAME); - columns = 0; - for(ep=entry_points; ep->name != NULL; ep++) { - len = strlen(ep->name) + 1; - if(columns+len < 80) - columns += len; - else { - fprintf(stderr, "\n"); - columns = len; + fprintf(stderr, + "usage: %s ..., where is one of:\n", EXECNAME); + columns = 0; + for (ep = entry_points; ep->name != NULL; ep++) { + len = strlen(ep->name) + 1; + if (columns + len < 80) + columns += len; + else { + fprintf(stderr, "\n"); + columns = len; + } + fprintf(stderr, " %s", ep->name); } - fprintf(stderr, " %s", ep->name); - } - fprintf(stderr, "\n"); - exit(1); + fprintf(stderr, "\n"); + exit(1); } /* end of crunched_main.c */ Modified: stable/12/usr.sbin/crunch/crunchgen/crunchgen.1 ============================================================================== --- stable/12/usr.sbin/crunch/crunchgen/crunchgen.1 Wed Sep 16 21:49:19 2020 (r365815) +++ stable/12/usr.sbin/crunch/crunchgen/crunchgen.1 Wed Sep 16 22:36:03 2020 (r365816) @@ -137,9 +137,7 @@ Set the name of a file to be included at the beginning .Pa Makefile Ns s generated by .Nm . -This is useful to define some make variables such as -.Va RELEASE_CRUNCH -or similar, which might affect the behavior of +This is useful to define some make variables which might affect the behavior of .Xr make 1 and are annoying to pass through environment variables. .It Fl m Ar makefile-name Modified: stable/12/usr.sbin/crunch/crunchgen/crunchgen.c ============================================================================== --- stable/12/usr.sbin/crunch/crunchgen/crunchgen.c Wed Sep 16 21:49:19 2020 (r365815) +++ stable/12/usr.sbin/crunch/crunchgen/crunchgen.c Wed Sep 16 22:36:03 2020 (r365816) @@ -39,10 +39,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include #include +#include #include #define CRUNCH_VERSION "0.2" @@ -91,6 +94,7 @@ prog_t *progs = NULL; char confname[MAXPATHLEN], infilename[MAXPATHLEN]; char outmkname[MAXPATHLEN], outcfname[MAXPATHLEN], execfname[MAXPATHLEN]; char tempfname[MAXPATHLEN], cachename[MAXPATHLEN], curfilename[MAXPATHLEN]; +bool tempfname_initialized = false; char outhdrname[MAXPATHLEN] ; /* user-supplied header for *.mk */ char *objprefix; /* where are the objects ? */ char *path_make; @@ -216,6 +220,7 @@ main(int argc, char **argv) snprintf(cachename, sizeof(cachename), "%s.cache", confname); snprintf(tempfname, sizeof(tempfname), "%s/crunchgen_%sXXXXXX", getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP, confname); + tempfname_initialized = false; parse_conf_file(); if (list_mode) @@ -648,8 +653,7 @@ fillin_program(prog_t *p) /* Determine the actual srcdir (maybe symlinked). */ if (p->srcdir) { - snprintf(line, MAXLINELEN, "cd %s && echo -n `/bin/pwd`", - p->srcdir); + snprintf(line, MAXLINELEN, "cd %s && pwd -P", p->srcdir); f = popen(line,"r"); if (!f) errx(1, "Can't execute: %s\n", line); @@ -721,14 +725,26 @@ fillin_program_objs(prog_t *p, char *path) /* discover the objs from the srcdir Makefile */ - if ((fd = mkstemp(tempfname)) == -1) { - perror(tempfname); - exit(1); + /* + * We reuse the same temporary file name for multiple objects. However, + * some libc implementations (such as glibc) return EINVAL if there + * are no XXXXX characters in the template. This happens after the + * first call to mkstemp since the argument is modified in-place. + * To avoid this error we use open() instead of mkstemp() after the + * call to mkstemp(). + */ + if (tempfname_initialized) { + if ((fd = open(tempfname, O_CREAT | O_EXCL | O_RDWR, 0600)) == -1) { + err(EX_OSERR, "open(%s)", tempfname); + } + } else if ((fd = mkstemp(tempfname)) == -1) { + err(EX_OSERR, "mkstemp(%s)", tempfname); } + tempfname_initialized = true; if ((f = fdopen(fd, "w")) == NULL) { - warn("%s", tempfname); + warn("fdopen(%s)", tempfname); goterror = 1; - return; + goto out; } if (p->objvar) objvar = p->objvar; @@ -763,14 +779,14 @@ fillin_program_objs(prog_t *p, char *path) if ((f = popen(line, "r")) == NULL) { warn("submake pipe"); goterror = 1; - return; + goto out; } while(fgets(line, MAXLINELEN, f)) { if (strncmp(line, "OBJS= ", 6)) { warnx("make error: %s", line); goterror = 1; - continue; + goto out; } cp = line + 6; @@ -793,7 +809,7 @@ fillin_program_objs(prog_t *p, char *path) warnx("make error: make returned %d", rc); goterror = 1; } - +out: unlink(tempfname); } @@ -918,7 +934,9 @@ gen_output_cfile(void) fprintf(outcf, "%s\n", *cp); for (p = progs; p != NULL; p = p->next) - fprintf(outcf, "extern int _crunched_%s_stub();\n", p->ident); + fprintf(outcf, + "extern crunched_stub_t _crunched_%s_stub;\n", + p->ident); fprintf(outcf, "\nstruct stub entry_points[] = {\n"); for (p = progs; p != NULL; p = p->next) { @@ -1106,9 +1124,10 @@ prog_makefile_rules(FILE *outmk, prog_t *p) fprintf(outmk, "%s_stub.c:\n", p->name); fprintf(outmk, "\techo \"" "extern int main(int argc, char **argv, char **envp); " + "int _crunched_%s_stub(int argc, char **argv, char **envp);" "int _crunched_%s_stub(int argc, char **argv, char **envp)" "{return main(argc,argv,envp);}\" >%s_stub.c\n", - p->ident, p->name); + p->ident, p->ident, p->name); fprintf(outmk, "%s.lo: %s_stub.o $(%s_OBJPATHS)", p->name, p->name, p->ident); if (p->libs) From owner-svn-src-all@freebsd.org Wed Sep 16 22:37:45 2020 Return-Path: Delivered-To: svn-src-all@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 88BD73F3872; Wed, 16 Sep 2020 22:37:45 +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 4BsFNT3686z4NjB; Wed, 16 Sep 2020 22:37:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35EA6205D8; Wed, 16 Sep 2020 22:37:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08GMbjKj070717; Wed, 16 Sep 2020 22:37:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GMbjDm070716; Wed, 16 Sep 2020 22:37:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009162237.08GMbjDm070716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 16 Sep 2020 22:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365817 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 365817 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 22:37:45 -0000 Author: kevans Date: Wed Sep 16 22:37:44 2020 New Revision: 365817 URL: https://svnweb.freebsd.org/changeset/base/365817 Log: Record merge of r364190 This added the pwd binary to those symlinked in $WORLDTMP/legacy, but it was effectively reverted by a commit that was MFC'd in r365816. Just record the merge. Modified: Directory Properties: stable/12/ (props changed) From owner-svn-src-all@freebsd.org Wed Sep 16 22:55:28 2020 Return-Path: Delivered-To: svn-src-all@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 64E133F3FB5; Wed, 16 Sep 2020 22:55:28 +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 4BsFmw23PKz4PlN; Wed, 16 Sep 2020 22:55:28 +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 258E820B3C; Wed, 16 Sep 2020 22:55:28 +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 08GMtRoo082793; Wed, 16 Sep 2020 22:55:27 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GMtR2B082792; Wed, 16 Sep 2020 22:55:27 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009162255.08GMtR2B082792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 16 Sep 2020 22:55:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365819 - in stable: 11/lib/libc/stdlib 12/lib/libc/stdlib X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/lib/libc/stdlib 12/lib/libc/stdlib X-SVN-Commit-Revision: 365819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 22:55:28 -0000 Author: jhb Date: Wed Sep 16 22:55:27 2020 New Revision: 365819 URL: https://svnweb.freebsd.org/changeset/base/365819 Log: MFC 365276: Compute the correct size of the string to move forward. Previously this was counting the amount of spare room at the start of the buffer that the string needed to move forward and passing that as the number of bytes to copy to memmove rather than the length of the string to be copied. In the strfmon test in the test suite this caused the memmove to overflow the allocated buffer by one byte which CHERI caught. Modified: stable/12/lib/libc/stdlib/strfmon.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libc/stdlib/strfmon.c Directory Properties: stable/11/ (props changed) Modified: stable/12/lib/libc/stdlib/strfmon.c ============================================================================== --- stable/12/lib/libc/stdlib/strfmon.c Wed Sep 16 22:42:27 2020 (r365818) +++ stable/12/lib/libc/stdlib/strfmon.c Wed Sep 16 22:55:27 2020 (r365819) @@ -636,7 +636,7 @@ __format_grouped_double(double value, int *flags, memset(bufend, pad_char, padded); } - bufsize = bufsize - (bufend - rslt) + 1; + bufsize = rslt + bufsize - bufend; memmove(rslt, bufend, bufsize); free(avalue); return (rslt); From owner-svn-src-all@freebsd.org Wed Sep 16 22:55:28 2020 Return-Path: Delivered-To: svn-src-all@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 A892C3F4308; Wed, 16 Sep 2020 22:55:28 +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 4BsFmw42zQz4PQL; Wed, 16 Sep 2020 22:55:28 +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 6F201206E4; Wed, 16 Sep 2020 22:55:28 +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 08GMtSRW082799; Wed, 16 Sep 2020 22:55:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GMtSl4082798; Wed, 16 Sep 2020 22:55:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009162255.08GMtSl4082798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 16 Sep 2020 22:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365819 - in stable: 11/lib/libc/stdlib 12/lib/libc/stdlib X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/lib/libc/stdlib 12/lib/libc/stdlib X-SVN-Commit-Revision: 365819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 22:55:28 -0000 Author: jhb Date: Wed Sep 16 22:55:27 2020 New Revision: 365819 URL: https://svnweb.freebsd.org/changeset/base/365819 Log: MFC 365276: Compute the correct size of the string to move forward. Previously this was counting the amount of spare room at the start of the buffer that the string needed to move forward and passing that as the number of bytes to copy to memmove rather than the length of the string to be copied. In the strfmon test in the test suite this caused the memmove to overflow the allocated buffer by one byte which CHERI caught. Modified: stable/11/lib/libc/stdlib/strfmon.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/lib/libc/stdlib/strfmon.c Directory Properties: stable/12/ (props changed) Modified: stable/11/lib/libc/stdlib/strfmon.c ============================================================================== --- stable/11/lib/libc/stdlib/strfmon.c Wed Sep 16 22:42:27 2020 (r365818) +++ stable/11/lib/libc/stdlib/strfmon.c Wed Sep 16 22:55:27 2020 (r365819) @@ -634,7 +634,7 @@ __format_grouped_double(double value, int *flags, memset(bufend, pad_char, padded); } - bufsize = bufsize - (bufend - rslt) + 1; + bufsize = rslt + bufsize - bufend; memmove(rslt, bufend, bufsize); free(avalue); return (rslt); From owner-svn-src-all@freebsd.org Wed Sep 16 23:14:24 2020 Return-Path: Delivered-To: svn-src-all@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 005C03F4934; Wed, 16 Sep 2020 23:14:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BsGBl69rNz4QbX; Wed, 16 Sep 2020 23:14:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B76C720D91; Wed, 16 Sep 2020 23:14:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08GNENPG095196; Wed, 16 Sep 2020 23:14:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GNEM1w095192; Wed, 16 Sep 2020 23:14:22 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009162314.08GNEM1w095192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 16 Sep 2020 23:14:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365820 - in stable/12: contrib/libarchive/test_utils contrib/netbsd-tests/lib/libexecinfo contrib/netbsd-tests/lib/librt lib/libc/tests/resolv lib/libc/tests/stdlib/dynthr_mod X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12: contrib/libarchive/test_utils contrib/netbsd-tests/lib/libexecinfo contrib/netbsd-tests/lib/librt lib/libc/tests/resolv lib/libc/tests/stdlib/dynthr_mod X-SVN-Commit-Revision: 365820 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 23:14:24 -0000 Author: kevans Date: Wed Sep 16 23:14:22 2020 New Revision: 365820 URL: https://svnweb.freebsd.org/changeset/base/365820 Log: MFC r365493-r365494, r365600, r365602, r365637: various WARNS fixes r365493: libc/resolv: attempt to fix the test under WARNS=6 In a side-change that I'm working on to start defaulting src builds to WARNS=6 where WARNS isn't otherwise specified, GCC6 (and clang, to a lesser extent) pointed out a number of issues with the resolv tests: - Global method variable that gets shadowed in run_tests() - Signed/unsigned comparison between i in run_tests() and hosts->sl_cur The shadowed variable looks like it might actually be bogus as written, as we pass it to RUN_TESTS -> run_tests, but other parts use the global method instead. This change is mainly geared towards correcting that by removing the global and plumbing the method through from run_tests -> run into the new thread. For the signed/unsigned comparison, there's no compelling reason to not just switch i/nthreads/nhosts to size_t. The review also included a change to the load() function that was better addressed by jhb in r365302. r365494: libc tests: dynthr_mod: fix some WARNS issues This is being addressed as part of a side-patch I'm working on that builds all the things with WARNS=6, instead of relying on it being supplied in just shallow parts of the build with higher-level Makefile.inc. Provide a prototype for mod_main and annotate the thread function argument as unused. r365600: MFV r365599: import fix for a libexecinfo warning at higher WARNS v1.17 of this file included a fix that I just submitted upstream to fix a warning about prevent_inline with external linkage not having been previously declared. r365602: librt: tests: fix minor issues with higher WARNS got_sigalrm is a global with external linkage and must therefore have a previous extern declaration. There's no reason to maintain the status quo there, so just make it static. The result var is unused. This part of the test has not been upstreamed, presumably because it exists solely for sem_clockwait_np. We should perhaps consider moving it into its own test file outside of ^/contrib/netbsd-tests, but this can happen later. r365637: MFV r365636: libarchive: import fix for WARNS=6 builds in testing bits Two more cases of explicitly marking globals for internal linkage where they need not be shared. Committed upstream as of a38e62314a1f. Modified: stable/12/contrib/libarchive/test_utils/test_main.c stable/12/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c stable/12/contrib/netbsd-tests/lib/librt/t_sem.c stable/12/lib/libc/tests/resolv/resolv_test.c stable/12/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/libarchive/test_utils/test_main.c ============================================================================== --- stable/12/contrib/libarchive/test_utils/test_main.c Wed Sep 16 22:55:27 2020 (r365819) +++ stable/12/contrib/libarchive/test_utils/test_main.c Wed Sep 16 23:14:22 2020 (r365820) @@ -475,7 +475,7 @@ static struct line { int count; int skip; } failed_lines[10000]; -const char *failed_filename; +static const char *failed_filename; /* Count this failure, setup up log destination and handle initial report. */ static void __LA_PRINTFLIKE(3, 4) @@ -3458,7 +3458,7 @@ assertion_entry_compare_acls(const char *file, int lin /* Use "list.h" to create a list of all tests (functions and names). */ #undef DEFINE_TEST #define DEFINE_TEST(n) { n, #n, 0 }, -struct test_list_t tests[] = { +static struct test_list_t tests[] = { #include "list.h" }; Modified: stable/12/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c ============================================================================== --- stable/12/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Wed Sep 16 22:55:27 2020 (r365819) +++ stable/12/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Wed Sep 16 23:14:22 2020 (r365820) @@ -1,4 +1,4 @@ -/* $NetBSD: t_backtrace.c,v 1.16 2014/11/04 00:20:19 justin Exp $ */ +/* $NetBSD: t_backtrace.c,v 1.17 2020/09/09 20:04:10 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_backtrace.c,v 1.16 2014/11/04 00:20:19 justin Exp $"); +__RCSID("$NetBSD: t_backtrace.c,v 1.17 2020/09/09 20:04:10 christos Exp $"); #include #include @@ -47,7 +47,7 @@ void myfunc2(size_t ncalls); void myfunc1(size_t origcalls, volatile size_t ncalls); void myfunc(size_t ncalls); -volatile int prevent_inline; +static volatile int prevent_inline; void myfunc3(size_t ncalls) Modified: stable/12/contrib/netbsd-tests/lib/librt/t_sem.c ============================================================================== --- stable/12/contrib/netbsd-tests/lib/librt/t_sem.c Wed Sep 16 22:55:27 2020 (r365819) +++ stable/12/contrib/netbsd-tests/lib/librt/t_sem.c Wed Sep 16 23:14:22 2020 (r365820) @@ -190,7 +190,7 @@ timespec_add_ms(struct timespec *ts, int ms) } } -volatile sig_atomic_t got_sigalrm = 0; +static volatile sig_atomic_t got_sigalrm = 0; static void sigalrm_handler(int sig __unused) @@ -212,7 +212,6 @@ ATF_TC_BODY(timedwait, tc) { struct timespec ts; sem_t sem; - int result; SEM_REQUIRE(sem_init(&sem, 0, 0)); SEM_REQUIRE(sem_post(&sem)); Modified: stable/12/lib/libc/tests/resolv/resolv_test.c ============================================================================== --- stable/12/lib/libc/tests/resolv/resolv_test.c Wed Sep 16 22:55:27 2020 (r365819) +++ stable/12/lib/libc/tests/resolv/resolv_test.c Wed Sep 16 23:14:22 2020 (r365820) @@ -34,6 +34,8 @@ __RCSID("$NetBSD: resolv.c,v 1.6 2004/05/23 16:59:11 c #include #include +#include +#include #include #include #include @@ -55,14 +57,13 @@ enum method { }; static StringList *hosts = NULL; -static enum method method = METHOD_GETADDRINFO; static int *ask = NULL; static int *got = NULL; static void load(const char *); -static void resolvone(int); +static void resolvone(int, enum method); static void *resolvloop(void *); -static void run(int *); +static void run(int *, enum method); static pthread_mutex_t stats = PTHREAD_MUTEX_INITIALIZER; @@ -172,18 +173,18 @@ resolv_getipnodeby(pthread_t self, char *host) } static void -resolvone(int n) +resolvone(int n, enum method method) { char buf[1024]; pthread_t self = pthread_self(); size_t i = (random() & 0x0fffffff) % hosts->sl_cur; char *host = hosts->sl_str[i]; - struct addrinfo hints, *res; int error, len; len = snprintf(buf, sizeof(buf), "%p: %d resolving %s %d\n", self, n, host, (int)i); (void)write(STDOUT_FILENO, buf, len); + error = 0; switch (method) { case METHOD_GETADDRINFO: error = resolv_getaddrinfo(self, host, i); @@ -195,6 +196,10 @@ resolvone(int n) error = resolv_getipnodeby(self, host); break; default: + /* UNREACHABLE */ + /* XXX Needs an __assert_unreachable() for userland. */ + assert(0 && "Unreachable segment reached"); + abort(); break; } pthread_mutex_lock(&stats); @@ -203,35 +208,53 @@ resolvone(int n) pthread_mutex_unlock(&stats); } +struct resolvloop_args { + int *nhosts; + enum method method; +}; + static void * resolvloop(void *p) { - int *nhosts = (int *)p; - if (*nhosts == 0) + struct resolvloop_args *args = p; + + if (*args->nhosts == 0) { + free(args); return NULL; + } + do - resolvone(*nhosts); - while (--(*nhosts)); + resolvone(*args->nhosts, args->method); + while (--(*args->nhosts)); + free(args); return NULL; } static void -run(int *nhosts) +run(int *nhosts, enum method method) { pthread_t self; int rc; + struct resolvloop_args *args; + /* Created thread is responsible for free(). */ + args = malloc(sizeof(*args)); + ATF_REQUIRE(args != NULL); + + args->nhosts = nhosts; + args->method = method; self = pthread_self(); - rc = pthread_create(&self, NULL, resolvloop, nhosts); + rc = pthread_create(&self, NULL, resolvloop, args); ATF_REQUIRE_MSG(rc == 0, "pthread_create failed: %s", strerror(rc)); } static int run_tests(const char *hostlist_file, enum method method) { - int nthreads = NTHREADS; - int nhosts = NHOSTS; - int i, c, done, *nleft; + size_t nthreads = NTHREADS; + size_t nhosts = NHOSTS; + size_t i; + int c, done, *nleft; hosts = sl_init(); srandom(1234); @@ -251,7 +274,7 @@ run_tests(const char *hostlist_file, enum method metho for (i = 0; i < nthreads; i++) { nleft[i] = nhosts; - run(&nleft[i]); + run(&nleft[i], method); } for (done = 0; !done;) { Modified: stable/12/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c ============================================================================== --- stable/12/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c Wed Sep 16 22:55:27 2020 (r365819) +++ stable/12/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c Wed Sep 16 23:14:22 2020 (r365820) @@ -41,10 +41,12 @@ __FBSDID("$FreeBSD$"); #include #include +void mod_main(int op); + static pthread_t thr; static void * -mod_thread(void *ptr) +mod_thread(void *ptr __unused) { char *volatile dummy; From owner-svn-src-all@freebsd.org Wed Sep 16 23:17:21 2020 Return-Path: Delivered-To: svn-src-all@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 2271E3F46DF; Wed, 16 Sep 2020 23:17:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BsGG86S0Gz4Qw3; Wed, 16 Sep 2020 23:17:20 +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 C1E4920D3A; Wed, 16 Sep 2020 23:17:20 +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 08GNHKpw095404; Wed, 16 Sep 2020 23:17:20 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08GNHFgg095379; Wed, 16 Sep 2020 23:17:15 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009162317.08GNHFgg095379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 16 Sep 2020 23:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365821 - in stable/12: gnu/usr.bin/gperf lib/libc++ lib/libcxxrt lib/libopenbsd lib/libsqlite3 lib/libucl lib/libzstd libexec/dma/dma-mbox-create libexec/dma/dmagent sbin/gvinum sbin/t... X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12: gnu/usr.bin/gperf lib/libc++ lib/libcxxrt lib/libopenbsd lib/libsqlite3 lib/libucl lib/libzstd libexec/dma/dma-mbox-create libexec/dma/dmagent sbin/gvinum sbin/tunefs stand/efi/boot1 sta... X-SVN-Commit-Revision: 365821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 23:17:21 -0000 Author: kevans Date: Wed Sep 16 23:17:15 2020 New Revision: 365821 URL: https://svnweb.freebsd.org/changeset/base/365821 Log: MFC r365631: Only set WARNS if not defined This would allow interested parties to do experimental runs with an environment set appropriately to raise all the warnings throughout the build; e.g. env WARNS=6 NO_WERROR=yes buildworld. Not currently touching the numerous instances in ^/tools. Modified: stable/12/gnu/usr.bin/gperf/Makefile stable/12/lib/libc++/Makefile stable/12/lib/libcxxrt/Makefile stable/12/lib/libopenbsd/Makefile stable/12/lib/libsqlite3/Makefile stable/12/lib/libucl/Makefile stable/12/lib/libzstd/Makefile stable/12/libexec/dma/dma-mbox-create/Makefile stable/12/libexec/dma/dmagent/Makefile stable/12/sbin/gvinum/Makefile stable/12/sbin/tunefs/Makefile stable/12/stand/efi/boot1/Makefile stable/12/stand/efi/gptboot/Makefile stable/12/stand/liblua/Makefile stable/12/usr.bin/bmake/Makefile.inc stable/12/usr.bin/iscsictl/Makefile stable/12/usr.bin/localedef/Makefile stable/12/usr.bin/m4/Makefile stable/12/usr.bin/users/Makefile stable/12/usr.bin/zstd/Makefile stable/12/usr.sbin/autofs/Makefile stable/12/usr.sbin/iscsid/Makefile stable/12/usr.sbin/uefisign/Makefile stable/12/usr.sbin/ypldap/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/gnu/usr.bin/gperf/Makefile ============================================================================== --- stable/12/gnu/usr.bin/gperf/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/gnu/usr.bin/gperf/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -9,7 +9,7 @@ PROG_CXX= gperf SRCS= bool-array.cc hash-table.cc input.cc keyword-list.cc keyword.cc \ main.cc options.cc output.cc positions.cc search.cc version.cc \ getline.cc hash.cc -WARNS= 1 +WARNS?= 1 MAN= gperf.1 gperf.7 CXXFLAGS+= -I${GPERFDIR}/lib -I${.CURDIR} Modified: stable/12/lib/libc++/Makefile ============================================================================== --- stable/12/lib/libc++/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/lib/libc++/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -71,7 +71,7 @@ cxxrt_${_S}: ${_LIBCXXRTDIR}/${_S} .NOMETA ln -sf ${.ALLSRC} ${.TARGET} .endfor -WARNS= 0 +WARNS?= 0 CFLAGS+= -isystem ${HDRDIR} CFLAGS+= -isystem ${_LIBCXXRTDIR} CFLAGS+= -nostdinc++ Modified: stable/12/lib/libcxxrt/Makefile ============================================================================== --- stable/12/lib/libcxxrt/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/lib/libcxxrt/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -20,7 +20,7 @@ SRCS+= libelftc_dem_gnu3.c\ typeinfo.cc\ guard.cc -WARNS= 0 +WARNS?= 0 CFLAGS+= -isystem ${SRCDIR} -nostdinc++ CXXSTD?= c++14 VERSION_MAP= ${.CURDIR}/Version.map Modified: stable/12/lib/libopenbsd/Makefile ============================================================================== --- stable/12/lib/libopenbsd/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/lib/libopenbsd/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -10,6 +10,6 @@ INTERNALLIB= CFLAGS+= -I${.CURDIR} -WARNS= 3 +WARNS?= 3 .include Modified: stable/12/lib/libsqlite3/Makefile ============================================================================== --- stable/12/lib/libsqlite3/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/lib/libsqlite3/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -12,7 +12,7 @@ INCS= sqlite3.h sqlite3ext.h SQLITE= ${SRCTOP}/contrib/sqlite3 .PATH: ${SQLITE} -WARNS= 3 +WARNS?= 3 CFLAGS+= -I${SQLITE} \ -DUSE_PREAD=1 \ -DSTDC_HEADERS=1 \ Modified: stable/12/lib/libucl/Makefile ============================================================================== --- stable/12/lib/libucl/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/lib/libucl/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -23,7 +23,7 @@ SRCS= ucl_emitter_streamline.c \ INCS= ucl.h LIBADD= m -WARNS= 1 +WARNS?= 1 CFLAGS+= -I${LIBUCL}/include \ -I${LIBUCL}/src \ -I${LIBUCL}/uthash \ Modified: stable/12/lib/libzstd/Makefile ============================================================================== --- stable/12/lib/libzstd/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/lib/libzstd/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -25,7 +25,7 @@ SRCS= entropy_common.c \ zstd_ldm.c \ zstd_opt.c \ zstd_double_fast.c -WARNS= 2 +WARNS?= 2 INCS= zstd.h CFLAGS+= -I${ZSTDDIR}/lib -I${ZSTDDIR}/lib/common -DXXH_NAMESPACE=ZSTD_ \ -DZSTD_MULTITHREAD=1 Modified: stable/12/libexec/dma/dma-mbox-create/Makefile ============================================================================== --- stable/12/libexec/dma/dma-mbox-create/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/libexec/dma/dma-mbox-create/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -2,7 +2,7 @@ MAN= -WARNS= 2 +WARNS?= 2 PROG= dma-mbox-create BINMODE= 4554 Modified: stable/12/libexec/dma/dmagent/Makefile ============================================================================== --- stable/12/libexec/dma/dmagent/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/libexec/dma/dmagent/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -35,7 +35,7 @@ BINMODE= 2555 .include .if ${COMPILER_TYPE} == gcc -WARNS= 5 +WARNS?= 5 .endif .include Modified: stable/12/sbin/gvinum/Makefile ============================================================================== --- stable/12/sbin/gvinum/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/sbin/gvinum/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -5,7 +5,7 @@ PROG= gvinum SRCS= gvinum.c gvinum.h geom_vinum_share.c MAN= gvinum.8 -WARNS= 2 +WARNS?= 2 CFLAGS+= -I${SRCTOP}/sys -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit LIBADD= edit geom Modified: stable/12/sbin/tunefs/Makefile ============================================================================== --- stable/12/sbin/tunefs/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/sbin/tunefs/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -11,6 +11,6 @@ MOUNT= ${SRCTOP}/sbin/mount CFLAGS+= -I${MOUNT} .PATH: ${MOUNT} -WARNS= 3 +WARNS?= 3 .include Modified: stable/12/stand/efi/boot1/Makefile ============================================================================== --- stable/12/stand/efi/boot1/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/stand/efi/boot1/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -5,7 +5,7 @@ BOOT1?= boot1 PROG= ${BOOT1}.sym INTERNALPROG= -WARNS= 6 +WARNS?= 6 CFLAGS+= -DEFI_BOOT1 # We implement a slightly non-standard %S in that it always takes a Modified: stable/12/stand/efi/gptboot/Makefile ============================================================================== --- stable/12/stand/efi/gptboot/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/stand/efi/gptboot/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -13,5 +13,5 @@ CFLAGS+= -I${.CURDIR} CFLAGS+= -DBOOTPROG=\"gptboot.efi\" SRCS+= gpt.c CWARNFLAGS.gpt.c+= -Wno-sign-compare -Wno-cast-align -WARNS=6 +WARNS?=6 .include "${.CURDIR}/../boot1/Makefile" Modified: stable/12/stand/liblua/Makefile ============================================================================== --- stable/12/stand/liblua/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/stand/liblua/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -28,7 +28,7 @@ SRCS+= lerrno.c lstd.c lutils.c .PATH: ${FLUASRC}/modules SRCS+= lfs.c -WARNS= 3 +WARNS?= 3 CFLAGS+= -DLUA_PATH=\"${LUAPATH}\" -DLUA_PATH_DEFAULT=\"${LUAPATH}/\?.lua\" CFLAGS+= -ffreestanding -nostdlib -DLUA_USE_POSIX Modified: stable/12/usr.bin/bmake/Makefile.inc ============================================================================== --- stable/12/usr.bin/bmake/Makefile.inc Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/usr.bin/bmake/Makefile.inc Wed Sep 16 23:17:15 2020 (r365821) @@ -22,7 +22,7 @@ NO_SHARED?= YES SUBDIR+= tests .endif -WARNS=3 +WARNS?=3 CFLAGS+= -DNO_PWD_OVERRIDE .if make(after-import) Modified: stable/12/usr.bin/iscsictl/Makefile ============================================================================== --- stable/12/usr.bin/iscsictl/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/usr.bin/iscsictl/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -13,7 +13,7 @@ YFLAGS+= -v LFLAGS+= -i CLEANFILES= y.tab.c y.tab.h y.output -WARNS= 6 +WARNS?= 6 NO_WMISSING_VARIABLE_DECLARATIONS= .include Modified: stable/12/usr.bin/localedef/Makefile ============================================================================== --- stable/12/usr.bin/localedef/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/usr.bin/localedef/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -13,7 +13,7 @@ SRCS= charmap.c \ time.c \ wide.c -WARNS= 3 +WARNS?= 3 ${SRCS:M*.c}: parser.h parser.h: parser.y Modified: stable/12/usr.bin/m4/Makefile ============================================================================== --- stable/12/usr.bin/m4/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/usr.bin/m4/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -14,7 +14,7 @@ NO_WMISSING_VARIABLE_DECLARATIONS= SRCS= eval.c expr.c look.c main.c misc.c gnum4.c trace.c parser.y tokenizer.l -WARNS= 3 +WARNS?= 3 tokenizer.o: parser.h Modified: stable/12/usr.bin/users/Makefile ============================================================================== --- stable/12/usr.bin/users/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/usr.bin/users/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -WARNS= 3 +WARNS?= 3 PROG_CXX= users CXXFLAGS+= -fno-rtti Modified: stable/12/usr.bin/zstd/Makefile ============================================================================== --- stable/12/usr.bin/zstd/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/usr.bin/zstd/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -22,7 +22,7 @@ MLINKS= zstd.1 unzstd.1 \ zstd.1 zstdcat.1 \ zstd.1 zstdmt.1 -WARNS= 2 +WARNS?= 2 LIBADD= zstd .PATH: ${SRCTOP}/sys/contrib/zstd/programs Modified: stable/12/usr.sbin/autofs/Makefile ============================================================================== --- stable/12/usr.sbin/autofs/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/usr.sbin/autofs/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -24,7 +24,7 @@ LIBADD= util MOUNT= ${SRCTOP}/sbin/mount CFLAGS+=-I${MOUNT} -WARNS= 6 +WARNS?= 6 LINKS= ${BINDIR}/automountd ${BINDIR}/automount LINKS+= ${BINDIR}/automountd ${BINDIR}/autounmountd Modified: stable/12/usr.sbin/iscsid/Makefile ============================================================================== --- stable/12/usr.sbin/iscsid/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/usr.sbin/iscsid/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -11,6 +11,6 @@ MAN= iscsid.8 LIBADD= md util -WARNS= 6 +WARNS?= 6 .include Modified: stable/12/usr.sbin/uefisign/Makefile ============================================================================== --- stable/12/usr.sbin/uefisign/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/usr.sbin/uefisign/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -6,6 +6,6 @@ MAN= uefisign.8 LIBADD= crypto -WARNS= 6 +WARNS?= 6 .include Modified: stable/12/usr.sbin/ypldap/Makefile ============================================================================== --- stable/12/usr.sbin/ypldap/Makefile Wed Sep 16 23:14:22 2020 (r365820) +++ stable/12/usr.sbin/ypldap/Makefile Wed Sep 16 23:17:15 2020 (r365821) @@ -15,6 +15,6 @@ CFLAGS+=-I${.CURDIR} CFLAGS+=-I${SRCTOP}/contrib/pf/libevent CFLAGS+=-I${SRCTOP}/lib/libopenbsd -WARNS= 2 +WARNS?= 2 .include From owner-svn-src-all@freebsd.org Thu Sep 17 00:07:17 2020 Return-Path: Delivered-To: svn-src-all@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 0BD313F57C9; Thu, 17 Sep 2020 00:07: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 4BsHMm3N2nz4TJn; Thu, 17 Sep 2020 00:07:16 +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 572C921479; Thu, 17 Sep 2020 00:07: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 08H07GYP026065; Thu, 17 Sep 2020 00:07:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08H07GvL026064; Thu, 17 Sep 2020 00:07:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009170007.08H07GvL026064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 17 Sep 2020 00:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365826 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365826 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 00:07:17 -0000 Author: kib Date: Thu Sep 17 00:07:15 2020 New Revision: 365826 URL: https://svnweb.freebsd.org/changeset/base/365826 Log: Put calls to check_pgrp_jobc() in fixjobc_kill() under INVARIANTS. Reported by: Michael Butler Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Thu Sep 17 00:03:19 2020 (r365825) +++ head/sys/kern/kern_proc.c Thu Sep 17 00:07:15 2020 (r365826) @@ -904,7 +904,9 @@ fixjobc_kill(struct proc *p) pgrp = p->p_pgrp; PGRP_LOCK_ASSERT(pgrp, MA_NOTOWNED); SESS_LOCK_ASSERT(pgrp->pg_session, MA_NOTOWNED); +#ifdef INVARIANTS check_pgrp_jobc(pgrp); +#endif /* * p no longer affects process group orphanage for children. @@ -941,7 +943,9 @@ fixjobc_kill(struct proc *p) LIST_FOREACH(q, &p->p_orphans, p_orphan) fixjobc_kill_q(p, q, false); +#ifdef INVARIANTS check_pgrp_jobc(pgrp); +#endif } void From owner-svn-src-all@freebsd.org Thu Sep 17 02:18:22 2020 Return-Path: Delivered-To: svn-src-all@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 5A65A3F847B; Thu, 17 Sep 2020 02:18:22 +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 4BsLH21qBJz4Zq4; Thu, 17 Sep 2020 02:18:22 +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 2337923013; Thu, 17 Sep 2020 02:18:22 +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 08H2IMUf006245; Thu, 17 Sep 2020 02:18:22 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08H2IMm5006244; Thu, 17 Sep 2020 02:18:22 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009170218.08H2IMm5006244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 17 Sep 2020 02:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365829 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 365829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 02:18:22 -0000 Author: kevans Date: Thu Sep 17 02:18:21 2020 New Revision: 365829 URL: https://svnweb.freebsd.org/changeset/base/365829 Log: installworld: run `certctl rehash` after installation completes This was originally introduced back in r360833, and subsequently reverted because it was broken for -DNO_ROOT builds and it may not have been the correct place for it. While debatably this may still not be 'the correct place,' it's much cleaner than scattering rehashes all throughout the tree. brooks has fixed the issue with -DNO_ROOT by properly writing to the METALOG in r361397. Do note that this is different than what was originally committed; brooks had revisions in D24932 that made it actually use the revised unprivileged mode and write to METALOG, along with being a little more friendly to foreign crossbuilds and just using the certctl in-tree. With this change, I believe we should now have a populated /etc/ssl/certs in the VM images. MFC after: 1 week Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Sep 17 02:03:51 2020 (r365828) +++ head/Makefile.inc1 Thu Sep 17 02:18:21 2020 (r365829) @@ -924,7 +924,9 @@ INSTALL_DDIR= ${_INSTALL_DDIR:S://:/:g:C:/$::} METALOG?= ${DESTDIR}/${DISTDIR}/METALOG METALOG:= ${METALOG:C,//+,/,g} IMAKE+= -DNO_ROOT METALOG=${METALOG} -INSTALLFLAGS+= -U -M ${METALOG} -D ${INSTALL_DDIR} +METALOG_INSTALLFLAGS= -U -M ${METALOG} -D ${INSTALL_DDIR} +INSTALLFLAGS+= ${METALOG_INSTALLFLAGS} +CERTCLTFLAGS= ${METALOG_INSTALLFLAGS} MTREEFLAGS+= -W .endif .if defined(BUILD_PKGS) @@ -1441,6 +1443,12 @@ distributeworld installworld stageworld: _installcheck ${DESTDIR}/${DISTDIR}/${dist}.debug.meta .endfor .endif +.elif make(installworld) && ${MK_CAROOT} != "no" + @if which openssl>/dev/null; then \ + sh ${SRCTOP}/usr.sbin/certctl/certctl.sh ${CERTCLTFLAGS} rehash \ + else \ + echo "No openssl on the host, not rehashing certificates target -- /etc/ssl may not be populated."; \ + fi .endif # make(distributeworld) packageworld: .PHONY From owner-svn-src-all@freebsd.org Thu Sep 17 04:39:40 2020 Return-Path: Delivered-To: svn-src-all@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 27B553FC04F; Thu, 17 Sep 2020 04:39:40 +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 4BsPQ4014qz4hnk; Thu, 17 Sep 2020 04:39:40 +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 D913F249C0; Thu, 17 Sep 2020 04:39:39 +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 08H4dd40092137; Thu, 17 Sep 2020 04:39:39 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08H4ddeb092136; Thu, 17 Sep 2020 04:39:39 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202009170439.08H4ddeb092136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Thu, 17 Sep 2020 04:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365830 - head/sys/geom/part X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/sys/geom/part X-SVN-Commit-Revision: 365830 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 04:39:40 -0000 Author: eugen Date: Thu Sep 17 04:39:39 2020 New Revision: 365830 URL: https://svnweb.freebsd.org/changeset/base/365830 Log: geom_part: make it possible recovering broken GPT after some LBAs cut off This is followup to r365477. If pre-formatted device has GPT and a partition covering last available LBAs and the device is attached using a bridge reducing amount of LBAs, then it could be not enough forcing GEOM to use primary GPT. Also, we should make it possible to recover GPT and this requires either deleting or resizing the partition. This change enables "gpart delete" and "gpart resize" commands on corrupted GPT with following "gpart recover". It still does not allow modifying corrupted GPT without preliminary setting sysctl kern.geom.part.check_integrity=0 For example: # gpart show da0 => 34 3906963389 da0 GPT (1.8T) [CORRUPT] 34 262144 1 ms-reserved (128M) 262178 2014 - free - (1.0M) 264192 3906764943 2 freebsd-swap (1.8T) # gpart resize -i 2 -s 3900000000 da0 # gpart recover da0 Reported by: Alex Korchmar MFC after: 3 days Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Thu Sep 17 02:18:21 2020 (r365829) +++ head/sys/geom/part/g_part.c Thu Sep 17 04:39:39 2020 (r365830) @@ -1852,7 +1852,8 @@ g_part_ctlreq(struct gctl_req *req, struct g_class *mp table = gpp.gpp_geom->softc; if (table != NULL && table->gpt_corrupt && ctlreq != G_PART_CTL_DESTROY && - ctlreq != G_PART_CTL_RECOVER) { + ctlreq != G_PART_CTL_RECOVER && + geom_part_check_integrity) { gctl_error(req, "%d table '%s' is corrupt", EPERM, gpp.gpp_geom->name); return; From owner-svn-src-all@freebsd.org Thu Sep 17 07:13:42 2020 Return-Path: Delivered-To: svn-src-all@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 6BFA33FEE43; Thu, 17 Sep 2020 07:13:42 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BsSqp28W0z4qHR; Thu, 17 Sep 2020 07:13:42 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D0E926370; Thu, 17 Sep 2020 07:13:42 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08H7DgJK089802; Thu, 17 Sep 2020 07:13:42 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08H7Dgn7089801; Thu, 17 Sep 2020 07:13:42 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202009170713.08H7Dgn7089801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Thu, 17 Sep 2020 07:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365831 - head/contrib/netbsd-tests/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/contrib/netbsd-tests/fs/tmpfs X-SVN-Commit-Revision: 365831 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 07:13:42 -0000 Author: lwhsu Date: Thu Sep 17 07:13:41 2020 New Revision: 365831 URL: https://svnweb.freebsd.org/changeset/base/365831 Log: Revert r249362, atime update in tmpfs is fixed in r365810 PR: 249362 Sponsored by: The FreeBSD Foundation Modified: head/contrib/netbsd-tests/fs/tmpfs/t_times.sh Modified: head/contrib/netbsd-tests/fs/tmpfs/t_times.sh ============================================================================== --- head/contrib/netbsd-tests/fs/tmpfs/t_times.sh Thu Sep 17 04:39:39 2020 (r365830) +++ head/contrib/netbsd-tests/fs/tmpfs/t_times.sh Thu Sep 17 07:13:41 2020 (r365831) @@ -36,10 +36,6 @@ empty_head() { atf_set "require.user" "root" } empty_body() { - if [ "$(atf_config_get ci false)" = "true" ]; then - atf_skip "https://bugs.freebsd.org/249362" - fi - test_mount atf_check -s eq:0 -o empty -e empty touch a @@ -72,10 +68,6 @@ non_empty_head() { atf_set "require.user" "root" } non_empty_body() { - if [ "$(atf_config_get ci false)" = "true" ]; then - atf_skip "https://bugs.freebsd.org/249362" - fi - test_mount echo foo >b || atf_fail "Non-empty creation failed" From owner-svn-src-all@freebsd.org Thu Sep 17 11:39:38 2020 Return-Path: Delivered-To: svn-src-all@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 7C1523DC87E; Thu, 17 Sep 2020 11:39:38 +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 4BsZkf2tYqz3bjH; Thu, 17 Sep 2020 11:39:38 +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 41E8E98AB; Thu, 17 Sep 2020 11:39:38 +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 08HBdcTL050292; Thu, 17 Sep 2020 11:39:38 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HBdXxD050270; Thu, 17 Sep 2020 11:39:33 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202009171139.08HBdXxD050270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 17 Sep 2020 11:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365832 - in head/sys: amd64/amd64 amd64/linux amd64/linux32 arm/arm arm64/arm64 arm64/linux compat/ia32 compat/linux i386/i386 i386/linux kern mips/mips powerpc/powerpc riscv/riscv sys X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/linux amd64/linux32 arm/arm arm64/arm64 arm64/linux compat/ia32 compat/linux i386/i386 i386/linux kern mips/mips powerpc/powerpc riscv/riscv sys X-SVN-Commit-Revision: 365832 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 11:39:38 -0000 Author: trasz Date: Thu Sep 17 11:39:33 2020 New Revision: 365832 URL: https://svnweb.freebsd.org/changeset/base/365832 Log: Get rid of sv_errtbl and SV_ABI_ERRNO(). Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26388 Modified: head/sys/amd64/amd64/elf_machdep.c head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/arm/arm/elf_machdep.c head/sys/arm64/arm64/elf32_machdep.c head/sys/arm64/arm64/elf_machdep.c head/sys/arm64/linux/linux_sysvec.c head/sys/compat/ia32/ia32_sysvec.c head/sys/compat/linux/linux.h head/sys/compat/linux/linux_errno.c head/sys/compat/linux/linux_socket.c head/sys/i386/i386/elf_machdep.c head/sys/i386/linux/linux_sysvec.c head/sys/kern/imgact_aout.c head/sys/kern/init_main.c head/sys/mips/mips/elf_machdep.c head/sys/mips/mips/freebsd32_machdep.c head/sys/powerpc/powerpc/elf32_machdep.c head/sys/powerpc/powerpc/elf64_machdep.c head/sys/riscv/riscv/elf_machdep.c head/sys/sys/sysent.h Modified: head/sys/amd64/amd64/elf_machdep.c ============================================================================== --- head/sys/amd64/amd64/elf_machdep.c Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/amd64/amd64/elf_machdep.c Thu Sep 17 11:39:33 2020 (r365832) @@ -52,8 +52,6 @@ __FBSDID("$FreeBSD$"); struct sysentvec elf64_freebsd_sysvec_la48 = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_errsize = 0, - .sv_errtbl = NULL, .sv_transtrap = NULL, .sv_fixup = __elfN(freebsd_fixup), .sv_sendsig = sendsig, @@ -89,8 +87,6 @@ struct sysentvec elf64_freebsd_sysvec_la48 = { struct sysentvec elf64_freebsd_sysvec_la57 = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_errsize = 0, - .sv_errtbl = NULL, .sv_transtrap = NULL, .sv_fixup = __elfN(freebsd_fixup), .sv_sendsig = sendsig, Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/amd64/linux/linux_sysvec.c Thu Sep 17 11:39:33 2020 (r365832) @@ -221,7 +221,7 @@ linux_set_syscall_retval(struct thread *td, int error) if (__predict_false(error != 0)) { if (error != ERESTART && error != EJUSTRETURN) - frame->tf_rax = SV_ABI_ERRNO(td->td_proc, error); + frame->tf_rax = linux_to_bsd_errno(error); } /* Restore all registers. */ @@ -732,8 +732,6 @@ linux_vsyscall(struct thread *td) struct sysentvec elf_linux_sysvec = { .sv_size = LINUX_SYS_MAXSYSCALL, .sv_table = linux_sysent, - .sv_errsize = ELAST + 1, - .sv_errtbl = linux_errtbl, .sv_transtrap = linux_translate_traps, .sv_fixup = linux_fixup_elf, .sv_sendsig = linux_rt_sendsig, Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/amd64/linux32/linux32_sysvec.c Thu Sep 17 11:39:33 2020 (r365832) @@ -679,7 +679,7 @@ linux32_set_syscall_retval(struct thread *td, int erro if (__predict_false(error != 0)) { if (error != ERESTART && error != EJUSTRETURN) - frame->tf_rax = SV_ABI_ERRNO(td->td_proc, error); + frame->tf_rax = linux_to_bsd_errno(error); } } @@ -898,8 +898,6 @@ linux32_fixlimit(struct rlimit *rl, int which) struct sysentvec elf_linux_sysvec = { .sv_size = LINUX32_SYS_MAXSYSCALL, .sv_table = linux32_sysent, - .sv_errsize = ELAST + 1, - .sv_errtbl = linux_errtbl, .sv_transtrap = linux_translate_traps, .sv_fixup = linux_fixup_elf, .sv_sendsig = linux_sendsig, Modified: head/sys/arm/arm/elf_machdep.c ============================================================================== --- head/sys/arm/arm/elf_machdep.c Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/arm/arm/elf_machdep.c Thu Sep 17 11:39:33 2020 (r365832) @@ -65,8 +65,6 @@ u_long elf_hwcap2; struct sysentvec elf32_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_errsize = 0, - .sv_errtbl = NULL, .sv_transtrap = NULL, .sv_fixup = __elfN(freebsd_fixup), .sv_sendsig = sendsig, Modified: head/sys/arm64/arm64/elf32_machdep.c ============================================================================== --- head/sys/arm64/arm64/elf32_machdep.c Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/arm64/arm64/elf32_machdep.c Thu Sep 17 11:39:33 2020 (r365832) @@ -77,8 +77,6 @@ extern void freebsd32_sendsig(sig_t catcher, ksiginfo_ static struct sysentvec elf32_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = freebsd32_sysent, - .sv_errsize = 0, - .sv_errtbl = NULL, .sv_transtrap = NULL, .sv_fixup = elf32_freebsd_fixup, .sv_sendsig = freebsd32_sendsig, Modified: head/sys/arm64/arm64/elf_machdep.c ============================================================================== --- head/sys/arm64/arm64/elf_machdep.c Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/arm64/arm64/elf_machdep.c Thu Sep 17 11:39:33 2020 (r365832) @@ -61,8 +61,6 @@ u_long __read_frequently elf_hwcap2; static struct sysentvec elf64_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_errsize = 0, - .sv_errtbl = NULL, .sv_transtrap = NULL, .sv_fixup = __elfN(freebsd_fixup), .sv_sendsig = sendsig, Modified: head/sys/arm64/linux/linux_sysvec.c ============================================================================== --- head/sys/arm64/linux/linux_sysvec.c Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/arm64/linux/linux_sysvec.c Thu Sep 17 11:39:33 2020 (r365832) @@ -145,7 +145,7 @@ linux_set_syscall_retval(struct thread *td, int error) if (__predict_false(error != 0)) { if (error != ERESTART && error != EJUSTRETURN) { td->td_frame->tf_x[0] = - SV_ABI_ERRNO(td->td_proc, error); + linux_to_bsd_errno(error); } } } @@ -394,8 +394,6 @@ linux_vsyscall(struct thread *td) struct sysentvec elf_linux_sysvec = { .sv_size = LINUX_SYS_MAXSYSCALL, .sv_table = linux_sysent, - .sv_errsize = ELAST + 1, - .sv_errtbl = linux_errtbl, .sv_transtrap = linux_translate_traps, .sv_fixup = linux_elf_fixup, .sv_sendsig = linux_rt_sendsig, Modified: head/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- head/sys/compat/ia32/ia32_sysvec.c Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/compat/ia32/ia32_sysvec.c Thu Sep 17 11:39:33 2020 (r365832) @@ -98,8 +98,6 @@ SYSCTL_ULONG(_compat_ia32, OID_AUTO, maxvmem, CTLFLAG_ struct sysentvec ia32_freebsd_sysvec = { .sv_size = FREEBSD32_SYS_MAXSYSCALL, .sv_table = freebsd32_sysent, - .sv_errsize = 0, - .sv_errtbl = NULL, .sv_transtrap = NULL, .sv_fixup = elf32_freebsd_fixup, .sv_sendsig = ia32_sendsig, Modified: head/sys/compat/linux/linux.h ============================================================================== --- head/sys/compat/linux/linux.h Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/compat/linux/linux.h Thu Sep 17 11:39:33 2020 (r365832) @@ -192,4 +192,6 @@ int linux_to_bsd_bits_(int value, struct bsd_to_linux_ } #define BITMAP_1t1_LINUX(_name) BITMAP_EASY_LINUX(_name, LINUX_##_name) +int linux_to_bsd_errno(int error); + #endif /* _LINUX_MI_H_ */ Modified: head/sys/compat/linux/linux_errno.c ============================================================================== --- head/sys/compat/linux/linux_errno.c Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/compat/linux/linux_errno.c Thu Sep 17 11:39:33 2020 (r365832) @@ -1,6 +1,21 @@ /* $FreeBSD$ */ #include +__FBSDID("$FreeBSD$"); + +#include #include +#include +#include #include + +int +linux_to_bsd_errno(int error) +{ + + KASSERT(error >= 0 && error <= ELAST, + ("%s: bad error %d", __func__, error)); + + return (linux_errtbl[error]); +} Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/compat/linux/linux_socket.c Thu Sep 17 11:39:33 2020 (r365832) @@ -1553,7 +1553,7 @@ linux_getsockopt(struct thread *td, struct linux_getso name, &newval, UIO_SYSSPACE, &len); if (error != 0) return (error); - newval = -SV_ABI_ERRNO(td->td_proc, newval); + newval = -linux_to_bsd_errno(newval); return (copyout(&newval, PTRIN(args->optval), len)); /* NOTREACHED */ default: Modified: head/sys/i386/i386/elf_machdep.c ============================================================================== --- head/sys/i386/i386/elf_machdep.c Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/i386/i386/elf_machdep.c Thu Sep 17 11:39:33 2020 (r365832) @@ -54,8 +54,6 @@ __FBSDID("$FreeBSD$"); struct sysentvec elf32_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_errsize = 0, - .sv_errtbl = NULL, .sv_transtrap = NULL, .sv_fixup = __elfN(freebsd_fixup), .sv_sendsig = sendsig, Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/i386/linux/linux_sysvec.c Thu Sep 17 11:39:33 2020 (r365832) @@ -801,7 +801,7 @@ linux_set_syscall_retval(struct thread *td, int error) if (__predict_false(error != 0)) { if (error != ERESTART && error != EJUSTRETURN) - frame->tf_eax = SV_ABI_ERRNO(td->td_proc, error); + frame->tf_eax = linux_to_bsd_errno(error); } } @@ -847,8 +847,6 @@ linux_get_machine(const char **dst) struct sysentvec linux_sysvec = { .sv_size = LINUX_SYS_MAXSYSCALL, .sv_table = linux_sysent, - .sv_errsize = ELAST + 1, - .sv_errtbl = linux_errtbl, .sv_transtrap = linux_translate_traps, .sv_fixup = linux_fixup, .sv_sendsig = linux_sendsig, @@ -882,8 +880,6 @@ INIT_SYSENTVEC(aout_sysvec, &linux_sysvec); struct sysentvec elf_linux_sysvec = { .sv_size = LINUX_SYS_MAXSYSCALL, .sv_table = linux_sysent, - .sv_errsize = ELAST + 1, - .sv_errtbl = linux_errtbl, .sv_transtrap = linux_translate_traps, .sv_fixup = linux_fixup_elf, .sv_sendsig = linux_sendsig, Modified: head/sys/kern/imgact_aout.c ============================================================================== --- head/sys/kern/imgact_aout.c Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/kern/imgact_aout.c Thu Sep 17 11:39:33 2020 (r365832) @@ -76,8 +76,6 @@ static int aout_fixup(uintptr_t *stack_base, struct im struct sysentvec aout_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_errsize = 0, - .sv_errtbl = NULL, .sv_transtrap = NULL, .sv_fixup = aout_fixup, .sv_sendsig = sendsig, @@ -117,8 +115,6 @@ extern u_long ia32_maxssiz; struct sysentvec aout_sysvec = { .sv_size = FREEBSD32_SYS_MAXSYSCALL, .sv_table = freebsd32_sysent, - .sv_errsize = 0, - .sv_errtbl = NULL, .sv_transtrap = NULL, .sv_fixup = aout_fixup, .sv_sendsig = ia32_sendsig, Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/kern/init_main.c Thu Sep 17 11:39:33 2020 (r365832) @@ -403,8 +403,6 @@ null_set_syscall_retval(struct thread *td __unused, in struct sysentvec null_sysvec = { .sv_size = 0, .sv_table = NULL, - .sv_errsize = 0, - .sv_errtbl = NULL, .sv_transtrap = NULL, .sv_fixup = NULL, .sv_sendsig = NULL, Modified: head/sys/mips/mips/elf_machdep.c ============================================================================== --- head/sys/mips/mips/elf_machdep.c Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/mips/mips/elf_machdep.c Thu Sep 17 11:39:33 2020 (r365832) @@ -54,8 +54,6 @@ __FBSDID("$FreeBSD$"); static struct sysentvec elf_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_errsize = 0, - .sv_errtbl = NULL, .sv_transtrap = NULL, .sv_fixup = __elfN(freebsd_fixup), .sv_sendsig = sendsig, Modified: head/sys/mips/mips/freebsd32_machdep.c ============================================================================== --- head/sys/mips/mips/freebsd32_machdep.c Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/mips/mips/freebsd32_machdep.c Thu Sep 17 11:39:33 2020 (r365832) @@ -77,8 +77,6 @@ extern const char *freebsd32_syscallnames[]; struct sysentvec elf32_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = freebsd32_sysent, - .sv_errsize = 0, - .sv_errtbl = NULL, .sv_transtrap = NULL, .sv_fixup = __elfN(freebsd_fixup), .sv_sendsig = freebsd32_sendsig, Modified: head/sys/powerpc/powerpc/elf32_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf32_machdep.c Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/powerpc/powerpc/elf32_machdep.c Thu Sep 17 11:39:33 2020 (r365832) @@ -90,8 +90,6 @@ struct sysentvec elf32_freebsd_sysvec = { #else .sv_table = sysent, #endif - .sv_errsize = 0, - .sv_errtbl = NULL, .sv_transtrap = NULL, .sv_fixup = __elfN(freebsd_fixup), .sv_copyout_auxargs = __elfN(powerpc_copyout_auxargs), Modified: head/sys/powerpc/powerpc/elf64_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf64_machdep.c Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/powerpc/powerpc/elf64_machdep.c Thu Sep 17 11:39:33 2020 (r365832) @@ -62,8 +62,6 @@ static void exec_setregs_funcdesc(struct thread *td, s struct sysentvec elf64_freebsd_sysvec_v1 = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_errsize = 0, - .sv_errtbl = NULL, .sv_transtrap = NULL, .sv_fixup = __elfN(freebsd_fixup), .sv_sendsig = sendsig, @@ -100,8 +98,6 @@ struct sysentvec elf64_freebsd_sysvec_v1 = { struct sysentvec elf64_freebsd_sysvec_v2 = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_errsize = 0, - .sv_errtbl = NULL, .sv_transtrap = NULL, .sv_fixup = __elfN(freebsd_fixup), .sv_sendsig = sendsig, Modified: head/sys/riscv/riscv/elf_machdep.c ============================================================================== --- head/sys/riscv/riscv/elf_machdep.c Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/riscv/riscv/elf_machdep.c Thu Sep 17 11:39:33 2020 (r365832) @@ -65,8 +65,6 @@ u_long elf_hwcap; struct sysentvec elf64_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, .sv_table = sysent, - .sv_errsize = 0, - .sv_errtbl = NULL, .sv_transtrap = NULL, .sv_fixup = __elfN(freebsd_fixup), .sv_sendsig = sendsig, Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Thu Sep 17 07:13:41 2020 (r365831) +++ head/sys/sys/sysent.h Thu Sep 17 11:39:33 2020 (r365832) @@ -102,8 +102,6 @@ struct vnode; struct sysentvec { int sv_size; /* number of entries */ struct sysent *sv_table; /* pointer to sysent */ - int sv_errsize; /* size of errno translation table */ - const int *sv_errtbl; /* errno translation table */ int (*sv_transtrap)(int, int); /* translate trap-to-signal mapping */ int (*sv_fixup)(uintptr_t *, struct image_params *); @@ -158,8 +156,6 @@ struct sysentvec { #define SV_ASLR 0x080000 /* ASLR allowed. */ #define SV_ABI_MASK 0xff -#define SV_ABI_ERRNO(p, e) ((p)->p_sysent->sv_errsize <= 0 ? e : \ - ((e) >= (p)->p_sysent->sv_errsize ? -1 : (p)->p_sysent->sv_errtbl[e])) #define SV_PROC_FLAG(p, x) ((p)->p_sysent->sv_flags & (x)) #define SV_PROC_ABI(p) ((p)->p_sysent->sv_flags & SV_ABI_MASK) #define SV_CURPROC_FLAG(x) SV_PROC_FLAG(curproc, x) From owner-svn-src-all@freebsd.org Thu Sep 17 11:44:46 2020 Return-Path: Delivered-To: svn-src-all@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 3E42D3DD0BF; Thu, 17 Sep 2020 11:44:46 +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 4BsZrZ101pz3cHM; Thu, 17 Sep 2020 11:44:46 +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 04CEF96D5; Thu, 17 Sep 2020 11:44:46 +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 08HBijJn057525; Thu, 17 Sep 2020 11:44:45 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HBijrE057523; Thu, 17 Sep 2020 11:44:45 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202009171144.08HBijrE057523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 17 Sep 2020 11:44:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365833 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 365833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 11:44:46 -0000 Author: trasz Date: Thu Sep 17 11:44:45 2020 New Revision: 365833 URL: https://svnweb.freebsd.org/changeset/base/365833 Log: Add support for SOUND_MIXER_WRITE_MONITOR ioctl. Fixes alsamixer(1) on my x220. Reviewed by: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25806 Modified: head/sys/compat/linux/linux_ioctl.c head/sys/compat/linux/linux_ioctl.h Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Thu Sep 17 11:39:33 2020 (r365832) +++ head/sys/compat/linux/linux_ioctl.c Thu Sep 17 11:44:45 2020 (r365833) @@ -1794,6 +1794,10 @@ linux_ioctl_sound(struct thread *td, struct linux_ioct args->cmd = SETDIR(SOUND_MIXER_WRITE_LINE3); return (sys_ioctl(td, (struct ioctl_args *)args)); + case LINUX_SOUND_MIXER_WRITE_MONITOR: + args->cmd = SETDIR(SOUND_MIXER_WRITE_MONITOR); + return (sys_ioctl(td, (struct ioctl_args *)args)); + case LINUX_SOUND_MIXER_INFO: { /* Key on encoded length */ switch ((args->cmd >> 16) & 0x1fff) { Modified: head/sys/compat/linux/linux_ioctl.h ============================================================================== --- head/sys/compat/linux/linux_ioctl.h Thu Sep 17 11:39:33 2020 (r365832) +++ head/sys/compat/linux/linux_ioctl.h Thu Sep 17 11:44:45 2020 (r365833) @@ -278,6 +278,7 @@ #define LINUX_SOUND_MIXER_WRITE_LINE1 0x4d0E #define LINUX_SOUND_MIXER_WRITE_LINE2 0x4d0F #define LINUX_SOUND_MIXER_WRITE_LINE3 0x4d10 +#define LINUX_SOUND_MIXER_WRITE_MONITOR 0x4d18 #define LINUX_SOUND_MIXER_INFO 0x4d65 #define LINUX_OSS_GETVERSION 0x4d76 #define LINUX_SOUND_MIXER_READ_STEREODEVS 0x4dfb From owner-svn-src-all@freebsd.org Thu Sep 17 12:14:25 2020 Return-Path: Delivered-To: svn-src-all@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 941863DEA5A; Thu, 17 Sep 2020 12:14:25 +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 4BsbVn3QGZz3fHx; Thu, 17 Sep 2020 12:14:25 +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 591639F43; Thu, 17 Sep 2020 12:14:25 +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 08HCEPbR076683; Thu, 17 Sep 2020 12:14:25 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HCEP8n076682; Thu, 17 Sep 2020 12:14:25 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202009171214.08HCEP8n076682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 17 Sep 2020 12:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365834 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 365834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 12:14:25 -0000 Author: trasz Date: Thu Sep 17 12:14:24 2020 New Revision: 365834 URL: https://svnweb.freebsd.org/changeset/base/365834 Log: Reduce code duplication by introducing linux_copyout_sockaddr() helper function. No functional changes. Reviewed by: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25804 Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Thu Sep 17 11:44:45 2020 (r365833) +++ head/sys/compat/linux/linux_socket.c Thu Sep 17 12:14:24 2020 (r365834) @@ -394,6 +394,22 @@ linux_set_socket_flags(int lflags, int *flags) } static int +linux_copyout_sockaddr(const struct sockaddr *sa, void *uaddr, size_t len) +{ + struct l_sockaddr *lsa; + int error; + + error = bsd_to_linux_sockaddr(sa, &lsa, len); + if (error != 0) + return (error); + + error = copyout(lsa, uaddr, len); + free(lsa, M_SONAME); + + return (error); +} + +static int linux_sendit(struct thread *td, int s, struct msghdr *mp, int flags, struct mbuf *control, enum uio_seg segflg) { @@ -609,7 +625,6 @@ static int linux_accept_common(struct thread *td, int s, l_uintptr_t addr, l_uintptr_t namelen, int flags) { - struct l_sockaddr *lsa; struct sockaddr *sa; struct file *fp, *fp1; int bflags, len; @@ -665,10 +680,7 @@ linux_accept_common(struct thread *td, int s, l_uintpt } if (len != 0) { - error = bsd_to_linux_sockaddr(sa, &lsa, len); - if (error == 0) - error = copyout(lsa, PTRIN(addr), len); - free(lsa, M_SONAME); + error = linux_copyout_sockaddr(sa, PTRIN(addr), len); /* * XXX: We should also copyout the len, shouldn't we? @@ -704,7 +716,6 @@ linux_accept4(struct thread *td, struct linux_accept4_ int linux_getsockname(struct thread *td, struct linux_getsockname_args *args) { - struct l_sockaddr *lsa; struct sockaddr *sa; int len, error; @@ -716,13 +727,8 @@ linux_getsockname(struct thread *td, struct linux_gets if (error != 0) return (error); - if (len != 0) { - error = bsd_to_linux_sockaddr(sa, &lsa, len); - if (error == 0) - error = copyout(lsa, PTRIN(args->addr), - len); - free(lsa, M_SONAME); - } + if (len != 0) + error = linux_copyout_sockaddr(sa, PTRIN(args->addr), len); free(sa, M_SONAME); if (error == 0) @@ -733,7 +739,6 @@ linux_getsockname(struct thread *td, struct linux_gets int linux_getpeername(struct thread *td, struct linux_getpeername_args *args) { - struct l_sockaddr *lsa; struct sockaddr *sa; int len, error; @@ -747,13 +752,8 @@ linux_getpeername(struct thread *td, struct linux_getp if (error != 0) return (error); - if (len != 0) { - error = bsd_to_linux_sockaddr(sa, &lsa, len); - if (error == 0) - error = copyout(lsa, PTRIN(args->addr), - len); - free(lsa, M_SONAME); - } + if (len != 0) + error = linux_copyout_sockaddr(sa, PTRIN(args->addr), len); free(sa, M_SONAME); if (error == 0) @@ -895,7 +895,6 @@ linux_sendto(struct thread *td, struct linux_sendto_ar int linux_recvfrom(struct thread *td, struct linux_recvfrom_args *args) { - struct l_sockaddr *lsa; struct sockaddr *sa; struct msghdr msg; struct iovec aiov; @@ -927,13 +926,8 @@ linux_recvfrom(struct thread *td, struct linux_recvfro if (error != 0) goto out; - if (PTRIN(args->from) != NULL) { - error = bsd_to_linux_sockaddr(sa, &lsa, msg.msg_namelen); - if (error == 0) - error = copyout(lsa, PTRIN(args->from), - msg.msg_namelen); - free(lsa, M_SONAME); - } + if (PTRIN(args->from) != NULL) + error = linux_copyout_sockaddr(sa, PTRIN(args->from), msg.msg_namelen); if (error == 0 && PTRIN(args->fromlen) != NULL) error = copyout(&msg.msg_namelen, PTRIN(args->fromlen), @@ -1170,7 +1164,6 @@ linux_recvmsg_common(struct thread *td, l_int s, struc struct mbuf *control = NULL; struct mbuf **controlp; struct timeval *ftmvl; - struct l_sockaddr *lsa; struct sockaddr *sa; l_timeval ltmvl; caddr_t outbuf; @@ -1216,11 +1209,8 @@ linux_recvmsg_common(struct thread *td, l_int s, struc */ if (msg->msg_name != NULL && msg->msg_namelen > 0) { msg->msg_name = PTRIN(linux_msghdr.msg_name); - error = bsd_to_linux_sockaddr(sa, &lsa, msg->msg_namelen); - if (error == 0) - error = copyout(lsa, PTRIN(msg->msg_name), - msg->msg_namelen); - free(lsa, M_SONAME); + error = linux_copyout_sockaddr(sa, + PTRIN(msg->msg_name), msg->msg_namelen); if (error != 0) goto bad; } @@ -1505,7 +1495,6 @@ linux_getsockopt(struct thread *td, struct linux_getso l_timeval linux_tv; struct timeval tv; socklen_t tv_len, xulen, len; - struct l_sockaddr *lsa; struct sockaddr *sa; struct xucred xu; struct l_ucred lxu; @@ -1591,10 +1580,7 @@ linux_getsockopt(struct thread *td, struct linux_getso if (error != 0) goto out; - error = bsd_to_linux_sockaddr(sa, &lsa, len); - if (error == 0) - error = copyout(lsa, PTRIN(args->optval), len); - free(lsa, M_SONAME); + error = linux_copyout_sockaddr(sa, PTRIN(args->optval), len); if (error == 0) error = copyout(&len, PTRIN(args->optlen), sizeof(len)); From owner-svn-src-all@freebsd.org Thu Sep 17 14:58:31 2020 Return-Path: Delivered-To: svn-src-all@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 2AE0D3E2CFB; Thu, 17 Sep 2020 14:58:31 +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 4Bsg8666fDz454w; Thu, 17 Sep 2020 14:58:30 +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 B53FDBDC6; Thu, 17 Sep 2020 14:58:30 +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 08HEwUfY074250; Thu, 17 Sep 2020 14:58:30 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HEwUNS074249; Thu, 17 Sep 2020 14:58:30 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202009171458.08HEwUNS074249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Thu, 17 Sep 2020 14:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365835 - head/sys/modules/dtb/sifive X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/modules/dtb/sifive X-SVN-Commit-Revision: 365835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 14:58:31 -0000 Author: mhorne Date: Thu Sep 17 14:58:30 2020 New Revision: 365835 URL: https://svnweb.freebsd.org/changeset/base/365835 Log: Add dtb/sifive module This allows building the HiFive Unleashed device tree blob. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D26459 Added: head/sys/modules/dtb/sifive/ head/sys/modules/dtb/sifive/Makefile (contents, props changed) Added: head/sys/modules/dtb/sifive/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/dtb/sifive/Makefile Thu Sep 17 14:58:30 2020 (r365835) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +DTS= \ + sifive/hifive-unleashed-a00.dts + +.include From owner-svn-src-all@freebsd.org Thu Sep 17 15:07:26 2020 Return-Path: Delivered-To: svn-src-all@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 B9A943E324F; Thu, 17 Sep 2020 15:07:26 +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 4BsgLQ4X8Mz45y1; Thu, 17 Sep 2020 15:07:26 +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 7A894BF45; Thu, 17 Sep 2020 15:07:26 +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 08HF7QEt080557; Thu, 17 Sep 2020 15:07:26 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HF7Qns080555; Thu, 17 Sep 2020 15:07:26 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202009171507.08HF7Qns080555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Thu, 17 Sep 2020 15:07:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365836 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 365836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 15:07:26 -0000 Author: arichardson Date: Thu Sep 17 15:07:25 2020 New Revision: 365836 URL: https://svnweb.freebsd.org/changeset/base/365836 Log: Stop using lorder and ranlib when building libraries Use of ranlib or lorder is no longer necessary with current linkers (probably anything newer than ~1990) and ar's ability to create an object index and symbol table in the archive. Currently the build system uses lorder+tsort to sort the .o files in dependency order so that a single-pass linker can use them. However, we can use the -s flag to ar to add an index to the .a file which makes lorder unnecessary. Running ar -s is equivalent to running ranlib afterwards, so we can also skip the ranlib invocation. Similarly, we don't have to pass the .o files for shared libraries in dependency order since both ld.bfd and ld.lld will correctly resolve references between the .o files. This removes many fork()+execve calls for each library so should speed up builds a bit. Additionally lorder.sh uses a regular expression that is not supported by the macOS libc or glibc and results in many warnings when cross-building (see D25989). There is one functional change: lorder.sh removed duplicated .o files from the linker command line which now no longer happens. I fixed the duplicates in the base system in r364649. I also checked the ports tree for uses of bsd.lib.mk and found one duplicate source file which I fixed in r548168. Most ports use CMake/autotools rather than bsd.lib.mk but if this breaks any ports that I missed in my search please let me know. Avoiding the shell script actually speeds up the linking step noticeably: I measured how long it takes to rebuild the .a and .so files for lib/libc using a basic benchmark: `rm $LIBC_OBJDIR/*.so* $LIBC_OBJDIR/*.a* && /usr/bin/time make -DWITHOUT_TESTS -s > /dev/null` Without this change ~4.5 seconds and afterwards ~3.1 seconds. Looking at truss -cf output we can see that the number fork() system calls goes down from 27 to 12 (and the speedup while tracing is more noticeable: 81 seconds -> 65 seconds). See also https://www.gnu.org/software/coreutils/manual/html_node/tsort-background.html for some more background: This whole procedure has been obsolete since about 1980, because Unix archives now contain a symbol table (traditionally built by ranlib, now generally built by ar itself), and the Unix linker uses the symbol table to effectively make multiple passes over an archive file. Or alternatively https://www.unix.com/man-page/osf1/1/lorder/: The lorder command is essentially obsolete. Use the following command in its place: % ar -ts file.a Reviewed By: emaste, imp, dim Differential Revision: https://reviews.freebsd.org/D26044 Modified: head/share/mk/bsd.lib.mk head/share/mk/sys.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Thu Sep 17 14:58:30 2020 (r365835) +++ head/share/mk/bsd.lib.mk Thu Sep 17 15:07:25 2020 (r365836) @@ -245,9 +245,7 @@ _LIBS= lib${LIB_PRIVATE}${LIB}.a lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS} @${ECHO} building static ${LIB} library @rm -f ${.TARGET} - ${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' NMFLAGS='${NMFLAGS}' \ - ${LORDER} ${OBJS} ${STATICOBJS} | ${TSORT} ${TSORTFLAGS}` ${ARADD} - ${RANLIB} ${RANLIBFLAGS} ${.TARGET} + ${AR} ${ARFLAGS} ${.TARGET} ${OBJS} ${STATICOBJS} ${ARADD} .endif .if !defined(INTERNALLIB) @@ -261,9 +259,7 @@ CLEANFILES+= ${POBJS} lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS} @${ECHO} building profiled ${LIB} library @rm -f ${.TARGET} - ${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' NMFLAGS='${NMFLAGS}' \ - ${LORDER} ${POBJS} | ${TSORT} ${TSORTFLAGS}` ${ARADD} - ${RANLIB} ${RANLIBFLAGS} ${.TARGET} + ${AR} ${ARFLAGS} ${.TARGET} ${POBJS} ${ARADD} .endif .if defined(LLVM_LINK) @@ -319,9 +315,7 @@ ${SHLIB_NAME_FULL}: ${SOBJS} @${INSTALL_LIBSYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ${SHLIB_NAME} ${SHLIB_LINK} .endif ${_LD:N${CCACHE_BIN}} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \ - -o ${.TARGET} -Wl,-soname,${SONAME} \ - `NM='${NM}' NMFLAGS='${NMFLAGS}' ${LORDER} ${SOBJS} | \ - ${TSORT} ${TSORTFLAGS}` ${LDADD} + -o ${.TARGET} -Wl,-soname,${SONAME} ${SOBJS} ${LDADD} .if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS} .endif @@ -347,7 +341,6 @@ lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS} @${ECHO} building special pic ${LIB} library @rm -f ${.TARGET} ${AR} ${ARFLAGS} ${.TARGET} ${SOBJS} ${ARADD} - ${RANLIB} ${RANLIBFLAGS} ${.TARGET} .endif .if defined(BUILD_NOSSP_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) @@ -360,7 +353,6 @@ lib${LIB_PRIVATE}${LIB}_nossp_pic.a: ${NOSSPSOBJS} @${ECHO} building special nossp pic ${LIB} library @rm -f ${.TARGET} ${AR} ${ARFLAGS} ${.TARGET} ${NOSSPSOBJS} ${ARADD} - ${RANLIB} ${RANLIBFLAGS} ${.TARGET} .endif .endif # !defined(INTERNALLIB) @@ -376,7 +368,6 @@ lib${LIB_PRIVATE}${LIB}_pie.a: ${PIEOBJS} @${ECHO} building pie ${LIB} library @rm -f ${.TARGET} ${AR} ${ARFLAGS} ${.TARGET} ${PIEOBJS} ${ARADD} - ${RANLIB} ${RANLIBFLAGS} ${.TARGET} .endif .if defined(_SKIP_BUILD) Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Thu Sep 17 14:58:30 2020 (r365835) +++ head/share/mk/sys.mk Thu Sep 17 15:07:25 2020 (r365836) @@ -150,7 +150,7 @@ AR ?= ar .if defined(%POSIX) ARFLAGS ?= -rv .else -ARFLAGS ?= -crD +ARFLAGS ?= -crsD .endif RANLIB ?= ranlib .if !defined(%POSIX) From owner-svn-src-all@freebsd.org Thu Sep 17 15:38:52 2020 Return-Path: Delivered-To: svn-src-all@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 C195E3E49CA; Thu, 17 Sep 2020 15:38:52 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) (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 4Bsh2h3BS0z49RZ; Thu, 17 Sep 2020 15:38:52 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: by sdaoden.eu (Postfix, from userid 1000) id AC94A16057; Thu, 17 Sep 2020 17:38:43 +0200 (CEST) Date: Thu, 17 Sep 2020 17:38:43 +0200 From: Steffen Nurpmeso To: Alex Richardson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r365836 - head/share/mk Message-ID: <20200917153843.tZEGn%steffen@sdaoden.eu> In-Reply-To: <202009171507.08HF7Qns080555@repo.freebsd.org> References: <202009171507.08HF7Qns080555@repo.freebsd.org> Mail-Followup-To: Alex Richardson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org User-Agent: s-nail v14.9.19-127-g67fa13b6 OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. X-Rspamd-Queue-Id: 4Bsh2h3BS0z49RZ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15987, ipnet:217.144.128.0/20, country:DE] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 15:38:52 -0000 Alex Richardson wrote in <202009171507.08HF7Qns080555@repo.freebsd.org>: |Author: arichardson |Date: Thu Sep 17 15:07:25 2020 |New Revision: 365836 |URL: https://svnweb.freebsd.org/changeset/base/365836 | |Log: | Stop using lorder and ranlib when building libraries | | Use of ranlib or lorder is no longer necessary with current linkers | (probably anything newer than ~1990) and ar's ability to create an object | index and symbol table in the archive. | Currently the build system uses lorder+tsort to sort the .o files in | dependency order so that a single-pass linker can use them. However, | we can use the -s flag to ar to add an index to the .a file which makes | lorder unnecessary. | Running ar -s is equivalent to running ranlib afterwards, so we can also | skip the ranlib invocation. That ranlib thing yes (for long indeed), but i have vague memories that the tsort/lorder ordering was also meant to keep the things which heavily interdepend nearby each other. (Luckily Linux always had at least tsort available.) This no longer matters for all the platforms FreeBSD supports? --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) From owner-svn-src-all@freebsd.org Thu Sep 17 15:55:06 2020 Return-Path: Delivered-To: svn-src-all@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 540323E50A2 for ; Thu, 17 Sep 2020 15:55:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (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 4BshPP2HLrz4CQr for ; Thu, 17 Sep 2020 15:55:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x832.google.com with SMTP id n10so2261141qtv.3 for ; Thu, 17 Sep 2020 08:55:05 -0700 (PDT) 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; bh=iWF4cX0WNcvfsQb+S2VhetJhPFx8aDtcw5UU1WVdhBs=; b=r+5R2O7NERewbxBQ2tzF6sXGEY6lTUQvNpFMZbG41yOIzDBYXGCmfeay9HOupL/e/y tysBJbCmXw03Jn63DVHBclNuh0IwwD06mOSDUotKDujhbA4tpR6NgW+CQdxpSutbFsiQ 3gcJgKTbP8Ln7hOMYVMhbJbnFkHYeG33Ems7AFiSqqscfdwZKQyRooOJAZe/0EpG7efh zsZZIJ4FJCydc2mFwN7mK8cZHfh4OxyEBW/9Odng++v82/UE0FzvyTwfFSs6eSBSVi4R gO6s707Q47azJ64NIyxQKQFzyvcpVGd96cNXT6WIKRCOVZky3cl9XYSQT6MhH4MNzuMT jTRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=iWF4cX0WNcvfsQb+S2VhetJhPFx8aDtcw5UU1WVdhBs=; b=ZWevAsR+f6m2xIT5WDBlePud8kuiu5KWzJYjImy3oGN3qIdwUot6qoXIJDmUczbP2t BfcCIEjC9JoM4rWqOXK6dPSU7xoh875q2HLqZE4ZGsy/uObkARjnpNMgZKhzAK6pYC0s +Uw6f6T3rYh6SLSnQt4LK2XwrJ9gXCnGUyjbN339vmiCQWQSJ/evqRSiZbCBfrDYmcdV LXAgYD5O5/rsvukpbfis3/4+uDJphsnG6/1O8Fc8xP6oqRoNGyBEcFlv9ADuTACRE2ti QEDwYaqS/vvOsnyzA+ZK17vSx5yVl5LkxuFU5ybIYHTKRA55mmvz07fjOFDsLEqHf608 qBtA== X-Gm-Message-State: AOAM531Z/hUrtffoFHIQEUDA1JfH24R86/ExBNLvFBQz0HKhDV99zv2j j3fdwKjMpyR+45Mn1sN0OHpup3+4Ee5t7iStGTSfiFetw9UtYg== X-Google-Smtp-Source: ABdhPJwmkXvsm410Pb0VqMh+BofhhsraLHVOQlA72l6cpvIiKW3q7BzG6MdZElA/q+lWUj35udVy6ngk2vP7FMvoUQQ= X-Received: by 2002:ac8:7388:: with SMTP id t8mr28672311qtp.187.1600358103310; Thu, 17 Sep 2020 08:55:03 -0700 (PDT) MIME-Version: 1.0 References: <202009171507.08HF7Qns080555@repo.freebsd.org> <20200917153843.tZEGn%steffen@sdaoden.eu> In-Reply-To: <20200917153843.tZEGn%steffen@sdaoden.eu> From: Warner Losh Date: Thu, 17 Sep 2020 09:54:52 -0600 Message-ID: Subject: Re: svn commit: r365836 - head/share/mk To: Alex Richardson , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4BshPP2HLrz4CQr X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=r+5R2O7N; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::832) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.35 / 15.00]; ARC_NA(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.96)[-0.961]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-0.998]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.39)[-0.394]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::832:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 15:55:06 -0000 On Thu, Sep 17, 2020 at 9:39 AM Steffen Nurpmeso wrote: > Alex Richardson wrote in > <202009171507.08HF7Qns080555@repo.freebsd.org>: > |Author: arichardson > |Date: Thu Sep 17 15:07:25 2020 > |New Revision: 365836 > |URL: https://svnweb.freebsd.org/changeset/base/365836 > | > |Log: > | Stop using lorder and ranlib when building libraries > | > | Use of ranlib or lorder is no longer necessary with current linkers > | (probably anything newer than ~1990) and ar's ability to create an > object > | index and symbol table in the archive. > | Currently the build system uses lorder+tsort to sort the .o files in > | dependency order so that a single-pass linker can use them. However, > | we can use the -s flag to ar to add an index to the .a file which makes > | lorder unnecessary. > | Running ar -s is equivalent to running ranlib afterwards, so we can > also > | skip the ranlib invocation. > > That ranlib thing yes (for long indeed), but i have vague memories > that the tsort/lorder ordering was also meant to keep the things > which heavily interdepend nearby each other. (Luckily Linux > always had at least tsort available.) > This no longer matters for all the platforms FreeBSD supports? > tsort has no notion of how dependent the modules are, just an order that allows a single pass through the .a file (otherwise you'd need to list the .a file multiple times on the command line absent ranlib). That's the original purpose of tsort. tsort, lsort, and ranlib all arrived in 7th edition unix on a PDP-11, where size was more important than proximity to locations (modulo overlays, which this doesn't affect at all). There were some issues of long vs short jumps on earlier architectures that this helped (since you could only jump 16MB, for example). However, there were workarounds for this issue on those platforms too. And if you have a program that this does make a difference, then you can still use tsort/lorder. They are still in the system. I doubt you could measure a difference here today. I doubt, honestly, that anybody will notice at all. Warner From owner-svn-src-all@freebsd.org Thu Sep 17 15:58:43 2020 Return-Path: Delivered-To: svn-src-all@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 9CB323E53BA; Thu, 17 Sep 2020 15:58:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BshTb3gNbz4Cwp; Thu, 17 Sep 2020 15:58:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CE5FC573; Thu, 17 Sep 2020 15:58:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08HFwhl3011020; Thu, 17 Sep 2020 15:58:43 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HFwhQl011019; Thu, 17 Sep 2020 15:58:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009171558.08HFwhQl011019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 17 Sep 2020 15:58:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365837 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 365837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 15:58:43 -0000 Author: kevans Date: Thu Sep 17 15:58:42 2020 New Revision: 365837 URL: https://svnweb.freebsd.org/changeset/base/365837 Log: Promote the installworld `certctl rehash` to distributeworld Contrary to my belief, installworld is not sufficient for getting certs installed into VM images. Promote the rehash to both installworld and distributeworld (notably: not stageworld) and rehash the base distdir so we end up with /etc/ssl/certs populated in the base dist archive. A future commit will remove the rehash from bsdinstall, which doesn't really need to happen if they're installed into base.txz. While here, fix a minor typo: s/CERTCLTFLAGS/CERTCTLFLAGS/ MFC after: 1 week Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Sep 17 15:07:25 2020 (r365836) +++ head/Makefile.inc1 Thu Sep 17 15:58:42 2020 (r365837) @@ -926,7 +926,7 @@ METALOG:= ${METALOG:C,//+,/,g} IMAKE+= -DNO_ROOT METALOG=${METALOG} METALOG_INSTALLFLAGS= -U -M ${METALOG} -D ${INSTALL_DDIR} INSTALLFLAGS+= ${METALOG_INSTALLFLAGS} -CERTCLTFLAGS= ${METALOG_INSTALLFLAGS} +CERTCTLFLAGS= ${METALOG_INSTALLFLAGS} MTREEFLAGS+= -W .endif .if defined(BUILD_PKGS) @@ -936,6 +936,11 @@ INSTALLFLAGS+= -h sha256 IMAKE_INSTALL= INSTALL="${INSTALL_CMD} ${INSTALLFLAGS}" IMAKE_MTREE= MTREE_CMD="${MTREE_CMD} ${MTREEFLAGS}" .endif +.if make(distributeworld) +CERTCTLDESTDIR= ${DESTDIR}/${DISTDIR}/base +.else +CERTCTLDESTDIR= ${DESTDIR} +.endif DESTDIR_MTREEFLAGS= -deU # When creating worldtmp we don't need to set the directories as owned by root @@ -1443,13 +1448,15 @@ distributeworld installworld stageworld: _installcheck ${DESTDIR}/${DISTDIR}/${dist}.debug.meta .endfor .endif -.elif make(installworld) && ${MK_CAROOT} != "no" +.endif # make(distributeworld) +.if !make(packageworld) && ${MK_CAROOT} != "no" @if which openssl>/dev/null; then \ - sh ${SRCTOP}/usr.sbin/certctl/certctl.sh ${CERTCLTFLAGS} rehash \ + DESTDIR=${CERTCTLDESTDIR} \ + sh ${SRCTOP}/usr.sbin/certctl/certctl.sh ${CERTCTLFLAGS} rehash \ else \ echo "No openssl on the host, not rehashing certificates target -- /etc/ssl may not be populated."; \ fi -.endif # make(distributeworld) +.endif packageworld: .PHONY .for dist in base ${EXTRA_DISTRIBUTIONS} From owner-svn-src-all@freebsd.org Thu Sep 17 16:09:38 2020 Return-Path: Delivered-To: svn-src-all@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 BF1EC3E565C; Thu, 17 Sep 2020 16:09:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BshkB4jgqz4Dk5; Thu, 17 Sep 2020 16:09:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 867C3C9B5; Thu, 17 Sep 2020 16:09:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08HG9cCe017198; Thu, 17 Sep 2020 16:09:38 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HG9cb0017197; Thu, 17 Sep 2020 16:09:38 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202009171609.08HG9cb0017197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 Sep 2020 16:09:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365838 - stable/12/sys/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/12/sys/conf X-SVN-Commit-Revision: 365838 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 16:09:38 -0000 Author: gjb Date: Thu Sep 17 16:09:38 2020 New Revision: 365838 URL: https://svnweb.freebsd.org/changeset/base/365838 Log: MFC r365646, r365720: r365646: Enclose BRANCH_OVERRIDE in quotes in order to fix an issue with freebsd-update(8) builds, where BRANCH is suffixed with -p0 for builds. r365720 (gordon): Partially revert r346018 and use the if/then construct instead of shell. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/12/sys/conf/newvers.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/newvers.sh ============================================================================== --- stable/12/sys/conf/newvers.sh Thu Sep 17 15:58:42 2020 (r365837) +++ stable/12/sys/conf/newvers.sh Thu Sep 17 16:09:38 2020 (r365838) @@ -49,7 +49,10 @@ TYPE="FreeBSD" REVISION="12.2" -BRANCH=${BRANCH_OVERRIDE:-STABLE} +BRANCH="STABLE" +if [ -n "${BRANCH_OVERRIDE}" ]; then + BRANCH=${BRANCH_OVERRIDE} +fi RELEASE="${REVISION}-${BRANCH}" VERSION="${TYPE} ${RELEASE}" From owner-svn-src-all@freebsd.org Thu Sep 17 16:31:19 2020 Return-Path: Delivered-To: svn-src-all@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 DA41D3E63A6; Thu, 17 Sep 2020 16:31:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BsjCC5TKFz4G5S; Thu, 17 Sep 2020 16:31:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F75CCEDA; Thu, 17 Sep 2020 16:31:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08HGVJ5u034249; Thu, 17 Sep 2020 16:31:19 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HGVJqE034248; Thu, 17 Sep 2020 16:31:19 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202009171631.08HGVJqE034248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 Sep 2020 16:31:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365839 - releng/12.2/sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/12.2/sys/conf X-SVN-Commit-Revision: 365839 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 16:31:19 -0000 Author: gjb Date: Thu Sep 17 16:31:19 2020 New Revision: 365839 URL: https://svnweb.freebsd.org/changeset/base/365839 Log: MFS12 r365838: MFC r365646, r365720: r365646: Enclose BRANCH_OVERRIDE in quotes in order to fix an issue with freebsd-update(8) builds, where BRANCH is suffixed with -p0 for builds. r365720 (gordon): Partially revert r346018 and use the if/then construct instead of shell. Approved by: re (kib) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/12.2/sys/conf/newvers.sh Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/sys/conf/newvers.sh ============================================================================== --- releng/12.2/sys/conf/newvers.sh Thu Sep 17 16:09:38 2020 (r365838) +++ releng/12.2/sys/conf/newvers.sh Thu Sep 17 16:31:19 2020 (r365839) @@ -49,7 +49,10 @@ TYPE="FreeBSD" REVISION="12.2" -BRANCH=${BRANCH_OVERRIDE:-BETA1-p1} +BRANCH="BETA1-p1" +if [ -n "${BRANCH_OVERRIDE}" ]; then + BRANCH=${BRANCH_OVERRIDE} +fi RELEASE="${REVISION}-${BRANCH}" VERSION="${TYPE} ${RELEASE}" From owner-svn-src-all@freebsd.org Thu Sep 17 16:44:13 2020 Return-Path: Delivered-To: svn-src-all@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 097223E67A9; Thu, 17 Sep 2020 16:44:13 +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 4BsjV46sFBz4GmD; Thu, 17 Sep 2020 16:44:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE80ECBF3; Thu, 17 Sep 2020 16:44:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08HGiCB6041570; Thu, 17 Sep 2020 16:44:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HGiCu8041569; Thu, 17 Sep 2020 16:44:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009171644.08HGiCu8041569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 17 Sep 2020 16:44:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365840 - head/tests/sys/posixshm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/tests/sys/posixshm X-SVN-Commit-Revision: 365840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 16:44:13 -0000 Author: markj Date: Thu Sep 17 16:44:12 2020 New Revision: 365840 URL: https://svnweb.freebsd.org/changeset/base/365840 Log: Add some basic regression tests for SHM_LARGEPAGE. Discussed with: kib Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D25900 Modified: head/tests/sys/posixshm/posixshm_test.c Modified: head/tests/sys/posixshm/posixshm_test.c ============================================================================== --- head/tests/sys/posixshm/posixshm_test.c Thu Sep 17 16:31:19 2020 (r365839) +++ head/tests/sys/posixshm/posixshm_test.c Thu Sep 17 16:44:12 2020 (r365840) @@ -28,10 +28,12 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include #include +#include #include #include @@ -956,6 +958,720 @@ ATF_TC_BODY(fallocate, tc) close(fd); } +static int +shm_open_large(int psind, int policy, size_t sz) +{ + int error, fd; + + fd = shm_create_largepage(SHM_ANON, O_CREAT | O_RDWR, psind, policy, 0); + if (fd < 0 && errno == ENOTTY) + atf_tc_skip("no large page support"); + ATF_REQUIRE_MSG(fd >= 0, "shm_create_largepage failed; errno=%d", errno); + + error = ftruncate(fd, sz); + if (error != 0 && errno == ENOMEM) + /* + * The test system might not have enough memory to accommodate + * the request. + */ + atf_tc_skip("failed to allocate %zu-byte superpage", sz); + ATF_REQUIRE_MSG(error == 0, "ftruncate failed; errno=%d", errno); + + return (fd); +} + +static int +pagesizes(size_t ps[MAXPAGESIZES]) +{ + int pscnt; + + pscnt = getpagesizes(ps, MAXPAGESIZES); + ATF_REQUIRE_MSG(pscnt != -1, "getpagesizes failed; errno=%d", errno); + ATF_REQUIRE_MSG(ps[0] == PAGE_SIZE, "psind 0 is %zu", ps[0]); + ATF_REQUIRE_MSG(pscnt <= MAXPAGESIZES, "invalid pscnt %d", pscnt); + if (pscnt == 1) + atf_tc_skip("no large page support"); + return (pscnt); +} + +ATF_TC_WITHOUT_HEAD(largepage_basic); +ATF_TC_BODY(largepage_basic, tc) +{ + char zeroes[PAGE_SIZE]; + char *addr, *vec; + size_t ps[MAXPAGESIZES]; + int error, fd, pscnt; + + memset(zeroes, 0, PAGE_SIZE); + + pscnt = pagesizes(ps); + for (int i = 1; i < pscnt; i++) { + fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]); + + addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd, + 0); + ATF_REQUIRE_MSG(addr != MAP_FAILED, + "mmap(%zu bytes) failed; errno=%d", ps[i], errno); + ATF_REQUIRE_MSG(((uintptr_t)addr & (ps[i] - 1)) == 0, + "mmap(%zu bytes) returned unaligned mapping; addr=%p", + ps[i], addr); + + /* Force a page fault. */ + *(volatile char *)addr = 0; + + vec = malloc(ps[i] / PAGE_SIZE); + ATF_REQUIRE(vec != NULL); + error = mincore(addr, ps[i], vec); + ATF_REQUIRE_MSG(error == 0, "mincore failed; errno=%d", errno); + + /* Verify that all pages in the run are mapped. */ + for (size_t p = 0; p < ps[i] / PAGE_SIZE; p++) { + ATF_REQUIRE_MSG((vec[p] & MINCORE_INCORE) != 0, + "page %zu is not mapped", p); + ATF_REQUIRE_MSG((vec[p] & MINCORE_PSIND(i)) != 0, + "page %zu is not in a %zu-byte superpage", + p, ps[i]); + } + + /* Validate zeroing. */ + for (size_t p = 0; p < ps[i] / PAGE_SIZE; p++) { + ATF_REQUIRE_MSG(memcmp(addr + p * PAGE_SIZE, zeroes, + PAGE_SIZE) == 0, "page %zu miscompare", p); + } + + free(vec); + ATF_REQUIRE(munmap(addr, ps[i]) == 0); + ATF_REQUIRE(close(fd) == 0); + } +} + +extern int __sys_shm_open2(const char *, int, mode_t, int, const char *); + +ATF_TC_WITHOUT_HEAD(largepage_config); +ATF_TC_BODY(largepage_config, tc) +{ + struct shm_largepage_conf lpc; + char *addr, *buf; + size_t ps[MAXPAGESIZES + 1]; /* silence warnings if MAXPAGESIZES == 1 */ + int error, fd, pscnt; + + pscnt = pagesizes(ps); + + fd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0); + ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; error=%d", errno); + + /* + * Configure a large page policy for an object created without + * SHM_LARGEPAGE. + */ + lpc.psind = 1; + lpc.alloc_policy = SHM_LARGEPAGE_ALLOC_DEFAULT; + error = ioctl(fd, FIOSSHMLPGCNF, &lpc); + ATF_REQUIRE(error != 0); + ATF_REQUIRE_MSG(errno == ENOTTY, "ioctl(FIOSSHMLPGCNF) returned %d", + errno); + ATF_REQUIRE(close(fd) == 0); + + /* + * Create a largepage object and try to use it without actually + * configuring anything. + */ + fd = __sys_shm_open2(SHM_ANON, O_CREAT | O_RDWR, 0, SHM_LARGEPAGE, + NULL); + if (fd < 0 && errno == ENOTTY) + atf_tc_skip("no large page support"); + ATF_REQUIRE_MSG(fd >= 0, "shm_open2 failed; error=%d", errno); + + error = ftruncate(fd, ps[1]); + ATF_REQUIRE(error != 0); + ATF_REQUIRE_MSG(errno == EINVAL, "ftruncate returned %d", errno); + + addr = mmap(NULL, ps[1], PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + ATF_REQUIRE(addr == MAP_FAILED); + ATF_REQUIRE_MSG(errno == EINVAL, "mmap returned %d", errno); + addr = mmap(NULL, 0, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + ATF_REQUIRE(addr == MAP_FAILED); + ATF_REQUIRE_MSG(errno == EINVAL, "mmap returned %d", errno); + + buf = calloc(1, PAGE_SIZE); + ATF_REQUIRE(buf != NULL); + ATF_REQUIRE(write(fd, buf, PAGE_SIZE) == -1); + ATF_REQUIRE_MSG(errno == EINVAL, "write returned %d", errno); + free(buf); + buf = calloc(1, ps[1]); + ATF_REQUIRE(buf != NULL); + ATF_REQUIRE(write(fd, buf, ps[1]) == -1); + ATF_REQUIRE_MSG(errno == EINVAL, "write returned %d", errno); + free(buf); + + error = posix_fallocate(fd, 0, PAGE_SIZE); + ATF_REQUIRE_MSG(error == EINVAL, "posix_fallocate returned %d", error); + + ATF_REQUIRE(close(fd) == 0); +} + +ATF_TC_WITHOUT_HEAD(largepage_mmap); +ATF_TC_BODY(largepage_mmap, tc) +{ + char *addr, *addr1, *vec; + size_t ps[MAXPAGESIZES]; + int fd, pscnt; + + pscnt = pagesizes(ps); + for (int i = 1; i < pscnt; i++) { + fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]); + + /* For mincore(). */ + vec = malloc(ps[i]); + ATF_REQUIRE(vec != NULL); + + /* + * Wrong mapping size. + */ + addr = mmap(NULL, ps[i - 1], PROT_READ | PROT_WRITE, MAP_SHARED, + fd, 0); + ATF_REQUIRE_MSG(addr == MAP_FAILED, + "mmap(%zu bytes) succeeded", ps[i - 1]); + ATF_REQUIRE_MSG(errno == EINVAL, + "mmap(%zu bytes) failed; error=%d", ps[i - 1], errno); + + /* + * Fixed mappings. + */ + addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd, + 0); + ATF_REQUIRE_MSG(addr != MAP_FAILED, + "mmap(%zu bytes) failed; errno=%d", ps[i], errno); + ATF_REQUIRE_MSG(((uintptr_t)addr & (ps[i] - 1)) == 0, + "mmap(%zu bytes) returned unaligned mapping; addr=%p", + ps[i], addr); + + /* Try mapping a small page with anonymous memory. */ + addr1 = mmap(addr, ps[i - 1], PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0); + ATF_REQUIRE_MSG(addr1 == MAP_FAILED, + "anon mmap(%zu bytes) succeeded", ps[i - 1]); + ATF_REQUIRE_MSG(errno == EINVAL, "mmap returned %d", errno); + + /* Check MAP_EXCL when creating a second largepage mapping. */ + addr1 = mmap(addr, ps[i], PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_FIXED | MAP_EXCL, fd, 0); + ATF_REQUIRE_MSG(addr1 == MAP_FAILED, + "mmap(%zu bytes) succeeded", ps[i]); + /* XXX wrong errno */ + ATF_REQUIRE_MSG(errno == ENOSPC, "mmap returned %d", errno); + + /* Overwrite a largepage mapping with a lagepage mapping. */ + addr1 = mmap(addr, ps[i], PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_FIXED, fd, 0); + ATF_REQUIRE_MSG(addr1 != MAP_FAILED, + "mmap(%zu bytes) failed; errno=%d", ps[i], errno); + ATF_REQUIRE_MSG(addr == addr1, + "mmap(%zu bytes) moved from %p to %p", ps[i], addr, addr1); + + ATF_REQUIRE(munmap(addr, ps[i] == 0)); + + /* Clobber an anonymous mapping with a superpage. */ + addr1 = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, + MAP_ANON | MAP_PRIVATE | MAP_ALIGNED(ffsl(ps[i]) - 1), -1, + 0); + ATF_REQUIRE_MSG(addr1 != MAP_FAILED, + "mmap failed; error=%d", errno); + *(volatile char *)addr1 = '\0'; + addr = mmap(addr1, ps[i], PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_FIXED, fd, 0); + ATF_REQUIRE_MSG(addr != MAP_FAILED, + "mmap failed; error=%d", errno); + ATF_REQUIRE_MSG(addr == addr1, + "mmap disobeyed MAP_FIXED, %p %p", addr, addr1); + *(volatile char *)addr = 0; /* fault */ + ATF_REQUIRE(mincore(addr, ps[i], vec) == 0); + for (size_t p = 0; p < ps[i] / PAGE_SIZE; p++) { + ATF_REQUIRE_MSG((vec[p] & MINCORE_INCORE) != 0, + "page %zu is not resident", p); + ATF_REQUIRE_MSG((vec[p] & MINCORE_PSIND(i)) != 0, + "page %zu is not resident", p); + } + + /* + * Copy-on-write mappings are not permitted. + */ + addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_PRIVATE, + fd, 0); + ATF_REQUIRE_MSG(addr == MAP_FAILED, + "mmap(%zu bytes) succeeded", ps[i]); + + ATF_REQUIRE(close(fd) == 0); + } +} + +ATF_TC_WITHOUT_HEAD(largepage_munmap); +ATF_TC_BODY(largepage_munmap, tc) +{ + char *addr; + size_t ps[MAXPAGESIZES], ps1; + int fd, pscnt; + + pscnt = pagesizes(ps); + for (int i = 1; i < pscnt; i++) { + fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]); + ps1 = ps[i - 1]; + + addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd, + 0); + ATF_REQUIRE_MSG(addr != MAP_FAILED, + "mmap(%zu bytes) failed; errno=%d", ps[i], errno); + + /* Try several unaligned munmap() requests. */ + ATF_REQUIRE(munmap(addr, ps1) != 0); + ATF_REQUIRE_MSG(errno == EINVAL, + "unexpected error %d from munmap", errno); + ATF_REQUIRE(munmap(addr, ps[i] - ps1)); + ATF_REQUIRE_MSG(errno == EINVAL, + "unexpected error %d from munmap", errno); + ATF_REQUIRE(munmap(addr + ps1, ps1) != 0); + ATF_REQUIRE_MSG(errno == EINVAL, + "unexpected error %d from munmap", errno); + ATF_REQUIRE(munmap(addr, 0)); + ATF_REQUIRE_MSG(errno == EINVAL, + "unexpected error %d from munmap", errno); + + ATF_REQUIRE(munmap(addr, ps[i]) == 0); + ATF_REQUIRE(close(fd) == 0); + } +} + +static void +largepage_madvise(char *addr, size_t sz, int advice, int error) +{ + if (error == 0) { + ATF_REQUIRE_MSG(madvise(addr, sz, advice) == 0, + "madvise(%zu, %d) failed; error=%d", sz, advice, errno); + } else { + ATF_REQUIRE_MSG(madvise(addr, sz, advice) != 0, + "madvise(%zu, %d) succeeded", sz, advice); + ATF_REQUIRE_MSG(errno == error, + "unexpected error %d from madvise(%zu, %d)", + errno, sz, advice); + } +} + +ATF_TC_WITHOUT_HEAD(largepage_madvise); +ATF_TC_BODY(largepage_madvise, tc) +{ + char *addr; + size_t ps[MAXPAGESIZES]; + int fd, pscnt; + + pscnt = pagesizes(ps); + for (int i = 1; i < pscnt; i++) { + fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]); + addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd, + 0); + ATF_REQUIRE_MSG(addr != MAP_FAILED, + "mmap(%zu bytes) failed; error=%d", ps[i], errno); + + /* Advice that requires clipping. */ + largepage_madvise(addr, PAGE_SIZE, MADV_NORMAL, EINVAL); + largepage_madvise(addr, ps[i], MADV_NORMAL, 0); + largepage_madvise(addr, PAGE_SIZE, MADV_RANDOM, EINVAL); + largepage_madvise(addr, ps[i], MADV_RANDOM, 0); + largepage_madvise(addr, PAGE_SIZE, MADV_SEQUENTIAL, EINVAL); + largepage_madvise(addr, ps[i], MADV_SEQUENTIAL, 0); + largepage_madvise(addr, PAGE_SIZE, MADV_NOSYNC, EINVAL); + largepage_madvise(addr, ps[i], MADV_NOSYNC, 0); + largepage_madvise(addr, PAGE_SIZE, MADV_AUTOSYNC, EINVAL); + largepage_madvise(addr, ps[i], MADV_AUTOSYNC, 0); + largepage_madvise(addr, PAGE_SIZE, MADV_CORE, EINVAL); + largepage_madvise(addr, ps[i], MADV_CORE, 0); + largepage_madvise(addr, PAGE_SIZE, MADV_NOCORE, EINVAL); + largepage_madvise(addr, ps[i], MADV_NOCORE, 0); + + /* Advice that does not result in clipping. */ + largepage_madvise(addr, PAGE_SIZE, MADV_DONTNEED, 0); + largepage_madvise(addr, ps[i], MADV_DONTNEED, 0); + largepage_madvise(addr, PAGE_SIZE, MADV_WILLNEED, 0); + largepage_madvise(addr, ps[i], MADV_WILLNEED, 0); + largepage_madvise(addr, PAGE_SIZE, MADV_FREE, 0); + largepage_madvise(addr, ps[i], MADV_FREE, 0); + + ATF_REQUIRE(munmap(addr, ps[i]) == 0); + ATF_REQUIRE(close(fd) == 0); + } +} + +ATF_TC(largepage_mlock); +ATF_TC_HEAD(largepage_mlock, tc) +{ + /* Needed to set rlimit. */ + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(largepage_mlock, tc) +{ + struct rlimit rl; + char *addr; + size_t ps[MAXPAGESIZES], sz; + u_long max_wired, wired; + int fd, error, pscnt; + + rl.rlim_cur = rl.rlim_max = RLIM_INFINITY; + ATF_REQUIRE_MSG(setrlimit(RLIMIT_MEMLOCK, &rl) == 0, + "setrlimit failed; error=%d", errno); + + sz = sizeof(max_wired); + error = sysctlbyname("vm.max_user_wired", &max_wired, &sz, NULL, 0); + ATF_REQUIRE_MSG(error == 0, + "sysctlbyname(vm.max_user_wired) failed; error=%d", errno); + ATF_REQUIRE(max_wired >= 0); + + sz = sizeof(wired); + error = sysctlbyname("vm.stats.vm.v_user_wire_count", &wired, &sz, NULL, + 0); + ATF_REQUIRE_MSG(error == 0, + "sysctlbyname(vm.stats.vm.v_user_wire_count) failed; error=%d", + errno); + ATF_REQUIRE(wired >= 0); + + pscnt = pagesizes(ps); + for (int i = 1; i < pscnt; i++) { + if (ps[i] / PAGE_SIZE > max_wired - wired) { + /* Cannot wire past the limit. */ + atf_tc_skip("test would exceed wiring limit"); + } + + fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]); + addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd, + 0); + ATF_REQUIRE_MSG(addr != MAP_FAILED, + "mmap(%zu bytes) failed; error=%d", ps[i], errno); + + ATF_REQUIRE(mlock(addr, PAGE_SIZE) != 0); + ATF_REQUIRE_MSG(errno == EINVAL, + "unexpected error %d from mlock(%zu bytes)", errno, ps[i]); + ATF_REQUIRE(mlock(addr, ps[i] - PAGE_SIZE) != 0); + ATF_REQUIRE_MSG(errno == EINVAL, + "unexpected error %d from mlock(%zu bytes)", errno, ps[i]); + + ATF_REQUIRE_MSG(mlock(addr, ps[i]) == 0, + "mlock failed; error=%d", errno); + + ATF_REQUIRE(munmap(addr, ps[i]) == 0); + + ATF_REQUIRE(mlockall(MCL_FUTURE) == 0); + addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd, + 0); + ATF_REQUIRE_MSG(addr != MAP_FAILED, + "mmap(%zu bytes) failed; error=%d", ps[i], errno); + + ATF_REQUIRE(munmap(addr, ps[i]) == 0); + ATF_REQUIRE(close(fd) == 0); + } +} + +ATF_TC_WITHOUT_HEAD(largepage_msync); +ATF_TC_BODY(largepage_msync, tc) +{ + char *addr; + size_t ps[MAXPAGESIZES]; + int fd, pscnt; + + pscnt = pagesizes(ps); + for (int i = 1; i < pscnt; i++) { + fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]); + addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd, + 0); + ATF_REQUIRE_MSG(addr != MAP_FAILED, + "mmap(%zu bytes) failed; error=%d", ps[i], errno); + + memset(addr, 0, ps[i]); + + /* + * "Sync" requests are no-ops for SHM objects, so small + * PAGE_SIZE-sized requests succeed. + */ + ATF_REQUIRE_MSG(msync(addr, PAGE_SIZE, MS_ASYNC) == 0, + "msync(MS_ASYNC) failed; error=%d", errno); + ATF_REQUIRE_MSG(msync(addr, ps[i], MS_ASYNC) == 0, + "msync(MS_ASYNC) failed; error=%d", errno); + ATF_REQUIRE_MSG(msync(addr, PAGE_SIZE, MS_SYNC) == 0, + "msync(MS_SYNC) failed; error=%d", errno); + ATF_REQUIRE_MSG(msync(addr, ps[i], MS_SYNC) == 0, + "msync(MS_SYNC) failed; error=%d", errno); + + ATF_REQUIRE_MSG(msync(addr, PAGE_SIZE, MS_INVALIDATE) != 0, + "msync(MS_INVALIDATE) succeeded"); + /* XXX wrong errno */ + ATF_REQUIRE_MSG(errno == EBUSY, + "unexpected error %d from msync(MS_INVALIDATE)", errno); + ATF_REQUIRE_MSG(msync(addr, ps[i], MS_INVALIDATE) == 0, + "msync(MS_INVALIDATE) failed; error=%d", errno); + memset(addr, 0, ps[i]); + + ATF_REQUIRE(munmap(addr, ps[i]) == 0); + ATF_REQUIRE(close(fd) == 0); + } +} + +static void +largepage_protect(char *addr, size_t sz, int prot, int error) +{ + if (error == 0) { + ATF_REQUIRE_MSG(mprotect(addr, sz, prot) == 0, + "mprotect(%zu, %x) failed; error=%d", sz, prot, errno); + } else { + ATF_REQUIRE_MSG(mprotect(addr, sz, prot) != 0, + "mprotect(%zu, %x) succeeded", sz, prot); + ATF_REQUIRE_MSG(errno == error, + "unexpected error %d from mprotect(%zu, %x)", + errno, sz, prot); + } +} + +ATF_TC_WITHOUT_HEAD(largepage_mprotect); +ATF_TC_BODY(largepage_mprotect, tc) +{ + char *addr, *addr1; + size_t ps[MAXPAGESIZES]; + int fd, pscnt; + + pscnt = pagesizes(ps); + for (int i = 1; i < pscnt; i++) { + fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]); + addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd, + 0); + ATF_REQUIRE_MSG(addr != MAP_FAILED, + "mmap(%zu bytes) failed; error=%d", ps[i], errno); + + /* + * These should be no-ops from the pmap perspective since the + * page is not yet entered into the pmap. + */ + largepage_protect(addr, PAGE_SIZE, PROT_READ, EINVAL); + largepage_protect(addr, ps[i], PROT_READ, 0); + largepage_protect(addr, PAGE_SIZE, PROT_NONE, EINVAL); + largepage_protect(addr, ps[i], PROT_NONE, 0); + largepage_protect(addr, PAGE_SIZE, + PROT_READ | PROT_WRITE | PROT_EXEC, EINVAL); + largepage_protect(addr, ps[i], + PROT_READ | PROT_WRITE | PROT_EXEC, 0); + + /* Trigger creation of a mapping and try again. */ + *(volatile char *)addr = 0; + largepage_protect(addr, PAGE_SIZE, PROT_READ, EINVAL); + largepage_protect(addr, ps[i], PROT_READ, 0); + largepage_protect(addr, PAGE_SIZE, PROT_NONE, EINVAL); + largepage_protect(addr, ps[i], PROT_NONE, 0); + largepage_protect(addr, PAGE_SIZE, + PROT_READ | PROT_WRITE | PROT_EXEC, EINVAL); + largepage_protect(addr, ps[i], + PROT_READ | PROT_WRITE | PROT_EXEC, 0); + + memset(addr, 0, ps[i]); + + /* Map two contiguous large pages and merge map entries. */ + addr1 = mmap(addr + ps[i], ps[i], PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_FIXED | MAP_EXCL, fd, 0); + ATF_REQUIRE_MSG(addr1 != MAP_FAILED, + "mmap(%zu bytes) failed; error=%d", ps[i], errno); + + largepage_protect(addr1 - PAGE_SIZE, PAGE_SIZE * 2, + PROT_READ | PROT_WRITE, EINVAL); + largepage_protect(addr, ps[i] * 2, PROT_READ | PROT_WRITE, 0); + + memset(addr, 0, ps[i] * 2); + + ATF_REQUIRE(munmap(addr, ps[i]) == 0); + ATF_REQUIRE(munmap(addr1, ps[i]) == 0); + ATF_REQUIRE(close(fd) == 0); + } +} + +ATF_TC_WITHOUT_HEAD(largepage_minherit); +ATF_TC_BODY(largepage_minherit, tc) +{ + char *addr; + size_t ps[MAXPAGESIZES]; + pid_t child; + int fd, pscnt, status; + + pscnt = pagesizes(ps); + for (int i = 1; i < pscnt; i++) { + fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]); + addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd, + 0); + ATF_REQUIRE_MSG(addr != MAP_FAILED, + "mmap(%zu bytes) failed; error=%d", ps[i], errno); + + ATF_REQUIRE(minherit(addr, PAGE_SIZE, INHERIT_SHARE) != 0); + + ATF_REQUIRE_MSG(minherit(addr, ps[i], INHERIT_SHARE) == 0, + "minherit(%zu bytes) failed; error=%d", ps[i], errno); + child = fork(); + ATF_REQUIRE_MSG(child != -1, "fork failed; error=%d", errno); + if (child == 0) { + char v; + + *(volatile char *)addr = 0; + if (mincore(addr, PAGE_SIZE, &v) != 0) + _exit(1); + if ((v & MINCORE_PSIND(i)) == 0) + _exit(2); + _exit(0); + } + ATF_REQUIRE_MSG(waitpid(child, &status, 0) == child, + "waitpid failed; error=%d", errno); + ATF_REQUIRE_MSG(WIFEXITED(status), + "child was killed by signal %d", WTERMSIG(status)); + ATF_REQUIRE_MSG(WEXITSTATUS(status) == 0, + "child exited with status %d", WEXITSTATUS(status)); + + ATF_REQUIRE_MSG(minherit(addr, ps[i], INHERIT_NONE) == 0, + "minherit(%zu bytes) failed; error=%d", ps[i], errno); + child = fork(); + ATF_REQUIRE_MSG(child != -1, "fork failed; error=%d", errno); + if (child == 0) { + char v; + + if (mincore(addr, PAGE_SIZE, &v) == 0) + _exit(1); + _exit(0); + } + ATF_REQUIRE_MSG(waitpid(child, &status, 0) == child, + "waitpid failed; error=%d", errno); + ATF_REQUIRE_MSG(WIFEXITED(status), + "child was killed by signal %d", WTERMSIG(status)); + ATF_REQUIRE_MSG(WEXITSTATUS(status) == 0, + "child exited with status %d", WEXITSTATUS(status)); + + /* Copy-on-write is not supported for static large pages. */ + ATF_REQUIRE_MSG(minherit(addr, ps[i], INHERIT_COPY) != 0, + "minherit(%zu bytes) succeeded", ps[i]); + + ATF_REQUIRE_MSG(minherit(addr, ps[i], INHERIT_ZERO) == 0, + "minherit(%zu bytes) failed; error=%d", ps[i], errno); + child = fork(); + ATF_REQUIRE_MSG(child != -1, "fork failed; error=%d", errno); + if (child == 0) { + char v; + + *(volatile char *)addr = 0; + if (mincore(addr, PAGE_SIZE, &v) != 0) + _exit(1); + if ((v & MINCORE_SUPER) != 0) + _exit(2); + _exit(0); + } + ATF_REQUIRE_MSG(waitpid(child, &status, 0) == child, + "waitpid failed; error=%d", errno); + ATF_REQUIRE_MSG(WIFEXITED(status), + "child was killed by signal %d", WTERMSIG(status)); + ATF_REQUIRE_MSG(WEXITSTATUS(status) == 0, + "child exited with status %d", WEXITSTATUS(status)); + + ATF_REQUIRE(munmap(addr, ps[i]) == 0); + ATF_REQUIRE(close(fd) == 0); + } +} + +ATF_TC_WITHOUT_HEAD(largepage_pipe); +ATF_TC_BODY(largepage_pipe, tc) +{ + size_t ps[MAXPAGESIZES]; + char *addr; + ssize_t len; + int fd, pfd[2], pscnt, status; + pid_t child; + + pscnt = pagesizes(ps); + + for (int i = 1; i < pscnt; i++) { + fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]); + addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd, + 0); + ATF_REQUIRE_MSG(addr != MAP_FAILED, + "mmap(%zu bytes) failed; error=%d", ps[i], errno); + + /* Trigger creation of a mapping. */ + *(volatile char *)addr = '\0'; + + ATF_REQUIRE(pipe(pfd) == 0); + child = fork(); + ATF_REQUIRE_MSG(child != -1, "fork() failed; error=%d", errno); + if (child == 0) { + char buf[BUFSIZ]; + ssize_t resid; + + (void)close(pfd[0]); + for (resid = (size_t)ps[i]; resid > 0; resid -= len) { + len = read(pfd[1], buf, sizeof(buf)); + if (len < 0) + _exit(1); + } + _exit(0); + } + ATF_REQUIRE(close(pfd[1]) == 0); + len = write(pfd[0], addr, ps[i]); + ATF_REQUIRE_MSG(len >= 0, "write() failed; error=%d", errno); + ATF_REQUIRE_MSG(len == (ssize_t)ps[i], + "short write; len=%zd", len); + ATF_REQUIRE(close(pfd[0]) == 0); + + ATF_REQUIRE_MSG(waitpid(child, &status, 0) == child, + "waitpid() failed; error=%d", errno); + ATF_REQUIRE_MSG(WIFEXITED(status), + "child was killed by signal %d", WTERMSIG(status)); + ATF_REQUIRE_MSG(WEXITSTATUS(status) == 0, + "child exited with status %d", WEXITSTATUS(status)); + + ATF_REQUIRE(munmap(addr, ps[i]) == 0); + ATF_REQUIRE(close(fd) == 0); + } +} + +ATF_TC_WITHOUT_HEAD(largepage_reopen); +ATF_TC_BODY(largepage_reopen, tc) +{ + char *addr, *vec; + size_t ps[MAXPAGESIZES]; + int fd, psind; + + (void)pagesizes(ps); + psind = 1; + + gen_test_path(); + fd = shm_create_largepage(test_path, O_CREAT | O_RDWR, psind, + SHM_LARGEPAGE_ALLOC_DEFAULT, 0600); + if (fd < 0 && errno == ENOTTY) + atf_tc_skip("no large page support"); + ATF_REQUIRE_MSG(fd >= 0, "shm_create_largepage failed; error=%d", errno); + + ATF_REQUIRE_MSG(ftruncate(fd, ps[psind]) == 0, + "ftruncate failed; error=%d", errno); + + ATF_REQUIRE_MSG(close(fd) == 0, "close failed; error=%d", errno); + + fd = shm_open(test_path, O_RDWR, 0); + ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; error=%d", errno); + + addr = mmap(NULL, ps[psind], PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + ATF_REQUIRE_MSG(addr != MAP_FAILED, "mmap failed; error=%d", errno); + + /* Trigger a fault and mapping creation. */ + *(volatile char *)addr = 0; + + vec = malloc(ps[psind] / PAGE_SIZE); + ATF_REQUIRE(vec != NULL); + ATF_REQUIRE_MSG(mincore(addr, ps[psind], vec) == 0, + "mincore failed; error=%d", errno); + ATF_REQUIRE_MSG((vec[0] & MINCORE_PSIND(psind)) != 0, + "page not mapped into a %zu-byte superpage", ps[psind]); + + ATF_REQUIRE_MSG(shm_unlink(test_path) == 0, + "shm_unlink failed; errno=%d", errno); + ATF_REQUIRE_MSG(close(fd) == 0, + "close failed; errno=%d", errno); +} + ATF_TP_ADD_TCS(tp) { @@ -990,6 +1706,17 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, cloexec); ATF_TP_ADD_TC(tp, mode); ATF_TP_ADD_TC(tp, fallocate); + ATF_TP_ADD_TC(tp, largepage_basic); + ATF_TP_ADD_TC(tp, largepage_config); + ATF_TP_ADD_TC(tp, largepage_mmap); + ATF_TP_ADD_TC(tp, largepage_munmap); + ATF_TP_ADD_TC(tp, largepage_madvise); + ATF_TP_ADD_TC(tp, largepage_mlock); + ATF_TP_ADD_TC(tp, largepage_msync); + ATF_TP_ADD_TC(tp, largepage_mprotect); + ATF_TP_ADD_TC(tp, largepage_minherit); + ATF_TP_ADD_TC(tp, largepage_pipe); + ATF_TP_ADD_TC(tp, largepage_reopen); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Thu Sep 17 16:49:29 2020 Return-Path: Delivered-To: svn-src-all@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 8C1713E6E0A; Thu, 17 Sep 2020 16:49:29 +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 4Bsjc93Gvcz4HN4; Thu, 17 Sep 2020 16:49:29 +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 54F19D39F; Thu, 17 Sep 2020 16:49:29 +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 08HGnTCS041842; Thu, 17 Sep 2020 16:49:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HGnTJN041841; Thu, 17 Sep 2020 16:49:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009171649.08HGnTJN041841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 17 Sep 2020 16:49:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365841 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 365841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 16:49:29 -0000 Author: markj Date: Thu Sep 17 16:49:28 2020 New Revision: 365841 URL: https://svnweb.freebsd.org/changeset/base/365841 Log: Increase the default vm.max_user_wired value. Since r347532 (merged to stable/12) we only count user-wired pages towards the system limit. However, we now also treat pages wired by hypervisors (bhyve and virtualbox) as user-wired, so starting VMs with large amounts of RAM tends to fail due to the low limit. The purpose of the limit is to provide a seatbelt, not to impose some policy on the use of wired memory. Thus, increase the default limit to allow reasonable VM configurations to work without tuning. Reviewed by: kib Discussed with: dougm MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26424 Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Thu Sep 17 16:44:12 2020 (r365840) +++ head/sys/vm/vm_pageout.c Thu Sep 17 16:49:28 2020 (r365841) @@ -2295,7 +2295,7 @@ vm_pageout_init_domain(int domain) static void vm_pageout_init(void) { - u_int freecount; + u_long freecount; int i; /* @@ -2328,8 +2328,13 @@ vm_pageout_init(void) if (vm_pageout_update_period == 0) vm_pageout_update_period = 600; + /* + * Set the maximum number of user-wired virtual pages. Historically the + * main source of such pages was mlock(2) and mlockall(2). Hypervisors + * may also request user-wired memory. + */ if (vm_page_max_user_wired == 0) - vm_page_max_user_wired = freecount / 3; + vm_page_max_user_wired = 4 * freecount / 5; } /* From owner-svn-src-all@freebsd.org Thu Sep 17 17:05:22 2020 Return-Path: Delivered-To: svn-src-all@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 22B033E6CC8; Thu, 17 Sep 2020 17:05:22 +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 4BsjyS66k3z4J4L; Thu, 17 Sep 2020 17:05:20 +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 08HH5CST014645; Thu, 17 Sep 2020 10:05:12 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 08HH5CtE014644; Thu, 17 Sep 2020 10:05:12 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202009171705.08HH5CtE014644@gndrsh.dnsmgr.net> Subject: Re: svn commit: r365836 - head/share/mk In-Reply-To: To: Warner Losh Date: Thu, 17 Sep 2020 10:05:12 -0700 (PDT) CC: Alex Richardson , src-committers , svn-src-all , svn-src-head 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: 4BsjyS66k3z4J4L X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [1.07 / 15.00]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_SPAM_MEDIUM(0.13)[0.130]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.23)[-0.227]; NEURAL_SPAM_LONG(0.26)[0.264]; RCVD_TLS_LAST(0.00)[]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 17:05:22 -0000 > On Thu, Sep 17, 2020 at 9:39 AM Steffen Nurpmeso wrote: > > > Alex Richardson wrote in > > <202009171507.08HF7Qns080555@repo.freebsd.org>: > > |Author: arichardson > > |Date: Thu Sep 17 15:07:25 2020 > > |New Revision: 365836 > > |URL: https://svnweb.freebsd.org/changeset/base/365836 > > | > > |Log: > > | Stop using lorder and ranlib when building libraries > > | > > | Use of ranlib or lorder is no longer necessary with current linkers > > | (probably anything newer than ~1990) and ar's ability to create an > > object > > | index and symbol table in the archive. > > | Currently the build system uses lorder+tsort to sort the .o files in > > | dependency order so that a single-pass linker can use them. However, > > | we can use the -s flag to ar to add an index to the .a file which makes > > | lorder unnecessary. > > | Running ar -s is equivalent to running ranlib afterwards, so we can > > also > > | skip the ranlib invocation. > > > > That ranlib thing yes (for long indeed), but i have vague memories > > that the tsort/lorder ordering was also meant to keep the things > > which heavily interdepend nearby each other. (Luckily Linux > > always had at least tsort available.) > > This no longer matters for all the platforms FreeBSD supports? > > > > tsort has no notion of how dependent the modules are, just an order that > allows a single pass through the .a file (otherwise you'd need to list the > .a file multiple times on the command line absent ranlib). That's the > original purpose of tsort. tsort, lsort, and ranlib all arrived in 7th > edition unix on a PDP-11, where size was more important than proximity to > locations (modulo overlays, which this doesn't affect at all). > > There were some issues of long vs short jumps on earlier architectures that > this helped (since you could only jump 16MB, for example). However, there > were workarounds for this issue on those platforms too. And if you have a > program that this does make a difference, then you can still use > tsort/lorder. They are still in the system. > > I doubt you could measure a difference here today. I doubt, honestly, that > anybody will notice at all. The x86 archicture has relative jmps of differning lengths, even in long mode there is support for rel8 and rel32. > > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Sep 17 17:07:05 2020 Return-Path: Delivered-To: svn-src-all@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 5ADCE3E746C; Thu, 17 Sep 2020 17:07:05 +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 4Bsk0T1MLKz4JFN; Thu, 17 Sep 2020 17:07:05 +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 120C0D6D0; Thu, 17 Sep 2020 17:07:05 +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 08HH74e9053825; Thu, 17 Sep 2020 17:07:04 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HH746v053824; Thu, 17 Sep 2020 17:07:04 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009171707.08HH746v053824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 17 Sep 2020 17:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365842 - head/usr.sbin/bhyvectl X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/bhyvectl X-SVN-Commit-Revision: 365842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 17:07:05 -0000 Author: jhb Date: Thu Sep 17 17:07:04 2020 New Revision: 365842 URL: https://svnweb.freebsd.org/changeset/base/365842 Log: Remove support for setting some obscure fields. Don't permit setting the exception bitmap or VMCS entry interrupt information. These are not generally useful to set. If it is needed in the future, dedicated pseudo registers can be added for these that would be used with vm_set_register(). Discussed with: grehan MFC after: 1 week Modified: head/usr.sbin/bhyvectl/bhyvectl.c Modified: head/usr.sbin/bhyvectl/bhyvectl.c ============================================================================== --- head/usr.sbin/bhyvectl/bhyvectl.c Thu Sep 17 16:49:28 2020 (r365841) +++ head/usr.sbin/bhyvectl/bhyvectl.c Thu Sep 17 17:07:04 2020 (r365842) @@ -313,11 +313,11 @@ static int get_vmcb_virq, get_avic_table; */ static int get_pinbased_ctls, get_procbased_ctls, get_procbased_ctls2; static int get_eptp, get_io_bitmap, get_tsc_offset; -static int get_vmcs_entry_interruption_info, set_vmcs_entry_interruption_info; +static int get_vmcs_entry_interruption_info; static int get_vmcs_interruptibility; uint32_t vmcs_entry_interruption_info; static int get_vmcs_gpa, get_vmcs_gla; -static int get_exception_bitmap, set_exception_bitmap, exception_bitmap; +static int get_exception_bitmap, exception_bitmap; static int get_cr0_mask, get_cr0_shadow; static int get_cr4_mask, get_cr4_shadow; static int get_cr3_targets; @@ -542,13 +542,6 @@ vm_get_vmcs_field(struct vmctx *ctx, int vcpu, int fie } static int -vm_set_vmcs_field(struct vmctx *ctx, int vcpu, int field, uint64_t val) -{ - - return (vm_set_register(ctx, vcpu, VMCS_IDENT(field), val)); -} - -static int vm_get_vmcb_field(struct vmctx *ctx, int vcpu, int off, int bytes, uint64_t *ret_val) { @@ -556,14 +549,6 @@ vm_get_vmcb_field(struct vmctx *ctx, int vcpu, int off return (vm_get_register(ctx, vcpu, VMCB_ACCESS(off, bytes), ret_val)); } -static int -vm_set_vmcb_field(struct vmctx *ctx, int vcpu, int off, int bytes, - uint64_t val) -{ - - return (vm_set_register(ctx, vcpu, VMCB_ACCESS(off, bytes), val)); -} - enum { VMNAME = 1000, /* avoid collision with return values from getopt */ VCPU, @@ -595,8 +580,6 @@ enum { SET_TR, SET_LDTR, SET_X2APIC_STATE, - SET_EXCEPTION_BITMAP, - SET_VMCS_ENTRY_INTERRUPTION_INFO, SET_CAP, CAPNAME, UNASSIGN_PPTDEV, @@ -1379,8 +1362,6 @@ setup_options(bool cpu_intel) { "set-tr", REQ_ARG, 0, SET_TR }, { "set-ldtr", REQ_ARG, 0, SET_LDTR }, { "set-x2apic-state",REQ_ARG, 0, SET_X2APIC_STATE }, - { "set-exception-bitmap", - REQ_ARG, 0, SET_EXCEPTION_BITMAP }, { "capname", REQ_ARG, 0, CAPNAME }, { "unassign-pptdev", REQ_ARG, 0, UNASSIGN_PPTDEV }, { "setcap", REQ_ARG, 0, SET_CAP }, @@ -1514,8 +1495,6 @@ setup_options(bool cpu_intel) { "get-vmcs-host-pat", NO_ARG, &get_host_pat, 1 }, { "get-vmcs-host-cr0", NO_ARG, &get_host_cr0, 1 }, - { "set-vmcs-entry-interruption-info", - REQ_ARG, 0, SET_VMCS_ENTRY_INTERRUPTION_INFO }, { "get-vmcs-exit-qualification", NO_ARG, &get_vmcs_exit_qualification, 1 }, { "get-vmcs-exit-inst-length", @@ -1923,14 +1902,6 @@ main(int argc, char *argv[]) x2apic_state = strtol(optarg, NULL, 0); set_x2apic_state = 1; break; - case SET_EXCEPTION_BITMAP: - exception_bitmap = strtoul(optarg, NULL, 0); - set_exception_bitmap = 1; - break; - case SET_VMCS_ENTRY_INTERRUPTION_INFO: - vmcs_entry_interruption_info = strtoul(optarg, NULL, 0); - set_vmcs_entry_interruption_info = 1; - break; case SET_CAP: capval = strtoul(optarg, NULL, 0); setcap = 1; @@ -2123,22 +2094,6 @@ main(int argc, char *argv[]) if (!error && unassign_pptdev) error = vm_unassign_pptdev(ctx, bus, slot, func); - - if (!error && set_exception_bitmap) { - if (cpu_intel) - error = vm_set_vmcs_field(ctx, vcpu, - VMCS_EXCEPTION_BITMAP, - exception_bitmap); - else - error = vm_set_vmcb_field(ctx, vcpu, - VMCB_OFF_EXC_INTERCEPT, - 4, exception_bitmap); - } - - if (!error && cpu_intel && set_vmcs_entry_interruption_info) { - error = vm_set_vmcs_field(ctx, vcpu, VMCS_ENTRY_INTR_INFO, - vmcs_entry_interruption_info); - } if (!error && inject_nmi) { error = vm_inject_nmi(ctx, vcpu); From owner-svn-src-all@freebsd.org Thu Sep 17 17:22:53 2020 Return-Path: Delivered-To: svn-src-all@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 CC6D53E7CA8; Thu, 17 Sep 2020 17:22:53 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) (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 4BskLh6ZQRz4KJX; Thu, 17 Sep 2020 17:22:52 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ed1-f67.google.com with SMTP id t16so3322510edw.7; Thu, 17 Sep 2020 10:22:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oqmHcwFMfE5oJmjSM5qZV9QrkugUQ1fKiy/gBgEYeXQ=; b=UuQhzrdARKhynNImVwV/DxU6aX7OnB7JCQiV29rzrtsFQ46MDv23j6yG7Yg7ksYuT1 2KDD6gcjEzenscH3VN4GTde//wPEnFN/Mij0YY0uLMxbrGwPMJf0H8ior0scViBTncsM m1w2ji+F1AsPy6MIQnDKCFaAwXm8tfkod2XNMSMHJkp0josMhuJ0b78tTypZeEja4saP QxQwpT4sa+0SrlzqZr+v/MbCv1A8mxSdpN38zaMusK8NPdPT42APmsDRM69JuUJPXZfZ bF8Rhg5n7tuECsm2lWR0LuCot/Z5Sea+sgS+F5ktEUUVhJ9tfeVIIc2TqfWETXJR6yrm UqTQ== X-Gm-Message-State: AOAM530ZItu+9sRY2vN1EPR7TAsIObD0dWqIBFs/7ynr/NazDnw13hBK UNkMxzWZIUX+J9xK3mvxxAJuoRU+bOTMTT/Y X-Google-Smtp-Source: ABdhPJy9tR/OSh3STOC+SjJMmerNtn+hUxm2rEpE60DLxD133K/sB1DE3P6rGmojkJLMiFqoJ/q0VQ== X-Received: by 2002:a50:b946:: with SMTP id m64mr34941912ede.92.1600363371248; Thu, 17 Sep 2020 10:22:51 -0700 (PDT) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com. [209.85.128.46]) by smtp.gmail.com with ESMTPSA id c11sm227485edu.44.2020.09.17.10.22.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Sep 2020 10:22:51 -0700 (PDT) Received: by mail-wm1-f46.google.com with SMTP id l15so4889214wmh.1; Thu, 17 Sep 2020 10:22:50 -0700 (PDT) X-Received: by 2002:a1c:2501:: with SMTP id l1mr12075780wml.16.1600363370417; Thu, 17 Sep 2020 10:22:50 -0700 (PDT) MIME-Version: 1.0 References: <202009171705.08HH5CtE014644@gndrsh.dnsmgr.net> In-Reply-To: <202009171705.08HH5CtE014644@gndrsh.dnsmgr.net> From: Alexander Richardson Date: Thu, 17 Sep 2020 18:22:39 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r365836 - head/share/mk To: rgrimes@freebsd.org Cc: Warner Losh , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BskLh6ZQRz4KJX X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 17:22:53 -0000 On Thu, 17 Sep 2020 at 18:05, Rodney W. Grimes wrote: > > > On Thu, Sep 17, 2020 at 9:39 AM Steffen Nurpmeso wrote: > > > > > Alex Richardson wrote in > > > <202009171507.08HF7Qns080555@repo.freebsd.org>: > > > |Author: arichardson > > > |Date: Thu Sep 17 15:07:25 2020 > > > |New Revision: 365836 > > > |URL: https://svnweb.freebsd.org/changeset/base/365836 > > > | > > > |Log: > > > | Stop using lorder and ranlib when building libraries > > > | > > > | Use of ranlib or lorder is no longer necessary with current linkers > > > | (probably anything newer than ~1990) and ar's ability to create an > > > object > > > | index and symbol table in the archive. > > > | Currently the build system uses lorder+tsort to sort the .o files in > > > | dependency order so that a single-pass linker can use them. However, > > > | we can use the -s flag to ar to add an index to the .a file which makes > > > | lorder unnecessary. > > > | Running ar -s is equivalent to running ranlib afterwards, so we can > > > also > > > | skip the ranlib invocation. > > > > > > That ranlib thing yes (for long indeed), but i have vague memories > > > that the tsort/lorder ordering was also meant to keep the things > > > which heavily interdepend nearby each other. (Luckily Linux > > > always had at least tsort available.) > > > This no longer matters for all the platforms FreeBSD supports? > > > > > > > tsort has no notion of how dependent the modules are, just an order that > > allows a single pass through the .a file (otherwise you'd need to list the > > .a file multiple times on the command line absent ranlib). That's the > > original purpose of tsort. tsort, lsort, and ranlib all arrived in 7th > > edition unix on a PDP-11, where size was more important than proximity to > > locations (modulo overlays, which this doesn't affect at all). > > > > There were some issues of long vs short jumps on earlier architectures that > > this helped (since you could only jump 16MB, for example). However, there > > were workarounds for this issue on those platforms too. And if you have a > > program that this does make a difference, then you can still use > > tsort/lorder. They are still in the system. > > > > I doubt you could measure a difference here today. I doubt, honestly, that > > anybody will notice at all. > > The x86 archicture has relative jmps of differning lengths, even in long mode > there is support for rel8 and rel32. However, unless you have linker relaxations (e.g. RISC-V) the compiler has to emit the large size anyway since the linker won't replace a 32-bit immediate with an 8-bit one since that changes all later offsets. Alex From owner-svn-src-all@freebsd.org Thu Sep 17 17:23:25 2020 Return-Path: Delivered-To: svn-src-all@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 358003E78CC for ; Thu, 17 Sep 2020 17:23:25 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) (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 4BskMJ1m3Rz4KBC for ; Thu, 17 Sep 2020 17:23:24 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f67.google.com with SMTP id x23so2716802wmi.3 for ; Thu, 17 Sep 2020 10:23:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=3PWYTVJJSdNpmjQGYxz4UMp794RYX2/VWbhMyqopfc4=; b=sZcmqbrMG5DkstBNehwj0M/6AOO07oGd9X4EeFWPLTHdg5cbXqfqPOhSaYKreLJtA/ 3k0mXRovcOnC0lKz0YsIxRo6qRNz3ZMkEQ4Lf+zM25JRflOm0EeWWr45MtabViEi3DxL BSDUpEsd07gwe5VYqhv66NjaKhaOObZxlKHyVmFOvGv9AX9/3blGRUXEDLHXUVHspyS1 HebMhlM92KAMZ07Ic8xodCWuHLMKV8tUj88q9c9BM3fHoWEkM8PukWa9OwKUBSA8K0wi Tku082DVgF0W4uAsoS4vJD28RkIaqKQ1WGeorPrCnZnfSi6eW9EbhbGKpLWoYRnRY8lt iOsA== X-Gm-Message-State: AOAM531uZ2zuiS7uZQF4jOX3gbGL4pxv41ZOhtUeOVLxxdmnya+t7mGc 0oT/8h3s4E6nRBlDC9/tOrcsoR1dQr2Exg== X-Google-Smtp-Source: ABdhPJypzssLqdgJ3uMnVan0RJVGDR9fdP7C9SsdO3FqmFvq6jZY40Di8Dyh3/IkHw1pnOJtpssofw== X-Received: by 2002:a1c:2903:: with SMTP id p3mr11506063wmp.170.1600363402651; Thu, 17 Sep 2020 10:23:22 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id f23sm16328618wmc.3.2020.09.17.10.23.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2020 10:23:21 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: svn commit: r365836 - head/share/mk From: Jessica Clarke In-Reply-To: <202009171705.08HH5CtE014644@gndrsh.dnsmgr.net> Date: Thu, 17 Sep 2020 18:23:19 +0100 Cc: Warner Losh , Alex Richardson , src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: References: <202009171705.08HH5CtE014644@gndrsh.dnsmgr.net> To: rgrimes@freebsd.org X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4BskMJ1m3Rz4KBC X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.67 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-1.77 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.27)[-0.274]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.96)[-0.958]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.04)[-1.038]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.67:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.67:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 17:23:25 -0000 > On 17 Sep 2020, at 18:05, Rodney W. Grimes = wrote: >=20 >> On Thu, Sep 17, 2020 at 9:39 AM Steffen Nurpmeso = wrote: >>=20 >>> Alex Richardson wrote in >>> <202009171507.08HF7Qns080555@repo.freebsd.org>: >>> |Author: arichardson >>> |Date: Thu Sep 17 15:07:25 2020 >>> |New Revision: 365836 >>> |URL: https://svnweb.freebsd.org/changeset/base/365836 >>> | >>> |Log: >>> | Stop using lorder and ranlib when building libraries >>> | >>> | Use of ranlib or lorder is no longer necessary with current = linkers >>> | (probably anything newer than ~1990) and ar's ability to create = an >>> object >>> | index and symbol table in the archive. >>> | Currently the build system uses lorder+tsort to sort the .o files = in >>> | dependency order so that a single-pass linker can use them. = However, >>> | we can use the -s flag to ar to add an index to the .a file which = makes >>> | lorder unnecessary. >>> | Running ar -s is equivalent to running ranlib afterwards, so we = can >>> also >>> | skip the ranlib invocation. >>>=20 >>> That ranlib thing yes (for long indeed), but i have vague memories >>> that the tsort/lorder ordering was also meant to keep the things >>> which heavily interdepend nearby each other. (Luckily Linux >>> always had at least tsort available.) >>> This no longer matters for all the platforms FreeBSD supports? >>>=20 >>=20 >> tsort has no notion of how dependent the modules are, just an order = that >> allows a single pass through the .a file (otherwise you'd need to = list the >> .a file multiple times on the command line absent ranlib). That's the >> original purpose of tsort. tsort, lsort, and ranlib all arrived in = 7th >> edition unix on a PDP-11, where size was more important than = proximity to >> locations (modulo overlays, which this doesn't affect at all). >>=20 >> There were some issues of long vs short jumps on earlier = architectures that >> this helped (since you could only jump 16MB, for example). However, = there >> were workarounds for this issue on those platforms too. And if you = have a >> program that this does make a difference, then you can still use >> tsort/lorder. They are still in the system. >>=20 >> I doubt you could measure a difference here today. I doubt, honestly, = that >> anybody will notice at all. >=20 > The x86 archicture has relative jmps of differning lengths, even in = long mode > there is support for rel8 and rel32. That's irrelevant though for several reasons: 1. The compiler has already decided on what jump instructions to use = based on the requested code model (unless you're on RISC-V and using GNU bfd = ld as that supports linker relaxations that actually delete instruction = bytes). 2. The linker is still free to reorder input sections however it likes, = it doesn't have to follow the order of the input files (and the files = within any archive). 3. If you care about those kinds of optimisations you should use = link-time optimisation which will likely do far more useful things than just = optimise branches, but again isn't constrained by the order of the input = files, it can lay out the code exactly how it wants. Not to mention that this is just a topological sort, not a clustering = sort. Jess From owner-svn-src-all@freebsd.org Thu Sep 17 17:25:58 2020 Return-Path: Delivered-To: svn-src-all@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 D172C3E7F10 for ; Thu, 17 Sep 2020 17:25:58 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 4BskQF5v5Yz4KlG for ; Thu, 17 Sep 2020 17:25:57 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f48.google.com with SMTP id k18so2851630wmj.5 for ; Thu, 17 Sep 2020 10:25:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=opux/o8U6Vm/T6AdMEBFhu/RZw/mcvm17dTHNLgYL10=; b=XBB4TW9U8h5TvC2tYbBe6RXtkpDuPtxgrL5H1z+7HgMfbM5t7DbSl1Pewl7pG+VV+E 4wHmQJDaYhM+Ouy+soovwpfTnpRPL/t8FyOzRZ1uZ4abIWhROeTx8Ftff7ODm1u8/og4 FyHyPqs6AKBV8dLddYfp/mJ/iqZTyHYJztT6j/10DSX3OtwTzqWvswG5fu6pVJEKk7fX bAZPMFMfkjPe7CAMcrBmhl/fyRahGOpTSGdtyyCxWyZ/vg/E7LACxaX1TMcypBjve/qs b3DyXc304PkVcDI14LPFSBWmV9I4R8tgmdRG+F5s79qE8RvfC7+gRWs0Y0nzVECHjoOg O8Bg== X-Gm-Message-State: AOAM533DPJRX7Y+ID8SPpTHDy/WnHzrjEJ2IgviWkO5Vbt9cc0sdJdL7 tO/whRflqr6uUE+1juzeulzEjQ== X-Google-Smtp-Source: ABdhPJwPB3PtzDR3lhcSa0wAZX4UVppGZv8pR0e4/QHKJCL4hQ7+ngR5z/PKT43GjaF8GD4t3H12cw== X-Received: by 2002:a05:600c:4108:: with SMTP id j8mr9645370wmi.116.1600363556377; Thu, 17 Sep 2020 10:25:56 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id u17sm260826wmm.4.2020.09.17.10.25.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2020 10:25:55 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: svn commit: r365836 - head/share/mk From: Jessica Clarke In-Reply-To: Date: Thu, 17 Sep 2020 18:25:55 +0100 Cc: Warner Losh , Alex Richardson , src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: <307760E0-1208-4F4C-AD7D-9E0A3C1B3A3B@freebsd.org> References: <202009171705.08HH5CtE014644@gndrsh.dnsmgr.net> To: rgrimes@freebsd.org X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4BskQF5v5Yz4KlG X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.48 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-1.77 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.27)[-0.270]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.96)[-0.958]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.04)[-1.039]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.48:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.48:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 17:25:58 -0000 > On 17 Sep 2020, at 18:23, Jessica Clarke wrote: >=20 >> On 17 Sep 2020, at 18:05, Rodney W. Grimes = wrote: >>=20 >>> On Thu, Sep 17, 2020 at 9:39 AM Steffen Nurpmeso = wrote: >>>=20 >>>> Alex Richardson wrote in >>>> <202009171507.08HF7Qns080555@repo.freebsd.org>: >>>> |Author: arichardson >>>> |Date: Thu Sep 17 15:07:25 2020 >>>> |New Revision: 365836 >>>> |URL: https://svnweb.freebsd.org/changeset/base/365836 >>>> | >>>> |Log: >>>> | Stop using lorder and ranlib when building libraries >>>> | >>>> | Use of ranlib or lorder is no longer necessary with current = linkers >>>> | (probably anything newer than ~1990) and ar's ability to create = an >>>> object >>>> | index and symbol table in the archive. >>>> | Currently the build system uses lorder+tsort to sort the .o = files in >>>> | dependency order so that a single-pass linker can use them. = However, >>>> | we can use the -s flag to ar to add an index to the .a file = which makes >>>> | lorder unnecessary. >>>> | Running ar -s is equivalent to running ranlib afterwards, so we = can >>>> also >>>> | skip the ranlib invocation. >>>>=20 >>>> That ranlib thing yes (for long indeed), but i have vague memories >>>> that the tsort/lorder ordering was also meant to keep the things >>>> which heavily interdepend nearby each other. (Luckily Linux >>>> always had at least tsort available.) >>>> This no longer matters for all the platforms FreeBSD supports? >>>>=20 >>>=20 >>> tsort has no notion of how dependent the modules are, just an order = that >>> allows a single pass through the .a file (otherwise you'd need to = list the >>> .a file multiple times on the command line absent ranlib). That's = the >>> original purpose of tsort. tsort, lsort, and ranlib all arrived in = 7th >>> edition unix on a PDP-11, where size was more important than = proximity to >>> locations (modulo overlays, which this doesn't affect at all). >>>=20 >>> There were some issues of long vs short jumps on earlier = architectures that >>> this helped (since you could only jump 16MB, for example). However, = there >>> were workarounds for this issue on those platforms too. And if you = have a >>> program that this does make a difference, then you can still use >>> tsort/lorder. They are still in the system. >>>=20 >>> I doubt you could measure a difference here today. I doubt, = honestly, that >>> anybody will notice at all. >>=20 >> The x86 archicture has relative jmps of differning lengths, even in = long mode >> there is support for rel8 and rel32. >=20 > That's irrelevant though for several reasons: >=20 > 1. The compiler has already decided on what jump instructions to use = based on > the requested code model (unless you're on RISC-V and using GNU bfd = ld as > that supports linker relaxations that actually delete instruction = bytes). >=20 > 2. The linker is still free to reorder input sections however it = likes, it > doesn't have to follow the order of the input files (and the files = within > any archive). Hm actually that's only true for archives; it needs to respect the order = of files on the command line for things like crti.o to work. But = regardless, the other points (and this one, partially) still hold. > 3. If you care about those kinds of optimisations you should use = link-time > optimisation which will likely do far more useful things than just = optimise > branches, but again isn't constrained by the order of the input = files, it > can lay out the code exactly how it wants. >=20 > Not to mention that this is just a topological sort, not a clustering = sort. >=20 > Jess From owner-svn-src-all@freebsd.org Thu Sep 17 17:29:34 2020 Return-Path: Delivered-To: svn-src-all@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 AC5C53E7F33; Thu, 17 Sep 2020 17:29: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 4BskVQ49Mhz4Kjg; Thu, 17 Sep 2020 17:29: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 6E214DB1C; Thu, 17 Sep 2020 17:29: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 08HHTYEF066184; Thu, 17 Sep 2020 17:29:34 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HHTYlU066183; Thu, 17 Sep 2020 17:29:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009171729.08HHTYlU066183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 17 Sep 2020 17:29:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365843 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 17:29:34 -0000 Author: imp Date: Thu Sep 17 17:29:33 2020 New Revision: 365843 URL: https://svnweb.freebsd.org/changeset/base/365843 Log: Move to a more robust and conservative alloation scheme for devctl messages Change the zone setup: - Allow slabs to be returned to the OS - Set the number of slots to the max devctl will queue before discarding - Reserve 2% of the max (capped at 100) for low memory allocations - Disable per-cpu caching since we don't need it and we avoid some pathologies Change the alloation strategiy a bit: - If a normal allocation fails, try to get the reserve - If a reserve allocation fails, re-use the oldest-queued entry for storage - If there's a weird race/failure and nothing on the queue to steal, return NULL This addresses two main issues in the old code: - If devd had died, and we're generating a lot of messages, we have an unbounded leak. This new scheme avoids the issue that lead to this. - The MPASS that was 'sure' the allocation couldn't have failed turned out to be wrong in some rare cases. The new code doesn't make this assumption. Since we reserve only 2% of the space, we go from about 1MB of allocation all the time to more like 50kB for the reserve. Reviewed by: markj@ Differential Revision: https://reviews.freebsd.org/D26448 Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Thu Sep 17 17:07:04 2020 (r365842) +++ head/sys/kern/subr_bus.c Thu Sep 17 17:29:33 2020 (r365843) @@ -426,6 +426,9 @@ static struct cdev *devctl_dev; static void devinit(void) { + int reserve; + uma_zone_t z; + devctl_dev = make_dev_credf(MAKEDEV_ETERNAL, &dev_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0600, "devctl"); mtx_init(&devsoftc.mtx, "dev mtx", "devd", MTX_DEF); @@ -433,9 +436,21 @@ devinit(void) STAILQ_INIT(&devsoftc.devq); knlist_init_mtx(&devsoftc.sel.si_note, &devsoftc.mtx); if (devctl_queue_length > 0) { - devsoftc.zone = uma_zcreate("DEVCTL", sizeof(struct dev_event_info), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); - uma_prealloc(devsoftc.zone, devctl_queue_length); + /* + * Allocate a zone for the messages. Preallocate 2% of these for + * a reserve. Allow only devctl_queue_length slabs to cap memory + * usage. The reserve usually allows coverage of surges of + * events during memory shortages. Normally we won't have to + * re-use events from the queue, but will in extreme shortages. + */ + z = devsoftc.zone = uma_zcreate("DEVCTL", + sizeof(struct dev_event_info), NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, 0); + reserve = max(devctl_queue_length / 50, 100); /* 2% reserve */ + uma_zone_set_max(z, devctl_queue_length); + uma_zone_set_maxcache(z, 0); + uma_zone_reserve(z, reserve); + uma_prealloc(z, reserve); } devctl2_init(); } @@ -598,15 +613,25 @@ devctl_alloc_dei(void) mtx_lock(&devsoftc.mtx); if (devctl_queue_length == 0) goto out; - if (devctl_queue_length == devsoftc.queued) { + dei = uma_zalloc(devsoftc.zone, M_NOWAIT); + if (dei == NULL) + dei = uma_zalloc(devsoftc.zone, M_NOWAIT | M_USE_RESERVE); + if (dei == NULL) { + /* + * Guard against no items in the queue. Normally, this won't + * happen, but if lots of events happen all at once and there's + * a chance we're out of allocated space but none have yet been + * queued when we get here, leaving nothing to steal. This can + * also happen with error injection. Fail safe by returning + * NULL in that case.. + */ + if (devsoftc.queued == 0) + goto out; dei = STAILQ_FIRST(&devsoftc.devq); STAILQ_REMOVE_HEAD(&devsoftc.devq, dei_link); devsoftc.queued--; - } else { - /* dei can't be NULL -- we know we have at least one in the zone */ - dei = uma_zalloc(devsoftc.zone, M_NOWAIT); - MPASS(dei != NULL); } + MPASS(dei != NULL); *dei->dei_data = '\0'; out: mtx_unlock(&devsoftc.mtx); From owner-svn-src-all@freebsd.org Thu Sep 17 17:49:27 2020 Return-Path: Delivered-To: svn-src-all@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 7573D3E8493; Thu, 17 Sep 2020 17:49:27 +0000 (UTC) (envelope-from olivier@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 4BskxM2W5Nz4M34; Thu, 17 Sep 2020 17:49:27 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (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: olivier/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 340B027908; Thu, 17 Sep 2020 17:49:27 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: by mail-qt1-f175.google.com with SMTP id c18so2592261qtw.5; Thu, 17 Sep 2020 10:49:27 -0700 (PDT) X-Gm-Message-State: AOAM531etO6xZsbLzio/me4A8T2MlPlPxbkFKC1ss4SnMIAmBLE+K/H/ Myd7aSCBwLcsjCIm5NegKH0TgSWR+2YsQ3yYzds= X-Google-Smtp-Source: ABdhPJy/TNTq+ga6Z1SF7Zcn7xAs618XjQjEuBg+KaDEQhMonmQ7EbRXlopIctzRqejQlHrTeskMS/a/PWna7PKb4Bs= X-Received: by 2002:ac8:24f1:: with SMTP id t46mr16074893qtt.93.1600364965960; Thu, 17 Sep 2020 10:49:25 -0700 (PDT) MIME-Version: 1.0 References: <202009081036.088AaCk8085096@repo.freebsd.org> In-Reply-To: <202009081036.088AaCk8085096@repo.freebsd.org> From: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Date: Thu, 17 Sep 2020 19:49:14 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r365449 - head/sbin/rcorder To: "Andrey V. Elsukov" Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 17:49:27 -0000 On Tue, Sep 8, 2020 at 12:36 PM Andrey V. Elsukov wrote: > Author: ae > Date: Tue Sep 8 10:36:11 2020 > New Revision: 365449 > URL: https://svnweb.freebsd.org/changeset/base/365449 > > Log: > Add a few features to rcorder: > > > Hi Andrey, I've spent some time bisecting an IPSec gateway performance regression on -head that points to this commit. So my bench uses a simple static IPSec aes-gcm-16 setup, and their results vary a lot between those 2 revisions: - r365448: Estimated Equilibrium Ethernet throughput= 1413 Mb/s (maximum value seen: 1419 Mb/s) - r365449: Estimated Equilibrium Ethernet throughput= 469 Mb/s (maximum value seen: 469 Mb/s) How could a modification to the rcoder be the source cause of that ? My rc.conf contains this: kld_list="aesni" ipsec_enable="YES" So My first thought was that the aesni module wasn't loaded anymore: Before upgrade: [root@hp]~# uname -a FreeBSD hp 13.0-CURRENT FreeBSD 13.0-CURRENT #15 r365448M: Thu Sep 17 18:17:58 CEST 2020 olivier@lame4.bsdrp.net:/usr/src/amd64.amd64/sys/amd64 amd64 [root@hp]~# kldstat Id Refs Address Size Name 1 11 0xffffffff80200000 1ee58b0 kernel 2 1 0xffffffff82319000 34c8 fdescfs.ko 3 1 0xffffffff8231d000 a240 aesni.ko 4 1 0xffffffff82328000 8c98 ioat.ko 5 1 0xffffffff82331000 e350 ipsec.ko Then after upgrade: [root@hp]~# uname -a FreeBSD hp 13.0-CURRENT FreeBSD 13.0-CURRENT #14 r365449M: Thu Sep 17 17:01:35 CEST 2020 olivier@lame4.bsdrp.net:/usr/src/amd64.amd64/sys/amd64 amd64 [root@hp]~# kldstat Id Refs Address Size Name 1 11 0xffffffff80200000 1ee58b0 kernel 2 1 0xffffffff82319000 34c8 fdescfs.ko 3 1 0xffffffff8231d000 e350 ipsec.ko 4 1 0xffffffff8232c000 a240 aesni.ko 5 1 0xffffffff82337000 8c98 ioat.ko => aesni.ko is correctly loaded, so it is not the problem, but notice the order of the kernel modules that have changed. Could be this the source of the problem ? Let's try: [root@hp]~# service ipsec stop Clearing ipsec manual keys/policies. [root@hp]~# kld kldconfig kldload kldstat kldunload kldxref [root@hp]~# kldunload ioat [root@hp]~# kldunload aesni [root@hp]~# kldunload ipsec [root@hp]~# kldload aesni [root@hp]~# kldload ipsec [root@hp]~# service ipsec start Installing ipsec manual keys/policies. [root@hp]~# kldstat Id Refs Address Size Name 1 11 0xffffffff80200000 1ee58b0 kernel 2 1 0xffffffff82319000 34c8 fdescfs.ko 5 1 0xffffffff82337000 8c98 ioat.ko 6 1 0xffffffff8231d000 a240 aesni.ko 7 1 0xffffffff82328000 e350 ipsec.ko And after that the IPSec bench results are back to their previous value :-) So rcorder needs to load aesni before ipsec. Regards, Olivier From owner-svn-src-all@freebsd.org Thu Sep 17 18:06:58 2020 Return-Path: Delivered-To: svn-src-all@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 237F93E8ED0; Thu, 17 Sep 2020 18:06:58 +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 4BslKZ01q4z4NhG; Thu, 17 Sep 2020 18:06:58 +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 D3F87E15A; Thu, 17 Sep 2020 18:06:57 +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 08HI6vAh090658; Thu, 17 Sep 2020 18:06:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HI6vUg090657; Thu, 17 Sep 2020 18:06:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009171806.08HI6vUg090657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 17 Sep 2020 18:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365844 - head/usr.sbin/bhyvectl X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/bhyvectl X-SVN-Commit-Revision: 365844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 18:06:58 -0000 Author: jhb Date: Thu Sep 17 18:06:57 2020 New Revision: 365844 URL: https://svnweb.freebsd.org/changeset/base/365844 Log: Remove no longer used variable. Pointy hat to: jhb Reported by: kevans MFC after: 1 week Modified: head/usr.sbin/bhyvectl/bhyvectl.c Modified: head/usr.sbin/bhyvectl/bhyvectl.c ============================================================================== --- head/usr.sbin/bhyvectl/bhyvectl.c Thu Sep 17 17:29:33 2020 (r365843) +++ head/usr.sbin/bhyvectl/bhyvectl.c Thu Sep 17 18:06:57 2020 (r365844) @@ -317,7 +317,7 @@ static int get_vmcs_entry_interruption_info; static int get_vmcs_interruptibility; uint32_t vmcs_entry_interruption_info; static int get_vmcs_gpa, get_vmcs_gla; -static int get_exception_bitmap, exception_bitmap; +static int get_exception_bitmap; static int get_cr0_mask, get_cr0_shadow; static int get_cr4_mask, get_cr4_shadow; static int get_cr3_targets; From owner-svn-src-all@freebsd.org Thu Sep 17 18:24:52 2020 Return-Path: Delivered-To: svn-src-all@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 6C7353E9996; Thu, 17 Sep 2020 18:24:52 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BslkD2DqCz4QBD; Thu, 17 Sep 2020 18:24:52 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30DF8E728; Thu, 17 Sep 2020 18:24:52 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08HIOqO4003091; Thu, 17 Sep 2020 18:24:52 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HIOq2K003090; Thu, 17 Sep 2020 18:24:52 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <202009171824.08HIOq2K003090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Thu, 17 Sep 2020 18:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365845 - head/lib/libpmc/pmu-events X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/lib/libpmc/pmu-events X-SVN-Commit-Revision: 365845 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 18:24:52 -0000 Author: vangyzen Date: Thu Sep 17 18:24:51 2020 New Revision: 365845 URL: https://svnweb.freebsd.org/changeset/base/365845 Log: Fix additional memory leak in process_mapfile Additional Coverity detected memory leak fix. Submitted by: bret_ketchum@dell.com Reported by: Coverity Reviewed by: cem, emaste MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D26462 Modified: head/lib/libpmc/pmu-events/jevents.c Modified: head/lib/libpmc/pmu-events/jevents.c ============================================================================== --- head/lib/libpmc/pmu-events/jevents.c Thu Sep 17 18:06:57 2020 (r365844) +++ head/lib/libpmc/pmu-events/jevents.c Thu Sep 17 18:24:51 2020 (r365845) @@ -821,6 +821,8 @@ process_mapfile(FILE *outfp, char *fpath) /* TODO Deal with lines longer than 16K */ pr_info("%s: Mapfile %s: line %d too long, aborting\n", prog, fpath, line_num); + free(line); + fclose(mapfp); return -1; } line[strlen(line)-1] = '\0'; From owner-svn-src-all@freebsd.org Thu Sep 17 18:47:23 2020 Return-Path: Delivered-To: svn-src-all@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 BF0793EA30B; Thu, 17 Sep 2020 18:47:23 +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 4BsmDC4SW2z4RbW; Thu, 17 Sep 2020 18:47:23 +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 7C669EC7E; Thu, 17 Sep 2020 18:47:23 +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 08HIlNCd015642; Thu, 17 Sep 2020 18:47:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HIlNXa015641; Thu, 17 Sep 2020 18:47:23 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009171847.08HIlNXa015641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 17 Sep 2020 18:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365846 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 365846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 18:47:23 -0000 Author: emaste Date: Thu Sep 17 18:47:23 2020 New Revision: 365846 URL: https://svnweb.freebsd.org/changeset/base/365846 Log: Cirrus-CI: build as an unprivileged user The Cirrus-CI-provided working tree is owned by root. Leave that as is for simplicity but build as an unprivileged user; this tests building with an unmodifiable source tree as a side effect. Continue running the smoke test as root for now, as it failed when run as an unprivileged user - pkg reported "Fail to chmod /usr/bin/.pkgtemp.lpq.dUHpEqPGJ9pq:Operation not permitted" Sponsored by: The FreeBSD Foundation Modified: head/.cirrus.yml Modified: head/.cirrus.yml ============================================================================== --- head/.cirrus.yml Thu Sep 17 18:24:51 2020 (r365845) +++ head/.cirrus.yml Thu Sep 17 18:47:23 2020 (r365846) @@ -12,9 +12,13 @@ task: timeout_in: 120m install_script: - pkg install -y qemu-devel uefi-edk2-qemu-x86_64 + setup_user_script: + - pw useradd user + - mkdir -p /usr/obj/$(pwd -P) + - chown user:user /usr/obj/$(pwd -P) script: - - make -j$(sysctl -n hw.ncpu) WITHOUT_TOOLCHAIN=yes buildworld buildkernel + - su user -c "make -j$(sysctl -n hw.ncpu) WITHOUT_TOOLCHAIN=yes buildworld buildkernel" package_script: - - make WITHOUT_TOOLCHAIN=yes PKG_FORMAT=tar packages + - su user -c "make WITHOUT_TOOLCHAIN=yes PKG_FORMAT=tar packages" test_script: - sh tools/boot/ci-qemu-test.sh From owner-svn-src-all@freebsd.org Thu Sep 17 19:03:54 2020 Return-Path: Delivered-To: svn-src-all@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 52C4F3EA340 for ; Thu, 17 Sep 2020 19:03:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) 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 4BsmbF3zv1z4S8f for ; Thu, 17 Sep 2020 19:03:53 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x733.google.com with SMTP id g72so3394469qke.8 for ; Thu, 17 Sep 2020 12:03:53 -0700 (PDT) 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=AyzofWIGY1+fmXOA3bVnhqKdBLqWULs1086sw6V3x+c=; b=kGKXGIiOt/N/NQPzhvP0SiSoampr+PKFGBQfH1Os4vh4FuLLZvairbQiy+QxEfmfpC HUWHRH/mNSswyzgHk/DVx5YZJBnvoE01GNs6pSu4KBzNWcI0PXeY2/7DyZK4f/Q0F1Qe yNk15F6xDZ5VsEF2m4AvSbjDZ80ltlU+UaXLmUaNnRyeIjoRhLntkbMDkOL35t4C0diC XHiPR1QhIkciRYtOtxKT5uL6wQjEov+b8T0fDiB81EtgecoDKw107pAFE3EYiVBNtERg SWUO8xZi8lZTNdyTJpQVcWL8DysNwgA14F7x6CueuJcTDB40ew+dZY63CcVLH/qjfmC1 lxUA== 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=AyzofWIGY1+fmXOA3bVnhqKdBLqWULs1086sw6V3x+c=; b=qKwyI2ZrqkmXIk46p1vwBjpxHTtZaWyO5xPQfGExnEEDRv1gnCKimtPw2a4Jd7H2Ui svJKt2WunHjGr1zOv+Ug+R8UTloXO80deG3y69XEFCKOkruFfEZEp1WCY35gWhxMZ72N vPV/zVW4zxLvlYUF8hK9VC7c0WLuPl/CFLkfxy0KTFeoyFaJINw9KKXQVQjxY/xloBHG UjBvRh1fUL9Hhdx4axXdGv9gv4I6EuJEGh767LVLgnCQLMEftwX9ek5X7Ur98ZXhulNV YzBZ+f/ZzJoOtnvCOfRogSTFRw8C6dqt0uIIfl0Rt4yhaftZkApSj5OzMHm3wm6EO9fP 2Mew== X-Gm-Message-State: AOAM533V0bjh8Ek2wrCzJkM0Gm43gf0vUGLpgPCCLNckG/CMFuZBagiS sqbGftW4ERRYaMtVYni1FrjabTJ8nN5+cjYNXag4Nw== X-Google-Smtp-Source: ABdhPJwdqd0dgsoMo8JgWcL+yJXY9AGw0TbXmXG48+wQTyJS1TedM/ALWuCMuAhOLdjB1kGx5RnLXxOGYLN48FOPtU8= X-Received: by 2002:a05:620a:2006:: with SMTP id c6mr27620524qka.240.1600369432211; Thu, 17 Sep 2020 12:03:52 -0700 (PDT) MIME-Version: 1.0 References: <202009171705.08HH5CtE014644@gndrsh.dnsmgr.net> <307760E0-1208-4F4C-AD7D-9E0A3C1B3A3B@freebsd.org> In-Reply-To: <307760E0-1208-4F4C-AD7D-9E0A3C1B3A3B@freebsd.org> From: Warner Losh Date: Thu, 17 Sep 2020 13:02:18 -0600 Message-ID: Subject: Re: svn commit: r365836 - head/share/mk To: Jessica Clarke Cc: "Rodney W. Grimes" , Alex Richardson , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4BsmbF3zv1z4S8f X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=kGKXGIiO; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::733) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.23 / 15.00]; ARC_NA(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.89)[-0.894]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.95)[-0.946]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.39)[-0.387]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::733:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 19:03:54 -0000 On Thu, Sep 17, 2020, 11:25 AM Jessica Clarke wrote: > > On 17 Sep 2020, at 18:23, Jessica Clarke wrote: > > > >> On 17 Sep 2020, at 18:05, Rodney W. Grimes > wrote: > >> > >>> On Thu, Sep 17, 2020 at 9:39 AM Steffen Nurpmeso > wrote: > >>> > >>>> Alex Richardson wrote in > >>>> <202009171507.08HF7Qns080555@repo.freebsd.org>: > >>>> |Author: arichardson > >>>> |Date: Thu Sep 17 15:07:25 2020 > >>>> |New Revision: 365836 > >>>> |URL: https://svnweb.freebsd.org/changeset/base/365836 > >>>> | > >>>> |Log: > >>>> | Stop using lorder and ranlib when building libraries > >>>> | > >>>> | Use of ranlib or lorder is no longer necessary with current linkers > >>>> | (probably anything newer than ~1990) and ar's ability to create an > >>>> object > >>>> | index and symbol table in the archive. > >>>> | Currently the build system uses lorder+tsort to sort the .o files > in > >>>> | dependency order so that a single-pass linker can use them. > However, > >>>> | we can use the -s flag to ar to add an index to the .a file which > makes > >>>> | lorder unnecessary. > >>>> | Running ar -s is equivalent to running ranlib afterwards, so we can > >>>> also > >>>> | skip the ranlib invocation. > >>>> > >>>> That ranlib thing yes (for long indeed), but i have vague memories > >>>> that the tsort/lorder ordering was also meant to keep the things > >>>> which heavily interdepend nearby each other. (Luckily Linux > >>>> always had at least tsort available.) > >>>> This no longer matters for all the platforms FreeBSD supports? > >>>> > >>> > >>> tsort has no notion of how dependent the modules are, just an order > that > >>> allows a single pass through the .a file (otherwise you'd need to list > the > >>> .a file multiple times on the command line absent ranlib). That's the > >>> original purpose of tsort. tsort, lsort, and ranlib all arrived in 7th > >>> edition unix on a PDP-11, where size was more important than proximity > to > >>> locations (modulo overlays, which this doesn't affect at all). > >>> > >>> There were some issues of long vs short jumps on earlier architectures > that > >>> this helped (since you could only jump 16MB, for example). However, > there > >>> were workarounds for this issue on those platforms too. And if you > have a > >>> program that this does make a difference, then you can still use > >>> tsort/lorder. They are still in the system. > >>> > >>> I doubt you could measure a difference here today. I doubt, honestly, > that > >>> anybody will notice at all. > >> > >> The x86 archicture has relative jmps of differning lengths, even in > long mode > >> there is support for rel8 and rel32. > > > > That's irrelevant though for several reasons: > > > > 1. The compiler has already decided on what jump instructions to use > based on > > the requested code model (unless you're on RISC-V and using GNU bfd ld > as > > that supports linker relaxations that actually delete instruction > bytes). > > > > 2. The linker is still free to reorder input sections however it likes, > it > > doesn't have to follow the order of the input files (and the files > within > > any archive). > > Hm actually that's only true for archives; it needs to respect the order of > files on the command line for things like crti.o to work. But regardless, > the > other points (and this one, partially) still hold. > > > 3. If you care about those kinds of optimisations you should use > link-time > > optimisation which will likely do far more useful things than just > optimise > > branches, but again isn't constrained by the order of the input files, > it > > can lay out the code exactly how it wants. > > > > Not to mention that this is just a topological sort, not a clustering > sort. > Yea. I doubt you'd be able to measure a difference on anything in our tree. Warner > Jess > > From owner-svn-src-all@freebsd.org Thu Sep 17 19:07:43 2020 Return-Path: Delivered-To: svn-src-all@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 3EAF53EA821; Thu, 17 Sep 2020 19:07:43 +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 4Bsmgg0mXJz4SWm; Thu, 17 Sep 2020 19:07:43 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (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 F2B7B2793A; Thu, 17 Sep 2020 19:07:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f47.google.com with SMTP id cv8so1549143qvb.12; Thu, 17 Sep 2020 12:07:42 -0700 (PDT) X-Gm-Message-State: AOAM530eXK7JnLIyfy5Gx4vYo+FyRpnZDcxKdOjeXOmf/xS7XQAz0ajQ D+Qi1chd3KE6uCn6R2nlaYQQ0XANKMJse7PyEuk= X-Google-Smtp-Source: ABdhPJzHpP/uqk8MDrI+zl8+/bYA0DNbpnUYbMz99LEDjlj3Kmo/ihXQB9czT0J+emrTJnPfZFz0mxXNmzBzuo44jkE= X-Received: by 2002:ad4:41c4:: with SMTP id a4mr13271364qvq.60.1600369662498; Thu, 17 Sep 2020 12:07:42 -0700 (PDT) MIME-Version: 1.0 References: <202009171847.08HIlNXa015641@repo.freebsd.org> In-Reply-To: <202009171847.08HIlNXa015641@repo.freebsd.org> From: Kyle Evans Date: Thu, 17 Sep 2020 14:07:30 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r365846 - head To: Ed Maste Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 19:07:43 -0000 On Thu, Sep 17, 2020 at 1:47 PM Ed Maste wrote: > > Author: emaste > Date: Thu Sep 17 18:47:23 2020 > New Revision: 365846 > URL: https://svnweb.freebsd.org/changeset/base/365846 > > Log: > Cirrus-CI: build as an unprivileged user > > The Cirrus-CI-provided working tree is owned by root. Leave that as is > for simplicity but build as an unprivileged user; this tests building > with an unmodifiable source tree as a side effect. > > Continue running the smoke test as root for now, as it failed when run > as an unprivileged user - pkg reported "Fail to chmod > /usr/bin/.pkgtemp.lpq.dUHpEqPGJ9pq:Operation not permitted" > > Sponsored by: The FreeBSD Foundation > Is there any way we can sneak a r/o src tree build in here? I've had a PR open to do this in our Jenkins builds for a couple years, but without any ability to test it myself I suspect it'll continue unmerged. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Thu Sep 17 19:41:11 2020 Return-Path: Delivered-To: svn-src-all@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 02B373EB225; Thu, 17 Sep 2020 19:41:11 +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 4BsnQG6Mrcz4Tr1; Thu, 17 Sep 2020 19:41:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE259F3A4; Thu, 17 Sep 2020 19:41:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08HJfAfx047708; Thu, 17 Sep 2020 19:41:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HJfAt7047707; Thu, 17 Sep 2020 19:41:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009171941.08HJfAt7047707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 17 Sep 2020 19:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365847 - in head/usr.sbin/makefs: . cd9660 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/usr.sbin/makefs: . cd9660 X-SVN-Commit-Revision: 365847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 19:41:11 -0000 Author: emaste Date: Thu Sep 17 19:41:10 2020 New Revision: 365847 URL: https://svnweb.freebsd.org/changeset/base/365847 Log: makefs: connect cd9660 El Torito EFI boot image system type Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/makefs/cd9660/cd9660_eltorito.c head/usr.sbin/makefs/makefs.8 Modified: head/usr.sbin/makefs/cd9660/cd9660_eltorito.c ============================================================================== --- head/usr.sbin/makefs/cd9660/cd9660_eltorito.c Thu Sep 17 18:47:23 2020 (r365846) +++ head/usr.sbin/makefs/cd9660/cd9660_eltorito.c Thu Sep 17 19:41:10 2020 (r365847) @@ -107,9 +107,11 @@ cd9660_add_boot_disk(iso9660_disk *diskStructure, cons else if (strcmp(sysname, "macppc") == 0 || strcmp(sysname, "mac68k") == 0) new_image->system = ET_SYS_MAC; + else if (strcmp(sysname, "efi") == 0) + new_image->system = ET_SYS_EFI; else { warnx("boot disk system must be " - "i386, powerpc, macppc, or mac68k"); + "i386, powerpc, macppc, mac68k, or efi"); free(temp); free(new_image); return 0; Modified: head/usr.sbin/makefs/makefs.8 ============================================================================== --- head/usr.sbin/makefs/makefs.8 Thu Sep 17 18:47:23 2020 (r365846) +++ head/usr.sbin/makefs/makefs.8 Thu Sep 17 19:41:10 2020 (r365847) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 20, 2019 +.Dd September 17, 2020 .Dt MAKEFS 8 .Os .Sh NAME @@ -385,8 +385,9 @@ is one of .Ql i386 , .Ql mac68k , .Ql macppc , +.Ql powerpc , or -.Ql powerpc . +.Ql efi . .It Sy generic-bootimage Load a generic boot image into the first 32K of the cd9660 image. .It Sy hard-disk-boot From owner-svn-src-all@freebsd.org Thu Sep 17 19:43:28 2020 Return-Path: Delivered-To: svn-src-all@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 70AD63EB34A; Thu, 17 Sep 2020 19:43:28 +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 4BsnSw1QQ4z4VJj; Thu, 17 Sep 2020 19:43:28 +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 ED3AEF061; Thu, 17 Sep 2020 19:43:27 +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 08HJhRFl052457; Thu, 17 Sep 2020 19:43:27 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HJhP8G052445; Thu, 17 Sep 2020 19:43:25 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009171943.08HJhP8G052445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 17 Sep 2020 19:43:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365848 - in head/contrib/llvm-project/clang: include/clang/Basic include/clang/Sema lib/AST lib/Headers lib/Sema lib/Serialization X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head/contrib/llvm-project/clang: include/clang/Basic include/clang/Sema lib/AST lib/Headers lib/Sema lib/Serialization X-SVN-Commit-Revision: 365848 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 19:43:28 -0000 Author: dim Date: Thu Sep 17 19:43:25 2020 New Revision: 365848 URL: https://svnweb.freebsd.org/changeset/base/365848 Log: Merge commit e09107ab8 from llvm git (by Raul Tambre): [Sema] Introduce BuiltinAttr, per-declaration builtin-ness Instead of relying on whether a certain identifier is a builtin, introduce BuiltinAttr to specify a declaration as having builtin semantics. This fixes incompatible redeclarations of builtins, as reverting the identifier as being builtin due to one incompatible redeclaration would have broken rest of the builtin calls. Mostly-compatible redeclarations of builtins also no longer have builtin semantics. They don't call the builtin nor inherit their attributes. A long-standing FIXME regarding builtins inside a namespace enclosed in extern "C" not being recognized is also addressed. Due to the more correct handling attributes for builtin functions are added in more places, resulting in more useful warnings. Tests are updated to reflect that. Intrinsics without an inline definition in intrin.h had `inline` and `static` removed as they had no effect and caused them to no longer be recognized as builtins otherwise. A pthread_create() related test is XFAIL-ed, as it relied on it being recognized as a builtin based on its name. The builtin declaration syntax is too restrictive and doesn't allow custom structs, function pointers, etc. It seems to be the only case and fixing this would require reworking the current builtin syntax, so this seems acceptable. Fixes PR45410. Reviewed By: rsmith, yutsumi Differential Revision: https://reviews.llvm.org/D77491 This should fix 'Assertion failed: (i < getNumParams() && "Illegal param #"), function getParamDecl, file /usr/src/contrib/llvm-project/clang/include/clang/AST/Decl.h, line 2430' when building the graphics/pgplot port. Note that there may also have been other ports which triggered this assertion, if they redeclare standard functions with incompatible arguments. Reported by: zeising MFC after: 6 weeks X-MFC-With: r364284 Modified: head/contrib/llvm-project/clang/include/clang/Basic/Attr.td head/contrib/llvm-project/clang/include/clang/Basic/Builtins.def head/contrib/llvm-project/clang/include/clang/Basic/IdentifierTable.h head/contrib/llvm-project/clang/include/clang/Sema/Sema.h head/contrib/llvm-project/clang/lib/AST/Decl.cpp head/contrib/llvm-project/clang/lib/Headers/intrin.h head/contrib/llvm-project/clang/lib/Sema/SemaDecl.cpp head/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp head/contrib/llvm-project/clang/lib/Sema/SemaLookup.cpp head/contrib/llvm-project/clang/lib/Serialization/ASTReader.cpp head/contrib/llvm-project/clang/lib/Serialization/ASTWriter.cpp Modified: head/contrib/llvm-project/clang/include/clang/Basic/Attr.td ============================================================================== --- head/contrib/llvm-project/clang/include/clang/Basic/Attr.td Thu Sep 17 19:41:10 2020 (r365847) +++ head/contrib/llvm-project/clang/include/clang/Basic/Attr.td Thu Sep 17 19:43:25 2020 (r365848) @@ -3444,3 +3444,11 @@ def ReleaseHandle : InheritableParamAttr { let Subjects = SubjectList<[ParmVar]>; let Documentation = [ReleaseHandleDocs]; } + +def Builtin : InheritableAttr { + let Spellings = []; + let Args = [UnsignedArgument<"ID">]; + let Subjects = SubjectList<[Function]>; + let SemaHandler = 0; + let Documentation = [Undocumented]; +} Modified: head/contrib/llvm-project/clang/include/clang/Basic/Builtins.def ============================================================================== --- head/contrib/llvm-project/clang/include/clang/Basic/Builtins.def Thu Sep 17 19:41:10 2020 (r365847) +++ head/contrib/llvm-project/clang/include/clang/Basic/Builtins.def Thu Sep 17 19:43:25 2020 (r365848) @@ -1017,6 +1017,7 @@ LIBBUILTIN(strncasecmp, "icC*cC*z", "f", "strings.h" LIBBUILTIN(_exit, "vi", "fr", "unistd.h", ALL_GNU_LANGUAGES) LIBBUILTIN(vfork, "p", "fj", "unistd.h", ALL_LANGUAGES) // POSIX pthread.h +// FIXME: Should specify argument types. LIBBUILTIN(pthread_create, "", "fC<2,3>", "pthread.h", ALL_GNU_LANGUAGES) // POSIX setjmp.h Modified: head/contrib/llvm-project/clang/include/clang/Basic/IdentifierTable.h ============================================================================== --- head/contrib/llvm-project/clang/include/clang/Basic/IdentifierTable.h Thu Sep 17 19:41:10 2020 (r365847) +++ head/contrib/llvm-project/clang/include/clang/Basic/IdentifierTable.h Thu Sep 17 19:43:25 2020 (r365848) @@ -225,18 +225,6 @@ class alignas(IdentifierInfoAlignment) IdentifierInfo } void setObjCKeywordID(tok::ObjCKeywordKind ID) { ObjCOrBuiltinID = ID; } - /// True if setNotBuiltin() was called. - bool hasRevertedBuiltin() const { - return ObjCOrBuiltinID == tok::NUM_OBJC_KEYWORDS; - } - - /// Revert the identifier to a non-builtin identifier. We do this if - /// the name of a known builtin library function is used to declare that - /// function, but an unexpected type is specified. - void revertBuiltin() { - setBuiltinID(0); - } - /// Return a value indicating whether this is a builtin function. /// /// 0 is not-built-in. 1+ are specific builtin functions. Modified: head/contrib/llvm-project/clang/include/clang/Sema/Sema.h ============================================================================== --- head/contrib/llvm-project/clang/include/clang/Sema/Sema.h Thu Sep 17 19:41:10 2020 (r365847) +++ head/contrib/llvm-project/clang/include/clang/Sema/Sema.h Thu Sep 17 19:43:25 2020 (r365848) @@ -3957,6 +3957,8 @@ class Sema final { (public) ObjCInterfaceDecl *getObjCInterfaceDecl(IdentifierInfo *&Id, SourceLocation IdLoc, bool TypoCorrection = false); + FunctionDecl *CreateBuiltin(IdentifierInfo *II, QualType Type, unsigned ID, + SourceLocation Loc); NamedDecl *LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID, Scope *S, bool ForRedeclaration, SourceLocation Loc); Modified: head/contrib/llvm-project/clang/lib/AST/Decl.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/AST/Decl.cpp Thu Sep 17 19:41:10 2020 (r365847) +++ head/contrib/llvm-project/clang/lib/AST/Decl.cpp Thu Sep 17 19:43:25 2020 (r365848) @@ -3162,44 +3162,24 @@ FunctionDecl *FunctionDecl::getCanonicalDecl() { retur /// functions as their wrapped builtins. This shouldn't be done in general, but /// it's useful in Sema to diagnose calls to wrappers based on their semantics. unsigned FunctionDecl::getBuiltinID(bool ConsiderWrapperFunctions) const { - unsigned BuiltinID; + unsigned BuiltinID = 0; if (const auto *ABAA = getAttr()) { BuiltinID = ABAA->getBuiltinName()->getBuiltinID(); - } else { - if (!getIdentifier()) - return 0; - - BuiltinID = getIdentifier()->getBuiltinID(); + } else if (const auto *A = getAttr()) { + BuiltinID = A->getID(); } if (!BuiltinID) return 0; - ASTContext &Context = getASTContext(); - if (Context.getLangOpts().CPlusPlus) { - const auto *LinkageDecl = - dyn_cast(getFirstDecl()->getDeclContext()); - // In C++, the first declaration of a builtin is always inside an implicit - // extern "C". - // FIXME: A recognised library function may not be directly in an extern "C" - // declaration, for instance "extern "C" { namespace std { decl } }". - if (!LinkageDecl) { - if (BuiltinID == Builtin::BI__GetExceptionInfo && - Context.getTargetInfo().getCXXABI().isMicrosoft()) - return Builtin::BI__GetExceptionInfo; - return 0; - } - if (LinkageDecl->getLanguage() != LinkageSpecDecl::lang_c) - return 0; - } - // If the function is marked "overloadable", it has a different mangled name // and is not the C library function. if (!ConsiderWrapperFunctions && hasAttr() && !hasAttr()) return 0; + ASTContext &Context = getASTContext(); if (!Context.BuiltinInfo.isPredefinedLibFunction(BuiltinID)) return BuiltinID; Modified: head/contrib/llvm-project/clang/lib/Headers/intrin.h ============================================================================== --- head/contrib/llvm-project/clang/lib/Headers/intrin.h Thu Sep 17 19:41:10 2020 (r365847) +++ head/contrib/llvm-project/clang/lib/Headers/intrin.h Thu Sep 17 19:43:25 2020 (r365848) @@ -57,16 +57,11 @@ void __addfsbyte(unsigned long, unsigned char); void __addfsdword(unsigned long, unsigned long); void __addfsword(unsigned long, unsigned short); void __code_seg(const char *); -static __inline__ void __cpuid(int[4], int); -static __inline__ void __cpuidex(int[4], int, int); -static __inline__ __int64 __emul(int, int); -static __inline__ unsigned __int64 __emulu(unsigned int, unsigned int); unsigned int __getcallerseflags(void); -static __inline__ void __halt(void); unsigned char __inbyte(unsigned short); void __inbytestring(unsigned short, unsigned char *, unsigned long); @@ -82,13 +77,9 @@ void __inwordstring(unsigned short, unsigned short *, void __lidt(void *); unsigned __int64 __ll_lshift(unsigned __int64, int); __int64 __ll_rshift(__int64, int); -static __inline__ void __movsb(unsigned char *, unsigned char const *, size_t); -static __inline__ void __movsd(unsigned long *, unsigned long const *, size_t); -static __inline__ void __movsw(unsigned short *, unsigned short const *, size_t); -static __inline__ void __nop(void); void __nvreg_restore_fence(void); void __nvreg_save_fence(void); @@ -105,23 +96,16 @@ unsigned long __readcr4(void); unsigned long __readcr8(void); unsigned int __readdr(unsigned int); #ifdef __i386__ -static __inline__ unsigned char __readfsbyte(unsigned long); -static __inline__ unsigned __int64 __readfsqword(unsigned long); -static __inline__ unsigned short __readfsword(unsigned long); #endif -static __inline__ unsigned __int64 __readmsr(unsigned long); unsigned __int64 __readpmc(unsigned long); unsigned long __segmentlimit(unsigned long); void __sidt(void *); -static __inline__ void __stosb(unsigned char *, unsigned char, size_t); -static __inline__ void __stosd(unsigned long *, unsigned long, size_t); -static __inline__ void __stosw(unsigned short *, unsigned short, size_t); void __svm_clgi(void); void __svm_invlpga(void *, int); @@ -136,7 +120,6 @@ void __vmx_off(void); void __vmx_vmptrst(unsigned __int64 *); void __wbinvd(void); void __writecr0(unsigned int); -static __inline__ void __writecr3(unsigned __INTPTR_TYPE__); void __writecr4(unsigned int); void __writecr8(unsigned int); @@ -146,11 +129,8 @@ void __writefsdword(unsigned long, unsigned long); void __writefsqword(unsigned long, unsigned __int64); void __writefsword(unsigned long, unsigned short); void __writemsr(unsigned long, unsigned __int64); -static __inline__ void *_AddressOfReturnAddress(void); -static __inline__ unsigned char _BitScanForward(unsigned long *_Index, unsigned long _Mask); -static __inline__ unsigned char _BitScanReverse(unsigned long *_Index, unsigned long _Mask); unsigned char _bittest(long const *, long); unsigned char _bittestandcomplement(long *, long); @@ -169,12 +149,10 @@ long _InterlockedExchangeAdd_HLEAcquire(long volatile long _InterlockedExchangeAdd_HLERelease(long volatile *, long); __int64 _InterlockedExchangeAdd64_HLEAcquire(__int64 volatile *, __int64); __int64 _InterlockedExchangeAdd64_HLERelease(__int64 volatile *, __int64); -static __inline__ void -__attribute__((__deprecated__("use other intrinsics or C++11 atomics instead"))) -_ReadBarrier(void); -static __inline__ void -__attribute__((__deprecated__("use other intrinsics or C++11 atomics instead"))) -_ReadWriteBarrier(void); +void __attribute__((__deprecated__( + "use other intrinsics or C++11 atomics instead"))) _ReadBarrier(void); +void __attribute__((__deprecated__( + "use other intrinsics or C++11 atomics instead"))) _ReadWriteBarrier(void); unsigned int _rorx_u32(unsigned int, const unsigned int); int _sarx_i32(int, unsigned int); #if __STDC_HOSTED__ @@ -185,9 +163,8 @@ unsigned int _shrx_u32(unsigned int, unsigned int); void _Store_HLERelease(long volatile *, long); void _Store64_HLERelease(__int64 volatile *, __int64); void _StorePointer_HLERelease(void *volatile *, void *); -static __inline__ void -__attribute__((__deprecated__("use other intrinsics or C++11 atomics instead"))) -_WriteBarrier(void); +void __attribute__((__deprecated__( + "use other intrinsics or C++11 atomics instead"))) _WriteBarrier(void); unsigned __int32 xbegin(void); void _xend(void); @@ -197,19 +174,14 @@ void __addgsbyte(unsigned long, unsigned char); void __addgsdword(unsigned long, unsigned long); void __addgsqword(unsigned long, unsigned __int64); void __addgsword(unsigned long, unsigned short); -static __inline__ void __faststorefence(void); void __incgsbyte(unsigned long); void __incgsdword(unsigned long); void __incgsqword(unsigned long); void __incgsword(unsigned long); -static __inline__ void __movsq(unsigned long long *, unsigned long long const *, size_t); -static __inline__ unsigned char __readgsbyte(unsigned long); -static __inline__ unsigned long __readgsdword(unsigned long); -static __inline__ unsigned __int64 __readgsqword(unsigned long); unsigned short __readgsword(unsigned long); unsigned __int64 __shiftleft128(unsigned __int64 _LowPart, @@ -218,7 +190,6 @@ unsigned __int64 __shiftleft128(unsigned __int64 _LowP unsigned __int64 __shiftright128(unsigned __int64 _LowPart, unsigned __int64 _HighPart, unsigned char _Shift); -static __inline__ void __stosq(unsigned __int64 *, unsigned __int64, size_t); unsigned char __vmx_on(unsigned __int64 *); unsigned char __vmx_vmclear(unsigned __int64 *); @@ -269,13 +240,9 @@ unsigned __int64 _rorx_u64(unsigned __int64, const uns __int64 _sarx_i64(__int64, unsigned int); unsigned __int64 _shlx_u64(unsigned __int64, unsigned int); unsigned __int64 _shrx_u64(unsigned __int64, unsigned int); -static __inline__ __int64 __mulh(__int64, __int64); -static __inline__ unsigned __int64 __umulh(unsigned __int64, unsigned __int64); -static __inline__ __int64 _mul128(__int64, __int64, __int64*); -static __inline__ unsigned __int64 _umul128(unsigned __int64, unsigned __int64, unsigned __int64*); @@ -284,29 +251,19 @@ unsigned __int64 _umul128(unsigned __int64, #if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) -static __inline__ unsigned char _BitScanForward64(unsigned long *_Index, unsigned __int64 _Mask); -static __inline__ unsigned char _BitScanReverse64(unsigned long *_Index, unsigned __int64 _Mask); #endif #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) -static __inline__ __int64 _InterlockedDecrement64(__int64 volatile *_Addend); -static __inline__ __int64 _InterlockedExchange64(__int64 volatile *_Target, __int64 _Value); -static __inline__ __int64 _InterlockedExchangeAdd64(__int64 volatile *_Addend, __int64 _Value); -static __inline__ __int64 _InterlockedExchangeSub64(__int64 volatile *_Subend, __int64 _Value); -static __inline__ __int64 _InterlockedIncrement64(__int64 volatile *_Addend); -static __inline__ __int64 _InterlockedOr64(__int64 volatile *_Value, __int64 _Mask); -static __inline__ __int64 _InterlockedXor64(__int64 volatile *_Value, __int64 _Mask); -static __inline__ __int64 _InterlockedAnd64(__int64 volatile *_Value, __int64 _Mask); #endif @@ -475,40 +432,56 @@ __int64 _InterlockedCompareExchange64_rel(__int64 vola |* movs, stos \*----------------------------------------------------------------------------*/ #if defined(__i386__) || defined(__x86_64__) -static __inline__ void __DEFAULT_FN_ATTRS -__movsb(unsigned char *__dst, unsigned char const *__src, size_t __n) { +static __inline__ void __DEFAULT_FN_ATTRS __movsb(unsigned char *__dst, + unsigned char const *__src, + size_t __n) { __asm__ __volatile__("rep movsb" : "+D"(__dst), "+S"(__src), "+c"(__n) : : "memory"); } -static __inline__ void __DEFAULT_FN_ATTRS -__movsd(unsigned long *__dst, unsigned long const *__src, size_t __n) { - __asm__ __volatile__("rep movsl" : "+D"(__dst), "+S"(__src), "+c"(__n) - : : "memory"); +static __inline__ void __DEFAULT_FN_ATTRS __movsd(unsigned long *__dst, + unsigned long const *__src, + size_t __n) { + __asm__ __volatile__("rep movsl" + : "+D"(__dst), "+S"(__src), "+c"(__n) + : + : "memory"); } -static __inline__ void __DEFAULT_FN_ATTRS -__movsw(unsigned short *__dst, unsigned short const *__src, size_t __n) { - __asm__ __volatile__("rep movsw" : "+D"(__dst), "+S"(__src), "+c"(__n) - : : "memory"); +static __inline__ void __DEFAULT_FN_ATTRS __movsw(unsigned short *__dst, + unsigned short const *__src, + size_t __n) { + __asm__ __volatile__("rep movsw" + : "+D"(__dst), "+S"(__src), "+c"(__n) + : + : "memory"); } -static __inline__ void __DEFAULT_FN_ATTRS -__stosd(unsigned long *__dst, unsigned long __x, size_t __n) { - __asm__ __volatile__("rep stosl" : "+D"(__dst), "+c"(__n) : "a"(__x) +static __inline__ void __DEFAULT_FN_ATTRS __stosd(unsigned long *__dst, + unsigned long __x, + size_t __n) { + __asm__ __volatile__("rep stosl" + : "+D"(__dst), "+c"(__n) + : "a"(__x) : "memory"); } -static __inline__ void __DEFAULT_FN_ATTRS -__stosw(unsigned short *__dst, unsigned short __x, size_t __n) { - __asm__ __volatile__("rep stosw" : "+D"(__dst), "+c"(__n) : "a"(__x) +static __inline__ void __DEFAULT_FN_ATTRS __stosw(unsigned short *__dst, + unsigned short __x, + size_t __n) { + __asm__ __volatile__("rep stosw" + : "+D"(__dst), "+c"(__n) + : "a"(__x) : "memory"); } #endif #ifdef __x86_64__ -static __inline__ void __DEFAULT_FN_ATTRS -__movsq(unsigned long long *__dst, unsigned long long const *__src, size_t __n) { - __asm__ __volatile__("rep movsq" : "+D"(__dst), "+S"(__src), "+c"(__n) - : : "memory"); +static __inline__ void __DEFAULT_FN_ATTRS __movsq( + unsigned long long *__dst, unsigned long long const *__src, size_t __n) { + __asm__ __volatile__("rep movsq" + : "+D"(__dst), "+S"(__src), "+c"(__n) + : + : "memory"); } -static __inline__ void __DEFAULT_FN_ATTRS -__stosq(unsigned __int64 *__dst, unsigned __int64 __x, size_t __n) { +static __inline__ void __DEFAULT_FN_ATTRS __stosq(unsigned __int64 *__dst, + unsigned __int64 __x, + size_t __n) { __asm__ __volatile__("rep stosq" : "+D"(__dst), "+c"(__n) : "a"(__x) : "memory"); } @@ -518,26 +491,25 @@ __stosq(unsigned __int64 *__dst, unsigned __int64 __x, |* Misc \*----------------------------------------------------------------------------*/ #if defined(__i386__) || defined(__x86_64__) -static __inline__ void __DEFAULT_FN_ATTRS -__cpuid(int __info[4], int __level) { - __asm__ ("cpuid" : "=a"(__info[0]), "=b" (__info[1]), "=c"(__info[2]), "=d"(__info[3]) - : "a"(__level), "c"(0)); +static __inline__ void __DEFAULT_FN_ATTRS __cpuid(int __info[4], int __level) { + __asm__("cpuid" + : "=a"(__info[0]), "=b"(__info[1]), "=c"(__info[2]), "=d"(__info[3]) + : "a"(__level), "c"(0)); } -static __inline__ void __DEFAULT_FN_ATTRS -__cpuidex(int __info[4], int __level, int __ecx) { - __asm__ ("cpuid" : "=a"(__info[0]), "=b" (__info[1]), "=c"(__info[2]), "=d"(__info[3]) - : "a"(__level), "c"(__ecx)); +static __inline__ void __DEFAULT_FN_ATTRS __cpuidex(int __info[4], int __level, + int __ecx) { + __asm__("cpuid" + : "=a"(__info[0]), "=b"(__info[1]), "=c"(__info[2]), "=d"(__info[3]) + : "a"(__level), "c"(__ecx)); } -static __inline__ void __DEFAULT_FN_ATTRS -__halt(void) { - __asm__ volatile ("hlt"); +static __inline__ void __DEFAULT_FN_ATTRS __halt(void) { + __asm__ volatile("hlt"); } #endif #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) -static __inline__ void __DEFAULT_FN_ATTRS -__nop(void) { - __asm__ volatile ("nop"); +static __inline__ void __DEFAULT_FN_ATTRS __nop(void) { + __asm__ volatile("nop"); } #endif @@ -574,8 +546,7 @@ __readmsr(unsigned long __register) { } #endif -static __inline__ unsigned __LPTRINT_TYPE__ __DEFAULT_FN_ATTRS -__readcr3(void) { +static __inline__ unsigned __LPTRINT_TYPE__ __DEFAULT_FN_ATTRS __readcr3(void) { unsigned __LPTRINT_TYPE__ __cr3_val; __asm__ __volatile__ ("mov %%cr3, %0" : "=r"(__cr3_val) : : "memory"); return __cr3_val; Modified: head/contrib/llvm-project/clang/lib/Sema/SemaDecl.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Sema/SemaDecl.cpp Thu Sep 17 19:41:10 2020 (r365847) +++ head/contrib/llvm-project/clang/lib/Sema/SemaDecl.cpp Thu Sep 17 19:43:25 2020 (r365848) @@ -2054,6 +2054,42 @@ static StringRef getHeaderName(Builtin::Context &Built llvm_unreachable("unhandled error kind"); } +FunctionDecl *Sema::CreateBuiltin(IdentifierInfo *II, QualType Type, + unsigned ID, SourceLocation Loc) { + DeclContext *Parent = Context.getTranslationUnitDecl(); + + if (getLangOpts().CPlusPlus) { + LinkageSpecDecl *CLinkageDecl = LinkageSpecDecl::Create( + Context, Parent, Loc, Loc, LinkageSpecDecl::lang_c, false); + CLinkageDecl->setImplicit(); + Parent->addDecl(CLinkageDecl); + Parent = CLinkageDecl; + } + + FunctionDecl *New = FunctionDecl::Create(Context, Parent, Loc, Loc, II, Type, + /*TInfo=*/nullptr, SC_Extern, false, + Type->isFunctionProtoType()); + New->setImplicit(); + New->addAttr(BuiltinAttr::CreateImplicit(Context, ID)); + + // Create Decl objects for each parameter, adding them to the + // FunctionDecl. + if (const FunctionProtoType *FT = dyn_cast(Type)) { + SmallVector Params; + for (unsigned i = 0, e = FT->getNumParams(); i != e; ++i) { + ParmVarDecl *parm = ParmVarDecl::Create( + Context, New, SourceLocation(), SourceLocation(), nullptr, + FT->getParamType(i), /*TInfo=*/nullptr, SC_None, nullptr); + parm->setScopeInfo(0, i); + Params.push_back(parm); + } + New->setParams(Params); + } + + AddKnownFunctionAttributes(New); + return New; +} + /// LazilyCreateBuiltin - The specified Builtin-ID was first used at /// file scope. lazily create a decl for it. ForRedeclaration is true /// if we're creating this built-in in anticipation of redeclaring the @@ -2105,40 +2141,7 @@ NamedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *I if (R.isNull()) return nullptr; - DeclContext *Parent = Context.getTranslationUnitDecl(); - if (getLangOpts().CPlusPlus) { - LinkageSpecDecl *CLinkageDecl = - LinkageSpecDecl::Create(Context, Parent, Loc, Loc, - LinkageSpecDecl::lang_c, false); - CLinkageDecl->setImplicit(); - Parent->addDecl(CLinkageDecl); - Parent = CLinkageDecl; - } - - FunctionDecl *New = FunctionDecl::Create(Context, - Parent, - Loc, Loc, II, R, /*TInfo=*/nullptr, - SC_Extern, - false, - R->isFunctionProtoType()); - New->setImplicit(); - - // Create Decl objects for each parameter, adding them to the - // FunctionDecl. - if (const FunctionProtoType *FT = dyn_cast(R)) { - SmallVector Params; - for (unsigned i = 0, e = FT->getNumParams(); i != e; ++i) { - ParmVarDecl *parm = - ParmVarDecl::Create(Context, New, SourceLocation(), SourceLocation(), - nullptr, FT->getParamType(i), /*TInfo=*/nullptr, - SC_None, nullptr); - parm->setScopeInfo(0, i); - Params.push_back(parm); - } - New->setParams(Params); - } - - AddKnownFunctionAttributes(New); + FunctionDecl *New = CreateBuiltin(II, R, ID, Loc); RegisterLocallyScopedExternCDecl(New, S); // TUScope is the translation-unit scope to insert this function into. @@ -2146,7 +2149,7 @@ NamedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *I // relate Scopes to DeclContexts, and probably eliminate CurContext // entirely, but we're not there yet. DeclContext *SavedContext = CurContext; - CurContext = Parent; + CurContext = New->getDeclContext(); PushOnScopeChains(New, TUScope); CurContext = SavedContext; return New; @@ -3348,7 +3351,10 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, NamedD // there but not here. NewTypeInfo = NewTypeInfo.withCallingConv(OldTypeInfo.getCC()); RequiresAdjustment = true; - } else if (New->getBuiltinID()) { + } else if (Old->getBuiltinID()) { + // Builtin attribute isn't propagated to the new one yet at this point, + // so we check if the old one is a builtin. + // Calling Conventions on a Builtin aren't really useful and setting a // default calling convention and cdecl'ing some builtin redeclarations is // common, so warn and ignore the calling convention on the redeclaration. @@ -3781,18 +3787,6 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, NamedD Diag(New->getLocation(), diag::warn_redecl_library_builtin) << New; Diag(OldLocation, diag::note_previous_builtin_declaration) << Old << Old->getType(); - - // If this is a global redeclaration, just forget hereafter - // about the "builtin-ness" of the function. - // - // Doing this for local extern declarations is problematic. If - // the builtin declaration remains visible, a second invalid - // local declaration will produce a hard error; if it doesn't - // remain visible, a single bogus local redeclaration (which is - // actually only a warning) could break all the downstream code. - if (!New->getLexicalDeclContext()->isFunctionOrMethod()) - New->getIdentifier()->revertBuiltin(); - return false; } @@ -9633,6 +9627,35 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, // generate them. Diag(NewFD->getLocation(), diag::ext_out_of_line_declaration) << D.getCXXScopeSpec().getRange(); + } + } + + // In C builtins get merged with implicitly lazily created declarations. + // In C++ we need to check if it's a builtin and add the BuiltinAttr here. + if (getLangOpts().CPlusPlus) { + if (IdentifierInfo *II = Previous.getLookupName().getAsIdentifierInfo()) { + if (unsigned BuiltinID = II->getBuiltinID()) { + if (NewFD->getLanguageLinkage() == CLanguageLinkage) { + // Declarations for builtins with custom typechecking by definition + // don't make sense. Don't attempt typechecking and simply add the + // attribute. + if (Context.BuiltinInfo.hasCustomTypechecking(BuiltinID)) { + NewFD->addAttr(BuiltinAttr::CreateImplicit(Context, BuiltinID)); + } else { + ASTContext::GetBuiltinTypeError Error; + QualType BuiltinType = Context.GetBuiltinType(BuiltinID, Error); + + if (!Error && !BuiltinType.isNull() && + Context.hasSameFunctionTypeIgnoringExceptionSpec( + NewFD->getType(), BuiltinType)) + NewFD->addAttr(BuiltinAttr::CreateImplicit(Context, BuiltinID)); + } + } else if (BuiltinID == Builtin::BI__GetExceptionInfo && + Context.getTargetInfo().getCXXABI().isMicrosoft()) { + // FIXME: We should consider this a builtin only in the std namespace. + NewFD->addAttr(BuiltinAttr::CreateImplicit(Context, BuiltinID)); + } + } } } Modified: head/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp Thu Sep 17 19:41:10 2020 (r365847) +++ head/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp Thu Sep 17 19:43:25 2020 (r365848) @@ -6158,6 +6158,7 @@ static FunctionDecl *rewriteBuiltinFunctionDecl(Sema * Params.push_back(Parm); } OverloadDecl->setParams(Params); + Sema->mergeDeclAttributes(OverloadDecl, FDecl); return OverloadDecl; } Modified: head/contrib/llvm-project/clang/lib/Sema/SemaLookup.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Sema/SemaLookup.cpp Thu Sep 17 19:41:10 2020 (r365847) +++ head/contrib/llvm-project/clang/lib/Sema/SemaLookup.cpp Thu Sep 17 19:43:25 2020 (r365848) @@ -894,10 +894,9 @@ bool Sema::LookupBuiltin(LookupResult &R) { Context.BuiltinInfo.isPredefinedLibFunction(BuiltinID)) return false; - if (NamedDecl *D = LazilyCreateBuiltin((IdentifierInfo *)II, - BuiltinID, TUScope, - R.isForRedeclaration(), - R.getNameLoc())) { + if (NamedDecl *D = + LazilyCreateBuiltin(II, BuiltinID, TUScope, + R.isForRedeclaration(), R.getNameLoc())) { R.addDecl(D); return true; } Modified: head/contrib/llvm-project/clang/lib/Serialization/ASTReader.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Serialization/ASTReader.cpp Thu Sep 17 19:41:10 2020 (r365847) +++ head/contrib/llvm-project/clang/lib/Serialization/ASTReader.cpp Thu Sep 17 19:43:25 2020 (r365848) @@ -908,9 +908,8 @@ ASTIdentifierLookupTraitBase::ReadKey(const unsigned c /// Whether the given identifier is "interesting". static bool isInterestingIdentifier(ASTReader &Reader, IdentifierInfo &II, bool IsModule) { - return II.hadMacroDefinition() || - II.isPoisoned() || - (IsModule ? II.hasRevertedBuiltin() : II.getObjCOrBuiltinID()) || + return II.hadMacroDefinition() || II.isPoisoned() || + (!IsModule && II.getObjCOrBuiltinID()) || II.hasRevertedTokenIDToIdentifier() || (!(IsModule && Reader.getPreprocessor().getLangOpts().CPlusPlus) && II.getFETokenInfo()); @@ -970,7 +969,6 @@ IdentifierInfo *ASTIdentifierLookupTrait::ReadData(con unsigned Bits = endian::readNext(d); bool CPlusPlusOperatorKeyword = readBit(Bits); bool HasRevertedTokenIDToIdentifier = readBit(Bits); - bool HasRevertedBuiltin = readBit(Bits); bool Poisoned = readBit(Bits); bool ExtensionToken = readBit(Bits); bool HadMacroDefinition = readBit(Bits); @@ -984,12 +982,6 @@ IdentifierInfo *ASTIdentifierLookupTrait::ReadData(con II->revertTokenIDToIdentifier(); if (!F.isModule()) II->setObjCOrBuiltinID(ObjCOrBuiltinID); - else if (HasRevertedBuiltin && II->getBuiltinID()) { - II->revertBuiltin(); - assert((II->hasRevertedBuiltin() || - II->getObjCOrBuiltinID() == ObjCOrBuiltinID) && - "Incorrect ObjC keyword or builtin ID"); - } assert(II->isExtensionToken() == ExtensionToken && "Incorrect extension token flag"); (void)ExtensionToken; Modified: head/contrib/llvm-project/clang/lib/Serialization/ASTWriter.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Serialization/ASTWriter.cpp Thu Sep 17 19:41:10 2020 (r365847) +++ head/contrib/llvm-project/clang/lib/Serialization/ASTWriter.cpp Thu Sep 17 19:43:25 2020 (r365848) @@ -3276,9 +3276,8 @@ class ASTIdentifierTableTrait { /// doesn't check whether the name has macros defined; use PublicMacroIterator /// to check that. bool isInterestingIdentifier(const IdentifierInfo *II, uint64_t MacroOffset) { - if (MacroOffset || - II->isPoisoned() || - (IsModule ? II->hasRevertedBuiltin() : II->getObjCOrBuiltinID()) || + if (MacroOffset || II->isPoisoned() || + (!IsModule && II->getObjCOrBuiltinID()) || II->hasRevertedTokenIDToIdentifier() || (NeedDecls && II->getFETokenInfo())) return true; @@ -3385,7 +3384,6 @@ class ASTIdentifierTableTrait { Bits = (Bits << 1) | unsigned(HadMacroDefinition); Bits = (Bits << 1) | unsigned(II->isExtensionToken()); Bits = (Bits << 1) | unsigned(II->isPoisoned()); - Bits = (Bits << 1) | unsigned(II->hasRevertedBuiltin()); Bits = (Bits << 1) | unsigned(II->hasRevertedTokenIDToIdentifier()); Bits = (Bits << 1) | unsigned(II->isCPlusPlusOperatorKeyword()); LE.write(Bits); From owner-svn-src-all@freebsd.org Thu Sep 17 19:47:42 2020 Return-Path: Delivered-To: svn-src-all@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 0E6DC3EB771; Thu, 17 Sep 2020 19:47:42 +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 4BsnYn6fHFz4VgN; Thu, 17 Sep 2020 19:47:41 +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 C3BE1F52D; Thu, 17 Sep 2020 19:47:41 +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 08HJlfv7052836; Thu, 17 Sep 2020 19:47:41 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HJlfhc052835; Thu, 17 Sep 2020 19:47:41 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009171947.08HJlfhc052835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 17 Sep 2020 19:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365849 - head/contrib/llvm-project/llvm/lib/Target/X86 X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm-project/llvm/lib/Target/X86 X-SVN-Commit-Revision: 365849 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 19:47:42 -0000 Author: dim Date: Thu Sep 17 19:47:41 2020 New Revision: 365849 URL: https://svnweb.freebsd.org/changeset/base/365849 Log: Merge commit 46673763f from llvm git (by Craig Topper): [X86] Place new constant node in topological order in X86DAGToDAGISel::matchBitExtract Fixes PR47482 This should fix 'Assertion failed: (Op->getNodeId() != -1 && "Node has already selected predecessor node"), function DoInstructionSelection, file /usr/src/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp, line 1149' when compiling part of the project_painter project, while targeting the bdver2 (or higher) CPU. Reported by: jkim MFC after: 6 weeks X-MFC-With: r364284 Modified: head/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Modified: head/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Thu Sep 17 19:43:25 2020 (r365848) +++ head/contrib/llvm-project/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Thu Sep 17 19:47:41 2020 (r365849) @@ -3496,6 +3496,7 @@ bool X86DAGToDAGISel::matchBitExtract(SDNode *Node) { // Shift NBits left by 8 bits, thus producing 'control'. // This makes the low 8 bits to be zero. SDValue C8 = CurDAG->getConstant(8, DL, MVT::i8); + insertDAGNode(*CurDAG, SDValue(Node, 0), C8); SDValue Control = CurDAG->getNode(ISD::SHL, DL, MVT::i32, NBits, C8); insertDAGNode(*CurDAG, SDValue(Node, 0), Control); From owner-svn-src-all@freebsd.org Thu Sep 17 20:21:42 2020 Return-Path: Delivered-To: svn-src-all@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 030EB3ECDA0; Thu, 17 Sep 2020 20:21:42 +0000 (UTC) (envelope-from jhb@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 4BspK15Lw8z4Ywb; Thu, 17 Sep 2020 20:21:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8681:1cb0:a135:cfa3:dd33:fe95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 06C0F288EA; Thu, 17 Sep 2020 20:21:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r365449 - head/sbin/rcorder To: =?UTF-8?Q?Olivier_Cochard-Labb=c3=a9?= , "Andrey V. Elsukov" Cc: src-committers , svn-src-all , svn-src-head References: <202009081036.088AaCk8085096@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <1ccf2cf7-eb01-a200-4335-4674a010f8a1@FreeBSD.org> Date: Thu, 17 Sep 2020 13:21:39 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 20:21:42 -0000 On 9/17/20 10:49 AM, Olivier Cochard-Labbé wrote: > On Tue, Sep 8, 2020 at 12:36 PM Andrey V. Elsukov wrote: > >> Author: ae >> Date: Tue Sep 8 10:36:11 2020 >> New Revision: 365449 >> URL: https://svnweb.freebsd.org/changeset/base/365449 >> >> Log: >> Add a few features to rcorder: >> >> >> > Hi Andrey, > > I've spent some time bisecting an IPSec gateway performance regression on > -head that points to this commit. > > So my bench uses a simple static IPSec aes-gcm-16 setup, and their results > vary a lot between those 2 revisions: > > - r365448: Estimated Equilibrium Ethernet throughput= 1413 Mb/s (maximum > value seen: 1419 Mb/s) > - r365449: Estimated Equilibrium Ethernet throughput= 469 Mb/s (maximum > value seen: 469 Mb/s) > > How could a modification to the rcoder be the source cause of that ? > My rc.conf contains this: > kld_list="aesni" > ipsec_enable="YES" > > So My first thought was that the aesni module wasn't loaded anymore: > Before upgrade: > [root@hp]~# uname -a > FreeBSD hp 13.0-CURRENT FreeBSD 13.0-CURRENT #15 r365448M: Thu Sep 17 > 18:17:58 CEST 2020 olivier@lame4.bsdrp.net:/usr/src/amd64.amd64/sys/amd64 > amd64 > [root@hp]~# kldstat > Id Refs Address Size Name > 1 11 0xffffffff80200000 1ee58b0 kernel > 2 1 0xffffffff82319000 34c8 fdescfs.ko > 3 1 0xffffffff8231d000 a240 aesni.ko > 4 1 0xffffffff82328000 8c98 ioat.ko > 5 1 0xffffffff82331000 e350 ipsec.ko > > Then after upgrade: > > [root@hp]~# uname -a > FreeBSD hp 13.0-CURRENT FreeBSD 13.0-CURRENT #14 r365449M: Thu Sep 17 > 17:01:35 CEST 2020 olivier@lame4.bsdrp.net:/usr/src/amd64.amd64/sys/amd64 > amd64 > [root@hp]~# kldstat > Id Refs Address Size Name > 1 11 0xffffffff80200000 1ee58b0 kernel > 2 1 0xffffffff82319000 34c8 fdescfs.ko > 3 1 0xffffffff8231d000 e350 ipsec.ko > 4 1 0xffffffff8232c000 a240 aesni.ko > 5 1 0xffffffff82337000 8c98 ioat.ko > > => aesni.ko is correctly loaded, so it is not the problem, but notice the > order of the kernel modules that have changed. > Could be this the source of the problem ? Let's try: > > [root@hp]~# service ipsec stop > Clearing ipsec manual keys/policies. > [root@hp]~# kld > kldconfig kldload kldstat kldunload kldxref > [root@hp]~# kldunload ioat > [root@hp]~# kldunload aesni > [root@hp]~# kldunload ipsec > [root@hp]~# kldload aesni > [root@hp]~# kldload ipsec > [root@hp]~# service ipsec start > Installing ipsec manual keys/policies. > [root@hp]~# kldstat > Id Refs Address Size Name > 1 11 0xffffffff80200000 1ee58b0 kernel > 2 1 0xffffffff82319000 34c8 fdescfs.ko > 5 1 0xffffffff82337000 8c98 ioat.ko > 6 1 0xffffffff8231d000 a240 aesni.ko > 7 1 0xffffffff82328000 e350 ipsec.ko > > And after that the IPSec bench results are back to their previous value :-) > So rcorder needs to load aesni before ipsec. I don't think the issue is with rcorder though. I think the reason the ordering matters warrants further investigation. Is aesni not getting used when ipsec is loaded first? You can use dtrace with the script at https://github.com/bsdjhb/kdbg/blob/master/dtrace/crypto_drivers.d to see which driver is being used. Hmm, the crypto driver gets selected when keys for SAs are set, so if /etc/rc.d/ipsec is configuring SAs, then having it run before aesni is loaded would indeed cause this. However, that still isn't an issue with this commit, per se, it just exposed the lack of an explicit ordering requirement of /etc/rc.d/ipsec after loading aesni. The problem though is that kld_list is pretty generic, so it's hard to know when /etc/rc.d/kld should run. Possibly it should even run multiple times where subsequent runs try to load any modules not loaded by the previous runs? I suspect btw that you could just do 'sh /etc/rc.d/ipsec restart' post-boot without unloading any modules which would also fix your benchmark. I think long term we want OCF's notions of sessions to be a bit more fluid such that "client" sessions for things like GELI and IPSec can be backed by one or more "driver" sessions (including "driver" sessions coming and going as devices come and go). That's a fair bit more work however. -- John Baldwin From owner-svn-src-all@freebsd.org Thu Sep 17 20:25:31 2020 Return-Path: Delivered-To: svn-src-all@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 B0BC33ED010; Thu, 17 Sep 2020 20:25:31 +0000 (UTC) (envelope-from gbe@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 4BspPR4CF1z4ZBd; Thu, 17 Sep 2020 20:25:31 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7423CFE19; Thu, 17 Sep 2020 20:25:31 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08HKPVLZ078549; Thu, 17 Sep 2020 20:25:31 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HKPVW8078548; Thu, 17 Sep 2020 20:25:31 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009172025.08HKPVW8078548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Thu, 17 Sep 2020 20:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365850 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 365850 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 20:25:31 -0000 Author: gbe (doc committer) Date: Thu Sep 17 20:25:31 2020 New Revision: 365850 URL: https://svnweb.freebsd.org/changeset/base/365850 Log: bus_dma(9): Some markup fixes - new sentence, new line - no blank before trailing delimiter - whitespace at end of input line MFC after: 3 days Modified: head/share/man/man9/bus_dma.9 Modified: head/share/man/man9/bus_dma.9 ============================================================================== --- head/share/man/man9/bus_dma.9 Thu Sep 17 19:47:41 2020 (r365849) +++ head/share/man/man9/bus_dma.9 Thu Sep 17 20:25:31 2020 (r365850) @@ -63,8 +63,8 @@ .Nm bus_dma_template_init , .Nm bus_dma_template_tag , .Nm bus_dma_template_clone , -.Nm bus_dma_template_fill, -.Nm BUS_DMA_TEMPLATE_FILL, +.Nm bus_dma_template_fill , +.Nm BUS_DMA_TEMPLATE_FILL , .Nm bus_dmamap_create , .Nm bus_dmamap_destroy , .Nm bus_dmamap_load , @@ -707,11 +707,13 @@ on success. .It Fn bus_dma_template_init "*template" "parent" Initializes a .Fa bus_dma_template_t -structure. If the -.Fa parent +structure. +If the +.Fa parent argument is non-NULL, this parent tag is associated with the template and -will be compiled into the dma tag that is later created. The values -of the parent are not copied into the template. During tag creation in +will be compiled into the dma tag that is later created. +The values of the parent are not copied into the template. +During tag creation in .Fn bus_dma_tag_template , any parameters from the parent tag that are more restrictive than what is in the provided template will overwrite what goes into the new tag. @@ -724,21 +726,24 @@ The template is not modified by this function, and can freed upon return. .It Fn bus_dma_template_clone "*template" "dmat" Copies the fields from an existing tag to a template. -The template does not need to be initialized first. All of its fields will -be overwritten by the values contained in the tag. When paired with +The template does not need to be initialized first. +All of its fields will be overwritten by the values contained in the tag. +When paired with .Fn bus_dma_template_tag , this function is useful for creating copies of tags. .It Fn bus_dma_template_fill "*template" "params[]" "count" Fills in the selected fields of the template with the keyed values from the .Fa params -array. This is not meant to be called directly, use +array. +This is not meant to be called directly, use .Fn BUS_DMA_TEMPLATE_FILL instead. .It Fn BUS_DMA_TEMPLATE_FILL "*template" "param ..." Fills in the selected fields of the template with a variable number of -key-value parameters. The macros listed below take an argument of the -specified type and encapsulate it into a key-value structure that is directly -usable as a parameter argument. Muliple parameters may be provided at once. +key-value parameters. +The macros listed below take an argument of the specified type and encapsulate +it into a key-value structure that is directly usable as a parameter argument. +Muliple parameters may be provided at once. .Bd -literal BD_PARENT() void * BD_ALIGNMENT() uintmax_t @@ -752,7 +757,6 @@ usable as a parameter argument. Muliple parameters ma BD_LOCKFUNC() void * BD_LOCKFUNCARG() void * .Ed -.Pp .It Fn bus_dmamap_create "dmat" "flags" "*mapp" Allocates and initializes a DMA map. Arguments are as follows: From owner-svn-src-all@freebsd.org Thu Sep 17 20:32:11 2020 Return-Path: Delivered-To: svn-src-all@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 04BB13ECDD8; Thu, 17 Sep 2020 20:32:11 +0000 (UTC) (envelope-from gbe@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 4BspY66PDtz4ZN3; Thu, 17 Sep 2020 20:32:10 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF095FB6D; Thu, 17 Sep 2020 20:32:10 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08HKWAY6084654; Thu, 17 Sep 2020 20:32:10 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HKWAJ6084653; Thu, 17 Sep 2020 20:32:10 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009172032.08HKWAJ6084653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Thu, 17 Sep 2020 20:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365851 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 365851 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 20:32:11 -0000 Author: gbe (doc committer) Date: Thu Sep 17 20:32:10 2020 New Revision: 365851 URL: https://svnweb.freebsd.org/changeset/base/365851 Log: rmlock(9): Some markup fixes - new sentence, new line MFC after: 3 days Modified: head/share/man/man9/rmlock.9 Modified: head/share/man/man9/rmlock.9 ============================================================================== --- head/share/man/man9/rmlock.9 Thu Sep 17 20:25:31 2020 (r365850) +++ head/share/man/man9/rmlock.9 Thu Sep 17 20:32:10 2020 (r365851) @@ -138,13 +138,14 @@ to It changes lock ordering rules to the same as for .Xr sx 9 locks. -They do not propagate priority to writers, but they do propagate priority to -readers. Note that readers are not permitted to sleep regardless of the flag. +They do not propagate priority to writers, but they do propagate priority to readers. +Note that readers are not permitted to sleep regardless of the flag. .Pp Sleepable read-mostly locks (created with .Fn rms_init ) allow sleeping for both readers and writers, but don't do priority propagation -for either. They follow +for either. +They follow .Xr sx 9 lock ordering. .Ss Macros and Functions @@ -350,8 +351,7 @@ lock must be unlocked. .Xr sleep 9 , .Xr sx 9 .Sh HISTORY -These -functions appeared in +These functions appeared in .Fx 7.0 . .Sh AUTHORS .An -nosplit From owner-svn-src-all@freebsd.org Thu Sep 17 20:35:46 2020 Return-Path: Delivered-To: svn-src-all@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 3132E3ED064; Thu, 17 Sep 2020 20:35:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BspdG02fnz4ZwX; Thu, 17 Sep 2020 20:35:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2B6710003; Thu, 17 Sep 2020 20:35:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08HKZjs8084896; Thu, 17 Sep 2020 20:35:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HKZjwS084895; Thu, 17 Sep 2020 20:35:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009172035.08HKZjwS084895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 17 Sep 2020 20:35:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365852 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 365852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 20:35:46 -0000 Author: kevans Date: Thu Sep 17 20:35:45 2020 New Revision: 365852 URL: https://svnweb.freebsd.org/changeset/base/365852 Log: Revert r361257: bsdinstall: do a `certctl rehash` upon installation [...] As of r365829, any given base distribution set will now include the /etc/ssl symlinks that this rehash would've otherwise installed. This extra step is no longer required. MFC after: 1 week X-MFC-With: r365837 Modified: head/usr.sbin/bsdinstall/scripts/config Modified: head/usr.sbin/bsdinstall/scripts/config ============================================================================== --- head/usr.sbin/bsdinstall/scripts/config Thu Sep 17 20:32:10 2020 (r365851) +++ head/usr.sbin/bsdinstall/scripts/config Thu Sep 17 20:35:45 2020 (r365852) @@ -55,9 +55,6 @@ cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot # Set up other things from installed config chroot $BSDINSTALL_CHROOT /usr/bin/newaliases > /dev/null 2>&1 -if [ -x $BSDINSTALL_CHROOT/usr/sbin/certctl ]; then - chroot $BSDINSTALL_CHROOT /usr/sbin/certctl rehash -fi exit 0 From owner-svn-src-all@freebsd.org Thu Sep 17 20:37:55 2020 Return-Path: Delivered-To: svn-src-all@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 1F6763ED5E6; Thu, 17 Sep 2020 20:37:55 +0000 (UTC) (envelope-from gbe@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 4Bspgk75B4z4b8n; Thu, 17 Sep 2020 20:37:54 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6A7F10004; Thu, 17 Sep 2020 20:37:54 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08HKbskj085166; Thu, 17 Sep 2020 20:37:54 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HKbsDB085165; Thu, 17 Sep 2020 20:37:54 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009172037.08HKbsDB085165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Thu, 17 Sep 2020 20:37:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365853 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 365853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 20:37:55 -0000 Author: gbe (doc committer) Date: Thu Sep 17 20:37:54 2020 New Revision: 365853 URL: https://svnweb.freebsd.org/changeset/base/365853 Log: domainset(9): Some markup fixes - new sentence, new line - whitespace at end of input line MFC after: 3 days Modified: head/share/man/man9/domainset.9 Modified: head/share/man/man9/domainset.9 ============================================================================== --- head/share/man/man9/domainset.9 Thu Sep 17 20:35:45 2020 (r365852) +++ head/share/man/man9/domainset.9 Thu Sep 17 20:37:54 2020 (r365853) @@ -88,8 +88,9 @@ memory is accessed from many CPUs that are not in the .It Dv DOMAINSET_POLICY_PREFER Memory is allocated from the node in the .Vt prefer -member. The preferred node must be set in the allowed mask. -If the preferred node is out of memory the allocation falls back to +member. +The preferred node must be set in the allowed mask. +If the preferred node is out of memory the allocation falls back to round-robin among allowed sets. .It Dv DOMAINSET_POLICY_INTERLEAVE Memory is allocated in a striped fashion with multiple pages @@ -128,8 +129,7 @@ function takes a partially filled in domainset as a ke valid domainset or NULL. It is critical that consumers not use domainsets that have not been returned by this function. -.Vt -domainset +.Vt domainset is an immutable type that is shared among all matching keys and must not be modified after return. .Pp @@ -138,9 +138,8 @@ The function is provided as a convenience for modifying or viewing domainsets that are not accessible via .Xr cpuset 2 . -It is intended for use with +It is intended for use with .Xr sysctl 9 . -.Pp .Sh SEE ALSO .Xr cpuset 1 , .Xr cpuset 2 , From owner-svn-src-all@freebsd.org Thu Sep 17 20:42:42 2020 Return-Path: Delivered-To: svn-src-all@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 5775E3EDB28; Thu, 17 Sep 2020 20:42:42 +0000 (UTC) (envelope-from gbe@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 4BspnG1PQ1z4bgj; Thu, 17 Sep 2020 20:42:42 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 133AD1027C; Thu, 17 Sep 2020 20:42:42 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08HKgfh6090954; Thu, 17 Sep 2020 20:42:41 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HKgfpI090953; Thu, 17 Sep 2020 20:42:41 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009172042.08HKgfpI090953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Thu, 17 Sep 2020 20:42:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365854 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 365854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 20:42:42 -0000 Author: gbe (doc committer) Date: Thu Sep 17 20:42:41 2020 New Revision: 365854 URL: https://svnweb.freebsd.org/changeset/base/365854 Log: VOP_INACTIVE(9): Remove trailing whitespace MFC after: 3 days Modified: head/share/man/man9/VOP_INACTIVE.9 Modified: head/share/man/man9/VOP_INACTIVE.9 ============================================================================== --- head/share/man/man9/VOP_INACTIVE.9 Thu Sep 17 20:37:54 2020 (r365853) +++ head/share/man/man9/VOP_INACTIVE.9 Thu Sep 17 20:42:41 2020 (r365854) @@ -57,7 +57,7 @@ to exclusive without sleeping. This may be because the reference count reaches zero or it may be that the file system is being forcibly unmounted while there are open files. -It can be used to reclaim space on the last close of an +It can be used to reclaim space on the last close of an .Sq open but deleted file. .Pp From owner-svn-src-all@freebsd.org Thu Sep 17 20:50:03 2020 Return-Path: Delivered-To: svn-src-all@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 234413EDB64; Thu, 17 Sep 2020 20:50:03 +0000 (UTC) (envelope-from gbe@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 4Bspxl03vLz4bty; Thu, 17 Sep 2020 20:50:03 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB11210024; Thu, 17 Sep 2020 20:50:02 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08HKo2O3091380; Thu, 17 Sep 2020 20:50:02 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HKo2Ok091379; Thu, 17 Sep 2020 20:50:02 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009172050.08HKo2Ok091379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Thu, 17 Sep 2020 20:50:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365855 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 365855 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 20:50:03 -0000 Author: gbe (doc committer) Date: Thu Sep 17 20:50:02 2020 New Revision: 365855 URL: https://svnweb.freebsd.org/changeset/base/365855 Log: crypto_buffer(9): Sort the SEE ALSO section MFC after: 3 days Modified: head/share/man/man9/crypto_buffer.9 Modified: head/share/man/man9/crypto_buffer.9 ============================================================================== --- head/share/man/man9/crypto_buffer.9 Thu Sep 17 20:42:41 2020 (r365854) +++ head/share/man/man9/crypto_buffer.9 Thu Sep 17 20:50:02 2020 (r365855) @@ -198,7 +198,7 @@ A scatter/gather list of kernel buffers as described i A network memory buffer as described in .Xr mbuf 9 . .It Dv CRYPTO_BUF_VMPAGE -A scatter/gather list of +A scatter/gather list of .Vt vm_page_t structures describing pages in the kernel's address space. This buffer type is only available if @@ -317,11 +317,10 @@ returns the length in bytes of a contiguous segment. returns true if the request uses a separate output buffer. .Sh SEE ALSO .Xr ipsec 4 , -.Xr bus_dma 9 , .Xr crypto 7 , .Xr crypto 9 , -.Xr crypto_request 9 , .Xr crypto_driver 9 , +.Xr crypto_request 9 , .Xr crypto_session 9 , -.Xr mbuf 9 +.Xr mbuf 9 , .Xr uio 9 From owner-svn-src-all@freebsd.org Thu Sep 17 20:53:24 2020 Return-Path: Delivered-To: svn-src-all@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 D0CCC3EDDB4; Thu, 17 Sep 2020 20:53:24 +0000 (UTC) (envelope-from gbe@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 4Bsq1c58cRz4cRb; Thu, 17 Sep 2020 20:53:24 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9442410397; Thu, 17 Sep 2020 20:53:24 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08HKrOXj096910; Thu, 17 Sep 2020 20:53:24 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HKrOxV096909; Thu, 17 Sep 2020 20:53:24 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009172053.08HKrOxV096909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Thu, 17 Sep 2020 20:53:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365856 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 365856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 20:53:24 -0000 Author: gbe (doc committer) Date: Thu Sep 17 20:53:24 2020 New Revision: 365856 URL: https://svnweb.freebsd.org/changeset/base/365856 Log: mbuf(9): Some markup fixes - whitespace at end of input line - no blank before trailing delimiter: Dv MJUM16BYTES MFC after: 3 days Modified: head/share/man/man9/mbuf.9 Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Thu Sep 17 20:50:02 2020 (r365855) +++ head/share/man/man9/mbuf.9 Thu Sep 17 20:53:24 2020 (r365856) @@ -574,7 +574,7 @@ for non-critical paths. Allocate an .Vt mbuf with enough space to hold specified amount of data. -If the size is is larger than +If the size is is larger than .Dv MJUMPAGESIZE , NULL will be returned. .It Fn m_getm orig len how type @@ -640,7 +640,7 @@ but the specified of the cluster to be allocated must be one of .Dv MCLBYTES , MJUMPAGESIZE , MJUM9BYTES , or -.Dv MJUM16BYTES. +.Dv MJUM16BYTES . .It Fn m_free mbuf Frees .Vt mbuf . From owner-svn-src-all@freebsd.org Thu Sep 17 20:55:43 2020 Return-Path: Delivered-To: svn-src-all@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 591D63EDBF4; Thu, 17 Sep 2020 20:55:43 +0000 (UTC) (envelope-from gbe@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 4Bsq4H1hzzz4chQ; Thu, 17 Sep 2020 20:55:43 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CC1E1030A; Thu, 17 Sep 2020 20:55:43 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08HKtgxf097091; Thu, 17 Sep 2020 20:55:42 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HKtgx0097090; Thu, 17 Sep 2020 20:55:42 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009172055.08HKtgx0097090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Thu, 17 Sep 2020 20:55:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365857 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 365857 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 20:55:43 -0000 Author: gbe (doc committer) Date: Thu Sep 17 20:55:42 2020 New Revision: 365857 URL: https://svnweb.freebsd.org/changeset/base/365857 Log: pwmbus(9): some markup fixes - whitespace at end of input line MFC after: 3 days Modified: head/share/man/man9/pwmbus.9 Modified: head/share/man/man9/pwmbus.9 ============================================================================== --- head/share/man/man9/pwmbus.9 Thu Sep 17 20:53:24 2020 (r365856) +++ head/share/man/man9/pwmbus.9 Thu Sep 17 20:55:42 2020 (r365857) @@ -68,11 +68,11 @@ argument is the duration in nanoseconds of the on port .Pp Some PWM hardware is organized as a single controller with multiple channels. Channel numbers count up from zero. -When multiple channels are present, they sometimes share a common clock or +When multiple channels are present, they sometimes share a common clock or other resources. -In such cases, changing the period or duty cycle of any one channel may affect +In such cases, changing the period or duty cycle of any one channel may affect other channels within the hardware which share the same resources. -Consult the documentation for the underlying PWM hardware device driver for +Consult the documentation for the underlying PWM hardware device driver for details on channels that share resources. .Sh INTERFACE .Bl -tag -width indent From owner-svn-src-all@freebsd.org Thu Sep 17 21:08:12 2020 Return-Path: Delivered-To: svn-src-all@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 C59133EE48F; Thu, 17 Sep 2020 21:08:12 +0000 (UTC) (envelope-from gbe@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 4BsqLh4pFfz4dCH; Thu, 17 Sep 2020 21:08:12 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 844FB1013C; Thu, 17 Sep 2020 21:08:12 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08HL8CFS003990; Thu, 17 Sep 2020 21:08:12 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HL8BoO003985; Thu, 17 Sep 2020 21:08:11 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009172108.08HL8BoO003985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Thu, 17 Sep 2020 21:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365858 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 365858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 21:08:12 -0000 Author: gbe (doc committer) Date: Thu Sep 17 21:08:11 2020 New Revision: 365858 URL: https://svnweb.freebsd.org/changeset/base/365858 Log: man(9): Some markup fixes - whitespace at end of input line - skipping paragraph macro: Pp after Sh MFC after: 3 days Modified: head/share/man/man9/EVENTHANDLER.9 head/share/man/man9/OF_node_from_xref.9 head/share/man/man9/ieee80211.9 head/share/man/man9/socket.9 head/share/man/man9/tcp_functions.9 head/share/man/man9/ucred.9 Modified: head/share/man/man9/EVENTHANDLER.9 ============================================================================== --- head/share/man/man9/EVENTHANDLER.9 Thu Sep 17 20:55:42 2020 (r365857) +++ head/share/man/man9/EVENTHANDLER.9 Thu Sep 17 21:08:11 2020 (r365858) @@ -299,7 +299,7 @@ Callback invoked when an interfance has been removed f .It Vt ifaddr_event Callbacks invoked when an address is set up on a network interface. .It Vt ifaddr_event_ext -Callback invoked when an address has been added or removed from an interface. +Callback invoked when an address has been added or removed from an interface. .It Vt if_clone_event Callbacks invoked when an interface is cloned. .It Vt iflladdr_event Modified: head/share/man/man9/OF_node_from_xref.9 ============================================================================== --- head/share/man/man9/OF_node_from_xref.9 Thu Sep 17 20:55:42 2020 (r365857) +++ head/share/man/man9/OF_node_from_xref.9 Thu Sep 17 21:08:11 2020 (r365858) @@ -64,7 +64,7 @@ the values of "phandle" properties. and .Fn OF_xref_from_node are used to perform conversion between these two kinds of node -identifiers. +identifiers. .Pp .Fn OF_node_from_xref returns the kernel phandle for the effective phandle Modified: head/share/man/man9/ieee80211.9 ============================================================================== --- head/share/man/man9/ieee80211.9 Thu Sep 17 20:55:42 2020 (r365857) +++ head/share/man/man9/ieee80211.9 Thu Sep 17 21:08:11 2020 (r365858) @@ -706,7 +706,7 @@ and were later ported to This man page was updated with the information from .Nx .Nm -man page. +man page. .Sh AUTHORS .An -nosplit The original Modified: head/share/man/man9/socket.9 ============================================================================== --- head/share/man/man9/socket.9 Thu Sep 17 20:55:42 2020 (r365857) +++ head/share/man/man9/socket.9 Thu Sep 17 21:08:11 2020 (r365858) @@ -56,7 +56,7 @@ .Fn sodisconnect "struct socket *so" .Ft void .Fo sodtor_set -.Fa "struct socket *so" +.Fa "struct socket *so" .Fa "void (*func)(struct socket *)" .Fc .Ft struct sockaddr * Modified: head/share/man/man9/tcp_functions.9 ============================================================================== --- head/share/man/man9/tcp_functions.9 Thu Sep 17 20:55:42 2020 (r365857) +++ head/share/man/man9/tcp_functions.9 Thu Sep 17 21:08:11 2020 (r365858) @@ -281,8 +281,9 @@ for that socket, the kernel will call the function poi .Va tfb_tcp_handoff_ok field. The function should return 0 if the user is allowed to switch the socket to use -the TCP stack. Otherwise, the function should return an error code, which will -be returned to the user. +the TCP stack. +Otherwise, the function should return an error code, which will be returned to +the user. If the .Va tfb_tcp_handoff_ok field is Modified: head/share/man/man9/ucred.9 ============================================================================== --- head/share/man/man9/ucred.9 Thu Sep 17 20:55:42 2020 (r365857) +++ head/share/man/man9/ucred.9 Thu Sep 17 21:08:11 2020 (r365858) @@ -143,7 +143,6 @@ and appropriately sets fields in the latter that are n the former (e.g., .Va cr_version ) . -.Pp .Sh RETURN VALUES .Fn crget , .Fn crhold , From owner-svn-src-all@freebsd.org Thu Sep 17 21:24:12 2020 Return-Path: Delivered-To: svn-src-all@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 2A2103EE83A; Thu, 17 Sep 2020 21:24:12 +0000 (UTC) (envelope-from gbe@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 4Bsqj80HwDz4f34; Thu, 17 Sep 2020 21:24:12 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C77E31090B; Thu, 17 Sep 2020 21:24:11 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08HLOBjV015641; Thu, 17 Sep 2020 21:24:11 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HLOBpp015640; Thu, 17 Sep 2020 21:24:11 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009172124.08HLOBpp015640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Thu, 17 Sep 2020 21:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365859 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 365859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 21:24:12 -0000 Author: gbe (doc committer) Date: Thu Sep 17 21:24:11 2020 New Revision: 365859 URL: https://svnweb.freebsd.org/changeset/base/365859 Log: arch(7): Some markup fixes - no blank before trailing delimiter MFC after: 3 days Modified: head/share/man/man7/arch.7 Modified: head/share/man/man7/arch.7 ============================================================================== --- head/share/man/man7/arch.7 Thu Sep 17 21:08:11 2020 (r365858) +++ head/share/man/man7/arch.7 Thu Sep 17 21:24:11 2020 (r365859) @@ -86,7 +86,6 @@ This table shows the first .Fx release to support each architecture, and, for discontinued architectures, the final release. -.Pp .Bl -column -offset indent "Architecture" "Initial Release" "Final Release" .It Sy Architecture Ta Sy Initial Release Ta Sy Final Release .It aarch64 Ta 11.0 @@ -341,24 +340,24 @@ Architecture-specific macros: .Bl -column -offset indent "Architecture" "Predefined macros" .It Sy Architecture Ta Sy Predefined macros .It aarch64 Ta Dv __aarch64__ -.It amd64 Ta Dv __amd64__, Dv __x86_64__ -.It armv6 Ta Dv __arm__, Dv __ARM_ARCH >= 6 -.It armv7 Ta Dv __arm__, Dv __ARM_ARCH >= 7 +.It amd64 Ta Dv __amd64__ , Dv __x86_64__ +.It armv6 Ta Dv __arm__ , Dv __ARM_ARCH >= 6 +.It armv7 Ta Dv __arm__ , Dv __ARM_ARCH >= 7 .It i386 Ta Dv __i386__ -.It mips Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_o32 -.It mipsel Ta Dv __mips__, Dv __mips_o32 -.It mipselhf Ta Dv __mips__, Dv __mips_o32 -.It mipshf Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_o32 -.It mipsn32 Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_n32 -.It mips64 Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_n64 -.It mips64el Ta Dv __mips__, Dv __mips_n64 -.It mips64elhf Ta Dv __mips__, Dv __mips_n64 -.It mips64hf Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_n64 +.It mips Ta Dv __mips__ , Dv __MIPSEB__ , Dv __mips_o32 +.It mipsel Ta Dv __mips__ , Dv __mips_o32 +.It mipselhf Ta Dv __mips__ , Dv __mips_o32 +.It mipshf Ta Dv __mips__ , Dv __MIPSEB__ , Dv __mips_o32 +.It mipsn32 Ta Dv __mips__ , Dv __MIPSEB__ , Dv __mips_n32 +.It mips64 Ta Dv __mips__ , Dv __MIPSEB__ , Dv __mips_n64 +.It mips64el Ta Dv __mips__ , Dv __mips_n64 +.It mips64elhf Ta Dv __mips__ , Dv __mips_n64 +.It mips64hf Ta Dv __mips__ , Dv __MIPSEB__ , Dv __mips_n64 .It powerpc Ta Dv __powerpc__ -.It powerpcspe Ta Dv __powerpc__, Dv __SPE__ -.It powerpc64 Ta Dv __powerpc__, Dv __powerpc64__ -.It riscv64 Ta Dv __riscv, Dv __riscv_xlen == 64 -.It riscv64sf Ta Dv __riscv, Dv __riscv_xlen == 64, Dv __riscv_float_abi_soft +.It powerpcspe Ta Dv __powerpc__ , Dv __SPE__ +.It powerpc64 Ta Dv __powerpc__ , Dv __powerpc64__ +.It riscv64 Ta Dv __riscv , Dv __riscv_xlen == 64 +.It riscv64sf Ta Dv __riscv , Dv __riscv_xlen == 64 , Dv __riscv_float_abi_soft .El .Pp Compilers may define additional variants of architecture-specific macros. From owner-svn-src-all@freebsd.org Thu Sep 17 21:51:06 2020 Return-Path: Delivered-To: svn-src-all@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 5C7BE3EF604; Thu, 17 Sep 2020 21:51:06 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BsrJB1sPxz4gHj; Thu, 17 Sep 2020 21:51:06 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 247A310C9B; Thu, 17 Sep 2020 21:51:06 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08HLp6Y1030987; Thu, 17 Sep 2020 21:51:06 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HLp6RU030986; Thu, 17 Sep 2020 21:51:06 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <202009172151.08HLp6RU030986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 17 Sep 2020 21:51:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365860 - stable/12/sys/cddl/compat/opensolaris/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: stable/12/sys/cddl/compat/opensolaris/kern X-SVN-Commit-Revision: 365860 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 21:51:06 -0000 Author: allanjude Date: Thu Sep 17 21:51:05 2020 New Revision: 365860 URL: https://svnweb.freebsd.org/changeset/base/365860 Log: Update naming of per-dataset counters introduced in r365689 Upstream OpenZFS is changing the structure of the sysctl mibs to avoid having a / in the element name. Chase this change here to avoid introducing a new sysctl that will change named between 12.2 and 13.0 MFC-with: 365689 Relnotes: yes (fix example) Sponsored by: Klara Inc. Modified: stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c Modified: stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c ============================================================================== --- stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c Thu Sep 17 21:24:11 2020 (r365859) +++ stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c Thu Sep 17 21:51:05 2020 (r365860) @@ -55,6 +55,7 @@ kstat_create(char *module, int instance, char *name, c { struct sysctl_oid *root; kstat_t *ksp; + char *pool; KASSERT(instance == 0, ("instance=%d", instance)); KASSERT(type == KSTAT_TYPE_NAMED, ("type=%hhu", type)); @@ -70,9 +71,18 @@ kstat_create(char *module, int instance, char *name, c ksp->ks_update = kstat_default_update; /* + * Some kstats use a module name like "zfs/poolname" to distinguish a + * set of kstats belonging to a specific pool. Split on '/' to add an + * extra node for the pool name if needed. + */ + pool = strchr(module, '/'); + if (pool != NULL) + *pool++ = '\0'; + + /* * Create sysctl tree for those statistics: * - * kstat.... + * kstat.[.].. */ sysctl_ctx_init(&ksp->ks_sysctl_ctx); root = SYSCTL_ADD_NODE(&ksp->ks_sysctl_ctx, @@ -84,11 +94,26 @@ kstat_create(char *module, int instance, char *name, c free(ksp, M_KSTAT); return (NULL); } + if (pool != NULL) { + root = SYSCTL_ADD_NODE(&ksp->ks_sysctl_ctx, + SYSCTL_CHILDREN(root), OID_AUTO, pool, CTLFLAG_RW, 0, ""); + if (root == NULL) { + printf("%s: Cannot create kstat.%s.%s tree!\n", + __func__, module, pool); + sysctl_ctx_free(&ksp->ks_sysctl_ctx); + free(ksp, M_KSTAT); + return (NULL); + } + } root = SYSCTL_ADD_NODE(&ksp->ks_sysctl_ctx, SYSCTL_CHILDREN(root), OID_AUTO, class, CTLFLAG_RW, 0, ""); if (root == NULL) { - printf("%s: Cannot create kstat.%s.%s tree!\n", __func__, - module, class); + if (pool != NULL) + printf("%s: Cannot create kstat.%s.%s.%s tree!\n", + __func__, module, pool, class); + else + printf("%s: Cannot create kstat.%s.%s tree!\n", + __func__, module, class); sysctl_ctx_free(&ksp->ks_sysctl_ctx); free(ksp, M_KSTAT); return (NULL); @@ -96,8 +121,13 @@ kstat_create(char *module, int instance, char *name, c root = SYSCTL_ADD_NODE(&ksp->ks_sysctl_ctx, SYSCTL_CHILDREN(root), OID_AUTO, name, CTLFLAG_RW, 0, ""); if (root == NULL) { - printf("%s: Cannot create kstat.%s.%s.%s tree!\n", __func__, - module, class, name); + if (pool != NULL) + printf("%s: Cannot create kstat.%s.%s.%s.%s " + "tree!\n", __func__, module, pool, class, + name); + else + printf("%s: Cannot create kstat.%s.%s.%s " + "tree!\n", __func__, module, class, name); sysctl_ctx_free(&ksp->ks_sysctl_ctx); free(ksp, M_KSTAT); return (NULL); From owner-svn-src-all@freebsd.org Thu Sep 17 22:14:14 2020 Return-Path: Delivered-To: svn-src-all@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 192C03EF88C; Thu, 17 Sep 2020 22:14: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 4Bsrps6jrkz3T0B; Thu, 17 Sep 2020 22:14:13 +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 CA3FB1122C; Thu, 17 Sep 2020 22:14:13 +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 08HMEDKS046318; Thu, 17 Sep 2020 22:14:13 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HMEBJI046308; Thu, 17 Sep 2020 22:14:11 GMT (envelope-from np@FreeBSD.org) Message-Id: <202009172214.08HMEBJI046308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 17 Sep 2020 22:14:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365861 - in head/sys: conf dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys: conf dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware X-SVN-Commit-Revision: 365861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 22:14:14 -0000 Author: np Date: Thu Sep 17 22:14:11 2020 New Revision: 365861 URL: https://svnweb.freebsd.org/changeset/base/365861 Log: cxgbe(4): Update T4/5/6 firmwares to 1.25.0.0. Obtained from: Chelsio Communications MFC after: 3 days Sponsored by: Chelsio Communications Added: head/sys/dev/cxgbe/firmware/t4fw-1.25.0.0.bin (contents, props changed) head/sys/dev/cxgbe/firmware/t5fw-1.25.0.0.bin (contents, props changed) head/sys/dev/cxgbe/firmware/t6fw-1.25.0.0.bin (contents, props changed) Deleted: head/sys/dev/cxgbe/firmware/t4fw-1.24.12.0.bin head/sys/dev/cxgbe/firmware/t5fw-1.24.12.0.bin head/sys/dev/cxgbe/firmware/t6fw-1.24.12.0.bin Modified: head/sys/conf/files head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/dev/cxgbe/firmware/t6fw_cfg.txt head/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt head/sys/modules/cxgbe/t4_firmware/Makefile head/sys/modules/cxgbe/t5_firmware/Makefile head/sys/modules/cxgbe/t6_firmware/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Sep 17 21:51:05 2020 (r365860) +++ head/sys/conf/files Thu Sep 17 22:14:11 2020 (r365861) @@ -1514,7 +1514,7 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.24.12.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.25.0.0.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t4fw.fw" @@ -1548,7 +1548,7 @@ t5fw.fwo optional cxgbe \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.24.12.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.25.0.0.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t5fw.fw" @@ -1582,7 +1582,7 @@ t6fw.fwo optional cxgbe \ no-implicit-rule \ clean "t6fw.fwo" t6fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t6fw-1.24.12.0.bin" \ + dependency "$S/dev/cxgbe/firmware/t6fw-1.25.0.0.bin" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t6fw.fw" Added: head/sys/dev/cxgbe/firmware/t4fw-1.25.0.0.bin ============================================================================== Modified: head/sys/dev/cxgbe/firmware/t4fw_interface.h ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_interface.h Thu Sep 17 21:51:05 2020 (r365860) +++ head/sys/dev/cxgbe/firmware/t4fw_interface.h Thu Sep 17 22:14:11 2020 (r365861) @@ -4690,6 +4690,7 @@ enum fw_caps_config_crypto { FW_CAPS_CONFIG_CRYPTO_LOOKASIDE = 0x00000001, FW_CAPS_CONFIG_TLSKEYS = 0x00000002, FW_CAPS_CONFIG_IPSEC_INLINE = 0x00000004, + FW_CAPS_CONFIG_TLS_HW = 0x00000008, }; enum fw_caps_config_fcoe { @@ -4838,6 +4839,7 @@ enum fw_params_param_dev { FW_PARAMS_PARAM_DEV_TCB_CACHE_FLUSH = 0x2D, FW_PARAMS_PARAM_DEV_FILTER = 0x2E, FW_PARAMS_PARAM_DEV_CLIP2_CMD = 0x2F, + FW_PARAMS_PARAM_DEV_KTLS_HW = 0x31, }; /* @@ -4874,6 +4876,13 @@ enum fw_params_param_dev_filter{ FW_PARAM_DEV_FILTER_MODE_MASK = 0x01, }; +enum fw_params_param_dev_ktls_hw { + FW_PARAMS_PARAM_DEV_KTLS_HW_DISABLE = 0x00, + FW_PARAMS_PARAM_DEV_KTLS_HW_ENABLE = 0x01, + FW_PARAMS_PARAM_DEV_KTLS_HW_USER_DISABLE = 0x00, + FW_PARAMS_PARAM_DEV_KTLS_HW_USER_ENABLE = 0x01, +}; + enum fw_params_param_dev_fwcache { FW_PARAM_DEV_FWCACHE_FLUSH = 0x00, FW_PARAM_DEV_FWCACHE_FLUSHINV = 0x01, @@ -9638,6 +9647,7 @@ struct fw_debug_cmd { enum fw_diag_cmd_type { FW_DIAG_CMD_TYPE_OFLDIAG = 0, + FW_DIAG_CMD_TYPE_MEM_TEST_DIAG, }; enum fw_diag_cmd_ofldiag_op { @@ -9654,6 +9664,22 @@ enum fw_diag_cmd_ofldiag_status { FW_DIAG_CMD_OFLDIAG_STATUS_PASSED, }; +enum fw_diag_cmd_memdiag_op { + FW_DIAG_CMD_MEMDIAG_TEST_START=1, + FW_DIAG_CMD_MEMDIAG_TEST_STOP, + FW_DIAG_CMD_MEMDIAG_TEST_STATUS, + FW_DIAG_CMD_MEMDIAG_TEST_INIT, +}; + + +enum fw_diag_cmd_memdiag_status { + FW_DIAG_CMD_MEMDIAG_STATUS_NONE, + FW_DIAG_CMD_MEMDIAG_STATUS_RUNNING, + FW_DIAG_CMD_MEMDIAG_STATUS_FAILED, + FW_DIAG_CMD_MEMDIAG_STATUS_PASSED +}; + + struct fw_diag_cmd { __be32 op_type; __be32 len16_pkd; @@ -9664,15 +9690,33 @@ struct fw_diag_cmd { __be16 test_status; __be32 duration; } ofldiag; + struct fw_diag_test_memtest_diag { + __u8 test_op; + __u8 test_status; + __be16 size; /* in KB */ + __be32 duration; /* in seconds */ + } memdiag; } u; }; -#define S_FW_DIAG_CMD_TYPE 0 -#define M_FW_DIAG_CMD_TYPE 0xff -#define V_FW_DIAG_CMD_TYPE(x) ((x) << S_FW_DIAG_CMD_TYPE) -#define G_FW_DIAG_CMD_TYPE(x) \ - (((x) >> S_FW_DIAG_CMD_TYPE) & M_FW_DIAG_CMD_TYPE) +#define S_FW_DIAG_CMD_OPCODE 24 +#define M_FW_DIAG_CMD_OPCODE 0xff +#define V_FW_DIAG_CMD_OPCODE(x) ((x) << S_FW_DIAG_CMD_OPCODE) +#define G_FW_DIAG_CMD_OPCODE(x) \ + (((x) >> S_FW_DIAG_CMD_OPCODE) & M_FW_DIAG_CMD_OPCODE) +#define S_FW_DIAG_CMD_TYPE 0 +#define M_FW_DIAG_CMD_TYPE 0xff +#define V_FW_DIAG_CMD_TYPE(x) ((x) << S_FW_DIAG_CMD_TYPE) +#define G_FW_DIAG_CMD_TYPE(x) \ + (((x) >> S_FW_DIAG_CMD_TYPE) & M_FW_DIAG_CMD_TYPE) + +#define S_FW_DIAG_CMD_LEN16 0 +#define M_FW_DIAG_CMD_LEN16 0xff +#define V_FW_DIAG_CMD_LEN16(x) ((x) << S_FW_DIAG_CMD_LEN16) +#define G_FW_DIAG_CMD_LEN16(x) \ + (((x) >> S_FW_DIAG_CMD_LEN16) & M_FW_DIAG_CMD_LEN16) + struct fw_hma_cmd { __be32 op_pkd; __be32 retval_len16; @@ -9939,18 +9983,18 @@ enum fw_hdr_chip { enum { T4FW_VERSION_MAJOR = 1, - T4FW_VERSION_MINOR = 24, - T4FW_VERSION_MICRO = 12, + T4FW_VERSION_MINOR = 25, + T4FW_VERSION_MICRO = 0, T4FW_VERSION_BUILD = 0, T5FW_VERSION_MAJOR = 1, - T5FW_VERSION_MINOR = 24, - T5FW_VERSION_MICRO = 12, + T5FW_VERSION_MINOR = 25, + T5FW_VERSION_MICRO = 0, T5FW_VERSION_BUILD = 0, T6FW_VERSION_MAJOR = 1, - T6FW_VERSION_MINOR = 24, - T6FW_VERSION_MICRO = 12, + T6FW_VERSION_MINOR = 25, + T6FW_VERSION_MICRO = 0, T6FW_VERSION_BUILD = 0, }; Added: head/sys/dev/cxgbe/firmware/t5fw-1.25.0.0.bin ============================================================================== Added: head/sys/dev/cxgbe/firmware/t6fw-1.25.0.0.bin ============================================================================== Modified: head/sys/dev/cxgbe/firmware/t6fw_cfg.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t6fw_cfg.txt Thu Sep 17 21:51:05 2020 (r365860) +++ head/sys/dev/cxgbe/firmware/t6fw_cfg.txt Thu Sep 17 22:14:11 2020 (r365861) @@ -41,8 +41,8 @@ # TP OFLD MTUs tp_mtus = 88, 256, 512, 576, 808, 1024, 1280, 1488, 1500, 2002, 2048, 4096, 4352, 8192, 9000, 9600 - # enable TP_OUT_CONFIG.IPIDSPLITMODE and CRXPKTENC - reg[0x7d04] = 0x00010008/0x00010008 + # enable TP_OUT_CONFIG.IPIDSplitMode, CRxPktEnc, and CCplAckMode. + reg[0x7d04] = 0x00012008/0x00012008 # TP_GLOBAL_CONFIG reg[0x7d08] = 0x00000800/0x00000800 # set IssFromCplEnable @@ -272,7 +272,7 @@ [fini] version = 0x1 - checksum = 0x4528a6ac + checksum = 0x13640470 # # $FreeBSD$ # Modified: head/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt Thu Sep 17 21:51:05 2020 (r365860) +++ head/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt Thu Sep 17 22:14:11 2020 (r365861) @@ -110,7 +110,8 @@ sge_dbq_timer = 3, 2, 1, 5, 7, 9, 12, 16 # enable TP_OUT_CONFIG.IPIDSPLITMODE - reg[0x7d04] = 0x00010000/0x00010000 + # Set TP_OUT_CONFIG.CCplAckMode to get srtt/rttvar + reg[0x7d04] = 0x00012000/0x00012000 reg[0x7dc0] = 0x0e2f8849 # TP_SHIFT_CNT @@ -200,6 +201,9 @@ hma_size = 92 # Size (in MBs) of host memory expected hma_regions = stag,pbl,rq # What all regions to place in host memory + #enable bottleneck-bw congestion control mode + #ofld_flags = 4 + # Some "definitions" to make the rest of this a bit more readable. We support # 4 ports, 3 functions (NIC, FCoE and iSCSI), scaling up to 8 "CPU Queue Sets" # per function per port ... @@ -426,7 +430,7 @@ nserver = 496 # number of server region entries nhash = 12288 # number of hash region entries nhpfilter = 64 # number of high priority filter region entries - protocol = nic_vm, ofld, rddp, rdmac, iscsi_initiator_pdu, iscsi_target_pdu, iscsi_t10dif, tlskeys, crypto_lookaside, ipsec_inline, nic_hashfilter + protocol = nic_vm, ofld, rddp, rdmac, iscsi_initiator_pdu, iscsi_target_pdu, iscsi_t10dif, tlskeys, crypto_lookaside, ipsec_inline, nic_hashfilter, nic_ktls_ofld tp_l2t = 3072 tp_ddp = 2 tp_ddp_iscsi = 2 @@ -588,7 +592,7 @@ [fini] version = 0x1425001d - checksum = 0x14a022cd + checksum = 0xa1403d73 # Total resources used by above allocations: # Virtual Interfaces: 104 @@ -599,4 +603,4 @@ # Virtual Functions: 64 # # $FreeBSD$ -# \ No newline at end of file +# Modified: head/sys/modules/cxgbe/t4_firmware/Makefile ============================================================================== --- head/sys/modules/cxgbe/t4_firmware/Makefile Thu Sep 17 21:51:05 2020 (r365860) +++ head/sys/modules/cxgbe/t4_firmware/Makefile Thu Sep 17 22:14:11 2020 (r365861) @@ -17,7 +17,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T4FW_VER= 1.24.12.0 +T4FW_VER= 1.25.0.0 FIRMWS+= t4fw-${T4FW_VER}.bin:t4fw:${T4FW_VER} .include Modified: head/sys/modules/cxgbe/t5_firmware/Makefile ============================================================================== --- head/sys/modules/cxgbe/t5_firmware/Makefile Thu Sep 17 21:51:05 2020 (r365860) +++ head/sys/modules/cxgbe/t5_firmware/Makefile Thu Sep 17 22:14:11 2020 (r365861) @@ -17,7 +17,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T5FW_VER= 1.24.12.0 +T5FW_VER= 1.25.0.0 FIRMWS+= t5fw-${T5FW_VER}.bin:t5fw:${T5FW_VER} .include Modified: head/sys/modules/cxgbe/t6_firmware/Makefile ============================================================================== --- head/sys/modules/cxgbe/t6_firmware/Makefile Thu Sep 17 21:51:05 2020 (r365860) +++ head/sys/modules/cxgbe/t6_firmware/Makefile Thu Sep 17 22:14:11 2020 (r365861) @@ -17,7 +17,7 @@ FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0 .endif .endfor -T6FW_VER= 1.24.12.0 +T6FW_VER= 1.25.0.0 FIRMWS+= t6fw-${T6FW_VER}.bin:t6fw:${T6FW_VER} .include From owner-svn-src-all@freebsd.org Thu Sep 17 22:27:08 2020 Return-Path: Delivered-To: svn-src-all@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 BA3FE3EF76E; Thu, 17 Sep 2020 22:27:08 +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 4Bss5m4WgLz3TDB; Thu, 17 Sep 2020 22:27:08 +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 7BAC310F75; Thu, 17 Sep 2020 22:27:08 +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 08HMR8li052900; Thu, 17 Sep 2020 22:27:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HMR8ut052899; Thu, 17 Sep 2020 22:27:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009172227.08HMR8ut052899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 17 Sep 2020 22:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365862 - stable/12/sys/nlm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/nlm X-SVN-Commit-Revision: 365862 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 22:27:08 -0000 Author: kib Date: Thu Sep 17 22:27:07 2020 New Revision: 365862 URL: https://svnweb.freebsd.org/changeset/base/365862 Log: MFC r360219: Make nfslockd depend on xdr. PR: 249378 Modified: stable/12/sys/nlm/nlm_prot_impl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/nlm/nlm_prot_impl.c ============================================================================== --- stable/12/sys/nlm/nlm_prot_impl.c Thu Sep 17 22:14:11 2020 (r365861) +++ stable/12/sys/nlm/nlm_prot_impl.c Thu Sep 17 22:27:07 2020 (r365862) @@ -2417,6 +2417,7 @@ static moduledata_t nfslockd_mod = { DECLARE_MODULE(nfslockd, nfslockd_mod, SI_SUB_VFS, SI_ORDER_ANY); /* So that loader and kldload(2) can find us, wherever we are.. */ +MODULE_DEPEND(nfslockd, xdr, 1, 1, 1); MODULE_DEPEND(nfslockd, krpc, 1, 1, 1); MODULE_DEPEND(nfslockd, nfslock, 1, 1, 1); MODULE_VERSION(nfslockd, 1); From owner-svn-src-all@freebsd.org Thu Sep 17 22:29:39 2020 Return-Path: Delivered-To: svn-src-all@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 91FCD3EFC58; Thu, 17 Sep 2020 22:29:39 +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 4Bss8g30bNz3Tb3; Thu, 17 Sep 2020 22:29:39 +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 4A4DF11394; Thu, 17 Sep 2020 22:29:39 +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 08HMTdP5053085; Thu, 17 Sep 2020 22:29:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HMTdXS053084; Thu, 17 Sep 2020 22:29:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009172229.08HMTdXS053084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 17 Sep 2020 22:29:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365863 - head/sys/kgssapi X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kgssapi X-SVN-Commit-Revision: 365863 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 22:29:39 -0000 Author: kib Date: Thu Sep 17 22:29:38 2020 New Revision: 365863 URL: https://svnweb.freebsd.org/changeset/base/365863 Log: State kgssapi dependency on xdr. Submitted by: Dmitry Afanasiev PR: 249378 MFC after: 3 days Modified: head/sys/kgssapi/gss_impl.c Modified: head/sys/kgssapi/gss_impl.c ============================================================================== --- head/sys/kgssapi/gss_impl.c Thu Sep 17 22:27:07 2020 (r365862) +++ head/sys/kgssapi/gss_impl.c Thu Sep 17 22:29:38 2020 (r365863) @@ -342,5 +342,6 @@ static moduledata_t kgssapi_mod = { NULL, }; DECLARE_MODULE(kgssapi, kgssapi_mod, SI_SUB_VFS, SI_ORDER_ANY); +MODULE_DEPEND(kgssapi, xdr, 1, 1, 1); MODULE_DEPEND(kgssapi, krpc, 1, 1, 1); MODULE_VERSION(kgssapi, 1); From owner-svn-src-all@freebsd.org Thu Sep 17 22:35:31 2020 Return-Path: Delivered-To: svn-src-all@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 688B03F008B; Thu, 17 Sep 2020 22:35:31 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.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 4BssHR0bXlz3Twd; Thu, 17 Sep 2020 22:35:30 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f46.google.com with SMTP id g128so4207969iof.11; Thu, 17 Sep 2020 15:35:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=j8t0dMeHdV7uXIldCseJF+u7pw+XQhcM45/YiOzwQbU=; b=n7g9jq8CMr36rixhIbDofaq0Jlw9q189HYQpN6gpl50Mf8zVhSzSfmGmQ/9KBN4OOb cmi9gf3vX3nL+aJyfEnO6ae9xEIYos73fk+3iVfhL8lkwhHYRIsLjcHDwjDSMbSBXx4i bx76YwmmIs9I7Lo8ybpcCuHJMz7UC5d2c6FpEmn5QBSaiCnABBISECJtZn/AKH66sKTq krTQTbUMotrcXDPobnlwgxxFSonPZJQm7qyRN4fGFSVmHqQLJdsrxewdZkXlcI7dM0cd qL22WitGQ9ja+JSVvnSECJpGxsuR9IACgcvCDLRUQA+GsOiq2LYw5Iew4pDs2xXEIT37 djSw== X-Gm-Message-State: AOAM532rlEzE4+NkIH9LGxJpSg6AkBsFc/vYTkJmqZpJQZpzr6OxAASK IUD8quElwccXpuUbKppnvAUXxSYCK6+SnRxDl+UGa3Vg X-Google-Smtp-Source: ABdhPJyPkOwg08Np4cNqkyXmRMs9he53aE5twkhIr8VtdbFLPRjTMHSt78Nq/KKIHhE8jpipPGZb1u9oXtc5+WIZ7uQ= X-Received: by 2002:a5d:8352:: with SMTP id q18mr25828151ior.31.1600382129174; Thu, 17 Sep 2020 15:35:29 -0700 (PDT) MIME-Version: 1.0 References: <202009171847.08HIlNXa015641@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Thu, 17 Sep 2020 18:35:17 -0400 Message-ID: Subject: Re: svn commit: r365846 - head To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BssHR0bXlz3Twd X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 22:35:31 -0000 On Thu, 17 Sep 2020 at 15:07, Kyle Evans wrote: > > Is there any way we can sneak a r/o src tree build in here? I've had a > PR open to do this in our Jenkins builds for a couple years, but > without any ability to test it myself I suspect it'll continue > unmerged. Cirrus-CI does the git clone for us and it is done as root, so we should in effect have a RO src tree here. I'll confirm sometime later on. From owner-svn-src-all@freebsd.org Thu Sep 17 22:40:50 2020 Return-Path: Delivered-To: svn-src-all@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 F04013F0040; Thu, 17 Sep 2020 22:40:50 +0000 (UTC) (envelope-from jhb@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 4BssPZ690hz3Ty6; Thu, 17 Sep 2020 22:40:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8681:1cb0:dc80:25c7:3292:de38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 41E9229A85; Thu, 17 Sep 2020 22:40:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r365855 - head/share/man/man9 To: Gordon Bergling , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202009172050.08HKo2Ok091379@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Thu, 17 Sep 2020 15:40:48 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202009172050.08HKo2Ok091379@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 22:40:51 -0000 On 9/17/20 1:50 PM, Gordon Bergling wrote: > Author: gbe (doc committer) > Date: Thu Sep 17 20:50:02 2020 > New Revision: 365855 > URL: https://svnweb.freebsd.org/changeset/base/365855 > > Log: > crypto_buffer(9): Sort the SEE ALSO section > > MFC after: 3 days This manpage isn't in stable FWIW. > Modified: > head/share/man/man9/crypto_buffer.9 > > Modified: head/share/man/man9/crypto_buffer.9 > ============================================================================== > --- head/share/man/man9/crypto_buffer.9 Thu Sep 17 20:42:41 2020 (r365854) > +++ head/share/man/man9/crypto_buffer.9 Thu Sep 17 20:50:02 2020 (r365855) > @@ -317,11 +317,10 @@ returns the length in bytes of a contiguous segment. > returns true if the request uses a separate output buffer. > .Sh SEE ALSO > .Xr ipsec 4 , > -.Xr bus_dma 9 , Did you mean to lose this one? (Rest looks fine) -- John Baldwin From owner-svn-src-all@freebsd.org Thu Sep 17 22:45:05 2020 Return-Path: Delivered-To: svn-src-all@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 36E3C3F0141; Thu, 17 Sep 2020 22:45:05 +0000 (UTC) (envelope-from olivier@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 4BssVS6wgRz3VjL; Thu, 17 Sep 2020 22:45:04 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (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: olivier/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id CC77F29A3B; Thu, 17 Sep 2020 22:45:04 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: by mail-qv1-f47.google.com with SMTP id b13so1884604qvl.2; Thu, 17 Sep 2020 15:45:04 -0700 (PDT) X-Gm-Message-State: AOAM5321Uh/bBNUBnSrs4Ry/IOcKq8/PvvDMsms5xHU9rrgMju8M4lEE Ru1BjyIaXDIp4MO5uk8vY73RcuCzJ2rSNYBbHq0= X-Google-Smtp-Source: ABdhPJx8Z9moMRe8SF/cWBFopxQZ/C2alkXnRsczj12dNvos8fzn20wTMspj/V0zp5SrlHr5ulm07I11tMNGtenWUgI= X-Received: by 2002:a0c:b308:: with SMTP id s8mr31642381qve.16.1600382704486; Thu, 17 Sep 2020 15:45:04 -0700 (PDT) MIME-Version: 1.0 References: <202009081036.088AaCk8085096@repo.freebsd.org> <1ccf2cf7-eb01-a200-4335-4674a010f8a1@FreeBSD.org> In-Reply-To: <1ccf2cf7-eb01-a200-4335-4674a010f8a1@FreeBSD.org> From: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Date: Fri, 18 Sep 2020 00:44:53 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r365449 - head/sbin/rcorder To: John Baldwin Cc: "Andrey V. Elsukov" , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 22:45:05 -0000 On Thu, Sep 17, 2020 at 10:21 PM John Baldwin wrote: > > > I don't think the issue is with rcorder though. I think the reason the > ordering matters warrants further investigation. Is aesni not getting > used when ipsec is loaded first? You can use dtrace with the script at > https://github.com/bsdjhb/kdbg/blob/master/dtrace/crypto_drivers.d to see > which driver is being used. > > Hi, The driver used is cryptosoft when ipsec keys are set before the aesni module is loaded. I suspect > btw that you could just do 'sh /etc/rc.d/ipsec restart' post-boot without > unloading any modules which would also fix your benchmark. > Correct, just restarting ipsec fix the benchmark. And once restarted, the driver used is aesni. > I think long term we want OCF's notions of sessions to be a bit more > fluid such that "client" sessions for things like GELI and IPSec can > be backed by one or more "driver" sessions (including "driver" sessions > coming and going as devices come and go). That's a fair bit more work > however. > > And why not simply add 'kld' into the REQUIRE part of /etc/rc.d/ipsec ? But this will fix only IPsec: What about other crypto consumers ? Regards, Olivier From owner-svn-src-all@freebsd.org Thu Sep 17 22:50:45 2020 Return-Path: Delivered-To: svn-src-all@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 29F9B3F04F9; Thu, 17 Sep 2020 22:50:45 +0000 (UTC) (envelope-from jhb@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 4Bssd10LDGz3W2J; Thu, 17 Sep 2020 22:50:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8681:1cb0:dc80:25c7:3292:de38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 5E1FC29A8B; Thu, 17 Sep 2020 22:50:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r365449 - head/sbin/rcorder To: =?UTF-8?Q?Olivier_Cochard-Labb=c3=a9?= Cc: "Andrey V. Elsukov" , src-committers , svn-src-all , svn-src-head References: <202009081036.088AaCk8085096@repo.freebsd.org> <1ccf2cf7-eb01-a200-4335-4674a010f8a1@FreeBSD.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <86cadaa8-12e6-8b61-a8d1-758a7722b795@FreeBSD.org> Date: Thu, 17 Sep 2020 15:50:43 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 22:50:45 -0000 On 9/17/20 3:44 PM, Olivier Cochard-Labbé wrote: > On Thu, Sep 17, 2020 at 10:21 PM John Baldwin wrote: >> I think long term we want OCF's notions of sessions to be a bit more >> fluid such that "client" sessions for things like GELI and IPSec can >> be backed by one or more "driver" sessions (including "driver" sessions >> coming and going as devices come and go). That's a fair bit more work >> however. >> >> > And why not simply add 'kld' into the REQUIRE part of /etc/rc.d/ipsec ? > But this will fix only IPsec: What about other crypto consumers ? The problem is that kld_list can be used to load all sorts of modules. Perhaps some of them need to be loaded after the network is configured, for example, but ipsec is probably before NETWORKING, so moving kld earlier would break those modules. The problem with 'kld' is that it is super generic so there isn't a "right" place to put it. I'm not sure of an easy solution. In your case, if you put aesni_load=YES in loader.conf instead of putting aesni in kld_list you would be fine though. I'm not sure it's really safe to assume that things loaded by kld_list are available for any boot-time services. -- John Baldwin From owner-svn-src-all@freebsd.org Thu Sep 17 23:14:17 2020 Return-Path: Delivered-To: svn-src-all@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 E83223F0BCD; Thu, 17 Sep 2020 23:14:17 +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 4Bst895sPVz3XTq; Thu, 17 Sep 2020 23:14:17 +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 AD24611A74; Thu, 17 Sep 2020 23:14:17 +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 08HNEH7w083425; Thu, 17 Sep 2020 23:14:17 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08HNEHn3083424; Thu, 17 Sep 2020 23:14:17 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202009172314.08HNEHn3083424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 17 Sep 2020 23:14:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365864 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 365864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 23:14:18 -0000 Author: brooks Date: Thu Sep 17 23:14:17 2020 New Revision: 365864 URL: https://svnweb.freebsd.org/changeset/base/365864 Log: MFC r365284: Always report ENOSYS in init While rare, encountering an unimplemented system call early in init is catastrophic and difficult to debug. Even after a SIGSYS handler is registered, such configurations are problematic. As such, always report such events for pid 1 (following kern.lognosys if non-zero). Reviewed by: kevans, imp Obtained from: CheriBSD (plus suggestions from kevans) Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26288 Modified: stable/11/sys/kern/kern_sig.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_sig.c ============================================================================== --- stable/11/sys/kern/kern_sig.c Thu Sep 17 22:29:38 2020 (r365863) +++ stable/11/sys/kern/kern_sig.c Thu Sep 17 23:14:17 2020 (r365864) @@ -3731,7 +3731,8 @@ nosys(struct thread *td, struct nosys_args *args) uprintf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm, td->td_sa.code); } - if (kern_lognosys == 2 || kern_lognosys == 3) { + if (kern_lognosys == 2 || kern_lognosys == 3 || + (p->p_pid == 1 && (kern_lognosys & 3) == 0)) { printf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm, td->td_sa.code); } From owner-svn-src-all@freebsd.org Thu Sep 17 23:16:30 2020 Return-Path: Delivered-To: svn-src-all@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 700C93F0D5D; Thu, 17 Sep 2020 23:16:30 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) (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 4BstBj3Xgpz3XVv; Thu, 17 Sep 2020 23:16:29 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: by sdaoden.eu (Postfix, from userid 1000) id B3AA716057; Fri, 18 Sep 2020 01:16:27 +0200 (CEST) Date: Fri, 18 Sep 2020 01:16:26 +0200 From: Steffen Nurpmeso To: Warner Losh Cc: Jessica Clarke , "Rodney W. Grimes" , Alex Richardson , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r365836 - head/share/mk Message-ID: <20200917231626.ki99z%steffen@sdaoden.eu> In-Reply-To: References: <202009171705.08HH5CtE014644@gndrsh.dnsmgr.net> <307760E0-1208-4F4C-AD7D-9E0A3C1B3A3B@freebsd.org> Mail-Followup-To: Warner Losh , Jessica Clarke , "Rodney W. Grimes" , Alex Richardson , src-committers , svn-src-all , svn-src-head User-Agent: s-nail v14.9.19-127-g67fa13b6 OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. X-Rspamd-Queue-Id: 4BstBj3Xgpz3XVv X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of steffen@sdaoden.eu designates 217.144.132.164 as permitted sender) smtp.mailfrom=steffen@sdaoden.eu X-Spamd-Result: default: False [-1.53 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.96)[-0.965]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+a]; NEURAL_HAM_LONG(-0.95)[-0.953]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[sdaoden.eu]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.31)[-0.311]; RCPT_COUNT_SEVEN(0.00)[7]; MID_CONTAINS_FROM(1.00)[]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15987, ipnet:217.144.128.0/20, country:DE]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 23:16:30 -0000 Warner Losh wrote in : |On Thu, Sep 17, 2020, 11:25 AM Jessica Clarke wrote: |>> On 17 Sep 2020, at 18:23, Jessica Clarke wrote: |>> |>>> On 17 Sep 2020, at 18:05, Rodney W. Grimes |> wrote: |>>> |>>>> On Thu, Sep 17, 2020 at 9:39 AM Steffen Nurpmeso |> wrote: |>>>> |>>>>> Alex Richardson wrote in |>>>>> <202009171507.08HF7Qns080555@repo.freebsd.org>: |>>>>>|Author: arichardson |>>>>>|Date: Thu Sep 17 15:07:25 2020 |>>>>>|New Revision: 365836 |>>>>>|URL: https://svnweb.freebsd.org/changeset/base/365836 |>>>>>| |>>>>>|Log: |>>>>>| Stop using lorder and ranlib when building libraries |>>>>>| |>>>>>| Use of ranlib or lorder is no longer necessary with current linkers |>>>>>| (probably anything newer than ~1990) and ar's ability to create an |>>>>> object |>>>>>| index and symbol table in the archive. |>>>>>| Currently the build system uses lorder+tsort to sort the .o files |> in |>>>>>| dependency order so that a single-pass linker can use them. |> However, |>>>>>| we can use the -s flag to ar to add an index to the .a file which |> makes |>>>>>| lorder unnecessary. |>>>>>| Running ar -s is equivalent to running ranlib afterwards, so we can |>>>>> also |>>>>>| skip the ranlib invocation. |>>>>> |>>>>> That ranlib thing yes (for long indeed), but i have vague memories |>>>>> that the tsort/lorder ordering was also meant to keep the things |>>>>> which heavily interdepend nearby each other. (Luckily Linux |>>>>> always had at least tsort available.) |>>>>> This no longer matters for all the platforms FreeBSD supports? |>>>>> |>>>> |>>>> tsort has no notion of how dependent the modules are, just an order |> that |>>>> allows a single pass through the .a file (otherwise you'd need to list |> the |>>>> .a file multiple times on the command line absent ranlib). That's the |>>>> original purpose of tsort. tsort, lsort, and ranlib all arrived in 7th |>>>> edition unix on a PDP-11, where size was more important than proximity |> to |>>>> locations (modulo overlays, which this doesn't affect at all). |>>>> |>>>> There were some issues of long vs short jumps on earlier architectures |> that |>>>> this helped (since you could only jump 16MB, for example). However, |> there |>>>> were workarounds for this issue on those platforms too. And if you |> have a |>>>> program that this does make a difference, then you can still use |>>>> tsort/lorder. They are still in the system. |>>>> |>>>> I doubt you could measure a difference here today. I doubt, honestly, |> that |>>>> anybody will notice at all. |>>> |>>> The x86 archicture has relative jmps of differning lengths, even in |> long mode |>>> there is support for rel8 and rel32. |>> |>> That's irrelevant though for several reasons: |>> |>> 1. The compiler has already decided on what jump instructions to use |> based on |>> the requested code model (unless you're on RISC-V and using GNU bfd ld |> as |>> that supports linker relaxations that actually delete instruction |> bytes). |>> |>> 2. The linker is still free to reorder input sections however it likes, |> it |>> doesn't have to follow the order of the input files (and the files |> within |>> any archive). |> |> Hm actually that's only true for archives; it needs to respect the \ |> order of |> files on the command line for things like crti.o to work. But regardless, |> the |> other points (and this one, partially) still hold. |> |>> 3. If you care about those kinds of optimisations you should use |> link-time |>> optimisation which will likely do far more useful things than just |> optimise |>> branches, but again isn't constrained by the order of the input files, |> it |>> can lay out the code exactly how it wants. |>> |>> Not to mention that this is just a topological sort, not a clustering |> sort. |> | |Yea. I doubt you'd be able to measure a difference on anything in our tree. Very interesting, thank you all. Profiling based sort order, impressive even. I thought more about cache hotness and, simply, keeping interdependent things together as such. But well, caches are so big today, and everything is dynamically linked, i only jerk a bit due to that runtime cost myself. --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) From owner-svn-src-all@freebsd.org Fri Sep 18 00:02:59 2020 Return-Path: Delivered-To: svn-src-all@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 0E0933F1BF9; Fri, 18 Sep 2020 00:02:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BsvDL6fD6z3Zm9; Fri, 18 Sep 2020 00:02:58 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C871A124FA; Fri, 18 Sep 2020 00:02:58 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08I02wP8013829; Fri, 18 Sep 2020 00:02:58 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08I02w9P013828; Fri, 18 Sep 2020 00:02:58 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202009180002.08I02w9P013828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 18 Sep 2020 00:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365865 - releng/12.2/sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/12.2/sys/conf X-SVN-Commit-Revision: 365865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 00:02:59 -0000 Author: gjb Date: Fri Sep 18 00:02:58 2020 New Revision: 365865 URL: https://svnweb.freebsd.org/changeset/base/365865 Log: Rename releng/12.2 to BETA2 as part of the 12.2-RELEASE cycle. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/12.2/sys/conf/newvers.sh Modified: releng/12.2/sys/conf/newvers.sh ============================================================================== --- releng/12.2/sys/conf/newvers.sh Thu Sep 17 23:14:17 2020 (r365864) +++ releng/12.2/sys/conf/newvers.sh Fri Sep 18 00:02:58 2020 (r365865) @@ -49,7 +49,7 @@ TYPE="FreeBSD" REVISION="12.2" -BRANCH="BETA1-p1" +BRANCH="BETA2" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri Sep 18 00:19:29 2020 Return-Path: Delivered-To: svn-src-all@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 DC9623F2DEF; Fri, 18 Sep 2020 00:19:29 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) (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 4BsvbN6s0gz3brJ; Fri, 18 Sep 2020 00:19:28 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f182.google.com with SMTP id t12so4359949ilh.3; Thu, 17 Sep 2020 17:19:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5tRhZOTdJehdwxDTGpbScgVR2ho5we3FXkNG5QTumTI=; b=HwE+nqx6j+ZWJDgQ80KF8ujrM3ZKsRsjzMfu81Mp5Ko31YMim0h+wCofLDtBKSzGtF N6+CiGAXUY+/RyZF13ViEA9MBeCcoyalORP5Lv+0ZB5Y8HSfenTBm+PdsmJVo1oict4r RIgchQvdNtluYLGg6139VvCLxW5h6L2RyCeofg40Gd6CuSfrh9uJvf9QEFrQK/yhOqSz Wmy670qKcCqVxd8SlihHy6yTKaBtvta+ENPeG95Nuv44+2L9NvkvCEOSrZYRkVxV5i3Q s/LtGq79qPBoz1ldH/VEmcT2KrcvuG03NcEyH8pRUhmFn0ltQokMNMThM57cEj3Y9qG5 9CIw== X-Gm-Message-State: AOAM531op1fbEyf+lZ4gn3wlF/U8FrOugK8HWY9MZpvTUTbbjQ6CXPYH 2wOGrk/BnpDTC2bK0zAqHJ7RmhLJYOi6FpR8EnugCpYnmxQ= X-Google-Smtp-Source: ABdhPJzubQaFlnRlIf3pvsrfihZieAqIV/aMU18d5PdAiNz024X8VLZob2I+VQMpyq4kOzzF0vFwPVYKPF6qqydKgZ8= X-Received: by 2002:a05:6e02:8a2:: with SMTP id a2mr9670119ilt.98.1600388367510; Thu, 17 Sep 2020 17:19:27 -0700 (PDT) MIME-Version: 1.0 References: <202009171847.08HIlNXa015641@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Thu, 17 Sep 2020 20:19:15 -0400 Message-ID: Subject: Re: svn commit: r365846 - head To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BsvbN6s0gz3brJ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.182 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-2.05 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FREEFALL_USER(0.00)[carpeddiem]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-0.78)[-0.776]; NEURAL_HAM_MEDIUM(-0.52)[-0.518]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.76)[-0.759]; RCVD_IN_DNSWL_NONE(0.00)[209.85.166.182:from]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.166.182:from]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 00:19:29 -0000 On Thu, 17 Sep 2020 at 18:35, Ed Maste wrote: > > On Thu, 17 Sep 2020 at 15:07, Kyle Evans wrote: > > > > Is there any way we can sneak a r/o src tree build in here? I've had a > > PR open to do this in our Jenkins builds for a couple years, but > > without any ability to test it myself I suspect it'll continue > > unmerged. > > Cirrus-CI does the git clone for us and it is done as root, so we > should in effect have a RO src tree here. I'll confirm sometime later > on. Indeed, Cirrus checks out the tree under /tmp/cirrus-ci-build as root, and there are no files/directories writable by the unprivileged user added by this change. From owner-svn-src-all@freebsd.org Fri Sep 18 01:38:47 2020 Return-Path: Delivered-To: svn-src-all@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 DC5593F4252; Fri, 18 Sep 2020 01:38:47 +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 4BsxLv5XZwz3fjf; Fri, 18 Sep 2020 01:38:47 +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 8505B136C5; Fri, 18 Sep 2020 01:38:47 +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 08I1cldJ069317; Fri, 18 Sep 2020 01:38:47 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08I1clD8069316; Fri, 18 Sep 2020 01:38:47 GMT (envelope-from np@FreeBSD.org) Message-Id: <202009180138.08I1clD8069316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 18 Sep 2020 01:38:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365867 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 365867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 01:38:47 -0000 Author: np Date: Fri Sep 18 01:38:47 2020 New Revision: 365867 URL: https://svnweb.freebsd.org/changeset/base/365867 Log: mbuf checksum flags and fields to support tunneling protocols. These are being added to support VXLAN but will work for GENEVE as well. ENCAP_RSVD1 will likely become ENCAP_GENEVE in the future. The size of struct mbuf does not change and that means this change can be MFC'd. If size wasn't a constraint a cleaner way may have been to add inner_csum_flags and inner_csum_data to go with csum_flags and csum_data. Reviewed by: kib@ Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D25873 Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Fri Sep 18 01:11:11 2020 (r365866) +++ head/sys/sys/mbuf.h Fri Sep 18 01:38:47 2020 (r365867) @@ -171,7 +171,10 @@ struct pkthdr { uint8_t l3hlen; /* layer 3 hdr len */ uint8_t l4hlen; /* layer 4 hdr len */ uint8_t l5hlen; /* layer 5 hdr len */ - uint32_t spare; + uint8_t inner_l2hlen; + uint8_t inner_l3hlen; + uint8_t inner_l4hlen; + uint8_t inner_l5hlen; }; }; union { @@ -616,7 +619,13 @@ m_epg_pagelen(const struct mbuf *m, int pidx, int pgof * Outbound flags that are set by upper protocol layers requesting lower * layers, or ideally the hardware, to perform these offloading tasks. * For outbound packets this field and its flags can be directly tested - * against ifnet if_hwassist. + * against ifnet if_hwassist. Note that the outbound and the inbound flags do + * not collide right now but they could be allowed to (as long as the flags are + * scrubbed appropriately when the direction of an mbuf changes). CSUM_BITS + * would also have to split into CSUM_BITS_TX and CSUM_BITS_RX. + * + * CSUM_INNER_ is the same as CSUM_ but it applies to the inner frame. + * The CSUM_ENCAP_ bits identify the outer encapsulation. */ #define CSUM_IP 0x00000001 /* IP header checksum offload */ #define CSUM_IP_UDP 0x00000002 /* UDP checksum offload */ @@ -625,13 +634,28 @@ m_epg_pagelen(const struct mbuf *m, int pidx, int pgof #define CSUM_IP_TSO 0x00000010 /* TCP segmentation offload */ #define CSUM_IP_ISCSI 0x00000020 /* iSCSI checksum offload */ +#define CSUM_INNER_IP6_UDP 0x00000040 +#define CSUM_INNER_IP6_TCP 0x00000080 +#define CSUM_INNER_IP6_TSO 0x00000100 #define CSUM_IP6_UDP 0x00000200 /* UDP checksum offload */ #define CSUM_IP6_TCP 0x00000400 /* TCP checksum offload */ #define CSUM_IP6_SCTP 0x00000800 /* SCTP checksum offload */ #define CSUM_IP6_TSO 0x00001000 /* TCP segmentation offload */ #define CSUM_IP6_ISCSI 0x00002000 /* iSCSI checksum offload */ +#define CSUM_INNER_IP 0x00004000 +#define CSUM_INNER_IP_UDP 0x00008000 +#define CSUM_INNER_IP_TCP 0x00010000 +#define CSUM_INNER_IP_TSO 0x00020000 + +#define CSUM_ENCAP_VXLAN 0x00040000 /* VXLAN outer encapsulation */ +#define CSUM_ENCAP_RSVD1 0x00080000 + /* Inbound checksum support where the checksum was verified by hardware. */ +#define CSUM_INNER_L3_CALC 0x00100000 +#define CSUM_INNER_L3_VALID 0x00200000 +#define CSUM_INNER_L4_CALC 0x00400000 +#define CSUM_INNER_L4_VALID 0x00800000 #define CSUM_L3_CALC 0x01000000 /* calculated layer 3 csum */ #define CSUM_L3_VALID 0x02000000 /* checksum is correct */ #define CSUM_L4_CALC 0x04000000 /* calculated layer 4 csum */ @@ -642,16 +666,31 @@ m_epg_pagelen(const struct mbuf *m, int pidx, int pgof #define CSUM_SND_TAG 0x80000000 /* Packet header has send tag */ +#define CSUM_FLAGS_TX (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP | CSUM_IP_SCTP | \ + CSUM_IP_TSO | CSUM_IP_ISCSI | CSUM_INNER_IP6_UDP | CSUM_INNER_IP6_TCP | \ + CSUM_INNER_IP6_TSO | CSUM_IP6_UDP | CSUM_IP6_TCP | CSUM_IP6_SCTP | \ + CSUM_IP6_TSO | CSUM_IP6_ISCSI | CSUM_INNER_IP | CSUM_INNER_IP_UDP | \ + CSUM_INNER_IP_TCP | CSUM_INNER_IP_TSO | CSUM_ENCAP_VXLAN | \ + CSUM_ENCAP_RSVD1 | CSUM_SND_TAG) + +#define CSUM_FLAGS_RX (CSUM_INNER_L3_CALC | CSUM_INNER_L3_VALID | \ + CSUM_INNER_L4_CALC | CSUM_INNER_L4_VALID | CSUM_L3_CALC | CSUM_L3_VALID | \ + CSUM_L4_CALC | CSUM_L4_VALID | CSUM_L5_CALC | CSUM_L5_VALID | \ + CSUM_COALESCED) + /* * CSUM flag description for use with printf(9) %b identifier. */ #define CSUM_BITS \ "\20\1CSUM_IP\2CSUM_IP_UDP\3CSUM_IP_TCP\4CSUM_IP_SCTP\5CSUM_IP_TSO" \ - "\6CSUM_IP_ISCSI" \ - "\12CSUM_IP6_UDP\13CSUM_IP6_TCP\14CSUM_IP6_SCTP\15CSUM_IP6_TSO" \ - "\16CSUM_IP6_ISCSI" \ - "\31CSUM_L3_CALC\32CSUM_L3_VALID\33CSUM_L4_CALC\34CSUM_L4_VALID" \ - "\35CSUM_L5_CALC\36CSUM_L5_VALID\37CSUM_COALESCED\40CSUM_SND_TAG" + "\6CSUM_IP_ISCSI\7CSUM_INNER_IP6_UDP\10CSUM_INNER_IP6_TCP" \ + "\11CSUM_INNER_IP6_TSO\12CSUM_IP6_UDP\13CSUM_IP6_TCP\14CSUM_IP6_SCTP" \ + "\15CSUM_IP6_TSO\16CSUM_IP6_ISCSI\17CSUM_INNER_IP\20CSUM_INNER_IP_UDP" \ + "\21CSUM_INNER_IP_TCP\22CSUM_INNER_IP_TSO\23CSUM_ENCAP_VXLAN" \ + "\24CSUM_ENCAP_RSVD1\25CSUM_INNER_L3_CALC\26CSUM_INNER_L3_VALID" \ + "\27CSUM_INNER_L4_CALC\30CSUM_INNER_L4_VALID\31CSUM_L3_CALC" \ + "\32CSUM_L3_VALID\33CSUM_L4_CALC\34CSUM_L4_VALID\35CSUM_L5_CALC" \ + "\36CSUM_L5_VALID\37CSUM_COALESCED\40CSUM_SND_TAG" /* CSUM flags compatibility mappings. */ #define CSUM_IP_CHECKED CSUM_L3_CALC @@ -667,6 +706,7 @@ m_epg_pagelen(const struct mbuf *m, int pidx, int pgof #define CSUM_UDP CSUM_IP_UDP #define CSUM_SCTP CSUM_IP_SCTP #define CSUM_TSO (CSUM_IP_TSO|CSUM_IP6_TSO) +#define CSUM_INNER_TSO (CSUM_INNER_IP_TSO|CSUM_INNER_IP6_TSO) #define CSUM_UDP_IPV6 CSUM_IP6_UDP #define CSUM_TCP_IPV6 CSUM_IP6_TCP #define CSUM_SCTP_IPV6 CSUM_IP6_SCTP From owner-svn-src-all@freebsd.org Fri Sep 18 02:10:30 2020 Return-Path: Delivered-To: svn-src-all@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 3CD243F4BD2; Fri, 18 Sep 2020 02:10:30 +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 4Bsy3V0rXMz3gtS; Fri, 18 Sep 2020 02:10:30 +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 D64F91365F; Fri, 18 Sep 2020 02:10:29 +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 08I2ATQc087565; Fri, 18 Sep 2020 02:10:29 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08I2AT3p087561; Fri, 18 Sep 2020 02:10:29 GMT (envelope-from np@FreeBSD.org) Message-Id: <202009180210.08I2AT3p087561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 18 Sep 2020 02:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365868 - in head: sbin/ifconfig sys/net X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head: sbin/ifconfig sys/net X-SVN-Commit-Revision: 365868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 02:10:30 -0000 Author: np Date: Fri Sep 18 02:10:28 2020 New Revision: 365868 URL: https://svnweb.freebsd.org/changeset/base/365868 Log: Add two new ifnet capabilities for hw checksumming and TSO for VXLAN traffic. These are similar to the existing VLAN capabilities. Reviewed by: kib@ Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D25873 Modified: head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/ifconfig.c head/sbin/ifconfig/ifvxlan.c head/sys/net/if.h Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Fri Sep 18 01:38:47 2020 (r365867) +++ head/sbin/ifconfig/ifconfig.8 Fri Sep 18 02:10:28 2020 (r365868) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd June 4, 2020 +.Dd September 17, 2020 .Dt IFCONFIG 8 .Os .Sh NAME @@ -587,7 +587,7 @@ If the driver offers user-configurable VLAN support, e reception of extended frames, tag processing in hardware, frame filtering in hardware, checksum offloading, or TSO on VLAN, respectively. -Note that this must be issued on a physical interface associated with +Note that this must be configured on a physical interface associated with .Xr vlan 4 , not on a .Xr vlan 4 @@ -597,6 +597,21 @@ If the driver offers user-configurable VLAN support, d reception of extended frames, tag processing in hardware, frame filtering in hardware, or TSO on VLAN, respectively. +.It Cm vxlanhwcsum , vxlanhwtso +If the driver offers user-configurable VXLAN support, enable inner checksum +offloading (receive and transmit) or TSO on VXLAN, respectively. +Note that this must be configured on a physical interface associated with +.Xr vxlan 4 , +not on a +.Xr vxlan 4 +interface itself. +The physical interface is either the interface specified as the vxlandev +or the interface hosting the vxlanlocal address. +The driver will offload as much checksum work and TSO as it can reliably +support, the exact level of offloading may vary between drivers. +.It Fl vxlanhwcsum , vxlanhwtso +If the driver offers user-configurable VXLAN support, disable checksum +offloading (receive and transmit) or TSO on VXLAN, respectively. .It Cm vnet Ar jail Move the interface to the .Xr jail 8 , Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Fri Sep 18 01:38:47 2020 (r365867) +++ head/sbin/ifconfig/ifconfig.c Fri Sep 18 02:10:28 2020 (r365868) @@ -1344,7 +1344,8 @@ unsetifdescr(const char *val, int value, int s, const "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ "\17TOE4\20TOE6\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \ -"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT\32HWRXTSTMP\33NOMAP\34TXTLS4\35TXTLS6" +"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT\32HWRXTSTMP\33NOMAP\34TXTLS4\35TXTLS6" \ +"\36VXLAN_HWCSUM\37VXLAN_HWTSO" /* * Print the status of the interface. If an address family was Modified: head/sbin/ifconfig/ifvxlan.c ============================================================================== --- head/sbin/ifconfig/ifvxlan.c Fri Sep 18 01:38:47 2020 (r365867) +++ head/sbin/ifconfig/ifvxlan.c Fri Sep 18 02:10:28 2020 (r365868) @@ -620,6 +620,11 @@ static struct cmd vxlan_cmds[] = { DEF_CMD("vxlanflush", 0, setvxlan_flush), DEF_CMD("vxlanflushall", 1, setvxlan_flush), + + DEF_CMD("vxlanhwcsum", IFCAP_VXLAN_HWCSUM, setifcap), + DEF_CMD("-vxlanhwcsum", -IFCAP_VXLAN_HWCSUM, setifcap), + DEF_CMD("vxlanhwtso", IFCAP_VXLAN_HWTSO, setifcap), + DEF_CMD("-vxlanhwtso", -IFCAP_VXLAN_HWTSO, setifcap), }; static struct afswtch af_vxlan = { Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Fri Sep 18 01:38:47 2020 (r365867) +++ head/sys/net/if.h Fri Sep 18 02:10:28 2020 (r365868) @@ -248,6 +248,8 @@ struct if_data { #define IFCAP_NOMAP 0x4000000 /* can TX unmapped mbufs */ #define IFCAP_TXTLS4 0x8000000 /* can do TLS encryption and segmentation for TCP */ #define IFCAP_TXTLS6 0x10000000 /* can do TLS encryption and segmentation for TCP6 */ +#define IFCAP_VXLAN_HWCSUM 0x20000000 /* can do IFCAN_HWCSUM on VXLANs */ +#define IFCAP_VXLAN_HWTSO 0x40000000 /* can do IFCAP_TSO on VXLANs */ #define IFCAP_HWCSUM_IPV6 (IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6) From owner-svn-src-all@freebsd.org Fri Sep 18 02:21:16 2020 Return-Path: Delivered-To: svn-src-all@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 54C163F4F00; Fri, 18 Sep 2020 02:21:16 +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 4BsyHw1b0Lz3yd5; Fri, 18 Sep 2020 02:21:16 +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 19D4114017; Fri, 18 Sep 2020 02:21:16 +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 08I2LFiK096311; Fri, 18 Sep 2020 02:21:15 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08I2LFop096309; Fri, 18 Sep 2020 02:21:15 GMT (envelope-from np@FreeBSD.org) Message-Id: <202009180221.08I2LFop096309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 18 Sep 2020 02:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365869 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 365869 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 02:21:16 -0000 Author: np Date: Fri Sep 18 02:21:15 2020 New Revision: 365869 URL: https://svnweb.freebsd.org/changeset/base/365869 Log: Add a knob to allow zero UDP checksums for UDP/IPv6 traffic on the given UDP port. This will be used by some upcoming changes to if_vxlan(4). RFC 7348 (VXLAN) says that the UDP checksum "SHOULD be transmitted as zero. When a packet is received with a UDP checksum of zero, it MUST be accepted for decapsulation." But the original IPv6 RFCs did not allow zero UDP checksum. RFC 6935 attempts to resolve this. Reviewed by: kib@ Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D25873 Modified: head/sys/netinet/udp_var.h head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet/udp_var.h ============================================================================== --- head/sys/netinet/udp_var.h Fri Sep 18 02:10:28 2020 (r365868) +++ head/sys/netinet/udp_var.h Fri Sep 18 02:21:15 2020 (r365869) @@ -154,6 +154,9 @@ VNET_DECLARE(int, udp_log_in_vain); #define V_udp_blackhole VNET(udp_blackhole) #define V_udp_log_in_vain VNET(udp_log_in_vain) +VNET_DECLARE(int, zero_checksum_port); +#define V_zero_checksum_port VNET(zero_checksum_port) + static __inline struct inpcbinfo * udp_get_inpcbinfo(int protocol) { Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Fri Sep 18 02:10:28 2020 (r365868) +++ head/sys/netinet6/udp6_usrreq.c Fri Sep 18 02:21:15 2020 (r365869) @@ -124,6 +124,11 @@ __FBSDID("$FreeBSD$"); #include +VNET_DEFINE(int, zero_checksum_port) = 0; +#define V_zero_checksum_port VNET(zero_checksum_port) +SYSCTL_INT(_net_inet6_udp6, OID_AUTO, rfc6935_port, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(zero_checksum_port), 0, + "Zero UDP checksum allowed for traffic to/from this port."); /* * UDP protocol implementation. * Per RFC 768, August, 1980. @@ -267,7 +272,14 @@ udp6_input(struct mbuf **mp, int *offp, int proto) } if (uh->uh_sum == 0) { UDPSTAT_INC(udps_nosum); - goto badunlocked; + /* + * dport 0 was rejected earlier so this is OK even if + * zero_checksum_port is 0 (which is its default value). + */ + if (ntohs(uh->uh_dport) == V_zero_checksum_port) + goto skip_checksum; + else + goto badunlocked; } } @@ -287,6 +299,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto) goto badunlocked; } +skip_checksum: /* * Construct sockaddr format source address. */ From owner-svn-src-all@freebsd.org Fri Sep 18 02:36:19 2020 Return-Path: Delivered-To: svn-src-all@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 1F2CF3F4FF4; Fri, 18 Sep 2020 02:36:19 +0000 (UTC) (envelope-from kevans@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 4BsydG6yNlz3yxy; Fri, 18 Sep 2020 02:36:18 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) (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 CD50D2B324; Fri, 18 Sep 2020 02:36:18 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f174.google.com with SMTP id h6so3791573qtd.6; Thu, 17 Sep 2020 19:36:18 -0700 (PDT) X-Gm-Message-State: AOAM53250pp1qJ/344xPh1oH9sRQzu8/Iq87n4tm2g+98+tNaxiU/uhA jVx8BuBQ2kfjRRJgqorAa4jjA5nhh9lqokC2lkg= X-Google-Smtp-Source: ABdhPJwiguEB5Sit+I36FIzYHnmvrCMzCfYiVHwpEPWu9fJrkRAtvzMDPY3SPk3TXc+lQuuovqkYOM84P3f7GxS3XGc= X-Received: by 2002:ac8:192b:: with SMTP id t40mr30755288qtj.60.1600396578068; Thu, 17 Sep 2020 19:36:18 -0700 (PDT) MIME-Version: 1.0 References: <202009172227.08HMR8ut052899@repo.freebsd.org> In-Reply-To: <202009172227.08HMR8ut052899@repo.freebsd.org> From: Kyle Evans Date: Thu, 17 Sep 2020 21:36:07 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r365862 - stable/12/sys/nlm To: Konstantin Belousov Cc: src-committers , svn-src-all , svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 02:36:19 -0000 On Thu, Sep 17, 2020 at 5:27 PM Konstantin Belousov wrote: > > Author: kib > Date: Thu Sep 17 22:27:07 2020 > New Revision: 365862 > URL: https://svnweb.freebsd.org/changeset/base/365862 > > Log: > MFC r360219: > Make nfslockd depend on xdr. > > PR: 249378 > Oy, my bad- thanks! From owner-svn-src-all@freebsd.org Fri Sep 18 02:37:59 2020 Return-Path: Delivered-To: svn-src-all@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 90A1F3F5350; Fri, 18 Sep 2020 02:37:59 +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 4BsygC3c2pz40C8; Fri, 18 Sep 2020 02:37:59 +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 5EA4F14371; Fri, 18 Sep 2020 02:37:59 +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 08I2bxiW006374; Fri, 18 Sep 2020 02:37:59 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08I2bw8e006369; Fri, 18 Sep 2020 02:37:58 GMT (envelope-from np@FreeBSD.org) Message-Id: <202009180237.08I2bw8e006369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 18 Sep 2020 02:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365870 - in head: share/man/man4 share/man/man9 sys/net sys/netinet sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head: share/man/man4 share/man/man9 sys/net sys/netinet sys/netinet6 X-SVN-Commit-Revision: 365870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 02:37:59 -0000 Author: np Date: Fri Sep 18 02:37:57 2020 New Revision: 365870 URL: https://svnweb.freebsd.org/changeset/base/365870 Log: if_vxlan(4): add support for hardware assisted checksumming, TSO, and RSS. This lets a VXLAN pseudo-interface take advantage of hardware checksumming (tx and rx), TSO, and RSS if the NIC is capable of performing these operations on inner VXLAN traffic. A VXLAN interface inherits the capabilities of its vxlandev interface if one is specified or of the interface that hosts the vxlanlocal address. If other interfaces will carry traffic for that VXLAN then they must have the same hardware capabilities. On transmit, if_vxlan verifies that the outbound interface has the required capabilities and then translates the CSUM_ flags to their inner equivalents. This tells the hardware ifnet that it needs to operate on the inner frame and not the outer VXLAN headers. An event is generated when a VXLAN ifnet starts. This allows hardware drivers to configure their devices to expect VXLAN traffic on the specified incoming port. On receive, the hardware does RSS and checksum verification on the inner frame. if_vxlan now does a direct netisr dispatch to take full advantage of RSS. It is not very clear why it didn't do this already. Future work: Rx: it should be possible to avoid the first trip up the protocol stack to get the frame to if_vxlan just so it can decapsulate and requeue for a second trip up the stack. The hardware NIC driver could directly call an if_vxlan receive routine for VXLAN traffic instead. Rx: LRO. depends on what happens with the previous item. There will have to to be a mechanism to indicate that it's time for if_vxlan to flush its LRO state. Reviewed by: kib@ Relnotes: Yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D25873 Modified: head/share/man/man4/vxlan.4 head/share/man/man9/EVENTHANDLER.9 head/sys/net/if_vxlan.c head/sys/net/if_vxlan.h head/sys/netinet/ip_output.c head/sys/netinet6/ip6_output.c Modified: head/share/man/man4/vxlan.4 ============================================================================== --- head/share/man/man4/vxlan.4 Fri Sep 18 02:21:15 2020 (r365869) +++ head/share/man/man4/vxlan.4 Fri Sep 18 02:37:57 2020 (r365870) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 31, 2017 +.Dd September 17, 2020 .Dt VXLAN 4 .Os .Sh NAME @@ -182,6 +182,39 @@ command may be used to reduce the MTU size on the .Nm interface to allow the encapsulated frame to fit in the current MTU of the physical network. +.Sh HARDWARE +The +.Nm +driver supports hardware checksum offload (receive and transmit) and TSO on the +encapsulated traffic over physical interfaces that support these features. +The +.Nm +interface examines the +.Cm vxlandev +interface, if one is specified, or the interface hosting the +.Cm vxlanlocal +address, and configures its capabilities based on the hardware offload +capabilities of that physical interface. +If multiple physical interfaces will transmit or receive traffic for the +.Nm +then they all must have the same hardware capabilities. +The transmit routine of a +.Nm +interface may fail with +.Er ENXIO +if an outbound physical interface does not support +an offload that the +.Nm +interface is requesting. +This can happen if there are multiple physical interfaces involved, with +different hardware capabilities, or an interface capability was disabled after +the +.Nm +interface had already started. +.Pp +At present, these devices are capable of generating checksums and performing TSO +on the inner frames in hardware: +.Xr cxgbe 4 . .Sh EXAMPLES Create a .Nm @@ -244,3 +277,7 @@ The .Nm driver was written by .An Bryan Venteicher Aq bryanv@freebsd.org . +Support for stateless hardware offloads was added by +.An Navdeep Parhar Aq np@freebsd.org +in +.Fx 13.0 . Modified: head/share/man/man9/EVENTHANDLER.9 ============================================================================== --- head/share/man/man9/EVENTHANDLER.9 Fri Sep 18 02:21:15 2020 (r365869) +++ head/share/man/man9/EVENTHANDLER.9 Fri Sep 18 02:37:57 2020 (r365870) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" $FreeBSD$ .\" -.Dd October 21, 2018 +.Dd September 17, 2020 .Dt EVENTHANDLER 9 .Os .Sh NAME @@ -389,6 +389,10 @@ Callback invoked when the vlan configuration has chang Callback invoked when a vlan is destroyed. .It Vt vm_lowmem Callbacks invoked when virtual memory is low. +.It Vt vxlan_start +Callback invoked when a vxlan interface starts. +.It Vt vxlan_stop +Callback invoked when a vxlan interface stops. .It Vt watchdog_list Callbacks invoked when the system watchdog timer is reinitialized. .El Modified: head/sys/net/if_vxlan.c ============================================================================== --- head/sys/net/if_vxlan.c Fri Sep 18 02:21:15 2020 (r365869) +++ head/sys/net/if_vxlan.c Fri Sep 18 02:37:57 2020 (r365870) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2014, Bryan Venteicher * All rights reserved. + * Copyright (c) 2020, Chelsio Communications. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -60,6 +61,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -70,6 +73,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -77,6 +82,9 @@ __FBSDID("$FreeBSD$"); struct vxlan_softc; LIST_HEAD(vxlan_softc_head, vxlan_softc); +struct sx vxlan_sx; +SX_SYSINIT(vxlan, &vxlan_sx, "VXLAN global start/stop lock"); + struct vxlan_socket_mc_info { union vxlan_sockaddr vxlsomc_saddr; union vxlan_sockaddr vxlsomc_gaddr; @@ -92,6 +100,7 @@ struct vxlan_socket_mc_info { sizeof(struct udphdr) - \ sizeof(struct vxlan_header) - \ ETHER_HDR_LEN - ETHER_CRC_LEN - ETHER_VLAN_ENCAP_LEN) +#define VXLAN_BASIC_IFCAPS (IFCAP_LINKSTATE | IFCAP_JUMBO_MTU) #define VXLAN_SO_MC_MAX_GROUPS 32 @@ -146,10 +155,14 @@ LIST_HEAD(vxlan_ftable_head, vxlan_ftable_entry); struct vxlan_statistics { uint32_t ftable_nospace; uint32_t ftable_lock_upgrade_failed; + counter_u64_t txcsum; + counter_u64_t tso; + counter_u64_t rxcsum; }; struct vxlan_softc { struct ifnet *vxl_ifp; + int vxl_reqcap; struct vxlan_socket *vxl_sock; uint32_t vxl_vni; union vxlan_sockaddr vxl_src_addr; @@ -193,6 +206,10 @@ struct vxlan_softc { char vxl_mc_ifname[IFNAMSIZ]; LIST_ENTRY(vxlan_softc) vxl_entry; LIST_ENTRY(vxlan_softc) vxl_ifdetach_list; + + /* For rate limiting errors on the tx fast path. */ + struct timeval err_time; + int err_pps; }; #define VXLAN_RLOCK(_sc, _p) rm_rlock(&(_sc)->vxl_lock, (_p)) @@ -297,7 +314,10 @@ static int vxlan_setup_multicast_interface(struct vxla static int vxlan_setup_multicast(struct vxlan_softc *); static int vxlan_setup_socket(struct vxlan_softc *); -static void vxlan_setup_interface(struct vxlan_softc *); +#ifdef INET6 +static void vxlan_setup_zero_checksum_port(struct vxlan_softc *); +#endif +static void vxlan_setup_interface_hdrlen(struct vxlan_softc *); static int vxlan_valid_init_config(struct vxlan_softc *); static void vxlan_init_wait(struct vxlan_softc *); static void vxlan_init_complete(struct vxlan_softc *); @@ -347,9 +367,13 @@ static void vxlan_rcv_udp_packet(struct mbuf *, int, s static int vxlan_input(struct vxlan_socket *, uint32_t, struct mbuf **, const struct sockaddr *); +static int vxlan_stats_alloc(struct vxlan_softc *); +static void vxlan_stats_free(struct vxlan_softc *); static void vxlan_set_default_config(struct vxlan_softc *); static int vxlan_set_user_config(struct vxlan_softc *, struct ifvxlanparam *); +static int vxlan_set_reqcap(struct vxlan_softc *, struct ifnet *, int); +static void vxlan_set_hwcaps(struct vxlan_softc *); static int vxlan_clone_create(struct if_clone *, int, caddr_t); static void vxlan_clone_destroy(struct ifnet *); @@ -1555,9 +1579,45 @@ out: return (error); } +#ifdef INET6 static void -vxlan_setup_interface(struct vxlan_softc *sc) +vxlan_setup_zero_checksum_port(struct vxlan_softc *sc) { + + if (!VXLAN_SOCKADDR_IS_IPV6(&sc->vxl_src_addr)) + return; + + MPASS(sc->vxl_src_addr.in6.sin6_port != 0); + MPASS(sc->vxl_dst_addr.in6.sin6_port != 0); + + if (sc->vxl_src_addr.in6.sin6_port != sc->vxl_dst_addr.in6.sin6_port) { + if_printf(sc->vxl_ifp, "port %d in src address does not match " + "port %d in dst address, rfc6935_port (%d) not updated.\n", + ntohs(sc->vxl_src_addr.in6.sin6_port), + ntohs(sc->vxl_dst_addr.in6.sin6_port), + V_zero_checksum_port); + return; + } + + if (V_zero_checksum_port != 0) { + if (V_zero_checksum_port != + ntohs(sc->vxl_src_addr.in6.sin6_port)) { + if_printf(sc->vxl_ifp, "rfc6935_port is already set to " + "%d, cannot set it to %d.\n", V_zero_checksum_port, + ntohs(sc->vxl_src_addr.in6.sin6_port)); + } + return; + } + + V_zero_checksum_port = ntohs(sc->vxl_src_addr.in6.sin6_port); + if_printf(sc->vxl_ifp, "rfc6935_port set to %d\n", + V_zero_checksum_port); +} +#endif + +static void +vxlan_setup_interface_hdrlen(struct vxlan_softc *sc) +{ struct ifnet *ifp; ifp = sc->vxl_ifp; @@ -1655,9 +1715,11 @@ vxlan_init(void *xsc) sc = xsc; ifp = sc->vxl_ifp; + sx_xlock(&vxlan_sx); VXLAN_WLOCK(sc); if (ifp->if_drv_flags & IFF_DRV_RUNNING) { VXLAN_WUNLOCK(sc); + sx_xunlock(&vxlan_sx); return; } sc->vxl_flags |= VXLAN_FLAG_INIT; @@ -1666,11 +1728,13 @@ vxlan_init(void *xsc) if (vxlan_valid_init_config(sc) != 0) goto out; - vxlan_setup_interface(sc); - if (vxlan_setup_socket(sc) != 0) goto out; +#ifdef INET6 + vxlan_setup_zero_checksum_port(sc); +#endif + /* Initialize the default forwarding entry. */ vxlan_ftable_entry_init(sc, &sc->vxl_default_fe, empty_mac, &sc->vxl_dst_addr.sa, VXLAN_FE_FLAG_STATIC); @@ -1682,8 +1746,12 @@ vxlan_init(void *xsc) VXLAN_WUNLOCK(sc); if_link_state_change(ifp, LINK_STATE_UP); + + EVENTHANDLER_INVOKE(vxlan_start, ifp, sc->vxl_src_addr.in4.sin_family, + ntohs(sc->vxl_src_addr.in4.sin_port)); out: vxlan_init_complete(sc); + sx_xunlock(&vxlan_sx); } static void @@ -1725,11 +1793,11 @@ vxlan_teardown_locked(struct vxlan_softc *sc) struct ifnet *ifp; struct vxlan_socket *vso; - ifp = sc->vxl_ifp; - + sx_assert(&vxlan_sx, SA_XLOCKED); VXLAN_LOCK_WASSERT(sc); MPASS(sc->vxl_flags & VXLAN_FLAG_TEARDOWN); + ifp = sc->vxl_ifp; ifp->if_flags &= ~IFF_UP; ifp->if_drv_flags &= ~IFF_DRV_RUNNING; callout_stop(&sc->vxl_callout); @@ -1738,6 +1806,8 @@ vxlan_teardown_locked(struct vxlan_softc *sc) VXLAN_WUNLOCK(sc); if_link_state_change(ifp, LINK_STATE_DOWN); + EVENTHANDLER_INVOKE(vxlan_stop, ifp, sc->vxl_src_addr.in4.sin_family, + ntohs(sc->vxl_src_addr.in4.sin_port)); if (vso != NULL) { vxlan_socket_remove_softc(vso, sc); @@ -1767,15 +1837,18 @@ static void vxlan_teardown(struct vxlan_softc *sc) { + sx_xlock(&vxlan_sx); VXLAN_WLOCK(sc); if (sc->vxl_flags & VXLAN_FLAG_TEARDOWN) { vxlan_teardown_wait(sc); VXLAN_WUNLOCK(sc); + sx_xunlock(&vxlan_sx); return; } sc->vxl_flags |= VXLAN_FLAG_TEARDOWN; vxlan_teardown_locked(sc); + sx_xunlock(&vxlan_sx); } static void @@ -1907,6 +1980,7 @@ vxlan_ctrl_set_local_addr(struct vxlan_softc *sc, void VXLAN_WLOCK(sc); if (vxlan_can_change_config(sc)) { vxlan_sockaddr_in_copy(&sc->vxl_src_addr, &vxlsa->sa); + vxlan_set_hwcaps(sc); error = 0; } else error = EBUSY; @@ -1936,6 +2010,7 @@ vxlan_ctrl_set_remote_addr(struct vxlan_softc *sc, voi VXLAN_WLOCK(sc); if (vxlan_can_change_config(sc)) { vxlan_sockaddr_in_copy(&sc->vxl_dst_addr, &vxlsa->sa); + vxlan_setup_interface_hdrlen(sc); error = 0; } else error = EBUSY; @@ -2063,6 +2138,7 @@ vxlan_ctrl_set_multicast_if(struct vxlan_softc * sc, v VXLAN_WLOCK(sc); if (vxlan_can_change_config(sc)) { strlcpy(sc->vxl_mc_ifname, cmd->vxlcmd_ifname, IFNAMSIZ); + vxlan_set_hwcaps(sc); error = 0; } else error = EBUSY; @@ -2284,6 +2360,14 @@ vxlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat ifp->if_mtu = ifr->ifr_mtu; break; + case SIOCSIFCAP: + VXLAN_WLOCK(sc); + error = vxlan_set_reqcap(sc, ifp, ifr->ifr_reqcap); + if (error == 0) + vxlan_set_hwcaps(sc); + VXLAN_WUNLOCK(sc); + break; + default: error = ether_ioctl(ifp, cmd, data); break; @@ -2335,6 +2419,48 @@ vxlan_encap_header(struct vxlan_softc *sc, struct mbuf } #endif +/* + * Return the CSUM_INNER_* equivalent of CSUM_* caps. + */ +static uint32_t +csum_flags_to_inner_flags(uint32_t csum_flags_in, uint32_t encap) +{ + uint32_t csum_flags = CSUM_ENCAP_VXLAN; + const uint32_t v4 = CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP; + + /* + * csum_flags can request either v4 or v6 offload but not both. + * tcp_output always sets CSUM_TSO (both CSUM_IP_TSO and CSUM_IP6_TSO) + * so those bits are no good to detect the IP version. Other bits are + * always set with CSUM_TSO and we use those to figure out the IP + * version. + */ + if (csum_flags_in & v4) { + if (csum_flags_in & CSUM_IP) + csum_flags |= CSUM_INNER_IP; + if (csum_flags_in & CSUM_IP_UDP) + csum_flags |= CSUM_INNER_IP_UDP; + if (csum_flags_in & CSUM_IP_TCP) + csum_flags |= CSUM_INNER_IP_TCP; + if (csum_flags_in & CSUM_IP_TSO) + csum_flags |= CSUM_INNER_IP_TSO; + } else { +#ifdef INVARIANTS + const uint32_t v6 = CSUM_IP6_UDP | CSUM_IP6_TCP; + + MPASS((csum_flags_in & v6) != 0); +#endif + if (csum_flags_in & CSUM_IP6_UDP) + csum_flags |= CSUM_INNER_IP6_UDP; + if (csum_flags_in & CSUM_IP6_TCP) + csum_flags |= CSUM_INNER_IP6_TCP; + if (csum_flags_in & CSUM_IP6_TSO) + csum_flags |= CSUM_INNER_IP6_TSO; + } + + return (csum_flags); +} + static int vxlan_encap4(struct vxlan_softc *sc, const union vxlan_sockaddr *fvxlsa, struct mbuf *m) @@ -2345,7 +2471,12 @@ vxlan_encap4(struct vxlan_softc *sc, const union vxlan struct in_addr srcaddr, dstaddr; uint16_t srcport, dstport; int len, mcast, error; + struct route route, *ro; + struct sockaddr_in *sin; + uint32_t csum_flags; + NET_EPOCH_ASSERT(); + ifp = sc->vxl_ifp; srcaddr = sc->vxl_src_addr.in4.sin_addr; srcport = vxlan_pick_source_port(sc, m); @@ -2376,7 +2507,57 @@ vxlan_encap4(struct vxlan_softc *sc, const union vxlan mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1 : 0; m->m_flags &= ~(M_MCAST | M_BCAST); - error = ip_output(m, NULL, NULL, 0, sc->vxl_im4o, NULL); + m->m_pkthdr.csum_flags &= CSUM_FLAGS_TX; + if (m->m_pkthdr.csum_flags != 0) { + /* + * HW checksum (L3 and/or L4) or TSO has been requested. Look + * up the ifnet for the outbound route and verify that the + * outbound ifnet can perform the requested operation on the + * inner frame. + */ + bzero(&route, sizeof(route)); + ro = &route; + sin = (struct sockaddr_in *)&ro->ro_dst; + sin->sin_family = AF_INET; + sin->sin_len = sizeof(*sin); + sin->sin_addr = ip->ip_dst; + ro->ro_nh = fib4_lookup(RT_DEFAULT_FIB, ip->ip_dst, 0, NHR_NONE, + 0); + if (ro->ro_nh == NULL) { + m_freem(m); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + return (EHOSTUNREACH); + } + + csum_flags = csum_flags_to_inner_flags(m->m_pkthdr.csum_flags, + CSUM_ENCAP_VXLAN); + if ((csum_flags & ro->ro_nh->nh_ifp->if_hwassist) != + csum_flags) { + if (ppsratecheck(&sc->err_time, &sc->err_pps, 1)) { + const struct ifnet *nh_ifp = ro->ro_nh->nh_ifp; + + if_printf(ifp, "interface %s is missing hwcaps " + "0x%08x, csum_flags 0x%08x -> 0x%08x, " + "hwassist 0x%08x\n", nh_ifp->if_xname, + csum_flags & ~(uint32_t)nh_ifp->if_hwassist, + m->m_pkthdr.csum_flags, csum_flags, + (uint32_t)nh_ifp->if_hwassist); + } + m_freem(m); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + return (ENXIO); + } + m->m_pkthdr.csum_flags = csum_flags; + if (csum_flags & + (CSUM_INNER_IP | CSUM_INNER_IP_UDP | CSUM_INNER_IP6_UDP | + CSUM_INNER_IP_TCP | CSUM_INNER_IP6_TCP)) { + counter_u64_add(sc->vxl_stats.txcsum, 1); + if (csum_flags & CSUM_INNER_TSO) + counter_u64_add(sc->vxl_stats.tso, 1); + } + } else + ro = NULL; + error = ip_output(m, NULL, ro, 0, sc->vxl_im4o, NULL); if (error == 0) { if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); if_inc_counter(ifp, IFCOUNTER_OBYTES, len); @@ -2402,7 +2583,12 @@ vxlan_encap6(struct vxlan_softc *sc, const union vxlan const struct in6_addr *srcaddr, *dstaddr; uint16_t srcport, dstport; int len, mcast, error; + struct route_in6 route, *ro; + struct sockaddr_in6 *sin6; + uint32_t csum_flags; + NET_EPOCH_ASSERT(); + ifp = sc->vxl_ifp; srcaddr = &sc->vxl_src_addr.in6.sin6_addr; srcport = vxlan_pick_source_port(sc, m); @@ -2429,22 +2615,67 @@ vxlan_encap6(struct vxlan_softc *sc, const union vxlan vxlan_encap_header(sc, m, sizeof(struct ip6_hdr), srcport, dstport); - /* - * XXX BMV We need support for RFC6935 before we can send and - * receive IPv6 UDP packets with a zero checksum. - */ - { + mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1 : 0; + m->m_flags &= ~(M_MCAST | M_BCAST); + + ro = NULL; + m->m_pkthdr.csum_flags &= CSUM_FLAGS_TX; + if (m->m_pkthdr.csum_flags != 0) { + /* + * HW checksum (L3 and/or L4) or TSO has been requested. Look + * up the ifnet for the outbound route and verify that the + * outbound ifnet can perform the requested operation on the + * inner frame. + */ + bzero(&route, sizeof(route)); + ro = &route; + sin6 = (struct sockaddr_in6 *)&ro->ro_dst; + sin6->sin6_family = AF_INET6; + sin6->sin6_len = sizeof(*sin6); + sin6->sin6_addr = ip6->ip6_dst; + ro->ro_nh = fib6_lookup(RT_DEFAULT_FIB, &ip6->ip6_dst, 0, + NHR_NONE, 0); + if (ro->ro_nh == NULL) { + m_freem(m); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + return (EHOSTUNREACH); + } + + csum_flags = csum_flags_to_inner_flags(m->m_pkthdr.csum_flags, + CSUM_ENCAP_VXLAN); + if ((csum_flags & ro->ro_nh->nh_ifp->if_hwassist) != + csum_flags) { + if (ppsratecheck(&sc->err_time, &sc->err_pps, 1)) { + const struct ifnet *nh_ifp = ro->ro_nh->nh_ifp; + + if_printf(ifp, "interface %s is missing hwcaps " + "0x%08x, csum_flags 0x%08x -> 0x%08x, " + "hwassist 0x%08x\n", nh_ifp->if_xname, + csum_flags & ~(uint32_t)nh_ifp->if_hwassist, + m->m_pkthdr.csum_flags, csum_flags, + (uint32_t)nh_ifp->if_hwassist); + } + m_freem(m); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + return (ENXIO); + } + m->m_pkthdr.csum_flags = csum_flags; + if (csum_flags & + (CSUM_INNER_IP | CSUM_INNER_IP_UDP | CSUM_INNER_IP6_UDP | + CSUM_INNER_IP_TCP | CSUM_INNER_IP6_TCP)) { + counter_u64_add(sc->vxl_stats.txcsum, 1); + if (csum_flags & CSUM_INNER_TSO) + counter_u64_add(sc->vxl_stats.tso, 1); + } + } else if (ntohs(dstport) != V_zero_checksum_port) { struct udphdr *hdr = mtodo(m, sizeof(struct ip6_hdr)); + hdr->uh_sum = in6_cksum_pseudo(ip6, m->m_pkthdr.len - sizeof(struct ip6_hdr), IPPROTO_UDP, 0); m->m_pkthdr.csum_flags = CSUM_UDP_IPV6; m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); } - - mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1 : 0; - m->m_flags &= ~(M_MCAST | M_BCAST); - - error = ip6_output(m, NULL, NULL, 0, sc->vxl_im6o, NULL, NULL); + error = ip6_output(m, NULL, ro, 0, sc->vxl_im6o, NULL, NULL); if (error == 0) { if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); if_inc_counter(ifp, IFCOUNTER_OBYTES, len); @@ -2593,8 +2824,30 @@ vxlan_input(struct vxlan_socket *vso, uint32_t vni, st m_clrprotoflags(m); m->m_pkthdr.rcvif = ifp; M_SETFIB(m, ifp->if_fib); + if (m->m_pkthdr.csum_flags & CSUM_ENCAP_VXLAN && + ((ifp->if_capenable & IFCAP_RXCSUM && + m->m_pkthdr.csum_flags & CSUM_INNER_L3_CALC) || + (ifp->if_capenable & IFCAP_RXCSUM_IPV6 && + !(m->m_pkthdr.csum_flags & CSUM_INNER_L3_CALC)))) { + uint32_t csum_flags = 0; - error = netisr_queue_src(NETISR_ETHER, 0, m); + if (m->m_pkthdr.csum_flags & CSUM_INNER_L3_CALC) + csum_flags |= CSUM_L3_CALC; + if (m->m_pkthdr.csum_flags & CSUM_INNER_L3_VALID) + csum_flags |= CSUM_L3_VALID; + if (m->m_pkthdr.csum_flags & CSUM_INNER_L4_CALC) + csum_flags |= CSUM_L4_CALC; + if (m->m_pkthdr.csum_flags & CSUM_INNER_L4_VALID) + csum_flags |= CSUM_L4_VALID; + m->m_pkthdr.csum_flags = csum_flags; + counter_u64_add(sc->vxl_stats.rxcsum, 1); + } else { + /* clear everything */ + m->m_pkthdr.csum_flags = 0; + m->m_pkthdr.csum_data = 0; + } + + error = netisr_dispatch(NETISR_ETHER, m); *m0 = NULL; out: @@ -2602,7 +2855,49 @@ out: return (error); } +static int +vxlan_stats_alloc(struct vxlan_softc *sc) +{ + struct vxlan_statistics *stats = &sc->vxl_stats; + + stats->txcsum = counter_u64_alloc(M_WAITOK); + if (stats->txcsum == NULL) + goto failed; + + stats->tso = counter_u64_alloc(M_WAITOK); + if (stats->tso == NULL) + goto failed; + + stats->rxcsum = counter_u64_alloc(M_WAITOK); + if (stats->rxcsum == NULL) + goto failed; + + return (0); +failed: + vxlan_stats_free(sc); + return (ENOMEM); +} + static void +vxlan_stats_free(struct vxlan_softc *sc) +{ + struct vxlan_statistics *stats = &sc->vxl_stats; + + if (stats->txcsum != NULL) { + counter_u64_free(stats->txcsum); + stats->txcsum = NULL; + } + if (stats->tso != NULL) { + counter_u64_free(stats->tso); + stats->tso = NULL; + } + if (stats->rxcsum != NULL) { + counter_u64_free(stats->rxcsum); + stats->rxcsum = NULL; + } +} + +static void vxlan_set_default_config(struct vxlan_softc *sc) { @@ -2722,6 +3017,142 @@ vxlan_set_user_config(struct vxlan_softc *sc, struct i } static int +vxlan_set_reqcap(struct vxlan_softc *sc, struct ifnet *ifp, int reqcap) +{ + int mask = reqcap ^ ifp->if_capenable; + + /* Disable TSO if tx checksums are disabled. */ + if (mask & IFCAP_TXCSUM && !(reqcap & IFCAP_TXCSUM) && + reqcap & IFCAP_TSO4) { + reqcap &= ~IFCAP_TSO4; + if_printf(ifp, "tso4 disabled due to -txcsum.\n"); + } + if (mask & IFCAP_TXCSUM_IPV6 && !(reqcap & IFCAP_TXCSUM_IPV6) && + reqcap & IFCAP_TSO6) { + reqcap &= ~IFCAP_TSO6; + if_printf(ifp, "tso6 disabled due to -txcsum6.\n"); + } + + /* Do not enable TSO if tx checksums are disabled. */ + if (mask & IFCAP_TSO4 && reqcap & IFCAP_TSO4 && + !(reqcap & IFCAP_TXCSUM)) { + if_printf(ifp, "enable txcsum first.\n"); + return (EAGAIN); + } + if (mask & IFCAP_TSO6 && reqcap & IFCAP_TSO6 && + !(reqcap & IFCAP_TXCSUM_IPV6)) { + if_printf(ifp, "enable txcsum6 first.\n"); + return (EAGAIN); + } + + sc->vxl_reqcap = reqcap; + return (0); +} + +/* + * A VXLAN interface inherits the capabilities of the vxlandev or the interface + * hosting the vxlanlocal address. + */ +static void +vxlan_set_hwcaps(struct vxlan_softc *sc) +{ + struct epoch_tracker et; + struct ifnet *p; + struct ifaddr *ifa; + u_long hwa; + int cap, ena; + bool rel; + struct ifnet *ifp = sc->vxl_ifp; + + /* reset caps */ + ifp->if_capabilities &= VXLAN_BASIC_IFCAPS; + ifp->if_capenable &= VXLAN_BASIC_IFCAPS; + ifp->if_hwassist = 0; + + NET_EPOCH_ENTER(et); + CURVNET_SET(ifp->if_vnet); + + rel = false; + p = NULL; + if (sc->vxl_mc_ifname[0] != '\0') { + rel = true; + p = ifunit_ref(sc->vxl_mc_ifname); + } else if (vxlan_sockaddr_in_any(&sc->vxl_src_addr) == 0) { + if (sc->vxl_src_addr.sa.sa_family == AF_INET) { + struct sockaddr_in in4 = sc->vxl_src_addr.in4; + + in4.sin_port = 0; + ifa = ifa_ifwithaddr((struct sockaddr *)&in4); + if (ifa != NULL) + p = ifa->ifa_ifp; + } else if (sc->vxl_src_addr.sa.sa_family == AF_INET6) { + struct sockaddr_in6 in6 = sc->vxl_src_addr.in6; + + in6.sin6_port = 0; + ifa = ifa_ifwithaddr((struct sockaddr *)&in6); + if (ifa != NULL) + p = ifa->ifa_ifp; + } + } + if (p == NULL) + goto done; + + cap = ena = hwa = 0; + + /* checksum offload */ + if (p->if_capabilities & IFCAP_VXLAN_HWCSUM) + cap |= p->if_capabilities & (IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6); + if (p->if_capenable & IFCAP_VXLAN_HWCSUM) { + ena |= sc->vxl_reqcap & p->if_capenable & + (IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6); + if (ena & IFCAP_TXCSUM) { + if (p->if_hwassist & CSUM_INNER_IP) + hwa |= CSUM_IP; + if (p->if_hwassist & CSUM_INNER_IP_UDP) + hwa |= CSUM_IP_UDP; + if (p->if_hwassist & CSUM_INNER_IP_TCP) + hwa |= CSUM_IP_TCP; + } + if (ena & IFCAP_TXCSUM_IPV6) { + if (p->if_hwassist & CSUM_INNER_IP6_UDP) + hwa |= CSUM_IP6_UDP; + if (p->if_hwassist & CSUM_INNER_IP6_TCP) + hwa |= CSUM_IP6_TCP; + } + } + + /* hardware TSO */ + if (p->if_capabilities & IFCAP_VXLAN_HWTSO) { + cap |= p->if_capabilities & IFCAP_TSO; + if (p->if_hw_tsomax > IP_MAXPACKET - ifp->if_hdrlen) + ifp->if_hw_tsomax = IP_MAXPACKET - ifp->if_hdrlen; + else + ifp->if_hw_tsomax = p->if_hw_tsomax; + /* XXX: tsomaxsegcount decrement is cxgbe specific */ + ifp->if_hw_tsomaxsegcount = p->if_hw_tsomaxsegcount - 1; + ifp->if_hw_tsomaxsegsize = p->if_hw_tsomaxsegsize; + } + if (p->if_capenable & IFCAP_VXLAN_HWTSO) { + ena |= sc->vxl_reqcap & p->if_capenable & IFCAP_TSO; + if (ena & IFCAP_TSO) { + if (p->if_hwassist & CSUM_INNER_IP_TSO) + hwa |= CSUM_IP_TSO; + if (p->if_hwassist & CSUM_INNER_IP6_TSO) + hwa |= CSUM_IP6_TSO; + } + } + + ifp->if_capabilities |= cap; + ifp->if_capenable |= ena; + ifp->if_hwassist |= hwa; + if (rel) + if_rele(p); +done: + CURVNET_RESTORE(); + NET_EPOCH_EXIT(et); +} + +static int vxlan_clone_create(struct if_clone *ifc, int unit, caddr_t params) { struct vxlan_softc *sc; @@ -2732,6 +3163,9 @@ vxlan_clone_create(struct if_clone *ifc, int unit, cad sc = malloc(sizeof(struct vxlan_softc), M_VXLAN, M_WAITOK | M_ZERO); sc->vxl_unit = unit; vxlan_set_default_config(sc); + error = vxlan_stats_alloc(sc); + if (error != 0) + goto fail; if (params != 0) { error = copyin(params, &vxlp, sizeof(vxlp)); @@ -2764,8 +3198,10 @@ vxlan_clone_create(struct if_clone *ifc, int unit, cad ifp->if_ioctl = vxlan_ioctl; ifp->if_transmit = vxlan_transmit; ifp->if_qflush = vxlan_qflush; - ifp->if_capabilities |= IFCAP_LINKSTATE | IFCAP_JUMBO_MTU; - ifp->if_capenable |= IFCAP_LINKSTATE | IFCAP_JUMBO_MTU; + ifp->if_capabilities = VXLAN_BASIC_IFCAPS; + ifp->if_capenable = VXLAN_BASIC_IFCAPS; + sc->vxl_reqcap = -1; + vxlan_set_hwcaps(sc); ifmedia_init(&sc->vxl_media, 0, vxlan_media_change, vxlan_media_status); ifmedia_add(&sc->vxl_media, IFM_ETHER | IFM_AUTO, 0, NULL); @@ -2775,7 +3211,7 @@ vxlan_clone_create(struct if_clone *ifc, int unit, cad ether_ifattach(ifp, sc->vxl_hwaddr.octet); ifp->if_baudrate = 0; - ifp->if_hdrlen = 0; + vxlan_setup_interface_hdrlen(sc); return (0); @@ -2803,6 +3239,7 @@ vxlan_clone_destroy(struct ifnet *ifp) vxlan_sysctl_destroy(sc); rm_destroy(&sc->vxl_lock); + vxlan_stats_free(sc); free(sc, M_VXLAN); } @@ -3087,6 +3524,15 @@ vxlan_sysctl_setup(struct vxlan_softc *sc) "ftable_lock_upgrade_failed", CTLFLAG_RD, &stats->ftable_lock_upgrade_failed, 0, "Forwarding table update required lock upgrade"); + + SYSCTL_ADD_COUNTER_U64(ctx, SYSCTL_CHILDREN(node), OID_AUTO, "txcsum", + CTLFLAG_RD, &stats->txcsum, + "# of times hardware assisted with tx checksum"); + SYSCTL_ADD_COUNTER_U64(ctx, SYSCTL_CHILDREN(node), OID_AUTO, "tso", + CTLFLAG_RD, &stats->tso, "# of times hardware assisted with TSO"); + SYSCTL_ADD_COUNTER_U64(ctx, SYSCTL_CHILDREN(node), OID_AUTO, "rxcsum", + CTLFLAG_RD, &stats->rxcsum, + "# of times hardware assisted with rx checksum"); } static void @@ -3131,10 +3577,12 @@ vxlan_ifdetach_event(void *arg __unused, struct ifnet LIST_FOREACH_SAFE(sc, &list, vxl_ifdetach_list, tsc) { LIST_REMOVE(sc, vxl_ifdetach_list); + sx_xlock(&vxlan_sx); VXLAN_WLOCK(sc); if (sc->vxl_flags & VXLAN_FLAG_INIT) vxlan_init_wait(sc); vxlan_teardown_locked(sc); + sx_xunlock(&vxlan_sx); } } Modified: head/sys/net/if_vxlan.h ============================================================================== --- head/sys/net/if_vxlan.h Fri Sep 18 02:21:15 2020 (r365869) +++ head/sys/net/if_vxlan.h Fri Sep 18 02:37:57 2020 (r365870) @@ -143,4 +143,11 @@ struct ifvxlancmd { char vxlcmd_ifname[IFNAMSIZ]; }; +#ifdef _KERNEL +typedef void (*vxlan_event_handler_t)(void *, struct ifnet *, sa_family_t, + u_int); +EVENTHANDLER_DECLARE(vxlan_start, vxlan_event_handler_t); +EVENTHANDLER_DECLARE(vxlan_stop, vxlan_event_handler_t); +#endif + #endif /* _NET_IF_VXLAN_H_ */ Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri Sep 18 02:21:15 2020 (r365869) +++ head/sys/netinet/ip_output.c Fri Sep 18 02:37:57 2020 (r365870) @@ -767,9 +767,13 @@ sendit: /* * If small enough for interface, or the interface will take * care of the fragmentation for us, we can just send directly. + * Note that if_vxlan could have requested TSO even though the outer + * frame is UDP. It is correct to not fragment such datagrams and + * instead just pass them on to the driver. */ if (ip_len <= mtu || - (m->m_pkthdr.csum_flags & ifp->if_hwassist & CSUM_TSO) != 0) { + (m->m_pkthdr.csum_flags & ifp->if_hwassist & + (CSUM_TSO | CSUM_INNER_TSO)) != 0) { ip->ip_sum = 0; if (m->m_pkthdr.csum_flags & CSUM_IP & ~ifp->if_hwassist) { ip->ip_sum = in_cksum(m, hlen); @@ -783,7 +787,8 @@ sendit: * once instead of for every generated packet. */ if (!(flags & IP_FORWARDING) && ia) { - if (m->m_pkthdr.csum_flags & CSUM_TSO) + if (m->m_pkthdr.csum_flags & + (CSUM_TSO | CSUM_INNER_TSO)) counter_u64_add(ia->ia_ifa.ifa_opackets, m->m_pkthdr.len / m->m_pkthdr.tso_segsz); else @@ -807,7 +812,8 @@ sendit: } /* Balk when DF bit is set or the interface didn't support TSO. */ - if ((ip_off & IP_DF) || (m->m_pkthdr.csum_flags & CSUM_TSO)) { + if ((ip_off & IP_DF) || + (m->m_pkthdr.csum_flags & (CSUM_TSO | CSUM_INNER_TSO))) { error = EMSGSIZE; IPSTAT_INC(ips_cantfrag); goto bad; Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Fri Sep 18 02:21:15 2020 (r365869) +++ head/sys/netinet6/ip6_output.c Fri Sep 18 02:37:57 2020 (r365870) @@ -1119,7 +1119,8 @@ passout: */ sw_csum = m->m_pkthdr.csum_flags; if (!hdrsplit) { - tso = ((sw_csum & ifp->if_hwassist & CSUM_TSO) != 0) ? 1 : 0; + tso = ((sw_csum & ifp->if_hwassist & + (CSUM_TSO | CSUM_INNER_TSO)) != 0) ? 1 : 0; sw_csum &= ~ifp->if_hwassist; } else tso = 0; From owner-svn-src-all@freebsd.org Fri Sep 18 03:01:49 2020 Return-Path: Delivered-To: svn-src-all@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 403183F565F; Fri, 18 Sep 2020 03:01:49 +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 4BszBj1Jwgz41Pt; Fri, 18 Sep 2020 03:01:49 +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 1172D144E0; Fri, 18 Sep 2020 03:01:49 +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 08I31n7U021058; Fri, 18 Sep 2020 03:01:49 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08I31lhU021051; Fri, 18 Sep 2020 03:01:47 GMT (envelope-from np@FreeBSD.org) Message-Id: <202009180301.08I31lhU021051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 18 Sep 2020 03:01:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365871 - in head: share/man/man4 sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/firmware X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/firmware X-SVN-Commit-Revision: 365871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 03:01:49 -0000 Author: np Date: Fri Sep 18 03:01:47 2020 New Revision: 365871 URL: https://svnweb.freebsd.org/changeset/base/365871 Log: cxgbe(4): add support for stateless offloads for VXLAN traffic. Hardware assistance includes checksumming (tx and rx), TSO, and RSS on the inner traffic in a VXLAN tunnel. Relnotes: Yes Sponsored by: Chelsio Communications Modified: head/share/man/man4/cxgbe.4 head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/firmware/t6fw_cfg.txt head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c Modified: head/share/man/man4/cxgbe.4 ============================================================================== --- head/share/man/man4/cxgbe.4 Fri Sep 18 02:37:57 2020 (r365870) +++ head/share/man/man4/cxgbe.4 Fri Sep 18 03:01:47 2020 (r365871) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Dec 10, 2019 +.Dd September 17, 2020 .Dt CXGBE 4 .Os .Sh NAME @@ -61,8 +61,8 @@ driver provides support for PCI Express Ethernet adapt the Chelsio Terminator 4, Terminator 5, and Terminator 6 ASICs (T4, T5, and T6). The driver supports Jumbo Frames, Transmit/Receive checksum offload, TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN -tag insertion/extraction, VLAN checksum offload, VLAN TSO, and -Receive Side Steering (RSS). +tag insertion/extraction, VLAN checksum offload, VLAN TSO, VXLAN checksum +offload, VXLAN TSO, and Receive Side Steering (RSS). For further hardware information and questions related to hardware requirements, see .Pa http://www.chelsio.com/ . Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Fri Sep 18 02:37:57 2020 (r365870) +++ head/sys/dev/cxgbe/adapter.h Fri Sep 18 03:01:47 2020 (r365871) @@ -119,6 +119,7 @@ enum { TX_SGL_SEGS = 39, TX_SGL_SEGS_TSO = 38, TX_SGL_SEGS_EO_TSO = 30, /* XXX: lower for IPv6. */ + TX_SGL_SEGS_VXLAN_TSO = 37, TX_WR_FLITS = SGE_MAX_WR_LEN / 8 }; @@ -286,6 +287,7 @@ struct port_info { int nvi; int up_vis; int uld_vis; + bool vxlan_tcam_entry; struct tx_sched_params *sched_params; @@ -593,6 +595,8 @@ struct sge_txq { uint64_t txpkts0_pkts; /* # of frames in type0 coalesced tx WRs */ uint64_t txpkts1_pkts; /* # of frames in type1 coalesced tx WRs */ uint64_t raw_wrs; /* # of raw work requests (alloc_wr_mbuf) */ + uint64_t vxlan_tso_wrs; /* # of VXLAN TSO work requests */ + uint64_t vxlan_txcsum; uint64_t kern_tls_records; uint64_t kern_tls_short; @@ -625,6 +629,7 @@ struct sge_rxq { uint64_t rxcsum; /* # of times hardware assisted with checksum */ uint64_t vlan_extraction;/* # of times VLAN tag was extracted */ + uint64_t vxlan_rxcsum; /* stats for not-that-common events */ @@ -847,6 +852,11 @@ struct adapter { struct sge sge; int lro_timeout; int sc_do_rxcopy; + + int vxlan_port; + u_int vxlan_refcount; + int rawf_base; + int nrawf; struct taskqueue *tq[MAX_NCHAN]; /* General purpose taskqueues */ struct task async_event_task; Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Fri Sep 18 02:37:57 2020 (r365870) +++ head/sys/dev/cxgbe/common/common.h Fri Sep 18 03:01:47 2020 (r365871) @@ -249,7 +249,7 @@ struct tp_params { uint32_t max_rx_pdu; uint32_t max_tx_pdu; uint64_t hash_filter_mask; - __be16 err_vec_mask; + bool rx_pkt_encap; int8_t fcoe_shift; int8_t port_shift; Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Fri Sep 18 02:37:57 2020 (r365870) +++ head/sys/dev/cxgbe/common/t4_hw.c Fri Sep 18 03:01:47 2020 (r365871) @@ -9647,19 +9647,11 @@ int t4_init_tp_params(struct adapter *adap, bool sleep read_filter_mode_and_ingress_config(adap, sleep_ok); - /* - * Cache a mask of the bits that represent the error vector portion of - * rx_pkt.err_vec. T6+ can use a compressed error vector to make room - * for information about outer encapsulation (GENEVE/VXLAN/NVGRE). - */ - tpp->err_vec_mask = htobe16(0xffff); if (chip_id(adap) > CHELSIO_T5) { v = t4_read_reg(adap, A_TP_OUT_CONFIG); - if (v & F_CRXPKTENC) { - tpp->err_vec_mask = - htobe16(V_T6_COMPR_RXERR_VEC(M_T6_COMPR_RXERR_VEC)); - } - } + tpp->rx_pkt_encap = v & F_CRXPKTENC; + } else + tpp->rx_pkt_encap = false; rx_len = t4_read_reg(adap, A_TP_PMM_RX_PAGE_SIZE); tx_len = t4_read_reg(adap, A_TP_PMM_TX_PAGE_SIZE); Modified: head/sys/dev/cxgbe/firmware/t6fw_cfg.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t6fw_cfg.txt Fri Sep 18 02:37:57 2020 (r365870) +++ head/sys/dev/cxgbe/firmware/t6fw_cfg.txt Fri Sep 18 03:01:47 2020 (r365871) @@ -146,7 +146,8 @@ nethctrl = 1024 neq = 2048 nqpcq = 8192 - nexactf = 456 + nexactf = 454 + nrawf = 2 cmask = all pmask = all ncrypto_lookaside = 16 @@ -272,7 +273,7 @@ [fini] version = 0x1 - checksum = 0x13640470 + checksum = 0xa92352a8 # # $FreeBSD$ # Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Sep 18 02:37:57 2020 (r365870) +++ head/sys/dev/cxgbe/t4_main.c Fri Sep 18 03:01:47 2020 (r365871) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1069,6 +1070,8 @@ t4_attach(device_t dev) TASK_INIT(&sc->async_event_task, 0, t4_async_event, sc); #endif + refcount_init(&sc->vxlan_refcount, 0); + rc = t4_map_bars_0_and_4(sc); if (rc != 0) goto done; /* error message displayed already */ @@ -1716,6 +1719,7 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) struct ifnet *ifp; struct sbuf *sb; struct pfil_head_args pa; + struct adapter *sc = vi->adapter; vi->xact_addr_filt = -1; callout_init(&vi->tick, 1); @@ -1749,28 +1753,36 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) ifp->if_capabilities = T4_CAP; ifp->if_capenable = T4_CAP_ENABLE; + ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO | + CSUM_UDP_IPV6 | CSUM_TCP_IPV6; + if (chip_id(sc) >= CHELSIO_T6) { + ifp->if_capabilities |= IFCAP_VXLAN_HWCSUM | IFCAP_VXLAN_HWTSO; + ifp->if_capenable |= IFCAP_VXLAN_HWCSUM | IFCAP_VXLAN_HWTSO; + ifp->if_hwassist |= CSUM_INNER_IP6_UDP | CSUM_INNER_IP6_TCP | + CSUM_INNER_IP6_TSO | CSUM_INNER_IP | CSUM_INNER_IP_UDP | + CSUM_INNER_IP_TCP | CSUM_INNER_IP_TSO | CSUM_ENCAP_VXLAN; + } + #ifdef TCP_OFFLOAD - if (vi->nofldrxq != 0 && (vi->adapter->flags & KERN_TLS_OK) == 0) + if (vi->nofldrxq != 0 && (sc->flags & KERN_TLS_OK) == 0) ifp->if_capabilities |= IFCAP_TOE; #endif #ifdef RATELIMIT - if (is_ethoffload(vi->adapter) && vi->nofldtxq != 0) { + if (is_ethoffload(sc) && vi->nofldtxq != 0) { ifp->if_capabilities |= IFCAP_TXRTLMT; ifp->if_capenable |= IFCAP_TXRTLMT; } #endif - ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO | - CSUM_UDP_IPV6 | CSUM_TCP_IPV6; ifp->if_hw_tsomax = IP_MAXPACKET; ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_TSO; #ifdef RATELIMIT - if (is_ethoffload(vi->adapter) && vi->nofldtxq != 0) + if (is_ethoffload(sc) && vi->nofldtxq != 0) ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_EO_TSO; #endif ifp->if_hw_tsomaxsegsize = 65536; #ifdef KERN_TLS - if (vi->adapter->flags & KERN_TLS_OK) { + if (sc->flags & KERN_TLS_OK) { ifp->if_capabilities |= IFCAP_TXTLS; ifp->if_capenable |= IFCAP_TXTLS; } @@ -2100,6 +2112,17 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, cadd if (mask & IFCAP_TXTLS) ifp->if_capenable ^= (mask & IFCAP_TXTLS); #endif + if (mask & IFCAP_VXLAN_HWCSUM) { + ifp->if_capenable ^= IFCAP_VXLAN_HWCSUM; + ifp->if_hwassist ^= CSUM_INNER_IP6_UDP | + CSUM_INNER_IP6_TCP | CSUM_INNER_IP | + CSUM_INNER_IP_UDP | CSUM_INNER_IP_TCP; + } + if (mask & IFCAP_VXLAN_HWTSO) { + ifp->if_capenable ^= IFCAP_VXLAN_HWTSO; + ifp->if_hwassist ^= CSUM_INNER_IP6_TSO | + CSUM_INNER_IP_TSO; + } #ifdef VLAN_CAPABILITIES VLAN_CAPABILITIES(ifp); @@ -4411,6 +4434,19 @@ get_params__post_init(struct adapter *sc) MPASS(sc->tids.hpftid_base == 0); MPASS(sc->tids.tid_base == sc->tids.nhpftids); } + + param[0] = FW_PARAM_PFVF(RAWF_START); + param[1] = FW_PARAM_PFVF(RAWF_END); + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 2, param, val); + if (rc != 0) { + device_printf(sc->dev, + "failed to query rawf parameters: %d.\n", rc); + return (rc); + } + if ((int)val[1] > (int)val[0]) { + sc->rawf_base = val[0]; + sc->nrawf = val[1] - val[0] + 1; + } } /* @@ -5142,6 +5178,7 @@ update_mac_settings(struct ifnet *ifp, int flags) struct port_info *pi = vi->pi; struct adapter *sc = pi->adapter; int mtu = -1, promisc = -1, allmulti = -1, vlanex = -1; + uint8_t match_all_mac[ETHER_ADDR_LEN] = {0}; ASSERT_SYNCHRONIZED_OP(sc); KASSERT(flags, ("%s: not told what to update.", __func__)); @@ -5215,7 +5252,7 @@ update_mac_settings(struct ifnet *ifp, int flags) rc = -rc; for (j = 0; j < ctx.i; j++) { if_printf(ifp, - "failed to add mc address" + "failed to add mcast address" " %02x:%02x:%02x:" "%02x:%02x:%02x rc=%d\n", ctx.mcaddr[j][0], ctx.mcaddr[j][1], @@ -5225,14 +5262,36 @@ update_mac_settings(struct ifnet *ifp, int flags) } return (rc); } + ctx.del = 0; } else NET_EPOCH_EXIT(et); rc = -t4_set_addr_hash(sc, sc->mbox, vi->viid, 0, ctx.hash, 0); if (rc != 0) - if_printf(ifp, "failed to set mc address hash: %d", rc); + if_printf(ifp, "failed to set mcast address hash: %d\n", + rc); + if (ctx.del == 0) { + /* We clobbered the VXLAN entry if there was one. */ + pi->vxlan_tcam_entry = false; + } } + if (IS_MAIN_VI(vi) && sc->vxlan_refcount > 0 && + pi->vxlan_tcam_entry == false) { + rc = t4_alloc_raw_mac_filt(sc, vi->viid, match_all_mac, + match_all_mac, sc->rawf_base + pi->port_id, 1, pi->port_id, + true); + if (rc < 0) { + rc = -rc; + if_printf(ifp, "failed to add VXLAN TCAM entry: %d.\n", + rc); + } else { + MPASS(rc == sc->rawf_base + pi->port_id); + rc = 0; + pi->vxlan_tcam_entry = true; + } + } + return (rc); } @@ -10407,6 +10466,7 @@ clear_stats(struct adapter *sc, u_int port_id) #endif rxq->rxcsum = 0; rxq->vlan_extraction = 0; + rxq->vxlan_rxcsum = 0; rxq->fl.cl_allocated = 0; rxq->fl.cl_recycled = 0; @@ -10425,6 +10485,8 @@ clear_stats(struct adapter *sc, u_int port_id) txq->txpkts0_pkts = 0; txq->txpkts1_pkts = 0; txq->raw_wrs = 0; + txq->vxlan_tso_wrs = 0; + txq->vxlan_txcsum = 0; txq->kern_tls_records = 0; txq->kern_tls_short = 0; txq->kern_tls_partial = 0; @@ -11235,6 +11297,116 @@ DB_FUNC(tcb, db_show_t4tcb, db_t4_table, CS_OWN, NULL) } #endif +static eventhandler_tag vxlan_start_evtag; +static eventhandler_tag vxlan_stop_evtag; + +struct vxlan_evargs { + struct ifnet *ifp; + uint16_t port; +}; + +static void +t4_vxlan_start(struct adapter *sc, void *arg) +{ + struct vxlan_evargs *v = arg; + struct port_info *pi; + uint8_t match_all_mac[ETHER_ADDR_LEN] = {0}; + int i, rc; + + if (sc->nrawf == 0 || chip_id(sc) <= CHELSIO_T5) + return; + if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4vxst") != 0) + return; + + if (sc->vxlan_refcount == 0) { + sc->vxlan_port = v->port; + sc->vxlan_refcount = 1; + t4_write_reg(sc, A_MPS_RX_VXLAN_TYPE, + V_VXLAN(v->port) | F_VXLAN_EN); + for_each_port(sc, i) { + pi = sc->port[i]; + if (pi->vxlan_tcam_entry == true) + continue; + rc = t4_alloc_raw_mac_filt(sc, pi->vi[0].viid, + match_all_mac, match_all_mac, + sc->rawf_base + pi->port_id, 1, pi->port_id, true); + if (rc < 0) { + rc = -rc; + log(LOG_ERR, + "%s: failed to add VXLAN TCAM entry: %d.\n", + device_get_name(pi->vi[0].dev), rc); + } else { + MPASS(rc == sc->rawf_base + pi->port_id); + rc = 0; + pi->vxlan_tcam_entry = true; + } + } + } else if (sc->vxlan_port == v->port) { + sc->vxlan_refcount++; + } else { + log(LOG_ERR, "%s: VXLAN already configured on port %d; " + "ignoring attempt to configure it on port %d\n", + device_get_nameunit(sc->dev), sc->vxlan_port, v->port); + } + end_synchronized_op(sc, 0); +} + +static void +t4_vxlan_stop(struct adapter *sc, void *arg) +{ + struct vxlan_evargs *v = arg; + + if (sc->nrawf == 0 || chip_id(sc) <= CHELSIO_T5) + return; + if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4vxsp") != 0) + return; + + /* + * VXLANs may have been configured before the driver was loaded so we + * may see more stops than starts. This is not handled cleanly but at + * least we keep the refcount sane. + */ + if (sc->vxlan_port != v->port) + goto done; + if (sc->vxlan_refcount == 0) { + log(LOG_ERR, + "%s: VXLAN operation on port %d was stopped earlier; " + "ignoring attempt to stop it again.\n", + device_get_nameunit(sc->dev), sc->vxlan_port); + } else if (--sc->vxlan_refcount == 0) { + t4_set_reg_field(sc, A_MPS_RX_VXLAN_TYPE, F_VXLAN_EN, 0); + } +done: + end_synchronized_op(sc, 0); +} + +static void +t4_vxlan_start_handler(void *arg __unused, struct ifnet *ifp, + sa_family_t family, u_int port) +{ + struct vxlan_evargs v; + + MPASS(family == AF_INET || family == AF_INET6); + v.ifp = ifp; + v.port = port; + + t4_iterate(t4_vxlan_start, &v); +} + +static void +t4_vxlan_stop_handler(void *arg __unused, struct ifnet *ifp, sa_family_t family, + u_int port) +{ + struct vxlan_evargs v; + + MPASS(family == AF_INET || family == AF_INET6); + v.ifp = ifp; + v.port = port; + + t4_iterate(t4_vxlan_stop, &v); +} + + static struct sx mlu; /* mod load unload */ SX_SYSINIT(cxgbe_mlu, &mlu, "cxgbe mod load/unload"); @@ -11278,6 +11450,14 @@ mod_event(module_t mod, int cmd, void *arg) #endif t4_tracer_modload(); tweak_tunables(); + vxlan_start_evtag = + EVENTHANDLER_REGISTER(vxlan_start, + t4_vxlan_start_handler, NULL, + EVENTHANDLER_PRI_ANY); + vxlan_stop_evtag = + EVENTHANDLER_REGISTER(vxlan_stop, + t4_vxlan_stop_handler, NULL, + EVENTHANDLER_PRI_ANY); } sx_xunlock(&mlu); break; @@ -11314,6 +11494,10 @@ mod_event(module_t mod, int cmd, void *arg) sx_sunlock(&t4_list_lock); if (t4_sge_extfree_refs() == 0) { + EVENTHANDLER_DEREGISTER(vxlan_start, + vxlan_start_evtag); + EVENTHANDLER_DEREGISTER(vxlan_stop, + vxlan_stop_evtag); t4_tracer_modunload(); #ifdef KERN_TLS t6_ktls_modunload(); Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Fri Sep 18 02:37:57 2020 (r365870) +++ head/sys/dev/cxgbe/t4_sge.c Fri Sep 18 03:01:47 2020 (r365871) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -266,8 +267,9 @@ static int find_refill_source(struct adapter *, int, b static void add_fl_to_sfl(struct adapter *, struct sge_fl *); static inline void get_pkt_gl(struct mbuf *, struct sglist *); -static inline u_int txpkt_len16(u_int, u_int); -static inline u_int txpkt_vm_len16(u_int, u_int); +static inline u_int txpkt_len16(u_int, const u_int); +static inline u_int txpkt_vm_len16(u_int, const u_int); +static inline void calculate_mbuf_len16(struct adapter *, struct mbuf *); static inline u_int txpkts0_len16(u_int); static inline u_int txpkts1_len16(void); static u_int write_raw_wr(struct sge_txq *, void *, struct mbuf *, u_int); @@ -1917,13 +1919,42 @@ eth_rx(struct adapter *sc, struct sge_rxq *rxq, const #if defined(INET) || defined(INET6) struct lro_ctrl *lro = &rxq->lro; #endif + uint16_t err_vec, tnl_type, tnlhdr_len; static const int sw_hashtype[4][2] = { {M_HASHTYPE_NONE, M_HASHTYPE_NONE}, {M_HASHTYPE_RSS_IPV4, M_HASHTYPE_RSS_IPV6}, {M_HASHTYPE_RSS_TCP_IPV4, M_HASHTYPE_RSS_TCP_IPV6}, {M_HASHTYPE_RSS_UDP_IPV4, M_HASHTYPE_RSS_UDP_IPV6}, }; + static const int sw_csum_flags[2][2] = { + { + /* IP, inner IP */ + CSUM_ENCAP_VXLAN | + CSUM_L3_CALC | CSUM_L3_VALID | + CSUM_L4_CALC | CSUM_L4_VALID | + CSUM_INNER_L3_CALC | CSUM_INNER_L3_VALID | + CSUM_INNER_L4_CALC | CSUM_INNER_L4_VALID, + /* IP, inner IP6 */ + CSUM_ENCAP_VXLAN | + CSUM_L3_CALC | CSUM_L3_VALID | + CSUM_L4_CALC | CSUM_L4_VALID | + CSUM_INNER_L4_CALC | CSUM_INNER_L4_VALID, + }, + { + /* IP6, inner IP */ + CSUM_ENCAP_VXLAN | + CSUM_L4_CALC | CSUM_L4_VALID | + CSUM_INNER_L3_CALC | CSUM_INNER_L3_VALID | + CSUM_INNER_L4_CALC | CSUM_INNER_L4_VALID, + + /* IP6, inner IP6 */ + CSUM_ENCAP_VXLAN | + CSUM_L4_CALC | CSUM_L4_VALID | + CSUM_INNER_L4_CALC | CSUM_INNER_L4_VALID, + }, + }; + MPASS(plen > sc->params.sge.fl_pktshift); if (vi->pfil != NULL && PFIL_HOOKED_IN(vi->pfil) && __predict_true((fl->flags & FL_BUF_RESUME) == 0)) { @@ -1963,23 +1994,73 @@ have_mbuf: m0->m_pkthdr.flowid = be32toh(d->rss.hash_val); cpl = (const void *)(&d->rss + 1); - if (cpl->csum_calc && !(cpl->err_vec & sc->params.tp.err_vec_mask)) { - if (ifp->if_capenable & IFCAP_RXCSUM && - cpl->l2info & htobe32(F_RXF_IP)) { - m0->m_pkthdr.csum_flags = (CSUM_IP_CHECKED | - CSUM_IP_VALID | CSUM_DATA_VALID | CSUM_PSEUDO_HDR); + if (sc->params.tp.rx_pkt_encap) { + const uint16_t ev = be16toh(cpl->err_vec); + + err_vec = G_T6_COMPR_RXERR_VEC(ev); + tnl_type = G_T6_RX_TNL_TYPE(ev); + tnlhdr_len = G_T6_RX_TNLHDR_LEN(ev); + } else { + err_vec = be16toh(cpl->err_vec); + tnl_type = 0; + tnlhdr_len = 0; + } + if (cpl->csum_calc && err_vec == 0) { + int ipv6 = !!(cpl->l2info & htobe32(F_RXF_IP6)); + + /* checksum(s) calculated and found to be correct. */ + + MPASS((cpl->l2info & htobe32(F_RXF_IP)) ^ + (cpl->l2info & htobe32(F_RXF_IP6))); + m0->m_pkthdr.csum_data = be16toh(cpl->csum); + if (tnl_type == 0) { + if (!ipv6 && ifp->if_capenable & IFCAP_RXCSUM) { + m0->m_pkthdr.csum_flags = CSUM_L3_CALC | + CSUM_L3_VALID | CSUM_L4_CALC | + CSUM_L4_VALID; + } else if (ipv6 && ifp->if_capenable & IFCAP_RXCSUM_IPV6) { + m0->m_pkthdr.csum_flags = CSUM_L4_CALC | + CSUM_L4_VALID; + } rxq->rxcsum++; - } else if (ifp->if_capenable & IFCAP_RXCSUM_IPV6 && - cpl->l2info & htobe32(F_RXF_IP6)) { - m0->m_pkthdr.csum_flags = (CSUM_DATA_VALID_IPV6 | - CSUM_PSEUDO_HDR); - rxq->rxcsum++; - } + } else { + MPASS(tnl_type == RX_PKT_TNL_TYPE_VXLAN); + if (__predict_false(cpl->ip_frag)) { + /* + * csum_data is for the inner frame (which is an + * IP fragment) and is not 0xffff. There is no + * way to pass the inner csum_data to the stack. + * We don't want the stack to use the inner + * csum_data to validate the outer frame or it + * will get rejected. So we fix csum_data here + * and let sw do the checksum of inner IP + * fragments. + * + * XXX: Need 32b for csum_data2 in an rx mbuf. + * Maybe stuff it into rcv_tstmp? + */ + m0->m_pkthdr.csum_data = 0xffff; + if (ipv6) { + m0->m_pkthdr.csum_flags = CSUM_L4_CALC | + CSUM_L4_VALID; + } else { + m0->m_pkthdr.csum_flags = CSUM_L3_CALC | + CSUM_L3_VALID | CSUM_L4_CALC | + CSUM_L4_VALID; + } + } else { + int outer_ipv6; - if (__predict_false(cpl->ip_frag)) - m0->m_pkthdr.csum_data = be16toh(cpl->csum); - else - m0->m_pkthdr.csum_data = 0xffff; + MPASS(m0->m_pkthdr.csum_data == 0xffff); + + outer_ipv6 = tnlhdr_len >= + sizeof(struct ether_header) + + sizeof(struct ip6_hdr); + m0->m_pkthdr.csum_flags = + sw_csum_flags[outer_ipv6][ipv6]; + } + rxq->vxlan_rxcsum++; + } } if (cpl->vlan_ex) { @@ -2007,7 +2088,7 @@ have_mbuf: m0->m_pkthdr.numa_domain = ifp->if_numa_domain; #endif #if defined(INET) || defined(INET6) - if (rxq->iq.flags & IQ_LRO_ENABLED && + if (rxq->iq.flags & IQ_LRO_ENABLED && tnl_type == 0 && (M_HASHTYPE_GET(m0) == M_HASHTYPE_RSS_TCP_IPV4 || M_HASHTYPE_GET(m0) == M_HASHTYPE_RSS_TCP_IPV6)) { if (sort_before_lro(lro)) { @@ -2179,10 +2260,10 @@ mbuf_nsegs(struct mbuf *m) { M_ASSERTPKTHDR(m); - KASSERT(m->m_pkthdr.l5hlen > 0, + KASSERT(m->m_pkthdr.inner_l5hlen > 0, ("%s: mbuf %p missing information on # of segments.", __func__, m)); - return (m->m_pkthdr.l5hlen); + return (m->m_pkthdr.inner_l5hlen); } static inline void @@ -2190,7 +2271,7 @@ set_mbuf_nsegs(struct mbuf *m, uint8_t nsegs) { M_ASSERTPKTHDR(m); - m->m_pkthdr.l5hlen = nsegs; + m->m_pkthdr.inner_l5hlen = nsegs; } static inline int @@ -2316,63 +2397,108 @@ alloc_wr_mbuf(int len, int how) return (m); } -static inline int +static inline bool needs_hwcsum(struct mbuf *m) { + const uint32_t csum_flags = CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP | + CSUM_IP_TSO | CSUM_INNER_IP | CSUM_INNER_IP_UDP | + CSUM_INNER_IP_TCP | CSUM_INNER_IP_TSO | CSUM_IP6_UDP | + CSUM_IP6_TCP | CSUM_IP6_TSO | CSUM_INNER_IP6_UDP | + CSUM_INNER_IP6_TCP | CSUM_INNER_IP6_TSO; M_ASSERTPKTHDR(m); - return (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP | CSUM_IP | - CSUM_TSO | CSUM_UDP_IPV6 | CSUM_TCP_IPV6)); + return (m->m_pkthdr.csum_flags & csum_flags); } -static inline int +static inline bool needs_tso(struct mbuf *m) { + const uint32_t csum_flags = CSUM_IP_TSO | CSUM_IP6_TSO | + CSUM_INNER_IP_TSO | CSUM_INNER_IP6_TSO; M_ASSERTPKTHDR(m); - return (m->m_pkthdr.csum_flags & CSUM_TSO); + return (m->m_pkthdr.csum_flags & csum_flags); } -static inline int +static inline bool +needs_vxlan_csum(struct mbuf *m) +{ + + M_ASSERTPKTHDR(m); + + return (m->m_pkthdr.csum_flags & CSUM_ENCAP_VXLAN); +} + +static inline bool +needs_vxlan_tso(struct mbuf *m) +{ + const uint32_t csum_flags = CSUM_ENCAP_VXLAN | CSUM_INNER_IP_TSO | + CSUM_INNER_IP6_TSO; + + M_ASSERTPKTHDR(m); + + return ((m->m_pkthdr.csum_flags & csum_flags) != 0 && + (m->m_pkthdr.csum_flags & csum_flags) != CSUM_ENCAP_VXLAN); +} + +static inline bool +needs_inner_tcp_csum(struct mbuf *m) +{ + const uint32_t csum_flags = CSUM_INNER_IP_TSO | CSUM_INNER_IP6_TSO; + + M_ASSERTPKTHDR(m); + + return (m->m_pkthdr.csum_flags & csum_flags); +} + +static inline bool needs_l3_csum(struct mbuf *m) { + const uint32_t csum_flags = CSUM_IP | CSUM_IP_TSO | CSUM_INNER_IP | + CSUM_INNER_IP_TSO; M_ASSERTPKTHDR(m); - return (m->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TSO)); + return (m->m_pkthdr.csum_flags & csum_flags); } -static inline int -needs_tcp_csum(struct mbuf *m) +static inline bool +needs_outer_tcp_csum(struct mbuf *m) { + const uint32_t csum_flags = CSUM_IP_TCP | CSUM_IP_TSO | CSUM_IP6_TCP | + CSUM_IP6_TSO; M_ASSERTPKTHDR(m); - return (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_TCP_IPV6 | CSUM_TSO)); + + return (m->m_pkthdr.csum_flags & csum_flags); } #ifdef RATELIMIT -static inline int -needs_l4_csum(struct mbuf *m) +static inline bool +needs_outer_l4_csum(struct mbuf *m) { + const uint32_t csum_flags = CSUM_IP_UDP | CSUM_IP_TCP | CSUM_IP_TSO | + CSUM_IP6_UDP | CSUM_IP6_TCP | CSUM_IP6_TSO; M_ASSERTPKTHDR(m); - return (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP | CSUM_UDP_IPV6 | - CSUM_TCP_IPV6 | CSUM_TSO)); + return (m->m_pkthdr.csum_flags & csum_flags); } -static inline int -needs_udp_csum(struct mbuf *m) +static inline bool +needs_outer_udp_csum(struct mbuf *m) { + const uint32_t csum_flags = CSUM_IP_UDP | CSUM_IP6_UDP; M_ASSERTPKTHDR(m); - return (m->m_pkthdr.csum_flags & (CSUM_UDP | CSUM_UDP_IPV6)); + + return (m->m_pkthdr.csum_flags & csum_flags); } #endif -static inline int +static inline bool needs_vlan_insertion(struct mbuf *m) { @@ -2513,6 +2639,23 @@ count_mbuf_nsegs(struct mbuf *m, int skip, uint8_t *cf } /* + * The maximum number of segments that can fit in a WR. + */ +static int +max_nsegs_allowed(struct mbuf *m) +{ + + if (needs_tso(m)) { + if (needs_vxlan_tso(m)) + return (TX_SGL_SEGS_VXLAN_TSO); + else + return (TX_SGL_SEGS_TSO); + } + + return (TX_SGL_SEGS); +} + +/* * Analyze the mbuf to determine its tx needs. The mbuf passed in may change: * a) caller can assume it's been freed if this function returns with an error. * b) it may get defragged up if the gather list is too long for the hardware. @@ -2570,7 +2713,7 @@ restart: return (0); } #endif - if (nsegs > (needs_tso(m0) ? TX_SGL_SEGS_TSO : TX_SGL_SEGS)) { + if (nsegs > max_nsegs_allowed(m0)) { if (defragged++ > 0 || (m = m_defrag(m0, M_NOWAIT)) == NULL) { rc = EFBIG; goto fail; @@ -2592,18 +2735,15 @@ restart: } set_mbuf_nsegs(m0, nsegs); set_mbuf_cflags(m0, cflags); - if (sc->flags & IS_VF) - set_mbuf_len16(m0, txpkt_vm_len16(nsegs, needs_tso(m0))); - else - set_mbuf_len16(m0, txpkt_len16(nsegs, needs_tso(m0))); + calculate_mbuf_len16(sc, m0); #ifdef RATELIMIT /* * Ethofld is limited to TCP and UDP for now, and only when L4 hw - * checksumming is enabled. needs_l4_csum happens to check for all the - * right things. + * checksumming is enabled. needs_outer_l4_csum happens to check for + * all the right things. */ - if (__predict_false(needs_eo(cst) && !needs_l4_csum(m0))) { + if (__predict_false(needs_eo(cst) && !needs_outer_l4_csum(m0))) { m_snd_tag_rele(m0->m_pkthdr.snd_tag); m0->m_pkthdr.snd_tag = NULL; m0->m_pkthdr.csum_flags &= ~CSUM_SND_TAG; @@ -2635,21 +2775,27 @@ restart: switch (eh_type) { #ifdef INET6 case ETHERTYPE_IPV6: - { - struct ip6_hdr *ip6 = l3hdr; - - MPASS(!needs_tso(m0) || ip6->ip6_nxt == IPPROTO_TCP); - - m0->m_pkthdr.l3hlen = sizeof(*ip6); + m0->m_pkthdr.l3hlen = sizeof(struct ip6_hdr); break; - } #endif #ifdef INET case ETHERTYPE_IP: { struct ip *ip = l3hdr; - m0->m_pkthdr.l3hlen = ip->ip_hl * 4; + if (needs_vxlan_csum(m0)) { + /* Driver will do the outer IP hdr checksum. */ + ip->ip_sum = 0; + if (needs_vxlan_tso(m0)) { + const uint16_t ipl = ip->ip_len; + + ip->ip_len = 0; + ip->ip_sum = ~in_cksum_hdr(ip); + ip->ip_len = ipl; + } else + ip->ip_sum = in_cksum_hdr(ip); + } + m0->m_pkthdr.l3hlen = ip->ip_hl << 2; break; } #endif @@ -2659,8 +2805,59 @@ restart: __func__, eh_type); } + if (needs_vxlan_csum(m0)) { + m0->m_pkthdr.l4hlen = sizeof(struct udphdr); + m0->m_pkthdr.l5hlen = sizeof(struct vxlan_header); + + /* Inner headers. */ + eh = m_advance(&m, &offset, m0->m_pkthdr.l3hlen + + sizeof(struct udphdr) + sizeof(struct vxlan_header)); + eh_type = ntohs(eh->ether_type); + if (eh_type == ETHERTYPE_VLAN) { + struct ether_vlan_header *evh = (void *)eh; + + eh_type = ntohs(evh->evl_proto); + m0->m_pkthdr.inner_l2hlen = sizeof(*evh); + } else + m0->m_pkthdr.inner_l2hlen = sizeof(*eh); + l3hdr = m_advance(&m, &offset, m0->m_pkthdr.inner_l2hlen); + + switch (eh_type) { +#ifdef INET6 + case ETHERTYPE_IPV6: + m0->m_pkthdr.inner_l3hlen = sizeof(struct ip6_hdr); + break; +#endif +#ifdef INET + case ETHERTYPE_IP: + { + struct ip *ip = l3hdr; + + m0->m_pkthdr.inner_l3hlen = ip->ip_hl << 2; + break; + } +#endif + default: + panic("%s: VXLAN hw offload requested with unknown " + "ethertype 0x%04x. if_cxgbe must be compiled" + " with the same INET/INET6 options as the kernel.", + __func__, eh_type); + } #if defined(INET) || defined(INET6) - if (needs_tcp_csum(m0)) { + if (needs_inner_tcp_csum(m0)) { + tcp = m_advance(&m, &offset, m0->m_pkthdr.inner_l3hlen); + m0->m_pkthdr.inner_l4hlen = tcp->th_off * 4; + } +#endif + MPASS((m0->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0); + m0->m_pkthdr.csum_flags &= CSUM_INNER_IP6_UDP | + CSUM_INNER_IP6_TCP | CSUM_INNER_IP6_TSO | CSUM_INNER_IP | + CSUM_INNER_IP_UDP | CSUM_INNER_IP_TCP | CSUM_INNER_IP_TSO | + CSUM_ENCAP_VXLAN; + } + +#if defined(INET) || defined(INET6) + if (needs_outer_tcp_csum(m0)) { tcp = m_advance(&m, &offset, m0->m_pkthdr.l3hlen); m0->m_pkthdr.l4hlen = tcp->th_off * 4; #ifdef RATELIMIT @@ -2670,7 +2867,7 @@ restart: V_FW_ETH_TX_EO_WR_TSOFF(sizeof(*tcp) / 2 + 1)); } else set_mbuf_eo_tsclk_tsoff(m0, 0); - } else if (needs_udp_csum(m0)) { + } else if (needs_outer_udp_csum(m0)) { m0->m_pkthdr.l4hlen = sizeof(struct udphdr); #endif } @@ -3627,6 +3824,9 @@ alloc_rxq(struct vi_info *vi, struct sge_rxq *rxq, int SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "vlan_extraction", CTLFLAG_RD, &rxq->vlan_extraction, "# of times hardware extracted 802.1Q tag"); + SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "vxlan_rxcsum", + CTLFLAG_RD, &rxq->vxlan_rxcsum, + "# of times hardware assisted with inner checksum (VXLAN) "); add_fl_sysctls(sc, &vi->ctx, oid, &rxq->fl); @@ -4281,6 +4481,11 @@ alloc_txq(struct vi_info *vi, struct sge_txq *txq, int "# of frames tx'd using type1 txpkts work requests"); SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "raw_wrs", CTLFLAG_RD, &txq->raw_wrs, "# of raw work requests (non-packets)"); + SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "vxlan_tso_wrs", + CTLFLAG_RD, &txq->vxlan_tso_wrs, "# of VXLAN TSO work requests"); + SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "vxlan_txcsum", + CTLFLAG_RD, &txq->vxlan_txcsum, + "# of times hardware assisted with inner checksums (VXLAN)"); #ifdef KERN_TLS if (sc->flags & KERN_TLS_OK) { @@ -4570,27 +4775,25 @@ get_pkt_gl(struct mbuf *m, struct sglist *gl) KASSERT(gl->sg_nseg == mbuf_nsegs(m), ("%s: nsegs changed for mbuf %p from %d to %d", __func__, m, mbuf_nsegs(m), gl->sg_nseg)); - KASSERT(gl->sg_nseg > 0 && - gl->sg_nseg <= (needs_tso(m) ? TX_SGL_SEGS_TSO : TX_SGL_SEGS), + KASSERT(gl->sg_nseg > 0 && gl->sg_nseg <= max_nsegs_allowed(m), ("%s: %d segments, should have been 1 <= nsegs <= %d", __func__, - gl->sg_nseg, needs_tso(m) ? TX_SGL_SEGS_TSO : TX_SGL_SEGS)); + gl->sg_nseg, max_nsegs_allowed(m))); } /* * len16 for a txpkt WR with a GL. Includes the firmware work request header. */ static inline u_int -txpkt_len16(u_int nsegs, u_int tso) +txpkt_len16(u_int nsegs, const u_int extra) { u_int n; MPASS(nsegs > 0); nsegs--; /* first segment is part of ulptx_sgl */ - n = sizeof(struct fw_eth_tx_pkt_wr) + sizeof(struct cpl_tx_pkt_core) + + n = extra + sizeof(struct fw_eth_tx_pkt_wr) + + sizeof(struct cpl_tx_pkt_core) + sizeof(struct ulptx_sgl) + 8 * ((3 * nsegs) / 2 + (nsegs & 1)); - if (tso) - n += sizeof(struct cpl_tx_pkt_lso_core); return (howmany(n, 16)); } @@ -4600,22 +4803,43 @@ txpkt_len16(u_int nsegs, u_int tso) * request header. */ static inline u_int -txpkt_vm_len16(u_int nsegs, u_int tso) +txpkt_vm_len16(u_int nsegs, const u_int extra) { u_int n; MPASS(nsegs > 0); nsegs--; /* first segment is part of ulptx_sgl */ - n = sizeof(struct fw_eth_tx_pkt_vm_wr) + + n = extra + sizeof(struct fw_eth_tx_pkt_vm_wr) + sizeof(struct cpl_tx_pkt_core) + sizeof(struct ulptx_sgl) + 8 * ((3 * nsegs) / 2 + (nsegs & 1)); - if (tso) - n += sizeof(struct cpl_tx_pkt_lso_core); return (howmany(n, 16)); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Sep 18 03:11:48 2020 Return-Path: Delivered-To: svn-src-all@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 1364B3F5DB7; Fri, 18 Sep 2020 03:11: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 4BszQC6h44z423Z; Fri, 18 Sep 2020 03:11:47 +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 C9BF1149B3; Fri, 18 Sep 2020 03:11:47 +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 08I3Bl4O030851; Fri, 18 Sep 2020 03:11:47 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08I3Bl1w030850; Fri, 18 Sep 2020 03:11:47 GMT (envelope-from np@FreeBSD.org) Message-Id: <202009180311.08I3Bl1w030850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 18 Sep 2020 03:11:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365872 - 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: 365872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 03:11:48 -0000 Author: np Date: Fri Sep 18 03:11:47 2020 New Revision: 365872 URL: https://svnweb.freebsd.org/changeset/base/365872 Log: cxgbe(4): add the firmware binaries instead of the empty files that were added in r365861. Obtained from: Chelsio Communications MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/firmware/t4fw-1.25.0.0.bin (contents, props changed) head/sys/dev/cxgbe/firmware/t5fw-1.25.0.0.bin (contents, props changed) head/sys/dev/cxgbe/firmware/t6fw-1.25.0.0.bin (contents, props changed) Modified: head/sys/dev/cxgbe/firmware/t4fw-1.25.0.0.bin ============================================================================== Binary file (source and/or target). No diff available. Modified: head/sys/dev/cxgbe/firmware/t5fw-1.25.0.0.bin ============================================================================== Binary file (source and/or target). No diff available. Modified: head/sys/dev/cxgbe/firmware/t6fw-1.25.0.0.bin ============================================================================== Binary file (source and/or target). No diff available. From owner-svn-src-all@freebsd.org Fri Sep 18 05:55:00 2020 Return-Path: Delivered-To: svn-src-all@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 28F2A3D9399; Fri, 18 Sep 2020 05:55:00 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Bt32X0G0Gz47dQ; Fri, 18 Sep 2020 05:55:00 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1A1416451; Fri, 18 Sep 2020 05:54:59 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08I5sxkT030485; Fri, 18 Sep 2020 05:54:59 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08I5sxi5030484; Fri, 18 Sep 2020 05:54:59 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <202009180554.08I5sxi5030484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Fri, 18 Sep 2020 05:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365873 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 365873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 05:55:00 -0000 Author: grehan Date: Fri Sep 18 05:54:59 2020 New Revision: 365873 URL: https://svnweb.freebsd.org/changeset/base/365873 Log: Fix byte-reversal of language ID in string descriptor. The language id of String Descriptors in usb mouse is 0x0904, while the spec require 0x0409 (English - United States) Submitted by: Wanpeng Qian Reviewed by: grehan Approved by: grehan (#bhyve) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D26472 Modified: head/usr.sbin/bhyve/usb_mouse.c Modified: head/usr.sbin/bhyve/usb_mouse.c ============================================================================== --- head/usr.sbin/bhyve/usb_mouse.c Fri Sep 18 03:11:47 2020 (r365872) +++ head/usr.sbin/bhyve/usb_mouse.c Fri Sep 18 05:54:59 2020 (r365873) @@ -74,7 +74,7 @@ enum { }; static const char *umouse_desc_strings[] = { - "\x04\x09", + "\x09\x04", "BHYVE", "HID Tablet", "01", From owner-svn-src-all@freebsd.org Fri Sep 18 06:44:26 2020 Return-Path: Delivered-To: svn-src-all@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 6D0303DA59B; Fri, 18 Sep 2020 06:44:26 +0000 (UTC) (envelope-from gbe@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 4Bt47Z2Fjxz4Crt; Fri, 18 Sep 2020 06:44:26 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from localhost (p4fd3acce.dip0.t-ipconnect.de [79.211.172.206]) (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 E4FFE2D60A; Fri, 18 Sep 2020 06:44:25 +0000 (UTC) (envelope-from gbe@freebsd.org) Date: Fri, 18 Sep 2020 08:44:23 +0200 From: Gordon Bergling To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r365855 - head/share/man/man9 Message-ID: <20200918064423.GA70291@lion.0xfce3.net> References: <202009172050.08HKo2Ok091379@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: X-Operating-System: FreeBSD 12.2-STABLE amd64 X-Host-Uptime: 8:39AM up 21:59, 3 users, load averages: 0.61, 0.35, 0.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 06:44:26 -0000 On Thu, Sep 17, 2020 at 03:40:48PM -0700, John Baldwin wrote: > On 9/17/20 1:50 PM, Gordon Bergling wrote: > > Author: gbe (doc committer) > > Date: Thu Sep 17 20:50:02 2020 > > New Revision: 365855 > > URL: https://svnweb.freebsd.org/changeset/base/365855 > > > > Log: > > crypto_buffer(9): Sort the SEE ALSO section > > > > MFC after: 3 days > > This manpage isn't in stable FWIW. I wasn't aware the crypto_buffer(9) isn't in -STABLE, so I will not MFC this. > > Modified: > > head/share/man/man9/crypto_buffer.9 > > > > Modified: head/share/man/man9/crypto_buffer.9 > > ============================================================================== > > --- head/share/man/man9/crypto_buffer.9 Thu Sep 17 20:42:41 2020 (r365854) > > +++ head/share/man/man9/crypto_buffer.9 Thu Sep 17 20:50:02 2020 (r365855) > > @@ -317,11 +317,10 @@ returns the length in bytes of a contiguous segment. > > returns true if the request uses a separate output buffer. > > .Sh SEE ALSO > > .Xr ipsec 4 , > > -.Xr bus_dma 9 , > > Did you mean to lose this one? (Rest looks fine) No, that is a mistake. I correct it in a few minutes. --Gordon From owner-svn-src-all@freebsd.org Fri Sep 18 07:27:02 2020 Return-Path: Delivered-To: svn-src-all@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 916F53DB211; Fri, 18 Sep 2020 07:27:02 +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 4Bt54k3KZxz4FHH; Fri, 18 Sep 2020 07:27:02 +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 5587B176DC; Fri, 18 Sep 2020 07:27:02 +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 08I7R2Oo085184; Fri, 18 Sep 2020 07:27:02 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08I7R1SH085183; Fri, 18 Sep 2020 07:27:01 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202009180727.08I7R1SH085183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Fri, 18 Sep 2020 07:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365874 - in head/tests/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/tests/sys: netinet netinet6 X-SVN-Commit-Revision: 365874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 07:27:02 -0000 Author: melifaro Date: Fri Sep 18 07:27:01 2020 New Revision: 365874 URL: https://svnweb.freebsd.org/changeset/base/365874 Log: Use atf_fail instead of exit 1 to indicate mpath tests failure. Modified: head/tests/sys/netinet/output.sh head/tests/sys/netinet6/output6.sh Modified: head/tests/sys/netinet/output.sh ============================================================================== --- head/tests/sys/netinet/output.sh Fri Sep 18 05:54:59 2020 (r365873) +++ head/tests/sys/netinet/output.sh Fri Sep 18 07:27:01 2020 (r365874) @@ -339,11 +339,10 @@ output_tcp_flowid_mpath_success_body() pkt_0=`jexec ${jname}a netstat -Wf link -I ${epair0}a | head | awk '$1!~/^Name/{print$8}'` pkt_1=`jexec ${jname}a netstat -Wf link -I ${epair1}a | head | awk '$1!~/^Name/{print$8}'` if [ ${pkt_0} -le 10 ]; then - echo "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" - exit 1 + atf_fail "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" fi if [ ${pkt_1} -le 10 ]; then - echo "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" + atf_fail "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" exit 1 fi echo "TCP Balancing: 1: ${pkt_0} 2: ${pkt_1}" @@ -468,12 +467,10 @@ output_udp_flowid_mpath_success_body() pkt_0=`jexec ${jname}a netstat -Wf link -I ${epair0}a | head | awk '$1!~/^Name/{print$8}'` pkt_1=`jexec ${jname}a netstat -Wf link -I ${epair1}a | head | awk '$1!~/^Name/{print$8}'` if [ ${pkt_0} -le 10 ]; then - echo "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" - exit 1 + atf_fail "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" fi if [ ${pkt_1} -le 10 ]; then - echo "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" - exit 1 + atf_fail "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" fi echo "UDP BALANCING: 1: ${pkt_0} 2: ${pkt_1}" } @@ -561,12 +558,10 @@ output_raw_flowid_mpath_success_body() jexec ${jname}a netstat -bWf link -I ${epair0}a jexec ${jname}a netstat -bWf link -I ${epair1}a if [ ${pkt_0} -le 10 ]; then - echo "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" - exit 1 + atf_fail "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" fi if [ ${pkt_1} -le 10 ]; then - echo "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" - exit 1 + atf_fail "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" fi echo "RAW BALANCING: 1: ${pkt_0} 2: ${pkt_1}" } Modified: head/tests/sys/netinet6/output6.sh ============================================================================== --- head/tests/sys/netinet6/output6.sh Fri Sep 18 05:54:59 2020 (r365873) +++ head/tests/sys/netinet6/output6.sh Fri Sep 18 07:27:01 2020 (r365874) @@ -376,12 +376,10 @@ output6_tcp_flowid_mpath_success_body() pkt_0=`jexec ${jname}a netstat -Wf link -I ${epair0}a | head | awk '$1!~/^Name/{print$8}'` pkt_1=`jexec ${jname}a netstat -Wf link -I ${epair1}a | head | awk '$1!~/^Name/{print$8}'` if [ ${pkt_0} -le 10 ]; then - echo "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" - exit 1 + atf_fail "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" fi if [ ${pkt_1} -le 10 ]; then - echo "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" - exit 1 + atf_fail "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" fi echo "TCP Balancing: 1: ${pkt_0} 2: ${pkt_1}" } @@ -519,12 +517,10 @@ output6_udp_flowid_mpath_success_body() pkt_0=`jexec ${jname}a netstat -Wf link -I ${epair0}a | head | awk '$1!~/^Name/{print$8}'` pkt_1=`jexec ${jname}a netstat -Wf link -I ${epair1}a | head | awk '$1!~/^Name/{print$8}'` if [ ${pkt_0} -le 10 ]; then - echo "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" - exit 1 + atf_fail "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" fi if [ ${pkt_1} -le 10 ]; then - echo "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" - exit 1 + atf_fail "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" fi echo "UDP BALANCING: 1: ${pkt_0} 2: ${pkt_1}" } @@ -628,12 +624,10 @@ output6_raw_flowid_mpath_success_body() jexec ${jname}a netstat -bWf link -I ${epair0}a jexec ${jname}a netstat -bWf link -I ${epair1}a if [ ${pkt_0} -le 10 ]; then - echo "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" - exit 1 + atf_fail "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" fi if [ ${pkt_1} -le 10 ]; then - echo "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" - exit 1 + atf_fail "Balancing failure: 1: ${pkt_0} 2: ${pkt_1}" fi echo "RAW BALANCING: 1: ${pkt_0} 2: ${pkt_1}" } From owner-svn-src-all@freebsd.org Fri Sep 18 11:04:17 2020 Return-Path: Delivered-To: svn-src-all@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 762EB3DF7D9; Fri, 18 Sep 2020 11:04:17 +0000 (UTC) (envelope-from gbe@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 4Bt9vP2GDFz4QL7; Fri, 18 Sep 2020 11:04:17 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D3AC1A1A8; Fri, 18 Sep 2020 11:04:17 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08IB4H1M020224; Fri, 18 Sep 2020 11:04:17 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08IB4HkK020223; Fri, 18 Sep 2020 11:04:17 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009181104.08IB4HkK020223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Fri, 18 Sep 2020 11:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365875 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 365875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 11:04:17 -0000 Author: gbe (doc committer) Date: Fri Sep 18 11:04:16 2020 New Revision: 365875 URL: https://svnweb.freebsd.org/changeset/base/365875 Log: crypto_buffer(9): Bring back the reference for bus_dma(9) The reference was accidentally deleted in r365855. Reported by: jhb Pointy hat to: gbe Modified: head/share/man/man9/crypto_buffer.9 Modified: head/share/man/man9/crypto_buffer.9 ============================================================================== --- head/share/man/man9/crypto_buffer.9 Fri Sep 18 07:27:01 2020 (r365874) +++ head/share/man/man9/crypto_buffer.9 Fri Sep 18 11:04:16 2020 (r365875) @@ -318,6 +318,7 @@ returns true if the request uses a separate output buf .Sh SEE ALSO .Xr ipsec 4 , .Xr crypto 7 , +.Xr bus_dma 9 , .Xr crypto 9 , .Xr crypto_driver 9 , .Xr crypto_request 9 , From owner-svn-src-all@freebsd.org Fri Sep 18 11:22:35 2020 Return-Path: Delivered-To: svn-src-all@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 3D7D93E0607; Fri, 18 Sep 2020 11:22:35 +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 4BtBJW0hsnz4RGP; Fri, 18 Sep 2020 11:22:35 +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 EFBC51A33D; Fri, 18 Sep 2020 11:22:34 +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 08IBMYtt032316; Fri, 18 Sep 2020 11:22:34 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08IBMYpo032313; Fri, 18 Sep 2020 11:22:34 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202009181122.08IBMYpo032313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Fri, 18 Sep 2020 11:22:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365876 - in head/lib/libarchive: . tests X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head/lib/libarchive: . tests X-SVN-Commit-Revision: 365876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 11:22:35 -0000 Author: arichardson Date: Fri Sep 18 11:22:34 2020 New Revision: 365876 URL: https://svnweb.freebsd.org/changeset/base/365876 Log: libarchive: fix mismatch between library and test configuration I was investigating libarchive test failures on CheriBSD and it turns out we get a reproducible SIGBUS for test_archive_m5, etc. Debugging this shows that libarchive and the tests disagree when it comes to the definition of archive_md5_ctx: libarchive assumes it's the OpenSSL type whereas the test use the libmd type. The latter is not necessarily aligned enough to store a pointer (16 bytes for CHERI RISC-V), so we were crashing when storing EVP_MD_CTX* to an 8-byte-aligned archive_md5_ctx. To avoid problems like this in the future, factor out the common compiler flags into a Makefile.inc and include that from the tests Makefile. Reviewed By: lwhsu Differential Revision: https://reviews.freebsd.org/D26469 Added: head/lib/libarchive/Makefile.inc (contents, props changed) Modified: head/lib/libarchive/Makefile head/lib/libarchive/tests/Makefile Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Fri Sep 18 11:04:16 2020 (r365875) +++ head/lib/libarchive/Makefile Fri Sep 18 11:22:34 2020 (r365876) @@ -6,29 +6,13 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive LIB= archive -LIBADD= z bz2 lzma bsdxml zstd -CFLAGS+= -DHAVE_BZLIB_H=1 -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 -DHAVE_ZSTD_H=1 -DHAVE_LIBZSTD=1 - # FreeBSD SHLIB_MAJOR value is managed as part of the FreeBSD system. # It has no real relation to the libarchive version number. SHLIB_MAJOR= 7 -CFLAGS+= -DPLATFORM_CONFIG_H=\"${.CURDIR}/config_freebsd.h\" CFLAGS+= -I${.OBJDIR} CFLAGS+= -I${SRCTOP}/sys/contrib/zstd/lib - -.if ${MK_OPENSSL} != "no" -CFLAGS+= -DWITH_OPENSSL -LIBADD+= crypto -.else -LIBADD+= md -.endif - -.if ${MK_ICONV} != "no" -# TODO: This can be changed back to CFLAGS once iconv works correctly -# with statically linked binaries. -SHARED_CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST= -.endif +.include "Makefile.inc" .if ${MACHINE_ARCH:Marm*} != "" || ${MACHINE_ARCH:Mmips*} != "" || \ ${MACHINE_ARCH:Mpowerpc*} != "" Added: head/lib/libarchive/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libarchive/Makefile.inc Fri Sep 18 11:22:34 2020 (r365876) @@ -0,0 +1,21 @@ +# $FreeBSD$ +# These defines are needed for both libarchive and the tests. If we don't keep +# them in sync we can get run-time crashes while running tests due to mismatches +# between structures such as archive_md5_ctx, etc. + +LIBADD= z bz2 lzma bsdxml zstd +CFLAGS+= -DHAVE_BZLIB_H=1 -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 -DHAVE_ZSTD_H=1 -DHAVE_LIBZSTD=1 +CFLAGS+= -DPLATFORM_CONFIG_H=\"${.CURDIR}/config_freebsd.h\" + +.if ${MK_OPENSSL} != "no" +CFLAGS+= -DWITH_OPENSSL +LIBADD+= crypto +.else +LIBADD+= md +.endif + +.if ${MK_ICONV} != "no" +# TODO: This can be changed back to CFLAGS once iconv works correctly +# with statically linked binaries. +SHARED_CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST= +.endif Modified: head/lib/libarchive/tests/Makefile ============================================================================== --- head/lib/libarchive/tests/Makefile Fri Sep 18 11:04:16 2020 (r365875) +++ head/lib/libarchive/tests/Makefile Fri Sep 18 11:22:34 2020 (r365876) @@ -1,4 +1,5 @@ # $FreeBSD$ +.include PACKAGE= tests @@ -15,7 +16,7 @@ PROGS+= libarchive_test CFLAGS+= -I${.CURDIR} -I${.CURDIR:H} -I${.OBJDIR} CFLAGS+= -I${_LIBARCHIVEDIR}/libarchive -I${_LIBARCHIVEDIR}/libarchive/test CFLAGS+= -I${_LIBARCHIVEDIR}/test_utils -CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 +.include "../Makefile.inc" # Uncomment to link against dmalloc #LDADD+= -L/usr/local/lib -ldmalloc @@ -298,10 +299,6 @@ TESTS_SRCS= \ test_zip_filename_encoding.c # Deterministic failures: -# Crashes with SIGBUS -BROKEN_TESTS+= test_archive_rmd160 -# Fails with `libarchive/test/test_archive_crypto.c:121: md != actualmd` -BROKEN_TESTS+= test_archive_sha384 # Fails with `test_read_disk_directory_traversals.c:1094: File at has atime 886622, 1443306049 seconds ago` BROKEN_TESTS+= test_read_disk_directory_traversals From owner-svn-src-all@freebsd.org Fri Sep 18 12:28:21 2020 Return-Path: Delivered-To: svn-src-all@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 72EEB3E2658; Fri, 18 Sep 2020 12:28:21 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp-relay-int.realworks.nl (smtp-relay-int.realworks.nl [194.109.157.24]) (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 4BtCmN2hYGz4W1B; Fri, 18 Sep 2020 12:28:19 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Date: Fri, 18 Sep 2020 14:28:15 +0200 (CEST) From: Ronald Klop To: John Baldwin Cc: "Andrey V. Elsukov" , src-committers , svn-src-all , svn-src-head , =?UTF-8?Q?Olivier_Cochard-Labb=C3=A9?= Message-ID: <1309102481.46.1600432095907@localhost> In-Reply-To: <86cadaa8-12e6-8b61-a8d1-758a7722b795@FreeBSD.org> References: <202009081036.088AaCk8085096@repo.freebsd.org> <1ccf2cf7-eb01-a200-4335-4674a010f8a1@FreeBSD.org> <86cadaa8-12e6-8b61-a8d1-758a7722b795@FreeBSD.org> Subject: Re: svn commit: r365449 - head/sbin/rcorder MIME-Version: 1.0 X-Mailer: Realworks (526.706.769a9b1c873) Importance: Normal X-Priority: 3 (Normal) X-Rspamd-Queue-Id: 4BtCmN2hYGz4W1B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of ronald-lists@klop.ws designates 194.109.157.24 as permitted sender) smtp.mailfrom=ronald-lists@klop.ws X-Spamd-Result: default: False [-2.19 / 15.00]; ARC_NA(0.00)[]; RWL_MAILSPIKE_VERYGOOD(0.00)[194.109.157.24:from]; NEURAL_HAM_MEDIUM(-0.96)[-0.957]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:194.109.157.0/24]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[klop.ws]; NEURAL_HAM_LONG(-1.02)[-1.022]; RCPT_COUNT_FIVE(0.00)[6]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.41)[-0.408]; HAS_X_PRIO_THREE(0.00)[3]; RCVD_IN_DNSWL_NONE(0.00)[194.109.157.24:from]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:3265, ipnet:194.109.0.0/16, country:NL]; MID_RHS_NOT_FQDN(0.50)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 12:28:21 -0000 =20 Van: John Baldwin Datum: vrijdag, 18 september 2020 00:50 Aan: "Olivier Cochard-Labb=C3=A9" CC: "Andrey V. Elsukov" , src-committers , svn-src-all , svn-src-head Onderwerp: Re: svn commit: r365449 - head/sbin/rcorder >=20 > On 9/17/20 3:44 PM, Olivier Cochard-Labb=C3=A9 wrote: > > On Thu, Sep 17, 2020 at 10:21 PM John Baldwin wrote: > >> I think long term we want OCF's notions of sessions to be a bit more > >> fluid such that "client" sessions for things like GELI and IPSec can > >> be backed by one or more "driver" sessions (including "driver" session= s > >> coming and going as devices come and go). That's a fair bit more work > >> however. > >> > >> > > And why not simply add 'kld' into the REQUIRE part of /etc/rc.d/ipsec ? > > But this will fix only IPsec: What about other crypto consumers ? >=20 > The problem is that kld_list can be used to load all sorts of modules. > Perhaps some of them need to be loaded after the network is configured, > for example, but ipsec is probably before NETWORKING, so moving kld > earlier would break those modules. The problem with 'kld' is that it is > super generic so there isn't a "right" place to put it. >=20 > I'm not sure of an easy solution. In your case, if you put aesni_load=3D= YES > in loader.conf instead of putting aesni in kld_list you would be fine > though. I'm not sure it's really safe to assume that things loaded by > kld_list are available for any boot-time services. >=20 > --=20 > John Baldwin > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" >=20 >=20 >=20 Another solution could be to create a /etc/rc.d/aesni script which loads th= e aesni module and use that for dependencies instead of the generic kld_lis= t. Or a more generic /etc/rc.d/cryptostuff. Regards, Ronald. =20 From owner-svn-src-all@freebsd.org Fri Sep 18 12:30:16 2020 Return-Path: Delivered-To: svn-src-all@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 7F6713E2670; Fri, 18 Sep 2020 12:30:16 +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 4BtCpc2pCHz4VqB; Fri, 18 Sep 2020 12:30:16 +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 3E62A1B055; Fri, 18 Sep 2020 12:30:16 +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 08ICUFdW069047; Fri, 18 Sep 2020 12:30:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ICUF7u069046; Fri, 18 Sep 2020 12:30:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009181230.08ICUF7u069046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 18 Sep 2020 12:30:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365877 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 365877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 12:30:16 -0000 Author: markj Date: Fri Sep 18 12:30:15 2020 New Revision: 365877 URL: https://svnweb.freebsd.org/changeset/base/365877 Log: Fix error checking in shm_create_largepage(). Reviewed by: alc, kib Reported by: Coverity MFC with: r365524 Differential Revision: https://reviews.freebsd.org/D26464 Modified: head/lib/libc/sys/shm_open.c Modified: head/lib/libc/sys/shm_open.c ============================================================================== --- head/lib/libc/sys/shm_open.c Fri Sep 18 11:22:34 2020 (r365876) +++ head/lib/libc/sys/shm_open.c Fri Sep 18 12:30:15 2020 (r365877) @@ -65,7 +65,7 @@ shm_create_largepage(const char *path, int flags, int int error, fd, saved_errno; fd = __sys_shm_open2(path, flags | O_CREAT, mode, SHM_LARGEPAGE, NULL); - if (error == -1) + if (fd == -1) return (-1); memset(&slc, 0, sizeof(slc)); From owner-svn-src-all@freebsd.org Fri Sep 18 12:30:40 2020 Return-Path: Delivered-To: svn-src-all@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 455923E26CF; Fri, 18 Sep 2020 12:30: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 4BtCq41BYyz4WQp; Fri, 18 Sep 2020 12:30: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 0C5A11B17D; Fri, 18 Sep 2020 12:30: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 08ICUdvY069108; Fri, 18 Sep 2020 12:30:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ICUdcl069107; Fri, 18 Sep 2020 12:30:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009181230.08ICUdcl069107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 18 Sep 2020 12:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365878 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 365878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 12:30:40 -0000 Author: markj Date: Fri Sep 18 12:30:39 2020 New Revision: 365878 URL: https://svnweb.freebsd.org/changeset/base/365878 Log: Ensure that a protection key is selected in pmap_enter_largepage(). Reviewed by: alc, kib Reported by: Coverity MFC with: r365518 Differential Revision: https://reviews.freebsd.org/D26464 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Sep 18 12:30:15 2020 (r365877) +++ head/sys/amd64/amd64/pmap.c Fri Sep 18 12:30:39 2020 (r365878) @@ -6537,14 +6537,14 @@ restart: mp->ref_count++; } KASSERT((origpte & PG_V) == 0 || ((origpte & PG_PS) != 0 && - (origpte & PG_FRAME) == (newpte & PG_FRAME)), - ("va %#lx changing 1G phys page pdpe %#lx newpte %#lx", - va, origpte, newpte)); - if ((newpte & PG_W) != 0 && (origpte & PG_W) == 0) + (origpte & PG_FRAME) == (pten & PG_FRAME)), + ("va %#lx changing 1G phys page pdpe %#lx pten %#lx", + va, origpte, pten)); + if ((pten & PG_W) != 0 && (origpte & PG_W) == 0) pmap->pm_stats.wired_count += NBPDP / PAGE_SIZE; - else if ((newpte & PG_W) == 0 && (origpte & PG_W) != 0) + else if ((pten & PG_W) == 0 && (origpte & PG_W) != 0) pmap->pm_stats.wired_count -= NBPDP / PAGE_SIZE; - *pdpe = newpte; + *pdpe = pten; } else /* (psind == 1) */ { /* 2M */ if (!pmap_pkru_same(pmap, va, va + NBPDR)) return (KERN_PROTECTION_FAILURE); @@ -6573,14 +6573,14 @@ restart: mp->ref_count++; } KASSERT((origpte & PG_V) == 0 || ((origpte & PG_PS) != 0 && - (origpte & PG_FRAME) == (newpte & PG_FRAME)), - ("va %#lx changing 2M phys page pde %#lx newpte %#lx", - va, origpte, newpte)); - if ((newpte & PG_W) != 0 && (origpte & PG_W) == 0) + (origpte & PG_FRAME) == (pten & PG_FRAME)), + ("va %#lx changing 2M phys page pde %#lx pten %#lx", + va, origpte, pten)); + if ((pten & PG_W) != 0 && (origpte & PG_W) == 0) pmap->pm_stats.wired_count += NBPDR / PAGE_SIZE; - else if ((newpte & PG_W) == 0 && (origpte & PG_W) != 0) + else if ((pten & PG_W) == 0 && (origpte & PG_W) != 0) pmap->pm_stats.wired_count -= NBPDR / PAGE_SIZE; - *pde = newpte; + *pde = pten; } if ((origpte & PG_V) == 0) pmap_resident_count_inc(pmap, pagesizes[psind] / PAGE_SIZE); From owner-svn-src-all@freebsd.org Fri Sep 18 12:37:42 2020 Return-Path: Delivered-To: svn-src-all@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 437573E2B85; Fri, 18 Sep 2020 12:37:42 +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 4BtCzB16XSz4WYZ; Fri, 18 Sep 2020 12:37:42 +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 051371ADEB; Fri, 18 Sep 2020 12:37: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 08ICbfo9075236; Fri, 18 Sep 2020 12:37:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ICbf2F075235; Fri, 18 Sep 2020 12:37:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009181237.08ICbf2F075235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 18 Sep 2020 12:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365879 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 365879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 12:37:42 -0000 Author: markj Date: Fri Sep 18 12:37:41 2020 New Revision: 365879 URL: https://svnweb.freebsd.org/changeset/base/365879 Log: Assert we are not traversing through superpages in the arm64 pmap. Reviewed by: alc, andrew MFC after: 1 week Sponsored by: Juniper Networks, Inc., Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26465 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Fri Sep 18 12:30:39 2020 (r365878) +++ head/sys/arm64/arm64/pmap.c Fri Sep 18 12:37:41 2020 (r365879) @@ -433,12 +433,15 @@ pmap_l1(pmap_t pmap, vm_offset_t va) } static __inline pd_entry_t * -pmap_l1_to_l2(pd_entry_t *l1, vm_offset_t va) +pmap_l1_to_l2(pd_entry_t *l1p, vm_offset_t va) { - pd_entry_t *l2; + pd_entry_t l1, *l2p; - l2 = (pd_entry_t *)PHYS_TO_DMAP(pmap_load(l1) & ~ATTR_MASK); - return (&l2[pmap_l2_index(va)]); + l1 = pmap_load(l1p); + KASSERT((l1 & ATTR_DESCR_MASK) == L1_TABLE, + ("%s: L1 entry %#lx is a leaf", __func__, l1)); + l2p = (pd_entry_t *)PHYS_TO_DMAP(l1 & ~ATTR_MASK); + return (&l2p[pmap_l2_index(va)]); } static __inline pd_entry_t * @@ -454,12 +457,16 @@ pmap_l2(pmap_t pmap, vm_offset_t va) } static __inline pt_entry_t * -pmap_l2_to_l3(pd_entry_t *l2, vm_offset_t va) +pmap_l2_to_l3(pd_entry_t *l2p, vm_offset_t va) { - pt_entry_t *l3; + pd_entry_t l2; + pt_entry_t *l3p; - l3 = (pd_entry_t *)PHYS_TO_DMAP(pmap_load(l2) & ~ATTR_MASK); - return (&l3[pmap_l3_index(va)]); + l2 = pmap_load(l2p); + KASSERT((l2 & ATTR_DESCR_MASK) == L2_TABLE, + ("%s: L2 entry %#lx is a leaf", __func__, l2)); + l3p = (pt_entry_t *)PHYS_TO_DMAP(l2 & ~ATTR_MASK); + return (&l3p[pmap_l3_index(va)]); } /* From owner-svn-src-all@freebsd.org Fri Sep 18 12:59:30 2020 Return-Path: Delivered-To: svn-src-all@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 275633E2F12; Fri, 18 Sep 2020 12:59:30 +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 4BtDSK6fN8z4Xyd; Fri, 18 Sep 2020 12:59:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A97C61B5A0; Fri, 18 Sep 2020 12:59:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ICxT2A087993; Fri, 18 Sep 2020 12:59:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ICxSqV087986; Fri, 18 Sep 2020 12:59:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009181259.08ICxSqV087986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 18 Sep 2020 12:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365880 - head/usr.bin/procstat X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/procstat X-SVN-Commit-Revision: 365880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 12:59:30 -0000 Author: kib Date: Fri Sep 18 12:59:27 2020 New Revision: 365880 URL: https://svnweb.freebsd.org/changeset/base/365880 Log: Add pargs, penv, pwdx commands and aliases to procstat(1). Intent is to mimic Solaris commands with the same names. Submitted by: Juraj Lutter MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26310 Added: head/usr.bin/procstat/procstat_penv.c (contents, props changed) head/usr.bin/procstat/procstat_pwdx.c (contents, props changed) Modified: head/usr.bin/procstat/Makefile head/usr.bin/procstat/procstat.1 head/usr.bin/procstat/procstat.c head/usr.bin/procstat/procstat.h head/usr.bin/procstat/procstat_kstack.c Modified: head/usr.bin/procstat/Makefile ============================================================================== --- head/usr.bin/procstat/Makefile Fri Sep 18 12:37:41 2020 (r365879) +++ head/usr.bin/procstat/Makefile Fri Sep 18 12:59:27 2020 (r365880) @@ -13,14 +13,24 @@ SRCS= procstat.c \ procstat_cs.c \ procstat_files.c \ procstat_kstack.c \ + procstat_penv.c \ procstat_ptlwpinfo.c \ + procstat_pwdx.c \ procstat_rlimit.c \ procstat_rusage.c \ procstat_sigs.c \ procstat_threads.c \ procstat_vm.c +MLINKS+= procstat.1 pargs.1 +MLINKS+= procstat.1 penv.1 +MLINKS+= procstat.1 pwdx.1 + LIBADD+= procstat xo util sbuf + +LINKS+= ${BINDIR}/procstat ${BINDIR}/pargs +LINKS+= ${BINDIR}/procstat ${BINDIR}/penv +LINKS+= ${BINDIR}/procstat ${BINDIR}/pwdx HAS_TESTS= SUBDIR.${MK_TESTS}+= tests Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Fri Sep 18 12:37:41 2020 (r365879) +++ head/usr.bin/procstat/procstat.1 Fri Sep 18 12:59:27 2020 (r365880) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 4, 2019 +.Dd September 14, 2020 .Dt PROCSTAT 1 .Os .Sh NAME @@ -102,6 +102,15 @@ .Op Fl N Ar system .Op Fl w Ar interval .Ar core ... +.Nm pargs +.Op Fl -libxo +.Ar pid ... +.Nm penv +.Op Fl -libxo +.Ar pid ... +.Nm pwdx +.Op Fl -libxo +.Ar pid ... .Sh DESCRIPTION .Nm utility displays detailed information about the processes identified by the @@ -112,6 +121,17 @@ flag is used, all processes. It can also display information extracted from a process core file, if the core file is specified as the argument. .Pp +The +.Nm pargs , +.Nm penv +and +.Nm pwdx +utilities display the arguments, environment, and current working directory, +respectively of the process specified by +.Ar pid +argument. +They mimic the behavior of Solaris utilities of the same names. +.Pp If the .Fl -libxo flag is specified the output is generated via @@ -121,7 +141,8 @@ See .Xr xo_parse_args 3 for details on command line arguments. .Pp -The following commands are available: +The following commands are available for +.Nm : .Bl -tag -width indent .It Ar basic Print basic process statistics (this is the default). @@ -196,6 +217,12 @@ Display thread information for the process. Display virtual memory mappings for the process. .It Ar auxv | Fl x Display ELF auxiliary vector for the process. +.It Ar pargs +Display arguments for the process. +.It Ar penv +Display environment variables for the process. +.It Ar pwdx +Display current working directory for the process. .El .Pp All options generate output in the format of a table, the first field of @@ -430,7 +457,7 @@ process signal disposition details, three symbols if signal is pending in the global process queue; - otherwise. .It I if signal delivery disposition is -.Dv SIG_IGN; +.Dv SIG_IGN ; - otherwise. .It C if the signal will be caught; - otherwise. @@ -711,6 +738,10 @@ support was added by .An -nosplit Allan Jude .Aq Mt allanjude@FreeBSD.org . +.br +.An Juraj Lutter +.Aq Mt juraj@lutter.sk +added the pargs, penv and pwdx functionality. .Sh BUGS The display of open file or memory mapping pathnames is implemented using the kernel's name cache. Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Fri Sep 18 12:37:41 2020 (r365879) +++ head/usr.bin/procstat/procstat.c Fri Sep 18 12:59:27 2020 (r365880) @@ -68,6 +68,23 @@ static void cmdopt_rusage(int argc, char * const argv[ static void cmdopt_files(int argc, char * const argv[]); static void cmdopt_cpuset(int argc, char * const argv[]); +static const char *progname; + +/* aliased program parameters and arguments + * - usage field is abused to hold the pointer to the function + * displaying program usage + */ +static const struct procstat_cmd pacmd_table[] = { + /* arguments are the same as for pwdx: pid or core file */ + { "pargs", "args", NULL, &procstat_pargs, &cmdopt_none, + PS_CMP_NORMAL | PS_MODE_COMPAT }, + { "penv", "env", NULL, &procstat_penv, &cmdopt_none, + PS_CMP_NORMAL | PS_MODE_COMPAT }, + { "pwdx", "pwd", NULL, &procstat_pwdx, &cmdopt_none, + PS_CMP_NORMAL | PS_MODE_COMPAT } +}; + +/* procstat parameters and arguments */ static const struct procstat_cmd cmd_table[] = { { "argument", "arguments", NULL, &procstat_args, &cmdopt_none, PS_CMP_PLURAL | PS_CMP_SUBSTR }, @@ -88,8 +105,14 @@ static const struct procstat_cmd cmd_table[] = { PS_CMP_PLURAL }, { "kstack", "kstack", "[-v]", &procstat_kstack, &cmdopt_verbose, PS_CMP_NORMAL }, + { "pargs", "args", NULL, &procstat_pargs, &cmdopt_none, + PS_CMP_NORMAL }, + { "penv", "env", NULL, &procstat_penv, &cmdopt_none, + PS_CMP_NORMAL }, { "ptlwpinfo", "ptlwpinfo", NULL, &procstat_ptlwpinfo, &cmdopt_none, PS_CMP_NORMAL }, + { "pwdx", "pwd", NULL, &procstat_pwdx, &cmdopt_none, + PS_CMP_NORMAL }, { "rlimit", "rlimit", NULL, &procstat_rlimit, &cmdopt_none, PS_CMP_NORMAL }, { "rusage", "rusage", "[-Ht]", &procstat_rusage, &cmdopt_rusage, @@ -106,43 +129,49 @@ static const struct procstat_cmd cmd_table[] = { }; static void -usage(void) +usage(const struct procstat_cmd *cmd) { size_t i, l; int multi; - xo_error("usage: procstat [--libxo] [-h] [-M core] [-N system]" - " [-w interval] command\n" - " [pid ... | core ...]\n" - " procstat [--libxo] -a [-h] [-M core] [-N system] " - " [-w interval] command\n" - " procstat [--libxo] [-h] [-M core] [-N system]" - " [-w interval]\n" - " [-S | -b | -c | -e | -f [-C] | -i [-n] | " - "-j [-n] | -k [-k] |\n" - " -l | -r [-H] | -s | -t | -v | -x] " - "[pid ... | core ...]\n" - " procstat [--libxo] -a [-h] [-M core] [-N system]" - " [-w interval]\n" - " [-S | -b | -c | -e | -f [-C] | -i [-n] | " - "-j [-n] | -k [-k] |\n" - " -l | -r [-H] | -s | -t | -v | -x]\n" - " procstat [--libxo] -L [-h] [-M core] [-N system] core ...\n" - "Available commands:\n"); - for (i = 0, l = nitems(cmd_table); i < l; i++) { - multi = i + 1 < l && cmd_table[i].cmd == cmd_table[i + 1].cmd; - xo_error(" %s%s%s", multi ? "[" : "", - cmd_table[i].command, (cmd_table[i].cmp & PS_CMP_PLURAL) ? - "(s)" : ""); - for (; i + 1 < l && cmd_table[i].cmd == cmd_table[i + 1].cmd; - i++) - xo_error(" | %s%s", cmd_table[i + 1].command, - (cmd_table[i].cmp & PS_CMP_PLURAL) ? "(s)" : ""); - if (multi) - xo_error("]"); - if (cmd_table[i].usage != NULL) - xo_error(" %s", cmd_table[i].usage); - xo_error("\n"); + if (cmd == NULL || (cmd->cmp & PS_MODE_COMPAT) == 0) { + xo_error("usage: procstat [--libxo] [-h] [-M core] [-N system]" + " [-w interval] command\n" + " [pid ... | core ...]\n" + " procstat [--libxo] -a [-h] [-M core] [-N system] " + " [-w interval] command\n" + " procstat [--libxo] [-h] [-M core] [-N system]" + " [-w interval]\n" + " [-S | -b | -c | -e | -f [-C] | -i [-n] | " + "-j [-n] | -k [-k] |\n" + " -l | -r [-H] | -s | -t | -v | -x] " + "[pid ... | core ...]\n" + " procstat [--libxo] -a [-h] [-M core] [-N system]" + " [-w interval]\n" + " [-S | -b | -c | -e | -f [-C] | -i [-n] | " + "-j [-n] | -k [-k] |\n" + " -l | -r [-H] | -s | -t | -v | -x]\n" + " procstat [--libxo] -L [-h] [-M core] [-N system] core ...\n" + "Available commands:\n"); + for (i = 0, l = nitems(cmd_table); i < l; i++) { + multi = i + 1 < l && cmd_table[i].cmd == + cmd_table[i + 1].cmd; + xo_error(" %s%s%s", multi ? "[" : "", + cmd_table[i].command, (cmd_table[i].cmp & + PS_CMP_PLURAL) ? "(s)" : ""); + for (; i + 1 < l && cmd_table[i].cmd == + cmd_table[i + 1].cmd; i++) + xo_error(" | %s%s", cmd_table[i + 1].command, + (cmd_table[i].cmp & PS_CMP_PLURAL) ? + "(s)" : ""); + if (multi) + xo_error("]"); + if (cmd_table[i].usage != NULL) + xo_error(" %s", cmd_table[i].usage); + xo_error("\n"); + } + } else { + xo_error("usage: %s [--libxo] pid ...\n", progname); } xo_finish(); exit(EX_USAGE); @@ -203,6 +232,25 @@ kinfo_proc_thread_name(const struct kinfo_proc *kipp) } static const struct procstat_cmd * +getcmdbyprogname(const char *pprogname) +{ + const char *ca; + size_t i, len; + + if (pprogname == NULL) + return (NULL); + len = strlen(pprogname); + + for (i = 0; i < nitems(pacmd_table); i++) { + ca = pacmd_table[i].command; + if (ca != NULL && strcmp(ca, pprogname) == 0) + return (&pacmd_table[i]); + } + + return (NULL); +} + +static const struct procstat_cmd * getcmd(const char *str) { const struct procstat_cmd *cmd; @@ -237,17 +285,14 @@ getcmd(const char *str) int main(int argc, char *argv[]) { - int ch, interval; - int i; struct kinfo_proc *p; const struct procstat_cmd *cmd; struct procstat *prstat, *cprstat; + char *dummy, *nlistf, *memf; + const char *xocontainer; long l; pid_t pid; - char *dummy; - char *nlistf, *memf; - int aflag; - int cnt; + int aflag, ch, cnt, i, interval; interval = 0; cmd = NULL; @@ -255,6 +300,9 @@ main(int argc, char *argv[]) aflag = 0; argc = xo_parse_args(argc, argv); + progname = getprogname(); + cmd = getcmdbyprogname(progname); + while ((ch = getopt(argc, argv, "abCcefHhijkLlM:N:nrSstvw:x")) != -1) { switch (ch) { case 'a': @@ -262,7 +310,7 @@ main(int argc, char *argv[]) break; case 'b': if (cmd != NULL) - usage(); + usage(cmd); cmd = getcmd("binary"); break; case 'C': @@ -270,17 +318,17 @@ main(int argc, char *argv[]) break; case 'c': if (cmd != NULL) - usage(); + usage(cmd); cmd = getcmd("arguments"); break; case 'e': if (cmd != NULL) - usage(); + usage(cmd); cmd = getcmd("environment"); break; case 'f': if (cmd != NULL) - usage(); + usage(cmd); cmd = getcmd("files"); break; case 'H': @@ -291,33 +339,33 @@ main(int argc, char *argv[]) break; case 'i': if (cmd != NULL) - usage(); + usage(cmd); cmd = getcmd("signals"); break; case 'j': if (cmd != NULL) - usage(); + usage(cmd); cmd = getcmd("tsignals"); break; case 'k': if (cmd != NULL && cmd->cmd == procstat_kstack) { if ((procstat_opts & PS_OPT_VERBOSE) != 0) - usage(); + usage(cmd); procstat_opts |= PS_OPT_VERBOSE; } else { if (cmd != NULL) - usage(); + usage(cmd); cmd = getcmd("kstack"); } break; case 'L': if (cmd != NULL) - usage(); + usage(cmd); cmd = getcmd("ptlwpinfo"); break; case 'l': if (cmd != NULL) - usage(); + usage(cmd); cmd = getcmd("rlimit"); break; case 'M': @@ -331,75 +379,79 @@ main(int argc, char *argv[]) break; case 'r': if (cmd != NULL) - usage(); + usage(cmd); cmd = getcmd("rusage"); break; case 'S': if (cmd != NULL) - usage(); + usage(cmd); cmd = getcmd("cpuset"); break; case 's': if (cmd != NULL) - usage(); + usage(cmd); cmd = getcmd("credentials"); break; case 't': if (cmd != NULL) - usage(); + usage(cmd); cmd = getcmd("threads"); break; case 'v': if (cmd != NULL) - usage(); + usage(cmd); cmd = getcmd("vm"); break; case 'w': l = strtol(optarg, &dummy, 10); if (*dummy != '\0') - usage(); + usage(cmd); if (l < 1 || l > INT_MAX) - usage(); + usage(cmd); interval = l; break; case 'x': if (cmd != NULL) - usage(); + usage(cmd); cmd = getcmd("auxv"); break; case '?': default: - usage(); + usage(cmd); } } argc -= optind; argv += optind; - if (cmd == NULL && argv[0] != NULL && (cmd = getcmd(argv[0])) != NULL) { + if (cmd == NULL && argv[0] != NULL) + cmd = getcmd(argv[0]); + if (cmd != NULL) { if ((procstat_opts & PS_SUBCOMMAND_OPTS) != 0) - usage(); + usage(cmd); if (cmd->opt != NULL) { optreset = 1; optind = 1; cmd->opt(argc, argv); - argc -= optind; - argv += optind; + if ((cmd->cmp & PS_MODE_COMPAT) == 0) { + argc -= optind; + argv += optind; + } } else { argc -= 1; argv += 1; } } else { - if (cmd == NULL) - cmd = getcmd("basic"); - if (cmd->cmd != procstat_files && - (procstat_opts & PS_OPT_CAPABILITIES) != 0) - usage(); + cmd = getcmd("basic"); } + if (cmd->cmd != procstat_files && + (procstat_opts & PS_OPT_CAPABILITIES) != 0 && + (cmd->cmp & PS_MODE_COMPAT) == 0) + usage(cmd); /* Must specify either the -a flag or a list of pids. */ if (!(aflag == 1 && argc == 0) && !(aflag == 0 && argc > 0)) - usage(); + usage(cmd); if (memf != NULL) prstat = procstat_open_kvm(nlistf, memf); @@ -408,9 +460,11 @@ main(int argc, char *argv[]) if (prstat == NULL) xo_errx(1, "procstat_open()"); do { + xocontainer = cmd->xocontainer != NULL ? cmd->xocontainer : + cmd->command; xo_set_version(PROCSTAT_XO_VERSION); - xo_open_container("procstat"); - xo_open_container(cmd->xocontainer); + xo_open_container(progname); + xo_open_container(xocontainer); if (aflag) { p = procstat_getprocs(prstat, KERN_PROC_PROC, 0, &cnt); @@ -430,7 +484,7 @@ main(int argc, char *argv[]) l = strtol(argv[i], &dummy, 10); if (*dummy == '\0') { if (l < 0) - usage(); + usage(cmd); pid = l; p = procstat_getprocs(prstat, KERN_PROC_PID, @@ -441,26 +495,34 @@ main(int argc, char *argv[]) procstat(cmd, prstat, p); procstat_freeprocs(prstat, p); } else { - cprstat = procstat_open_core(argv[i]); - if (cprstat == NULL) { - warnx("procstat_open()"); - continue; + if ((cmd->cmp & PS_MODE_COMPAT) == 0) { + cprstat = procstat_open_core(argv[i]); + if (cprstat == NULL) { + warnx("procstat_open()"); + continue; + } + p = procstat_getprocs(cprstat, + KERN_PROC_PID, -1, &cnt); + if (p == NULL) { + xo_errx(1, + "procstat_getprocs()"); + } + if (cnt != 0) + procstat(cmd, cprstat, p); + procstat_freeprocs(cprstat, p); + procstat_close(cprstat); + } else { + usage(cmd); } - p = procstat_getprocs(cprstat, KERN_PROC_PID, - -1, &cnt); - if (p == NULL) - xo_errx(1, "procstat_getprocs()"); - if (cnt != 0) - procstat(cmd, cprstat, p); - procstat_freeprocs(cprstat, p); - procstat_close(cprstat); } - /* Suppress header after first process. */ - procstat_opts |= PS_OPT_NOHEADER; + if ((cmd->cmp & PS_MODE_COMPAT) == 0) { + /* Suppress header after first process. */ + procstat_opts |= PS_OPT_NOHEADER; + } } - xo_close_container(cmd->xocontainer); - xo_close_container("procstat"); + xo_close_container(xocontainer); + xo_close_container(progname); xo_finish(); if (interval) sleep(interval); @@ -480,7 +542,7 @@ cmdopt_none(int argc, char * const argv[]) switch (ch) { case '?': default: - usage(); + usage(NULL); } } } @@ -497,7 +559,7 @@ cmdopt_verbose(int argc, char * const argv[]) break; case '?': default: - usage(); + usage(NULL); } } } @@ -514,7 +576,7 @@ cmdopt_signals(int argc, char * const argv[]) break; case '?': default: - usage(); + usage(NULL); } } } @@ -533,7 +595,7 @@ cmdopt_rusage(int argc, char * const argv[]) break; case '?': default: - usage(); + usage(NULL); } } } @@ -550,7 +612,7 @@ cmdopt_files(int argc, char * const argv[]) break; case '?': default: - usage(); + usage(NULL); } } } Modified: head/usr.bin/procstat/procstat.h ============================================================================== --- head/usr.bin/procstat/procstat.h Fri Sep 18 12:37:41 2020 (r365879) +++ head/usr.bin/procstat/procstat.h Fri Sep 18 12:59:27 2020 (r365880) @@ -42,7 +42,8 @@ enum { PS_OPT_NOHEADER = 0x02, PS_OPT_PERTHREAD = 0x04, PS_OPT_SIGNUM = 0x08, - PS_OPT_VERBOSE = 0x10 + PS_OPT_VERBOSE = 0x10, + PS_MODE_COMPAT = 0x20, }; #define PS_SUBCOMMAND_OPTS \ @@ -64,7 +65,10 @@ void procstat_cs(struct procstat *prstat, struct kinfo void procstat_env(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_files(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_kstack(struct procstat *prstat, struct kinfo_proc *kipp); +void procstat_pargs(struct procstat *prstat, struct kinfo_proc *kipp); +void procstat_penv(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_ptlwpinfo(struct procstat *prstat, struct kinfo_proc *kipp); +void procstat_pwdx(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_rlimit(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_rusage(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_sigfastblock(struct procstat *procstat, Modified: head/usr.bin/procstat/procstat_kstack.c ============================================================================== --- head/usr.bin/procstat/procstat_kstack.c Fri Sep 18 12:37:41 2020 (r365879) +++ head/usr.bin/procstat/procstat_kstack.c Fri Sep 18 12:59:27 2020 (r365880) @@ -68,7 +68,7 @@ kstack_nextstate(enum trace_state ts) return (TS_OFF); case TS_OFF: - return TS_FRAMENUM; + return (TS_FRAMENUM); default: errx(-1, "kstack_nextstate"); Added: head/usr.bin/procstat/procstat_penv.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/procstat/procstat_penv.c Fri Sep 18 12:59:27 2020 (r365880) @@ -0,0 +1,86 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Juraj Lutter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "procstat.h" + +void +procstat_pargs(struct procstat *procstat, struct kinfo_proc *kipp) +{ + int i; + char **args; + + args = procstat_getargv(procstat, kipp, 0); + + xo_emit("{k:process_id/%d}: {:command/%s/%s}\n", kipp->ki_pid, + kipp->ki_comm); + + if (args == NULL) { + xo_emit("{d:args/-}\n"); + } else { + for (i = 0; args[i] != NULL; i++) { + xo_emit("{Ld:argv[}{Ld:/%d}{Ldwc:]}{l:argv/%s}\n", + i, args[i]); + } + } +} + +void +procstat_penv(struct procstat *procstat, struct kinfo_proc *kipp) +{ + int i; + char **envs; + + envs = procstat_getenvv(procstat, kipp, 0); + + xo_emit("{k:process_id/%d}: {:command/%s/%s}\n", kipp->ki_pid, + kipp->ki_comm); + + if (envs == NULL) { + xo_emit("{d:env/-}\n"); + } else { + for (i = 0; envs[i] != NULL; i++) { + xo_emit("{Ld:envp[}{Ld:/%d}{Ldwc:]}{l:envp/%s}\n", + i, envs[i]); + } + } +} Added: head/usr.bin/procstat/procstat_pwdx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/procstat/procstat_pwdx.c Fri Sep 18 12:59:27 2020 (r365880) @@ -0,0 +1,70 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Juraj Lutter + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include "procstat.h" + +void +procstat_pwdx(struct procstat *procstat, struct kinfo_proc *kipp) +{ + struct filestat_list *head; + struct filestat *fst; + + head = procstat_getfiles(procstat, kipp, 0); + if (head == NULL) + return; + STAILQ_FOREACH(fst, head, next) { + if ((fst->fs_uflags & PS_FST_UFLAG_CDIR) && + (fst->fs_path != NULL)) { + xo_emit("{k:process_id/%d}{P:: }", kipp->ki_pid); + xo_emit("{:cwd/%s}", fst->fs_path); + xo_emit("\n"); + } + } + procstat_freefiles(procstat, head); +} From owner-svn-src-all@freebsd.org Fri Sep 18 13:12:15 2020 Return-Path: Delivered-To: svn-src-all@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 874E13E3571; Fri, 18 Sep 2020 13:12:15 +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 4BtDl3354Vz4Ywt; Fri, 18 Sep 2020 13:12:15 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.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 4E31E10403; Fri, 18 Sep 2020 13:12:15 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f172.google.com with SMTP id o16so5915693qkj.10; Fri, 18 Sep 2020 06:12:15 -0700 (PDT) X-Gm-Message-State: AOAM531okwi0MCKGZPUDi4GhXoTE7CGn1MWpWVakkeouV8PAU3SKuyc6 3u1s4w7DRY9xpvjj/ZKR4WQthtLPMSQG+fjFcp4= X-Google-Smtp-Source: ABdhPJybpoBETkfBzC0d7YTXU6qnjW5FMmr2SQiQIzOn22a7h7lg6wZskMcyum3psITgHka5OJW6ZCQL9e+sZyIYYLo= X-Received: by 2002:a05:620a:4fb:: with SMTP id b27mr34467887qkh.120.1600434734287; Fri, 18 Sep 2020 06:12:14 -0700 (PDT) MIME-Version: 1.0 References: <202009181122.08IBMYpo032313@repo.freebsd.org> In-Reply-To: <202009181122.08IBMYpo032313@repo.freebsd.org> From: Kyle Evans Date: Fri, 18 Sep 2020 08:12:01 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r365876 - in head/lib/libarchive: . tests To: Alex Richardson Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 13:12:15 -0000 On Fri, Sep 18, 2020 at 6:22 AM Alex Richardson wrote: > > Author: arichardson > Date: Fri Sep 18 11:22:34 2020 > New Revision: 365876 > URL: https://svnweb.freebsd.org/changeset/base/365876 > > Log: > libarchive: fix mismatch between library and test configuration > > I was investigating libarchive test failures on CheriBSD and it turns out > we get a reproducible SIGBUS for test_archive_m5, etc. Debugging this shows > that libarchive and the tests disagree when it comes to the definition of > archive_md5_ctx: libarchive assumes it's the OpenSSL type whereas the test > use the libmd type. The latter is not necessarily aligned enough to store > a pointer (16 bytes for CHERI RISC-V), so we were crashing when storing > EVP_MD_CTX* to an 8-byte-aligned archive_md5_ctx. > > To avoid problems like this in the future, factor out the common compiler > flags into a Makefile.inc and include that from the tests Makefile. > > Reviewed By: lwhsu > Differential Revision: https://reviews.freebsd.org/D26469 > > Added: > head/lib/libarchive/Makefile.inc (contents, props changed) > Modified: > head/lib/libarchive/Makefile > head/lib/libarchive/tests/Makefile > > [.. snip ..] > Modified: head/lib/libarchive/tests/Makefile > ============================================================================== > --- head/lib/libarchive/tests/Makefile Fri Sep 18 11:04:16 2020 (r365875) > +++ head/lib/libarchive/tests/Makefile Fri Sep 18 11:22:34 2020 (r365876) > @@ -1,4 +1,5 @@ > # $FreeBSD$ > +.include > > PACKAGE= tests > > @@ -15,7 +16,7 @@ PROGS+= libarchive_test > CFLAGS+= -I${.CURDIR} -I${.CURDIR:H} -I${.OBJDIR} > CFLAGS+= -I${_LIBARCHIVEDIR}/libarchive -I${_LIBARCHIVEDIR}/libarchive/test > CFLAGS+= -I${_LIBARCHIVEDIR}/test_utils > -CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 > +.include "../Makefile.inc" > > # Uncomment to link against dmalloc > #LDADD+= -L/usr/local/lib -ldmalloc Is the explicit .include here necessary (e.g. for ordering)? I note that inclusion of the parent directory's Makefile.inc is already guaranteed by bsd.init.mk, so this duplicates all the CFLAGS additions. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Fri Sep 18 14:01:10 2020 Return-Path: Delivered-To: svn-src-all@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 DFAC63E3DF3; Fri, 18 Sep 2020 14:01:10 +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 4BtFqV5bfPz4bfL; Fri, 18 Sep 2020 14:01:10 +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 A3A181BF51; Fri, 18 Sep 2020 14:01:10 +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 08IE1Ajh025623; Fri, 18 Sep 2020 14:01:10 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08IE1AJV025622; Fri, 18 Sep 2020 14:01:10 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202009181401.08IE1AJV025622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 18 Sep 2020 14:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365881 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 365881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 14:01:10 -0000 Author: mhorne Date: Fri Sep 18 14:01:10 2020 New Revision: 365881 URL: https://svnweb.freebsd.org/changeset/base/365881 Log: Initialize some local variables earlier Move the initialization of these variables to the beginning of their respective functions. On our end this creates a small amount of unneeded churn, as these variables are properly initialized before their first use in all cases. However, changing this benefits at least one downstream consumer (NetApp) by allowing local and future modifications to these functions to be made without worrying about where the initialization occurs. Reviewed by: melifaro, rscheff Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26454 Modified: head/sys/netinet/ip_output.c head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri Sep 18 12:59:27 2020 (r365880) +++ head/sys/netinet/ip_output.c Fri Sep 18 14:01:10 2020 (r365881) @@ -323,11 +323,11 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct rou struct ifnet *ifp = NULL; /* keep compiler happy */ struct mbuf *m0; int hlen = sizeof (struct ip); - int mtu; + int mtu = 0; int error = 0; struct sockaddr_in *dst, sin; const struct sockaddr_in *gw; - struct in_ifaddr *ia; + struct in_ifaddr *ia = NULL; struct in_addr src; int isbroadcast; uint16_t ip_len, ip_off; @@ -485,7 +485,6 @@ again: * possible that a matching SPD entry exists. */ no_route_but_check_spd = 1; - mtu = 0; /* Silence GCC warning. */ goto sendit; #endif IPSTAT_INC(ips_noroute); @@ -521,7 +520,6 @@ again: * possible that a matching SPD entry exists. */ no_route_but_check_spd = 1; - mtu = 0; /* Silence GCC warning. */ goto sendit; #endif IPSTAT_INC(ips_noroute); Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Fri Sep 18 12:59:27 2020 (r365880) +++ head/sys/netinet/udp_usrreq.c Fri Sep 18 14:01:10 2020 (r365881) @@ -1151,7 +1151,7 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct s struct epoch_tracker et; int cscov_partial = 0; int error = 0; - int ipflags; + int ipflags = 0; u_short fport, lport; u_char tos; uint8_t pr; @@ -1435,7 +1435,6 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct s ip->ip_off |= htons(IP_DF); } - ipflags = 0; if (inp->inp_socket->so_options & SO_DONTROUTE) ipflags |= IP_ROUTETOIF; if (inp->inp_socket->so_options & SO_BROADCAST) From owner-svn-src-all@freebsd.org Fri Sep 18 14:05:32 2020 Return-Path: Delivered-To: svn-src-all@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 66CA73E4717; Fri, 18 Sep 2020 14:05:32 +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 4BtFwX294Zz4c8r; Fri, 18 Sep 2020 14:05:32 +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 28BAE1C238; Fri, 18 Sep 2020 14:05:32 +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 08IE5Wmn030643; Fri, 18 Sep 2020 14:05:32 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08IE5VjV030642; Fri, 18 Sep 2020 14:05:31 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202009181405.08IE5VjV030642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Fri, 18 Sep 2020 14:05:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365882 - head/lib/libarchive/tests X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/lib/libarchive/tests X-SVN-Commit-Revision: 365882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 14:05:32 -0000 Author: arichardson Date: Fri Sep 18 14:05:31 2020 New Revision: 365882 URL: https://svnweb.freebsd.org/changeset/base/365882 Log: Remove unnecessary include "../Makefile.inc" This is already pulled in by bsd.init.mk. Reported By: kevans Modified: head/lib/libarchive/tests/Makefile Modified: head/lib/libarchive/tests/Makefile ============================================================================== --- head/lib/libarchive/tests/Makefile Fri Sep 18 14:01:10 2020 (r365881) +++ head/lib/libarchive/tests/Makefile Fri Sep 18 14:05:31 2020 (r365882) @@ -16,7 +16,6 @@ PROGS+= libarchive_test CFLAGS+= -I${.CURDIR} -I${.CURDIR:H} -I${.OBJDIR} CFLAGS+= -I${_LIBARCHIVEDIR}/libarchive -I${_LIBARCHIVEDIR}/libarchive/test CFLAGS+= -I${_LIBARCHIVEDIR}/test_utils -.include "../Makefile.inc" # Uncomment to link against dmalloc #LDADD+= -L/usr/local/lib -ldmalloc From owner-svn-src-all@freebsd.org Fri Sep 18 14:06:25 2020 Return-Path: Delivered-To: svn-src-all@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 1E2873E481A; Fri, 18 Sep 2020 14:06:25 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) (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 4BtFxX5dStz4cGk; Fri, 18 Sep 2020 14:06:24 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ej1-f65.google.com with SMTP id gr14so8356574ejb.1; Fri, 18 Sep 2020 07:06:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bw0J8Vc06gSbyQdUzd0+58ZQDOYxpIBsQ+/g1bcVBIc=; b=Qj2MicPNtIU9dx6FnOjhAyN8rBjBJLBfS9CH1UydlJdY5Z7Lng2zZy4aCNqyMPmysV sJwngfbBGbwDHkmfLjHaw465FFe0IE4NDhQTHnskR/SnKMcymqwZMbVjnZVaoPA8OZyK TxhyNKzSVI2kgLhAm0erguXmnW0lHdjLAkTPOo0yBH/F7yiYYyyv/0BKTNGa4IjxMUsH YQGjhj5fedeR2Q1pKTfe8jeW0ELRwaHC4FNk4CzTcoFSGjDsJzs9cs0K5If7Fuf6udnP x8zFEJWzzNu2S54NWWq22+R4Bmbfucl7w8n+NWUUOTQeum4unFgRlajb3BtAVYDBB2hM Asgw== X-Gm-Message-State: AOAM5323BVMB+WTCUwXAxUCROqn5M6nmjOjr4RGIGrZEXgUKBfh5niDW 5MOF9tSOz53ytqA/Fgaw9kGQPOesSFBNjyIa X-Google-Smtp-Source: ABdhPJwb3/CI3U33hcfky8Fl7lR/fln7TvcGu5GcVu6HdBhCrh7oWOyLfjTaRhOwPe+ftbnOZU8BAA== X-Received: by 2002:a17:907:20d9:: with SMTP id qq25mr34569396ejb.382.1600437983111; Fri, 18 Sep 2020 07:06:23 -0700 (PDT) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com. [209.85.128.54]) by smtp.gmail.com with ESMTPSA id k13sm2312820edj.92.2020.09.18.07.06.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Sep 2020 07:06:22 -0700 (PDT) Received: by mail-wm1-f54.google.com with SMTP id d4so5459492wmd.5; Fri, 18 Sep 2020 07:06:22 -0700 (PDT) X-Received: by 2002:a1c:e256:: with SMTP id z83mr16937290wmg.137.1600437982138; Fri, 18 Sep 2020 07:06:22 -0700 (PDT) MIME-Version: 1.0 References: <202009181122.08IBMYpo032313@repo.freebsd.org> In-Reply-To: From: Alexander Richardson Date: Fri, 18 Sep 2020 15:06:09 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r365876 - in head/lib/libarchive: . tests To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BtFxX5dStz4cGk X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 14:06:25 -0000 On Fri, 18 Sep 2020 at 14:12, Kyle Evans wrote: > > On Fri, Sep 18, 2020 at 6:22 AM Alex Richardson wrote: > > > > Author: arichardson > > Date: Fri Sep 18 11:22:34 2020 > > New Revision: 365876 > > URL: https://svnweb.freebsd.org/changeset/base/365876 > > > > Log: > > libarchive: fix mismatch between library and test configuration > > > > I was investigating libarchive test failures on CheriBSD and it turns out > > we get a reproducible SIGBUS for test_archive_m5, etc. Debugging this shows > > that libarchive and the tests disagree when it comes to the definition of > > archive_md5_ctx: libarchive assumes it's the OpenSSL type whereas the test > > use the libmd type. The latter is not necessarily aligned enough to store > > a pointer (16 bytes for CHERI RISC-V), so we were crashing when storing > > EVP_MD_CTX* to an 8-byte-aligned archive_md5_ctx. > > > > To avoid problems like this in the future, factor out the common compiler > > flags into a Makefile.inc and include that from the tests Makefile. > > > > Reviewed By: lwhsu > > Differential Revision: https://reviews.freebsd.org/D26469 > > > > Added: > > head/lib/libarchive/Makefile.inc (contents, props changed) > > Modified: > > head/lib/libarchive/Makefile > > head/lib/libarchive/tests/Makefile > > > > [.. snip ..] > > Modified: head/lib/libarchive/tests/Makefile > > ============================================================================== > > --- head/lib/libarchive/tests/Makefile Fri Sep 18 11:04:16 2020 (r365875) > > +++ head/lib/libarchive/tests/Makefile Fri Sep 18 11:22:34 2020 (r365876) > > @@ -1,4 +1,5 @@ > > # $FreeBSD$ > > +.include > > > > PACKAGE= tests > > > > @@ -15,7 +16,7 @@ PROGS+= libarchive_test > > CFLAGS+= -I${.CURDIR} -I${.CURDIR:H} -I${.OBJDIR} > > CFLAGS+= -I${_LIBARCHIVEDIR}/libarchive -I${_LIBARCHIVEDIR}/libarchive/test > > CFLAGS+= -I${_LIBARCHIVEDIR}/test_utils > > -CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 > > +.include "../Makefile.inc" > > > > # Uncomment to link against dmalloc > > #LDADD+= -L/usr/local/lib -ldmalloc > > Is the explicit .include here necessary (e.g. for ordering)? I note > that inclusion of the parent directory's Makefile.inc is already > guaranteed by bsd.init.mk, so this duplicates all the CFLAGS > additions. > Thanks, I didn't notice that it was already being included. Fixed in r365882 Alex From owner-svn-src-all@freebsd.org Fri Sep 18 14:07:50 2020 Return-Path: Delivered-To: svn-src-all@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 D565E3E456F; Fri, 18 Sep 2020 14:07:50 +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 4BtFzB5Pp1z4cBn; Fri, 18 Sep 2020 14:07:50 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (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 9779910A8D; Fri, 18 Sep 2020 14:07:50 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f54.google.com with SMTP id ef16so2893260qvb.8; Fri, 18 Sep 2020 07:07:50 -0700 (PDT) X-Gm-Message-State: AOAM531QIUZw7zJXNCT+WekD3fdHwWTr5lXoYXhmnuyk5aUO9RNMXiQ5 eOp+p4ouFZFYAgII4ag0bsYDCQqMRp26HR8GX0A= X-Google-Smtp-Source: ABdhPJwn5ifSMqFxNwaAFLrat9DjYshju/ZPs/x6OYLJZebbyFlSdOjxI3zaWN2zFskYdLkrI0guaXLYyr2LlTBM2zc= X-Received: by 2002:a0c:f0d1:: with SMTP id d17mr17472990qvl.34.1600438069818; Fri, 18 Sep 2020 07:07:49 -0700 (PDT) MIME-Version: 1.0 References: <202009181122.08IBMYpo032313@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Fri, 18 Sep 2020 09:07:37 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r365876 - in head/lib/libarchive: . tests To: Alexander Richardson Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 14:07:50 -0000 On Fri, Sep 18, 2020 at 9:06 AM Alexander Richardson wrote: > > On Fri, 18 Sep 2020 at 14:12, Kyle Evans wrote: > > > > On Fri, Sep 18, 2020 at 6:22 AM Alex Richardson wrote: > > > > > > Author: arichardson > > > Date: Fri Sep 18 11:22:34 2020 > > > New Revision: 365876 > > > URL: https://svnweb.freebsd.org/changeset/base/365876 > > > > > > Log: > > > libarchive: fix mismatch between library and test configuration > > > > > > I was investigating libarchive test failures on CheriBSD and it turns out > > > we get a reproducible SIGBUS for test_archive_m5, etc. Debugging this shows > > > that libarchive and the tests disagree when it comes to the definition of > > > archive_md5_ctx: libarchive assumes it's the OpenSSL type whereas the test > > > use the libmd type. The latter is not necessarily aligned enough to store > > > a pointer (16 bytes for CHERI RISC-V), so we were crashing when storing > > > EVP_MD_CTX* to an 8-byte-aligned archive_md5_ctx. > > > > > > To avoid problems like this in the future, factor out the common compiler > > > flags into a Makefile.inc and include that from the tests Makefile. > > > > > > Reviewed By: lwhsu > > > Differential Revision: https://reviews.freebsd.org/D26469 > > > > > > Added: > > > head/lib/libarchive/Makefile.inc (contents, props changed) > > > Modified: > > > head/lib/libarchive/Makefile > > > head/lib/libarchive/tests/Makefile > > > > > > [.. snip ..] > > > Modified: head/lib/libarchive/tests/Makefile > > > ============================================================================== > > > --- head/lib/libarchive/tests/Makefile Fri Sep 18 11:04:16 2020 (r365875) > > > +++ head/lib/libarchive/tests/Makefile Fri Sep 18 11:22:34 2020 (r365876) > > > @@ -1,4 +1,5 @@ > > > # $FreeBSD$ > > > +.include > > > > > > PACKAGE= tests > > > > > > @@ -15,7 +16,7 @@ PROGS+= libarchive_test > > > CFLAGS+= -I${.CURDIR} -I${.CURDIR:H} -I${.OBJDIR} > > > CFLAGS+= -I${_LIBARCHIVEDIR}/libarchive -I${_LIBARCHIVEDIR}/libarchive/test > > > CFLAGS+= -I${_LIBARCHIVEDIR}/test_utils > > > -CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 > > > +.include "../Makefile.inc" > > > > > > # Uncomment to link against dmalloc > > > #LDADD+= -L/usr/local/lib -ldmalloc > > > > Is the explicit .include here necessary (e.g. for ordering)? I note > > that inclusion of the parent directory's Makefile.inc is already > > guaranteed by bsd.init.mk, so this duplicates all the CFLAGS > > additions. > > > Thanks, I didn't notice that it was already being included. Fixed in r365882 > Excellent, thanks! =) From owner-svn-src-all@freebsd.org Fri Sep 18 14:29:02 2020 Return-Path: Delivered-To: svn-src-all@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 999593E4E1E; Fri, 18 Sep 2020 14:29:02 +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 4BtGRf3Tpzz4dG5; Fri, 18 Sep 2020 14:29:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56D311C27A; Fri, 18 Sep 2020 14:29:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08IET2an042915; Fri, 18 Sep 2020 14:29:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08IET22l042914; Fri, 18 Sep 2020 14:29:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009181429.08IET22l042914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 18 Sep 2020 14:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365883 - head/release/packages X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/release/packages X-SVN-Commit-Revision: 365883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 14:29:02 -0000 Author: kevans Date: Fri Sep 18 14:29:01 2020 New Revision: 365883 URL: https://svnweb.freebsd.org/changeset/base/365883 Log: pkgbase: use consistent annotation for objectk eys Everywhere else we use objects ("scripts", generally) we do sepcify the optional colon. Be consistent and do the same for directories. PR: 249273 Submitted by: Martin MFC after: 1 week Modified: head/release/packages/runtime.ucl Modified: head/release/packages/runtime.ucl ============================================================================== --- head/release/packages/runtime.ucl Fri Sep 18 14:05:31 2020 (r365882) +++ head/release/packages/runtime.ucl Fri Sep 18 14:29:01 2020 (r365883) @@ -23,7 +23,7 @@ scripts: { chmod 1777 ${PKG_ROOTDIR}/tmp EOD } -directories { +directories: { /dev = "y"; /tmp = "y"; } From owner-svn-src-all@freebsd.org Fri Sep 18 14:40:13 2020 Return-Path: Delivered-To: svn-src-all@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 EB9BC3E514C; Fri, 18 Sep 2020 14:40:13 +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 4BtGhY51mRz4f4T; Fri, 18 Sep 2020 14:40:13 +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 8DA721CA74; Fri, 18 Sep 2020 14:40:13 +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 08IEeD1L049337; Fri, 18 Sep 2020 14:40:13 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08IEeDtT049336; Fri, 18 Sep 2020 14:40:13 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202009181440.08IEeDtT049336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 18 Sep 2020 14:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365884 - head/release/arm64 X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/release/arm64 X-SVN-Commit-Revision: 365884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 14:40:14 -0000 Author: mhorne Date: Fri Sep 18 14:40:13 2020 New Revision: 365884 URL: https://svnweb.freebsd.org/changeset/base/365884 Log: arm64: generate ISO release images Some IPMI implementations on arm64 are reportedly unable to load our memstick installer images, but support the older ISO format. Start generating these for arm64. Unlike installer ISOs for other platforms, these images are UEFI-only. Reviewed by: emaste Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26452 Added: head/release/arm64/mkisoimages.sh (contents, props changed) Added: head/release/arm64/mkisoimages.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/arm64/mkisoimages.sh Fri Sep 18 14:40:13 2020 (r365884) @@ -0,0 +1,93 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# This script is used by release/Makefile to build the (optional) ISO images +# for a FreeBSD release. It is considered architecture dependent since each +# platform has a slightly unique way of making bootable CDs. This script is +# also allowed to generate any number of images since that is more of +# publishing decision than anything else. +# +# Usage: +# +# mkisoimages.sh [-b] image-label image-name base-bits-dir [extra-bits-dir] +# +# Where -b is passed if the ISO image should be made "bootable" by +# whatever standards this architecture supports (may be unsupported), +# image-label is the ISO image label, image-name is the filename of the +# resulting ISO image, base-bits-dir contains the image contents and +# extra-bits-dir, if provided, contains additional files to be merged +# into base-bits-dir as part of making the image. + +set -e + +scriptdir=$(dirname $(realpath $0)) +. ${scriptdir}/../../tools/boot/install-boot.sh + +if [ -z $ETDUMP ]; then + ETDUMP=etdump +fi + +if [ -z $MAKEFS ]; then + MAKEFS=makefs +fi + +if [ -z $MKIMG ]; then + MKIMG=mkimg +fi + +if [ "$1" = "-b" ]; then + BASEBITSDIR="$4" + + # Make an EFI system partition. + # The ISO file is a special case, in that it only has a maximum of + # 800 KB available for the boot code. So make an 800 KB ESP + espfilename=$(mktemp /tmp/efiboot.XXXXXX) + make_esp_file ${espfilename} 800 ${BASEBITSDIR}/boot/loader.efi + + bootable="-o bootimage=efi;${espfilename} -o no-emul-boot -o platformid=efi" + + shift +else + BASEBITSDIR="$3" + bootable="" +fi + +if [ $# -lt 3 ]; then + echo "Usage: $0 [-b] image-label image-name base-bits-dir [extra-bits-dir]" + exit 1 +fi + +LABEL=`echo "$1" | tr '[:lower:]' '[:upper:]'`; shift +NAME="$1"; shift + +publisher="The FreeBSD Project. https://www.FreeBSD.org/" +echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$BASEBITSDIR/etc/fstab" +$MAKEFS -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@" +rm -f "$BASEBITSDIR/etc/fstab" +rm -f ${espfilename} + +if [ "$bootable" != "" ]; then + # Look for the EFI System Partition image we dropped in the ISO image. + for entry in `$ETDUMP --format shell $NAME`; do + eval $entry + # XXX: etdump(8) returns "default" for the initial entry + if [ "$et_platform" = "default" ]; then + espstart=`expr $et_lba \* 2048` + espsize=`expr $et_sectors \* 512` + espparam="-p efi::$espsize:$espstart" + break + fi + done + + # Create a GPT image containing the EFI partition. + imgsize=`stat -f %z "$NAME"` + $MKIMG -s gpt \ + --capacity $imgsize \ + $espparam \ + -o efi.img + + # Drop the GPT into the System Area of the ISO. + dd if=efi.img of="$NAME" bs=32k count=1 conv=notrunc + rm -f efi.img +fi From owner-svn-src-all@freebsd.org Fri Sep 18 16:48:10 2020 Return-Path: Delivered-To: svn-src-all@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 709A73E7924; Fri, 18 Sep 2020 16:48:10 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BtKXB2L3Nz3XwM; Fri, 18 Sep 2020 16:48:10 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2FA161E1BF; Fri, 18 Sep 2020 16:48:10 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08IGm9Tm029519; Fri, 18 Sep 2020 16:48:09 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08IGm8mD029511; Fri, 18 Sep 2020 16:48:08 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <202009181648.08IGm8mD029511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 18 Sep 2020 16:48:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365886 - in head/sys: dev/fb dev/ksyms dev/vt/hw/fb fs/tmpfs kern vm X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: in head/sys: dev/fb dev/ksyms dev/vt/hw/fb fs/tmpfs kern vm X-SVN-Commit-Revision: 365886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 16:48:10 -0000 Author: vangyzen Date: Fri Sep 18 16:48:08 2020 New Revision: 365886 URL: https://svnweb.freebsd.org/changeset/base/365886 Log: vm_ooffset_t is now unsigned vm_ooffset_t is now unsigned. Remove some tests for negative values, or make other adjustments accordingly. Reported by: Coverity Reviewed by: kib markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D26214 Modified: head/sys/dev/fb/fbd.c head/sys/dev/ksyms/ksyms.c head/sys/dev/vt/hw/fb/vt_fb.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/kern/uipc_shm.c head/sys/kern/vfs_vnops.c head/sys/vm/vnode_pager.c Modified: head/sys/dev/fb/fbd.c ============================================================================== --- head/sys/dev/fb/fbd.c Fri Sep 18 15:51:16 2020 (r365885) +++ head/sys/dev/fb/fbd.c Fri Sep 18 16:48:08 2020 (r365886) @@ -176,7 +176,7 @@ fb_mmap(struct cdev *dev, vm_ooffset_t offset, vm_padd if (info->fb_flags & FB_FLAG_NOMMAP) return (ENODEV); - if (offset >= 0 && offset < info->fb_size) { + if (offset < info->fb_size) { if (info->fb_pbase == 0) *paddr = vtophys((uint8_t *)info->fb_vbase + offset); else Modified: head/sys/dev/ksyms/ksyms.c ============================================================================== --- head/sys/dev/ksyms/ksyms.c Fri Sep 18 15:51:16 2020 (r365885) +++ head/sys/dev/ksyms/ksyms.c Fri Sep 18 16:48:08 2020 (r365886) @@ -484,7 +484,7 @@ ksyms_mmap_single(struct cdev *dev, vm_ooffset_t *offs if (error != 0) return (error); - if (*offset < 0 || *offset >= round_page(sc->sc_objsz) || + if (*offset >= round_page(sc->sc_objsz) || size > round_page(sc->sc_objsz) - *offset || (nprot & ~PROT_READ) != 0) return (EINVAL); Modified: head/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.c Fri Sep 18 15:51:16 2020 (r365885) +++ head/sys/dev/vt/hw/fb/vt_fb.c Fri Sep 18 16:48:08 2020 (r365886) @@ -140,7 +140,7 @@ vt_fb_mmap(struct vt_device *vd, vm_ooffset_t offset, if (info->fb_flags & FB_FLAG_NOMMAP) return (ENODEV); - if (offset >= 0 && offset < info->fb_size) { + if (offset < info->fb_size) { if (info->fb_pbase == 0) { *paddr = vtophys((uint8_t *)info->fb_vbase + offset); } else { Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Fri Sep 18 15:51:16 2020 (r365885) +++ head/sys/fs/tmpfs/tmpfs_subr.c Fri Sep 18 16:48:08 2020 (r365886) @@ -178,12 +178,14 @@ RB_PROTOTYPE_STATIC(tmpfs_dir, tmpfs_dirent, uh.td_ent size_t tmpfs_mem_avail(void) { - vm_ooffset_t avail; + size_t avail; + long reserved; - avail = swap_pager_avail + vm_free_count() - tmpfs_pages_reserved; - if (__predict_false(avail < 0)) - avail = 0; - return (avail); + avail = swap_pager_avail + vm_free_count(); + reserved = atomic_load_long(&tmpfs_pages_reserved); + if (__predict_false(avail < reserved)) + return (0); + return (avail - reserved); } size_t Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Fri Sep 18 15:51:16 2020 (r365885) +++ head/sys/kern/uipc_shm.c Fri Sep 18 16:48:08 2020 (r365886) @@ -1577,7 +1577,7 @@ shm_mmap(struct file *fp, vm_map_t map, vm_offset_t *a #ifdef _LP64 objsize > OFF_MAX || #endif - foff < 0 || foff > OFF_MAX - objsize) { + foff > OFF_MAX - objsize) { error = EINVAL; goto out; } Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Fri Sep 18 15:51:16 2020 (r365885) +++ head/sys/kern/vfs_vnops.c Fri Sep 18 16:48:08 2020 (r365886) @@ -2630,7 +2630,7 @@ vn_mmap(struct file *fp, vm_map_t map, vm_offset_t *ad #ifdef _LP64 size > OFF_MAX || #endif - foff < 0 || foff > OFF_MAX - size) + foff > OFF_MAX - size) return (EINVAL); writecounted = FALSE; Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Fri Sep 18 15:51:16 2020 (r365885) +++ head/sys/vm/vnode_pager.c Fri Sep 18 16:48:08 2020 (r365886) @@ -541,9 +541,6 @@ vnode_pager_addr(struct vnode *vp, vm_ooffset_t addres daddr_t vblock; daddr_t voffset; - if (address < 0) - return -1; - if (VN_IS_DOOMED(vp)) return -1; From owner-svn-src-all@freebsd.org Fri Sep 18 17:17:54 2020 Return-Path: Delivered-To: svn-src-all@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 040743E8718; Fri, 18 Sep 2020 17:17:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BtLBT6Zksz3ZKY; Fri, 18 Sep 2020 17:17:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0CEC1E4DD; Fri, 18 Sep 2020 17:17:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08IHHrSZ047618; Fri, 18 Sep 2020 17:17:53 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08IHHkSq047581; Fri, 18 Sep 2020 17:17:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009181717.08IHHkSq047581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 18 Sep 2020 17:17:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365887 - in head: . bin gnu/lib/libregex gnu/usr.bin/diff3 gnu/usr.bin/gdb gnu/usr.bin/grep lib lib/clang lib/libarchive/tests lib/libc/tests/regex lib/libcasper/services/cap_dns/tests... X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: . bin gnu/lib/libregex gnu/usr.bin/diff3 gnu/usr.bin/gdb gnu/usr.bin/grep lib lib/clang lib/libarchive/tests lib/libc/tests/regex lib/libcasper/services/cap_dns/tests lib/libcasper/services/c... X-SVN-Commit-Revision: 365887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 17:17:54 -0000 Author: kevans Date: Fri Sep 18 17:17:46 2020 New Revision: 365887 URL: https://svnweb.freebsd.org/changeset/base/365887 Log: build: provide a default WARNS for all in-tree builds The current default is provided in various Makefile.inc in some top-level directories and covers a good portion of the tree, but doesn't cover parts of the build a little deeper (e.g. libcasper). Provide a default in src.sys.mk and set WARNS to it in bsd.sys.mk if that variable is defined. This lets us relatively cleanly provide a default WARNS no matter where you're building in the src tree without breaking things outside of the tree. Crunchgen has been updated as a bootstrap tool to work on this change because it needs r365605 at a minimum to succeed. The cleanup necessary to successfully walk over this change on WITHOUT_CLEAN builds has been added. There is a supplemental project to this to list all of the warnings that are encountered when the environment has WARNS=6 NO_WERROR=yes: https://warns.kevans.dev -- this project will hopefully eventually go away in favor of CI doing a much better job than it. Reviewed by: emaste, brooks, ngie (all earlier version) Reviewed by: emaste, arichardson (depend-cleanup.sh change) Differential Revision: https://reviews.freebsd.org/D26455 Added: head/tests/sys/cddl/zfs/tests/Makefile.inc (contents, props changed) Modified: head/Makefile.inc1 head/bin/Makefile.inc head/gnu/lib/libregex/Makefile head/gnu/usr.bin/diff3/Makefile head/gnu/usr.bin/gdb/Makefile.inc head/gnu/usr.bin/grep/Makefile head/lib/Makefile.inc head/lib/clang/Makefile.inc head/lib/libarchive/tests/Makefile head/lib/libc/tests/regex/Makefile.inc head/lib/libcasper/services/cap_dns/tests/Makefile head/lib/libcasper/services/cap_grp/tests/Makefile head/lib/libcasper/services/cap_pwd/tests/Makefile head/lib/libcasper/services/cap_sysctl/tests/Makefile head/lib/libthr/tests/Makefile head/lib/libthr/tests/dlopen/Makefile head/lib/libthr/tests/dlopen/dso/Makefile head/lib/libxo/tests/Makefile head/lib/ofed/Makefile.inc head/rescue/librescue/Makefile head/sbin/Makefile.inc head/secure/lib/libcrypto/engines/Makefile.inc head/share/mk/bsd.sys.mk head/share/mk/src.sys.mk head/tests/sys/cddl/zfs/bin/Makefile head/tests/sys/geom/class/eli/Makefile head/tests/sys/net/routing/Makefile head/tools/build/depend-cleanup.sh head/usr.bin/Makefile.inc head/usr.bin/ofed/infiniband-diags/Makefile.inc head/usr.bin/ofed/libibverbs/Makefile.inc head/usr.bin/ofed/librdmacm/Makefile.inc head/usr.bin/tar/tests/Makefile head/usr.sbin/Makefile.inc head/usr.sbin/wpa/Makefile.inc Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Sep 18 16:48:08 2020 (r365886) +++ head/Makefile.inc1 Fri Sep 18 17:17:46 2020 (r365887) @@ -2226,12 +2226,9 @@ _crunchide= usr.sbin/crunch/crunchide _bootstrap_tools_links+=crunchide .endif -# r285986 crunchen: use STRIPBIN rather than STRIP -# 1100113: Support MK_AUTO_OBJ -# 1200006: META_MODE fixes -.if ${BOOTSTRAPPING} < 1100078 || \ - (${MK_AUTO_OBJ} == "yes" && ${BOOTSTRAPPING} < 1100114) || \ - (${MK_META_MODE} == "yes" && ${BOOTSTRAPPING} < 1200006) +# 1300115: Higher WARNS fixes +.if ${BOOTSTRAPPING} < 1202502 || \ + (${BOOTSTRAPPING} > 1300000 && ${BOOTSTRAPPING} < 1300115) _crunchgen= usr.sbin/crunch/crunchgen .else _bootstrap_tools_links+=crunchgen Modified: head/bin/Makefile.inc ============================================================================== --- head/bin/Makefile.inc Fri Sep 18 16:48:08 2020 (r365886) +++ head/bin/Makefile.inc Fri Sep 18 17:17:46 2020 (r365887) @@ -4,7 +4,6 @@ .include BINDIR?= /bin -WARNS?= 6 .if ${MK_DYNAMICROOT} == "no" NO_SHARED?= YES Modified: head/gnu/lib/libregex/Makefile ============================================================================== --- head/gnu/lib/libregex/Makefile Fri Sep 18 16:48:08 2020 (r365886) +++ head/gnu/lib/libregex/Makefile Fri Sep 18 17:17:46 2020 (r365887) @@ -6,6 +6,8 @@ SHLIB_MAJOR= 5 REGEXDIR= ${SRCTOP}/contrib/libgnuregex .PATH: ${REGEXDIR} +WARNS?= 1 + SRCS= gnuregex.c INCSGROUPS= INCS WRINCS PXINCS INCS= regex.h.patched Modified: head/gnu/usr.bin/diff3/Makefile ============================================================================== --- head/gnu/usr.bin/diff3/Makefile Fri Sep 18 16:48:08 2020 (r365886) +++ head/gnu/usr.bin/diff3/Makefile Fri Sep 18 17:17:46 2020 (r365887) @@ -18,6 +18,8 @@ CFLAGS+=-I${SRCTOP}/contrib/diff/lib CFLAGS+=-DHAVE_CONFIG_H CFLAGS+=-DDEFAULT_DIFF_PROGRAM=\"/usr/bin/diff\" +WARNS?= 0 + .for f in diff3.c ${f}: ${DIFFSRC}/${f} ${.CURDIR}/${f}.diff patch -s -o ${.TARGET} < ${.CURDIR}/${f}.diff ${DIFFSRC}/${f} Modified: head/gnu/usr.bin/gdb/Makefile.inc ============================================================================== --- head/gnu/usr.bin/gdb/Makefile.inc Fri Sep 18 16:48:08 2020 (r365886) +++ head/gnu/usr.bin/gdb/Makefile.inc Fri Sep 18 17:17:46 2020 (r365887) @@ -2,6 +2,8 @@ .include +WARNS?= 0 + VERSION= "6.1.1 [FreeBSD]" VENDOR= marcel Modified: head/gnu/usr.bin/grep/Makefile ============================================================================== --- head/gnu/usr.bin/grep/Makefile Fri Sep 18 16:48:08 2020 (r365886) +++ head/gnu/usr.bin/grep/Makefile Fri Sep 18 17:17:46 2020 (r365887) @@ -14,6 +14,8 @@ SRCS= closeout.c dfa.c error.c exclude.c grep.c grepma xstrtoumax.c CLEANFILES+= gnugrep.1 +WARNS?= 0 + CFLAGS+=-I${.CURDIR} -I${SYSROOT:U${DESTDIR}}/usr/include/gnu -DHAVE_CONFIG_H .if ${MK_BSD_GREP} != "yes" Modified: head/lib/Makefile.inc ============================================================================== --- head/lib/Makefile.inc Fri Sep 18 16:48:08 2020 (r365886) +++ head/lib/Makefile.inc Fri Sep 18 17:17:46 2020 (r365887) @@ -1,5 +1,3 @@ # $FreeBSD$ # Default version for system libs (override in /Makefile if necessary) SHLIB_MAJOR?= 5 - -WARNS?= 6 Modified: head/lib/clang/Makefile.inc ============================================================================== --- head/lib/clang/Makefile.inc Fri Sep 18 16:48:08 2020 (r365886) +++ head/lib/clang/Makefile.inc Fri Sep 18 17:17:46 2020 (r365887) @@ -9,3 +9,5 @@ DEBUG_FILES_CFLAGS= -gline-tables-only .else DEBUG_FILES_CFLAGS= -g1 .endif + +WARNS?= 0 Modified: head/lib/libarchive/tests/Makefile ============================================================================== --- head/lib/libarchive/tests/Makefile Fri Sep 18 16:48:08 2020 (r365886) +++ head/lib/libarchive/tests/Makefile Fri Sep 18 17:17:46 2020 (r365887) @@ -3,6 +3,8 @@ PACKAGE= tests +WARNS?= 3 + _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive ATF_TESTS_SH+= functional_test Modified: head/lib/libc/tests/regex/Makefile.inc ============================================================================== --- head/lib/libc/tests/regex/Makefile.inc Fri Sep 18 16:48:08 2020 (r365886) +++ head/lib/libc/tests/regex/Makefile.inc Fri Sep 18 17:17:46 2020 (r365887) @@ -3,6 +3,7 @@ .include BINDIR?= ${TESTSDIR} +WARNS?= 3 # SKIP_LEFTASSOC -> these testcases fail on FreeBSD. IMPLEMENTATION?= -DREGEX_SPENCER -DSKIP_LEFTASSOC Modified: head/lib/libcasper/services/cap_dns/tests/Makefile ============================================================================== --- head/lib/libcasper/services/cap_dns/tests/Makefile Fri Sep 18 16:48:08 2020 (r365886) +++ head/lib/libcasper/services/cap_dns/tests/Makefile Fri Sep 18 17:17:46 2020 (r365887) @@ -11,6 +11,4 @@ CFLAGS+=-DWITH_CASPER .endif LIBADD+= nv -WARNS?= 3 - .include Modified: head/lib/libcasper/services/cap_grp/tests/Makefile ============================================================================== --- head/lib/libcasper/services/cap_grp/tests/Makefile Fri Sep 18 16:48:08 2020 (r365886) +++ head/lib/libcasper/services/cap_grp/tests/Makefile Fri Sep 18 17:17:46 2020 (r365887) @@ -11,6 +11,4 @@ CFLAGS+=-DWITH_CASPER .endif LIBADD+= nv -WARNS?= 3 - .include Modified: head/lib/libcasper/services/cap_pwd/tests/Makefile ============================================================================== --- head/lib/libcasper/services/cap_pwd/tests/Makefile Fri Sep 18 16:48:08 2020 (r365886) +++ head/lib/libcasper/services/cap_pwd/tests/Makefile Fri Sep 18 17:17:46 2020 (r365887) @@ -11,6 +11,4 @@ CFLAGS+=-DWITH_CASPER .endif LIBADD+= nv -WARNS?= 3 - .include Modified: head/lib/libcasper/services/cap_sysctl/tests/Makefile ============================================================================== --- head/lib/libcasper/services/cap_sysctl/tests/Makefile Fri Sep 18 16:48:08 2020 (r365886) +++ head/lib/libcasper/services/cap_sysctl/tests/Makefile Fri Sep 18 17:17:46 2020 (r365887) @@ -11,8 +11,6 @@ CFLAGS+=-DWITH_CASPER .endif LIBADD+= nv -WARNS?= 3 - TEST_METADATA.sysctl_test+= required_user="root" .include Modified: head/lib/libthr/tests/Makefile ============================================================================== --- head/lib/libthr/tests/Makefile Fri Sep 18 16:48:08 2020 (r365886) +++ head/lib/libthr/tests/Makefile Fri Sep 18 17:17:46 2020 (r365887) @@ -2,6 +2,8 @@ PACKAGE= tests +WARNS?= 3 + TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libpthread # TODO: t_name (missing pthread_getname_np support in FreeBSD) Modified: head/lib/libthr/tests/dlopen/Makefile ============================================================================== --- head/lib/libthr/tests/dlopen/Makefile Fri Sep 18 16:48:08 2020 (r365886) +++ head/lib/libthr/tests/dlopen/Makefile Fri Sep 18 17:17:46 2020 (r365887) @@ -2,6 +2,8 @@ TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libpthread/dlopen +WARNS?= 2 + .include TESTSDIR= ${TESTSBASE}/lib/libthr/dlopen Modified: head/lib/libthr/tests/dlopen/dso/Makefile ============================================================================== --- head/lib/libthr/tests/dlopen/dso/Makefile Fri Sep 18 16:48:08 2020 (r365886) +++ head/lib/libthr/tests/dlopen/dso/Makefile Fri Sep 18 17:17:46 2020 (r365887) @@ -1,6 +1,7 @@ # $FreeBSD$ TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libpthread/dlopen/dso +WARNS?= 3 SHLIB= h_pthread_dlopen SHLIB_MAJOR= 1 Modified: head/lib/libxo/tests/Makefile ============================================================================== --- head/lib/libxo/tests/Makefile Fri Sep 18 16:48:08 2020 (r365886) +++ head/lib/libxo/tests/Makefile Fri Sep 18 17:17:46 2020 (r365887) @@ -4,6 +4,8 @@ PACKAGE= tests +WARNS?= 1 + LIBXOSRC= ${SRCTOP}/contrib/libxo # Override the default suffix transformation rules for .c/.o -> .out Modified: head/lib/ofed/Makefile.inc ============================================================================== --- head/lib/ofed/Makefile.inc Fri Sep 18 16:48:08 2020 (r365886) +++ head/lib/ofed/Makefile.inc Fri Sep 18 17:17:46 2020 (r365887) @@ -1 +1,3 @@ # $FreeBSD$ + +WARNS?= 0 Modified: head/rescue/librescue/Makefile ============================================================================== --- head/rescue/librescue/Makefile Fri Sep 18 16:48:08 2020 (r365886) +++ head/rescue/librescue/Makefile Fri Sep 18 17:17:46 2020 (r365887) @@ -23,6 +23,8 @@ INTERNALLIB= # Don't install this library SRCS= exec.c getusershell.c login_class.c popen.c rcmdsh.c \ sysctl.c system.c +WARNS?= 3 + CFLAGS+= -DRESCUE # Flags copied from src/lib/libc and src/lib/libutil # libc/db/Makefile.inc Modified: head/sbin/Makefile.inc ============================================================================== --- head/sbin/Makefile.inc Fri Sep 18 16:48:08 2020 (r365886) +++ head/sbin/Makefile.inc Fri Sep 18 17:17:46 2020 (r365887) @@ -4,7 +4,6 @@ .include BINDIR?= /sbin -WARNS?= 6 .if ${MK_DYNAMICROOT} == "no" NO_SHARED?= YES Modified: head/secure/lib/libcrypto/engines/Makefile.inc ============================================================================== --- head/secure/lib/libcrypto/engines/Makefile.inc Fri Sep 18 16:48:08 2020 (r365886) +++ head/secure/lib/libcrypto/engines/Makefile.inc Fri Sep 18 17:17:46 2020 (r365887) @@ -18,3 +18,5 @@ CFLAGS+= -DB_ENDIAN CFLAGS+= -DNDEBUG .PATH: ${LCRYPTO_SRC}/engines + +WARNS?= 0 Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Fri Sep 18 16:48:08 2020 (r365886) +++ head/share/mk/bsd.sys.mk Fri Sep 18 17:17:46 2020 (r365887) @@ -28,6 +28,14 @@ CFLAGS+= -std=${CSTD} CXXFLAGS+= -std=${CXXSTD} .endif +# This gives the Makefile we're evaluating at the top-level a chance to set +# WARNS. If it doesn't do so, we may freely pull a DEFAULTWARNS if it's set +# and use that. This allows us to default WARNS to 6 for src builds without +# needing to set the default in various Makefile.inc. +.if !defined(WARNS) && defined(DEFAULTWARNS) +WARNS= ${DEFAULTWARNS} +.endif + # -pedantic is problematic because it also imposes namespace restrictions #CFLAGS+= -pedantic .if defined(WARNS) Modified: head/share/mk/src.sys.mk ============================================================================== --- head/share/mk/src.sys.mk Fri Sep 18 16:48:08 2020 (r365886) +++ head/share/mk/src.sys.mk Fri Sep 18 17:17:46 2020 (r365887) @@ -40,6 +40,8 @@ __postrcconf_${var}:= ${MK_${var}:U-}${WITHOUT_${var}: CFCOMMONFLAG?= -fno-common CFLAGS+= ${CFCOMMONFLAG} +DEFAULTWARNS= 6 + # tempting, but bsd.compiler.mk causes problems this early # probably need to remove dependence on bsd.own.mk #.include "src.opts.mk" Modified: head/tests/sys/cddl/zfs/bin/Makefile ============================================================================== --- head/tests/sys/cddl/zfs/bin/Makefile Fri Sep 18 16:48:08 2020 (r365886) +++ head/tests/sys/cddl/zfs/bin/Makefile Fri Sep 18 17:17:46 2020 (r365887) @@ -7,6 +7,8 @@ MAN= BINDIR= ${TESTSBASE}/sys/cddl/zfs/bin SCRIPTSDIR= ${TESTSBASE}/sys/cddl/zfs/bin +WARNS?= 0 + SCRIPTS+= bsddisks.ksh SCRIPTS+= dircmp.ksh SCRIPTS+= dumpadm.ksh Added: head/tests/sys/cddl/zfs/tests/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/cddl/zfs/tests/Makefile.inc Fri Sep 18 17:17:46 2020 (r365887) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +WARNS?= 0 Modified: head/tests/sys/geom/class/eli/Makefile ============================================================================== --- head/tests/sys/geom/class/eli/Makefile Fri Sep 18 16:48:08 2020 (r365886) +++ head/tests/sys/geom/class/eli/Makefile Fri Sep 18 17:17:46 2020 (r365887) @@ -4,6 +4,8 @@ PACKAGE= tests +WARNS?= 3 + TESTSDIR= ${TESTSBASE}/sys/geom/class/${.CURDIR:T} ATF_TESTS_C= pbkdf2_test Modified: head/tests/sys/net/routing/Makefile ============================================================================== --- head/tests/sys/net/routing/Makefile Fri Sep 18 16:48:08 2020 (r365886) +++ head/tests/sys/net/routing/Makefile Fri Sep 18 17:17:46 2020 (r365887) @@ -1,6 +1,7 @@ # $FreeBSD$ PACKAGE= tests +WARNS?= 1 TESTSDIR= ${TESTSBASE}/sys/net/routing Modified: head/tools/build/depend-cleanup.sh ============================================================================== --- head/tools/build/depend-cleanup.sh Fri Sep 18 16:48:08 2020 (r365886) +++ head/tools/build/depend-cleanup.sh Fri Sep 18 17:17:46 2020 (r365887) @@ -49,3 +49,10 @@ if [ -e "$OBJTOP"/cddl/lib/libzfs/.depend.libzfs_chang echo "Removing old ZFS tree" rm -rf "$OBJTOP"/cddl "$OBJTOP"/obj-lib32/cddl fi + +# 20200916 WARNS bumped, need bootstrapped crunchgen stubs +if [ -e "$OBJTOP"/rescue/rescue/rescue.c ] && \ + ! grep -q 'crunched_stub_t' "$OBJTOP"/rescue/rescue/rescue.c; then + echo "Removing old rescue(8) tree" + rm -rf "$OBJTOP"/rescue/rescue +fi Modified: head/usr.bin/Makefile.inc ============================================================================== --- head/usr.bin/Makefile.inc Fri Sep 18 16:48:08 2020 (r365886) +++ head/usr.bin/Makefile.inc Fri Sep 18 17:17:46 2020 (r365887) @@ -2,5 +2,3 @@ # $FreeBSD$ BINDIR?= /usr/bin - -WARNS?= 6 Modified: head/usr.bin/ofed/infiniband-diags/Makefile.inc ============================================================================== --- head/usr.bin/ofed/infiniband-diags/Makefile.inc Fri Sep 18 16:48:08 2020 (r365886) +++ head/usr.bin/ofed/infiniband-diags/Makefile.inc Fri Sep 18 17:17:46 2020 (r365887) @@ -10,3 +10,4 @@ CFLAGS+= -DHAVE_CONFIG_H=1 CFLAGS+= -I${_spath} -I${_spath}/src LIBADD+= osmcomp ibmad ibumad +WARNS?= 0 Modified: head/usr.bin/ofed/libibverbs/Makefile.inc ============================================================================== --- head/usr.bin/ofed/libibverbs/Makefile.inc Fri Sep 18 16:48:08 2020 (r365886) +++ head/usr.bin/ofed/libibverbs/Makefile.inc Fri Sep 18 17:17:46 2020 (r365887) @@ -7,3 +7,4 @@ BINDIR?= /usr/bin CFLAGS+= -I${_spath} LIBADD+= ibverbs mlx4 mlx5 cxgb4 pthread +WARNS?= 2 Modified: head/usr.bin/ofed/librdmacm/Makefile.inc ============================================================================== --- head/usr.bin/ofed/librdmacm/Makefile.inc Fri Sep 18 16:48:08 2020 (r365886) +++ head/usr.bin/ofed/librdmacm/Makefile.inc Fri Sep 18 17:17:46 2020 (r365887) @@ -6,3 +6,5 @@ _spath=${SRCTOP}/contrib/ofed/librdmacm BINDIR?= /usr/bin CFLAGS+= -I${SRCTOP}/contrib/ofed LIBADD+= ibverbs rdmacm mlx4 mlx5 cxgb4 pthread + +WARNS?= 0 Modified: head/usr.bin/tar/tests/Makefile ============================================================================== --- head/usr.bin/tar/tests/Makefile Fri Sep 18 16:48:08 2020 (r365886) +++ head/usr.bin/tar/tests/Makefile Fri Sep 18 17:17:46 2020 (r365887) @@ -2,6 +2,8 @@ PACKAGE= tests +WARNS?= 3 + _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive ATF_TESTS_SH+= functional_test Modified: head/usr.sbin/Makefile.inc ============================================================================== --- head/usr.sbin/Makefile.inc Fri Sep 18 16:48:08 2020 (r365886) +++ head/usr.sbin/Makefile.inc Fri Sep 18 17:17:46 2020 (r365887) @@ -2,5 +2,3 @@ # $FreeBSD$ BINDIR?= /usr/sbin - -WARNS?= 6 Modified: head/usr.sbin/wpa/Makefile.inc ============================================================================== --- head/usr.sbin/wpa/Makefile.inc Fri Sep 18 16:48:08 2020 (r365886) +++ head/usr.sbin/wpa/Makefile.inc Fri Sep 18 17:17:46 2020 (r365887) @@ -2,6 +2,8 @@ BINDIR?= /usr/sbin +WARNS?= 0 + WPA_DISTDIR?= ${SRCTOP}/contrib/wpa/ WPA_SUPPLICANT_DISTDIR?=${WPA_DISTDIR}/wpa_supplicant HOSTAPD_DISTDIR?= ${WPA_DISTDIR}/hostapd From owner-svn-src-all@freebsd.org Fri Sep 18 17:19:55 2020 Return-Path: Delivered-To: svn-src-all@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 E72B93E87A2 for ; Fri, 18 Sep 2020 17:19:55 +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 4BtLDq5rZgz3Zkj for ; Fri, 18 Sep 2020 17:19:55 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (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 A7C4711F8D for ; Fri, 18 Sep 2020 17:19:55 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f179.google.com with SMTP id v54so5700589qtj.7 for ; Fri, 18 Sep 2020 10:19:55 -0700 (PDT) X-Gm-Message-State: AOAM533m9BpzFfplaOL+DQqrlZ441q+4IO0gs/r5XXIM9syztxX9h3lG k1//4JRDpzGWRYsONqYrVPFzRJI8kT75t0NFv1I= X-Received: by 2002:ac8:709:: with SMTP id g9mt21865097qth.310.1600449595040; Fri, 18 Sep 2020 10:19:55 -0700 (PDT) MIME-Version: 1.0 References: <202009181717.08IHHkSq047581@repo.freebsd.org> In-Reply-To: <202009181717.08IHHkSq047581@repo.freebsd.org> From: Kyle Evans Date: Fri, 18 Sep 2020 12:19:42 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r365887 - in head: . bin gnu/lib/libregex gnu/usr.bin/diff3 gnu/usr.bin/gdb gnu/usr.bin/grep lib lib/clang lib/libarchive/tests lib/libc/tests/regex lib/libcasper/services/cap_dns/tests... Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 17:19:56 -0000 On Fri, Sep 18, 2020 at 12:18 PM Kyle Evans wrote: > > Author: kevans > Date: Fri Sep 18 17:17:46 2020 > New Revision: 365887 > URL: https://svnweb.freebsd.org/changeset/base/365887 > > Log: > build: provide a default WARNS for all in-tree builds > > The current default is provided in various Makefile.inc in some top-level > directories and covers a good portion of the tree, but doesn't cover parts > of the build a little deeper (e.g. libcasper). > > Provide a default in src.sys.mk and set WARNS to it in bsd.sys.mk if that > variable is defined. This lets us relatively cleanly provide a default WARNS > no matter where you're building in the src tree without breaking things > outside of the tree. > > Crunchgen has been updated as a bootstrap tool to work on this change > because it needs r365605 at a minimum to succeed. The cleanup necessary to > successfully walk over this change on WITHOUT_CLEAN builds has been added. > > There is a supplemental project to this to list all of the warnings that are > encountered when the environment has WARNS=6 NO_WERROR=yes: > https://warns.kevans.dev -- this project will hopefully eventually go away > in favor of CI doing a much better job than it. > > Reviewed by: emaste, brooks, ngie (all earlier version) > Reviewed by: emaste, arichardson (depend-cleanup.sh change) > Differential Revision: https://reviews.freebsd.org/D26455 > *sigh* Differential Revision: https://reviews.freebsd.org/D26397 D26455 was just the depend-cleanup part. From owner-svn-src-all@freebsd.org Fri Sep 18 18:35:19 2020 Return-Path: Delivered-To: svn-src-all@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 27F383E99C6; Fri, 18 Sep 2020 18:35:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BtMvq00xgz3dsm; Fri, 18 Sep 2020 18:35:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D757F1F5B6; Fri, 18 Sep 2020 18:35:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08IIZIhk097016; Fri, 18 Sep 2020 18:35:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08IIZINR097015; Fri, 18 Sep 2020 18:35:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009181835.08IIZINR097015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 18 Sep 2020 18:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365888 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Commit-Revision: 365888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 18:35:19 -0000 Author: emaste Date: Fri Sep 18 18:35:18 2020 New Revision: 365888 URL: https://svnweb.freebsd.org/changeset/base/365888 Log: ys/contrib/dev/ath: remove unintentional double semicolon Approved by: adrian Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Fri Sep 18 17:17:46 2020 (r365887) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Fri Sep 18 18:35:18 2020 (r365888) @@ -3879,7 +3879,7 @@ ar9300_init_cal_internal(struct ath_hal *ah, struct ie cl_tab_reg = BB_cl_tab_b[ch_idx]; for (j = 0; j < BB_cl_tab_entry; j++) { OS_REG_WRITE(ah, cl_tab_reg, ichan->tx_clcal[ch_idx][j]); - cl_tab_reg += 4;; + cl_tab_reg += 4; } } HALDEBUG(ah, HAL_DEBUG_FCS_RTT, From owner-svn-src-all@freebsd.org Fri Sep 18 19:03:35 2020 Return-Path: Delivered-To: svn-src-all@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 385AA3EC44F; Fri, 18 Sep 2020 19:03:35 +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 4BtNXR0kCPz3yfD; Fri, 18 Sep 2020 19:03:35 +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 F00231FB9A; Fri, 18 Sep 2020 19:03:34 +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 08IJ3YPf014959; Fri, 18 Sep 2020 19:03:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08IJ3YTM014958; Fri, 18 Sep 2020 19:03:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009181903.08IJ3YTM014958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 18 Sep 2020 19:03:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365889 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 365889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 19:03:35 -0000 Author: markj Date: Fri Sep 18 19:03:34 2020 New Revision: 365889 URL: https://svnweb.freebsd.org/changeset/base/365889 Log: Install library symlinks atomically. As we do for shared library binaries, pass -S to install(1) when installing symlinks. Doing so helps avoid transient failures when libraries are being reinstalled, which seems to be the root cause of spurious libgcc_s.so link failures during CI builds. PR: 233769 Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26453 Modified: head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Fri Sep 18 18:35:18 2020 (r365888) +++ head/share/mk/bsd.lib.mk Fri Sep 18 19:03:34 2020 (r365889) @@ -403,6 +403,7 @@ SHLINSTALLFLAGS+= -fschg # that are only creating an image. .if !defined(NO_SAFE_LIBINSTALL) && !defined(NO_ROOT) SHLINSTALLFLAGS+= -S +SHLINSTALLSYMLINKFLAGS+= -S .endif _INSTALLFLAGS:= ${INSTALLFLAGS} @@ -410,6 +411,7 @@ _INSTALLFLAGS:= ${INSTALLFLAGS} _INSTALLFLAGS:= ${_INSTALLFLAGS${ie}} .endfor _SHLINSTALLFLAGS:= ${SHLINSTALLFLAGS} +_SHLINSTALLSYMLINKFLAGS:= ${SHLINSTALLSYMLINKFLAGS} .for ie in ${INSTALLFLAGS_EDIT} _SHLINSTALLFLAGS:= ${_SHLINSTALLFLAGS${ie}} .endfor @@ -444,29 +446,31 @@ _libinstall: ${_INSTALLFLAGS} ${SHLIB_LINK:R}.ld \ ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .for _SHLIB_LINK_LINK in ${SHLIB_LDSCRIPT_LINKS} - ${INSTALL_LIBSYMLINK} ${TAG_ARGS} ${SHLIB_LINK} ${DESTDIR}${_LIBDIR}/${_SHLIB_LINK_LINK} + ${INSTALL_LIBSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS} ${SHLIB_LINK} \ + ${DESTDIR}${_LIBDIR}/${_SHLIB_LINK_LINK} .endfor .else .if ${_SHLIBDIR} == ${_LIBDIR} .if ${SHLIB_LINK:Mlib*} - ${INSTALL_RSYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} + ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS:D${TAG_ARGS},dev} \ + ${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .else - ${INSTALL_RSYMLINK} ${TAG_ARGS} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \ + ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \ ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .endif .else .if ${SHLIB_LINK:Mlib*} - ${INSTALL_RSYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \ - ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} + ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS:D${TAG_ARGS},dev} \ + ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .else - ${INSTALL_RSYMLINK} ${TAG_ARGS} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \ - ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} + ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS} \ + ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .endif .if exists(${DESTDIR}${_LIBDIR}/${SHLIB_NAME}) -chflags noschg ${DESTDIR}${_LIBDIR}/${SHLIB_NAME} rm -f ${DESTDIR}${_LIBDIR}/${SHLIB_NAME} .endif -.endif +.endif # _SHLIBDIR == _LIBDIR .endif # SHLIB_LDSCRIPT .endif # SHLIB_LINK .endif # SHIB_NAME From owner-svn-src-all@freebsd.org Fri Sep 18 19:27:34 2020 Return-Path: Delivered-To: svn-src-all@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 0FBAE3ED429 for ; Fri, 18 Sep 2020 19:27:34 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound5a.ore.mailhop.org (outbound5a.ore.mailhop.org [44.233.67.66]) (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 4BtP454CTVz41Hy for ; Fri, 18 Sep 2020 19:27:33 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1600457246; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=sXAq0eLWlbH6cyoVt5RpAwtqpKhwdUhtwhSseOG5Gxe8lk9vHrxns+s2Y3nztf6pXW8LwXeHlPNBA xuFZUaTb2rDthRN60UAAPnPf7/Ebr11mlIVov6yq8gNaKZgiicsxgzJTIqXdlArl6TeNa9LSbtumLZ HQKLYPGUTB+3wWOVgrhZiELhQiV9ZZmzsofOCpxgLUwVmaN9DzY3GXzOXkJlR7eUIni51vl1E1lkyJ nwPSVbBR60lgEVf4HllSMFgge2I4Rj3CjW9CuL2rC4QycSE3z36gSy0fx+Ddc+oJA0AG9VaL0gB6q0 BENj+FVfGkrWTwMCSKtqJPQpoFpulag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=gwA2/SBgABAoPPbFav5xyN0+maQFrKqpKi+k5Yet0i0=; b=orppzD4JU3c5kkiU+rBmWZxY7yUuyj5CEzfV5io2w09qyfZVJ+SremTHaVDLiU1eRft3rWbK+jZ+f AuhdFL2/LpdwnhJsSCnqd0vOSkuW6wmV3nlm3gjNt3kTU6Ycph25B9AMLzYmcuR5OjgGwlxXUzi0xE sXoeAcQzGFqzLtUdAwUL0zjNeJ2Vcvc1EsgxMqtcJhwXi9b2TueuvvyBuBw0ncfOmeMTeK+6RHA9uj 5EbjGWYcTeVzXnrzxocqs/7pHCanynlnwz6RAmYSzBOY9EkSrq7yhQIseRX2Srx47xtryeqlqK/Pig NwuLynnXLAq3Sj1PdscMSOFKNqDL7AA== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=gwA2/SBgABAoPPbFav5xyN0+maQFrKqpKi+k5Yet0i0=; b=xExCjj+oIxnSY7MLG1Lf/AfBDh82woC4FzKLDPiQeaF8xybREth2g3m/RomkUZOcRMEoGuuUZY4qr 2aX4m3r6artc6relPrvRfTb5vL8STMvhZxyiZolw11WcsE+Qei6eJYRd97DX5XWaVQinyXmxhPwRCQ QweOkwkidIpUZwJ6b3yxuuB5Ua7Ydr0jNFhaNO7WEQ6PoFkHuPiXR25UDtD0OUTqcUb9/dekOoH2dV wPzreJl1zb4ED6nmDYnHhf7spuZlOzOWh+MYFiVBzCXW2QXFMWt1nV7NFaznyFpTEAfmx/b7waN08S FQor9NC6GIL3rm+yG4ibQsyFRcdxPjA== X-MHO-RoutePath: aGlwcGll X-MHO-User: fa5cbe89-f9e4-11ea-8b38-614106969e8d X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id fa5cbe89-f9e4-11ea-8b38-614106969e8d; Fri, 18 Sep 2020 19:27:24 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 08IJRN16010696; Fri, 18 Sep 2020 13:27:23 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <311b50c504a5dc1e54a1442aa4f759b14f263b67.camel@freebsd.org> Subject: Re: svn commit: r365889 - head/share/mk From: Ian Lepore To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 18 Sep 2020 13:27:23 -0600 In-Reply-To: <202009181903.08IJ3YTM014958@repo.freebsd.org> References: <202009181903.08IJ3YTM014958@repo.freebsd.org> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BtP454CTVz41Hy X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:16509, ipnet:44.224.0.0/11, country:US]; local_wl_from(0.00)[freebsd.org] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 19:27:34 -0000 On Fri, 2020-09-18 at 19:03 +0000, Mark Johnston wrote: > Author: markj > Date: Fri Sep 18 19:03:34 2020 > New Revision: 365889 > URL: https://svnweb.freebsd.org/changeset/base/365889 > > Log: > Install library symlinks atomically. > > As we do for shared library binaries, pass -S to install(1) when > installing symlinks. Doing so helps avoid transient failures when > libraries are being reinstalled, which seems to be the root cause > of > spurious libgcc_s.so link failures during CI builds. > Actually, I believe this will just paper over the real problem, which is the fact that we're building and installing the same library multiple times during early build steps. Nobody has yet been able to explain why we do that, and I haven't been able to figure out why by analyzing any differences in the generated files, but I'm not done trying. -- Ian From owner-svn-src-all@freebsd.org Fri Sep 18 19:44:08 2020 Return-Path: Delivered-To: svn-src-all@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 0160A3EDBCA; Fri, 18 Sep 2020 19:44:08 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) (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 4BtPRC6FzNz427b; Fri, 18 Sep 2020 19:44:07 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x744.google.com with SMTP id 16so7539282qkf.4; Fri, 18 Sep 2020 12:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=FfBJ1UYcCPImIYu2EwcB4YKcdpvNwZU9bCmIicqtJ7M=; b=Nvmx+lB6VpUUCE2CCYx6r8gCwt11xv8HhzqXHLMMjhvFQ89k+cCwq4m9RaBxYsxrWg yNfYzHl0tHNu+DCVAfF4JJsGlE6tOTQNWz96ag7eacTLSLznCvGgRn2XHOZrFlmwpmOL WuF16xXMDmD8B6w8tneKuY7yAOgx7QzT+utJrl1b9f38yi+al9XwI6Dnzv6eWewfpBRR p36aXdisfhn0a37WlKpymU/IfT47zBcnToeuLZemwbnilqokQ7rFNvUQa+0lCsWGiqNF sqUF622TEsx22TAnLuTQ/taWkcmSDDqfLAt8M3HgsDAPheHaU8e4L7RzdMdKBPIE7xr+ 7NGw== 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=FfBJ1UYcCPImIYu2EwcB4YKcdpvNwZU9bCmIicqtJ7M=; b=gvpUrfjo2Gfr0x23MHfRrEpfFOaESM7q6+dbZft5dm2fKdqgJ3cEwQ8eQnUxhIXYT7 dVSPIc+5RdthyhzLazIOKxIH9tuLA0tTLHg9Whk+KGItSQ9BGqi0D709RqmSbfMWlH6r gNFbuT3ghiq93gs6wkucxx0xHawuIaUwrkpFNXiqsvIbYJtex6kP7VaHlAJ608IiWPBM ei/4NFGCzeUakzn4Hz+oITx9C0iHe7naTah9004Fnwup8aYgRCXHwWoEXer+JsceaRzH D+qpshFc0bk+8fnx8s9hMjHS1QqcPpA/4lxyfAK/12lGNSxSaeNVZ1fDHnnnLxBRwcpv 93GQ== X-Gm-Message-State: AOAM531ZZan/M3p3NxjWXQkBxLpOeWJmiBLWN66eosUUk8e7wBnp69yq T19aIb1RZrcyo1JaJCEEX92sBZesOmRd0A== X-Google-Smtp-Source: ABdhPJy9ibBtDSg4mv/A1vcL3OvYnSE7e84DTsezQX3VXqV/ZHkc2a2LF3znbs6MBCWxQoGCeU2DhA== X-Received: by 2002:a37:9c86:: with SMTP id f128mr35247724qke.30.1600458246410; Fri, 18 Sep 2020 12:44:06 -0700 (PDT) Received: from raichu (bras-vprn-toroon0560w-lp130-18-184-148-120-111.dsl.bell.ca. [184.148.120.111]) by smtp.gmail.com with ESMTPSA id o28sm2912739qtl.62.2020.09.18.12.44.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Sep 2020 12:44:05 -0700 (PDT) Sender: Mark Johnston Date: Fri, 18 Sep 2020 15:44:00 -0400 From: Mark Johnston To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r365889 - head/share/mk Message-ID: <20200918194400.GA36442@raichu> References: <202009181903.08IJ3YTM014958@repo.freebsd.org> <311b50c504a5dc1e54a1442aa4f759b14f263b67.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <311b50c504a5dc1e54a1442aa4f759b14f263b67.camel@freebsd.org> X-Rspamd-Queue-Id: 4BtPRC6FzNz427b X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 19:44:08 -0000 On Fri, Sep 18, 2020 at 01:27:23PM -0600, Ian Lepore wrote: > On Fri, 2020-09-18 at 19:03 +0000, Mark Johnston wrote: > > Author: markj > > Date: Fri Sep 18 19:03:34 2020 > > New Revision: 365889 > > URL: https://svnweb.freebsd.org/changeset/base/365889 > > > > Log: > > Install library symlinks atomically. > > > > As we do for shared library binaries, pass -S to install(1) when > > installing symlinks. Doing so helps avoid transient failures when > > libraries are being reinstalled, which seems to be the root cause > > of > > spurious libgcc_s.so link failures during CI builds. > > > > Actually, I believe this will just paper over the real problem, which > is the fact that we're building and installing the same library > multiple times during early build steps. Nobody has yet been able to > explain why we do that, and I haven't been able to figure out why by > analyzing any differences in the generated files, but I'm not done > trying. Sorry, this deserved more commentary in the commit log. Indeed, we install libgcc_s.so multiple times during buildworld. As far as I can see, it's intentional insofar as libgcc_s.so is listed in multiple library targets: it's in both _prereq_libs and _startup_libs in Makefile.inc1. In particular, from scanning the log from a recent instance of the failure, libgcc_s gets built once but installed multiple times. Why that's the case, or whether it's still necessary, is not clear to me. But adding -S seemed like a desirable change in general, so I went forward with it. From owner-svn-src-all@freebsd.org Fri Sep 18 20:10:19 2020 Return-Path: Delivered-To: svn-src-all@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 4E8A13EE60B for ; Fri, 18 Sep 2020 20:10:19 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound5a.ore.mailhop.org (outbound5a.ore.mailhop.org [44.233.67.66]) (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 4BtQ1R040cz43Vy for ; Fri, 18 Sep 2020 20:10:18 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1600459817; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=YeI5a3D0dG4jgmJSCBRn4iaCILCw7QF4Hi9iHaHFINqEHkygR7pX1CqDbN3OPgC5eOabBuPBCPROC /uaXk/p14RArCXnqoZyyiLjPIPaH4FNyRO4/pPvg2ed598nQ4dRN38axqfwpbiBk4Lk9NnUolDGYyK HqD325tUk6WtUh4Ye8gIdkUiGDnHHomsqO6MemhrLTd7dwnUyG1lW57BINb533Q/Lv6S6Ufp3gPWtk EeWJt33LBS+ek05Rr7ln+NZalKnrya6S35ueih6dCal/5c27kT+0KvwvX6btB+EQrrubApuPgOOPl9 0suqGaXAGFcpTb9wvz8qalITBUA+fgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=8ITYyr0BCkwdLVa7hCXe1Sa42eI1xUHhRNf6ganYN8M=; b=Vw4VLqOMMDKE9PIyoNDA7GIPgwWH2Pg4znfhRVs/WJ1W7QV45TwINbud9ESRo7reUyWXQsrmwOG1J bz+Fyx+kpxthSDyXFBOI1N51E86H4/QDQyJDvn1JeLvEp8jSaOUT9DaTZgtnPowQgwCqj5UHyKzzqC je4on92Foo5X4nx56Pd+Ov8QbxjUvSkOH/KwcC4/hxX1LajQ5dGQP5dSNfamqu33awC511bImCTiei 8cEdE7mTOXg+H8OspNy6S2VP6Z5qZ/rn93jXIB3RRAU5FpGT1fmx6AZi1+nzPiUT/zA+Ti/9JAzKud armMIAdUf2RQlIx+/AsH9CsuPpwUPGA== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=8ITYyr0BCkwdLVa7hCXe1Sa42eI1xUHhRNf6ganYN8M=; b=VebIIDyWNPiIFoaiIheZsGYf6kLOKmT33SkjajFeihuW/+/AZakYsHnXGo66lKBgDg1ARw4o8tO19 k96A1LCnUkipGWt+BPdrPANLO0l46EOZjYVJmJXxWOWKnR6Anz3kIJfyvd1PmMIvLGFwlHfbNXc/Op svMBgwD61l43e8yy7ZBqpGYd+ZfkhmyYxkarb1+YSiPX74N4wOhaHGdA36pJhaPQUrcN4029ksdEIl TlLqOYVv99pu9vrAGevBL6bVDjKKJBZK93BL8mchOdyVlJgj66Gtbtjr3l/r5SUTtd6PcW2H0wLIdX abKc2wzHpYrPqey31HT75cOx8PUPz2w== X-MHO-RoutePath: aGlwcGll X-MHO-User: f67c6819-f9ea-11ea-8b38-614106969e8d X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id f67c6819-f9ea-11ea-8b38-614106969e8d; Fri, 18 Sep 2020 20:10:15 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 08IKAD8Y010822; Fri, 18 Sep 2020 14:10:14 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <3a0ce4f32721320bd04e400cfda05f2383d46220.camel@freebsd.org> Subject: Re: svn commit: r365889 - head/share/mk From: Ian Lepore To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, kan@freebsd.org Date: Fri, 18 Sep 2020 14:10:13 -0600 In-Reply-To: <20200918194400.GA36442@raichu> References: <202009181903.08IJ3YTM014958@repo.freebsd.org> <311b50c504a5dc1e54a1442aa4f759b14f263b67.camel@freebsd.org> <20200918194400.GA36442@raichu> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BtQ1R040cz43Vy X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:16509, ipnet:44.224.0.0/11, country:US]; local_wl_from(0.00)[freebsd.org] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 20:10:19 -0000 On Fri, 2020-09-18 at 15:44 -0400, Mark Johnston wrote: > On Fri, Sep 18, 2020 at 01:27:23PM -0600, Ian Lepore wrote: > > On Fri, 2020-09-18 at 19:03 +0000, Mark Johnston wrote: > > > Author: markj > > > Date: Fri Sep 18 19:03:34 2020 > > > New Revision: 365889 > > > URL: https://svnweb.freebsd.org/changeset/base/365889 > > > > > > Log: > > > Install library symlinks atomically. > > > > > > As we do for shared library binaries, pass -S to install(1) when > > > installing symlinks. Doing so helps avoid transient failures when > > > libraries are being reinstalled, which seems to be the root cause > > > of > > > spurious libgcc_s.so link failures during CI builds. > > > > > > > Actually, I believe this will just paper over the real problem, which > > is the fact that we're building and installing the same library > > multiple times during early build steps. Nobody has yet been able to > > explain why we do that, and I haven't been able to figure out why by > > analyzing any differences in the generated files, but I'm not done > > trying. > > Sorry, this deserved more commentary in the commit log. > > Indeed, we install libgcc_s.so multiple times during buildworld. As far > as I can see, it's intentional insofar as libgcc_s.so is listed in > multiple library targets: it's in both _prereq_libs and _startup_libs in > Makefile.inc1. In particular, from scanning the log from a recent > instance of the failure, libgcc_s gets built once but installed multiple > times. > > Why that's the case, or whether it's still necessary, is not clear to > me. But adding -S seemed like a desirable change in general, so I went > forward with it. Yeah, it has been listed in both prereq and startup list since it was first added by kan@ in 2007 or so. I wonder if he remembers why (added to cc list)? -- Ian From owner-svn-src-all@freebsd.org Fri Sep 18 20:53:41 2020 Return-Path: Delivered-To: svn-src-all@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 453E43EF56F; Fri, 18 Sep 2020 20:53:41 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BtQzT14F3z45fS; Fri, 18 Sep 2020 20:53:41 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08FD820F6F; Fri, 18 Sep 2020 20:53:41 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08IKreFM082562; Fri, 18 Sep 2020 20:53:40 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08IKrem9082561; Fri, 18 Sep 2020 20:53:40 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <202009182053.08IKrem9082561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 18 Sep 2020 20:53:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365890 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 365890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 20:53:41 -0000 Author: vangyzen Date: Fri Sep 18 20:53:40 2020 New Revision: 365890 URL: https://svnweb.freebsd.org/changeset/base/365890 Log: amd64 pmap_pkru_same: prev_ppr was always NULL Fix the logic so it works as it appears. Reported by: Coverity Reviewed by: kib MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: D26211 (in progress, so omitting full URL) Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Sep 18 19:03:34 2020 (r365889) +++ head/sys/amd64/amd64/pmap.c Fri Sep 18 20:53:40 2020 (r365890) @@ -10788,9 +10788,11 @@ pmap_pkru_same(pmap_t pmap, vm_offset_t sva, vm_offset sva >= VM_MAXUSER_ADDRESS) return (true); MPASS(eva <= VM_MAXUSER_ADDRESS); - for (va = sva, prev_ppr = NULL; va < eva;) { + for (va = sva; va < eva; prev_ppr = ppr) { ppr = rangeset_lookup(&pmap->pm_pkru, va); - if ((ppr == NULL) ^ (prev_ppr == NULL)) + if (va == sva) + prev_ppr = ppr; + else if ((ppr == NULL) ^ (prev_ppr == NULL)) return (false); if (ppr == NULL) { va += PAGE_SIZE; From owner-svn-src-all@freebsd.org Fri Sep 18 21:23:36 2020 Return-Path: Delivered-To: svn-src-all@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 0E4D53F04A7; Fri, 18 Sep 2020 21:23:36 +0000 (UTC) (envelope-from markjdb@gmail.com) 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 4BtRdz6WKTz488d; Fri, 18 Sep 2020 21:23:35 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x835.google.com with SMTP id n18so6392404qtw.0; Fri, 18 Sep 2020 14:23:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ET8GrRfRE+NFYL1TiQ2Hx55/C+2d2lVJHYXdWpyop1c=; b=N/BMHhIOYJ4itINkz6zWR2kxxGUL/q7AdSEivhSD+JREKij8Zfl/Nu2VhnIeV0L4IW Kp5/LmkY11oD2Fy0qO/dudkL5uoRHnPOhm5b4Wl2yW+l2qPeVteqI++XfaNNKppILXMx +X2rr8SWDvcJFOZtJ+EhT6XxsHlEowJQ1DBfSKsDbABSjOhUr2ywB0qalN1C9Ouq8ChS 0aba2RAr1xq0F+z55ulK5Q+Ew/na14SmbOV4GYJX/aEBKVDoeGKHn/fNYGHeR+aM1jZn iy1hyjVVGpdjNPh8pI+7GkbII1/Y+Afql9zzp8r+3tsQRZ0LGCmynrzbQ+oDfJRot44C juCA== 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=ET8GrRfRE+NFYL1TiQ2Hx55/C+2d2lVJHYXdWpyop1c=; b=bY4xJnWMkZhmL4AuJfC9hgQTzZhhcE3FMGvUbIhwnUR44WKSZL/R94dtXlmD9ss3j4 20SwRHhEHzIxFFS1Pu4zZM+2qVxc5NfWsN23YX9Z9ARypvMT7imZFMdpxaR4jokklvn7 Wz5EhD78XkujhCuhrDnm6qwTUtYQ6IrVGNZACkJvR8EdM8iedAS66imzakTKH/NRpqZW y8XqYc5znxHBCeoULVsGpB631liUy0HDwy4/0dTyVYtCbG/m2Ll9Qhg0uq+aAWkYR4YH fzptLGnPSbS+Lk6Kp11MXigWKwA6eMb99IGWPwRJxF/w7SvrnQBquWobIvxthlAWpnuO Hf5A== X-Gm-Message-State: AOAM532ny2nfI5EAhLN7lWKWY2MXimrM+XosEgkHHM2jKr4KDw4fGccp L4ZRTrCoY1BzNtmah2X1dBUFBS/tr+Ku7A== X-Google-Smtp-Source: ABdhPJzc+ASKxP6Y+mKdXhXiEA9T8i90i7YyXEuEc2c4x6x2rEEjWIYVvhQyjJYHhn8/4vb/hmh+bg== X-Received: by 2002:ac8:6f21:: with SMTP id i1mr33499074qtv.89.1600464214780; Fri, 18 Sep 2020 14:23:34 -0700 (PDT) Received: from raichu (bras-vprn-toroon0560w-lp130-18-184-148-120-111.dsl.bell.ca. [184.148.120.111]) by smtp.gmail.com with ESMTPSA id g18sm2850135qtu.69.2020.09.18.14.23.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Sep 2020 14:23:34 -0700 (PDT) Sender: Mark Johnston Date: Fri, 18 Sep 2020 17:23:32 -0400 From: Mark Johnston To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, kan@freebsd.org Subject: Re: svn commit: r365889 - head/share/mk Message-ID: <20200918212332.GB36442@raichu> References: <202009181903.08IJ3YTM014958@repo.freebsd.org> <311b50c504a5dc1e54a1442aa4f759b14f263b67.camel@freebsd.org> <20200918194400.GA36442@raichu> <3a0ce4f32721320bd04e400cfda05f2383d46220.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3a0ce4f32721320bd04e400cfda05f2383d46220.camel@freebsd.org> X-Rspamd-Queue-Id: 4BtRdz6WKTz488d X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 21:23:36 -0000 On Fri, Sep 18, 2020 at 02:10:13PM -0600, Ian Lepore wrote: > On Fri, 2020-09-18 at 15:44 -0400, Mark Johnston wrote: > > On Fri, Sep 18, 2020 at 01:27:23PM -0600, Ian Lepore wrote: > > > On Fri, 2020-09-18 at 19:03 +0000, Mark Johnston wrote: > > > > Author: markj > > > > Date: Fri Sep 18 19:03:34 2020 > > > > New Revision: 365889 > > > > URL: https://svnweb.freebsd.org/changeset/base/365889 > > > > > > > > Log: > > > > Install library symlinks atomically. > > > > > > > > As we do for shared library binaries, pass -S to install(1) when > > > > installing symlinks. Doing so helps avoid transient failures when > > > > libraries are being reinstalled, which seems to be the root cause > > > > of > > > > spurious libgcc_s.so link failures during CI builds. > > > > > > > > > > Actually, I believe this will just paper over the real problem, which > > > is the fact that we're building and installing the same library > > > multiple times during early build steps. Nobody has yet been able to > > > explain why we do that, and I haven't been able to figure out why by > > > analyzing any differences in the generated files, but I'm not done > > > trying. > > > > Sorry, this deserved more commentary in the commit log. > > > > Indeed, we install libgcc_s.so multiple times during buildworld. As far > > as I can see, it's intentional insofar as libgcc_s.so is listed in > > multiple library targets: it's in both _prereq_libs and _startup_libs in > > Makefile.inc1. In particular, from scanning the log from a recent > > instance of the failure, libgcc_s gets built once but installed multiple > > times. > > > > Why that's the case, or whether it's still necessary, is not clear to > > me. But adding -S seemed like a desirable change in general, so I went > > forward with it. > > Yeah, it has been listed in both prereq and startup list since it was > first added by kan@ in 2007 or so. I wonder if he remembers why (added > to cc list)? Digging a bit deeper, _prereq_libs are built with -DNO_PIC. For lib/libgcc_s this actually does nothing: libgcc_s/Makefile does not define LIB so no static library gets built. The problem seems to be that libgcc_s gets built+installed for _startup_libs and then again as part of _generic_libs. Again, the constituent object files only get built once, but the library binary and symlink get installed multiple times into the worldtmp dir. libc.so is not a symlink and was already getting installed with -S, so despite also getting installed to worldtmp multiple times it does not cause similar build failures. So it seems that: - libgcc_s can be dropped from _prereq_libs. - _generic_libs revisits libraries that were built during earlier stages of the libraries target, i.e., the problem is not specific to libgcc_s. From owner-svn-src-all@freebsd.org Fri Sep 18 22:24:52 2020 Return-Path: Delivered-To: svn-src-all@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 492BC3F1E02; Fri, 18 Sep 2020 22:24:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BtT0h1FTcz4FBm; Fri, 18 Sep 2020 22:24:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B28F220B6; Fri, 18 Sep 2020 22:24:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08IMOpFB040610; Fri, 18 Sep 2020 22:24:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08IMOpod040609; Fri, 18 Sep 2020 22:24:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009182224.08IMOpod040609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 18 Sep 2020 22:24:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365891 - in stable: 11/usr.sbin/certctl 12/usr.sbin/certctl X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/usr.sbin/certctl 12/usr.sbin/certctl X-SVN-Commit-Revision: 365891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 22:24:52 -0000 Author: kevans Date: Fri Sep 18 22:24:51 2020 New Revision: 365891 URL: https://svnweb.freebsd.org/changeset/base/365891 Log: MFC r365756: certctl: fix unprivileged mode The first issue was lack of quoting around INSTALLFLAGS, which set it incorrectly and produced an error on -M. The second issue was that we weren't actually doing the install in unprivileged mode, making it effectively useless. This was designed to pass through the proper metalog/unpriv flags to install(1), so just let it happen. Modified: stable/11/usr.sbin/certctl/certctl.sh Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.sbin/certctl/certctl.sh Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.sbin/certctl/certctl.sh ============================================================================== --- stable/11/usr.sbin/certctl/certctl.sh Fri Sep 18 20:53:40 2020 (r365890) +++ stable/11/usr.sbin/certctl/certctl.sh Fri Sep 18 22:24:51 2020 (r365891) @@ -129,7 +129,7 @@ do_scan() [ -d "$CPATH" ] || continue echo "Scanning $CPATH for certificates..." for CFILE in $(ls -1 "${CPATH}" | grep -Ee "${FILEPAT}"); do - [ -e "$CPATH/$CFILE" -a $UNPRIV -eq 0 ] || continue + [ -e "$CPATH/$CFILE" ] || continue [ $VERBOSE -gt 0 ] && echo "Reading $CFILE" "$CFUNC" "$CPATH/$CFILE" done @@ -263,7 +263,7 @@ shift $(( $OPTIND - 1 )) : ${METALOG:=${DESTDIR}/METALOG} INSTALLFLAGS= -[ $UNPRIV -eq 1 ] && INSTALLFLAGS=-U -M ${METALOG} -D ${DESTDIR} +[ $UNPRIV -eq 1 ] && INSTALLFLAGS="-U -M ${METALOG} -D ${DESTDIR}" : ${TRUSTPATH:=${DESTDIR}/usr/share/certs/trusted:${DESTDIR}/usr/local/share/certs:${DESTDIR}/usr/local/etc/ssl/certs} : ${BLACKLISTPATH:=${DESTDIR}/usr/share/certs/blacklisted:${DESTDIR}/usr/local/etc/ssl/blacklisted} : ${CERTDESTDIR:=${DESTDIR}/etc/ssl/certs} From owner-svn-src-all@freebsd.org Fri Sep 18 22:24:52 2020 Return-Path: Delivered-To: svn-src-all@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 9F3833F1BA5; Fri, 18 Sep 2020 22:24:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BtT0h3r7Rz4F8P; Fri, 18 Sep 2020 22:24:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68AEC221B8; Fri, 18 Sep 2020 22:24:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08IMOqxL040616; Fri, 18 Sep 2020 22:24:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08IMOqrH040615; Fri, 18 Sep 2020 22:24:52 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009182224.08IMOqrH040615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 18 Sep 2020 22:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365891 - in stable: 11/usr.sbin/certctl 12/usr.sbin/certctl X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/usr.sbin/certctl 12/usr.sbin/certctl X-SVN-Commit-Revision: 365891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 22:24:52 -0000 Author: kevans Date: Fri Sep 18 22:24:51 2020 New Revision: 365891 URL: https://svnweb.freebsd.org/changeset/base/365891 Log: MFC r365756: certctl: fix unprivileged mode The first issue was lack of quoting around INSTALLFLAGS, which set it incorrectly and produced an error on -M. The second issue was that we weren't actually doing the install in unprivileged mode, making it effectively useless. This was designed to pass through the proper metalog/unpriv flags to install(1), so just let it happen. Modified: stable/12/usr.sbin/certctl/certctl.sh Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.sbin/certctl/certctl.sh Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.sbin/certctl/certctl.sh ============================================================================== --- stable/12/usr.sbin/certctl/certctl.sh Fri Sep 18 20:53:40 2020 (r365890) +++ stable/12/usr.sbin/certctl/certctl.sh Fri Sep 18 22:24:51 2020 (r365891) @@ -129,7 +129,7 @@ do_scan() [ -d "$CPATH" ] || continue echo "Scanning $CPATH for certificates..." for CFILE in $(ls -1 "${CPATH}" | grep -Ee "${FILEPAT}"); do - [ -e "$CPATH/$CFILE" -a $UNPRIV -eq 0 ] || continue + [ -e "$CPATH/$CFILE" ] || continue [ $VERBOSE -gt 0 ] && echo "Reading $CFILE" "$CFUNC" "$CPATH/$CFILE" done @@ -263,7 +263,7 @@ shift $(( $OPTIND - 1 )) : ${METALOG:=${DESTDIR}/METALOG} INSTALLFLAGS= -[ $UNPRIV -eq 1 ] && INSTALLFLAGS=-U -M ${METALOG} -D ${DESTDIR} +[ $UNPRIV -eq 1 ] && INSTALLFLAGS="-U -M ${METALOG} -D ${DESTDIR}" : ${TRUSTPATH:=${DESTDIR}/usr/share/certs/trusted:${DESTDIR}/usr/local/share/certs:${DESTDIR}/usr/local/etc/ssl/certs} : ${BLACKLISTPATH:=${DESTDIR}/usr/share/certs/blacklisted:${DESTDIR}/usr/local/etc/ssl/blacklisted} : ${CERTDESTDIR:=${DESTDIR}/etc/ssl/certs} From owner-svn-src-all@freebsd.org Fri Sep 18 22:55:14 2020 Return-Path: Delivered-To: svn-src-all@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 095ED3F2D26; Fri, 18 Sep 2020 22:55:14 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BtTgj6ks7z4Gnv; Fri, 18 Sep 2020 22:55:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAC6122796; Fri, 18 Sep 2020 22:55:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08IMtDLm059032; Fri, 18 Sep 2020 22:55:13 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08IMt5uB058991; Fri, 18 Sep 2020 22:55:05 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202009182255.08IMt5uB058991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 18 Sep 2020 22:55:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r365892 - in vendor-sys/openzfs/dist: . cmd/mount_zfs cmd/zdb cmd/zfs cmd/zgenhostid cmd/zpool config contrib/dracut/90zfs include include/os/freebsd/spl/sys include/os/freebsd/zfs/sys ... X-SVN-Group: vendor-sys X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in vendor-sys/openzfs/dist: . cmd/mount_zfs cmd/zdb cmd/zfs cmd/zgenhostid cmd/zpool config contrib/dracut/90zfs include include/os/freebsd/spl/sys include/os/freebsd/zfs/sys include/os/linux/kernel/l... X-SVN-Commit-Revision: 365892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 22:55:14 -0000 Author: mmacy Date: Fri Sep 18 22:55:05 2020 New Revision: 365892 URL: https://svnweb.freebsd.org/changeset/base/365892 Log: Update openzfs to 2.0.0-rc2-g4ce06f Added: vendor-sys/openzfs/dist/cmd/zgenhostid/.gitignore vendor-sys/openzfs/dist/cmd/zgenhostid/zgenhostid.c (contents, props changed) vendor-sys/openzfs/dist/include/libzfsbootenv.h (contents, props changed) vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_bootenv_os.h (contents, props changed) vendor-sys/openzfs/dist/include/os/linux/zfs/sys/zfs_bootenv_os.h (contents, props changed) vendor-sys/openzfs/dist/include/sys/zfs_bootenv.h (contents, props changed) vendor-sys/openzfs/dist/lib/libzfsbootenv/ vendor-sys/openzfs/dist/lib/libzfsbootenv/.gitignore vendor-sys/openzfs/dist/lib/libzfsbootenv/Makefile.am (contents, props changed) vendor-sys/openzfs/dist/lib/libzfsbootenv/libzfsbootenv.pc.in (contents, props changed) vendor-sys/openzfs/dist/lib/libzfsbootenv/lzbe_device.c (contents, props changed) vendor-sys/openzfs/dist/lib/libzfsbootenv/lzbe_pair.c (contents, props changed) vendor-sys/openzfs/dist/lib/libzfsbootenv/lzbe_util.c (contents, props changed) vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_events/.gitignore vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_events/ereports.c (contents, props changed) vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh Deleted: vendor-sys/openzfs/dist/cmd/zgenhostid/zgenhostid Modified: vendor-sys/openzfs/dist/META vendor-sys/openzfs/dist/cmd/mount_zfs/mount_zfs.c vendor-sys/openzfs/dist/cmd/zdb/zdb.c vendor-sys/openzfs/dist/cmd/zfs/zfs_main.c vendor-sys/openzfs/dist/cmd/zgenhostid/Makefile.am vendor-sys/openzfs/dist/cmd/zpool/zpool_main.c vendor-sys/openzfs/dist/config/deb.am vendor-sys/openzfs/dist/config/find_system_library.m4 vendor-sys/openzfs/dist/config/rpm.am vendor-sys/openzfs/dist/config/zfs-build.m4 vendor-sys/openzfs/dist/configure.ac vendor-sys/openzfs/dist/contrib/dracut/90zfs/module-setup.sh.in vendor-sys/openzfs/dist/contrib/dracut/90zfs/parse-zfs.sh.in vendor-sys/openzfs/dist/include/Makefile.am vendor-sys/openzfs/dist/include/libzfs.h vendor-sys/openzfs/dist/include/libzfs_core.h vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/ccompile.h vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/condvar.h vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/Makefile.am vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_context_os.h vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_vfsops_os.h vendor-sys/openzfs/dist/include/os/linux/kernel/linux/mod_compat.h vendor-sys/openzfs/dist/include/os/linux/spl/sys/condvar.h vendor-sys/openzfs/dist/include/os/linux/zfs/sys/Makefile.am vendor-sys/openzfs/dist/include/sys/Makefile.am vendor-sys/openzfs/dist/include/sys/dsl_synctask.h vendor-sys/openzfs/dist/include/sys/fm/fs/zfs.h vendor-sys/openzfs/dist/include/sys/fm/util.h vendor-sys/openzfs/dist/include/sys/fs/zfs.h vendor-sys/openzfs/dist/include/sys/spa.h vendor-sys/openzfs/dist/include/sys/vdev.h vendor-sys/openzfs/dist/include/sys/vdev_impl.h vendor-sys/openzfs/dist/include/sys/zfs_context.h vendor-sys/openzfs/dist/include/sys/zfs_ioctl.h vendor-sys/openzfs/dist/include/sys/zio.h vendor-sys/openzfs/dist/lib/Makefile.am vendor-sys/openzfs/dist/lib/libefi/rdwr_efi.c vendor-sys/openzfs/dist/lib/libshare/os/linux/nfs.c vendor-sys/openzfs/dist/lib/libspl/include/os/freebsd/sys/stat.h vendor-sys/openzfs/dist/lib/libzfs/libzfs.pc.in vendor-sys/openzfs/dist/lib/libzfs/libzfs_dataset.c vendor-sys/openzfs/dist/lib/libzfs/libzfs_pool.c vendor-sys/openzfs/dist/lib/libzfs/libzfs_sendrecv.c vendor-sys/openzfs/dist/lib/libzfs/libzfs_util.c vendor-sys/openzfs/dist/lib/libzfs/os/linux/libzfs_pool_os.c vendor-sys/openzfs/dist/lib/libzfs_core/libzfs_core.c vendor-sys/openzfs/dist/lib/libzfs_core/libzfs_core.pc.in vendor-sys/openzfs/dist/lib/libzpool/Makefile.am vendor-sys/openzfs/dist/lib/libzutil/Makefile.am vendor-sys/openzfs/dist/man/man5/zfs-module-parameters.5 vendor-sys/openzfs/dist/man/man8/zfs-rename.8 vendor-sys/openzfs/dist/man/man8/zfsprops.8 vendor-sys/openzfs/dist/man/man8/zgenhostid.8 vendor-sys/openzfs/dist/man/man8/zpoolprops.8 vendor-sys/openzfs/dist/module/os/freebsd/zfs/kmod_core.c vendor-sys/openzfs/dist/module/os/freebsd/zfs/sysctl_os.c vendor-sys/openzfs/dist/module/os/freebsd/zfs/vdev_file.c vendor-sys/openzfs/dist/module/os/freebsd/zfs/zfs_file_os.c vendor-sys/openzfs/dist/module/os/freebsd/zfs/zfs_vfsops.c vendor-sys/openzfs/dist/module/os/freebsd/zfs/zfs_vnops.c vendor-sys/openzfs/dist/module/os/freebsd/zfs/zfs_znode.c vendor-sys/openzfs/dist/module/os/linux/spl/spl-condvar.c vendor-sys/openzfs/dist/module/os/linux/zfs/vdev_disk.c vendor-sys/openzfs/dist/module/os/linux/zfs/vdev_file.c vendor-sys/openzfs/dist/module/os/linux/zfs/zfs_acl.c vendor-sys/openzfs/dist/module/os/linux/zfs/zfs_vfsops.c vendor-sys/openzfs/dist/module/os/linux/zfs/zpl_super.c vendor-sys/openzfs/dist/module/os/linux/zfs/zpl_xattr.c vendor-sys/openzfs/dist/module/zcommon/zfs_prop.c vendor-sys/openzfs/dist/module/zfs/arc.c vendor-sys/openzfs/dist/module/zfs/dbuf.c vendor-sys/openzfs/dist/module/zfs/dmu_redact.c vendor-sys/openzfs/dist/module/zfs/dnode.c vendor-sys/openzfs/dist/module/zfs/dsl_scan.c vendor-sys/openzfs/dist/module/zfs/dsl_synctask.c vendor-sys/openzfs/dist/module/zfs/fm.c vendor-sys/openzfs/dist/module/zfs/metaslab.c vendor-sys/openzfs/dist/module/zfs/mmp.c vendor-sys/openzfs/dist/module/zfs/range_tree.c vendor-sys/openzfs/dist/module/zfs/spa.c vendor-sys/openzfs/dist/module/zfs/spa_config.c vendor-sys/openzfs/dist/module/zfs/spa_history.c vendor-sys/openzfs/dist/module/zfs/txg.c vendor-sys/openzfs/dist/module/zfs/vdev.c vendor-sys/openzfs/dist/module/zfs/vdev_indirect.c vendor-sys/openzfs/dist/module/zfs/vdev_initialize.c vendor-sys/openzfs/dist/module/zfs/vdev_label.c vendor-sys/openzfs/dist/module/zfs/vdev_mirror.c vendor-sys/openzfs/dist/module/zfs/vdev_raidz.c vendor-sys/openzfs/dist/module/zfs/vdev_rebuild.c vendor-sys/openzfs/dist/module/zfs/vdev_removal.c vendor-sys/openzfs/dist/module/zfs/vdev_trim.c vendor-sys/openzfs/dist/module/zfs/zfs_fm.c vendor-sys/openzfs/dist/module/zfs/zfs_ioctl.c vendor-sys/openzfs/dist/module/zfs/zio.c vendor-sys/openzfs/dist/module/zfs/zthr.c vendor-sys/openzfs/dist/rpm/generic/zfs.spec.in vendor-sys/openzfs/dist/scripts/zfs-tests.sh vendor-sys/openzfs/dist/tests/runfiles/common.run vendor-sys/openzfs/dist/tests/zfs-tests/cmd/libzfs_input_check/Makefile.am vendor-sys/openzfs/dist/tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c vendor-sys/openzfs/dist/tests/zfs-tests/include/commands.cfg vendor-sys/openzfs/dist/tests/zfs-tests/include/tunables.cfg vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/acl/posix/posix_001_pos.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/acl/posix/posix_002_pos.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/acl/posix/setup.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_add/add-o_ashift.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_add/add_prop_ashift.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_attach/attach-o_ashift.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_021_pos.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_022_pos.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_events/Makefile.am vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_replace/replace-o_ashift.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_replace/replace_prop_ashift.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_ashift.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_user/misc/misc.cfg vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/history/history_002_pos.ksh vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh Modified: vendor-sys/openzfs/dist/META ============================================================================== --- vendor-sys/openzfs/dist/META Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/META Fri Sep 18 22:55:05 2020 (r365892) @@ -2,7 +2,7 @@ Meta: 1 Name: zfs Branch: 1.0 Version: 2.0.0 -Release: rc1 +Release: rc2 Release-Tags: relext License: CDDL Author: OpenZFS Modified: vendor-sys/openzfs/dist/cmd/mount_zfs/mount_zfs.c ============================================================================== --- vendor-sys/openzfs/dist/cmd/mount_zfs/mount_zfs.c Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/cmd/mount_zfs/mount_zfs.c Fri Sep 18 22:55:05 2020 (r365892) @@ -182,6 +182,7 @@ main(int argc, char **argv) int error, c; (void) setlocale(LC_ALL, ""); + (void) setlocale(LC_NUMERIC, "C"); (void) textdomain(TEXT_DOMAIN); opterr = 0; Modified: vendor-sys/openzfs/dist/cmd/zdb/zdb.c ============================================================================== --- vendor-sys/openzfs/dist/cmd/zdb/zdb.c Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/cmd/zdb/zdb.c Fri Sep 18 22:55:05 2020 (r365892) @@ -5340,11 +5340,6 @@ load_unflushed_svr_segs_cb(spa_t *spa, space_map_entry if (txg < metaslab_unflushed_txg(ms)) return (0); - vdev_indirect_mapping_t *vim = vd->vdev_indirect_mapping; - ASSERT(vim != NULL); - if (offset >= vdev_indirect_mapping_max_offset(vim)) - return (0); - if (sme->sme_type == SM_ALLOC) range_tree_add(svr->svr_allocd_segs, offset, size); else @@ -5406,9 +5401,6 @@ zdb_claim_removing(spa_t *spa, zdb_cb_t *zcb) range_tree_t *allocs = range_tree_create(NULL, RANGE_SEG64, NULL, 0, 0); for (uint64_t msi = 0; msi < vd->vdev_ms_count; msi++) { metaslab_t *msp = vd->vdev_ms[msi]; - - if (msp->ms_start >= vdev_indirect_mapping_max_offset(vim)) - break; ASSERT0(range_tree_space(allocs)); if (msp->ms_sm != NULL) Modified: vendor-sys/openzfs/dist/cmd/zfs/zfs_main.c ============================================================================== --- vendor-sys/openzfs/dist/cmd/zfs/zfs_main.c Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/cmd/zfs/zfs_main.c Fri Sep 18 22:55:05 2020 (r365892) @@ -8468,6 +8468,7 @@ main(int argc, char **argv) char **newargv; (void) setlocale(LC_ALL, ""); + (void) setlocale(LC_NUMERIC, "C"); (void) textdomain(TEXT_DOMAIN); opterr = 0; Added: vendor-sys/openzfs/dist/cmd/zgenhostid/.gitignore ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/openzfs/dist/cmd/zgenhostid/.gitignore Fri Sep 18 22:55:05 2020 (r365892) @@ -0,0 +1 @@ +/zgenhostid Modified: vendor-sys/openzfs/dist/cmd/zgenhostid/Makefile.am ============================================================================== --- vendor-sys/openzfs/dist/cmd/zgenhostid/Makefile.am Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/cmd/zgenhostid/Makefile.am Fri Sep 18 22:55:05 2020 (r365892) @@ -1 +1,5 @@ -dist_bin_SCRIPTS = zgenhostid +include $(top_srcdir)/config/Rules.am + +bin_PROGRAMS = zgenhostid + +zgenhostid_SOURCES = zgenhostid.c Added: vendor-sys/openzfs/dist/cmd/zgenhostid/zgenhostid.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/openzfs/dist/cmd/zgenhostid/zgenhostid.c Fri Sep 18 22:55:05 2020 (r365892) @@ -0,0 +1,152 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2020, Georgy Yakovlev. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void usage(void); + +static void +usage(void) +{ + (void) fprintf(stderr, + "usage: zgenhostid [-fh] [-o path] [value]\n\n" + " -f\t\t force hostid file write\n" + " -h\t\t print this usage and exit\n" + " -o \t write hostid to this file\n\n" + "If hostid file is not present, store a hostid in it.\n" + "The optional value must be an 8-digit hex number between" + "1 and 2^32-1.\n" + "If no value is provided, a random one will" + "be generated.\n" + "The value must be unique among your systems.\n"); + exit(EXIT_FAILURE); + /* NOTREACHED */ +} + +int +main(int argc, char **argv) +{ + /* default file path, can be optionally set by user */ + char path[PATH_MAX] = "/etc/hostid"; + /* holds converted user input or lrand48() generated value */ + unsigned long input_i = 0; + + int opt; + int pathlen; + int force_fwrite = 0; + while ((opt = getopt_long(argc, argv, "fo:h?", 0, 0)) != -1) { + switch (opt) { + case 'f': + force_fwrite = 1; + break; + case 'o': + pathlen = snprintf(path, sizeof (path), "%s", optarg); + if (pathlen >= sizeof (path)) { + fprintf(stderr, "%s\n", strerror(EOVERFLOW)); + exit(EXIT_FAILURE); + } else if (pathlen < 1) { + fprintf(stderr, "%s\n", strerror(EINVAL)); + exit(EXIT_FAILURE); + } + break; + case 'h': + case '?': + usage(); + } + } + + char *in_s = argv[optind]; + if (in_s != NULL) { + /* increment pointer by 2 if string is 0x prefixed */ + if (strncasecmp("0x", in_s, 2) == 0) { + in_s += 2; + } + + /* need to be exactly 8 characters */ + const char *hex = "0123456789abcdefABCDEF"; + if (strlen(in_s) != 8 || strspn(in_s, hex) != 8) { + fprintf(stderr, "%s\n", strerror(ERANGE)); + usage(); + } + + input_i = strtoul(in_s, NULL, 16); + if (errno != 0) { + perror("strtoul"); + exit(EXIT_FAILURE); + } + + if (input_i < 0x1 || input_i > UINT32_MAX) { + fprintf(stderr, "%s\n", strerror(ERANGE)); + usage(); + } + } + + struct stat fstat; + if (force_fwrite == 0 && stat(path, &fstat) == 0 && + S_ISREG(fstat.st_mode)) { + fprintf(stderr, "%s: %s\n", path, strerror(EEXIST)); + exit(EXIT_FAILURE); + } + + /* + * generate if not provided by user + * also handle unlikely zero return from lrand48() + */ + while (input_i == 0) { + srand48(getpid() ^ time(NULL)); + input_i = lrand48(); + } + + FILE *fp = fopen(path, "wb"); + if (!fp) { + perror("fopen"); + exit(EXIT_FAILURE); + } + + /* + * we need just 4 bytes in native endianess + * not using sethostid() because it may be missing or just a stub + */ + uint32_t hostid = input_i; + int written = fwrite(&hostid, 1, 4, fp); + if (written != 4) { + perror("fwrite"); + exit(EXIT_FAILURE); + } + + fclose(fp); + exit(EXIT_SUCCESS); +} Modified: vendor-sys/openzfs/dist/cmd/zpool/zpool_main.c ============================================================================== --- vendor-sys/openzfs/dist/cmd/zpool/zpool_main.c Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/cmd/zpool/zpool_main.c Fri Sep 18 22:55:05 2020 (r365892) @@ -2654,6 +2654,13 @@ show_import(nvlist_t *config) errata); break; + case ZPOOL_STATUS_NON_NATIVE_ASHIFT: + printf_color(ANSI_BOLD, gettext("status: ")); + printf_color(ANSI_YELLOW, gettext("One or more devices are " + "configured to use a non-native block size.\n" + "\tExpect reduced performance.\n")); + break; + default: /* * No other status can be seen when importing pools. @@ -10229,6 +10236,7 @@ main(int argc, char **argv) char **newargv; (void) setlocale(LC_ALL, ""); + (void) setlocale(LC_NUMERIC, "C"); (void) textdomain(TEXT_DOMAIN); srand(time(NULL)); Modified: vendor-sys/openzfs/dist/config/deb.am ============================================================================== --- vendor-sys/openzfs/dist/config/deb.am Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/config/deb.am Fri Sep 18 22:55:05 2020 (r365892) @@ -35,7 +35,7 @@ deb-dkms: deb-local rpm-dkms fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1 || exit 1; \ $(RM) $$pkg1 -deb-utils: deb-local rpm-utils +deb-utils: deb-local rpm-utils-initramfs name=${PACKAGE}; \ version=${VERSION}-${RELEASE}; \ arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \ Modified: vendor-sys/openzfs/dist/config/find_system_library.m4 ============================================================================== --- vendor-sys/openzfs/dist/config/find_system_library.m4 Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/config/find_system_library.m4 Fri Sep 18 22:55:05 2020 (r365892) @@ -11,10 +11,12 @@ AC_DEFUN([ZFS_AC_FIND_SYSTEM_LIBRARY], [ _header_found= _library_found= + _pc_found= AS_IF([test -n "$2"], [PKG_CHECK_MODULES([$1], [$2], [ _header_found=1 _library_found=1 + _pc_found=1 ], [:])]) # set _header_found/_library_found if the user passed in CFLAGS/LIBS @@ -82,6 +84,9 @@ AC_DEFUN([ZFS_AC_FIND_SYSTEM_LIBRARY], [ AS_IF([test "x$_header_found" = "x1" && test "x$_library_found" = "x1"], [ AC_SUBST([$1]_CFLAGS) AC_SUBST([$1]_LIBS) + AS_IF([test "x$_pc_found" = "x1"], [ + AC_SUBST([$1]_PC, [$2]) + ]) AC_DEFINE([HAVE_][$1], [1], [Define if you have [$5]]) $7 ],[dnl ELSE Modified: vendor-sys/openzfs/dist/config/rpm.am ============================================================================== --- vendor-sys/openzfs/dist/config/rpm.am Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/config/rpm.am Fri Sep 18 22:55:05 2020 (r365892) @@ -7,7 +7,7 @@ ############################################################################### PHONY += srpm srpms srpm-kmod srpm-dkms srpm-utils -PHONY += rpm rpms rpm-kmod rpm-dkms rpm-utils +PHONY += rpm rpms rpm-kmod rpm-dkms rpm-utils rpm-utils-initramfs PHONY += srpm-common rpm-common rpm-local srpm-kmod srpm-dkms srpm-utils: dist @@ -35,9 +35,21 @@ rpm-dkms: srpm-dkms $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-dkms" \ def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_DKMS}' rpm-common +# The rpm-utils and rpm-utils-initramfs targets are identical except for the +# zfs-initramfs package: rpm-utils never includes it, rpm-utils-initramfs +# includes it if detected at configure time. The zfs-initramfs package does +# not work on any known RPM-based distribution and the resulting RPM is only +# used to create a Debian package. The rpm-utils-initramfs target is not +# intended to be specified by the user directly, it is provided as a +# dependency of the deb-utils target. + rpm-utils: srpm-utils $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \ def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_UTIL}' rpm-common + +rpm-utils-initramfs: srpm-utils + $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \ + def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_UTIL} ${RPM_DEFINE_INITRAMFS}' rpm-common rpm: rpm-kmod rpm-dkms rpm-utils rpms: rpm-kmod rpm-dkms rpm-utils Modified: vendor-sys/openzfs/dist/config/zfs-build.m4 ============================================================================== --- vendor-sys/openzfs/dist/config/zfs-build.m4 Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/config/zfs-build.m4 Fri Sep 18 22:55:05 2020 (r365892) @@ -282,7 +282,6 @@ AC_DEFUN([ZFS_AC_RPM], [ AS_IF([test -n "$udevruledir" ], [ RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_udevruledir $(udevruledir)"' ]) - RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_INITRAMFS)' RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_SYSTEMD)' RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PYZFS)' RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PAM)' @@ -542,13 +541,13 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ AC_MSG_CHECKING([whether initramfs-tools is available]) if test -d /usr/share/initramfs-tools ; then - DEFINE_INITRAMFS='--define "_initramfs 1"' + RPM_DEFINE_INITRAMFS='--define "_initramfs 1"' AC_MSG_RESULT([yes]) else - DEFINE_INITRAMFS='' + RPM_DEFINE_INITRAMFS='' AC_MSG_RESULT([no]) fi - AC_SUBST(DEFINE_INITRAMFS) + AC_SUBST(RPM_DEFINE_INITRAMFS) ]) dnl # Modified: vendor-sys/openzfs/dist/configure.ac ============================================================================== --- vendor-sys/openzfs/dist/configure.ac Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/configure.ac Fri Sep 18 22:55:05 2020 (r365892) @@ -161,6 +161,8 @@ AC_CONFIG_FILES([ lib/libuutil/Makefile lib/libzfs/Makefile lib/libzfs/libzfs.pc + lib/libzfsbootenv/Makefile + lib/libzfsbootenv/libzfsbootenv.pc lib/libzfs_core/Makefile lib/libzfs_core/libzfs_core.pc lib/libzpool/Makefile Modified: vendor-sys/openzfs/dist/contrib/dracut/90zfs/module-setup.sh.in ============================================================================== --- vendor-sys/openzfs/dist/contrib/dracut/90zfs/module-setup.sh.in Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/contrib/dracut/90zfs/module-setup.sh.in Fri Sep 18 22:55:05 2020 (r365892) @@ -5,7 +5,7 @@ check() { [ "${1}" = "-d" ] && return 0 # Verify the zfs tool chain - for tool in "@sbindir@/zpool" "@sbindir@/zfs" "@mounthelperdir@/mount.zfs" ; do + for tool in "@bindir@/zgenhostid" "@sbindir@/zpool" "@sbindir@/zfs" "@mounthelperdir@/mount.zfs" ; do test -x "$tool" || return 1 done # Verify grep exists @@ -38,6 +38,7 @@ install() { inst_rules @udevruledir@/60-zvol.rules dracut_install hostid dracut_install grep + dracut_install @bindir@/zgenhostid dracut_install @sbindir@/zfs dracut_install @sbindir@/zpool # Workaround for zfsonlinux/zfs#4749 by ensuring libgcc_s.so(.1) is included @@ -83,11 +84,7 @@ install() { fi # Synchronize initramfs and system hostid - AA=`hostid | cut -b 1,2` - BB=`hostid | cut -b 3,4` - CC=`hostid | cut -b 5,6` - DD=`hostid | cut -b 7,8` - echo -ne "\\x${DD}\\x${CC}\\x${BB}\\x${AA}" > "${initdir}/etc/hostid" + zgenhostid -o "${initdir}/etc/hostid" "$(hostid)" if dracut_module_included "systemd"; then mkdir -p "${initdir}/$systemdsystemunitdir/zfs-import.target.wants" Modified: vendor-sys/openzfs/dist/contrib/dracut/90zfs/parse-zfs.sh.in ============================================================================== --- vendor-sys/openzfs/dist/contrib/dracut/90zfs/parse-zfs.sh.in Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/contrib/dracut/90zfs/parse-zfs.sh.in Fri Sep 18 22:55:05 2020 (r365892) @@ -6,11 +6,7 @@ spl_hostid=$(getarg spl_hostid=) if [ -n "${spl_hostid}" ] ; then info "ZFS: Using hostid from command line: ${spl_hostid}" - AA=$(echo "${spl_hostid}" | cut -b 1,2) - BB=$(echo "${spl_hostid}" | cut -b 3,4) - CC=$(echo "${spl_hostid}" | cut -b 5,6) - DD=$(echo "${spl_hostid}" | cut -b 7,8) - echo -ne "\\x${DD}\\x${CC}\\x${BB}\\x${AA}" >/etc/hostid + zgenhostid -f "${spl_hostid}" elif [ -f "/etc/hostid" ] ; then info "ZFS: Using hostid from /etc/hostid: $(hostid)" else Modified: vendor-sys/openzfs/dist/include/Makefile.am ============================================================================== --- vendor-sys/openzfs/dist/include/Makefile.am Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/Makefile.am Fri Sep 18 22:55:05 2020 (r365892) @@ -15,6 +15,7 @@ USER_H = \ libuutil.h \ libuutil_impl.h \ libzfs.h \ + libzfsbootenv.h \ libzfs_core.h \ libzfs_impl.h \ libzutil.h \ Modified: vendor-sys/openzfs/dist/include/libzfs.h ============================================================================== --- vendor-sys/openzfs/dist/include/libzfs.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/libzfs.h Fri Sep 18 22:55:05 2020 (r365892) @@ -892,8 +892,8 @@ extern int zpool_in_use(libzfs_handle_t *, int, pool_s * Label manipulation. */ extern int zpool_clear_label(int); -extern int zpool_set_bootenv(zpool_handle_t *, const char *); -extern int zpool_get_bootenv(zpool_handle_t *, char *, size_t, off_t); +extern int zpool_set_bootenv(zpool_handle_t *, const nvlist_t *); +extern int zpool_get_bootenv(zpool_handle_t *, nvlist_t **); /* * Management interfaces for SMB ACL files Modified: vendor-sys/openzfs/dist/include/libzfs_core.h ============================================================================== --- vendor-sys/openzfs/dist/include/libzfs_core.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/libzfs_core.h Fri Sep 18 22:55:05 2020 (r365892) @@ -135,7 +135,7 @@ int lzc_wait(const char *, zpool_wait_activity_t, bool int lzc_wait_tag(const char *, zpool_wait_activity_t, uint64_t, boolean_t *); int lzc_wait_fs(const char *, zfs_wait_activity_t, boolean_t *); -int lzc_set_bootenv(const char *, const char *); +int lzc_set_bootenv(const char *, const nvlist_t *); int lzc_get_bootenv(const char *, nvlist_t **); #ifdef __cplusplus } Added: vendor-sys/openzfs/dist/include/libzfsbootenv.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/openzfs/dist/include/libzfsbootenv.h Fri Sep 18 22:55:05 2020 (r365892) @@ -0,0 +1,41 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2020 Toomas Soome + */ + +#ifndef _LIBZFSBOOTENV_H +#define _LIBZFSBOOTENV_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum lzbe_flags { + lzbe_add, /* add data to existing nvlist */ + lzbe_replace /* replace current nvlist */ +} lzbe_flags_t; + +extern int lzbe_nvlist_get(const char *, const char *, void **); +extern int lzbe_nvlist_set(const char *, const char *, void *); +extern void lzbe_nvlist_free(void *); +extern int lzbe_add_pair(void *, const char *, const char *, void *, size_t); +extern int lzbe_remove_pair(void *, const char *); +extern int lzbe_set_boot_device(const char *, lzbe_flags_t, const char *); +extern int lzbe_get_boot_device(const char *, char **); +extern int lzbe_bootenv_print(const char *, const char *, FILE *); + +#ifdef __cplusplus +} +#endif + +#endif /* _LIBZFSBOOTENV_H */ Modified: vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/ccompile.h ============================================================================== --- vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/ccompile.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/ccompile.h Fri Sep 18 22:55:05 2020 (r365892) @@ -206,8 +206,10 @@ typedef int enum_t; #define __XSI_VISIBLE 1000 #endif #define ARRAY_SIZE(a) (sizeof (a) / sizeof (a[0])) -#define open64 open #define mmap64 mmap +/* Note: this file can be used on linux/macOS when bootstrapping tools. */ +#if defined(__FreeBSD__) +#define open64 open #define pwrite64 pwrite #define ftruncate64 ftruncate #define lseek64 lseek @@ -217,6 +219,7 @@ typedef int enum_t; #define statfs64 statfs #define readdir64 readdir #define dirent64 dirent +#endif #define P2ALIGN(x, align) ((x) & -(align)) #define P2CROSS(x, y, align) (((x) ^ (y)) > (align) - 1) #define P2ROUNDUP(x, align) ((((x) - 1) | ((align) - 1)) + 1) Modified: vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/condvar.h ============================================================================== --- vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/condvar.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/os/freebsd/spl/sys/condvar.h Fri Sep 18 22:55:05 2020 (r365892) @@ -142,8 +142,14 @@ cv_timedwait_sig(kcondvar_t *cvp, kmutex_t *mp, clock_ return (1); } -#define cv_timedwait_io cv_timedwait -#define cv_timedwait_sig_io cv_timedwait_sig +#define cv_timedwait_io cv_timedwait +#define cv_timedwait_idle cv_timedwait +#define cv_timedwait_sig_io cv_timedwait_sig +#define cv_wait_io cv_wait +#define cv_wait_io_sig cv_wait_sig +#define cv_wait_idle cv_wait +#define cv_timedwait_io_hires cv_timedwait_hires +#define cv_timedwait_idle_hires cv_timedwait_hires static inline int cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, hrtime_t res, Modified: vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/Makefile.am ============================================================================== --- vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/Makefile.am Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/Makefile.am Fri Sep 18 22:55:05 2020 (r365892) @@ -2,6 +2,7 @@ KERNEL_H = \ freebsd_crypto.h \ sha2.h \ vdev_os.h \ + zfs_bootenv_os.h \ zfs_context_os.h \ zfs_ctldir.h \ zfs_dir.h \ Added: vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_bootenv_os.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_bootenv_os.h Fri Sep 18 22:55:05 2020 (r365892) @@ -0,0 +1,29 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2020 Toomas Soome + */ + +#ifndef _ZFS_BOOTENV_OS_H +#define _ZFS_BOOTENV_OS_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define BOOTENV_OS BE_FREEBSD_VENDOR + +#ifdef __cplusplus +} +#endif + +#endif /* _ZFS_BOOTENV_OS_H */ Modified: vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_context_os.h ============================================================================== --- vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_context_os.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_context_os.h Fri Sep 18 22:55:05 2020 (r365892) @@ -41,9 +41,6 @@ #include #include -#define cv_wait_io(cv, mp) cv_wait(cv, mp) -#define cv_wait_io_sig(cv, mp) cv_wait_sig(cv, mp) - #define cond_resched() kern_yield(PRI_USER) #define taskq_create_sysdc(a, b, d, e, p, dc, f) \ @@ -75,7 +72,7 @@ extern struct mtx zfs_debug_mtx; } \ } while (0) -#define MSEC_TO_TICK(msec) ((msec) / (MILLISEC / hz)) +#define MSEC_TO_TICK(msec) (howmany((hrtime_t)(msec) * hz, MILLISEC)) extern int hz; extern int tick; typedef int fstrans_cookie_t; @@ -84,7 +81,6 @@ typedef int fstrans_cookie_t; #define signal_pending(x) SIGPENDING(x) #define current curthread #define thread_join(x) -#define cv_wait_io(cv, mp) cv_wait(cv, mp) typedef struct opensolaris_utsname utsname_t; extern utsname_t *utsname(void); extern int spa_import_rootpool(const char *name, bool checkpointrewind); Modified: vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_vfsops_os.h ============================================================================== --- vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_vfsops_os.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_vfsops_os.h Fri Sep 18 22:55:05 2020 (r365892) @@ -27,18 +27,31 @@ #ifndef _SYS_FS_ZFS_VFSOPS_H #define _SYS_FS_ZFS_VFSOPS_H +#if __FreeBSD_version >= 1300109 +#define TEARDOWN_INACTIVE_RMS +#endif + #include #include #include #include #include #include +#ifdef TEARDOWN_INACTIVE_RMS +#include +#endif #include #ifdef __cplusplus extern "C" { #endif +#ifdef TEARDOWN_INACTIVE_RMS +typedef struct rmslock zfs_teardown_lock_t; +#else +#define zfs_teardown_lock_t krwlock_t +#endif + typedef struct zfsvfs zfsvfs_t; struct znode; @@ -67,7 +80,7 @@ struct zfsvfs { boolean_t z_atime; /* enable atimes mount option */ boolean_t z_unmounted; /* unmounted */ rrmlock_t z_teardown_lock; - krwlock_t z_teardown_inactive_lock; + zfs_teardown_lock_t z_teardown_inactive_lock; list_t z_all_znodes; /* all vnodes in the fs */ uint64_t z_nr_znodes; /* number of znodes in the fs */ kmutex_t z_znodes_lock; /* lock for z_all_znodes */ @@ -97,6 +110,56 @@ struct zfsvfs { kmutex_t z_hold_mtx[ZFS_OBJ_MTX_SZ]; /* znode hold locks */ struct task z_unlinked_drain_task; }; + +#ifdef TEARDOWN_INACTIVE_RMS +#define ZFS_INIT_TEARDOWN_INACTIVE(zfsvfs) \ + rms_init(&(zfsvfs)->z_teardown_inactive_lock, "zfs teardown inactive") + +#define ZFS_DESTROY_TEARDOWN_INACTIVE(zfsvfs) \ + rms_destroy(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_TRYRLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rms_try_rlock(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_RLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rms_rlock(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_RUNLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rms_runlock(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_WLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rms_wlock(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_WUNLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rms_wunlock(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_TEARDOWN_INACTIVE_WLOCKED(zfsvfs) \ + rms_wowned(&(zfsvfs)->z_teardown_inactive_lock) +#else +#define ZFS_INIT_TEARDOWN_INACTIVE(zfsvfs) \ + rw_init(&(zfsvfs)->z_teardown_inactive_lock, NULL, RW_DEFAULT, NULL) + +#define ZFS_DESTROY_TEARDOWN_INACTIVE(zfsvfs) \ + rw_destroy(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_TRYRLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rw_tryenter(&(zfsvfs)->z_teardown_inactive_lock, RW_READER) + +#define ZFS_RLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rw_enter(&(zfsvfs)->z_teardown_inactive_lock, RW_READER) + +#define ZFS_RUNLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rw_exit(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_WLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rw_enter(&(zfsvfs)->z_teardown_inactive_lock, RW_WRITER) + +#define ZFS_WUNLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rw_exit(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_TEARDOWN_INACTIVE_WLOCKED(zfsvfs) \ + RW_WRITE_HELD(&(zfsvfs)->z_teardown_inactive_lock) +#endif #define ZSB_XATTR 0x0001 /* Enable user xattrs */ /* Modified: vendor-sys/openzfs/dist/include/os/linux/kernel/linux/mod_compat.h ============================================================================== --- vendor-sys/openzfs/dist/include/os/linux/kernel/linux/mod_compat.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/os/linux/kernel/linux/mod_compat.h Fri Sep 18 22:55:05 2020 (r365892) @@ -21,6 +21,7 @@ /* * Copyright (C) 2016 Gvozden Neskovic . + * Copyright (c) 2020 by Delphix. All rights reserved. */ #ifndef _MOD_COMPAT_H @@ -71,6 +72,7 @@ enum scope_prefix_types { zfs_txg, zfs_vdev, zfs_vdev_cache, + zfs_vdev_file, zfs_vdev_mirror, zfs_zevent, zfs_zio, Modified: vendor-sys/openzfs/dist/include/os/linux/spl/sys/condvar.h ============================================================================== --- vendor-sys/openzfs/dist/include/os/linux/spl/sys/condvar.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/os/linux/spl/sys/condvar.h Fri Sep 18 22:55:05 2020 (r365892) @@ -80,15 +80,19 @@ extern void __cv_init(kcondvar_t *, char *, kcv_type_t extern void __cv_destroy(kcondvar_t *); extern void __cv_wait(kcondvar_t *, kmutex_t *); extern void __cv_wait_io(kcondvar_t *, kmutex_t *); +extern void __cv_wait_idle(kcondvar_t *, kmutex_t *); extern int __cv_wait_io_sig(kcondvar_t *, kmutex_t *); extern int __cv_wait_sig(kcondvar_t *, kmutex_t *); extern int __cv_timedwait(kcondvar_t *, kmutex_t *, clock_t); extern int __cv_timedwait_io(kcondvar_t *, kmutex_t *, clock_t); extern int __cv_timedwait_sig(kcondvar_t *, kmutex_t *, clock_t); +extern int __cv_timedwait_idle(kcondvar_t *, kmutex_t *, clock_t); extern int cv_timedwait_hires(kcondvar_t *, kmutex_t *, hrtime_t, hrtime_t res, int flag); extern int cv_timedwait_sig_hires(kcondvar_t *, kmutex_t *, hrtime_t, hrtime_t res, int flag); +extern int cv_timedwait_idle_hires(kcondvar_t *, kmutex_t *, hrtime_t, + hrtime_t res, int flag); extern void __cv_signal(kcondvar_t *); extern void __cv_broadcast(kcondvar_t *c); @@ -96,6 +100,7 @@ extern void __cv_broadcast(kcondvar_t *c); #define cv_destroy(cvp) __cv_destroy(cvp) #define cv_wait(cvp, mp) __cv_wait(cvp, mp) #define cv_wait_io(cvp, mp) __cv_wait_io(cvp, mp) +#define cv_wait_idle(cvp, mp) __cv_wait_idle(cvp, mp) #define cv_wait_io_sig(cvp, mp) __cv_wait_io_sig(cvp, mp) #define cv_wait_sig(cvp, mp) __cv_wait_sig(cvp, mp) #define cv_signal(cvp) __cv_signal(cvp) @@ -109,5 +114,7 @@ extern void __cv_broadcast(kcondvar_t *c); #define cv_timedwait(cvp, mp, t) __cv_timedwait(cvp, mp, t) #define cv_timedwait_io(cvp, mp, t) __cv_timedwait_io(cvp, mp, t) #define cv_timedwait_sig(cvp, mp, t) __cv_timedwait_sig(cvp, mp, t) +#define cv_timedwait_idle(cvp, mp, t) __cv_timedwait_idle(cvp, mp, t) + #endif /* _SPL_CONDVAR_H */ Modified: vendor-sys/openzfs/dist/include/os/linux/zfs/sys/Makefile.am ============================================================================== --- vendor-sys/openzfs/dist/include/os/linux/zfs/sys/Makefile.am Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/os/linux/zfs/sys/Makefile.am Fri Sep 18 22:55:05 2020 (r365892) @@ -16,6 +16,7 @@ KERNEL_H = \ trace_zil.h \ trace_zio.h \ trace_zrlock.h \ + zfs_bootenv_os.h \ zfs_context_os.h \ zfs_ctldir.h \ zfs_dir.h \ Added: vendor-sys/openzfs/dist/include/os/linux/zfs/sys/zfs_bootenv_os.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/openzfs/dist/include/os/linux/zfs/sys/zfs_bootenv_os.h Fri Sep 18 22:55:05 2020 (r365892) @@ -0,0 +1,29 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2020 Toomas Soome + */ + +#ifndef _ZFS_BOOTENV_OS_H +#define _ZFS_BOOTENV_OS_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define BOOTENV_OS BE_LINUX_VENDOR + +#ifdef __cplusplus +} +#endif + +#endif /* _ZFS_BOOTENV_OS_H */ Modified: vendor-sys/openzfs/dist/include/sys/Makefile.am ============================================================================== --- vendor-sys/openzfs/dist/include/sys/Makefile.am Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/sys/Makefile.am Fri Sep 18 22:55:05 2020 (r365892) @@ -102,6 +102,7 @@ COMMON_H = \ zcp_set.h \ zfeature.h \ zfs_acl.h \ + zfs_bootenv.h \ zfs_context.h \ zfs_debug.h \ zfs_delay.h \ Modified: vendor-sys/openzfs/dist/include/sys/dsl_synctask.h ============================================================================== --- vendor-sys/openzfs/dist/include/sys/dsl_synctask.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/sys/dsl_synctask.h Fri Sep 18 22:55:05 2020 (r365892) @@ -112,11 +112,11 @@ void dsl_sync_task_sync(dsl_sync_task_t *, dmu_tx_t *) int dsl_sync_task(const char *, dsl_checkfunc_t *, dsl_syncfunc_t *, void *, int, zfs_space_check_t); void dsl_sync_task_nowait(struct dsl_pool *, dsl_syncfunc_t *, - void *, int, zfs_space_check_t, dmu_tx_t *); + void *, dmu_tx_t *); int dsl_early_sync_task(const char *, dsl_checkfunc_t *, dsl_syncfunc_t *, void *, int, zfs_space_check_t); void dsl_early_sync_task_nowait(struct dsl_pool *, dsl_syncfunc_t *, - void *, int, zfs_space_check_t, dmu_tx_t *); + void *, dmu_tx_t *); int dsl_sync_task_sig(const char *, dsl_checkfunc_t *, dsl_syncfunc_t *, dsl_sigfunc_t *, void *, int, zfs_space_check_t); Modified: vendor-sys/openzfs/dist/include/sys/fm/fs/zfs.h ============================================================================== --- vendor-sys/openzfs/dist/include/sys/fm/fs/zfs.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/sys/fm/fs/zfs.h Fri Sep 18 22:55:05 2020 (r365892) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2020 by Delphix. All rights reserved. + */ + #ifndef _SYS_FM_FS_ZFS_H #define _SYS_FM_FS_ZFS_H @@ -88,6 +92,7 @@ extern "C" { #define FM_EREPORT_PAYLOAD_ZFS_ZIO_SIZE "zio_size" #define FM_EREPORT_PAYLOAD_ZFS_ZIO_FLAGS "zio_flags" #define FM_EREPORT_PAYLOAD_ZFS_ZIO_STAGE "zio_stage" +#define FM_EREPORT_PAYLOAD_ZFS_ZIO_PRIORITY "zio_priority" #define FM_EREPORT_PAYLOAD_ZFS_ZIO_PIPELINE "zio_pipeline" #define FM_EREPORT_PAYLOAD_ZFS_ZIO_DELAY "zio_delay" #define FM_EREPORT_PAYLOAD_ZFS_ZIO_TIMESTAMP "zio_timestamp" Modified: vendor-sys/openzfs/dist/include/sys/fm/util.h ============================================================================== --- vendor-sys/openzfs/dist/include/sys/fm/util.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/sys/fm/util.h Fri Sep 18 22:55:05 2020 (r365892) @@ -104,6 +104,9 @@ extern int zfs_zevent_seek(zfs_zevent_t *, uint64_t); extern void zfs_zevent_init(zfs_zevent_t **); extern void zfs_zevent_destroy(zfs_zevent_t *); +extern void zfs_zevent_track_duplicate(void); +extern void zfs_ereport_init(void); +extern void zfs_ereport_fini(void); #else static inline void fm_init(void) { } Modified: vendor-sys/openzfs/dist/include/sys/fs/zfs.h ============================================================================== --- vendor-sys/openzfs/dist/include/sys/fs/zfs.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/sys/fs/zfs.h Fri Sep 18 22:55:05 2020 (r365892) @@ -1336,8 +1336,8 @@ typedef enum zfs_ioc { ZFS_IOC_NEXTBOOT, /* 0x84 (FreeBSD) */ ZFS_IOC_JAIL, /* 0x85 (FreeBSD) */ ZFS_IOC_UNJAIL, /* 0x86 (FreeBSD) */ - ZFS_IOC_SET_BOOTENV, /* 0x87 (Linux) */ - ZFS_IOC_GET_BOOTENV, /* 0x88 (Linux) */ + ZFS_IOC_SET_BOOTENV, /* 0x87 */ + ZFS_IOC_GET_BOOTENV, /* 0x88 */ ZFS_IOC_LAST } zfs_ioc_t; Modified: vendor-sys/openzfs/dist/include/sys/spa.h ============================================================================== --- vendor-sys/openzfs/dist/include/sys/spa.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/sys/spa.h Fri Sep 18 22:55:05 2020 (r365892) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2019 by Delphix. All rights reserved. + * Copyright (c) 2011, 2020 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. @@ -1145,10 +1145,10 @@ extern const char *spa_state_to_name(spa_t *spa); struct zbookmark_phys; extern void spa_log_error(spa_t *spa, const zbookmark_phys_t *zb); extern int zfs_ereport_post(const char *clazz, spa_t *spa, vdev_t *vd, - const zbookmark_phys_t *zb, zio_t *zio, uint64_t stateoroffset, - uint64_t length); + const zbookmark_phys_t *zb, zio_t *zio, uint64_t state); extern boolean_t zfs_ereport_is_valid(const char *clazz, spa_t *spa, vdev_t *vd, zio_t *zio); +extern void zfs_ereport_taskq_fini(void); extern nvlist_t *zfs_event_create(spa_t *spa, vdev_t *vd, const char *type, const char *name, nvlist_t *aux); extern void zfs_post_remove(spa_t *spa, vdev_t *vd); Modified: vendor-sys/openzfs/dist/include/sys/vdev.h ============================================================================== --- vendor-sys/openzfs/dist/include/sys/vdev.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/sys/vdev.h Fri Sep 18 22:55:05 2020 (r365892) @@ -94,7 +94,6 @@ extern void vdev_rele(vdev_t *); extern int vdev_metaslab_init(vdev_t *vd, uint64_t txg); extern void vdev_metaslab_fini(vdev_t *vd); extern void vdev_metaslab_set_size(vdev_t *); -extern void vdev_ashift_optimize(vdev_t *); extern void vdev_expand(vdev_t *vd, uint64_t txg); extern void vdev_split(vdev_t *vd); extern void vdev_deadman(vdev_t *vd, char *tag); @@ -181,7 +180,7 @@ extern void vdev_config_generate_stats(vdev_t *vd, nvl extern void vdev_label_write(zio_t *zio, vdev_t *vd, int l, abd_t *buf, uint64_t offset, uint64_t size, zio_done_func_t *done, void *priv, int flags); extern int vdev_label_read_bootenv(vdev_t *, nvlist_t *); -extern int vdev_label_write_bootenv(vdev_t *, char *); +extern int vdev_label_write_bootenv(vdev_t *, nvlist_t *); typedef enum { VDEV_LABEL_CREATE, /* create/add a new device */ Modified: vendor-sys/openzfs/dist/include/sys/vdev_impl.h ============================================================================== --- vendor-sys/openzfs/dist/include/sys/vdev_impl.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/sys/vdev_impl.h Fri Sep 18 22:55:05 2020 (r365892) @@ -476,7 +476,16 @@ typedef struct vdev_phys { } vdev_phys_t; typedef enum vbe_vers { - /* The bootenv file is stored as ascii text in the envblock */ + /* + * The bootenv file is stored as ascii text in the envblock. + * It is used by the GRUB bootloader used on Linux to store the + * contents of the grubenv file. The file is stored as raw ASCII, + * and is protected by an embedded checksum. By default, GRUB will + * check if the boot filesystem supports storing the environment data + * in a special location, and if so, will invoke filesystem specific + * logic to retrieve it. This can be overriden by a variable, should + * the user so desire. + */ VB_RAW = 0, /* Added: vendor-sys/openzfs/dist/include/sys/zfs_bootenv.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/openzfs/dist/include/sys/zfs_bootenv.h Fri Sep 18 22:55:05 2020 (r365892) @@ -0,0 +1,53 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2020 Toomas Soome + */ + +#ifndef _ZFS_BOOTENV_H +#define _ZFS_BOOTENV_H + +/* + * Define macros for label bootenv nvlist pair keys. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#define BOOTENV_VERSION "version" + +#define BE_ILLUMOS_VENDOR "illumos" +#define BE_FREEBSD_VENDOR "freebsd" +#define BE_GRUB_VENDOR "grub" +#define BE_LINUX_VENDOR "linux" + +#include + +#define GRUB_ENVMAP BE_GRUB_VENDOR ":" "envmap" + +#define FREEBSD_BOOTONCE BE_FREEBSD_VENDOR ":" "bootonce" +#define FREEBSD_BOOTONCE_USED BE_FREEBSD_VENDOR ":" "bootonce-used" +#define FREEBSD_NVSTORE BE_FREEBSD_VENDOR ":" "nvstore" +#define ILLUMOS_BOOTONCE BE_ILLUMOS_VENDOR ":" "bootonce" +#define ILLUMOS_BOOTONCE_USED BE_ILLUMOS_VENDOR ":" "bootonce-used" +#define ILLUMOS_NVSTORE BE_ILLUMOS_VENDOR ":" "nvstore" + +#define OS_BOOTONCE BOOTENV_OS ":" "bootonce" +#define OS_BOOTONCE_USED BOOTENV_OS ":" "bootonce-used" +#define OS_NVSTORE BOOTENV_OS ":" "nvstore" + +#ifdef __cplusplus +} +#endif + +#endif /* _ZFS_BOOTENV_H */ Modified: vendor-sys/openzfs/dist/include/sys/zfs_context.h ============================================================================== --- vendor-sys/openzfs/dist/include/sys/zfs_context.h Fri Sep 18 22:24:51 2020 (r365891) +++ vendor-sys/openzfs/dist/include/sys/zfs_context.h Fri Sep 18 22:55:05 2020 (r365892) @@ -325,11 +325,15 @@ extern void cv_signal(kcondvar_t *cv); extern void cv_broadcast(kcondvar_t *cv); #define cv_timedwait_io(cv, mp, at) cv_timedwait(cv, mp, at) +#define cv_timedwait_idle(cv, mp, at) cv_timedwait(cv, mp, at) #define cv_timedwait_sig(cv, mp, at) cv_timedwait(cv, mp, at) #define cv_wait_io(cv, mp) cv_wait(cv, mp) +#define cv_wait_idle(cv, mp) cv_wait(cv, mp) #define cv_wait_io_sig(cv, mp) cv_wait_sig(cv, mp) #define cv_timedwait_sig_hires(cv, mp, t, r, f) \ cv_timedwait_hires(cv, mp, t, r, f) +#define cv_timedwait_idle_hires(cv, mp, t, r, f) \ + cv_timedwait_hires(cv, mp, t, r, f) /* * Thread-specific data @@ -598,9 +602,9 @@ typedef struct vsecattr { extern void delay(clock_t ticks); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Sep 18 22:59:45 2020 Return-Path: Delivered-To: svn-src-all@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 7ED833F2F4E; Fri, 18 Sep 2020 22:59:45 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BtTmx2nBSz4H9h; Fri, 18 Sep 2020 22:59:45 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 285D722626; Fri, 18 Sep 2020 22:59:45 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08IMxjOX059296; Fri, 18 Sep 2020 22:59:45 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08IMxjLe059295; Fri, 18 Sep 2020 22:59:45 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202009182259.08IMxjLe059295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 18 Sep 2020 22:59:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r365893 - vendor-sys/openzfs/2.0-rc2-g4ce06f X-SVN-Group: vendor-sys X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: vendor-sys/openzfs/2.0-rc2-g4ce06f X-SVN-Commit-Revision: 365893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 22:59:45 -0000 Author: mmacy Date: Fri Sep 18 22:59:44 2020 New Revision: 365893 URL: https://svnweb.freebsd.org/changeset/base/365893 Log: Checkpoint 2.0-rc2-g4ce06f Added: vendor-sys/openzfs/2.0-rc2-g4ce06f/ - copied from r365892, vendor-sys/openzfs/dist/ From owner-svn-src-all@freebsd.org Fri Sep 18 23:21:33 2020 Return-Path: Delivered-To: svn-src-all@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 7D8343F3175; Fri, 18 Sep 2020 23:21:33 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BtVG52cpcz4HtW; Fri, 18 Sep 2020 23:21:33 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DA3022C25; Fri, 18 Sep 2020 23:21:33 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08INLXFM072983; Fri, 18 Sep 2020 23:21:33 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08INLOxW072199; Fri, 18 Sep 2020 23:21:24 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202009182321.08INLOxW072199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 18 Sep 2020 23:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365894 - in head: cddl/lib/libzpool sys/contrib/openzfs sys/contrib/openzfs/cmd/mount_zfs sys/contrib/openzfs/cmd/zdb sys/contrib/openzfs/cmd/zfs sys/contrib/openzfs/cmd/zgenhostid sys... X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head: cddl/lib/libzpool sys/contrib/openzfs sys/contrib/openzfs/cmd/mount_zfs sys/contrib/openzfs/cmd/zdb sys/contrib/openzfs/cmd/zfs sys/contrib/openzfs/cmd/zgenhostid sys/contrib/openzfs/cmd/zpoo... X-SVN-Commit-Revision: 365894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 23:21:33 -0000 Author: mmacy Date: Fri Sep 18 23:21:24 2020 New Revision: 365894 URL: https://svnweb.freebsd.org/changeset/base/365894 Log: MFV 2.0-rc2 - Fixes divide by zero for unusual hz - remove cryptodev dependency Added: head/sys/contrib/openzfs/cmd/zgenhostid/.gitignore - copied unchanged from r365893, vendor-sys/openzfs/dist/cmd/zgenhostid/.gitignore head/sys/contrib/openzfs/cmd/zgenhostid/zgenhostid.c - copied unchanged from r365893, vendor-sys/openzfs/dist/cmd/zgenhostid/zgenhostid.c head/sys/contrib/openzfs/include/libzfsbootenv.h - copied unchanged from r365893, vendor-sys/openzfs/dist/include/libzfsbootenv.h head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_bootenv_os.h - copied unchanged from r365893, vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_bootenv_os.h head/sys/contrib/openzfs/include/os/linux/zfs/sys/zfs_bootenv_os.h - copied unchanged from r365893, vendor-sys/openzfs/dist/include/os/linux/zfs/sys/zfs_bootenv_os.h head/sys/contrib/openzfs/include/sys/zfs_bootenv.h - copied unchanged from r365893, vendor-sys/openzfs/dist/include/sys/zfs_bootenv.h head/sys/contrib/openzfs/lib/libzfsbootenv/ - copied from r365893, vendor-sys/openzfs/dist/lib/libzfsbootenv/ head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_events/.gitignore - copied unchanged from r365893, vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_events/.gitignore head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_events/ereports.c - copied unchanged from r365893, vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_events/ereports.c head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh - copied unchanged from r365893, vendor-sys/openzfs/dist/tests/zfs-tests/tests/functional/cli_root/zpool_events/zpool_events_duplicates.ksh Deleted: head/sys/contrib/openzfs/cmd/zgenhostid/zgenhostid Modified: head/cddl/lib/libzpool/Makefile head/sys/contrib/openzfs/META head/sys/contrib/openzfs/cmd/mount_zfs/mount_zfs.c head/sys/contrib/openzfs/cmd/zdb/zdb.c head/sys/contrib/openzfs/cmd/zfs/zfs_main.c head/sys/contrib/openzfs/cmd/zgenhostid/Makefile.am head/sys/contrib/openzfs/cmd/zpool/zpool_main.c head/sys/contrib/openzfs/config/deb.am head/sys/contrib/openzfs/config/find_system_library.m4 head/sys/contrib/openzfs/config/rpm.am head/sys/contrib/openzfs/config/zfs-build.m4 head/sys/contrib/openzfs/configure.ac head/sys/contrib/openzfs/contrib/dracut/90zfs/module-setup.sh.in head/sys/contrib/openzfs/contrib/dracut/90zfs/parse-zfs.sh.in head/sys/contrib/openzfs/include/Makefile.am head/sys/contrib/openzfs/include/libzfs.h head/sys/contrib/openzfs/include/libzfs_core.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h head/sys/contrib/openzfs/include/os/freebsd/spl/sys/condvar.h head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/Makefile.am head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_context_os.h head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_vfsops_os.h head/sys/contrib/openzfs/include/os/linux/kernel/linux/mod_compat.h head/sys/contrib/openzfs/include/os/linux/spl/sys/condvar.h head/sys/contrib/openzfs/include/os/linux/zfs/sys/Makefile.am head/sys/contrib/openzfs/include/sys/Makefile.am head/sys/contrib/openzfs/include/sys/dsl_synctask.h head/sys/contrib/openzfs/include/sys/fm/fs/zfs.h head/sys/contrib/openzfs/include/sys/fm/util.h head/sys/contrib/openzfs/include/sys/fs/zfs.h head/sys/contrib/openzfs/include/sys/spa.h head/sys/contrib/openzfs/include/sys/vdev.h head/sys/contrib/openzfs/include/sys/vdev_impl.h head/sys/contrib/openzfs/include/sys/zfs_context.h head/sys/contrib/openzfs/include/sys/zfs_ioctl.h head/sys/contrib/openzfs/include/sys/zio.h head/sys/contrib/openzfs/lib/Makefile.am head/sys/contrib/openzfs/lib/libefi/rdwr_efi.c head/sys/contrib/openzfs/lib/libshare/os/linux/nfs.c head/sys/contrib/openzfs/lib/libspl/include/os/freebsd/sys/stat.h head/sys/contrib/openzfs/lib/libzfs/libzfs.pc.in head/sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c head/sys/contrib/openzfs/lib/libzfs/libzfs_pool.c head/sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c head/sys/contrib/openzfs/lib/libzfs/libzfs_util.c head/sys/contrib/openzfs/lib/libzfs/os/linux/libzfs_pool_os.c head/sys/contrib/openzfs/lib/libzfs_core/libzfs_core.c head/sys/contrib/openzfs/lib/libzfs_core/libzfs_core.pc.in head/sys/contrib/openzfs/lib/libzpool/Makefile.am head/sys/contrib/openzfs/lib/libzutil/Makefile.am head/sys/contrib/openzfs/man/man5/zfs-module-parameters.5 head/sys/contrib/openzfs/man/man8/zfs-rename.8 head/sys/contrib/openzfs/man/man8/zfsprops.8 head/sys/contrib/openzfs/man/man8/zgenhostid.8 head/sys/contrib/openzfs/man/man8/zpoolprops.8 head/sys/contrib/openzfs/module/os/freebsd/zfs/kmod_core.c head/sys/contrib/openzfs/module/os/freebsd/zfs/sysctl_os.c head/sys/contrib/openzfs/module/os/freebsd/zfs/vdev_file.c head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_file_os.c head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c head/sys/contrib/openzfs/module/os/linux/spl/spl-condvar.c head/sys/contrib/openzfs/module/os/linux/zfs/vdev_disk.c head/sys/contrib/openzfs/module/os/linux/zfs/vdev_file.c head/sys/contrib/openzfs/module/os/linux/zfs/zfs_acl.c head/sys/contrib/openzfs/module/os/linux/zfs/zfs_vfsops.c head/sys/contrib/openzfs/module/os/linux/zfs/zpl_super.c head/sys/contrib/openzfs/module/os/linux/zfs/zpl_xattr.c head/sys/contrib/openzfs/module/zcommon/zfs_prop.c head/sys/contrib/openzfs/module/zfs/arc.c head/sys/contrib/openzfs/module/zfs/dbuf.c head/sys/contrib/openzfs/module/zfs/dmu_redact.c head/sys/contrib/openzfs/module/zfs/dnode.c head/sys/contrib/openzfs/module/zfs/dsl_scan.c head/sys/contrib/openzfs/module/zfs/dsl_synctask.c head/sys/contrib/openzfs/module/zfs/fm.c head/sys/contrib/openzfs/module/zfs/metaslab.c head/sys/contrib/openzfs/module/zfs/mmp.c head/sys/contrib/openzfs/module/zfs/range_tree.c head/sys/contrib/openzfs/module/zfs/spa.c head/sys/contrib/openzfs/module/zfs/spa_config.c head/sys/contrib/openzfs/module/zfs/spa_history.c head/sys/contrib/openzfs/module/zfs/txg.c head/sys/contrib/openzfs/module/zfs/vdev.c head/sys/contrib/openzfs/module/zfs/vdev_indirect.c head/sys/contrib/openzfs/module/zfs/vdev_initialize.c head/sys/contrib/openzfs/module/zfs/vdev_label.c head/sys/contrib/openzfs/module/zfs/vdev_mirror.c head/sys/contrib/openzfs/module/zfs/vdev_raidz.c head/sys/contrib/openzfs/module/zfs/vdev_rebuild.c head/sys/contrib/openzfs/module/zfs/vdev_removal.c head/sys/contrib/openzfs/module/zfs/vdev_trim.c head/sys/contrib/openzfs/module/zfs/zfs_fm.c head/sys/contrib/openzfs/module/zfs/zfs_ioctl.c head/sys/contrib/openzfs/module/zfs/zio.c head/sys/contrib/openzfs/module/zfs/zthr.c head/sys/contrib/openzfs/rpm/generic/zfs.spec.in head/sys/contrib/openzfs/scripts/zfs-tests.sh head/sys/contrib/openzfs/tests/runfiles/common.run head/sys/contrib/openzfs/tests/zfs-tests/cmd/libzfs_input_check/Makefile.am head/sys/contrib/openzfs/tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c head/sys/contrib/openzfs/tests/zfs-tests/include/commands.cfg head/sys/contrib/openzfs/tests/zfs-tests/include/tunables.cfg head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix/posix_001_pos.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix/posix_002_pos.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/acl/posix/setup.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_add/add-o_ashift.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_add/add_prop_ashift.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_attach/attach-o_ashift.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_021_pos.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_022_pos.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_events/Makefile.am head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_replace/replace-o_ashift.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_replace/replace_prop_ashift.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_set/zpool_set_ashift.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_user/misc/misc.cfg head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/history/history_002_pos.ksh head/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/rsend_012_pos.ksh Directory Properties: head/sys/contrib/openzfs/ (props changed) Modified: head/cddl/lib/libzpool/Makefile ============================================================================== --- head/cddl/lib/libzpool/Makefile Fri Sep 18 22:59:44 2020 (r365893) +++ head/cddl/lib/libzpool/Makefile Fri Sep 18 23:21:24 2020 (r365894) @@ -234,6 +234,7 @@ CFLAGS+= \ -DHAVE_ISSETUGID \ -include ${SRCTOP}/sys/modules/zfs/zfs_config.h \ -I${SRCTOP}/sys/modules/zfs \ + -I${ZFSTOP}/include/os/freebsd/zfs \ -DLIB_ZPOOL_BUILD -DZFS_DEBUG \ # XXX: pthread doesn't have mutex_owned() equivalent, so we need to look Modified: head/sys/contrib/openzfs/META ============================================================================== --- head/sys/contrib/openzfs/META Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/META Fri Sep 18 23:21:24 2020 (r365894) @@ -2,7 +2,7 @@ Meta: 1 Name: zfs Branch: 1.0 Version: 2.0.0 -Release: rc1 +Release: rc2 Release-Tags: relext License: CDDL Author: OpenZFS Modified: head/sys/contrib/openzfs/cmd/mount_zfs/mount_zfs.c ============================================================================== --- head/sys/contrib/openzfs/cmd/mount_zfs/mount_zfs.c Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/cmd/mount_zfs/mount_zfs.c Fri Sep 18 23:21:24 2020 (r365894) @@ -182,6 +182,7 @@ main(int argc, char **argv) int error, c; (void) setlocale(LC_ALL, ""); + (void) setlocale(LC_NUMERIC, "C"); (void) textdomain(TEXT_DOMAIN); opterr = 0; Modified: head/sys/contrib/openzfs/cmd/zdb/zdb.c ============================================================================== --- head/sys/contrib/openzfs/cmd/zdb/zdb.c Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/cmd/zdb/zdb.c Fri Sep 18 23:21:24 2020 (r365894) @@ -5340,11 +5340,6 @@ load_unflushed_svr_segs_cb(spa_t *spa, space_map_entry if (txg < metaslab_unflushed_txg(ms)) return (0); - vdev_indirect_mapping_t *vim = vd->vdev_indirect_mapping; - ASSERT(vim != NULL); - if (offset >= vdev_indirect_mapping_max_offset(vim)) - return (0); - if (sme->sme_type == SM_ALLOC) range_tree_add(svr->svr_allocd_segs, offset, size); else @@ -5406,9 +5401,6 @@ zdb_claim_removing(spa_t *spa, zdb_cb_t *zcb) range_tree_t *allocs = range_tree_create(NULL, RANGE_SEG64, NULL, 0, 0); for (uint64_t msi = 0; msi < vd->vdev_ms_count; msi++) { metaslab_t *msp = vd->vdev_ms[msi]; - - if (msp->ms_start >= vdev_indirect_mapping_max_offset(vim)) - break; ASSERT0(range_tree_space(allocs)); if (msp->ms_sm != NULL) Modified: head/sys/contrib/openzfs/cmd/zfs/zfs_main.c ============================================================================== --- head/sys/contrib/openzfs/cmd/zfs/zfs_main.c Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/cmd/zfs/zfs_main.c Fri Sep 18 23:21:24 2020 (r365894) @@ -8468,6 +8468,7 @@ main(int argc, char **argv) char **newargv; (void) setlocale(LC_ALL, ""); + (void) setlocale(LC_NUMERIC, "C"); (void) textdomain(TEXT_DOMAIN); opterr = 0; Copied: head/sys/contrib/openzfs/cmd/zgenhostid/.gitignore (from r365893, vendor-sys/openzfs/dist/cmd/zgenhostid/.gitignore) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/openzfs/cmd/zgenhostid/.gitignore Fri Sep 18 23:21:24 2020 (r365894, copy of r365893, vendor-sys/openzfs/dist/cmd/zgenhostid/.gitignore) @@ -0,0 +1 @@ +/zgenhostid Modified: head/sys/contrib/openzfs/cmd/zgenhostid/Makefile.am ============================================================================== --- head/sys/contrib/openzfs/cmd/zgenhostid/Makefile.am Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/cmd/zgenhostid/Makefile.am Fri Sep 18 23:21:24 2020 (r365894) @@ -1 +1,5 @@ -dist_bin_SCRIPTS = zgenhostid +include $(top_srcdir)/config/Rules.am + +bin_PROGRAMS = zgenhostid + +zgenhostid_SOURCES = zgenhostid.c Copied: head/sys/contrib/openzfs/cmd/zgenhostid/zgenhostid.c (from r365893, vendor-sys/openzfs/dist/cmd/zgenhostid/zgenhostid.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/openzfs/cmd/zgenhostid/zgenhostid.c Fri Sep 18 23:21:24 2020 (r365894, copy of r365893, vendor-sys/openzfs/dist/cmd/zgenhostid/zgenhostid.c) @@ -0,0 +1,152 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2020, Georgy Yakovlev. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void usage(void); + +static void +usage(void) +{ + (void) fprintf(stderr, + "usage: zgenhostid [-fh] [-o path] [value]\n\n" + " -f\t\t force hostid file write\n" + " -h\t\t print this usage and exit\n" + " -o \t write hostid to this file\n\n" + "If hostid file is not present, store a hostid in it.\n" + "The optional value must be an 8-digit hex number between" + "1 and 2^32-1.\n" + "If no value is provided, a random one will" + "be generated.\n" + "The value must be unique among your systems.\n"); + exit(EXIT_FAILURE); + /* NOTREACHED */ +} + +int +main(int argc, char **argv) +{ + /* default file path, can be optionally set by user */ + char path[PATH_MAX] = "/etc/hostid"; + /* holds converted user input or lrand48() generated value */ + unsigned long input_i = 0; + + int opt; + int pathlen; + int force_fwrite = 0; + while ((opt = getopt_long(argc, argv, "fo:h?", 0, 0)) != -1) { + switch (opt) { + case 'f': + force_fwrite = 1; + break; + case 'o': + pathlen = snprintf(path, sizeof (path), "%s", optarg); + if (pathlen >= sizeof (path)) { + fprintf(stderr, "%s\n", strerror(EOVERFLOW)); + exit(EXIT_FAILURE); + } else if (pathlen < 1) { + fprintf(stderr, "%s\n", strerror(EINVAL)); + exit(EXIT_FAILURE); + } + break; + case 'h': + case '?': + usage(); + } + } + + char *in_s = argv[optind]; + if (in_s != NULL) { + /* increment pointer by 2 if string is 0x prefixed */ + if (strncasecmp("0x", in_s, 2) == 0) { + in_s += 2; + } + + /* need to be exactly 8 characters */ + const char *hex = "0123456789abcdefABCDEF"; + if (strlen(in_s) != 8 || strspn(in_s, hex) != 8) { + fprintf(stderr, "%s\n", strerror(ERANGE)); + usage(); + } + + input_i = strtoul(in_s, NULL, 16); + if (errno != 0) { + perror("strtoul"); + exit(EXIT_FAILURE); + } + + if (input_i < 0x1 || input_i > UINT32_MAX) { + fprintf(stderr, "%s\n", strerror(ERANGE)); + usage(); + } + } + + struct stat fstat; + if (force_fwrite == 0 && stat(path, &fstat) == 0 && + S_ISREG(fstat.st_mode)) { + fprintf(stderr, "%s: %s\n", path, strerror(EEXIST)); + exit(EXIT_FAILURE); + } + + /* + * generate if not provided by user + * also handle unlikely zero return from lrand48() + */ + while (input_i == 0) { + srand48(getpid() ^ time(NULL)); + input_i = lrand48(); + } + + FILE *fp = fopen(path, "wb"); + if (!fp) { + perror("fopen"); + exit(EXIT_FAILURE); + } + + /* + * we need just 4 bytes in native endianess + * not using sethostid() because it may be missing or just a stub + */ + uint32_t hostid = input_i; + int written = fwrite(&hostid, 1, 4, fp); + if (written != 4) { + perror("fwrite"); + exit(EXIT_FAILURE); + } + + fclose(fp); + exit(EXIT_SUCCESS); +} Modified: head/sys/contrib/openzfs/cmd/zpool/zpool_main.c ============================================================================== --- head/sys/contrib/openzfs/cmd/zpool/zpool_main.c Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/cmd/zpool/zpool_main.c Fri Sep 18 23:21:24 2020 (r365894) @@ -2654,6 +2654,13 @@ show_import(nvlist_t *config) errata); break; + case ZPOOL_STATUS_NON_NATIVE_ASHIFT: + printf_color(ANSI_BOLD, gettext("status: ")); + printf_color(ANSI_YELLOW, gettext("One or more devices are " + "configured to use a non-native block size.\n" + "\tExpect reduced performance.\n")); + break; + default: /* * No other status can be seen when importing pools. @@ -10229,6 +10236,7 @@ main(int argc, char **argv) char **newargv; (void) setlocale(LC_ALL, ""); + (void) setlocale(LC_NUMERIC, "C"); (void) textdomain(TEXT_DOMAIN); srand(time(NULL)); Modified: head/sys/contrib/openzfs/config/deb.am ============================================================================== --- head/sys/contrib/openzfs/config/deb.am Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/config/deb.am Fri Sep 18 23:21:24 2020 (r365894) @@ -35,7 +35,7 @@ deb-dkms: deb-local rpm-dkms fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1 || exit 1; \ $(RM) $$pkg1 -deb-utils: deb-local rpm-utils +deb-utils: deb-local rpm-utils-initramfs name=${PACKAGE}; \ version=${VERSION}-${RELEASE}; \ arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \ Modified: head/sys/contrib/openzfs/config/find_system_library.m4 ============================================================================== --- head/sys/contrib/openzfs/config/find_system_library.m4 Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/config/find_system_library.m4 Fri Sep 18 23:21:24 2020 (r365894) @@ -11,10 +11,12 @@ AC_DEFUN([ZFS_AC_FIND_SYSTEM_LIBRARY], [ _header_found= _library_found= + _pc_found= AS_IF([test -n "$2"], [PKG_CHECK_MODULES([$1], [$2], [ _header_found=1 _library_found=1 + _pc_found=1 ], [:])]) # set _header_found/_library_found if the user passed in CFLAGS/LIBS @@ -82,6 +84,9 @@ AC_DEFUN([ZFS_AC_FIND_SYSTEM_LIBRARY], [ AS_IF([test "x$_header_found" = "x1" && test "x$_library_found" = "x1"], [ AC_SUBST([$1]_CFLAGS) AC_SUBST([$1]_LIBS) + AS_IF([test "x$_pc_found" = "x1"], [ + AC_SUBST([$1]_PC, [$2]) + ]) AC_DEFINE([HAVE_][$1], [1], [Define if you have [$5]]) $7 ],[dnl ELSE Modified: head/sys/contrib/openzfs/config/rpm.am ============================================================================== --- head/sys/contrib/openzfs/config/rpm.am Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/config/rpm.am Fri Sep 18 23:21:24 2020 (r365894) @@ -7,7 +7,7 @@ ############################################################################### PHONY += srpm srpms srpm-kmod srpm-dkms srpm-utils -PHONY += rpm rpms rpm-kmod rpm-dkms rpm-utils +PHONY += rpm rpms rpm-kmod rpm-dkms rpm-utils rpm-utils-initramfs PHONY += srpm-common rpm-common rpm-local srpm-kmod srpm-dkms srpm-utils: dist @@ -35,9 +35,21 @@ rpm-dkms: srpm-dkms $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-dkms" \ def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_DKMS}' rpm-common +# The rpm-utils and rpm-utils-initramfs targets are identical except for the +# zfs-initramfs package: rpm-utils never includes it, rpm-utils-initramfs +# includes it if detected at configure time. The zfs-initramfs package does +# not work on any known RPM-based distribution and the resulting RPM is only +# used to create a Debian package. The rpm-utils-initramfs target is not +# intended to be specified by the user directly, it is provided as a +# dependency of the deb-utils target. + rpm-utils: srpm-utils $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \ def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_UTIL}' rpm-common + +rpm-utils-initramfs: srpm-utils + $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \ + def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_UTIL} ${RPM_DEFINE_INITRAMFS}' rpm-common rpm: rpm-kmod rpm-dkms rpm-utils rpms: rpm-kmod rpm-dkms rpm-utils Modified: head/sys/contrib/openzfs/config/zfs-build.m4 ============================================================================== --- head/sys/contrib/openzfs/config/zfs-build.m4 Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/config/zfs-build.m4 Fri Sep 18 23:21:24 2020 (r365894) @@ -282,7 +282,6 @@ AC_DEFUN([ZFS_AC_RPM], [ AS_IF([test -n "$udevruledir" ], [ RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_udevruledir $(udevruledir)"' ]) - RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_INITRAMFS)' RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_SYSTEMD)' RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PYZFS)' RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PAM)' @@ -542,13 +541,13 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ AC_MSG_CHECKING([whether initramfs-tools is available]) if test -d /usr/share/initramfs-tools ; then - DEFINE_INITRAMFS='--define "_initramfs 1"' + RPM_DEFINE_INITRAMFS='--define "_initramfs 1"' AC_MSG_RESULT([yes]) else - DEFINE_INITRAMFS='' + RPM_DEFINE_INITRAMFS='' AC_MSG_RESULT([no]) fi - AC_SUBST(DEFINE_INITRAMFS) + AC_SUBST(RPM_DEFINE_INITRAMFS) ]) dnl # Modified: head/sys/contrib/openzfs/configure.ac ============================================================================== --- head/sys/contrib/openzfs/configure.ac Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/configure.ac Fri Sep 18 23:21:24 2020 (r365894) @@ -161,6 +161,8 @@ AC_CONFIG_FILES([ lib/libuutil/Makefile lib/libzfs/Makefile lib/libzfs/libzfs.pc + lib/libzfsbootenv/Makefile + lib/libzfsbootenv/libzfsbootenv.pc lib/libzfs_core/Makefile lib/libzfs_core/libzfs_core.pc lib/libzpool/Makefile Modified: head/sys/contrib/openzfs/contrib/dracut/90zfs/module-setup.sh.in ============================================================================== --- head/sys/contrib/openzfs/contrib/dracut/90zfs/module-setup.sh.in Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/contrib/dracut/90zfs/module-setup.sh.in Fri Sep 18 23:21:24 2020 (r365894) @@ -5,7 +5,7 @@ check() { [ "${1}" = "-d" ] && return 0 # Verify the zfs tool chain - for tool in "@sbindir@/zpool" "@sbindir@/zfs" "@mounthelperdir@/mount.zfs" ; do + for tool in "@bindir@/zgenhostid" "@sbindir@/zpool" "@sbindir@/zfs" "@mounthelperdir@/mount.zfs" ; do test -x "$tool" || return 1 done # Verify grep exists @@ -38,6 +38,7 @@ install() { inst_rules @udevruledir@/60-zvol.rules dracut_install hostid dracut_install grep + dracut_install @bindir@/zgenhostid dracut_install @sbindir@/zfs dracut_install @sbindir@/zpool # Workaround for zfsonlinux/zfs#4749 by ensuring libgcc_s.so(.1) is included @@ -83,11 +84,7 @@ install() { fi # Synchronize initramfs and system hostid - AA=`hostid | cut -b 1,2` - BB=`hostid | cut -b 3,4` - CC=`hostid | cut -b 5,6` - DD=`hostid | cut -b 7,8` - echo -ne "\\x${DD}\\x${CC}\\x${BB}\\x${AA}" > "${initdir}/etc/hostid" + zgenhostid -o "${initdir}/etc/hostid" "$(hostid)" if dracut_module_included "systemd"; then mkdir -p "${initdir}/$systemdsystemunitdir/zfs-import.target.wants" Modified: head/sys/contrib/openzfs/contrib/dracut/90zfs/parse-zfs.sh.in ============================================================================== --- head/sys/contrib/openzfs/contrib/dracut/90zfs/parse-zfs.sh.in Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/contrib/dracut/90zfs/parse-zfs.sh.in Fri Sep 18 23:21:24 2020 (r365894) @@ -6,11 +6,7 @@ spl_hostid=$(getarg spl_hostid=) if [ -n "${spl_hostid}" ] ; then info "ZFS: Using hostid from command line: ${spl_hostid}" - AA=$(echo "${spl_hostid}" | cut -b 1,2) - BB=$(echo "${spl_hostid}" | cut -b 3,4) - CC=$(echo "${spl_hostid}" | cut -b 5,6) - DD=$(echo "${spl_hostid}" | cut -b 7,8) - echo -ne "\\x${DD}\\x${CC}\\x${BB}\\x${AA}" >/etc/hostid + zgenhostid -f "${spl_hostid}" elif [ -f "/etc/hostid" ] ; then info "ZFS: Using hostid from /etc/hostid: $(hostid)" else Modified: head/sys/contrib/openzfs/include/Makefile.am ============================================================================== --- head/sys/contrib/openzfs/include/Makefile.am Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/include/Makefile.am Fri Sep 18 23:21:24 2020 (r365894) @@ -15,6 +15,7 @@ USER_H = \ libuutil.h \ libuutil_impl.h \ libzfs.h \ + libzfsbootenv.h \ libzfs_core.h \ libzfs_impl.h \ libzutil.h \ Modified: head/sys/contrib/openzfs/include/libzfs.h ============================================================================== --- head/sys/contrib/openzfs/include/libzfs.h Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/include/libzfs.h Fri Sep 18 23:21:24 2020 (r365894) @@ -892,8 +892,8 @@ extern int zpool_in_use(libzfs_handle_t *, int, pool_s * Label manipulation. */ extern int zpool_clear_label(int); -extern int zpool_set_bootenv(zpool_handle_t *, const char *); -extern int zpool_get_bootenv(zpool_handle_t *, char *, size_t, off_t); +extern int zpool_set_bootenv(zpool_handle_t *, const nvlist_t *); +extern int zpool_get_bootenv(zpool_handle_t *, nvlist_t **); /* * Management interfaces for SMB ACL files Modified: head/sys/contrib/openzfs/include/libzfs_core.h ============================================================================== --- head/sys/contrib/openzfs/include/libzfs_core.h Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/include/libzfs_core.h Fri Sep 18 23:21:24 2020 (r365894) @@ -135,7 +135,7 @@ int lzc_wait(const char *, zpool_wait_activity_t, bool int lzc_wait_tag(const char *, zpool_wait_activity_t, uint64_t, boolean_t *); int lzc_wait_fs(const char *, zfs_wait_activity_t, boolean_t *); -int lzc_set_bootenv(const char *, const char *); +int lzc_set_bootenv(const char *, const nvlist_t *); int lzc_get_bootenv(const char *, nvlist_t **); #ifdef __cplusplus } Copied: head/sys/contrib/openzfs/include/libzfsbootenv.h (from r365893, vendor-sys/openzfs/dist/include/libzfsbootenv.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/openzfs/include/libzfsbootenv.h Fri Sep 18 23:21:24 2020 (r365894, copy of r365893, vendor-sys/openzfs/dist/include/libzfsbootenv.h) @@ -0,0 +1,41 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2020 Toomas Soome + */ + +#ifndef _LIBZFSBOOTENV_H +#define _LIBZFSBOOTENV_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum lzbe_flags { + lzbe_add, /* add data to existing nvlist */ + lzbe_replace /* replace current nvlist */ +} lzbe_flags_t; + +extern int lzbe_nvlist_get(const char *, const char *, void **); +extern int lzbe_nvlist_set(const char *, const char *, void *); +extern void lzbe_nvlist_free(void *); +extern int lzbe_add_pair(void *, const char *, const char *, void *, size_t); +extern int lzbe_remove_pair(void *, const char *); +extern int lzbe_set_boot_device(const char *, lzbe_flags_t, const char *); +extern int lzbe_get_boot_device(const char *, char **); +extern int lzbe_bootenv_print(const char *, const char *, FILE *); + +#ifdef __cplusplus +} +#endif + +#endif /* _LIBZFSBOOTENV_H */ Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h Fri Sep 18 23:21:24 2020 (r365894) @@ -206,8 +206,10 @@ typedef int enum_t; #define __XSI_VISIBLE 1000 #endif #define ARRAY_SIZE(a) (sizeof (a) / sizeof (a[0])) -#define open64 open #define mmap64 mmap +/* Note: this file can be used on linux/macOS when bootstrapping tools. */ +#if defined(__FreeBSD__) +#define open64 open #define pwrite64 pwrite #define ftruncate64 ftruncate #define lseek64 lseek @@ -217,6 +219,7 @@ typedef int enum_t; #define statfs64 statfs #define readdir64 readdir #define dirent64 dirent +#endif #define P2ALIGN(x, align) ((x) & -(align)) #define P2CROSS(x, y, align) (((x) ^ (y)) > (align) - 1) #define P2ROUNDUP(x, align) ((((x) - 1) | ((align) - 1)) + 1) Modified: head/sys/contrib/openzfs/include/os/freebsd/spl/sys/condvar.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/spl/sys/condvar.h Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/include/os/freebsd/spl/sys/condvar.h Fri Sep 18 23:21:24 2020 (r365894) @@ -142,8 +142,14 @@ cv_timedwait_sig(kcondvar_t *cvp, kmutex_t *mp, clock_ return (1); } -#define cv_timedwait_io cv_timedwait -#define cv_timedwait_sig_io cv_timedwait_sig +#define cv_timedwait_io cv_timedwait +#define cv_timedwait_idle cv_timedwait +#define cv_timedwait_sig_io cv_timedwait_sig +#define cv_wait_io cv_wait +#define cv_wait_io_sig cv_wait_sig +#define cv_wait_idle cv_wait +#define cv_timedwait_io_hires cv_timedwait_hires +#define cv_timedwait_idle_hires cv_timedwait_hires static inline int cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, hrtime_t res, Modified: head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/Makefile.am ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/Makefile.am Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/Makefile.am Fri Sep 18 23:21:24 2020 (r365894) @@ -2,6 +2,7 @@ KERNEL_H = \ freebsd_crypto.h \ sha2.h \ vdev_os.h \ + zfs_bootenv_os.h \ zfs_context_os.h \ zfs_ctldir.h \ zfs_dir.h \ Copied: head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_bootenv_os.h (from r365893, vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_bootenv_os.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_bootenv_os.h Fri Sep 18 23:21:24 2020 (r365894, copy of r365893, vendor-sys/openzfs/dist/include/os/freebsd/zfs/sys/zfs_bootenv_os.h) @@ -0,0 +1,29 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2020 Toomas Soome + */ + +#ifndef _ZFS_BOOTENV_OS_H +#define _ZFS_BOOTENV_OS_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define BOOTENV_OS BE_FREEBSD_VENDOR + +#ifdef __cplusplus +} +#endif + +#endif /* _ZFS_BOOTENV_OS_H */ Modified: head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_context_os.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_context_os.h Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_context_os.h Fri Sep 18 23:21:24 2020 (r365894) @@ -41,9 +41,6 @@ #include #include -#define cv_wait_io(cv, mp) cv_wait(cv, mp) -#define cv_wait_io_sig(cv, mp) cv_wait_sig(cv, mp) - #define cond_resched() kern_yield(PRI_USER) #define taskq_create_sysdc(a, b, d, e, p, dc, f) \ @@ -75,7 +72,7 @@ extern struct mtx zfs_debug_mtx; } \ } while (0) -#define MSEC_TO_TICK(msec) ((msec) / (MILLISEC / hz)) +#define MSEC_TO_TICK(msec) (howmany((hrtime_t)(msec) * hz, MILLISEC)) extern int hz; extern int tick; typedef int fstrans_cookie_t; @@ -84,7 +81,6 @@ typedef int fstrans_cookie_t; #define signal_pending(x) SIGPENDING(x) #define current curthread #define thread_join(x) -#define cv_wait_io(cv, mp) cv_wait(cv, mp) typedef struct opensolaris_utsname utsname_t; extern utsname_t *utsname(void); extern int spa_import_rootpool(const char *name, bool checkpointrewind); Modified: head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_vfsops_os.h ============================================================================== --- head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_vfsops_os.h Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_vfsops_os.h Fri Sep 18 23:21:24 2020 (r365894) @@ -27,18 +27,31 @@ #ifndef _SYS_FS_ZFS_VFSOPS_H #define _SYS_FS_ZFS_VFSOPS_H +#if __FreeBSD_version >= 1300109 +#define TEARDOWN_INACTIVE_RMS +#endif + #include #include #include #include #include #include +#ifdef TEARDOWN_INACTIVE_RMS +#include +#endif #include #ifdef __cplusplus extern "C" { #endif +#ifdef TEARDOWN_INACTIVE_RMS +typedef struct rmslock zfs_teardown_lock_t; +#else +#define zfs_teardown_lock_t krwlock_t +#endif + typedef struct zfsvfs zfsvfs_t; struct znode; @@ -67,7 +80,7 @@ struct zfsvfs { boolean_t z_atime; /* enable atimes mount option */ boolean_t z_unmounted; /* unmounted */ rrmlock_t z_teardown_lock; - krwlock_t z_teardown_inactive_lock; + zfs_teardown_lock_t z_teardown_inactive_lock; list_t z_all_znodes; /* all vnodes in the fs */ uint64_t z_nr_znodes; /* number of znodes in the fs */ kmutex_t z_znodes_lock; /* lock for z_all_znodes */ @@ -97,6 +110,56 @@ struct zfsvfs { kmutex_t z_hold_mtx[ZFS_OBJ_MTX_SZ]; /* znode hold locks */ struct task z_unlinked_drain_task; }; + +#ifdef TEARDOWN_INACTIVE_RMS +#define ZFS_INIT_TEARDOWN_INACTIVE(zfsvfs) \ + rms_init(&(zfsvfs)->z_teardown_inactive_lock, "zfs teardown inactive") + +#define ZFS_DESTROY_TEARDOWN_INACTIVE(zfsvfs) \ + rms_destroy(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_TRYRLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rms_try_rlock(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_RLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rms_rlock(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_RUNLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rms_runlock(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_WLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rms_wlock(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_WUNLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rms_wunlock(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_TEARDOWN_INACTIVE_WLOCKED(zfsvfs) \ + rms_wowned(&(zfsvfs)->z_teardown_inactive_lock) +#else +#define ZFS_INIT_TEARDOWN_INACTIVE(zfsvfs) \ + rw_init(&(zfsvfs)->z_teardown_inactive_lock, NULL, RW_DEFAULT, NULL) + +#define ZFS_DESTROY_TEARDOWN_INACTIVE(zfsvfs) \ + rw_destroy(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_TRYRLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rw_tryenter(&(zfsvfs)->z_teardown_inactive_lock, RW_READER) + +#define ZFS_RLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rw_enter(&(zfsvfs)->z_teardown_inactive_lock, RW_READER) + +#define ZFS_RUNLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rw_exit(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_WLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rw_enter(&(zfsvfs)->z_teardown_inactive_lock, RW_WRITER) + +#define ZFS_WUNLOCK_TEARDOWN_INACTIVE(zfsvfs) \ + rw_exit(&(zfsvfs)->z_teardown_inactive_lock) + +#define ZFS_TEARDOWN_INACTIVE_WLOCKED(zfsvfs) \ + RW_WRITE_HELD(&(zfsvfs)->z_teardown_inactive_lock) +#endif #define ZSB_XATTR 0x0001 /* Enable user xattrs */ /* Modified: head/sys/contrib/openzfs/include/os/linux/kernel/linux/mod_compat.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/kernel/linux/mod_compat.h Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/include/os/linux/kernel/linux/mod_compat.h Fri Sep 18 23:21:24 2020 (r365894) @@ -21,6 +21,7 @@ /* * Copyright (C) 2016 Gvozden Neskovic . + * Copyright (c) 2020 by Delphix. All rights reserved. */ #ifndef _MOD_COMPAT_H @@ -71,6 +72,7 @@ enum scope_prefix_types { zfs_txg, zfs_vdev, zfs_vdev_cache, + zfs_vdev_file, zfs_vdev_mirror, zfs_zevent, zfs_zio, Modified: head/sys/contrib/openzfs/include/os/linux/spl/sys/condvar.h ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/spl/sys/condvar.h Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/include/os/linux/spl/sys/condvar.h Fri Sep 18 23:21:24 2020 (r365894) @@ -80,15 +80,19 @@ extern void __cv_init(kcondvar_t *, char *, kcv_type_t extern void __cv_destroy(kcondvar_t *); extern void __cv_wait(kcondvar_t *, kmutex_t *); extern void __cv_wait_io(kcondvar_t *, kmutex_t *); +extern void __cv_wait_idle(kcondvar_t *, kmutex_t *); extern int __cv_wait_io_sig(kcondvar_t *, kmutex_t *); extern int __cv_wait_sig(kcondvar_t *, kmutex_t *); extern int __cv_timedwait(kcondvar_t *, kmutex_t *, clock_t); extern int __cv_timedwait_io(kcondvar_t *, kmutex_t *, clock_t); extern int __cv_timedwait_sig(kcondvar_t *, kmutex_t *, clock_t); +extern int __cv_timedwait_idle(kcondvar_t *, kmutex_t *, clock_t); extern int cv_timedwait_hires(kcondvar_t *, kmutex_t *, hrtime_t, hrtime_t res, int flag); extern int cv_timedwait_sig_hires(kcondvar_t *, kmutex_t *, hrtime_t, hrtime_t res, int flag); +extern int cv_timedwait_idle_hires(kcondvar_t *, kmutex_t *, hrtime_t, + hrtime_t res, int flag); extern void __cv_signal(kcondvar_t *); extern void __cv_broadcast(kcondvar_t *c); @@ -96,6 +100,7 @@ extern void __cv_broadcast(kcondvar_t *c); #define cv_destroy(cvp) __cv_destroy(cvp) #define cv_wait(cvp, mp) __cv_wait(cvp, mp) #define cv_wait_io(cvp, mp) __cv_wait_io(cvp, mp) +#define cv_wait_idle(cvp, mp) __cv_wait_idle(cvp, mp) #define cv_wait_io_sig(cvp, mp) __cv_wait_io_sig(cvp, mp) #define cv_wait_sig(cvp, mp) __cv_wait_sig(cvp, mp) #define cv_signal(cvp) __cv_signal(cvp) @@ -109,5 +114,7 @@ extern void __cv_broadcast(kcondvar_t *c); #define cv_timedwait(cvp, mp, t) __cv_timedwait(cvp, mp, t) #define cv_timedwait_io(cvp, mp, t) __cv_timedwait_io(cvp, mp, t) #define cv_timedwait_sig(cvp, mp, t) __cv_timedwait_sig(cvp, mp, t) +#define cv_timedwait_idle(cvp, mp, t) __cv_timedwait_idle(cvp, mp, t) + #endif /* _SPL_CONDVAR_H */ Modified: head/sys/contrib/openzfs/include/os/linux/zfs/sys/Makefile.am ============================================================================== --- head/sys/contrib/openzfs/include/os/linux/zfs/sys/Makefile.am Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/include/os/linux/zfs/sys/Makefile.am Fri Sep 18 23:21:24 2020 (r365894) @@ -16,6 +16,7 @@ KERNEL_H = \ trace_zil.h \ trace_zio.h \ trace_zrlock.h \ + zfs_bootenv_os.h \ zfs_context_os.h \ zfs_ctldir.h \ zfs_dir.h \ Copied: head/sys/contrib/openzfs/include/os/linux/zfs/sys/zfs_bootenv_os.h (from r365893, vendor-sys/openzfs/dist/include/os/linux/zfs/sys/zfs_bootenv_os.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/openzfs/include/os/linux/zfs/sys/zfs_bootenv_os.h Fri Sep 18 23:21:24 2020 (r365894, copy of r365893, vendor-sys/openzfs/dist/include/os/linux/zfs/sys/zfs_bootenv_os.h) @@ -0,0 +1,29 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2020 Toomas Soome + */ + +#ifndef _ZFS_BOOTENV_OS_H +#define _ZFS_BOOTENV_OS_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define BOOTENV_OS BE_LINUX_VENDOR + +#ifdef __cplusplus +} +#endif + +#endif /* _ZFS_BOOTENV_OS_H */ Modified: head/sys/contrib/openzfs/include/sys/Makefile.am ============================================================================== --- head/sys/contrib/openzfs/include/sys/Makefile.am Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/include/sys/Makefile.am Fri Sep 18 23:21:24 2020 (r365894) @@ -102,6 +102,7 @@ COMMON_H = \ zcp_set.h \ zfeature.h \ zfs_acl.h \ + zfs_bootenv.h \ zfs_context.h \ zfs_debug.h \ zfs_delay.h \ Modified: head/sys/contrib/openzfs/include/sys/dsl_synctask.h ============================================================================== --- head/sys/contrib/openzfs/include/sys/dsl_synctask.h Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/include/sys/dsl_synctask.h Fri Sep 18 23:21:24 2020 (r365894) @@ -112,11 +112,11 @@ void dsl_sync_task_sync(dsl_sync_task_t *, dmu_tx_t *) int dsl_sync_task(const char *, dsl_checkfunc_t *, dsl_syncfunc_t *, void *, int, zfs_space_check_t); void dsl_sync_task_nowait(struct dsl_pool *, dsl_syncfunc_t *, - void *, int, zfs_space_check_t, dmu_tx_t *); + void *, dmu_tx_t *); int dsl_early_sync_task(const char *, dsl_checkfunc_t *, dsl_syncfunc_t *, void *, int, zfs_space_check_t); void dsl_early_sync_task_nowait(struct dsl_pool *, dsl_syncfunc_t *, - void *, int, zfs_space_check_t, dmu_tx_t *); + void *, dmu_tx_t *); int dsl_sync_task_sig(const char *, dsl_checkfunc_t *, dsl_syncfunc_t *, dsl_sigfunc_t *, void *, int, zfs_space_check_t); Modified: head/sys/contrib/openzfs/include/sys/fm/fs/zfs.h ============================================================================== --- head/sys/contrib/openzfs/include/sys/fm/fs/zfs.h Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/include/sys/fm/fs/zfs.h Fri Sep 18 23:21:24 2020 (r365894) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2020 by Delphix. All rights reserved. + */ + #ifndef _SYS_FM_FS_ZFS_H #define _SYS_FM_FS_ZFS_H @@ -88,6 +92,7 @@ extern "C" { #define FM_EREPORT_PAYLOAD_ZFS_ZIO_SIZE "zio_size" #define FM_EREPORT_PAYLOAD_ZFS_ZIO_FLAGS "zio_flags" #define FM_EREPORT_PAYLOAD_ZFS_ZIO_STAGE "zio_stage" +#define FM_EREPORT_PAYLOAD_ZFS_ZIO_PRIORITY "zio_priority" #define FM_EREPORT_PAYLOAD_ZFS_ZIO_PIPELINE "zio_pipeline" #define FM_EREPORT_PAYLOAD_ZFS_ZIO_DELAY "zio_delay" #define FM_EREPORT_PAYLOAD_ZFS_ZIO_TIMESTAMP "zio_timestamp" Modified: head/sys/contrib/openzfs/include/sys/fm/util.h ============================================================================== --- head/sys/contrib/openzfs/include/sys/fm/util.h Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/include/sys/fm/util.h Fri Sep 18 23:21:24 2020 (r365894) @@ -104,6 +104,9 @@ extern int zfs_zevent_seek(zfs_zevent_t *, uint64_t); extern void zfs_zevent_init(zfs_zevent_t **); extern void zfs_zevent_destroy(zfs_zevent_t *); +extern void zfs_zevent_track_duplicate(void); +extern void zfs_ereport_init(void); +extern void zfs_ereport_fini(void); #else static inline void fm_init(void) { } Modified: head/sys/contrib/openzfs/include/sys/fs/zfs.h ============================================================================== --- head/sys/contrib/openzfs/include/sys/fs/zfs.h Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/include/sys/fs/zfs.h Fri Sep 18 23:21:24 2020 (r365894) @@ -1336,8 +1336,8 @@ typedef enum zfs_ioc { ZFS_IOC_NEXTBOOT, /* 0x84 (FreeBSD) */ ZFS_IOC_JAIL, /* 0x85 (FreeBSD) */ ZFS_IOC_UNJAIL, /* 0x86 (FreeBSD) */ - ZFS_IOC_SET_BOOTENV, /* 0x87 (Linux) */ - ZFS_IOC_GET_BOOTENV, /* 0x88 (Linux) */ + ZFS_IOC_SET_BOOTENV, /* 0x87 */ + ZFS_IOC_GET_BOOTENV, /* 0x88 */ ZFS_IOC_LAST } zfs_ioc_t; Modified: head/sys/contrib/openzfs/include/sys/spa.h ============================================================================== --- head/sys/contrib/openzfs/include/sys/spa.h Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/include/sys/spa.h Fri Sep 18 23:21:24 2020 (r365894) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2019 by Delphix. All rights reserved. + * Copyright (c) 2011, 2020 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. @@ -1145,10 +1145,10 @@ extern const char *spa_state_to_name(spa_t *spa); struct zbookmark_phys; extern void spa_log_error(spa_t *spa, const zbookmark_phys_t *zb); extern int zfs_ereport_post(const char *clazz, spa_t *spa, vdev_t *vd, - const zbookmark_phys_t *zb, zio_t *zio, uint64_t stateoroffset, - uint64_t length); + const zbookmark_phys_t *zb, zio_t *zio, uint64_t state); extern boolean_t zfs_ereport_is_valid(const char *clazz, spa_t *spa, vdev_t *vd, zio_t *zio); +extern void zfs_ereport_taskq_fini(void); extern nvlist_t *zfs_event_create(spa_t *spa, vdev_t *vd, const char *type, const char *name, nvlist_t *aux); extern void zfs_post_remove(spa_t *spa, vdev_t *vd); Modified: head/sys/contrib/openzfs/include/sys/vdev.h ============================================================================== --- head/sys/contrib/openzfs/include/sys/vdev.h Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/include/sys/vdev.h Fri Sep 18 23:21:24 2020 (r365894) @@ -94,7 +94,6 @@ extern void vdev_rele(vdev_t *); extern int vdev_metaslab_init(vdev_t *vd, uint64_t txg); extern void vdev_metaslab_fini(vdev_t *vd); extern void vdev_metaslab_set_size(vdev_t *); -extern void vdev_ashift_optimize(vdev_t *); extern void vdev_expand(vdev_t *vd, uint64_t txg); extern void vdev_split(vdev_t *vd); extern void vdev_deadman(vdev_t *vd, char *tag); @@ -181,7 +180,7 @@ extern void vdev_config_generate_stats(vdev_t *vd, nvl extern void vdev_label_write(zio_t *zio, vdev_t *vd, int l, abd_t *buf, uint64_t offset, uint64_t size, zio_done_func_t *done, void *priv, int flags); extern int vdev_label_read_bootenv(vdev_t *, nvlist_t *); -extern int vdev_label_write_bootenv(vdev_t *, char *); +extern int vdev_label_write_bootenv(vdev_t *, nvlist_t *); typedef enum { VDEV_LABEL_CREATE, /* create/add a new device */ Modified: head/sys/contrib/openzfs/include/sys/vdev_impl.h ============================================================================== --- head/sys/contrib/openzfs/include/sys/vdev_impl.h Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/include/sys/vdev_impl.h Fri Sep 18 23:21:24 2020 (r365894) @@ -476,7 +476,16 @@ typedef struct vdev_phys { } vdev_phys_t; typedef enum vbe_vers { - /* The bootenv file is stored as ascii text in the envblock */ + /* + * The bootenv file is stored as ascii text in the envblock. + * It is used by the GRUB bootloader used on Linux to store the + * contents of the grubenv file. The file is stored as raw ASCII, + * and is protected by an embedded checksum. By default, GRUB will + * check if the boot filesystem supports storing the environment data + * in a special location, and if so, will invoke filesystem specific + * logic to retrieve it. This can be overriden by a variable, should + * the user so desire. + */ VB_RAW = 0, /* Copied: head/sys/contrib/openzfs/include/sys/zfs_bootenv.h (from r365893, vendor-sys/openzfs/dist/include/sys/zfs_bootenv.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/openzfs/include/sys/zfs_bootenv.h Fri Sep 18 23:21:24 2020 (r365894, copy of r365893, vendor-sys/openzfs/dist/include/sys/zfs_bootenv.h) @@ -0,0 +1,53 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2020 Toomas Soome + */ + +#ifndef _ZFS_BOOTENV_H +#define _ZFS_BOOTENV_H + +/* + * Define macros for label bootenv nvlist pair keys. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#define BOOTENV_VERSION "version" + +#define BE_ILLUMOS_VENDOR "illumos" +#define BE_FREEBSD_VENDOR "freebsd" +#define BE_GRUB_VENDOR "grub" +#define BE_LINUX_VENDOR "linux" + +#include + +#define GRUB_ENVMAP BE_GRUB_VENDOR ":" "envmap" + +#define FREEBSD_BOOTONCE BE_FREEBSD_VENDOR ":" "bootonce" +#define FREEBSD_BOOTONCE_USED BE_FREEBSD_VENDOR ":" "bootonce-used" +#define FREEBSD_NVSTORE BE_FREEBSD_VENDOR ":" "nvstore" +#define ILLUMOS_BOOTONCE BE_ILLUMOS_VENDOR ":" "bootonce" +#define ILLUMOS_BOOTONCE_USED BE_ILLUMOS_VENDOR ":" "bootonce-used" +#define ILLUMOS_NVSTORE BE_ILLUMOS_VENDOR ":" "nvstore" + +#define OS_BOOTONCE BOOTENV_OS ":" "bootonce" +#define OS_BOOTONCE_USED BOOTENV_OS ":" "bootonce-used" +#define OS_NVSTORE BOOTENV_OS ":" "nvstore" + +#ifdef __cplusplus +} +#endif + +#endif /* _ZFS_BOOTENV_H */ Modified: head/sys/contrib/openzfs/include/sys/zfs_context.h ============================================================================== --- head/sys/contrib/openzfs/include/sys/zfs_context.h Fri Sep 18 22:59:44 2020 (r365893) +++ head/sys/contrib/openzfs/include/sys/zfs_context.h Fri Sep 18 23:21:24 2020 (r365894) @@ -325,11 +325,15 @@ extern void cv_signal(kcondvar_t *cv); extern void cv_broadcast(kcondvar_t *cv); #define cv_timedwait_io(cv, mp, at) cv_timedwait(cv, mp, at) +#define cv_timedwait_idle(cv, mp, at) cv_timedwait(cv, mp, at) #define cv_timedwait_sig(cv, mp, at) cv_timedwait(cv, mp, at) #define cv_wait_io(cv, mp) cv_wait(cv, mp) +#define cv_wait_idle(cv, mp) cv_wait(cv, mp) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Sep 18 23:52:56 2020 Return-Path: Delivered-To: svn-src-all@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 BAA453F43C2; Fri, 18 Sep 2020 23:52:56 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BtVyJ4Wwlz4Kmx; Fri, 18 Sep 2020 23:52:56 +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 7EFE9231A4; Fri, 18 Sep 2020 23:52:56 +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 08INqugJ095580; Fri, 18 Sep 2020 23:52:56 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08INquT0095579; Fri, 18 Sep 2020 23:52:56 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202009182352.08INquT0095579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 18 Sep 2020 23:52:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365895 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 365895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2020 23:52:56 -0000 Author: rmacklem Date: Fri Sep 18 23:52:56 2020 New Revision: 365895 URL: https://svnweb.freebsd.org/changeset/base/365895 Log: Fix a LOR between the NFS server and server side krpc. Recent testing of the NFS-over-TLS code found a LOR between the mutex lock used for sessions and the sleep lock used for server side krpc socket structures in nfsrv_checksequence(). This was fixed by r365789. A similar bug exists in nfsrv_bindconnsess(), where SVC_RELEASE() is called while mutexes are held. This patch applies a fix similar to r365789, moving the SVC_RELEASE() call down to after the mutexes are released. This patch fixes the problem by moving the SVC_RELEASE() call in nfsrv_checksequence() down a few lines to below where the mutex is released. MFC after: 1 week Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Fri Sep 18 23:21:24 2020 (r365894) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Fri Sep 18 23:52:56 2020 (r365895) @@ -6424,6 +6424,7 @@ nfsrv_bindconnsess(struct nfsrv_descript *nd, uint8_t int error; error = 0; + savxprt = NULL; shp = NFSSESSIONHASH(sessionid); NFSLOCKSTATE(); NFSLOCKSESSION(shp); @@ -6451,8 +6452,6 @@ nfsrv_bindconnsess(struct nfsrv_descript *nd, uint8_t /* Disable idle timeout. */ nd->nd_xprt->xp_idletimeout = 0; sep->sess_cbsess.nfsess_xprt = nd->nd_xprt; - if (savxprt != NULL) - SVC_RELEASE(savxprt); sep->sess_crflags |= NFSV4CRSESS_CONNBACKCHAN; clp->lc_flags |= LCL_DONEBINDCONN; if (*foreaftp == NFSCDFS4_BACK) @@ -6479,6 +6478,8 @@ nfsrv_bindconnsess(struct nfsrv_descript *nd, uint8_t error = NFSERR_BADSESSION; NFSUNLOCKSESSION(shp); NFSUNLOCKSTATE(); + if (savxprt != NULL) + SVC_RELEASE(savxprt); return (error); } From owner-svn-src-all@freebsd.org Sat Sep 19 01:59:19 2020 Return-Path: Delivered-To: svn-src-all@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 27C453F7BA6; Sat, 19 Sep 2020 01:59:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BtYm70fNdz4Rt3; Sat, 19 Sep 2020 01:59:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED2582483A; Sat, 19 Sep 2020 01:59:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08J1xIrZ069839; Sat, 19 Sep 2020 01:59:18 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08J1xIMA069835; Sat, 19 Sep 2020 01:59:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009190159.08J1xIMA069835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 19 Sep 2020 01:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365896 - in head/secure/caroot: blacklisted trusted X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/secure/caroot: blacklisted trusted X-SVN-Commit-Revision: 365896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 01:59:19 -0000 Author: kevans Date: Sat Sep 19 01:59:17 2020 New Revision: 365896 URL: https://svnweb.freebsd.org/changeset/base/365896 Log: caroot: update base store Count: - Two (2) removed - Three (3) added MFC after: 3 days Added: head/secure/caroot/blacklisted/EE_Certification_Centre_Root_CA.pem - copied unchanged from r365895, head/secure/caroot/trusted/EE_Certification_Centre_Root_CA.pem head/secure/caroot/blacklisted/Taiwan_GRCA.pem - copied unchanged from r365895, head/secure/caroot/trusted/Taiwan_GRCA.pem head/secure/caroot/trusted/Trustwave_Global_Certification_Authority.pem (contents, props changed) head/secure/caroot/trusted/Trustwave_Global_ECC_P256_Certification_Authority.pem (contents, props changed) head/secure/caroot/trusted/Trustwave_Global_ECC_P384_Certification_Authority.pem (contents, props changed) Deleted: head/secure/caroot/trusted/EE_Certification_Centre_Root_CA.pem head/secure/caroot/trusted/Taiwan_GRCA.pem Copied: head/secure/caroot/blacklisted/EE_Certification_Centre_Root_CA.pem (from r365895, head/secure/caroot/trusted/EE_Certification_Centre_Root_CA.pem) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/blacklisted/EE_Certification_Centre_Root_CA.pem Sat Sep 19 01:59:17 2020 (r365896, copy of r365895, head/secure/caroot/trusted/EE_Certification_Centre_Root_CA.pem) @@ -0,0 +1,96 @@ +## +## EE Certification Centre Root CA +## +## This is a single X.509 certificate for a public Certificate +## Authority (CA). It was automatically extracted from Mozilla's +## root CA list (the file `certdata.txt' in security/nss). +## +## Extracted from nss +## with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 01:27:50Z kevans $ +## +## @generated +## +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 54:80:f9:a0:73:ed:3f:00:4c:ca:89:d8:e3:71:e6:4a + Signature Algorithm: sha1WithRSAEncryption + Issuer: C = EE, O = AS Sertifitseerimiskeskus, CN = EE Certification Centre Root CA, emailAddress = pki@sk.ee + Validity + Not Before: Oct 30 10:10:30 2010 GMT + Not After : Dec 17 23:59:59 2030 GMT + Subject: C = EE, O = AS Sertifitseerimiskeskus, CN = EE Certification Centre Root CA, emailAddress = pki@sk.ee + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public-Key: (2048 bit) + Modulus: + 00:c8:20:c0:ec:e0:c5:4b:ab:07:78:95:f3:44:ee: + fb:0b:0c:ff:74:8e:61:bb:b1:62:ea:23:d8:ab:a1: + 65:32:7a:eb:8e:17:4f:96:d8:0a:7b:91:a2:63:6c: + c7:8c:4c:2e:79:bf:a9:05:fc:69:5c:95:8d:62:f9: + b9:70:ed:c3:51:7d:d0:93:e6:6c:eb:30:4b:e1:bc: + 7d:bf:52:9b:ce:6e:7b:65:f2:38:b1:c0:a2:32:ef: + 62:b2:68:e0:61:53:c1:36:95:ff:ec:94:ba:36:ae: + 9c:1c:a7:32:0f:e5:7c:b4:c6:6f:74:fd:7b:18:e8: + ac:57:ed:06:20:4b:32:30:58:5b:fd:cd:a8:e6:a1: + fc:70:bc:8e:92:73:db:97:a7:7c:21:ae:3d:c1:f5: + 48:87:6c:27:bd:9f:25:74:81:55:b0:f7:75:f6:3d: + a4:64:6b:d6:4f:e7:ce:40:ad:0f:dd:32:d3:bc:8a: + 12:53:98:c9:89:fb:10:1d:4d:7e:cd:7e:1f:56:0d: + 21:70:85:f6:20:83:1f:f6:ba:1f:04:8f:ea:77:88: + 35:c4:ff:ea:4e:a1:8b:4d:3f:63:1b:44:c3:44:d4: + 25:76:ca:b7:8d:d7:1e:4a:66:64:cd:5c:c5:9c:83: + e1:c2:08:88:9a:ec:4e:a3:f1:3e:1c:2c:d9:6c:1d: + a1:4b + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + 12:F2:5A:3E:EA:56:1C:BF:CD:06:AC:F1:F1:25:C9:A9:4B:D4:14:99 + X509v3 Extended Key Usage: + TLS Web Client Authentication, TLS Web Server Authentication, Code Signing, E-mail Protection, Time Stamping, OCSP Signing + Signature Algorithm: sha1WithRSAEncryption + 7b:f6:e4:c0:0d:aa:19:47:b7:4d:57:a3:fe:ad:bb:b1:6a:d5: + 0f:9e:db:e4:63:c5:8e:a1:50:56:93:96:b8:38:c0:24:22:66: + bc:53:14:61:95:bf:d0:c7:2a:96:39:3f:7d:28:b3:10:40:21: + 6a:c4:af:b0:52:77:18:e1:96:d8:56:5d:e3:dd:36:5e:1d:a7: + 50:54:a0:c5:2a:e4:aa:8c:94:8a:4f:9d:35:ff:76:a4:06:13: + 91:a2:a2:7d:00:44:3f:55:d3:82:3c:1a:d5:5b:bc:56:4c:22: + 2e:46:43:8a:24:40:2d:f3:12:b8:3b:70:1a:a4:96:b9:1a:af: + 87:41:1a:6a:18:0d:06:4f:c7:3e:6e:b9:29:4d:0d:49:89:11: + 87:32:5b:e6:4b:04:c8:e4:5c:e6:74:73:94:5d:16:98:13:95: + fe:fb:db:b1:44:e5:3a:70:ac:37:6b:e6:b3:33:72:28:c9:b3: + 57:a0:f6:02:16:88:06:0b:b6:a6:4b:20:28:d4:de:3d:8b:ad: + 37:05:53:74:fe:6e:cc:bc:43:17:71:5e:f9:c5:cc:1a:a9:61: + ee:f7:76:0c:f3:72:f4:72:ad:cf:72:02:36:07:47:cf:ef:19: + 50:89:60:cc:e9:24:95:0f:c2:cb:1d:f2:6f:76:90:c7:cc:75: + c1:96:c5:9d +SHA1 Fingerprint=C9:A8:B9:E7:55:80:5E:58:E3:53:77:A7:25:EB:AF:C3:7B:27:CC:D7 +-----BEGIN CERTIFICATE----- +MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1 +MQswCQYDVQQGEwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1 +czEoMCYGA1UEAwwfRUUgQ2VydGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYG +CSqGSIb3DQEJARYJcGtpQHNrLmVlMCIYDzIwMTAxMDMwMTAxMDMwWhgPMjAzMDEy +MTcyMzU5NTlaMHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlBUyBTZXJ0aWZpdHNl +ZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRyZSBS +b290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQDIIMDs4MVLqwd4lfNE7vsLDP90jmG7sWLqI9iroWUy +euuOF0+W2Ap7kaJjbMeMTC55v6kF/GlclY1i+blw7cNRfdCT5mzrMEvhvH2/UpvO +bntl8jixwKIy72KyaOBhU8E2lf/slLo2rpwcpzIP5Xy0xm90/XsY6KxX7QYgSzIw +WFv9zajmofxwvI6Sc9uXp3whrj3B9UiHbCe9nyV0gVWw93X2PaRka9ZP585ArQ/d +MtO8ihJTmMmJ+xAdTX7Nfh9WDSFwhfYggx/2uh8Ej+p3iDXE/+pOoYtNP2MbRMNE +1CV2yreN1x5KZmTNXMWcg+HCCIia7E6j8T4cLNlsHaFLAgMBAAGjgYowgYcwDwYD +VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBLyWj7qVhy/ +zQas8fElyalL1BSZMEUGA1UdJQQ+MDwGCCsGAQUFBwMCBggrBgEFBQcDAQYIKwYB +BQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYIKwYBBQUHAwkwDQYJKoZIhvcNAQEF +BQADggEBAHv25MANqhlHt01Xo/6tu7Fq1Q+e2+RjxY6hUFaTlrg4wCQiZrxTFGGV +v9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqMlIpPnTX/dqQG +E5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u +uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIW +iAYLtqZLICjU3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/v +GVCJYMzpJJUPwssd8m92kMfMdcGWxZ0= +-----END CERTIFICATE----- Copied: head/secure/caroot/blacklisted/Taiwan_GRCA.pem (from r365895, head/secure/caroot/trusted/Taiwan_GRCA.pem) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/blacklisted/Taiwan_GRCA.pem Sat Sep 19 01:59:17 2020 (r365896, copy of r365895, head/secure/caroot/trusted/Taiwan_GRCA.pem) @@ -0,0 +1,133 @@ +## +## Taiwan GRCA +## +## This is a single X.509 certificate for a public Certificate +## Authority (CA). It was automatically extracted from Mozilla's +## root CA list (the file `certdata.txt' in security/nss). +## +## Extracted from nss +## with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 01:27:50Z kevans $ +## +## @generated +## +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 1f:9d:59:5a:d7:2f:c2:06:44:a5:80:08:69:e3:5e:f6 + Signature Algorithm: sha1WithRSAEncryption + Issuer: C = TW, O = Government Root Certification Authority + Validity + Not Before: Dec 5 13:23:33 2002 GMT + Not After : Dec 5 13:23:33 2032 GMT + Subject: C = TW, O = Government Root Certification Authority + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public-Key: (4096 bit) + Modulus: + 00:9a:25:b8:ec:cc:a2:75:a8:7b:f7:ce:5b:59:8a: + c9:d1:86:12:08:54:ec:9c:f2:e7:46:f6:88:f3:7c: + e9:a5:df:4c:47:36:a4:1b:01:1c:7f:1e:57:8a:8d: + c3:c5:d1:21:e3:da:24:3f:48:2b:fb:9f:2e:a1:94: + e7:2c:1c:93:d1:bf:1b:01:87:53:99:ce:a7:f5:0a: + 21:76:77:ff:a9:b7:c6:73:94:4f:46:f7:10:49:37: + fa:a8:59:49:5d:6a:81:07:56:f2:8a:f9:06:d0:f7: + 70:22:4d:b4:b7:41:b9:32:b8:b1:f0:b1:c3:9c:3f: + 70:fd:53:dd:81:aa:d8:63:78:f6:d8:53:6e:a1:ac: + 6a:84:24:72:54:86:c6:d2:b2:ca:1c:0e:79:81:d6: + b5:70:62:08:01:2e:4e:4f:0e:d5:11:af:a9:af:e5: + 9a:bf:dc:cc:87:6d:26:e4:c9:57:a2:fb:96:f9:cc: + e1:3f:53:8c:6c:4c:7e:9b:53:08:0b:6c:17:fb:67: + c8:c2:ad:b1:cd:80:b4:97:dc:76:01:16:15:e9:6a: + d7:a4:e1:78:47:ce:86:d5:fb:31:f3:fa:31:be:34: + aa:28:fb:70:4c:1d:49:c7:af:2c:9d:6d:66:a6:b6: + 8d:64:7e:b5:20:6a:9d:3b:81:b6:8f:40:00:67:4b: + 89:86:b8:cc:65:fe:15:53:e9:04:c1:d6:5f:1d:44: + d7:0a:2f:27:9a:46:7d:a1:0d:75:ad:54:86:15:dc: + 49:3b:f1:96:ce:0f:9b:a0:ec:a3:7a:5d:be:d5:2a: + 75:42:e5:7b:de:a5:b6:aa:af:28:ac:ac:90:ac:38: + b7:d5:68:35:26:7a:dc:f7:3b:f3:fd:45:9b:d1:bb: + 43:78:6e:6f:f1:42:54:6a:98:f0:0d:ad:97:e9:52: + 5e:e9:d5:6a:72:de:6a:f7:1b:60:14:f4:a5:e4:b6: + 71:67:aa:1f:ea:e2:4d:c1:42:40:fe:67:46:17:38: + 2f:47:3f:71:9c:ae:e5:21:ca:61:2d:6d:07:a8:84: + 7c:2d:ee:51:25:f1:63:90:9e:fd:e1:57:88:6b:ef: + 8a:23:6d:b1:e6:bd:3f:ad:d1:3d:96:0b:85:8d:cd: + 6b:27:bb:b7:05:9b:ec:bb:91:a9:0a:07:12:02:97: + 4e:20:90:f0:ff:0d:1e:e2:41:3b:d3:40:3a:e7:8d: + 5d:da:66:e4:02:b0:07:52:98:5c:0e:8e:33:9c:c2: + a6:95:fb:55:19:6e:4c:8e:ae:4b:0f:bd:c1:38:4d: + 5e:8f:84:1d:66:cd:c5:60:96:b4:52:5a:05:89:8e: + 95:7a:98:c1:91:3c:95:23:b2:0e:f4:79:b4:c9:7c: + c1:4a:21 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + CC:CC:EF:CC:29:60:A4:3B:B1:92:B6:3C:FA:32:62:8F:AC:25:15:3B + X509v3 Basic Constraints: + CA:TRUE + setCext-hashedRoot: + 0/0-...0...+......0...g*........"...(6....2.1:.Qe + Signature Algorithm: sha1WithRSAEncryption + 40:80:4a:fa:26:c9:ce:5e:30:dd:4f:86:74:76:58:f5:ae:b3: + 83:33:78:a4:7a:74:17:19:4e:e9:52:b5:b9:e0:0a:74:62:aa: + 68:ca:78:a0:4c:9a:8e:2c:23:2e:d5:6a:12:24:bf:d4:68:d3: + 8a:d0:d8:9c:9f:b4:1f:0c:de:38:7e:57:38:fc:8d:e2:4f:5e: + 0c:9f:ab:3b:d2:ff:75:97:cb:a4:e3:67:08:ff:e5:c0:16:b5: + 48:01:7d:e9:f9:0a:ff:1b:e5:6a:69:bf:78:21:a8:c2:a7:23: + a9:86:ab:76:56:e8:0e:0c:f6:13:dd:2a:66:8a:64:49:3d:1a: + 18:87:90:04:9f:42:52:b7:4f:cb:fe:47:41:76:35:ef:ff:00: + 76:36:45:32:9b:c6:46:85:5d:e2:24:b0:1e:e3:48:96:98:57: + 47:94:55:7a:0f:41:b1:44:24:f3:c1:fe:1a:6b:bf:88:fd:c1: + a6:da:93:60:5e:81:4a:99:20:9c:48:66:19:b5:00:79:54:0f: + b8:2c:2f:4b:bc:a9:5d:5b:60:7f:8c:87:a5:e0:52:63:2a:be: + d8:3b:85:40:15:fe:1e:b6:65:3f:c5:4b:da:7e:b5:7a:35:29: + a3:2e:7a:98:60:22:a3:f4:7d:27:4e:2d:ea:b4:74:3c:e9:0f: + a4:33:0f:10:11:bc:13:01:d6:e5:0e:d3:bf:b5:12:a2:e1:45: + 23:c0:cc:08:6e:61:b7:89:ab:83:e3:24:1e:e6:5d:07:e7:1f: + 20:3e:cf:67:c8:e7:ac:30:6d:27:4b:68:6e:4b:2a:5c:02:08: + 34:db:f8:76:e4:67:a3:26:9c:3f:a2:32:c2:4a:c5:81:18:31: + 10:56:aa:84:ef:2d:0a:ff:b8:1f:77:d2:bf:a5:58:a0:62:e4: + d7:4b:91:75:8d:89:80:98:7e:6d:cb:53:4e:5e:af:f6:b2:97: + 85:97:b9:da:55:06:b9:24:ee:d7:c6:38:1e:63:1b:12:3b:95: + e1:58:ac:f2:df:84:d5:5f:99:2f:0d:55:5b:e6:38:db:2e:3f: + 72:e9:48:85:cb:bb:29:13:8f:1e:38:55:b9:f3:b2:c4:30:99: + 23:4e:5d:f2:48:a1:12:0c:dc:12:90:09:90:54:91:03:3c:47: + e5:d5:c9:65:e0:b7:4b:7d:ec:47:d3:b3:0b:3e:ad:9e:d0:74: + 00:0e:eb:bd:51:ad:c0:de:2c:c0:c3:6a:fe:ef:dc:0b:a7:fa: + 46:df:60:db:9c:a6:59:50:75:23:69:73:93:b2:f9:fc:02:d3: + 47:e6:71:ce:10:02:ee:27:8c:84:ff:ac:45:0d:13:5c:83:32: + e0:25:a5:86:2c:7c:f4:12 +SHA1 Fingerprint=F4:8B:11:BF:DE:AB:BE:94:54:20:71:E6:41:DE:6B:BE:88:2B:40:B9 +-----BEGIN CERTIFICATE----- +MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/ +MQswCQYDVQQGEwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmlj +YXRpb24gQXV0aG9yaXR5MB4XDTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1ow +PzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dvdmVybm1lbnQgUm9vdCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB +AJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qNw8XR +IePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1q +gQdW8or5BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKy +yhwOeYHWtXBiCAEuTk8O1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAts +F/tnyMKtsc2AtJfcdgEWFelq16TheEfOhtX7MfP6Mb40qij7cEwdScevLJ1tZqa2 +jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wovJ5pGfaENda1UhhXcSTvx +ls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7Q3hub/FC +VGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHK +YS1tB6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoH +EgKXTiCQ8P8NHuJBO9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThN +Xo+EHWbNxWCWtFJaBYmOlXqYwZE8lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1Ud +DgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNVHRMEBTADAQH/MDkGBGcqBwAE +MTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg209yewDL7MTqK +UWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ +TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyf +qzvS/3WXy6TjZwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaK +ZEk9GhiHkASfQlK3T8v+R0F2Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFE +JPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlUD7gsL0u8qV1bYH+Mh6XgUmMqvtg7 +hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6QzDxARvBMB1uUO07+1 +EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+HbkZ6Mm +nD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WX +udpVBrkk7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44Vbnz +ssQwmSNOXfJIoRIM3BKQCZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDe +LMDDav7v3Aun+kbfYNucpllQdSNpc5Oy+fwC00fmcc4QAu4njIT/rEUNE1yDMuAl +pYYsfPQS +-----END CERTIFICATE----- Added: head/secure/caroot/trusted/Trustwave_Global_Certification_Authority.pem ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/trusted/Trustwave_Global_Certification_Authority.pem Sat Sep 19 01:59:17 2020 (r365896) @@ -0,0 +1,135 @@ +## +## Trustwave Global Certification Authority +## +## This is a single X.509 certificate for a public Certificate +## Authority (CA). It was automatically extracted from Mozilla's +## root CA list (the file `certdata.txt' in security/nss). +## +## Extracted from nss +## with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 01:27:50Z kevans $ +## +## @generated +## +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 05:f7:0e:86:da:49:f3:46:35:2e:ba:b2 + Signature Algorithm: sha256WithRSAEncryption + Issuer: C = US, ST = Illinois, L = Chicago, O = "Trustwave Holdings, Inc.", CN = Trustwave Global Certification Authority + Validity + Not Before: Aug 23 19:34:12 2017 GMT + Not After : Aug 23 19:34:12 2042 GMT + Subject: C = US, ST = Illinois, L = Chicago, O = "Trustwave Holdings, Inc.", CN = Trustwave Global Certification Authority + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public-Key: (4096 bit) + Modulus: + 00:b9:5d:51:28:4b:3c:37:92:d1:82:ce:bd:1d:bd: + cd:dd:b8:ab:cf:0a:3e:e1:5d:e5:dc:aa:09:b9:57: + 02:3e:e6:63:61:df:f2:0f:82:63:ae:a3:f7:ac:73: + d1:7c:e7:b3:0b:af:08:00:09:59:7f:cd:29:2a:88: + 93:87:17:18:80:ed:88:b2:b4:b6:10:1f:2d:d6:5f: + 55:a2:13:5d:d1:c6:eb:06:56:89:88:fe:ac:32:9d: + fd:5c:c3:05:c7:6e:ee:86:89:ba:88:03:9d:72:21: + 86:90:ae:8f:03:a5:dc:9f:88:28:cb:a3:92:49:0f: + ec:d0:0f:e2:6d:44:4f:80:6a:b2:d4:e7:a0:0a:53: + 01:ba:8e:97:91:76:6e:bc:fc:d5:6b:36:e6:40:88: + d6:7b:2f:5f:05:e8:2c:6d:11:f3:e7:b2:be:92:44: + 4c:d2:97:a4:fe:d2:72:81:43:07:9c:e9:11:3e:f5: + 8b:1a:59:7d:1f:68:58:dd:04:00:2c:96:f3:43:b3: + 7e:98:19:74:d9:9c:73:d9:18:be:41:c7:34:79:d9: + f4:62:c2:43:b9:b3:27:b0:22:cb:f9:3d:52:c7:30: + 47:b3:c9:3e:b8:6a:e2:e7:e8:81:70:5e:42:8b:4f: + 26:a5:fe:3a:c2:20:6e:bb:f8:16:8e:cd:0c:a9:b4: + 1b:6c:76:10:e1:58:79:46:3e:54:ce:80:a8:57:09: + 37:29:1b:99:13:8f:0c:c8:d6:2c:1c:fb:05:e8:08: + 95:3d:65:46:dc:ee:cd:69:e2:4d:8f:87:28:4e:34: + 0b:3e:cf:14:d9:bb:dd:b6:50:9a:ad:77:d4:19:d6: + da:1a:88:c8:4e:1b:27:75:d8:b2:08:f1:ae:83:30: + b9:11:0e:cd:87:f0:84:8d:15:72:7c:a1:ef:cc:f2: + 88:61:ba:f4:69:bb:0c:8c:0b:75:57:04:b8:4e:2a: + 14:2e:3d:0f:1c:1e:32:a6:62:36:ee:66:e2:22:b8: + 05:40:63:10:22:f3:33:1d:74:72:8a:2c:f5:39:29: + a0:d3:e7:1b:80:84:2d:c5:3d:e3:4d:b1:fd:1a:6f: + ba:65:07:3b:58:ec:42:45:26:fb:d8:da:25:72:c4: + f6:00:b1:22:79:bd:e3:7c:59:62:4a:9c:05:6f:3d: + ce:e6:d6:47:63:99:c6:24:6f:72:12:c8:ac:7f:90: + b4:0b:91:70:e8:b7:e6:16:10:71:17:ce:de:06:4f: + 48:41:7d:35:4a:a3:89:f2:c9:4b:7b:41:11:6d:67: + b7:08:98:4c:e5:11:19:ae:42:80:dc:fb:90:05:d4: + f8:50:ca:be:e4:ad:c7:c2:94:d7:16:9d:e6:17:8f: + af:36:fb + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Key Identifier: + 99:E0:19:67:0D:62:DB:76:B3:DA:3D:B8:5B:E8:FD:42:D2:31:0E:87 + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + Signature Algorithm: sha256WithRSAEncryption + 98:73:70:e2:b0:d3:ed:39:ec:4c:60:d9:a9:12:86:17:1e:96: + d0:e8:54:28:3b:64:2d:21:a6:f8:9d:56:13:6a:48:3d:4f:c7: + 3e:29:db:6d:58:83:54:3d:87:7d:23:05:d4:e4:1c:dc:e8:38: + 65:86:c5:75:a7:5a:db:35:05:bd:77:de:bb:29:37:40:05:07: + c3:94:52:9f:ca:64:dd:f1:1b:2b:dc:46:0a:10:02:31:fd:4a: + 68:0d:07:64:90:e6:1e:f5:2a:a1:a8:bb:3c:5d:f9:a3:08:0b: + 11:0c:f1:3f:2d:10:94:6f:fe:e2:34:87:83:d6:cf:e5:1b:35: + 6d:d2:03:e1:b0:0d:a8:a0:aa:46:27:82:36:a7:15:b6:08:a6: + 42:54:57:b6:99:5a:e2:0b:79:90:d7:57:12:51:35:19:88:41: + 68:25:d4:37:17:84:15:fb:01:72:dc:95:de:52:26:20:98:26: + e2:76:f5:27:6f:fa:00:3b:4a:61:d9:0d:cb:51:93:2a:fd:16: + 06:96:a7:23:9a:23:48:fe:51:bd:b6:c4:b0:b1:54:ce:de:6c: + 41:ad:16:67:7e:db:fd:38:cd:b9:38:4e:b2:c1:60:cb:9d:17: + df:58:9e:7a:62:b2:26:8f:74:95:9b:e4:5b:1d:d2:0f:dd:98: + 1c:9b:59:b9:23:d3:31:a0:a6:ff:38:dd:cf:20:4f:e9:58:56: + 3a:67:c3:d1:f6:99:99:9d:ba:36:b6:80:2f:88:47:4f:86:bf: + 44:3a:80:e4:37:1c:a6:ba:ea:97:98:11:d0:84:62:47:64:1e: + aa:ee:40:bf:34:b1:9c:8f:4e:e1:f2:92:4f:1f:8e:f3:9e:97: + de:f3:a6:79:6a:89:71:4f:4b:27:17:48:fe:ec:f4:50:0f:4f: + 49:7d:cc:45:e3:bd:7a:40:c5:41:dc:61:56:27:06:69:e5:72: + 41:81:d3:b6:01:89:a0:2f:3a:72:79:fe:3a:30:bf:41:ec:c7: + 62:3e:91:4b:c7:d9:31:76:42:f9:f7:3c:63:ec:26:8c:73:0c: + 7d:1a:1d:ea:a8:7c:87:a8:c2:27:7c:e1:33:41:0f:cf:cf:fc: + 00:a0:22:80:9e:4a:a7:6f:00:b0:41:45:b7:22:ca:68:48:c5: + 42:a2:ae:dd:1d:f2:e0:6e:4e:05:58:b1:c0:90:16:2a:a4:3d: + 10:40:be:8f:62:63:83:a9:9c:82:7d:2d:02:e9:83:30:7c:cb: + 27:c9:fd:1e:66:00:b0:2e:d3:21:2f:8e:33:16:6c:98:ed:10: + a8:07:d6:cc:93:cf:db:d1:69:1c:e4:ca:c9:e0:b6:9c:e9:ce: + 71:71:de:6c:3f:16:a4:79 +SHA1 Fingerprint=2F:8F:36:4F:E1:58:97:44:21:59:87:A5:2A:9A:D0:69:95:26:7F:B5 +-----BEGIN CERTIFICATE----- +MIIF2jCCA8KgAwIBAgIMBfcOhtpJ80Y1LrqyMA0GCSqGSIb3DQEBCwUAMIGIMQsw +CQYDVQQGEwJVUzERMA8GA1UECAwISWxsaW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28x +ITAfBgNVBAoMGFRydXN0d2F2ZSBIb2xkaW5ncywgSW5jLjExMC8GA1UEAwwoVHJ1 +c3R3YXZlIEdsb2JhbCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xNzA4MjMx +OTM0MTJaFw00MjA4MjMxOTM0MTJaMIGIMQswCQYDVQQGEwJVUzERMA8GA1UECAwI +SWxsaW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xITAfBgNVBAoMGFRydXN0d2F2ZSBI +b2xkaW5ncywgSW5jLjExMC8GA1UEAwwoVHJ1c3R3YXZlIEdsb2JhbCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB +ALldUShLPDeS0YLOvR29zd24q88KPuFd5dyqCblXAj7mY2Hf8g+CY66j96xz0Xzn +swuvCAAJWX/NKSqIk4cXGIDtiLK0thAfLdZfVaITXdHG6wZWiYj+rDKd/VzDBcdu +7oaJuogDnXIhhpCujwOl3J+IKMujkkkP7NAP4m1ET4BqstTnoApTAbqOl5F2brz8 +1Ws25kCI1nsvXwXoLG0R8+eyvpJETNKXpP7ScoFDB5zpET71ixpZfR9oWN0EACyW +80OzfpgZdNmcc9kYvkHHNHnZ9GLCQ7mzJ7Aiy/k9UscwR7PJPrhq4ufogXBeQotP +JqX+OsIgbrv4Fo7NDKm0G2x2EOFYeUY+VM6AqFcJNykbmROPDMjWLBz7BegIlT1l +RtzuzWniTY+HKE40Cz7PFNm73bZQmq131BnW2hqIyE4bJ3XYsgjxroMwuREOzYfw +hI0Vcnyh78zyiGG69Gm7DIwLdVcEuE4qFC49DxweMqZiNu5m4iK4BUBjECLzMx10 +coos9TkpoNPnG4CELcU9402x/RpvumUHO1jsQkUm+9jaJXLE9gCxInm943xZYkqc +BW89zubWR2OZxiRvchLIrH+QtAuRcOi35hYQcRfO3gZPSEF9NUqjifLJS3tBEW1n +twiYTOURGa5CgNz7kAXU+FDKvuStx8KU1xad5hePrzb7AgMBAAGjQjBAMA8GA1Ud +EwEB/wQFMAMBAf8wHQYDVR0OBBYEFJngGWcNYtt2s9o9uFvo/ULSMQ6HMA4GA1Ud +DwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAmHNw4rDT7TnsTGDZqRKGFx6W +0OhUKDtkLSGm+J1WE2pIPU/HPinbbViDVD2HfSMF1OQc3Og4ZYbFdada2zUFvXfe +uyk3QAUHw5RSn8pk3fEbK9xGChACMf1KaA0HZJDmHvUqoai7PF35owgLEQzxPy0Q +lG/+4jSHg9bP5Rs1bdID4bANqKCqRieCNqcVtgimQlRXtpla4gt5kNdXElE1GYhB +aCXUNxeEFfsBctyV3lImIJgm4nb1J2/6ADtKYdkNy1GTKv0WBpanI5ojSP5RvbbE +sLFUzt5sQa0WZ37b/TjNuThOssFgy50X31ieemKyJo90lZvkWx3SD92YHJtZuSPT +MaCm/zjdzyBP6VhWOmfD0faZmZ26NraAL4hHT4a/RDqA5Dccprrql5gR0IRiR2Qe +qu5AvzSxnI9O4fKSTx+O856X3vOmeWqJcU9LJxdI/uz0UA9PSX3MReO9ekDFQdxh +VicGaeVyQYHTtgGJoC86cnn+OjC/QezHYj6RS8fZMXZC+fc8Y+wmjHMMfRod6qh8 +h6jCJ3zhM0EPz8/8AKAigJ5Kp28AsEFFtyLKaEjFQqKu3R3y4G5OBVixwJAWKqQ9 +EEC+j2Jjg6mcgn0tAumDMHzLJ8n9HmYAsC7TIS+OMxZsmO0QqAfWzJPP29FpHOTK +yeC2nOnOcXHebD8WpHk= +-----END CERTIFICATE----- Added: head/secure/caroot/trusted/Trustwave_Global_ECC_P256_Certification_Authority.pem ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/trusted/Trustwave_Global_ECC_P256_Certification_Authority.pem Sat Sep 19 01:59:17 2020 (r365896) @@ -0,0 +1,62 @@ +## +## Trustwave Global ECC P256 Certification Authority +## +## This is a single X.509 certificate for a public Certificate +## Authority (CA). It was automatically extracted from Mozilla's +## root CA list (the file `certdata.txt' in security/nss). +## +## Extracted from nss +## with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 01:27:50Z kevans $ +## +## @generated +## +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 0d:6a:5f:08:3f:28:5c:3e:51:95:df:5d + Signature Algorithm: ecdsa-with-SHA256 + Issuer: C = US, ST = Illinois, L = Chicago, O = "Trustwave Holdings, Inc.", CN = Trustwave Global ECC P256 Certification Authority + Validity + Not Before: Aug 23 19:35:10 2017 GMT + Not After : Aug 23 19:35:10 2042 GMT + Subject: C = US, ST = Illinois, L = Chicago, O = "Trustwave Holdings, Inc.", CN = Trustwave Global ECC P256 Certification Authority + Subject Public Key Info: + Public Key Algorithm: id-ecPublicKey + Public-Key: (256 bit) + pub: + 04:7e:fb:6c:e6:23:e3:73:32:08:ca:60:e6:53:9c: + ba:74:8d:18:b0:78:90:52:80:dd:38:c0:4a:1d:d1: + a8:cc:93:a4:97:06:38:ca:0d:15:62:c6:8e:01:2a: + 65:9d:aa:df:34:91:2e:81:c1:e4:33:92:31:c4:fd: + 09:3a:a6:3f:ad + ASN1 OID: prime256v1 + NIST CURVE: P-256 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + A3:41:06:AC:90:6D:D1:4A:EB:75:A5:4A:10:99:B3:B1:A1:8B:4A:F7 + Signature Algorithm: ecdsa-with-SHA256 + 30:44:02:20:07:e6:54:da:0e:a0:5a:b2:ae:11:9f:87:c5:b6: + ff:69:de:25:be:f8:a0:b7:08:f3:44:ce:2a:df:08:21:0c:37: + 02:20:2d:26:03:a0:05:bd:6b:d1:f6:5c:f8:65:cc:86:6d:b3: + 9c:34:48:63:84:09:c5:8d:77:1a:e2:cc:9c:e1:74:7b +SHA1 Fingerprint=B4:90:82:DD:45:0C:BE:8B:5B:B1:66:D3:E2:A4:08:26:CD:ED:42:CF +-----BEGIN CERTIFICATE----- +MIICYDCCAgegAwIBAgIMDWpfCD8oXD5Rld9dMAoGCCqGSM49BAMCMIGRMQswCQYD +VQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAf +BgNVBAoTGFRydXN0d2F2ZSBIb2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3 +YXZlIEdsb2JhbCBFQ0MgUDI1NiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0x +NzA4MjMxOTM1MTBaFw00MjA4MjMxOTM1MTBaMIGRMQswCQYDVQQGEwJVUzERMA8G +A1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRydXN0 +d2F2ZSBIb2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBF +Q0MgUDI1NiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTBZMBMGByqGSM49AgEGCCqG +SM49AwEHA0IABH77bOYj43MyCMpg5lOcunSNGLB4kFKA3TjASh3RqMyTpJcGOMoN +FWLGjgEqZZ2q3zSRLoHB5DOSMcT9CTqmP62jQzBBMA8GA1UdEwEB/wQFMAMBAf8w +DwYDVR0PAQH/BAUDAwcGADAdBgNVHQ4EFgQUo0EGrJBt0UrrdaVKEJmzsaGLSvcw +CgYIKoZIzj0EAwIDRwAwRAIgB+ZU2g6gWrKuEZ+Hxbb/ad4lvvigtwjzRM4q3wgh +DDcCIC0mA6AFvWvR9lz4ZcyGbbOcNEhjhAnFjXca4syc4XR7 +-----END CERTIFICATE----- Added: head/secure/caroot/trusted/Trustwave_Global_ECC_P384_Certification_Authority.pem ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/caroot/trusted/Trustwave_Global_ECC_P384_Certification_Authority.pem Sat Sep 19 01:59:17 2020 (r365896) @@ -0,0 +1,68 @@ +## +## Trustwave Global ECC P384 Certification Authority +## +## This is a single X.509 certificate for a public Certificate +## Authority (CA). It was automatically extracted from Mozilla's +## root CA list (the file `certdata.txt' in security/nss). +## +## Extracted from nss +## with $FreeBSD: head/secure/caroot/MAca-bundle.pl 352951 2019-10-02 01:27:50Z kevans $ +## +## @generated +## +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 08:bd:85:97:6c:99:27:a4:80:68:47:3b + Signature Algorithm: ecdsa-with-SHA384 + Issuer: C = US, ST = Illinois, L = Chicago, O = "Trustwave Holdings, Inc.", CN = Trustwave Global ECC P384 Certification Authority + Validity + Not Before: Aug 23 19:36:43 2017 GMT + Not After : Aug 23 19:36:43 2042 GMT + Subject: C = US, ST = Illinois, L = Chicago, O = "Trustwave Holdings, Inc.", CN = Trustwave Global ECC P384 Certification Authority + Subject Public Key Info: + Public Key Algorithm: id-ecPublicKey + Public-Key: (384 bit) + pub: + 04:6b:da:0d:75:35:08:31:47:05:ae:45:99:55:f1: + 11:13:2e:4a:f8:10:31:23:a3:7e:83:d3:7f:28:08: + 3a:26:1a:3a:cf:97:82:1f:80:b7:27:09:8f:d1:8e: + 30:c4:0a:9b:0e:ac:58:04:ab:f7:36:7d:94:23:a4: + 9b:0a:8a:8b:ab:eb:fd:39:25:66:f1:5e:fe:8c:ae: + 8d:41:79:9d:09:60:ce:28:a9:d3:8a:6d:f3:d6:45: + d4:f2:98:84:38:65:a0 + ASN1 OID: secp384r1 + NIST CURVE: P-384 + X509v3 extensions: + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Subject Key Identifier: + 55:A9:84:89:D2:C1:32:BD:18:CB:6C:A6:07:4E:C8:E7:9D:BE:82:90 + Signature Algorithm: ecdsa-with-SHA384 + 30:64:02:30:37:01:92:97:45:12:7e:a0:f3:3e:ad:19:3a:72: + dd:f4:50:93:03:12:be:44:d2:4f:41:a4:8c:9c:9d:1f:a3:f6: + c2:92:e7:48:14:fe:4e:9b:a5:91:57:ae:c6:37:72:bb:02:30: + 67:25:0a:b1:0c:5e:ee:a9:63:92:6f:e5:90:0b:fe:66:22:ca: + 47:fd:8a:31:f7:83:fe:7a:bf:10:be:18:2b:1e:8f:f6:29:1e: + 94:59:ef:8e:21:37:cb:51:98:a5:6e:4b +SHA1 Fingerprint=E7:F3:A3:C8:CF:6F:C3:04:2E:6D:0E:67:32:C5:9E:68:95:0D:5E:D2 +-----BEGIN CERTIFICATE----- +MIICnTCCAiSgAwIBAgIMCL2Fl2yZJ6SAaEc7MAoGCCqGSM49BAMDMIGRMQswCQYD +VQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAf +BgNVBAoTGFRydXN0d2F2ZSBIb2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3 +YXZlIEdsb2JhbCBFQ0MgUDM4NCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0x +NzA4MjMxOTM2NDNaFw00MjA4MjMxOTM2NDNaMIGRMQswCQYDVQQGEwJVUzERMA8G +A1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRydXN0 +d2F2ZSBIb2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBF +Q0MgUDM4NCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTB2MBAGByqGSM49AgEGBSuB +BAAiA2IABGvaDXU1CDFHBa5FmVXxERMuSvgQMSOjfoPTfygIOiYaOs+Xgh+AtycJ +j9GOMMQKmw6sWASr9zZ9lCOkmwqKi6vr/TklZvFe/oyujUF5nQlgziip04pt89ZF +1PKYhDhloKNDMEEwDwYDVR0TAQH/BAUwAwEB/zAPBgNVHQ8BAf8EBQMDBwYAMB0G +A1UdDgQWBBRVqYSJ0sEyvRjLbKYHTsjnnb6CkDAKBggqhkjOPQQDAwNnADBkAjA3 +AZKXRRJ+oPM+rRk6ct30UJMDEr5E0k9BpIycnR+j9sKS50gU/k6bpZFXrsY3crsC +MGclCrEMXu6pY5Jv5ZAL/mYiykf9ijH3g/56vxC+GCsej/YpHpRZ744hN8tRmKVu +Sw== +-----END CERTIFICATE----- From owner-svn-src-all@freebsd.org Sat Sep 19 02:12:04 2020 Return-Path: Delivered-To: svn-src-all@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 B41FA3F7EC6; Sat, 19 Sep 2020 02:12:04 +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 4BtZ2r4QGwz4RyS; Sat, 19 Sep 2020 02:12:04 +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 7AFF7249BD; Sat, 19 Sep 2020 02:12:04 +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 08J2C4Jc081533; Sat, 19 Sep 2020 02:12:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08J2C41C081532; Sat, 19 Sep 2020 02:12:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009190212.08J2C41C081532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 19 Sep 2020 02:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365897 - releng/12.2/usr.sbin/certctl X-SVN-Group: releng X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: releng/12.2/usr.sbin/certctl X-SVN-Commit-Revision: 365897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 02:12:04 -0000 Author: kevans Date: Sat Sep 19 02:12:04 2020 New Revision: 365897 URL: https://svnweb.freebsd.org/changeset/base/365897 Log: MFS r365891: certctl: fix unprivileged mode The first issue was lack of quoting around INSTALLFLAGS, which set it incorrectly and produced an error on -M. The second issue was that we weren't actually doing the install in unprivileged mode, making it effectively useless. This was designed to pass through the proper metalog/unpriv flags to install(1), so just let it happen. Approved by: re (gjb) Modified: releng/12.2/usr.sbin/certctl/certctl.sh Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/usr.sbin/certctl/certctl.sh ============================================================================== --- releng/12.2/usr.sbin/certctl/certctl.sh Sat Sep 19 01:59:17 2020 (r365896) +++ releng/12.2/usr.sbin/certctl/certctl.sh Sat Sep 19 02:12:04 2020 (r365897) @@ -129,7 +129,7 @@ do_scan() [ -d "$CPATH" ] || continue echo "Scanning $CPATH for certificates..." for CFILE in $(ls -1 "${CPATH}" | grep -Ee "${FILEPAT}"); do - [ -e "$CPATH/$CFILE" -a $UNPRIV -eq 0 ] || continue + [ -e "$CPATH/$CFILE" ] || continue [ $VERBOSE -gt 0 ] && echo "Reading $CFILE" "$CFUNC" "$CPATH/$CFILE" done @@ -263,7 +263,7 @@ shift $(( $OPTIND - 1 )) : ${METALOG:=${DESTDIR}/METALOG} INSTALLFLAGS= -[ $UNPRIV -eq 1 ] && INSTALLFLAGS=-U -M ${METALOG} -D ${DESTDIR} +[ $UNPRIV -eq 1 ] && INSTALLFLAGS="-U -M ${METALOG} -D ${DESTDIR}" : ${TRUSTPATH:=${DESTDIR}/usr/share/certs/trusted:${DESTDIR}/usr/local/share/certs:${DESTDIR}/usr/local/etc/ssl/certs} : ${BLACKLISTPATH:=${DESTDIR}/usr/share/certs/blacklisted:${DESTDIR}/usr/local/etc/ssl/blacklisted} : ${CERTDESTDIR:=${DESTDIR}/etc/ssl/certs} From owner-svn-src-all@freebsd.org Sat Sep 19 02:15:57 2020 Return-Path: Delivered-To: svn-src-all@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 424453F7E56; Sat, 19 Sep 2020 02:15:57 +0000 (UTC) (envelope-from cperciva@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 4BtZ7K10nGz4SgQ; Sat, 19 Sep 2020 02:15:57 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDB5A24B21; Sat, 19 Sep 2020 02:15:56 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08J2Fuhs081737; Sat, 19 Sep 2020 02:15:56 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08J2FuVY081736; Sat, 19 Sep 2020 02:15:56 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202009190215.08J2FuVY081736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Sat, 19 Sep 2020 02:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365898 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 365898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 02:15:57 -0000 Author: cperciva Date: Sat Sep 19 02:15:56 2020 New Revision: 365898 URL: https://svnweb.freebsd.org/changeset/base/365898 Log: Move finalize_components_config from get_params to cmd_*. This allows us to redirect its output in cmd_cron, so that the "src component not installed, skipped" message will be treated the same way as other output from freebsd-update cron: Sent in an email to root (or other address specified) if there are updates to install, and silenced otherwise. PR: 202492 MFC After: 1 week Differential Revision: https://reviews.freebsd.org/D26432 Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Sat Sep 19 02:12:04 2020 (r365897) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Sat Sep 19 02:15:56 2020 (r365898) @@ -3300,12 +3300,12 @@ get_params () { parse_cmdline $@ parse_conffile default_params - finalize_components_config ${COMPONENTS} } # Fetch command. Make sure that we're being called # interactively, then run fetch_check_params and fetch_run cmd_fetch () { + finalize_components_config ${COMPONENTS} if [ ! -t 0 -a $NOTTYOK -eq 0 ]; then echo -n "`basename $0` fetch should not " echo "be run non-interactively." @@ -3326,6 +3326,7 @@ cmd_cron () { sleep `jot -r 1 0 3600` TMPFILE=`mktemp /tmp/freebsd-update.XXXXXX` || exit 1 + finalize_components_config ${COMPONENTS} >> ${TMPFILE} if ! fetch_run >> ${TMPFILE} || ! grep -q "No updates needed" ${TMPFILE} || [ ${VERBOSELEVEL} = "debug" ]; then @@ -3337,6 +3338,7 @@ cmd_cron () { # Fetch files for upgrading to a new release. cmd_upgrade () { + finalize_components_config ${COMPONENTS} upgrade_check_params upgrade_run || exit 1 } @@ -3344,6 +3346,7 @@ cmd_upgrade () { # Check if there are fetched updates ready to install. # Chdir into the working directory. cmd_updatesready () { + finalize_components_config ${COMPONENTS} # Check if working directory exists (if not, no updates pending) if ! [ -e "${WORKDIR}" ]; then echo "No updates are available to install." @@ -3368,24 +3371,28 @@ cmd_updatesready () { # Install downloaded updates. cmd_install () { + finalize_components_config ${COMPONENTS} install_check_params install_run || exit 1 } # Rollback most recently installed updates. cmd_rollback () { + finalize_components_config ${COMPONENTS} rollback_check_params rollback_run || exit 1 } # Compare system against a "known good" index. cmd_IDS () { + finalize_components_config ${COMPONENTS} IDS_check_params IDS_run || exit 1 } # Output configuration. cmd_showconfig () { + finalize_components_config ${COMPONENTS} for X in ${CONFIGOPTIONS}; do echo $X=$(eval echo \$${X}) done From owner-svn-src-all@freebsd.org Sat Sep 19 11:06:44 2020 Return-Path: Delivered-To: svn-src-all@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 955CB3DAA24; Sat, 19 Sep 2020 11:06:44 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Btnvm3lXFz4tdf; Sat, 19 Sep 2020 11:06:44 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63A4BB385; Sat, 19 Sep 2020 11:06:44 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08JB6i23010182; Sat, 19 Sep 2020 11:06:44 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JB6fE9010167; Sat, 19 Sep 2020 11:06:41 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202009191106.08JB6fE9010167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 19 Sep 2020 11:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365899 - in head: share/man/man9 sys/arm/include sys/arm64/arm64 sys/arm64/include sys/kern sys/mips/include sys/powerpc/include sys/riscv/include sys/sys sys/tools sys/x86/include X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in head: share/man/man9 sys/arm/include sys/arm64/arm64 sys/arm64/include sys/kern sys/mips/include sys/powerpc/include sys/riscv/include sys/sys sys/tools sys/x86/include X-SVN-Commit-Revision: 365899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 11:06:44 -0000 Author: mmel Date: Sat Sep 19 11:06:41 2020 New Revision: 365899 URL: https://svnweb.freebsd.org/changeset/base/365899 Log: Add NetBSD compatible bus_space_peek_N() and bus_space_poke_N() functions. One problem with the bus_space_read_N() and bus_space_write_N() family of functions is that they provide no protection against exceptions which can occur when no physical hardware or device responds to the read or write cycles. In such a situation, the system typically would panic due to a kernel-mode bus error. The bus_space_peek_N() and bus_space_poke_N() family of functions provide a mechanism to handle these exceptions gracefully without the risk of crashing the system. Typical example is access to PCI(e) configuration space in bus enumeration function on badly implemented PCI(e) root complexes (RK3399 or Neoverse N1 N1SDP and/or access to PCI(e) register when device is in deep sleep state. This commit adds a real implementation for arm64 only. The remaining architectures have bus_space_peek()/bus_space_poke() emulated by using bus_space_read()/bus_space_write() (without exception handling). MFC after: 1 month Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D25371 Modified: head/share/man/man9/bus_space.9 head/sys/arm/include/bus.h head/sys/arm64/arm64/bus_machdep.c head/sys/arm64/arm64/bus_space_asm.S head/sys/arm64/arm64/trap.c head/sys/arm64/include/bus.h head/sys/arm64/include/md_var.h head/sys/kern/subr_csan.c head/sys/mips/include/bus.h head/sys/powerpc/include/bus.h head/sys/riscv/include/bus.h head/sys/sys/_cscan_bus.h head/sys/sys/bus.h head/sys/tools/bus_macro.sh head/sys/x86/include/bus.h Modified: head/share/man/man9/bus_space.9 ============================================================================== --- head/share/man/man9/bus_space.9 Sat Sep 19 02:15:56 2020 (r365898) +++ head/share/man/man9/bus_space.9 Sat Sep 19 11:06:41 2020 (r365899) @@ -52,7 +52,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2017 +.Dd July 7, 2020 .Dt BUS_SPACE 9 .Os .Sh NAME @@ -68,6 +68,14 @@ .Nm bus_space_copy_region_stream_8 , .Nm bus_space_free , .Nm bus_space_map , +.Nm bus_space_peek_1 , +.Nm bus_space_peek_2 , +.Nm bus_space_peek_4 , +.Nm bus_space_peek_8 , +.Nm bus_space_poke_1 , +.Nm bus_space_poke_2 , +.Nm bus_space_poke_4 , +.Nm bus_space_poke_8 , .Nm bus_space_read_1 , .Nm bus_space_read_2 , .Nm bus_space_read_4 , @@ -161,6 +169,46 @@ .Fo bus_space_free .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t size" .Fc +.Ft int +.Fo bus_space_peek_1 +.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset" +.Fa "uint8_t *datap" +.Fc +.Ft int +.Fo bus_space_peek_2 +.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset" +.Fa "uint8_t *datap" +.Fc +.Ft int +.Fo bus_space_peek_4 +.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset" +.Fa "uint8_t *datap" +.Fc +.Ft int +.Fo bus_space_peek_8 +.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset" +.Fa "uint8_t *datap" +.Fc +.Ft int +.Fo bus_space_poke_1 +.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset" +.Fa "uint8_t *datap" +.Fc +.Ft int +.Fo bus_space_poke_2 +.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset" +.Fa "uint8_t *datap" +.Fc +.Ft int +.Fo bus_space_poke_4 +.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset" +.Fa "uint8_t *datap" +.Fc +.Ft int +.Fo bus_space_poke_8 +.Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset" +.Fa "uint8_t *datap" +.Fc .Ft uint8_t .Fo bus_space_read_1 .Fa "bus_space_tag_t space" "bus_space_handle_t handle" "bus_size_t offset" @@ -1124,6 +1172,105 @@ If they would fail (e.g.\& because of an argument error), that indicates a software bug which should cause a panic. In that case, they will never return. +.Sh PROBING BUS SPACE FOR HARDWARE WHICH MAY NOT RESPOND +One problem with the +.Fn bus_space_read_N +and +.Fn bus_space_write_N +family of functions is that they provide no protection against +exceptions which can occur when no physical hardware or +device responds to the read or write cycles. +In such a situation, the system typically would panic due to a kernel-mode +bus error. +The +.Fn bus_space_peek_N +and +.Fn bus_space_poke_N +family of functions provide a mechanism to handle these exceptions +gracefully without the risk of crashing the system. +.Pp +As with +.Fn bus_space_read_N +and +.Fn bus_space_write_N , +the peek and poke functions provide the ability to read and +write 1, 2, 4, and 8 byte data items on busses which support those +access sizes. +All of the constraints specified in the descriptions of the +.Fn bus_space_read_N +and +.Fn bus_space_write_N +functions also apply to +.Fn bus_space_peek_N +and +.Fn bus_space_poke_N . +.Pp +In addition, explicit calls to the +.Fn bus_space_barrier +function are not required as the implementation will ensure all +pending operations complete before the peek or poke operation starts. +The implementation will also ensure that the peek or poke operations +complete before returning. +.Pp +The return value indicates the outcome of the peek or poke operation. +A return value of zero implies that a hardware device is +responding to the operation at the specified offset in the bus space. +A non-zero return value indicates that the kernel intercepted a +hardware exception (e.g., bus error) when the peek or poke operation +was attempted. +Note that some busses are incapable of generating exceptions when +non-existent hardware is accessed. +In such cases, these functions will always return zero and the value of +the data read by +.Fn bus_space_peek_N +will be unspecified. +.Pp +Finally, it should be noted that at this time the +.Fn bus_space_peek_N +and +.Fn bus_space_poke_N +functions are not re-entrant and should not, therefore, be used +from within an interrupt service routine. +This constraint may be removed at some point in the future. +.Pp +.Bl -ohang -compact +.It Fn bus_space_peek_1 "space" "handle" "offset" "datap" +.It Fn bus_space_peek_2 "space" "handle" "offset" "datap" +.It Fn bus_space_peek_4 "space" "handle" "offset" "datap" +.It Fn bus_space_peek_8 "space" "handle" "offset" "datap" +.Pp +The +.Fn bus_space_peek_N +family of functions cautiously read a 1, 2, 4, or 8 byte data item from +the offset specified by +.Fa offset +in the region specified by +.Fa handle +of the bus space specified by +.Fa space . +The data item read is stored in the location pointed to by +.Fa datap . +It is permissible for +.Fa datap +to be NULL, in which case the data item will be discarded after being read. +.Pp +.It Fn bus_space_poke_1 "space" "handle" "offset" "value" +.It Fn bus_space_poke_2 "space" "handle" "offset" "value" +.It Fn bus_space_poke_4 "space" "handle" "offset" "value" +.It Fn bus_space_poke_8 "space" "handle" "offset" "value" +.Pp +The +.Fn bus_space_poke_N +family of functions cautiously write a 1, 2, 4, or 8 byte data item +specified by +.Fa value +to the offset specified by +.Fa offset +in the region specified by +.Fa handle +of the bus space specified by +.Fa space . +.El .Sh BARRIERS In order to allow high-performance buffering implementations to avoid bus activity on every operation, read and write ordering should be specified Modified: head/sys/arm/include/bus.h ============================================================================== --- head/sys/arm/include/bus.h Sat Sep 19 02:15:56 2020 (r365898) +++ head/sys/arm/include/bus.h Sat Sep 19 11:06:41 2020 (r365899) @@ -747,6 +747,33 @@ void generic_bs_unimplemented(void); #define BUS_SPACE_UNRESTRICTED (~0) +#define BUS_PEEK_FUNC(width, type) \ + static inline int \ + bus_space_peek_##width(bus_space_tag_t tag, \ + bus_space_handle_t hnd, bus_size_t offset, type *value) \ + { \ + type tmp; \ + tmp = bus_space_read_##width(tag, hnd, offset); \ + return (0); \ + } +BUS_PEEK_FUNC(1, uint8_t) +BUS_PEEK_FUNC(2, uint16_t) +BUS_PEEK_FUNC(4, uint32_t) +BUS_PEEK_FUNC(8, uint64_t) + +#define BUS_POKE_FUNC(width, type) \ + static inline int \ + bus_space_poke_##width(bus_space_tag_t tag, \ + bus_space_handle_t hnd, bus_size_t offset, type value) \ + { \ + bus_space_write_##width(tag, hnd, offset, value); \ + return (0); \ + } +BUS_POKE_FUNC(1, uint8_t) +BUS_POKE_FUNC(2, uint16_t) +BUS_POKE_FUNC(4, uint32_t) +BUS_POKE_FUNC(8, uint64_t) + #include /* Modified: head/sys/arm64/arm64/bus_machdep.c ============================================================================== --- head/sys/arm64/arm64/bus_machdep.c Sat Sep 19 02:15:56 2020 (r365898) +++ head/sys/arm64/arm64/bus_machdep.c Sat Sep 19 11:06:41 2020 (r365899) @@ -83,6 +83,16 @@ void generic_bs_wr_4(void *, bus_space_handle_t, bus_s void generic_bs_wr_8(void *, bus_space_handle_t, bus_size_t, const uint64_t *, bus_size_t); +int generic_bs_peek_1(void *, bus_space_handle_t, bus_size_t , uint8_t *); +int generic_bs_peek_2(void *, bus_space_handle_t, bus_size_t , uint16_t *); +int generic_bs_peek_4(void *, bus_space_handle_t, bus_size_t , uint32_t *); +int generic_bs_peek_8(void *, bus_space_handle_t, bus_size_t , uint64_t *); + +int generic_bs_poke_1(void *, bus_space_handle_t, bus_size_t, uint8_t); +int generic_bs_poke_2(void *, bus_space_handle_t, bus_size_t, uint16_t); +int generic_bs_poke_4(void *, bus_space_handle_t, bus_size_t, uint32_t); +int generic_bs_poke_8(void *, bus_space_handle_t, bus_size_t, uint64_t); + static int generic_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, bus_space_handle_t *bshp) @@ -223,6 +233,18 @@ struct bus_space memmap_bus = { .bs_wr_2_s = NULL, .bs_wr_4_s = NULL, .bs_wr_8_s = NULL, + + /* peek */ + .bs_peek_1 = generic_bs_peek_1, + .bs_peek_2 = generic_bs_peek_2, + .bs_peek_4 = generic_bs_peek_4, + .bs_peek_8 = generic_bs_peek_8, + + /* poke */ + .bs_poke_1 = generic_bs_poke_1, + .bs_poke_2 = generic_bs_poke_2, + .bs_poke_4 = generic_bs_poke_4, + .bs_poke_8 = generic_bs_poke_8, }; #ifdef FDT Modified: head/sys/arm64/arm64/bus_space_asm.S ============================================================================== --- head/sys/arm64/arm64/bus_space_asm.S Sat Sep 19 02:15:56 2020 (r365898) +++ head/sys/arm64/arm64/bus_space_asm.S Sat Sep 19 11:06:41 2020 (r365899) @@ -26,7 +26,6 @@ */ #include - __FBSDID("$FreeBSD$"); ENTRY(generic_bs_r_1) @@ -397,3 +396,84 @@ ENTRY(generic_bs_wr_8) 2: ret END(generic_bs_wr_8) + +ENTRY(generic_bs_fault) + mov x0, #-1 + ret +END(bus_fault) + +ENTRY(generic_bs_peek_1) + .globl generic_bs_peek_1f +generic_bs_peek_1f: + ldrb w0, [x1, x2] /* Checked instruction */ + dsb sy + strb w0,[x3] + mov x0, #0 + ret +END(generic_bs_peek_1) + +ENTRY(generic_bs_peek_2) + .globl generic_bs_peek_2f +generic_bs_peek_2f: + ldrh w0, [x1, x2] /* Checked instruction */ + dsb sy + strh w0,[x3] + mov x0, #0 + ret +END(generic_bs_peek_2) + +ENTRY(generic_bs_peek_4) + .globl generic_bs_peek_4f +generic_bs_peek_4f: + ldr w0, [x1, x2] /* Checked instruction */ + dsb sy + str w0,[x3] + mov x0, #0 + ret +END(generic_bs_peek_4) + +ENTRY(generic_bs_peek_8) + .globl generic_bs_peek_8f +generic_bs_peek_8f: + ldr x0, [x1, x2] /* Checked instruction */ + dsb sy + str x0,[x3] + mov x0, #0 + ret +END(generic_bs_peek_8) + +ENTRY(generic_bs_poke_1) + .globl generic_bs_poke_1f +generic_bs_poke_1f: + strb w3, [x1, x2] /* Checked instruction */ + dsb sy + mov x0, #0 + ret +END(generic_bs_poke_1) + +ENTRY(generic_bs_poke_2) + .globl generic_bs_poke_2f +generic_bs_poke_2f: + strh w3, [x1, x2] /* Checked instruction */ + dsb sy + mov x0, #0 + ret +END(generic_bs_poke_2) + +ENTRY(generic_bs_poke_4) + .globl generic_bs_poke_4f +generic_bs_poke_4f: + str w3, [x1, x2] /* Checked instruction */ + dsb sy + mov x0, #0 + ret +END(generic_bs_poke_4) + +ENTRY(generic_bs_poke_8) + .globl generic_bs_poke_8f +generic_bs_poke_8f: + str x3, [x1, x2] /* Checked instruction */ + dsb sy + mov x0, #0 + ret +END(generic_bs_poke_8) Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Sat Sep 19 02:15:56 2020 (r365898) +++ head/sys/arm64/arm64/trap.c Sat Sep 19 11:06:41 2020 (r365899) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -88,6 +89,7 @@ typedef void (abort_handler)(struct thread *, struct t static abort_handler align_abort; static abort_handler data_abort; +static abort_handler external_abort; static abort_handler *abort_handlers[] = { [ISS_DATA_DFSC_TF_L0] = data_abort, @@ -101,6 +103,7 @@ static abort_handler *abort_handlers[] = { [ISS_DATA_DFSC_PF_L2] = data_abort, [ISS_DATA_DFSC_PF_L3] = data_abort, [ISS_DATA_DFSC_ALIGN] = align_abort, + [ISS_DATA_DFSC_EXT] = external_abort, }; static __inline void @@ -154,6 +157,28 @@ cpu_fetch_syscall_args(struct thread *td) #include "../../kern/subr_syscall.c" +/* + * Test for fault generated by given access instruction in + * bus_peek_ or bus_poke_ bus function. + */ +extern uint32_t generic_bs_peek_1f, generic_bs_peek_2f; +extern uint32_t generic_bs_peek_4f, generic_bs_peek_8f; +extern uint32_t generic_bs_poke_1f, generic_bs_poke_2f; +extern uint32_t generic_bs_poke_4f, generic_bs_poke_8f; + +static bool +test_bs_fault(void *addr) +{ + return (addr == &generic_bs_peek_1f || + addr == &generic_bs_peek_2f || + addr == &generic_bs_peek_4f || + addr == &generic_bs_peek_8f || + addr == &generic_bs_poke_1f || + addr == &generic_bs_poke_2f || + addr == &generic_bs_poke_4f || + addr == &generic_bs_poke_8f); +} + static void svc_handler(struct thread *td, struct trapframe *frame) { @@ -182,6 +207,26 @@ align_abort(struct thread *td, struct trapframe *frame call_trapsignal(td, SIGBUS, BUS_ADRALN, (void *)frame->tf_elr, ESR_ELx_EXCEPTION(frame->tf_esr)); userret(td, frame); +} + + +static void +external_abort(struct thread *td, struct trapframe *frame, uint64_t esr, + uint64_t far, int lower) +{ + + /* + * Try to handle synchronous external aborts caused by + * bus_space_peek() and/or bus_space_poke() functions. + */ + if (!lower && test_bs_fault((void *)frame->tf_elr)) { + frame->tf_elr = (uint64_t)generic_bs_fault; + return; + } + + print_registers(frame); + printf(" far: %16lx\n", far); + panic("Unhandled EL%d external data abort", lower ? 0: 1); } static void Modified: head/sys/arm64/include/bus.h ============================================================================== --- head/sys/arm64/include/bus.h Sat Sep 19 02:15:56 2020 (r365898) +++ head/sys/arm64/include/bus.h Sat Sep 19 11:06:41 2020 (r365899) @@ -259,6 +259,24 @@ struct bus_space { bus_size_t, const u_int32_t *, bus_size_t); void (*bs_wr_8_s) (void *, bus_space_handle_t, bus_size_t, const u_int64_t *, bus_size_t); + /* peek */ + int (*bs_peek_1)(void *, bus_space_handle_t, + bus_size_t , uint8_t *); + int (*bs_peek_2)(void *, bus_space_handle_t, + bus_size_t , uint16_t *); + int (*bs_peek_4)(void *, bus_space_handle_t, + bus_size_t , uint32_t *); + int (*bs_peek_8)(void *, bus_space_handle_t, + bus_size_t , uint64_t *); + /* poke */ + int (*bs_poke_1)(void *, bus_space_handle_t, + bus_size_t, uint8_t); + int (*bs_poke_2)(void *, bus_space_handle_t, + bus_size_t, uint16_t); + int (*bs_poke_4)(void *, bus_space_handle_t, + bus_size_t, uint32_t); + int (*bs_poke_8)(void *, bus_space_handle_t, + bus_size_t, uint64_t); }; /* @@ -283,6 +301,10 @@ struct bus_space { (*(t)->__bs_opname_s(r,sz))((t)->bs_cookie, h, o) #define __bs_ws_s(sz, t, h, o, v) \ (*(t)->__bs_opname_s(w,sz))((t)->bs_cookie, h, o, v) +#define __bs_peek(sz, t, h, o, vp) \ + (*(t)->__bs_opname(peek, sz))((t)->bs_cookie, h, o, vp) +#define __bs_poke(sz, t, h, o, v) \ + (*(t)->__bs_opname(poke, sz))((t)->bs_cookie, h, o, v) #define __bs_nonsingle_s(type, sz, t, h, o, a, c) \ (*(t)->__bs_opname_s(type,sz))((t)->bs_cookie, h, o, a, c) @@ -456,6 +478,22 @@ struct bus_space { __bs_copy(4, t, h1, o1, h2, o2, c) #define bus_space_copy_region_8(t, h1, o1, h2, o2, c) \ __bs_copy(8, t, h1, o1, h2, o2, c) + +/* + * Poke (checked write) operations. + */ +#define bus_space_poke_1(t, h, o, v) __bs_poke(1, (t), (h), (o), (v)) +#define bus_space_poke_2(t, h, o, v) __bs_poke(2, (t), (h), (o), (v)) +#define bus_space_poke_4(t, h, o, v) __bs_poke(4, (t), (h), (o), (v)) +#define bus_space_poke_8(t, h, o, v) __bs_poke(8, (t), (h), (o), (v)) + +/* + * Peek (checked read) operations. + */ +#define bus_space_peek_1(t, h, o, vp) __bs_peek(1, (t), (h), (o), (vp)) +#define bus_space_peek_2(t, h, o, vp) __bs_peek(2, (t), (h), (o), (vp)) +#define bus_space_peek_4(t, h, o, vp) __bs_peek(4, (t), (h), (o), (vp)) +#define bus_space_peek_8(t, h, o, vp) __bs_peek(8, (t), (h), (o), (vp)) #endif Modified: head/sys/arm64/include/md_var.h ============================================================================== --- head/sys/arm64/include/md_var.h Sat Sep 19 02:15:56 2020 (r365898) +++ head/sys/arm64/include/md_var.h Sat Sep 19 11:06:41 2020 (r365899) @@ -48,5 +48,14 @@ void busdma_swi(void); void dump_add_page(vm_paddr_t); void dump_drop_page(vm_paddr_t); int minidumpsys(struct dumperinfo *); +void generic_bs_fault(void) __asm(__STRING(generic_bs_fault)); +void generic_bs_peek_1(void) __asm(__STRING(generic_bs_peek_1)); +void generic_bs_peek_2(void) __asm(__STRING(generic_bs_peek_2)); +void generic_bs_peek_4(void) __asm(__STRING(generic_bs_peek_4)); +void generic_bs_peek_8(void) __asm(__STRING(generic_bs_peek_8)); +void generic_bs_poke_1(void) __asm(__STRING(generic_bs_poke_1)); +void generic_bs_poke_2(void) __asm(__STRING(generic_bs_poke_2)); +void generic_bs_poke_4(void) __asm(__STRING(generic_bs_poke_4)); +void generic_bs_poke_8(void) __asm(__STRING(generic_bs_poke_8)); #endif /* !_MACHINE_MD_VAR_H_ */ Modified: head/sys/kern/subr_csan.c ============================================================================== --- head/sys/kern/subr_csan.c Sat Sep 19 02:15:56 2020 (r365898) +++ head/sys/kern/subr_csan.c Sat Sep 19 11:06:41 2020 (r365899) @@ -878,3 +878,33 @@ CSAN_BUS_SET_FUNC(multi_stream, 8, uint64_t) CSAN_BUS_SET_FUNC(region_stream, 8, uint64_t) #endif #endif + +#define CSAN_BUS_PEEK_FUNC(width, type) \ + int kcsan_bus_space_peek_##width(bus_space_tag_t tag, \ + bus_space_handle_t hnd, bus_size_t offset, type *value) \ + { \ + kcsan_access((uintptr_t)value, sizeof(type), true, false, \ + __RET_ADDR); \ + return (bus_space_peek_##width(tag, hnd, offset, value)); \ + } + +CSAN_BUS_PEEK_FUNC(1, uint8_t) +CSAN_BUS_PEEK_FUNC(2, uint16_t) +CSAN_BUS_PEEK_FUNC(4, uint32_t) +#if !defined(__i386__) +CSAN_BUS_PEEK_FUNC(8, uint64_t) +#endif + +#define CSAN_BUS_POKE_FUNC(width, type) \ + int kcsan_bus_space_poke_##width(bus_space_tag_t tag, \ + bus_space_handle_t hnd, bus_size_t offset, type value) \ + { \ + return (bus_space_poke_##width(tag, hnd, offset, value)); \ + } + +CSAN_BUS_POKE_FUNC(1, uint8_t) +CSAN_BUS_POKE_FUNC(2, uint16_t) +CSAN_BUS_POKE_FUNC(4, uint32_t) +#if !defined(__i386__) +CSAN_BUS_POKE_FUNC(8, uint64_t) +#endif Modified: head/sys/mips/include/bus.h ============================================================================== --- head/sys/mips/include/bus.h Sat Sep 19 02:15:56 2020 (r365898) +++ head/sys/mips/include/bus.h Sat Sep 19 11:06:41 2020 (r365899) @@ -689,6 +689,33 @@ void __bs_c(f,_bs_c_8) (void *t, bus_space_handle_t bs bs_c_4_proto(f); \ bs_c_8_proto(f); +#define BUS_PEEK_FUNC(width, type) \ + static inline int \ + bus_space_peek_##width(bus_space_tag_t tag, \ + bus_space_handle_t hnd, bus_size_t offset, type *value) \ + { \ + type tmp; \ + tmp = bus_space_read_##width(tag, hnd, offset); \ + return (0); \ + } +BUS_PEEK_FUNC(1, uint8_t) +BUS_PEEK_FUNC(2, uint16_t) +BUS_PEEK_FUNC(4, uint32_t) +BUS_PEEK_FUNC(8, uint64_t) + +#define BUS_POKE_FUNC(width, type) \ + static inline int \ + bus_space_poke_##width(bus_space_tag_t tag, \ + bus_space_handle_t hnd, bus_size_t offset, type value) \ + { \ + bus_space_write_##width(tag, hnd, offset, value); \ + return (0); \ + } +BUS_POKE_FUNC(1, uint8_t) +BUS_POKE_FUNC(2, uint16_t) +BUS_POKE_FUNC(4, uint32_t) +BUS_POKE_FUNC(8, uint64_t) + #define BUS_SPACE_ALIGNED_POINTER(p, t) ALIGNED_POINTER(p, t) #define BUS_SPACE_MAXADDR_24BIT 0xFFFFFF Modified: head/sys/powerpc/include/bus.h ============================================================================== --- head/sys/powerpc/include/bus.h Sat Sep 19 02:15:56 2020 (r365898) +++ head/sys/powerpc/include/bus.h Sat Sep 19 11:06:41 2020 (r365899) @@ -462,6 +462,33 @@ extern struct bus_space bs_le_tag; __bs_copy(s_8, t, h1, o1, h2, o2, c) #endif +#define BUS_PEEK_FUNC(width, type) \ + static inline int \ + bus_space_peek_##width(bus_space_tag_t tag, \ + bus_space_handle_t hnd, bus_size_t offset, type *value) \ + { \ + type tmp; \ + tmp = bus_space_read_##width(tag, hnd, offset); \ + return (0); \ + } +BUS_PEEK_FUNC(1, uint8_t) +BUS_PEEK_FUNC(2, uint16_t) +BUS_PEEK_FUNC(4, uint32_t) +BUS_PEEK_FUNC(8, uint64_t) + +#define BUS_POKE_FUNC(width, type) \ + static inline int \ + bus_space_poke_##width(bus_space_tag_t tag, \ + bus_space_handle_t hnd, bus_size_t offset, type value) \ + { \ + bus_space_write_##width(tag, hnd, offset, value); \ + return (0); \ + } +BUS_POKE_FUNC(1, uint8_t) +BUS_POKE_FUNC(2, uint16_t) +BUS_POKE_FUNC(4, uint32_t) +BUS_POKE_FUNC(8, uint64_t) + #include #endif /* _MACHINE_BUS_H_ */ Modified: head/sys/riscv/include/bus.h ============================================================================== --- head/sys/riscv/include/bus.h Sat Sep 19 02:15:56 2020 (r365898) +++ head/sys/riscv/include/bus.h Sat Sep 19 11:06:41 2020 (r365899) @@ -451,6 +451,33 @@ struct bus_space { #define bus_space_copy_region_8(t, h1, o1, h2, o2, c) \ __bs_copy(8, t, h1, o1, h2, o2, c) +#define BUS_PEEK_FUNC(width, type) \ + static inline int \ + bus_space_peek_##width(bus_space_tag_t tag, \ + bus_space_handle_t hnd, bus_size_t offset, type *value) \ + { \ + type tmp; \ + tmp = bus_space_read_##width(tag, hnd, offset); \ + return (0); \ + } +BUS_PEEK_FUNC(1, uint8_t) +BUS_PEEK_FUNC(2, uint16_t) +BUS_PEEK_FUNC(4, uint32_t) +BUS_PEEK_FUNC(8, uint64_t) + +#define BUS_POKE_FUNC(width, type) \ + static inline int \ + bus_space_poke_##width(bus_space_tag_t tag, \ + bus_space_handle_t hnd, bus_size_t offset, type value) \ + { \ + bus_space_write_##width(tag, hnd, offset, value); \ + return (0); \ + } +BUS_POKE_FUNC(1, uint8_t) +BUS_POKE_FUNC(2, uint16_t) +BUS_POKE_FUNC(4, uint32_t) +BUS_POKE_FUNC(8, uint64_t) + #include #endif /* _MACHINE_BUS_H_ */ Modified: head/sys/sys/_cscan_bus.h ============================================================================== --- head/sys/sys/_cscan_bus.h Sat Sep 19 02:15:56 2020 (r365898) +++ head/sys/sys/_cscan_bus.h Sat Sep 19 11:06:41 2020 (r365899) @@ -77,11 +77,21 @@ bus_space_handle_t, bus_size_t, bus_space_handle_t, \ bus_size_t, bus_size_t); +#define KCSAN_BS_PEEK(width, type) \ + int kcsan_bus_space_peek_##width(bus_space_tag_t, \ + bus_space_handle_t, bus_size_t, type *); + +#define KCSAN_BS_POKE(width, type) \ + int kcsan_bus_space_poke_##width(bus_space_tag_t, \ + bus_space_handle_t, bus_size_t, type); + #define KCSAN_BS(width, type) \ KCSAN_BS_READ(width, type); \ KCSAN_BS_WRITE(width, type); \ KCSAN_BS_SET(width, type); \ - KCSAN_BS_COPY(width, type) + KCSAN_BS_COPY(width, type) \ + KCSAN_BS_PEEK(width, type); \ + KCSAN_BS_POKE(width, type); KCSAN_BS(1, uint8_t); KCSAN_BS(2, uint16_t); @@ -127,6 +137,8 @@ void kcsan_bus_space_barrier(bus_space_tag_t, bus_spac #define bus_space_set_region_stream_1 kcsan_bus_space_set_region_stream_1 #define bus_space_copy_multi_1 kcsan_bus_space_copy_multi_1 #define bus_space_copy_multi_stream_1 kcsan_bus_space_copy_multi_stream_1 +#define bus_space_poke_1 kcsan_bus_space_poke_1 +#define bus_space_peek_1 kcsan_bus_space_peek_1 #define bus_space_read_2 kcsan_bus_space_read_2 #define bus_space_read_stream_2 kcsan_bus_space_read_stream_2 @@ -146,6 +158,8 @@ void kcsan_bus_space_barrier(bus_space_tag_t, bus_spac #define bus_space_set_region_stream_2 kcsan_bus_space_set_region_stream_2 #define bus_space_copy_multi_2 kcsan_bus_space_copy_multi_2 #define bus_space_copy_multi_stream_2 kcsan_bus_space_copy_multi_stream_2 +#define bus_space_poke_2 kcsan_bus_space_poke_2 +#define bus_space_peek_2 kcsan_bus_space_peek_2 #define bus_space_read_4 kcsan_bus_space_read_4 #define bus_space_read_stream_4 kcsan_bus_space_read_stream_4 @@ -165,6 +179,8 @@ void kcsan_bus_space_barrier(bus_space_tag_t, bus_spac #define bus_space_set_region_stream_4 kcsan_bus_space_set_region_stream_4 #define bus_space_copy_multi_4 kcsan_bus_space_copy_multi_4 #define bus_space_copy_multi_stream_4 kcsan_bus_space_copy_multi_stream_4 +#define bus_space_poke_4 kcsan_bus_space_poke_4 +#define bus_space_peek_4 kcsan_bus_space_peek_4 #define bus_space_read_8 kcsan_bus_space_read_8 #define bus_space_read_stream_8 kcsan_bus_space_read_stream_8 @@ -184,6 +200,9 @@ void kcsan_bus_space_barrier(bus_space_tag_t, bus_spac #define bus_space_set_region_stream_8 kcsan_bus_space_set_region_stream_8 #define bus_space_copy_multi_8 kcsan_bus_space_copy_multi_8 #define bus_space_copy_multi_stream_8 kcsan_bus_space_copy_multi_stream_8 +#define bus_space_poke_8 kcsan_bus_space_poke_8 +#define bus_space_peek_8 kcsan_bus_space_peek_8 + #endif /* !KCSAN_RUNTIME */ Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Sat Sep 19 02:15:56 2020 (r365898) +++ head/sys/sys/bus.h Sat Sep 19 11:06:41 2020 (r365899) @@ -827,6 +827,10 @@ static __inline void varp ## _set_ ## var(device_t dev #define bus_barrier(r, o, l, f) \ bus_space_barrier((r)->r_bustag, (r)->r_bushandle, (o), (l), (f)) +#define bus_poke_1(r, o, v) \ + bus_space_poke_1((r)->r_bustag, (r)->r_bushandle, (o), (v)) +#define bus_peek_1(r, o, vp) \ + bus_space_peek_1((r)->r_bustag, (r)->r_bushandle, (o), (vp)) #define bus_read_1(r, o) \ bus_space_read_1((r)->r_bustag, (r)->r_bushandle, (o)) #define bus_read_multi_1(r, o, d, c) \ @@ -859,6 +863,10 @@ static __inline void varp ## _set_ ## var(device_t dev bus_space_write_multi_stream_1((r)->r_bustag, (r)->r_bushandle, (o), (d), (c)) #define bus_write_region_stream_1(r, o, d, c) \ bus_space_write_region_stream_1((r)->r_bustag, (r)->r_bushandle, (o), (d), (c)) +#define bus_poke_2(r, o, v) \ + bus_space_poke_2((r)->r_bustag, (r)->r_bushandle, (o), (v)) +#define bus_peek_2(r, o, vp) \ + bus_space_peek_2((r)->r_bustag, (r)->r_bushandle, (o), (vp)) #define bus_read_2(r, o) \ bus_space_read_2((r)->r_bustag, (r)->r_bushandle, (o)) #define bus_read_multi_2(r, o, d, c) \ @@ -891,6 +899,10 @@ static __inline void varp ## _set_ ## var(device_t dev bus_space_write_multi_stream_2((r)->r_bustag, (r)->r_bushandle, (o), (d), (c)) #define bus_write_region_stream_2(r, o, d, c) \ bus_space_write_region_stream_2((r)->r_bustag, (r)->r_bushandle, (o), (d), (c)) +#define bus_poke_4(r, o, v) \ + bus_space_poke_4((r)->r_bustag, (r)->r_bushandle, (o), (v)) +#define bus_peek_4(r, o, vp) \ + bus_space_peek_4((r)->r_bustag, (r)->r_bushandle, (o), (vp)) #define bus_read_4(r, o) \ bus_space_read_4((r)->r_bustag, (r)->r_bushandle, (o)) #define bus_read_multi_4(r, o, d, c) \ @@ -923,6 +935,10 @@ static __inline void varp ## _set_ ## var(device_t dev bus_space_write_multi_stream_4((r)->r_bustag, (r)->r_bushandle, (o), (d), (c)) #define bus_write_region_stream_4(r, o, d, c) \ bus_space_write_region_stream_4((r)->r_bustag, (r)->r_bushandle, (o), (d), (c)) +#define bus_poke_8(r, o, v) \ + bus_space_poke_8((r)->r_bustag, (r)->r_bushandle, (o), (v)) +#define bus_peek_8(r, o, vp) \ + bus_space_peek_8((r)->r_bustag, (r)->r_bushandle, (o), (vp)) #define bus_read_8(r, o) \ bus_space_read_8((r)->r_bustag, (r)->r_bushandle, (o)) #define bus_read_multi_8(r, o, d, c) \ Modified: head/sys/tools/bus_macro.sh ============================================================================== --- head/sys/tools/bus_macro.sh Sat Sep 19 02:15:56 2020 (r365898) +++ head/sys/tools/bus_macro.sh Sat Sep 19 11:06:41 2020 (r365899) @@ -55,7 +55,8 @@ for w in 1 2 4 8 do # macro copy_region_$w so dh do c # macro copy_region_stream_$w ? - # macro peek_$w + macro poke_$w o v + macro peek_$w o vp for s in "" stream_ do macro read_$s$w o Modified: head/sys/x86/include/bus.h ============================================================================== --- head/sys/x86/include/bus.h Sat Sep 19 02:15:56 2020 (r365898) +++ head/sys/x86/include/bus.h Sat Sep 19 11:06:41 2020 (r365899) @@ -1089,6 +1089,31 @@ bus_space_barrier(bus_space_tag_t tag __unused, bus_sp #define bus_space_copy_region_stream_4(t, h1, o1, h2, o2, c) \ bus_space_copy_region_4((t), (h1), (o1), (h2), (o2), (c)) +#define BUS_PEEK_FUNC(width, type) \ + static inline int \ + bus_space_peek_##width(bus_space_tag_t tag, \ + bus_space_handle_t hnd, bus_size_t offset, type *value) \ + { \ + type tmp; \ + tmp = bus_space_read_##width(tag, hnd, offset); \ + return (0); \ + } +BUS_PEEK_FUNC(1, uint8_t) +BUS_PEEK_FUNC(2, uint16_t) +BUS_PEEK_FUNC(4, uint32_t) + +#define BUS_POKE_FUNC(width, type) \ + static inline int \ + bus_space_poke_##width(bus_space_tag_t tag, \ + bus_space_handle_t hnd, bus_size_t offset, type value) \ + { \ + bus_space_write_##width(tag, hnd, offset, value); \ + return (0); \ + } +BUS_POKE_FUNC(1, uint8_t) +BUS_POKE_FUNC(2, uint16_t) +BUS_POKE_FUNC(4, uint32_t) + #endif /* KCSAN && !KCSAN_RUNTIME */ #endif /* _X86_BUS_H_ */ From owner-svn-src-all@freebsd.org Sat Sep 19 11:27:16 2020 Return-Path: Delivered-To: svn-src-all@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 EA79A3DB596; Sat, 19 Sep 2020 11:27:16 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BtpMS5t5Vz3RQW; Sat, 19 Sep 2020 11:27:16 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC604B429; Sat, 19 Sep 2020 11:27:16 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08JBRGjH022716; Sat, 19 Sep 2020 11:27:16 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JBRG6V022715; Sat, 19 Sep 2020 11:27:16 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202009191127.08JBRG6V022715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 19 Sep 2020 11:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365900 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 365900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 11:27:17 -0000 Author: mmel Date: Sat Sep 19 11:27:16 2020 New Revision: 365900 URL: https://svnweb.freebsd.org/changeset/base/365900 Log: Implement workaround for broken access to configuration space. Due to a HW bug in the RockChip PCIe implementation, attempting to access a non-existent register in the configuration space will throw an exception. Use new bus functions bus_peek() and bus_poke() to overcomme this limitation. Modified: head/sys/arm64/rockchip/rk_pcie.c Modified: head/sys/arm64/rockchip/rk_pcie.c ============================================================================== --- head/sys/arm64/rockchip/rk_pcie.c Sat Sep 19 11:06:41 2020 (r365899) +++ head/sys/arm64/rockchip/rk_pcie.c Sat Sep 19 11:27:16 2020 (r365900) @@ -310,7 +310,7 @@ rk_pcie_check_dev(struct rk_pcie_softc *sc, u_int bus, uint32_t val; if (bus < sc->bus_start || bus > sc->bus_end || slot > PCI_SLOTMAX || - func > PCI_FUNCMAX || reg > PCI_REGMAX) + func > PCI_FUNCMAX || reg > PCIE_REGMAX) return (false); if (bus == sc->root_bus) { @@ -325,8 +325,8 @@ rk_pcie_check_dev(struct rk_pcie_softc *sc, u_int bus, if (STATUS1_LINK_ST_GET(val) != STATUS1_LINK_ST_UP) return (false); - /* only one device is on first subordinate bus */ - if (bus == sc->sub_bus && slot) + /* only one device can be on first subordinate bus */ + if (bus == sc->sub_bus && slot != 0 ) return (false); return (true); } @@ -452,45 +452,41 @@ rk_pcie_read_config(device_t dev, u_int bus, u_int slo u_int func, u_int reg, int bytes) { struct rk_pcie_softc *sc; - uint32_t data; + uint32_t d32, data; + uint16_t d16; + uint8_t d8; uint64_t addr; - int type; + int type, ret; sc = device_get_softc(dev); if (!rk_pcie_check_dev(sc, bus, slot, func, reg)) return (0xFFFFFFFFU); - if (bus == sc->root_bus) return (rk_pcie_local_cfg_read(sc, false, reg, bytes)); addr = ATU_CFG_BUS(bus) | ATU_CFG_SLOT(slot) | ATU_CFG_FUNC(func) | ATU_CFG_REG(reg); - if (bus == sc->sub_bus) { - type = ATU_TYPE_CFG0; - } else { - type = ATU_TYPE_CFG1; - /* - * XXX FIXME: any attempt to generate type1 configuration - * access causes external data abort - */ - return (0xFFFFFFFFU); - } + type = bus == sc->sub_bus ? ATU_TYPE_CFG0: ATU_TYPE_CFG1; rk_pcie_map_cfg_atu(sc, 0, type); + ret = -1; switch (bytes) { case 1: - data = bus_read_1(sc->axi_mem_res, addr); + ret = bus_peek_1(sc->axi_mem_res, addr, &d8); + data = d8; break; case 2: - data = bus_read_2(sc->axi_mem_res, addr); + ret = bus_peek_2(sc->axi_mem_res, addr, &d16); + data = d16; break; case 4: - data = bus_read_4(sc->axi_mem_res, addr); + ret = bus_peek_4(sc->axi_mem_res, addr, &d32); + data = d32; break; - default: - data = 0xFFFFFFFFU; } + if (ret != 0) + data = 0xFFFFFFFF; return (data); } @@ -512,27 +508,18 @@ rk_pcie_write_config(device_t dev, u_int bus, u_int sl addr = ATU_CFG_BUS(bus) | ATU_CFG_SLOT(slot) | ATU_CFG_FUNC(func) | ATU_CFG_REG(reg); - if (bus == sc->sub_bus){ - type = ATU_TYPE_CFG0; - } else { - type = ATU_TYPE_CFG1; - /* - * XXX FIXME: any attempt to generate type1 configuration - * access causes external data abort - */ - return; - } + type = bus == sc->sub_bus ? ATU_TYPE_CFG0: ATU_TYPE_CFG1; rk_pcie_map_cfg_atu(sc, 0, type); switch (bytes) { case 1: - bus_write_1(sc->axi_mem_res, addr, val); + bus_poke_1(sc->axi_mem_res, addr, (uint8_t)val); break; case 2: - bus_write_2(sc->axi_mem_res, addr, val); + bus_poke_2(sc->axi_mem_res, addr, (uint16_t)val); break; case 4: - bus_write_4(sc->axi_mem_res, addr, val); + bus_poke_4(sc->axi_mem_res, addr, val); break; default: break; From owner-svn-src-all@freebsd.org Sat Sep 19 12:08:18 2020 Return-Path: Delivered-To: svn-src-all@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 5591E3DE254; Sat, 19 Sep 2020 12:08:18 +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 4BtqGp1ZX1z3Vh1; Sat, 19 Sep 2020 12:08:18 +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 197B8BEC2; Sat, 19 Sep 2020 12:08:18 +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 08JC8Het047876; Sat, 19 Sep 2020 12:08:17 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JC8Giu047870; Sat, 19 Sep 2020 12:08:16 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202009191208.08JC8Giu047870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Sat, 19 Sep 2020 12:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365901 - in head: cddl/lib/libspl tools/build/cross-build/include/common tools/build/cross-build/include/common/sys tools/build/cross-build/include/linux/sys tools/build/cross-build/in... X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: cddl/lib/libspl tools/build/cross-build/include/common tools/build/cross-build/include/common/sys tools/build/cross-build/include/linux/sys tools/build/cross-build/include/mac/sys tools/build... X-SVN-Commit-Revision: 365901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 12:08:18 -0000 Author: arichardson Date: Sat Sep 19 12:08:16 2020 New Revision: 365901 URL: https://svnweb.freebsd.org/changeset/base/365901 Log: Fix dtrace tools bootstrap on non-FreeBSD after OpenZFS import This required surprisingly few build system changes and only two changes to the openZFS compat headers which have been upstreamed as https://github.com/openzfs/zfs/pull/10863 Reviewed By: #zfs, freqlabs Differential Revision: https://reviews.freebsd.org/D26193 Deleted: head/tools/build/cross-build/include/common/sys/uio.h Modified: head/cddl/lib/libspl/Makefile head/tools/build/cross-build/include/common/string.h head/tools/build/cross-build/include/common/sys/cdefs.h head/tools/build/cross-build/include/linux/sys/stat.h head/tools/build/cross-build/include/mac/sys/_types.h head/tools/build/mk/Makefile.boot Modified: head/cddl/lib/libspl/Makefile ============================================================================== --- head/cddl/lib/libspl/Makefile Sat Sep 19 11:27:16 2020 (r365900) +++ head/cddl/lib/libspl/Makefile Sat Sep 19 12:08:16 2020 (r365901) @@ -14,13 +14,14 @@ SRCS = \ list.c \ mkdirp.c \ page.c \ - strlcat.c \ - strlcpy.c \ timestamp.c \ zone.c \ include/sys/list.h \ include/sys/list_impl.h +# These functions are not required when bootstrapping and the atomic code +# will not compile when building on macOS. +.if !defined(BOOTSTRAPPING) SRCS += \ getexecname.c \ gethostid.c \ @@ -37,6 +38,7 @@ SRCS += atomic.S .else .PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libspl/asm-generic SRCS += atomic.c +.endif .endif Modified: head/tools/build/cross-build/include/common/string.h ============================================================================== --- head/tools/build/cross-build/include/common/string.h Sat Sep 19 11:27:16 2020 (r365900) +++ head/tools/build/cross-build/include/common/string.h Sat Sep 19 12:08:16 2020 (r365901) @@ -37,6 +37,10 @@ */ #pragma once +/* Avoid incompatible opensolaris redeclarations (without _FORTIFY_SOURCE). */ +#define HAVE_STRLCAT 1 +#define HAVE_STRLCPY 1 + #include_next /* * FreeBSD string.h #includes strings.h and all libmd code depends on Modified: head/tools/build/cross-build/include/common/sys/cdefs.h ============================================================================== --- head/tools/build/cross-build/include/common/sys/cdefs.h Sat Sep 19 11:27:16 2020 (r365900) +++ head/tools/build/cross-build/include/common/sys/cdefs.h Sat Sep 19 12:08:16 2020 (r365901) @@ -276,3 +276,11 @@ typedef unsigned long u_long; #ifndef __DEQUALIFY #define __DEQUALIFY(type, var) ((type)(__uintptr_t)(const volatile void *)(var)) #endif + + +/* Expose all declarations when using FreeBSD headers */ +#define __POSIX_VISIBLE 200809 +#define __XSI_VISIBLE 700 +#define __BSD_VISIBLE 1 +#define __ISO_C_VISIBLE 2011 +#define __EXT1_VISIBLE 1 Modified: head/tools/build/cross-build/include/linux/sys/stat.h ============================================================================== --- head/tools/build/cross-build/include/linux/sys/stat.h Sat Sep 19 11:27:16 2020 (r365900) +++ head/tools/build/cross-build/include/linux/sys/stat.h Sat Sep 19 12:08:16 2020 (r365901) @@ -59,3 +59,6 @@ #ifndef S_ISTXT #define S_ISTXT S_ISVTX #endif + +/* This include is needed for OpenZFS bootstrap */ +#include Modified: head/tools/build/cross-build/include/mac/sys/_types.h ============================================================================== --- head/tools/build/cross-build/include/mac/sys/_types.h Sat Sep 19 11:27:16 2020 (r365900) +++ head/tools/build/cross-build/include/mac/sys/_types.h Sat Sep 19 12:08:16 2020 (r365901) @@ -43,3 +43,5 @@ * __darwin_ct_rune_t exists. */ typedef __darwin_ct_rune_t __ct_rune_t; +/* Needed for opensolaris compat. */ +typedef __int64_t off64_t; Modified: head/tools/build/mk/Makefile.boot ============================================================================== --- head/tools/build/mk/Makefile.boot Sat Sep 19 11:27:16 2020 (r365900) +++ head/tools/build/mk/Makefile.boot Sat Sep 19 12:08:16 2020 (r365901) @@ -44,7 +44,6 @@ LIBELF:=${WORLDTMP}/legacy/usr/lib/libelf.a CFLAGS+= -Werror=implicit-function-declaration -Werror=implicit-int \ -Werror=return-type -Wundef CFLAGS+= -DHAVE_NBTOOL_CONFIG_H=1 -CFLAGS+= -D__BSD_VISIBLE=1 CFLAGS+= -I${SRCTOP}/tools/build/cross-build/include/common # b64_pton and b64_ntop is in libresolv on MacOS and Linux: From owner-svn-src-all@freebsd.org Sat Sep 19 13:55:26 2020 Return-Path: Delivered-To: svn-src-all@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 EAB173E1693; Sat, 19 Sep 2020 13:55:26 +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 4BtsfQ5kdtz3d16; Sat, 19 Sep 2020 13:55:26 +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 A39CECF6A; Sat, 19 Sep 2020 13:55:26 +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 08JDtQvZ019391; Sat, 19 Sep 2020 13:55:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JDtQNN019390; Sat, 19 Sep 2020 13:55:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009191355.08JDtQNN019390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 19 Sep 2020 13:55:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365902 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 365902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 13:55:27 -0000 Author: emaste Date: Sat Sep 19 13:55:26 2020 New Revision: 365902 URL: https://svnweb.freebsd.org/changeset/base/365902 Log: Cirrus-CI: skip svn_head branch svn_head has the same content as the master or main branch (it's just the result of a `git svn` conversion instead of svn2git). Sponsored by: The FreeBSD Foundation Modified: head/.cirrus.yml Modified: head/.cirrus.yml ============================================================================== --- head/.cirrus.yml Sat Sep 19 12:08:16 2020 (r365901) +++ head/.cirrus.yml Sat Sep 19 13:55:26 2020 (r365902) @@ -9,6 +9,7 @@ env: CIRRUS_CLONE_DEPTH: 1 task: + only_if: $CIRRUS_BRANCH != 'svn_head' timeout_in: 120m install_script: - pkg install -y qemu-devel uefi-edk2-qemu-x86_64 From owner-svn-src-all@freebsd.org Sat Sep 19 14:49:33 2020 Return-Path: Delivered-To: svn-src-all@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 123A13E309B; Sat, 19 Sep 2020 14:49:33 +0000 (UTC) (envelope-from gbe@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 4Bttrr6nb5z3y1s; Sat, 19 Sep 2020 14:49:32 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDACED9D7; Sat, 19 Sep 2020 14:49:32 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08JEnWWf051360; Sat, 19 Sep 2020 14:49:32 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JEnW6p051356; Sat, 19 Sep 2020 14:49:32 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009191449.08JEnW6p051356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 19 Sep 2020 14:49:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365903 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 365903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 14:49:33 -0000 Author: gbe (doc committer) Date: Sat Sep 19 14:49:31 2020 New Revision: 365903 URL: https://svnweb.freebsd.org/changeset/base/365903 Log: src.conf(5): Fix some mandoc issues in source files - new sentence, new line - blank line in fill mode Event: September 2020 Bugathon MFC after: 1 week Modified: head/tools/build/options/WITH_LOADER_FIREWIRE head/tools/build/options/WITH_LOADER_VERBOSE head/tools/build/options/WITH_NVME Modified: head/tools/build/options/WITH_LOADER_FIREWIRE ============================================================================== --- head/tools/build/options/WITH_LOADER_FIREWIRE Sat Sep 19 13:55:26 2020 (r365902) +++ head/tools/build/options/WITH_LOADER_FIREWIRE Sat Sep 19 14:49:31 2020 (r365903) @@ -1,3 +1,3 @@ .\" $FreeBSD$ -Enable firewire support in /boot/loader on x86. This option is a nop -on all other platforms. +Enable firewire support in /boot/loader on x86. +This option is a nop on all other platforms. Modified: head/tools/build/options/WITH_LOADER_VERBOSE ============================================================================== --- head/tools/build/options/WITH_LOADER_VERBOSE Sat Sep 19 13:55:26 2020 (r365902) +++ head/tools/build/options/WITH_LOADER_VERBOSE Sat Sep 19 14:49:31 2020 (r365903) @@ -2,4 +2,3 @@ Set to build with extra verbose debugging in the loader. May explode already nearly too large loader over the limit. Use with care. - Modified: head/tools/build/options/WITH_NVME ============================================================================== --- head/tools/build/options/WITH_NVME Sat Sep 19 13:55:26 2020 (r365902) +++ head/tools/build/options/WITH_NVME Sat Sep 19 14:49:31 2020 (r365903) @@ -1,3 +1,2 @@ .\" $FreeBSD$ Set to build nvme related tools and kernel modules. - From owner-svn-src-all@freebsd.org Sat Sep 19 15:08:58 2020 Return-Path: Delivered-To: svn-src-all@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 602733E35DA; Sat, 19 Sep 2020 15:08:58 +0000 (UTC) (envelope-from gbe@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 4BtvHG1s3nz3yy9; Sat, 19 Sep 2020 15:08:58 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22E99E101; Sat, 19 Sep 2020 15:08:58 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08JF8wxI063478; Sat, 19 Sep 2020 15:08:58 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JF8wLM063477; Sat, 19 Sep 2020 15:08:58 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009191508.08JF8wLM063477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 19 Sep 2020 15:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365904 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 365904 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 15:08:58 -0000 Author: gbe (doc committer) Date: Sat Sep 19 15:08:57 2020 New Revision: 365904 URL: https://svnweb.freebsd.org/changeset/base/365904 Log: crypto(7): Correct Sections out of conventional order error Event: September 2020 Bugathon MFC after: 1 week Modified: head/share/man/man7/crypto.7 Modified: head/share/man/man7/crypto.7 ============================================================================== --- head/share/man/man7/crypto.7 Sat Sep 19 14:49:31 2020 (r365903) +++ head/share/man/man7/crypto.7 Sat Sep 19 15:08:57 2020 (r365904) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 04, 2020 +.Dd June 4, 2020 .Dt CRYPTO 7 .Os .Sh NAME @@ -166,13 +166,13 @@ This algorithm implements Cipher Block Chaining. 16 or 32 .El .El +.Sh SEE ALSO +.Xr crypto 4 , +.Xr crypto 9 .Sh HISTORY The .Nm manpage first appeared in .Fx 10.1 . -.Sh SEE ALSO -.Xr crypto 4 , -.Xr crypto 9 .Sh BUGS Not all the implemented algorithms are listed. From owner-svn-src-all@freebsd.org Sat Sep 19 15:10:17 2020 Return-Path: Delivered-To: svn-src-all@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 DF0943E3740; Sat, 19 Sep 2020 15:10:17 +0000 (UTC) (envelope-from gbe@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 4BtvJn5bYtz402T; Sat, 19 Sep 2020 15:10:17 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4C9BDF3A; Sat, 19 Sep 2020 15:10:17 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08JFAHI6063619; Sat, 19 Sep 2020 15:10:17 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JFAH0j063618; Sat, 19 Sep 2020 15:10:17 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009191510.08JFAH0j063618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 19 Sep 2020 15:10:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365905 - head/share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/share/man/man8 X-SVN-Commit-Revision: 365905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 15:10:17 -0000 Author: gbe (doc committer) Date: Sat Sep 19 15:10:17 2020 New Revision: 365905 URL: https://svnweb.freebsd.org/changeset/base/365905 Log: diskless(8): Correct Sections out of conventional order error Event: September 2020 Bugathon MFC after: 1 week Modified: head/share/man/man8/diskless.8 Modified: head/share/man/man8/diskless.8 ============================================================================== --- head/share/man/man8/diskless.8 Sat Sep 19 15:08:57 2020 (r365904) +++ head/share/man/man8/diskless.8 Sat Sep 19 15:10:17 2020 (r365905) @@ -453,11 +453,6 @@ Be warned that using unencrypted to mount root and user partitions may expose information such as encryption keys. -.Sh HISTORY -The -.Nm -environment first appeared in -.Fx 2.2.5 . .Sh SEE ALSO .Xr ethers 5 , .Xr exports 5 , @@ -470,6 +465,11 @@ environment first appeared in .Xr tftpd 8 .Pp .Pa ports/net/etherboot +.Sh HISTORY +The +.Nm +environment first appeared in +.Fx 2.2.5 . .Sh BUGS This manpage is probably incomplete. .Pp From owner-svn-src-all@freebsd.org Sat Sep 19 15:22:05 2020 Return-Path: Delivered-To: svn-src-all@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 A03BE3E4439; Sat, 19 Sep 2020 15:22:05 +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 4BtvZP3nM2z415W; Sat, 19 Sep 2020 15:22:05 +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 66674DD5A; Sat, 19 Sep 2020 15:22:05 +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 08JFM50q076058; Sat, 19 Sep 2020 15:22:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JFM5ix076057; Sat, 19 Sep 2020 15:22:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009191522.08JFM5ix076057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 19 Sep 2020 15:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365906 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 365906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 15:22:05 -0000 Author: markj Date: Sat Sep 19 15:22:04 2020 New Revision: 365906 URL: https://svnweb.freebsd.org/changeset/base/365906 Log: Fix some nits in 1G page support in the amd64 pmap. - Move assertions out of the main loop to avoid duplicate conditional expressions, and improve assertion messages. - Fix va_next updates. In some cases we were not doing the wraparound check before continuing the loop. - Use the right va_next. In pmap_advise() and pmap_copy() we would step through 1G pages 2M at a time. - Copy 1G mappings in pmap_copy(). Reviewed by: alc, kib MFC with: r365518 Sponsored by: Juniper Networks, Inc., Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26463 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Sep 19 15:10:17 2020 (r365905) +++ head/sys/amd64/amd64/pmap.c Sat Sep 19 15:22:04 2020 (r365906) @@ -5935,22 +5935,20 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t continue; } - pdpe = pmap_pml4e_to_pdpe(pml4e, sva); va_next = (sva + NBPDP) & ~PDPMASK; - if ((*pdpe & PG_V) == 0) { - if (va_next < sva) - va_next = eva; + if (va_next < sva) + va_next = eva; + pdpe = pmap_pml4e_to_pdpe(pml4e, sva); + if ((*pdpe & PG_V) == 0) continue; - } - - KASSERT((*pdpe & PG_PS) == 0 || va_next <= eva, - ("pmap_remove of non-transient 1G page " - "pdpe %#lx sva %#lx eva %#lx va_next %#lx", - *pdpe, sva, eva, va_next)); if ((*pdpe & PG_PS) != 0) { + KASSERT(va_next <= eva, + ("partial update of non-transparent 1G mapping " + "pdpe %#lx sva %#lx eva %#lx va_next %#lx", + *pdpe, sva, eva, va_next)); MPASS(pmap != kernel_pmap); /* XXXKIB */ MPASS((*pdpe & (PG_MANAGED | PG_G)) == 0); - anyvalid = 1; + anyvalid = 1; *pdpe = 0; pmap_resident_count_dec(pmap, NBPDP / PAGE_SIZE); mt = PHYS_TO_VM_PAGE(*pmap_pml4e(pmap, sva) & PG_FRAME); @@ -6228,19 +6226,17 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t continue; } - pdpe = pmap_pml4e_to_pdpe(pml4e, sva); va_next = (sva + NBPDP) & ~PDPMASK; - if ((*pdpe & PG_V) == 0) { - if (va_next < sva) - va_next = eva; + if (va_next < sva) + va_next = eva; + pdpe = pmap_pml4e_to_pdpe(pml4e, sva); + if ((*pdpe & PG_V) == 0) continue; - } - - KASSERT((*pdpe & PG_PS) == 0 || va_next <= eva, - ("pmap_remove of non-transient 1G page " - "pdpe %#lx sva %#lx eva %#lx va_next %#lx", - *pdpe, sva, eva, va_next)); if ((*pdpe & PG_PS) != 0) { + KASSERT(va_next <= eva, + ("partial update of non-transparent 1G mapping " + "pdpe %#lx sva %#lx eva %#lx va_next %#lx", + *pdpe, sva, eva, va_next)); retry_pdpe: obits = pbits = *pdpe; MPASS((pbits & (PG_MANAGED | PG_G)) == 0); @@ -7373,17 +7369,18 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t va_next = eva; continue; } - pdpe = pmap_pml4e_to_pdpe(pml4e, sva); + va_next = (sva + NBPDP) & ~PDPMASK; if (va_next < sva) va_next = eva; + pdpe = pmap_pml4e_to_pdpe(pml4e, sva); if ((*pdpe & PG_V) == 0) continue; - KASSERT((*pdpe & PG_PS) == 0 || va_next <= eva, - ("pmap_unwire of non-transient 1G page " - "pdpe %#lx sva %#lx eva %#lx va_next %#lx", - *pdpe, sva, eva, va_next)); if ((*pdpe & PG_PS) != 0) { + KASSERT(va_next <= eva, + ("partial update of non-transparent 1G mapping " + "pdpe %#lx sva %#lx eva %#lx va_next %#lx", + *pdpe, sva, eva, va_next)); MPASS(pmap != kernel_pmap); /* XXXKIB */ MPASS((*pdpe & (PG_MANAGED | PG_G)) == 0); atomic_clear_long(pdpe, PG_W); @@ -7498,21 +7495,42 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ continue; } + va_next = (addr + NBPDP) & ~PDPMASK; + if (va_next < addr) + va_next = end_addr; pdpe = pmap_pml4e_to_pdpe(pml4e, addr); - if ((*pdpe & PG_V) == 0) { - va_next = (addr + NBPDP) & ~PDPMASK; - if (va_next < addr) - va_next = end_addr; + if ((*pdpe & PG_V) == 0) continue; + if ((*pdpe & PG_PS) != 0) { + KASSERT(va_next <= end_addr, + ("partial update of non-transparent 1G mapping " + "pdpe %#lx sva %#lx eva %#lx va_next %#lx", + *pdpe, addr, end_addr, va_next)); + MPASS((addr & PDPMASK) == 0); + MPASS((*pdpe & PG_MANAGED) == 0); + srcptepaddr = *pdpe; + pdpe = pmap_pdpe(dst_pmap, addr); + if (pdpe == NULL) { + if (_pmap_allocpte(dst_pmap, + pmap_pml4e_pindex(addr), NULL, addr) == + NULL) + break; + pdpe = pmap_pdpe(dst_pmap, addr); + } else { + pml4e = pmap_pml4e(dst_pmap, addr); + dst_pdpg = PHYS_TO_VM_PAGE(*pml4e & PG_FRAME); + dst_pdpg->ref_count++; + } + KASSERT(*pdpe == 0, + ("1G mapping present in dst pmap " + "pdpe %#lx sva %#lx eva %#lx va_next %#lx", + *pdpe, addr, end_addr, va_next)); + *pdpe = srcptepaddr & ~PG_W; + pmap_resident_count_inc(dst_pmap, NBPDP / PAGE_SIZE); + continue; } va_next = (addr + NBPDR) & ~PDRMASK; - KASSERT((*pdpe & PG_PS) == 0 || va_next <= end_addr, - ("pmap_copy of partial non-transient 1G page " - "pdpe %#lx sva %#lx eva %#lx va_next %#lx", - *pdpe, addr, end_addr, va_next)); - if ((*pdpe & PG_PS) != 0) - continue; if (va_next < addr) va_next = end_addr; @@ -8559,22 +8577,24 @@ pmap_advise(pmap_t pmap, vm_offset_t sva, vm_offset_t va_next = eva; continue; } + + va_next = (sva + NBPDP) & ~PDPMASK; + if (va_next < sva) + va_next = eva; pdpe = pmap_pml4e_to_pdpe(pml4e, sva); - if ((*pdpe & PG_V) == 0) { - va_next = (sva + NBPDP) & ~PDPMASK; - if (va_next < sva) - va_next = eva; + if ((*pdpe & PG_V) == 0) continue; + if ((*pdpe & PG_PS) != 0) { + KASSERT(va_next <= eva, + ("partial update of non-transparent 1G mapping " + "pdpe %#lx sva %#lx eva %#lx va_next %#lx", + *pdpe, sva, eva, va_next)); + continue; } + va_next = (sva + NBPDR) & ~PDRMASK; if (va_next < sva) va_next = eva; - KASSERT((*pdpe & PG_PS) == 0 || va_next <= eva, - ("pmap_advise of non-transient 1G page " - "pdpe %#lx sva %#lx eva %#lx va_next %#lx", - *pdpe, sva, eva, va_next)); - if ((*pdpe & PG_PS) != 0) - continue; pde = pmap_pdpe_to_pde(pdpe, sva); oldpde = *pde; if ((oldpde & PG_V) == 0) From owner-svn-src-all@freebsd.org Sat Sep 19 16:15:30 2020 Return-Path: Delivered-To: svn-src-all@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 6B55F3E6F3B; Sat, 19 Sep 2020 16:15:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Btwm22NSCz47fs; Sat, 19 Sep 2020 16:15:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34C52EE3C; Sat, 19 Sep 2020 16:15:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08JGFUor011458; Sat, 19 Sep 2020 16:15:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JGFND5011425; Sat, 19 Sep 2020 16:15:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009191615.08JGFND5011425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 19 Sep 2020 16:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365907 - in head/cddl/contrib/opensolaris/cmd/dtrace/test/tst: amd64/arrays common/io common/java_api common/json common/pid common/proc common/profile-n common/raise common/sdt common... X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/cddl/contrib/opensolaris/cmd/dtrace/test/tst: amd64/arrays common/io common/java_api common/json common/pid common/proc common/profile-n common/raise common/sdt common/stop common/syscall comm... X-SVN-Commit-Revision: 365907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 16:15:30 -0000 Author: markj Date: Sat Sep 19 16:15:22 2020 New Revision: 365907 URL: https://svnweb.freebsd.org/changeset/base/365907 Log: Address compiler warnings in C code used by the DTrace test suite. Reported by: Jenkins MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/arrays/tst.rax.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/tst.usdt.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/usdt.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.float.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret1.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret2.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.vfork.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak1.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop1.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop2.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.aouttype.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.printtype.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.argmap.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.args.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.forker.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.bigstack.c head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.spin.c Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/arrays/tst.rax.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/arrays/tst.rax.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/arrays/tst.rax.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,6 +24,8 @@ * Use is subject to license terms. */ +void frax(void); + __attribute__((optnone)) void frax(void) { Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include @@ -48,7 +46,8 @@ int main(int argc, char *argv[]) { const char *file = "/dev/null"; - int i, n, fds[10]; + size_t i, n; + int fds[10]; struct sigaction act; if (argc > 1) { Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.FunctionLookup.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include typedef void f(int x); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/java_api/tst.ProbeData.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,43 +24,43 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +#include typedef void f(char *); static void -f_a(char *a) +f_a(char *a __unused) { } static void -f_b(char *a) +f_b(char *a __unused) { } static void -f_c(char *a) +f_c(char *a __unused) { } static void -f_d(char *a) +f_d(char *a __unused) { } static void -f_e(char *a) +f_e(char *a __unused) { } static void -fN(f func, char *a, int i) +fN(f func, char *a, int i __unused) { func(a); } static void -fN2(f func, char *a, int i) +fN2(f func, char *a, int i __unused) { func(a); } Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/tst.usdt.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/tst.usdt.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/tst.usdt.c Sat Sep 19 16:15:22 2020 (r365907) @@ -28,6 +28,8 @@ " \"action\": \"%s\"" \ "}\n" +int waiting(volatile int *); + int waiting(volatile int *a) { @@ -35,7 +37,7 @@ waiting(volatile int *a) } int -main(int argc, char **argv) +main(void) { volatile int a = 0; int idx; @@ -45,7 +47,8 @@ main(int argc, char **argv) continue; for (idx = 0; idx < 10; idx++) { - char *odd, *even, *json, *action; + const char *odd, *even, *action; + char *json; size *= 1.78; odd = idx % 2 == 1 ? "true" : "false"; @@ -57,7 +60,7 @@ main(int argc, char **argv) free(json); } - BUNYAN_FAKE_LOG_DEBUG("{\"finished\": true}"); + BUNYAN_FAKE_LOG_DEBUG(__DECONST(char *, "{\"finished\": true}")); return (0); } Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/usdt.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/usdt.d Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/usdt.d Sat Sep 19 16:15:22 2020 (r365907) @@ -18,10 +18,10 @@ */ provider bunyan_fake { - probe log__trace(char *msg); - probe log__debug(char *msg); - probe log__info(char *msg); - probe log__warn(char *msg); - probe log__error(char *msg); - probe log__fatal(char *msg); + probe log__trace(const char *msg); + probe log__debug(const char *msg); + probe log__info(const char *msg); + probe log__warn(const char *msg); + probe log__error(const char *msg); + probe log__fatal(const char *msg); }; Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,28 +24,30 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include +int go(long, long, long, long, long, long, long, long, long, long); + int -go(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, - long arg7, long arg8, long arg9) +go(long arg0 __unused, long arg1 __unused, long arg2 __unused, + long arg3 __unused, long arg4 __unused, long arg5 __unused, + long arg6 __unused, long arg7 __unused, long arg8 __unused, + long arg9 __unused) { return (arg1); } static void -handle(int sig) +handle(int sig __unused) { go(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); exit(0); } int -main(int argc, char **argv) +main(void) { (void) signal(SIGUSR1, handle); for (;;) Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.float.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.float.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.float.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,14 +24,14 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include +extern volatile double c; + volatile double c = 1.2; int -main(int argc, char **argv) +main(int argc, char **argv __unused) { double a = 1.56; double b = (double)argc; Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,10 +24,11 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include +int waiting(volatile int *); +int go(void); + int waiting(volatile int *a) { @@ -49,7 +50,7 @@ go(void) } int -main(int argc, char **argv) +main(void) { volatile int a = 0; Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,14 +24,15 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include #include #include +void go(void); +void intr(int); + void go(void) { @@ -43,12 +44,12 @@ go(void) } void -intr(int sig) +intr(int sig __unused) { } int -main(int argc, char **argv) +main(void) { struct sigaction sa; Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret1.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret1.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret1.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -35,6 +33,11 @@ * leading underscores. */ +extern int a; + +int help(void); +int go(void); + int a = 100; int @@ -50,14 +53,14 @@ go(void) } static void -handle(int sig) +handle(int sig __unused) { go(); exit(0); } int -main(int argc, char **argv) +main(void) { (void) signal(SIGUSR1, handle); for (;;) Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret2.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret2.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret2.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -35,6 +33,10 @@ * leading underscores. */ +extern int a; + +int go(void); + int a = 100; int @@ -44,14 +46,14 @@ go(void) } static void -handle(int sig) +handle(int sig __unused) { go(); exit(0); } int -main(int argc, char **argv) +main(void) { (void) signal(SIGUSR1, handle); for (;;) Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.vfork.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.vfork.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.vfork.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,10 +24,11 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include +int waiting(volatile int *); +int go(void); + int waiting(volatile int *a) { @@ -49,7 +50,7 @@ go(void) } int -main(int argc, char **argv) +main(void) { volatile int a = 0; Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak1.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak1.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak1.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -37,6 +35,8 @@ #pragma weak _go = go +int go(int); + int go(int a) { @@ -44,14 +44,14 @@ go(int a) } static void -handle(int sig) +handle(int sig __unused) { _go(1); exit(0); } int -main(int argc, char **argv) +main(void) { (void) signal(SIGUSR1, handle); for (;;) Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -35,7 +33,7 @@ * leading underscores. */ -static int +static int __unused go(int a) { return (a + 1); @@ -44,14 +42,14 @@ go(int a) #pragma weak _go = go static void -handle(int sig) +handle(int sig __unused) { _go(1); exit(0); } int -main(int argc, char **argv) +main(void) { (void) signal(SIGUSR1, handle); for (;;) Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.c Sat Sep 19 16:15:22 2020 (r365907) @@ -26,7 +26,7 @@ #include int -main(int argc, char **argv) +main(void) { for (;;) Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -36,7 +34,7 @@ #define NANOSEC 1000000000 int -main(int argc, char **argv) +main(int argc __unused, char **argv) { struct sigevent ev; struct itimerspec ts; Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.ufuncsort.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,32 +24,32 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +#include typedef void f(int x); static void -f_a(int i) +f_a(int i __unused) { } static void -f_b(int i) +f_b(int i __unused) { } static void -f_c(int i) +f_c(int i __unused) { } static void -f_d(int i) +f_d(int i __unused) { } static void -f_e(int i) +f_e(int i __unused) { } @@ -60,7 +60,7 @@ fN(f func, int i) } int -main() +main(void) { fN(f_a, 1); fN(f_b, 2); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,13 +24,11 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include int -main(int argc, char **argv) +main(void) { sigset_t ss; Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,20 +24,18 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include static void -handle(int sig) +handle(int sig __unused) { exit(0); } int -main(int argc, char **argv) +main(void) { struct sigaction sa; Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,20 +24,18 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include static void -handle(int sig) +handle(int sig __unused) { exit(0); } int -main(int argc, char **argv) +main(void) { struct sigaction sa; Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include @@ -33,7 +31,7 @@ #include int -main(int argc, char **argv) +main(void) { int val = 1; Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop1.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop1.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop1.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,12 +24,10 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include int -main(int argc, char **argv) +main(void) { for (;;) { getpid(); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop2.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop2.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/stop/tst.stop2.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,12 +24,10 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include int -main(int argc, char **argv) +main(void) { for (;;) { getpid(); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,15 +24,13 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include /*ARGSUSED*/ int -main(int argc, char **argv) +main(void) { for (;;) { (void) __syscall(SYS_mmap, NULL, (size_t)1, 2, 3, -1, Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.aouttype.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.aouttype.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.aouttype.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,6 +24,8 @@ typedef struct season_7_lisa_the_vegetarian { int fr_salad; } season_7_lisa_the_vegetarian_t; +int sleeper(season_7_lisa_the_vegetarian_t *); + int sleeper(season_7_lisa_the_vegetarian_t *lp) { Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.chasestrings.c Sat Sep 19 16:15:22 2020 (r365907) @@ -22,9 +22,9 @@ #include typedef struct zelda_info { - char *zi_gamename; + const char *zi_gamename; int zi_ndungeons; - char *zi_villain; + const char *zi_villain; int zi_haszelda; } zelda_info_t; Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.printtype.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.printtype.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.printtype.c Sat Sep 19 16:15:22 2020 (r365907) @@ -27,19 +27,19 @@ typedef struct final_fantasy_info { } final_fantasy_info_t; static int -ff_getgameid(final_fantasy_info_t *f) +ff_getgameid(final_fantasy_info_t *f __unused) { return (0); } static int -ff_getpartysize(final_fantasy_info_t *f) +ff_getpartysize(final_fantasy_info_t *f __unused) { return (0); } static int -ff_getsummons(final_fantasy_info_t *f) +ff_getsummons(final_fantasy_info_t *f __unused) { return (0); } Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.argmap.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.argmap.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.argmap.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,12 +24,10 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include int -main(int argc, char **argv) +main(void) { for (;;) { DTRACE_PROBE2(test_prov, place, 10, 4); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.args.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.args.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.args.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,12 +24,10 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include int -main(int argc, char **argv) +main(void) { for (;;) { DTRACE_PROBE2(test_prov, place, 10, 4); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.forker.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.forker.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.forker.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include @@ -35,7 +33,7 @@ #include "forker.h" int -main(int argc, char **argv) +main(void) { int i; Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.bigstack.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.bigstack.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.bigstack.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,12 +24,11 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include +void grow(int); void grow1(int); void @@ -53,7 +52,7 @@ grow1(int frame) } int -main(int argc, char *argv[]) +main(void) { grow(1); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.spin.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.spin.c Sat Sep 19 15:22:04 2020 (r365906) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ustack/tst.spin.c Sat Sep 19 16:15:22 2020 (r365907) @@ -24,12 +24,16 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include +extern volatile long long count; + volatile long long count = 0; +int baz(int); +int bar(int); +int foo(int, int); + int baz(int a) { @@ -57,5 +61,5 @@ foo(int a, int b) int main(int argc, char **argv) { - return (foo(argc, (int)argv) == 0); + return (foo(argc, (int)(uintptr_t)argv) == 0); } From owner-svn-src-all@freebsd.org Sat Sep 19 18:00:12 2020 Return-Path: Delivered-To: svn-src-all@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 06BC63EA795; Sat, 19 Sep 2020 18:00:12 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) (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 4Btz4q1n3Bz4HX3; Sat, 19 Sep 2020 18:00:11 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f49.google.com with SMTP id 95so1252568ota.13; Sat, 19 Sep 2020 11:00:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dLQf7cWcyFHzMBzPatf3ptJmSioPK44byIz2bqsc4Iw=; b=hCebZp5D+Q3u5oQTLgTF5goM6p4MqSQW0zl5s3BcNMTFhaFPJlZonjEEUs3ZrkNbsE oV7F9EybM/5smHbZzIS6MoYOpZsCLADY2JU9csHOtvQ4kjP7i8pP298Hj5PrCLfXdlyk E/NMmJdlamZGe1hFP/zlpO6uuQlXWItN03PjU+gGV6xnryJq7FSg1QOuTD1zJldrfwFw qNTRJjXeOTZAz7zW1GOEZWK7bkhDi8paGq1XsOHcsQ2E6k6/NW7fS9PvI6AMJMOvniKx WCJgV4CucaSs7Z7lw72e/NfD22jx1SKLg84aHrnUm7ut5sh5/VWdt9d6huc8bEryYzRR WUWA== X-Gm-Message-State: AOAM531tFM0uHBzElqOo8SU4eBYfy8LjVIyvQDlyopJseMgduLeZModS dfLgvOVt+RxgTnEAiv3p9qzK++Hb26LtgzOGSr8= X-Google-Smtp-Source: ABdhPJzA7g1R0xmKqHsiWxIfnSy81v6PPSsRrFfYBBeNuR7l1fPyMXFlaksuDWfPyt/jY+RDcjlba5tfORwUZEvlGAw= X-Received: by 2002:a05:6830:1e30:: with SMTP id t16mr27363571otr.18.1600538410012; Sat, 19 Sep 2020 11:00:10 -0700 (PDT) MIME-Version: 1.0 References: <202009112049.08BKnavL032212@repo.freebsd.org> <20200911214327.GY94807@kib.kiev.ua> In-Reply-To: From: Alan Somers Date: Sat, 19 Sep 2020 11:59:58 -0600 Message-ID: Subject: Re: svn commit: r365643 - head/bin/cp To: Rick Macklem Cc: Konstantin Belousov , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: 4Btz4q1n3Bz4HX3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.210.49 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-2.26 / 15.00]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_DN_EQ_ADDR_SOME(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; FREEFALL_USER(0.00)[asomers]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; ARC_NA(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[209.85.210.49:from]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.05)[-1.047]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.25)[-0.249]; RCVD_IN_DNSWL_NONE(0.00)[209.85.210.49:from]; NEURAL_HAM_MEDIUM(-0.96)[-0.965]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 18:00:12 -0000 On Fri, Sep 11, 2020 at 3:52 PM Rick Macklem wrote: > Konstantin Belousov wrote: > >On Fri, Sep 11, 2020 at 08:49:36PM +0000, Alan Somers wrote: > >> Author: asomers > >> Date: Fri Sep 11 20:49:36 2020 > >> New Revision: 365643 > >> URL: https://svnweb.freebsd.org/changeset/base/365643 > >> > >> Log: > >> cp: fall back to read/write if copy_file_range fails > >> > >> Even though copy_file_range has a file-system agnostic version, it > still > >> fails on devfs (perhaps because the file descriptor is non-seekable?) > In > >> that case, fallback to old-fashioned read/write. Fixes > >> "cp /dev/null /tmp/null" > > > >Devices are seekable. > > > >The reason for EINVAL is that vn_copy_file_range() checks that both in > and out > >vnodes are VREG. For devfs, they are VCHR. > > I coded the syscall to the Linux man page, which states that EINVAL is > returned > if either fd does not refer to a regular file. > Having said that, I do not recall testing the VCHR case under Linux. (ie. > It might > actually work and the man page turns out to be incorrect?) > > I will test this case under Linux when I get home next week, rick > Since there's no standard, I think it's fine for us to support devfs if possible. From owner-svn-src-all@freebsd.org Sat Sep 19 18:02:56 2020 Return-Path: Delivered-To: svn-src-all@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 A036A3EA6F9; Sat, 19 Sep 2020 18:02:56 +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 4Btz803rKcz4J42; Sat, 19 Sep 2020 18:02:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 669EB1041B; Sat, 19 Sep 2020 18:02:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08JI2uSk079326; Sat, 19 Sep 2020 18:02:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JI2uK3079325; Sat, 19 Sep 2020 18:02:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009191802.08JI2uK3079325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 19 Sep 2020 18:02:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365908 - stable/12/sys/fs/tmpfs X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/fs/tmpfs X-SVN-Commit-Revision: 365908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 18:02:56 -0000 Author: kib Date: Sat Sep 19 18:02:55 2020 New Revision: 365908 URL: https://svnweb.freebsd.org/changeset/base/365908 Log: MFC r365809: Style. Modified: stable/12/sys/fs/tmpfs/tmpfs_subr.c stable/12/sys/fs/tmpfs/tmpfs_vnops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/12/sys/fs/tmpfs/tmpfs_subr.c Sat Sep 19 16:15:22 2020 (r365907) +++ stable/12/sys/fs/tmpfs/tmpfs_subr.c Sat Sep 19 18:02:55 2020 (r365908) @@ -1584,7 +1584,7 @@ tmpfs_chflags(struct vnode *vp, u_long flags, struct u /* Disallow this operation if the file system is mounted read-only. */ if (vp->v_mount->mnt_flag & MNT_RDONLY) - return EROFS; + return (EROFS); /* * Callers may only modify the file flags on objects they @@ -1703,11 +1703,11 @@ tmpfs_chown(struct vnode *vp, uid_t uid, gid_t gid, st /* Disallow this operation if the file system is mounted read-only. */ if (vp->v_mount->mnt_flag & MNT_RDONLY) - return EROFS; + return (EROFS); /* Immutable or append-only files cannot be modified, either. */ if (node->tn_flags & (IMMUTABLE | APPEND)) - return EPERM; + return (EPERM); /* * To modify the ownership of a file, must possess VADMIN for that @@ -1764,11 +1764,11 @@ tmpfs_chsize(struct vnode *vp, u_quad_t size, struct u error = 0; switch (vp->v_type) { case VDIR: - return EISDIR; + return (EISDIR); case VREG: if (vp->v_mount->mnt_flag & MNT_RDONLY) - return EROFS; + return (EROFS); break; case VBLK: @@ -1776,23 +1776,27 @@ tmpfs_chsize(struct vnode *vp, u_quad_t size, struct u case VCHR: /* FALLTHROUGH */ case VFIFO: - /* Allow modifications of special files even if in the file + /* + * Allow modifications of special files even if in the file * system is mounted read-only (we are not modifying the - * files themselves, but the objects they represent). */ - return 0; + * files themselves, but the objects they represent). + */ + return (0); default: /* Anything else is unsupported. */ - return EOPNOTSUPP; + return (EOPNOTSUPP); } /* Immutable or append-only files cannot be modified, either. */ if (node->tn_flags & (IMMUTABLE | APPEND)) - return EPERM; + return (EPERM); error = tmpfs_truncate(vp, size); - /* tmpfs_truncate will raise the NOTE_EXTEND and NOTE_ATTRIB kevents - * for us, as will update tn_status; no need to do that here. */ + /* + * tmpfs_truncate will raise the NOTE_EXTEND and NOTE_ATTRIB kevents + * for us, as will update tn_status; no need to do that here. + */ ASSERT_VOP_ELOCKED(vp, "chsize2"); @@ -1817,11 +1821,11 @@ tmpfs_chtimes(struct vnode *vp, struct vattr *vap, /* Disallow this operation if the file system is mounted read-only. */ if (vp->v_mount->mnt_flag & MNT_RDONLY) - return EROFS; + return (EROFS); /* Immutable or append-only files cannot be modified, either. */ if (node->tn_flags & (IMMUTABLE | APPEND)) - return EPERM; + return (EPERM); error = vn_utimes_perm(vp, vap, cred, l); if (error != 0) Modified: stable/12/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/12/sys/fs/tmpfs/tmpfs_vnops.c Sat Sep 19 16:15:22 2020 (r365907) +++ stable/12/sys/fs/tmpfs/tmpfs_vnops.c Sat Sep 19 18:02:55 2020 (r365908) @@ -368,7 +368,7 @@ tmpfs_access(struct vop_access_args *v) out: MPASS(VOP_ISLOCKED(vp)); - return error; + return (error); } int @@ -455,9 +455,11 @@ tmpfs_setattr(struct vop_setattr_args *v) vap->va_birthtime.tv_nsec != VNOVAL))) error = tmpfs_chtimes(vp, vap, cred, td); - /* Update the node times. We give preference to the error codes + /* + * Update the node times. We give preference to the error codes * generated by this function rather than the ones that may arise - * from tmpfs_update. */ + * from tmpfs_update. + */ tmpfs_update(vp); MPASS(VOP_ISLOCKED(vp)); @@ -595,8 +597,7 @@ tmpfs_remove(struct vop_remove_args *v) error = 0; out: - - return error; + return (error); } static int From owner-svn-src-all@freebsd.org Sat Sep 19 18:25:53 2020 Return-Path: Delivered-To: svn-src-all@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 7E7433EB510; Sat, 19 Sep 2020 18:25:53 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4BtzfT2rgDz4Jqs; Sat, 19 Sep 2020 18:25:53 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CB9E10469; Sat, 19 Sep 2020 18:25:53 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08JIPrWX091651; Sat, 19 Sep 2020 18:25:53 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JIPqnr091648; Sat, 19 Sep 2020 18:25:52 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202009191825.08JIPqnr091648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 19 Sep 2020 18:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365909 - stable/12/tests/sys/opencrypto X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/tests/sys/opencrypto X-SVN-Commit-Revision: 365909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 18:25:53 -0000 Author: asomers Date: Sat Sep 19 18:25:52 2020 New Revision: 365909 URL: https://svnweb.freebsd.org/changeset/base/365909 Log: MFC r363361: tests/sys/opencrypto: use python3 python2 will be EOL soon Reviewed by: lwhsu, jmg Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D25682 Modified: stable/12/tests/sys/opencrypto/Makefile stable/12/tests/sys/opencrypto/cryptodev.py stable/12/tests/sys/opencrypto/cryptotest.py stable/12/tests/sys/opencrypto/runtests.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/opencrypto/Makefile ============================================================================== --- stable/12/tests/sys/opencrypto/Makefile Sat Sep 19 18:02:55 2020 (r365908) +++ stable/12/tests/sys/opencrypto/Makefile Sat Sep 19 18:25:52 2020 (r365909) @@ -14,7 +14,7 @@ ATF_TESTS_C+= blake2_test poly1305_test TAP_TESTS_SH+= runtests -TEST_METADATA.runtests+= required_programs="python2" +TEST_METADATA.runtests+= required_programs="python3" TEST_METADATA.runtests+= required_user="root" PYMODULES= cryptodev.py cryptodevh.py cryptotest.py Modified: stable/12/tests/sys/opencrypto/cryptodev.py ============================================================================== --- stable/12/tests/sys/opencrypto/cryptodev.py Sat Sep 19 18:02:55 2020 (r365908) +++ stable/12/tests/sys/opencrypto/cryptodev.py Sat Sep 19 18:25:52 2020 (r365909) @@ -1,4 +1,4 @@ -#!/usr/local/bin/python2 +#!/usr/local/bin/python3 # # Copyright (c) 2014 The FreeBSD Foundation # Copyright 2014 John-Mark Gurney @@ -30,7 +30,7 @@ # $FreeBSD$ # -from __future__ import print_function + import array import dpkt from fcntl import ioctl Modified: stable/12/tests/sys/opencrypto/cryptotest.py ============================================================================== --- stable/12/tests/sys/opencrypto/cryptotest.py Sat Sep 19 18:02:55 2020 (r365908) +++ stable/12/tests/sys/opencrypto/cryptotest.py Sat Sep 19 18:25:52 2020 (r365909) @@ -1,4 +1,4 @@ -#!/usr/local/bin/python2 +#!/usr/local/bin/python3 # # Copyright (c) 2014 The FreeBSD Foundation # All rights reserved. @@ -29,7 +29,9 @@ # $FreeBSD$ # -from __future__ import print_function + + +import binascii import errno import cryptodev import itertools Modified: stable/12/tests/sys/opencrypto/runtests.sh ============================================================================== --- stable/12/tests/sys/opencrypto/runtests.sh Sat Sep 19 18:02:55 2020 (r365908) +++ stable/12/tests/sys/opencrypto/runtests.sh Sat Sep 19 18:25:52 2020 (r365909) @@ -29,7 +29,7 @@ # $FreeBSD$ # -: ${PYTHON=python2} +: ${PYTHON=python3} if [ ! -d /usr/local/share/nist-kat ]; then echo "1..0 # SKIP: nist-kat package not installed for test vectors" From owner-svn-src-all@freebsd.org Sat Sep 19 19:08:28 2020 Return-Path: Delivered-To: svn-src-all@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 4F4633EC2FC; Sat, 19 Sep 2020 19:08:28 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Bv0bc1NXDz4Mhr; Sat, 19 Sep 2020 19:08:28 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13B7D10CB7; Sat, 19 Sep 2020 19:08:28 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08JJ8R2j016915; Sat, 19 Sep 2020 19:08:27 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JJ8RUU016910; Sat, 19 Sep 2020 19:08:27 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202009191908.08JJ8RUU016910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 19 Sep 2020 19:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365910 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 365910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 19:08:28 -0000 Author: asomers Date: Sat Sep 19 19:08:27 2020 New Revision: 365910 URL: https://svnweb.freebsd.org/changeset/base/365910 Log: fix integer underflow in getgrnam_r and getpwnam_r Sometimes nscd(8) will return a 1-byte buffer for a nonexistent entry. This triggered an integer underflow in grp_unmarshal_func, causing getgrnam_r to return ERANGE instead of 0. Fix the user's buffer size check, and add a correct check for a too-small nscd buffer. PR: 248932 Event: September 2020 Bugathon Reviewed by: markj MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D26204 Modified: head/lib/libc/gen/getgrent.c head/lib/libc/gen/getpwent.c Modified: head/lib/libc/gen/getgrent.c ============================================================================== --- head/lib/libc/gen/getgrent.c Sat Sep 19 18:25:52 2020 (r365909) +++ head/lib/libc/gen/getgrent.c Sat Sep 19 19:08:27 2020 (r365910) @@ -334,14 +334,27 @@ grp_unmarshal_func(char *buffer, size_t buffer_size, v orig_buf_size = va_arg(ap, size_t); ret_errno = va_arg(ap, int *); - if (orig_buf_size < - buffer_size - sizeof(struct group) - sizeof(char *)) { + if (orig_buf_size + sizeof(struct group) + sizeof(char *) < buffer_size) + { *ret_errno = ERANGE; return (NS_RETURN); + } else if (buffer_size < sizeof(struct group) + sizeof(char *)) { + /* + * nscd(8) sometimes returns buffer_size=1 for nonexistent + * entries. + */ + *ret_errno = 0; + return (NS_NOTFOUND); } memcpy(grp, buffer, sizeof(struct group)); memcpy(&p, buffer + sizeof(struct group), sizeof(char *)); + + if (orig_buf_size + sizeof(struct group) + sizeof(char *) + + _ALIGN(p) - (size_t)p < buffer_size) { + *ret_errno = ERANGE; + return (NS_RETURN); + } orig_buf = (char *)_ALIGN(orig_buf); memcpy(orig_buf, buffer + sizeof(struct group) + sizeof(char *) + Modified: head/lib/libc/gen/getpwent.c ============================================================================== --- head/lib/libc/gen/getpwent.c Sat Sep 19 18:25:52 2020 (r365909) +++ head/lib/libc/gen/getpwent.c Sat Sep 19 19:08:27 2020 (r365910) @@ -389,10 +389,17 @@ pwd_unmarshal_func(char *buffer, size_t buffer_size, v orig_buf_size = va_arg(ap, size_t); ret_errno = va_arg(ap, int *); - if (orig_buf_size < - buffer_size - sizeof(struct passwd) - sizeof(char *)) { + if (orig_buf_size + sizeof(struct passwd) + sizeof(char *) < + buffer_size) { *ret_errno = ERANGE; return (NS_RETURN); + } else if (buffer_size < sizeof(struct passwd) + sizeof(char *)) { + /* + * nscd(8) sometimes returns buffer_size=1 for nonexistent + * entries. + */ + *ret_errno = 0; + return (NS_NOTFOUND); } memcpy(pwd, buffer, sizeof(struct passwd)); From owner-svn-src-all@freebsd.org Sat Sep 19 19:48:16 2020 Return-Path: Delivered-To: svn-src-all@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 7A1863ECEF5; Sat, 19 Sep 2020 19:48:16 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Bv1TX2dQ0z4P4D; Sat, 19 Sep 2020 19:48:16 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CF9F115B9; Sat, 19 Sep 2020 19:48:16 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08JJmGA0041893; Sat, 19 Sep 2020 19:48:16 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JJmGY4041892; Sat, 19 Sep 2020 19:48:16 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202009191948.08JJmGY4041892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 19 Sep 2020 19:48:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365911 - stable/12/share/man/man5 X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/share/man/man5 X-SVN-Commit-Revision: 365911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 19:48:16 -0000 Author: asomers Date: Sat Sep 19 19:48:15 2020 New Revision: 365911 URL: https://svnweb.freebsd.org/changeset/base/365911 Log: MFC r365391, r365415 r365391: nsswitch.conf(5): recommend placing cache after files When cache precedes files, and nscd is configured to allow negative caching, commands like "pw groupadd" can fail. The sequence of events looks like: 1. A command like pkg(8) looks up the group, and finds it absent. 2. pkg invokes pw(8) to add the group 3. pkg queries the group, but nscd says it doesn't exist, since it has a negative cache entry for that group. See also: https://lists.freebsd.org/pipermail/freebsd-current/2012-January/031595.html Reviewed by: bcr (manpages) Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D26184 r365415: nsswitch.conf.5: style fixes Fix some whitespace, and remove the .Tn macro Reported by: mandoc, igor Reviewed by: bcr (manpages) Differential Revision: https://reviews.freebsd.org/D26345 Modified: stable/12/share/man/man5/nsswitch.conf.5 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man5/nsswitch.conf.5 ============================================================================== --- stable/12/share/man/man5/nsswitch.conf.5 Sat Sep 19 19:08:27 2020 (r365910) +++ stable/12/share/man/man5/nsswitch.conf.5 Sat Sep 19 19:48:15 2020 (r365911) @@ -1,4 +1,4 @@ -.\" $NetBSD: nsswitch.conf.5,v 1.14 1999/03/17 20:19:47 garbled Exp $ +.\" $NetBSD: nsswitch.conf.5,v 1.14 1999/03/17 20:19:47 garbled Exp $ .\" .\" Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -16,7 +16,7 @@ .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: -.\" This product includes software developed by Luke Mewburn. +.\" This product includes software developed by Luke Mewburn. .\" 4. The name of the author may not be used to endorse or promote products .\" derived from this software without specific prior written permission. .\" @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 6, 2016 +.Dd September 6, 2020 .Dt NSSWITCH.CONF 5 .Os .Sh NAME @@ -48,8 +48,7 @@ file specifies how the .Pp The configuration file controls how a process looks up various databases containing information regarding hosts, users (passwords), groups, etc. -Each database comes from a source (such as local files, DNS, -.Tn NIS , +Each database comes from a source (such as local files, DNS, NIS , and cache), and the order to look up the sources is specified in .Nm . .Pp @@ -180,9 +179,7 @@ Try the next source Return with the current result .El .Ss Format of file -A -.Tn BNF -description of the syntax of +A BNF description of the syntax of .Nm is: .Pp @@ -222,20 +219,24 @@ and continue on anything else (i.e, .Ss Cache You can enable caching for the particular database by specifying .Dq cache -as the first source in the +in the .Nm file. +It should come after +.Dq files , +but before remote sources like +.Dq nis . You should also enable caching for this database in .Xr nscd.conf 5 . -If for the particular query +If for a particular query .Dq cache -source returns success, no further sources are queried. +source returns success, then no further sources are queried. On the other hand, if there are no previously cached data, the query result will be placed into the cache right after all other sources are processed. -Note, that +Note that .Dq cache -requires +requires the .Xr nscd 8 daemon to be running. .Ss Compat mode: +/- syntax @@ -244,12 +245,10 @@ In historical multi-source implementations, the and .Sq - characters are used to specify the importing of user password and -group information from -.Tn NIS . +group information from NIS . Although .Nm -provides alternative methods of accessing distributed sources such as -.Tn NIS , +provides alternative methods of accessing distributed sources such as NIS , specifying a sole source of .Dq compat will provide the historical behaviour. @@ -319,15 +318,14 @@ resides in .Pa /etc . .El .Sh EXAMPLES -To lookup hosts in cache, then in +To lookup hosts in .Pa /etc/hosts -and then from the DNS, and lookup user information from -.Tn NIS -then files, use: +, then in cache, +and then from the DNS, and lookup user information from NIS then files, use: .Pp .Bl -tag -width passwd: -compact .It hosts: -cache files dns +files cache dns .It passwd: nis [notfound=return] files .It group: @@ -349,9 +347,7 @@ entries. .Fx Ns 's .Lb libc provides stubs for compatibility with NSS modules -written for the -.Tn GNU -C Library +written for the GNU C Library .Nm nsswitch interface. However, these stubs only support the use of the @@ -377,10 +373,8 @@ Project, where it appeared first in .Sh AUTHORS .An Luke Mewburn Aq Mt lukem@netbsd.org wrote this freely distributable name-service switch implementation, -using ideas from the -.Tn ULTRIX +using ideas from the ULTRIX .Xr svc.conf 5 -and -.Tn Solaris +and Solaris .Xr nsswitch.conf 4 manual pages. From owner-svn-src-all@freebsd.org Sat Sep 19 20:06:13 2020 Return-Path: Delivered-To: svn-src-all@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 BFB373EE01A; Sat, 19 Sep 2020 20:06:13 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Bv1tF4dCCz4R5p; Sat, 19 Sep 2020 20:06:13 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DA53115EF; Sat, 19 Sep 2020 20:06:13 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08JK6DjQ054364; Sat, 19 Sep 2020 20:06:13 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JK6CHu054359; Sat, 19 Sep 2020 20:06:12 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202009192006.08JK6CHu054359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 19 Sep 2020 20:06:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365912 - in head: sbin/fsdb tools/diag/prtblknos X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head: sbin/fsdb tools/diag/prtblknos X-SVN-Commit-Revision: 365912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 20:06:13 -0000 Author: mckusick Date: Sat Sep 19 20:06:12 2020 New Revision: 365912 URL: https://svnweb.freebsd.org/changeset/base/365912 Log: The fsdb(8) utility uses the fsck_ffs(8) disk I/O interfaces, so switch from using libufs's bread() to using fsck_ffs's getdatablk() when importing tools/diag/prtblnos's prtblknos(). Sponsored by: Netflix Modified: head/sbin/fsdb/fsdb.c head/sbin/fsdb/fsdbutil.c head/tools/diag/prtblknos/Makefile head/tools/diag/prtblknos/main.c head/tools/diag/prtblknos/prtblknos.c Modified: head/sbin/fsdb/fsdb.c ============================================================================== --- head/sbin/fsdb/fsdb.c Sat Sep 19 19:48:15 2020 (r365911) +++ head/sbin/fsdb/fsdb.c Sat Sep 19 20:06:12 2020 (r365912) @@ -109,6 +109,8 @@ main(int argc, char *argv[]) sblock_init(); if (!setup(fsys)) errx(1, "cannot set up file system `%s'", fsys); + if (fswritefd < 0) + nflag++; printf("%s file system `%s'\nLast Mounted on %s\n", nflag? "Examining": "Editing", fsys, sblock.fs_fsmnt); rval = cmdloop(); Modified: head/sbin/fsdb/fsdbutil.c ============================================================================== --- head/sbin/fsdb/fsdbutil.c Sat Sep 19 19:48:15 2020 (r365911) +++ head/sbin/fsdb/fsdbutil.c Sat Sep 19 20:06:12 2020 (r365912) @@ -53,7 +53,7 @@ static const char rcsid[] = #include "fsdb.h" #include "fsck.h" -void prtblknos(struct uufsd *disk, union dinode *dp); +void prtblknos(struct fs *fs, union dinode *dp); char ** crack(char *line, int *argc) @@ -236,7 +236,7 @@ printactive(int doblocks) case IFSOCK: case IFIFO: if (doblocks) - prtblknos(&disk, curinode); + prtblknos(&sblock, curinode); else printstat("current inode", curinum, curinode); break; Modified: head/tools/diag/prtblknos/Makefile ============================================================================== --- head/tools/diag/prtblknos/Makefile Sat Sep 19 19:48:15 2020 (r365911) +++ head/tools/diag/prtblknos/Makefile Sat Sep 19 20:06:12 2020 (r365912) @@ -11,6 +11,8 @@ LIBADD+=ufs WARNS?= 3 +CFLAGS+=-DPRTBLKNOS + test: ${PROG} ./${PROG} > a Modified: head/tools/diag/prtblknos/main.c ============================================================================== --- head/tools/diag/prtblknos/main.c Sat Sep 19 19:48:15 2020 (r365911) +++ head/tools/diag/prtblknos/main.c Sat Sep 19 20:06:12 2020 (r365912) @@ -39,14 +39,15 @@ union dinode { struct ufs2_dinode *dp2; }; -void prtblknos(struct uufsd *disk, union dinode *dp); +void prtblknos(struct fs *fs, union dinode *dp); +struct uufsd disk; + int main(argc, argv) int argc; char *argv[]; { - struct uufsd disk; union dinodep dp; struct fs *fs; struct stat sb; @@ -102,7 +103,7 @@ main(argc, argv) warn("Read of inode %jd on %s failed: %s", (intmax_t)inonum, fsname, disk.d_error); - prtblknos(&disk, (union dinode *)dp.dp1); + prtblknos(fs, (union dinode *)dp.dp1); } exit(0); } Modified: head/tools/diag/prtblknos/prtblknos.c ============================================================================== --- head/tools/diag/prtblknos/prtblknos.c Sat Sep 19 19:48:15 2020 (r365911) +++ head/tools/diag/prtblknos/prtblknos.c Sat Sep 19 20:06:12 2020 (r365912) @@ -31,32 +31,37 @@ #include #include +#include #include +#ifdef PRTBLKNOS union dinode { struct ufs1_dinode dp1; struct ufs2_dinode dp2; }; +extern struct uufsd disk; +#else /* used by fsdb */ +#include +static struct bufarea *bp; +#endif -void prtblknos(struct uufsd *disk, union dinode *dp); +void prtblknos(struct fs *fs, union dinode *dp); static const char *distance(struct fs *, ufs2_daddr_t, ufs2_daddr_t); static void printblk(struct fs *, ufs_lbn_t, ufs2_daddr_t, int, ufs_lbn_t); -static void indirprt(struct uufsd *, int, ufs_lbn_t, ufs_lbn_t, ufs2_daddr_t, +static void indirprt(struct fs *, int, ufs_lbn_t, ufs_lbn_t, ufs2_daddr_t, ufs_lbn_t); void -prtblknos(disk, dp) - struct uufsd *disk; +prtblknos(fs, dp) + struct fs *fs; union dinode *dp; { int i, mode, frags; ufs_lbn_t lbn, lastlbn, len, blksperindir; ufs2_daddr_t blkno; - struct fs *fs; off_t size; - fs = (struct fs *)&disk->d_sb; if (fs->fs_magic == FS_UFS1_MAGIC) { size = dp->dp1.di_size; mode = dp->dp1.di_mode; @@ -138,7 +143,7 @@ prtblknos(disk, dp) blkno = dp->dp1.di_ib[i]; else blkno = dp->dp2.di_ib[i]; - indirprt(disk, i, blksperindir, lbn, blkno, lastlbn); + indirprt(fs, i, blksperindir, lbn, blkno, lastlbn); blksperindir *= NINDIR(fs); lbn += blksperindir; len -= blksperindir; @@ -149,8 +154,8 @@ prtblknos(disk, dp) } static void -indirprt(disk, level, blksperindir, lbn, blkno, lastlbn) - struct uufsd *disk; +indirprt(fs, level, blksperindir, lbn, blkno, lastlbn) + struct fs *fs; int level; ufs_lbn_t blksperindir; ufs_lbn_t lbn; @@ -158,10 +163,8 @@ indirprt(disk, level, blksperindir, lbn, blkno, lastlb ufs_lbn_t lastlbn; { char indir[MAXBSIZE]; - struct fs *fs; ufs_lbn_t i, last; - fs = (struct fs *)&disk->d_sb; if (blkno == 0) { printblk(fs, lbn, blkno, blksperindir * NINDIR(fs) * fs->fs_frag, lastlbn); @@ -169,7 +172,14 @@ indirprt(disk, level, blksperindir, lbn, blkno, lastlb } printblk(fs, lbn, blkno, fs->fs_frag, -level); /* read in the indirect block. */ - if (bread(disk, fsbtodb(fs, blkno), indir, fs->fs_bsize) == -1) { +#ifdef PRTBLKNOS + if (bread(&disk, fsbtodb(fs, blkno), indir, fs->fs_bsize) == -1) { +#else /* used by fsdb */ + bp = getdatablk(blkno, fs->fs_bsize, BT_LEVEL1 + level); + if (bp->b_errs == 0) { + memcpy(indir, bp->b_un.b_buf, fs->fs_bsize); + } else { +#endif warn("Read of indirect block %jd failed", (intmax_t)blkno); /* List the unreadable part as a hole */ printblk(fs, lbn, 0, @@ -193,7 +203,7 @@ indirprt(disk, level, blksperindir, lbn, blkno, lastlb blkno = ((ufs1_daddr_t *)indir)[i]; else blkno = ((ufs2_daddr_t *)indir)[i]; - indirprt(disk, level - 1, blksperindir / NINDIR(fs), + indirprt(fs, level - 1, blksperindir / NINDIR(fs), lbn + blksperindir * i, blkno, lastlbn); } } From owner-svn-src-all@freebsd.org Sat Sep 19 20:06:31 2020 Return-Path: Delivered-To: svn-src-all@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 62C163EDF3A; Sat, 19 Sep 2020 20:06:31 +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 4Bv1tb18XPz4R4F; Sat, 19 Sep 2020 20:06:31 +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 E575C11846; Sat, 19 Sep 2020 20:06:30 +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 08JK6UeH054423; Sat, 19 Sep 2020 20:06:30 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JK6USd054422; Sat, 19 Sep 2020 20:06:30 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202009192006.08JK6USd054422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 19 Sep 2020 20:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365913 - stable/12/share/termcap X-SVN-Group: stable-12 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/12/share/termcap X-SVN-Commit-Revision: 365913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 20:06:31 -0000 Author: bapt Date: Sat Sep 19 20:06:30 2020 New Revision: 365913 URL: https://svnweb.freebsd.org/changeset/base/365913 Log: MFC r360775: Fix indentation of the Kitty entry Modified: stable/12/share/termcap/termcap Directory Properties: stable/12/ (props changed) Modified: stable/12/share/termcap/termcap ============================================================================== --- stable/12/share/termcap/termcap Sat Sep 19 20:06:12 2020 (r365912) +++ stable/12/share/termcap/termcap Sat Sep 19 20:06:30 2020 (r365913) @@ -4740,22 +4740,22 @@ xterm-kitty|KovId's TTY:\ :tc=xterm-256color:tc=kitty+common: kitty+common|KovId's TTY common properties:\ - :am:hs:km:mi:ms:xn:\ - :co#80:it#8:li#24:\ - :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:K1=:K3=:\ - :K4=:K5=:LE=\E[%dD:RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:\ - :ae=\E(B:al=\E[L:as=\E(0:bl=^G:bt=\E[Z:cd=\E[J:ce=\E[K:\ - :cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=\r:cs=\E[%i%d;%dr:\ - :ct=\E[3g:dc=\E[P:dl=\E[M:do=\n:ds=\E]2;\007:ec=\E[%dX:\ - :ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:k1=\EOP:k2=\EOQ:k3=\EOR:\ - :k4=\EOS:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:\ - :k9=\E[20~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:\ - :kd=\EOB:ke=\E[?1l:kh=\EOH:kl=\EOD:kr=\EOC:ks=\E[?1h:\ - :ku=\EOA:le=^H:md=\E[1m:me=\E[0m:mh=\E[2m:mr=\E[7m:nd=\E[C:\ - :rc=\E8:sc=\E7:se=\E[27m:sf=\n:so=\E[7m:sr=\EM:st=\EH:ta=^I:\ - :te=\E[?1049l:ti=\E[?1049h:ts=\E]2;:ue=\E[24m:up=\E[A:\ - :us=\E[4m:vb=\E[?5h\E[?5l:ve=\E[?12l\E[?25h:vi=\E[?25l:\ - :vs=\E[?12;25h: + :am:hs:km:mi:ms:xn:\ + :co#80:it#8:li#24:\ + :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:K1=:K3=:\ + :K4=:K5=:LE=\E[%dD:RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:\ + :ae=\E(B:al=\E[L:as=\E(0:bl=^G:bt=\E[Z:cd=\E[J:ce=\E[K:\ + :cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=\r:cs=\E[%i%d;%dr:\ + :ct=\E[3g:dc=\E[P:dl=\E[M:do=\n:ds=\E]2;\007:ec=\E[%dX:\ + :ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:k1=\EOP:k2=\EOQ:k3=\EOR:\ + :k4=\EOS:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:\ + :k9=\E[20~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:\ + :kd=\EOB:ke=\E[?1l:kh=\EOH:kl=\EOD:kr=\EOC:ks=\E[?1h:\ + :ku=\EOA:le=^H:md=\E[1m:me=\E[0m:mh=\E[2m:mr=\E[7m:nd=\E[C:\ + :rc=\E8:sc=\E7:se=\E[27m:sf=\n:so=\E[7m:sr=\EM:st=\EH:ta=^I:\ + :te=\E[?1049l:ti=\E[?1049h:ts=\E]2;:ue=\E[24m:up=\E[A:\ + :us=\E[4m:vb=\E[?5h\E[?5l:ve=\E[?12l\E[?25h:vi=\E[?25l:\ + :vs=\E[?12;25h: # # END OF TERMCAP From owner-svn-src-all@freebsd.org Sat Sep 19 20:15:52 2020 Return-Path: Delivered-To: svn-src-all@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 A17833EE23F; Sat, 19 Sep 2020 20:15:52 +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 4Bv25N3lWwz4Rkg; Sat, 19 Sep 2020 20:15:52 +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 64ECE11AC0; Sat, 19 Sep 2020 20:15:52 +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 08JKFqqh060645; Sat, 19 Sep 2020 20:15:52 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JKFpIU060641; Sat, 19 Sep 2020 20:15:51 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202009192015.08JKFpIU060641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 19 Sep 2020 20:15:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365914 - in stable/12/usr.bin/diff: . tests X-SVN-Group: stable-12 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in stable/12/usr.bin/diff: . tests X-SVN-Commit-Revision: 365914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 20:15:52 -0000 Author: bapt Date: Sat Sep 19 20:15:51 2020 New Revision: 365914 URL: https://svnweb.freebsd.org/changeset/base/365914 Log: MFC r361688-r361690, r365041 r361688: Restore compatibility with GNU diff regarding --label Various options to "diff(1)" show filenames, and traditionally make use of the "--label" parameter, if set. Restore this behaviour in BSD diff. While here add a regression test PR: 244533 Submitted by: Jamie Landeg-Jones r361689: diff: restore compatibility with GNU diff regarding -N option When -N is used the missing files are treated as empty. PR: 233402 Submitted by: Fehmi Noyan Isi Reported by: Roman Neuhauser Differential Revision: D25081 r361690: Document long version of -b option PR: 234195 Submitted by: Fehmi Noyan Isi Reported by: Andras Farkas r365041: diff: always properly kill pr(1) When diff is invoked with -l it will spawn the pr(1) program. In some circumpstances the pr(1) was not properly killed when diff program exits. Submitted by: Bret Ketchum Differential Revision: https://reviews.freebsd.org/D26232 Modified: stable/12/usr.bin/diff/diff.1 stable/12/usr.bin/diff/diff.c stable/12/usr.bin/diff/diffreg.c stable/12/usr.bin/diff/tests/diff_test.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/diff/diff.1 ============================================================================== --- stable/12/usr.bin/diff/diff.1 Sat Sep 19 20:06:30 2020 (r365913) +++ stable/12/usr.bin/diff/diff.1 Sat Sep 19 20:15:51 2020 (r365914) @@ -30,7 +30,7 @@ .\" @(#)diff.1 8.1 (Berkeley) 6/30/93 .\" $FreeBSD$ .\" -.Dd April 27, 2020 +.Dd June 1, 2020 .Dt DIFF 1 .Os .Sh NAME @@ -330,7 +330,7 @@ Use of this option forces to produce a diff. .It Fl B Fl -ignore-blank-lines Causes chunks that include only blank lines to be ignored. -.It Fl b +.It Fl b -ignore-space-change Causes trailing blanks (spaces and tabs) to be ignored, and other strings of blanks to compare equal. .It Fl d -minimal Modified: stable/12/usr.bin/diff/diff.c ============================================================================== --- stable/12/usr.bin/diff/diff.c Sat Sep 19 20:06:30 2020 (r365913) +++ stable/12/usr.bin/diff/diff.c Sat Sep 19 20:15:51 2020 (r365914) @@ -27,6 +27,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -351,13 +352,33 @@ main(int argc, char **argv) if (strcmp(argv[0], "-") == 0) { fstat(STDIN_FILENO, &stb1); gotstdin = 1; - } else if (stat(argv[0], &stb1) != 0) - err(2, "%s", argv[0]); + } else if (stat(argv[0], &stb1) != 0) { + if (!Nflag || errno != ENOENT) + err(2, "%s", argv[0]); + dflags |= D_EMPTY1; + memset(&stb1, 0, sizeof(struct stat)); + } + if (strcmp(argv[1], "-") == 0) { fstat(STDIN_FILENO, &stb2); gotstdin = 1; - } else if (stat(argv[1], &stb2) != 0) - err(2, "%s", argv[1]); + } else if (stat(argv[1], &stb2) != 0) { + if (!Nflag || errno != ENOENT) + err(2, "%s", argv[1]); + dflags |= D_EMPTY2; + memset(&stb2, 0, sizeof(stb2)); + stb2.st_mode = stb1.st_mode; + } + + if (dflags & D_EMPTY1 && dflags & D_EMPTY2){ + warn("%s", argv[0]); + warn("%s", argv[1]); + exit(2); + } + + if (stb1.st_mode == 0) + stb1.st_mode = stb2.st_mode; + if (gotstdin && (S_ISDIR(stb1.st_mode) || S_ISDIR(stb2.st_mode))) errx(2, "can't compare - to a directory"); set_argstr(oargv, argv); @@ -465,6 +486,9 @@ print_only(const char *path, size_t dirlen, const char void print_status(int val, char *path1, char *path2, const char *entry) { + if (label[0] != NULL) path1 = label[0]; + if (label[1] != NULL) path2 = label[1]; + switch (val) { case D_BINARY: printf("Binary files %s%s and %s%s differ\n", Modified: stable/12/usr.bin/diff/diffreg.c ============================================================================== --- stable/12/usr.bin/diff/diffreg.c Sat Sep 19 20:06:30 2020 (r365913) +++ stable/12/usr.bin/diff/diffreg.c Sat Sep 19 20:15:51 2020 (r365914) @@ -412,10 +412,10 @@ diffreg(char *file1, char *file2, int flags, int capsi ixnew = xreallocarray(ixnew, len[1] + 2, sizeof(*ixnew)); check(f1, f2, flags); output(file1, f1, file2, f2, flags); - if (pr != NULL) - stop_pr(pr); closem: + if (pr != NULL) + stop_pr(pr); if (anychange) { status |= 1; if (rval == D_SAME) @@ -1704,4 +1704,4 @@ print_space(int nc, int n, int flags) { } } diff_output("%*s", col, ""); -} \ No newline at end of file +} Modified: stable/12/usr.bin/diff/tests/diff_test.sh ============================================================================== --- stable/12/usr.bin/diff/tests/diff_test.sh Sat Sep 19 20:06:30 2020 (r365913) +++ stable/12/usr.bin/diff/tests/diff_test.sh Sat Sep 19 20:15:51 2020 (r365914) @@ -10,8 +10,10 @@ atf_test_case side_by_side atf_test_case brief_format atf_test_case b230049 atf_test_case Bflag +atf_test_case Nflag atf_test_case tabsize atf_test_case conflicting_format +atf_test_case label simple_body() { @@ -164,6 +166,15 @@ Bflag_body() atf_check -s exit:1 -o file:"$(atf_get_srcdir)/Bflag_F.out" diff -B E F } +Nflag_body() +{ + atf_check -x 'printf "foo" > A' + + atf_check -s exit:1 -o ignore -e ignore diff -N A NOFILE + atf_check -s exit:1 -o ignore -e ignore diff -N NOFILE A + atf_check -s exit:2 -o ignore -e ignore diff -N NOFILE1 NOFILE2 +} + tabsize_body() { printf "\tA\n" > A @@ -195,6 +206,17 @@ conflicting_format_body() atf_check -s exit:1 -o ignore -e ignore diff --normal --normal A B } +label_body() +{ + printf "\tA\n" > A + + atf_check -o inline:"Files hello and world are identical\n" \ + -s exit:0 diff --label hello --label world -s A A + + atf_check -o inline:"Binary files hello and world differ\n" \ + -s exit:1 diff --label hello --label world `which diff` `which ls` +} + atf_init_test_cases() { atf_add_test_case simple @@ -207,6 +229,8 @@ atf_init_test_cases() atf_add_test_case brief_format atf_add_test_case b230049 atf_add_test_case Bflag + atf_add_test_case Nflag atf_add_test_case tabsize atf_add_test_case conflicting_format + atf_add_test_case label } From owner-svn-src-all@freebsd.org Sat Sep 19 20:17:08 2020 Return-Path: Delivered-To: svn-src-all@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 B50363EE703; Sat, 19 Sep 2020 20:17:08 +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 4Bv26r4jhxz4Rpx; Sat, 19 Sep 2020 20:17:08 +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 84D841176D; Sat, 19 Sep 2020 20:17:08 +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 08JKH8R9060785; Sat, 19 Sep 2020 20:17:08 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JKH828060784; Sat, 19 Sep 2020 20:17:08 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202009192017.08JKH828060784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 19 Sep 2020 20:17:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365915 - stable/12/share/misc X-SVN-Group: stable-12 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/12/share/misc X-SVN-Commit-Revision: 365915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 20:17:08 -0000 Author: bapt Date: Sat Sep 19 20:17:08 2020 New Revision: 365915 URL: https://svnweb.freebsd.org/changeset/base/365915 Log: MFC r361361, r365791 r361361: Update pciids to 2020.05.22 r365791: Update to 2020.08.19 Modified: stable/12/share/misc/pci_vendors Directory Properties: stable/12/ (props changed) Modified: stable/12/share/misc/pci_vendors ============================================================================== --- stable/12/share/misc/pci_vendors Sat Sep 19 20:15:51 2020 (r365914) +++ stable/12/share/misc/pci_vendors Sat Sep 19 20:17:08 2020 (r365915) @@ -1,9 +1,10 @@ # $FreeBSD$ +# # List of PCI ID's # -# Version: 2020.02.22 -# Date: 2020-02-22 03:15:04 +# Version: 2020.08.19 +# Date: 2020-08-19 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at https://pci-ids.ucw.cz/. @@ -43,6 +44,8 @@ 7a0b SPI Controller 7a0c LPC Controller 7a0f DMA (Direct Memory Access) Controller +# Found on some boards with two sockets + 7a10 Hyper Transport Bridge Controller 7a14 EHCI USB Controller 7a15 Vivante GPU (Graphics Processing Unit) 7a19 PCI-to-PCI Bridge @@ -92,6 +95,8 @@ 1703 ISDN Adapter (PCI Bus, DV, W) 1704 ISDN Adapter (PCI Bus, D, C) 0721 Sapphire, Inc. +0731 Jingjia Microelectronics Co Ltd + 7200 JM7200 Series GPU 0777 Ubiquiti Networks, Inc. 0795 Wired Inc. 6663 Butane II (MPEG2 encoder board) @@ -271,6 +276,9 @@ 0013 53c875a 1000 1000 LSI53C875A PCI to Ultra SCSI Controller 0014 MegaRAID Tri-Mode SAS3516 + 1000 9460 MegaRAID 9460-16i + 1000 9480 MegaRAID 9480-8i8e + 1000 9481 MegaRAID 9480-8e 1028 1f3a PERC H745 Adapter 1028 1f3b PERC H745 Front 1028 1fd4 PERC H745P MX @@ -282,10 +290,15 @@ 8086 9460 RAID Controller RSP3TD160F 8086 9480 RAID Controller RSP3MD088F 0015 MegaRAID Tri-Mode SAS3416 + 1000 9441 MegaRAID 9440-16i 1028 1f3c PERC H345 Adapter 1028 1f3d PERC H345 Front 1d49 0503 ThinkSystem RAID 530-16i PCIe 12Gb Adapter 0016 MegaRAID Tri-Mode SAS3508 + 1000 9461 MegaRAID 9460-8i + 1000 9462 MegaRAID 9460-4i + 1000 9463 MegaRAID 9365-28i + 1000 9464 MegaRAID 9365-24i 1028 1fc9 PERC H840 Adapter 1028 1fcb PERC H740P Adapter 1028 1fcd PERC H740P Mini @@ -296,6 +309,8 @@ 8086 352f Integrated RAID Module RMSP3HD080E 8086 9461 RAID Controller RSP3DD080F 0017 MegaRAID Tri-Mode SAS3408 + 1000 9440 MegaRAID 9440-8i + 1000 9442 MegaRAID 9440-4i 1d49 0500 ThinkSystem RAID 530-8i PCIe 12Gb Adapter 1d49 0502 ThinkSystem RAID 530-8i Dense Adapter 8086 3528 Integrated RAID RMSP3LD060 @@ -438,8 +453,8 @@ 1028 1fd1 PERC H730P MX 17aa 1052 ThinkServer RAID 720i 17aa 1053 ThinkServer RAID 720ix - 1bd4 0014 6G SAS3108 2G - 1bd4 0015 6G SAS3108 4G + 1bd4 0014 12G SAS3108 2G + 1bd4 0015 12G SAS3108 4G 1d49 0600 ThinkSystem RAID 730-8i 1GB Cache PCIe 12Gb Adapter 1d49 0608 ThinkSystem RAID 730-8i 2GB Flash PCIe 12Gb Adapter 1d49 0609 ThinkSystem RAID 730-8i 4GB Flash PCIe 12Gb Adapter @@ -456,6 +471,7 @@ 1028 1f4c PERC H330 Mini (for blades) 1028 1f4d PERC H330 Embedded (for monolithic) 1054 306a SAS 3004 iMR ROMB + 1734 1211 PRAID CP400i [D3307-A12] 1d49 04db ServeRAID M1210 SAS/SATA Controller 1d49 0504 ThinkSystem RAID 520-8i PCIe 12Gb Adapter 0060 MegaRAID SAS 1078 @@ -655,10 +671,13 @@ 1028 1fd3 HBA330 MMZ # Supermicro AOC-S3008L-L8e uses 0808 for their SAS3008 SAS controller 15d9 0808 AOC-S3008L-L8e + 1bd4 0008 12G SAS3008IMR Onboard 1bd4 000b 12G SAS3008IR 1bd4 000c 12G SAS3008IT 1bd4 0011 Inspur 12Gb 8i-3008 IT SAS HBA 1bd4 0012 12Gb SAS3008IR UDM + 1bd4 001f 12G SAS3008IR Onboard + 1bd4 0020 12G SAS3008IT Onboard 1bd4 0026 12G SAS3008IT RACK 1bd4 0027 12G SAS3008IMR RACK 1bd4 0028 12G SAS3008IR RACK @@ -692,6 +711,7 @@ 00c2 SAS3324 PCI-Express Fusion-MPT SAS-3 00c3 SAS3324 PCI-Express Fusion-MPT SAS-3 00c4 SAS3224 PCI-Express Fusion-MPT SAS-3 + 1170 0002 SAS3224 PCI Express to 12Gb HBA MEZZ CARD 00c5 SAS3316 PCI-Express Fusion-MPT SAS-3 00c6 SAS3316 PCI-Express Fusion-MPT SAS-3 00c7 SAS3316 PCI-Express Fusion-MPT SAS-3 @@ -739,6 +759,10 @@ 1d49 0205 ThinkSystem 440-16i SAS/SATA PCIe Gen4 12Gb Internal HBA 1d49 0206 ThinkSystem 440-16e SAS/SATA PCIe Gen4 12Gb HBA 00e6 Fusion-MPT 12GSAS/PCIe Secure SAS38xx + 1000 4050 9500-16i Tri-Mode HBA + 1000 4060 9500-8i Tri-Mode HBA + 1000 4070 9500-16e Tri-Mode HBA + 1000 4080 9500-8e Tri-Mode HBA 1028 200b HBA355i Adapter 1028 200c HBA355i Front 1028 200d HBA355e Adapter @@ -922,18 +946,20 @@ 13e9 Ariel 1478 Navi 10 XL Upstream Port of PCI Express Switch 1479 Navi 10 XL Downstream Port of PCI Express Switch - 154c Kryptos + 154c Kryptos [Radeon RX 350] 154e Garfield 1551 Arlene 1552 Pooky 1561 Anubis 15d8 Picasso 103c 8615 Pavilion Laptop 15-cw1xxx + 17aa 5124 ThinkPad E595 15dd Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] 103c 83c6 Radeon Vega 8 Mobile 1458 d000 Radeon RX Vega 11 15de Raven/Raven2/Fenghuang HDMI/DP Audio Controller 103c 8615 Pavilion Laptop 15-cw1xxx + 17aa 5124 ThinkPad E595 15df Raven/Raven2/Fenghuang/Renoir Cryptographic Coprocessor 103c 8615 Pavilion Laptop 15-cw1xxx 15ff Fenghuang [Zhongshan Subor Z+] @@ -1120,6 +1146,7 @@ 105b 0e13 N15235/A74MX mainboard / AMD SB700 1179 ff50 Satellite P305D-S8995E 1458 a022 GA-MA770-DS3rev2.0 Motherboard + 1458 a102 GA-880GMA-USB3 17f2 5000 KI690-AM2 Motherboard 4384 SBx00 PCI to PCI Bridge 4385 SBx00 SMBus Controller @@ -1190,6 +1217,7 @@ 1043 8443 M5A88-V EVO 1043 84dd M5A99X EVO (R1.0) SB950 105b 0e13 N15235/A74MX mainboard / AMD SB700 + 1458 b002 GA-880GMA-USB3 174b 1001 PURE Fusion Mini 4392 SB7x0/SB8x0/SB9x0 SATA Controller [Non-RAID5 mode] 105b 0e13 N15235/A74MX mainboard / AMD SB700 @@ -1203,6 +1231,7 @@ 1043 82ef M3A78-EH Motherboard 1043 8443 M5A88-V EVO 105b 0e13 N15235/A74MX mainboard / AMD SB700 + 1458 5004 GA-880GMA-USB3 15d9 a811 H8DGU 174b 1001 PURE Fusion Mini 4397 SB7x0/SB8x0/SB9x0 USB OHCI0 Controller @@ -1212,6 +1241,7 @@ 1043 82ef M3A78-EH Motherboard 1043 8443 M5A88-V EVO 105b 0e13 N15235/A74MX mainboard / AMD SB700 + 1458 5004 GA-880GMA-USB3 15d9 a811 H8DGU 174b 1001 PURE Fusion Mini 4398 SB7x0 USB OHCI1 Controller @@ -1224,6 +1254,7 @@ 1043 82ef M3A78-EH Motherboard 1043 8443 M5A88-V EVO 105b 0e13 N15235/A74MX mainboard / AMD SB700 + 1458 5004 GA-880GMA-USB3 174b 1001 PURE Fusion Mini 439c SB7x0/SB8x0/SB9x0 IDE Controller 1002 4392 MSI MS-7713 motherboard @@ -1649,7 +1680,7 @@ 554a R423 [Radeon X800 XT Platinum Edition] 554b R423 [Radeon X800 GT/SE] 1002 0302 Radeon X800 SE - 554d R430 [Radeon X800 XL] + 554d R480 [Radeon X800 GTO2/XL] 1002 0322 All-In-Wonder X800 XL 1458 2124 GV-R80L256V-B (AGP) 554e R430 [All-In-Wonder X800 GT] @@ -1658,7 +1689,7 @@ 5551 R423 GL [FireGL V5100] 5569 R423 [Radeon X800 PRO] (Secondary) 556b R423 [Radeon X800 GT] (Secondary) - 556d R430 [Radeon X800 XL] (Secondary) + 556d R480 [Radeon X800 GTO2/XL] (Secondary) 1458 2125 GV-R80L256V-B (AGP) 556f R430 [Radeon X800] (Secondary) 5571 R423 GL [FireGL V5100] (Secondary) @@ -1878,9 +1909,9 @@ 1642 3c81 Radeon HD 8670 1642 3c91 Radeon HD 8670 1642 3f09 Radeon R7 350 - 6611 Oland [Radeon HD 8570 / R7 240/340 OEM] + 6611 Oland [Radeon HD 8570 / R7 240/340 / Radeon 520 OEM] 1028 210b Radeon R5 240 OEM - 1642 1869 AMD Radeon 520 + 1642 1869 Radeon 520 OEM 174b 4248 Radeon R7 240 OEM 174b a240 Radeon R7 240 OEM 174b d340 Radeon R7 340 OEM @@ -1900,9 +1931,11 @@ 103c 0b0c Bonaire [FirePro W4300] 103c 230c FirePro W5100 13cc 3d2a MXRT-5600 + 664d Bonaire [FirePro W5100 / Barco MXRT-5600] 6650 Bonaire 6651 Bonaire 6658 Bonaire XTX [Radeon R7 260X/360] + 1043 048f R7260X-DC2OC-2GD5 1043 04d3 AMD Radeon R7 260X 148c 0907 Radeon R7 360 1682 0907 Radeon R7 360 @@ -2561,6 +2594,8 @@ 1002 0b37 Radeon RX 480 1028 1722 Radeon RX 570X 1028 1723 Radeon RX 580X +# OEM card found in desktops sold by HP. + 103c 840e Radeon RX 580 4GB 1043 04a8 Radeon RX 480 1043 04b0 Radeon RX 470 1043 04fb Radeon RX 480 @@ -2575,10 +2610,15 @@ 1462 3413 Radeon RX 480 Gaming X 8GB 1462 3416 Radeon RX 570 1462 3418 Radeon RX 580 Armor 4G OC + 1462 341b Radeon RX 570 Armor 8G OC 1462 341e Radeon RX 570 Armor 4G OC 1462 8a92 Radeon RX 580 148c 2372 Radeon RX 480 [Red Dragon] 148c 2373 Radeon RX 470 + 148c 2377 Red Devil RX 580 8G Golden +# https://www.techpowerup.com/vgabios/?manufacturer=Powercolor&model=RX+580 + 148c 2378 Radeon RX 580 + 148c 2379 Radeon RX 570 4G [Red Dragon] 1682 9470 Radeon RX 470 1682 9480 Radeon RX 480 1682 9588 Radeon RX 580 XTR @@ -2591,6 +2631,7 @@ 1849 5030 Phantom Gaming D Radeon RX580 8G OC 1da2 e353 Radeon RX 570 Pulse 4GB 1da2 e366 Nitro+ Radeon RX 570/580/590 + 1da2 e387 Radeon RX 570 Pulse 4GB 67e0 Baffin [Radeon Pro WX 4170] 103c 8270 Radeon Pro WX 4170 103c 8272 Radeon Pro WX 4170 @@ -2610,6 +2651,7 @@ 67ef Baffin [Radeon RX 460/560D / Pro 450/455/460/555/555X/560/560X] 1028 1703 RX 560D OEM OC 2 GB 103c 3421 Radeon RX 460 + 1043 0561 AREZ Radeon RX 560 106b 0160 Radeon Pro 460 106b 0166 Radeon Pro 455 106b 0167 Radeon Pro 450 @@ -2844,13 +2886,14 @@ 6861 Vega 10 XT [Radeon PRO WX 9100] 6862 Vega 10 XT [Radeon PRO SSG] 6863 Vega 10 XTX [Radeon Vega Frontier Edition] - 6864 Vega + 6864 Vega 10 [Radeon Pro V340] 6867 Vega 10 XL [Radeon Pro Vega 56] 6868 Vega 10 [Radeon PRO WX 8100/8200] 686c Vega 10 [Radeon Instinct MI25 MxGPU] 687f Vega 10 XL/XT [Radeon RX Vega 56/64] 1002 0b36 RX Vega64 - 1002 6b76 RX Vega56 + 1002 6b76 RX Vega64 + 1458 230c Radeon RX VEGA 56 GAMING OC 8G 6880 Lexington [Radeon HD 6550M] 103c 163c Pavilion dv6 Radeon HD 6550M 6888 Cypress XT [FirePro V8800] @@ -3349,7 +3392,8 @@ 6901 Topaz PRO [Radeon R5 M255] 103c 1318 Radeon R6 M255DX 6907 Meso XT [Radeon R5 M315] - 6921 Amethyst XT [Radeon R9 M295X] + 6920 Amethyst [Radeon R9 M395/ M395X Mac Edition] + 6921 Amethyst XT [Radeon R9 M295X / M390X] 6929 Tonga XT GL [FirePro S7150] 692b Tonga PRO GL [FirePro W7100] 13cc 3d2b MXRT-7600 @@ -3468,6 +3512,7 @@ 71c1 RV535 [Radeon X1650 PRO] 174b 0880 Radeon X1700 FSC 71c2 RV530 [Radeon X1600 PRO] + 71c3 RV530 [Radeon X1600 PRO] 71c4 RV530/M56 GL [Mobility FireGL V5200] 17aa 2007 ThinkPad T60p 71c5 RV530/M56-P [Mobility Radeon X1600] @@ -3528,13 +3573,16 @@ 1043 049e Radeon R9 FURY 1043 04a0 Radeon R9 FURY X 174b e329 Radeon R9 FURY - 7310 Navi 10 + 7310 Navi 10 [Radeon Pro W5700X] 7312 Navi 10 [Radeon Pro W5700] 731f Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] + 1458 2313 Radeon RX 5700 XT Gaming OC + 1da2 e411 Radeon RX 5600 XT 7340 Navi 14 [Radeon RX 5500/5500M / Pro 5500M] 7341 Navi 14 [Radeon Pro W5500] 7347 Navi 14 [Radeon Pro W5500M] 734f Navi 14 [Radeon Pro W5300M] + 7360 Navi 12 [Radeon Pro 5600M] 7833 RS350 Host Bridge 7834 RS350 [Radeon 9100 PRO/XT IGP] 7835 RS350M [Mobility Radeon 9000 IGP] @@ -3730,6 +3778,7 @@ 9599 RV635 PRO [Radeon HD 3650 AGP] 95c0 RV620 PRO [Radeon HD 3470] 1002 95c0 Mobility Radeon HD 3470 + 1028 3243 C120D 95c2 RV620/M82 [Mobility Radeon HD 3410/3430] 95c4 RV620/M82 [Mobility Radeon HD 3450/3470] 1002 95c4 Mobility Radeon HD 3400 @@ -3747,6 +3796,7 @@ 9612 RS780M [Mobility Radeon HD 3200] 9613 RS780MC [Mobility Radeon HD 3100] 9614 RS780D [Radeon HD 3300] + 9615 RS780E [Radeon HD 3200] 9616 RS780L [Radeon 3000] 9640 Sumo [Radeon HD 6550D] 9641 Sumo [Radeon HD 6620G] @@ -3860,7 +3910,7 @@ 9917 Trinity [Radeon HD 7620G] 9918 Trinity [Radeon HD 7600G] 9919 Trinity [Radeon HD 7500G] - 991e Bishop + 991e Bishop [Xbox One S APU] 9920 Liverpool [Playstation 4 APU] 9921 Liverpool HDMI/DP Audio Controller 9922 Starshp @@ -3917,6 +3967,7 @@ aab0 Oland/Hainan/Cape Verde/Pitcairn HDMI Audio [Radeon HD 7000 Series] aab8 Tiran HDMI Audio aac0 Tobago HDMI Audio [Radeon R7 360 / R9 360 OEM] + 1043 aac0 R7260X-DC2OC-2GD5 aac8 Hawaii HDMI Audio [Radeon R9 290/290X / 390/390X] aad8 Tonga HDMI Audio [Radeon R9 285/380] 174b aad8 Radeon R9 285/380 HDMI Audio @@ -4567,6 +4618,8 @@ 1466 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 6 1467 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 7 1468 Zeppelin Cryptographic Coprocessor NTBCCP + 1470 Vega 10 PCIe Bridge + 1471 Vega 10 PCIe Bridge 1480 Starship/Matisse Root Complex 1462 7c37 X570-A PRO motherboard 1481 Starship/Matisse IOMMU @@ -4694,13 +4747,18 @@ 15dc Raven/Raven2 Internal PCIe GPP Bridge 0 to Bus B 15de Raven/Raven2/FireFlight HD Audio Controller 15df Family 17h (Models 10h-1fh) Platform Security Processor + 17aa 5124 ThinkPad E595 15e0 Raven USB 3.1 103c 8615 Pavilion Laptop 15-cw1xxx + 17aa 5124 ThinkPad E595 15e1 Raven USB 3.1 103c 8615 Pavilion Laptop 15-cw1xxx + 17aa 5124 ThinkPad E595 15e2 Raven/Raven2/FireFlight/Renoir Audio Processor + 17aa 5124 ThinkPad E595 15e3 Family 17h (Models 10h-1fh) HD Audio Controller 103c 8615 Pavilion Laptop 15-cw1xxx + 17aa 5124 ThinkPad E595 15e4 Raven/Raven2/Renoir Sensor Fusion Hub 15e5 Raven2 USB 3.1 15e6 Raven/Raven2/Renoir Non-Sensor Fusion Hub KMDF driver @@ -4968,9 +5026,11 @@ 790b FCH SMBus Controller 103c 8615 Pavilion Laptop 15-cw1xxx 1462 7c37 X570-A PRO motherboard + 17aa 5124 ThinkPad E595 790e FCH LPC Bridge 103c 8615 Pavilion Laptop 15-cw1xxx 1462 7c37 X570-A PRO motherboard + 17aa 5124 ThinkPad E595 790f FCH PCI Bridge 7914 FCH USB XHCI Controller 9600 RS780 Host Bridge @@ -5174,6 +5234,7 @@ 0519 MGA 2064W [Millennium] 051a MGA 1064SG [Mystique] 102b 0100 MGA-1064SG Mystique + 102b 051a MGA-1164SG Mystique 220 102b 1100 MGA-1084SG Mystique 102b 1200 MGA-1084SG Mystique 1100 102b MGA-1084SG Mystique @@ -6657,24 +6718,24 @@ 105d 0009 Imagine 128 series 2e 4Mb DRAM 105d 000a Imagine 128 series 2 8Mb VRAM 105d 000b Imagine 128 series 2 8Mb H-VRAM - 11a4 000a Barco Metheus 5 Megapixel - 13cc 0000 Barco Metheus 5 Megapixel - 13cc 0004 Barco Metheus 5 Megapixel - 13cc 0005 Barco Metheus 5 Megapixel - 13cc 0006 Barco Metheus 5 Megapixel - 13cc 0008 Barco Metheus 5 Megapixel - 13cc 0009 Barco Metheus 5 Megapixel - 13cc 000a Barco Metheus 5 Megapixel - 13cc 000c Barco Metheus 5 Megapixel + 11a4 000a Metheus 5 Megapixel + 13cc 0000 Metheus 5 Megapixel + 13cc 0004 Metheus 5 Megapixel + 13cc 0005 Metheus 5 Megapixel + 13cc 0006 Metheus 5 Megapixel + 13cc 0008 Metheus 5 Megapixel + 13cc 0009 Metheus 5 Megapixel + 13cc 000a Metheus 5 Megapixel + 13cc 000c Metheus 5 Megapixel 493d Imagine 128 T2R [Ticket to Ride] - 11a4 000a Barco Metheus 5 Megapixel, Dual Head - 11a4 000b Barco Metheus 5 Megapixel, Dual Head - 13cc 0002 Barco Metheus 4 Megapixel, Dual Head - 13cc 0003 Barco Metheus 5 Megapixel, Dual Head - 13cc 0007 Barco Metheus 5 Megapixel, Dual Head - 13cc 0008 Barco Metheus 5 Megapixel, Dual Head - 13cc 0009 Barco Metheus 5 Megapixel, Dual Head - 13cc 000a Barco Metheus 5 Megapixel, Dual Head + 11a4 000a Metheus 5 Megapixel, Dual Head + 11a4 000b Metheus 5 Megapixel, Dual Head + 13cc 0002 Metheus 4 Megapixel, Dual Head + 13cc 0003 Metheus 5 Megapixel, Dual Head + 13cc 0007 Metheus 5 Megapixel, Dual Head + 13cc 0008 Metheus 5 Megapixel, Dual Head + 13cc 0009 Metheus 5 Megapixel, Dual Head + 13cc 000a Metheus 5 Megapixel, Dual Head 5348 Revolution 4 105d 0037 Revolution IV-FP AGP (For SGI 1600SW) 11a4 0028 PVS5600M @@ -10419,7 +10480,7 @@ 06eb G98M [Quadro NVS 160M] 06ec G98M [GeForce G 105M] 06ed G98 [GeForce 9600 GT / 9800 GT] - 06ee G98 [GeForce 9600 GT / 9800 GT] + 06ee G98 [GeForce 9600 GT / 9800 GT / GT 240] 06ef G98M [GeForce G 103M] 06f1 G98M [GeForce G 105M] 06f8 G98 [Quadro NVS 420] @@ -10974,6 +11035,7 @@ 0fb9 GP107GL High Definition Audio Controller 0fba GM206 High Definition Audio Controller 0fbb GM204 High Definition Audio Controller + 0fbc GM107 High Definition Audio Controller [GeForce 940MX] 0fc0 GK107 [GeForce GT 640 OEM] 0fc1 GK107 [GeForce GT 640] 0fc2 GK107 [GeForce GT 630 OEM] @@ -10998,6 +11060,7 @@ 0fd3 GK107M [GeForce GT 640M LE] 0fd4 GK107M [GeForce GTX 660M] 0fd5 GK107M [GeForce GT 650M Mac Edition] + 0fd6 GK107M 0fd8 GK107M [GeForce GT 640M Mac Edition] 0fd9 GK107M [GeForce GT 645M] 0fdb GK107M @@ -11014,6 +11077,7 @@ # GRID K1 USM 0fe7 GK107GL [GRID K100 vGPU] 10de 101e GRID K100 + 0fe8 GK107M 0fe9 GK107M [GeForce GT 750M Mac Edition] 0fea GK107M [GeForce GT 755M Mac Edition] 0fec GK107M [GeForce 710A] @@ -11538,6 +11602,7 @@ 11a3 GK104M [GeForce GTX 680MX] 106b 010d iMac 13,2 11a7 GK104M [GeForce GTX 675MX] + 11a9 GK104M [GeForce GTX 870M] 11af GK104GLM [GRID IceCube] 11b0 GK104GL [GRID K240Q / K260Q vGPU] 10de 101a GRID K240Q @@ -11630,8 +11695,10 @@ 1287 GK208B [GeForce GT 730] 1288 GK208B [GeForce GT 720] 1289 GK208 [GeForce GT 710] + 128a GK208B 128b GK208B [GeForce GT 710] 1043 85f7 GT710-SL-1GD5 + 128c GK208B 1290 GK208M [GeForce GT 730M] 103c 2afa GeForce GT 730A 103c 2b04 GeForce GT 730A @@ -11772,6 +11839,7 @@ 174e GM108M [GeForce MX110] 1789 GM107GL [GRID M3-3020] 179c GM107 [GeForce 940MX] + 1025 1094 Acer Aspire E5-575G 17c2 GM200 [GeForce GTX TITAN X] 17c8 GM200 [GeForce GTX 980 Ti] 17f0 GM200GL [Quadro M6000] @@ -11787,7 +11855,8 @@ 1adb TU106 USB Type-C UCSI Controller 1043 8673 TURBO-RTX2070-8G 1aeb TU116 High Definition Audio Controller - 1aed TU116 [GeForce GTX 1650 SUPER] + 1aec TU116 USB 3.1 Host Controller + 1aed TU116 USB Type-C UCSI Controller 1b00 GP102 [TITAN X] 1b01 GP102 [GeForce GTX 1080 Ti 10GB] 1b02 GP102 [TITAN Xp] @@ -11869,6 +11938,7 @@ 1c91 GP107M [GeForce GTX 1050 3 GB Max-Q] 1c92 GP107M [GeForce GTX 1050 Mobile] 1c94 GP107M [GeForce MX350] + 1c96 GP107M [GeForce MX350] 1ca7 GP107GL 1ca8 GP107GL 1caa GP107GL @@ -11901,6 +11971,7 @@ 1d33 GP108GLM [Quadro P500 Mobile] 1d34 GP108GLM [Quadro P520] 1d52 GP108BM [GeForce MX250] + 1d56 GP108BM [GeForce MX330] 1d81 GV100 [TITAN V] 1db1 GV100GL [Tesla V100 SXM2 16GB] 1db2 GV100GL [Tesla V100 DGXS 16GB] @@ -11921,11 +11992,12 @@ 1e04 TU102 [GeForce RTX 2080 Ti] 1e07 TU102 [GeForce RTX 2080 Ti Rev. A] 1462 3715 RTX 2080 Ti GAMING X TRIO - 1e2d TU102B - 1e2e TU102B + 1e2d TU102 [GeForce RTX 2080 Ti Engineering Sample] + 1e2e TU102 [GeForce RTX 2080 Ti 12GB Engineering Sample] 1e30 TU102GL [Quadro RTX 6000/8000] 10de 129e Quadro RTX 8000 10de 12ba Quadro RTX 6000 + 1e36 TU102GL [Quadro RTX 6000] 1e37 TU102GL [GRID RTX T10-4/T10-8/T10-16] 10de 1347 GRID RTX T10-8 10de 1348 GRID RTX T10-4 @@ -11943,6 +12015,8 @@ 1e87 TU104 [GeForce RTX 2080 Rev. A] 1e89 TU104 [GeForce RTX 2060] 1e90 TU104M [GeForce RTX 2080 Mobile] + 1e91 TU104M [GeForce RTX 2070 SUPER Mobile / Max-Q] + 1e93 TU104M [GeForce RTX 2080 SUPER Mobile / Max-Q] 1eab TU104M 1eae TU104M 1eb0 TU104GL [Quadro RTX 5000] @@ -11955,34 +12029,56 @@ 1ec2 TU104 [GeForce RTX 2070 SUPER] 1ec7 TU104 [GeForce RTX 2070 SUPER] 1ed0 TU104BM [GeForce RTX 2080 Mobile] + 1ed1 TU104BM [GeForce RTX 2070 SUPER Mobile / Max-Q] + 1ed3 TU104BM [GeForce RTX 2080 SUPER Mobile / Max-Q] + 1ef5 TU104GLM [Quadro RTX 5000 Mobile Refresh] 1f02 TU106 [GeForce RTX 2070] 1043 8673 TURBO RTX 2070 1f04 TU106 1f06 TU106 [GeForce RTX 2060 SUPER] 1f07 TU106 [GeForce RTX 2070 Rev. A] 1f08 TU106 [GeForce RTX 2060 Rev. A] + 1f09 TU106 [GeForce GTX 1660 SUPER] + 1f0a TU106 [GeForce GTX 1650] 1f10 TU106M [GeForce RTX 2070 Mobile] 1f11 TU106M [GeForce RTX 2060 Mobile] + 1f12 TU106M [GeForce RTX 2060 Max-Q] + 1f14 TU106M [GeForce RTX 2070 Mobile / Max-Q Refresh] + 1f15 TU106M [GeForce RTX 2060 Mobile] 1f2e TU106M 1f36 TU106GLM [Quadro RTX 3000 Mobile / Max-Q] 1f42 TU106 [GeForce RTX 2060 SUPER] 1f47 TU106 [GeForce RTX 2060 SUPER] - 1f50 TU106BM [GeForce RTX 2070 Mobile] + 1f50 TU106BM [GeForce RTX 2070 Mobile / Max-Q] 1f51 TU106BM [GeForce RTX 2060 Mobile] + 1f54 TU106BM [GeForce RTX 2070 Mobile] + 1f55 TU106BM [GeForce RTX 2060 Mobile] 1f81 TU117 1f82 TU117 [GeForce GTX 1650] 1f91 TU117M [GeForce GTX 1650 Mobile / Max-Q] 1f92 TU117M [GeForce GTX 1650 Mobile] + 1f94 TU117M [GeForce GTX 1650 Mobile] + 1f95 TU117M [GeForce GTX 1650 Ti Mobile] 1f96 TU117M [GeForce GTX 1650 Mobile / Max-Q] + 1f97 TU117M [GeForce MX450] + 1f99 TU117M 1fae TU117GL 1fb8 TU117GLM [Quadro T2000 Mobile / Max-Q] 1fb9 TU117GLM [Quadro T1000 Mobile] 1fbf TU117GL + 1fd9 TU117BM [GeForce GTX 1650 Mobile Refresh] + 1ff9 TU117GLM [Quadro T1000 Mobile] + 20b0 GA100 [A100 SXM4 40GB] + 20be GA100 [GRID A100A] + 20bf GA100 [GRID A100B] + 20f1 GA100 [A100 PCIe 40GB] 2182 TU116 [GeForce GTX 1660 Ti] 2183 TU116 2184 TU116 [GeForce GTX 1660] 2187 TU116 [GeForce GTX 1650 SUPER] + 2188 TU116 [GeForce GTX 1650] 2191 TU116M [GeForce GTX 1660 Ti Mobile] + 2192 TU116M [GeForce GTX 1650 Ti Mobile] 21ae TU116GL 21bf TU116GL 21c4 TU116 [GeForce GTX 1660 SUPER] @@ -12201,17 +12297,20 @@ 522a RTS522A PCI Express Card Reader 103c 8079 EliteBook 840 G3 103c 825b OMEN-17-w001nv + 17aa 5124 ThinkPad E595 5249 RTS5249 PCI Express Card Reader 103c 1909 ZBook 15 524a RTS524A PCI Express Card Reader 5250 RTS5250 PCI Express Card Reader 525a RTS525A PCI Express Card Reader + 1028 06d6 Latitude 7275 tablet 1028 06dc Latitude E7470 1028 06e4 XPS 15 9550 17aa 224f ThinkPad X1 Carbon 5th Gen 5260 RTS5260 PCI Express Card Reader 5286 RTS5286 PCI Express Card Reader 5287 RTL8411B PCI Express Card Reader + 1025 1094 Acer Aspire E5-575G 5288 RTS5288 PCI Express Card Reader 5289 RTL8411 PCI Express Card Reader 1043 1457 K55A Laptop @@ -12294,11 +12393,13 @@ 1462 236c 945P Neo3-F motherboard 8168 RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller 1019 8168 RTL8111/8168 PCI Express Gigabit Ethernet controller + 1025 1094 Acer Aspire E5-575G 1028 0283 Vostro 220 1028 04b2 Vostro 3350 1028 04da Vostro 3750 1028 06f2 Latitude 3470 1028 06f3 Latitude 3570 + 1028 0869 Vostro 3470 103c 1611 Pavilion DM1Z-3000 103c 1950 ProBook 450/455 103c 2a6f Asus IPIBL-LB Motherboard @@ -12323,6 +12424,8 @@ 1462 7c37 X570-A PRO motherboard 1775 11cc CC11/CL11 17aa 3814 Z50-75 + 17aa 3823 Lenovo V130-15IGM Laptop - Type 81HL + 17aa 5124 ThinkPad E595 1849 8168 Motherboard (one of many) 7470 3468 TG-3468 Gigabit PCI Express Network Adapter 8086 2055 NUC Kit DN2820FYKH @@ -12376,6 +12479,8 @@ 17aa b736 Z50-75 b822 RTL8822BE 802.11a/b/g/n/ac WiFi adapter 103c 831b Realtek RTL8822BE 802.11ac 2 × 2 Wi-Fi + Bluetooth 4.2 Combo Adapter (MU-MIMO supported) + 17aa 5124 ThinkPad E595 + 17aa b023 ThinkPad E595 c821 RTL8821CE 802.11ac PCIe Wireless Network Adapter c822 RTL8822CE 802.11ac PCIe Wireless Network Adapter d723 RTL8723DE 802.11b/g/n PCIe Adapter @@ -12399,6 +12504,7 @@ 3fc4 RME Digi9652 (Hammerfall) 3fc5 RME Hammerfall DSP 3fc6 RME Hammerfall DSP MADI + 5005 Alveo U250 7038 FPGA Card XC7VX690T 17aa 402f FPGA XC7VX690T-3FFG1157E 8380 Ellips ProfiXpress Profibus Master @@ -12485,6 +12591,9 @@ 1102 8071 SB0150 SoundBlaster PCI512 # EMU8008 PCI version of emu8000 chip 0003 SB AWE64(D) + 1102 0010 CT4600 AWE64D + 1102 0030 CT4650 AWE64D + 1102 0031 CT4655 AWE64D 0004 EMU10k2/CA0100/CA0102/CA10200 [Sound Blaster Audigy Series] 1102 0040 SB0090 Audigy Player # Probably an early engineering sample @@ -12526,7 +12635,11 @@ 1102 0021 X-Fi Platinum 1102 002c X-Fi XtremeGamer FATAL1TY PRO 1102 1003 X-Fi XtremeMusic - 0006 EMU10k1X [SB Live! Value/OEM Series] +# This chip is also known as CA0103 on Sound Blaster 5.1 SB0680 card. + 0006 EMU10k1X / CA0103 [SB Live! OEM / SB 5.1 / Ectiva 5.1] + 1102 1001 SB0680 Sound Blaster 5.1 + 1102 1003 SB0203 SB Live! 5.1 (Dell) + 1102 1004 TP0033 Ectiva Audio 5.1 0007 CA0106/CA0111 [SB Live!/Audigy/X-Fi Series] 1102 0007 SBLive! 24bit 1102 1001 SB0310 Audigy LS @@ -14637,6 +14750,7 @@ 0314 Model 14 Road Runner Frame Grabber 0324 Model 24 Road Runner Frame Grabber 0344 Model 44 Road Runner Frame Grabber + b04e Claxon CXP4 CoaXPress frame grabber 118e Hermstedt GmbH 118f Green Logic 1190 Tripace @@ -15764,6 +15878,7 @@ 0811 SM811 LynxE 0820 SM820 Lynx3D 0910 SM910 + 2262 SM2262/SM2262EN SSD Controller 1270 Olympus Optical Co., Ltd. 1271 GW Instruments 1272 Telematics International @@ -16224,6 +16339,10 @@ # acquired by Diodes Inc. 12d8 Pericom Semiconductor 01a7 7C21P100 2-port PCI-X to PCI-X Bridge +# 3Port-3Lane PCI Express Switch GreenPacket Family + 0303 PCI Express Switch 3-3 +# PI7C9X20508GP 5Port-8Lane PCI Express Switch GreenPacket Family + 0508 PI7C9X20508GP PCI Express Switch 5Port-8Lane 2304 PI7C9X2G304 EL/SL PCIe2 3-Port/4-Lane Packet Switch 2404 PI7C9X2G404 EL/SL PCIe2 4-Port/4-Lane Packet Switch 2608 PI7C9X2G608GP PCIe2 6-Port/8-Lane Packet Switch @@ -16953,7 +17072,7 @@ 13c9 Eaton Corporation 13ca Iomega Corporation 13cb Yano Electric Co Ltd -13cc Metheus Corporation +13cc BARCO 13cd Compatible Systems Corporation 13ce Cocom A/S 13cf Studio Audio & Video Ltd @@ -18118,6 +18237,30 @@ 1028 1ff9 Express Flash PM1725b 6.4TB AIC 1028 1ffa Express Flash PM1725b 12.8TB AIC a824 NVMe SSD Controller PM173X + 1028 2040 EMC PowerEdge Express Flash Ent NVMe AGN MU U.2 Gen4 1.6TB + 1028 2041 EMC PowerEdge Express Flash Ent NVMe AGN MU U.2 Gen4 3.2TB + 1028 2042 EMC PowerEdge Express Flash Ent NVMe AGN MU U.2 Gen4 6.4TB + 1028 2043 EMC PowerEdge Express Flash Ent NVMe AGN MU U.2 Gen4 12.8TB + 1028 2044 EMC PowerEdge Express Flash Ent NVMe AGN MU AIC Gen4 1.6TB + 1028 2045 EMC PowerEdge Express Flash Ent NVMe AGN MU AIC Gen4 3.2TB + 1028 2046 EMC PowerEdge Express Flash Ent NVMe AGN MU AIC Gen4 6.4TB + 1028 2070 EMC PowerEdge Express Flash Ent NVMe AGN RI U.2 Gen4 1.92TB + 1028 2071 EMC PowerEdge Express Flash Ent NVMe AGN RI U.2 Gen4 3.84TB + 1028 2072 EMC PowerEdge Express Flash Ent NVMe AGN RI U.2 Gen4 7.68TB + 1028 2073 EMC PowerEdge Express Flash Ent NVMe AGN RI U.2 Gen4 15.36TB + 1028 2074 EMC PowerEdge Express Flash Ent NVMe AGN RI AIC Gen4 1.92TB + 1028 2075 EMC PowerEdge Express Flash Ent NVMe AGN RI AIC Gen4 3.84TB + 1028 2076 EMC PowerEdge Express Flash Ent NVMe AGN RI AIC Gen4 7.68TB + 1028 2090 EMC PowerEdge Express Flash Ent NVMe AGN SED MU U.2 Gen4 1.6TB + 1028 2091 EMC PowerEdge Express Flash Ent NVMe AGN SED MU U.2 Gen4 3.2TB + 1028 2092 EMC PowerEdge Express Flash Ent NVMe AGN SED MU U.2 Gen4 6.4TB + 1028 2093 EMC PowerEdge Express Flash Ent NVMe AGN SED MU U.2 Gen4 12.8TB + 1028 2094 EMC PowerEdge Express Flash Ent NVMe AGN SED MU AIC Gen4 1.6TB + 1028 2095 EMC PowerEdge Express Flash Ent NVMe AGN SED MU AIC Gen4 3.2TB + 1028 2096 EMC PowerEdge Express Flash Ent NVMe AGN SED MU AIC Gen4 6.4TB + 1028 2097 EMC PowerEdge Express Flash Ent NVMe AGN SED RI U.2 Gen4 1.92TB + 1028 2098 EMC PowerEdge Express Flash Ent NVMe AGN SED RI U.2 Gen4 3.84TB + 1028 2099 EMC PowerEdge Express Flash Ent NVMe AGN SED RI U.2 Gen4 7.68TB 144e OLITEC 144f Askey Computer Corp. 1450 Octave Communications Ind. @@ -18801,6 +18944,7 @@ 16d5 BCM57407 NetXtreme-E 10GBase-T Ethernet Controller 16d6 BCM57412 NetXtreme-E 10Gb RDMA Ethernet Controller 14e4 4120 NetXtreme E-Series Advanced Dual-port 10Gb SFP+ Ethernet Network Daughter Card + 14e4 4126 NetXtreme-E Dual-port 10G SFP+ Ethernet OCP 3.0 Adapter (BCM957412N4120C) 152d 8b20 BCM57412 NetXtreme-E 10Gb RDMA Ethernet Controller 152d 8b22 BCM57412 NetXtreme-E 25Gb RDMA Ethernet Controller 16d7 BCM57414 NetXtreme-E 10Gb/25Gb RDMA Ethernet Controller @@ -18808,11 +18952,13 @@ 14e4 1402 BCM957414A4142CC 10Gb/25Gb Ethernet PCIe 14e4 1404 BCM957414M4142C OCP 2x25G Type1 wRoCE 14e4 4140 NetXtreme E-Series Advanced Dual-port 25Gb SFP28 Network Daughter Card + 14e4 4146 NetXtreme-E Dual-port 25G SFP28 Ethernet OCP 3.0 Adapter (BCM957414N4140C) 1590 020e Ethernet 25Gb 2-port 631SFP28 Adapter 1590 0211 Ethernet 25Gb 2-port 631FLR-SFP28 Adapter 16d8 BCM57416 NetXtreme-E Dual-Media 10G RDMA Ethernet Controller 1028 1feb NetXtreme-E 10Gb SFP+ Adapter - 14e4 4163 BCM957416M4163C OCP 2x10GBT Type1 wRoCE + 14e4 4163 NetXtreme-E Dual-port 10GBASE-T Ethernet OCP 2.0 Adapter (BCM957416M4163C) + 14e4 4166 NetXtreme-E Dual-port 10GBASE-T Ethernet OCP 3.0 Adapter (BCM957416N4160C) 1590 020c Ethernet 10Gb 2-port 535T Adapter 1590 0212 Ethernet 10Gb 2-port 535FLR-T Adapter 16d9 BCM57417 NetXtreme-E 10GBASE-T RDMA Ethernet Controller @@ -18829,6 +18975,7 @@ 16e7 BCM57404 NetXtreme-E Ethernet Partition 16e8 BCM57406 NetXtreme-E Ethernet Partition 16e9 BCM57407 NetXtreme-E 25Gb Ethernet Controller + 16eb BCM57412 NetXtreme-E RDMA Partition 16ec BCM57414 NetXtreme-E Ethernet Partition 16ed BCM57414 NetXtreme-E RDMA Partition 16ee BCM57416 NetXtreme-E Ethernet Partition @@ -18861,6 +19008,8 @@ 103c 30c0 Compaq 6710b 17aa 3a23 IdeaPad S10e 1750 BCM57508 NetXtreme-E 10Gb/25Gb/40Gb/50Gb/100Gb/200Gb Ethernet + 14e4 2100 NetXtreme-E Dual-port 100G QSFP56 Ethernet PCIe4.0 x16 Adapter (BCM957508-P2100G) + 14e4 5208 NetXtreme-E Dual-port 100G QSFP56 Ethernet OCP 3.0 Adapter (BCM957508-N2100G) 1751 BCM57504 NetXtreme-E 10Gb/25Gb/40Gb/50Gb/100Gb/200Gb Ethernet 1752 BCM57502 NetXtreme-E 10Gb/25Gb/40Gb/50Gb Ethernet 1806 BCM5750X NetXtreme-E Ethernet Virtual Function @@ -19040,6 +19189,8 @@ 43a1 BCM4360 802.11ac Wireless Network Adapter 43a2 BCM4360 802.11ac Wireless Network Adapter 43a3 BCM4350 802.11ac Wireless Network Adapter +# Manufactured by Foxconn for Lenovo + 17aa 075a 00JT494 43a9 BCM43217 802.11b/g/n 43aa BCM43131 802.11b/g/n 43ae BCM43162 802.11ac Wireless Network Adapter @@ -19817,11 +19968,18 @@ 0215 MT42822 Family [BlueField-2 Secure Flash Recovery] 0216 MT2894 Family [ConnectX-6 Lx Flash Recovery] 0217 MT2894 Family [ConnectX-6 Lx Secure Flash Recovery] + 0218 MT2910 Family [ConnectX-7 Flash Recovery] + 0219 MT2910 Family [ConnectX-7 Secure Flash Recovery] + 021a MT43162 Family [BlueField-3 Lx SoC Flash Recovery] + 021b MT43162 Family [BlueField-3 Lx Secure Flash Recovery] + 021c MT43244 Family [BlueField-3 SoC Flash Recovery] + 021d MT43244 Family [BlueField-3 Secure Flash Recovery] 024e MT53100 [Spectrum-2, Flash recovery mode] 024f MT53100 [Spectrum-2, Secure Flash recovery mode] 0250 Spectrum-3, Flash recovery mode 0251 Spectrum-3, Secure Flash recovery mode 0252 Amos chiplet + 0253 Amos GearBox Manager 0254 Spectrum-4, Flash recovery mode 0255 Spectrum-4, Secure Flash recovery mode 0256 Ofek chiplet @@ -19830,8 +19988,6 @@ 0263 MT27710 [ConnectX-4 Lx Programmable Virtual Function] EN 0264 Innova-2 Flex Burn image 0281 NPS-600 Flash Recovery - 0538 MT2910 Family [ConnectX-7 Flash Recovery] - 0539 MT2910 Family [ConnectX-7 Secure Flash Recovery] 1002 MT25400 Family [ConnectX-2 Virtual Function] 1003 MT27500 Family [ConnectX-3] 1014 04b5 PCIe3 40GbE RoCE Converged Host Bus Adapter for Power @@ -19904,11 +20060,13 @@ 1016 MT27710 Family [ConnectX-4 Lx Virtual Function] 1017 MT27800 Family [ConnectX-5] 15b3 0006 ConnectX®-5 EN network interface card, 100GbE single-port QSFP28, PCIe3.0 x16, tall bracket; MCX515A-CCAT + 15b3 0007 Mellanox ConnectX®-5 MCX516A-CCAT 15b3 0020 ConnectX®-5 EN network interface card, 10/25GbE dual-port SFP28, PCIe3.0 x8, tall bracket ; MCX512A-ACAT 15b3 0068 ConnectX®-5 EN network interface card for OCP2.0, Type 1, with host management, 25GbE dual-port SFP28, PCIe3.0 x8, no bracket Halogen free ; MCX542B-ACAN 1018 MT27800 Family [ConnectX-5 Virtual Function] 1019 MT28800 Family [ConnectX-5 Ex] 15b3 0008 ConnectX-5 Ex EN network interface card, 100GbE dual-port QSFP28, PCIe4.0 x16, tall bracket; MCX516A-CDAT + 15b3 0125 Tencent ConnectX-5 EN Ex network interface card for OCP 3.0, with host management, 50GbE Dual-port QSFP28, PCIe4.0 x16, Thumbscrew (pull-tab) bracket 101a MT28800 Family [ConnectX-5 Ex Virtual Function] 101b MT28908 Family [ConnectX-6] 101c MT28908 Family [ConnectX-6 Virtual Function] @@ -19922,9 +20080,12 @@ 1976 MT28908 Family [ConnectX-6 PCIe Bridge] 1977 MT2892 Family [ConnectX-6 Dx PCIe Bridge] 1978 MT42822 Family [BlueField-2 SoC PCIe Bridge] + 1979 MT2910 Family [ConnectX-7 PCIe Bridge] + 197a MT43162 Family [BlueField-3 Lx SoC PCIe Bridge] + 197b MT43244 Family [BlueField-3 SoC PCIe Bridge] 4117 MT27712A0-FDCF-AE 1bd4 0039 SN10XMP2P25 - 1bd4 003a 10G SFP28 SP EO251FM9 Adapter + 1bd4 003a 25G SFP28 SP EO251FM9 Adapter 1bd4 004d SN10XMP2P25,YZPC-01191-101 5274 MT21108 InfiniBridge 5a44 MT23108 InfiniHost @@ -19976,8 +20137,16 @@ a2d4 MT42822 BlueField-2 SoC Crypto enabled a2d5 MT42822 BlueField-2 SoC Crypto disabled a2d6 MT42822 BlueField-2 integrated ConnectX-6 Dx network controller + a2d7 MT43162 BlueField-3 Lx SoC Crypto enabled + a2d8 MT43162 BlueField-3 Lx SoC Crypto disabled + a2d9 MT43162 BlueField-3 Lx integrated ConnectX-7 network controller + a2da MT43244 BlueField-3 SoC Crypto enabled + a2db MT43244 BlueField-3 SoC Crypto disabled + a2dc MT43244 BlueField-3 integrated ConnectX-7 network controller c2d2 MT416842 BlueField SoC management interfac c2d3 MT42822 BlueField-2 SoC Management Interface + c2d4 MT43162 BlueField-3 Lx SoC Management Interface + c2d5 MT43244 BlueField-3 SoC Management Interface # SwitchX-2, 40GbE switch c738 MT51136 c739 MT51136 GW @@ -20313,9 +20482,14 @@ 167e ONNTO Corp. 1681 Hercules 1682 XFX Pine Group Inc. + 5701 Radeon 5700 XT Thicc III Ultra c580 Radeon RX 580 1688 CastleNet Technology Inc. 1170 WLAN 802.11b card +168a Utimaco IS GmbH + 2086 CryptoServer Se-Series Hardware Security Module + c040 CryptoServer CSe-Series Hardware Security Module + c051 CryptoServer Se-Series Gen2 Hardware Security Module # nee Atheros Communications, Inc. 168c Qualcomm Atheros 0007 AR5210 Wireless Network Adapter [AR5000 802.11a] @@ -20541,6 +20715,7 @@ 1028 0300 Wireless 1802 802.11abgn Adapter 1a56 2003 Killer Wireless-N 1202 Half-size Mini PCIe Card 0036 QCA9565 / AR9565 Wireless Network Adapter + 1028 020e Vostro 3470 0037 AR9485 Wireless Network Adapter # Also used as Gigabyte GC-WB150 on a PCIe-to-mini-PCIe converter 1a3b 2100 AW-NB100H 802.11n Wireless Mini PCIe Card @@ -20551,6 +20726,9 @@ 0040 QCA9980/9990 802.11ac Wireless Network Adapter 0041 QCA6164 802.11ac Wireless Network Adapter 0042 QCA9377 802.11ac Wireless Network Adapter + 11ad 08a6 Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter +# compatible with Lenovo's BIOS lock + 17aa 0901 Qualcomm Atheros QCA9377 Wireless Network Adapter 0046 QCA9984 802.11ac Wave 2 Wireless Network Adapter 0050 QCA9887 802.11ac Wireless Network Adapter 0207 AR5210 Wireless Network Adapter [AR5000 802.11a] @@ -20778,11 +20956,22 @@ 0121 PCT-7303A PC card with IRC counters 0122 PCT-7408A PC card with counters and timers 0123 PCT-7424 PCI card with standard counters + 0141 PCA7208AL - Analog Inputs/Outputs + 0142 PCA7208AS - Analog inputs/Outputs + 0143 PCA7408AL - Analog Inputs/Outputs + 0144 PCA7408AS - Analog Inputs/Outputs 0214 PCT-7424C (F0) PC card with standard counters 0215 PCT-7424C (F1) PC card with standard counters 0216 PCT-7424E (F0) PC card with standard counters 0217 PCT-7424E (F1) PC card with standard counters + 0240 PCA7428CL_F0 - analog Inputs + 0241 PCA7428CL_F1 - analog Inputs + 0242 PCA7428CS_F0 - Analog Inputs/Outputs non isolated + 0243 PCA7428CS_F1 - Analog Inputs/Outputs non isolated + 0244 PCA7428CE_F0 - Analog Inputs isolated + 0245 PCA7428CE_F1 - Analog Inputs isolated 0303 PCD-7006C Digital Input & Output PCI Card + 0800 PCD8006 - PCIe digital Inputs/Outputs ff00 CTU CAN FD PCIe Card 1761 Pickering Interfaces Ltd 1771 InnoVISION Multimedia Ltd. @@ -20982,8 +21171,14 @@ 0002 AGN300 802.11 a/b/g True MIMO Wireless Card 1385 6d00 WPNT511 RangeMax 240 Mbps Wireless CardBus Adapter 1737 0054 WPC54GX4 v1 802.11g Wireless-G Notebook Adapter with SRX400 + 0105 MSM8998 PCIe Root Complex + 0108 SM8150/SA8195P PCIe Root Complex + 0300 MDM9x35 LTE Modem + 0301 MDM9640 PCIe Root Complex + 0302 MDM9x55 LTE Modem [Snapdragon X12] 0400 Datacenter Technologies QDF2432 PCI Express Root Port 0401 Datacenter Technologies QDF2400 PCI Express Root Port + 1000 QCS405 PCIe Root Complex 17cc NetChip Technology, Inc 2280 USB 2.0 17cd Cadence Design Systems, Inc. @@ -21126,11 +21321,35 @@ 1011 R1011 IDE Controller 1012 R1012 IDE Controller 1031 PCI/PCI-X to PCI-E Bridge +# Integrated in Vortex86EX, Vortex86EX2 SoC + 1070 CAN Bus Controller +# Integrated in Vortex86EX, Vortex86EX2 SoCs + 1331 Motion Control Interface +# Found in the Vortex86EX2 SoC + 1930 Hybrid Function Control Register +# IGP = on-chip integrated in the MSTI-PMX-1000 (Vortex86MX). + 2010 RDC M2010 VGA-compatible graphics adapter 2012 M2012/R3308 VGA-compatible graphics adapter +# IGP = on-chip integrated in the Vortex86DX3. Basic 2D accel. UMA architecture. + 2015 RDC M2015 VGA-compatible graphics adapter +# Found in the Vortex86EX SoC + 6011 R6011 ISA Bridge +# Found in the Vortex86EX2 SoC + 6013 R6013 ISA Bridge 6020 R6020 North Bridge 6021 R6021 Host Bridge +# Found in the Vortex86DX3 SoC + 6023 R6023 Host Bridge +# Found in the Vortex86EX SoC + 6025 R6025 Host Bridge +# Found in the Vortex86EX2 SoC + 6026 R6026 Host Bridge 6030 R6030 ISA Bridge 6031 R6031 ISA Bridge +# Found in the Vortex86DX3 SoC + 6035 R6035 ISA Bridge +# Found in MSTI-PMX-1000 (Vortex86MX) SoC. + 6036 R6036 ISA Bridge 6040 R6040 MAC Controller 6060 R6060 USB 1.1 Controller 6061 R6061 USB 2.0 Controller @@ -21780,6 +21999,11 @@ 1966 Orad Hi-Tec Systems 1975 DVG64 family 1977 DVG128 family + 1979 3DVG/UHD3 + 1980 HDV2/UHD2 + 1234 3160 UHD2LC + 1234 3300 Legacy UHD2 + 1234 3410 UHD2 # nee Atheros Communications, Inc. nee Attansic Technology Corp. 1969 Qualcomm Atheros *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Sep 19 20:18:15 2020 Return-Path: Delivered-To: svn-src-all@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 6D7DB3EE740; Sat, 19 Sep 2020 20:18:15 +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 4Bv2872WjNz4S0Z; Sat, 19 Sep 2020 20:18:15 +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 3963911AC4; Sat, 19 Sep 2020 20:18:15 +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 08JKIFQ4060890; Sat, 19 Sep 2020 20:18:15 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JKIFDa060889; Sat, 19 Sep 2020 20:18:15 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202009192018.08JKIFDa060889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 19 Sep 2020 20:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365916 - stable/11/share/misc X-SVN-Group: stable-11 X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: stable/11/share/misc X-SVN-Commit-Revision: 365916 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 20:18:15 -0000 Author: bapt Date: Sat Sep 19 20:18:14 2020 New Revision: 365916 URL: https://svnweb.freebsd.org/changeset/base/365916 Log: MFC r361361, r365791 r361361: Update pciids to 2020.05.22 r365791: Update to 2020.08.19 Modified: stable/11/share/misc/pci_vendors Directory Properties: stable/11/ (props changed) Modified: stable/11/share/misc/pci_vendors ============================================================================== --- stable/11/share/misc/pci_vendors Sat Sep 19 20:17:08 2020 (r365915) +++ stable/11/share/misc/pci_vendors Sat Sep 19 20:18:14 2020 (r365916) @@ -1,9 +1,10 @@ # $FreeBSD$ +# # List of PCI ID's # -# Version: 2020.02.22 -# Date: 2020-02-22 03:15:04 +# Version: 2020.08.19 +# Date: 2020-08-19 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at https://pci-ids.ucw.cz/. @@ -43,6 +44,8 @@ 7a0b SPI Controller 7a0c LPC Controller 7a0f DMA (Direct Memory Access) Controller +# Found on some boards with two sockets + 7a10 Hyper Transport Bridge Controller 7a14 EHCI USB Controller 7a15 Vivante GPU (Graphics Processing Unit) 7a19 PCI-to-PCI Bridge @@ -92,6 +95,8 @@ 1703 ISDN Adapter (PCI Bus, DV, W) 1704 ISDN Adapter (PCI Bus, D, C) 0721 Sapphire, Inc. +0731 Jingjia Microelectronics Co Ltd + 7200 JM7200 Series GPU 0777 Ubiquiti Networks, Inc. 0795 Wired Inc. 6663 Butane II (MPEG2 encoder board) @@ -271,6 +276,9 @@ 0013 53c875a 1000 1000 LSI53C875A PCI to Ultra SCSI Controller 0014 MegaRAID Tri-Mode SAS3516 + 1000 9460 MegaRAID 9460-16i + 1000 9480 MegaRAID 9480-8i8e + 1000 9481 MegaRAID 9480-8e 1028 1f3a PERC H745 Adapter 1028 1f3b PERC H745 Front 1028 1fd4 PERC H745P MX @@ -282,10 +290,15 @@ 8086 9460 RAID Controller RSP3TD160F 8086 9480 RAID Controller RSP3MD088F 0015 MegaRAID Tri-Mode SAS3416 + 1000 9441 MegaRAID 9440-16i 1028 1f3c PERC H345 Adapter 1028 1f3d PERC H345 Front 1d49 0503 ThinkSystem RAID 530-16i PCIe 12Gb Adapter 0016 MegaRAID Tri-Mode SAS3508 + 1000 9461 MegaRAID 9460-8i + 1000 9462 MegaRAID 9460-4i + 1000 9463 MegaRAID 9365-28i + 1000 9464 MegaRAID 9365-24i 1028 1fc9 PERC H840 Adapter 1028 1fcb PERC H740P Adapter 1028 1fcd PERC H740P Mini @@ -296,6 +309,8 @@ 8086 352f Integrated RAID Module RMSP3HD080E 8086 9461 RAID Controller RSP3DD080F 0017 MegaRAID Tri-Mode SAS3408 + 1000 9440 MegaRAID 9440-8i + 1000 9442 MegaRAID 9440-4i 1d49 0500 ThinkSystem RAID 530-8i PCIe 12Gb Adapter 1d49 0502 ThinkSystem RAID 530-8i Dense Adapter 8086 3528 Integrated RAID RMSP3LD060 @@ -438,8 +453,8 @@ 1028 1fd1 PERC H730P MX 17aa 1052 ThinkServer RAID 720i 17aa 1053 ThinkServer RAID 720ix - 1bd4 0014 6G SAS3108 2G - 1bd4 0015 6G SAS3108 4G + 1bd4 0014 12G SAS3108 2G + 1bd4 0015 12G SAS3108 4G 1d49 0600 ThinkSystem RAID 730-8i 1GB Cache PCIe 12Gb Adapter 1d49 0608 ThinkSystem RAID 730-8i 2GB Flash PCIe 12Gb Adapter 1d49 0609 ThinkSystem RAID 730-8i 4GB Flash PCIe 12Gb Adapter @@ -456,6 +471,7 @@ 1028 1f4c PERC H330 Mini (for blades) 1028 1f4d PERC H330 Embedded (for monolithic) 1054 306a SAS 3004 iMR ROMB + 1734 1211 PRAID CP400i [D3307-A12] 1d49 04db ServeRAID M1210 SAS/SATA Controller 1d49 0504 ThinkSystem RAID 520-8i PCIe 12Gb Adapter 0060 MegaRAID SAS 1078 @@ -655,10 +671,13 @@ 1028 1fd3 HBA330 MMZ # Supermicro AOC-S3008L-L8e uses 0808 for their SAS3008 SAS controller 15d9 0808 AOC-S3008L-L8e + 1bd4 0008 12G SAS3008IMR Onboard 1bd4 000b 12G SAS3008IR 1bd4 000c 12G SAS3008IT 1bd4 0011 Inspur 12Gb 8i-3008 IT SAS HBA 1bd4 0012 12Gb SAS3008IR UDM + 1bd4 001f 12G SAS3008IR Onboard + 1bd4 0020 12G SAS3008IT Onboard 1bd4 0026 12G SAS3008IT RACK 1bd4 0027 12G SAS3008IMR RACK 1bd4 0028 12G SAS3008IR RACK @@ -692,6 +711,7 @@ 00c2 SAS3324 PCI-Express Fusion-MPT SAS-3 00c3 SAS3324 PCI-Express Fusion-MPT SAS-3 00c4 SAS3224 PCI-Express Fusion-MPT SAS-3 + 1170 0002 SAS3224 PCI Express to 12Gb HBA MEZZ CARD 00c5 SAS3316 PCI-Express Fusion-MPT SAS-3 00c6 SAS3316 PCI-Express Fusion-MPT SAS-3 00c7 SAS3316 PCI-Express Fusion-MPT SAS-3 @@ -739,6 +759,10 @@ 1d49 0205 ThinkSystem 440-16i SAS/SATA PCIe Gen4 12Gb Internal HBA 1d49 0206 ThinkSystem 440-16e SAS/SATA PCIe Gen4 12Gb HBA 00e6 Fusion-MPT 12GSAS/PCIe Secure SAS38xx + 1000 4050 9500-16i Tri-Mode HBA + 1000 4060 9500-8i Tri-Mode HBA + 1000 4070 9500-16e Tri-Mode HBA + 1000 4080 9500-8e Tri-Mode HBA 1028 200b HBA355i Adapter 1028 200c HBA355i Front 1028 200d HBA355e Adapter @@ -922,18 +946,20 @@ 13e9 Ariel 1478 Navi 10 XL Upstream Port of PCI Express Switch 1479 Navi 10 XL Downstream Port of PCI Express Switch - 154c Kryptos + 154c Kryptos [Radeon RX 350] 154e Garfield 1551 Arlene 1552 Pooky 1561 Anubis 15d8 Picasso 103c 8615 Pavilion Laptop 15-cw1xxx + 17aa 5124 ThinkPad E595 15dd Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] 103c 83c6 Radeon Vega 8 Mobile 1458 d000 Radeon RX Vega 11 15de Raven/Raven2/Fenghuang HDMI/DP Audio Controller 103c 8615 Pavilion Laptop 15-cw1xxx + 17aa 5124 ThinkPad E595 15df Raven/Raven2/Fenghuang/Renoir Cryptographic Coprocessor 103c 8615 Pavilion Laptop 15-cw1xxx 15ff Fenghuang [Zhongshan Subor Z+] @@ -1120,6 +1146,7 @@ 105b 0e13 N15235/A74MX mainboard / AMD SB700 1179 ff50 Satellite P305D-S8995E 1458 a022 GA-MA770-DS3rev2.0 Motherboard + 1458 a102 GA-880GMA-USB3 17f2 5000 KI690-AM2 Motherboard 4384 SBx00 PCI to PCI Bridge 4385 SBx00 SMBus Controller @@ -1190,6 +1217,7 @@ 1043 8443 M5A88-V EVO 1043 84dd M5A99X EVO (R1.0) SB950 105b 0e13 N15235/A74MX mainboard / AMD SB700 + 1458 b002 GA-880GMA-USB3 174b 1001 PURE Fusion Mini 4392 SB7x0/SB8x0/SB9x0 SATA Controller [Non-RAID5 mode] 105b 0e13 N15235/A74MX mainboard / AMD SB700 @@ -1203,6 +1231,7 @@ 1043 82ef M3A78-EH Motherboard 1043 8443 M5A88-V EVO 105b 0e13 N15235/A74MX mainboard / AMD SB700 + 1458 5004 GA-880GMA-USB3 15d9 a811 H8DGU 174b 1001 PURE Fusion Mini 4397 SB7x0/SB8x0/SB9x0 USB OHCI0 Controller @@ -1212,6 +1241,7 @@ 1043 82ef M3A78-EH Motherboard 1043 8443 M5A88-V EVO 105b 0e13 N15235/A74MX mainboard / AMD SB700 + 1458 5004 GA-880GMA-USB3 15d9 a811 H8DGU 174b 1001 PURE Fusion Mini 4398 SB7x0 USB OHCI1 Controller @@ -1224,6 +1254,7 @@ 1043 82ef M3A78-EH Motherboard 1043 8443 M5A88-V EVO 105b 0e13 N15235/A74MX mainboard / AMD SB700 + 1458 5004 GA-880GMA-USB3 174b 1001 PURE Fusion Mini 439c SB7x0/SB8x0/SB9x0 IDE Controller 1002 4392 MSI MS-7713 motherboard @@ -1649,7 +1680,7 @@ 554a R423 [Radeon X800 XT Platinum Edition] 554b R423 [Radeon X800 GT/SE] 1002 0302 Radeon X800 SE - 554d R430 [Radeon X800 XL] + 554d R480 [Radeon X800 GTO2/XL] 1002 0322 All-In-Wonder X800 XL 1458 2124 GV-R80L256V-B (AGP) 554e R430 [All-In-Wonder X800 GT] @@ -1658,7 +1689,7 @@ 5551 R423 GL [FireGL V5100] 5569 R423 [Radeon X800 PRO] (Secondary) 556b R423 [Radeon X800 GT] (Secondary) - 556d R430 [Radeon X800 XL] (Secondary) + 556d R480 [Radeon X800 GTO2/XL] (Secondary) 1458 2125 GV-R80L256V-B (AGP) 556f R430 [Radeon X800] (Secondary) 5571 R423 GL [FireGL V5100] (Secondary) @@ -1878,9 +1909,9 @@ 1642 3c81 Radeon HD 8670 1642 3c91 Radeon HD 8670 1642 3f09 Radeon R7 350 - 6611 Oland [Radeon HD 8570 / R7 240/340 OEM] + 6611 Oland [Radeon HD 8570 / R7 240/340 / Radeon 520 OEM] 1028 210b Radeon R5 240 OEM - 1642 1869 AMD Radeon 520 + 1642 1869 Radeon 520 OEM 174b 4248 Radeon R7 240 OEM 174b a240 Radeon R7 240 OEM 174b d340 Radeon R7 340 OEM @@ -1900,9 +1931,11 @@ 103c 0b0c Bonaire [FirePro W4300] 103c 230c FirePro W5100 13cc 3d2a MXRT-5600 + 664d Bonaire [FirePro W5100 / Barco MXRT-5600] 6650 Bonaire 6651 Bonaire 6658 Bonaire XTX [Radeon R7 260X/360] + 1043 048f R7260X-DC2OC-2GD5 1043 04d3 AMD Radeon R7 260X 148c 0907 Radeon R7 360 1682 0907 Radeon R7 360 @@ -2561,6 +2594,8 @@ 1002 0b37 Radeon RX 480 1028 1722 Radeon RX 570X 1028 1723 Radeon RX 580X +# OEM card found in desktops sold by HP. + 103c 840e Radeon RX 580 4GB 1043 04a8 Radeon RX 480 1043 04b0 Radeon RX 470 1043 04fb Radeon RX 480 @@ -2575,10 +2610,15 @@ 1462 3413 Radeon RX 480 Gaming X 8GB 1462 3416 Radeon RX 570 1462 3418 Radeon RX 580 Armor 4G OC + 1462 341b Radeon RX 570 Armor 8G OC 1462 341e Radeon RX 570 Armor 4G OC 1462 8a92 Radeon RX 580 148c 2372 Radeon RX 480 [Red Dragon] 148c 2373 Radeon RX 470 + 148c 2377 Red Devil RX 580 8G Golden +# https://www.techpowerup.com/vgabios/?manufacturer=Powercolor&model=RX+580 + 148c 2378 Radeon RX 580 + 148c 2379 Radeon RX 570 4G [Red Dragon] 1682 9470 Radeon RX 470 1682 9480 Radeon RX 480 1682 9588 Radeon RX 580 XTR @@ -2591,6 +2631,7 @@ 1849 5030 Phantom Gaming D Radeon RX580 8G OC 1da2 e353 Radeon RX 570 Pulse 4GB 1da2 e366 Nitro+ Radeon RX 570/580/590 + 1da2 e387 Radeon RX 570 Pulse 4GB 67e0 Baffin [Radeon Pro WX 4170] 103c 8270 Radeon Pro WX 4170 103c 8272 Radeon Pro WX 4170 @@ -2610,6 +2651,7 @@ 67ef Baffin [Radeon RX 460/560D / Pro 450/455/460/555/555X/560/560X] 1028 1703 RX 560D OEM OC 2 GB 103c 3421 Radeon RX 460 + 1043 0561 AREZ Radeon RX 560 106b 0160 Radeon Pro 460 106b 0166 Radeon Pro 455 106b 0167 Radeon Pro 450 @@ -2844,13 +2886,14 @@ 6861 Vega 10 XT [Radeon PRO WX 9100] 6862 Vega 10 XT [Radeon PRO SSG] 6863 Vega 10 XTX [Radeon Vega Frontier Edition] - 6864 Vega + 6864 Vega 10 [Radeon Pro V340] 6867 Vega 10 XL [Radeon Pro Vega 56] 6868 Vega 10 [Radeon PRO WX 8100/8200] 686c Vega 10 [Radeon Instinct MI25 MxGPU] 687f Vega 10 XL/XT [Radeon RX Vega 56/64] 1002 0b36 RX Vega64 - 1002 6b76 RX Vega56 + 1002 6b76 RX Vega64 + 1458 230c Radeon RX VEGA 56 GAMING OC 8G 6880 Lexington [Radeon HD 6550M] 103c 163c Pavilion dv6 Radeon HD 6550M 6888 Cypress XT [FirePro V8800] @@ -3349,7 +3392,8 @@ 6901 Topaz PRO [Radeon R5 M255] 103c 1318 Radeon R6 M255DX 6907 Meso XT [Radeon R5 M315] - 6921 Amethyst XT [Radeon R9 M295X] + 6920 Amethyst [Radeon R9 M395/ M395X Mac Edition] + 6921 Amethyst XT [Radeon R9 M295X / M390X] 6929 Tonga XT GL [FirePro S7150] 692b Tonga PRO GL [FirePro W7100] 13cc 3d2b MXRT-7600 @@ -3468,6 +3512,7 @@ 71c1 RV535 [Radeon X1650 PRO] 174b 0880 Radeon X1700 FSC 71c2 RV530 [Radeon X1600 PRO] + 71c3 RV530 [Radeon X1600 PRO] 71c4 RV530/M56 GL [Mobility FireGL V5200] 17aa 2007 ThinkPad T60p 71c5 RV530/M56-P [Mobility Radeon X1600] @@ -3528,13 +3573,16 @@ 1043 049e Radeon R9 FURY 1043 04a0 Radeon R9 FURY X 174b e329 Radeon R9 FURY - 7310 Navi 10 + 7310 Navi 10 [Radeon Pro W5700X] 7312 Navi 10 [Radeon Pro W5700] 731f Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] + 1458 2313 Radeon RX 5700 XT Gaming OC + 1da2 e411 Radeon RX 5600 XT 7340 Navi 14 [Radeon RX 5500/5500M / Pro 5500M] 7341 Navi 14 [Radeon Pro W5500] 7347 Navi 14 [Radeon Pro W5500M] 734f Navi 14 [Radeon Pro W5300M] + 7360 Navi 12 [Radeon Pro 5600M] 7833 RS350 Host Bridge 7834 RS350 [Radeon 9100 PRO/XT IGP] 7835 RS350M [Mobility Radeon 9000 IGP] @@ -3730,6 +3778,7 @@ 9599 RV635 PRO [Radeon HD 3650 AGP] 95c0 RV620 PRO [Radeon HD 3470] 1002 95c0 Mobility Radeon HD 3470 + 1028 3243 C120D 95c2 RV620/M82 [Mobility Radeon HD 3410/3430] 95c4 RV620/M82 [Mobility Radeon HD 3450/3470] 1002 95c4 Mobility Radeon HD 3400 @@ -3747,6 +3796,7 @@ 9612 RS780M [Mobility Radeon HD 3200] 9613 RS780MC [Mobility Radeon HD 3100] 9614 RS780D [Radeon HD 3300] + 9615 RS780E [Radeon HD 3200] 9616 RS780L [Radeon 3000] 9640 Sumo [Radeon HD 6550D] 9641 Sumo [Radeon HD 6620G] @@ -3860,7 +3910,7 @@ 9917 Trinity [Radeon HD 7620G] 9918 Trinity [Radeon HD 7600G] 9919 Trinity [Radeon HD 7500G] - 991e Bishop + 991e Bishop [Xbox One S APU] 9920 Liverpool [Playstation 4 APU] 9921 Liverpool HDMI/DP Audio Controller 9922 Starshp @@ -3917,6 +3967,7 @@ aab0 Oland/Hainan/Cape Verde/Pitcairn HDMI Audio [Radeon HD 7000 Series] aab8 Tiran HDMI Audio aac0 Tobago HDMI Audio [Radeon R7 360 / R9 360 OEM] + 1043 aac0 R7260X-DC2OC-2GD5 aac8 Hawaii HDMI Audio [Radeon R9 290/290X / 390/390X] aad8 Tonga HDMI Audio [Radeon R9 285/380] 174b aad8 Radeon R9 285/380 HDMI Audio @@ -4567,6 +4618,8 @@ 1466 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 6 1467 Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 7 1468 Zeppelin Cryptographic Coprocessor NTBCCP + 1470 Vega 10 PCIe Bridge + 1471 Vega 10 PCIe Bridge 1480 Starship/Matisse Root Complex 1462 7c37 X570-A PRO motherboard 1481 Starship/Matisse IOMMU @@ -4694,13 +4747,18 @@ 15dc Raven/Raven2 Internal PCIe GPP Bridge 0 to Bus B 15de Raven/Raven2/FireFlight HD Audio Controller 15df Family 17h (Models 10h-1fh) Platform Security Processor + 17aa 5124 ThinkPad E595 15e0 Raven USB 3.1 103c 8615 Pavilion Laptop 15-cw1xxx + 17aa 5124 ThinkPad E595 15e1 Raven USB 3.1 103c 8615 Pavilion Laptop 15-cw1xxx + 17aa 5124 ThinkPad E595 15e2 Raven/Raven2/FireFlight/Renoir Audio Processor + 17aa 5124 ThinkPad E595 15e3 Family 17h (Models 10h-1fh) HD Audio Controller 103c 8615 Pavilion Laptop 15-cw1xxx + 17aa 5124 ThinkPad E595 15e4 Raven/Raven2/Renoir Sensor Fusion Hub 15e5 Raven2 USB 3.1 15e6 Raven/Raven2/Renoir Non-Sensor Fusion Hub KMDF driver @@ -4968,9 +5026,11 @@ 790b FCH SMBus Controller 103c 8615 Pavilion Laptop 15-cw1xxx 1462 7c37 X570-A PRO motherboard + 17aa 5124 ThinkPad E595 790e FCH LPC Bridge 103c 8615 Pavilion Laptop 15-cw1xxx 1462 7c37 X570-A PRO motherboard + 17aa 5124 ThinkPad E595 790f FCH PCI Bridge 7914 FCH USB XHCI Controller 9600 RS780 Host Bridge @@ -5174,6 +5234,7 @@ 0519 MGA 2064W [Millennium] 051a MGA 1064SG [Mystique] 102b 0100 MGA-1064SG Mystique + 102b 051a MGA-1164SG Mystique 220 102b 1100 MGA-1084SG Mystique 102b 1200 MGA-1084SG Mystique 1100 102b MGA-1084SG Mystique @@ -6657,24 +6718,24 @@ 105d 0009 Imagine 128 series 2e 4Mb DRAM 105d 000a Imagine 128 series 2 8Mb VRAM 105d 000b Imagine 128 series 2 8Mb H-VRAM - 11a4 000a Barco Metheus 5 Megapixel - 13cc 0000 Barco Metheus 5 Megapixel - 13cc 0004 Barco Metheus 5 Megapixel - 13cc 0005 Barco Metheus 5 Megapixel - 13cc 0006 Barco Metheus 5 Megapixel - 13cc 0008 Barco Metheus 5 Megapixel - 13cc 0009 Barco Metheus 5 Megapixel - 13cc 000a Barco Metheus 5 Megapixel - 13cc 000c Barco Metheus 5 Megapixel + 11a4 000a Metheus 5 Megapixel + 13cc 0000 Metheus 5 Megapixel + 13cc 0004 Metheus 5 Megapixel + 13cc 0005 Metheus 5 Megapixel + 13cc 0006 Metheus 5 Megapixel + 13cc 0008 Metheus 5 Megapixel + 13cc 0009 Metheus 5 Megapixel + 13cc 000a Metheus 5 Megapixel + 13cc 000c Metheus 5 Megapixel 493d Imagine 128 T2R [Ticket to Ride] - 11a4 000a Barco Metheus 5 Megapixel, Dual Head - 11a4 000b Barco Metheus 5 Megapixel, Dual Head - 13cc 0002 Barco Metheus 4 Megapixel, Dual Head - 13cc 0003 Barco Metheus 5 Megapixel, Dual Head - 13cc 0007 Barco Metheus 5 Megapixel, Dual Head - 13cc 0008 Barco Metheus 5 Megapixel, Dual Head - 13cc 0009 Barco Metheus 5 Megapixel, Dual Head - 13cc 000a Barco Metheus 5 Megapixel, Dual Head + 11a4 000a Metheus 5 Megapixel, Dual Head + 11a4 000b Metheus 5 Megapixel, Dual Head + 13cc 0002 Metheus 4 Megapixel, Dual Head + 13cc 0003 Metheus 5 Megapixel, Dual Head + 13cc 0007 Metheus 5 Megapixel, Dual Head + 13cc 0008 Metheus 5 Megapixel, Dual Head + 13cc 0009 Metheus 5 Megapixel, Dual Head + 13cc 000a Metheus 5 Megapixel, Dual Head 5348 Revolution 4 105d 0037 Revolution IV-FP AGP (For SGI 1600SW) 11a4 0028 PVS5600M @@ -10419,7 +10480,7 @@ 06eb G98M [Quadro NVS 160M] 06ec G98M [GeForce G 105M] 06ed G98 [GeForce 9600 GT / 9800 GT] - 06ee G98 [GeForce 9600 GT / 9800 GT] + 06ee G98 [GeForce 9600 GT / 9800 GT / GT 240] 06ef G98M [GeForce G 103M] 06f1 G98M [GeForce G 105M] 06f8 G98 [Quadro NVS 420] @@ -10974,6 +11035,7 @@ 0fb9 GP107GL High Definition Audio Controller 0fba GM206 High Definition Audio Controller 0fbb GM204 High Definition Audio Controller + 0fbc GM107 High Definition Audio Controller [GeForce 940MX] 0fc0 GK107 [GeForce GT 640 OEM] 0fc1 GK107 [GeForce GT 640] 0fc2 GK107 [GeForce GT 630 OEM] @@ -10998,6 +11060,7 @@ 0fd3 GK107M [GeForce GT 640M LE] 0fd4 GK107M [GeForce GTX 660M] 0fd5 GK107M [GeForce GT 650M Mac Edition] + 0fd6 GK107M 0fd8 GK107M [GeForce GT 640M Mac Edition] 0fd9 GK107M [GeForce GT 645M] 0fdb GK107M @@ -11014,6 +11077,7 @@ # GRID K1 USM 0fe7 GK107GL [GRID K100 vGPU] 10de 101e GRID K100 + 0fe8 GK107M 0fe9 GK107M [GeForce GT 750M Mac Edition] 0fea GK107M [GeForce GT 755M Mac Edition] 0fec GK107M [GeForce 710A] @@ -11538,6 +11602,7 @@ 11a3 GK104M [GeForce GTX 680MX] 106b 010d iMac 13,2 11a7 GK104M [GeForce GTX 675MX] + 11a9 GK104M [GeForce GTX 870M] 11af GK104GLM [GRID IceCube] 11b0 GK104GL [GRID K240Q / K260Q vGPU] 10de 101a GRID K240Q @@ -11630,8 +11695,10 @@ 1287 GK208B [GeForce GT 730] 1288 GK208B [GeForce GT 720] 1289 GK208 [GeForce GT 710] + 128a GK208B 128b GK208B [GeForce GT 710] 1043 85f7 GT710-SL-1GD5 + 128c GK208B 1290 GK208M [GeForce GT 730M] 103c 2afa GeForce GT 730A 103c 2b04 GeForce GT 730A @@ -11772,6 +11839,7 @@ 174e GM108M [GeForce MX110] 1789 GM107GL [GRID M3-3020] 179c GM107 [GeForce 940MX] + 1025 1094 Acer Aspire E5-575G 17c2 GM200 [GeForce GTX TITAN X] 17c8 GM200 [GeForce GTX 980 Ti] 17f0 GM200GL [Quadro M6000] @@ -11787,7 +11855,8 @@ 1adb TU106 USB Type-C UCSI Controller 1043 8673 TURBO-RTX2070-8G 1aeb TU116 High Definition Audio Controller - 1aed TU116 [GeForce GTX 1650 SUPER] + 1aec TU116 USB 3.1 Host Controller + 1aed TU116 USB Type-C UCSI Controller 1b00 GP102 [TITAN X] 1b01 GP102 [GeForce GTX 1080 Ti 10GB] 1b02 GP102 [TITAN Xp] @@ -11869,6 +11938,7 @@ 1c91 GP107M [GeForce GTX 1050 3 GB Max-Q] 1c92 GP107M [GeForce GTX 1050 Mobile] 1c94 GP107M [GeForce MX350] + 1c96 GP107M [GeForce MX350] 1ca7 GP107GL 1ca8 GP107GL 1caa GP107GL @@ -11901,6 +11971,7 @@ 1d33 GP108GLM [Quadro P500 Mobile] 1d34 GP108GLM [Quadro P520] 1d52 GP108BM [GeForce MX250] + 1d56 GP108BM [GeForce MX330] 1d81 GV100 [TITAN V] 1db1 GV100GL [Tesla V100 SXM2 16GB] 1db2 GV100GL [Tesla V100 DGXS 16GB] @@ -11921,11 +11992,12 @@ 1e04 TU102 [GeForce RTX 2080 Ti] 1e07 TU102 [GeForce RTX 2080 Ti Rev. A] 1462 3715 RTX 2080 Ti GAMING X TRIO - 1e2d TU102B - 1e2e TU102B + 1e2d TU102 [GeForce RTX 2080 Ti Engineering Sample] + 1e2e TU102 [GeForce RTX 2080 Ti 12GB Engineering Sample] 1e30 TU102GL [Quadro RTX 6000/8000] 10de 129e Quadro RTX 8000 10de 12ba Quadro RTX 6000 + 1e36 TU102GL [Quadro RTX 6000] 1e37 TU102GL [GRID RTX T10-4/T10-8/T10-16] 10de 1347 GRID RTX T10-8 10de 1348 GRID RTX T10-4 @@ -11943,6 +12015,8 @@ 1e87 TU104 [GeForce RTX 2080 Rev. A] 1e89 TU104 [GeForce RTX 2060] 1e90 TU104M [GeForce RTX 2080 Mobile] + 1e91 TU104M [GeForce RTX 2070 SUPER Mobile / Max-Q] + 1e93 TU104M [GeForce RTX 2080 SUPER Mobile / Max-Q] 1eab TU104M 1eae TU104M 1eb0 TU104GL [Quadro RTX 5000] @@ -11955,34 +12029,56 @@ 1ec2 TU104 [GeForce RTX 2070 SUPER] 1ec7 TU104 [GeForce RTX 2070 SUPER] 1ed0 TU104BM [GeForce RTX 2080 Mobile] + 1ed1 TU104BM [GeForce RTX 2070 SUPER Mobile / Max-Q] + 1ed3 TU104BM [GeForce RTX 2080 SUPER Mobile / Max-Q] + 1ef5 TU104GLM [Quadro RTX 5000 Mobile Refresh] 1f02 TU106 [GeForce RTX 2070] 1043 8673 TURBO RTX 2070 1f04 TU106 1f06 TU106 [GeForce RTX 2060 SUPER] 1f07 TU106 [GeForce RTX 2070 Rev. A] 1f08 TU106 [GeForce RTX 2060 Rev. A] + 1f09 TU106 [GeForce GTX 1660 SUPER] + 1f0a TU106 [GeForce GTX 1650] 1f10 TU106M [GeForce RTX 2070 Mobile] 1f11 TU106M [GeForce RTX 2060 Mobile] + 1f12 TU106M [GeForce RTX 2060 Max-Q] + 1f14 TU106M [GeForce RTX 2070 Mobile / Max-Q Refresh] + 1f15 TU106M [GeForce RTX 2060 Mobile] 1f2e TU106M 1f36 TU106GLM [Quadro RTX 3000 Mobile / Max-Q] 1f42 TU106 [GeForce RTX 2060 SUPER] 1f47 TU106 [GeForce RTX 2060 SUPER] - 1f50 TU106BM [GeForce RTX 2070 Mobile] + 1f50 TU106BM [GeForce RTX 2070 Mobile / Max-Q] 1f51 TU106BM [GeForce RTX 2060 Mobile] + 1f54 TU106BM [GeForce RTX 2070 Mobile] + 1f55 TU106BM [GeForce RTX 2060 Mobile] 1f81 TU117 1f82 TU117 [GeForce GTX 1650] 1f91 TU117M [GeForce GTX 1650 Mobile / Max-Q] 1f92 TU117M [GeForce GTX 1650 Mobile] + 1f94 TU117M [GeForce GTX 1650 Mobile] + 1f95 TU117M [GeForce GTX 1650 Ti Mobile] 1f96 TU117M [GeForce GTX 1650 Mobile / Max-Q] + 1f97 TU117M [GeForce MX450] + 1f99 TU117M 1fae TU117GL 1fb8 TU117GLM [Quadro T2000 Mobile / Max-Q] 1fb9 TU117GLM [Quadro T1000 Mobile] 1fbf TU117GL + 1fd9 TU117BM [GeForce GTX 1650 Mobile Refresh] + 1ff9 TU117GLM [Quadro T1000 Mobile] + 20b0 GA100 [A100 SXM4 40GB] + 20be GA100 [GRID A100A] + 20bf GA100 [GRID A100B] + 20f1 GA100 [A100 PCIe 40GB] 2182 TU116 [GeForce GTX 1660 Ti] 2183 TU116 2184 TU116 [GeForce GTX 1660] 2187 TU116 [GeForce GTX 1650 SUPER] + 2188 TU116 [GeForce GTX 1650] 2191 TU116M [GeForce GTX 1660 Ti Mobile] + 2192 TU116M [GeForce GTX 1650 Ti Mobile] 21ae TU116GL 21bf TU116GL 21c4 TU116 [GeForce GTX 1660 SUPER] @@ -12201,17 +12297,20 @@ 522a RTS522A PCI Express Card Reader 103c 8079 EliteBook 840 G3 103c 825b OMEN-17-w001nv + 17aa 5124 ThinkPad E595 5249 RTS5249 PCI Express Card Reader 103c 1909 ZBook 15 524a RTS524A PCI Express Card Reader 5250 RTS5250 PCI Express Card Reader 525a RTS525A PCI Express Card Reader + 1028 06d6 Latitude 7275 tablet 1028 06dc Latitude E7470 1028 06e4 XPS 15 9550 17aa 224f ThinkPad X1 Carbon 5th Gen 5260 RTS5260 PCI Express Card Reader 5286 RTS5286 PCI Express Card Reader 5287 RTL8411B PCI Express Card Reader + 1025 1094 Acer Aspire E5-575G 5288 RTS5288 PCI Express Card Reader 5289 RTL8411 PCI Express Card Reader 1043 1457 K55A Laptop @@ -12294,11 +12393,13 @@ 1462 236c 945P Neo3-F motherboard 8168 RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller 1019 8168 RTL8111/8168 PCI Express Gigabit Ethernet controller + 1025 1094 Acer Aspire E5-575G 1028 0283 Vostro 220 1028 04b2 Vostro 3350 1028 04da Vostro 3750 1028 06f2 Latitude 3470 1028 06f3 Latitude 3570 + 1028 0869 Vostro 3470 103c 1611 Pavilion DM1Z-3000 103c 1950 ProBook 450/455 103c 2a6f Asus IPIBL-LB Motherboard @@ -12323,6 +12424,8 @@ 1462 7c37 X570-A PRO motherboard 1775 11cc CC11/CL11 17aa 3814 Z50-75 + 17aa 3823 Lenovo V130-15IGM Laptop - Type 81HL + 17aa 5124 ThinkPad E595 1849 8168 Motherboard (one of many) 7470 3468 TG-3468 Gigabit PCI Express Network Adapter 8086 2055 NUC Kit DN2820FYKH @@ -12376,6 +12479,8 @@ 17aa b736 Z50-75 b822 RTL8822BE 802.11a/b/g/n/ac WiFi adapter 103c 831b Realtek RTL8822BE 802.11ac 2 × 2 Wi-Fi + Bluetooth 4.2 Combo Adapter (MU-MIMO supported) + 17aa 5124 ThinkPad E595 + 17aa b023 ThinkPad E595 c821 RTL8821CE 802.11ac PCIe Wireless Network Adapter c822 RTL8822CE 802.11ac PCIe Wireless Network Adapter d723 RTL8723DE 802.11b/g/n PCIe Adapter @@ -12399,6 +12504,7 @@ 3fc4 RME Digi9652 (Hammerfall) 3fc5 RME Hammerfall DSP 3fc6 RME Hammerfall DSP MADI + 5005 Alveo U250 7038 FPGA Card XC7VX690T 17aa 402f FPGA XC7VX690T-3FFG1157E 8380 Ellips ProfiXpress Profibus Master @@ -12485,6 +12591,9 @@ 1102 8071 SB0150 SoundBlaster PCI512 # EMU8008 PCI version of emu8000 chip 0003 SB AWE64(D) + 1102 0010 CT4600 AWE64D + 1102 0030 CT4650 AWE64D + 1102 0031 CT4655 AWE64D 0004 EMU10k2/CA0100/CA0102/CA10200 [Sound Blaster Audigy Series] 1102 0040 SB0090 Audigy Player # Probably an early engineering sample @@ -12526,7 +12635,11 @@ 1102 0021 X-Fi Platinum 1102 002c X-Fi XtremeGamer FATAL1TY PRO 1102 1003 X-Fi XtremeMusic - 0006 EMU10k1X [SB Live! Value/OEM Series] +# This chip is also known as CA0103 on Sound Blaster 5.1 SB0680 card. + 0006 EMU10k1X / CA0103 [SB Live! OEM / SB 5.1 / Ectiva 5.1] + 1102 1001 SB0680 Sound Blaster 5.1 + 1102 1003 SB0203 SB Live! 5.1 (Dell) + 1102 1004 TP0033 Ectiva Audio 5.1 0007 CA0106/CA0111 [SB Live!/Audigy/X-Fi Series] 1102 0007 SBLive! 24bit 1102 1001 SB0310 Audigy LS @@ -14637,6 +14750,7 @@ 0314 Model 14 Road Runner Frame Grabber 0324 Model 24 Road Runner Frame Grabber 0344 Model 44 Road Runner Frame Grabber + b04e Claxon CXP4 CoaXPress frame grabber 118e Hermstedt GmbH 118f Green Logic 1190 Tripace @@ -15764,6 +15878,7 @@ 0811 SM811 LynxE 0820 SM820 Lynx3D 0910 SM910 + 2262 SM2262/SM2262EN SSD Controller 1270 Olympus Optical Co., Ltd. 1271 GW Instruments 1272 Telematics International @@ -16224,6 +16339,10 @@ # acquired by Diodes Inc. 12d8 Pericom Semiconductor 01a7 7C21P100 2-port PCI-X to PCI-X Bridge +# 3Port-3Lane PCI Express Switch GreenPacket Family + 0303 PCI Express Switch 3-3 +# PI7C9X20508GP 5Port-8Lane PCI Express Switch GreenPacket Family + 0508 PI7C9X20508GP PCI Express Switch 5Port-8Lane 2304 PI7C9X2G304 EL/SL PCIe2 3-Port/4-Lane Packet Switch 2404 PI7C9X2G404 EL/SL PCIe2 4-Port/4-Lane Packet Switch 2608 PI7C9X2G608GP PCIe2 6-Port/8-Lane Packet Switch @@ -16953,7 +17072,7 @@ 13c9 Eaton Corporation 13ca Iomega Corporation 13cb Yano Electric Co Ltd -13cc Metheus Corporation +13cc BARCO 13cd Compatible Systems Corporation 13ce Cocom A/S 13cf Studio Audio & Video Ltd @@ -18118,6 +18237,30 @@ 1028 1ff9 Express Flash PM1725b 6.4TB AIC 1028 1ffa Express Flash PM1725b 12.8TB AIC a824 NVMe SSD Controller PM173X + 1028 2040 EMC PowerEdge Express Flash Ent NVMe AGN MU U.2 Gen4 1.6TB + 1028 2041 EMC PowerEdge Express Flash Ent NVMe AGN MU U.2 Gen4 3.2TB + 1028 2042 EMC PowerEdge Express Flash Ent NVMe AGN MU U.2 Gen4 6.4TB + 1028 2043 EMC PowerEdge Express Flash Ent NVMe AGN MU U.2 Gen4 12.8TB + 1028 2044 EMC PowerEdge Express Flash Ent NVMe AGN MU AIC Gen4 1.6TB + 1028 2045 EMC PowerEdge Express Flash Ent NVMe AGN MU AIC Gen4 3.2TB + 1028 2046 EMC PowerEdge Express Flash Ent NVMe AGN MU AIC Gen4 6.4TB + 1028 2070 EMC PowerEdge Express Flash Ent NVMe AGN RI U.2 Gen4 1.92TB + 1028 2071 EMC PowerEdge Express Flash Ent NVMe AGN RI U.2 Gen4 3.84TB + 1028 2072 EMC PowerEdge Express Flash Ent NVMe AGN RI U.2 Gen4 7.68TB + 1028 2073 EMC PowerEdge Express Flash Ent NVMe AGN RI U.2 Gen4 15.36TB + 1028 2074 EMC PowerEdge Express Flash Ent NVMe AGN RI AIC Gen4 1.92TB + 1028 2075 EMC PowerEdge Express Flash Ent NVMe AGN RI AIC Gen4 3.84TB + 1028 2076 EMC PowerEdge Express Flash Ent NVMe AGN RI AIC Gen4 7.68TB + 1028 2090 EMC PowerEdge Express Flash Ent NVMe AGN SED MU U.2 Gen4 1.6TB + 1028 2091 EMC PowerEdge Express Flash Ent NVMe AGN SED MU U.2 Gen4 3.2TB + 1028 2092 EMC PowerEdge Express Flash Ent NVMe AGN SED MU U.2 Gen4 6.4TB + 1028 2093 EMC PowerEdge Express Flash Ent NVMe AGN SED MU U.2 Gen4 12.8TB + 1028 2094 EMC PowerEdge Express Flash Ent NVMe AGN SED MU AIC Gen4 1.6TB + 1028 2095 EMC PowerEdge Express Flash Ent NVMe AGN SED MU AIC Gen4 3.2TB + 1028 2096 EMC PowerEdge Express Flash Ent NVMe AGN SED MU AIC Gen4 6.4TB + 1028 2097 EMC PowerEdge Express Flash Ent NVMe AGN SED RI U.2 Gen4 1.92TB + 1028 2098 EMC PowerEdge Express Flash Ent NVMe AGN SED RI U.2 Gen4 3.84TB + 1028 2099 EMC PowerEdge Express Flash Ent NVMe AGN SED RI U.2 Gen4 7.68TB 144e OLITEC 144f Askey Computer Corp. 1450 Octave Communications Ind. @@ -18801,6 +18944,7 @@ 16d5 BCM57407 NetXtreme-E 10GBase-T Ethernet Controller 16d6 BCM57412 NetXtreme-E 10Gb RDMA Ethernet Controller 14e4 4120 NetXtreme E-Series Advanced Dual-port 10Gb SFP+ Ethernet Network Daughter Card + 14e4 4126 NetXtreme-E Dual-port 10G SFP+ Ethernet OCP 3.0 Adapter (BCM957412N4120C) 152d 8b20 BCM57412 NetXtreme-E 10Gb RDMA Ethernet Controller 152d 8b22 BCM57412 NetXtreme-E 25Gb RDMA Ethernet Controller 16d7 BCM57414 NetXtreme-E 10Gb/25Gb RDMA Ethernet Controller @@ -18808,11 +18952,13 @@ 14e4 1402 BCM957414A4142CC 10Gb/25Gb Ethernet PCIe 14e4 1404 BCM957414M4142C OCP 2x25G Type1 wRoCE 14e4 4140 NetXtreme E-Series Advanced Dual-port 25Gb SFP28 Network Daughter Card + 14e4 4146 NetXtreme-E Dual-port 25G SFP28 Ethernet OCP 3.0 Adapter (BCM957414N4140C) 1590 020e Ethernet 25Gb 2-port 631SFP28 Adapter 1590 0211 Ethernet 25Gb 2-port 631FLR-SFP28 Adapter 16d8 BCM57416 NetXtreme-E Dual-Media 10G RDMA Ethernet Controller 1028 1feb NetXtreme-E 10Gb SFP+ Adapter - 14e4 4163 BCM957416M4163C OCP 2x10GBT Type1 wRoCE + 14e4 4163 NetXtreme-E Dual-port 10GBASE-T Ethernet OCP 2.0 Adapter (BCM957416M4163C) + 14e4 4166 NetXtreme-E Dual-port 10GBASE-T Ethernet OCP 3.0 Adapter (BCM957416N4160C) 1590 020c Ethernet 10Gb 2-port 535T Adapter 1590 0212 Ethernet 10Gb 2-port 535FLR-T Adapter 16d9 BCM57417 NetXtreme-E 10GBASE-T RDMA Ethernet Controller @@ -18829,6 +18975,7 @@ 16e7 BCM57404 NetXtreme-E Ethernet Partition 16e8 BCM57406 NetXtreme-E Ethernet Partition 16e9 BCM57407 NetXtreme-E 25Gb Ethernet Controller + 16eb BCM57412 NetXtreme-E RDMA Partition 16ec BCM57414 NetXtreme-E Ethernet Partition 16ed BCM57414 NetXtreme-E RDMA Partition 16ee BCM57416 NetXtreme-E Ethernet Partition @@ -18861,6 +19008,8 @@ 103c 30c0 Compaq 6710b 17aa 3a23 IdeaPad S10e 1750 BCM57508 NetXtreme-E 10Gb/25Gb/40Gb/50Gb/100Gb/200Gb Ethernet + 14e4 2100 NetXtreme-E Dual-port 100G QSFP56 Ethernet PCIe4.0 x16 Adapter (BCM957508-P2100G) + 14e4 5208 NetXtreme-E Dual-port 100G QSFP56 Ethernet OCP 3.0 Adapter (BCM957508-N2100G) 1751 BCM57504 NetXtreme-E 10Gb/25Gb/40Gb/50Gb/100Gb/200Gb Ethernet 1752 BCM57502 NetXtreme-E 10Gb/25Gb/40Gb/50Gb Ethernet 1806 BCM5750X NetXtreme-E Ethernet Virtual Function @@ -19040,6 +19189,8 @@ 43a1 BCM4360 802.11ac Wireless Network Adapter 43a2 BCM4360 802.11ac Wireless Network Adapter 43a3 BCM4350 802.11ac Wireless Network Adapter +# Manufactured by Foxconn for Lenovo + 17aa 075a 00JT494 43a9 BCM43217 802.11b/g/n 43aa BCM43131 802.11b/g/n 43ae BCM43162 802.11ac Wireless Network Adapter @@ -19817,11 +19968,18 @@ 0215 MT42822 Family [BlueField-2 Secure Flash Recovery] 0216 MT2894 Family [ConnectX-6 Lx Flash Recovery] 0217 MT2894 Family [ConnectX-6 Lx Secure Flash Recovery] + 0218 MT2910 Family [ConnectX-7 Flash Recovery] + 0219 MT2910 Family [ConnectX-7 Secure Flash Recovery] + 021a MT43162 Family [BlueField-3 Lx SoC Flash Recovery] + 021b MT43162 Family [BlueField-3 Lx Secure Flash Recovery] + 021c MT43244 Family [BlueField-3 SoC Flash Recovery] + 021d MT43244 Family [BlueField-3 Secure Flash Recovery] 024e MT53100 [Spectrum-2, Flash recovery mode] 024f MT53100 [Spectrum-2, Secure Flash recovery mode] 0250 Spectrum-3, Flash recovery mode 0251 Spectrum-3, Secure Flash recovery mode 0252 Amos chiplet + 0253 Amos GearBox Manager 0254 Spectrum-4, Flash recovery mode 0255 Spectrum-4, Secure Flash recovery mode 0256 Ofek chiplet @@ -19830,8 +19988,6 @@ 0263 MT27710 [ConnectX-4 Lx Programmable Virtual Function] EN 0264 Innova-2 Flex Burn image 0281 NPS-600 Flash Recovery - 0538 MT2910 Family [ConnectX-7 Flash Recovery] - 0539 MT2910 Family [ConnectX-7 Secure Flash Recovery] 1002 MT25400 Family [ConnectX-2 Virtual Function] 1003 MT27500 Family [ConnectX-3] 1014 04b5 PCIe3 40GbE RoCE Converged Host Bus Adapter for Power @@ -19904,11 +20060,13 @@ 1016 MT27710 Family [ConnectX-4 Lx Virtual Function] 1017 MT27800 Family [ConnectX-5] 15b3 0006 ConnectX®-5 EN network interface card, 100GbE single-port QSFP28, PCIe3.0 x16, tall bracket; MCX515A-CCAT + 15b3 0007 Mellanox ConnectX®-5 MCX516A-CCAT 15b3 0020 ConnectX®-5 EN network interface card, 10/25GbE dual-port SFP28, PCIe3.0 x8, tall bracket ; MCX512A-ACAT 15b3 0068 ConnectX®-5 EN network interface card for OCP2.0, Type 1, with host management, 25GbE dual-port SFP28, PCIe3.0 x8, no bracket Halogen free ; MCX542B-ACAN 1018 MT27800 Family [ConnectX-5 Virtual Function] 1019 MT28800 Family [ConnectX-5 Ex] 15b3 0008 ConnectX-5 Ex EN network interface card, 100GbE dual-port QSFP28, PCIe4.0 x16, tall bracket; MCX516A-CDAT + 15b3 0125 Tencent ConnectX-5 EN Ex network interface card for OCP 3.0, with host management, 50GbE Dual-port QSFP28, PCIe4.0 x16, Thumbscrew (pull-tab) bracket 101a MT28800 Family [ConnectX-5 Ex Virtual Function] 101b MT28908 Family [ConnectX-6] 101c MT28908 Family [ConnectX-6 Virtual Function] @@ -19922,9 +20080,12 @@ 1976 MT28908 Family [ConnectX-6 PCIe Bridge] 1977 MT2892 Family [ConnectX-6 Dx PCIe Bridge] 1978 MT42822 Family [BlueField-2 SoC PCIe Bridge] + 1979 MT2910 Family [ConnectX-7 PCIe Bridge] + 197a MT43162 Family [BlueField-3 Lx SoC PCIe Bridge] + 197b MT43244 Family [BlueField-3 SoC PCIe Bridge] 4117 MT27712A0-FDCF-AE 1bd4 0039 SN10XMP2P25 - 1bd4 003a 10G SFP28 SP EO251FM9 Adapter + 1bd4 003a 25G SFP28 SP EO251FM9 Adapter 1bd4 004d SN10XMP2P25,YZPC-01191-101 5274 MT21108 InfiniBridge 5a44 MT23108 InfiniHost @@ -19976,8 +20137,16 @@ a2d4 MT42822 BlueField-2 SoC Crypto enabled a2d5 MT42822 BlueField-2 SoC Crypto disabled a2d6 MT42822 BlueField-2 integrated ConnectX-6 Dx network controller + a2d7 MT43162 BlueField-3 Lx SoC Crypto enabled + a2d8 MT43162 BlueField-3 Lx SoC Crypto disabled + a2d9 MT43162 BlueField-3 Lx integrated ConnectX-7 network controller + a2da MT43244 BlueField-3 SoC Crypto enabled + a2db MT43244 BlueField-3 SoC Crypto disabled + a2dc MT43244 BlueField-3 integrated ConnectX-7 network controller c2d2 MT416842 BlueField SoC management interfac c2d3 MT42822 BlueField-2 SoC Management Interface + c2d4 MT43162 BlueField-3 Lx SoC Management Interface + c2d5 MT43244 BlueField-3 SoC Management Interface # SwitchX-2, 40GbE switch c738 MT51136 c739 MT51136 GW @@ -20313,9 +20482,14 @@ 167e ONNTO Corp. 1681 Hercules 1682 XFX Pine Group Inc. + 5701 Radeon 5700 XT Thicc III Ultra c580 Radeon RX 580 1688 CastleNet Technology Inc. 1170 WLAN 802.11b card +168a Utimaco IS GmbH + 2086 CryptoServer Se-Series Hardware Security Module + c040 CryptoServer CSe-Series Hardware Security Module + c051 CryptoServer Se-Series Gen2 Hardware Security Module # nee Atheros Communications, Inc. 168c Qualcomm Atheros 0007 AR5210 Wireless Network Adapter [AR5000 802.11a] @@ -20541,6 +20715,7 @@ 1028 0300 Wireless 1802 802.11abgn Adapter 1a56 2003 Killer Wireless-N 1202 Half-size Mini PCIe Card 0036 QCA9565 / AR9565 Wireless Network Adapter + 1028 020e Vostro 3470 0037 AR9485 Wireless Network Adapter # Also used as Gigabyte GC-WB150 on a PCIe-to-mini-PCIe converter 1a3b 2100 AW-NB100H 802.11n Wireless Mini PCIe Card @@ -20551,6 +20726,9 @@ 0040 QCA9980/9990 802.11ac Wireless Network Adapter 0041 QCA6164 802.11ac Wireless Network Adapter 0042 QCA9377 802.11ac Wireless Network Adapter + 11ad 08a6 Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter +# compatible with Lenovo's BIOS lock + 17aa 0901 Qualcomm Atheros QCA9377 Wireless Network Adapter 0046 QCA9984 802.11ac Wave 2 Wireless Network Adapter 0050 QCA9887 802.11ac Wireless Network Adapter 0207 AR5210 Wireless Network Adapter [AR5000 802.11a] @@ -20778,11 +20956,22 @@ 0121 PCT-7303A PC card with IRC counters 0122 PCT-7408A PC card with counters and timers 0123 PCT-7424 PCI card with standard counters + 0141 PCA7208AL - Analog Inputs/Outputs + 0142 PCA7208AS - Analog inputs/Outputs + 0143 PCA7408AL - Analog Inputs/Outputs + 0144 PCA7408AS - Analog Inputs/Outputs 0214 PCT-7424C (F0) PC card with standard counters 0215 PCT-7424C (F1) PC card with standard counters 0216 PCT-7424E (F0) PC card with standard counters 0217 PCT-7424E (F1) PC card with standard counters + 0240 PCA7428CL_F0 - analog Inputs + 0241 PCA7428CL_F1 - analog Inputs + 0242 PCA7428CS_F0 - Analog Inputs/Outputs non isolated + 0243 PCA7428CS_F1 - Analog Inputs/Outputs non isolated + 0244 PCA7428CE_F0 - Analog Inputs isolated + 0245 PCA7428CE_F1 - Analog Inputs isolated 0303 PCD-7006C Digital Input & Output PCI Card + 0800 PCD8006 - PCIe digital Inputs/Outputs ff00 CTU CAN FD PCIe Card 1761 Pickering Interfaces Ltd 1771 InnoVISION Multimedia Ltd. @@ -20982,8 +21171,14 @@ 0002 AGN300 802.11 a/b/g True MIMO Wireless Card 1385 6d00 WPNT511 RangeMax 240 Mbps Wireless CardBus Adapter 1737 0054 WPC54GX4 v1 802.11g Wireless-G Notebook Adapter with SRX400 + 0105 MSM8998 PCIe Root Complex + 0108 SM8150/SA8195P PCIe Root Complex + 0300 MDM9x35 LTE Modem + 0301 MDM9640 PCIe Root Complex + 0302 MDM9x55 LTE Modem [Snapdragon X12] 0400 Datacenter Technologies QDF2432 PCI Express Root Port 0401 Datacenter Technologies QDF2400 PCI Express Root Port + 1000 QCS405 PCIe Root Complex 17cc NetChip Technology, Inc 2280 USB 2.0 17cd Cadence Design Systems, Inc. @@ -21126,11 +21321,35 @@ 1011 R1011 IDE Controller 1012 R1012 IDE Controller 1031 PCI/PCI-X to PCI-E Bridge +# Integrated in Vortex86EX, Vortex86EX2 SoC + 1070 CAN Bus Controller +# Integrated in Vortex86EX, Vortex86EX2 SoCs + 1331 Motion Control Interface +# Found in the Vortex86EX2 SoC + 1930 Hybrid Function Control Register +# IGP = on-chip integrated in the MSTI-PMX-1000 (Vortex86MX). + 2010 RDC M2010 VGA-compatible graphics adapter 2012 M2012/R3308 VGA-compatible graphics adapter +# IGP = on-chip integrated in the Vortex86DX3. Basic 2D accel. UMA architecture. + 2015 RDC M2015 VGA-compatible graphics adapter +# Found in the Vortex86EX SoC + 6011 R6011 ISA Bridge +# Found in the Vortex86EX2 SoC + 6013 R6013 ISA Bridge 6020 R6020 North Bridge 6021 R6021 Host Bridge +# Found in the Vortex86DX3 SoC + 6023 R6023 Host Bridge +# Found in the Vortex86EX SoC + 6025 R6025 Host Bridge +# Found in the Vortex86EX2 SoC + 6026 R6026 Host Bridge 6030 R6030 ISA Bridge 6031 R6031 ISA Bridge +# Found in the Vortex86DX3 SoC + 6035 R6035 ISA Bridge +# Found in MSTI-PMX-1000 (Vortex86MX) SoC. + 6036 R6036 ISA Bridge 6040 R6040 MAC Controller 6060 R6060 USB 1.1 Controller 6061 R6061 USB 2.0 Controller @@ -21780,6 +21999,11 @@ 1966 Orad Hi-Tec Systems 1975 DVG64 family 1977 DVG128 family + 1979 3DVG/UHD3 + 1980 HDV2/UHD2 + 1234 3160 UHD2LC + 1234 3300 Legacy UHD2 + 1234 3410 UHD2 # nee Atheros Communications, Inc. nee Attansic Technology Corp. 1969 Qualcomm Atheros *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Sep 19 20:47:00 2020 Return-Path: Delivered-To: svn-src-all@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 788E43EF303; Sat, 19 Sep 2020 20:47:00 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Bv2nJ2vfBz4Tjg; Sat, 19 Sep 2020 20:47:00 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E33B11F22; Sat, 19 Sep 2020 20:47:00 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08JKl0di080263; Sat, 19 Sep 2020 20:47:00 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JKkuBn080241; Sat, 19 Sep 2020 20:46:56 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <202009192046.08JKkuBn080241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 19 Sep 2020 20:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365917 - in releng/12.2: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolar... X-SVN-Group: releng X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: in releng/12.2: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/common/zfs sys/cddl/co... X-SVN-Commit-Revision: 365917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 20:47:00 -0000 Author: allanjude Date: Sat Sep 19 20:46:56 2020 New Revision: 365917 URL: https://svnweb.freebsd.org/changeset/base/365917 Log: MFS r365689,r365808,r365860 MFOpenZFS: Introduce read/write kstats per dataset The following patch introduces a few statistics on reads and writes grouped by dataset. These statistics are implemented as kstats (backed by aggregate sums for performance) and can be retrieved by using the dataset objset ID number. The motivation for this change is to provide some preliminary analytics on dataset usage/performance. Reviewed-by: Richard Elling Reviewed-by: Brian Behlendorf Reviewed by: Matthew Ahrens Signed-off-by: Serapheim Dimitropoulos openzfs/zfs@a448a2557ec4938ed6944c7766fe0b8e6e5f6456 Also contains parts of: MFOpenZFS: Connect dataset_kstats for FreeBSD Example output: kstat.zfs.mypool.dataset.objset-0x10b.nread: 150528 kstat.zfs.mypool.dataset.objset-0x10b.reads: 48 kstat.zfs.mypool.dataset.objset-0x10b.nwritten: 134217728 kstat.zfs.mypool.dataset.objset-0x10b.writes: 1024 kstat.zfs.mypool.dataset.objset-0x10b.dataset_name: mypool/datasetname Reviewed-by: Ryan Moeller Reviewed by: Sean Eric Fagan Reviewed-by: Serapheim Dimitropoulos Reviewed-by: Brian Behlendorf Signed-off-by: Allan Jude openzfs/zfs@4547fc4e071ceb1818b3a46c3035b923e06e5390 Approved by: re (gjb) Relnotes: yes Sponsored by: Klara Inc. Added: releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dataset_kstats.c - copied unchanged from r365689, stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dataset_kstats.c releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dataset_kstats.h - copied unchanged from r365689, stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dataset_kstats.h Modified: releng/12.2/cddl/contrib/opensolaris/cmd/zfs/zfs.8 releng/12.2/cddl/contrib/opensolaris/cmd/zpool/zpool.8 releng/12.2/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c releng/12.2/sys/cddl/compat/opensolaris/sys/kstat.h releng/12.2/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c releng/12.2/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c releng/12.2/sys/cddl/contrib/opensolaris/uts/common/Makefile.files releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c releng/12.2/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h releng/12.2/sys/conf/files releng/12.2/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- releng/12.2/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sat Sep 19 20:18:14 2020 (r365916) +++ releng/12.2/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sat Sep 19 20:46:56 2020 (r365917) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 16, 2019 +.Dd September 12, 2020 .Dt ZFS 8 .Os .Sh NAME @@ -635,6 +635,16 @@ property can be either .Cm yes or .Cm no . +.It Sy objsetid +A unique identifier for this dataset within the pool. Unlike the dataset's +.Sy guid +, the +.Sy objsetid +of a dataset is not transferred to other pools when the snapshot is copied +with a send/receive operation. +The +.Sy objsetid +can be reused (for a new datatset) after the dataset is deleted. .It Sy origin For cloned file systems or volumes, the snapshot from which the clone was created. See also the Modified: releng/12.2/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- releng/12.2/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sat Sep 19 20:18:14 2020 (r365916) +++ releng/12.2/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sat Sep 19 20:46:56 2020 (r365917) @@ -687,6 +687,15 @@ will decrease while increases. .It Sy guid A unique identifier for the pool. +.It Sy load_guid +A unique identifier for the pool. +Unlike the +.Sy guid +property, this identifier is generated every time we load the pool (e.g. does +not persist across imports/exports) and never changes while the pool is loaded +(even if a +.Sy reguid +operation takes place). .It Sy health The current health of the pool. Health can be .Qq Sy ONLINE , Modified: releng/12.2/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c ============================================================================== --- releng/12.2/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c Sat Sep 19 20:18:14 2020 (r365916) +++ releng/12.2/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c Sat Sep 19 20:46:56 2020 (r365917) @@ -38,12 +38,24 @@ static MALLOC_DEFINE(M_KSTAT, "kstat_data", "Kernel st SYSCTL_ROOT_NODE(OID_AUTO, kstat, CTLFLAG_RW, 0, "Kernel statistics"); +static int +kstat_default_update(kstat_t *ksp, int rw) +{ + KASSERT(ksp != NULL, ("kstat=%p", ksp)); + + if (rw == KSTAT_WRITE) + return (EACCES); + + return (0); +} + kstat_t * kstat_create(char *module, int instance, char *name, char *class, uchar_t type, ulong_t ndata, uchar_t flags) { struct sysctl_oid *root; kstat_t *ksp; + char *pool; KASSERT(instance == 0, ("instance=%d", instance)); KASSERT(type == KSTAT_TYPE_NAMED, ("type=%hhu", type)); @@ -56,11 +68,21 @@ kstat_create(char *module, int instance, char *name, c */ ksp = malloc(sizeof(*ksp), M_KSTAT, M_WAITOK); ksp->ks_ndata = ndata; + ksp->ks_update = kstat_default_update; /* + * Some kstats use a module name like "zfs/poolname" to distinguish a + * set of kstats belonging to a specific pool. Split on '/' to add an + * extra node for the pool name if needed. + */ + pool = strchr(module, '/'); + if (pool != NULL) + *pool++ = '\0'; + + /* * Create sysctl tree for those statistics: * - * kstat.... + * kstat.[.].. */ sysctl_ctx_init(&ksp->ks_sysctl_ctx); root = SYSCTL_ADD_NODE(&ksp->ks_sysctl_ctx, @@ -72,11 +94,26 @@ kstat_create(char *module, int instance, char *name, c free(ksp, M_KSTAT); return (NULL); } + if (pool != NULL) { + root = SYSCTL_ADD_NODE(&ksp->ks_sysctl_ctx, + SYSCTL_CHILDREN(root), OID_AUTO, pool, CTLFLAG_RW, 0, ""); + if (root == NULL) { + printf("%s: Cannot create kstat.%s.%s tree!\n", + __func__, module, pool); + sysctl_ctx_free(&ksp->ks_sysctl_ctx); + free(ksp, M_KSTAT); + return (NULL); + } + } root = SYSCTL_ADD_NODE(&ksp->ks_sysctl_ctx, SYSCTL_CHILDREN(root), OID_AUTO, class, CTLFLAG_RW, 0, ""); if (root == NULL) { - printf("%s: Cannot create kstat.%s.%s tree!\n", __func__, - module, class); + if (pool != NULL) + printf("%s: Cannot create kstat.%s.%s.%s tree!\n", + __func__, module, pool, class); + else + printf("%s: Cannot create kstat.%s.%s tree!\n", + __func__, module, class); sysctl_ctx_free(&ksp->ks_sysctl_ctx); free(ksp, M_KSTAT); return (NULL); @@ -84,8 +121,13 @@ kstat_create(char *module, int instance, char *name, c root = SYSCTL_ADD_NODE(&ksp->ks_sysctl_ctx, SYSCTL_CHILDREN(root), OID_AUTO, name, CTLFLAG_RW, 0, ""); if (root == NULL) { - printf("%s: Cannot create kstat.%s.%s.%s tree!\n", __func__, - module, class, name); + if (pool != NULL) + printf("%s: Cannot create kstat.%s.%s.%s.%s " + "tree!\n", __func__, module, pool, class, + name); + else + printf("%s: Cannot create kstat.%s.%s.%s " + "tree!\n", __func__, module, class, name); sysctl_ctx_free(&ksp->ks_sysctl_ctx); free(ksp, M_KSTAT); return (NULL); @@ -98,13 +140,38 @@ kstat_create(char *module, int instance, char *name, c static int kstat_sysctl(SYSCTL_HANDLER_ARGS) { - kstat_named_t *ksent = arg1; + kstat_t *ksp = arg1; + kstat_named_t *ksent = ksp->ks_data; uint64_t val; + /* Select the correct element */ + ksent += arg2; + /* Update the aggsums before reading */ + (void) ksp->ks_update(ksp, KSTAT_READ); val = ksent->value.ui64; + return sysctl_handle_64(oidp, &val, 0, req); } +static int +kstat_sysctl_string(SYSCTL_HANDLER_ARGS) +{ + kstat_t *ksp = arg1; + kstat_named_t *ksent = ksp->ks_data; + char *val; + uint32_t len = 0; + + /* Select the correct element */ + ksent += arg2; + /* Update the aggsums before reading */ + (void) ksp->ks_update(ksp, KSTAT_READ); + val = KSTAT_NAMED_STR_PTR(ksent); + len = KSTAT_NAMED_STR_BUFLEN(ksent); + val[len-1] = '\0'; + + return (sysctl_handle_string(oidp, val, len, req)); +} + void kstat_install(kstat_t *ksp) { @@ -113,11 +180,19 @@ kstat_install(kstat_t *ksp) ksent = ksp->ks_data; for (i = 0; i < ksp->ks_ndata; i++, ksent++) { + if (ksent->data_type == KSTAT_DATA_STRING) { + SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx, + SYSCTL_CHILDREN(ksp->ks_sysctl_root), + OID_AUTO, ksent->name, + CTLTYPE_STRING | CTLFLAG_RD, ksp, i, + kstat_sysctl_string, "A", ksent->desc); + continue; + } KASSERT(ksent->data_type == KSTAT_DATA_UINT64, ("data_type=%d", ksent->data_type)); SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx, SYSCTL_CHILDREN(ksp->ks_sysctl_root), OID_AUTO, ksent->name, - CTLTYPE_U64 | CTLFLAG_RD, ksent, sizeof(*ksent), + CTLTYPE_U64 | CTLFLAG_RD, ksp, i, kstat_sysctl, "QU", ksent->desc); } } Modified: releng/12.2/sys/cddl/compat/opensolaris/sys/kstat.h ============================================================================== --- releng/12.2/sys/cddl/compat/opensolaris/sys/kstat.h Sat Sep 19 20:18:14 2020 (r365916) +++ releng/12.2/sys/cddl/compat/opensolaris/sys/kstat.h Sat Sep 19 20:46:56 2020 (r365917) @@ -68,13 +68,24 @@ typedef struct kstat_named { #define KSTAT_DATA_UINT32 2 #define KSTAT_DATA_INT64 3 #define KSTAT_DATA_UINT64 4 +#define KSTAT_DATA_STRING 7 uchar_t data_type; #define KSTAT_DESCLEN 128 char desc[KSTAT_DESCLEN]; union { uint64_t ui64; + struct { + union { + char *ptr; /* NULL-term string */ + char __pad[8]; /* 64-bit padding */ + } addr; + uint32_t len; /* # bytes for strlen + '\0' */ + } string; } value; } kstat_named_t; + +#define KSTAT_NAMED_STR_PTR(knptr) ((knptr)->value.string.addr.ptr) +#define KSTAT_NAMED_STR_BUFLEN(knptr) ((knptr)->value.string.len) kstat_t *kstat_create(char *module, int instance, char *name, char *cls, uchar_t type, ulong_t ndata, uchar_t flags); Modified: releng/12.2/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- releng/12.2/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Sat Sep 19 20:18:14 2020 (r365916) +++ releng/12.2/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Sat Sep 19 20:46:56 2020 (r365917) @@ -446,6 +446,8 @@ zfs_prop_init(void) ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "", "GUID"); zprop_register_number(ZFS_PROP_CREATETXG, "createtxg", 0, PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "", "CREATETXG"); + zprop_register_number(ZFS_PROP_OBJSETID, "objsetid", 0, + PROP_READONLY, ZFS_TYPE_DATASET, "", "OBJSETID"); /* inherit number properties */ zprop_register_number(ZFS_PROP_RECORDSIZE, "recordsize", @@ -472,8 +474,6 @@ zfs_prop_init(void) "USERACCOUNTING"); zprop_register_hidden(ZFS_PROP_UNIQUE, "unique", PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "UNIQUE"); - zprop_register_hidden(ZFS_PROP_OBJSETID, "objsetid", PROP_TYPE_NUMBER, - PROP_READONLY, ZFS_TYPE_DATASET, "OBJSETID"); zprop_register_hidden(ZFS_PROP_INCONSISTENT, "inconsistent", PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "INCONSISTENT"); zprop_register_hidden(ZFS_PROP_PREV_SNAP, "prevsnap", PROP_TYPE_STRING, Modified: releng/12.2/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c ============================================================================== --- releng/12.2/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c Sat Sep 19 20:18:14 2020 (r365916) +++ releng/12.2/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c Sat Sep 19 20:46:56 2020 (r365917) @@ -21,7 +21,7 @@ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012, 2017 by Delphix. All rights reserved. + * Copyright (c) 2012, 2017, 2018 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -96,6 +96,8 @@ zpool_prop_init(void) ZFS_TYPE_POOL, "", "CAP"); zprop_register_number(ZPOOL_PROP_GUID, "guid", 0, PROP_READONLY, ZFS_TYPE_POOL, "", "GUID"); + zprop_register_number(ZPOOL_PROP_LOAD_GUID, "load_guid", 0, + PROP_READONLY, ZFS_TYPE_POOL, "", "LOAD_GUID"); zprop_register_number(ZPOOL_PROP_HEALTH, "health", 0, PROP_READONLY, ZFS_TYPE_POOL, "", "HEALTH"); zprop_register_number(ZPOOL_PROP_DEDUPRATIO, "dedupratio", 0, Modified: releng/12.2/sys/cddl/contrib/opensolaris/uts/common/Makefile.files ============================================================================== --- releng/12.2/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Sat Sep 19 20:18:14 2020 (r365916) +++ releng/12.2/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Sat Sep 19 20:46:56 2020 (r365917) @@ -71,6 +71,7 @@ ZFS_COMMON_OBJS += \ bptree.o \ bqueue.o \ cityhash.o \ + dataset_kstats.c \ dbuf.o \ dbuf_stats.o \ ddt.o \ Copied: releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dataset_kstats.c (from r365689, stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dataset_kstats.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dataset_kstats.c Sat Sep 19 20:46:56 2020 (r365917, copy of r365689, stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dataset_kstats.c) @@ -0,0 +1,185 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2018 by Delphix. All rights reserved. + */ + +#include +#include +#include +#include + +static dataset_kstat_values_t empty_dataset_kstats = { + { "dataset_name", KSTAT_DATA_STRING }, + { "writes", KSTAT_DATA_UINT64 }, + { "nwritten", KSTAT_DATA_UINT64 }, + { "reads", KSTAT_DATA_UINT64 }, + { "nread", KSTAT_DATA_UINT64 }, +}; + +static int +dataset_kstats_update(kstat_t *ksp, int rw) +{ + dataset_kstats_t *dk = ksp->ks_private; + ASSERT3P(dk->dk_kstats->ks_data, ==, ksp->ks_data); + + if (rw == KSTAT_WRITE) + return (EACCES); + + dataset_kstat_values_t *dkv = dk->dk_kstats->ks_data; + dkv->dkv_writes.value.ui64 = + aggsum_value(&dk->dk_aggsums.das_writes); + dkv->dkv_nwritten.value.ui64 = + aggsum_value(&dk->dk_aggsums.das_nwritten); + dkv->dkv_reads.value.ui64 = + aggsum_value(&dk->dk_aggsums.das_reads); + dkv->dkv_nread.value.ui64 = + aggsum_value(&dk->dk_aggsums.das_nread); + + return (0); +} + +void +dataset_kstats_create(dataset_kstats_t *dk, objset_t *objset) +{ + /* + * There should not be anything wrong with having kstats for + * snapshots. Since we are not sure how useful they would be + * though nor how much their memory overhead would matter in + * a filesystem with many snapshots, we skip them for now. + */ + if (dmu_objset_is_snapshot(objset)) + return; + + /* + * At the time of this writing, KSTAT_STRLEN is 255 in Linux, + * and the spa_name can theoretically be up to 256 characters. + * In reality though the spa_name can be 240 characters max + * [see origin directory name check in pool_namecheck()]. Thus, + * the naming scheme for the module name below should not cause + * any truncations. In the event that a truncation does happen + * though, due to some future change, we silently skip creating + * the kstat and log the event. + */ + char kstat_module_name[KSTAT_STRLEN]; + int n = snprintf(kstat_module_name, sizeof (kstat_module_name), + "zfs/%s", spa_name(dmu_objset_spa(objset))); + if (n < 0) { + zfs_dbgmsg("failed to create dataset kstat for objset %lld: " + " snprintf() for kstat module name returned %d", + (unsigned long long)dmu_objset_id(objset), n); + return; + } else if (n >= KSTAT_STRLEN) { + zfs_dbgmsg("failed to create dataset kstat for objset %lld: " + "kstat module name length (%d) exceeds limit (%d)", + (unsigned long long)dmu_objset_id(objset), + n, KSTAT_STRLEN); + return; + } + + char kstat_name[KSTAT_STRLEN]; + n = snprintf(kstat_name, sizeof (kstat_name), "objset-0x%llx", + (unsigned long long)dmu_objset_id(objset)); + if (n < 0) { + zfs_dbgmsg("failed to create dataset kstat for objset %lld: " + " snprintf() for kstat name returned %d", + (unsigned long long)dmu_objset_id(objset), n); + return; + } + ASSERT3U(n, <, KSTAT_STRLEN); + + kstat_t *kstat = kstat_create(kstat_module_name, 0, kstat_name, + "dataset", KSTAT_TYPE_NAMED, + sizeof (empty_dataset_kstats) / sizeof (kstat_named_t), + KSTAT_FLAG_VIRTUAL); + if (kstat == NULL) + return; + + dataset_kstat_values_t *dk_kstats = + kmem_alloc(sizeof (empty_dataset_kstats), KM_SLEEP); + bcopy(&empty_dataset_kstats, dk_kstats, + sizeof (empty_dataset_kstats)); + + char *ds_name = kmem_zalloc(ZFS_MAX_DATASET_NAME_LEN, KM_SLEEP); + dsl_dataset_name(objset->os_dsl_dataset, ds_name); + KSTAT_NAMED_STR_PTR(&dk_kstats->dkv_ds_name) = ds_name; + KSTAT_NAMED_STR_BUFLEN(&dk_kstats->dkv_ds_name) = + ZFS_MAX_DATASET_NAME_LEN; + + kstat->ks_data = dk_kstats; + kstat->ks_update = dataset_kstats_update; + kstat->ks_private = dk; + + kstat_install(kstat); + dk->dk_kstats = kstat; + + aggsum_init(&dk->dk_aggsums.das_writes, 0); + aggsum_init(&dk->dk_aggsums.das_nwritten, 0); + aggsum_init(&dk->dk_aggsums.das_reads, 0); + aggsum_init(&dk->dk_aggsums.das_nread, 0); +} + +void +dataset_kstats_destroy(dataset_kstats_t *dk) +{ + if (dk->dk_kstats == NULL) + return; + + dataset_kstat_values_t *dkv = dk->dk_kstats->ks_data; + kmem_free(KSTAT_NAMED_STR_PTR(&dkv->dkv_ds_name), + KSTAT_NAMED_STR_BUFLEN(&dkv->dkv_ds_name)); + kmem_free(dkv, sizeof (empty_dataset_kstats)); + + kstat_delete(dk->dk_kstats); + dk->dk_kstats = NULL; + + aggsum_fini(&dk->dk_aggsums.das_writes); + aggsum_fini(&dk->dk_aggsums.das_nwritten); + aggsum_fini(&dk->dk_aggsums.das_reads); + aggsum_fini(&dk->dk_aggsums.das_nread); +} + +void +dataset_kstats_update_write_kstats(dataset_kstats_t *dk, + int64_t nwritten) +{ + ASSERT3S(nwritten, >=, 0); + + if (dk->dk_kstats == NULL) + return; + + aggsum_add(&dk->dk_aggsums.das_writes, 1); + aggsum_add(&dk->dk_aggsums.das_nwritten, nwritten); +} + +void +dataset_kstats_update_read_kstats(dataset_kstats_t *dk, + int64_t nread) +{ + ASSERT3S(nread, >=, 0); + + if (dk->dk_kstats == NULL) + return; + + aggsum_add(&dk->dk_aggsums.das_reads, 1); + aggsum_add(&dk->dk_aggsums.das_nread, nread); +} Modified: releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Sep 19 20:18:14 2020 (r365916) +++ releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Sep 19 20:46:56 2020 (r365917) @@ -352,6 +352,9 @@ spa_prop_get_config(spa_t *spa, nvlist_t **nvp) else src = ZPROP_SRC_LOCAL; spa_prop_add_list(*nvp, ZPOOL_PROP_VERSION, NULL, version, src); + + spa_prop_add_list(*nvp, ZPOOL_PROP_LOAD_GUID, + NULL, spa_load_guid(spa), src); } if (pool != NULL) { Copied: releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dataset_kstats.h (from r365689, stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dataset_kstats.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dataset_kstats.h Sat Sep 19 20:46:56 2020 (r365917, copy of r365689, stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dataset_kstats.h) @@ -0,0 +1,59 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2018 by Delphix. All rights reserved. + */ + +#ifndef _SYS_DATASET_KSTATS_H +#define _SYS_DATASET_KSTATS_H + +#include +#include +#include + +typedef struct dataset_aggsum_stats_t { + aggsum_t das_writes; + aggsum_t das_nwritten; + aggsum_t das_reads; + aggsum_t das_nread; +} dataset_aggsum_stats_t; + +typedef struct dataset_kstat_values { + kstat_named_t dkv_ds_name; + kstat_named_t dkv_writes; + kstat_named_t dkv_nwritten; + kstat_named_t dkv_reads; + kstat_named_t dkv_nread; +} dataset_kstat_values_t; + +typedef struct dataset_kstats { + dataset_aggsum_stats_t dk_aggsums; + kstat_t *dk_kstats; +} dataset_kstats_t; + +void dataset_kstats_create(dataset_kstats_t *, objset_t *); +void dataset_kstats_destroy(dataset_kstats_t *); + +void dataset_kstats_update_write_kstats(dataset_kstats_t *, int64_t); +void dataset_kstats_update_read_kstats(dataset_kstats_t *, int64_t); + +#endif /* _SYS_DATASET_KSTATS_H */ Modified: releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h ============================================================================== --- releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Sat Sep 19 20:18:14 2020 (r365916) +++ releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Sat Sep 19 20:46:56 2020 (r365917) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018 by Delphix. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. */ @@ -27,6 +28,7 @@ #ifndef _SYS_FS_ZFS_VFSOPS_H #define _SYS_FS_ZFS_VFSOPS_H +#include #include #include #include @@ -80,6 +82,7 @@ struct zfsvfs { boolean_t z_use_namecache;/* make use of FreeBSD name cache */ uint64_t z_version; /* ZPL version */ uint64_t z_shares_dir; /* hidden shares dir */ + dataset_kstats_t z_kstat; /* fs kstats */ kmutex_t z_lock; uint64_t z_userquota_obj; uint64_t z_groupquota_obj; Modified: releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Sep 19 20:18:14 2020 (r365916) +++ releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Sep 19 20:46:56 2020 (r365917) @@ -1245,6 +1245,9 @@ zfsvfs_setup(zfsvfs_t *zfsvfs, boolean_t mounting) if (mounting) { boolean_t readonly; + ASSERT3P(zfsvfs->z_kstat.dk_kstats, ==, NULL); + dataset_kstats_create(&zfsvfs->z_kstat, zfsvfs->z_os); + /* * During replay we remove the read only flag to * allow replays to succeed. @@ -1333,6 +1336,7 @@ zfsvfs_free(zfsvfs_t *zfsvfs) rw_destroy(&zfsvfs->z_fuid_lock); for (i = 0; i != ZFS_OBJ_MTX_SZ; i++) mutex_destroy(&zfsvfs->z_hold_mtx[i]); + dataset_kstats_destroy(&zfsvfs->z_kstat); kmem_free(zfsvfs, sizeof (zfsvfs_t)); } Modified: releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Sep 19 20:18:14 2020 (r365916) +++ releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Sep 19 20:46:56 2020 (r365917) @@ -77,6 +77,7 @@ #include #include #include +#include /* * Programming rules. @@ -701,9 +702,10 @@ zfs_read(vnode_t *vp, uio_t *uio, int ioflag, cred_t * { znode_t *zp = VTOZ(vp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; - ssize_t n, nbytes; + ssize_t n, nbytes, start_resid; int error = 0; xuio_t *xuio = NULL; + int64_t nread; ZFS_ENTER(zfsvfs); ZFS_VERIFY_ZP(zp); @@ -764,6 +766,7 @@ zfs_read(vnode_t *vp, uio_t *uio, int ioflag, cred_t * ASSERT(uio->uio_loffset < zp->z_size); n = MIN(uio->uio_resid, zp->z_size - uio->uio_loffset); + start_resid = n; #ifdef illumos if ((uio->uio_extflg == UIO_XUIO) && @@ -820,6 +823,10 @@ zfs_read(vnode_t *vp, uio_t *uio, int ioflag, cred_t * n -= nbytes; } + + nread = start_resid - n; + dataset_kstats_update_read_kstats(&zfsvfs->z_kstat, nread); + out: rangelock_exit(lr); @@ -873,6 +880,7 @@ zfs_write(vnode_t *vp, uio_t *uio, int ioflag, cred_t int count = 0; sa_bulk_attr_t bulk[4]; uint64_t mtime[2], ctime[2]; + int64_t nwritten; /* * Fasttrack empty write @@ -1239,6 +1247,9 @@ zfs_write(vnode_t *vp, uio_t *uio, int ioflag, cred_t if (ioflag & (FSYNC | FDSYNC) || zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) zil_commit(zilog, zp->z_id); + + nwritten = start_resid - uio->uio_resid; + dataset_kstats_update_write_kstats(&zfsvfs->z_kstat, nwritten); ZFS_EXIT(zfsvfs); return (0); Modified: releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sat Sep 19 20:18:14 2020 (r365916) +++ releng/12.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sat Sep 19 20:46:56 2020 (r365917) @@ -96,6 +96,7 @@ #include #include #include +#include #include @@ -177,6 +178,7 @@ typedef struct zvol_state { list_t zv_extents; /* List of extents for dump */ rangelock_t zv_rangelock; dnode_t *zv_dn; /* dnode hold */ + dataset_kstats_t zv_kstat; /* zvol kstats */ #ifndef illumos int zv_state; int zv_volmode; /* Provide GEOM or cdev */ @@ -768,6 +770,10 @@ zvol_create_minor(const char *name) else zil_replay(os, zv, zvol_replay_vector); } + + ASSERT3P(zv->zv_kstat.dk_kstats, ==, NULL); + dataset_kstats_create(&zv->zv_kstat, zv->zv_objset); + dmu_objset_disown(os, FTAG); zv->zv_objset = NULL; @@ -823,6 +829,7 @@ zvol_remove_zv(zvol_state_t *zv) rangelock_fini(&zv->zv_rangelock); + dataset_kstats_destroy(&zv->zv_kstat); kmem_free(zv, sizeof (zvol_state_t)); #ifdef illumos ddi_soft_state_free(zfsdev_state, minor); @@ -1752,6 +1759,23 @@ unlock: bp->bio_completed = bp->bio_length - resid; if (bp->bio_completed < bp->bio_length && off > volsize) error = EINVAL; + + switch (bp->bio_cmd) { + case BIO_FLUSH: + break; + case BIO_READ: + dataset_kstats_update_read_kstats(&zv->zv_kstat, + bp->bio_completed); + break; + case BIO_WRITE: + dataset_kstats_update_write_kstats(&zv->zv_kstat, + bp->bio_completed); + break; + case BIO_DELETE: + break; + default: + break; + } if (sync) { sync: Modified: releng/12.2/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- releng/12.2/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Sat Sep 19 20:18:14 2020 (r365916) +++ releng/12.2/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Sat Sep 19 20:46:56 2020 (r365917) @@ -148,7 +148,7 @@ typedef enum { ZFS_PROP_USERREFS, ZFS_PROP_LOGBIAS, ZFS_PROP_UNIQUE, /* not exposed to the user */ - ZFS_PROP_OBJSETID, /* not exposed to the user */ + ZFS_PROP_OBJSETID, ZFS_PROP_DEDUP, ZFS_PROP_MLSLABEL, ZFS_PROP_SYNC, @@ -220,6 +220,7 @@ typedef enum { ZPOOL_PROP_TNAME, ZPOOL_PROP_MAXDNODESIZE, ZPOOL_PROP_MULTIHOST, + ZPOOL_PROP_LOAD_GUID, ZPOOL_NUM_PROPS } zpool_prop_t; Modified: releng/12.2/sys/conf/files ============================================================================== --- releng/12.2/sys/conf/files Sat Sep 19 20:18:14 2020 (r365916) +++ releng/12.2/sys/conf/files Sat Sep 19 20:46:56 2020 (r365917) @@ -163,6 +163,7 @@ cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c o cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/bqueue.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/cityhash.c optional zfs compile-with "${ZFS_C}" +cddl/contrib/opensolaris/uts/common/fs/zfs/dataset_kstats.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf_stats.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c optional zfs compile-with "${ZFS_C}" Modified: releng/12.2/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg ============================================================================== --- releng/12.2/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg Sat Sep 19 20:18:14 2020 (r365916) +++ releng/12.2/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg Sat Sep 19 20:46:56 2020 (r365917) @@ -35,6 +35,7 @@ typeset -a properties=( "altroot" "health" "guid" + "load_guid" "version" "bootfs" "delegation" From owner-svn-src-all@freebsd.org Sat Sep 19 22:37:46 2020 Return-Path: Delivered-To: svn-src-all@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 8FAA73F1657; Sat, 19 Sep 2020 22:37:46 +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 4Bv5F63G7kz4bQh; Sat, 19 Sep 2020 22:37:46 +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 540B813656; Sat, 19 Sep 2020 22:37:46 +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 08JMbkWe048551; Sat, 19 Sep 2020 22:37:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JMbkjK048550; Sat, 19 Sep 2020 22:37:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202009192237.08JMbkjK048550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 19 Sep 2020 22:37:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365918 - 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: 365918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 22:37:46 -0000 Author: hselasky Date: Sat Sep 19 22:37:45 2020 New Revision: 365918 URL: https://svnweb.freebsd.org/changeset/base/365918 Log: Fix for use of the XHCI driver on Cortex-A72 by adding a missing cache flush operation before writing to the XHCI_ERSTBA_LO/HI register(s). PR: 237666 Discussed with: Mark Millard MFC after: 1 week Sponsored by: Mellanox Technologies // Nvidia Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Sat Sep 19 20:46:56 2020 (r365917) +++ head/sys/dev/usb/controller/xhci.c Sat Sep 19 22:37:45 2020 (r365918) @@ -432,6 +432,19 @@ xhci_start_controller(struct xhci_softc *sc) phwr->hwr_ring_seg[0].qwEvrsTablePtr = htole64(addr); phwr->hwr_ring_seg[0].dwEvrsTableSize = htole32(XHCI_MAX_EVENTS); + /* + * PR 237666: + * + * According to the XHCI specification, the XWRITE4's to + * XHCI_ERSTBA_LO and _HI lead to the XHCI to copy the + * qwEvrsTablePtr and dwEvrsTableSize values above at that + * time, as the XHCI initializes its event ring support. This + * is before the event ring starts to pay attention to the + * RUN/STOP bit. Thus, make sure the values are observable to + * the XHCI before that point. + */ + usb_bus_mem_flush_all(&sc->sc_bus, &xhci_iterate_hw_softc); + DPRINTF("ERDP(0)=0x%016llx\n", (unsigned long long)addr); XWRITE4(sc, runt, XHCI_ERDP_LO(0), (uint32_t)addr); From owner-svn-src-all@freebsd.org Sat Sep 19 22:48:33 2020 Return-Path: Delivered-To: svn-src-all@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 3371C3F1A4C; Sat, 19 Sep 2020 22:48:33 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.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 4Bv5TY0V7Lz4bwr; Sat, 19 Sep 2020 22:48:33 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7FEA1361F; Sat, 19 Sep 2020 22:48:32 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08JMmWnM055042; Sat, 19 Sep 2020 22:48:32 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08JMmUfl055032; Sat, 19 Sep 2020 22:48:30 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202009192248.08JMmUfl055032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 19 Sep 2020 22:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365919 - in head: lib/libufs sbin/fsck_ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head: lib/libufs sbin/fsck_ffs X-SVN-Commit-Revision: 365919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 22:48:33 -0000 Author: mckusick Date: Sat Sep 19 22:48:30 2020 New Revision: 365919 URL: https://svnweb.freebsd.org/changeset/base/365919 Log: Update the libufs cgget() and cgput() interfaces to have a similar API to the sbget() and sbput() interfaces. Specifically they take a file descriptor pointer rather than the struct uufsd *disk pointer used by the libufs cgread() and cgwrite() interfaces. Update fsck_ffs to use these revised interfaces. No functional changes intended. Sponsored by: Netflix Modified: head/lib/libufs/cgread.3 head/lib/libufs/cgroup.c head/lib/libufs/getinode.3 head/lib/libufs/libufs.3 head/lib/libufs/libufs.h head/lib/libufs/sblock.c head/lib/libufs/sbread.3 head/sbin/fsck_ffs/fsutil.c head/sbin/fsck_ffs/gjournal.c head/sbin/fsck_ffs/suj.c Modified: head/lib/libufs/cgread.3 ============================================================================== --- head/lib/libufs/cgread.3 Sat Sep 19 22:37:45 2020 (r365918) +++ head/lib/libufs/cgread.3 Sat Sep 19 22:48:30 2020 (r365919) @@ -13,7 +13,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 19, 2018 +.Dd September 2, 2020 .Dt CGREAD 3 .Os .Sh NAME @@ -29,9 +29,9 @@ .In ufs/ffs/fs.h .In libufs.h .Ft int -.Fn cgget "struct uufsd *disk" "int cg" "struct cg *cgp" +.Fn cgget "int devfd" "struct fs *fs" "int cg" "struct cg *cgp" .Ft int -.Fn cgput "struct uufsd *disk" "struct cg *cgp" +.Fn cgput "int devfd" "struct fs *fs" "struct cg *cgp" .Ft int .Fn cgread "struct uufsd *disk" .Ft int @@ -64,7 +64,11 @@ function reads the cylinder group specified by .Fa cg into the buffer pointed to by .Fa cgp -from the disk referenced by the user-land UFS-disk structure. +from the filesystem described by the +.Fa fs +superblock using the +.Fa devfd +file descriptor that references the filesystem disk. The .Fn cgget function is the only cylinder group read function that is safe to use @@ -74,7 +78,11 @@ The .Fn cgput function writes the cylinder group specified by .Va cgp -to the disk referenced by the user-land UFS-disk structure. +to the filesystem described by the +.Fa fs +superblock using the +.Fa devfd +file descriptor that references the filesystem disk. The .Fn cgput function is the only cylinder group write function that is safe to use @@ -172,3 +180,4 @@ in .Fx 5.1 . .Sh AUTHORS .An Juli Mallett Aq Mt jmallett@FreeBSD.org +.An Marshall Kirk McKusick Aq Mt mckusick@FreeBSD.org Modified: head/lib/libufs/cgroup.c ============================================================================== --- head/lib/libufs/cgroup.c Sat Sep 19 22:37:45 2020 (r365918) +++ head/lib/libufs/cgroup.c Sat Sep 19 22:48:30 2020 (r365919) @@ -188,27 +188,56 @@ cgread(struct uufsd *disk) return (cgread1(disk, disk->d_ccg++)); } +/* Short read/write error messages from cgget()/cgput() */ +static const char *failmsg; + int cgread1(struct uufsd *disk, int c) { - if ((cgget(disk, c, &disk->d_cg)) == 0) + if (cgget(disk->d_fd, &disk->d_fs, c, &disk->d_cg) == 0) { + disk->d_lcg = c; return (1); + } + ERROR(disk, NULL); + if (failmsg != NULL) { + ERROR(disk, failmsg); + return (-1); + } + switch (errno) { + case EINTEGRITY: + ERROR(disk, "cylinder group checks failed"); + break; + case EIO: + ERROR(disk, "read error from block device"); + break; + default: + ERROR(disk, strerror(errno)); + break; + } return (-1); } int -cgget(struct uufsd *disk, int cg, struct cg *cgp) +cgget(int devfd, struct fs *fs, int cg, struct cg *cgp) { - struct fs *fs; uint32_t cghash, calchash; + size_t cnt; - fs = &disk->d_fs; - if (bread(disk, fsbtodb(fs, cgtod(fs, cg)), (void *)cgp, - fs->fs_cgsize) == -1) { - ERROR(disk, "unable to read cylinder group"); + failmsg = NULL; + if ((cnt = pread(devfd, cgp, fs->fs_cgsize, + fsbtodb(fs, cgtod(fs, cg)) * (fs->fs_fsize / fsbtodb(fs,1)))) < 0) return (-1); + if (cnt == 0) { + failmsg = "end of file from block device"; + errno = EIO; + return (-1); } + if (cnt != fs->fs_cgsize) { + failmsg = "short read from block device"; + errno = EIO; + return (-1); + } calchash = cgp->cg_ckhash; if ((fs->fs_metackhash & CK_CYLGRP) != 0) { cghash = cgp->cg_ckhash; @@ -218,11 +247,9 @@ cgget(struct uufsd *disk, int cg, struct cg *cgp) } if (cgp->cg_ckhash != calchash || !cg_chkmagic(cgp) || cgp->cg_cgx != cg) { - ERROR(disk, "cylinder group checks failed"); - errno = EIO; + errno = EINTEGRITY; return (-1); } - disk->d_lcg = cg; return (0); } @@ -230,7 +257,7 @@ int cgwrite(struct uufsd *disk) { - return (cgput(disk, &disk->d_cg)); + return (cgwrite1(disk, disk->d_cg.cg_cgx)); } int @@ -238,8 +265,24 @@ cgwrite1(struct uufsd *disk, int cg) { static char errmsg[BUFSIZ]; - if (cg == disk->d_cg.cg_cgx) - return (cgput(disk, &disk->d_cg)); + if (cg == disk->d_cg.cg_cgx) { + if (cgput(disk->d_fd, &disk->d_fs, &disk->d_cg) == 0) + return (0); + ERROR(disk, NULL); + if (failmsg != NULL) { + ERROR(disk, failmsg); + return (-1); + } + switch (errno) { + case EIO: + ERROR(disk, "unable to write cylinder group"); + break; + default: + ERROR(disk, strerror(errno)); + break; + } + return (-1); + } snprintf(errmsg, BUFSIZ, "Cylinder group %d in buffer does not match " "the cylinder group %d that cgwrite1 requested", disk->d_cg.cg_cgx, cg); @@ -249,19 +292,22 @@ cgwrite1(struct uufsd *disk, int cg) } int -cgput(struct uufsd *disk, struct cg *cgp) +cgput(int devfd, struct fs *fs, struct cg *cgp) { - struct fs *fs; + size_t cnt; - fs = &disk->d_fs; if ((fs->fs_metackhash & CK_CYLGRP) != 0) { cgp->cg_ckhash = 0; cgp->cg_ckhash = calculate_crc32c(~0L, (void *)cgp, fs->fs_cgsize); } - if (bwrite(disk, fsbtodb(fs, cgtod(fs, cgp->cg_cgx)), cgp, - fs->fs_cgsize) == -1) { - ERROR(disk, "unable to write cylinder group"); + failmsg = NULL; + if ((cnt = pwrite(devfd, cgp, fs->fs_cgsize, + fsbtodb(fs, cgtod(fs, cgp->cg_cgx)) * + (fs->fs_fsize / fsbtodb(fs,1)))) < 0) + return (-1); + if (cnt != fs->fs_cgsize) { + failmsg = "short write to block device"; return (-1); } return (0); Modified: head/lib/libufs/getinode.3 ============================================================================== --- head/lib/libufs/getinode.3 Sat Sep 19 22:37:45 2020 (r365918) +++ head/lib/libufs/getinode.3 Sat Sep 19 22:48:30 2020 (r365919) @@ -9,7 +9,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 10, 2018 +.Dd September 2, 2020 .Dt GETINODE 3 .Os .Sh NAME @@ -128,4 +128,4 @@ These functions first appeared as part of in .Fx 13.0 . .Sh AUTHORS -.An Marshall Kirk McKusick Aq Mt mckusick@freebsd.org +.An Marshall Kirk McKusick Aq Mt mckusick@FreeBSD.org Modified: head/lib/libufs/libufs.3 ============================================================================== --- head/lib/libufs/libufs.3 Sat Sep 19 22:37:45 2020 (r365918) +++ head/lib/libufs/libufs.3 Sat Sep 19 22:48:30 2020 (r365919) @@ -7,7 +7,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 26, 2018 +.Dd September 2, 2020 .Dt LIBUFS 3 .Os .Sh NAME @@ -80,6 +80,7 @@ library first appeared in .Fx 5.0 . .Sh AUTHORS .An Juli Mallett Aq Mt jmallett@FreeBSD.org +.An Marshall Kirk McKusick Aq Mt mckusick@FreeBSD.org .Pp .An -nosplit Additional design, feedback, and ideas were provided by Modified: head/lib/libufs/libufs.h ============================================================================== --- head/lib/libufs/libufs.h Sat Sep 19 22:37:45 2020 (r365918) +++ head/lib/libufs/libufs.h Sat Sep 19 22:48:30 2020 (r365919) @@ -136,8 +136,8 @@ int berase(struct uufsd *, ufs2_daddr_t, ufs2_daddr_t) ufs2_daddr_t cgballoc(struct uufsd *); int cgbfree(struct uufsd *, ufs2_daddr_t, long); ino_t cgialloc(struct uufsd *); -int cgget(struct uufsd *, int, struct cg *); -int cgput(struct uufsd *, struct cg *); +int cgget(int, struct fs *, int, struct cg *); +int cgput(int, struct fs *, struct cg *); int cgread(struct uufsd *); int cgread1(struct uufsd *, int); int cgwrite(struct uufsd *); Modified: head/lib/libufs/sblock.c ============================================================================== --- head/lib/libufs/sblock.c Sat Sep 19 22:37:45 2020 (r365918) +++ head/lib/libufs/sblock.c Sat Sep 19 22:48:30 2020 (r365919) @@ -186,7 +186,7 @@ sbput(int devfd, struct fs *fs, int numaltwrite) use_pwrite)) != 0) { fs->fs_sblockactualloc = savedactualloc; fs->fs_csp = savedcsp; - return (-1); + return (error); } } fs->fs_sblockactualloc = savedactualloc; Modified: head/lib/libufs/sbread.3 ============================================================================== --- head/lib/libufs/sbread.3 Sat Sep 19 22:37:45 2020 (r365918) +++ head/lib/libufs/sbread.3 Sat Sep 19 22:48:30 2020 (r365919) @@ -11,7 +11,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 19, 2018 +.Dd September 2, 2020 .Dt SBREAD 3 .Os .Sh NAME @@ -145,3 +145,4 @@ in .Fx 5.0 . .Sh AUTHORS .An Juli Mallett Aq Mt jmallett@FreeBSD.org +.An Marshall Kirk McKusick Aq Mt mckusick@FreeBSD.org Modified: head/sbin/fsck_ffs/fsutil.c ============================================================================== --- head/sbin/fsck_ffs/fsutil.c Sat Sep 19 22:37:45 2020 (r365918) +++ head/sbin/fsck_ffs/fsutil.c Sat Sep 19 22:48:30 2020 (r365919) @@ -217,6 +217,9 @@ bufinit(void) /* * Manage cylinder group buffers. + * + * Use getblk() here rather than cgget() because the cylinder group + * may be corrupted but we want it anyway so we can fix it. */ static struct bufarea *cgbufs; /* header for cylinder group cache */ static int flushtries; /* number of tries to reclaim memory */ @@ -370,7 +373,7 @@ flush(int fd, struct bufarea *bp) fsmodified = 1; break; case BT_CYLGRP: - if (cgput(&disk, bp->b_un.b_cg) == 0) + if (cgput(fswritefd, &sblock, bp->b_un.b_cg) == 0) fsmodified = 1; break; default: Modified: head/sbin/fsck_ffs/gjournal.c ============================================================================== --- head/sbin/fsck_ffs/gjournal.c Sat Sep 19 22:37:45 2020 (r365918) +++ head/sbin/fsck_ffs/gjournal.c Sat Sep 19 22:48:30 2020 (r365919) @@ -133,7 +133,7 @@ getcg(int cg) if (cgc == NULL) err(1, "malloc(%zu)", sizeof(*cgc)); } - if (cgget(diskp, cg, &cgc->cgc_cg) == -1) + if (cgget(fsreadfd, fs, cg, &cgc->cgc_cg) == -1) err(1, "cgget(%d)", cg); cgc->cgc_busy = 0; cgc->cgc_dirty = 0; @@ -189,7 +189,7 @@ putcgs(void) LIST_REMOVE(cgc, cgc_next); ncgs--; if (cgc->cgc_dirty) { - if (cgput(diskp, &cgc->cgc_cg) == -1) + if (cgput(fswritefd, fs, &cgc->cgc_cg) == -1) err(1, "cgput(%d)", cgc->cgc_cg.cg_cgx); //printf("%s: Wrote cg=%d\n", __func__, // cgc->cgc_cg.cg_cgx); Modified: head/sbin/fsck_ffs/suj.c ============================================================================== --- head/sbin/fsck_ffs/suj.c Sat Sep 19 22:37:45 2020 (r365918) +++ head/sbin/fsck_ffs/suj.c Sat Sep 19 22:48:30 2020 (r365919) @@ -1912,7 +1912,7 @@ cg_write(struct suj_cg *sc) * before writing the block. */ fs->fs_cs(fs, sc->sc_cgx) = cgp->cg_cs; - if (cgput(&disk, cgp) == -1) + if (cgput(fswritefd, fs, cgp) == -1) err_suj("Unable to write cylinder group %d\n", sc->sc_cgx); } From owner-svn-src-all@freebsd.org Sat Sep 19 23:18:58 2020 Return-Path: Delivered-To: svn-src-all@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 B79623F213E; Sat, 19 Sep 2020 23:18:58 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670079.outbound.protection.outlook.com [40.107.67.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bv68f2kwpz4dNK; Sat, 19 Sep 2020 23:18:58 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NAUmtlwAcApFTtDUANR8/A2+oBlAbd243S3Q4daXKs7o9Nao2mdsL6rSg0arRoVPSKaRL+QZKv2fppq6IscGUZ6j57xwacjniv2eZ4hJy1Ys8amZ4qyhrXEU8xcYYZZikySMj0UcounrG1xPK0WFXPMxL+F4sO344BFB2GX9kmEjp829D6oAEjuwdYi+KdqHBUnKeyTSWbbByyPII/jNCJviGmkCEW/bBz3Bn82PVPuJW4O56Qvtio5FjYWdyRY0E68Z0+MDR77SZGzXVwSClHoeZgryleDS5joF3h1Fyuljo5WTR3sNtyVl/bcaiq0VGL7BM/iCRbPv1ZPVlKy20Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2YLSUg46x0bcKcjVXjgwq0V8KzfTLzN/NQ/K/Ft4Pqo=; b=AV20UyDZerfaLCfhK1nJ6ytK2WoMtYvUxDBaWDvAf54EWgeYDoajtnDVJeHPcDCMIv63P8yT+HZgPNm8boOwf9nqH5RbX1W4INKdBvpVwIgQgAanf0CGFI7vUdiAl35A9ECq3CD7AzkzpXxSUxTi06FbcZQ+0NXzXSdlWSUqksp8vNT60XsZdGi+m9lYEzmpBknxl2TkZRQClD4BapOHSA9upWUftCNKxiUI52qf/uEMlRrTGyfChxyPIj+HbvCEexNhSxgD4bbKUnajiaBepzgRv78LxOSsFGzDdhXdglF8gNu62JcKPw7xZCbIUNa0sPEX1Yckbjhz+sMZ8oVWmA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=uoguelph.ca; dmarc=pass action=none header.from=uoguelph.ca; dkim=pass header.d=uoguelph.ca; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uoguelph.ca; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2YLSUg46x0bcKcjVXjgwq0V8KzfTLzN/NQ/K/Ft4Pqo=; b=ev29qWRAJFvzEJjHOvgTDaNm4Fll1STPE9oUI4K+M/lob1Kif23pYdOdJmZUoo7aVpmrAc9Zfgnr+TgIz/Gb9u/TJHmwMfrD3pA6uuZgcv03J1Y0pU3pGU50KsHgIvWphnOTDWb5sHm3BDv4TuoMyHMxde0LiLGwLNTwhjIwiLqFLZrFLja9sYyOTvMmLc28isi69tfbhiRdp/21Rwxe16gH0MgvaUwLYvIs0PwVutO2cIJmBXQelQ2zESwiP2kW7GVf1QWRF1+qfLs4/aa2M6geALbtwH3Qf3Y8314eEyFB0+NZmYTyfyYV476wPTtsG9WOk2lwqwOMpGAzN2VSdQ== Received: from YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:24::27) by YTBPR01MB2895.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:17::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.11; Sat, 19 Sep 2020 23:18:56 +0000 Received: from YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM ([fe80::687f:d85a:a0a3:bd20]) by YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM ([fe80::687f:d85a:a0a3:bd20%6]) with mapi id 15.20.3391.014; Sat, 19 Sep 2020 23:18:56 +0000 From: Rick Macklem To: Alan Somers CC: Konstantin Belousov , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r365643 - head/bin/cp Thread-Topic: svn commit: r365643 - head/bin/cp Thread-Index: AQHWiH0X8pBOJ1Dd2EKX5zw9++b1Talj+C+AgAABEqiADFMkAIAAVZ6L Date: Sat, 19 Sep 2020 23:18:56 +0000 Message-ID: References: <202009112049.08BKnavL032212@repo.freebsd.org> <20200911214327.GY94807@kib.kiev.ua> , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 57d7a48d-7828-413f-0a2c-08d85cf261b5 x-ms-traffictypediagnostic: YTBPR01MB2895: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: YPB7kw8QL9woeCq4x7tf9cj1y4WNLMxyjB5U99/QDsrsug91Zht8J3a/vCughKGlzxm9GaWG1onBAzHCTp8ps2iDJ6kpTHieMythjEIl1b5K4pAwtKAUBK5t+TRCVPQOWe3EeFrVXDB51jL+1XZUn8x3eCw8jn42aVT5YRRuKvcCDVPnekf+d8aJLSM4NXdfJg+YJ4ppozrmZQXebCJchk5Gs3XBVVrF2YEzHH/9K+4VT7KV+pFcl84fappdvAZHOCX2uhLdcVrssjteXUL1Q1DThNr4anJMqD7ECBnygX54KpXXbRGPtQq+8uLYQg1UNYzmLLYDIPORgUu264NAxTTw9S2gMOuc4nlPjCN8G5+mYROotbmoHCV+YwYEtkZpOVw/kgIJAOfawyQG8Rc5tQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(39850400004)(396003)(366004)(136003)(346002)(376002)(54906003)(786003)(316002)(7696005)(86362001)(91956017)(8676002)(33656002)(76116006)(55016002)(8936002)(2906002)(9686003)(52536014)(5660300002)(186003)(966005)(478600001)(66946007)(6916009)(6506007)(64756008)(66446008)(4326008)(66556008)(71200400001)(66476007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: PbWzf9n7O1YJc5CxfsVLEYOHtJaxO4hSVg9m61CSimx7HFNlD9b9b4Z0UZfybBZk38VnRmCr7qj6PuaUA7d44Jk/lkZDeHDK5ReF6dbCYIy+nQQnf2kQii8yvDVZnQUcewH5m2xH8AYUse8TYEVa3xypvn4+MgJT9pCBse8bmXbBf6RX7kHk8Qj7uLrl2rvlqfLIirAxuNTiXmOnwtPH0emtAV4AZ6Xf4RJp6v6eTOnZahmO8MrXwjlkks3m8kM0sDtne23yY91c3zKASMMzf8XbeFzDrmGTZ0b2T185+K7yy2GYi+YJXuct+JYpsNi5zW/S4Fv8XZE5BAt11x5PDce9kjbdNCgFLeQtI4fnugtbGzZzw9loN0tmu3+mXgDamcbJoLHTdxJ+KC3PdEpiGisWp+HbDugwEllD9wAO9VwCItm7uO/JCFhN4W1+Psdnn3lVDQCFPKQhFpSmbKNxWPWphJPkyuQblkelHjDZ+aqZlcI+O+QY+h197fgInUqY3alj30VJCA3T/RhHi/VFgAErZ2fnSUCFtDoWDyMUEn4WcpqzaIG+7vFEpRF4iYDDBEVX9uTlOPgvJYd8obA+YMZLe3c8QBqP0+QHENYn0AgCPNzaakh6zotG1F+0jbzuZPxc56tdGsTOPbsff3/PyNzGoUuXpJKLTzEUhV91xPVmI+rX9TRLnG9aAEQU+SPbFGk+b0EAGUWoW16nBZaSRw== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 57d7a48d-7828-413f-0a2c-08d85cf261b5 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Sep 2020 23:18:56.2731 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: mpwUkpCDaAx4aZ4XzzoCAQjUjp0Ew96x0dY1Oj8/yOEyk5uFiVz0RhUOIvKeV9qfGuGvE8KNFoOcjIEp+E0vww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTBPR01MB2895 X-Rspamd-Queue-Id: 4Bv68f2kwpz4dNK X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8075, ipnet:40.104.0.0/14, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 23:18:58 -0000 Alan Somers wrote:=0A= >On Fri, Sep 11, 2020 at 3:52 PM Rick Macklem > wrote:=0A= >Konstantin Belousov wrote:=0A= >>On Fri, Sep 11, 2020 at 08:49:36PM +0000, Alan Somers wrote:=0A= >>> Author: asomers=0A= >>> Date: Fri Sep 11 20:49:36 2020=0A= >>> New Revision: 365643=0A= >>> URL: https://svnweb.freebsd.org/changeset/base/365643=0A= >>>=0A= >>> Log:=0A= >>> cp: fall back to read/write if copy_file_range fails=0A= >>>=0A= >>> Even though copy_file_range has a file-system agnostic version, it st= ill=0A= >>> fails on devfs (perhaps because the file descriptor is non-seekable?)= In=0A= >>> that case, fallback to old-fashioned read/write. Fixes=0A= >>> "cp /dev/null /tmp/null"=0A= >>=0A= >>Devices are seekable.=0A= >>=0A= >>The reason for EINVAL is that vn_copy_file_range() checks that both in an= d out=0A= >>vnodes are VREG. For devfs, they are VCHR.=0A= >=0A= >I coded the syscall to the Linux man page, which states that EINVAL is ret= urned=0A= >if either fd does not refer to a regular file.=0A= >Having said that, I do not recall testing the VCHR case under Linux. (ie. = It might=0A= >actually work and the man page turns out to be incorrect?)=0A= >=0A= >I will test this case under Linux when I get home next week, rick=0A= I'll admit I haven't tested this in Linux to see if they do return EINVAL.= =0A= =0A= >Since there's no standard, I think it's fine for us to support devfs if po= ssible.=0A= 1 - I think this is a good question for a mailing list like freebsd-current= @.=0A= 2 - I see Linux as the de-facto standard these days and consider POSIX no= =0A= longer relevant, but that's just mho.=0A= 3 - For NFSv4.2, the Copy operation will fail for non-regular files, so if = you=0A= do this, you will need to handle the fall-back to using the generic c= ode.=0A= (Should be doable, but you need to be aware of this case.)=0A= =0A= Having said the above, it is up to the "collective" and not me and, as such= ,=0A= I suggest #1, to see whether others think doing a non-Linux compatible=0A= version makes sense for FreeBSD?=0A= =0A= rick=0A= From owner-svn-src-all@freebsd.org Sat Sep 19 23:27:23 2020 Return-Path: Delivered-To: svn-src-all@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 4B72D3F239C; Sat, 19 Sep 2020 23:27:23 +0000 (UTC) (envelope-from kevans@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 4Bv6LM112zz4dKb; Sat, 19 Sep 2020 23:27:23 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (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 009831F664; Sat, 19 Sep 2020 23:27:22 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f170.google.com with SMTP id 16so10989226qkf.4; Sat, 19 Sep 2020 16:27:22 -0700 (PDT) X-Gm-Message-State: AOAM531P5RhUlDAQK/kwNKCZzy1tg2uTQBpSI3q791P60PaeAjKVWJZQ lWEIUXyk6Mpeyiz2iC+OfQJMVL/mc+Y7aIrQqZk= X-Google-Smtp-Source: ABdhPJw3r4I/s8GNuzglb+szrG+5yKnjDETEGhT/Zmh3/fgOLAqbc5c4owk8NW9lcsOkQaUUqBYIfkJ5LKFSY98+su8= X-Received: by 2002:a05:620a:136e:: with SMTP id d14mr19348764qkl.430.1600558042387; Sat, 19 Sep 2020 16:27:22 -0700 (PDT) MIME-Version: 1.0 References: <202009112049.08BKnavL032212@repo.freebsd.org> <20200911214327.GY94807@kib.kiev.ua> In-Reply-To: From: Kyle Evans Date: Sat, 19 Sep 2020 18:27:11 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r365643 - head/bin/cp To: Rick Macklem Cc: Alan Somers , Konstantin Belousov , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 23:27:23 -0000 On Sat, Sep 19, 2020 at 6:19 PM Rick Macklem wrote: > > Alan Somers wrote: > >On Fri, Sep 11, 2020 at 3:52 PM Rick Macklem > wrote: > >Konstantin Belousov wrote: > >>On Fri, Sep 11, 2020 at 08:49:36PM +0000, Alan Somers wrote: > >>> Author: asomers > >>> Date: Fri Sep 11 20:49:36 2020 > >>> New Revision: 365643 > >>> URL: https://svnweb.freebsd.org/changeset/base/365643 > >>> > >>> Log: > >>> cp: fall back to read/write if copy_file_range fails > >>> > >>> Even though copy_file_range has a file-system agnostic version, it still > >>> fails on devfs (perhaps because the file descriptor is non-seekable?) In > >>> that case, fallback to old-fashioned read/write. Fixes > >>> "cp /dev/null /tmp/null" > >> > >>Devices are seekable. > >> > >>The reason for EINVAL is that vn_copy_file_range() checks that both in and out > >>vnodes are VREG. For devfs, they are VCHR. > > > >I coded the syscall to the Linux man page, which states that EINVAL is returned > >if either fd does not refer to a regular file. > >Having said that, I do not recall testing the VCHR case under Linux. (ie. It might > >actually work and the man page turns out to be incorrect?) > > > >I will test this case under Linux when I get home next week, rick > I'll admit I haven't tested this in Linux to see if they do return EINVAL. > > >Since there's no standard, I think it's fine for us to support devfs if possible. > 1 - I think this is a good question for a mailing list like freebsd-current@. > 2 - I see Linux as the de-facto standard these days and consider POSIX no > longer relevant, but that's just mho. > 3 - For NFSv4.2, the Copy operation will fail for non-regular files, so if you > do this, you will need to handle the fall-back to using the generic code. > (Should be doable, but you need to be aware of this case.) > > Having said the above, it is up to the "collective" and not me and, as such, > I suggest #1, to see whether others think doing a non-Linux compatible > version makes sense for FreeBSD? > Testing on Debian I seem to get back an EINVAL, but I think it's maybe a little surprising: EXDEV The files referred to by file_in and file_out are not on the same mounted filesystem. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Sat Sep 19 23:32:47 2020 Return-Path: Delivered-To: svn-src-all@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 CE5783F2755; Sat, 19 Sep 2020 23:32:47 +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 4Bv6SZ6mG9z4fH1; Sat, 19 Sep 2020 23:32:46 +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 08JNWWrG008110 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 20 Sep 2020 02:32:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 08JNWWrG008110 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 08JNWWGo008109; Sun, 20 Sep 2020 02:32:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 20 Sep 2020 02:32:32 +0300 From: Konstantin Belousov To: Rick Macklem Cc: Alan Somers , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r365643 - head/bin/cp Message-ID: <20200919233232.GC94807@kib.kiev.ua> References: <202009112049.08BKnavL032212@repo.freebsd.org> <20200911214327.GY94807@kib.kiev.ua> 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: 4Bv6SZ6mG9z4fH1 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 [-0.67 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-0.16)[-0.160]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_MEDIUM(-0.47)[-0.473]; R_SPF_SOFTFAIL(0.00)[~all:c]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.04)[-0.042]; 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-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 23:32:47 -0000 On Sat, Sep 19, 2020 at 11:18:56PM +0000, Rick Macklem wrote: > Alan Somers wrote: > >On Fri, Sep 11, 2020 at 3:52 PM Rick Macklem > wrote: > >Konstantin Belousov wrote: > >>On Fri, Sep 11, 2020 at 08:49:36PM +0000, Alan Somers wrote: > >>> Author: asomers > >>> Date: Fri Sep 11 20:49:36 2020 > >>> New Revision: 365643 > >>> URL: https://svnweb.freebsd.org/changeset/base/365643 > >>> > >>> Log: > >>> cp: fall back to read/write if copy_file_range fails > >>> > >>> Even though copy_file_range has a file-system agnostic version, it still > >>> fails on devfs (perhaps because the file descriptor is non-seekable?) In > >>> that case, fallback to old-fashioned read/write. Fixes > >>> "cp /dev/null /tmp/null" > >> > >>Devices are seekable. > >> > >>The reason for EINVAL is that vn_copy_file_range() checks that both in and out > >>vnodes are VREG. For devfs, they are VCHR. > > > >I coded the syscall to the Linux man page, which states that EINVAL is returned > >if either fd does not refer to a regular file. > >Having said that, I do not recall testing the VCHR case under Linux. (ie. It might > >actually work and the man page turns out to be incorrect?) > > > >I will test this case under Linux when I get home next week, rick > I'll admit I haven't tested this in Linux to see if they do return EINVAL. > > >Since there's no standard, I think it's fine for us to support devfs if possible. > 1 - I think this is a good question for a mailing list like freebsd-current@. > 2 - I see Linux as the de-facto standard these days and consider POSIX no > longer relevant, but that's just mho. > 3 - For NFSv4.2, the Copy operation will fail for non-regular files, so if you > do this, you will need to handle the fall-back to using the generic code. > (Should be doable, but you need to be aware of this case.) > > Having said the above, it is up to the "collective" and not me and, as such, > I suggest #1, to see whether others think doing a non-Linux compatible > version makes sense for FreeBSD? I believe that allowing devfs nodes for vn_copy_file() is not very good idea. For /dev/null driver returns EOF, but think about real devices or even better, /dev/zero that never EOF its output. Is vn_copy_file() interruptible ? I think not. So if insane range is specified, we have unstoppable copier that fills the disk (at best). From owner-svn-src-all@freebsd.org Sat Sep 19 23:58:13 2020 Return-Path: Delivered-To: svn-src-all@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 EE6993F2F24; Sat, 19 Sep 2020 23:58:13 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-to1can01on062a.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5d::62a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bv71x49WMz3S5v; Sat, 19 Sep 2020 23:58:13 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dq+2vQGUiiWL2tHpsEcumTrZnJSHxS48GzsSKkJWS8yBXNwq+4C+vOTmRBiKs4xHTTdvk1EjOp3OC6XiW8SmvtJO47xroKeuLQZ/LwvT3y/7o8UNwfjY17/+Dv+qTSNuCdljozFmo7YR47oO5KuWlbWRBsVxim8d2nUJiZMlroQ5nrujWkKn1DjRoqpYXK15EpTxpHdYqgz7kYRJTvYhwCBPFlqXYOD9T9CaD/AxImr4ddPat5plXiTtNuudFntl7778kOByE8eS6jTUFRGHNxqkJbeUPQ5A54ZxSiu8Dp2RStZb4zY7w/MIyf3kd/ekVDIMwZg6N1WfoebQlbgqCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AKYPM7oG+YglRO8nQ2sbS4+ab5WfgFuml0X/71MGszc=; b=bagxYI5SFt5n2qJIGa3Con1py5yqBZGNYTDA4Hiy+Ckwgrg3zwmf4PdJJbwD2v6GAtRB9w6iVuDwwgLAlm246PI2n3Ta1SfiAEdl95l26VOFG3j8/tcdRnly7ph3N9gi7DtmgTC7yOVcTypHhHFwbixl+5igjT/CZC1e2MULsBKKJ+1RiFvfxWqd7qkXM0UCdKzq8phPNcby0gHAsgrkndhE7PD308kJH88DdXO7MFSZeJrKmZnA65fpuOTFtvVwYZXWvDjizafDS6GOWvA50U+AO1Px5X4Ou4z4vUjPljR+l6WP5q04XPWCHaDHbQs/Bt+6+d3nypQeUJOveYm+dA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=uoguelph.ca; dmarc=pass action=none header.from=uoguelph.ca; dkim=pass header.d=uoguelph.ca; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uoguelph.ca; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AKYPM7oG+YglRO8nQ2sbS4+ab5WfgFuml0X/71MGszc=; b=tVaiIb2mR/xqHxzK7KBVdHINWSB9cSANSnQzdHHEyVY2NLRcWFJTvKHjSQykQKNy9gc7mdAK5ObpAtdQadaSXj4lVFqHuo2IN13GrIErtq6urr60HlPc0XzxK1e6Ldc7UZlxK6ziM9C+Hm8ENul+B3AHU7Leoob3k5T3+2lrXaExYtEkpzoSzV3gw63q3PldUl91WgzgUhZlxRCGFFzj2pug/Np37QqvOofOJXrrW8becI+BKgXksUDYVUdJm6mMg1ghYMnlEQWVmSazU+qZ3yRt1eO3CPZUE7YjGXAyJ32KJKMY9cr85NEO17V8qJ6zYEUv3hhf8r4FOOG17ebbxw== Received: from YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:24::27) by YT1PR01MB2331.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.11; Sat, 19 Sep 2020 23:58:11 +0000 Received: from YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM ([fe80::687f:d85a:a0a3:bd20]) by YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM ([fe80::687f:d85a:a0a3:bd20%6]) with mapi id 15.20.3391.014; Sat, 19 Sep 2020 23:58:11 +0000 From: Rick Macklem To: Kyle Evans CC: Alan Somers , Konstantin Belousov , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r365643 - head/bin/cp Thread-Topic: svn commit: r365643 - head/bin/cp Thread-Index: AQHWiH0X8pBOJ1Dd2EKX5zw9++b1Talj+C+AgAABEqiADFMkAIAAVZ6LgAAFzoCAAAXwBw== Date: Sat, 19 Sep 2020 23:58:11 +0000 Message-ID: References: <202009112049.08BKnavL032212@repo.freebsd.org> <20200911214327.GY94807@kib.kiev.ua> , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5e4e86ef-daca-49d4-02c2-08d85cf7dd49 x-ms-traffictypediagnostic: YT1PR01MB2331: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: pgG+bvcZX1eiXX0dyPAwzACFToKVSTlBKcI2WeBigyp0aSFK0J9xcfOrTZem0wzoVA1P9Q8Jg68nYX00anWkoQ0xZLJjJgNoSC2XmpneH+Fxz7E/uYo49cnBDoRmTQxN4ZF7j481E77jAWjAhJymWkc2uHIqYZRjipzYwHCydZYtSvRo5bB/TIWfDKWv+FeP4K4997pc3xwnx0S7eXeIuVuSLynTMeTiZLrs7I2Eg2u3Iwf59mucWzBHN17/rc905r/KKo0wV2eynn8RAvLjA0TPtjit9awanQ0vVdb03GG5ktCo1kPnDH6MbfVLYpCAZL5IPQaSPPNefp0mbV7V982+9tYa3MVqjPh+xRjPmvPp9lpmKYfTisWIw5FMyMLg x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(39850400004)(136003)(376002)(396003)(346002)(366004)(5660300002)(478600001)(33656002)(76116006)(66946007)(7696005)(66476007)(64756008)(4326008)(55016002)(8936002)(66556008)(66446008)(91956017)(52536014)(54906003)(8676002)(2906002)(86362001)(6916009)(71200400001)(9686003)(786003)(6506007)(186003)(316002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: U1i5EU+7Hc2jiFiGooh8gsffRVF/scjVN0POWFJpq58SDm+mzCrP6ONTtSV3zsWzyTbhVhFEC1IsZlm9tAgnjMwDrcKCAnGR+tZUWJ9pp3z6pJbZamN2G6uJt6CKH3uywakYk0BXK43PdZJeGdSmQbIwBUejWs01ONvlLAfqsjJXfUoCNVxhPl4I/Tc+CMoI7xiwMm3Zhs0NqTQxCLIpg+31uqUtrAuJKjbvY7LXCPQHham5ZJk6UGS8pWNPoTXyRrDGvwLNBhS5ELpX5YOCO+rxO6FMPBafV144LYcRBT9D/5NbRHxK4fx5bSKWvCyIxSyKZ0HIzP0li/b3HFuyjkvcTBbMBGTJ3R9DY3vCk3Jcl4lUXf57eD6amKhWjgooJsPoY1P0EWHlH57npXhEKV11HBffms4T/FHWqIKXpHEbgRfsCBMIQjTI6eoypGadauC9cEdkbYoyrPJJ5X6KaEFT6v281ovhjlbcJhAvq8KlCzQD+kyNt0psneOqxyzAAOjPc6OiPtxXKl83OXtYpFcPjCpHauAWVBRyymGlP5h0YtjeRCDAYHd99pl7tbKUrj5B1LNMzoMnwy8ODd7uO5RVwfUHetV7yXi+oG7dbO5IRIj9UjSPuVcubCH1HkRBy4myGvvSrou2YS5K0gaJ9hXe3Tn3j3Zk1rb3zz1OoDe/qOEUxU7SfGFChx0OTkKU2uBed9U9nCs4Nc6FexDwnA== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 5e4e86ef-daca-49d4-02c2-08d85cf7dd49 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Sep 2020 23:58:11.1192 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: qqYpe9J0O70n0/dDPgjq+Jwaz8mobiECuGA5WsUdgnCpC4SM39YjUSnQ3t9Ckz+ziVldDDxvT6XXTbnz5cyM6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YT1PR01MB2331 X-Rspamd-Queue-Id: 4Bv71x49WMz3S5v X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8075, ipnet:2a01:111:f000::/36, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2020 23:58:14 -0000 Kyle Evans wrote:=0A= [stuff snipped]=0A= >Testing on Debian I seem to get back an EINVAL, but I think it's maybe=0A= >a little surprising:=0A= >=0A= > EXDEV The files referred to by file_in and file_out are=0A= > not on the same mounted filesystem.=0A= Well, as Alan noted, Linux is not a standard and they've also changed the= =0A= semantics of copy_file_range(2) significantly since it was introduced.=0A= Here's what the most current man page I have says:=0A= EXDEV The files referred to by fd_in and fd_out are not on the same= =0A= mounted filesystem (pre Linux 5.3).=0A= Note the change as of Linux5.3. They also initially did not allow it to wor= k=0A= across multiple file systems and then changed to allowing that.=0A= --> All I could do was try and be compatible with the most up to date=0A= man page I had, which does also state:=0A= EINVAL Either fd_in or fd_out is not a regular file.=0A= =0A= So, I guess the surprising part for me is how quickly (and wthout concerns= =0A= w.r.t. backwards compatibility) the Linux kernel folk change things.;-)=0A= =0A= All part of the fun, rick=0A= =0A= Thanks,=0A= =0A= Kyle Evans=0A=