From owner-svn-src-all@freebsd.org Sun May 17 01:46: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 ED80B13917A; Sun, 17 May 2020 01:46:00 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PlNS60Lpz3VGP; Sun, 17 May 2020 01:46:00 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4979903D; Sun, 17 May 2020 01:46:00 +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 04H1k0Qq073802; Sun, 17 May 2020 01:46:00 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04H1k0xR073801; Sun, 17 May 2020 01:46:00 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005170146.04H1k0xR073801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 17 May 2020 01:46: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: r361120 - stable/12/cddl/usr.sbin/zfsd X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/cddl/usr.sbin/zfsd X-SVN-Commit-Revision: 361120 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, 17 May 2020 01:46:01 -0000 Author: asomers Date: Sun May 17 01:46:00 2020 New Revision: 361120 URL: https://svnweb.freebsd.org/changeset/base/361120 Log: MFC r360077: zfsd.8: fix orphan .Xr Though ZFS is a kernel module, it has no man page in section 4. Reported by: phk Modified: stable/12/cddl/usr.sbin/zfsd/zfsd.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/usr.sbin/zfsd/zfsd.8 ============================================================================== --- stable/12/cddl/usr.sbin/zfsd/zfsd.8 Sat May 16 23:24:39 2020 (r361119) +++ stable/12/cddl/usr.sbin/zfsd/zfsd.8 Sun May 17 01:46:00 2020 (r361120) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 26, 2016 +.Dd April 18, 2020 .Dt ZFSD 8 .Os .Sh NAME @@ -96,8 +96,7 @@ If a leaf vdev generates more than 50 I/O errors in a .Nm will mark that vdev as .Em FAULTED . -.Xr zfs 4 -will no longer issue any I/Os to it. +ZFS will no longer issue any I/Os to it. .Nm will activate a hotspare if one is available. .It Checksum errors @@ -106,8 +105,7 @@ period, then .Nm will mark that vdev as .Em DEGRADED . -.Xr zfs 4 -will still use it, but zfsd will activate a spare anyway. +ZFS will still use it, but zfsd will activate a spare anyway. .It Spare addition If the system administrator adds a hotspare to a pool that is already degraded, .Nm @@ -138,7 +136,6 @@ then reads them back in when next it starts up. .El .Sh SEE ALSO .Xr devctl 4 , -.Xr zfs 4 , .Xr zpool 8 .Sh HISTORY .Nm From owner-svn-src-all@freebsd.org Sun May 17 01:48: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 3DA41139663; Sun, 17 May 2020 01:48:13 +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 49PlR10m5Wz3VHH; Sun, 17 May 2020 01:48:13 +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 0FA858E7C; Sun, 17 May 2020 01:48:13 +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 04H1mCPr073970; Sun, 17 May 2020 01:48:12 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04H1mCov073968; Sun, 17 May 2020 01:48:12 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005170148.04H1mCov073968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 17 May 2020 01:48: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: r361121 - in stable/12: sbin/bectl share/man/man8 X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/12: sbin/bectl share/man/man8 X-SVN-Commit-Revision: 361121 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, 17 May 2020 01:48:13 -0000 Author: asomers Date: Sun May 17 01:48:12 2020 New Revision: 361121 URL: https://svnweb.freebsd.org/changeset/base/361121 Log: MFC r360078, r360086 r360078: bectl.8, beinstall.sh.8: fix man page section of beinstall.sh Reported by: phk r360086: bectl.8: correctly sort SEE ALSO section after 360078 Reported by: yuripv MFC with: 360078 Modified: stable/12/sbin/bectl/bectl.8 stable/12/share/man/man8/beinstall.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/bectl/bectl.8 ============================================================================== --- stable/12/sbin/bectl/bectl.8 Sun May 17 01:46:00 2020 (r361120) +++ stable/12/sbin/bectl/bectl.8 Sun May 17 01:48:12 2020 (r361121) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 14, 2019 +.Dd April 18, 2020 .Dt BECTL 8 .Os .Sh NAME @@ -343,8 +343,8 @@ is specified. To fill in with jail upgrade example when behavior is firm. .El .Sh SEE ALSO -.Xr beinstall.sh 1 , .Xr libbe 3 , +.Xr beinstall.sh 8 , .Xr jail 8 , .Xr zfs 8 , .Xr zpool 8 Modified: stable/12/share/man/man8/beinstall.8 ============================================================================== --- stable/12/share/man/man8/beinstall.8 Sun May 17 01:46:00 2020 (r361120) +++ stable/12/share/man/man8/beinstall.8 Sun May 17 01:48:12 2020 (r361121) @@ -25,8 +25,8 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd August 20, 2018 -.Dt BEINSTALL.SH 1 +.Dd April 18, 2020 +.Dt BEINSTALL.SH 8 .Os .Sh NAME .Nm beinstall.sh From owner-svn-src-all@freebsd.org Sun May 17 01:50: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 04ADA1396BB; Sun, 17 May 2020 01:50:05 +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 49PlT86LJzz3VRF; Sun, 17 May 2020 01:50:04 +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 D3F018E7D; Sun, 17 May 2020 01:50:04 +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 04H1o4rA074148; Sun, 17 May 2020 01:50:04 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04H1o4at074147; Sun, 17 May 2020 01:50:04 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005170150.04H1o4at074147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 17 May 2020 01:50: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: r361122 - stable/12/lib/libcasper/services/cap_dns X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/lib/libcasper/services/cap_dns X-SVN-Commit-Revision: 361122 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, 17 May 2020 01:50:05 -0000 Author: asomers Date: Sun May 17 01:50:04 2020 New Revision: 361122 URL: https://svnweb.freebsd.org/changeset/base/361122 Log: MFC r360079: cap_dns.3: fix some orphan .Xr links Reported by: phk Modified: stable/12/lib/libcasper/services/cap_dns/cap_dns.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libcasper/services/cap_dns/cap_dns.3 ============================================================================== --- stable/12/lib/libcasper/services/cap_dns/cap_dns.3 Sun May 17 01:48:12 2020 (r361121) +++ stable/12/lib/libcasper/services/cap_dns/cap_dns.3 Sun May 17 01:50:04 2020 (r361122) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2018 +.Dd April 18, 2020 .Dt CAP_DNS 3 .Os .Sh NAME @@ -61,11 +61,11 @@ The functions and .Fn cap_getnameinfo are respectively equivalent to -.Xr gethostbyname 2 , -.Xr gethostbyname2 2 , -.Xr gethostbyaddr 2 +.Xr gethostbyname 3 , +.Xr gethostbyname2 3 , +.Xr gethostbyaddr 3 and -.Xr getnameinfo 2 +.Xr getnameinfo 3 except that the connection to the .Nm system.dns service needs to be provided. From owner-svn-src-all@freebsd.org Sun May 17 01:51: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 825EC1399B5; Sun, 17 May 2020 01:51:26 +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 49PlVk2xHZz3VWp; Sun, 17 May 2020 01:51:26 +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 600399051; Sun, 17 May 2020 01:51:26 +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 04H1pQQi078376; Sun, 17 May 2020 01:51:26 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04H1pQP1078375; Sun, 17 May 2020 01:51:26 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005170151.04H1pQP1078375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 17 May 2020 01:51: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: r361123 - stable/12/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/cddl/contrib/opensolaris/cmd/zfs X-SVN-Commit-Revision: 361123 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, 17 May 2020 01:51:26 -0000 Author: asomers Date: Sun May 17 01:51:25 2020 New Revision: 361123 URL: https://svnweb.freebsd.org/changeset/base/361123 Log: MFC r360080: zfs-program.8: fix orphan .Xr Reported by: phk Reviewed by: avg Differential Revision: https://reviews.freebsd.org/D24488 Modified: stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Sun May 17 01:50:04 2020 (r361122) +++ stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Sun May 17 01:51:25 2020 (r361123) @@ -11,7 +11,7 @@ .\" Copyright (c) 2016, 2017 by Delphix. All rights reserved. .\" Copyright (c) 2018 Datto Inc. .\" -.Dd October 02, 2017 +.Dd April 18, 2020 .Dt ZFS-PROGRAM 8 .Os .Sh NAME @@ -289,7 +289,7 @@ EBADF EXDEV EFBIG .Ss API Functions For detailed descriptions of the exact behavior of any zfs administrative operations, see the main -.Xr zfs 1 +.Xr zfs 8 manual page. .Bl -tag -width "xx" .It Em zfs.debug(msg) From owner-svn-src-all@freebsd.org Sun May 17 01:55: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 2CD59139A36; Sun, 17 May 2020 01:55:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Plb00Tb4z3W1J; Sun, 17 May 2020 01:55:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09A718D79; Sun, 17 May 2020 01:55:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04H1t7dM080063; Sun, 17 May 2020 01:55:07 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04H1t7oj080061; Sun, 17 May 2020 01:55:07 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005170155.04H1t7oj080061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 17 May 2020 01:55:07 +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: r361124 - in stable/12: . lib/libbsm X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/12: . lib/libbsm X-SVN-Commit-Revision: 361124 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, 17 May 2020 01:55:08 -0000 Author: asomers Date: Sun May 17 01:55:07 2020 New Revision: 361124 URL: https://svnweb.freebsd.org/changeset/base/361124 Log: MFC r360087: libbsm: fix some MLINKS Add missing MLINKS entries for a few functions. Remove some old typo entries. Reported by: phk Reviewed by: cem Modified: stable/12/ObsoleteFiles.inc stable/12/lib/libbsm/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Sun May 17 01:51:25 2020 (r361123) +++ stable/12/ObsoleteFiles.inc Sun May 17 01:55:07 2020 (r361124) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20200516: Remove bogus man links +OLD_FILES+=usr/share/man/man3/getauusernam_R.3.gz +OLD_FILES+=usr/share/man/man3/getauclassnam_3.3.gz + # 20200501: new clang import which bumps version from 9.0.1 to 10.0.0. OLD_FILES+=usr/lib/clang/9.0.1/include/cuda_wrappers/algorithm OLD_FILES+=usr/lib/clang/9.0.1/include/cuda_wrappers/complex Modified: stable/12/lib/libbsm/Makefile ============================================================================== --- stable/12/lib/libbsm/Makefile Sun May 17 01:51:25 2020 (r361123) +++ stable/12/lib/libbsm/Makefile Sun May 17 01:55:07 2020 (r361124) @@ -75,10 +75,11 @@ MAN+= audit.2 \ setauid.2 MLINKS= libbsm.3 bsm.3 \ + libbsm.3 au_fcntl_cmd_to_bsm.3 \ au_class.3 getauclassent.3 \ au_class.3 getauclassent_r.3 \ au_class.3 getauclassnam.3 \ - au_class.3 getauclassnam_3.3 \ + au_class.3 getauclassnam_r.3 \ au_class.3 setauclass.3 \ au_class.3 endauclass.3 \ au_control.3 setac.3 \ @@ -127,6 +128,7 @@ MLINKS= libbsm.3 bsm.3 \ au_token.3 au_to_arg32.3 \ au_token.3 au_to_arg64.3 \ au_token.3 au_to_arg.3 \ + au_token.3 au_to_attr32.3 \ au_token.3 au_to_attr64.3 \ au_token.3 au_to_data.3 \ au_token.3 au_to_exit.3 \ @@ -155,6 +157,7 @@ MLINKS= libbsm.3 bsm.3 \ au_token.3 au_to_sock_inet32.3 \ au_token.3 au_to_sock_inet128.3 \ au_token.3 au_to_sock_inet.3 \ + au_token.3 au_to_socket_ex.3 \ au_token.3 au_to_subject32.3 \ au_token.3 au_to_subject64.3 \ au_token.3 au_to_subject.3 \ @@ -166,6 +169,7 @@ MLINKS= libbsm.3 bsm.3 \ au_token.3 au_to_exec_env.3 \ au_token.3 au_to_header.3 \ au_token.3 au_to_header32.3 \ + au_token.3 au_to_header32_ex.3 \ au_token.3 au_to_header64.3 \ au_token.3 au_to_trailer.3 \ au_token.3 au_to_zonename.3 \ @@ -174,7 +178,7 @@ MLINKS= libbsm.3 bsm.3 \ au_user.3 getauuserent.3 \ au_user.3 getauuserent_r.3 \ au_user.3 getauusernam.3 \ - au_user.3 getauusernam_R.3 \ + au_user.3 getauusernam_r.3 \ au_user.3 au_user_mask.3 \ au_user.3 getfauditflags.3 \ getaudit.2 getaudit_addr.2 \ From owner-svn-src-all@freebsd.org Sun May 17 02:21: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 549B4139C50; Sun, 17 May 2020 02:21:54 +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 49Pm9t1cZ4z3WlY; Sun, 17 May 2020 02:21:54 +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 32D7F91CC; Sun, 17 May 2020 02:21:54 +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 04H2LsCD097488; Sun, 17 May 2020 02:21:54 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04H2LsiE097487; Sun, 17 May 2020 02:21:54 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005170221.04H2LsiE097487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 17 May 2020 02:21:54 +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: r361125 - stable/12/sys/fs/fuse X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/sys/fs/fuse X-SVN-Commit-Revision: 361125 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, 17 May 2020 02:21:54 -0000 Author: asomers Date: Sun May 17 02:21:53 2020 New Revision: 361125 URL: https://svnweb.freebsd.org/changeset/base/361125 Log: MFC r359435: fusefs: add a dtrace probe that fires after mounting is complete This probe is useful for showing the protocol options negotiated with a FUSE server. Modified: stable/12/sys/fs/fuse/fuse_internal.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/fuse/fuse_internal.c ============================================================================== --- stable/12/sys/fs/fuse/fuse_internal.c Sun May 17 01:55:07 2020 (r361124) +++ stable/12/sys/fs/fuse/fuse_internal.c Sun May 17 02:21:53 2020 (r361125) @@ -959,6 +959,8 @@ fuse_internal_vnode_disappear(struct vnode *vp) /* fuse start/stop */ +SDT_PROBE_DEFINE2(fusefs, , internal, init_done, + "struct fuse_data*", "struct fuse_init_out*"); int fuse_internal_init_callback(struct fuse_ticket *tick, struct uio *uio) { @@ -1043,6 +1045,7 @@ out: } FUSE_LOCK(); data->dataflags |= FSESS_INITED; + SDT_PROBE2(fusefs, , internal, init_done, data, fiio); wakeup(&data->ticketer); FUSE_UNLOCK(); From owner-svn-src-all@freebsd.org Sun May 17 02:35: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 7A95013A4BD; Sun, 17 May 2020 02:35:51 +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 49PmTz3394z3XKK; Sun, 17 May 2020 02:35:51 +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 6395D99FD; Sun, 17 May 2020 02:35:51 +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 04H2ZpiV005364; Sun, 17 May 2020 02:35:51 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04H2Zpeg005361; Sun, 17 May 2020 02:35:51 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005170235.04H2Zpeg005361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 17 May 2020 02:35: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: r361126 - in stable/12/tests/sys: fs/fusefs mac/bsdextended X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/12/tests/sys: fs/fusefs mac/bsdextended X-SVN-Commit-Revision: 361126 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, 17 May 2020 02:35:51 -0000 Author: asomers Date: Sun May 17 02:35:50 2020 New Revision: 361126 URL: https://svnweb.freebsd.org/changeset/base/361126 Log: MFC r360339, r360567 r360339: mac_bsdextended: ATFify the tests The new tests have more complete setup and cleanup, are more granular, and correctly annotate expected failures and skipped tests. A follow-up commit will resolve a conflict with the fusefs tests (bug 244229). Differential Revision: https://reviews.freebsd.org/D24257 r360567: Resolve conflict between the fusefs(5) and mac_bsdextended(4) tests mac_bsdextended(4), when enabled, causes ordinary operations to send many more VOP_GETATTRs to file system. The fusefs tests expectations aren't written with those in mind. Optionally expecting them would greatly obfuscate the fusefs tests. Worse, certain fusefs functionality (like attribute caching) would be impossible to test if the tests couldn't expect an exact number of GETATTR operations. This commit resolves that conflict by making two changes: 1. The fusefs tests will now check for mac_bsdextended, and skip if it's enabled. 2. The mac_bsdextended tests will now check whether the module is enabled, not merely loaded. If it's loaded but disabled, the tests will automatically enable it for the duration of the tests. With these changes, a CI system can achieve best coverage by loading both fusefs and mac_bsdextended at boot, and setting security.mac.bsdextended.enabled=0 PR: 244229 Reported by: lwhsu Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D24577 Modified: stable/12/tests/sys/fs/fusefs/utils.cc stable/12/tests/sys/mac/bsdextended/Makefile stable/12/tests/sys/mac/bsdextended/matches_test.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/fs/fusefs/utils.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/utils.cc Sun May 17 02:21:53 2020 (r361125) +++ stable/12/tests/sys/fs/fusefs/utils.cc Sun May 17 02:35:50 2020 (r361126) @@ -70,6 +70,10 @@ const uint32_t default_max_write = MIN(libfuse_max_wri void check_environment() { const char *devnode = "/dev/fuse"; + const char *bsdextended_node = "security.mac.bsdextended.enabled"; + int bsdextended_val = 0; + size_t bsdextended_size = sizeof(bsdextended_val); + int bsdextended_found; const char *usermount_node = "vfs.usermount"; int usermount_val = 0; size_t usermount_size = sizeof(usermount_val); @@ -83,9 +87,19 @@ void check_environment() GTEST_SKIP() << strerror(errno); } } + // mac_bsdextended(4), when enabled, generates many more GETATTR + // operations. The fusefs tests' expectations don't account for those, + // and adding extra code to handle them obfuscates the real purpose of + // the tests. Better just to skip the fusefs tests if mac_bsdextended + // is enabled. + bsdextended_found = sysctlbyname(bsdextended_node, &bsdextended_val, + &bsdextended_size, NULL, 0); + if (bsdextended_found == 0 && bsdextended_val != 0) + GTEST_SKIP() << + "The fusefs tests are incompatible with mac_bsdextended."; ASSERT_EQ(sysctlbyname(usermount_node, &usermount_val, &usermount_size, NULL, 0), - 0);; + 0); if (geteuid() != 0 && !usermount_val) GTEST_SKIP() << "current user is not allowed to mount"; } Modified: stable/12/tests/sys/mac/bsdextended/Makefile ============================================================================== --- stable/12/tests/sys/mac/bsdextended/Makefile Sun May 17 02:21:53 2020 (r361125) +++ stable/12/tests/sys/mac/bsdextended/Makefile Sun May 17 02:35:50 2020 (r361126) @@ -2,12 +2,14 @@ TESTSDIR= ${TESTSBASE}/sys/mac/bsdextended +ATF_TESTS_SH+= matches_test TAP_TESTS_C+= ugidfw_test -TAP_TESTS_SH+= matches_test LIBADD.ugidfw_test+= ugidfw -TEST_METADATA.matches_test+= required_user="root" TEST_METADATA.ugidfw_test+= required_user="root" +# Each test case of matches_test reuses the same ruleset number, so they cannot +# be run simultaneously +TEST_METADATA.matches_test+= is_exclusive=true .include Modified: stable/12/tests/sys/mac/bsdextended/matches_test.sh ============================================================================== --- stable/12/tests/sys/mac/bsdextended/matches_test.sh Sun May 17 02:21:53 2020 (r361125) +++ stable/12/tests/sys/mac/bsdextended/matches_test.sh Sun May 17 02:35:50 2020 (r361126) @@ -10,356 +10,390 @@ uidoutrange="daemon" gidinrange="nobody" # We expect $uidinrange in this group gidoutrange="daemon" # We expect $uidinrange in this group -test_num=1 -pass() -{ - echo "ok $test_num # $@" - : $(( test_num += 1 )) -} -fail() +check_ko() { - echo "not ok $test_num # $@" - : $(( test_num += 1 )) + if ! sysctl -N security.mac.bsdextended >/dev/null 2>&1; then + atf_skip "mac_bsdextended(4) support isn't available" + fi + if [ $(sysctl -n security.mac.bsdextended.enabled) = "0" ]; then + # The kernel module is loaded but disabled. Enable it for the + # duration of the test. + touch enabled_bsdextended + sysctl security.mac.bsdextended.enabled=1 + fi } -# -# Setup -# - -: ${TMPDIR=/tmp} -if [ $(id -u) -ne 0 ]; then - echo "1..0 # SKIP test must be run as root" - exit 0 -fi -if ! sysctl -N security.mac.bsdextended >/dev/null 2>&1; then - echo "1..0 # SKIP mac_bsdextended(4) support isn't available" - exit 0 -fi -if [ "$TMPDIR" != "/tmp" ]; then - if ! chmod -Rf 0755 $TMPDIR; then - echo "1..0 # SKIP failed to chmod $TMPDIR" - exit 0 +setup() +{ + check_ko + mkdir mnt + mdmfs -s 25m md mnt \ + || atf_fail "failed to mount md device" + chmod a+rwx mnt + md_device=$(mount -p | grep "$PWD/mnt" | awk '{ gsub(/^\/dev\//, "", $1); print $1 }') + if [ -z "$md_device" ]; then + atf_fail "md device not properly attached to the system" fi -fi -if ! playground=$(mktemp -d $TMPDIR/tmp.XXXXXXX); then - echo "1..0 # SKIP failed to create temporary directory" - exit 0 -fi -trap "rmdir $playground" EXIT INT TERM -if ! mdmfs -s 25m md $playground; then - echo "1..0 # SKIP failed to mount md device" - exit 0 -fi -chmod a+rwx $playground -md_device=$(mount -p | grep "$playground" | awk '{ gsub(/^\/dev\//, "", $1); print $1 }') -trap "umount -f $playground; mdconfig -d -u $md_device; rmdir $playground" EXIT INT TERM -if [ -z "$md_device" ]; then - mount -p | grep $playground - echo "1..0 # SKIP md device not properly attached to the system" -fi + echo $md_device > md_device -ugidfw remove 1 + ugidfw remove 1 -file1=$playground/test-$uidinrange -file2=$playground/test-$uidoutrange -cat > $playground/test-script.sh <<'EOF' + cat > mnt/test-script.sh <<'EOF' #!/bin/sh : > $1 EOF -if [ $? -ne 0 ]; then - echo "1..0 # SKIP failed to create test script" - exit 0 -fi -echo "1..30" + if [ $? -ne 0 ]; then + atf_fail "failed to create test script" + fi -command1="sh $playground/test-script.sh $file1" -command2="sh $playground/test-script.sh $file2" + file1=mnt/test-$uidinrange + file2=mnt/test-$uidoutrange + command1="sh mnt/test-script.sh $file1" + command2="sh mnt/test-script.sh $file2" -desc="$uidinrange file" -if su -m $uidinrange -c "$command1"; then - pass $desc -else - fail $desc -fi + # $uidinrange file + atf_check -s exit:0 su -m $uidinrange -c "$command1" -chown "$uidinrange":"$gidinrange" $file1 -chmod a+w $file1 + chown "$uidinrange":"$gidinrange" $file1 + chmod a+w $file1 -desc="$uidoutrange file" -if $command2; then - pass $desc -else - fail $desc -fi + # $uidoutrange file + if ! $command2; then + atf_fail $desc + fi -chown "$uidoutrange":"$gidoutrange" $file2 -chmod a+w $file2 + chown "$uidoutrange":"$gidoutrange" $file2 + chmod a+w $file2 +} -# -# No rules -# -desc="no rules $uidinrange" -if su -fm $uidinrange -c "$command1"; then - pass $desc -else - fail $desc -fi +cleanup() +{ + ugidfw remove 1 -desc="no rules $uidoutrange" -if su -fm $uidoutrange -c "$command1"; then - pass $desc -else - fail $desc -fi + umount -f mnt + if [ -f md_device ]; then + mdconfig -d -u $( cat md_device ) + fi + if [ -f enabled_bsdextended ]; then + sysctl security.mac.bsdextended.enabled=0 + fi +} -# -# Subject Match on uid -# -ugidfw set 1 subject uid $uidrange object mode rasx -desc="subject uid in range" -if su -fm $uidinrange -c "$command1"; then - fail $desc -else - pass $desc -fi +atf_test_case no_rules cleanup +no_rules_head() +{ + atf_set "require.user" "root" +} +no_rules_body() +{ + setup -desc="subject uid out range" -if su -fm $uidoutrange -c "$command1"; then - pass $desc -else - fail $desc -fi + # no rules $uidinrange + atf_check -s exit:0 su -fm $uidinrange -c "$command1" -# -# Subject Match on gid -# -ugidfw set 1 subject gid $gidrange object mode rasx + # no rules $uidoutrange + atf_check -s exit:0 su -fm $uidoutrange -c "$command1" +} +no_rules_cleanup() +{ + cleanup +} -desc="subject gid in range" -if su -fm $uidinrange -c "$command1"; then - fail $desc -else - pass $desc -fi +atf_test_case subject_match_on_uid cleanup +subject_match_on_uid_head() +{ + atf_set "require.user" "root" +} +subject_match_on_uid_body() +{ + setup -desc="subject gid out range" -if su -fm $uidoutrange -c "$command1"; then - pass $desc -else - fail $desc -fi + atf_check -s exit:0 ugidfw set 1 subject uid $uidrange object mode rasx + # subject uid in range + atf_check -s not-exit:0 -e match:"Permission denied" \ + su -fm $uidinrange -c "$command1" -if which jail >/dev/null; then - # - # Subject Match on jail - # - rm -f $playground/test-jail + # subject uid out range + atf_check -s exit:0 su -fm $uidoutrange -c "$command1" - desc="subject matching jailid" - jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` - ugidfw set 1 subject jailid $jailid object mode rasx +} +subject_match_on_uid_cleanup() +{ + cleanup +} + +atf_test_case subject_match_on_gid cleanup +subject_match_on_gid_head() +{ + atf_set "require.user" "root" +} +subject_match_on_gid_body() +{ + setup + + atf_check -s exit:0 ugidfw set 1 subject gid $gidrange object mode rasx + + # subject gid in range + atf_check -s not-exit:0 -e match:"Permission denied" \ + su -fm $uidinrange -c "$command1" + + # subject gid out range + atf_check -s exit:0 su -fm $uidoutrange -c "$command1" +} +subject_match_on_gid_cleanup() +{ + cleanup +} + +atf_test_case subject_match_on_jail cleanup +subject_match_on_jail_head() +{ + atf_set "require.progs" "jail" + atf_set "require.user" "root" +} +subject_match_on_jail_body() +{ + setup + + atf_expect_fail "this testcase fails (see bug # 205481)" + # subject matching jailid + jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch mnt/test-jail) &"` + atf_check -s exit:0 ugidfw set 1 subject jailid $jailid object mode rasx sleep 10 - if [ -f $playground/test-jail ]; then - fail "TODO $desc: this testcase fails (see bug # 205481)" - else - pass $desc + if [ -f mnt/test-jail ]; then + atf_fail "$desc" fi - rm -f $playground/test-jail - desc="subject nonmatching jailid" - jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` + rm -f mnt/test-jail + # subject nonmatching jailid + jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch mnt/test-jail) &"` sleep 10 - if [ -f $playground/test-jail ]; then - pass $desc - else - fail $desc + if ! [ -f mnt/test-jail ]; then + atf_fail $desc fi -else - # XXX: kyua is too dumb to parse skip ranges, still.. - pass "skip jail(8) not installed" - pass "skip jail(8) not installed" -fi +} +subject_match_on_jail_cleanup() +{ + cleanup +} -# -# Object uid -# -ugidfw set 1 subject object uid $uidrange mode rasx +atf_test_case object_uid cleanup +object_uid_head() +{ + atf_set "require.user" "root" +} +object_uid_body() +{ + setup -desc="object uid in range" -if su -fm $uidinrange -c "$command1"; then - fail $desc -else - pass $desc -fi + atf_check -s exit:0 ugidfw set 1 subject object uid $uidrange mode rasx -desc="object uid out range" -if su -fm $uidinrange -c "$command2"; then - pass $desc -else - fail $desc -fi -ugidfw set 1 subject object uid $uidrange mode rasx + # object uid in range + atf_check -s not-exit:0 -e match:"Permission denied" \ + su -fm $uidinrange -c "$command1" -desc="object uid in range (different subject)" -if su -fm $uidoutrange -c "$command1"; then - fail $desc -else - pass $desc -fi + # object uid out range + atf_check -s exit:0 su -fm $uidinrange -c "$command2" + atf_check -s exit:0 ugidfw set 1 subject object uid $uidrange mode rasx -desc="object uid out range (different subject)" -if su -fm $uidoutrange -c "$command2"; then - pass $desc -else - fail $desc -fi + # object uid in range (different subject) + atf_check -s not-exit:0 -e match:"Permission denied" \ + su -fm $uidoutrange -c "$command1" -# -# Object gid -# -ugidfw set 1 subject object gid $uidrange mode rasx + # object uid out range (different subject) + atf_check -s exit:0 su -fm $uidoutrange -c "$command2" -desc="object gid in range" -if su -fm $uidinrange -c "$command1"; then - fail $desc -else - pass $desc -fi +} +object_uid_cleanup() +{ + cleanup +} -desc="object gid out range" -if su -fm $uidinrange -c "$command2"; then - pass $desc -else - fail $desc -fi -desc="object gid in range (different subject)" -if su -fm $uidoutrange -c "$command1"; then - fail $desc -else - pass $desc -fi +atf_test_case object_gid cleanup +object_gid_head() +{ + atf_set "require.user" "root" +} +object_gid_body() +{ + setup -desc="object gid out range (different subject)" -if su -fm $uidoutrange -c "$command2"; then - pass $desc -else - fail $desc -fi + atf_check -s exit:0 ugidfw set 1 subject object gid $uidrange mode rasx -# -# Object filesys -# -ugidfw set 1 subject uid $uidrange object filesys / mode rasx -desc="object out of filesys" -if su -fm $uidinrange -c "$command1"; then - pass $desc -else - fail $desc -fi + # object gid in range + atf_check -s not-exit:0 -e match:"Permission denied" \ + su -fm $uidinrange -c "$command1" -ugidfw set 1 subject uid $uidrange object filesys $playground mode rasx -desc="object in filesys" -if su -fm $uidinrange -c "$command1"; then - fail $desc -else - pass $desc -fi + # object gid out range + atf_check -s exit:0 su -fm $uidinrange -c "$command2" + # object gid in range (different subject) + atf_check -s not-exit:0 -e match:"Permission denied" \ + su -fm $uidoutrange -c "$command1" -# -# Object suid -# -ugidfw set 1 subject uid $uidrange object suid mode rasx -desc="object notsuid" -if su -fm $uidinrange -c "$command1"; then - pass $desc -else - fail $desc -fi + # object gid out range (different subject) + atf_check -s exit:0 su -fm $uidoutrange -c "$command2" +} +object_gid_cleanup() +{ + cleanup +} -chmod u+s $file1 -desc="object suid" -if su -fm $uidinrange -c "$command1"; then - fail $desc -else - pass $desc -fi -chmod u-s $file1 +atf_test_case object_filesys cleanup +object_filesys_head() +{ + atf_set "require.user" "root" +} +object_filesys_body() +{ + setup -# -# Object sgid -# -ugidfw set 1 subject uid $uidrange object sgid mode rasx -desc="object notsgid" -if su -fm $uidinrange -c "$command1"; then - pass $desc -else - fail $desc -fi + atf_check -s exit:0 ugidfw set 1 subject uid $uidrange object filesys / mode rasx + # object out of filesys + atf_check -s exit:0 su -fm $uidinrange -c "$command1" -chmod g+s $file1 -desc="object sgid" -if su -fm $uidinrange -c "$command1"; then - fail $desc -else - pass $desc -fi -chmod g-s $file1 + atf_check -s exit:0 ugidfw set 1 subject uid $uidrange object filesys mnt mode rasx + # object in filesys + atf_check -s not-exit:0 -e match:"Permission denied" \ + su -fm $uidinrange -c "$command1" +} +object_filesys_cleanup() +{ + cleanup +} -# -# Object uid matches subject -# -ugidfw set 1 subject uid $uidrange object uid_of_subject mode rasx +atf_test_case object_suid cleanup +object_suid_head() +{ + atf_set "require.user" "root" +} +object_suid_body() +{ + setup -desc="object uid notmatches subject" -if su -fm $uidinrange -c "$command2"; then - pass $desc -else - fail $desc -fi + atf_check -s exit:0 ugidfw set 1 subject uid $uidrange object suid mode rasx + # object notsuid + atf_check -s exit:0 su -fm $uidinrange -c "$command1" -desc="object uid matches subject" -if su -fm $uidinrange -c "$command1"; then - fail $desc -else - pass $desc -fi + chmod u+s $file1 + # object suid + atf_check -s not-exit:0 -e match:"Permission denied" \ + su -fm $uidinrange -c "$command1" + chmod u-s $file1 -# -# Object gid matches subject -# -ugidfw set 1 subject uid $uidrange object gid_of_subject mode rasx +} +object_suid_cleanup() +{ + cleanup +} -desc="object gid notmatches subject" -if su -fm $uidinrange -c "$command2"; then - pass $desc -else - fail $desc -fi +atf_test_case object_sgid cleanup +object_sgid_head() +{ + atf_set "require.user" "root" +} +object_sgid_body() +{ + setup -desc="object gid matches subject" -if su -fm $uidinrange -c "$command1"; then - fail $desc -else - pass $desc -fi + atf_check -s exit:0 ugidfw set 1 subject uid $uidrange object sgid mode rasx + # object notsgid + atf_check -s exit:0 su -fm $uidinrange -c "$command1" -# -# Object type -# -desc="object not type" -ugidfw set 1 subject uid $uidrange object type dbclsp mode rasx -if su -fm $uidinrange -c "$command1"; then - pass $desc -else - fail $desc -fi + chmod g+s $file1 + # object sgid + atf_check -s not-exit:0 -e match:"Permission denied" \ + su -fm $uidinrange -c "$command1" + chmod g-s $file1 +} +object_sgid_cleanup() +{ + cleanup +} -desc="object type" -ugidfw set 1 subject uid $uidrange object type r mode rasx -if su -fm $uidinrange -c "$command1"; then - fail $desc -else - pass $desc -fi +atf_test_case object_uid_matches_subject cleanup +object_uid_matches_subject_head() +{ + atf_set "require.user" "root" +} +object_uid_matches_subject_body() +{ + setup + + atf_check -s exit:0 ugidfw set 1 subject uid $uidrange object uid_of_subject mode rasx + + # object uid notmatches subject + atf_check -s exit:0 su -fm $uidinrange -c "$command2" + + # object uid matches subject + atf_check -s not-exit:0 -e match:"Permission denied" \ + su -fm $uidinrange -c "$command1" +} +object_uid_matches_subject_cleanup() +{ + cleanup +} + +atf_test_case object_gid_matches_subject cleanup +object_gid_matches_subject_head() +{ + atf_set "require.user" "root" +} +object_gid_matches_subject_body() +{ + setup + + atf_check -s exit:0 ugidfw set 1 subject uid $uidrange object gid_of_subject mode rasx + + # object gid notmatches subject + atf_check -s exit:0 su -fm $uidinrange -c "$command2" + + # object gid matches subject + atf_check -s not-exit:0 -e match:"Permission denied" \ + su -fm $uidinrange -c "$command1" + +} +object_gid_matches_subject_cleanup() +{ + cleanup +} + +atf_test_case object_type cleanup +object_type_head() +{ + atf_set "require.user" "root" +} +object_type_body() +{ + setup + + # object not type + atf_check -s exit:0 ugidfw set 1 subject uid $uidrange object type dbclsp mode rasx + atf_check -s exit:0 su -fm $uidinrange -c "$command1" + + # object type + atf_check -s exit:0 ugidfw set 1 subject uid $uidrange object type r mode rasx + atf_check -s not-exit:0 -e match:"Permission denied" \ + su -fm $uidinrange -c "$command1" +} +object_type_cleanup() +{ + cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case no_rules + atf_add_test_case subject_match_on_uid + atf_add_test_case subject_match_on_gid + atf_add_test_case subject_match_on_jail + atf_add_test_case object_uid + atf_add_test_case object_gid + atf_add_test_case object_filesys + atf_add_test_case object_suid + atf_add_test_case object_sgid + atf_add_test_case object_uid_matches_subject + atf_add_test_case object_gid_matches_subject + atf_add_test_case object_type +} From owner-svn-src-all@freebsd.org Sun May 17 02:36: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 3EDF413A4DA; Sun, 17 May 2020 02:36:43 +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 49PmVz0w7kz3Xmn; Sun, 17 May 2020 02:36:43 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AA87988B; Sun, 17 May 2020 02:36:43 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04H2agov005468; Sun, 17 May 2020 02:36:42 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04H2agch005467; Sun, 17 May 2020 02:36:42 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005170236.04H2agch005467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 17 May 2020 02:36:42 +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: r361127 - stable/12/tests/sys/geom/class/gate X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/tests/sys/geom/class/gate X-SVN-Commit-Revision: 361127 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, 17 May 2020 02:36:43 -0000 Author: asomers Date: Sun May 17 02:36:42 2020 New Revision: 361127 URL: https://svnweb.freebsd.org/changeset/base/361127 Log: MFC r360613: Fix intermittent cleanup failures in the ggated test Modified: stable/12/tests/sys/geom/class/gate/ggate_test.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/geom/class/gate/ggate_test.sh ============================================================================== --- stable/12/tests/sys/geom/class/gate/ggate_test.sh Sun May 17 02:35:50 2020 (r361126) +++ stable/12/tests/sys/geom/class/gate/ggate_test.sh Sun May 17 02:36:42 2020 (r361127) @@ -194,7 +194,11 @@ common_cleanup() if [ -f "md.devs" ]; then while read test_md; do - mdconfig -d -u $test_md 2>/dev/null + # ggatec destroy doesn't release the provider + # synchronously, so we may need to retry destroying it. + while ! mdconfig -d -u $test_md; do + sleep 0.1 + done done < md.devs rm md.devs fi From owner-svn-src-all@freebsd.org Sun May 17 02: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 1F30B13A465; Sun, 17 May 2020 02:40:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Pmbk02hjz3XyT; Sun, 17 May 2020 02:40:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFD2D94C7; Sun, 17 May 2020 02:40:49 +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 04H2enQV008131; Sun, 17 May 2020 02:40:49 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04H2enQP008130; Sun, 17 May 2020 02:40:49 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005170240.04H2enQP008130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 17 May 2020 02:40:49 +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: r361128 - stable/11/tests/sys/geom/class/gate X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/tests/sys/geom/class/gate X-SVN-Commit-Revision: 361128 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, 17 May 2020 02:40:50 -0000 Author: asomers Date: Sun May 17 02:40:49 2020 New Revision: 361128 URL: https://svnweb.freebsd.org/changeset/base/361128 Log: MFC r360613: Fix intermittent cleanup failures in the ggated test Modified: stable/11/tests/sys/geom/class/gate/ggate_test.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/geom/class/gate/ggate_test.sh ============================================================================== --- stable/11/tests/sys/geom/class/gate/ggate_test.sh Sun May 17 02:36:42 2020 (r361127) +++ stable/11/tests/sys/geom/class/gate/ggate_test.sh Sun May 17 02:40:49 2020 (r361128) @@ -194,7 +194,11 @@ common_cleanup() if [ -f "md.devs" ]; then while read test_md; do - mdconfig -d -u $test_md 2>/dev/null + # ggatec destroy doesn't release the provider + # synchronously, so we may need to retry destroying it. + while ! mdconfig -d -u $test_md; do + sleep 0.1 + done done < md.devs rm md.devs fi From owner-svn-src-all@freebsd.org Sun May 17 02:41: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 88B5D13A8C0; Sun, 17 May 2020 02:41:51 +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 49Pmcv35Bfz3XxF; Sun, 17 May 2020 02:41:51 +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 6547B9BF1; Sun, 17 May 2020 02:41:51 +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 04H2fp5S010554; Sun, 17 May 2020 02:41:51 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04H2fpvF010553; Sun, 17 May 2020 02:41:51 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005170241.04H2fpvF010553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 17 May 2020 02:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361129 - head/tests/sys/geom/class/gate X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/geom/class/gate X-SVN-Commit-Revision: 361129 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, 17 May 2020 02:41:51 -0000 Author: asomers Date: Sun May 17 02:41:50 2020 New Revision: 361129 URL: https://svnweb.freebsd.org/changeset/base/361129 Log: Reenable sys.geom.class.gate.ggate_test.ggated in CI Should be fixed by r360613 PR: 244737 Reported by: lwhsu Modified: head/tests/sys/geom/class/gate/ggate_test.sh Modified: head/tests/sys/geom/class/gate/ggate_test.sh ============================================================================== --- head/tests/sys/geom/class/gate/ggate_test.sh Sun May 17 02:40:49 2020 (r361128) +++ head/tests/sys/geom/class/gate/ggate_test.sh Sun May 17 02:41:50 2020 (r361129) @@ -16,10 +16,6 @@ ggated_head() ggated_body() { - if [ "$(atf_config_get ci false)" = "true" ]; then - atf_skip "https://bugs.freebsd.org/244737" - fi - load_ggate us=$(alloc_ggate_dev) From owner-svn-src-all@freebsd.org Sun May 17 09:34: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 5C0532CBD5D; Sun, 17 May 2020 09:34:30 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Pxn21nJBz49kc; Sun, 17 May 2020 09:34:30 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34096E54A; Sun, 17 May 2020 09:34:30 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04H9YUPZ067152; Sun, 17 May 2020 09:34:30 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04H9YTGF067151; Sun, 17 May 2020 09:34:29 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <202005170934.04H9YTGF067151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Sun, 17 May 2020 09:34:29 +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: r361130 - stable/12/share/man/man7 X-SVN-Group: stable-12 X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: stable/12/share/man/man7 X-SVN-Commit-Revision: 361130 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, 17 May 2020 09:34:30 -0000 Author: bcr (doc committer) Date: Sun May 17 09:34:29 2020 New Revision: 361130 URL: https://svnweb.freebsd.org/changeset/base/361130 Log: Add new stats(7) man page and hook it up to the build. This man page contains stat utilities that are available in the base system. This is a better approach than looking them up via "apropos stat" or similar commands. Thanks to Daniel Ebdrup Jensen for writing the original page and incorporating the feedback given. Submitted by: Daniel Ebdrup Jensen Reviewed by: 0mp, allanjude, brueffer, bcr Approved by: bcr Relnotes: yes (new stats(7) man page) Differential Revision: https://reviews.freebsd.org/D24417 Added: stable/12/share/man/man7/stats.7 - copied unchanged from r361028, head/share/man/man7/stats.7 Modified: stable/12/share/man/man7/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man7/Makefile ============================================================================== --- stable/12/share/man/man7/Makefile Sun May 17 02:41:50 2020 (r361129) +++ stable/12/share/man/man7/Makefile Sun May 17 09:34:29 2020 (r361130) @@ -28,6 +28,7 @@ MAN= arch.7 \ sdoc.7 \ security.7 \ sprog.7 \ + stats.7 \ stdint.7 \ sticky.7 \ tests.7 \ Copied: stable/12/share/man/man7/stats.7 (from r361028, head/share/man/man7/stats.7) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/man/man7/stats.7 Sun May 17 09:34:29 2020 (r361130, copy of r361028, head/share/man/man7/stats.7) @@ -0,0 +1,120 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2020 Daniel Ebdrup Jensen +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 14, 2020 +.Dt STATS 7 +.Os +.Sh NAME +.Nm stats +.Nd information about various and sundry statistics utilities +.Sh DESCRIPTION +The +.Fx +userland in part contains a series of utilities which can be used +to ascertain system state at runtime and optionally from core files. +.Sh COMMANDS +The following commands +.Pq sorted alphabetically +are currently included in the base system, with more appearing periodically. +.Bl -tag -width "zpool iostat" +.It Nm btsockstat +Show Bluetooth socket information +.It Nm ctlstat +CAM Target Layer statistics utility +.It Nm fstat +Identify active files +.It Nm gstat +Print statistics about GEOM disks +.It Nm ibstat +Display information from the InfiniBand driver +.It Nm ifmcstat +Dump multicast group management statistics per interface +.It Nm iostat +Report kernel subsystem I/O statistics +.It Nm ipfstat +Display IPF packet filter statistics and filter list +.It Nm kldstat +Display status of dynamic kernel linker +.It Nm lockstat +Report kernel lock and profiling statistics +.It Nm mailstats +Display mail statistics +.It Nm netstat +Show network status and statistics +.It Nm nfsstat +Display NFS statistics +.It Nm plockstat +Trace pthread lock statistics using DTrace +.It Nm pmcstat +Performance measurement with performance monitoring hardware +.It Nm procstat +Get detailed process information +.It Nm pstat +Display system data structures +.It Nm sockstat +List open sockets +.It Nm stat +Display file status +.It Nm systat +Display system statistics +.It Nm vmstat +Report virtual memory statistics +.It Nm zpool iostat +Report ZFS I/O statistics +.Sh SEE ALSO +.Xr intro 1 , +.Xr intro 7 , +.Xr intro 8 , +.Xr btsockstat 1 , +.Xr ctlstat 8 , +.Xr fstat 1 , +.Xr gstat 8 , +.Xr ibstat 8 , +.Xr ifmcstat 8 , +.Xr iostat 8 , +.Xr ipfstat 8 , +.Xr kldstat 8 , +.Xr lockstat 1 , +.Xr mailstats 8 , +.Xr netstat 1 , +.Xr plockstat 1 , +.Xr pmcstat 8 , +.Xr procstat 1 , +.Xr pstat 8 , +.Xr sockstat 1, +.Xr stat 1 , +.Xr systat 1 , +.Xr vmstat 8 , +.Xr zpool-iostat 8 , +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 13.0 . +.Sh AUTHORS +.An Daniel Ebdrup Jensen Aq Mt debdrup@FreeBSD.org From owner-svn-src-all@freebsd.org Sun May 17 11:09: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 2B1792CD254; Sun, 17 May 2020 11:09:39 +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 49Pztq0G94z4FRq; Sun, 17 May 2020 11:09:39 +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 F402DF275; Sun, 17 May 2020 11:09:38 +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 04HB9cg7023050; Sun, 17 May 2020 11:09:38 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HB9ckh023048; Sun, 17 May 2020 11:09:38 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <202005171109.04HB9ckh023048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Sun, 17 May 2020 11: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: r361131 - stable/12/sys/amd64/vmm X-SVN-Group: stable-12 X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: stable/12/sys/amd64/vmm X-SVN-Commit-Revision: 361131 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, 17 May 2020 11:09:39 -0000 Author: grehan Date: Sun May 17 11:09:38 2020 New Revision: 361131 URL: https://svnweb.freebsd.org/changeset/base/361131 Log: MFC r361064 Hide host CPUID 0x15 TSC/Crystal ratio/freq info from guest In recent Linux (5.3+) and OpenBSD (6.6+) kernels, and with hosts that support CPUID 0x15, the local APIC frequency is determined directly from the reported crystal clock to avoid calibration against the 8254 timer. However, the local APIC frequency implemented by bhyve is 128MHz, where most h/w systems report frequencies around 25MHz. This shows up on OpenBSD guests as repeated keystrokes on the emulated PS2 keyboard when using VNC, since the kernel's timers are now much shorter. Fix by reporting all-zeroes for CPUID 0x15. This allows guests to fall back to using the 8254 to calibrate the local APIC frequency. Future work could be to compute values returned for 0x15 that would match the host TSC and bhyve local APIC frequency, though all dependencies on this would need to be examined (for example, Linux will start using 0x16 for some hosts). PR: 246321 Reported by: Jason Tubnor (and tested) Approved by: bz (mentor) Modified: stable/12/sys/amd64/vmm/x86.c stable/12/sys/amd64/vmm/x86.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/vmm/x86.c ============================================================================== --- stable/12/sys/amd64/vmm/x86.c Sun May 17 09:34:29 2020 (r361130) +++ stable/12/sys/amd64/vmm/x86.c Sun May 17 11:09:38 2020 (r361131) @@ -559,6 +559,18 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, } break; + case CPUID_0000_0015: + /* + * Don't report CPU TSC/Crystal ratio and clock + * values since guests may use these to derive the + * local APIC frequency.. + */ + regs[0] = 0; + regs[1] = 0; + regs[2] = 0; + regs[3] = 0; + break; + case 0x40000000: regs[0] = CPUID_VM_HIGH; bcopy(bhyve_id, ®s[1], 4); Modified: stable/12/sys/amd64/vmm/x86.h ============================================================================== --- stable/12/sys/amd64/vmm/x86.h Sun May 17 09:34:29 2020 (r361130) +++ stable/12/sys/amd64/vmm/x86.h Sun May 17 11:09:38 2020 (r361131) @@ -41,6 +41,7 @@ #define CPUID_0000_000A (0xA) #define CPUID_0000_000B (0xB) #define CPUID_0000_000D (0xD) +#define CPUID_0000_0015 (0x15) #define CPUID_8000_0000 (0x80000000) #define CPUID_8000_0001 (0x80000001) #define CPUID_8000_0002 (0x80000002) From owner-svn-src-all@freebsd.org Sun May 17 11:13: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 65EC52CD5FB; Sun, 17 May 2020 11:13:13 +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 49Pzyx24x7z4Fx0; Sun, 17 May 2020 11:13:13 +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 401A7F4F2; Sun, 17 May 2020 11:13:13 +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 04HBDDAb028671; Sun, 17 May 2020 11:13:13 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HBDC3q028669; Sun, 17 May 2020 11:13:12 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <202005171113.04HBDC3q028669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Sun, 17 May 2020 11:13:12 +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: r361132 - stable/11/sys/amd64/vmm X-SVN-Group: stable-11 X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: stable/11/sys/amd64/vmm X-SVN-Commit-Revision: 361132 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, 17 May 2020 11:13:13 -0000 Author: grehan Date: Sun May 17 11:13:12 2020 New Revision: 361132 URL: https://svnweb.freebsd.org/changeset/base/361132 Log: MFC r361064 Hide host CPUID 0x15 TSC/Crystal ratio/freq info from guest In recent Linux (5.3+) and OpenBSD (6.6+) kernels, and with hosts that support CPUID 0x15, the local APIC frequency is determined directly from the reported crystal clock to avoid calibration against the 8254 timer. However, the local APIC frequency implemented by bhyve is 128MHz, where most h/w systems report frequencies around 25MHz. This shows up on OpenBSD guests as repeated keystrokes on the emulated PS2 keyboard when using VNC, since the kernel's timers are now much shorter. Fix by reporting all-zeroes for CPUID 0x15. This allows guests to fall back to using the 8254 to calibrate the local APIC frequency. Future work could be to compute values returned for 0x15 that would match the host TSC and bhyve local APIC frequency, though all dependencies on this would need to be examined (for example, Linux will start using 0x16 for some hosts). PR: 246321 Reported by: Jason Tubnor (and tested) Approved by: bz (mentor) Modified: stable/11/sys/amd64/vmm/x86.c stable/11/sys/amd64/vmm/x86.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/vmm/x86.c ============================================================================== --- stable/11/sys/amd64/vmm/x86.c Sun May 17 11:09:38 2020 (r361131) +++ stable/11/sys/amd64/vmm/x86.c Sun May 17 11:13:12 2020 (r361132) @@ -554,6 +554,18 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, } break; + case CPUID_0000_0015: + /* + * Don't report CPU TSC/Crystal ratio and clock + * values since guests may use these to derive the + * local APIC frequency.. + */ + regs[0] = 0; + regs[1] = 0; + regs[2] = 0; + regs[3] = 0; + break; + case 0x40000000: regs[0] = CPUID_VM_HIGH; bcopy(bhyve_id, ®s[1], 4); Modified: stable/11/sys/amd64/vmm/x86.h ============================================================================== --- stable/11/sys/amd64/vmm/x86.h Sun May 17 11:09:38 2020 (r361131) +++ stable/11/sys/amd64/vmm/x86.h Sun May 17 11:13:12 2020 (r361132) @@ -39,6 +39,7 @@ #define CPUID_0000_000A (0xA) #define CPUID_0000_000B (0xB) #define CPUID_0000_000D (0xD) +#define CPUID_0000_0015 (0x15) #define CPUID_8000_0000 (0x80000000) #define CPUID_8000_0001 (0x80000001) #define CPUID_8000_0002 (0x80000002) From owner-svn-src-all@freebsd.org Sun May 17 14:00: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 426C02DA816; Sun, 17 May 2020 14:00:55 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Q3hR155Tz4Nwf; Sun, 17 May 2020 14:00:55 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 209BE11651; Sun, 17 May 2020 14:00:55 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04HE0tu4029403; Sun, 17 May 2020 14:00:55 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HE0tjD029386; Sun, 17 May 2020 14:00:55 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <202005171400.04HE0tjD029386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Sun, 17 May 2020 14:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361133 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 361133 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, 17 May 2020 14:00:55 -0000 Author: fsu Date: Sun May 17 14:00:54 2020 New Revision: 361133 URL: https://svnweb.freebsd.org/changeset/base/361133 Log: Add inode bitmap tail initialization. Make ext2fs compatible with changes introduced in e2fsprogs v1.45.2. Now the tail of inode bitmap is filled with 0xff pattern explicitly during bitmap initialization phase to avoid e2fsck error like: "Padding at end of inode bitmap is not set." Modified: head/sys/fs/ext2fs/ext2_alloc.c Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Sun May 17 11:13:12 2020 (r361132) +++ head/sys/fs/ext2fs/ext2_alloc.c Sun May 17 14:00:54 2020 (r361133) @@ -1287,6 +1287,16 @@ ext2_zero_inode_table(struct inode *ip, int cg) return (0); } +static void +ext2_fix_bitmap_tail(unsigned char *bitmap, int first, int last) +{ + int i; + + for (i = first; i <= last; i++) + bitmap[i] = 0xff; +} + + /* * Determine whether an inode can be allocated. * @@ -1299,7 +1309,7 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr struct m_ext2fs *fs; struct buf *bp; struct ext2mount *ump; - int error, start, len, ifree; + int error, start, len, ifree, ibytes; char *ibp, *loc; ipref--; /* to avoid a lot of (ipref -1) */ @@ -1320,7 +1330,10 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) || EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { if (fs->e2fs_gd[cg].ext4bgd_flags & EXT2_BG_INODE_UNINIT) { - memset(bp->b_data, 0, fs->e2fs_bsize); + ibytes = fs->e2fs_ipg / 8; + memset(bp->b_data, 0, ibytes - 1); + ext2_fix_bitmap_tail(bp->b_data, ibytes, + fs->e2fs_bsize - 1); fs->e2fs_gd[cg].ext4bgd_flags &= ~EXT2_BG_INODE_UNINIT; } ext2_gd_i_bitmap_csum_set(fs, cg, bp); From owner-svn-src-all@freebsd.org Sun May 17 14:03: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 0E6502DAA4E; Sun, 17 May 2020 14:03:14 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Q3l567CWz4P5p; Sun, 17 May 2020 14:03:13 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD350116CF; Sun, 17 May 2020 14:03:13 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04HE3D6f032874; Sun, 17 May 2020 14:03:13 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HE3D1o032873; Sun, 17 May 2020 14:03:13 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <202005171403.04HE3D1o032873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Sun, 17 May 2020 14:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361134 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 361134 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, 17 May 2020 14:03:14 -0000 Author: fsu Date: Sun May 17 14:03:13 2020 New Revision: 361134 URL: https://svnweb.freebsd.org/changeset/base/361134 Log: Fix incorrect inode link count check in case of rename. The check was incorrect because the directory inode link count have min value 2 after dir_nlink extfs feature introduction. Modified: head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Sun May 17 14:00:54 2020 (r361133) +++ head/sys/fs/ext2fs/ext2_vnops.c Sun May 17 14:03:13 2020 (r361134) @@ -1018,10 +1018,11 @@ abortit: */ ext2_dec_nlink(xp); if (doingdirectory) { - if (--xp->i_nlink != 0) + if (xp->i_nlink > 2) panic("ext2_rename: linked directory"); error = ext2_truncate(tvp, (off_t)0, IO_SYNC, tcnp->cn_cred, tcnp->cn_thread); + xp->i_nlink = 0; } xp->i_flag |= IN_CHANGE; vput(tvp); From owner-svn-src-all@freebsd.org Sun May 17 14:10: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 342622DA9EE; Sun, 17 May 2020 14:10:47 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Q3vq0ZXJz4PLr; Sun, 17 May 2020 14:10:47 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0EF0A119AB; Sun, 17 May 2020 14:10:47 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04HEAk5u036512; Sun, 17 May 2020 14:10:46 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HEAkXQ036511; Sun, 17 May 2020 14:10:46 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <202005171410.04HEAkXQ036511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Sun, 17 May 2020 14:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361135 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 361135 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, 17 May 2020 14:10:47 -0000 Author: fsu Date: Sun May 17 14:10:46 2020 New Revision: 361135 URL: https://svnweb.freebsd.org/changeset/base/361135 Log: Restrict the max runp and runb return values in case of extents mapping. This restriction already present in case of indirect mapping, do the same in case of extents. PR: 246182 Reported by: Teran McKinney MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_bmap.c Modified: head/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- head/sys/fs/ext2fs/ext2_bmap.c Sun May 17 14:03:13 2020 (r361134) +++ head/sys/fs/ext2fs/ext2_bmap.c Sun May 17 14:10:46 2020 (r361135) @@ -94,21 +94,28 @@ ext4_bmapext(struct vnode *vp, int32_t bn, int64_t *bn { struct inode *ip; struct m_ext2fs *fs; + struct mount *mp; + struct ext2mount *ump; struct ext4_extent_header *ehp; struct ext4_extent *ep; struct ext4_extent_path *path = NULL; daddr_t lbn; - int error, depth; + int error, depth, maxrun = 0, bsize; ip = VTOI(vp); fs = ip->i_e2fs; + mp = vp->v_mount; + ump = VFSTOEXT2(mp); lbn = bn; ehp = (struct ext4_extent_header *)ip->i_data; depth = ehp->eh_depth; + bsize = EXT2_BLOCK_SIZE(ump->um_e2fs); *bnp = -1; - if (runp != NULL) + if (runp != NULL) { + maxrun = mp->mnt_iosize_max / bsize - 1; *runp = 0; + } if (runb != NULL) *runb = 0; @@ -119,18 +126,21 @@ ext4_bmapext(struct vnode *vp, int32_t bn, int64_t *bn ep = path[depth].ep_ext; if(ep) { if (lbn < ep->e_blk) { - if (runp != NULL) - *runp = ep->e_blk - lbn - 1; + if (runp != NULL) { + *runp = min(maxrun, ep->e_blk - lbn - 1); + } } else if (ep->e_blk <= lbn && lbn < ep->e_blk + ep->e_len) { *bnp = fsbtodb(fs, lbn - ep->e_blk + (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); - if (runp != NULL) - *runp = ep->e_len - (lbn - ep->e_blk) - 1; + if (runp != NULL) { + *runp = min(maxrun, + ep->e_len - (lbn - ep->e_blk) - 1); + } if (runb != NULL) - *runb = lbn - ep->e_blk; + *runb = min(maxrun, lbn - ep->e_blk); } else { if (runb != NULL) - *runb = ep->e_blk + lbn - ep->e_len; + *runb = min(maxrun, ep->e_blk + lbn - ep->e_len); } } From owner-svn-src-all@freebsd.org Sun May 17 14: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 0E6F32DBB96; Sun, 17 May 2020 14:52:56 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Q4rR6v2Fz4RkT; Sun, 17 May 2020 14:52:55 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD407121FB; Sun, 17 May 2020 14:52:55 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04HEqtrv063894; Sun, 17 May 2020 14:52:55 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HEqs7b063888; Sun, 17 May 2020 14:52:54 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <202005171452.04HEqs7b063888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Sun, 17 May 2020 14:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361136 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 361136 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, 17 May 2020 14:52:56 -0000 Author: fsu Date: Sun May 17 14:52:54 2020 New Revision: 361136 URL: https://svnweb.freebsd.org/changeset/base/361136 Log: Add BE architectures support. Author of most initial version: pfg (https://reviews.freebsd.org/D23259) Reviewed by: pfg MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D24685 Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_balloc.c head/sys/fs/ext2fs/ext2_bmap.c head/sys/fs/ext2fs/ext2_csum.c head/sys/fs/ext2fs/ext2_extattr.c head/sys/fs/ext2fs/ext2_extents.c head/sys/fs/ext2fs/ext2_extents.h head/sys/fs/ext2fs/ext2_htree.c head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/ext2fs/ext2_inode_cnv.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_subr.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/ext2fs/ext2fs.h head/sys/fs/ext2fs/fs.h Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Sun May 17 14:10:46 2020 (r361135) +++ head/sys/fs/ext2fs/ext2_alloc.c Sun May 17 14:52:54 2020 (r361136) @@ -397,7 +397,7 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred ump = pip->i_ump; EXT2_LOCK(ump); - if (fs->e2fs->e2fs_ficount == 0) + if (fs->e2fs_ficount == 0) goto noinodes; /* * If it is a directory then obtain a cylinder group based on @@ -413,7 +413,7 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred if (fs->e2fs_contigdirs[cg] > 0) fs->e2fs_contigdirs[cg]--; } - ipref = cg * fs->e2fs->e2fs_ipg + 1; + ipref = cg * fs->e2fs_ipg + 1; ino = (ino_t)ext2_hashalloc(pip, cg, (long)ipref, mode, ext2_nodealloccg); if (ino == 0) goto noinodes; @@ -501,87 +501,87 @@ uint64_t e2fs_gd_get_b_bitmap(struct ext2_gd *gd) { - return (((uint64_t)(gd->ext4bgd_b_bitmap_hi) << 32) | - gd->ext2bgd_b_bitmap); + return (((uint64_t)(le32toh(gd->ext4bgd_b_bitmap_hi)) << 32) | + le32toh(gd->ext2bgd_b_bitmap)); } uint64_t e2fs_gd_get_i_bitmap(struct ext2_gd *gd) { - return (((uint64_t)(gd->ext4bgd_i_bitmap_hi) << 32) | - gd->ext2bgd_i_bitmap); + return (((uint64_t)(le32toh(gd->ext4bgd_i_bitmap_hi)) << 32) | + le32toh(gd->ext2bgd_i_bitmap)); } uint64_t e2fs_gd_get_i_tables(struct ext2_gd *gd) { - return (((uint64_t)(gd->ext4bgd_i_tables_hi) << 32) | - gd->ext2bgd_i_tables); + return (((uint64_t)(le32toh(gd->ext4bgd_i_tables_hi)) << 32) | + le32toh(gd->ext2bgd_i_tables)); } static uint32_t e2fs_gd_get_nbfree(struct ext2_gd *gd) { - return (((uint32_t)(gd->ext4bgd_nbfree_hi) << 16) | - gd->ext2bgd_nbfree); + return (((uint32_t)(le16toh(gd->ext4bgd_nbfree_hi)) << 16) | + le16toh(gd->ext2bgd_nbfree)); } static void e2fs_gd_set_nbfree(struct ext2_gd *gd, uint32_t val) { - gd->ext2bgd_nbfree = val & 0xffff; - gd->ext4bgd_nbfree_hi = val >> 16; + gd->ext2bgd_nbfree = htole16(val & 0xffff); + gd->ext4bgd_nbfree_hi = htole16(val >> 16); } static uint32_t e2fs_gd_get_nifree(struct ext2_gd *gd) { - return (((uint32_t)(gd->ext4bgd_nifree_hi) << 16) | - gd->ext2bgd_nifree); + return (((uint32_t)(le16toh(gd->ext4bgd_nifree_hi)) << 16) | + le16toh(gd->ext2bgd_nifree)); } static void e2fs_gd_set_nifree(struct ext2_gd *gd, uint32_t val) { - gd->ext2bgd_nifree = val & 0xffff; - gd->ext4bgd_nifree_hi = val >> 16; + gd->ext2bgd_nifree = htole16(val & 0xffff); + gd->ext4bgd_nifree_hi = htole16(val >> 16); } uint32_t e2fs_gd_get_ndirs(struct ext2_gd *gd) { - return (((uint32_t)(gd->ext4bgd_ndirs_hi) << 16) | - gd->ext2bgd_ndirs); + return (((uint32_t)(le16toh(gd->ext4bgd_ndirs_hi)) << 16) | + le16toh(gd->ext2bgd_ndirs)); } static void e2fs_gd_set_ndirs(struct ext2_gd *gd, uint32_t val) { - gd->ext2bgd_ndirs = val & 0xffff; - gd->ext4bgd_ndirs_hi = val >> 16; + gd->ext2bgd_ndirs = htole16(val & 0xffff); + gd->ext4bgd_ndirs_hi = htole16(val >> 16); } static uint32_t e2fs_gd_get_i_unused(struct ext2_gd *gd) { - return (((uint32_t)(gd->ext4bgd_i_unused_hi) << 16) | - gd->ext4bgd_i_unused); + return ((uint32_t)(le16toh(gd->ext4bgd_i_unused_hi) << 16) | + le16toh(gd->ext4bgd_i_unused)); } static void e2fs_gd_set_i_unused(struct ext2_gd *gd, uint32_t val) { - gd->ext4bgd_i_unused = val & 0xffff; - gd->ext4bgd_i_unused_hi = val >> 16; + gd->ext4bgd_i_unused = htole16(val & 0xffff); + gd->ext4bgd_i_unused_hi = htole16(val >> 16); } /* @@ -612,7 +612,7 @@ ext2_dirpref(struct inode *pip) mtx_assert(EXT2_MTX(pip->i_ump), MA_OWNED); fs = pip->i_e2fs; - avgifree = fs->e2fs->e2fs_ficount / fs->e2fs_gcount; + avgifree = fs->e2fs_ficount / fs->e2fs_gcount; avgbfree = fs->e2fs_fbcount / fs->e2fs_gcount; avgndir = fs->e2fs_total_dir / fs->e2fs_gcount; @@ -653,7 +653,8 @@ ext2_dirpref(struct inode *pip) minbfree = 1; cgsize = fs->e2fs_fsize * fs->e2fs_fpg; dirsize = AVGDIRSIZE; - curdirsize = avgndir ? (cgsize - avgbfree * fs->e2fs_bsize) / avgndir : 0; + curdirsize = avgndir ? + (cgsize - avgbfree * fs->e2fs_bsize) / avgndir : 0; if (dirsize < curdirsize) dirsize = curdirsize; maxcontigdirs = min((avgbfree * fs->e2fs_bsize) / dirsize, 255); @@ -731,7 +732,7 @@ ext2_blkpref(struct inode *ip, e2fs_lbn_t lbn, int ind if (bap) for (tmp = indx - 1; tmp >= 0; tmp--) if (bap[tmp]) - return bap[tmp]; + return (le32toh(bap[tmp])); /* * Else lets fall back to the blocknr or, if there is none, follow @@ -739,7 +740,7 @@ ext2_blkpref(struct inode *ip, e2fs_lbn_t lbn, int ind */ return (blocknr ? blocknr : (e2fs_daddr_t)(ip->i_block_group * - EXT2_BLOCKS_PER_GROUP(fs)) + fs->e2fs->e2fs_first_dblock); + EXT2_BLOCKS_PER_GROUP(fs)) + le32toh(fs->e2fs->e2fs_first_dblock)); } /* @@ -802,7 +803,7 @@ ext2_cg_number_gdb_nometa(struct m_ext2fs *fs, int cg) return (0); if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_META_BG)) - return (fs->e2fs->e3fs_first_meta_bg); + return (le32toh(fs->e2fs->e3fs_first_meta_bg)); return ((fs->e2fs_gcount + EXT2_DESCS_PER_BLOCK(fs) - 1) / EXT2_DESCS_PER_BLOCK(fs)); @@ -829,7 +830,7 @@ ext2_cg_number_gdb(struct m_ext2fs *fs, int cg) { unsigned long first_meta_bg, metagroup; - first_meta_bg = fs->e2fs->e3fs_first_meta_bg; + first_meta_bg = le32toh(fs->e2fs->e3fs_first_meta_bg); metagroup = cg / EXT2_DESCS_PER_BLOCK(fs); if (!EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_META_BG) || @@ -847,10 +848,11 @@ ext2_number_base_meta_blocks(struct m_ext2fs *fs, int number = ext2_cg_has_sb(fs, cg); if (!EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_META_BG) || - cg < fs->e2fs->e3fs_first_meta_bg * EXT2_DESCS_PER_BLOCK(fs)) { + cg < le32toh(fs->e2fs->e3fs_first_meta_bg) * + EXT2_DESCS_PER_BLOCK(fs)) { if (number) { number += ext2_cg_number_gdb(fs, cg); - number += fs->e2fs->e2fs_reserved_ngdb; + number += le16toh(fs->e2fs->e2fs_reserved_ngdb); } } else { number += ext2_cg_number_gdb(fs, cg); @@ -877,7 +879,8 @@ static int ext2_get_group_number(struct m_ext2fs *fs, e4fs_daddr_t block) { - return ((block - fs->e2fs->e2fs_first_dblock) / fs->e2fs_bsize); + return ((block - le32toh(fs->e2fs->e2fs_first_dblock)) / + fs->e2fs_bsize); } static int @@ -893,7 +896,7 @@ ext2_cg_block_bitmap_init(struct m_ext2fs *fs, int cg, int bit, bit_max, inodes_per_block; uint64_t start, tmp; - if (!(fs->e2fs_gd[cg].ext4bgd_flags & EXT2_BG_BLOCK_UNINIT)) + if (!(le16toh(fs->e2fs_gd[cg].ext4bgd_flags) & EXT2_BG_BLOCK_UNINIT)) return (0); memset(bp->b_data, 0, fs->e2fs_bsize); @@ -905,7 +908,8 @@ ext2_cg_block_bitmap_init(struct m_ext2fs *fs, int cg, for (bit = 0; bit < bit_max; bit++) setbit(bp->b_data, bit); - start = (uint64_t)cg * fs->e2fs->e2fs_bpg + fs->e2fs->e2fs_first_dblock; + start = (uint64_t)cg * fs->e2fs_bpg + + le32toh(fs->e2fs->e2fs_first_dblock); /* Set bits for block and inode bitmaps, and inode table. */ tmp = e2fs_gd_get_b_bitmap(&fs->e2fs_gd[cg]); @@ -921,7 +925,7 @@ ext2_cg_block_bitmap_init(struct m_ext2fs *fs, int cg, tmp = e2fs_gd_get_i_tables(&fs->e2fs_gd[cg]); inodes_per_block = fs->e2fs_bsize/EXT2_INODE_SIZE(fs); while( tmp < e2fs_gd_get_i_tables(&fs->e2fs_gd[cg]) + - fs->e2fs->e2fs_ipg / inodes_per_block ) { + fs->e2fs_ipg / inodes_per_block ) { if (!EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_FLEX_BG) || ext2_block_in_group(fs, tmp, cg)) setbit(bp->b_data, tmp - start); @@ -933,11 +937,12 @@ ext2_cg_block_bitmap_init(struct m_ext2fs *fs, int cg, * the blocksize * 8 ( which is the size of bitmap ), set rest * of the block bitmap to 1 */ - ext2_mark_bitmap_end(fs->e2fs->e2fs_bpg, fs->e2fs_bsize * 8, + ext2_mark_bitmap_end(fs->e2fs_bpg, fs->e2fs_bsize * 8, bp->b_data); /* Clean the flag */ - fs->e2fs_gd[cg].ext4bgd_flags &= ~EXT2_BG_BLOCK_UNINIT; + fs->e2fs_gd[cg].ext4bgd_flags = htole16(le16toh( + fs->e2fs_gd[cg].ext4bgd_flags) & ~EXT2_BG_BLOCK_UNINIT); return (0); } @@ -951,8 +956,8 @@ ext2_b_bitmap_validate(struct m_ext2fs *fs, struct buf if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_FLEX_BG)) { /* - * It is not possible to check block bitmap in case of this feature, - * because the inode and block bitmaps and inode table + * It is not possible to check block bitmap in case of this + * feature, because the inode and block bitmaps and inode table * blocks may not be in the group at all. * So, skip check in this case. */ @@ -961,8 +966,8 @@ ext2_b_bitmap_validate(struct m_ext2fs *fs, struct buf gd = &fs->e2fs_gd[cg]; max_bit = fs->e2fs_fpg; - group_first_block = ((uint64_t)cg) * fs->e2fs->e2fs_fpg + - fs->e2fs->e2fs_first_dblock; + group_first_block = ((uint64_t)cg) * fs->e2fs_fpg + + le32toh(fs->e2fs->e2fs_first_dblock); /* Check block bitmap block number */ offset = e2fs_gd_get_b_bitmap(gd) - group_first_block; @@ -1036,8 +1041,8 @@ ext2_alloccg(struct inode *ip, int cg, daddr_t bpref, goto fail; /* - * Check, that another thread did not not allocate the last block in this - * group while we were waiting for the buffer. + * Check, that another thread did not not allocate the last block in + * this group while we were waiting for the buffer. */ if (e2fs_gd_get_nbfree(&fs->e2fs_gd[cg]) == 0) goto fail; @@ -1066,7 +1071,7 @@ ext2_alloccg(struct inode *ip, int cg, daddr_t bpref, start = dtogd(fs, bpref) / NBBY; else start = 0; - end = howmany(fs->e2fs->e2fs_fpg, NBBY) - start; + end = howmany(fs->e2fs_fpg, NBBY) - start; retry: runlen = 0; runstart = 0; @@ -1135,7 +1140,8 @@ gotit: EXT2_UNLOCK(ump); ext2_gd_b_bitmap_csum_set(fs, cg, bp); bdwrite(bp); - return (((uint64_t)cg) * fs->e2fs->e2fs_fpg + fs->e2fs->e2fs_first_dblock + bno); + return (((uint64_t)cg) * fs->e2fs_fpg + + le32toh(fs->e2fs->e2fs_first_dblock) + bno); fail: brelse(bp); @@ -1203,7 +1209,7 @@ ext2_clusteralloc(struct inode *ip, int cg, daddr_t bp bpref = dtogd(fs, bpref); loc = bpref / NBBY; bit = 1 << (bpref % NBBY); - for (run = 0, got = bpref; got < fs->e2fs->e2fs_fpg; got++) { + for (run = 0, got = bpref; got < fs->e2fs_fpg; got++) { if ((bbp[loc] & bit) != 0) run = 0; else { @@ -1219,7 +1225,7 @@ ext2_clusteralloc(struct inode *ip, int cg, daddr_t bp } } - if (got >= fs->e2fs->e2fs_fpg) + if (got >= fs->e2fs_fpg) goto fail_lock; /* Allocate the cluster that we found. */ @@ -1228,7 +1234,7 @@ ext2_clusteralloc(struct inode *ip, int cg, daddr_t bp panic("ext2_clusteralloc: map mismatch"); bno = got - run + 1; - if (bno >= fs->e2fs->e2fs_fpg) + if (bno >= fs->e2fs_fpg) panic("ext2_clusteralloc: allocated out of group"); EXT2_LOCK(ump); @@ -1243,7 +1249,8 @@ ext2_clusteralloc(struct inode *ip, int cg, daddr_t bp EXT2_UNLOCK(ump); bdwrite(bp); - return (cg * fs->e2fs->e2fs_fpg + fs->e2fs->e2fs_first_dblock + bno); + return (cg * fs->e2fs_fpg + le32toh(fs->e2fs->e2fs_first_dblock) + + bno); fail_lock: EXT2_LOCK(ump); @@ -1261,13 +1268,13 @@ ext2_zero_inode_table(struct inode *ip, int cg) fs = ip->i_e2fs; - if (fs->e2fs_gd[cg].ext4bgd_flags & EXT2_BG_INODE_ZEROED) + if (le16toh(fs->e2fs_gd[cg].ext4bgd_flags) & EXT2_BG_INODE_ZEROED) return (0); - all_blks = fs->e2fs->e2fs_inode_size * fs->e2fs->e2fs_ipg / + all_blks = le16toh(fs->e2fs->e2fs_inode_size) * fs->e2fs_ipg / fs->e2fs_bsize; - used_blks = howmany(fs->e2fs->e2fs_ipg - + used_blks = howmany(fs->e2fs_ipg - e2fs_gd_get_i_unused(&fs->e2fs_gd[cg]), fs->e2fs_bsize / EXT2_INODE_SIZE(fs)); @@ -1282,7 +1289,8 @@ ext2_zero_inode_table(struct inode *ip, int cg) bawrite(bp); } - fs->e2fs_gd[cg].ext4bgd_flags |= EXT2_BG_INODE_ZEROED; + fs->e2fs_gd[cg].ext4bgd_flags = htole16(le16toh( + fs->e2fs_gd[cg].ext4bgd_flags) | EXT2_BG_INODE_ZEROED); return (0); } @@ -1329,12 +1337,15 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr } if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) || EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { - if (fs->e2fs_gd[cg].ext4bgd_flags & EXT2_BG_INODE_UNINIT) { + if (le16toh(fs->e2fs_gd[cg].ext4bgd_flags) & + EXT2_BG_INODE_UNINIT) { ibytes = fs->e2fs_ipg / 8; memset(bp->b_data, 0, ibytes - 1); ext2_fix_bitmap_tail(bp->b_data, ibytes, fs->e2fs_bsize - 1); - fs->e2fs_gd[cg].ext4bgd_flags &= ~EXT2_BG_INODE_UNINIT; + fs->e2fs_gd[cg].ext4bgd_flags = htole16(le16toh( + fs->e2fs_gd[cg].ext4bgd_flags) & + ~EXT2_BG_INODE_UNINIT); } ext2_gd_i_bitmap_csum_set(fs, cg, bp); error = ext2_zero_inode_table(ip, cg); @@ -1361,20 +1372,21 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr } ibp = (char *)bp->b_data; if (ipref) { - ipref %= fs->e2fs->e2fs_ipg; + ipref %= fs->e2fs_ipg; if (isclr(ibp, ipref)) goto gotit; } start = ipref / NBBY; - len = howmany(fs->e2fs->e2fs_ipg - ipref, NBBY); + len = howmany(fs->e2fs_ipg - ipref, NBBY); loc = memcchr(&ibp[start], 0xff, len); if (loc == NULL) { len = start + 1; start = 0; loc = memcchr(&ibp[start], 0xff, len); if (loc == NULL) { - SDT_PROBE3(ext2fs, , alloc, ext2_nodealloccg_bmap_corrupted, - cg, ipref, fs->e2fs_fsmnt); + SDT_PROBE3(ext2fs, , alloc, + ext2_nodealloccg_bmap_corrupted, cg, ipref, + fs->e2fs_fsmnt); brelse(bp); EXT2_LOCK(ump); return (0); @@ -1388,12 +1400,12 @@ gotit: e2fs_gd_get_nifree(&fs->e2fs_gd[cg]) - 1); if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) || EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { - ifree = fs->e2fs->e2fs_ipg - e2fs_gd_get_i_unused(&fs->e2fs_gd[cg]); + ifree = fs->e2fs_ipg - e2fs_gd_get_i_unused(&fs->e2fs_gd[cg]); if (ipref + 1 > ifree) e2fs_gd_set_i_unused(&fs->e2fs_gd[cg], - fs->e2fs->e2fs_ipg - (ipref + 1)); + fs->e2fs_ipg - (ipref + 1)); } - fs->e2fs->e2fs_ficount--; + fs->e2fs_ficount--; fs->e2fs_fmod = 1; if ((mode & IFMT) == IFDIR) { e2fs_gd_set_ndirs(&fs->e2fs_gd[cg], @@ -1423,7 +1435,8 @@ ext2_blkfree(struct inode *ip, e4fs_daddr_t bno, long ump = ip->i_ump; cg = dtog(fs, bno); if (bno >= fs->e2fs_bcount) { - SDT_PROBE2(ext2fs, , alloc, ext2_blkfree_bad_block, ip->i_number, bno); + SDT_PROBE2(ext2fs, , alloc, ext2_blkfree_bad_block, + ip->i_number, bno); return; } error = bread(ip->i_devvp, @@ -1479,7 +1492,7 @@ ext2_vfree(struct vnode *pvp, ino_t ino, int mode) return (0); } ibp = (char *)bp->b_data; - ino = (ino - 1) % fs->e2fs->e2fs_ipg; + ino = (ino - 1) % fs->e2fs_ipg; if (isclr(ibp, ino)) { SDT_PROBE2(ext2fs, , alloc, ext2_vfree_doublefree, fs->e2fs_fsmnt, ino); @@ -1488,7 +1501,7 @@ ext2_vfree(struct vnode *pvp, ino_t ino, int mode) } clrbit(ibp, ino); EXT2_LOCK(ump); - fs->e2fs->e2fs_ficount++; + fs->e2fs_ficount++; e2fs_gd_set_nifree(&fs->e2fs_gd[cg], e2fs_gd_get_nifree(&fs->e2fs_gd[cg]) + 1); if ((mode & IFMT) == IFDIR) { @@ -1523,15 +1536,15 @@ ext2_mapsearch(struct m_ext2fs *fs, char *bbp, daddr_t start = dtogd(fs, bpref) / NBBY; else start = 0; - len = howmany(fs->e2fs->e2fs_fpg, NBBY) - start; + len = howmany(fs->e2fs_fpg, NBBY) - start; loc = memcchr(&bbp[start], 0xff, len); if (loc == NULL) { len = start + 1; start = 0; loc = memcchr(&bbp[start], 0xff, len); if (loc == NULL) { - panic("ext2_mapsearch: map corrupted: start=%d, len=%d, fs=%s", - start, len, fs->e2fs_fsmnt); + panic("ext2_mapsearch: map corrupted: start=%d, len=%d," + "fs=%s", start, len, fs->e2fs_fsmnt); /* NOTREACHED */ } } @@ -1547,8 +1560,8 @@ ext2_cg_has_sb(struct m_ext2fs *fs, int cg) return (1); if (EXT2_HAS_COMPAT_FEATURE(fs, EXT2F_COMPAT_SPARSESUPER2)) { - if (cg == fs->e2fs->e4fs_backup_bgs[0] || - cg == fs->e2fs->e4fs_backup_bgs[1]) + if (cg == le32toh(fs->e2fs->e4fs_backup_bgs[0]) || + cg == le32toh(fs->e2fs->e4fs_backup_bgs[1])) return (1); return (0); } Modified: head/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_balloc.c Sun May 17 14:10:46 2020 (r361135) +++ head/sys/fs/ext2fs/ext2_balloc.c Sun May 17 14:52:54 2020 (r361136) @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -220,7 +221,7 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size return (error); } bap = (e2fs_daddr_t *)bp->b_data; - nb = bap[indirs[i].in_off]; + nb = le32toh(bap[indirs[i].in_off]); if (i == num) break; i += 1; @@ -252,7 +253,7 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size brelse(bp); return (error); } - bap[indirs[i - 1].in_off] = nb; + bap[indirs[i - 1].in_off] = htole32(nb); /* * If required, write synchronously, otherwise use * delayed write. @@ -284,7 +285,7 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size nbp->b_blkno = fsbtodb(fs, nb); if (flags & BA_CLRBUF) vfs_bio_clrbuf(nbp); - bap[indirs[i].in_off] = nb; + bap[indirs[i].in_off] = htole32(nb); /* * If required, write synchronously, otherwise use * delayed write. Modified: head/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- head/sys/fs/ext2fs/ext2_bmap.c Sun May 17 14:10:46 2020 (r361135) +++ head/sys/fs/ext2fs/ext2_bmap.c Sun May 17 14:52:54 2020 (r361136) @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -108,7 +109,7 @@ ext4_bmapext(struct vnode *vp, int32_t bn, int64_t *bn ump = VFSTOEXT2(mp); lbn = bn; ehp = (struct ext4_extent_header *)ip->i_data; - depth = ehp->eh_depth; + depth = le16toh(ehp->eh_depth); bsize = EXT2_BLOCK_SIZE(ump->um_e2fs); *bnp = -1; @@ -125,22 +126,26 @@ ext4_bmapext(struct vnode *vp, int32_t bn, int64_t *bn ep = path[depth].ep_ext; if(ep) { - if (lbn < ep->e_blk) { + if (lbn < le32toh(ep->e_blk)) { if (runp != NULL) { - *runp = min(maxrun, ep->e_blk - lbn - 1); + *runp = min(maxrun, le32toh(ep->e_blk) - lbn - 1); } - } else if (ep->e_blk <= lbn && lbn < ep->e_blk + ep->e_len) { - *bnp = fsbtodb(fs, lbn - ep->e_blk + - (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); + } else if (le32toh(ep->e_blk) <= lbn && + lbn < le32toh(ep->e_blk) + le16toh(ep->e_len)) { + *bnp = fsbtodb(fs, lbn - le32toh(ep->e_blk) + + (le32toh(ep->e_start_lo) | + (daddr_t)le16toh(ep->e_start_hi) << 32)); if (runp != NULL) { *runp = min(maxrun, - ep->e_len - (lbn - ep->e_blk) - 1); + le16toh(ep->e_len) - + (lbn - le32toh(ep->e_blk)) - 1); } if (runb != NULL) - *runb = min(maxrun, lbn - ep->e_blk); + *runb = min(maxrun, lbn - le32toh(ep->e_blk)); } else { if (runb != NULL) - *runb = min(maxrun, ep->e_blk + lbn - ep->e_len); + *runb = min(maxrun, le32toh(ep->e_blk) + lbn - + le16toh(ep->e_len)); } } @@ -283,7 +288,7 @@ ext2_bmaparray(struct vnode *vp, daddr_t bn, daddr_t * if (error != 0) return (error); - daddr = ((e2fs_daddr_t *)bp->b_data)[ap->in_off]; + daddr = le32toh(((e2fs_daddr_t *)bp->b_data)[ap->in_off]); if (num == 1 && daddr && runp) { for (bn = ap->in_off + 1; bn < MNINDIR(ump) && *runp < maxrun && @@ -395,7 +400,7 @@ ext2_bmap_seekdata(struct vnode *vp, off_t *offp) */ off = ap->in_off; do { - daddr = ((e2fs_daddr_t *)bp->b_data)[off]; + daddr = le32toh(((e2fs_daddr_t *)bp->b_data)[off]); } while (daddr == 0 && ++off < MNINDIR(ump)); nextbn += off * lbn_count(ump, num - 1); Modified: head/sys/fs/ext2fs/ext2_csum.c ============================================================================== --- head/sys/fs/ext2fs/ext2_csum.c Sun May 17 14:10:46 2020 (r361135) +++ head/sys/fs/ext2fs/ext2_csum.c Sun May 17 14:52:54 2020 (r361136) @@ -77,7 +77,7 @@ ext2_sb_csum_set_seed(struct m_ext2fs *fs) { if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_CSUM_SEED)) - fs->e2fs_csum_seed = fs->e2fs->e4fs_chksum_seed; + fs->e2fs_csum_seed = le32toh(fs->e2fs->e4fs_chksum_seed); else if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { fs->e2fs_csum_seed = calculate_crc32c(~0, fs->e2fs->e2fs_uuid, sizeof(fs->e2fs->e2fs_uuid)); @@ -95,13 +95,14 @@ ext2_sb_csum_verify(struct m_ext2fs *fs) "WARNING: mount of %s denied due bad sb csum type\n", fs->e2fs_fsmnt); return (EINVAL); } - if (fs->e2fs->e4fs_sbchksum != + if (le32toh(fs->e2fs->e4fs_sbchksum) != calculate_crc32c(~0, (const char *)fs->e2fs, offsetof(struct ext2fs, e4fs_sbchksum))) { printf( "WARNING: mount of %s denied due bad sb csum=0x%x, expected=0x%x - run fsck\n", - fs->e2fs_fsmnt, fs->e2fs->e4fs_sbchksum, calculate_crc32c(~0, - (const char *)fs->e2fs, offsetof(struct ext2fs, e4fs_sbchksum))); + fs->e2fs_fsmnt, le32toh(fs->e2fs->e4fs_sbchksum), + calculate_crc32c(~0, (const char *)fs->e2fs, + offsetof(struct ext2fs, e4fs_sbchksum))); return (EINVAL); } @@ -112,8 +113,9 @@ void ext2_sb_csum_set(struct m_ext2fs *fs) { - fs->e2fs->e4fs_sbchksum = calculate_crc32c(~0, (const char *)fs->e2fs, - offsetof(struct ext2fs, e4fs_sbchksum)); + fs->e2fs->e4fs_sbchksum = + htole32(calculate_crc32c(~0, (const char *)fs->e2fs, + offsetof(struct ext2fs, e4fs_sbchksum))); } static uint32_t @@ -121,18 +123,22 @@ ext2_extattr_blk_csum(struct inode *ip, uint64_t facl, struct ext2fs_extattr_header *header) { struct m_ext2fs *fs; - uint32_t crc, old_crc; + uint32_t crc, dummy_crc = 0; + uint64_t facl_bn = htole64(facl); + int offset = offsetof(struct ext2fs_extattr_header, h_checksum); fs = ip->i_e2fs; - old_crc = header->h_checksum; + crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&facl_bn, + sizeof(facl_bn)); + crc = calculate_crc32c(crc, (uint8_t *)header, offset); + crc = calculate_crc32c(crc, (uint8_t *)&dummy_crc, + sizeof(dummy_crc)); + offset += sizeof(dummy_crc); + crc = calculate_crc32c(crc, (uint8_t *)header + offset, + fs->e2fs_bsize - offset); - header->h_checksum = 0; - crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&facl, sizeof(facl)); - crc = calculate_crc32c(crc, (uint8_t *)header, fs->e2fs_bsize); - header->h_checksum = old_crc; - - return (crc); + return (htole32(crc)); } int @@ -167,7 +173,7 @@ void ext2_init_dirent_tail(struct ext2fs_direct_tail *tp) { memset(tp, 0, sizeof(struct ext2fs_direct_tail)); - tp->e2dt_rec_len = sizeof(struct ext2fs_direct_tail); + tp->e2dt_rec_len = le16toh(sizeof(struct ext2fs_direct_tail)); tp->e2dt_reserved_ft = EXT2_FT_DIR_CSUM; } @@ -184,7 +190,7 @@ ext2_is_dirent_tail(struct inode *ip, struct ext2fs_di tp = (struct ext2fs_direct_tail *)ep; if (tp->e2dt_reserved_zero1 == 0 && - tp->e2dt_rec_len == sizeof(struct ext2fs_direct_tail) && + le16toh(tp->e2dt_rec_len) == sizeof(struct ext2fs_direct_tail) && tp->e2dt_reserved_zero2 == 0 && tp->e2dt_reserved_ft == EXT2_FT_DIR_CSUM) return (1); @@ -201,13 +207,13 @@ ext2_dirent_get_tail(struct inode *ip, struct ext2fs_d dep = ep; top = EXT2_DIRENT_TAIL(ep, ip->i_e2fs->e2fs_bsize); - rec_len = dep->e2d_reclen; + rec_len = le16toh(dep->e2d_reclen); while (rec_len && !(rec_len & 0x3)) { dep = (struct ext2fs_direct_2 *)(((char *)dep) + rec_len); if ((void *)dep >= top) break; - rec_len = dep->e2d_reclen; + rec_len = le16toh(dep->e2d_reclen); } if (dep != top) @@ -230,8 +236,8 @@ ext2_dirent_csum(struct inode *ip, struct ext2fs_direc buf = (char *)ep; - inum = ip->i_number; - gen = ip->i_gen; + inum = htole32(ip->i_number); + gen = htole32(ip->i_gen); crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&inum, sizeof(inum)); crc = calculate_crc32c(crc, (uint8_t *)&gen, sizeof(gen)); crc = calculate_crc32c(crc, (uint8_t *)buf, size); @@ -250,7 +256,7 @@ ext2_dirent_csum_verify(struct inode *ip, struct ext2f return (0); calculated = ext2_dirent_csum(ip, ep, (char *)tp - (char *)ep); - if (calculated != tp->e2dt_checksum) + if (calculated != le32toh(tp->e2dt_checksum)) return (EIO); return (0); @@ -263,11 +269,11 @@ ext2_get_dx_count(struct inode *ip, struct ext2fs_dire struct ext2fs_htree_root_info *root; int count_offset; - if (ep->e2d_reclen == EXT2_BLOCK_SIZE(ip->i_e2fs)) + if (le16toh(ep->e2d_reclen) == EXT2_BLOCK_SIZE(ip->i_e2fs)) count_offset = 8; - else if (ep->e2d_reclen == 12) { + else if (le16toh(ep->e2d_reclen) == 12) { dp = (struct ext2fs_direct_2 *)(((char *)ep) + 12); - if (dp->e2d_reclen != EXT2_BLOCK_SIZE(ip->i_e2fs) - 12) + if (le16toh(dp->e2d_reclen) != EXT2_BLOCK_SIZE(ip->i_e2fs) - 12) return (NULL); root = (struct ext2fs_htree_root_info *)(((char *)dp + 12)); @@ -302,15 +308,15 @@ ext2_dx_csum(struct inode *ip, struct ext2fs_direct_2 old_csum = tp->ht_checksum; tp->ht_checksum = 0; - inum = ip->i_number; - gen = ip->i_gen; + inum = htole32(ip->i_number); + gen = htole32(ip->i_gen); crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&inum, sizeof(inum)); crc = calculate_crc32c(crc, (uint8_t *)&gen, sizeof(gen)); crc = calculate_crc32c(crc, (uint8_t *)buf, size); crc = calculate_crc32c(crc, (uint8_t *)tp, sizeof(struct ext2fs_htree_tail)); tp->ht_checksum = old_csum; - return (crc); + return htole32(crc); } int @@ -325,8 +331,8 @@ ext2_dx_csum_verify(struct inode *ip, struct ext2fs_di if (cp == NULL) return (0); - limit = cp->h_entries_max; - count = cp->h_entries_num; + limit = le16toh(cp->h_entries_max); + count = le16toh(cp->h_entries_num); if (count_offset + (limit * sizeof(struct ext2fs_htree_entry)) > ip->i_e2fs->e2fs_bsize - sizeof(struct ext2fs_htree_tail)) return (EIO); @@ -381,7 +387,7 @@ ext2_dirent_csum_set(struct inode *ip, struct ext2fs_d return; tp->e2dt_checksum = - ext2_dirent_csum(ip, ep, (char *)tp - (char *)ep); + htole32(ext2_dirent_csum(ip, ep, (char *)tp - (char *)ep)); } void @@ -401,8 +407,8 @@ ext2_dx_csum_set(struct inode *ip, struct ext2fs_direc if (cp == NULL) return; - limit = cp->h_entries_max; - count = cp->h_entries_num; + limit = le16toh(cp->h_entries_max); + count = le16toh(cp->h_entries_num); if (count_offset + (limit * sizeof(struct ext2fs_htree_entry)) > ip->i_e2fs->e2fs_bsize - sizeof(struct ext2fs_htree_tail)) return; @@ -423,8 +429,8 @@ ext2_extent_blk_csum(struct inode *ip, struct ext4_ext size = EXT4_EXTENT_TAIL_OFFSET(ehp) + offsetof(struct ext4_extent_tail, et_checksum); - inum = ip->i_number; - gen = ip->i_gen; + inum = htole32(ip->i_number); + gen = htole32(ip->i_gen); crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&inum, sizeof(inum)); crc = calculate_crc32c(crc, (uint8_t *)&gen, sizeof(gen)); crc = calculate_crc32c(crc, (uint8_t *)ehp, size); @@ -449,7 +455,7 @@ ext2_extent_blk_csum_verify(struct inode *ip, void *da etp = (struct ext4_extent_tail *)(((char *)ehp) + EXT4_EXTENT_TAIL_OFFSET(ehp)); - provided = etp->et_checksum; + provided = le32toh(etp->et_checksum); calculated = ext2_extent_blk_csum(ip, ehp); if (provided != calculated) { @@ -476,8 +482,8 @@ ext2_extent_blk_csum_set(struct inode *ip, void *data) etp = (struct ext4_extent_tail *)(((char *)data) + EXT4_EXTENT_TAIL_OFFSET(ehp)); - etp->et_checksum = ext2_extent_blk_csum(ip, - (struct ext4_extent_header *)data); + etp->et_checksum = htole32(ext2_extent_blk_csum(ip, + (struct ext4_extent_header *)data)); } int @@ -488,11 +494,12 @@ ext2_gd_i_bitmap_csum_verify(struct m_ext2fs *fs, int if (!EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) return (0); - provided = fs->e2fs_gd[cg].ext4bgd_i_bmap_csum; + provided = le16toh(fs->e2fs_gd[cg].ext4bgd_i_bmap_csum); calculated = calculate_crc32c(fs->e2fs_csum_seed, bp->b_data, - fs->e2fs->e2fs_ipg / 8); - if (fs->e2fs->e3fs_desc_size >= EXT2_BG_INODE_BITMAP_CSUM_HI_END) { - hi = fs->e2fs_gd[cg].ext4bgd_i_bmap_csum_hi; + fs->e2fs_ipg / 8); + if (le16toh(fs->e2fs->e3fs_desc_size) >= + EXT2_BG_INODE_BITMAP_CSUM_HI_END) { + hi = le16toh(fs->e2fs_gd[cg].ext4bgd_i_bmap_csum_hi); provided |= (hi << 16); } else calculated &= 0xFFFF; @@ -514,10 +521,10 @@ ext2_gd_i_bitmap_csum_set(struct m_ext2fs *fs, int cg, return; csum = calculate_crc32c(fs->e2fs_csum_seed, bp->b_data, - fs->e2fs->e2fs_ipg / 8); - fs->e2fs_gd[cg].ext4bgd_i_bmap_csum = csum & 0xFFFF; - if (fs->e2fs->e3fs_desc_size >= EXT2_BG_INODE_BITMAP_CSUM_HI_END) - fs->e2fs_gd[cg].ext4bgd_i_bmap_csum_hi = csum >> 16; + fs->e2fs_ipg / 8); + fs->e2fs_gd[cg].ext4bgd_i_bmap_csum = htole16(csum & 0xFFFF); + if (le16toh(fs->e2fs->e3fs_desc_size) >= EXT2_BG_INODE_BITMAP_CSUM_HI_END) + fs->e2fs_gd[cg].ext4bgd_i_bmap_csum_hi = htole16(csum >> 16); } int @@ -529,10 +536,11 @@ ext2_gd_b_bitmap_csum_verify(struct m_ext2fs *fs, int return (0); size = fs->e2fs_fpg / 8; - provided = fs->e2fs_gd[cg].ext4bgd_b_bmap_csum; + provided = le16toh(fs->e2fs_gd[cg].ext4bgd_b_bmap_csum); calculated = calculate_crc32c(fs->e2fs_csum_seed, bp->b_data, size); - if (fs->e2fs->e3fs_desc_size >= EXT2_BG_BLOCK_BITMAP_CSUM_HI_LOCATION) { - hi = fs->e2fs_gd[cg].ext4bgd_b_bmap_csum_hi; + if (le16toh(fs->e2fs->e3fs_desc_size) >= + EXT2_BG_BLOCK_BITMAP_CSUM_HI_LOCATION) { + hi = le16toh(fs->e2fs_gd[cg].ext4bgd_b_bmap_csum_hi); provided |= (hi << 16); } else calculated &= 0xFFFF; @@ -555,9 +563,9 @@ ext2_gd_b_bitmap_csum_set(struct m_ext2fs *fs, int cg, size = fs->e2fs_fpg / 8; csum = calculate_crc32c(fs->e2fs_csum_seed, bp->b_data, size); - fs->e2fs_gd[cg].ext4bgd_b_bmap_csum = csum & 0xFFFF; - if (fs->e2fs->e3fs_desc_size >= EXT2_BG_BLOCK_BITMAP_CSUM_HI_LOCATION) - fs->e2fs_gd[cg].ext4bgd_b_bmap_csum_hi = csum >> 16; + fs->e2fs_gd[cg].ext4bgd_b_bmap_csum = htole16(csum & 0xFFFF); + if (le16toh(fs->e2fs->e3fs_desc_size) >= EXT2_BG_BLOCK_BITMAP_CSUM_HI_LOCATION) + fs->e2fs_gd[cg].ext4bgd_b_bmap_csum_hi = htole16(csum >> 16); } static uint32_t @@ -571,10 +579,10 @@ ext2_ei_csum(struct inode *ip, struct ext2fs_dinode *e fs = ip->i_e2fs; offset = offsetof(struct ext2fs_dinode, e2di_chksum_lo); csum_size = sizeof(dummy_csum); - inum = ip->i_number; + inum = htole32(ip->i_number); crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&inum, sizeof(inum)); - gen = ip->i_gen; + gen = htole32(ip->i_gen); inode_csum_seed = calculate_crc32c(crc, (uint8_t *)&gen, sizeof(gen)); @@ -590,7 +598,8 @@ ext2_ei_csum(struct inode *ip, struct ext2fs_dinode *e E2FS_REV0_INODE_SIZE, offset - E2FS_REV0_INODE_SIZE); if ((EXT2_INODE_SIZE(ip->i_e2fs) > E2FS_REV0_INODE_SIZE && - ei->e2di_extra_isize >= EXT2_INODE_CSUM_HI_EXTRA_END)) { + le16toh(ei->e2di_extra_isize) >= + EXT2_INODE_CSUM_HI_EXTRA_END)) { crc = calculate_crc32c(crc, (uint8_t *)&dummy_csum, csum_size); offset += csum_size; @@ -615,12 +624,12 @@ ext2_ei_csum_verify(struct inode *ip, struct ext2fs_di if (!EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) return (0); - provided = ei->e2di_chksum_lo; + provided = le16toh(ei->e2di_chksum_lo); calculated = ext2_ei_csum(ip, ei); if ((EXT2_INODE_SIZE(fs) > E2FS_REV0_INODE_SIZE && - ei->e2di_extra_isize >= EXT2_INODE_CSUM_HI_EXTRA_END)) { - hi = ei->e2di_chksum_hi; + le16toh(ei->e2di_extra_isize) >= EXT2_INODE_CSUM_HI_EXTRA_END)) { + hi = le16toh(ei->e2di_chksum_hi); provided |= hi << 16; } else calculated &= 0xFFFF; @@ -655,10 +664,10 @@ ext2_ei_csum_set(struct inode *ip, struct ext2fs_dinod crc = ext2_ei_csum(ip, ei); - ei->e2di_chksum_lo = crc & 0xFFFF; + ei->e2di_chksum_lo = htole16(crc & 0xFFFF); if ((EXT2_INODE_SIZE(fs) > E2FS_REV0_INODE_SIZE && - ei->e2di_extra_isize >= EXT2_INODE_CSUM_HI_EXTRA_END)) - ei->e2di_chksum_hi = crc >> 16; + le16toh(ei->e2di_extra_isize) >= EXT2_INODE_CSUM_HI_EXTRA_END)) + ei->e2di_chksum_hi = htole16(crc >> 16); } static uint16_t @@ -716,6 +725,8 @@ ext2_gd_csum(struct m_ext2fs *fs, uint32_t block_group offset = offsetof(struct ext2_gd, ext4bgd_csum); + block_group = htole32(block_group); + if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { csum32 = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&block_group, sizeof(block_group)); @@ -724,12 +735,12 @@ ext2_gd_csum(struct m_ext2fs *fs, uint32_t block_group csum32 = calculate_crc32c(csum32, (uint8_t *)&dummy_csum, sizeof(dummy_csum)); offset += sizeof(dummy_csum); - if (offset < fs->e2fs->e3fs_desc_size) + if (offset < le16toh(fs->e2fs->e3fs_desc_size)) csum32 = calculate_crc32c(csum32, (uint8_t *)gd + offset, - fs->e2fs->e3fs_desc_size - offset); + le16toh(fs->e2fs->e3fs_desc_size) - offset); crc = csum32 & 0xFFFF; - return (crc); + return (htole16(crc)); } else if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM)) { crc = ext2_crc16(~0, fs->e2fs->e2fs_uuid, sizeof(fs->e2fs->e2fs_uuid)); @@ -738,10 +749,10 @@ ext2_gd_csum(struct m_ext2fs *fs, uint32_t block_group crc = ext2_crc16(crc, (uint8_t *)gd, offset); offset += sizeof(gd->ext4bgd_csum); /* skip checksum */ if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_64BIT) && - offset < fs->e2fs->e3fs_desc_size) + offset < le16toh(fs->e2fs->e3fs_desc_size)) crc = ext2_crc16(crc, (uint8_t *)gd + offset, - fs->e2fs->e3fs_desc_size - offset); - return (crc); + le16toh(fs->e2fs->e3fs_desc_size) - offset); + return (htole16(crc)); } return (0); @@ -774,6 +785,5 @@ ext2_gd_csum_set(struct m_ext2fs *fs) unsigned int i; for (i = 0; i < fs->e2fs_gcount; i++) - fs->e2fs_gd[i].ext4bgd_csum = - ext2_gd_csum(fs, i, &fs->e2fs_gd[i]); + fs->e2fs_gd[i].ext4bgd_csum = ext2_gd_csum(fs, i, &fs->e2fs_gd[i]); } Modified: head/sys/fs/ext2fs/ext2_extattr.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extattr.c Sun May 17 14:10:46 2020 (r361135) +++ head/sys/fs/ext2fs/ext2_extattr.c Sun May 17 14:52:54 2020 (r361136) @@ -216,9 +216,9 @@ ext2_extattr_inode_list(struct inode *ip, int attrname /* Check attributes magic value */ header = (struct ext2fs_extattr_dinode_header *)((char *)dinode + - E2FS_REV0_INODE_SIZE + dinode->e2di_extra_isize); + E2FS_REV0_INODE_SIZE + le16toh(dinode->e2di_extra_isize)); - if (header->h_magic != EXTATTR_MAGIC) { + if (le32toh(header->h_magic) != EXTATTR_MAGIC) { brelse(bp); return (0); } @@ -285,7 +285,8 @@ ext2_extattr_block_list(struct inode *ip, int attrname /* Check attributes magic value */ header = EXT2_HDR(bp); - if (header->h_magic != EXTATTR_MAGIC || header->h_blocks != 1) { + if (le32toh(header->h_magic) != EXTATTR_MAGIC || + le32toh(header->h_blocks) != 1) { brelse(bp); return (EINVAL); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun May 17 15:32: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 9024A2DC892; Sun, 17 May 2020 15:32:36 +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 49Q5kD3N2cz4TWm; Sun, 17 May 2020 15:32:36 +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 6F0CA12B63; Sun, 17 May 2020 15:32:36 +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 04HFWaVw089589; Sun, 17 May 2020 15:32:36 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HFWaDY089588; Sun, 17 May 2020 15:32:36 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005171532.04HFWaDY089588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 17 May 2020 15:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361137 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361137 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, 17 May 2020 15:32:36 -0000 Author: melifaro Date: Sun May 17 15:32:36 2020 New Revision: 361137 URL: https://svnweb.freebsd.org/changeset/base/361137 Log: Remove redundant checks for nhop validity. Currently NH_IS_VALID() simly aliases to RT_LINK_IS_UP(), so we're checking the same thing twice. In the near future the implementation of this check will be simpler, as there are plans to introduce control-plane interface status monitoring similar to ipfw interface tracker. Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Sun May 17 14:52:54 2020 (r361136) +++ head/sys/netinet/ip_output.c Sun May 17 15:32:36 2020 (r361137) @@ -407,8 +407,7 @@ again: * Also check whether routing cache needs invalidation. */ if (ro != NULL && ro->ro_nh != NULL && - ((!NH_IS_VALID(ro->ro_nh)) || !RT_LINK_IS_UP(ro->ro_nh->nh_ifp) || - dst->sin_family != AF_INET || + ((!NH_IS_VALID(ro->ro_nh)) || dst->sin_family != AF_INET || dst->sin_addr.s_addr != ip->ip_dst.s_addr)) RO_INVALIDATE_CACHE(ro); ia = NULL; @@ -480,8 +479,7 @@ again: ro->ro_nh = fib4_lookup(fibnum, dst->sin_addr, 0, NHR_REF, flowid); - if (ro->ro_nh == NULL || (!NH_IS_VALID(ro->ro_nh)) || - !RT_LINK_IS_UP(ro->ro_nh->nh_ifp)) { + if (ro->ro_nh == NULL || (!NH_IS_VALID(ro->ro_nh))) { #if defined(IPSEC) || defined(IPSEC_SUPPORT) /* * There is no route for this packet, but it is From owner-svn-src-all@freebsd.org Sun May 17 20:09: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 B9AD12F2ADE; Sun, 17 May 2020 20:09:11 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QCsM493Vz4qTS; Sun, 17 May 2020 20:09:11 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85C6915DA9; Sun, 17 May 2020 20:09:11 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04HK9BZA064777; Sun, 17 May 2020 20:09:11 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HK9B68064776; Sun, 17 May 2020 20:09:11 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005172009.04HK9B68064776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 17 May 2020 20:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361138 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361138 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, 17 May 2020 20:09:11 -0000 Author: manu Date: Sun May 17 20:09:11 2020 New Revision: 361138 URL: https://svnweb.freebsd.org/changeset/base/361138 Log: linuxkpi: Add atomic_dec_and_mutex_lock This function decrement the counter and if the result is 0 it acquires the mutex and returns 1, if not it simply returns 0. Needed by DRM from Linux v5.3 Sponsored-by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24847 Modified: head/sys/compat/linuxkpi/common/include/linux/mutex.h Modified: head/sys/compat/linuxkpi/common/include/linux/mutex.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mutex.h Sun May 17 15:32:36 2020 (r361137) +++ head/sys/compat/linuxkpi/common/include/linux/mutex.h Sun May 17 20:09:11 2020 (r361138) @@ -37,6 +37,7 @@ #include #include +#include typedef struct mutex { struct sx sx; @@ -123,6 +124,16 @@ static inline bool mutex_is_owned(mutex_t *m) { return (sx_xlocked(&m->sx)); +} + +static inline int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *m) +{ + if (atomic_dec_and_test(cnt)) { + mutex_lock(m); + return (1); + } + + return (0); } #ifdef WITNESS_ALL From owner-svn-src-all@freebsd.org Sun May 17 20:12: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 037C72F2B5F; Sun, 17 May 2020 20:12:17 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QCww6LcMz4qfg; Sun, 17 May 2020 20:12:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D542715BCC; Sun, 17 May 2020 20:12:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04HKCGUp070412; Sun, 17 May 2020 20:12:16 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HKCGax070411; Sun, 17 May 2020 20:12:16 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005172012.04HKCGax070411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 17 May 2020 20:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361139 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361139 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, 17 May 2020 20:12:17 -0000 Author: manu Date: Sun May 17 20:12:16 2020 New Revision: 361139 URL: https://svnweb.freebsd.org/changeset/base/361139 Log: linuxkpi: Add __mutex_init Same as mutex_init, the lock_class_key argument seems to be only used for debug in Linux, simply ignore it for now. Needed by DRM in Linux v5.3 Sponsored-by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24848 Modified: head/sys/compat/linuxkpi/common/include/linux/mutex.h Modified: head/sys/compat/linuxkpi/common/include/linux/mutex.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mutex.h Sun May 17 20:09:11 2020 (r361138) +++ head/sys/compat/linuxkpi/common/include/linux/mutex.h Sun May 17 20:12:16 2020 (r361139) @@ -108,6 +108,9 @@ mutex_trylock_recursive(struct mutex *lock) #define mutex_init(_m) \ linux_mutex_init(_m, mutex_name(#_m), SX_NOWITNESS) +#define __mutex_init(_m, _n, _l) \ + linux_mutex_init(_m, _n, SX_NOWITNESS) + #define mutex_init_witness(_m) \ linux_mutex_init(_m, mutex_name(#_m), SX_DUPOK) From owner-svn-src-all@freebsd.org Sun May 17 20:14: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 4CBFD2F2C5C; Sun, 17 May 2020 20:14:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QCzt1Fb6z4r2F; Sun, 17 May 2020 20:14:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 260B715F34; Sun, 17 May 2020 20:14:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04HKEoe0070579; Sun, 17 May 2020 20:14:50 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HKEnSc070578; Sun, 17 May 2020 20:14:49 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005172014.04HKEnSc070578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 17 May 2020 20:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361140 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361140 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, 17 May 2020 20:14:50 -0000 Author: manu Date: Sun May 17 20:14:49 2020 New Revision: 361140 URL: https://svnweb.freebsd.org/changeset/base/361140 Log: linuxkpi: Add offsetofend macro This calculate the offset of the end of the member in the given struct. Needed by DRM in Linux v5.3 Sponsored-by: The FreeBSD Foudation Differential Revision: https://reviews.freebsd.org/D24849 Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Sun May 17 20:12:16 2020 (r361139) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Sun May 17 20:14:49 2020 (r361140) @@ -462,6 +462,9 @@ kstrtobool_from_user(const char __user *s, size_t coun type __max2 = (y); \ __max1 > __max2 ? __max1 : __max2; }) +#define offsetofend(t, m) \ + (offsetof(t, m) + sizeof((((t *)0)->m))) + #define clamp_t(type, _x, min, max) min_t(type, max_t(type, _x, min), max) #define clamp(x, lo, hi) min( max(x,lo), hi) #define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi) From owner-svn-src-all@freebsd.org Sun May 17 21:29: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 CF3C22F712A; Sun, 17 May 2020 21:29:45 +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 49QFfK5955z3X0C; Sun, 17 May 2020 21:29:45 +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 A842716F91; Sun, 17 May 2020 21:29:45 +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 04HLTj0O018382; Sun, 17 May 2020 21:29:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HLTjqo018381; Sun, 17 May 2020 21:29:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005172129.04HLTjqo018381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 17 May 2020 21:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r361142 - releng/11.4/contrib/llvm-project/llvm/lib/Support/Unix X-SVN-Group: releng X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: releng/11.4/contrib/llvm-project/llvm/lib/Support/Unix X-SVN-Commit-Revision: 361142 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, 17 May 2020 21:29:45 -0000 Author: emaste Date: Sun May 17 21:29:45 2020 New Revision: 361142 URL: https://svnweb.freebsd.org/changeset/base/361142 Log: MF11 r360876: Merge commit 21e5e1724b75 from llvm git: getMainExecutable: Fix hand-rolled AT_EXECPATH for older FreeBSD Once we hit AT_NULL, we need to bail out of the loop; not just the enclosing switch. This fixes basic usage (e.g. `cc --version`) when AT_EXECPATH isn't present on older branches (e.g. under qemu-user-static, at the moment), where we would previously run off the end of ::environ. Patch By: kevans Reviewed By: arichardson Approved by: re (kib) Modified: releng/11.4/contrib/llvm-project/llvm/lib/Support/Unix/Path.inc Directory Properties: releng/11.4/ (props changed) releng/11.4/contrib/llvm-project/llvm/ (props changed) Modified: releng/11.4/contrib/llvm-project/llvm/lib/Support/Unix/Path.inc ============================================================================== --- releng/11.4/contrib/llvm-project/llvm/lib/Support/Unix/Path.inc Sun May 17 20:37:15 2020 (r361141) +++ releng/11.4/contrib/llvm-project/llvm/lib/Support/Unix/Path.inc Sun May 17 21:29:45 2020 (r361142) @@ -208,14 +208,9 @@ std::string getMainExecutable(const char *argv0, void while (*p++ != 0) ; // Iterate through auxiliary vectors for AT_EXECPATH. - for (;;) { - switch (*(uintptr_t *)p++) { - case AT_EXECPATH: + for (; *(uintptr_t *)p != AT_NULL; p++) { + if (*(uintptr_t *)p++ == AT_EXECPATH) return *p; - case AT_NULL: - break; - } - p++; } #endif // Fall back to argv[0] if auxiliary vectors are not available. From owner-svn-src-all@freebsd.org Sun May 17 21: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 8D4B22F7452; Sun, 17 May 2020 21:55:00 +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 49QGCS1wJpz3Y1m; Sun, 17 May 2020 21:55:00 +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 3D26A17338; Sun, 17 May 2020 21:55:00 +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 04HLt0T9036231; Sun, 17 May 2020 21:55:00 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HLt07J036230; Sun, 17 May 2020 21:55:00 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202005172155.04HLt07J036230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Sun, 17 May 2020 21:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361143 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 361143 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, 17 May 2020 21:55:00 -0000 Author: cperciva Date: Sun May 17 21:54:59 2020 New Revision: 361143 URL: https://svnweb.freebsd.org/changeset/base/361143 Log: Add /etc/autofs/special_efs to EC2 AMIs Since Amazon Elastic File System is only available within AWS, it seems more appropriate to have this added only in EC2 AMIs rather than "polluting" non-EC2 images with it. Reviewed by: gjb MFC after: 7 days Relnotes: Amazon EFS filesystems can be automounted by enabling autofs and placing "/efs -efs" into /etc/auto_master. Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D24791 Modified: head/release/tools/ec2.conf Modified: head/release/tools/ec2.conf ============================================================================== --- head/release/tools/ec2.conf Sun May 17 21:29:45 2020 (r361142) +++ head/release/tools/ec2.conf Sun May 17 21:54:59 2020 (r361143) @@ -113,6 +113,23 @@ vm_extra_pre_umount() { -e '1,/^#server/s/^#server.*/server 169.254.169.123 iburst/' \ ${DESTDIR}/etc/ntp.conf + # Provide a map for accessing Elastic File System mounts + cat > ${DESTDIR}/etc/autofs/special_efs <<'EOF' +#!/bin/sh + +if [ $# -eq 0 ]; then + # No way to know which EFS filesystems exist and are + # accessible to this EC2 instance. + exit 0 +fi + +# Provide instructions on how to mount the requested filesystem. +FS=$1 +REGION=`fetch -qo- http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's/[a-z]$//'` +echo "-nfsv4,minorversion=1,oneopenown ${FS}.efs.${REGION}.amazonaws.com:/" +EOF + chmod 755 ${DESTDIR}/etc/autofs/special_efs + # The first time the AMI boots, the installed "first boot" scripts # should be allowed to run: # * ec2_configinit (download and process EC2 user-data) From owner-svn-src-all@freebsd.org Sun May 17 22:31: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 2E5812F7EEE; Sun, 17 May 2020 22:31:40 +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 49QH1m0WK2z3Ywm; Sun, 17 May 2020 22:31:40 +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 0CE6E17B8C; Sun, 17 May 2020 22:31:40 +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 04HMVdkm059071; Sun, 17 May 2020 22:31:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HMVdMU059067; Sun, 17 May 2020 22:31:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005172231.04HMVdMU059067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 17 May 2020 22:31:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361145 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361145 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, 17 May 2020 22:31:40 -0000 Author: tuexen Date: Sun May 17 22:31:38 2020 New Revision: 361145 URL: https://svnweb.freebsd.org/changeset/base/361145 Log: Non-functional changes, cleanups. MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Sun May 17 22:05:25 2020 (r361144) +++ head/sys/netinet/sctp_asconf.c Sun May 17 22:31:38 2020 (r361145) @@ -2212,7 +2212,6 @@ sctp_asconf_iterator_stcb(struct sctp_inpcb *inp, stru struct sctp_nets *net; TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - /* delete this address if cached */ if (net->ro._s_addr == ifa) { sctp_free_ifa(net->ro._s_addr); Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Sun May 17 22:05:25 2020 (r361144) +++ head/sys/netinet/sctp_os_bsd.h Sun May 17 22:31:38 2020 (r361145) @@ -309,8 +309,6 @@ typedef struct callout sctp_os_timer_t; #define SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, af) ((struct ifnet *)ifn)->if_mtu #define SCTP_GATHER_MTU_FROM_ROUTE(sctp_ifa, sa, nh) ((uint32_t)((nh != NULL) ? nh->nh_mtu : 0)) #define SCTP_GATHER_MTU_FROM_INTFC(sctp_ifn) ((sctp_ifn->ifn_p != NULL) ? ((struct ifnet *)(sctp_ifn->ifn_p))->if_mtu : 0) -/* XXX: Setting MTU from the protocol in this way is simply incorrect */ -#define SCTP_SET_MTU_OF_ROUTE(sa, rt, mtu) /* (de-)register interface event notifications */ #define SCTP_REGISTER_INTERFACE(ifhandle, af) Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun May 17 22:05:25 2020 (r361144) +++ head/sys/netinet/sctp_output.c Sun May 17 22:31:38 2020 (r361145) @@ -6202,10 +6202,10 @@ sctp_prune_prsctp(struct sctp_tcb *stcb, if (chk->rec.data.timetodrop.tv_sec > (long)srcv->sinfo_timetolive) { /* * Lower numbers equates to higher - * priority so if the one we are - * looking at has a larger - * priority we want to drop the data - * and NOT retransmit it. + * priority. So if the one we are + * looking at has a larger priority, + * we want to drop the data and NOT + * retransmit it. */ if (chk->data) { /* Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun May 17 22:05:25 2020 (r361144) +++ head/sys/netinet/sctp_pcb.c Sun May 17 22:31:38 2020 (r361145) @@ -5451,8 +5451,6 @@ sctp_del_local_addr_ep(struct sctp_inpcb *inp, struct TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { if (net->ro._s_addr == laddr->ifa) { /* Yep, purge src address selected */ - - /* delete this address if cached */ RO_NHFREE(&net->ro); sctp_free_ifa(net->ro._s_addr); net->ro._s_addr = NULL; From owner-svn-src-all@freebsd.org Sun May 17 23:48: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 AAFA02F93A4; Sun, 17 May 2020 23:48:53 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) (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 49QJkr5Ppyz3cw9; Sun, 17 May 2020 23:48:52 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: by mail-yb1-xb33.google.com with SMTP id g79so739348ybf.0; Sun, 17 May 2020 16:48:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=lmwHmp4A8ZA/WR7e3VkwCHvsJk3lf3dh3G57oD/mRf8=; b=lPQpIlb85LLEQxOw8nxPrPdIWufFDQ+JIwjQdAso8/KdJdK7MdqCWXqrlZ090ucHs6 jziJW/K8yCUYLikQjD2mr7s44IxLa7Kh4s7gxjzL+EzJSmXNmb2OyAPTzBZeQopGAxrA N8wNxT8QRfoNQ5Bci7mNS5alSL7mAqcuNw273B9O80keJ0Oq5KxF0oo4tQbKzxiI2s6i 0kbld172RDcvvaQxWAJdlPmNiMVazXP9o8C/Ow1Xg/fbYXomcBNE32RK9dtZ+oR6cNjD ShDys3CZ+22RaiVcBtE+vElPVH/JUGLEHysIxwluL9/s0WYBdJn4wQtJZT0S2IssX0D2 uUnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=lmwHmp4A8ZA/WR7e3VkwCHvsJk3lf3dh3G57oD/mRf8=; b=HHEARf21CYGWjLuDX+vY1BL3L4BmrX9+UiE1kMU7zJ9nt04wFrHqFZ2E9wUAfPcBz8 B+TowAVQJlB9Vt5uEtq5ojDJHI9KMJ/TFJTaZJljmw5w6nBc5BYNo7QHqn1bUjT8Yzm7 nUy53ohzYofW5x2eF/qNkdtooNTWvAVk8xNYJxN+nR+RYb7ibDV1FuLEoQLNV/cCpsPl 9U3dTy+6gdnDUNSzTciI49/iRGzyU237L1EsDzfQhOQ32CKQxboUyDKisNuBuSGN0+8i +g6vSQ6kbtoMJHgP6y/tZC6uWpp+gITSXbi1hEro9TtzlKX7m417zdpGnVh0wtkDjjYK sl5A== X-Gm-Message-State: AOAM532Y5NlXSocp4EIJ2FR57BCDDYuk9QpFNej8+Z4ZWgoH5NVnRwPK tieM0Ogp0lZC9s9HPp9upAYtE2T8PM1Oq0O7qMF2nw== X-Google-Smtp-Source: ABdhPJwkh3kGaglGyXwt6DHJMDGFvrh+KGaHhZrO/w1NSjNmv0KU+eiBb/ranJNSFA84n8z1t2cGXYgIatGCeNtTstc= X-Received: by 2002:a5b:c41:: with SMTP id d1mr3489569ybr.67.1589759331112; Sun, 17 May 2020 16:48:51 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:2bc5:0:0:0:0:0 with HTTP; Sun, 17 May 2020 16:48:50 -0700 (PDT) In-Reply-To: <202005172155.04HLt07J036230@repo.freebsd.org> References: <202005172155.04HLt07J036230@repo.freebsd.org> From: Oliver Pinter Date: Mon, 18 May 2020 01:48:50 +0200 Message-ID: Subject: Re: svn commit: r361143 - head/release/tools To: Colin Percival Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: 49QJkr5Ppyz3cw9 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]; TAGGED_FROM(0.00)[] 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: Sun, 17 May 2020 23:48:53 -0000 On Sunday, May 17, 2020, Colin Percival wrote: > Author: cperciva > Date: Sun May 17 21:54:59 2020 > New Revision: 361143 > URL: https://svnweb.freebsd.org/changeset/base/361143 > > Log: > Add /etc/autofs/special_efs to EC2 AMIs > > Since Amazon Elastic File System is only available within AWS, it seems > more appropriate to have this added only in EC2 AMIs rather than > "polluting" non-EC2 images with it. > > Reviewed by: gjb > MFC after: 7 days > Relnotes: Amazon EFS filesystems can be automounted by enabling > autofs > and placing "/efs -efs" into /etc/auto_master. > Sponsored by: https://www.patreon.com/cperciva > Differential Revision: https://reviews.freebsd.org/D24791 > > Modified: > head/release/tools/ec2.conf > > Modified: head/release/tools/ec2.conf > ============================================================ > ================== > --- head/release/tools/ec2.conf Sun May 17 21:29:45 2020 (r361142) > +++ head/release/tools/ec2.conf Sun May 17 21:54:59 2020 (r361143) > @@ -113,6 +113,23 @@ vm_extra_pre_umount() { > -e '1,/^#server/s/^#server.*/server 169.254.169.123 > iburst/' \ > ${DESTDIR}/etc/ntp.conf > > + # Provide a map for accessing Elastic File System mounts > + cat > ${DESTDIR}/etc/autofs/special_efs <<'EOF' > +#!/bin/sh > + > +if [ $# -eq 0 ]; then > + # No way to know which EFS filesystems exist and are > + # accessible to this EC2 instance. > + exit 0 > +fi > + > +# Provide instructions on how to mount the requested filesystem. > +FS=$1 > +REGION=`fetch -qo- http://169.254.169.254/latest/meta-data/placement/ > availability-zone | sed -e 's/[a-z]$//'` What will be this hard-coded ip address without any verification or at least https? > +echo "-nfsv4,minorversion=1,oneopenown ${FS}.efs.${REGION}.amazonaws. > com:/" > +EOF > + chmod 755 ${DESTDIR}/etc/autofs/special_efs > + > # The first time the AMI boots, the installed "first boot" scripts > # should be allowed to run: > # * ec2_configinit (download and process EC2 user-data) > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Mon May 18 00:07: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 BB59F2F994A; Mon, 18 May 2020 00:07:46 +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 49QK8f4XSQz3djN; Mon, 18 May 2020 00:07:46 +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 9288B1885C; Mon, 18 May 2020 00:07:46 +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 04I07k8B015937; Mon, 18 May 2020 00:07:46 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I07kUq015935; Mon, 18 May 2020 00:07:46 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202005180007.04I07kUq015935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 18 May 2020 00:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361146 - in head/sys/fs: nfs nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 361146 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, 18 May 2020 00:07:46 -0000 Author: rmacklem Date: Mon May 18 00:07:45 2020 New Revision: 361146 URL: https://svnweb.freebsd.org/changeset/base/361146 Log: Add a function nfsm_set() to initialize "struct nfsrv_descript" for building mbuf lists. This function is currently trivial, but will that will change when support for building NFS messages in ext_pgs mbufs is added. Adding support for ext_pgs mbufs is needed for KERN_TLS, which will be used to implement nfs-over-tls. Modified: head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Sun May 17 22:31:38 2020 (r361145) +++ head/sys/fs/nfs/nfs_commonsubs.c Mon May 18 00:07:45 2020 (r361146) @@ -4778,3 +4778,14 @@ nfsv4_findmirror(struct nfsmount *nmp) return (ds); } +/* + * Fill in the fields of "struct nfsrv_descript". + */ +void +nfsm_set(struct nfsrv_descript *nd, u_int offs) +{ + struct mbuf *m; + + m = nd->nd_mb; + nd->nd_bpos = mtod(m, char *) + offs; +} Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Sun May 17 22:31:38 2020 (r361145) +++ head/sys/fs/nfs/nfs_var.h Mon May 18 00:07:45 2020 (r361146) @@ -360,6 +360,7 @@ int nfsv4_sequencelookup(struct nfsmount *, struct nfs void nfsv4_freeslot(struct nfsclsession *, int); struct ucred *nfsrv_getgrpscred(struct ucred *); struct nfsdevice *nfsv4_findmirror(struct nfsmount *); +void nfsm_set(struct nfsrv_descript *, u_int); /* nfs_clcomsubs.c */ void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int); Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Sun May 17 22:31:38 2020 (r361145) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Mon May 18 00:07:45 2020 (r361146) @@ -5080,7 +5080,7 @@ nfsrv_writedsdorpc(struct nfsmount *nmp, fhandle_t *fh while (m->m_next != NULL) m = m->m_next; nd->nd_mb = m; - nd->nd_bpos = mtod(m, char *) + m->m_len; + nfsm_set(nd, m->m_len); NFSD_DEBUG(4, "nfsrv_writedsdorpc: lastmb len=%d\n", m->m_len); /* Do a Getattr for the attributes that change upon writing. */ From owner-svn-src-all@freebsd.org Mon May 18 00:24: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 E22F62FA0B1; Mon, 18 May 2020 00:24:17 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) (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 49QKWh5qYsz3fnQ; Mon, 18 May 2020 00:24:16 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi1-f171.google.com with SMTP id o7so7646143oif.2; Sun, 17 May 2020 17:24:16 -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:reply-to :from:date:message-id:subject:to:cc; bh=+LNLKa6awuzOj8F62GRTQxBYONBWWPaypxGzpVTwFNU=; b=czk9O6GRCg+hMdZaY9Pk/5lafzCkK9vODvWMoOcva6qCL8POUso4xmUhW4J87umQ4E 95sOGD+ssdArmOH3YKR0OIeqloIt0/Oq9MypNS1Z0RTwB48VmXYJNbxziqnslL8ZjYgn fuO2IY50Hou2ZfXeC3o6jEzFghf0wLx9528P2Mr9nU/ktZUDHyxH5QNJpB4xIVLpcbew XC0FICfavxisc8YU9qli2r++RVmp9b7X1ZnCJBBoatADZkLV0h5RlS/x+24tcR1XhjkQ xJLYQxEUgiYbLRZwX+uVfEeGxBQYgRbTrvazbDtfR9YDf1utjHBbQc3RPBYtC0ut6f8a TWww== X-Gm-Message-State: AOAM533MUdsaAIjvm5wUDZyi+NKAkx497YTpfpLoTJy4crcCfHyCJhMf wXJ1qTHpLbhYQhTMoaT17FH9Rp6G X-Google-Smtp-Source: ABdhPJwj1IREyc893Jr1eFppPTMsqj1K4CQr3n8TmCH5OPLsu9ZTopipOW3mrXekzMTIDIoQiSaDCA== X-Received: by 2002:a54:4004:: with SMTP id x4mr8914229oie.76.1589761455415; Sun, 17 May 2020 17:24:15 -0700 (PDT) Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com. [209.85.167.182]) by smtp.gmail.com with ESMTPSA id q19sm2641526ooh.11.2020.05.17.17.24.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 May 2020 17:24:15 -0700 (PDT) Received: by mail-oi1-f182.google.com with SMTP id l6so1746131oic.9; Sun, 17 May 2020 17:24:15 -0700 (PDT) X-Received: by 2002:aca:eb96:: with SMTP id j144mr8670649oih.48.1589761454982; Sun, 17 May 2020 17:24:14 -0700 (PDT) MIME-Version: 1.0 References: <202005172155.04HLt07J036230@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sun, 17 May 2020 17:24:03 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361143 - head/release/tools To: Oliver Pinter Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49QKWh5qYsz3fnQ X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.167.171 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-0.06 / 15.00]; HAS_REPLYTO(0.00)[cem@freebsd.org]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; NEURAL_HAM_SHORT(-0.06)[-0.061]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.171:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.171:from]; RCVD_TLS_ALL(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: Mon, 18 May 2020 00:24:17 -0000 On Sun, May 17, 2020 at 4:49 PM Oliver Pinter wrote: > On Sunday, May 17, 2020, Colin Percival wrote: >> +# Provide instructions on how to mount the requested filesystem. >> +FS=$1 >> +REGION=`fetch -qo- http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's/[a-z]$//'` > > > What will be this hard-coded ip address without any verification or at least https? It's a special non-routable IP that is used in at least AWS and Azure to provide some VM services. Traffic to and from it never leaves the virtual overlay network, which by design VM instances already trust to provide privacy. It doesn't require functioning DNS to access the raw IP. Conrad From owner-svn-src-all@freebsd.org Mon May 18 00:32: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 ED1F82FA540; Mon, 18 May 2020 00:32:42 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QKjQ5x8Bz3g4C; Mon, 18 May 2020 00:32:42 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6C6C19269; Mon, 18 May 2020 00:32:42 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I0WgQS034013; Mon, 18 May 2020 00:32:42 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I0WgdE034012; Mon, 18 May 2020 00:32:42 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005180032.04I0WgdE034012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Mon, 18 May 2020 00:32:42 +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: r361147 - in stable: 11/sys/kern 12/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in stable: 11/sys/kern 12/sys/kern X-SVN-Commit-Revision: 361147 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, 18 May 2020 00:32:43 -0000 Author: freqlabs Date: Mon May 18 00:32:42 2020 New Revision: 361147 URL: https://svnweb.freebsd.org/changeset/base/361147 Log: MFC r360900: vfs_exports: Tighten bounds and assert consistency of numsecflavors We know the value must be greater than 0 and less than MAXSECFLAVORS. Reject values outside this range in the initial check in vfs_export and add KASSERTs in the later consumers. Also check that we are called with one of either MNT_DELEXPORT or MNT_EXPORTED set. Reviewed by: rmacklem Approved by: mav (mentor) Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D24753 Modified: stable/11/sys/kern/vfs_export.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/kern/vfs_export.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/kern/vfs_export.c ============================================================================== --- stable/11/sys/kern/vfs_export.c Mon May 18 00:07:45 2020 (r361146) +++ stable/11/sys/kern/vfs_export.c Mon May 18 00:32:42 2020 (r361147) @@ -108,6 +108,11 @@ vfs_hang_addrlist(struct mount *mp, struct netexport * #endif int error; + KASSERT(argp->ex_numsecflavors > 0, + ("%s: numsecflavors <= 0", __func__)); + KASSERT(argp->ex_numsecflavors < MAXSECFLAVORS, + ("%s: numsecflavors >= MAXSECFLAVORS", __func__)); + /* * XXX: This routine converts from a `struct xucred' * (argp->ex_anon) to a `struct ucred' (np->netc_anon). This @@ -294,10 +299,14 @@ vfs_export(struct mount *mp, struct export_args *argp) struct netexport *nep; int error; - if (argp->ex_numsecflavors < 0 - || argp->ex_numsecflavors >= MAXSECFLAVORS) + if ((argp->ex_flags & (MNT_DELEXPORT | MNT_EXPORTED)) == 0) return (EINVAL); + if ((argp->ex_flags & MNT_EXPORTED) != 0 && + (argp->ex_numsecflavors <= 0 + || argp->ex_numsecflavors >= MAXSECFLAVORS)) + return (EINVAL); + error = 0; lockmgr(&mp->mnt_explock, LK_EXCLUSIVE, NULL); nep = mp->mnt_export; @@ -510,8 +519,13 @@ vfs_stdcheckexp(struct mount *mp, struct sockaddr *nam *extflagsp = np->netc_exflags; if ((*credanonp = np->netc_anon) != NULL) crhold(*credanonp); - if (numsecflavors) + if (numsecflavors) { *numsecflavors = np->netc_numsecflavors; + KASSERT(*numsecflavors > 0, + ("%s: numsecflavors <= 0", __func__)); + KASSERT(*numsecflavors < MAXSECFLAVORS, + ("%s: numsecflavors >= MAXSECFLAVORS", __func__)); + } if (secflavors) *secflavors = np->netc_secflavors; lockmgr(&mp->mnt_explock, LK_RELEASE, NULL); From owner-svn-src-all@freebsd.org Mon May 18 00:32: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 6EF532FA145; Mon, 18 May 2020 00:32:43 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QKjR2GWwz3gHM; Mon, 18 May 2020 00:32:43 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 215B719121; Mon, 18 May 2020 00:32:43 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I0Whbv034019; Mon, 18 May 2020 00:32:43 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I0WhFs034018; Mon, 18 May 2020 00:32:43 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005180032.04I0WhFs034018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Mon, 18 May 2020 00:32:43 +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: r361147 - in stable: 11/sys/kern 12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in stable: 11/sys/kern 12/sys/kern X-SVN-Commit-Revision: 361147 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, 18 May 2020 00:32:43 -0000 Author: freqlabs Date: Mon May 18 00:32:42 2020 New Revision: 361147 URL: https://svnweb.freebsd.org/changeset/base/361147 Log: MFC r360900: vfs_exports: Tighten bounds and assert consistency of numsecflavors We know the value must be greater than 0 and less than MAXSECFLAVORS. Reject values outside this range in the initial check in vfs_export and add KASSERTs in the later consumers. Also check that we are called with one of either MNT_DELEXPORT or MNT_EXPORTED set. Reviewed by: rmacklem Approved by: mav (mentor) Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D24753 Modified: stable/12/sys/kern/vfs_export.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/kern/vfs_export.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/kern/vfs_export.c ============================================================================== --- stable/12/sys/kern/vfs_export.c Mon May 18 00:07:45 2020 (r361146) +++ stable/12/sys/kern/vfs_export.c Mon May 18 00:32:42 2020 (r361147) @@ -112,6 +112,11 @@ vfs_hang_addrlist(struct mount *mp, struct netexport * #endif int error; + KASSERT(argp->ex_numsecflavors > 0, + ("%s: numsecflavors <= 0", __func__)); + KASSERT(argp->ex_numsecflavors < MAXSECFLAVORS, + ("%s: numsecflavors >= MAXSECFLAVORS", __func__)); + /* * XXX: This routine converts from a `struct xucred' * (argp->ex_anon) to a `struct ucred' (np->netc_anon). This @@ -300,10 +305,14 @@ vfs_export(struct mount *mp, struct export_args *argp) struct netexport *nep; int error; - if (argp->ex_numsecflavors < 0 - || argp->ex_numsecflavors >= MAXSECFLAVORS) + if ((argp->ex_flags & (MNT_DELEXPORT | MNT_EXPORTED)) == 0) return (EINVAL); + if ((argp->ex_flags & MNT_EXPORTED) != 0 && + (argp->ex_numsecflavors <= 0 + || argp->ex_numsecflavors >= MAXSECFLAVORS)) + return (EINVAL); + error = 0; lockmgr(&mp->mnt_explock, LK_EXCLUSIVE, NULL); nep = mp->mnt_export; @@ -518,8 +527,13 @@ vfs_stdcheckexp(struct mount *mp, struct sockaddr *nam *extflagsp = np->netc_exflags; if ((*credanonp = np->netc_anon) != NULL) crhold(*credanonp); - if (numsecflavors) + if (numsecflavors) { *numsecflavors = np->netc_numsecflavors; + KASSERT(*numsecflavors > 0, + ("%s: numsecflavors <= 0", __func__)); + KASSERT(*numsecflavors < MAXSECFLAVORS, + ("%s: numsecflavors >= MAXSECFLAVORS", __func__)); + } if (secflavors) *secflavors = np->netc_secflavors; lockmgr(&mp->mnt_explock, LK_RELEASE, NULL); From owner-svn-src-all@freebsd.org Mon May 18 00:38: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 E30D82FA374; Mon, 18 May 2020 00:38:08 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) (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 49QKqh2m7Nz3gvZ; Mon, 18 May 2020 00:38:08 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f181.google.com with SMTP id l20so8194715ilj.10; Sun, 17 May 2020 17:38:08 -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=3qQxVR2o1Zk0Au+G0RAgJCeMA3s4uMmFD8IPZtkVUuc=; b=qx97/0MYBRSEiXaoh8CDUttvBqvhD3aRe3JVw+V7squmf3+vhL1N+EKgMbuBbQP3zl tVSMDPAyvz4Ch2CCbZKBgzxKTyUqDoNyqsJoTi+igQSnY2NEDWocFWLEF7dMjGsYQkGT gIFflMRXhhNifC7a0k2kYEkwr45PpPVKfJZFHdq9DGQP1Era09DhpHN6WeZGnSRCW6a1 1jCSkbKJN+IAMmhyBhDRD/dIw4mj19JBGRzCm0FFqz9nUYXkbb+aM8ZzgeomN9OMnIyD H6scubUjjjjBWfNrX1owjRqY1VoJ4LjoD9EXe41jrMm3A/26b1JtgklS9EJ24VaQYUKZ owAw== X-Gm-Message-State: AOAM5332MddT1TxHfAckAiVwPw3sBf+rIi8GK3Ek4/2IucgkiaRD73jO lpqLXQZLGqg1M8EGsCZzf11V4/2RZnK03rxZZ0WMilWDcZ4= X-Google-Smtp-Source: ABdhPJwBAstkN2OKZInwLwHOo5sACpcXhzJlgQXjmpwx4R8WnDq6UelFZUugcNaURVPF2tJ/taKfnz4WaZUWDXfJHK8= X-Received: by 2002:a92:c952:: with SMTP id i18mr14677635ilq.100.1589762286203; Sun, 17 May 2020 17:38:06 -0700 (PDT) MIME-Version: 1.0 References: <202005172155.04HLt07J036230@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Sun, 17 May 2020 20:37:54 -0400 Message-ID: Subject: Re: svn commit: r361143 - head/release/tools To: Conrad Meyer Cc: Oliver Pinter , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49QKqh2m7Nz3gvZ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_RCPT(0.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: Mon, 18 May 2020 00:38:09 -0000 On Sun, 17 May 2020 at 20:24, Conrad Meyer wrote: > > On Sun, May 17, 2020 at 4:49 PM Oliver Pinter wrote: > > On Sunday, May 17, 2020, Colin Percival wrote: > >> +# Provide instructions on how to mount the requested filesystem. > >> +FS=$1 > >> +REGION=`fetch -qo- http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's/[a-z]$//'` > > > > > > What will be this hard-coded ip address without any verification or at least https? > > It's a special non-routable IP that is used in at least AWS and Azure > to provide some VM services. Traffic to and from it never leaves the > virtual overlay network, which by design VM instances already trust to > provide privacy. It doesn't require functioning DNS to access the raw > IP. And, more information at https://en.wikipedia.org/wiki/Link-local_address From owner-svn-src-all@freebsd.org Mon May 18 01:30: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 E31A72FB5C4 for ; Mon, 18 May 2020 01:30:14 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from mail.tarsnap.com (mail.tarsnap.com [54.86.246.204]) by mx1.freebsd.org (Postfix) with SMTP id 49QLzp45TZz4183 for ; Mon, 18 May 2020 01:30:14 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: (qmail 32194 invoked from network); 18 May 2020 01:30:08 -0000 Received: from unknown (HELO exbuntu.daemonology.net) (127.0.0.1) by mail.tarsnap.com with SMTP; 18 May 2020 01:30:08 -0000 Received: (qmail 99547 invoked from network); 18 May 2020 01:30:22 -0000 Received: from unknown (HELO ?127.0.0.1?) (127.0.0.1) by clamshell.daemonology.net with SMTP; 18 May 2020 01:30:22 -0000 Subject: Re: svn commit: r361143 - head/release/tools To: Oliver Pinter Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <202005172155.04HLt07J036230@repo.freebsd.org> From: Colin Percival Autocrypt: addr=cperciva@freebsd.org; prefer-encrypt=mutual; keydata= mQGhBElrAAcRBACDfDys4ZtK+ErCJ1HAzYeteKpm3OEsvT/49AjUTLihkF79HhIKrCQU+1KC zv7BwHCMLb6hq30As9L7iFKG7n5QFLFC4Te/VcITUnWHMG/c3ViLOfJGvi+9/nOEHaM1dVJY D6tEp5yM1nHmVQpo9932j4KGuGFR0LhOK5IHXOSfGwCgxSFDPdgxe2OEjWxjGgY+oV3EafcD +JROXCTjlcQiG/OguQH4Vks3mhHfFnEppLxTkDuYgHZQiUtpcT9ssH5khgqoTyMar05OUdAj ZIhNbWDh4LgTj+7ZmvLhXT5Zxw8LX9d7T36aTB8XDQSenDqEtinMWOb0TCBBLbsB8EFG1WTT ESbZci9jJS5yhtktuZoY/eM8uXMD/3k4FWFO80VRRkELSp+XSy/VlSQjyi/rhl2nQq/oOA9F oJbDaB0yq9VNhxP+uFBzBWSqeIX0t1ZWLtNfVFr4TRP5hihI5ICrg/0OpqgisKsU2NFe9xyO hyJLYmfD8ebpDJ/9k30C7Iju9pVrwLm1QgS4S2fqJRcR+U4WbjvP7CgStCVDb2xpbiBQZXJj aXZhbCA8Y3BlcmNpdmFARnJlZUJTRC5vcmc+iGEEExECACEFAklrAI4CGwMHCwkIBwMCAQQV AggDBBYCAwECHgECF4AACgkQOM7KaQxqam6CdwCfQpS2a4bNO8/PX9hP1YnHE+M8BdwAoLwu CIxGuzK7pNBNUyVMWhy11hH+uQINBElrAAcQCAD3ZLMIsP4CIDoJORg+YY0lqLVBgcnF7pFb 4Uy2+KvdWofN+DKH61rZLjgXXkNE9M4EQC1B4lGttBP8IY2gs41y3AUogGdyFbidq99rCBz7 LTsgARHwFxZoaHmXyiZLEU1QZuMqwPZV1mCviRhN5E3rRqYNXVcrnXAAuhBpvNyj/ntHvcDN 2/m+ochiuBYueU4kX3lHya7sOj+mTsndcWmQ9soOUyr8O0r/BG088bMn4qqtUw4dl5/pglXk jbl7uOOPinKf0WVd2r6M0wLPJCD4NPHrCWRLLLAjwfjrtoSRvXxDbXhCdgGBa72+K8eYLzVs hgq7tJOoBWzjVK6XRxR7AAMGB/9Mo3iJ2DxqDecd02KCB5BsFDICbJGhPltU7FwrtbC7djSb XUrwsEVLHi4st4cbdGNCWCrp0BRezXZKohKnNAPFOTK++ZfgeKxrV2sJod+Q9RILF86tQ4XF 7A7Yme5hy92t/WgiU4vc/fWbgP8gV/19f8nunaT2E9NSa70mZFjZNu4iuwThoUUO5CV3Wo0Y UISsnRK8XD1+LR3A2qVyLiFRwh/miC1hgLFCTGCQ3GLxZeZzIpYSlGdQJ0L5lixW5ZQD9r1I 8i/8zhE6qRFAM0upUMI3Gt1Oq2w03DiXrZU0Fu/R8Rm8rlnkQKA+95mRTUq1xL5P5NZIi4gJ Z569OPMFiEkEGBECAAkFAklrAAcCGwwACgkQOM7KaQxqam41igCfbaldnFTu5uAdrnrghESv EI3CAo8AoLkNMks1pThl2BJNRm4CtTK9xZeH Message-ID: Date: Sun, 17 May 2020 18:30:22 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49QLzp45TZz4183 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]; TAGGED_RCPT(0.00)[]; ASN(0.00)[asn:14618, ipnet:54.86.0.0/16, 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, 18 May 2020 01:30:15 -0000 On 2020-05-17 16:48, Oliver Pinter wrote: > On Sunday, May 17, 2020, Colin Percival > wrote: > +REGION=`fetch -qo- > http://169.254.169.254/latest/meta-data/placement/availability-zone > | > sed -e 's/[a-z]$//'` > > What will be this hard-coded ip address without any verification or at least > https? That's a magic IP address which connects to the EC2 "instance metadata service". It doesn't actually go out over the network. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@freebsd.org Mon May 18 01:34: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 91FA62FB847; Mon, 18 May 2020 01:34:27 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [18.222.6.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QM4g3NTQz41ts; Mon, 18 May 2020 01:34:27 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (unknown [18.188.142.31]) by mail.soaustin.net (Postfix) with ESMTPSA id 9EA1613E42; Mon, 18 May 2020 01:34:26 +0000 (UTC) Date: Mon, 18 May 2020 01:34:25 +0000 From: Mark Linimon To: Colin Percival Cc: Oliver Pinter , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r361143 - head/release/tools Message-ID: <20200518013425.GJ26937@lonesome.com> References: <202005172155.04HLt07J036230@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Rspamd-Queue-Id: 49QM4g3NTQz41ts X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_RCPT(0.00)[]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:18.220.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: Mon, 18 May 2020 01:34:27 -0000 Defining it to MAGIC_UNROUTED_IP_ADDRESS or something would have obviated our questions :-) mcl From owner-svn-src-all@freebsd.org Mon May 18 01:35: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 C15932FBB89; Mon, 18 May 2020 01:35:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QM684gF4z41vl; Mon, 18 May 2020 01:35:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B80119E83; Mon, 18 May 2020 01:35:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I1Zi01071951; Mon, 18 May 2020 01:35:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I1ZiBn071950; Mon, 18 May 2020 01:35:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005180135.04I1ZiBn071950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 18 May 2020 01:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361148 - 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: 361148 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, 18 May 2020 01:35:44 -0000 Author: kevans Date: Mon May 18 01:35:44 2020 New Revision: 361148 URL: https://svnweb.freebsd.org/changeset/base/361148 Log: certctl: don't fall over flat with relative DESTDIR Up until now, all of our DESTDIR use has been with absolute paths. It turned out that the cd in/out dance we do here breaks us down later on, as the relative path no longer resolves. Convert EXTENSIONS to an ERE that we'll use to grep ls -1 of the dir we're inspecting, rather than cd'ing into it and globbing it up. MFC after: 3 days Modified: head/usr.sbin/certctl/certctl.sh Modified: head/usr.sbin/certctl/certctl.sh ============================================================================== --- head/usr.sbin/certctl/certctl.sh Mon May 18 00:32:42 2020 (r361147) +++ head/usr.sbin/certctl/certctl.sh Mon May 18 01:35:44 2020 (r361148) @@ -34,7 +34,7 @@ : ${BLACKLISTPATH:=${DESTDIR}/usr/share/certs/blacklisted:${DESTDIR}/usr/local/etc/ssl/blacklisted} : ${CERTDESTDIR:=${DESTDIR}/etc/ssl/certs} : ${BLACKLISTDESTDIR:=${DESTDIR}/etc/ssl/blacklisted} -: ${EXTENSIONS:="*.pem *.crt *.cer *.crl *.0"} +: ${FILEPAT:="\.pem$|\.crt$|\.cer$|\.crl$|\.0$"} : ${VERBOSE:=0} ############################################################ GLOBALS @@ -104,13 +104,11 @@ do_scan() for CPATH in "$@"; do [ -d "$CPATH" ] || continue echo "Scanning $CPATH for certificates..." - cd "$CPATH" - for CFILE in $EXTENSIONS; do - [ -e "$CFILE" ] || continue + for CFILE in $(ls -1 "${CPATH}" | grep -Ee "${FILEPAT}"); do + [ -e "$CPATH/$CFILE" ] || continue [ $VERBOSE -gt 0 ] && echo "Reading $CFILE" "$CFUNC" "$CPATH/$CFILE" done - cd - done } From owner-svn-src-all@freebsd.org Mon May 18 01: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 B5FB22FBCB6; Mon, 18 May 2020 01:48:55 +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 49QMPM4JRjz42cw; Mon, 18 May 2020 01:48:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A36F19BB4; Mon, 18 May 2020 01:48:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I1mtuS078200; Mon, 18 May 2020 01:48:55 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I1mtbV078199; Mon, 18 May 2020 01:48:55 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005180148.04I1mtbV078199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 18 May 2020 01:48:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361149 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 361149 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, 18 May 2020 01:48:55 -0000 Author: kevans Date: Mon May 18 01:48:55 2020 New Revision: 361149 URL: https://svnweb.freebsd.org/changeset/base/361149 Log: Revert r360833, r360882: certctl rehash in installworld This was solving the correct-ish problem in the wrong place. Noted by brooks; while he didn't request a prompt revert, doing so now will facilitate proper testing for the revised version of this. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon May 18 01:35:44 2020 (r361148) +++ head/Makefile.inc1 Mon May 18 01:48:55 2020 (r361149) @@ -1403,16 +1403,6 @@ distributeworld installworld stageworld: _installcheck ${DESTDIR}/${DISTDIR}/${dist}.debug.meta .endfor .endif -.elif make(installworld) && ${MK_CAROOT} != "no" - # We could make certctl a bootstrap tool, but it requires OpenSSL and - # friends, which we likely don't want. We'll rehash on a best-effort - # basis, otherwise we'll just mention that we're not doing it to raise - # awareness. - @if which certctl>/dev/null; then \ - certctl rehash; \ - else \ - echo "No certctl on the host, not rehashing target -- /etc/ssl may not be populated."; \ - fi .endif packageworld: .PHONY From owner-svn-src-all@freebsd.org Mon May 18 01:55: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 88F092FC092; Mon, 18 May 2020 01:55:39 +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 49QMY70wQnz42qY; Mon, 18 May 2020 01:55:38 +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 04I1tUrI098552; Sun, 17 May 2020 18:55:30 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04I1tUtV098551; Sun, 17 May 2020 18:55:30 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202005180155.04I1tUtV098551@gndrsh.dnsmgr.net> Subject: Re: svn commit: r361143 - head/release/tools In-Reply-To: To: Ed Maste Date: Sun, 17 May 2020 18:55:30 -0700 (PDT) CC: Conrad Meyer , Oliver Pinter , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49QMY70wQnz42qY X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_RCPT(0.00)[]; REPLY(-4.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, 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, 18 May 2020 01:55:39 -0000 > On Sun, 17 May 2020 at 20:24, Conrad Meyer wrote: > > > > On Sun, May 17, 2020 at 4:49 PM Oliver Pinter wrote: > > > On Sunday, May 17, 2020, Colin Percival wrote: > > >> +# Provide instructions on how to mount the requested filesystem. > > >> +FS=$1 > > >> +REGION=`fetch -qo- http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's/[a-z]$//'` > > > > > > > > > What will be this hard-coded ip address without any verification or at least https? > > > > It's a special non-routable IP that is used in at least AWS and Azure > > to provide some VM services. Traffic to and from it never leaves the > > virtual overlay network, which by design VM instances already trust to > > provide privacy. It doesn't require functioning DNS to access the raw > > IP. > > And, more information at > https://en.wikipedia.org/wiki/Link-local_address And the definative document(s) https://www.rfc-editor.org/rfc/rfc3927.txt https://who.is/whois-ip/ip-address/169.254.0.0 -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon May 18 02:14: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 7CCA82FC655; Mon, 18 May 2020 02:14:26 +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 49QMyp2lbZz43pY; Mon, 18 May 2020 02:14:26 +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 59AE219EE2; Mon, 18 May 2020 02:14:26 +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 04I2EQJZ096341; Mon, 18 May 2020 02:14:26 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I2EQCW096340; Mon, 18 May 2020 02:14:26 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202005180214.04I2EQCW096340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Mon, 18 May 2020 02:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361150 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 361150 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, 18 May 2020 02:14:26 -0000 Author: cperciva Date: Mon May 18 02:14:25 2020 New Revision: 361150 URL: https://svnweb.freebsd.org/changeset/base/361150 Log: Add ebsnvme-id to EC2 AMIs and enable /dev/aws/disk The ebsnvme-id utility exposes information about EC2 disks -- for Elastic Block Store volumes, their volume IDs and "linux device names", and for Instance Store (aka "Ephemeral") disks, their serial numbers. The dev_aws_disk rc.d script and associated devd.conf rule maintains a tree under /dev/aws/disk: /dev/aws/disk/ebs/ /dev/aws/disk/linuxname/ /dev/aws/disk/ephemeral/ which are symlinks to the corresponding nda or nvd devices. 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 Mon May 18 01:48:55 2020 (r361149) +++ head/release/tools/ec2.conf Mon May 18 02:14:25 2020 (r361150) @@ -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" +export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs dual-dhclient-daemon 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. @@ -17,7 +17,7 @@ if [ "${TARGET_ARCH}" = "amd64" ]; then 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" +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 # the partition to fill the root disk after the EC2 instance is launched. From owner-svn-src-all@freebsd.org Mon May 18 03:10: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 446802FD70E; Mon, 18 May 2020 03:10:04 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QPC00pMdz46Dr; Mon, 18 May 2020 03:10:04 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (c-98-207-126-143.hsd1.ca.comcast.net [98.207.126.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 6BD691C0CB; Mon, 18 May 2020 03:10:03 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.37.20051002 Date: Sun, 17 May 2020 20:09:58 -0700 Subject: Re: svn commit: r361143 - head/release/tools From: Ravi Pokala To: Colin Percival , Oliver Pinter CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: Thread-Topic: svn commit: r361143 - head/release/tools References: <202005172155.04HLt07J036230@repo.freebsd.org> In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" 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: Mon, 18 May 2020 03:10:04 -0000 -----Original Message----- From: on behalf of Colin Percival Date: 2020-05-17, Sunday at 18:30 To: Oliver Pinter Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r361143 - head/release/tools > On 2020-05-17 16:48, Oliver Pinter wrote: >> On Sunday, May 17, 2020, Colin Percival > > wrote: >> +REGION=`fetch -qo- >> http://169.254.169.254/latest/meta-data/placement/availability-zone >> | >> sed -e 's/[a-z]$//'` >> >> What will be this hard-coded ip address without any verification or at least >> https? > > That's a magic IP address which connects to the EC2 "instance metadata > service". It doesn't actually go out over the network. A comment would be appreciated, e.g. "Amazon uses this link-local address for the EC2 instance metadata service" Thanks, Ravi (rpokala@) > -- > Colin Percival > Security Officer Emeritus, FreeBSD | The power to serve > Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@freebsd.org Mon May 18 07:06: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 2F29D138B05; Mon, 18 May 2020 07:06:36 +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 49QVRw0D2hz4H23; Mon, 18 May 2020 07:06:36 +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 02D8D1D99D; Mon, 18 May 2020 07:06:36 +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 04I76ZiR074972; Mon, 18 May 2020 07:06:35 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I76ZPe074971; Mon, 18 May 2020 07:06:35 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <202005180706.04I76ZPe074971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Mon, 18 May 2020 07:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r361151 - releng/11.4/sys/amd64/vmm X-SVN-Group: releng X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: releng/11.4/sys/amd64/vmm X-SVN-Commit-Revision: 361151 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, 18 May 2020 07:06:36 -0000 Author: grehan Date: Mon May 18 07:06:35 2020 New Revision: 361151 URL: https://svnweb.freebsd.org/changeset/base/361151 Log: MFS r361132 Hide host CPUID 0x15 TSC/Crystal ratio/freq info from guest Approved by: re (kib), bz (mentor) Modified: releng/11.4/sys/amd64/vmm/x86.c releng/11.4/sys/amd64/vmm/x86.h Directory Properties: releng/11.4/ (props changed) Modified: releng/11.4/sys/amd64/vmm/x86.c ============================================================================== --- releng/11.4/sys/amd64/vmm/x86.c Mon May 18 02:14:25 2020 (r361150) +++ releng/11.4/sys/amd64/vmm/x86.c Mon May 18 07:06:35 2020 (r361151) @@ -554,6 +554,18 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, } break; + case CPUID_0000_0015: + /* + * Don't report CPU TSC/Crystal ratio and clock + * values since guests may use these to derive the + * local APIC frequency.. + */ + regs[0] = 0; + regs[1] = 0; + regs[2] = 0; + regs[3] = 0; + break; + case 0x40000000: regs[0] = CPUID_VM_HIGH; bcopy(bhyve_id, ®s[1], 4); Modified: releng/11.4/sys/amd64/vmm/x86.h ============================================================================== --- releng/11.4/sys/amd64/vmm/x86.h Mon May 18 02:14:25 2020 (r361150) +++ releng/11.4/sys/amd64/vmm/x86.h Mon May 18 07:06:35 2020 (r361151) @@ -39,6 +39,7 @@ #define CPUID_0000_000A (0xA) #define CPUID_0000_000B (0xB) #define CPUID_0000_000D (0xD) +#define CPUID_0000_0015 (0x15) #define CPUID_8000_0000 (0x80000000) #define CPUID_8000_0001 (0x80000001) #define CPUID_8000_0002 (0x80000002) From owner-svn-src-all@freebsd.org Mon May 18 08:40: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 1962713A560; Mon, 18 May 2020 08:40:41 +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 49QXXS6ymvz4NDr; Mon, 18 May 2020 08:40:40 +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 EA5AA1EB25; Mon, 18 May 2020 08:40:40 +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 04I8eeAU034389; Mon, 18 May 2020 08:40:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8eeqT034385; Mon, 18 May 2020 08:40:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180840.04I8eeqT034385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:40:40 +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: r361152 - stable/12/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361152 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, 18 May 2020 08:40:41 -0000 Author: hselasky Date: Mon May 18 08:40:39 2020 New Revision: 361152 URL: https://svnweb.freebsd.org/changeset/base/361152 Log: MFC r360070: Add missing feature descriptions to hci_features2str(). The list of possible features in hccontrol/features2str() is incomplete. Refer to "Bluetooth Core Specification 5.2 Vol. 2 Part C. 3.3 Feature Mask Definition". Submitted by: Marc Veldman PR: 245354 Sponsored by: Mellanox Technologies Modified: stable/12/usr.sbin/bluetooth/hccontrol/info.c stable/12/usr.sbin/bluetooth/hccontrol/link_control.c stable/12/usr.sbin/bluetooth/hccontrol/node.c stable/12/usr.sbin/bluetooth/hccontrol/util.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bluetooth/hccontrol/info.c ============================================================================== --- stable/12/usr.sbin/bluetooth/hccontrol/info.c Mon May 18 07:06:35 2020 (r361151) +++ stable/12/usr.sbin/bluetooth/hccontrol/info.c Mon May 18 08:40:39 2020 (r361152) @@ -78,7 +78,7 @@ hci_read_local_supported_features(int s, int argc, cha { ng_hci_read_local_features_rp rp; int n; - char buffer[1024]; + char buffer[2048]; n = sizeof(rp); if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_INFO, Modified: stable/12/usr.sbin/bluetooth/hccontrol/link_control.c ============================================================================== --- stable/12/usr.sbin/bluetooth/hccontrol/link_control.c Mon May 18 07:06:35 2020 (r361151) +++ stable/12/usr.sbin/bluetooth/hccontrol/link_control.c Mon May 18 08:40:39 2020 (r361152) @@ -612,7 +612,7 @@ hci_read_remote_supported_features(int s, int argc, ch char b[512]; ng_hci_read_remote_features_cp cp; ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t *) b; - char buffer[1024]; + char buffer[2048]; /* parse command parameters */ switch (argc) { Modified: stable/12/usr.sbin/bluetooth/hccontrol/node.c ============================================================================== --- stable/12/usr.sbin/bluetooth/hccontrol/node.c Mon May 18 07:06:35 2020 (r361151) +++ stable/12/usr.sbin/bluetooth/hccontrol/node.c Mon May 18 08:40:39 2020 (r361152) @@ -153,7 +153,7 @@ hci_read_node_features(int s, int argc, char **argv) { struct ng_btsocket_hci_raw_node_features r; int n; - char buffer[1024]; + char buffer[2048]; memset(&r, 0, sizeof(r)); if (ioctl(s, SIOC_HCI_RAW_NODE_GET_FEATURES, &r, sizeof(r)) < 0) Modified: stable/12/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- stable/12/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 07:06:35 2020 (r361151) +++ stable/12/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:40:39 2020 (r361152) @@ -289,7 +289,57 @@ hci_features2str(uint8_t *features, char *buffer, int /* 4 */ " ", /* 5 */ " ", /* 6 */ " ", - /* 7 */ " " + /* 7 */ " " + }, + { /* byte 3 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 4 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ "
", + /* 6 */ " ", + /* 7 */ "<3-Slot EDR ACL packets> " + }, + { /* byte 5 */ + /* 0 */ "<5-Slot EDR ACL packets> ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ "<3-Slot EDR eSCO packets> " + }, + { /* byte 6 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 7 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " }}; if (buffer != NULL && size > 0) { From owner-svn-src-all@freebsd.org Mon May 18 08:42: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 789E513A370; Mon, 18 May 2020 08:42:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QXZC2h7mz4Ntt; Mon, 18 May 2020 08:42:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 576351ED1E; Mon, 18 May 2020 08:42:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I8gBPI035501; Mon, 18 May 2020 08:42:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8gAN4035495; Mon, 18 May 2020 08:42:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180842.04I8gAN4035495@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:42:10 +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: r361153 - stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361153 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, 18 May 2020 08:42:11 -0000 Author: hselasky Date: Mon May 18 08:42:10 2020 New Revision: 361153 URL: https://svnweb.freebsd.org/changeset/base/361153 Log: MFC r360070: Add missing feature descriptions to hci_features2str(). The list of possible features in hccontrol/features2str() is incomplete. Refer to "Bluetooth Core Specification 5.2 Vol. 2 Part C. 3.3 Feature Mask Definition". Submitted by: Marc Veldman PR: 245354 Sponsored by: Mellanox Technologies Modified: stable/11/usr.sbin/bluetooth/hccontrol/info.c stable/11/usr.sbin/bluetooth/hccontrol/link_control.c stable/11/usr.sbin/bluetooth/hccontrol/node.c stable/11/usr.sbin/bluetooth/hccontrol/util.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bluetooth/hccontrol/info.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/info.c Mon May 18 08:40:39 2020 (r361152) +++ stable/11/usr.sbin/bluetooth/hccontrol/info.c Mon May 18 08:42:10 2020 (r361153) @@ -78,7 +78,7 @@ hci_read_local_supported_features(int s, int argc, cha { ng_hci_read_local_features_rp rp; int n; - char buffer[1024]; + char buffer[2048]; n = sizeof(rp); if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_INFO, Modified: stable/11/usr.sbin/bluetooth/hccontrol/link_control.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/link_control.c Mon May 18 08:40:39 2020 (r361152) +++ stable/11/usr.sbin/bluetooth/hccontrol/link_control.c Mon May 18 08:42:10 2020 (r361153) @@ -612,7 +612,7 @@ hci_read_remote_supported_features(int s, int argc, ch char b[512]; ng_hci_read_remote_features_cp cp; ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t *) b; - char buffer[1024]; + char buffer[2048]; /* parse command parameters */ switch (argc) { Modified: stable/11/usr.sbin/bluetooth/hccontrol/node.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/node.c Mon May 18 08:40:39 2020 (r361152) +++ stable/11/usr.sbin/bluetooth/hccontrol/node.c Mon May 18 08:42:10 2020 (r361153) @@ -153,7 +153,7 @@ hci_read_node_features(int s, int argc, char **argv) { struct ng_btsocket_hci_raw_node_features r; int n; - char buffer[1024]; + char buffer[2048]; memset(&r, 0, sizeof(r)); if (ioctl(s, SIOC_HCI_RAW_NODE_GET_FEATURES, &r, sizeof(r)) < 0) Modified: stable/11/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:40:39 2020 (r361152) +++ stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:42:10 2020 (r361153) @@ -289,7 +289,57 @@ hci_features2str(uint8_t *features, char *buffer, int /* 4 */ " ", /* 5 */ " ", /* 6 */ " ", - /* 7 */ " " + /* 7 */ " " + }, + { /* byte 3 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 4 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ "
", + /* 6 */ " ", + /* 7 */ "<3-Slot EDR ACL packets> " + }, + { /* byte 5 */ + /* 0 */ "<5-Slot EDR ACL packets> ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ "<3-Slot EDR eSCO packets> " + }, + { /* byte 6 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 7 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " }}; if (buffer != NULL && size > 0) { From owner-svn-src-all@freebsd.org Mon May 18 08:43: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 A280513A976; Mon, 18 May 2020 08:43:06 +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 49QXbG3l1Zz4NsP; Mon, 18 May 2020 08:43:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B6B61EABE; Mon, 18 May 2020 08:43:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I8h6Dv037209; Mon, 18 May 2020 08:43:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8h5VS037204; Mon, 18 May 2020 08:43:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180843.04I8h5VS037204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:43:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r361154 - stable/10/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361154 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, 18 May 2020 08:43:06 -0000 Author: hselasky Date: Mon May 18 08:43:05 2020 New Revision: 361154 URL: https://svnweb.freebsd.org/changeset/base/361154 Log: MFC r360070: Add missing feature descriptions to hci_features2str(). The list of possible features in hccontrol/features2str() is incomplete. Refer to "Bluetooth Core Specification 5.2 Vol. 2 Part C. 3.3 Feature Mask Definition". Submitted by: Marc Veldman PR: 245354 Sponsored by: Mellanox Technologies Modified: stable/10/usr.sbin/bluetooth/hccontrol/info.c stable/10/usr.sbin/bluetooth/hccontrol/link_control.c stable/10/usr.sbin/bluetooth/hccontrol/node.c stable/10/usr.sbin/bluetooth/hccontrol/util.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bluetooth/hccontrol/info.c ============================================================================== --- stable/10/usr.sbin/bluetooth/hccontrol/info.c Mon May 18 08:42:10 2020 (r361153) +++ stable/10/usr.sbin/bluetooth/hccontrol/info.c Mon May 18 08:43:05 2020 (r361154) @@ -75,7 +75,7 @@ hci_read_local_supported_features(int s, int argc, cha { ng_hci_read_local_features_rp rp; int n; - char buffer[1024]; + char buffer[2048]; n = sizeof(rp); if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_INFO, Modified: stable/10/usr.sbin/bluetooth/hccontrol/link_control.c ============================================================================== --- stable/10/usr.sbin/bluetooth/hccontrol/link_control.c Mon May 18 08:42:10 2020 (r361153) +++ stable/10/usr.sbin/bluetooth/hccontrol/link_control.c Mon May 18 08:43:05 2020 (r361154) @@ -609,7 +609,7 @@ hci_read_remote_supported_features(int s, int argc, ch char b[512]; ng_hci_read_remote_features_cp cp; ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t *) b; - char buffer[1024]; + char buffer[2048]; /* parse command parameters */ switch (argc) { Modified: stable/10/usr.sbin/bluetooth/hccontrol/node.c ============================================================================== --- stable/10/usr.sbin/bluetooth/hccontrol/node.c Mon May 18 08:42:10 2020 (r361153) +++ stable/10/usr.sbin/bluetooth/hccontrol/node.c Mon May 18 08:43:05 2020 (r361154) @@ -150,7 +150,7 @@ hci_read_node_features(int s, int argc, char **argv) { struct ng_btsocket_hci_raw_node_features r; int n; - char buffer[1024]; + char buffer[2048]; memset(&r, 0, sizeof(r)); if (ioctl(s, SIOC_HCI_RAW_NODE_GET_FEATURES, &r, sizeof(r)) < 0) Modified: stable/10/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- stable/10/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:42:10 2020 (r361153) +++ stable/10/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:43:05 2020 (r361154) @@ -276,7 +276,57 @@ hci_features2str(uint8_t *features, char *buffer, int /* 4 */ " ", /* 5 */ " ", /* 6 */ " ", - /* 7 */ " " + /* 7 */ " " + }, + { /* byte 3 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 4 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ "
", + /* 6 */ " ", + /* 7 */ "<3-Slot EDR ACL packets> " + }, + { /* byte 5 */ + /* 0 */ "<5-Slot EDR ACL packets> ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ "<3-Slot EDR eSCO packets> " + }, + { /* byte 6 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 7 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " }}; if (buffer != NULL && size > 0) { From owner-svn-src-all@freebsd.org Mon May 18 08:44: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 73CB713AB28; Mon, 18 May 2020 08:44:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QXcd2WZHz4PCL; Mon, 18 May 2020 08:44:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51B331EF81; Mon, 18 May 2020 08:44:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I8iHtN037357; Mon, 18 May 2020 08:44:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8iHp7037356; Mon, 18 May 2020 08:44:17 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180844.04I8iHp7037356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:44:17 +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: r361155 - in stable/12: sys/netgraph/bluetooth/hci usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12: sys/netgraph/bluetooth/hci usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361155 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, 18 May 2020 08:44:17 -0000 Author: hselasky Date: Mon May 18 08:44:16 2020 New Revision: 361155 URL: https://svnweb.freebsd.org/changeset/base/361155 Log: MFC r360092: Bring HCI error messages up-to-date. See Bluetooth v5.6 core specification Vol.1 Part F: Controller error codes. Submitted by: Marc Veldman PR: 245737 Sponsored by: Mellanox Technologies Modified: stable/12/sys/netgraph/bluetooth/hci/ng_hci_misc.c stable/12/usr.sbin/bluetooth/hccontrol/util.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netgraph/bluetooth/hci/ng_hci_misc.c ============================================================================== --- stable/12/sys/netgraph/bluetooth/hci/ng_hci_misc.c Mon May 18 08:43:05 2020 (r361154) +++ stable/12/sys/netgraph/bluetooth/hci/ng_hci_misc.c Mon May 18 08:44:16 2020 (r361155) @@ -491,7 +491,35 @@ ng_hci_str_error(u_int16_t code) /* 0x26 */ "Unit key used", /* 0x27 */ "QoS is not supported", /* 0x28 */ "Instant passed", - /* 0x29 */ "Paring with unit key not supported", + /* 0x29 */ "Pairing with unit key not supported", + /* 0x2a */ "Different Transaction Collision", + /* 0x2b */ "Unknown error (Reserved for future use)", + /* 0x2c */ "QoS Unacceptable Parameter", + /* 0x2d */ "QoS Rejected", + /* 0x2e */ "Channel Classification Not Supported", + /* 0x2f */ "Insufficient Security", + /* 0x30 */ "Parameter Out Of Mandatory Range", + /* 0x31 */ "Unknown error (Reserved for future use)", + /* 0x32 */ "Role Switch Pending", + /* 0x33 */ "Unknown error (Reserved for future use)", + /* 0x34 */ "Reserved Slot Violation", + /* 0x35 */ "Role Switch Failed", + /* 0x36 */ "Extended Inquiry Response Too Large", + /* 0x37 */ "Secure Simple Pairing Not Supported By Host", + /* 0x38 */ "Host Busy - Pairing", + /* 0x39 */ "Connection Rejected due to No Suitable Channel Found", + /* 0x3a */ "Controller Busy", + /* 0x3b */ "Unacceptable Connection Parameters", + /* 0x3c */ "Advertising Timeout", + /* 0x3d */ "Connection Terminated due to MIC Failure", + /* 0x3e */ "Connection Failed to be Established / Synchronization Timeout", + /* 0x3f */ "MAC Connection Failed", + /* 0x40 */ "Coarse Clock Adjustment Rejected but Will Try to Adjust Using Clock Dragging", + /* 0x41 */ "Type0 Submap Not Defined", + /* 0x42 */ "Unknown Advertising Identifier", + /* 0x43 */ "Limit Reached", + /* 0x44 */ "Operation Cancelled by Host", + /* 0x45 */ "Packet Too Long", /* SHOULD ALWAYS BE LAST */ "Unknown error" }; Modified: stable/12/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- stable/12/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:43:05 2020 (r361154) +++ stable/12/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:44:16 2020 (r361155) @@ -439,7 +439,35 @@ hci_status2str(int status) /* 0x26 */ "Unit key used", /* 0x27 */ "QoS is not supported", /* 0x28 */ "Instant passed", - /* 0x29 */ "Pairing with unit key not supported" + /* 0x29 */ "Pairing with unit key not supported", + /* 0x2a */ "Different Transaction Collision", + /* 0x2b */ "Unknown error (Reserved for future use)", + /* 0x2c */ "QoS Unacceptable Parameter", + /* 0x2d */ "QoS Rejected", + /* 0x2e */ "Channel Classification Not Supported", + /* 0x2f */ "Insufficient Security", + /* 0x30 */ "Parameter Out Of Mandatory Range", + /* 0x31 */ "Unknown error (Reserved for future use)", + /* 0x32 */ "Role Switch Pending", + /* 0x33 */ "Unknown error (Reserved for future use)", + /* 0x34 */ "Reserved Slot Violation", + /* 0x35 */ "Role Switch Failed", + /* 0x36 */ "Extended Inquiry Response Too Large", + /* 0x37 */ "Secure Simple Pairing Not Supported By Host", + /* 0x38 */ "Host Busy - Pairing", + /* 0x39 */ "Connection Rejected due to No Suitable Channel Found", + /* 0x3a */ "Controller Busy", + /* 0x3b */ "Unacceptable Connection Parameters", + /* 0x3c */ "Advertising Timeout", + /* 0x3d */ "Connection Terminated due to MIC Failure", + /* 0x3e */ "Connection Failed to be Established / Synchronization Timeout", + /* 0x3f */ "MAC Connection Failed", + /* 0x40 */ "Coarse Clock Adjustment Rejected but Will Try to Adjust Using Clock Dragging", + /* 0x41 */ "Type0 Submap Not Defined", + /* 0x42 */ "Unknown Advertising Identifier", + /* 0x43 */ "Limit Reached", + /* 0x44 */ "Operation Cancelled by Host", + /* 0x45 */ "Packet Too Long" }; return (status >= SIZE(t)? "Unknown error" : t[status]); From owner-svn-src-all@freebsd.org Mon May 18 08:44: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 7EB3813AD95; Mon, 18 May 2020 08:44:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QXdG2mP1z4P9C; Mon, 18 May 2020 08:44:50 +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 5A1CC1EABF; Mon, 18 May 2020 08:44:50 +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 04I8io9m037456; Mon, 18 May 2020 08:44:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8io3e037453; Mon, 18 May 2020 08:44:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180844.04I8io3e037453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:44:50 +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: r361156 - in stable/11: sys/netgraph/bluetooth/hci usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11: sys/netgraph/bluetooth/hci usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361156 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, 18 May 2020 08:44:50 -0000 Author: hselasky Date: Mon May 18 08:44:49 2020 New Revision: 361156 URL: https://svnweb.freebsd.org/changeset/base/361156 Log: MFC r360092: Bring HCI error messages up-to-date. See Bluetooth v5.6 core specification Vol.1 Part F: Controller error codes. Submitted by: Marc Veldman PR: 245737 Sponsored by: Mellanox Technologies Modified: stable/11/sys/netgraph/bluetooth/hci/ng_hci_misc.c stable/11/usr.sbin/bluetooth/hccontrol/util.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netgraph/bluetooth/hci/ng_hci_misc.c ============================================================================== --- stable/11/sys/netgraph/bluetooth/hci/ng_hci_misc.c Mon May 18 08:44:16 2020 (r361155) +++ stable/11/sys/netgraph/bluetooth/hci/ng_hci_misc.c Mon May 18 08:44:49 2020 (r361156) @@ -489,7 +489,35 @@ ng_hci_str_error(u_int16_t code) /* 0x26 */ "Unit key used", /* 0x27 */ "QoS is not supported", /* 0x28 */ "Instant passed", - /* 0x29 */ "Paring with unit key not supported", + /* 0x29 */ "Pairing with unit key not supported", + /* 0x2a */ "Different Transaction Collision", + /* 0x2b */ "Unknown error (Reserved for future use)", + /* 0x2c */ "QoS Unacceptable Parameter", + /* 0x2d */ "QoS Rejected", + /* 0x2e */ "Channel Classification Not Supported", + /* 0x2f */ "Insufficient Security", + /* 0x30 */ "Parameter Out Of Mandatory Range", + /* 0x31 */ "Unknown error (Reserved for future use)", + /* 0x32 */ "Role Switch Pending", + /* 0x33 */ "Unknown error (Reserved for future use)", + /* 0x34 */ "Reserved Slot Violation", + /* 0x35 */ "Role Switch Failed", + /* 0x36 */ "Extended Inquiry Response Too Large", + /* 0x37 */ "Secure Simple Pairing Not Supported By Host", + /* 0x38 */ "Host Busy - Pairing", + /* 0x39 */ "Connection Rejected due to No Suitable Channel Found", + /* 0x3a */ "Controller Busy", + /* 0x3b */ "Unacceptable Connection Parameters", + /* 0x3c */ "Advertising Timeout", + /* 0x3d */ "Connection Terminated due to MIC Failure", + /* 0x3e */ "Connection Failed to be Established / Synchronization Timeout", + /* 0x3f */ "MAC Connection Failed", + /* 0x40 */ "Coarse Clock Adjustment Rejected but Will Try to Adjust Using Clock Dragging", + /* 0x41 */ "Type0 Submap Not Defined", + /* 0x42 */ "Unknown Advertising Identifier", + /* 0x43 */ "Limit Reached", + /* 0x44 */ "Operation Cancelled by Host", + /* 0x45 */ "Packet Too Long", /* SHOULD ALWAYS BE LAST */ "Unknown error" }; Modified: stable/11/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:44:16 2020 (r361155) +++ stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:44:49 2020 (r361156) @@ -439,7 +439,35 @@ hci_status2str(int status) /* 0x26 */ "Unit key used", /* 0x27 */ "QoS is not supported", /* 0x28 */ "Instant passed", - /* 0x29 */ "Pairing with unit key not supported" + /* 0x29 */ "Pairing with unit key not supported", + /* 0x2a */ "Different Transaction Collision", + /* 0x2b */ "Unknown error (Reserved for future use)", + /* 0x2c */ "QoS Unacceptable Parameter", + /* 0x2d */ "QoS Rejected", + /* 0x2e */ "Channel Classification Not Supported", + /* 0x2f */ "Insufficient Security", + /* 0x30 */ "Parameter Out Of Mandatory Range", + /* 0x31 */ "Unknown error (Reserved for future use)", + /* 0x32 */ "Role Switch Pending", + /* 0x33 */ "Unknown error (Reserved for future use)", + /* 0x34 */ "Reserved Slot Violation", + /* 0x35 */ "Role Switch Failed", + /* 0x36 */ "Extended Inquiry Response Too Large", + /* 0x37 */ "Secure Simple Pairing Not Supported By Host", + /* 0x38 */ "Host Busy - Pairing", + /* 0x39 */ "Connection Rejected due to No Suitable Channel Found", + /* 0x3a */ "Controller Busy", + /* 0x3b */ "Unacceptable Connection Parameters", + /* 0x3c */ "Advertising Timeout", + /* 0x3d */ "Connection Terminated due to MIC Failure", + /* 0x3e */ "Connection Failed to be Established / Synchronization Timeout", + /* 0x3f */ "MAC Connection Failed", + /* 0x40 */ "Coarse Clock Adjustment Rejected but Will Try to Adjust Using Clock Dragging", + /* 0x41 */ "Type0 Submap Not Defined", + /* 0x42 */ "Unknown Advertising Identifier", + /* 0x43 */ "Limit Reached", + /* 0x44 */ "Operation Cancelled by Host", + /* 0x45 */ "Packet Too Long" }; return (status >= SIZE(t)? "Unknown error" : t[status]); From owner-svn-src-all@freebsd.org Mon May 18 08:45: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 4C70513ADA0; Mon, 18 May 2020 08:45:25 +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 49QXdx1L5qz4PJc; Mon, 18 May 2020 08:45:25 +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 290171EF83; Mon, 18 May 2020 08:45:25 +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 04I8jPmv037568; Mon, 18 May 2020 08:45:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8jO7C037566; Mon, 18 May 2020 08:45:24 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180845.04I8jO7C037566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r361157 - in stable/10: sys/netgraph/bluetooth/hci usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10: sys/netgraph/bluetooth/hci usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361157 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, 18 May 2020 08:45:25 -0000 Author: hselasky Date: Mon May 18 08:45:24 2020 New Revision: 361157 URL: https://svnweb.freebsd.org/changeset/base/361157 Log: MFC r360092: Bring HCI error messages up-to-date. See Bluetooth v5.6 core specification Vol.1 Part F: Controller error codes. Submitted by: Marc Veldman PR: 245737 Sponsored by: Mellanox Technologies Modified: stable/10/sys/netgraph/bluetooth/hci/ng_hci_misc.c stable/10/usr.sbin/bluetooth/hccontrol/util.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netgraph/bluetooth/hci/ng_hci_misc.c ============================================================================== --- stable/10/sys/netgraph/bluetooth/hci/ng_hci_misc.c Mon May 18 08:44:49 2020 (r361156) +++ stable/10/sys/netgraph/bluetooth/hci/ng_hci_misc.c Mon May 18 08:45:24 2020 (r361157) @@ -488,7 +488,35 @@ ng_hci_str_error(u_int16_t code) /* 0x26 */ "Unit key used", /* 0x27 */ "QoS is not supported", /* 0x28 */ "Instant passed", - /* 0x29 */ "Paring with unit key not supported", + /* 0x29 */ "Pairing with unit key not supported", + /* 0x2a */ "Different Transaction Collision", + /* 0x2b */ "Unknown error (Reserved for future use)", + /* 0x2c */ "QoS Unacceptable Parameter", + /* 0x2d */ "QoS Rejected", + /* 0x2e */ "Channel Classification Not Supported", + /* 0x2f */ "Insufficient Security", + /* 0x30 */ "Parameter Out Of Mandatory Range", + /* 0x31 */ "Unknown error (Reserved for future use)", + /* 0x32 */ "Role Switch Pending", + /* 0x33 */ "Unknown error (Reserved for future use)", + /* 0x34 */ "Reserved Slot Violation", + /* 0x35 */ "Role Switch Failed", + /* 0x36 */ "Extended Inquiry Response Too Large", + /* 0x37 */ "Secure Simple Pairing Not Supported By Host", + /* 0x38 */ "Host Busy - Pairing", + /* 0x39 */ "Connection Rejected due to No Suitable Channel Found", + /* 0x3a */ "Controller Busy", + /* 0x3b */ "Unacceptable Connection Parameters", + /* 0x3c */ "Advertising Timeout", + /* 0x3d */ "Connection Terminated due to MIC Failure", + /* 0x3e */ "Connection Failed to be Established / Synchronization Timeout", + /* 0x3f */ "MAC Connection Failed", + /* 0x40 */ "Coarse Clock Adjustment Rejected but Will Try to Adjust Using Clock Dragging", + /* 0x41 */ "Type0 Submap Not Defined", + /* 0x42 */ "Unknown Advertising Identifier", + /* 0x43 */ "Limit Reached", + /* 0x44 */ "Operation Cancelled by Host", + /* 0x45 */ "Packet Too Long", /* SHOULD ALWAYS BE LAST */ "Unknown error" }; Modified: stable/10/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- stable/10/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:44:49 2020 (r361156) +++ stable/10/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:45:24 2020 (r361157) @@ -426,7 +426,35 @@ hci_status2str(int status) /* 0x26 */ "Unit key used", /* 0x27 */ "QoS is not supported", /* 0x28 */ "Instant passed", - /* 0x29 */ "Pairing with unit key not supported" + /* 0x29 */ "Pairing with unit key not supported", + /* 0x2a */ "Different Transaction Collision", + /* 0x2b */ "Unknown error (Reserved for future use)", + /* 0x2c */ "QoS Unacceptable Parameter", + /* 0x2d */ "QoS Rejected", + /* 0x2e */ "Channel Classification Not Supported", + /* 0x2f */ "Insufficient Security", + /* 0x30 */ "Parameter Out Of Mandatory Range", + /* 0x31 */ "Unknown error (Reserved for future use)", + /* 0x32 */ "Role Switch Pending", + /* 0x33 */ "Unknown error (Reserved for future use)", + /* 0x34 */ "Reserved Slot Violation", + /* 0x35 */ "Role Switch Failed", + /* 0x36 */ "Extended Inquiry Response Too Large", + /* 0x37 */ "Secure Simple Pairing Not Supported By Host", + /* 0x38 */ "Host Busy - Pairing", + /* 0x39 */ "Connection Rejected due to No Suitable Channel Found", + /* 0x3a */ "Controller Busy", + /* 0x3b */ "Unacceptable Connection Parameters", + /* 0x3c */ "Advertising Timeout", + /* 0x3d */ "Connection Terminated due to MIC Failure", + /* 0x3e */ "Connection Failed to be Established / Synchronization Timeout", + /* 0x3f */ "MAC Connection Failed", + /* 0x40 */ "Coarse Clock Adjustment Rejected but Will Try to Adjust Using Clock Dragging", + /* 0x41 */ "Type0 Submap Not Defined", + /* 0x42 */ "Unknown Advertising Identifier", + /* 0x43 */ "Limit Reached", + /* 0x44 */ "Operation Cancelled by Host", + /* 0x45 */ "Packet Too Long" }; return (status >= SIZE(t)? "Unknown error" : t[status]); From owner-svn-src-all@freebsd.org Mon May 18 08:46: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 CADAF13AB78; Mon, 18 May 2020 08:46:18 +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 49QXfy52g9z4PMq; Mon, 18 May 2020 08:46:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A82FB1EF86; Mon, 18 May 2020 08:46:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I8kIVl037680; Mon, 18 May 2020 08:46:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8kIJo037678; Mon, 18 May 2020 08:46:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180846.04I8kIJo037678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:46:18 +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: r361158 - stable/12/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361158 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, 18 May 2020 08:46:18 -0000 Author: hselasky Date: Mon May 18 08:46:17 2020 New Revision: 361158 URL: https://svnweb.freebsd.org/changeset/base/361158 Log: MFC r360094: Improve printing of le features in hccontrol(8). Submitted by: Marc Veldman PR: 245739 Sponsored by: Mellanox Technologies Modified: stable/12/usr.sbin/bluetooth/hccontrol/hccontrol.h stable/12/usr.sbin/bluetooth/hccontrol/le.c stable/12/usr.sbin/bluetooth/hccontrol/util.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bluetooth/hccontrol/hccontrol.h ============================================================================== --- stable/12/usr.sbin/bluetooth/hccontrol/hccontrol.h Mon May 18 08:45:24 2020 (r361157) +++ stable/12/usr.sbin/bluetooth/hccontrol/hccontrol.h Mon May 18 08:46:17 2020 (r361158) @@ -73,6 +73,7 @@ char const * hci_ver2str (int); char const * hci_lmpver2str (int); char const * hci_manufacturer2str(int); char const * hci_features2str (uint8_t *, char *, int); +char const * hci_le_features2str (uint8_t *, char *, int); char const * hci_cc2str (int); char const * hci_con_state2str (int); char const * hci_status2str (int); Modified: stable/12/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- stable/12/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 08:45:24 2020 (r361157) +++ stable/12/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 08:46:17 2020 (r361158) @@ -225,18 +225,37 @@ static int le_read_local_supported_features(int s, int argc ,char *argv[]) { ng_hci_le_read_local_supported_features_rp rp; - int e; int n = sizeof(rp); - e = hci_simple_request(s, + union { + uint64_t raw; + uint8_t octets[8]; + } le_features; + + char buffer[2048]; + + if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, NG_HCI_OCF_LE_READ_LOCAL_SUPPORTED_FEATURES), - (void *)&rp, &n); + (void *)&rp, &n) == ERROR) + return (ERROR); - printf("LOCAL SUPPORTED: %d %d %jx\n", e, rp.status, - (uintmax_t) rp.le_features); + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } - return 0; + le_features.raw = rp.le_features; + + fprintf(stdout, "LE Features: "); + for(int i = 0; i < 8; i++) + fprintf(stdout, " %#02x", le_features.octets[i]); + fprintf(stdout, "\n%s\n", hci_le_features2str(le_features.octets, + buffer, sizeof(buffer))); + fprintf(stdout, "\n"); + + return OK; } static int Modified: stable/12/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- stable/12/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:45:24 2020 (r361157) +++ stable/12/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:46:17 2020 (r361158) @@ -371,6 +371,119 @@ done: } /* hci_features2str */ char const * +hci_le_features2str(uint8_t *features, char *buffer, int size) +{ + static char const * const t[][8] = { + { /* byte 0 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 1 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 2 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 3 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 4 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 5 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 6 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 7 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }}; + + if (buffer != NULL && size > 0) { + int n, i, len0, len1; + + memset(buffer, 0, size); + len1 = 0; + + for (n = 0; n < SIZE(t); n++) { + for (i = 0; i < SIZE(t[n]); i++) { + len0 = strlen(buffer); + if (len0 >= size) + goto done; + + if (features[n] & (1 << i)) { + if (len1 + strlen(t[n][i]) > 60) { + len1 = 0; + buffer[len0 - 1] = '\n'; + } + + len1 += strlen(t[n][i]); + strncat(buffer, t[n][i], size - len0); + } + } + } + } +done: + return (buffer); +} + +char const * hci_cc2str(int cc) { static char const * const t[] = { From owner-svn-src-all@freebsd.org Mon May 18 08:46: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 1C03A13AF02; Mon, 18 May 2020 08:46:54 +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 49QXgd73VJz4Pjs; Mon, 18 May 2020 08:46:53 +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 ED6F41ED23; Mon, 18 May 2020 08:46:53 +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 04I8krsh037779; Mon, 18 May 2020 08:46:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8krGF037776; Mon, 18 May 2020 08:46:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180846.04I8krGF037776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:46:53 +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: r361159 - stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361159 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, 18 May 2020 08:46:54 -0000 Author: hselasky Date: Mon May 18 08:46:53 2020 New Revision: 361159 URL: https://svnweb.freebsd.org/changeset/base/361159 Log: MFC r360094: Improve printing of le features in hccontrol(8). Submitted by: Marc Veldman PR: 245739 Sponsored by: Mellanox Technologies Modified: stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.h stable/11/usr.sbin/bluetooth/hccontrol/le.c stable/11/usr.sbin/bluetooth/hccontrol/util.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.h ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.h Mon May 18 08:46:17 2020 (r361158) +++ stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.h Mon May 18 08:46:53 2020 (r361159) @@ -73,6 +73,7 @@ char const * hci_ver2str (int); char const * hci_lmpver2str (int); char const * hci_manufacturer2str(int); char const * hci_features2str (uint8_t *, char *, int); +char const * hci_le_features2str (uint8_t *, char *, int); char const * hci_cc2str (int); char const * hci_con_state2str (int); char const * hci_status2str (int); Modified: stable/11/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 08:46:17 2020 (r361158) +++ stable/11/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 08:46:53 2020 (r361159) @@ -225,18 +225,37 @@ static int le_read_local_supported_features(int s, int argc ,char *argv[]) { ng_hci_le_read_local_supported_features_rp rp; - int e; int n = sizeof(rp); - e = hci_simple_request(s, + union { + uint64_t raw; + uint8_t octets[8]; + } le_features; + + char buffer[2048]; + + if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, NG_HCI_OCF_LE_READ_LOCAL_SUPPORTED_FEATURES), - (void *)&rp, &n); + (void *)&rp, &n) == ERROR) + return (ERROR); - printf("LOCAL SUPPORTED: %d %d %jx\n", e, rp.status, - (uintmax_t) rp.le_features); + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } - return 0; + le_features.raw = rp.le_features; + + fprintf(stdout, "LE Features: "); + for(int i = 0; i < 8; i++) + fprintf(stdout, " %#02x", le_features.octets[i]); + fprintf(stdout, "\n%s\n", hci_le_features2str(le_features.octets, + buffer, sizeof(buffer))); + fprintf(stdout, "\n"); + + return OK; } static int Modified: stable/11/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:46:17 2020 (r361158) +++ stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:46:53 2020 (r361159) @@ -371,6 +371,119 @@ done: } /* hci_features2str */ char const * +hci_le_features2str(uint8_t *features, char *buffer, int size) +{ + static char const * const t[][8] = { + { /* byte 0 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 1 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 2 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 3 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 4 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 5 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 6 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 7 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }}; + + if (buffer != NULL && size > 0) { + int n, i, len0, len1; + + memset(buffer, 0, size); + len1 = 0; + + for (n = 0; n < SIZE(t); n++) { + for (i = 0; i < SIZE(t[n]); i++) { + len0 = strlen(buffer); + if (len0 >= size) + goto done; + + if (features[n] & (1 << i)) { + if (len1 + strlen(t[n][i]) > 60) { + len1 = 0; + buffer[len0 - 1] = '\n'; + } + + len1 += strlen(t[n][i]); + strncat(buffer, t[n][i], size - len0); + } + } + } + } +done: + return (buffer); +} + +char const * hci_cc2str(int cc) { static char const * const t[] = { From owner-svn-src-all@freebsd.org Mon May 18 08:52: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 8160913B010; Mon, 18 May 2020 08:52:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QXng2tZCz4Q0j; Mon, 18 May 2020 08:52:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E3331ECE2; Mon, 18 May 2020 08:52:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I8q7xY043675; Mon, 18 May 2020 08:52:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8q7Q7043674; Mon, 18 May 2020 08:52:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180852.04I8q7Q7043674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:52:07 +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: r361160 - stable/12/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361160 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, 18 May 2020 08:52:07 -0000 Author: hselasky Date: Mon May 18 08:52:06 2020 New Revision: 361160 URL: https://svnweb.freebsd.org/changeset/base/361160 Log: MFC r360095: Fix cut and paste off-by-one error in hccontrol(8). Make sure strncpy() doesn't write beyond its given buffer. PR: 245739 Sponsored by: Mellanox Technologies Modified: stable/12/usr.sbin/bluetooth/hccontrol/util.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- stable/12/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:46:53 2020 (r361159) +++ stable/12/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:52:06 2020 (r361160) @@ -134,6 +134,7 @@ hci_hmode2str(int mode, char *buffer, int size) int n; memset(buffer, 0, size); + size--; for (n = 0; n < SIZE(t); n++) { int len = strlen(buffer); @@ -347,6 +348,7 @@ hci_features2str(uint8_t *features, char *buffer, int memset(buffer, 0, size); len1 = 0; + size--; for (n = 0; n < SIZE(t); n++) { for (i = 0; i < SIZE(t[n]); i++) { @@ -460,6 +462,7 @@ hci_le_features2str(uint8_t *features, char *buffer, i memset(buffer, 0, size); len1 = 0; + size--; for (n = 0; n < SIZE(t); n++) { for (i = 0; i < SIZE(t[n]); i++) { From owner-svn-src-all@freebsd.org Mon May 18 08:52: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 6A7F613AFAC; Mon, 18 May 2020 08:52:41 +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 49QXpK2DmVz4Q9y; Mon, 18 May 2020 08:52:41 +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 47EE81ECEB; Mon, 18 May 2020 08:52:41 +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 04I8qfdD043769; Mon, 18 May 2020 08:52:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8qfNq043768; Mon, 18 May 2020 08:52:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180852.04I8qfNq043768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:52: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: r361161 - stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361161 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, 18 May 2020 08:52:41 -0000 Author: hselasky Date: Mon May 18 08:52:40 2020 New Revision: 361161 URL: https://svnweb.freebsd.org/changeset/base/361161 Log: MFC r360095: Fix cut and paste off-by-one error in hccontrol(8). Make sure strncpy() doesn't write beyond its given buffer. PR: 245739 Sponsored by: Mellanox Technologies Modified: stable/11/usr.sbin/bluetooth/hccontrol/util.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:52:06 2020 (r361160) +++ stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:52:40 2020 (r361161) @@ -134,6 +134,7 @@ hci_hmode2str(int mode, char *buffer, int size) int n; memset(buffer, 0, size); + size--; for (n = 0; n < SIZE(t); n++) { int len = strlen(buffer); @@ -347,6 +348,7 @@ hci_features2str(uint8_t *features, char *buffer, int memset(buffer, 0, size); len1 = 0; + size--; for (n = 0; n < SIZE(t); n++) { for (i = 0; i < SIZE(t[n]); i++) { @@ -460,6 +462,7 @@ hci_le_features2str(uint8_t *features, char *buffer, i memset(buffer, 0, size); len1 = 0; + size--; for (n = 0; n < SIZE(t); n++) { for (i = 0; i < SIZE(t[n]); i++) { From owner-svn-src-all@freebsd.org Mon May 18 08:55: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 A8E0513B2E2; Mon, 18 May 2020 08:55:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QXsy3zmYz4QXj; Mon, 18 May 2020 08:55:50 +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 79E6F1ECEF; Mon, 18 May 2020 08:55:50 +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 04I8tocf044055; Mon, 18 May 2020 08:55:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8toIG044054; Mon, 18 May 2020 08:55:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180855.04I8toIG044054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:55:50 +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: r361162 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361162 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, 18 May 2020 08:55:50 -0000 Author: hselasky Date: Mon May 18 08:55:49 2020 New Revision: 361162 URL: https://svnweb.freebsd.org/changeset/base/361162 Log: MFC r360115: Allow the ERR_CAST() function in the LinuxKPI to take a const void pointer. No functional change. Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/err.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/err.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/err.h Mon May 18 08:52:40 2020 (r361161) +++ stable/12/sys/compat/linuxkpi/common/include/linux/err.h Mon May 18 08:55:49 2020 (r361162) @@ -31,6 +31,8 @@ #ifndef _LINUX_ERR_H_ #define _LINUX_ERR_H_ +#include + #include #define MAX_ERRNO 4095 @@ -62,9 +64,9 @@ IS_ERR_OR_NULL(const void *ptr) } static inline void * -ERR_CAST(void *ptr) +ERR_CAST(const void *ptr) { - return (void *)ptr; + return __DECONST(void *, ptr); } static inline int From owner-svn-src-all@freebsd.org Mon May 18 08:56: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 1FEC813B4B2; Mon, 18 May 2020 08:56:23 +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 49QXtb04l8z4QmB; Mon, 18 May 2020 08:56:23 +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 F20BE1ED62; Mon, 18 May 2020 08:56:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I8uMte044140; Mon, 18 May 2020 08:56:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8uMou044139; Mon, 18 May 2020 08:56:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180856.04I8uMou044139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:56: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: r361163 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361163 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, 18 May 2020 08:56:23 -0000 Author: hselasky Date: Mon May 18 08:56:22 2020 New Revision: 361163 URL: https://svnweb.freebsd.org/changeset/base/361163 Log: MFC r360115: Allow the ERR_CAST() function in the LinuxKPI to take a const void pointer. No functional change. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/err.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/err.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/err.h Mon May 18 08:55:49 2020 (r361162) +++ stable/11/sys/compat/linuxkpi/common/include/linux/err.h Mon May 18 08:56:22 2020 (r361163) @@ -31,6 +31,8 @@ #ifndef _LINUX_ERR_H_ #define _LINUX_ERR_H_ +#include + #include #define MAX_ERRNO 4095 @@ -62,9 +64,9 @@ IS_ERR_OR_NULL(const void *ptr) } static inline void * -ERR_CAST(void *ptr) +ERR_CAST(const void *ptr) { - return (void *)ptr; + return __DECONST(void *, ptr); } static inline int From owner-svn-src-all@freebsd.org Mon May 18 08:57: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 2B9BC13B702; Mon, 18 May 2020 08:57:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QXvk0MHVz4Qmx; Mon, 18 May 2020 08:57:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 060611EFAC; Mon, 18 May 2020 08:57:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I8vLwQ044245; Mon, 18 May 2020 08:57:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8vLFT044242; Mon, 18 May 2020 08:57:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180857.04I8vLFT044242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:57:21 +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: r361164 - in stable/12: sys/netgraph/bluetooth/hci sys/netgraph/bluetooth/include usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12: sys/netgraph/bluetooth/hci sys/netgraph/bluetooth/include usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361164 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, 18 May 2020 08:57:22 -0000 Author: hselasky Date: Mon May 18 08:57:21 2020 New Revision: 361164 URL: https://svnweb.freebsd.org/changeset/base/361164 Log: MFC r360116: Substitute le_read_supported_status with le_read_supported_states. Refer to bluetooth core v5.2 specifications Vol4. Part E. 7.8.27. PR: 245763 Submitted by: Marc Veldman Sponsored by: Mellanox Technologies Modified: stable/12/sys/netgraph/bluetooth/hci/ng_hci_cmds.c stable/12/sys/netgraph/bluetooth/include/ng_hci.h stable/12/usr.sbin/bluetooth/hccontrol/le.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netgraph/bluetooth/hci/ng_hci_cmds.c ============================================================================== --- stable/12/sys/netgraph/bluetooth/hci/ng_hci_cmds.c Mon May 18 08:56:22 2020 (r361163) +++ stable/12/sys/netgraph/bluetooth/hci/ng_hci_cmds.c Mon May 18 08:57:21 2020 (r361164) @@ -842,7 +842,7 @@ process_le_params(ng_hci_unit_p unit, u_int16_t ocf, case NG_HCI_OCF_LE_RAND: case NG_HCI_OCF_LE_LONG_TERM_KEY_REQUEST_REPLY: case NG_HCI_OCF_LE_LONG_TERM_KEY_REQUEST_NEGATIVE_REPLY: - case NG_HCI_OCF_LE_READ_SUPPORTED_STATUS: + case NG_HCI_OCF_LE_READ_SUPPORTED_STATES: case NG_HCI_OCF_LE_RECEIVER_TEST: case NG_HCI_OCF_LE_TRANSMITTER_TEST: case NG_HCI_OCF_LE_TEST_END: @@ -913,7 +913,7 @@ process_le_status(ng_hci_unit_p unit,ng_hci_command_st case NG_HCI_OCF_LE_RAND: case NG_HCI_OCF_LE_LONG_TERM_KEY_REQUEST_REPLY: case NG_HCI_OCF_LE_LONG_TERM_KEY_REQUEST_NEGATIVE_REPLY: - case NG_HCI_OCF_LE_READ_SUPPORTED_STATUS: + case NG_HCI_OCF_LE_READ_SUPPORTED_STATES: case NG_HCI_OCF_LE_RECEIVER_TEST: case NG_HCI_OCF_LE_TRANSMITTER_TEST: case NG_HCI_OCF_LE_TEST_END: Modified: stable/12/sys/netgraph/bluetooth/include/ng_hci.h ============================================================================== --- stable/12/sys/netgraph/bluetooth/include/ng_hci.h Mon May 18 08:56:22 2020 (r361163) +++ stable/12/sys/netgraph/bluetooth/include/ng_hci.h Mon May 18 08:57:21 2020 (r361164) @@ -1673,12 +1673,12 @@ typedef struct { }__attribute__ ((packed)) ng_hci_le_long_term_key_request_negative_reply_rp; -#define NG_HCI_OCF_LE_READ_SUPPORTED_STATUS 0x001c +#define NG_HCI_OCF_LE_READ_SUPPORTED_STATES 0x001c /*No command parameter*/ typedef struct { u_int8_t status; - u_int64_t le_status; -}__attribute__ ((packed)) ng_hci_le_read_supported_status_rp; + u_int64_t le_states; +}__attribute__ ((packed)) ng_hci_le_read_supported_states_rp; #define NG_HCI_OCF_LE_RECEIVER_TEST 0x001d typedef struct{ Modified: stable/12/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- stable/12/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 08:56:22 2020 (r361163) +++ stable/12/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 08:57:21 2020 (r361164) @@ -52,7 +52,7 @@ static int le_set_scan_param(int s, int argc, char *ar static int le_set_scan_enable(int s, int argc, char *argv[]); static int parse_param(int argc, char *argv[], char *buf, int *len); static int le_set_scan_response(int s, int argc, char *argv[]); -static int le_read_supported_status(int s, int argc, char *argv[]); +static int le_read_supported_states(int s, int argc, char *argv[]); static int le_read_local_supported_features(int s, int argc ,char *argv[]); static int set_le_event_mask(int s, uint64_t mask); static int set_event_mask(int s, uint64_t mask); @@ -259,20 +259,26 @@ le_read_local_supported_features(int s, int argc ,char } static int -le_read_supported_status(int s, int argc, char *argv[]) +le_read_supported_states(int s, int argc, char *argv[]) { - ng_hci_le_read_supported_status_rp rp; - int e; + ng_hci_le_read_supported_states_rp rp; int n = sizeof(rp); - e = hci_simple_request(s, NG_HCI_OPCODE( + if (hci_simple_request(s, NG_HCI_OPCODE( NG_HCI_OGF_LE, - NG_HCI_OCF_LE_READ_SUPPORTED_STATUS), - (void *)&rp, &n); + NG_HCI_OCF_LE_READ_SUPPORTED_STATES), + (void *)&rp, &n) == ERROR) + return (ERROR); - printf("LE_STATUS: %d %d %jx\n", e, rp.status, (uintmax_t)rp.le_status); + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } - return 0; + fprintf(stdout, "LE States: %jx\n", rp.le_states); + + return (OK); } static int @@ -347,11 +353,11 @@ struct hci_command le_commands[] = { &le_read_local_supported_features, }, { - "le_read_supported_status", - "le_read_supported_status\n" + "le_read_supported_states", + "le_read_supported_states\n" "read supported status" , - &le_read_supported_status, + &le_read_supported_states, }, { "le_set_scan_response", From owner-svn-src-all@freebsd.org Mon May 18 08:57: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 17D1313B2FF; Mon, 18 May 2020 08:57:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QXwM6YCSz4Qxk; Mon, 18 May 2020 08:57: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 DC12F1F10C; Mon, 18 May 2020 08:57: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 04I8vt0t044341; Mon, 18 May 2020 08:57:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8vtWA044339; Mon, 18 May 2020 08:57:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180857.04I8vtWA044339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:57:55 +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: r361165 - in stable/11: sys/netgraph/bluetooth/hci sys/netgraph/bluetooth/include usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11: sys/netgraph/bluetooth/hci sys/netgraph/bluetooth/include usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361165 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, 18 May 2020 08:57:56 -0000 Author: hselasky Date: Mon May 18 08:57:55 2020 New Revision: 361165 URL: https://svnweb.freebsd.org/changeset/base/361165 Log: MFC r360116: Substitute le_read_supported_status with le_read_supported_states. Refer to bluetooth core v5.2 specifications Vol4. Part E. 7.8.27. PR: 245763 Submitted by: Marc Veldman Sponsored by: Mellanox Technologies Modified: stable/11/sys/netgraph/bluetooth/hci/ng_hci_cmds.c stable/11/sys/netgraph/bluetooth/include/ng_hci.h stable/11/usr.sbin/bluetooth/hccontrol/le.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netgraph/bluetooth/hci/ng_hci_cmds.c ============================================================================== --- stable/11/sys/netgraph/bluetooth/hci/ng_hci_cmds.c Mon May 18 08:57:21 2020 (r361164) +++ stable/11/sys/netgraph/bluetooth/hci/ng_hci_cmds.c Mon May 18 08:57:55 2020 (r361165) @@ -840,7 +840,7 @@ process_le_params(ng_hci_unit_p unit, u_int16_t ocf, case NG_HCI_OCF_LE_RAND: case NG_HCI_OCF_LE_LONG_TERM_KEY_REQUEST_REPLY: case NG_HCI_OCF_LE_LONG_TERM_KEY_REQUEST_NEGATIVE_REPLY: - case NG_HCI_OCF_LE_READ_SUPPORTED_STATUS: + case NG_HCI_OCF_LE_READ_SUPPORTED_STATES: case NG_HCI_OCF_LE_RECEIVER_TEST: case NG_HCI_OCF_LE_TRANSMITTER_TEST: case NG_HCI_OCF_LE_TEST_END: @@ -911,7 +911,7 @@ process_le_status(ng_hci_unit_p unit,ng_hci_command_st case NG_HCI_OCF_LE_RAND: case NG_HCI_OCF_LE_LONG_TERM_KEY_REQUEST_REPLY: case NG_HCI_OCF_LE_LONG_TERM_KEY_REQUEST_NEGATIVE_REPLY: - case NG_HCI_OCF_LE_READ_SUPPORTED_STATUS: + case NG_HCI_OCF_LE_READ_SUPPORTED_STATES: case NG_HCI_OCF_LE_RECEIVER_TEST: case NG_HCI_OCF_LE_TRANSMITTER_TEST: case NG_HCI_OCF_LE_TEST_END: Modified: stable/11/sys/netgraph/bluetooth/include/ng_hci.h ============================================================================== --- stable/11/sys/netgraph/bluetooth/include/ng_hci.h Mon May 18 08:57:21 2020 (r361164) +++ stable/11/sys/netgraph/bluetooth/include/ng_hci.h Mon May 18 08:57:55 2020 (r361165) @@ -1667,12 +1667,12 @@ typedef struct { }__attribute__ ((packed)) ng_hci_le_long_term_key_request_negative_reply_rp; -#define NG_HCI_OCF_LE_READ_SUPPORTED_STATUS 0x001c +#define NG_HCI_OCF_LE_READ_SUPPORTED_STATES 0x001c /*No command parameter*/ typedef struct { u_int8_t status; - u_int64_t le_status; -}__attribute__ ((packed)) ng_hci_le_read_supported_status_rp; + u_int64_t le_states; +}__attribute__ ((packed)) ng_hci_le_read_supported_states_rp; #define NG_HCI_OCF_LE_RECEIVER_TEST 0x001d typedef struct{ Modified: stable/11/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 08:57:21 2020 (r361164) +++ stable/11/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 08:57:55 2020 (r361165) @@ -52,7 +52,7 @@ static int le_set_scan_param(int s, int argc, char *ar static int le_set_scan_enable(int s, int argc, char *argv[]); static int parse_param(int argc, char *argv[], char *buf, int *len); static int le_set_scan_response(int s, int argc, char *argv[]); -static int le_read_supported_status(int s, int argc, char *argv[]); +static int le_read_supported_states(int s, int argc, char *argv[]); static int le_read_local_supported_features(int s, int argc ,char *argv[]); static int set_le_event_mask(int s, uint64_t mask); static int set_event_mask(int s, uint64_t mask); @@ -259,20 +259,26 @@ le_read_local_supported_features(int s, int argc ,char } static int -le_read_supported_status(int s, int argc, char *argv[]) +le_read_supported_states(int s, int argc, char *argv[]) { - ng_hci_le_read_supported_status_rp rp; - int e; + ng_hci_le_read_supported_states_rp rp; int n = sizeof(rp); - e = hci_simple_request(s, NG_HCI_OPCODE( + if (hci_simple_request(s, NG_HCI_OPCODE( NG_HCI_OGF_LE, - NG_HCI_OCF_LE_READ_SUPPORTED_STATUS), - (void *)&rp, &n); + NG_HCI_OCF_LE_READ_SUPPORTED_STATES), + (void *)&rp, &n) == ERROR) + return (ERROR); - printf("LE_STATUS: %d %d %jx\n", e, rp.status, (uintmax_t)rp.le_status); + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } - return 0; + fprintf(stdout, "LE States: %jx\n", rp.le_states); + + return (OK); } static int @@ -347,11 +353,11 @@ struct hci_command le_commands[] = { &le_read_local_supported_features, }, { - "le_read_supported_status", - "le_read_supported_status\n" + "le_read_supported_states", + "le_read_supported_states\n" "read supported status" , - &le_read_supported_status, + &le_read_supported_states, }, { "le_set_scan_response", From owner-svn-src-all@freebsd.org Mon May 18 08:58: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 A930213B55C; Mon, 18 May 2020 08:58:41 +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 49QXxF4MJrz4R1s; Mon, 18 May 2020 08:58:41 +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 909241EB54; Mon, 18 May 2020 08:58:41 +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 04I8wfkc044445; Mon, 18 May 2020 08:58:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8wf4e044444; Mon, 18 May 2020 08:58:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180858.04I8wf4e044444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:58:41 +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: r361166 - stable/12/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361166 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, 18 May 2020 08:58:41 -0000 Author: hselasky Date: Mon May 18 08:58:41 2020 New Revision: 361166 URL: https://svnweb.freebsd.org/changeset/base/361166 Log: MFC r360172: Update string tables in hccontrol(8). Submitted by: Marc Veldman PR: 245796 Sponsored by: Mellanox Technologies Modified: stable/12/usr.sbin/bluetooth/hccontrol/util.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- stable/12/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:57:55 2020 (r361165) +++ stable/12/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:58:41 2020 (r361166) @@ -160,7 +160,10 @@ hci_ver2str(int ver) /* 0x05 */ "Bluetooth HCI Specification 3.0", /* 0x06 */ "Bluetooth HCI Specification 4.0", /* 0x07 */ "Bluetooth HCI Specification 4.1", - /* 0x08 */ "Bluetooth HCI Specification 4.2" + /* 0x08 */ "Bluetooth HCI Specification 4.2", + /* 0x09 */ "Bluetooth HCI Specification 5.0", + /* 0x0a */ "Bluetooth HCI Specification 5.1", + /* 0x0b */ "Bluetooth HCI Specification 5.2" }; return (ver >= SIZE(t)? "?" : t[ver]); @@ -175,10 +178,13 @@ hci_lmpver2str(int ver) /* 0x02 */ "Bluetooth LMP 1.2", /* 0x03 */ "Bluetooth LMP 2.0", /* 0x04 */ "Bluetooth LMP 2.1", - /* 0x04 */ "Bluetooth LMP 3.0", - /* 0x04 */ "Bluetooth LMP 4.0", - /* 0x04 */ "Bluetooth LMP 4.1", - /* 0x04 */ "Bluetooth LMP 4.2" + /* 0x05 */ "Bluetooth LMP 3.0", + /* 0x06 */ "Bluetooth LMP 4.0", + /* 0x07 */ "Bluetooth LMP 4.1", + /* 0x08 */ "Bluetooth LMP 4.2", + /* 0x09 */ "Bluetooth LMP 5.0", + /* 0x0a */ "Bluetooth LMP 5.1", + /* 0x0b */ "Bluetooth LMP 5.2" }; return (ver >= SIZE(t)? "?" : t[ver]); @@ -198,7 +204,7 @@ hci_manufacturer2str(int m) /* 0007 */ "Lucent", /* 0008 */ "Motorola", /* 0009 */ "Infineon Technologies AG", - /* 0010 */ "Cambridge Silicon Radio", + /* 0010 */ "Qualcomm Technologies International, Ltd. (QTIL)", /* 0011 */ "Silicon Wave", /* 0012 */ "Digianswer A/S", /* 0013 */ "Texas Instruments Inc.", @@ -213,7 +219,7 @@ hci_manufacturer2str(int m) /* 0022 */ "KC Technology Inc.", /* 0023 */ "Newlogic", /* 0024 */ "Transilica, Inc.", - /* 0025 */ "Rohde & Schwartz GmbH & Co. KG", + /* 0025 */ "Rohde & Schwarz GmbH & Co. KG", /* 0026 */ "TTPCom Limited", /* 0027 */ "Signia Technologies, Inc.", /* 0028 */ "Conexant Systems Inc.", @@ -225,7 +231,7 @@ hci_manufacturer2str(int m) /* 0034 */ "NEC Corporation", /* 0035 */ "WavePlus Technology Co., Ltd.", /* 0036 */ "Alcatel", - /* 0037 */ "Philips Semiconductors", + /* 0037 */ "NXP Semiconductors (formerly Philips Semiconductors)", /* 0038 */ "C Technologies", /* 0039 */ "Open Interface", /* 0040 */ "R F Micro Devices", @@ -237,22 +243,2187 @@ hci_manufacturer2str(int m) /* 0046 */ "Norwood Systems", /* 0047 */ "MewTel Technology Inc.", /* 0048 */ "ST Microelectronics", - /* 0049 */ "Synopsys", + /* 0049 */ "Synopsys, Inc.", /* 0050 */ "Red-M (Communications) Ltd", /* 0051 */ "Commil Ltd", /* 0052 */ "Computer Access Technology Corporation (CATC)", /* 0053 */ "Eclipse (HQ Espana) S.L.", - /* 0054 */ "Renesas Technology Corp.", + /* 0054 */ "Renesas Electronics Corporation", /* 0055 */ "Mobilian Corporation", - /* 0056 */ "Terax", + /* 0056 */ "Syntronix Corporation", /* 0057 */ "Integrated System Solution Corp.", - /* 0058 */ "Matsushita Electric Industrial Co., Ltd.", + /* 0058 */ "Panasonic Corporation (formerly Matsushita Electric Industrial Co., Ltd.)", /* 0059 */ "Gennum Corporation", - /* 0060 */ "Research In Motion", + /* 0060 */ "BlackBerry Limited (formerly Research In Motion)", /* 0061 */ "IPextreme, Inc.", /* 0062 */ "Systems and Chips, Inc", /* 0063 */ "Bluetooth SIG, Inc", - /* 0064 */ "Seiko Epson Corporation" + /* 0064 */ "Seiko Epson Corporation", + /* 0065 */ "Integrated Silicon Solution Taiwan, Inc.", + /* 0066 */ "CONWISE Technology Corporation Ltd", + /* 0067 */ "PARROT AUTOMOTIVE SAS", + /* 0068 */ "Socket Mobile", + /* 0069 */ "Atheros Communications, Inc.", + /* 0070 */ "MediaTek, Inc.", + /* 0071 */ "Bluegiga", + /* 0072 */ "Marvell Technology Group Ltd.", + /* 0073 */ "3DSP Corporation", + /* 0074 */ "Accel Semiconductor Ltd.", + /* 0075 */ "Continental Automotive Systems", + /* 0076 */ "Apple, Inc.", + /* 0077 */ "Staccato Communications, Inc.", + /* 0078 */ "Avago Technologies", + /* 0079 */ "APT Ltd.", + /* 0080 */ "SiRF Technology, Inc.", + /* 0081 */ "Tzero Technologies, Inc.", + /* 0082 */ "J&M Corporation", + /* 0083 */ "Free2move AB", + /* 0084 */ "3DiJoy Corporation", + /* 0085 */ "Plantronics, Inc.", + /* 0086 */ "Sony Ericsson Mobile Communications", + /* 0087 */ "Harman International Industries, Inc.", + /* 0088 */ "Vizio, Inc.", + /* 0089 */ "Nordic Semiconductor ASA", + /* 0090 */ "EM Microelectronic-Marin SA", + /* 0091 */ "Ralink Technology Corporation", + /* 0092 */ "Belkin International, Inc.", + /* 0093 */ "Realtek Semiconductor Corporation", + /* 0094 */ "Stonestreet One, LLC", + /* 0095 */ "Wicentric, Inc.", + /* 0096 */ "RivieraWaves S.A.S", + /* 0097 */ "RDA Microelectronics", + /* 0098 */ "Gibson Guitars", + /* 0099 */ "MiCommand Inc.", + /* 0100 */ "Band XI International, LLC", + /* 0101 */ "Hewlett-Packard Company", + /* 0102 */ "9Solutions Oy", + /* 0103 */ "GN Netcom A/S", + /* 0104 */ "General Motors", + /* 0105 */ "A&D Engineering, Inc.", + /* 0106 */ "MindTree Ltd.", + /* 0107 */ "Polar Electro OY", + /* 0108 */ "Beautiful Enterprise Co., Ltd.", + /* 0109 */ "BriarTek, Inc", + /* 0110 */ "Summit Data Communications, Inc.", + /* 0111 */ "Sound ID", + /* 0112 */ "Monster, LLC", + /* 0113 */ "connectBlue AB", + /* 0114 */ "ShangHai Super Smart Electronics Co. Ltd.", + /* 0115 */ "Group Sense Ltd.", + /* 0116 */ "Zomm, LLC", + /* 0117 */ "Samsung Electronics Co. Ltd.", + /* 0118 */ "Creative Technology Ltd.", + /* 0119 */ "Laird Technologies", + /* 0120 */ "Nike, Inc.", + /* 0121 */ "lesswire AG", + /* 0122 */ "MStar Semiconductor, Inc.", + /* 0123 */ "Hanlynn Technologies", + /* 0124 */ "A & R Cambridge", + /* 0125 */ "Seers Technology Co., Ltd.", + /* 0126 */ "Sports Tracking Technologies Ltd.", + /* 0127 */ "Autonet Mobile", + /* 0128 */ "DeLorme Publishing Company, Inc.", + /* 0129 */ "WuXi Vimicro", + /* 0130 */ "Sennheiser Communications A/S", + /* 0131 */ "TimeKeeping Systems, Inc.", + /* 0132 */ "Ludus Helsinki Ltd.", + /* 0133 */ "BlueRadios, Inc.", + /* 0134 */ "Equinux AG", + /* 0135 */ "Garmin International, Inc.", + /* 0136 */ "Ecotest", + /* 0137 */ "GN ReSound A/S", + /* 0138 */ "Jawbone", + /* 0139 */ "Topcon Positioning Systems, LLC", + /* 0140 */ "Gimbal Inc. (formerly Qualcomm Labs, Inc. and Qualcomm Retail Solutions, Inc.)", + /* 0141 */ "Zscan Software", + /* 0142 */ "Quintic Corp", + /* 0143 */ "Telit Wireless Solutions GmbH (formerly Stollmann E+V GmbH)", + /* 0144 */ "Funai Electric Co., Ltd.", + /* 0145 */ "Advanced PANMOBIL systems GmbH & Co. KG", + /* 0146 */ "ThinkOptics, Inc.", + /* 0147 */ "Universal Electronics, Inc.", + /* 0148 */ "Airoha Technology Corp.", + /* 0149 */ "NEC Lighting, Ltd.", + /* 0150 */ "ODM Technology, Inc.", + /* 0151 */ "ConnecteDevice Ltd.", + /* 0152 */ "zero1.tv GmbH", + /* 0153 */ "i.Tech Dynamic Global Distribution Ltd.", + /* 0154 */ "Alpwise", + /* 0155 */ "Jiangsu Toppower Automotive Electronics Co., Ltd.", + /* 0156 */ "Colorfy, Inc.", + /* 0157 */ "Geoforce Inc.", + /* 0158 */ "Bose Corporation", + /* 0159 */ "Suunto Oy", + /* 0160 */ "Kensington Computer Products Group", + /* 0161 */ "SR-Medizinelektronik", + /* 0162 */ "Vertu Corporation Limited", + /* 0163 */ "Meta Watch Ltd.", + /* 0164 */ "LINAK A/S", + /* 0165 */ "OTL Dynamics LLC", + /* 0166 */ "Panda Ocean Inc.", + /* 0167 */ "Visteon Corporation", + /* 0168 */ "ARP Devices Limited", + /* 0169 */ "MARELLI EUROPE S.P.A. (formerly Magneti Marelli S.p.A.)", + /* 0170 */ "CAEN RFID srl", + /* 0171 */ "Ingenieur-Systemgruppe Zahn GmbH", + /* 0172 */ "Green Throttle Games", + /* 0173 */ "Peter Systemtechnik GmbH", + /* 0174 */ "Omegawave Oy", + /* 0175 */ "Cinetix", + /* 0176 */ "Passif Semiconductor Corp", + /* 0177 */ "Saris Cycling Group, Inc", + /* 0178 */ "Bekey A/S", + /* 0179 */ "Clarinox Technologies Pty. Ltd.", + /* 0180 */ "BDE Technology Co., Ltd.", + /* 0181 */ "Swirl Networks", + /* 0182 */ "Meso international", + /* 0183 */ "TreLab Ltd", + /* 0184 */ "Qualcomm Innovation Center, Inc. (QuIC)", + /* 0185 */ "Johnson Controls, Inc.", + /* 0186 */ "Starkey Laboratories Inc.", + /* 0187 */ "S-Power Electronics Limited", + /* 0188 */ "Ace Sensor Inc", + /* 0189 */ "Aplix Corporation", + /* 0190 */ "AAMP of America", + /* 0191 */ "Stalmart Technology Limited", + /* 0192 */ "AMICCOM Electronics Corporation", + /* 0193 */ "Shenzhen Excelsecu Data Technology Co.,Ltd", + /* 0194 */ "Geneq Inc.", + /* 0195 */ "adidas AG", + /* 0196 */ "LG Electronics", + /* 0197 */ "Onset Computer Corporation", + /* 0198 */ "Selfly BV", + /* 0199 */ "Quuppa Oy.", + /* 0200 */ "GeLo Inc", + /* 0201 */ "Evluma", + /* 0202 */ "MC10", + /* 0203 */ "Binauric SE", + /* 0204 */ "Beats Electronics", + /* 0205 */ "Microchip Technology Inc.", + /* 0206 */ "Elgato Systems GmbH", + /* 0207 */ "ARCHOS SA", + /* 0208 */ "Dexcom, Inc.", + /* 0209 */ "Polar Electro Europe B.V.", + /* 0210 */ "Dialog Semiconductor B.V.", + /* 0211 */ "Taixingbang Technology (HK) Co,. LTD.", + /* 0212 */ "Kawantech", + /* 0213 */ "Austco Communication Systems", + /* 0214 */ "Timex Group USA, Inc.", + /* 0215 */ "Qualcomm Technologies, Inc.", + /* 0216 */ "Qualcomm Connected Experiences, Inc.", + /* 0217 */ "Voyetra Turtle Beach", + /* 0218 */ "txtr GmbH", + /* 0219 */ "Biosentronics", + /* 0220 */ "Procter & Gamble", + /* 0221 */ "Hosiden Corporation", + /* 0222 */ "Muzik LLC", + /* 0223 */ "Misfit Wearables Corp", + /* 0224 */ "Google", + /* 0225 */ "Danlers Ltd", + /* 0226 */ "Semilink Inc", + /* 0227 */ "inMusic Brands, Inc", + /* 0228 */ "L.S. Research Inc.", + /* 0229 */ "Eden Software Consultants Ltd.", + /* 0230 */ "Freshtemp", + /* 0231 */ "KS Technologies", + /* 0232 */ "ACTS Technologies", + /* 0233 */ "Vtrack Systems", + /* 0234 */ "Nielsen-Kellerman Company", + /* 0235 */ "Server Technology Inc.", + /* 0236 */ "BioResearch Associates", + /* 0237 */ "Jolly Logic, LLC", + /* 0238 */ "Above Average Outcomes, Inc.", + /* 0239 */ "Bitsplitters GmbH", + /* 0240 */ "PayPal, Inc.", + /* 0241 */ "Witron Technology Limited", + /* 0242 */ "Morse Project Inc.", + /* 0243 */ "Kent Displays Inc.", + /* 0244 */ "Nautilus Inc.", + /* 0245 */ "Smartifier Oy", + /* 0246 */ "Elcometer Limited", + /* 0247 */ "VSN Technologies, Inc.", + /* 0248 */ "AceUni Corp., Ltd.", + /* 0249 */ "StickNFind", + /* 0250 */ "Crystal Code AB", + /* 0251 */ "KOUKAAM a.s.", + /* 0252 */ "Delphi Corporation", + /* 0253 */ "ValenceTech Limited", + /* 0254 */ "Stanley Black and Decker", + /* 0255 */ "Typo Products, LLC", + /* 0256 */ "TomTom International BV", + /* 0257 */ "Fugoo, Inc.", + /* 0258 */ "Keiser Corporation", + /* 0259 */ "Bang & Olufsen A/S", + /* 0260 */ "PLUS Location Systems Pty Ltd", + /* 0261 */ "Ubiquitous Computing Technology Corporation", + /* 0262 */ "Innovative Yachtter Solutions", + /* 0263 */ "William Demant Holding A/S", + /* 0264 */ "Chicony Electronics Co., Ltd.", + /* 0265 */ "Atus BV", + /* 0266 */ "Codegate Ltd", + /* 0267 */ "ERi, Inc", + /* 0268 */ "Transducers Direct, LLC", + /* 0269 */ "DENSO TEN LIMITED (formerly Fujitsu Ten LImited)", + /* 0270 */ "Audi AG", + /* 0271 */ "HiSilicon Technologies CO., LIMITED", + /* 0272 */ "Nippon Seiki Co., Ltd.", + /* 0273 */ "Steelseries ApS", + /* 0274 */ "Visybl Inc.", + /* 0275 */ "Openbrain Technologies, Co., Ltd.", + /* 0276 */ "Xensr", + /* 0277 */ "e.solutions", + /* 0278 */ "10AK Technologies", + /* 0279 */ "Wimoto Technologies Inc", + /* 0280 */ "Radius Networks, Inc.", + /* 0281 */ "Wize Technology Co., Ltd.", + /* 0282 */ "Qualcomm Labs, Inc.", + /* 0283 */ "Hewlett Packard Enterprise", + /* 0284 */ "Baidu", + /* 0285 */ "Arendi AG", + /* 0286 */ "Skoda Auto a.s.", + /* 0287 */ "Volkswagen AG", + /* 0288 */ "Porsche AG", + /* 0289 */ "Sino Wealth Electronic Ltd.", + /* 0290 */ "AirTurn, Inc.", + /* 0291 */ "Kinsa, Inc", + /* 0292 */ "HID Global", + /* 0293 */ "SEAT es", + /* 0294 */ "Promethean Ltd.", + /* 0295 */ "Salutica Allied Solutions", + /* 0296 */ "GPSI Group Pty Ltd", + /* 0297 */ "Nimble Devices Oy", + /* 0298 */ "Changzhou Yongse Infotech Co., Ltd.", + /* 0299 */ "SportIQ", + /* 0300 */ "TEMEC Instruments B.V.", + /* 0301 */ "Sony Corporation", + /* 0302 */ "ASSA ABLOY", + /* 0303 */ "Clarion Co. Inc.", + /* 0304 */ "Warehouse Innovations", + /* 0305 */ "Cypress Semiconductor", + /* 0306 */ "MADS Inc", + /* 0307 */ "Blue Maestro Limited", + /* 0308 */ "Resolution Products, Ltd.", + /* 0309 */ "Aireware LLC", + /* 0310 */ "Silvair, Inc.", + /* 0311 */ "Prestigio Plaza Ltd.", + /* 0312 */ "NTEO Inc.", + /* 0313 */ "Focus Systems Corporation", + /* 0314 */ "Tencent Holdings Ltd.", + /* 0315 */ "Allegion", + /* 0316 */ "Murata Manufacturing Co., Ltd.", + /* 0317 */ "WirelessWERX", + /* 0318 */ "Nod, Inc.", + /* 0319 */ "B&B Manufacturing Company", + /* 0320 */ "Alpine Electronics (China) Co., Ltd", + /* 0321 */ "FedEx Services", + /* 0322 */ "Grape Systems Inc.", + /* 0323 */ "Bkon Connect", + /* 0324 */ "Lintech GmbH", + /* 0325 */ "Novatel Wireless", + /* 0326 */ "Ciright", + /* 0327 */ "Mighty Cast, Inc.", + /* 0328 */ "Ambimat Electronics", + /* 0329 */ "Perytons Ltd.", + /* 0330 */ "Tivoli Audio, LLC", + /* 0331 */ "Master Lock", + /* 0332 */ "Mesh-Net Ltd", + /* 0333 */ "HUIZHOU DESAY SV AUTOMOTIVE CO., LTD.", + /* 0334 */ "Tangerine, Inc.", + /* 0335 */ "B&W Group Ltd.", + /* 0336 */ "Pioneer Corporation", + /* 0337 */ "OnBeep", + /* 0338 */ "Vernier Software & Technology", + /* 0339 */ "ROL Ergo", + /* 0340 */ "Pebble Technology", + /* 0341 */ "NETATMO", + /* 0342 */ "Accumulate AB", + /* 0343 */ "Anhui Huami Information Technology Co., Ltd.", + /* 0344 */ "Inmite s.r.o.", + /* 0345 */ "ChefSteps, Inc.", + /* 0346 */ "micas AG", + /* 0347 */ "Biomedical Research Ltd.", + /* 0348 */ "Pitius Tec S.L.", + /* 0349 */ "Estimote, Inc.", + /* 0350 */ "Unikey Technologies, Inc.", + /* 0351 */ "Timer Cap Co.", + /* 0352 */ "AwoX", + /* 0353 */ "yikes", + /* 0354 */ "MADSGlobalNZ Ltd.", + /* 0355 */ "PCH International", + /* 0356 */ "Qingdao Yeelink Information Technology Co., Ltd.", + /* 0357 */ "Milwaukee Tool (Formally Milwaukee Electric Tools)", + /* 0358 */ "MISHIK Pte Ltd", + /* 0359 */ "Ascensia Diabetes Care US Inc.", + /* 0360 */ "Spicebox LLC", + /* 0361 */ "emberlight", + /* 0362 */ "Cooper-Atkins Corporation", + /* 0363 */ "Qblinks", + /* 0364 */ "MYSPHERA", + /* 0365 */ "LifeScan Inc", + /* 0366 */ "Volantic AB", + /* 0367 */ "Podo Labs, Inc", + /* 0368 */ "Roche Diabetes Care AG", + /* 0369 */ "Amazon.com Services, LLC (formerly Amazon Fulfillment Service)", + /* 0370 */ "Connovate Technology Private Limited", + /* 0371 */ "Kocomojo, LLC", + /* 0372 */ "Everykey Inc.", + /* 0373 */ "Dynamic Controls", + /* 0374 */ "SentriLock", + /* 0375 */ "I-SYST inc.", + /* 0376 */ "CASIO COMPUTER CO., LTD.", + /* 0377 */ "LAPIS Semiconductor Co., Ltd.", + /* 0378 */ "Telemonitor, Inc.", + /* 0379 */ "taskit GmbH", + /* 0380 */ "Daimler AG", + /* 0381 */ "BatAndCat", + /* 0382 */ "BluDotz Ltd", + /* 0383 */ "XTel Wireless ApS", + /* 0384 */ "Gigaset Communications GmbH", + /* 0385 */ "Gecko Health Innovations, Inc.", + /* 0386 */ "HOP Ubiquitous", + /* 0387 */ "Walt Disney", + /* 0388 */ "Nectar", + /* 0389 */ "bel'apps LLC", + /* 0390 */ "CORE Lighting Ltd", + /* 0391 */ "Seraphim Sense Ltd", + /* 0392 */ "Unico RBC", + /* 0393 */ "Physical Enterprises Inc.", + /* 0394 */ "Able Trend Technology Limited", + /* 0395 */ "Konica Minolta, Inc.", + /* 0396 */ "Wilo SE", + /* 0397 */ "Extron Design Services", + /* 0398 */ "Fitbit, Inc.", + /* 0399 */ "Fireflies Systems", + /* 0400 */ "Intelletto Technologies Inc.", + /* 0401 */ "FDK CORPORATION", + /* 0402 */ "Cloudleaf, Inc", + /* 0403 */ "Maveric Automation LLC", + /* 0404 */ "Acoustic Stream Corporation", + /* 0405 */ "Zuli", + /* 0406 */ "Paxton Access Ltd", + /* 0407 */ "WiSilica Inc.", + /* 0408 */ "VENGIT Korlatolt Felelossegu Tarsasag", + /* 0409 */ "SALTO SYSTEMS S.L.", + /* 0410 */ "TRON Forum (formerly T-Engine Forum)", + /* 0411 */ "CUBETECH s.r.o.", + /* 0412 */ "Cokiya Incorporated", + /* 0413 */ "CVS Health", + /* 0414 */ "Ceruus", + /* 0415 */ "Strainstall Ltd", + /* 0416 */ "Channel Enterprises (HK) Ltd.", + /* 0417 */ "FIAMM", + /* 0418 */ "GIGALANE.CO.,LTD", + /* 0419 */ "EROAD", + /* 0420 */ "Mine Safety Appliances", + /* 0421 */ "Icon Health and Fitness", + /* 0422 */ "Wille Engineering (formely as Asandoo GmbH)", + /* 0423 */ "ENERGOUS CORPORATION", + /* 0424 */ "Taobao", + /* 0425 */ "Canon Inc.", + /* 0426 */ "Geophysical Technology Inc.", + /* 0427 */ "Facebook, Inc.", + /* 0428 */ "Trividia Health, Inc.", + /* 0429 */ "FlightSafety International", + /* 0430 */ "Earlens Corporation", + /* 0431 */ "Sunrise Micro Devices, Inc.", + /* 0432 */ "Star Micronics Co., Ltd.", + /* 0433 */ "Netizens Sp. z o.o.", + /* 0434 */ "Nymi Inc.", + /* 0435 */ "Nytec, Inc.", + /* 0436 */ "Trineo Sp. z o.o.", + /* 0437 */ "Nest Labs Inc.", + /* 0438 */ "LM Technologies Ltd", + /* 0439 */ "General Electric Company", + /* 0440 */ "i+D3 S.L.", + /* 0441 */ "HANA Micron", + /* 0442 */ "Stages Cycling LLC", + /* 0443 */ "Cochlear Bone Anchored Solutions AB", + /* 0444 */ "SenionLab AB", + /* 0445 */ "Syszone Co., Ltd", + /* 0446 */ "Pulsate Mobile Ltd.", + /* 0447 */ "Hong Kong HunterSun Electronic Limited", + /* 0448 */ "pironex GmbH", + /* 0449 */ "BRADATECH Corp.", + /* 0450 */ "Transenergooil AG", + /* 0451 */ "Bunch", + /* 0452 */ "DME Microelectronics", + /* 0453 */ "Bitcraze AB", + /* 0454 */ "HASWARE Inc.", + /* 0455 */ "Abiogenix Inc.", + /* 0456 */ "Poly-Control ApS", + /* 0457 */ "Avi-on", + /* 0458 */ "Laerdal Medical AS", + /* 0459 */ "Fetch My Pet", + /* 0460 */ "Sam Labs Ltd.", + /* 0461 */ "Chengdu Synwing Technology Ltd", + /* 0462 */ "HOUWA SYSTEM DESIGN, k.k.", + /* 0463 */ "BSH", + /* 0464 */ "Primus Inter Pares Ltd", + /* 0465 */ "August Home, Inc", + /* 0466 */ "Gill Electronics", + /* 0467 */ "Sky Wave Design", + /* 0468 */ "Newlab S.r.l.", + /* 0469 */ "ELAD srl", + /* 0470 */ "G-wearables inc.", + /* 0471 */ "Squadrone Systems Inc.", + /* 0472 */ "Code Corporation", + /* 0473 */ "Savant Systems LLC", + /* 0474 */ "Logitech International SA", + /* 0475 */ "Innblue Consulting", + /* 0476 */ "iParking Ltd.", + /* 0477 */ "Koninklijke Philips Electronics N.V.", + /* 0478 */ "Minelab Electronics Pty Limited", + /* 0479 */ "Bison Group Ltd.", + /* 0480 */ "Widex A/S", + /* 0481 */ "Jolla Ltd", + /* 0482 */ "Lectronix, Inc.", + /* 0483 */ "Caterpillar Inc", + /* 0484 */ "Freedom Innovations", + /* 0485 */ "Dynamic Devices Ltd", + /* 0486 */ "Technology Solutions (UK) Ltd", + /* 0487 */ "IPS Group Inc.", + /* 0488 */ "STIR", + /* 0489 */ "Sano, Inc.", + /* 0490 */ "Advanced Application Design, Inc.", + /* 0491 */ "AutoMap LLC", + /* 0492 */ "Spreadtrum Communications Shanghai Ltd", + /* 0493 */ "CuteCircuit LTD", + /* 0494 */ "Valeo Service", + /* 0495 */ "Fullpower Technologies, Inc.", + /* 0496 */ "KloudNation", + /* 0497 */ "Zebra Technologies Corporation", + /* 0498 */ "Itron, Inc.", + /* 0499 */ "The University of Tokyo", + /* 0500 */ "UTC Fire and Security", + /* 0501 */ "Cool Webthings Limited", + /* 0502 */ "DJO Global", + /* 0503 */ "Gelliner Limited", + /* 0504 */ "Anyka (Guangzhou) Microelectronics Technology Co, LTD", + /* 0505 */ "Medtronic Inc.", + /* 0506 */ "Gozio Inc.", + /* 0507 */ "Form Lifting, LLC", + /* 0508 */ "Wahoo Fitness, LLC", + /* 0509 */ "Kontakt Micro-Location Sp. z o.o.", + /* 0510 */ "Radio Systems Corporation", + /* 0511 */ "Freescale Semiconductor, Inc.", + /* 0512 */ "Verifone Systems Pte Ltd. Taiwan Branch", + /* 0513 */ "AR Timing", + /* 0514 */ "Rigado LLC", + /* 0515 */ "Kemppi Oy", + /* 0516 */ "Tapcentive Inc.", + /* 0517 */ "Smartbotics Inc.", + /* 0518 */ "Otter Products, LLC", + /* 0519 */ "STEMP Inc.", + /* 0520 */ "LumiGeek LLC", + /* 0521 */ "InvisionHeart Inc.", + /* 0522 */ "Macnica Inc.", + /* 0523 */ "Jaguar Land Rover Limited", + /* 0524 */ "CoroWare Technologies, Inc", + /* 0525 */ "Simplo Technology Co., LTD", + /* 0526 */ "Omron Healthcare Co., LTD", + /* 0527 */ "Comodule GMBH", + /* 0528 */ "ikeGPS", + /* 0529 */ "Telink Semiconductor Co. Ltd", + /* 0530 */ "Interplan Co., Ltd", + /* 0531 */ "Wyler AG", + /* 0532 */ "IK Multimedia Production srl", + /* 0533 */ "Lukoton Experience Oy", + /* 0534 */ "MTI Ltd", + /* 0535 */ "Tech4home, Lda", + /* 0536 */ "Hiotech AB", + /* 0537 */ "DOTT Limited", + /* 0538 */ "Blue Speck Labs, LLC", + /* 0539 */ "Cisco Systems, Inc", + /* 0540 */ "Mobicomm Inc", + /* 0541 */ "Edamic", + /* 0542 */ "Goodnet, Ltd", + /* 0543 */ "Luster Leaf Products Inc", + /* 0544 */ "Manus Machina BV", + /* 0545 */ "Mobiquity Networks Inc", + /* 0546 */ "Praxis Dynamics", + /* 0547 */ "Philip Morris Products S.A.", + /* 0548 */ "Comarch SA", + /* 0549 */ "Nestlé Nespresso S.A.", + /* 0550 */ "Merlinia A/S", + /* 0551 */ "LifeBEAM Technologies", + /* 0552 */ "Twocanoes Labs, LLC", + /* 0553 */ "Muoverti Limited", + /* 0554 */ "Stamer Musikanlagen GMBH", + /* 0555 */ "Tesla Motors", + /* 0556 */ "Pharynks Corporation", + /* 0557 */ "Lupine", + /* 0558 */ "Siemens AG", + /* 0559 */ "Huami (Shanghai) Culture Communication CO., LTD", + /* 0560 */ "Foster Electric Company, Ltd", + /* 0561 */ "ETA SA", + /* 0562 */ "x-Senso Solutions Kft", + /* 0563 */ "Shenzhen SuLong Communication Ltd", + /* 0564 */ "FengFan (BeiJing) Technology Co, Ltd", + /* 0565 */ "Qrio Inc", + /* 0566 */ "Pitpatpet Ltd", + /* 0567 */ "MSHeli s.r.l.", + /* 0568 */ "Trakm8 Ltd", + /* 0569 */ "JIN CO, Ltd", + /* 0570 */ "Alatech Tehnology", + /* 0571 */ "Beijing CarePulse Electronic Technology Co, Ltd", + /* 0572 */ "Awarepoint", + /* 0573 */ "ViCentra B.V.", + /* 0574 */ "Raven Industries", + /* 0575 */ "WaveWare Technologies Inc.", + /* 0576 */ "Argenox Technologies", + /* 0577 */ "Bragi GmbH", + /* 0578 */ "16Lab Inc", + /* 0579 */ "Masimo Corp", + /* 0580 */ "Iotera Inc", + /* 0581 */ "Endress+Hauser", + /* 0582 */ "ACKme Networks, Inc.", + /* 0583 */ "FiftyThree Inc.", + /* 0584 */ "Parker Hannifin Corp", + /* 0585 */ "Transcranial Ltd", + /* 0586 */ "Uwatec AG", + /* 0587 */ "Orlan LLC", + /* 0588 */ "Blue Clover Devices", + /* 0589 */ "M-Way Solutions GmbH", + /* 0590 */ "Microtronics Engineering GmbH", + /* 0591 */ "Schneider Schreibgeräte GmbH", + /* 0592 */ "Sapphire Circuits LLC", + /* 0593 */ "Lumo Bodytech Inc.", + /* 0594 */ "UKC Technosolution", + /* 0595 */ "Xicato Inc.", + /* 0596 */ "Playbrush", + /* 0597 */ "Dai Nippon Printing Co., Ltd.", + /* 0598 */ "G24 Power Limited", + /* 0599 */ "AdBabble Local Commerce Inc.", + /* 0600 */ "Devialet SA", + /* 0601 */ "ALTYOR", + /* 0602 */ "University of Applied Sciences Valais/Haute Ecole Valaisanne", + /* 0603 */ "Five Interactive, LLC dba Zendo", + /* 0604 */ "NetEase (Hangzhou) Network co.Ltd.", + /* 0605 */ "Lexmark International Inc.", + /* 0606 */ "Fluke Corporation", + /* 0607 */ "Yardarm Technologies", + /* 0608 */ "SensaRx", + /* 0609 */ "SECVRE GmbH", + /* 0610 */ "Glacial Ridge Technologies", + /* 0611 */ "Identiv, Inc.", + /* 0612 */ "DDS, Inc.", + /* 0613 */ "SMK Corporation", + /* 0614 */ "Schawbel Technologies LLC", + /* 0615 */ "XMI Systems SA", + /* 0616 */ "Cerevo", + /* 0617 */ "Torrox GmbH & Co KG", + /* 0618 */ "Gemalto", + /* 0619 */ "DEKA Research & Development Corp.", + /* 0620 */ "Domster Tadeusz Szydlowski", + /* 0621 */ "Technogym SPA", + /* 0622 */ "FLEURBAEY BVBA", + /* 0623 */ "Aptcode Solutions", + /* 0624 */ "LSI ADL Technology", + /* 0625 */ "Animas Corp", + /* 0626 */ "Alps Electric Co., Ltd.", + /* 0627 */ "OCEASOFT", + /* 0628 */ "Motsai Research", + /* 0629 */ "Geotab", + /* 0630 */ "E.G.O. Elektro-Geraetebau GmbH", + /* 0631 */ "bewhere inc", + /* 0632 */ "Johnson Outdoors Inc", + /* 0633 */ "steute Schaltgerate GmbH & Co. KG", + /* 0634 */ "Ekomini inc.", + /* 0635 */ "DEFA AS", + /* 0636 */ "Aseptika Ltd", + /* 0637 */ "HUAWEI Technologies Co., Ltd.", + /* 0638 */ "HabitAware, LLC", + /* 0639 */ "ruwido austria gmbh", + /* 0640 */ "ITEC corporation", + /* 0641 */ "StoneL", + /* 0642 */ "Sonova AG", + /* 0643 */ "Maven Machines, Inc.", + /* 0644 */ "Synapse Electronics", + /* 0645 */ "Standard Innovation Inc.", + /* 0646 */ "RF Code, Inc.", + /* 0647 */ "Wally Ventures S.L.", + /* 0648 */ "Willowbank Electronics Ltd", + /* 0649 */ "SK Telecom", + /* 0650 */ "Jetro AS", + /* 0651 */ "Code Gears LTD", + /* 0652 */ "NANOLINK APS", + /* 0653 */ "IF, LLC", + /* 0654 */ "RF Digital Corp", + /* 0655 */ "Church & Dwight Co., Inc", + /* 0656 */ "Multibit Oy", + /* 0657 */ "CliniCloud Inc", + /* 0658 */ "SwiftSensors", + /* 0659 */ "Blue Bite", + /* 0660 */ "ELIAS GmbH", + /* 0661 */ "Sivantos GmbH", + /* 0662 */ "Petzl", + /* 0663 */ "storm power ltd", + /* 0664 */ "EISST Ltd", + /* 0665 */ "Inexess Technology Simma KG", + /* 0666 */ "Currant, Inc.", + /* 0667 */ "C2 Development, Inc.", + /* 0668 */ "Blue Sky Scientific, LLC", + /* 0669 */ "ALOTTAZS LABS, LLC", + /* 0670 */ "Kupson spol. s r.o.", + /* 0671 */ "Areus Engineering GmbH", + /* 0672 */ "Impossible Camera GmbH", + /* 0673 */ "InventureTrack Systems", + /* 0674 */ "LockedUp", + /* 0675 */ "Itude", + /* 0676 */ "Pacific Lock Company", + /* 0677 */ "Tendyron Corporation", + /* 0678 */ "Robert Bosch GmbH", + /* 0679 */ "Illuxtron international B.V.", + /* 0680 */ "miSport Ltd.", + /* 0681 */ "Chargelib", + /* 0682 */ "Doppler Lab", + /* 0683 */ "BBPOS Limited", + /* 0684 */ "RTB Elektronik GmbH & Co. KG", + /* 0685 */ "Rx Networks, Inc.", + /* 0686 */ "WeatherFlow, Inc.", + /* 0687 */ "Technicolor USA Inc.", + /* 0688 */ "Bestechnic(Shanghai),Ltd", + /* 0689 */ "Raden Inc", + /* 0690 */ "JouZen Oy", + /* 0691 */ "CLABER S.P.A.", + /* 0692 */ "Hyginex, Inc.", + /* 0693 */ "HANSHIN ELECTRIC RAILWAY CO.,LTD.", + /* 0694 */ "Schneider Electric", + /* 0695 */ "Oort Technologies LLC", + /* 0696 */ "Chrono Therapeutics", + /* 0697 */ "Rinnai Corporation", + /* 0698 */ "Swissprime Technologies AG", + /* 0699 */ "Koha.,Co.Ltd", + /* 0700 */ "Genevac Ltd", + /* 0701 */ "Chemtronics", + /* 0702 */ "Seguro Technology Sp. z o.o.", + /* 0703 */ "Redbird Flight Simulations", + /* 0704 */ "Dash Robotics", + /* 0705 */ "LINE Corporation", + /* 0706 */ "Guillemot Corporation", + /* 0707 */ "Techtronic Power Tools Technology Limited", + /* 0708 */ "Wilson Sporting Goods", + /* 0709 */ "Lenovo (Singapore) Pte Ltd.", + /* 0710 */ "Ayatan Sensors", + /* 0711 */ "Electronics Tomorrow Limited", + /* 0712 */ "VASCO Data Security International, Inc.", + /* 0713 */ "PayRange Inc.", + /* 0714 */ "ABOV Semiconductor", + /* 0715 */ "AINA-Wireless Inc.", + /* 0716 */ "Eijkelkamp Soil & Water", + /* 0717 */ "BMA ergonomics b.v.", + /* 0718 */ "Teva Branded Pharmaceutical Products R&D, Inc.", + /* 0719 */ "Anima", + /* 0720 */ "3M", + /* 0721 */ "Empatica Srl", + /* 0722 */ "Afero, Inc.", + /* 0723 */ "Powercast Corporation", + /* 0724 */ "Secuyou ApS", + /* 0725 */ "OMRON Corporation", + /* 0726 */ "Send Solutions", + /* 0727 */ "NIPPON SYSTEMWARE CO.,LTD.", + /* 0728 */ "Neosfar", + /* 0729 */ "Fliegl Agrartechnik GmbH", + /* 0730 */ "Gilvader", + /* 0731 */ "Digi International Inc (R)", + /* 0732 */ "DeWalch Technologies, Inc.", + /* 0733 */ "Flint Rehabilitation Devices, LLC", + /* 0734 */ "Samsung SDS Co., Ltd.", + /* 0735 */ "Blur Product Development", + /* 0736 */ "University of Michigan", + /* 0737 */ "Victron Energy BV", + /* 0738 */ "NTT docomo", + /* 0739 */ "Carmanah Technologies Corp.", + /* 0740 */ "Bytestorm Ltd.", + /* 0741 */ "Espressif Incorporated", + /* 0742 */ "Unwire", + /* 0743 */ "Connected Yard, Inc.", + /* 0744 */ "American Music Environments", + /* 0745 */ "Sensogram Technologies, Inc.", + /* 0746 */ "Fujitsu Limited", + /* 0747 */ "Ardic Technology", + /* 0748 */ "Delta Systems, Inc", + /* 0749 */ "HTC Corporation", + /* 0750 */ "Citizen Holdings Co., Ltd.", + /* 0751 */ "SMART-INNOVATION.inc", + /* 0752 */ "Blackrat Software", + /* 0753 */ "The Idea Cave, LLC", + /* 0754 */ "GoPro, Inc.", + /* 0755 */ "AuthAir, Inc", + /* 0756 */ "Vensi, Inc.", + /* 0757 */ "Indagem Tech LLC", + /* 0758 */ "Intemo Technologies", + /* 0759 */ "DreamVisions co., Ltd.", + /* 0760 */ "Runteq Oy Ltd", + /* 0761 */ "IMAGINATION TECHNOLOGIES LTD", + /* 0762 */ "CoSTAR TEchnologies", + /* 0763 */ "Clarius Mobile Health Corp.", + /* 0764 */ "Shanghai Frequen Microelectronics Co., Ltd.", + /* 0765 */ "Uwanna, Inc.", + /* 0766 */ "Lierda Science & Technology Group Co., Ltd.", + /* 0767 */ "Silicon Laboratories", + /* 0768 */ "World Moto Inc.", + /* 0769 */ "Giatec Scientific Inc.", + /* 0770 */ "Loop Devices, Inc", + /* 0771 */ "IACA electronique", + /* 0772 */ "Proxy Technologies, Inc.", + /* 0773 */ "Swipp ApS", + /* 0774 */ "Life Laboratory Inc.", + /* 0775 */ "FUJI INDUSTRIAL CO.,LTD.", + /* 0776 */ "Surefire, LLC", + /* 0777 */ "Dolby Labs", + /* 0778 */ "Ellisys", + /* 0779 */ "Magnitude Lighting Converters", + /* 0780 */ "Hilti AG", + /* 0781 */ "Devdata S.r.l.", + /* 0782 */ "Deviceworx", + /* 0783 */ "Shortcut Labs", + /* 0784 */ "SGL Italia S.r.l.", + /* 0785 */ "PEEQ DATA", + /* 0786 */ "Ducere Technologies Pvt Ltd", + /* 0787 */ "DiveNav, Inc.", + /* 0788 */ "RIIG AI Sp. z o.o.", + /* 0789 */ "Thermo Fisher Scientific", + /* 0790 */ "AG Measurematics Pvt. Ltd.", + /* 0791 */ "CHUO Electronics CO., LTD.", + /* 0792 */ "Aspenta International", + /* 0793 */ "Eugster Frismag AG", + /* 0794 */ "Amber wireless GmbH", + /* 0795 */ "HQ Inc", + /* 0796 */ "Lab Sensor Solutions", + /* 0797 */ "Enterlab ApS", + /* 0798 */ "Eyefi, Inc.", + /* 0799 */ "MetaSystem S.p.A.", + /* 0800 */ "SONO ELECTRONICS. CO., LTD", + /* 0801 */ "Jewelbots", + /* 0802 */ "Compumedics Limited", + /* 0803 */ "Rotor Bike Components", + /* 0804 */ "Astro, Inc.", + /* 0805 */ "Amotus Solutions", + /* 0806 */ "Healthwear Technologies (Changzhou)Ltd", + /* 0807 */ "Essex Electronics", + /* 0808 */ "Grundfos A/S", + /* 0809 */ "Eargo, Inc.", + /* 0810 */ "Electronic Design Lab", + /* 0811 */ "ESYLUX", + /* 0812 */ "NIPPON SMT.CO.,Ltd", + /* 0813 */ "BM innovations GmbH", + /* 0814 */ "indoormap", + /* 0815 */ "OttoQ Inc", + /* 0816 */ "North Pole Engineering", + /* 0817 */ "3flares Technologies Inc.", + /* 0818 */ "Electrocompaniet A.S.", + /* 0819 */ "Mul-T-Lock", + /* 0820 */ "Corentium AS", + /* 0821 */ "Enlighted Inc", + /* 0822 */ "GISTIC", + /* 0823 */ "AJP2 Holdings, LLC", + /* 0824 */ "COBI GmbH", + /* 0825 */ "Blue Sky Scientific, LLC", + /* 0826 */ "Appception, Inc.", + /* 0827 */ "Courtney Thorne Limited", + /* 0828 */ "Virtuosys", + /* 0829 */ "TPV Technology Limited", + /* 0830 */ "Monitra SA", + /* 0831 */ "Automation Components, Inc.", + /* 0832 */ "Letsense s.r.l.", + /* 0833 */ "Etesian Technologies LLC", + /* 0834 */ "GERTEC BRASIL LTDA.", + /* 0835 */ "Drekker Development Pty. Ltd.", + /* 0836 */ "Whirl Inc", + /* 0837 */ "Locus Positioning", + /* 0838 */ "Acuity Brands Lighting, Inc", + /* 0839 */ "Prevent Biometrics", + /* 0840 */ "Arioneo", + /* 0841 */ "VersaMe", + /* 0842 */ "Vaddio", + /* 0843 */ "Libratone A/S", + /* 0844 */ "HM Electronics, Inc.", + /* 0845 */ "TASER International, Inc.", + /* 0846 */ "SafeTrust Inc.", + /* 0847 */ "Heartland Payment Systems", + /* 0848 */ "Bitstrata Systems Inc.", + /* 0849 */ "Pieps GmbH", + /* 0850 */ "iRiding(Xiamen)Technology Co.,Ltd.", + /* 0851 */ "Alpha Audiotronics, Inc.", + /* 0852 */ "TOPPAN FORMS CO.,LTD.", + /* 0853 */ "Sigma Designs, Inc.", + /* 0854 */ "Spectrum Brands, Inc.", + /* 0855 */ "Polymap Wireless", + /* 0856 */ "MagniWare Ltd.", + /* 0857 */ "Novotec Medical GmbH", + /* 0858 */ "Medicom Innovation Partner a/s", + /* 0859 */ "Matrix Inc.", + /* 0860 */ "Eaton Corporation", + /* 0861 */ "KYS", + /* 0862 */ "Naya Health, Inc.", + /* 0863 */ "Acromag", + /* 0864 */ "Insulet Corporation", + /* 0865 */ "Wellinks Inc.", + /* 0866 */ "ON Semiconductor", + /* 0867 */ "FREELAP SA", + /* 0868 */ "Favero Electronics Srl", + /* 0869 */ "BioMech Sensor LLC", + /* 0870 */ "BOLTT Sports technologies Private limited", + /* 0871 */ "Saphe International", + /* 0872 */ "Metormote AB", + /* 0873 */ "littleBits", + /* 0874 */ "SetPoint Medical", + /* 0875 */ "BRControls Products BV", + /* 0876 */ "Zipcar", + /* 0877 */ "AirBolt Pty Ltd", + /* 0878 */ "KeepTruckin Inc", + /* 0879 */ "Motiv, Inc.", + /* 0880 */ "Wazombi Labs OU", + /* 0881 */ "ORBCOMM", + /* 0882 */ "Nixie Labs, Inc.", + /* 0883 */ "AppNearMe Ltd", + /* 0884 */ "Holman Industries", + /* 0885 */ "Expain AS", + /* 0886 */ "Electronic Temperature Instruments Ltd", + /* 0887 */ "Plejd AB", + /* 0888 */ "Propeller Health", + /* 0889 */ "Shenzhen iMCO Electronic Technology Co.,Ltd", + /* 0890 */ "Algoria", + /* 0891 */ "Apption Labs Inc.", + /* 0892 */ "Cronologics Corporation", + /* 0893 */ "MICRODIA Ltd.", + /* 0894 */ "lulabytes S.L.", + /* 0895 */ "Societe des Produits Nestle S.A. (formerly Nestec S.A.)", + /* 0896 */ "LLC \"MEGA-F service\"", + /* 0897 */ "Sharp Corporation", + /* 0898 */ "Precision Outcomes Ltd", + /* 0899 */ "Kronos Incorporated", + /* 0900 */ "OCOSMOS Co., Ltd.", + /* 0901 */ "Embedded Electronic Solutions Ltd. dba e2Solutions", + /* 0902 */ "Aterica Inc.", + /* 0903 */ "BluStor PMC, Inc.", + /* 0904 */ "Kapsch TrafficCom AB", + /* 0905 */ "ActiveBlu Corporation", + /* 0906 */ "Kohler Mira Limited", + /* 0907 */ "Noke", + /* 0908 */ "Appion Inc.", + /* 0909 */ "Resmed Ltd", + /* 0910 */ "Crownstone B.V.", + /* 0911 */ "Xiaomi Inc.", + /* 0912 */ "INFOTECH s.r.o.", + /* 0913 */ "Thingsquare AB", + /* 0914 */ "T&D", + /* 0915 */ "LAVAZZA S.p.A.", + /* 0916 */ "Netclearance Systems, Inc.", + /* 0917 */ "SDATAWAY", + /* 0918 */ "BLOKS GmbH", + /* 0919 */ "LEGO System A/S", + /* 0920 */ "Thetatronics Ltd", + /* 0921 */ "Nikon Corporation", + /* 0922 */ "NeST", + /* 0923 */ "South Silicon Valley Microelectronics", + /* 0924 */ "ALE International", + /* 0925 */ "CareView Communications, Inc.", + /* 0926 */ "SchoolBoard Limited", + /* 0927 */ "Molex Corporation", + /* 0928 */ "IVT Wireless Limited", + /* 0929 */ "Alpine Labs LLC", + /* 0930 */ "Candura Instruments", + /* 0931 */ "SmartMovt Technology Co., Ltd", + /* 0932 */ "Token Zero Ltd", + /* 0933 */ "ACE CAD Enterprise Co., Ltd. (ACECAD)", + /* 0934 */ "Medela, Inc", + /* 0935 */ "AeroScout", + /* 0936 */ "Esrille Inc.", + /* 0937 */ "THINKERLY SRL", + /* 0938 */ "Exon Sp. z o.o.", + /* 0939 */ "Meizu Technology Co., Ltd.", + /* 0940 */ "Smablo LTD", + /* 0941 */ "XiQ", + /* 0942 */ "Allswell Inc.", + /* 0943 */ "Comm-N-Sense Corp DBA Verigo", + /* 0944 */ "VIBRADORM GmbH", + /* 0945 */ "Otodata Wireless Network Inc.", + /* 0946 */ "Propagation Systems Limited", + /* 0947 */ "Midwest Instruments & Controls", + /* 0948 */ "Alpha Nodus, inc.", + /* 0949 */ "petPOMM, Inc", + /* 0950 */ "Mattel", + /* 0951 */ "Airbly Inc.", + /* 0952 */ "A-Safe Limited", + /* 0953 */ "FREDERIQUE CONSTANT SA", + /* 0954 */ "Maxscend Microelectronics Company Limited", + /* 0955 */ "Abbott", + /* 0956 */ "ASB Bank Ltd", + /* 0957 */ "amadas", + /* 0958 */ "Applied Science, Inc.", + /* 0959 */ "iLumi Solutions Inc.", + /* 0960 */ "Arch Systems Inc.", + /* 0961 */ "Ember Technologies, Inc.", + /* 0962 */ "Snapchat Inc", + /* 0963 */ "Casambi Technologies Oy", + /* 0964 */ "Pico Technology Inc.", + /* 0965 */ "St. Jude Medical, Inc.", + /* 0966 */ "Intricon", + /* 0967 */ "Structural Health Systems, Inc.", + /* 0968 */ "Avvel International", + /* 0969 */ "Gallagher Group", + /* 0970 */ "In2things Automation Pvt. Ltd.", + /* 0971 */ "SYSDEV Srl", + /* 0972 */ "Vonkil Technologies Ltd", + /* 0973 */ "Wynd Technologies, Inc.", + /* 0974 */ "CONTRINEX S.A.", + /* 0975 */ "MIRA, Inc.", + /* 0976 */ "Watteam Ltd", + /* 0977 */ "Density Inc.", + /* 0978 */ "IOT Pot India Private Limited", + /* 0979 */ "Sigma Connectivity AB", *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon May 18 08:59: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 95BD313B73F; Mon, 18 May 2020 08:59:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QXxv29Pjz4RFt; Mon, 18 May 2020 08:59:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B4151F094; Mon, 18 May 2020 08:59:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I8xFau044544; Mon, 18 May 2020 08:59:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8xFtV044543; Mon, 18 May 2020 08:59:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180859.04I8xFtV044543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:59: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: r361167 - stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361167 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, 18 May 2020 08:59:15 -0000 Author: hselasky Date: Mon May 18 08:59:14 2020 New Revision: 361167 URL: https://svnweb.freebsd.org/changeset/base/361167 Log: MFC r360172: Update string tables in hccontrol(8). Submitted by: Marc Veldman PR: 245796 Sponsored by: Mellanox Technologies Modified: stable/11/usr.sbin/bluetooth/hccontrol/util.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:58:41 2020 (r361166) +++ stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:59:14 2020 (r361167) @@ -160,7 +160,10 @@ hci_ver2str(int ver) /* 0x05 */ "Bluetooth HCI Specification 3.0", /* 0x06 */ "Bluetooth HCI Specification 4.0", /* 0x07 */ "Bluetooth HCI Specification 4.1", - /* 0x08 */ "Bluetooth HCI Specification 4.2" + /* 0x08 */ "Bluetooth HCI Specification 4.2", + /* 0x09 */ "Bluetooth HCI Specification 5.0", + /* 0x0a */ "Bluetooth HCI Specification 5.1", + /* 0x0b */ "Bluetooth HCI Specification 5.2" }; return (ver >= SIZE(t)? "?" : t[ver]); @@ -175,10 +178,13 @@ hci_lmpver2str(int ver) /* 0x02 */ "Bluetooth LMP 1.2", /* 0x03 */ "Bluetooth LMP 2.0", /* 0x04 */ "Bluetooth LMP 2.1", - /* 0x04 */ "Bluetooth LMP 3.0", - /* 0x04 */ "Bluetooth LMP 4.0", - /* 0x04 */ "Bluetooth LMP 4.1", - /* 0x04 */ "Bluetooth LMP 4.2" + /* 0x05 */ "Bluetooth LMP 3.0", + /* 0x06 */ "Bluetooth LMP 4.0", + /* 0x07 */ "Bluetooth LMP 4.1", + /* 0x08 */ "Bluetooth LMP 4.2", + /* 0x09 */ "Bluetooth LMP 5.0", + /* 0x0a */ "Bluetooth LMP 5.1", + /* 0x0b */ "Bluetooth LMP 5.2" }; return (ver >= SIZE(t)? "?" : t[ver]); @@ -198,7 +204,7 @@ hci_manufacturer2str(int m) /* 0007 */ "Lucent", /* 0008 */ "Motorola", /* 0009 */ "Infineon Technologies AG", - /* 0010 */ "Cambridge Silicon Radio", + /* 0010 */ "Qualcomm Technologies International, Ltd. (QTIL)", /* 0011 */ "Silicon Wave", /* 0012 */ "Digianswer A/S", /* 0013 */ "Texas Instruments Inc.", @@ -213,7 +219,7 @@ hci_manufacturer2str(int m) /* 0022 */ "KC Technology Inc.", /* 0023 */ "Newlogic", /* 0024 */ "Transilica, Inc.", - /* 0025 */ "Rohde & Schwartz GmbH & Co. KG", + /* 0025 */ "Rohde & Schwarz GmbH & Co. KG", /* 0026 */ "TTPCom Limited", /* 0027 */ "Signia Technologies, Inc.", /* 0028 */ "Conexant Systems Inc.", @@ -225,7 +231,7 @@ hci_manufacturer2str(int m) /* 0034 */ "NEC Corporation", /* 0035 */ "WavePlus Technology Co., Ltd.", /* 0036 */ "Alcatel", - /* 0037 */ "Philips Semiconductors", + /* 0037 */ "NXP Semiconductors (formerly Philips Semiconductors)", /* 0038 */ "C Technologies", /* 0039 */ "Open Interface", /* 0040 */ "R F Micro Devices", @@ -237,22 +243,2187 @@ hci_manufacturer2str(int m) /* 0046 */ "Norwood Systems", /* 0047 */ "MewTel Technology Inc.", /* 0048 */ "ST Microelectronics", - /* 0049 */ "Synopsys", + /* 0049 */ "Synopsys, Inc.", /* 0050 */ "Red-M (Communications) Ltd", /* 0051 */ "Commil Ltd", /* 0052 */ "Computer Access Technology Corporation (CATC)", /* 0053 */ "Eclipse (HQ Espana) S.L.", - /* 0054 */ "Renesas Technology Corp.", + /* 0054 */ "Renesas Electronics Corporation", /* 0055 */ "Mobilian Corporation", - /* 0056 */ "Terax", + /* 0056 */ "Syntronix Corporation", /* 0057 */ "Integrated System Solution Corp.", - /* 0058 */ "Matsushita Electric Industrial Co., Ltd.", + /* 0058 */ "Panasonic Corporation (formerly Matsushita Electric Industrial Co., Ltd.)", /* 0059 */ "Gennum Corporation", - /* 0060 */ "Research In Motion", + /* 0060 */ "BlackBerry Limited (formerly Research In Motion)", /* 0061 */ "IPextreme, Inc.", /* 0062 */ "Systems and Chips, Inc", /* 0063 */ "Bluetooth SIG, Inc", - /* 0064 */ "Seiko Epson Corporation" + /* 0064 */ "Seiko Epson Corporation", + /* 0065 */ "Integrated Silicon Solution Taiwan, Inc.", + /* 0066 */ "CONWISE Technology Corporation Ltd", + /* 0067 */ "PARROT AUTOMOTIVE SAS", + /* 0068 */ "Socket Mobile", + /* 0069 */ "Atheros Communications, Inc.", + /* 0070 */ "MediaTek, Inc.", + /* 0071 */ "Bluegiga", + /* 0072 */ "Marvell Technology Group Ltd.", + /* 0073 */ "3DSP Corporation", + /* 0074 */ "Accel Semiconductor Ltd.", + /* 0075 */ "Continental Automotive Systems", + /* 0076 */ "Apple, Inc.", + /* 0077 */ "Staccato Communications, Inc.", + /* 0078 */ "Avago Technologies", + /* 0079 */ "APT Ltd.", + /* 0080 */ "SiRF Technology, Inc.", + /* 0081 */ "Tzero Technologies, Inc.", + /* 0082 */ "J&M Corporation", + /* 0083 */ "Free2move AB", + /* 0084 */ "3DiJoy Corporation", + /* 0085 */ "Plantronics, Inc.", + /* 0086 */ "Sony Ericsson Mobile Communications", + /* 0087 */ "Harman International Industries, Inc.", + /* 0088 */ "Vizio, Inc.", + /* 0089 */ "Nordic Semiconductor ASA", + /* 0090 */ "EM Microelectronic-Marin SA", + /* 0091 */ "Ralink Technology Corporation", + /* 0092 */ "Belkin International, Inc.", + /* 0093 */ "Realtek Semiconductor Corporation", + /* 0094 */ "Stonestreet One, LLC", + /* 0095 */ "Wicentric, Inc.", + /* 0096 */ "RivieraWaves S.A.S", + /* 0097 */ "RDA Microelectronics", + /* 0098 */ "Gibson Guitars", + /* 0099 */ "MiCommand Inc.", + /* 0100 */ "Band XI International, LLC", + /* 0101 */ "Hewlett-Packard Company", + /* 0102 */ "9Solutions Oy", + /* 0103 */ "GN Netcom A/S", + /* 0104 */ "General Motors", + /* 0105 */ "A&D Engineering, Inc.", + /* 0106 */ "MindTree Ltd.", + /* 0107 */ "Polar Electro OY", + /* 0108 */ "Beautiful Enterprise Co., Ltd.", + /* 0109 */ "BriarTek, Inc", + /* 0110 */ "Summit Data Communications, Inc.", + /* 0111 */ "Sound ID", + /* 0112 */ "Monster, LLC", + /* 0113 */ "connectBlue AB", + /* 0114 */ "ShangHai Super Smart Electronics Co. Ltd.", + /* 0115 */ "Group Sense Ltd.", + /* 0116 */ "Zomm, LLC", + /* 0117 */ "Samsung Electronics Co. Ltd.", + /* 0118 */ "Creative Technology Ltd.", + /* 0119 */ "Laird Technologies", + /* 0120 */ "Nike, Inc.", + /* 0121 */ "lesswire AG", + /* 0122 */ "MStar Semiconductor, Inc.", + /* 0123 */ "Hanlynn Technologies", + /* 0124 */ "A & R Cambridge", + /* 0125 */ "Seers Technology Co., Ltd.", + /* 0126 */ "Sports Tracking Technologies Ltd.", + /* 0127 */ "Autonet Mobile", + /* 0128 */ "DeLorme Publishing Company, Inc.", + /* 0129 */ "WuXi Vimicro", + /* 0130 */ "Sennheiser Communications A/S", + /* 0131 */ "TimeKeeping Systems, Inc.", + /* 0132 */ "Ludus Helsinki Ltd.", + /* 0133 */ "BlueRadios, Inc.", + /* 0134 */ "Equinux AG", + /* 0135 */ "Garmin International, Inc.", + /* 0136 */ "Ecotest", + /* 0137 */ "GN ReSound A/S", + /* 0138 */ "Jawbone", + /* 0139 */ "Topcon Positioning Systems, LLC", + /* 0140 */ "Gimbal Inc. (formerly Qualcomm Labs, Inc. and Qualcomm Retail Solutions, Inc.)", + /* 0141 */ "Zscan Software", + /* 0142 */ "Quintic Corp", + /* 0143 */ "Telit Wireless Solutions GmbH (formerly Stollmann E+V GmbH)", + /* 0144 */ "Funai Electric Co., Ltd.", + /* 0145 */ "Advanced PANMOBIL systems GmbH & Co. KG", + /* 0146 */ "ThinkOptics, Inc.", + /* 0147 */ "Universal Electronics, Inc.", + /* 0148 */ "Airoha Technology Corp.", + /* 0149 */ "NEC Lighting, Ltd.", + /* 0150 */ "ODM Technology, Inc.", + /* 0151 */ "ConnecteDevice Ltd.", + /* 0152 */ "zero1.tv GmbH", + /* 0153 */ "i.Tech Dynamic Global Distribution Ltd.", + /* 0154 */ "Alpwise", + /* 0155 */ "Jiangsu Toppower Automotive Electronics Co., Ltd.", + /* 0156 */ "Colorfy, Inc.", + /* 0157 */ "Geoforce Inc.", + /* 0158 */ "Bose Corporation", + /* 0159 */ "Suunto Oy", + /* 0160 */ "Kensington Computer Products Group", + /* 0161 */ "SR-Medizinelektronik", + /* 0162 */ "Vertu Corporation Limited", + /* 0163 */ "Meta Watch Ltd.", + /* 0164 */ "LINAK A/S", + /* 0165 */ "OTL Dynamics LLC", + /* 0166 */ "Panda Ocean Inc.", + /* 0167 */ "Visteon Corporation", + /* 0168 */ "ARP Devices Limited", + /* 0169 */ "MARELLI EUROPE S.P.A. (formerly Magneti Marelli S.p.A.)", + /* 0170 */ "CAEN RFID srl", + /* 0171 */ "Ingenieur-Systemgruppe Zahn GmbH", + /* 0172 */ "Green Throttle Games", + /* 0173 */ "Peter Systemtechnik GmbH", + /* 0174 */ "Omegawave Oy", + /* 0175 */ "Cinetix", + /* 0176 */ "Passif Semiconductor Corp", + /* 0177 */ "Saris Cycling Group, Inc", + /* 0178 */ "Bekey A/S", + /* 0179 */ "Clarinox Technologies Pty. Ltd.", + /* 0180 */ "BDE Technology Co., Ltd.", + /* 0181 */ "Swirl Networks", + /* 0182 */ "Meso international", + /* 0183 */ "TreLab Ltd", + /* 0184 */ "Qualcomm Innovation Center, Inc. (QuIC)", + /* 0185 */ "Johnson Controls, Inc.", + /* 0186 */ "Starkey Laboratories Inc.", + /* 0187 */ "S-Power Electronics Limited", + /* 0188 */ "Ace Sensor Inc", + /* 0189 */ "Aplix Corporation", + /* 0190 */ "AAMP of America", + /* 0191 */ "Stalmart Technology Limited", + /* 0192 */ "AMICCOM Electronics Corporation", + /* 0193 */ "Shenzhen Excelsecu Data Technology Co.,Ltd", + /* 0194 */ "Geneq Inc.", + /* 0195 */ "adidas AG", + /* 0196 */ "LG Electronics", + /* 0197 */ "Onset Computer Corporation", + /* 0198 */ "Selfly BV", + /* 0199 */ "Quuppa Oy.", + /* 0200 */ "GeLo Inc", + /* 0201 */ "Evluma", + /* 0202 */ "MC10", + /* 0203 */ "Binauric SE", + /* 0204 */ "Beats Electronics", + /* 0205 */ "Microchip Technology Inc.", + /* 0206 */ "Elgato Systems GmbH", + /* 0207 */ "ARCHOS SA", + /* 0208 */ "Dexcom, Inc.", + /* 0209 */ "Polar Electro Europe B.V.", + /* 0210 */ "Dialog Semiconductor B.V.", + /* 0211 */ "Taixingbang Technology (HK) Co,. LTD.", + /* 0212 */ "Kawantech", + /* 0213 */ "Austco Communication Systems", + /* 0214 */ "Timex Group USA, Inc.", + /* 0215 */ "Qualcomm Technologies, Inc.", + /* 0216 */ "Qualcomm Connected Experiences, Inc.", + /* 0217 */ "Voyetra Turtle Beach", + /* 0218 */ "txtr GmbH", + /* 0219 */ "Biosentronics", + /* 0220 */ "Procter & Gamble", + /* 0221 */ "Hosiden Corporation", + /* 0222 */ "Muzik LLC", + /* 0223 */ "Misfit Wearables Corp", + /* 0224 */ "Google", + /* 0225 */ "Danlers Ltd", + /* 0226 */ "Semilink Inc", + /* 0227 */ "inMusic Brands, Inc", + /* 0228 */ "L.S. Research Inc.", + /* 0229 */ "Eden Software Consultants Ltd.", + /* 0230 */ "Freshtemp", + /* 0231 */ "KS Technologies", + /* 0232 */ "ACTS Technologies", + /* 0233 */ "Vtrack Systems", + /* 0234 */ "Nielsen-Kellerman Company", + /* 0235 */ "Server Technology Inc.", + /* 0236 */ "BioResearch Associates", + /* 0237 */ "Jolly Logic, LLC", + /* 0238 */ "Above Average Outcomes, Inc.", + /* 0239 */ "Bitsplitters GmbH", + /* 0240 */ "PayPal, Inc.", + /* 0241 */ "Witron Technology Limited", + /* 0242 */ "Morse Project Inc.", + /* 0243 */ "Kent Displays Inc.", + /* 0244 */ "Nautilus Inc.", + /* 0245 */ "Smartifier Oy", + /* 0246 */ "Elcometer Limited", + /* 0247 */ "VSN Technologies, Inc.", + /* 0248 */ "AceUni Corp., Ltd.", + /* 0249 */ "StickNFind", + /* 0250 */ "Crystal Code AB", + /* 0251 */ "KOUKAAM a.s.", + /* 0252 */ "Delphi Corporation", + /* 0253 */ "ValenceTech Limited", + /* 0254 */ "Stanley Black and Decker", + /* 0255 */ "Typo Products, LLC", + /* 0256 */ "TomTom International BV", + /* 0257 */ "Fugoo, Inc.", + /* 0258 */ "Keiser Corporation", + /* 0259 */ "Bang & Olufsen A/S", + /* 0260 */ "PLUS Location Systems Pty Ltd", + /* 0261 */ "Ubiquitous Computing Technology Corporation", + /* 0262 */ "Innovative Yachtter Solutions", + /* 0263 */ "William Demant Holding A/S", + /* 0264 */ "Chicony Electronics Co., Ltd.", + /* 0265 */ "Atus BV", + /* 0266 */ "Codegate Ltd", + /* 0267 */ "ERi, Inc", + /* 0268 */ "Transducers Direct, LLC", + /* 0269 */ "DENSO TEN LIMITED (formerly Fujitsu Ten LImited)", + /* 0270 */ "Audi AG", + /* 0271 */ "HiSilicon Technologies CO., LIMITED", + /* 0272 */ "Nippon Seiki Co., Ltd.", + /* 0273 */ "Steelseries ApS", + /* 0274 */ "Visybl Inc.", + /* 0275 */ "Openbrain Technologies, Co., Ltd.", + /* 0276 */ "Xensr", + /* 0277 */ "e.solutions", + /* 0278 */ "10AK Technologies", + /* 0279 */ "Wimoto Technologies Inc", + /* 0280 */ "Radius Networks, Inc.", + /* 0281 */ "Wize Technology Co., Ltd.", + /* 0282 */ "Qualcomm Labs, Inc.", + /* 0283 */ "Hewlett Packard Enterprise", + /* 0284 */ "Baidu", + /* 0285 */ "Arendi AG", + /* 0286 */ "Skoda Auto a.s.", + /* 0287 */ "Volkswagen AG", + /* 0288 */ "Porsche AG", + /* 0289 */ "Sino Wealth Electronic Ltd.", + /* 0290 */ "AirTurn, Inc.", + /* 0291 */ "Kinsa, Inc", + /* 0292 */ "HID Global", + /* 0293 */ "SEAT es", + /* 0294 */ "Promethean Ltd.", + /* 0295 */ "Salutica Allied Solutions", + /* 0296 */ "GPSI Group Pty Ltd", + /* 0297 */ "Nimble Devices Oy", + /* 0298 */ "Changzhou Yongse Infotech Co., Ltd.", + /* 0299 */ "SportIQ", + /* 0300 */ "TEMEC Instruments B.V.", + /* 0301 */ "Sony Corporation", + /* 0302 */ "ASSA ABLOY", + /* 0303 */ "Clarion Co. Inc.", + /* 0304 */ "Warehouse Innovations", + /* 0305 */ "Cypress Semiconductor", + /* 0306 */ "MADS Inc", + /* 0307 */ "Blue Maestro Limited", + /* 0308 */ "Resolution Products, Ltd.", + /* 0309 */ "Aireware LLC", + /* 0310 */ "Silvair, Inc.", + /* 0311 */ "Prestigio Plaza Ltd.", + /* 0312 */ "NTEO Inc.", + /* 0313 */ "Focus Systems Corporation", + /* 0314 */ "Tencent Holdings Ltd.", + /* 0315 */ "Allegion", + /* 0316 */ "Murata Manufacturing Co., Ltd.", + /* 0317 */ "WirelessWERX", + /* 0318 */ "Nod, Inc.", + /* 0319 */ "B&B Manufacturing Company", + /* 0320 */ "Alpine Electronics (China) Co., Ltd", + /* 0321 */ "FedEx Services", + /* 0322 */ "Grape Systems Inc.", + /* 0323 */ "Bkon Connect", + /* 0324 */ "Lintech GmbH", + /* 0325 */ "Novatel Wireless", + /* 0326 */ "Ciright", + /* 0327 */ "Mighty Cast, Inc.", + /* 0328 */ "Ambimat Electronics", + /* 0329 */ "Perytons Ltd.", + /* 0330 */ "Tivoli Audio, LLC", + /* 0331 */ "Master Lock", + /* 0332 */ "Mesh-Net Ltd", + /* 0333 */ "HUIZHOU DESAY SV AUTOMOTIVE CO., LTD.", + /* 0334 */ "Tangerine, Inc.", + /* 0335 */ "B&W Group Ltd.", + /* 0336 */ "Pioneer Corporation", + /* 0337 */ "OnBeep", + /* 0338 */ "Vernier Software & Technology", + /* 0339 */ "ROL Ergo", + /* 0340 */ "Pebble Technology", + /* 0341 */ "NETATMO", + /* 0342 */ "Accumulate AB", + /* 0343 */ "Anhui Huami Information Technology Co., Ltd.", + /* 0344 */ "Inmite s.r.o.", + /* 0345 */ "ChefSteps, Inc.", + /* 0346 */ "micas AG", + /* 0347 */ "Biomedical Research Ltd.", + /* 0348 */ "Pitius Tec S.L.", + /* 0349 */ "Estimote, Inc.", + /* 0350 */ "Unikey Technologies, Inc.", + /* 0351 */ "Timer Cap Co.", + /* 0352 */ "AwoX", + /* 0353 */ "yikes", + /* 0354 */ "MADSGlobalNZ Ltd.", + /* 0355 */ "PCH International", + /* 0356 */ "Qingdao Yeelink Information Technology Co., Ltd.", + /* 0357 */ "Milwaukee Tool (Formally Milwaukee Electric Tools)", + /* 0358 */ "MISHIK Pte Ltd", + /* 0359 */ "Ascensia Diabetes Care US Inc.", + /* 0360 */ "Spicebox LLC", + /* 0361 */ "emberlight", + /* 0362 */ "Cooper-Atkins Corporation", + /* 0363 */ "Qblinks", + /* 0364 */ "MYSPHERA", + /* 0365 */ "LifeScan Inc", + /* 0366 */ "Volantic AB", + /* 0367 */ "Podo Labs, Inc", + /* 0368 */ "Roche Diabetes Care AG", + /* 0369 */ "Amazon.com Services, LLC (formerly Amazon Fulfillment Service)", + /* 0370 */ "Connovate Technology Private Limited", + /* 0371 */ "Kocomojo, LLC", + /* 0372 */ "Everykey Inc.", + /* 0373 */ "Dynamic Controls", + /* 0374 */ "SentriLock", + /* 0375 */ "I-SYST inc.", + /* 0376 */ "CASIO COMPUTER CO., LTD.", + /* 0377 */ "LAPIS Semiconductor Co., Ltd.", + /* 0378 */ "Telemonitor, Inc.", + /* 0379 */ "taskit GmbH", + /* 0380 */ "Daimler AG", + /* 0381 */ "BatAndCat", + /* 0382 */ "BluDotz Ltd", + /* 0383 */ "XTel Wireless ApS", + /* 0384 */ "Gigaset Communications GmbH", + /* 0385 */ "Gecko Health Innovations, Inc.", + /* 0386 */ "HOP Ubiquitous", + /* 0387 */ "Walt Disney", + /* 0388 */ "Nectar", + /* 0389 */ "bel'apps LLC", + /* 0390 */ "CORE Lighting Ltd", + /* 0391 */ "Seraphim Sense Ltd", + /* 0392 */ "Unico RBC", + /* 0393 */ "Physical Enterprises Inc.", + /* 0394 */ "Able Trend Technology Limited", + /* 0395 */ "Konica Minolta, Inc.", + /* 0396 */ "Wilo SE", + /* 0397 */ "Extron Design Services", + /* 0398 */ "Fitbit, Inc.", + /* 0399 */ "Fireflies Systems", + /* 0400 */ "Intelletto Technologies Inc.", + /* 0401 */ "FDK CORPORATION", + /* 0402 */ "Cloudleaf, Inc", + /* 0403 */ "Maveric Automation LLC", + /* 0404 */ "Acoustic Stream Corporation", + /* 0405 */ "Zuli", + /* 0406 */ "Paxton Access Ltd", + /* 0407 */ "WiSilica Inc.", + /* 0408 */ "VENGIT Korlatolt Felelossegu Tarsasag", + /* 0409 */ "SALTO SYSTEMS S.L.", + /* 0410 */ "TRON Forum (formerly T-Engine Forum)", + /* 0411 */ "CUBETECH s.r.o.", + /* 0412 */ "Cokiya Incorporated", + /* 0413 */ "CVS Health", + /* 0414 */ "Ceruus", + /* 0415 */ "Strainstall Ltd", + /* 0416 */ "Channel Enterprises (HK) Ltd.", + /* 0417 */ "FIAMM", + /* 0418 */ "GIGALANE.CO.,LTD", + /* 0419 */ "EROAD", + /* 0420 */ "Mine Safety Appliances", + /* 0421 */ "Icon Health and Fitness", + /* 0422 */ "Wille Engineering (formely as Asandoo GmbH)", + /* 0423 */ "ENERGOUS CORPORATION", + /* 0424 */ "Taobao", + /* 0425 */ "Canon Inc.", + /* 0426 */ "Geophysical Technology Inc.", + /* 0427 */ "Facebook, Inc.", + /* 0428 */ "Trividia Health, Inc.", + /* 0429 */ "FlightSafety International", + /* 0430 */ "Earlens Corporation", + /* 0431 */ "Sunrise Micro Devices, Inc.", + /* 0432 */ "Star Micronics Co., Ltd.", + /* 0433 */ "Netizens Sp. z o.o.", + /* 0434 */ "Nymi Inc.", + /* 0435 */ "Nytec, Inc.", + /* 0436 */ "Trineo Sp. z o.o.", + /* 0437 */ "Nest Labs Inc.", + /* 0438 */ "LM Technologies Ltd", + /* 0439 */ "General Electric Company", + /* 0440 */ "i+D3 S.L.", + /* 0441 */ "HANA Micron", + /* 0442 */ "Stages Cycling LLC", + /* 0443 */ "Cochlear Bone Anchored Solutions AB", + /* 0444 */ "SenionLab AB", + /* 0445 */ "Syszone Co., Ltd", + /* 0446 */ "Pulsate Mobile Ltd.", + /* 0447 */ "Hong Kong HunterSun Electronic Limited", + /* 0448 */ "pironex GmbH", + /* 0449 */ "BRADATECH Corp.", + /* 0450 */ "Transenergooil AG", + /* 0451 */ "Bunch", + /* 0452 */ "DME Microelectronics", + /* 0453 */ "Bitcraze AB", + /* 0454 */ "HASWARE Inc.", + /* 0455 */ "Abiogenix Inc.", + /* 0456 */ "Poly-Control ApS", + /* 0457 */ "Avi-on", + /* 0458 */ "Laerdal Medical AS", + /* 0459 */ "Fetch My Pet", + /* 0460 */ "Sam Labs Ltd.", + /* 0461 */ "Chengdu Synwing Technology Ltd", + /* 0462 */ "HOUWA SYSTEM DESIGN, k.k.", + /* 0463 */ "BSH", + /* 0464 */ "Primus Inter Pares Ltd", + /* 0465 */ "August Home, Inc", + /* 0466 */ "Gill Electronics", + /* 0467 */ "Sky Wave Design", + /* 0468 */ "Newlab S.r.l.", + /* 0469 */ "ELAD srl", + /* 0470 */ "G-wearables inc.", + /* 0471 */ "Squadrone Systems Inc.", + /* 0472 */ "Code Corporation", + /* 0473 */ "Savant Systems LLC", + /* 0474 */ "Logitech International SA", + /* 0475 */ "Innblue Consulting", + /* 0476 */ "iParking Ltd.", + /* 0477 */ "Koninklijke Philips Electronics N.V.", + /* 0478 */ "Minelab Electronics Pty Limited", + /* 0479 */ "Bison Group Ltd.", + /* 0480 */ "Widex A/S", + /* 0481 */ "Jolla Ltd", + /* 0482 */ "Lectronix, Inc.", + /* 0483 */ "Caterpillar Inc", + /* 0484 */ "Freedom Innovations", + /* 0485 */ "Dynamic Devices Ltd", + /* 0486 */ "Technology Solutions (UK) Ltd", + /* 0487 */ "IPS Group Inc.", + /* 0488 */ "STIR", + /* 0489 */ "Sano, Inc.", + /* 0490 */ "Advanced Application Design, Inc.", + /* 0491 */ "AutoMap LLC", + /* 0492 */ "Spreadtrum Communications Shanghai Ltd", + /* 0493 */ "CuteCircuit LTD", + /* 0494 */ "Valeo Service", + /* 0495 */ "Fullpower Technologies, Inc.", + /* 0496 */ "KloudNation", + /* 0497 */ "Zebra Technologies Corporation", + /* 0498 */ "Itron, Inc.", + /* 0499 */ "The University of Tokyo", + /* 0500 */ "UTC Fire and Security", + /* 0501 */ "Cool Webthings Limited", + /* 0502 */ "DJO Global", + /* 0503 */ "Gelliner Limited", + /* 0504 */ "Anyka (Guangzhou) Microelectronics Technology Co, LTD", + /* 0505 */ "Medtronic Inc.", + /* 0506 */ "Gozio Inc.", + /* 0507 */ "Form Lifting, LLC", + /* 0508 */ "Wahoo Fitness, LLC", + /* 0509 */ "Kontakt Micro-Location Sp. z o.o.", + /* 0510 */ "Radio Systems Corporation", + /* 0511 */ "Freescale Semiconductor, Inc.", + /* 0512 */ "Verifone Systems Pte Ltd. Taiwan Branch", + /* 0513 */ "AR Timing", + /* 0514 */ "Rigado LLC", + /* 0515 */ "Kemppi Oy", + /* 0516 */ "Tapcentive Inc.", + /* 0517 */ "Smartbotics Inc.", + /* 0518 */ "Otter Products, LLC", + /* 0519 */ "STEMP Inc.", + /* 0520 */ "LumiGeek LLC", + /* 0521 */ "InvisionHeart Inc.", + /* 0522 */ "Macnica Inc.", + /* 0523 */ "Jaguar Land Rover Limited", + /* 0524 */ "CoroWare Technologies, Inc", + /* 0525 */ "Simplo Technology Co., LTD", + /* 0526 */ "Omron Healthcare Co., LTD", + /* 0527 */ "Comodule GMBH", + /* 0528 */ "ikeGPS", + /* 0529 */ "Telink Semiconductor Co. Ltd", + /* 0530 */ "Interplan Co., Ltd", + /* 0531 */ "Wyler AG", + /* 0532 */ "IK Multimedia Production srl", + /* 0533 */ "Lukoton Experience Oy", + /* 0534 */ "MTI Ltd", + /* 0535 */ "Tech4home, Lda", + /* 0536 */ "Hiotech AB", + /* 0537 */ "DOTT Limited", + /* 0538 */ "Blue Speck Labs, LLC", + /* 0539 */ "Cisco Systems, Inc", + /* 0540 */ "Mobicomm Inc", + /* 0541 */ "Edamic", + /* 0542 */ "Goodnet, Ltd", + /* 0543 */ "Luster Leaf Products Inc", + /* 0544 */ "Manus Machina BV", + /* 0545 */ "Mobiquity Networks Inc", + /* 0546 */ "Praxis Dynamics", + /* 0547 */ "Philip Morris Products S.A.", + /* 0548 */ "Comarch SA", + /* 0549 */ "Nestlé Nespresso S.A.", + /* 0550 */ "Merlinia A/S", + /* 0551 */ "LifeBEAM Technologies", + /* 0552 */ "Twocanoes Labs, LLC", + /* 0553 */ "Muoverti Limited", + /* 0554 */ "Stamer Musikanlagen GMBH", + /* 0555 */ "Tesla Motors", + /* 0556 */ "Pharynks Corporation", + /* 0557 */ "Lupine", + /* 0558 */ "Siemens AG", + /* 0559 */ "Huami (Shanghai) Culture Communication CO., LTD", + /* 0560 */ "Foster Electric Company, Ltd", + /* 0561 */ "ETA SA", + /* 0562 */ "x-Senso Solutions Kft", + /* 0563 */ "Shenzhen SuLong Communication Ltd", + /* 0564 */ "FengFan (BeiJing) Technology Co, Ltd", + /* 0565 */ "Qrio Inc", + /* 0566 */ "Pitpatpet Ltd", + /* 0567 */ "MSHeli s.r.l.", + /* 0568 */ "Trakm8 Ltd", + /* 0569 */ "JIN CO, Ltd", + /* 0570 */ "Alatech Tehnology", + /* 0571 */ "Beijing CarePulse Electronic Technology Co, Ltd", + /* 0572 */ "Awarepoint", + /* 0573 */ "ViCentra B.V.", + /* 0574 */ "Raven Industries", + /* 0575 */ "WaveWare Technologies Inc.", + /* 0576 */ "Argenox Technologies", + /* 0577 */ "Bragi GmbH", + /* 0578 */ "16Lab Inc", + /* 0579 */ "Masimo Corp", + /* 0580 */ "Iotera Inc", + /* 0581 */ "Endress+Hauser", + /* 0582 */ "ACKme Networks, Inc.", + /* 0583 */ "FiftyThree Inc.", + /* 0584 */ "Parker Hannifin Corp", + /* 0585 */ "Transcranial Ltd", + /* 0586 */ "Uwatec AG", + /* 0587 */ "Orlan LLC", + /* 0588 */ "Blue Clover Devices", + /* 0589 */ "M-Way Solutions GmbH", + /* 0590 */ "Microtronics Engineering GmbH", + /* 0591 */ "Schneider Schreibgeräte GmbH", + /* 0592 */ "Sapphire Circuits LLC", + /* 0593 */ "Lumo Bodytech Inc.", + /* 0594 */ "UKC Technosolution", + /* 0595 */ "Xicato Inc.", + /* 0596 */ "Playbrush", + /* 0597 */ "Dai Nippon Printing Co., Ltd.", + /* 0598 */ "G24 Power Limited", + /* 0599 */ "AdBabble Local Commerce Inc.", + /* 0600 */ "Devialet SA", + /* 0601 */ "ALTYOR", + /* 0602 */ "University of Applied Sciences Valais/Haute Ecole Valaisanne", + /* 0603 */ "Five Interactive, LLC dba Zendo", + /* 0604 */ "NetEase (Hangzhou) Network co.Ltd.", + /* 0605 */ "Lexmark International Inc.", + /* 0606 */ "Fluke Corporation", + /* 0607 */ "Yardarm Technologies", + /* 0608 */ "SensaRx", + /* 0609 */ "SECVRE GmbH", + /* 0610 */ "Glacial Ridge Technologies", + /* 0611 */ "Identiv, Inc.", + /* 0612 */ "DDS, Inc.", + /* 0613 */ "SMK Corporation", + /* 0614 */ "Schawbel Technologies LLC", + /* 0615 */ "XMI Systems SA", + /* 0616 */ "Cerevo", + /* 0617 */ "Torrox GmbH & Co KG", + /* 0618 */ "Gemalto", + /* 0619 */ "DEKA Research & Development Corp.", + /* 0620 */ "Domster Tadeusz Szydlowski", + /* 0621 */ "Technogym SPA", + /* 0622 */ "FLEURBAEY BVBA", + /* 0623 */ "Aptcode Solutions", + /* 0624 */ "LSI ADL Technology", + /* 0625 */ "Animas Corp", + /* 0626 */ "Alps Electric Co., Ltd.", + /* 0627 */ "OCEASOFT", + /* 0628 */ "Motsai Research", + /* 0629 */ "Geotab", + /* 0630 */ "E.G.O. Elektro-Geraetebau GmbH", + /* 0631 */ "bewhere inc", + /* 0632 */ "Johnson Outdoors Inc", + /* 0633 */ "steute Schaltgerate GmbH & Co. KG", + /* 0634 */ "Ekomini inc.", + /* 0635 */ "DEFA AS", + /* 0636 */ "Aseptika Ltd", + /* 0637 */ "HUAWEI Technologies Co., Ltd.", + /* 0638 */ "HabitAware, LLC", + /* 0639 */ "ruwido austria gmbh", + /* 0640 */ "ITEC corporation", + /* 0641 */ "StoneL", + /* 0642 */ "Sonova AG", + /* 0643 */ "Maven Machines, Inc.", + /* 0644 */ "Synapse Electronics", + /* 0645 */ "Standard Innovation Inc.", + /* 0646 */ "RF Code, Inc.", + /* 0647 */ "Wally Ventures S.L.", + /* 0648 */ "Willowbank Electronics Ltd", + /* 0649 */ "SK Telecom", + /* 0650 */ "Jetro AS", + /* 0651 */ "Code Gears LTD", + /* 0652 */ "NANOLINK APS", + /* 0653 */ "IF, LLC", + /* 0654 */ "RF Digital Corp", + /* 0655 */ "Church & Dwight Co., Inc", + /* 0656 */ "Multibit Oy", + /* 0657 */ "CliniCloud Inc", + /* 0658 */ "SwiftSensors", + /* 0659 */ "Blue Bite", + /* 0660 */ "ELIAS GmbH", + /* 0661 */ "Sivantos GmbH", + /* 0662 */ "Petzl", + /* 0663 */ "storm power ltd", + /* 0664 */ "EISST Ltd", + /* 0665 */ "Inexess Technology Simma KG", + /* 0666 */ "Currant, Inc.", + /* 0667 */ "C2 Development, Inc.", + /* 0668 */ "Blue Sky Scientific, LLC", + /* 0669 */ "ALOTTAZS LABS, LLC", + /* 0670 */ "Kupson spol. s r.o.", + /* 0671 */ "Areus Engineering GmbH", + /* 0672 */ "Impossible Camera GmbH", + /* 0673 */ "InventureTrack Systems", + /* 0674 */ "LockedUp", + /* 0675 */ "Itude", + /* 0676 */ "Pacific Lock Company", + /* 0677 */ "Tendyron Corporation", + /* 0678 */ "Robert Bosch GmbH", + /* 0679 */ "Illuxtron international B.V.", + /* 0680 */ "miSport Ltd.", + /* 0681 */ "Chargelib", + /* 0682 */ "Doppler Lab", + /* 0683 */ "BBPOS Limited", + /* 0684 */ "RTB Elektronik GmbH & Co. KG", + /* 0685 */ "Rx Networks, Inc.", + /* 0686 */ "WeatherFlow, Inc.", + /* 0687 */ "Technicolor USA Inc.", + /* 0688 */ "Bestechnic(Shanghai),Ltd", + /* 0689 */ "Raden Inc", + /* 0690 */ "JouZen Oy", + /* 0691 */ "CLABER S.P.A.", + /* 0692 */ "Hyginex, Inc.", + /* 0693 */ "HANSHIN ELECTRIC RAILWAY CO.,LTD.", + /* 0694 */ "Schneider Electric", + /* 0695 */ "Oort Technologies LLC", + /* 0696 */ "Chrono Therapeutics", + /* 0697 */ "Rinnai Corporation", + /* 0698 */ "Swissprime Technologies AG", + /* 0699 */ "Koha.,Co.Ltd", + /* 0700 */ "Genevac Ltd", + /* 0701 */ "Chemtronics", + /* 0702 */ "Seguro Technology Sp. z o.o.", + /* 0703 */ "Redbird Flight Simulations", + /* 0704 */ "Dash Robotics", + /* 0705 */ "LINE Corporation", + /* 0706 */ "Guillemot Corporation", + /* 0707 */ "Techtronic Power Tools Technology Limited", + /* 0708 */ "Wilson Sporting Goods", + /* 0709 */ "Lenovo (Singapore) Pte Ltd.", + /* 0710 */ "Ayatan Sensors", + /* 0711 */ "Electronics Tomorrow Limited", + /* 0712 */ "VASCO Data Security International, Inc.", + /* 0713 */ "PayRange Inc.", + /* 0714 */ "ABOV Semiconductor", + /* 0715 */ "AINA-Wireless Inc.", + /* 0716 */ "Eijkelkamp Soil & Water", + /* 0717 */ "BMA ergonomics b.v.", + /* 0718 */ "Teva Branded Pharmaceutical Products R&D, Inc.", + /* 0719 */ "Anima", + /* 0720 */ "3M", + /* 0721 */ "Empatica Srl", + /* 0722 */ "Afero, Inc.", + /* 0723 */ "Powercast Corporation", + /* 0724 */ "Secuyou ApS", + /* 0725 */ "OMRON Corporation", + /* 0726 */ "Send Solutions", + /* 0727 */ "NIPPON SYSTEMWARE CO.,LTD.", + /* 0728 */ "Neosfar", + /* 0729 */ "Fliegl Agrartechnik GmbH", + /* 0730 */ "Gilvader", + /* 0731 */ "Digi International Inc (R)", + /* 0732 */ "DeWalch Technologies, Inc.", + /* 0733 */ "Flint Rehabilitation Devices, LLC", + /* 0734 */ "Samsung SDS Co., Ltd.", + /* 0735 */ "Blur Product Development", + /* 0736 */ "University of Michigan", + /* 0737 */ "Victron Energy BV", + /* 0738 */ "NTT docomo", + /* 0739 */ "Carmanah Technologies Corp.", + /* 0740 */ "Bytestorm Ltd.", + /* 0741 */ "Espressif Incorporated", + /* 0742 */ "Unwire", + /* 0743 */ "Connected Yard, Inc.", + /* 0744 */ "American Music Environments", + /* 0745 */ "Sensogram Technologies, Inc.", + /* 0746 */ "Fujitsu Limited", + /* 0747 */ "Ardic Technology", + /* 0748 */ "Delta Systems, Inc", + /* 0749 */ "HTC Corporation", + /* 0750 */ "Citizen Holdings Co., Ltd.", + /* 0751 */ "SMART-INNOVATION.inc", + /* 0752 */ "Blackrat Software", + /* 0753 */ "The Idea Cave, LLC", + /* 0754 */ "GoPro, Inc.", + /* 0755 */ "AuthAir, Inc", + /* 0756 */ "Vensi, Inc.", + /* 0757 */ "Indagem Tech LLC", + /* 0758 */ "Intemo Technologies", + /* 0759 */ "DreamVisions co., Ltd.", + /* 0760 */ "Runteq Oy Ltd", + /* 0761 */ "IMAGINATION TECHNOLOGIES LTD", + /* 0762 */ "CoSTAR TEchnologies", + /* 0763 */ "Clarius Mobile Health Corp.", + /* 0764 */ "Shanghai Frequen Microelectronics Co., Ltd.", + /* 0765 */ "Uwanna, Inc.", + /* 0766 */ "Lierda Science & Technology Group Co., Ltd.", + /* 0767 */ "Silicon Laboratories", + /* 0768 */ "World Moto Inc.", + /* 0769 */ "Giatec Scientific Inc.", + /* 0770 */ "Loop Devices, Inc", + /* 0771 */ "IACA electronique", + /* 0772 */ "Proxy Technologies, Inc.", + /* 0773 */ "Swipp ApS", + /* 0774 */ "Life Laboratory Inc.", + /* 0775 */ "FUJI INDUSTRIAL CO.,LTD.", + /* 0776 */ "Surefire, LLC", + /* 0777 */ "Dolby Labs", + /* 0778 */ "Ellisys", + /* 0779 */ "Magnitude Lighting Converters", + /* 0780 */ "Hilti AG", + /* 0781 */ "Devdata S.r.l.", + /* 0782 */ "Deviceworx", + /* 0783 */ "Shortcut Labs", + /* 0784 */ "SGL Italia S.r.l.", + /* 0785 */ "PEEQ DATA", + /* 0786 */ "Ducere Technologies Pvt Ltd", + /* 0787 */ "DiveNav, Inc.", + /* 0788 */ "RIIG AI Sp. z o.o.", + /* 0789 */ "Thermo Fisher Scientific", + /* 0790 */ "AG Measurematics Pvt. Ltd.", + /* 0791 */ "CHUO Electronics CO., LTD.", + /* 0792 */ "Aspenta International", + /* 0793 */ "Eugster Frismag AG", + /* 0794 */ "Amber wireless GmbH", + /* 0795 */ "HQ Inc", + /* 0796 */ "Lab Sensor Solutions", + /* 0797 */ "Enterlab ApS", + /* 0798 */ "Eyefi, Inc.", + /* 0799 */ "MetaSystem S.p.A.", + /* 0800 */ "SONO ELECTRONICS. CO., LTD", + /* 0801 */ "Jewelbots", + /* 0802 */ "Compumedics Limited", + /* 0803 */ "Rotor Bike Components", + /* 0804 */ "Astro, Inc.", + /* 0805 */ "Amotus Solutions", + /* 0806 */ "Healthwear Technologies (Changzhou)Ltd", + /* 0807 */ "Essex Electronics", + /* 0808 */ "Grundfos A/S", + /* 0809 */ "Eargo, Inc.", + /* 0810 */ "Electronic Design Lab", + /* 0811 */ "ESYLUX", + /* 0812 */ "NIPPON SMT.CO.,Ltd", + /* 0813 */ "BM innovations GmbH", + /* 0814 */ "indoormap", + /* 0815 */ "OttoQ Inc", + /* 0816 */ "North Pole Engineering", + /* 0817 */ "3flares Technologies Inc.", + /* 0818 */ "Electrocompaniet A.S.", + /* 0819 */ "Mul-T-Lock", + /* 0820 */ "Corentium AS", + /* 0821 */ "Enlighted Inc", + /* 0822 */ "GISTIC", + /* 0823 */ "AJP2 Holdings, LLC", + /* 0824 */ "COBI GmbH", + /* 0825 */ "Blue Sky Scientific, LLC", + /* 0826 */ "Appception, Inc.", + /* 0827 */ "Courtney Thorne Limited", + /* 0828 */ "Virtuosys", + /* 0829 */ "TPV Technology Limited", + /* 0830 */ "Monitra SA", + /* 0831 */ "Automation Components, Inc.", + /* 0832 */ "Letsense s.r.l.", + /* 0833 */ "Etesian Technologies LLC", + /* 0834 */ "GERTEC BRASIL LTDA.", + /* 0835 */ "Drekker Development Pty. Ltd.", + /* 0836 */ "Whirl Inc", + /* 0837 */ "Locus Positioning", + /* 0838 */ "Acuity Brands Lighting, Inc", + /* 0839 */ "Prevent Biometrics", + /* 0840 */ "Arioneo", + /* 0841 */ "VersaMe", + /* 0842 */ "Vaddio", + /* 0843 */ "Libratone A/S", + /* 0844 */ "HM Electronics, Inc.", + /* 0845 */ "TASER International, Inc.", + /* 0846 */ "SafeTrust Inc.", + /* 0847 */ "Heartland Payment Systems", + /* 0848 */ "Bitstrata Systems Inc.", + /* 0849 */ "Pieps GmbH", + /* 0850 */ "iRiding(Xiamen)Technology Co.,Ltd.", + /* 0851 */ "Alpha Audiotronics, Inc.", + /* 0852 */ "TOPPAN FORMS CO.,LTD.", + /* 0853 */ "Sigma Designs, Inc.", + /* 0854 */ "Spectrum Brands, Inc.", + /* 0855 */ "Polymap Wireless", + /* 0856 */ "MagniWare Ltd.", + /* 0857 */ "Novotec Medical GmbH", + /* 0858 */ "Medicom Innovation Partner a/s", + /* 0859 */ "Matrix Inc.", + /* 0860 */ "Eaton Corporation", + /* 0861 */ "KYS", + /* 0862 */ "Naya Health, Inc.", + /* 0863 */ "Acromag", + /* 0864 */ "Insulet Corporation", + /* 0865 */ "Wellinks Inc.", + /* 0866 */ "ON Semiconductor", + /* 0867 */ "FREELAP SA", + /* 0868 */ "Favero Electronics Srl", + /* 0869 */ "BioMech Sensor LLC", + /* 0870 */ "BOLTT Sports technologies Private limited", + /* 0871 */ "Saphe International", + /* 0872 */ "Metormote AB", + /* 0873 */ "littleBits", + /* 0874 */ "SetPoint Medical", + /* 0875 */ "BRControls Products BV", + /* 0876 */ "Zipcar", + /* 0877 */ "AirBolt Pty Ltd", + /* 0878 */ "KeepTruckin Inc", + /* 0879 */ "Motiv, Inc.", + /* 0880 */ "Wazombi Labs OU", + /* 0881 */ "ORBCOMM", + /* 0882 */ "Nixie Labs, Inc.", + /* 0883 */ "AppNearMe Ltd", + /* 0884 */ "Holman Industries", + /* 0885 */ "Expain AS", + /* 0886 */ "Electronic Temperature Instruments Ltd", + /* 0887 */ "Plejd AB", + /* 0888 */ "Propeller Health", + /* 0889 */ "Shenzhen iMCO Electronic Technology Co.,Ltd", + /* 0890 */ "Algoria", + /* 0891 */ "Apption Labs Inc.", + /* 0892 */ "Cronologics Corporation", + /* 0893 */ "MICRODIA Ltd.", + /* 0894 */ "lulabytes S.L.", + /* 0895 */ "Societe des Produits Nestle S.A. (formerly Nestec S.A.)", + /* 0896 */ "LLC \"MEGA-F service\"", + /* 0897 */ "Sharp Corporation", + /* 0898 */ "Precision Outcomes Ltd", + /* 0899 */ "Kronos Incorporated", + /* 0900 */ "OCOSMOS Co., Ltd.", + /* 0901 */ "Embedded Electronic Solutions Ltd. dba e2Solutions", + /* 0902 */ "Aterica Inc.", + /* 0903 */ "BluStor PMC, Inc.", + /* 0904 */ "Kapsch TrafficCom AB", + /* 0905 */ "ActiveBlu Corporation", + /* 0906 */ "Kohler Mira Limited", + /* 0907 */ "Noke", + /* 0908 */ "Appion Inc.", + /* 0909 */ "Resmed Ltd", + /* 0910 */ "Crownstone B.V.", + /* 0911 */ "Xiaomi Inc.", + /* 0912 */ "INFOTECH s.r.o.", + /* 0913 */ "Thingsquare AB", + /* 0914 */ "T&D", + /* 0915 */ "LAVAZZA S.p.A.", + /* 0916 */ "Netclearance Systems, Inc.", + /* 0917 */ "SDATAWAY", + /* 0918 */ "BLOKS GmbH", + /* 0919 */ "LEGO System A/S", + /* 0920 */ "Thetatronics Ltd", + /* 0921 */ "Nikon Corporation", + /* 0922 */ "NeST", + /* 0923 */ "South Silicon Valley Microelectronics", + /* 0924 */ "ALE International", + /* 0925 */ "CareView Communications, Inc.", + /* 0926 */ "SchoolBoard Limited", + /* 0927 */ "Molex Corporation", + /* 0928 */ "IVT Wireless Limited", + /* 0929 */ "Alpine Labs LLC", + /* 0930 */ "Candura Instruments", + /* 0931 */ "SmartMovt Technology Co., Ltd", + /* 0932 */ "Token Zero Ltd", + /* 0933 */ "ACE CAD Enterprise Co., Ltd. (ACECAD)", + /* 0934 */ "Medela, Inc", + /* 0935 */ "AeroScout", + /* 0936 */ "Esrille Inc.", + /* 0937 */ "THINKERLY SRL", + /* 0938 */ "Exon Sp. z o.o.", + /* 0939 */ "Meizu Technology Co., Ltd.", + /* 0940 */ "Smablo LTD", + /* 0941 */ "XiQ", + /* 0942 */ "Allswell Inc.", + /* 0943 */ "Comm-N-Sense Corp DBA Verigo", + /* 0944 */ "VIBRADORM GmbH", + /* 0945 */ "Otodata Wireless Network Inc.", + /* 0946 */ "Propagation Systems Limited", + /* 0947 */ "Midwest Instruments & Controls", + /* 0948 */ "Alpha Nodus, inc.", + /* 0949 */ "petPOMM, Inc", + /* 0950 */ "Mattel", + /* 0951 */ "Airbly Inc.", + /* 0952 */ "A-Safe Limited", + /* 0953 */ "FREDERIQUE CONSTANT SA", + /* 0954 */ "Maxscend Microelectronics Company Limited", + /* 0955 */ "Abbott", + /* 0956 */ "ASB Bank Ltd", + /* 0957 */ "amadas", + /* 0958 */ "Applied Science, Inc.", + /* 0959 */ "iLumi Solutions Inc.", + /* 0960 */ "Arch Systems Inc.", + /* 0961 */ "Ember Technologies, Inc.", + /* 0962 */ "Snapchat Inc", + /* 0963 */ "Casambi Technologies Oy", + /* 0964 */ "Pico Technology Inc.", + /* 0965 */ "St. Jude Medical, Inc.", + /* 0966 */ "Intricon", + /* 0967 */ "Structural Health Systems, Inc.", + /* 0968 */ "Avvel International", + /* 0969 */ "Gallagher Group", + /* 0970 */ "In2things Automation Pvt. Ltd.", + /* 0971 */ "SYSDEV Srl", + /* 0972 */ "Vonkil Technologies Ltd", + /* 0973 */ "Wynd Technologies, Inc.", + /* 0974 */ "CONTRINEX S.A.", + /* 0975 */ "MIRA, Inc.", + /* 0976 */ "Watteam Ltd", + /* 0977 */ "Density Inc.", + /* 0978 */ "IOT Pot India Private Limited", + /* 0979 */ "Sigma Connectivity AB", *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon May 18 09:00: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 A588513B7E4; Mon, 18 May 2020 09:00: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 49QXzf4H3Tz4RF3; Mon, 18 May 2020 09:00: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 8DE191F112; Mon, 18 May 2020 09:00: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 04I90kUW045632; Mon, 18 May 2020 09:00:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I90j2X045629; Mon, 18 May 2020 09:00:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180900.04I90j2X045629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:00: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: r361168 - stable/12/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361168 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, 18 May 2020 09:00:46 -0000 Author: hselasky Date: Mon May 18 09:00:45 2020 New Revision: 361168 URL: https://svnweb.freebsd.org/changeset/base/361168 Log: MFC r360197: Add support for Read_Local_Supported_Commands command to hccontrol(8). Submitted by: Marc Veldman PR: 245811 Sponsored by: Mellanox Technologies Modified: stable/12/usr.sbin/bluetooth/hccontrol/hccontrol.8 stable/12/usr.sbin/bluetooth/hccontrol/hccontrol.h stable/12/usr.sbin/bluetooth/hccontrol/info.c stable/12/usr.sbin/bluetooth/hccontrol/util.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bluetooth/hccontrol/hccontrol.8 ============================================================================== --- stable/12/usr.sbin/bluetooth/hccontrol/hccontrol.8 Mon May 18 08:59:14 2020 (r361167) +++ stable/12/usr.sbin/bluetooth/hccontrol/hccontrol.8 Mon May 18 09:00:45 2020 (r361168) @@ -134,6 +134,7 @@ are: .It Cm Read_Page_Scan_Mode .It Cm Write_Page_Scan_Mode .It Cm Read_Local_Version_Information +.It Cm Read_Local_Supported_Commands .It Cm Read_Local_Supported_Features .It Cm Read_Buffer_Size .It Cm Read_Country_Code Modified: stable/12/usr.sbin/bluetooth/hccontrol/hccontrol.h ============================================================================== --- stable/12/usr.sbin/bluetooth/hccontrol/hccontrol.h Mon May 18 08:59:14 2020 (r361167) +++ stable/12/usr.sbin/bluetooth/hccontrol/hccontrol.h Mon May 18 09:00:45 2020 (r361168) @@ -72,6 +72,7 @@ char const * hci_hmode2str (int, char *, int); char const * hci_ver2str (int); char const * hci_lmpver2str (int); char const * hci_manufacturer2str(int); +char const * hci_commands2str (uint8_t *, char *, int); char const * hci_features2str (uint8_t *, char *, int); char const * hci_le_features2str (uint8_t *, char *, int); char const * hci_cc2str (int); Modified: stable/12/usr.sbin/bluetooth/hccontrol/info.c ============================================================================== --- stable/12/usr.sbin/bluetooth/hccontrol/info.c Mon May 18 08:59:14 2020 (r361167) +++ stable/12/usr.sbin/bluetooth/hccontrol/info.c Mon May 18 09:00:45 2020 (r361168) @@ -72,6 +72,38 @@ hci_read_local_version_information(int s, int argc, ch return (OK); } /* hci_read_local_version_information */ +/* Send Read_Local_Supported_Commands command to the unit */ +static int +hci_read_local_supported_commands(int s, int argc, char **argv) +{ + ng_hci_read_local_commands_rp rp; + int n; + char buffer[16384]; + + n = sizeof(rp); + if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_INFO, + NG_HCI_OCF_READ_LOCAL_COMMANDS), + (char *) &rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + fprintf(stdout, "Supported commands:"); + for (n = 0; n < sizeof(rp.features); n++) { + if (n % 8 == 0) + fprintf(stdout, "\n"); + fprintf(stdout, "%#02x ", rp.features[n]); + } + fprintf(stdout, "\n%s\n", hci_commands2str(rp.features, + buffer, sizeof(buffer))); + + return (OK); +} /* hci_read_local_supported_commands */ + /* Send Read_Local_Supported_Features command to the unit */ static int hci_read_local_supported_features(int s, int argc, char **argv) @@ -186,6 +218,11 @@ struct hci_command info_commands[] = { "\nThis command will read the values for the version information for the\n" \ "local Bluetooth unit.", &hci_read_local_version_information +}, +{ +"read_local_supported_commands", +"\nThis command will read the commands the local Bluetooth unit supports.\n", +&hci_read_local_supported_commands }, { "read_local_supported_features", Modified: stable/12/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- stable/12/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:59:14 2020 (r361167) +++ stable/12/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 09:00:45 2020 (r361168) @@ -2430,6 +2430,501 @@ hci_manufacturer2str(int m) } /* hci_manufacturer2str */ char const * +hci_commands2str(uint8_t *commands, char *buffer, int size) +{ + static char const * const t[][8] = { + { /* byte 0 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 1 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 2 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 3 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 4 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 5 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 6 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 7 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 8 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 9 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 10 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 11 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 12 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 13 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 14 */ + /* 0 */ " ", + /* 1 */ "", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 15 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 16 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 17 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 18 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 19 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 20 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 21 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 22 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 23 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 24 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 25 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 26 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 27 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 28 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 29 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 30 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 31 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 32 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 33 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 34 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 35 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 36 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 37 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 38 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 39 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 40 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 41 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 42 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 43 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 44 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 45 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }}; + + if (buffer != NULL && size > 0) { + int n, i, len0, len1; + + memset(buffer, 0, size); + size--; + + + for (n = 0; n < SIZE(t); n++) { + for (i = 0; i < SIZE(t[n]); i++) { + len0 = strlen(buffer); + if (len0 >= size) + goto done; + + if (commands[n] & (1 << i)) { + if (len1 + strlen(t[n][i]) > 60) { + len1 = 0; + buffer[len0 - 1] = '\n'; + } + + len1 += strlen(t[n][i]); + strncat(buffer, t[n][i], size - len0); + } + + } + } + } +done: + return (buffer); +} /* hci_commands2str */ + +char const * hci_features2str(uint8_t *features, char *buffer, int size) { static char const * const t[][8] = { From owner-svn-src-all@freebsd.org Mon May 18 09:01: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 DA0BC13BD5B; Mon, 18 May 2020 09:01:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QY0H5sdKz4RQk; Mon, 18 May 2020 09:01:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C49BC1ED76; Mon, 18 May 2020 09:01:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I91JQ9049615; Mon, 18 May 2020 09:01:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I91JjZ048783; Mon, 18 May 2020 09:01:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180901.04I91JjZ048783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:01:19 +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: r361169 - stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361169 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, 18 May 2020 09:01:19 -0000 Author: hselasky Date: Mon May 18 09:01:18 2020 New Revision: 361169 URL: https://svnweb.freebsd.org/changeset/base/361169 Log: MFC r360197: Add support for Read_Local_Supported_Commands command to hccontrol(8). Submitted by: Marc Veldman PR: 245811 Sponsored by: Mellanox Technologies Modified: stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.8 stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.h stable/11/usr.sbin/bluetooth/hccontrol/info.c stable/11/usr.sbin/bluetooth/hccontrol/util.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.8 ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.8 Mon May 18 09:00:45 2020 (r361168) +++ stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.8 Mon May 18 09:01:18 2020 (r361169) @@ -134,6 +134,7 @@ are: .It Cm Read_Page_Scan_Mode .It Cm Write_Page_Scan_Mode .It Cm Read_Local_Version_Information +.It Cm Read_Local_Supported_Commands .It Cm Read_Local_Supported_Features .It Cm Read_Buffer_Size .It Cm Read_Country_Code Modified: stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.h ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.h Mon May 18 09:00:45 2020 (r361168) +++ stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.h Mon May 18 09:01:18 2020 (r361169) @@ -72,6 +72,7 @@ char const * hci_hmode2str (int, char *, int); char const * hci_ver2str (int); char const * hci_lmpver2str (int); char const * hci_manufacturer2str(int); +char const * hci_commands2str (uint8_t *, char *, int); char const * hci_features2str (uint8_t *, char *, int); char const * hci_le_features2str (uint8_t *, char *, int); char const * hci_cc2str (int); Modified: stable/11/usr.sbin/bluetooth/hccontrol/info.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/info.c Mon May 18 09:00:45 2020 (r361168) +++ stable/11/usr.sbin/bluetooth/hccontrol/info.c Mon May 18 09:01:18 2020 (r361169) @@ -72,6 +72,38 @@ hci_read_local_version_information(int s, int argc, ch return (OK); } /* hci_read_local_version_information */ +/* Send Read_Local_Supported_Commands command to the unit */ +static int +hci_read_local_supported_commands(int s, int argc, char **argv) +{ + ng_hci_read_local_commands_rp rp; + int n; + char buffer[16384]; + + n = sizeof(rp); + if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_INFO, + NG_HCI_OCF_READ_LOCAL_COMMANDS), + (char *) &rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + fprintf(stdout, "Supported commands:"); + for (n = 0; n < sizeof(rp.features); n++) { + if (n % 8 == 0) + fprintf(stdout, "\n"); + fprintf(stdout, "%#02x ", rp.features[n]); + } + fprintf(stdout, "\n%s\n", hci_commands2str(rp.features, + buffer, sizeof(buffer))); + + return (OK); +} /* hci_read_local_supported_commands */ + /* Send Read_Local_Supported_Features command to the unit */ static int hci_read_local_supported_features(int s, int argc, char **argv) @@ -186,6 +218,11 @@ struct hci_command info_commands[] = { "\nThis command will read the values for the version information for the\n" \ "local Bluetooth unit.", &hci_read_local_version_information +}, +{ +"read_local_supported_commands", +"\nThis command will read the commands the local Bluetooth unit supports.\n", +&hci_read_local_supported_commands }, { "read_local_supported_features", Modified: stable/11/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 09:00:45 2020 (r361168) +++ stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 09:01:18 2020 (r361169) @@ -2430,6 +2430,501 @@ hci_manufacturer2str(int m) } /* hci_manufacturer2str */ char const * +hci_commands2str(uint8_t *commands, char *buffer, int size) +{ + static char const * const t[][8] = { + { /* byte 0 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 1 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 2 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 3 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 4 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 5 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 6 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 7 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 8 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 9 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 10 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 11 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 12 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 13 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 14 */ + /* 0 */ " ", + /* 1 */ "", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 15 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 16 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 17 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 18 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 19 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 20 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 21 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 22 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 23 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 24 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 25 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 26 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 27 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 28 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 29 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 30 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 31 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 32 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 33 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 34 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 35 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 36 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 37 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 38 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 39 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 40 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 41 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 42 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 43 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 44 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 45 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }}; + + if (buffer != NULL && size > 0) { + int n, i, len0, len1; + + memset(buffer, 0, size); + size--; + + + for (n = 0; n < SIZE(t); n++) { + for (i = 0; i < SIZE(t[n]); i++) { + len0 = strlen(buffer); + if (len0 >= size) + goto done; + + if (commands[n] & (1 << i)) { + if (len1 + strlen(t[n][i]) > 60) { + len1 = 0; + buffer[len0 - 1] = '\n'; + } + + len1 += strlen(t[n][i]); + strncat(buffer, t[n][i], size - len0); + } + + } + } + } +done: + return (buffer); +} /* hci_commands2str */ + +char const * hci_features2str(uint8_t *features, char *buffer, int size) { static char const * const t[][8] = { From owner-svn-src-all@freebsd.org Mon May 18 09:03: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 1F9B413BC17; Mon, 18 May 2020 09:03:14 +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 49QY2V00vLz4RgB; Mon, 18 May 2020 09:03:14 +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 EF5771EFE2; Mon, 18 May 2020 09:03:13 +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 04I93DCR050593; Mon, 18 May 2020 09:03:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I93Dml050589; Mon, 18 May 2020 09:03:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180903.04I93Dml050589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:03: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: r361170 - in stable/12/sys/dev/mlx5: . mlx5_en X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys/dev/mlx5: . mlx5_en X-SVN-Commit-Revision: 361170 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, 18 May 2020 09:03:14 -0000 Author: hselasky Date: Mon May 18 09:03:12 2020 New Revision: 361170 URL: https://svnweb.freebsd.org/changeset/base/361170 Log: MFC r360377: Add support for reading temperature in mlx5en(4). Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/mlx5/mlx5_en/en.h stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/12/sys/dev/mlx5/mlx5_ifc.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_en/en.h Mon May 18 09:01:18 2020 (r361169) +++ stable/12/sys/dev/mlx5/mlx5_en/en.h Mon May 18 09:03:12 2020 (r361170) @@ -724,6 +724,8 @@ struct mlx5e_params_ethtool { u8 fec_avail_10x_25x[MLX5E_MAX_FEC_10X_25X]; u16 fec_avail_50x[MLX5E_MAX_FEC_50X]; u32 fec_mode_active; + s32 hw_val_temp[MLX5_MAX_TEMPERATURE]; + u32 hw_num_temp; }; struct mlx5e_cq { @@ -1187,5 +1189,6 @@ void mlx5e_update_sq_inline(struct mlx5e_sq *sq); void mlx5e_refresh_sq_inline(struct mlx5e_priv *priv); int mlx5e_update_buf_lossy(struct mlx5e_priv *priv); int mlx5e_fec_update(struct mlx5e_priv *priv); +int mlx5e_hw_temperature_update(struct mlx5e_priv *priv); #endif /* _MLX5_EN_H_ */ Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon May 18 09:01:18 2020 (r361169) +++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon May 18 09:03:12 2020 (r361170) @@ -801,6 +801,65 @@ mlx5e_cable_length_handler(SYSCTL_HANDLER_ARGS) return (error); } +static int +mlx5e_hw_temperature_handler(SYSCTL_HANDLER_ARGS) +{ + struct mlx5e_priv *priv = arg1; + int err; + + PRIV_LOCK(priv); + err = SYSCTL_OUT(req, priv->params_ethtool.hw_val_temp, + sizeof(priv->params_ethtool.hw_val_temp[0]) * + priv->params_ethtool.hw_num_temp); + if (err == 0 && req->newptr != NULL) + err = EOPNOTSUPP; + PRIV_UNLOCK(priv); + return (err); +} + +int +mlx5e_hw_temperature_update(struct mlx5e_priv *priv) +{ + int err; + u32 x; + + if (priv->params_ethtool.hw_num_temp == 0) { + u32 out_cap[MLX5_ST_SZ_DW(mtcap)] = {}; + const int sz_cap = MLX5_ST_SZ_BYTES(mtcap); + u32 value; + + err = -mlx5_core_access_reg(priv->mdev, NULL, 0, out_cap, sz_cap, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTCAP, 0, 0); + if (err) + goto done; + value = MLX5_GET(mtcap, out_cap, sensor_count); + if (value == 0) + return (0); + if (value > MLX5_MAX_TEMPERATURE) + value = MLX5_MAX_TEMPERATURE; + /* update number of temperature sensors */ + priv->params_ethtool.hw_num_temp = value; + } + + for (x = 0; x != priv->params_ethtool.hw_num_temp; x++) { + u32 out_sensor[MLX5_ST_SZ_DW(mtmp_reg)] = {}; + const int sz_sensor = MLX5_ST_SZ_BYTES(mtmp_reg); + + MLX5_SET(mtmp_reg, out_sensor, sensor_index, x); + + err = -mlx5_core_access_reg(priv->mdev, out_sensor, sz_sensor, + out_sensor, sz_sensor, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTMP, 0, 0); + if (err) + goto done; + /* convert from 0.125 celcius to millicelcius */ + priv->params_ethtool.hw_val_temp[x] = + (s16)MLX5_GET(mtmp_reg, out_sensor, temperature) * 125; + } +done: + return (err); +} + #define MLX5_PARAM_OFFSET(n) \ __offsetof(struct mlx5e_priv, params_ethtool.n) @@ -1540,5 +1599,13 @@ mlx5e_create_ethtool(struct mlx5e_priv *priv) CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, priv, 0, mlx5e_cable_length_handler, "IU", "Set cable length in meters for xoff threshold calculation"); + } + + if (mlx5e_hw_temperature_update(priv) == 0) { + SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), + OID_AUTO, "hw_temperature", + CTLTYPE_S32 | CTLFLAG_RD | CTLFLAG_MPSAFE, + priv, 0, mlx5e_hw_temperature_handler, "I", + "HW temperature in millicelcius"); } } Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon May 18 09:01:18 2020 (r361169) +++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon May 18 09:03:12 2020 (r361170) @@ -1035,6 +1035,15 @@ free_out: mlx5_en_err(priv->ifp, "Updating FEC failed: %d\n", error); } + + /* Update temperature, if any */ + if (priv->params_ethtool.hw_num_temp != 0) { + error = mlx5e_hw_temperature_update(priv); + if (error != 0 && error != EOPNOTSUPP) { + mlx5_en_err(priv->ifp, + "Updating temperature failed: %d\n", error); + } + } } static void Modified: stable/12/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_ifc.h Mon May 18 09:01:18 2020 (r361169) +++ stable/12/sys/dev/mlx5/mlx5_ifc.h Mon May 18 09:03:12 2020 (r361170) @@ -10452,4 +10452,163 @@ struct mlx5_ifc_mfrl_reg_bits { u8 reset_level[0x8]; }; +enum { + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTCAP = 0x9009, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTECR = 0x9109, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTMP = 0x900a, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTWE = 0x900b, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTBR = 0x900f, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTEWE = 0x910b, + MLX5_MAX_TEMPERATURE = 16, +}; + +struct mlx5_ifc_mtbr_temp_record_bits { + u8 max_temperature[0x10]; + u8 temperature[0x10]; +}; + +struct mlx5_ifc_mtbr_reg_bits { + u8 reserved_at_0[0x14]; + u8 base_sensor_index[0xc]; + + u8 reserved_at_20[0x18]; + u8 num_rec[0x8]; + + u8 reserved_at_40[0x40]; + + struct mlx5_ifc_mtbr_temp_record_bits temperature_record[MLX5_MAX_TEMPERATURE]; +}; + +struct mlx5_ifc_mtbr_reg_ext_bits { + u8 reserved_at_0[0x14]; + u8 base_sensor_index[0xc]; + + u8 reserved_at_20[0x18]; + u8 num_rec[0x8]; + + u8 reserved_at_40[0x40]; + + struct mlx5_ifc_mtbr_temp_record_bits temperature_record[MLX5_MAX_TEMPERATURE]; +}; + +struct mlx5_ifc_mtcap_bits { + u8 reserved_at_0[0x19]; + u8 sensor_count[0x7]; + + u8 reserved_at_20[0x19]; + u8 internal_sensor_count[0x7]; + + u8 sensor_map[0x40]; +}; + +struct mlx5_ifc_mtcap_ext_bits { + u8 reserved_at_0[0x19]; + u8 sensor_count[0x7]; + + u8 reserved_at_20[0x20]; + + u8 sensor_map[0x40]; +}; + +struct mlx5_ifc_mtecr_bits { + u8 reserved_at_0[0x4]; + u8 last_sensor[0xc]; + u8 reserved_at_10[0x4]; + u8 sensor_count[0xc]; + + u8 reserved_at_20[0x19]; + u8 internal_sensor_count[0x7]; + + u8 sensor_map_0[0x20]; + + u8 reserved_at_60[0x2a0]; +}; + +struct mlx5_ifc_mtecr_ext_bits { + u8 reserved_at_0[0x4]; + u8 last_sensor[0xc]; + u8 reserved_at_10[0x4]; + u8 sensor_count[0xc]; + + u8 reserved_at_20[0x20]; + + u8 sensor_map_0[0x20]; + + u8 reserved_at_60[0x2a0]; +}; + +struct mlx5_ifc_mtewe_bits { + u8 reserved_at_0[0x4]; + u8 last_sensor[0xc]; + u8 reserved_at_10[0x4]; + u8 sensor_count[0xc]; + + u8 sensor_warning_0[0x20]; + + u8 reserved_at_40[0x2a0]; +}; + +struct mlx5_ifc_mtewe_ext_bits { + u8 reserved_at_0[0x4]; + u8 last_sensor[0xc]; + u8 reserved_at_10[0x4]; + u8 sensor_count[0xc]; + + u8 sensor_warning_0[0x20]; + + u8 reserved_at_40[0x2a0]; +}; + +struct mlx5_ifc_mtmp_bits { + u8 reserved_at_0[0x14]; + u8 sensor_index[0xc]; + + u8 reserved_at_20[0x10]; + u8 temperature[0x10]; + + u8 mte[0x1]; + u8 mtr[0x1]; + u8 reserved_at_42[0xe]; + u8 max_temperature[0x10]; + + u8 tee[0x2]; + u8 reserved_at_62[0xe]; + u8 temperature_threshold_hi[0x10]; + + u8 reserved_at_80[0x10]; + u8 temperature_threshold_lo[0x10]; + + u8 reserved_at_a0[0x20]; + + u8 sensor_name_hi[0x20]; + + u8 sensor_name_lo[0x20]; +}; + +struct mlx5_ifc_mtmp_ext_bits { + u8 reserved_at_0[0x14]; + u8 sensor_index[0xc]; + + u8 reserved_at_20[0x10]; + u8 temperature[0x10]; + + u8 mte[0x1]; + u8 mtr[0x1]; + u8 reserved_at_42[0xe]; + u8 max_temperature[0x10]; + + u8 tee[0x2]; + u8 reserved_at_62[0xe]; + u8 temperature_threshold_hi[0x10]; + + u8 reserved_at_80[0x10]; + u8 temperature_threshold_lo[0x10]; + + u8 reserved_at_a0[0x20]; + + u8 sensor_name_hi[0x20]; + + u8 sensor_name_lo[0x20]; +}; + #endif /* MLX5_IFC_H */ From owner-svn-src-all@freebsd.org Mon May 18 09:04: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 F1C5613BB42; Mon, 18 May 2020 09:04:25 +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 49QY3s66TXz4S7g; Mon, 18 May 2020 09:04:25 +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 CCF631F237; Mon, 18 May 2020 09:04:25 +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 04I94PLn050704; Mon, 18 May 2020 09:04:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I94P7U050701; Mon, 18 May 2020 09:04:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180904.04I94P7U050701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:04:25 +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: r361171 - in stable/11/sys/dev/mlx5: . mlx5_en X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_en X-SVN-Commit-Revision: 361171 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, 18 May 2020 09:04:26 -0000 Author: hselasky Date: Mon May 18 09:04:24 2020 New Revision: 361171 URL: https://svnweb.freebsd.org/changeset/base/361171 Log: MFC r360377: Add support for reading temperature in mlx5en(4). Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/11/sys/dev/mlx5/mlx5_ifc.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/en.h Mon May 18 09:03:12 2020 (r361170) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Mon May 18 09:04:24 2020 (r361171) @@ -723,6 +723,8 @@ struct mlx5e_params_ethtool { u8 fec_avail_10x_25x[MLX5E_MAX_FEC_10X_25X]; u16 fec_avail_50x[MLX5E_MAX_FEC_50X]; u32 fec_mode_active; + s32 hw_val_temp[MLX5_MAX_TEMPERATURE]; + u32 hw_num_temp; }; struct mlx5e_cq { @@ -1123,5 +1125,6 @@ void mlx5e_update_sq_inline(struct mlx5e_sq *sq); void mlx5e_refresh_sq_inline(struct mlx5e_priv *priv); int mlx5e_update_buf_lossy(struct mlx5e_priv *priv); int mlx5e_fec_update(struct mlx5e_priv *priv); +int mlx5e_hw_temperature_update(struct mlx5e_priv *priv); #endif /* _MLX5_EN_H_ */ Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon May 18 09:03:12 2020 (r361170) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon May 18 09:04:24 2020 (r361171) @@ -801,6 +801,65 @@ mlx5e_cable_length_handler(SYSCTL_HANDLER_ARGS) return (error); } +static int +mlx5e_hw_temperature_handler(SYSCTL_HANDLER_ARGS) +{ + struct mlx5e_priv *priv = arg1; + int err; + + PRIV_LOCK(priv); + err = SYSCTL_OUT(req, priv->params_ethtool.hw_val_temp, + sizeof(priv->params_ethtool.hw_val_temp[0]) * + priv->params_ethtool.hw_num_temp); + if (err == 0 && req->newptr != NULL) + err = EOPNOTSUPP; + PRIV_UNLOCK(priv); + return (err); +} + +int +mlx5e_hw_temperature_update(struct mlx5e_priv *priv) +{ + int err; + u32 x; + + if (priv->params_ethtool.hw_num_temp == 0) { + u32 out_cap[MLX5_ST_SZ_DW(mtcap)] = {}; + const int sz_cap = MLX5_ST_SZ_BYTES(mtcap); + u32 value; + + err = -mlx5_core_access_reg(priv->mdev, NULL, 0, out_cap, sz_cap, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTCAP, 0, 0); + if (err) + goto done; + value = MLX5_GET(mtcap, out_cap, sensor_count); + if (value == 0) + return (0); + if (value > MLX5_MAX_TEMPERATURE) + value = MLX5_MAX_TEMPERATURE; + /* update number of temperature sensors */ + priv->params_ethtool.hw_num_temp = value; + } + + for (x = 0; x != priv->params_ethtool.hw_num_temp; x++) { + u32 out_sensor[MLX5_ST_SZ_DW(mtmp_reg)] = {}; + const int sz_sensor = MLX5_ST_SZ_BYTES(mtmp_reg); + + MLX5_SET(mtmp_reg, out_sensor, sensor_index, x); + + err = -mlx5_core_access_reg(priv->mdev, out_sensor, sz_sensor, + out_sensor, sz_sensor, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTMP, 0, 0); + if (err) + goto done; + /* convert from 0.125 celcius to millicelcius */ + priv->params_ethtool.hw_val_temp[x] = + (s16)MLX5_GET(mtmp_reg, out_sensor, temperature) * 125; + } +done: + return (err); +} + #define MLX5_PARAM_OFFSET(n) \ __offsetof(struct mlx5e_priv, params_ethtool.n) @@ -1540,5 +1599,13 @@ mlx5e_create_ethtool(struct mlx5e_priv *priv) CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, priv, 0, mlx5e_cable_length_handler, "IU", "Set cable length in meters for xoff threshold calculation"); + } + + if (mlx5e_hw_temperature_update(priv) == 0) { + SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), + OID_AUTO, "hw_temperature", + CTLTYPE_S32 | CTLFLAG_RD | CTLFLAG_MPSAFE, + priv, 0, mlx5e_hw_temperature_handler, "I", + "HW temperature in millicelcius"); } } Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon May 18 09:03:12 2020 (r361170) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon May 18 09:04:24 2020 (r361171) @@ -1027,6 +1027,15 @@ free_out: mlx5_en_err(priv->ifp, "Updating FEC failed: %d\n", error); } + + /* Update temperature, if any */ + if (priv->params_ethtool.hw_num_temp != 0) { + error = mlx5e_hw_temperature_update(priv); + if (error != 0 && error != EOPNOTSUPP) { + mlx5_en_err(priv->ifp, + "Updating temperature failed: %d\n", error); + } + } } static void Modified: stable/11/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_ifc.h Mon May 18 09:03:12 2020 (r361170) +++ stable/11/sys/dev/mlx5/mlx5_ifc.h Mon May 18 09:04:24 2020 (r361171) @@ -10452,4 +10452,163 @@ struct mlx5_ifc_mfrl_reg_bits { u8 reset_level[0x8]; }; +enum { + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTCAP = 0x9009, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTECR = 0x9109, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTMP = 0x900a, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTWE = 0x900b, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTBR = 0x900f, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTEWE = 0x910b, + MLX5_MAX_TEMPERATURE = 16, +}; + +struct mlx5_ifc_mtbr_temp_record_bits { + u8 max_temperature[0x10]; + u8 temperature[0x10]; +}; + +struct mlx5_ifc_mtbr_reg_bits { + u8 reserved_at_0[0x14]; + u8 base_sensor_index[0xc]; + + u8 reserved_at_20[0x18]; + u8 num_rec[0x8]; + + u8 reserved_at_40[0x40]; + + struct mlx5_ifc_mtbr_temp_record_bits temperature_record[MLX5_MAX_TEMPERATURE]; +}; + +struct mlx5_ifc_mtbr_reg_ext_bits { + u8 reserved_at_0[0x14]; + u8 base_sensor_index[0xc]; + + u8 reserved_at_20[0x18]; + u8 num_rec[0x8]; + + u8 reserved_at_40[0x40]; + + struct mlx5_ifc_mtbr_temp_record_bits temperature_record[MLX5_MAX_TEMPERATURE]; +}; + +struct mlx5_ifc_mtcap_bits { + u8 reserved_at_0[0x19]; + u8 sensor_count[0x7]; + + u8 reserved_at_20[0x19]; + u8 internal_sensor_count[0x7]; + + u8 sensor_map[0x40]; +}; + +struct mlx5_ifc_mtcap_ext_bits { + u8 reserved_at_0[0x19]; + u8 sensor_count[0x7]; + + u8 reserved_at_20[0x20]; + + u8 sensor_map[0x40]; +}; + +struct mlx5_ifc_mtecr_bits { + u8 reserved_at_0[0x4]; + u8 last_sensor[0xc]; + u8 reserved_at_10[0x4]; + u8 sensor_count[0xc]; + + u8 reserved_at_20[0x19]; + u8 internal_sensor_count[0x7]; + + u8 sensor_map_0[0x20]; + + u8 reserved_at_60[0x2a0]; +}; + +struct mlx5_ifc_mtecr_ext_bits { + u8 reserved_at_0[0x4]; + u8 last_sensor[0xc]; + u8 reserved_at_10[0x4]; + u8 sensor_count[0xc]; + + u8 reserved_at_20[0x20]; + + u8 sensor_map_0[0x20]; + + u8 reserved_at_60[0x2a0]; +}; + +struct mlx5_ifc_mtewe_bits { + u8 reserved_at_0[0x4]; + u8 last_sensor[0xc]; + u8 reserved_at_10[0x4]; + u8 sensor_count[0xc]; + + u8 sensor_warning_0[0x20]; + + u8 reserved_at_40[0x2a0]; +}; + +struct mlx5_ifc_mtewe_ext_bits { + u8 reserved_at_0[0x4]; + u8 last_sensor[0xc]; + u8 reserved_at_10[0x4]; + u8 sensor_count[0xc]; + + u8 sensor_warning_0[0x20]; + + u8 reserved_at_40[0x2a0]; +}; + +struct mlx5_ifc_mtmp_bits { + u8 reserved_at_0[0x14]; + u8 sensor_index[0xc]; + + u8 reserved_at_20[0x10]; + u8 temperature[0x10]; + + u8 mte[0x1]; + u8 mtr[0x1]; + u8 reserved_at_42[0xe]; + u8 max_temperature[0x10]; + + u8 tee[0x2]; + u8 reserved_at_62[0xe]; + u8 temperature_threshold_hi[0x10]; + + u8 reserved_at_80[0x10]; + u8 temperature_threshold_lo[0x10]; + + u8 reserved_at_a0[0x20]; + + u8 sensor_name_hi[0x20]; + + u8 sensor_name_lo[0x20]; +}; + +struct mlx5_ifc_mtmp_ext_bits { + u8 reserved_at_0[0x14]; + u8 sensor_index[0xc]; + + u8 reserved_at_20[0x10]; + u8 temperature[0x10]; + + u8 mte[0x1]; + u8 mtr[0x1]; + u8 reserved_at_42[0xe]; + u8 max_temperature[0x10]; + + u8 tee[0x2]; + u8 reserved_at_62[0xe]; + u8 temperature_threshold_hi[0x10]; + + u8 reserved_at_80[0x10]; + u8 temperature_threshold_lo[0x10]; + + u8 reserved_at_a0[0x20]; + + u8 sensor_name_hi[0x20]; + + u8 sensor_name_lo[0x20]; +}; + #endif /* MLX5_IFC_H */ From owner-svn-src-all@freebsd.org Mon May 18 09:05: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 8A40B13BC4F; Mon, 18 May 2020 09:05:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QY5636fMz4SBk; Mon, 18 May 2020 09:05:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 663961EB69; Mon, 18 May 2020 09:05:30 +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 04I95U3n050823; Mon, 18 May 2020 09:05:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I95UST050822; Mon, 18 May 2020 09:05:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180905.04I95UST050822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:05: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: r361172 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361172 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, 18 May 2020 09:05:30 -0000 Author: hselasky Date: Mon May 18 09:05:29 2020 New Revision: 361172 URL: https://svnweb.freebsd.org/changeset/base/361172 Log: MFC r360528: Implement kstrtou64() in the LinuxKPI. Submitted by: ashafer_badland.io (Austin Shafer) Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Mon May 18 09:04:24 2020 (r361171) +++ stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Mon May 18 09:05:29 2020 (r361172) @@ -390,6 +390,21 @@ kstrtou32(const char *cp, unsigned int base, u32 *res) } static inline int +kstrtou64(const char *cp, unsigned int base, u64 *res) +{ + char *end; + + *res = strtouq(cp, &end, base); + + /* skip newline character, if any */ + if (*end == '\n') + end++; + if (*cp == 0 || *end != 0) + return (-EINVAL); + return (0); +} + +static inline int kstrtobool(const char *s, bool *res) { int len; From owner-svn-src-all@freebsd.org Mon May 18 09:06: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 4083A13BFA3; Mon, 18 May 2020 09:06:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QY5t0yhmz4SKZ; Mon, 18 May 2020 09:06:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C2151EB6A; Mon, 18 May 2020 09:06:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I969lG050911; Mon, 18 May 2020 09:06:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I969aI050910; Mon, 18 May 2020 09:06:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180906.04I969aI050910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:06:09 +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: r361173 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361173 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, 18 May 2020 09:06:10 -0000 Author: hselasky Date: Mon May 18 09:06:09 2020 New Revision: 361173 URL: https://svnweb.freebsd.org/changeset/base/361173 Log: MFC r360528: Implement kstrtou64() in the LinuxKPI. Submitted by: ashafer_badland.io (Austin Shafer) Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Mon May 18 09:05:29 2020 (r361172) +++ stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Mon May 18 09:06:09 2020 (r361173) @@ -385,6 +385,21 @@ kstrtou32(const char *cp, unsigned int base, u32 *res) } static inline int +kstrtou64(const char *cp, unsigned int base, u64 *res) +{ + char *end; + + *res = strtouq(cp, &end, base); + + /* skip newline character, if any */ + if (*end == '\n') + end++; + if (*cp == 0 || *end != 0) + return (-EINVAL); + return (0); +} + +static inline int kstrtobool(const char *s, bool *res) { int len; From owner-svn-src-all@freebsd.org Mon May 18 09:07: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 E53D113BB7E; Mon, 18 May 2020 09:07:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QY770zXmz4SDK; Mon, 18 May 2020 09:07:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CE9F1F0E7; Mon, 18 May 2020 09:07:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I97Evp051023; Mon, 18 May 2020 09:07:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I97E58051022; Mon, 18 May 2020 09:07:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180907.04I97E58051022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:07:14 +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: r361174 - stable/12/sys/dev/sound/pcm X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/sound/pcm X-SVN-Commit-Revision: 361174 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, 18 May 2020 09:07:16 -0000 Author: hselasky Date: Mon May 18 09:07:14 2020 New Revision: 361174 URL: https://svnweb.freebsd.org/changeset/base/361174 Log: MFC r360790: Set PCM_CAP_VIRTUAL for virtual DSP devices. Submitted by: Kevin Zheng PR: 246206 Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/sound/pcm/dsp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sound/pcm/dsp.c ============================================================================== --- stable/12/sys/dev/sound/pcm/dsp.c Mon May 18 09:06:09 2020 (r361173) +++ stable/12/sys/dev/sound/pcm/dsp.c Mon May 18 09:07:14 2020 (r361174) @@ -1703,6 +1703,10 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, *arg_i = PCM_CAP_REALTIME | PCM_CAP_MMAP | PCM_CAP_TRIGGER; if (rdch && wrch && !(dsp_get_flags(i_dev) & SD_F_SIMPLEX)) *arg_i |= PCM_CAP_DUPLEX; + if (rdch && (rdch->flags & CHN_F_VIRTUAL) != 0) + *arg_i |= PCM_CAP_VIRTUAL; + if (wrch && (wrch->flags & CHN_F_VIRTUAL) != 0) + *arg_i |= PCM_CAP_VIRTUAL; PCM_UNLOCK(d); break; @@ -2653,6 +2657,7 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *a * these in pcmchan::caps? */ ai->caps = PCM_CAP_REALTIME | PCM_CAP_MMAP | PCM_CAP_TRIGGER | + ((ch->flags & CHN_F_VIRTUAL) ? PCM_CAP_VIRTUAL : 0) | ((ch->direction == PCMDIR_PLAY) ? PCM_CAP_OUTPUT : PCM_CAP_INPUT); /* From owner-svn-src-all@freebsd.org Mon May 18 09:07: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 E7E8D13BF4A; Mon, 18 May 2020 09:07:51 +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 49QY7q5vhkz4SZc; Mon, 18 May 2020 09:07:51 +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 C5E691F0E8; Mon, 18 May 2020 09:07:51 +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 04I97p8b051120; Mon, 18 May 2020 09:07:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I97pnj051119; Mon, 18 May 2020 09:07:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180907.04I97pnj051119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:07: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: r361175 - stable/11/sys/dev/sound/pcm X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/sound/pcm X-SVN-Commit-Revision: 361175 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, 18 May 2020 09:07:52 -0000 Author: hselasky Date: Mon May 18 09:07:51 2020 New Revision: 361175 URL: https://svnweb.freebsd.org/changeset/base/361175 Log: MFC r360790: Set PCM_CAP_VIRTUAL for virtual DSP devices. Submitted by: Kevin Zheng PR: 246206 Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/sound/pcm/dsp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sound/pcm/dsp.c ============================================================================== --- stable/11/sys/dev/sound/pcm/dsp.c Mon May 18 09:07:14 2020 (r361174) +++ stable/11/sys/dev/sound/pcm/dsp.c Mon May 18 09:07:51 2020 (r361175) @@ -1701,6 +1701,10 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, *arg_i = PCM_CAP_REALTIME | PCM_CAP_MMAP | PCM_CAP_TRIGGER; if (rdch && wrch && !(dsp_get_flags(i_dev) & SD_F_SIMPLEX)) *arg_i |= PCM_CAP_DUPLEX; + if (rdch && (rdch->flags & CHN_F_VIRTUAL) != 0) + *arg_i |= PCM_CAP_VIRTUAL; + if (wrch && (wrch->flags & CHN_F_VIRTUAL) != 0) + *arg_i |= PCM_CAP_VIRTUAL; PCM_UNLOCK(d); break; @@ -2648,6 +2652,7 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *a * these in pcmchan::caps? */ ai->caps = PCM_CAP_REALTIME | PCM_CAP_MMAP | PCM_CAP_TRIGGER | + ((ch->flags & CHN_F_VIRTUAL) ? PCM_CAP_VIRTUAL : 0) | ((ch->direction == PCMDIR_PLAY) ? PCM_CAP_OUTPUT : PCM_CAP_INPUT); /* From owner-svn-src-all@freebsd.org Mon May 18 09:09: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 B2F0A13C131; Mon, 18 May 2020 09:09:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QY9C4HjKz4SSH; Mon, 18 May 2020 09:09:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E9C31EFE3; Mon, 18 May 2020 09:09:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I993cg051245; Mon, 18 May 2020 09:09:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I993IM051244; Mon, 18 May 2020 09:09:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180909.04I993IM051244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:09: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: r361176 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361176 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, 18 May 2020 09:09:03 -0000 Author: hselasky Date: Mon May 18 09:09:03 2020 New Revision: 361176 URL: https://svnweb.freebsd.org/changeset/base/361176 Log: MFC r360118: Allow test_bit() in the LinuxKPI to accept a const pointer. Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/bitops.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/bitops.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/bitops.h Mon May 18 09:07:51 2020 (r361175) +++ stable/12/sys/compat/linuxkpi/common/include/linux/bitops.h Mon May 18 09:09:03 2020 (r361176) @@ -273,7 +273,7 @@ find_next_zero_bit(const unsigned long *addr, unsigned atomic_clear_long(&((volatile unsigned long *)(a))[BIT_WORD(i)], BIT_MASK(i)) #define test_bit(i, a) \ - !!(READ_ONCE(((volatile unsigned long *)(a))[BIT_WORD(i)]) & BIT_MASK(i)) + !!(READ_ONCE(((volatile const unsigned long *)(a))[BIT_WORD(i)]) & BIT_MASK(i)) static inline int test_and_clear_bit(long bit, volatile unsigned long *var) From owner-svn-src-all@freebsd.org Mon May 18 09:09: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 7555013C31F; Mon, 18 May 2020 09:09:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QY9q2TM9z4SWT; Mon, 18 May 2020 09:09:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 501811EB6D; Mon, 18 May 2020 09:09:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I99Zvb051497; Mon, 18 May 2020 09:09:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I99ZAe051496; Mon, 18 May 2020 09:09:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180909.04I99ZAe051496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:09:35 +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: r361177 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361177 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, 18 May 2020 09:09:35 -0000 Author: hselasky Date: Mon May 18 09:09:34 2020 New Revision: 361177 URL: https://svnweb.freebsd.org/changeset/base/361177 Log: MFC r360118: Allow test_bit() in the LinuxKPI to accept a const pointer. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/bitops.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/bitops.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/bitops.h Mon May 18 09:09:03 2020 (r361176) +++ stable/11/sys/compat/linuxkpi/common/include/linux/bitops.h Mon May 18 09:09:34 2020 (r361177) @@ -273,7 +273,7 @@ find_next_zero_bit(const unsigned long *addr, unsigned atomic_clear_long(&((volatile unsigned long *)(a))[BIT_WORD(i)], BIT_MASK(i)) #define test_bit(i, a) \ - !!(READ_ONCE(((volatile unsigned long *)(a))[BIT_WORD(i)]) & BIT_MASK(i)) + !!(READ_ONCE(((volatile const unsigned long *)(a))[BIT_WORD(i)]) & BIT_MASK(i)) static inline int test_and_clear_bit(long bit, volatile unsigned long *var) From owner-svn-src-all@freebsd.org Mon May 18 09:10: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 DE46613C0E7; Mon, 18 May 2020 09:10:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYBj5bvRz4Sww; Mon, 18 May 2020 09:10:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB9661F2A6; Mon, 18 May 2020 09:10:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9ALTh051627; Mon, 18 May 2020 09:10:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9AL9R051626; Mon, 18 May 2020 09:10:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180910.04I9AL9R051626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:10:21 +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: r361178 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361178 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, 18 May 2020 09:10:21 -0000 Author: hselasky Date: Mon May 18 09:10:21 2020 New Revision: 361178 URL: https://svnweb.freebsd.org/changeset/base/361178 Log: MFC r360119: Implement aligned LinuxKPI types for u16, u32 and u64. Makes a difference for 32-bit platforms mostly. Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/types.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/types.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/types.h Mon May 18 09:09:34 2020 (r361177) +++ stable/12/sys/compat/linuxkpi/common/include/linux/types.h Mon May 18 09:10:21 2020 (r361178) @@ -53,6 +53,10 @@ typedef uint32_t __be32; typedef uint64_t __le64; typedef uint64_t __be64; +typedef uint16_t __aligned_u16 __aligned(sizeof(uint16_t)); +typedef uint32_t __aligned_u32 __aligned(sizeof(uint32_t)); +typedef uint64_t __aligned_u64 __aligned(sizeof(uint64_t)); + typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long ulong; From owner-svn-src-all@freebsd.org Mon May 18 09:10: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 5914313C2BC; Mon, 18 May 2020 09:10:53 +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 49QYCK1nQsz4SrL; Mon, 18 May 2020 09:10:53 +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 38ABF1EF64; Mon, 18 May 2020 09:10:53 +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 04I9ArY1051712; Mon, 18 May 2020 09:10:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9ArkM051711; Mon, 18 May 2020 09:10:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180910.04I9ArkM051711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:10:53 +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: r361179 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361179 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, 18 May 2020 09:10:53 -0000 Author: hselasky Date: Mon May 18 09:10:52 2020 New Revision: 361179 URL: https://svnweb.freebsd.org/changeset/base/361179 Log: MFC r360119: Implement aligned LinuxKPI types for u16, u32 and u64. Makes a difference for 32-bit platforms mostly. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/types.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/types.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/types.h Mon May 18 09:10:21 2020 (r361178) +++ stable/11/sys/compat/linuxkpi/common/include/linux/types.h Mon May 18 09:10:52 2020 (r361179) @@ -53,6 +53,10 @@ typedef uint32_t __be32; typedef uint64_t __le64; typedef uint64_t __be64; +typedef uint16_t __aligned_u16 __aligned(sizeof(uint16_t)); +typedef uint32_t __aligned_u32 __aligned(sizeof(uint32_t)); +typedef uint64_t __aligned_u64 __aligned(sizeof(uint64_t)); + typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long ulong; From owner-svn-src-all@freebsd.org Mon May 18 09:11: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 539F213C35F; Mon, 18 May 2020 09:11:42 +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 49QYDG1b5zz4TDX; Mon, 18 May 2020 09:11:42 +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 187C71F243; Mon, 18 May 2020 09:11:42 +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 04I9Bf8O055837; Mon, 18 May 2020 09:11:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9Bfvs055832; Mon, 18 May 2020 09:11:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180911.04I9Bfvs055832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:11:41 +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: r361180 - stable/12/sys/compat/linuxkpi/common/include/asm X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 361180 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, 18 May 2020 09:11:42 -0000 Author: hselasky Date: Mon May 18 09:11:41 2020 New Revision: 361180 URL: https://svnweb.freebsd.org/changeset/base/361180 Log: MFC r360127: Implement the atomic fetch add unless functions for the LinuxKPI. Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/asm/atomic-long.h stable/12/sys/compat/linuxkpi/common/include/asm/atomic.h stable/12/sys/compat/linuxkpi/common/include/asm/atomic64.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/asm/atomic-long.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon May 18 09:10:52 2020 (r361179) +++ stable/12/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon May 18 09:11:41 2020 (r361180) @@ -119,6 +119,20 @@ atomic_long_add_unless(atomic_long_t *v, long a, long } static inline long +atomic_long_fetch_add_unless(atomic_long_t *v, long a, long u) +{ + long c = atomic_long_read(v); + + for (;;) { + if (unlikely(c == u)) + break; + if (likely(atomic_fcmpset_long(&v->counter, &c, c + a))) + break; + } + return (c); +} + +static inline long atomic_long_dec_and_test(atomic_long_t *v) { long i = atomic_long_add(-1, v); Modified: stable/12/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/asm/atomic.h Mon May 18 09:10:52 2020 (r361179) +++ stable/12/sys/compat/linuxkpi/common/include/asm/atomic.h Mon May 18 09:11:41 2020 (r361180) @@ -119,6 +119,20 @@ atomic_add_unless(atomic_t *v, int a, int u) return (c != u); } +static inline int +atomic_fetch_add_unless(atomic_t *v, int a, int u) +{ + int c = atomic_read(v); + + for (;;) { + if (unlikely(c == u)) + break; + if (likely(atomic_fcmpset_int(&v->counter, &c, c + a))) + break; + } + return (c); +} + static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) { Modified: stable/12/sys/compat/linuxkpi/common/include/asm/atomic64.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/asm/atomic64.h Mon May 18 09:10:52 2020 (r361179) +++ stable/12/sys/compat/linuxkpi/common/include/asm/atomic64.h Mon May 18 09:11:41 2020 (r361180) @@ -104,6 +104,20 @@ atomic64_add_unless(atomic64_t *v, int64_t a, int64_t } static inline int64_t +atomic64_fetch_add_unless(atomic64_t *v, int64_t a, int64_t u) +{ + int64_t c = atomic64_read(v); + + for (;;) { + if (unlikely(c == u)) + break; + if (likely(atomic_fcmpset_64(&v->counter, &c, c + a))) + break; + } + return (c); +} + +static inline int64_t atomic64_xchg(atomic64_t *v, int64_t i) { #if !((defined(__mips__) && !(defined(__mips_n32) || defined(__mips_n64))) || \ From owner-svn-src-all@freebsd.org Mon May 18 09:12: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 B001E13C60E; Mon, 18 May 2020 09:12:14 +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 49QYDt4Gfdz4THG; Mon, 18 May 2020 09:12:14 +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 7586D1F2C7; Mon, 18 May 2020 09:12:14 +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 04I9CEFX056884; Mon, 18 May 2020 09:12:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9CDIH056880; Mon, 18 May 2020 09:12:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180912.04I9CDIH056880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:12:13 +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: r361181 - stable/11/sys/compat/linuxkpi/common/include/asm X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 361181 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, 18 May 2020 09:12:14 -0000 Author: hselasky Date: Mon May 18 09:12:13 2020 New Revision: 361181 URL: https://svnweb.freebsd.org/changeset/base/361181 Log: MFC r360127: Implement the atomic fetch add unless functions for the LinuxKPI. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic-long.h stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h stable/11/sys/compat/linuxkpi/common/include/asm/atomic64.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic-long.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon May 18 09:11:41 2020 (r361180) +++ stable/11/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon May 18 09:12:13 2020 (r361181) @@ -118,6 +118,20 @@ atomic_long_add_unless(atomic_long_t *v, long a, long } static inline long +atomic_long_fetch_add_unless(atomic_long_t *v, long a, long u) +{ + long c = atomic_long_read(v); + + for (;;) { + if (unlikely(c == u)) + break; + if (likely(atomic_fcmpset_long(&v->counter, &c, c + a))) + break; + } + return (c); +} + +static inline long atomic_long_dec_and_test(atomic_long_t *v) { long i = atomic_long_add(-1, v); Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Mon May 18 09:11:41 2020 (r361180) +++ stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Mon May 18 09:12:13 2020 (r361181) @@ -119,6 +119,20 @@ atomic_add_unless(atomic_t *v, int a, int u) return (c != u); } +static inline int +atomic_fetch_add_unless(atomic_t *v, int a, int u) +{ + int c = atomic_read(v); + + for (;;) { + if (unlikely(c == u)) + break; + if (likely(atomic_fcmpset_int(&v->counter, &c, c + a))) + break; + } + return (c); +} + static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) { Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic64.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/asm/atomic64.h Mon May 18 09:11:41 2020 (r361180) +++ stable/11/sys/compat/linuxkpi/common/include/asm/atomic64.h Mon May 18 09:12:13 2020 (r361181) @@ -104,6 +104,20 @@ atomic64_add_unless(atomic64_t *v, int64_t a, int64_t } static inline int64_t +atomic64_fetch_add_unless(atomic64_t *v, int64_t a, int64_t u) +{ + int64_t c = atomic64_read(v); + + for (;;) { + if (unlikely(c == u)) + break; + if (likely(atomic_fcmpset_64(&v->counter, &c, c + a))) + break; + } + return (c); +} + +static inline int64_t atomic64_xchg(atomic64_t *v, int64_t i) { #if defined(__i386__) || defined(__amd64__) || \ From owner-svn-src-all@freebsd.org Mon May 18 09:13: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 32ACE13C543; Mon, 18 May 2020 09:13:04 +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 49QYFr0brVz4TRQ; Mon, 18 May 2020 09:13:04 +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 0FDFF1F2CC; Mon, 18 May 2020 09:13:04 +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 04I9D3uG057653; Mon, 18 May 2020 09:13:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9D3Au057652; Mon, 18 May 2020 09:13:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180913.04I9D3Au057652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:13: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: r361182 - stable/12/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361182 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, 18 May 2020 09:13:04 -0000 Author: hselasky Date: Mon May 18 09:13:03 2020 New Revision: 361182 URL: https://svnweb.freebsd.org/changeset/base/361182 Log: MFC r360243: Add support for LE advertising to hccontrol(8). Submitted by: Marc Veldman PR: 245848 Sponsored by: Mellanox Technologies Modified: stable/12/usr.sbin/bluetooth/hccontrol/hccontrol.8 stable/12/usr.sbin/bluetooth/hccontrol/le.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bluetooth/hccontrol/hccontrol.8 ============================================================================== --- stable/12/usr.sbin/bluetooth/hccontrol/hccontrol.8 Mon May 18 09:12:13 2020 (r361181) +++ stable/12/usr.sbin/bluetooth/hccontrol/hccontrol.8 Mon May 18 09:13:03 2020 (r361182) @@ -25,7 +25,7 @@ .\" $Id: hccontrol.8,v 1.6 2003/08/06 21:26:38 max Exp $ .\" $FreeBSD$ .\" -.Dd February 7, 2015 +.Dd April 24, 2020 .Dt HCCONTROL 8 .Os .Sh NAME @@ -133,6 +133,8 @@ are: .It Cm Write_Page_Scan_Period_Mode .It Cm Read_Page_Scan_Mode .It Cm Write_Page_Scan_Mode +.It Cm Read_LE_Host_Support +.It Cm Write_LE_Host_Support .It Cm Read_Local_Version_Information .It Cm Read_Local_Supported_Commands .It Cm Read_Local_Supported_Features @@ -143,6 +145,15 @@ are: .It Cm Reset_Failed_Contact_Counter .It Cm Get_Link_Quality .It Cm Read_RSSI +.It Cm LE_Read_Local_Supported_Features +.It Cm LE_Set_Advertising_Parameters +.It Cm LE_Read_Advertising_Physical_Channel_Tx_Power +.It Cm LE_Set_Advertising_Data +.It Cm LE_Set_Scan_Response_Data +.It Cm LE_Set_Advertising_Enable +.It Cm LE_Set_Scan_Parameters +.It Cm LE_Set_Scan_Enable +.It Cm LE_Read_Supported_States .El .Pp The currently supported node commands in @@ -170,6 +181,18 @@ are: .It Cm Write_Node_Role_Switch .It Cm Read_Node_List .El +.Sh EXAMPLES +Make the blutooth LE host, ubt0hci, scannable through +.Xr hccontrol 8 commands: +.Pp +.Bd -literal -offset indent +hccontrol -n ubt0hci le_set_advertising_enable disable +hccontrol -n ubt0hci le_set_advertising_param +hccontrol -n ubt0hci le_read_advertising_channel_tx_power +hccontrol -n ubt0hci le_set_advertising_data +hccontrol -n ubt0hci le_set_scan_response -n FBSD_Host +hccontrol -n ubt0hci le_set_advertising_enable enable +.Ed .Sh EXIT STATUS .Ex -std .Sh SEE ALSO Modified: stable/12/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- stable/12/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 09:12:13 2020 (r361181) +++ stable/12/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 09:13:03 2020 (r361182) @@ -57,6 +57,9 @@ static int le_read_local_supported_features(int s, int static int set_le_event_mask(int s, uint64_t mask); static int set_event_mask(int s, uint64_t mask); static int le_enable(int s, int argc, char *argv[]); +static int le_set_advertising_enable(int s, int argc, char *argv[]); +static int le_set_advertising_param(int s, int argc, char *argv[]); +static int le_read_advertising_channel_tx_power(int s, int argc, char *argv[]); static int le_set_scan_param(int s, int argc, char *argv[]) @@ -339,6 +342,170 @@ int le_enable(int s, int argc, char *argv[]) return OK; } +static int +le_set_advertising_enable(int s, int argc, char *argv[]) +{ + ng_hci_le_set_advertise_enable_cp cp; + ng_hci_le_set_advertise_enable_rp rp; + int n, enable = 0; + + if (argc != 1) + return USAGE; + + if (strcmp(argv[0], "enable") == 0) + enable = 1; + else if (strcmp(argv[0], "disable") != 0) + return USAGE; + + n = sizeof(rp); + cp.advertising_enable = enable; + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_SET_ADVERTISE_ENABLE), + (void *)&cp, sizeof(cp), (void *)&rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + fprintf(stdout, "LE Advertising %s\n", (enable ? "enabled" : "disabled")); + + return (OK); +} + +static int +le_set_advertising_param(int s, int argc, char *argv[]) +{ + ng_hci_le_set_advertising_parameters_cp cp; + ng_hci_le_set_advertising_parameters_rp rp; + + int n, ch; + + cp.advertising_interval_min = 0x800; + cp.advertising_interval_max = 0x800; + cp.advertising_type = 0; + cp.own_address_type = 0; + cp.direct_address_type = 0; + + cp.advertising_channel_map = 7; + cp.advertising_filter_policy = 0; + + optreset = 1; + optind = 0; + while ((ch = getopt(argc, argv , "m:M:t:o:p:a:c:f:")) != -1) { + switch(ch) { + case 'm': + cp.advertising_interval_min = + (uint16_t)(strtod(optarg, NULL)/0.625); + break; + case 'M': + cp.advertising_interval_max = + (uint16_t)(strtod(optarg, NULL)/0.625); + break; + case 't': + cp.advertising_type = + (uint8_t)strtod(optarg, NULL); + break; + case 'o': + cp.own_address_type = + (uint8_t)strtod(optarg, NULL); + break; + case 'p': + cp.direct_address_type = + (uint8_t)strtod(optarg, NULL); + break; + case 'a': + if (!bt_aton(optarg, &cp.direct_address)) { + struct hostent *he = NULL; + + if ((he = bt_gethostbyname(optarg)) == NULL) + return (USAGE); + + memcpy(&cp.direct_address, he->h_addr, sizeof(cp.direct_address)); + } + break; + case 'c': + cp.advertising_channel_map = + (uint8_t)strtod(optarg, NULL); + break; + case 'f': + cp.advertising_filter_policy = + (uint8_t)strtod(optarg, NULL); + break; + } + } + + n = sizeof(rp); + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_SET_ADVERTISING_PARAMETERS), + (void *)&cp, sizeof(cp), (void *)&rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + return (OK); +} + +static int +le_read_advertising_channel_tx_power(int s, int argc, char *argv[]) +{ + ng_hci_le_read_advertising_channel_tx_power_rp rp; + int n; + + n = sizeof(rp); + + if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_READ_ADVERTISING_CHANNEL_TX_POWER), + (void *)&rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + fprintf(stdout, "Advertising transmit power level: %d dBm\n", + (int8_t)rp.transmit_power_level); + + return (OK); +} + +static int +le_set_advertising_data(int s, int argc, char *argv[]) +{ + ng_hci_le_set_advertising_data_cp cp; + ng_hci_le_set_advertising_data_rp rp; + int n, len; + + n = sizeof(rp); + + char buf[NG_HCI_ADVERTISING_DATA_SIZE]; + + len = sizeof(buf); + parse_param(argc, argv, buf, &len); + memset(cp.advertising_data, 0, sizeof(cp.advertising_data)); + cp.advertising_data_length = len; + + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_SET_ADVERTISING_DATA), + (void *)&cp, sizeof(cp), (void *)&rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + return (OK); +} + struct hci_command le_commands[] = { { "le_enable", @@ -377,5 +544,32 @@ struct hci_command le_commands[] = { "le_set_scan_param [active|passive] interval(ms) window(ms) [public|random] [all|whitelist] \n" "set LE device scan parameter", &le_set_scan_param + }, + { + "le_set_advertising_enable", + "le_set_advertising_enable [enable|disable] \n" + "start or stop advertising", + &le_set_advertising_enable + }, + { + "le_read_advertising_channel_tx_power", + "le_read_advertising_channel_tx_power\n" + "read host advertising transmit poser level (dBm)", + &le_read_advertising_channel_tx_power + }, + { + "le_set_advertising_param", + "le_set_advertising_param [-m min_interval(ms)] [-M max_interval(ms)]\n" + "[-t advertising_type] [-o own_address_type] [-p peer_address_type]\n" + "[-c advertising_channel_map] [-f advertising_filter_policy]\n" + "[-a peer_address]\n" + "set LE device advertising parameters", + &le_set_advertising_param + }, + { + "le_set_advertising_data", + "le_set_advertising_data -n $name -f $flag -u $uuid16,$uuid16 \n" + "set LE device advertising packed data", + &le_set_advertising_data }, }; From owner-svn-src-all@freebsd.org Mon May 18 09:13: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 5E42713C1A8; Mon, 18 May 2020 09:13:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYGR1rZpz4Tm6; Mon, 18 May 2020 09:13:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A8291F53D; Mon, 18 May 2020 09:13:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9DZGT057745; Mon, 18 May 2020 09:13:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9DYWj057744; Mon, 18 May 2020 09:13:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180913.04I9DYWj057744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:13:34 +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: r361183 - stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361183 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, 18 May 2020 09:13:35 -0000 Author: hselasky Date: Mon May 18 09:13:34 2020 New Revision: 361183 URL: https://svnweb.freebsd.org/changeset/base/361183 Log: MFC r360243: Add support for LE advertising to hccontrol(8). Submitted by: Marc Veldman PR: 245848 Sponsored by: Mellanox Technologies Modified: stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.8 stable/11/usr.sbin/bluetooth/hccontrol/le.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.8 ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.8 Mon May 18 09:13:03 2020 (r361182) +++ stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.8 Mon May 18 09:13:34 2020 (r361183) @@ -25,7 +25,7 @@ .\" $Id: hccontrol.8,v 1.6 2003/08/06 21:26:38 max Exp $ .\" $FreeBSD$ .\" -.Dd February 7, 2015 +.Dd April 24, 2020 .Dt HCCONTROL 8 .Os .Sh NAME @@ -133,6 +133,8 @@ are: .It Cm Write_Page_Scan_Period_Mode .It Cm Read_Page_Scan_Mode .It Cm Write_Page_Scan_Mode +.It Cm Read_LE_Host_Support +.It Cm Write_LE_Host_Support .It Cm Read_Local_Version_Information .It Cm Read_Local_Supported_Commands .It Cm Read_Local_Supported_Features @@ -143,6 +145,15 @@ are: .It Cm Reset_Failed_Contact_Counter .It Cm Get_Link_Quality .It Cm Read_RSSI +.It Cm LE_Read_Local_Supported_Features +.It Cm LE_Set_Advertising_Parameters +.It Cm LE_Read_Advertising_Physical_Channel_Tx_Power +.It Cm LE_Set_Advertising_Data +.It Cm LE_Set_Scan_Response_Data +.It Cm LE_Set_Advertising_Enable +.It Cm LE_Set_Scan_Parameters +.It Cm LE_Set_Scan_Enable +.It Cm LE_Read_Supported_States .El .Pp The currently supported node commands in @@ -170,6 +181,18 @@ are: .It Cm Write_Node_Role_Switch .It Cm Read_Node_List .El +.Sh EXAMPLES +Make the blutooth LE host, ubt0hci, scannable through +.Xr hccontrol 8 commands: +.Pp +.Bd -literal -offset indent +hccontrol -n ubt0hci le_set_advertising_enable disable +hccontrol -n ubt0hci le_set_advertising_param +hccontrol -n ubt0hci le_read_advertising_channel_tx_power +hccontrol -n ubt0hci le_set_advertising_data +hccontrol -n ubt0hci le_set_scan_response -n FBSD_Host +hccontrol -n ubt0hci le_set_advertising_enable enable +.Ed .Sh EXIT STATUS .Ex -std .Sh SEE ALSO Modified: stable/11/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 09:13:03 2020 (r361182) +++ stable/11/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 09:13:34 2020 (r361183) @@ -57,6 +57,9 @@ static int le_read_local_supported_features(int s, int static int set_le_event_mask(int s, uint64_t mask); static int set_event_mask(int s, uint64_t mask); static int le_enable(int s, int argc, char *argv[]); +static int le_set_advertising_enable(int s, int argc, char *argv[]); +static int le_set_advertising_param(int s, int argc, char *argv[]); +static int le_read_advertising_channel_tx_power(int s, int argc, char *argv[]); static int le_set_scan_param(int s, int argc, char *argv[]) @@ -339,6 +342,170 @@ int le_enable(int s, int argc, char *argv[]) return OK; } +static int +le_set_advertising_enable(int s, int argc, char *argv[]) +{ + ng_hci_le_set_advertise_enable_cp cp; + ng_hci_le_set_advertise_enable_rp rp; + int n, enable = 0; + + if (argc != 1) + return USAGE; + + if (strcmp(argv[0], "enable") == 0) + enable = 1; + else if (strcmp(argv[0], "disable") != 0) + return USAGE; + + n = sizeof(rp); + cp.advertising_enable = enable; + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_SET_ADVERTISE_ENABLE), + (void *)&cp, sizeof(cp), (void *)&rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + fprintf(stdout, "LE Advertising %s\n", (enable ? "enabled" : "disabled")); + + return (OK); +} + +static int +le_set_advertising_param(int s, int argc, char *argv[]) +{ + ng_hci_le_set_advertising_parameters_cp cp; + ng_hci_le_set_advertising_parameters_rp rp; + + int n, ch; + + cp.advertising_interval_min = 0x800; + cp.advertising_interval_max = 0x800; + cp.advertising_type = 0; + cp.own_address_type = 0; + cp.direct_address_type = 0; + + cp.advertising_channel_map = 7; + cp.advertising_filter_policy = 0; + + optreset = 1; + optind = 0; + while ((ch = getopt(argc, argv , "m:M:t:o:p:a:c:f:")) != -1) { + switch(ch) { + case 'm': + cp.advertising_interval_min = + (uint16_t)(strtod(optarg, NULL)/0.625); + break; + case 'M': + cp.advertising_interval_max = + (uint16_t)(strtod(optarg, NULL)/0.625); + break; + case 't': + cp.advertising_type = + (uint8_t)strtod(optarg, NULL); + break; + case 'o': + cp.own_address_type = + (uint8_t)strtod(optarg, NULL); + break; + case 'p': + cp.direct_address_type = + (uint8_t)strtod(optarg, NULL); + break; + case 'a': + if (!bt_aton(optarg, &cp.direct_address)) { + struct hostent *he = NULL; + + if ((he = bt_gethostbyname(optarg)) == NULL) + return (USAGE); + + memcpy(&cp.direct_address, he->h_addr, sizeof(cp.direct_address)); + } + break; + case 'c': + cp.advertising_channel_map = + (uint8_t)strtod(optarg, NULL); + break; + case 'f': + cp.advertising_filter_policy = + (uint8_t)strtod(optarg, NULL); + break; + } + } + + n = sizeof(rp); + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_SET_ADVERTISING_PARAMETERS), + (void *)&cp, sizeof(cp), (void *)&rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + return (OK); +} + +static int +le_read_advertising_channel_tx_power(int s, int argc, char *argv[]) +{ + ng_hci_le_read_advertising_channel_tx_power_rp rp; + int n; + + n = sizeof(rp); + + if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_READ_ADVERTISING_CHANNEL_TX_POWER), + (void *)&rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + fprintf(stdout, "Advertising transmit power level: %d dBm\n", + (int8_t)rp.transmit_power_level); + + return (OK); +} + +static int +le_set_advertising_data(int s, int argc, char *argv[]) +{ + ng_hci_le_set_advertising_data_cp cp; + ng_hci_le_set_advertising_data_rp rp; + int n, len; + + n = sizeof(rp); + + char buf[NG_HCI_ADVERTISING_DATA_SIZE]; + + len = sizeof(buf); + parse_param(argc, argv, buf, &len); + memset(cp.advertising_data, 0, sizeof(cp.advertising_data)); + cp.advertising_data_length = len; + + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_SET_ADVERTISING_DATA), + (void *)&cp, sizeof(cp), (void *)&rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + return (OK); +} + struct hci_command le_commands[] = { { "le_enable", @@ -377,5 +544,32 @@ struct hci_command le_commands[] = { "le_set_scan_param [active|passive] interval(ms) window(ms) [public|random] [all|whitelist] \n" "set LE device scan parameter", &le_set_scan_param + }, + { + "le_set_advertising_enable", + "le_set_advertising_enable [enable|disable] \n" + "start or stop advertising", + &le_set_advertising_enable + }, + { + "le_read_advertising_channel_tx_power", + "le_read_advertising_channel_tx_power\n" + "read host advertising transmit poser level (dBm)", + &le_read_advertising_channel_tx_power + }, + { + "le_set_advertising_param", + "le_set_advertising_param [-m min_interval(ms)] [-M max_interval(ms)]\n" + "[-t advertising_type] [-o own_address_type] [-p peer_address_type]\n" + "[-c advertising_channel_map] [-f advertising_filter_policy]\n" + "[-a peer_address]\n" + "set LE device advertising parameters", + &le_set_advertising_param + }, + { + "le_set_advertising_data", + "le_set_advertising_data -n $name -f $flag -u $uuid16,$uuid16 \n" + "set LE device advertising packed data", + &le_set_advertising_data }, }; From owner-svn-src-all@freebsd.org Mon May 18 09: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 2C49213C1C2; Mon, 18 May 2020 09:14:25 +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 49QYHP0Ql0z4Ty1; Mon, 18 May 2020 09:14:25 +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 09C981EF77; Mon, 18 May 2020 09:14:25 +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 04I9EOQ9057857; Mon, 18 May 2020 09:14:24 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9EO6a057856; Mon, 18 May 2020 09:14:24 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180914.04I9EO6a057856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:14: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: r361184 - stable/12/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361184 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, 18 May 2020 09:14:25 -0000 Author: hselasky Date: Mon May 18 09:14:24 2020 New Revision: 361184 URL: https://svnweb.freebsd.org/changeset/base/361184 Log: MFC r360263: Rename two commands to match the Bluetooth specification in hccontrol(8). Fix some bad spelling while at it. Submitted by: Marc Veldman PR: 245868 Sponsored by: Mellanox Technologies Modified: stable/12/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c ============================================================================== --- stable/12/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c Mon May 18 09:13:34 2020 (r361183) +++ stable/12/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c Mon May 18 09:14:24 2020 (r361184) @@ -1491,7 +1491,7 @@ hci_write_page_scan_mode(int s, int argc, char **argv) } /* hci_write_page_scan_mode */ static int -hci_read_le_host_supported_command(int s, int argc, char **argv) +hci_read_le_host_support(int s, int argc, char **argv) { ng_hci_read_le_host_supported_rp rp; int n; @@ -1508,13 +1508,13 @@ hci_read_le_host_supported_command(int s, int argc, ch } fprintf(stdout, "LE Host support: %#02x\n", rp.le_supported_host); - fprintf(stdout, "Simulateneouse LE Host : %#02x\n", rp.simultaneous_le_host); + fprintf(stdout, "Simultaneous LE Host : %#02x\n", rp.simultaneous_le_host); return (OK); } static int -hci_write_le_host_supported_command(int s, int argc, char **argv) +hci_write_le_host_support(int s, int argc, char **argv) { ng_hci_write_le_host_supported_cp cp; ng_hci_write_le_host_supported_rp rp; @@ -1948,14 +1948,14 @@ struct hci_command host_controller_baseband_commands[] &hci_write_page_scan_mode }, { -"read_le_host_supported_command", \ -"Read if this host is in le supported mode and stimulatenouse le supported mode", -&hci_read_le_host_supported_command, +"read_le_host_support", \ +"Read if this host is in LE supported mode and simultaneous LE supported mode", +&hci_read_le_host_support, }, { -"write_le_host_supported_command", \ -"write_le_host_supported_command le_host[0|1] stimultajeous_le[0|1]", -&hci_write_le_host_supported_command, +"write_le_host_support", \ +"write_le_host_support le_host[0|1] simultaneous_le[0|1]", +&hci_write_le_host_support, }, { NULL, } From owner-svn-src-all@freebsd.org Mon May 18 09:14: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 5FDAB13C6EC; Mon, 18 May 2020 09:14:59 +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 49QYJ31wpRz4Tsp; Mon, 18 May 2020 09:14:59 +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 3D7321F330; Mon, 18 May 2020 09:14:59 +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 04I9ExjV057957; Mon, 18 May 2020 09:14:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9Exas057956; Mon, 18 May 2020 09:14:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180914.04I9Exas057956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:14:59 +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: r361185 - stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361185 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, 18 May 2020 09:14:59 -0000 Author: hselasky Date: Mon May 18 09:14:58 2020 New Revision: 361185 URL: https://svnweb.freebsd.org/changeset/base/361185 Log: MFC r360263: Rename two commands to match the Bluetooth specification in hccontrol(8). Fix some bad spelling while at it. Submitted by: Marc Veldman PR: 245868 Sponsored by: Mellanox Technologies Modified: stable/11/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c Mon May 18 09:14:24 2020 (r361184) +++ stable/11/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c Mon May 18 09:14:58 2020 (r361185) @@ -1491,7 +1491,7 @@ hci_write_page_scan_mode(int s, int argc, char **argv) } /* hci_write_page_scan_mode */ static int -hci_read_le_host_supported_command(int s, int argc, char **argv) +hci_read_le_host_support(int s, int argc, char **argv) { ng_hci_read_le_host_supported_rp rp; int n; @@ -1508,13 +1508,13 @@ hci_read_le_host_supported_command(int s, int argc, ch } fprintf(stdout, "LE Host support: %#02x\n", rp.le_supported_host); - fprintf(stdout, "Simulateneouse LE Host : %#02x\n", rp.simultaneous_le_host); + fprintf(stdout, "Simultaneous LE Host : %#02x\n", rp.simultaneous_le_host); return (OK); } static int -hci_write_le_host_supported_command(int s, int argc, char **argv) +hci_write_le_host_support(int s, int argc, char **argv) { ng_hci_write_le_host_supported_cp cp; ng_hci_write_le_host_supported_rp rp; @@ -1948,14 +1948,14 @@ struct hci_command host_controller_baseband_commands[] &hci_write_page_scan_mode }, { -"read_le_host_supported_command", \ -"Read if this host is in le supported mode and stimulatenouse le supported mode", -&hci_read_le_host_supported_command, +"read_le_host_support", \ +"Read if this host is in LE supported mode and simultaneous LE supported mode", +&hci_read_le_host_support, }, { -"write_le_host_supported_command", \ -"write_le_host_supported_command le_host[0|1] stimultajeous_le[0|1]", -&hci_write_le_host_supported_command, +"write_le_host_support", \ +"write_le_host_support le_host[0|1] simultaneous_le[0|1]", +&hci_write_le_host_support, }, { NULL, } From owner-svn-src-all@freebsd.org Mon May 18 09:15: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 E7DCE13C1D4; Mon, 18 May 2020 09:15:45 +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 49QYJx5w97z4V75; Mon, 18 May 2020 09:15:45 +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 C635A1F2CE; Mon, 18 May 2020 09:15:45 +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 04I9FjqF058074; Mon, 18 May 2020 09:15:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9FjjG058073; Mon, 18 May 2020 09:15:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180915.04I9FjjG058073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:15: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: r361186 - stable/12/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361186 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, 18 May 2020 09:15:46 -0000 Author: hselasky Date: Mon May 18 09:15:45 2020 New Revision: 361186 URL: https://svnweb.freebsd.org/changeset/base/361186 Log: MFC r360288: Put advertising data in correct place. Submitted by: Marc Veldman PR: 245848 Sponsored by: Mellanox Technologies Modified: stable/12/usr.sbin/bluetooth/hccontrol/le.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- stable/12/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 09:14:58 2020 (r361185) +++ stable/12/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 09:15:45 2020 (r361186) @@ -491,6 +491,7 @@ le_set_advertising_data(int s, int argc, char *argv[]) parse_param(argc, argv, buf, &len); memset(cp.advertising_data, 0, sizeof(cp.advertising_data)); cp.advertising_data_length = len; + memcpy(cp.advertising_data, buf, len); if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, NG_HCI_OCF_LE_SET_ADVERTISING_DATA), From owner-svn-src-all@freebsd.org Mon May 18 09:16: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 8D04F13C760; Mon, 18 May 2020 09:16:18 +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 49QYKZ3Gcnz4VLn; Mon, 18 May 2020 09:16:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BA7C1F332; Mon, 18 May 2020 09:16:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9GImJ058175; Mon, 18 May 2020 09:16:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9GIL5058174; Mon, 18 May 2020 09:16:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180916.04I9GIL5058174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:16: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: r361187 - stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361187 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, 18 May 2020 09:16:18 -0000 Author: hselasky Date: Mon May 18 09:16:17 2020 New Revision: 361187 URL: https://svnweb.freebsd.org/changeset/base/361187 Log: MFC r360288: Put advertising data in correct place. Submitted by: Marc Veldman PR: 245848 Sponsored by: Mellanox Technologies Modified: stable/11/usr.sbin/bluetooth/hccontrol/le.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 09:15:45 2020 (r361186) +++ stable/11/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 09:16:17 2020 (r361187) @@ -491,6 +491,7 @@ le_set_advertising_data(int s, int argc, char *argv[]) parse_param(argc, argv, buf, &len); memset(cp.advertising_data, 0, sizeof(cp.advertising_data)); cp.advertising_data_length = len; + memcpy(cp.advertising_data, buf, len); if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, NG_HCI_OCF_LE_SET_ADVERTISING_DATA), From owner-svn-src-all@freebsd.org Mon May 18 09:17: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 EEF7313C814; Mon, 18 May 2020 09:17:05 +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 49QYLT62mHz4VV7; Mon, 18 May 2020 09:17:05 +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 CAA411EF7B; Mon, 18 May 2020 09:17:05 +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 04I9H5vh058284; Mon, 18 May 2020 09:17:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9H5rT058283; Mon, 18 May 2020 09:17:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180917.04I9H5rT058283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:17:05 +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: r361188 - stable/12/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361188 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, 18 May 2020 09:17:06 -0000 Author: hselasky Date: Mon May 18 09:17:05 2020 New Revision: 361188 URL: https://svnweb.freebsd.org/changeset/base/361188 Log: MFC r360329: Properly update AD field length in hccontrol(8). While at it use strtol() instead of atoi() to support hexadecimal numbers aswell as 10-base numbers. Submitted by: Marc Veldman PR: 245899 Sponsored by: Mellanox Technologies Modified: stable/12/usr.sbin/bluetooth/hccontrol/le.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- stable/12/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 09:16:17 2020 (r361187) +++ stable/12/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 09:17:05 2020 (r361188) @@ -172,13 +172,13 @@ parse_param(int argc, char *argv[], char *buf, int *le goto done; curbuf[0] = 2; curbuf[1] = 1; - curbuf[2] = atoi(optarg); + curbuf[2] = (uint8_t)strtol(optarg, NULL, 16); curbuf += 3; break; case 'u': - lenpos = buf; if ((buf+2) >= buflast) goto done; + lenpos = curbuf; curbuf[1] = 2; *lenpos = 1; curbuf += 2; @@ -189,6 +189,7 @@ parse_param(int argc, char *argv[], char *buf, int *le curbuf[0] = value &0xff; curbuf[1] = (value>>8)&0xff; curbuf += 2; + *lenpos += 2; } } From owner-svn-src-all@freebsd.org Mon May 18 09:17: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 08F3413C93E; Mon, 18 May 2020 09:17:39 +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 49QYM66W10z4VPg; Mon, 18 May 2020 09:17:38 +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 DA99A1F14B; Mon, 18 May 2020 09:17:38 +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 04I9HcQ6058378; Mon, 18 May 2020 09:17:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9HcA4058377; Mon, 18 May 2020 09:17:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180917.04I9HcA4058377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:17:38 +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: r361189 - stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361189 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, 18 May 2020 09:17:39 -0000 Author: hselasky Date: Mon May 18 09:17:38 2020 New Revision: 361189 URL: https://svnweb.freebsd.org/changeset/base/361189 Log: MFC r360329: Properly update AD field length in hccontrol(8). While at it use strtol() instead of atoi() to support hexadecimal numbers aswell as 10-base numbers. Submitted by: Marc Veldman PR: 245899 Sponsored by: Mellanox Technologies Modified: stable/11/usr.sbin/bluetooth/hccontrol/le.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 09:17:05 2020 (r361188) +++ stable/11/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 09:17:38 2020 (r361189) @@ -172,13 +172,13 @@ parse_param(int argc, char *argv[], char *buf, int *le goto done; curbuf[0] = 2; curbuf[1] = 1; - curbuf[2] = atoi(optarg); + curbuf[2] = (uint8_t)strtol(optarg, NULL, 16); curbuf += 3; break; case 'u': - lenpos = buf; if ((buf+2) >= buflast) goto done; + lenpos = curbuf; curbuf[1] = 2; *lenpos = 1; curbuf += 2; @@ -189,6 +189,7 @@ parse_param(int argc, char *argv[], char *buf, int *le curbuf[0] = value &0xff; curbuf[1] = (value>>8)&0xff; curbuf += 2; + *lenpos += 2; } } From owner-svn-src-all@freebsd.org Mon May 18 09:21: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 5360E13CABA; Mon, 18 May 2020 09:21: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 49QYRt1Tkqz4VjJ; Mon, 18 May 2020 09:21: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 2E3021F342; Mon, 18 May 2020 09:21: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 04I9LkXs061984; Mon, 18 May 2020 09:21:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9LkoQ061983; Mon, 18 May 2020 09:21:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180921.04I9LkoQ061983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:21:46 +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: r361190 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361190 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, 18 May 2020 09:21:46 -0000 Author: hselasky Date: Mon May 18 09:21:45 2020 New Revision: 361190 URL: https://svnweb.freebsd.org/changeset/base/361190 Log: MFC r351003: Fix build with DRM and INVARIANTS enabled. The DRM drivers use the lockdep assertion macros with spinlock_t locks which are backed by mutexes, not sx locks. This causes compile failures since you can't use sx_assert with a mutex. Instead, change the lockdep macros to use lock_class methods. This works by assuming that each LinuxKPI locking primitive embeds a FreeBSD lock as its first structure and uses a cast to get to the underlying 'struct lock_object'. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D20992 Modified: stable/12/sys/compat/linuxkpi/common/include/linux/lockdep.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/lockdep.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/lockdep.h Mon May 18 09:17:38 2020 (r361189) +++ stable/12/sys/compat/linuxkpi/common/include/linux/lockdep.h Mon May 18 09:21:45 2020 (r361190) @@ -40,13 +40,34 @@ struct lock_class_key { #define lockdep_set_current_reclaim_state(g) do { } while (0) #define lockdep_clear_current_reclaim_state() do { } while (0) -#define lockdep_assert_held(m) \ - sx_assert(&(m)->sx, SA_XLOCKED) +#ifdef INVARIANTS +#define lockdep_assert_held(m) do { \ + struct lock_object *__lock = (struct lock_object *)(m); \ + LOCK_CLASS(__lock)->lc_assert(__lock, LA_LOCKED); \ +} while (0) -#define lockdep_assert_held_once(m) \ - sx_assert(&(m)->sx, SA_XLOCKED | SA_NOTRECURSED) +#define lockdep_assert_held_once(m) do { \ + struct lock_object *__lock = (struct lock_object *)(m); \ + LOCK_CLASS(__lock)->lc_assert(__lock, LA_LOCKED | LA_NOTRECURSED); \ +} while (0) -#define lockdep_is_held(m) (sx_xholder(&(m)->sx) == curthread) +static __inline bool +lockdep_is_held(void *__m) +{ + struct lock_object *__lock; + struct thread *__td; + + __lock = __m; + return (LOCK_CLASS(__lock)->lc_owner(__lock, &__td) != 0); +} + +#else +#define lockdep_assert_held(m) do { } while (0) + +#define lockdep_assert_held_once(m) do { } while (0) + +#define lockdep_is_held(m) 1 +#endif #define might_lock(m) do { } while (0) #define might_lock_read(m) do { } while (0) From owner-svn-src-all@freebsd.org Mon May 18 09: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 17A2013CA26; Mon, 18 May 2020 09:22:18 +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 49QYST6yhwz4W2s; Mon, 18 May 2020 09:22:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA4961F15C; Mon, 18 May 2020 09:22:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9MHN1064402; Mon, 18 May 2020 09:22:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9MHd2064401; Mon, 18 May 2020 09:22:17 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180922.04I9MHd2064401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:22: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: r361191 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361191 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, 18 May 2020 09:22:18 -0000 Author: hselasky Date: Mon May 18 09:22:17 2020 New Revision: 361191 URL: https://svnweb.freebsd.org/changeset/base/361191 Log: MFC r351003: Fix build with DRM and INVARIANTS enabled. The DRM drivers use the lockdep assertion macros with spinlock_t locks which are backed by mutexes, not sx locks. This causes compile failures since you can't use sx_assert with a mutex. Instead, change the lockdep macros to use lock_class methods. This works by assuming that each LinuxKPI locking primitive embeds a FreeBSD lock as its first structure and uses a cast to get to the underlying 'struct lock_object'. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D20992 Modified: stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h Mon May 18 09:21:45 2020 (r361190) +++ stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h Mon May 18 09:22:17 2020 (r361191) @@ -40,13 +40,34 @@ struct lock_class_key { #define lockdep_set_current_reclaim_state(g) do { } while (0) #define lockdep_clear_current_reclaim_state() do { } while (0) -#define lockdep_assert_held(m) \ - sx_assert(&(m)->sx, SA_XLOCKED) +#ifdef INVARIANTS +#define lockdep_assert_held(m) do { \ + struct lock_object *__lock = (struct lock_object *)(m); \ + LOCK_CLASS(__lock)->lc_assert(__lock, LA_LOCKED); \ +} while (0) -#define lockdep_assert_held_once(m) \ - sx_assert(&(m)->sx, SA_XLOCKED | SA_NOTRECURSED) +#define lockdep_assert_held_once(m) do { \ + struct lock_object *__lock = (struct lock_object *)(m); \ + LOCK_CLASS(__lock)->lc_assert(__lock, LA_LOCKED | LA_NOTRECURSED); \ +} while (0) -#define lockdep_is_held(m) (sx_xholder(&(m)->sx) == curthread) +static __inline bool +lockdep_is_held(void *__m) +{ + struct lock_object *__lock; + struct thread *__td; + + __lock = __m; + return (LOCK_CLASS(__lock)->lc_owner(__lock, &__td) != 0); +} + +#else +#define lockdep_assert_held(m) do { } while (0) + +#define lockdep_assert_held_once(m) do { } while (0) + +#define lockdep_is_held(m) 1 +#endif #define might_lock(m) do { } while (0) #define might_lock_read(m) do { } while (0) From owner-svn-src-all@freebsd.org Mon May 18 09:22: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 65A2713CD23; Mon, 18 May 2020 09:22:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYT4259sz4W3M; Mon, 18 May 2020 09:22:48 +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 42EC01F633; Mon, 18 May 2020 09:22:48 +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 04I9MmgV064480; Mon, 18 May 2020 09:22:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9MmQN064479; Mon, 18 May 2020 09:22:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180922.04I9MmQN064479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:22: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: r361192 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361192 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, 18 May 2020 09:22:48 -0000 Author: hselasky Date: Mon May 18 09:22:47 2020 New Revision: 361192 URL: https://svnweb.freebsd.org/changeset/base/361192 Log: MFC r360529: Implement more lockdep macros in the LinuxKPI. Submitted by: ashafer_badland.io (Austin Shafer) Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/lockdep.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/lockdep.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/lockdep.h Mon May 18 09:22:17 2020 (r361191) +++ stable/12/sys/compat/linuxkpi/common/include/linux/lockdep.h Mon May 18 09:22:47 2020 (r361192) @@ -36,6 +36,7 @@ struct lock_class_key { }; #define lockdep_set_class(lock, key) +#define lockdep_set_subclass(lock, sub) #define lockdep_set_class_and_name(lock, key, name) #define lockdep_set_current_reclaim_state(g) do { } while (0) #define lockdep_clear_current_reclaim_state() do { } while (0) @@ -60,6 +61,7 @@ lockdep_is_held(void *__m) __lock = __m; return (LOCK_CLASS(__lock)->lc_owner(__lock, &__td) != 0); } +#define lockdep_is_held_type(_m, _t) lockdep_is_held(_m) #else #define lockdep_assert_held(m) do { } while (0) @@ -67,6 +69,7 @@ lockdep_is_held(void *__m) #define lockdep_assert_held_once(m) do { } while (0) #define lockdep_is_held(m) 1 +#define lockdep_is_held_type(_m, _t) 1 #endif #define might_lock(m) do { } while (0) @@ -75,5 +78,8 @@ lockdep_is_held(void *__m) #define lock_acquire(...) do { } while (0) #define lock_release(...) do { } while (0) #define lock_acquire_shared_recursive(...) do { } while (0) + +#define mutex_acquire(...) do { } while (0) +#define mutex_release(...) do { } while (0) #endif /* _LINUX_LOCKDEP_H_ */ From owner-svn-src-all@freebsd.org Mon May 18 09:23: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 9D48813CD3D; Mon, 18 May 2020 09:23:18 +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 49QYTf3fZHz4Vyr; Mon, 18 May 2020 09:23:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 788E71F7B0; Mon, 18 May 2020 09:23:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9NI2O064566; Mon, 18 May 2020 09:23:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9NIRI064565; Mon, 18 May 2020 09:23:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180923.04I9NIRI064565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:23: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: r361193 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361193 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, 18 May 2020 09:23:18 -0000 Author: hselasky Date: Mon May 18 09:23:18 2020 New Revision: 361193 URL: https://svnweb.freebsd.org/changeset/base/361193 Log: MFC r360529: Implement more lockdep macros in the LinuxKPI. Submitted by: ashafer_badland.io (Austin Shafer) Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h Mon May 18 09:22:47 2020 (r361192) +++ stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h Mon May 18 09:23:18 2020 (r361193) @@ -36,6 +36,7 @@ struct lock_class_key { }; #define lockdep_set_class(lock, key) +#define lockdep_set_subclass(lock, sub) #define lockdep_set_class_and_name(lock, key, name) #define lockdep_set_current_reclaim_state(g) do { } while (0) #define lockdep_clear_current_reclaim_state() do { } while (0) @@ -60,6 +61,7 @@ lockdep_is_held(void *__m) __lock = __m; return (LOCK_CLASS(__lock)->lc_owner(__lock, &__td) != 0); } +#define lockdep_is_held_type(_m, _t) lockdep_is_held(_m) #else #define lockdep_assert_held(m) do { } while (0) @@ -67,6 +69,7 @@ lockdep_is_held(void *__m) #define lockdep_assert_held_once(m) do { } while (0) #define lockdep_is_held(m) 1 +#define lockdep_is_held_type(_m, _t) 1 #endif #define might_lock(m) do { } while (0) @@ -75,5 +78,8 @@ lockdep_is_held(void *__m) #define lock_acquire(...) do { } while (0) #define lock_release(...) do { } while (0) #define lock_acquire_shared_recursive(...) do { } while (0) + +#define mutex_acquire(...) do { } while (0) +#define mutex_release(...) do { } while (0) #endif /* _LINUX_LOCKDEP_H_ */ From owner-svn-src-all@freebsd.org Mon May 18 09:24: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 0F4DA13C8F3; Mon, 18 May 2020 09:24:06 +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 49QYVY6fb4z4WGd; Mon, 18 May 2020 09:24:05 +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 DFA8D1F596; Mon, 18 May 2020 09:24:05 +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 04I9O5la064661; Mon, 18 May 2020 09:24:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9O5hx064660; Mon, 18 May 2020 09:24:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180924.04I9O5hx064660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:24:05 +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: r361194 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361194 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, 18 May 2020 09:24:06 -0000 Author: hselasky Date: Mon May 18 09:24:05 2020 New Revision: 361194 URL: https://svnweb.freebsd.org/changeset/base/361194 Log: MFC r360530: Implement DIV64_U64_ROUND_UP() in the LinuxKPI. Submitted by: ashafer_badland.io (Austin Shafer) Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/math64.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/math64.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/math64.h Mon May 18 09:23:18 2020 (r361193) +++ stable/12/sys/compat/linuxkpi/common/include/linux/math64.h Mon May 18 09:24:05 2020 (r361194) @@ -91,4 +91,13 @@ mul_u32_u32(uint32_t a, uint32_t b) return ((uint64_t)a * b); } +static inline uint64_t +div64_u64_round_up(uint64_t dividend, uint64_t divisor) +{ + return ((dividend + divisor - 1) / divisor); +} + +#define DIV64_U64_ROUND_UP(...) \ + div64_u64_round_up(__VA_ARGS__) + #endif /* _LINUX_MATH64_H */ From owner-svn-src-all@freebsd.org Mon May 18 09:24: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 AEC3113CE46; Mon, 18 May 2020 09:24:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYW84Dt9z4WRQ; Mon, 18 May 2020 09:24:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C9581F634; Mon, 18 May 2020 09:24:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9OaeY064739; Mon, 18 May 2020 09:24:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9Oas3064738; Mon, 18 May 2020 09:24:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180924.04I9Oas3064738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:24:36 +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: r361195 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361195 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, 18 May 2020 09:24:36 -0000 Author: hselasky Date: Mon May 18 09:24:36 2020 New Revision: 361195 URL: https://svnweb.freebsd.org/changeset/base/361195 Log: MFC r360530: Implement DIV64_U64_ROUND_UP() in the LinuxKPI. Submitted by: ashafer_badland.io (Austin Shafer) Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/math64.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/math64.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/math64.h Mon May 18 09:24:05 2020 (r361194) +++ stable/11/sys/compat/linuxkpi/common/include/linux/math64.h Mon May 18 09:24:36 2020 (r361195) @@ -91,4 +91,13 @@ mul_u32_u32(uint32_t a, uint32_t b) return ((uint64_t)a * b); } +static inline uint64_t +div64_u64_round_up(uint64_t dividend, uint64_t divisor) +{ + return ((dividend + divisor - 1) / divisor); +} + +#define DIV64_U64_ROUND_UP(...) \ + div64_u64_round_up(__VA_ARGS__) + #endif /* _LINUX_MATH64_H */ From owner-svn-src-all@freebsd.org Mon May 18 09:25: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 0C61413CF8E; Mon, 18 May 2020 09:25:24 +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 49QYX36fxFz4WPZ; Mon, 18 May 2020 09:25:23 +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 DFED31F3C8; Mon, 18 May 2020 09:25:23 +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 04I9PNEb064847; Mon, 18 May 2020 09:25:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9PNu0064846; Mon, 18 May 2020 09:25:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180925.04I9PNu0064846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:25: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: r361196 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361196 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, 18 May 2020 09:25:24 -0000 Author: hselasky Date: Mon May 18 09:25:23 2020 New Revision: 361196 URL: https://svnweb.freebsd.org/changeset/base/361196 Log: MFC r360531: Implement mutex_lock_killable() in the LinuxKPI. Submitted by: ashafer_badland.io (Austin Shafer) Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/mutex.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/mutex.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/mutex.h Mon May 18 09:24:36 2020 (r361195) +++ stable/12/sys/compat/linuxkpi/common/include/linux/mutex.h Mon May 18 09:25:23 2020 (r361196) @@ -66,6 +66,18 @@ typedef struct mutex { linux_mutex_lock_interruptible(_m); \ }) +/* + * Reuse the interruptable method since the SX + * lock handles both signals and interrupts: + */ +#define mutex_lock_killable(_m) ({ \ + MUTEX_SKIP() ? 0 : \ + linux_mutex_lock_interruptible(_m); \ +}) + +#define mutex_lock_killable_nested(_m, _sub) \ + mutex_lock_killable(_m) + #define mutex_unlock(_m) do { \ if (MUTEX_SKIP()) \ break; \ From owner-svn-src-all@freebsd.org Mon May 18 09:25: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 502F413CF17; Mon, 18 May 2020 09:25:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYXh1SGTz4WmQ; Mon, 18 May 2020 09:25:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D4171F7B2; Mon, 18 May 2020 09:25:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9PugO064929; Mon, 18 May 2020 09:25:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9Pul4064928; Mon, 18 May 2020 09:25:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180925.04I9Pul4064928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:25:56 +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: r361197 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361197 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, 18 May 2020 09:25:56 -0000 Author: hselasky Date: Mon May 18 09:25:55 2020 New Revision: 361197 URL: https://svnweb.freebsd.org/changeset/base/361197 Log: MFC r360531: Implement mutex_lock_killable() in the LinuxKPI. Submitted by: ashafer_badland.io (Austin Shafer) Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mutex.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mutex.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/mutex.h Mon May 18 09:25:23 2020 (r361196) +++ stable/11/sys/compat/linuxkpi/common/include/linux/mutex.h Mon May 18 09:25:55 2020 (r361197) @@ -66,6 +66,18 @@ typedef struct mutex { linux_mutex_lock_interruptible(_m); \ }) +/* + * Reuse the interruptable method since the SX + * lock handles both signals and interrupts: + */ +#define mutex_lock_killable(_m) ({ \ + MUTEX_SKIP() ? 0 : \ + linux_mutex_lock_interruptible(_m); \ +}) + +#define mutex_lock_killable_nested(_m, _sub) \ + mutex_lock_killable(_m) + #define mutex_unlock(_m) do { \ if (MUTEX_SKIP()) \ break; \ From owner-svn-src-all@freebsd.org Mon May 18 09:26: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 7EF3E13CEE2; Mon, 18 May 2020 09:26:43 +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 49QYYb2m48z4WnC; Mon, 18 May 2020 09:26:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59AD11F68B; Mon, 18 May 2020 09:26:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9QhO4065023; Mon, 18 May 2020 09:26:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9QhiE065022; Mon, 18 May 2020 09:26:43 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180926.04I9QhiE065022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:26:43 +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: r361198 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361198 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, 18 May 2020 09:26:43 -0000 Author: hselasky Date: Mon May 18 09:26:42 2020 New Revision: 361198 URL: https://svnweb.freebsd.org/changeset/base/361198 Log: MFC r360532: Implement more PCI-express bandwidth functions in the LinuxKPI. Submitted by: ashafer_badland.io (Austin Shafer) Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/pci.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/pci.h Mon May 18 09:25:55 2020 (r361197) +++ stable/12/sys/compat/linuxkpi/common/include/linux/pci.h Mon May 18 09:26:42 2020 (r361198) @@ -954,6 +954,47 @@ pcie_get_width_cap(struct pci_dev *dev) return (PCIE_LNK_WIDTH_UNKNOWN); } +static inline int +pcie_get_mps(struct pci_dev *dev) +{ + return (pci_get_max_payload(dev->dev.bsddev)); +} + +static inline uint32_t +PCIE_SPEED2MBS_ENC(enum pci_bus_speed spd) +{ + + switch(spd) { + case PCIE_SPEED_16_0GT: + return (16000 * 128 / 130); + case PCIE_SPEED_8_0GT: + return (8000 * 128 / 130); + case PCIE_SPEED_5_0GT: + return (5000 * 8 / 10); + case PCIE_SPEED_2_5GT: + return (2500 * 8 / 10); + default: + return (0); + } +} + +static inline uint32_t +pcie_bandwidth_available(struct pci_dev *pdev, + struct pci_dev **limiting, + enum pci_bus_speed *speed, + enum pcie_link_width *width) +{ + enum pci_bus_speed nspeed = pcie_get_speed_cap(pdev); + enum pcie_link_width nwidth = pcie_get_width_cap(pdev); + + if (speed) + *speed = nspeed; + if (width) + *width = nwidth; + + return (nwidth * PCIE_SPEED2MBS_ENC(nspeed)); +} + /* * The following functions can be used to attach/detach the LinuxKPI's * PCI device runtime. The pci_driver and pci_device_id pointer is From owner-svn-src-all@freebsd.org Mon May 18 09:32: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 1EC3C13CFDC; Mon, 18 May 2020 09:32:57 +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 49QYhn03VFz4X7s; Mon, 18 May 2020 09:32:57 +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 F162D1F65E; Mon, 18 May 2020 09:32:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9WuLs071046; Mon, 18 May 2020 09:32:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9Wucb071045; Mon, 18 May 2020 09:32:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180932.04I9Wucb071045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:32:56 +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: r361199 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361199 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, 18 May 2020 09:32:57 -0000 Author: hselasky Date: Mon May 18 09:32:56 2020 New Revision: 361199 URL: https://svnweb.freebsd.org/changeset/base/361199 Log: MFC r345103: Implement more PCI speed related functions and macros in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Mon May 18 09:26:42 2020 (r361198) +++ stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Mon May 18 09:32:56 2020 (r361199) @@ -141,10 +141,13 @@ struct pci_device_id { #define PCI_EXP_TYPE_RC_EC PCIEM_TYPE_ROOT_EC /* Root Complex Event Collector */ #define PCI_EXP_LNKCAP_SLS_2_5GB 0x01 /* Supported Link Speed 2.5GT/s */ #define PCI_EXP_LNKCAP_SLS_5_0GB 0x02 /* Supported Link Speed 5.0GT/s */ +#define PCI_EXP_LNKCAP_SLS_8_0GB 0x04 /* Supported Link Speed 8.0GT/s */ +#define PCI_EXP_LNKCAP_SLS_16_0GB 0x08 /* Supported Link Speed 16.0GT/s */ #define PCI_EXP_LNKCAP_MLW 0x03f0 /* Maximum Link Width */ #define PCI_EXP_LNKCAP2_SLS_2_5GB 0x02 /* Supported Link Speed 2.5GT/s */ #define PCI_EXP_LNKCAP2_SLS_5_0GB 0x04 /* Supported Link Speed 5.0GT/s */ #define PCI_EXP_LNKCAP2_SLS_8_0GB 0x08 /* Supported Link Speed 8.0GT/s */ +#define PCI_EXP_LNKCAP2_SLS_16_0GB 0x10 /* Supported Link Speed 16.0GT/s */ #define PCI_EXP_LNKCTL_HAWD PCIEM_LINK_CTL_HAWD #define PCI_EXP_LNKCAP_CLKPM 0x00040000 @@ -159,10 +162,19 @@ enum pci_bus_speed { PCIE_SPEED_2_5GT, PCIE_SPEED_5_0GT, PCIE_SPEED_8_0GT, + PCIE_SPEED_16_0GT, }; enum pcie_link_width { - PCIE_LNK_WIDTH_UNKNOWN = 0xFF, + PCIE_LNK_WIDTH_RESRV = 0x00, + PCIE_LNK_X1 = 0x01, + PCIE_LNK_X2 = 0x02, + PCIE_LNK_X4 = 0x04, + PCIE_LNK_X8 = 0x08, + PCIE_LNK_X12 = 0x0c, + PCIE_LNK_X16 = 0x10, + PCIE_LNK_X32 = 0x20, + PCIE_LNK_WIDTH_UNKNOWN = 0xff, }; typedef int pci_power_t; @@ -895,6 +907,67 @@ static inline int pci_num_vf(struct pci_dev *dev) { return (0); +} + +static inline enum pci_bus_speed +pcie_get_speed_cap(struct pci_dev *dev) +{ + device_t root; + uint32_t lnkcap, lnkcap2; + int error, pos; + + root = device_get_parent(dev->dev.bsddev); + if (root == NULL) + return (PCI_SPEED_UNKNOWN); + root = device_get_parent(root); + if (root == NULL) + return (PCI_SPEED_UNKNOWN); + root = device_get_parent(root); + if (root == NULL) + return (PCI_SPEED_UNKNOWN); + + if (pci_get_vendor(root) == PCI_VENDOR_ID_VIA || + pci_get_vendor(root) == PCI_VENDOR_ID_SERVERWORKS) + return (PCI_SPEED_UNKNOWN); + + if ((error = pci_find_cap(root, PCIY_EXPRESS, &pos)) != 0) + return (PCI_SPEED_UNKNOWN); + + lnkcap2 = pci_read_config(root, pos + PCIER_LINK_CAP2, 4); + + if (lnkcap2) { /* PCIe r3.0-compliant */ + if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_2_5GB) + return (PCIE_SPEED_2_5GT); + if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_5_0GB) + return (PCIE_SPEED_5_0GT); + if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_8_0GB) + return (PCIE_SPEED_8_0GT); + if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_16_0GB) + return (PCIE_SPEED_16_0GT); + } else { /* pre-r3.0 */ + lnkcap = pci_read_config(root, pos + PCIER_LINK_CAP, 4); + if (lnkcap & PCI_EXP_LNKCAP_SLS_2_5GB) + return (PCIE_SPEED_2_5GT); + if (lnkcap & PCI_EXP_LNKCAP_SLS_5_0GB) + return (PCIE_SPEED_5_0GT); + if (lnkcap & PCI_EXP_LNKCAP_SLS_8_0GB) + return (PCIE_SPEED_8_0GT); + if (lnkcap & PCI_EXP_LNKCAP_SLS_16_0GB) + return (PCIE_SPEED_16_0GT); + } + return (PCI_SPEED_UNKNOWN); +} + +static inline enum pcie_link_width +pcie_get_width_cap(struct pci_dev *dev) +{ + uint32_t lnkcap; + + pcie_capability_read_dword(dev, PCI_EXP_LNKCAP, &lnkcap); + if (lnkcap) + return ((lnkcap & PCI_EXP_LNKCAP_MLW) >> 4); + + return (PCIE_LNK_WIDTH_UNKNOWN); } #endif /* _LINUX_PCI_H_ */ From owner-svn-src-all@freebsd.org Mon May 18 09:34: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 D215913D41A; Mon, 18 May 2020 09:34:41 +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 49QYkn58Wgz4X8b; Mon, 18 May 2020 09:34:41 +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 AC0C11F7CB; Mon, 18 May 2020 09:34:41 +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 04I9Yfqj071210; Mon, 18 May 2020 09:34:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9YfgG071209; Mon, 18 May 2020 09:34:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180934.04I9YfgG071209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:34: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: r361200 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361200 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, 18 May 2020 09:34:41 -0000 Author: hselasky Date: Mon May 18 09:34:41 2020 New Revision: 361200 URL: https://svnweb.freebsd.org/changeset/base/361200 Log: MFC r360532: Implement more PCI-express bandwidth functions in the LinuxKPI. Submitted by: ashafer_badland.io (Austin Shafer) Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Mon May 18 09:32:56 2020 (r361199) +++ stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Mon May 18 09:34:41 2020 (r361200) @@ -970,4 +970,45 @@ pcie_get_width_cap(struct pci_dev *dev) return (PCIE_LNK_WIDTH_UNKNOWN); } +static inline int +pcie_get_mps(struct pci_dev *dev) +{ + return (pci_get_max_payload(dev->dev.bsddev)); +} + +static inline uint32_t +PCIE_SPEED2MBS_ENC(enum pci_bus_speed spd) +{ + + switch(spd) { + case PCIE_SPEED_16_0GT: + return (16000 * 128 / 130); + case PCIE_SPEED_8_0GT: + return (8000 * 128 / 130); + case PCIE_SPEED_5_0GT: + return (5000 * 8 / 10); + case PCIE_SPEED_2_5GT: + return (2500 * 8 / 10); + default: + return (0); + } +} + +static inline uint32_t +pcie_bandwidth_available(struct pci_dev *pdev, + struct pci_dev **limiting, + enum pci_bus_speed *speed, + enum pcie_link_width *width) +{ + enum pci_bus_speed nspeed = pcie_get_speed_cap(pdev); + enum pcie_link_width nwidth = pcie_get_width_cap(pdev); + + if (speed) + *speed = nspeed; + if (width) + *width = nwidth; + + return (nwidth * PCIE_SPEED2MBS_ENC(nspeed)); +} + #endif /* _LINUX_PCI_H_ */ From owner-svn-src-all@freebsd.org Mon May 18 09:35: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 03FD213D444; Mon, 18 May 2020 09:35:43 +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 49QYly6MHXz4Xc9; Mon, 18 May 2020 09:35:42 +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 D56AD1F3E2; Mon, 18 May 2020 09:35:42 +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 04I9Zg3h071330; Mon, 18 May 2020 09:35:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9Zg7H071329; Mon, 18 May 2020 09:35:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180935.04I9Zg7H071329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:35:42 +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: r361201 - stable/12/sys/compat/linuxkpi/common/src X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 361201 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, 18 May 2020 09:35:43 -0000 Author: hselasky Date: Mon May 18 09:35:42 2020 New Revision: 361201 URL: https://svnweb.freebsd.org/changeset/base/361201 Log: MFC r360621: Fix warning about sleeping with non-sleepable lock when allocating "current" from linux_cdev_pager_populate() in the LinuxKPI: Backtrace: witness_debugger() witness_warn() uma_zalloc_arg() malloc() linux_alloc_current() linux_cdev_pager_populate() vm_fault() vm_fault_trap() trap_pfault() trap() calltrap() Suggested by: avg@ Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Mon May 18 09:34:41 2020 (r361200) +++ stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Mon May 18 09:35:42 2020 (r361201) @@ -528,14 +528,14 @@ linux_cdev_pager_populate(vm_object_t vm_obj, vm_pinde struct vm_area_struct *vmap; int err; - linux_set_current(curthread); - /* get VM area structure */ vmap = linux_cdev_handle_find(vm_obj->handle); MPASS(vmap != NULL); MPASS(vmap->vm_private_data == vm_obj->handle); VM_OBJECT_WUNLOCK(vm_obj); + + linux_set_current(curthread); down_write(&vmap->vm_mm->mmap_sem); if (unlikely(vmap->vm_ops == NULL)) { From owner-svn-src-all@freebsd.org Mon May 18 09:36: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 0322413D44D; Mon, 18 May 2020 09:36:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYmZ6Jcdz4XPY; Mon, 18 May 2020 09:36:14 +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 D3BA71F5A8; Mon, 18 May 2020 09:36:14 +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 04I9aE42071413; Mon, 18 May 2020 09:36:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9aESX071412; Mon, 18 May 2020 09:36:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180936.04I9aESX071412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:36:14 +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: r361202 - stable/11/sys/compat/linuxkpi/common/src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 361202 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, 18 May 2020 09:36:15 -0000 Author: hselasky Date: Mon May 18 09:36:14 2020 New Revision: 361202 URL: https://svnweb.freebsd.org/changeset/base/361202 Log: MFC r360621: Fix warning about sleeping with non-sleepable lock when allocating "current" from linux_cdev_pager_populate() in the LinuxKPI: Backtrace: witness_debugger() witness_warn() uma_zalloc_arg() malloc() linux_alloc_current() linux_cdev_pager_populate() vm_fault() vm_fault_trap() trap_pfault() trap() calltrap() Suggested by: avg@ Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Mon May 18 09:35:42 2020 (r361201) +++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Mon May 18 09:36:14 2020 (r361202) @@ -528,14 +528,14 @@ linux_cdev_pager_populate(vm_object_t vm_obj, vm_pinde struct vm_area_struct *vmap; int err; - linux_set_current(curthread); - /* get VM area structure */ vmap = linux_cdev_handle_find(vm_obj->handle); MPASS(vmap != NULL); MPASS(vmap->vm_private_data == vm_obj->handle); VM_OBJECT_WUNLOCK(vm_obj); + + linux_set_current(curthread); down_write(&vmap->vm_mm->mmap_sem); if (unlikely(vmap->vm_ops == NULL)) { From owner-svn-src-all@freebsd.org Mon May 18 09:37: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 A481F13D2D1; Mon, 18 May 2020 09:37:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYnW3yt4z4XkT; Mon, 18 May 2020 09:37:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A3DC1F8C4; Mon, 18 May 2020 09:37:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9b3I8071506; Mon, 18 May 2020 09:37:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9b3oP071505; Mon, 18 May 2020 09:37:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180937.04I9b3oP071505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:37: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: r361203 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361203 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, 18 May 2020 09:37:03 -0000 Author: hselasky Date: Mon May 18 09:37:02 2020 New Revision: 361203 URL: https://svnweb.freebsd.org/changeset/base/361203 Log: MFC r360622: Implement more scatter and gather functions in the LinuxKPI. Differential Revision: https://reviews.freebsd.org/D24611 Submitted by: ashafer_badland.io (Austin Shafer) Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/scatterlist.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/scatterlist.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon May 18 09:36:14 2020 (r361202) +++ stable/12/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon May 18 09:37:02 2020 (r361203) @@ -66,6 +66,10 @@ struct sg_page_iter { } internal; }; +struct sg_dma_page_iter { + struct sg_page_iter base; +}; + #define SCATTERLIST_MAX_SEGMENT (-1U & ~(PAGE_SIZE - 1)) #define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist)) @@ -85,6 +89,8 @@ struct sg_page_iter { #define for_each_sg_page(sgl, iter, nents, pgoffset) \ for (_sg_iter_init(sgl, iter, nents, pgoffset); \ (iter)->sg; _sg_iter_next(iter)) +#define for_each_sg_dma_page(sgl, iter, nents, pgoffset) \ + for_each_sg_page(sgl, &(iter)->base, nents, pgoffset) #define for_each_sg(sglist, sg, sgmax, iter) \ for (iter = 0, sg = (sglist); iter < (sgmax); iter++, sg = sg_next(sg)) @@ -404,6 +410,8 @@ sg_page_count(struct scatterlist *sg) { return (PAGE_ALIGN(sg->offset + sg->length) >> PAGE_SHIFT); } +#define sg_dma_page_count(sg) \ + sg_page_count(sg) static inline bool __sg_page_iter_next(struct sg_page_iter *piter) @@ -426,6 +434,8 @@ __sg_page_iter_next(struct sg_page_iter *piter) } return (1); } +#define __sg_page_iter_dma_next(itr) \ + __sg_page_iter_next(&(itr)->base) static inline void _sg_iter_init(struct scatterlist *sgl, struct sg_page_iter *iter, @@ -443,11 +453,20 @@ _sg_iter_init(struct scatterlist *sgl, struct sg_page_ } } -static inline dma_addr_t -sg_page_iter_dma_address(struct sg_page_iter *spi) -{ - return (spi->sg->dma_address + (spi->sg_pgoffset << PAGE_SHIFT)); -} +/* + * sg_page_iter_dma_address() is implemented as a macro because it + * needs to accept two different and identical structure types. This + * allows both old and new code to co-exist. The compile time assert + * adds some safety, that the structure sizes match. + */ +#define sg_page_iter_dma_address(spi) ({ \ + struct sg_page_iter *__spi = (void *)(spi); \ + dma_addr_t __dma_address; \ + CTASSERT(sizeof(*(spi)) == sizeof(*__spi)); \ + __dma_address = __spi->sg->dma_address + \ + (__spi->sg_pgoffset << PAGE_SHIFT); \ + __dma_address; \ +}) static inline struct page * sg_page_iter_page(struct sg_page_iter *piter) From owner-svn-src-all@freebsd.org Mon May 18 09:43: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 BA8E613D809; Mon, 18 May 2020 09:43:32 +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 49QYx04WQ7z4YFp; Mon, 18 May 2020 09:43:32 +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 7BB901F67F; Mon, 18 May 2020 09:43:32 +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 04I9hWCb077205; Mon, 18 May 2020 09:43:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9hWNU077204; Mon, 18 May 2020 09:43:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180943.04I9hWNU077204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:43:32 +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: r361204 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361204 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, 18 May 2020 09:43:32 -0000 Author: hselasky Date: Mon May 18 09:43:31 2020 New Revision: 361204 URL: https://svnweb.freebsd.org/changeset/base/361204 Log: MFC r360622: Implement more scatter and gather functions in the LinuxKPI. Differential Revision: https://reviews.freebsd.org/D24611 Submitted by: ashafer_badland.io (Austin Shafer) Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/scatterlist.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/scatterlist.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon May 18 09:37:02 2020 (r361203) +++ stable/11/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon May 18 09:43:31 2020 (r361204) @@ -64,6 +64,10 @@ struct sg_page_iter { } internal; }; +struct sg_dma_page_iter { + struct sg_page_iter base; +}; + #define SCATTERLIST_MAX_SEGMENT (-1U & ~(PAGE_SIZE - 1)) #define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist)) @@ -83,6 +87,8 @@ struct sg_page_iter { #define for_each_sg_page(sgl, iter, nents, pgoffset) \ for (_sg_iter_init(sgl, iter, nents, pgoffset); \ (iter)->sg; _sg_iter_next(iter)) +#define for_each_sg_dma_page(sgl, iter, nents, pgoffset) \ + for_each_sg_page(sgl, &(iter)->base, nents, pgoffset) #define for_each_sg(sglist, sg, sgmax, iter) \ for (iter = 0, sg = (sglist); iter < (sgmax); iter++, sg = sg_next(sg)) @@ -402,6 +408,8 @@ sg_page_count(struct scatterlist *sg) { return (PAGE_ALIGN(sg->offset + sg->length) >> PAGE_SHIFT); } +#define sg_dma_page_count(sg) \ + sg_page_count(sg) static inline bool __sg_page_iter_next(struct sg_page_iter *piter) @@ -424,6 +432,8 @@ __sg_page_iter_next(struct sg_page_iter *piter) } return (1); } +#define __sg_page_iter_dma_next(itr) \ + __sg_page_iter_next(&(itr)->base) static inline void _sg_iter_init(struct scatterlist *sgl, struct sg_page_iter *iter, @@ -441,11 +451,20 @@ _sg_iter_init(struct scatterlist *sgl, struct sg_page_ } } -static inline dma_addr_t -sg_page_iter_dma_address(struct sg_page_iter *spi) -{ - return (spi->sg->address + (spi->sg_pgoffset << PAGE_SHIFT)); -} +/* + * sg_page_iter_dma_address() is implemented as a macro because it + * needs to accept two different and identical structure types. This + * allows both old and new code to co-exist. The compile time assert + * adds some safety, that the structure sizes match. + */ +#define sg_page_iter_dma_address(spi) ({ \ + struct sg_page_iter *__spi = (void *)(spi); \ + dma_addr_t __dma_address; \ + CTASSERT(sizeof(*(spi)) == sizeof(*__spi)); \ + __dma_address = __spi->sg->address + \ + (__spi->sg_pgoffset << PAGE_SHIFT); \ + __dma_address; \ +}) static inline struct page * sg_page_iter_page(struct sg_page_iter *piter) From owner-svn-src-all@freebsd.org Mon May 18 09:44: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 160C413D65C; Mon, 18 May 2020 09:44:27 +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 49QYy26sYZz4YJl; Mon, 18 May 2020 09:44:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6AC31F991; Mon, 18 May 2020 09:44:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9iQiI077330; Mon, 18 May 2020 09:44:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9iQAq077329; Mon, 18 May 2020 09:44:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180944.04I9iQAq077329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:44: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: r361205 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361205 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, 18 May 2020 09:44:27 -0000 Author: hselasky Date: Mon May 18 09:44:26 2020 New Revision: 361205 URL: https://svnweb.freebsd.org/changeset/base/361205 Log: MFC r360623: Optimise use of sg_page_count() in __sg_page_iter_next() in the LinuxKPI. No need to compute value twice. No functional change intended. Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/scatterlist.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/scatterlist.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon May 18 09:43:31 2020 (r361204) +++ stable/12/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon May 18 09:44:26 2020 (r361205) @@ -416,6 +416,8 @@ sg_page_count(struct scatterlist *sg) static inline bool __sg_page_iter_next(struct sg_page_iter *piter) { + unsigned int pgcount; + if (piter->internal.nents == 0) return (0); if (piter->sg == NULL) @@ -424,8 +426,11 @@ __sg_page_iter_next(struct sg_page_iter *piter) piter->sg_pgoffset += piter->internal.pg_advance; piter->internal.pg_advance = 1; - while (piter->sg_pgoffset >= sg_page_count(piter->sg)) { - piter->sg_pgoffset -= sg_page_count(piter->sg); + while (1) { + pgcount = sg_page_count(piter->sg); + if (likely(piter->sg_pgoffset < pgcount)) + break; + piter->sg_pgoffset -= pgcount; piter->sg = sg_next(piter->sg); if (--piter->internal.nents == 0) return (0); From owner-svn-src-all@freebsd.org Mon May 18 09:45: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 E453713D5C4; Mon, 18 May 2020 09:45:13 +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 49QYyx5kB6z4Yb6; Mon, 18 May 2020 09:45:13 +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 BFA4C1FB00; Mon, 18 May 2020 09:45:13 +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 04I9jDRl077436; Mon, 18 May 2020 09:45:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9jDno077435; Mon, 18 May 2020 09:45:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180945.04I9jDno077435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:45:13 +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: r361206 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361206 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, 18 May 2020 09:45:14 -0000 Author: hselasky Date: Mon May 18 09:45:13 2020 New Revision: 361206 URL: https://svnweb.freebsd.org/changeset/base/361206 Log: MFC r360623: Optimise use of sg_page_count() in __sg_page_iter_next() in the LinuxKPI. No need to compute value twice. No functional change intended. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/scatterlist.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/scatterlist.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon May 18 09:44:26 2020 (r361205) +++ stable/11/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon May 18 09:45:13 2020 (r361206) @@ -414,6 +414,8 @@ sg_page_count(struct scatterlist *sg) static inline bool __sg_page_iter_next(struct sg_page_iter *piter) { + unsigned int pgcount; + if (piter->internal.nents == 0) return (0); if (piter->sg == NULL) @@ -422,8 +424,11 @@ __sg_page_iter_next(struct sg_page_iter *piter) piter->sg_pgoffset += piter->internal.pg_advance; piter->internal.pg_advance = 1; - while (piter->sg_pgoffset >= sg_page_count(piter->sg)) { - piter->sg_pgoffset -= sg_page_count(piter->sg); + while (1) { + pgcount = sg_page_count(piter->sg); + if (likely(piter->sg_pgoffset < pgcount)) + break; + piter->sg_pgoffset -= pgcount; piter->sg = sg_next(piter->sg); if (--piter->internal.nents == 0) return (0); From owner-svn-src-all@freebsd.org Mon May 18 09:46: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 3568113D8BB; Mon, 18 May 2020 09:46:00 +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 49QYzr0bBjz4YSc; Mon, 18 May 2020 09:46:00 +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 0F5AA1FB01; Mon, 18 May 2020 09:46:00 +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 04I9jxi0077537; Mon, 18 May 2020 09:45:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9jx3Z077533; Mon, 18 May 2020 09:45:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180945.04I9jx3Z077533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:45:59 +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: r361207 - stable/12/sys/dev/usb X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/usb X-SVN-Commit-Revision: 361207 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, 18 May 2020 09:46:00 -0000 Author: hselasky Date: Mon May 18 09:45:59 2020 New Revision: 361207 URL: https://svnweb.freebsd.org/changeset/base/361207 Log: MFC r360925: Refresh the USB device strings when a USB device is re-enumerated. Submitted by: Horse Ma Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/usb/usb_device.c stable/12/sys/dev/usb/usb_device.h stable/12/sys/dev/usb/usb_hub.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/usb_device.c ============================================================================== --- stable/12/sys/dev/usb/usb_device.c Mon May 18 09:45:13 2020 (r361206) +++ stable/12/sys/dev/usb/usb_device.c Mon May 18 09:45:59 2020 (r361207) @@ -103,7 +103,6 @@ static void usb_suspend_resume_sub(struct usb_device * uint8_t); static usb_proc_callback_t usbd_clear_stall_proc; static usb_error_t usb_config_parse(struct usb_device *, uint8_t, uint8_t); -static void usbd_set_device_strings(struct usb_device *); #if USB_HAVE_DEVCTL static void usb_notify_addq(const char *type, struct usb_device *); #endif @@ -1652,6 +1651,85 @@ usbd_clear_stall_proc(struct usb_proc_msg *_pm) } /*------------------------------------------------------------------------* + * usb_get_langid + * + * This function tries to figure out the USB string language to use. + *------------------------------------------------------------------------*/ +void +usb_get_langid(struct usb_device *udev) +{ + uint8_t *scratch_ptr; + uint8_t do_unlock; + int err; + + /* + * Workaround for buggy USB devices. + * + * It appears that some string-less USB chips will crash and + * disappear if any attempts are made to read any string + * descriptors. + * + * Try to detect such chips by checking the strings in the USB + * device descriptor. If no strings are present there we + * simply disable all USB strings. + */ + + /* Protect scratch area */ + do_unlock = usbd_ctrl_lock(udev); + + scratch_ptr = udev->scratch.data; + + if (udev->flags.no_strings) { + err = USB_ERR_INVAL; + } else if (udev->ddesc.iManufacturer || + udev->ddesc.iProduct || + udev->ddesc.iSerialNumber) { + /* read out the language ID string */ + err = usbd_req_get_string_desc(udev, NULL, + (char *)scratch_ptr, 4, 0, USB_LANGUAGE_TABLE); + } else { + err = USB_ERR_INVAL; + } + + if (err || (scratch_ptr[0] < 4)) { + udev->flags.no_strings = 1; + } else { + uint16_t langid; + uint16_t pref; + uint16_t mask; + uint8_t x; + + /* load preferred value and mask */ + pref = usb_lang_id; + mask = usb_lang_mask; + + /* align length correctly */ + scratch_ptr[0] &= ~1U; + + /* fix compiler warning */ + langid = 0; + + /* search for preferred language */ + for (x = 2; x < scratch_ptr[0]; x += 2) { + langid = UGETW(scratch_ptr + x); + if ((langid & mask) == pref) + break; + } + if (x >= scratch_ptr[0]) { + /* pick the first language as the default */ + DPRINTFN(1, "Using first language\n"); + langid = UGETW(scratch_ptr + 2); + } + + DPRINTFN(1, "Language selected: 0x%04x\n", langid); + udev->langid = langid; + } + + if (do_unlock) + usbd_ctrl_unlock(udev); +} + +/*------------------------------------------------------------------------* * usb_alloc_device * * This function allocates a new USB device. This function is called @@ -1672,13 +1750,11 @@ usb_alloc_device(device_t parent_dev, struct usb_bus * struct usb_device *udev; struct usb_device *adev; struct usb_device *hub; - uint8_t *scratch_ptr; usb_error_t err; uint8_t device_index; uint8_t config_index; uint8_t config_quirk; uint8_t set_config_failed; - uint8_t do_unlock; DPRINTF("parent_dev=%p, bus=%p, parent_hub=%p, depth=%u, " "port_index=%u, port_no=%u, speed=%u, usb_mode=%u\n", @@ -1888,76 +1964,13 @@ usb_alloc_device(device_t parent_dev, struct usb_bus * if (usb_test_quirk(&uaa, UQ_NO_STRINGS)) { udev->flags.no_strings = 1; } - /* - * Workaround for buggy USB devices. - * - * It appears that some string-less USB chips will crash and - * disappear if any attempts are made to read any string - * descriptors. - * - * Try to detect such chips by checking the strings in the USB - * device descriptor. If no strings are present there we - * simply disable all USB strings. - */ - /* Protect scratch area */ - do_unlock = usbd_ctrl_lock(udev); + usb_get_langid(udev); - scratch_ptr = udev->scratch.data; - - if (udev->flags.no_strings) { - err = USB_ERR_INVAL; - } else if (udev->ddesc.iManufacturer || - udev->ddesc.iProduct || - udev->ddesc.iSerialNumber) { - /* read out the language ID string */ - err = usbd_req_get_string_desc(udev, NULL, - (char *)scratch_ptr, 4, 0, USB_LANGUAGE_TABLE); - } else { - err = USB_ERR_INVAL; - } - - if (err || (scratch_ptr[0] < 4)) { - udev->flags.no_strings = 1; - } else { - uint16_t langid; - uint16_t pref; - uint16_t mask; - uint8_t x; - - /* load preferred value and mask */ - pref = usb_lang_id; - mask = usb_lang_mask; - - /* align length correctly */ - scratch_ptr[0] &= ~1U; - - /* fix compiler warning */ - langid = 0; - - /* search for preferred language */ - for (x = 2; (x < scratch_ptr[0]); x += 2) { - langid = UGETW(scratch_ptr + x); - if ((langid & mask) == pref) - break; - } - if (x >= scratch_ptr[0]) { - /* pick the first language as the default */ - DPRINTFN(1, "Using first language\n"); - langid = UGETW(scratch_ptr + 2); - } - - DPRINTFN(1, "Language selected: 0x%04x\n", langid); - udev->langid = langid; - } - - if (do_unlock) - usbd_ctrl_unlock(udev); - /* assume 100mA bus powered for now. Changed when configured. */ udev->power = USB_MIN_POWER; /* fetch the vendor and product strings from the device */ - usbd_set_device_strings(udev); + usb_set_device_strings(udev); if (udev->flags.usb_mode == USB_MODE_DEVICE) { /* USB device mode setup is complete */ @@ -2477,8 +2490,8 @@ struct usb_knowndev { #include "usbdevs_data.h" #endif /* USB_VERBOSE */ -static void -usbd_set_device_strings(struct usb_device *udev) +void +usb_set_device_strings(struct usb_device *udev) { struct usb_device_descriptor *udd = &udev->ddesc; #ifdef USB_VERBOSE @@ -2498,6 +2511,16 @@ usbd_set_device_strings(struct usb_device *udev) vendor_id = UGETW(udd->idVendor); product_id = UGETW(udd->idProduct); + + /* cleanup old strings, if any */ + free(udev->serial, M_USB); + free(udev->manufacturer, M_USB); + free(udev->product, M_USB); + + /* zero the string pointers */ + udev->serial = NULL; + udev->manufacturer = NULL; + udev->product = NULL; /* get serial number string */ usbd_req_get_string_any(udev, NULL, temp_ptr, temp_size, Modified: stable/12/sys/dev/usb/usb_device.h ============================================================================== --- stable/12/sys/dev/usb/usb_device.h Mon May 18 09:45:13 2020 (r361206) +++ stable/12/sys/dev/usb/usb_device.h Mon May 18 09:45:59 2020 (r361207) @@ -328,6 +328,9 @@ struct usb_endpoint *usb_endpoint_foreach(struct usb_d void usb_set_device_state(struct usb_device *, enum usb_dev_state); enum usb_dev_state usb_get_device_state(struct usb_device *); +void usb_set_device_strings(struct usb_device *); +void usb_get_langid(struct usb_device *); + uint8_t usbd_enum_lock(struct usb_device *); #if USB_HAVE_UGEN uint8_t usbd_enum_lock_sig(struct usb_device *); Modified: stable/12/sys/dev/usb/usb_hub.c ============================================================================== --- stable/12/sys/dev/usb/usb_hub.c Mon May 18 09:45:13 2020 (r361206) +++ stable/12/sys/dev/usb/usb_hub.c Mon May 18 09:45:59 2020 (r361207) @@ -472,8 +472,14 @@ uhub_explore_handle_re_enumerate(struct usb_device *ch } else { err = usbd_req_re_enumerate(child, NULL); } - if (err == 0) + if (err == 0) { + /* refresh device strings */ + usb_get_langid(child); + usb_set_device_strings(child); + + /* set default configuration */ err = usbd_set_config_index(child, 0); + } if (err == 0) { err = usb_probe_and_attach(child, USB_IFACE_INDEX_ANY); @@ -1726,6 +1732,7 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch struct usb_hub *hub; struct usb_interface *iface; struct hub_result res; + uint8_t do_unlock; if (!device_is_attached(parent)) { if (buflen) @@ -1747,6 +1754,9 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch } iface = usbd_get_iface(res.udev, res.iface_index); if (iface && iface->idesc) { + /* Make sure device information is not changed during the print. */ + do_unlock = usbd_ctrl_lock(res.udev); + snprintf(buf, buflen, "vendor=0x%04x product=0x%04x " "devclass=0x%02x devsubclass=0x%02x " "devproto=0x%02x " @@ -1768,6 +1778,9 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch iface->idesc->bInterfaceProtocol, iface->pnpinfo ? " " : "", iface->pnpinfo ? iface->pnpinfo : ""); + + if (do_unlock) + usbd_ctrl_unlock(res.udev); } else { if (buflen) { buf[0] = '\0'; From owner-svn-src-all@freebsd.org Mon May 18 09:46: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 522CF13DB00; Mon, 18 May 2020 09:46:52 +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 49QZ0r1Rsxz4YhW; Mon, 18 May 2020 09:46:52 +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 2CA391F6BD; Mon, 18 May 2020 09:46:52 +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 04I9kqiX077639; Mon, 18 May 2020 09:46:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9kpsT077636; Mon, 18 May 2020 09:46:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180946.04I9kpsT077636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:46: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: r361208 - stable/11/sys/dev/usb X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/usb X-SVN-Commit-Revision: 361208 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, 18 May 2020 09:46:52 -0000 Author: hselasky Date: Mon May 18 09:46:51 2020 New Revision: 361208 URL: https://svnweb.freebsd.org/changeset/base/361208 Log: MFC r360925: Refresh the USB device strings when a USB device is re-enumerated. Submitted by: Horse Ma Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/usb_device.c stable/11/sys/dev/usb/usb_device.h stable/11/sys/dev/usb/usb_hub.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/usb_device.c ============================================================================== --- stable/11/sys/dev/usb/usb_device.c Mon May 18 09:45:59 2020 (r361207) +++ stable/11/sys/dev/usb/usb_device.c Mon May 18 09:46:51 2020 (r361208) @@ -101,7 +101,6 @@ static void usb_suspend_resume_sub(struct usb_device * uint8_t); static usb_proc_callback_t usbd_clear_stall_proc; static usb_error_t usb_config_parse(struct usb_device *, uint8_t, uint8_t); -static void usbd_set_device_strings(struct usb_device *); #if USB_HAVE_DEVCTL static void usb_notify_addq(const char *type, struct usb_device *); #endif @@ -1650,6 +1649,85 @@ usbd_clear_stall_proc(struct usb_proc_msg *_pm) } /*------------------------------------------------------------------------* + * usb_get_langid + * + * This function tries to figure out the USB string language to use. + *------------------------------------------------------------------------*/ +void +usb_get_langid(struct usb_device *udev) +{ + uint8_t *scratch_ptr; + uint8_t do_unlock; + int err; + + /* + * Workaround for buggy USB devices. + * + * It appears that some string-less USB chips will crash and + * disappear if any attempts are made to read any string + * descriptors. + * + * Try to detect such chips by checking the strings in the USB + * device descriptor. If no strings are present there we + * simply disable all USB strings. + */ + + /* Protect scratch area */ + do_unlock = usbd_ctrl_lock(udev); + + scratch_ptr = udev->scratch.data; + + if (udev->flags.no_strings) { + err = USB_ERR_INVAL; + } else if (udev->ddesc.iManufacturer || + udev->ddesc.iProduct || + udev->ddesc.iSerialNumber) { + /* read out the language ID string */ + err = usbd_req_get_string_desc(udev, NULL, + (char *)scratch_ptr, 4, 0, USB_LANGUAGE_TABLE); + } else { + err = USB_ERR_INVAL; + } + + if (err || (scratch_ptr[0] < 4)) { + udev->flags.no_strings = 1; + } else { + uint16_t langid; + uint16_t pref; + uint16_t mask; + uint8_t x; + + /* load preferred value and mask */ + pref = usb_lang_id; + mask = usb_lang_mask; + + /* align length correctly */ + scratch_ptr[0] &= ~1U; + + /* fix compiler warning */ + langid = 0; + + /* search for preferred language */ + for (x = 2; x < scratch_ptr[0]; x += 2) { + langid = UGETW(scratch_ptr + x); + if ((langid & mask) == pref) + break; + } + if (x >= scratch_ptr[0]) { + /* pick the first language as the default */ + DPRINTFN(1, "Using first language\n"); + langid = UGETW(scratch_ptr + 2); + } + + DPRINTFN(1, "Language selected: 0x%04x\n", langid); + udev->langid = langid; + } + + if (do_unlock) + usbd_ctrl_unlock(udev); +} + +/*------------------------------------------------------------------------* * usb_alloc_device * * This function allocates a new USB device. This function is called @@ -1670,13 +1748,11 @@ usb_alloc_device(device_t parent_dev, struct usb_bus * struct usb_device *udev; struct usb_device *adev; struct usb_device *hub; - uint8_t *scratch_ptr; usb_error_t err; uint8_t device_index; uint8_t config_index; uint8_t config_quirk; uint8_t set_config_failed; - uint8_t do_unlock; DPRINTF("parent_dev=%p, bus=%p, parent_hub=%p, depth=%u, " "port_index=%u, port_no=%u, speed=%u, usb_mode=%u\n", @@ -1886,76 +1962,13 @@ usb_alloc_device(device_t parent_dev, struct usb_bus * if (usb_test_quirk(&uaa, UQ_NO_STRINGS)) { udev->flags.no_strings = 1; } - /* - * Workaround for buggy USB devices. - * - * It appears that some string-less USB chips will crash and - * disappear if any attempts are made to read any string - * descriptors. - * - * Try to detect such chips by checking the strings in the USB - * device descriptor. If no strings are present there we - * simply disable all USB strings. - */ - /* Protect scratch area */ - do_unlock = usbd_ctrl_lock(udev); + usb_get_langid(udev); - scratch_ptr = udev->scratch.data; - - if (udev->flags.no_strings) { - err = USB_ERR_INVAL; - } else if (udev->ddesc.iManufacturer || - udev->ddesc.iProduct || - udev->ddesc.iSerialNumber) { - /* read out the language ID string */ - err = usbd_req_get_string_desc(udev, NULL, - (char *)scratch_ptr, 4, 0, USB_LANGUAGE_TABLE); - } else { - err = USB_ERR_INVAL; - } - - if (err || (scratch_ptr[0] < 4)) { - udev->flags.no_strings = 1; - } else { - uint16_t langid; - uint16_t pref; - uint16_t mask; - uint8_t x; - - /* load preferred value and mask */ - pref = usb_lang_id; - mask = usb_lang_mask; - - /* align length correctly */ - scratch_ptr[0] &= ~1U; - - /* fix compiler warning */ - langid = 0; - - /* search for preferred language */ - for (x = 2; (x < scratch_ptr[0]); x += 2) { - langid = UGETW(scratch_ptr + x); - if ((langid & mask) == pref) - break; - } - if (x >= scratch_ptr[0]) { - /* pick the first language as the default */ - DPRINTFN(1, "Using first language\n"); - langid = UGETW(scratch_ptr + 2); - } - - DPRINTFN(1, "Language selected: 0x%04x\n", langid); - udev->langid = langid; - } - - if (do_unlock) - usbd_ctrl_unlock(udev); - /* assume 100mA bus powered for now. Changed when configured. */ udev->power = USB_MIN_POWER; /* fetch the vendor and product strings from the device */ - usbd_set_device_strings(udev); + usb_set_device_strings(udev); if (udev->flags.usb_mode == USB_MODE_DEVICE) { /* USB device mode setup is complete */ @@ -2475,8 +2488,8 @@ struct usb_knowndev { #include "usbdevs_data.h" #endif /* USB_VERBOSE */ -static void -usbd_set_device_strings(struct usb_device *udev) +void +usb_set_device_strings(struct usb_device *udev) { struct usb_device_descriptor *udd = &udev->ddesc; #ifdef USB_VERBOSE @@ -2496,6 +2509,16 @@ usbd_set_device_strings(struct usb_device *udev) vendor_id = UGETW(udd->idVendor); product_id = UGETW(udd->idProduct); + + /* cleanup old strings, if any */ + free(udev->serial, M_USB); + free(udev->manufacturer, M_USB); + free(udev->product, M_USB); + + /* zero the string pointers */ + udev->serial = NULL; + udev->manufacturer = NULL; + udev->product = NULL; /* get serial number string */ usbd_req_get_string_any(udev, NULL, temp_ptr, temp_size, Modified: stable/11/sys/dev/usb/usb_device.h ============================================================================== --- stable/11/sys/dev/usb/usb_device.h Mon May 18 09:45:59 2020 (r361207) +++ stable/11/sys/dev/usb/usb_device.h Mon May 18 09:46:51 2020 (r361208) @@ -326,6 +326,9 @@ struct usb_endpoint *usb_endpoint_foreach(struct usb_d void usb_set_device_state(struct usb_device *, enum usb_dev_state); enum usb_dev_state usb_get_device_state(struct usb_device *); +void usb_set_device_strings(struct usb_device *); +void usb_get_langid(struct usb_device *); + uint8_t usbd_enum_lock(struct usb_device *); #if USB_HAVE_UGEN uint8_t usbd_enum_lock_sig(struct usb_device *); Modified: stable/11/sys/dev/usb/usb_hub.c ============================================================================== --- stable/11/sys/dev/usb/usb_hub.c Mon May 18 09:45:59 2020 (r361207) +++ stable/11/sys/dev/usb/usb_hub.c Mon May 18 09:46:51 2020 (r361208) @@ -470,8 +470,14 @@ uhub_explore_handle_re_enumerate(struct usb_device *ch } else { err = usbd_req_re_enumerate(child, NULL); } - if (err == 0) + if (err == 0) { + /* refresh device strings */ + usb_get_langid(child); + usb_set_device_strings(child); + + /* set default configuration */ err = usbd_set_config_index(child, 0); + } if (err == 0) { err = usb_probe_and_attach(child, USB_IFACE_INDEX_ANY); @@ -1724,6 +1730,7 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch struct usb_hub *hub; struct usb_interface *iface; struct hub_result res; + uint8_t do_unlock; if (!device_is_attached(parent)) { if (buflen) @@ -1745,6 +1752,9 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch } iface = usbd_get_iface(res.udev, res.iface_index); if (iface && iface->idesc) { + /* Make sure device information is not changed during the print. */ + do_unlock = usbd_ctrl_lock(res.udev); + snprintf(buf, buflen, "vendor=0x%04x product=0x%04x " "devclass=0x%02x devsubclass=0x%02x " "devproto=0x%02x " @@ -1766,6 +1776,9 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch iface->idesc->bInterfaceProtocol, iface->pnpinfo ? " " : "", iface->pnpinfo ? iface->pnpinfo : ""); + + if (do_unlock) + usbd_ctrl_unlock(res.udev); } else { if (buflen) { buf[0] = '\0'; From owner-svn-src-all@freebsd.org Mon May 18 10:07: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 8260213E021; Mon, 18 May 2020 10:07:02 +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 49QZS631Szz4ZM7; Mon, 18 May 2020 10:07:02 +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 5E53A1FE1B; Mon, 18 May 2020 10:07:02 +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 04IA72Wq089941; Mon, 18 May 2020 10:07:02 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IA713t089936; Mon, 18 May 2020 10:07:01 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005181007.04IA713t089936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 May 2020 10:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361209 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361209 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, 18 May 2020 10:07:02 -0000 Author: tuexen Date: Mon May 18 10:07:01 2020 New Revision: 361209 URL: https://svnweb.freebsd.org/changeset/base/361209 Log: Handle failures of snprintf(). MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Mon May 18 09:46:51 2020 (r361208) +++ head/sys/netinet/sctp_asconf.c Mon May 18 10:07:01 2020 (r361209) @@ -1706,8 +1706,9 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset, char msg[SCTP_DIAG_INFO_LEN]; SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf_ack: got unexpected next serial number! Aborting asoc!\n"); - snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", - serial_num); + if (snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", serial_num) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_no_unlock = 1; Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon May 18 09:46:51 2020 (r361208) +++ head/sys/netinet/sctp_indata.c Mon May 18 10:07:01 2020 (r361209) @@ -434,22 +434,26 @@ sctp_abort_in_reasm(struct sctp_tcb *stcb, struct mbuf *oper; if (stcb->asoc.idata_supported) { - snprintf(msg, sizeof(msg), + if (snprintf(msg, sizeof(msg), "Reass %x,CF:%x,TSN=%8.8x,SID=%4.4x,FSN=%8.8x,MID:%8.8x", opspot, control->fsn_included, chk->rec.data.tsn, chk->rec.data.sid, - chk->rec.data.fsn, chk->rec.data.mid); + chk->rec.data.fsn, chk->rec.data.mid) < 0) { + msg[0] = '\0'; + } } else { - snprintf(msg, sizeof(msg), + if (snprintf(msg, sizeof(msg), "Reass %x,CI:%x,TSN=%8.8x,SID=%4.4x,FSN=%4.4x,SSN:%4.4x", opspot, control->fsn_included, chk->rec.data.tsn, chk->rec.data.sid, chk->rec.data.fsn, - (uint16_t)chk->rec.data.mid); + (uint16_t)chk->rec.data.mid) < 0) { + msg[0] = '\0'; + } } oper = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); sctp_m_freem(chk->data); @@ -533,15 +537,19 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, */ TAILQ_INSERT_HEAD(&strm->inqueue, control, next_instrm); if (asoc->idata_supported) { - snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", + if (snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", strm->last_mid_delivered, control->sinfo_tsn, - control->sinfo_stream, control->mid); + control->sinfo_stream, control->mid) < 0) { + msg[0] = '\0'; + } } else { - snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + if (snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", (uint16_t)strm->last_mid_delivered, control->sinfo_tsn, control->sinfo_stream, - (uint16_t)control->mid); + (uint16_t)control->mid) < 0) { + msg[0] = '\0'; + } } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_2; @@ -648,9 +656,10 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, * to put it on the queue. */ if (sctp_place_control_in_stream(strm, asoc, control)) { - snprintf(msg, sizeof(msg), - "Queue to str MID: %u duplicate", - control->mid); + if (snprintf(msg, sizeof(msg), + "Queue to str MID: %u duplicate", control->mid) < 0) { + msg[0] = '\0'; + } sctp_clean_up_control(stcb, control); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_3; @@ -1881,8 +1890,9 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc * can *not* be fsn 0. XXX: This can happen in case of a * wrap around. Ignore is for now. */ - snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", - mid, chk_flags); + if (snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", mid, chk_flags) < 0) { + msg[0] = '\0'; + } goto err_out; } control = sctp_find_reasm_entry(&asoc->strmin[sid], mid, ordered, asoc->idata_supported); @@ -1893,7 +1903,9 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc if (control != NULL) { /* We found something, does it belong? */ if (ordered && (mid != control->mid)) { - snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid); + if (snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid) < 0) { + msg[0] = '\0'; + } err_out: op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; @@ -1906,8 +1918,11 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc * We can't have a switched order with an * unordered chunk */ - snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", - tsn); + if (snprintf(msg, sizeof(msg), + "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", + tsn) < 0) { + msg[0] = '\0'; + } goto err_out; } if (!ordered && (((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED) == 0)) { @@ -1915,8 +1930,11 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc * We can't have a switched unordered with a * ordered chunk */ - snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", - tsn); + if (snprintf(msg, sizeof(msg), + "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", + tsn) < 0) { + msg[0] = '\0'; + } goto err_out; } } @@ -1930,12 +1948,18 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc if (ordered || asoc->idata_supported) { SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x dup detected on MID: %u\n", chk_flags, mid); - snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid); + if (snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid) < 0) { + msg[0] = '\0'; + } goto err_out; } else { if ((tsn == control->fsn_included + 1) && (control->end_added == 0)) { - snprintf(msg, sizeof(msg), "Illegal message sequence, missing end for MID: %8.8x", control->fsn_included); + if (snprintf(msg, sizeof(msg), + "Illegal message sequence, missing end for MID: %8.8x", + control->fsn_included) < 0) { + msg[0] = '\0'; + } goto err_out; } else { control = NULL; @@ -2032,17 +2056,21 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc mid, asoc->strmin[sid].last_mid_delivered); if (asoc->idata_supported) { - snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", + if (snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", asoc->strmin[sid].last_mid_delivered, tsn, sid, - mid); + mid) < 0) { + msg[0] = '\0'; + } } else { - snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + if (snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", (uint16_t)asoc->strmin[sid].last_mid_delivered, tsn, sid, - (uint16_t)mid); + (uint16_t)mid) < 0) { + msg[0] = '\0'; + } } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17; @@ -2769,7 +2797,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated"); + if (snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated") < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -2780,7 +2810,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated"); + if (snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated") < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -2803,9 +2835,11 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "%s chunk of length %u", + if (snprintf(msg, sizeof(msg), "%s chunk of length %u", ch->chunk_type == SCTP_DATA ? "DATA" : "I-DATA", - chk_length); + chk_length) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_22; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -2874,8 +2908,10 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", - ch->chunk_type); + if (snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", + ch->chunk_type) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (2); @@ -2893,8 +2929,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "Chunk of length %u", - chk_length); + if (snprintf(msg, sizeof(msg), "Chunk of length %u", chk_length) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_23; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -4043,8 +4080,11 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 *abort_now = 1; /* XXX */ - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", - cumack, send_s); + if (snprintf(msg, sizeof(msg), + "Cum ack %8.8x greater or equal than TSN %8.8x", + cumack, send_s) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -4585,8 +4625,11 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int o hopeless_peer: *abort_now = 1; /* XXX */ - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", - cum_ack, send_s); + if (snprintf(msg, sizeof(msg), + "Cum ack %8.8x greater or equal than TSN %8.8x", + cum_ack, send_s) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_28; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -5629,9 +5672,11 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, * give out). This must be an attacker. */ *abort_flag = 1; - snprintf(msg, sizeof(msg), + if (snprintf(msg, sizeof(msg), "New cum ack %8.8x too high, highest TSN %8.8x", - new_cum_tsn, asoc->highest_tsn_inside_map); + new_cum_tsn, asoc->highest_tsn_inside_map) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_36; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Mon May 18 09:46:51 2020 (r361208) +++ head/sys/netinet/sctp_input.c Mon May 18 10:07:01 2020 (r361209) @@ -4692,7 +4692,9 @@ sctp_process_control(struct mbuf *m, int iphlen, int * } } if (stcb == NULL) { - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); /* no association, so it's out of the blue... */ @@ -4734,7 +4736,9 @@ sctp_process_control(struct mbuf *m, int iphlen, int * if (stcb != NULL) { SCTP_TCB_UNLOCK(stcb); } - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, *offset, src, dst, @@ -5671,7 +5675,9 @@ sctp_common_input_processing(struct mbuf **mm, int iph SCTP_TCB_UNLOCK(stcb); stcb = NULL; SCTP_PROBE5(receive, NULL, stcb, m, stcb, sh); - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, @@ -5733,7 +5739,9 @@ sctp_common_input_processing(struct mbuf **mm, int iph if (stcb == NULL) { /* out of the blue DATA chunk */ SCTP_PROBE5(receive, NULL, NULL, m, NULL, sh); - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, @@ -5799,7 +5807,9 @@ sctp_common_input_processing(struct mbuf **mm, int iph /* * We consider OOTB any data sent during asoc setup. */ - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Mon May 18 09:46:51 2020 (r361208) +++ head/sys/netinet/sctp_output.c Mon May 18 10:07:01 2020 (r361209) @@ -5581,7 +5581,9 @@ do_a_abort: if (op_err == NULL) { char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); + if (snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); } @@ -6758,8 +6760,10 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct s char msg[SCTP_DIAG_INFO_LEN]; abort_anyway: - snprintf(msg, sizeof(msg), - "%s:%d at %s", __FILE__, __LINE__, __func__); + if (snprintf(msg, sizeof(msg), + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); atomic_add_int(&stcb->asoc.refcnt, 1); @@ -9626,8 +9630,10 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp, struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up", - chk->rec.data.tsn, chk->snd_count); + if (snprintf(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up", + chk->rec.data.tsn, chk->snd_count) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); atomic_add_int(&stcb->asoc.refcnt, 1); @@ -13610,8 +13616,10 @@ dataless_eof: atomic_add_int(&stcb->asoc.refcnt, -1); free_cnt_applied = 0; } - snprintf(msg, sizeof(msg), - "%s:%d at %s", __FILE__, __LINE__, __func__); + if (snprintf(msg, sizeof(msg), + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); NET_EPOCH_ENTER(et); Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon May 18 09:46:51 2020 (r361208) +++ head/sys/netinet/sctp_pcb.c Mon May 18 10:07:01 2020 (r361209) @@ -544,9 +544,13 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint3 atomic_add_int(&vrf->refcount, 1); sctp_ifnp->ifn_mtu = SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, addr->sa_family); if (if_name != NULL) { - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name); + if (snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name) < 0) { + sctp_ifnp->ifn_name[0] = '\0'; + } } else { - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown"); + if (snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown") < 0) { + sctp_ifnp->ifn_name[0] = '\0'; + } } hash_ifn_head = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & SCTP_BASE_INFO(vrf_ifn_hashmark))]; LIST_INIT(&sctp_ifnp->ifalist); @@ -6221,8 +6225,10 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s * in setup state we * abort this guy */ - snprintf(msg, sizeof(msg), - "%s:%d at %s", __FILE__, __LINE__, __func__); + if (snprintf(msg, sizeof(msg), + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_abort_an_association(stcb_tmp->sctp_ep, @@ -6321,8 +6327,10 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s * in setup state we * abort this guy */ - snprintf(msg, sizeof(msg), - "%s:%d at %s", __FILE__, __LINE__, __func__); + if (snprintf(msg, sizeof(msg), + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { + msg[0] = '\0'; + } op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_abort_an_association(stcb_tmp->sctp_ep, From owner-svn-src-all@freebsd.org Mon May 18 12:36: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 500082CA119; Mon, 18 May 2020 12:36:29 +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 49QdmY1PQqz3T4R; Mon, 18 May 2020 12:36:29 +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 2B14B216B5; Mon, 18 May 2020 12:36:29 +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 04ICaSlW081332; Mon, 18 May 2020 12:36:28 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04ICaSxs081331; Mon, 18 May 2020 12:36:28 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202005181236.04ICaSxs081331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 18 May 2020 12:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361210 - head/contrib/netbsd-tests/lib/libexecinfo X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libexecinfo X-SVN-Commit-Revision: 361210 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, 18 May 2020 12:36:29 -0000 Author: lwhsu Date: Mon May 18 12:36:28 2020 New Revision: 361210 URL: https://svnweb.freebsd.org/changeset/base/361210 Log: Temporarily disable failing case in CI of amd64: - lib.libexecinfo.backtrace_test.backtrace_fmt_basic PR: 246537 Sponsored by: The FreeBSD Foundation Modified: head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Modified: head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c ============================================================================== --- head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Mon May 18 10:07:01 2020 (r361209) +++ head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Mon May 18 12:36:28 2020 (r361210) @@ -151,6 +151,11 @@ ATF_TC_HEAD(backtrace_fmt_basic, tc) ATF_TC_BODY(backtrace_fmt_basic, tc) { +#if defined(__amd64__) + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/246537"); +#endif + myfunc(12); if (prevent_inline) From owner-svn-src-all@freebsd.org Mon May 18 14:37: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 2BFC12CC61D; Mon, 18 May 2020 14:37: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 49QhRq0LClz3ZrQ; Mon, 18 May 2020 14:37: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 0274323021; Mon, 18 May 2020 14:37: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 04IEbAjR054652; Mon, 18 May 2020 14:37:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IEbA6J054651; Mon, 18 May 2020 14:37:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005181437.04IEbA6J054651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 18 May 2020 14:37: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: r361211 - 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: 361211 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, 18 May 2020 14:37:11 -0000 Author: kib Date: Mon May 18 14:37:10 2020 New Revision: 361211 URL: https://svnweb.freebsd.org/changeset/base/361211 Log: MFC r361077, r361078, r361079: Improve comment for compat32 handling of sysctl hw.pagesizes. Modified: stable/12/sys/kern/kern_mib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_mib.c ============================================================================== --- stable/12/sys/kern/kern_mib.c Mon May 18 12:36:28 2020 (r361210) +++ stable/12/sys/kern/kern_mib.c Mon May 18 14:37:10 2020 (r361211) @@ -240,8 +240,9 @@ sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS) if (req->flags & SCTL_MASK32) { /* - * Recreate the "pagesizes" array with 32-bit elements. Truncate - * any page size greater than UINT32_MAX to zero. + * Recreate the "pagesizes" array with 32-bit elements. + * Truncate any page size greater than UINT32_MAX to zero, + * which assumes that page sizes are powers of two. */ for (i = 0; i < MAXPAGESIZES; i++) pagesizes32[i] = (uint32_t)pagesizes[i]; From owner-svn-src-all@freebsd.org Mon May 18 14:38: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 5C3242CC3D4; Mon, 18 May 2020 14:38: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 49QhTJ1nJhz3b7w; Mon, 18 May 2020 14:38: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 382A022FAB; Mon, 18 May 2020 14:38:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IEcS1F054761; Mon, 18 May 2020 14:38:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IEcSXK054760; Mon, 18 May 2020 14:38:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005181438.04IEcSXK054760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 18 May 2020 14:38: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: r361212 - 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: 361212 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, 18 May 2020 14:38:28 -0000 Author: kib Date: Mon May 18 14:38:27 2020 New Revision: 361212 URL: https://svnweb.freebsd.org/changeset/base/361212 Log: MFC r361077, r361078, r361079: Improve comment for compat32 handling of sysctl hw.pagesizes. Modified: stable/11/sys/kern/kern_mib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_mib.c ============================================================================== --- stable/11/sys/kern/kern_mib.c Mon May 18 14:37:10 2020 (r361211) +++ stable/11/sys/kern/kern_mib.c Mon May 18 14:38:27 2020 (r361212) @@ -235,8 +235,9 @@ sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS) if (req->flags & SCTL_MASK32) { /* - * Recreate the "pagesizes" array with 32-bit elements. Truncate - * any page size greater than UINT32_MAX to zero. + * Recreate the "pagesizes" array with 32-bit elements. + * Truncate any page size greater than UINT32_MAX to zero, + * which assumes that page sizes are powers of two. */ for (i = 0; i < MAXPAGESIZES; i++) pagesizes32[i] = (uint32_t)pagesizes[i]; From owner-svn-src-all@freebsd.org Mon May 18 15:00: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 907202CCF82; Mon, 18 May 2020 15:00:19 +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 49QhyW3G4Tz3cMc; Mon, 18 May 2020 15:00:19 +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 6B073234E1; Mon, 18 May 2020 15:00:19 +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 04IF0JGc067635; Mon, 18 May 2020 15:00:19 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IF0Jmu067634; Mon, 18 May 2020 15:00:19 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005181500.04IF0Jmu067634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 May 2020 15:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361213 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361213 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, 18 May 2020 15:00:19 -0000 Author: tuexen Date: Mon May 18 15:00:18 2020 New Revision: 361213 URL: https://svnweb.freebsd.org/changeset/base/361213 Log: Whitespace change. MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon May 18 14:38:27 2020 (r361212) +++ head/sys/netinet/sctputil.c Mon May 18 15:00:18 2020 (r361213) @@ -1560,8 +1560,8 @@ select_a_new_ep: iteration_count = 0; } KASSERT(it->inp == it->stcb->sctp_ep, - ("%s: stcb %p does not belong to inp %p, but inp %p", - __func__, it->stcb, it->inp, it->stcb->sctp_ep)); + ("%s: stcb %p does not belong to inp %p, but inp %p", + __func__, it->stcb, it->inp, it->stcb->sctp_ep)); /* run function on this one */ (*it->function_assoc) (it->inp, it->stcb, it->pointer, it->val); From owner-svn-src-all@freebsd.org Mon May 18 15:02: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 013442CCFA5; Mon, 18 May 2020 15:02:16 +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 49Qj0l6HVmz3cJj; Mon, 18 May 2020 15:02:15 +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 D322A2360C; Mon, 18 May 2020 15:02:15 +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 04IF2FwC072443; Mon, 18 May 2020 15:02:15 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IF2F7V072442; Mon, 18 May 2020 15:02:15 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005181502.04IF2F7V072442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 May 2020 15:02:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361214 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361214 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, 18 May 2020 15:02:16 -0000 Author: tuexen Date: Mon May 18 15:02:15 2020 New Revision: 361214 URL: https://svnweb.freebsd.org/changeset/base/361214 Log: Fix logical condition by looking at usecs. This issue was found by cpp-check running on the userland stack. MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon May 18 15:00:18 2020 (r361213) +++ head/sys/netinet/sctputil.c Mon May 18 15:02:15 2020 (r361214) @@ -2933,7 +2933,7 @@ sctp_calculate_rto(struct sctp_tcb *stcb, (void)SCTP_GETTIME_TIMEVAL(&now); } if ((old->tv_sec > now.tv_sec) || - ((old->tv_sec == now.tv_sec) && (old->tv_sec > now.tv_sec))) { + ((old->tv_sec == now.tv_sec) && (old->tv_usec > now.tv_usec))) { /* The starting point is in the future. */ return (0); } From owner-svn-src-all@freebsd.org Mon May 18 15:03: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 E54EA2CD23C; Mon, 18 May 2020 15:03:52 +0000 (UTC) (envelope-from afedorov@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Qj2c5mTQz3cbt; Mon, 18 May 2020 15:03:52 +0000 (UTC) (envelope-from afedorov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0C9023708; Mon, 18 May 2020 15:03:52 +0000 (UTC) (envelope-from afedorov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IF3qkj073320; Mon, 18 May 2020 15:03:52 GMT (envelope-from afedorov@FreeBSD.org) Received: (from afedorov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IF3q8q073319; Mon, 18 May 2020 15:03:52 GMT (envelope-from afedorov@FreeBSD.org) Message-Id: <202005181503.04IF3q8q073319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: afedorov set sender to afedorov@FreeBSD.org using -f From: Aleksandr Fedorov Date: Mon, 18 May 2020 15:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361215 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: afedorov X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 361215 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, 18 May 2020 15:03:53 -0000 Author: afedorov Date: Mon May 18 15:03:52 2020 New Revision: 361215 URL: https://svnweb.freebsd.org/changeset/base/361215 Log: bhyve(8): Add the netgraph network backend decription to the manpage. Reviewed by: vmaffione, bcr Approved by: vmaffione (mentor) Sponsored by: vstack.com Differential Revision: https://reviews.freebsd.org/D24846 Modified: head/usr.sbin/bhyve/bhyve.8 Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Mon May 18 15:02:15 2020 (r361214) +++ head/usr.sbin/bhyve/bhyve.8 Mon May 18 15:03:52 2020 (r361215) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 5, 2020 +.Dd May 18, 2020 .Dt BHYVE 8 .Os .Sh NAME @@ -291,10 +291,11 @@ If is not specified, the device emulation has no backend and can be considered unconnected. .Pp -Network devices: +Network backends: .Bl -tag -width 10n .It Ar tapN Ns Oo , Ns Ar mac=xx:xx:xx:xx:xx:xx Oc Ns Oo , Ns Ar mtu=N Oc .It Ar vmnetN Ns Oo , Ns Ar mac=xx:xx:xx:xx:xx:xx Oc Ns Oo , Ns Ar mtu=N Oc +.It Ar netgraph,path=ADDRESS,peerhook=HOOK Ns Oo , Ns Ar socket=NAME Oc Ns Oo , Ns Ar hook=HOOK Oc Ns Oo , Ns Ar mac=xx:xx:xx:xx:xx:xx Oc Ns Oo , Ns Ar mtu=N Oc .Pp If .Ar mac @@ -310,6 +311,27 @@ With virtio-net devices, the .Ar mtu parameter can be specified to inform the guest about the largest MTU that should be allowed, expressed in bytes. +.Pp +With netgraph backend, the +.Ar path +and +.Ar peerhook +parameters must be specified to set the destination node and corresponding hook. +The optional parameters +.Ar socket +and +.Ar hook +may be used to set the +.Xr ng_socket 4 +node name and source hook. +The +.Ar ADDRESS , +.Ar HOOK +and +.Ar NAME +must comply with +.Xr netgraph 4 +addressing rules. .El .Pp Block storage devices: @@ -670,6 +692,8 @@ bhyve -c 2 -m 4G -w -H \\ .Ed .Sh SEE ALSO .Xr bhyve 4 , +.Xr netgraph 4 , +.Xr ng_socket 4 , .Xr nmdm 4 , .Xr vmm 4 , .Xr ethers 5 , From owner-svn-src-all@freebsd.org Mon May 18 15:06: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 21D122CD38D; Mon, 18 May 2020 15:06:00 +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 49Qj5406Vzz3d4H; Mon, 18 May 2020 15:06:00 +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 F332523616; Mon, 18 May 2020 15:05:59 +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 04IF5xM6073522; Mon, 18 May 2020 15:05:59 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IF5x0U073521; Mon, 18 May 2020 15:05:59 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202005181505.04IF5x0U073521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 18 May 2020 15:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361216 - head/usr.sbin/acpi/acpidump X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/usr.sbin/acpi/acpidump X-SVN-Commit-Revision: 361216 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, 18 May 2020 15:06:00 -0000 Author: andrew Date: Mon May 18 15:05:59 2020 New Revision: 361216 URL: https://svnweb.freebsd.org/changeset/base/361216 Log: Allow the FACS and XFACS to be zero in acpidump. These are allowed to be zero when the hardware reduced APCI flag is set Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D23207 Modified: head/usr.sbin/acpi/acpidump/acpi.c Modified: head/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- head/usr.sbin/acpi/acpidump/acpi.c Mon May 18 15:03:52 2020 (r361215) +++ head/usr.sbin/acpi/acpidump/acpi.c Mon May 18 15:05:59 2020 (r361216) @@ -245,6 +245,7 @@ acpi_handle_fadt(ACPI_TABLE_HEADER *sdp) ACPI_TABLE_HEADER *dsdp; ACPI_TABLE_FACS *facs; ACPI_TABLE_FADT *fadt; + vm_offset_t addr; int fadt_revision; fadt = (ACPI_TABLE_FADT *)sdp; @@ -252,12 +253,17 @@ acpi_handle_fadt(ACPI_TABLE_HEADER *sdp) fadt_revision = acpi_get_fadt_revision(fadt); if (fadt_revision == 1) - facs = (ACPI_TABLE_FACS *)acpi_map_sdt(fadt->Facs); + addr = fadt->Facs; else - facs = (ACPI_TABLE_FACS *)acpi_map_sdt(fadt->XFacs); - if (memcmp(facs->Signature, ACPI_SIG_FACS, 4) != 0 || facs->Length < 64) - errx(1, "FACS is corrupt"); - acpi_print_facs(facs); + addr = fadt->XFacs; + if (addr != 0) { + facs = (ACPI_TABLE_FACS *)acpi_map_sdt(addr); + + if (memcmp(facs->Signature, ACPI_SIG_FACS, 4) != 0 || + facs->Length < 64) + errx(1, "FACS is corrupt"); + acpi_print_facs(facs); + } if (fadt_revision == 1) dsdp = (ACPI_TABLE_HEADER *)acpi_map_sdt(fadt->Dsdt); From owner-svn-src-all@freebsd.org Mon May 18 15:39: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 BB2132CDF29; Mon, 18 May 2020 15:39:01 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (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 49Qjq93YY8z3fdZ; Mon, 18 May 2020 15:39:01 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f52.google.com with SMTP id a68so8379554otb.10; Mon, 18 May 2020 08:39:01 -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:reply-to :from:date:message-id:subject:to:cc; bh=0LcTR2IyUtvqpuiuc1h/s5Tf2+kg7L56DEidAlFsuF0=; b=IR+K7Lmx8chNL/63lakbKE+yY4DVWHoNp6/q9Xex33kWGe2SEe2oDneqWTvS4g++GT gzTFYbQdNWN7yL5X96QYzeb5dtOPsVicwcdysLZGkqueXmCo7mGiUcdId8G2FUO8RoOJ ZokrK+0IN3rPQvHoly7U23ZlY7cskYeomr+k+THMSbU5OTFoVdsTfFYc5B0H0II2juuM IkFbmt1O+7w8hi4XRExh3fkS/mpWzTRYsl+potGXDxDJqXxjtk9pMqw0tHFYctNUmptn 3bmRX9wMjrcefJHoJEYmlGI5kmg177/CXRv7V2ZLoUh+Qi54Wdu3IZUGzTWJQiR5ImMR yGGw== X-Gm-Message-State: AOAM530NTnypDqWeKhDNj+HKP8tKdKnoAU76AcYtni4m9XAHbMB58ggw PkmD7r2ZoRwoJAmWVUrPNYWrs57R X-Google-Smtp-Source: ABdhPJxjXgjIn77zot3e2DwOksAIvG40M3hPSfdwN7KfXaNix1XV4UC19Nc2aTeK/lTBIStd6O93gw== X-Received: by 2002:a9d:20e7:: with SMTP id x94mr7767162ota.260.1589816339308; Mon, 18 May 2020 08:38:59 -0700 (PDT) Received: from mail-oo1-f43.google.com (mail-oo1-f43.google.com. [209.85.161.43]) by smtp.gmail.com with ESMTPSA id p18sm2888714oth.2.2020.05.18.08.38.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 May 2020 08:38:59 -0700 (PDT) Received: by mail-oo1-f43.google.com with SMTP id a83so2119312oob.9; Mon, 18 May 2020 08:38:58 -0700 (PDT) X-Received: by 2002:a4a:9c09:: with SMTP id y9mr11834155ooj.43.1589816338243; Mon, 18 May 2020 08:38:58 -0700 (PDT) MIME-Version: 1.0 References: <202005181007.04IA713t089936@repo.freebsd.org> In-Reply-To: <202005181007.04IA713t089936@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 18 May 2020 08:38:46 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361209 - head/sys/netinet To: Michael Tuexen Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49Qjq93YY8z3fdZ 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: Mon, 18 May 2020 15:39:01 -0000 Hi Michael, These changes are a bit odd. The only reason a standards-compliant snprintf() would fail to nul-terminate a buffer is if the provided buffer had length zero. Since this is not the case in any of these uses, I wonder why this revision was made? Does a SCTP downstream have a broken snprintf implementation, and if so, wouldn't it make more sense to create a standards-compliant portability shim for that platform instead of this more invasive change? FreeBSD's snprintf(9) does not have this bug, nor does its snprintf(3). Best regards, Conrad On Mon, May 18, 2020 at 3:07 AM Michael Tuexen wrote: > > Author: tuexen > Date: Mon May 18 10:07:01 2020 > New Revision: 361209 > URL: https://svnweb.freebsd.org/changeset/base/361209 > > Log: > Handle failures of snprintf(). > > MFC after: 3 days > > Modified: > head/sys/netinet/sctp_asconf.c > head/sys/netinet/sctp_indata.c > head/sys/netinet/sctp_input.c > head/sys/netinet/sctp_output.c > head/sys/netinet/sctp_pcb.c > > Modified: head/sys/netinet/sctp_asconf.c > ============================================================================== > --- head/sys/netinet/sctp_asconf.c Mon May 18 09:46:51 2020 (r361208) > +++ head/sys/netinet/sctp_asconf.c Mon May 18 10:07:01 2020 (r361209) > @@ -1706,8 +1706,9 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset, > char msg[SCTP_DIAG_INFO_LEN]; > > SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf_ack: got unexpected next serial number! Aborting asoc!\n"); > - snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", > - serial_num); > + if (snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", serial_num) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); > *abort_no_unlock = 1; > > Modified: head/sys/netinet/sctp_indata.c > ============================================================================== > --- head/sys/netinet/sctp_indata.c Mon May 18 09:46:51 2020 (r361208) > +++ head/sys/netinet/sctp_indata.c Mon May 18 10:07:01 2020 (r361209) > @@ -434,22 +434,26 @@ sctp_abort_in_reasm(struct sctp_tcb *stcb, > struct mbuf *oper; > > if (stcb->asoc.idata_supported) { > - snprintf(msg, sizeof(msg), > + if (snprintf(msg, sizeof(msg), > "Reass %x,CF:%x,TSN=%8.8x,SID=%4.4x,FSN=%8.8x,MID:%8.8x", > opspot, > control->fsn_included, > chk->rec.data.tsn, > chk->rec.data.sid, > - chk->rec.data.fsn, chk->rec.data.mid); > + chk->rec.data.fsn, chk->rec.data.mid) < 0) { > + msg[0] = '\0'; > + } > } else { > - snprintf(msg, sizeof(msg), > + if (snprintf(msg, sizeof(msg), > "Reass %x,CI:%x,TSN=%8.8x,SID=%4.4x,FSN=%4.4x,SSN:%4.4x", > opspot, > control->fsn_included, > chk->rec.data.tsn, > chk->rec.data.sid, > chk->rec.data.fsn, > - (uint16_t)chk->rec.data.mid); > + (uint16_t)chk->rec.data.mid) < 0) { > + msg[0] = '\0'; > + } > } > oper = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > sctp_m_freem(chk->data); > @@ -533,15 +537,19 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, > */ > TAILQ_INSERT_HEAD(&strm->inqueue, control, next_instrm); > if (asoc->idata_supported) { > - snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", > + if (snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", > strm->last_mid_delivered, control->sinfo_tsn, > - control->sinfo_stream, control->mid); > + control->sinfo_stream, control->mid) < 0) { > + msg[0] = '\0'; > + } > } else { > - snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", > + if (snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", > (uint16_t)strm->last_mid_delivered, > control->sinfo_tsn, > control->sinfo_stream, > - (uint16_t)control->mid); > + (uint16_t)control->mid) < 0) { > + msg[0] = '\0'; > + } > } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_2; > @@ -648,9 +656,10 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, > * to put it on the queue. > */ > if (sctp_place_control_in_stream(strm, asoc, control)) { > - snprintf(msg, sizeof(msg), > - "Queue to str MID: %u duplicate", > - control->mid); > + if (snprintf(msg, sizeof(msg), > + "Queue to str MID: %u duplicate", control->mid) < 0) { > + msg[0] = '\0'; > + } > sctp_clean_up_control(stcb, control); > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_3; > @@ -1881,8 +1890,9 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > * can *not* be fsn 0. XXX: This can happen in case of a > * wrap around. Ignore is for now. > */ > - snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", > - mid, chk_flags); > + if (snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", mid, chk_flags) < 0) { > + msg[0] = '\0'; > + } > goto err_out; > } > control = sctp_find_reasm_entry(&asoc->strmin[sid], mid, ordered, asoc->idata_supported); > @@ -1893,7 +1903,9 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > if (control != NULL) { > /* We found something, does it belong? */ > if (ordered && (mid != control->mid)) { > - snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid); > + if (snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid) < 0) { > + msg[0] = '\0'; > + } > err_out: > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; > @@ -1906,8 +1918,11 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > * We can't have a switched order with an > * unordered chunk > */ > - snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", > - tsn); > + if (snprintf(msg, sizeof(msg), > + "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", > + tsn) < 0) { > + msg[0] = '\0'; > + } > goto err_out; > } > if (!ordered && (((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED) == 0)) { > @@ -1915,8 +1930,11 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > * We can't have a switched unordered with a > * ordered chunk > */ > - snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", > - tsn); > + if (snprintf(msg, sizeof(msg), > + "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", > + tsn) < 0) { > + msg[0] = '\0'; > + } > goto err_out; > } > } > @@ -1930,12 +1948,18 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > if (ordered || asoc->idata_supported) { > SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x dup detected on MID: %u\n", > chk_flags, mid); > - snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid); > + if (snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid) < 0) { > + msg[0] = '\0'; > + } > goto err_out; > } else { > if ((tsn == control->fsn_included + 1) && > (control->end_added == 0)) { > - snprintf(msg, sizeof(msg), "Illegal message sequence, missing end for MID: %8.8x", control->fsn_included); > + if (snprintf(msg, sizeof(msg), > + "Illegal message sequence, missing end for MID: %8.8x", > + control->fsn_included) < 0) { > + msg[0] = '\0'; > + } > goto err_out; > } else { > control = NULL; > @@ -2032,17 +2056,21 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > mid, asoc->strmin[sid].last_mid_delivered); > > if (asoc->idata_supported) { > - snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", > + if (snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", > asoc->strmin[sid].last_mid_delivered, > tsn, > sid, > - mid); > + mid) < 0) { > + msg[0] = '\0'; > + } > } else { > - snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", > + if (snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", > (uint16_t)asoc->strmin[sid].last_mid_delivered, > tsn, > sid, > - (uint16_t)mid); > + (uint16_t)mid) < 0) { > + msg[0] = '\0'; > + } > } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17; > @@ -2769,7 +2797,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o > struct mbuf *op_err; > char msg[SCTP_DIAG_INFO_LEN]; > > - snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated"); > + if (snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated") < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; > sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); > @@ -2780,7 +2810,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o > struct mbuf *op_err; > char msg[SCTP_DIAG_INFO_LEN]; > > - snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated"); > + if (snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated") < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; > sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); > @@ -2803,9 +2835,11 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o > struct mbuf *op_err; > char msg[SCTP_DIAG_INFO_LEN]; > > - snprintf(msg, sizeof(msg), "%s chunk of length %u", > + if (snprintf(msg, sizeof(msg), "%s chunk of length %u", > ch->chunk_type == SCTP_DATA ? "DATA" : "I-DATA", > - chk_length); > + chk_length) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_22; > sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); > @@ -2874,8 +2908,10 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o > struct mbuf *op_err; > char msg[SCTP_DIAG_INFO_LEN]; > > - snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", > - ch->chunk_type); > + if (snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", > + ch->chunk_type) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); > return (2); > @@ -2893,8 +2929,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o > struct mbuf *op_err; > char msg[SCTP_DIAG_INFO_LEN]; > > - snprintf(msg, sizeof(msg), "Chunk of length %u", > - chk_length); > + if (snprintf(msg, sizeof(msg), "Chunk of length %u", chk_length) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_23; > sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); > @@ -4043,8 +4080,11 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 > > *abort_now = 1; > /* XXX */ > - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", > - cumack, send_s); > + if (snprintf(msg, sizeof(msg), > + "Cum ack %8.8x greater or equal than TSN %8.8x", > + cumack, send_s) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; > sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); > @@ -4585,8 +4625,11 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int o > hopeless_peer: > *abort_now = 1; > /* XXX */ > - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", > - cum_ack, send_s); > + if (snprintf(msg, sizeof(msg), > + "Cum ack %8.8x greater or equal than TSN %8.8x", > + cum_ack, send_s) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_28; > sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); > @@ -5629,9 +5672,11 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, > * give out). This must be an attacker. > */ > *abort_flag = 1; > - snprintf(msg, sizeof(msg), > + if (snprintf(msg, sizeof(msg), > "New cum ack %8.8x too high, highest TSN %8.8x", > - new_cum_tsn, asoc->highest_tsn_inside_map); > + new_cum_tsn, asoc->highest_tsn_inside_map) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_36; > sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); > > Modified: head/sys/netinet/sctp_input.c > ============================================================================== > --- head/sys/netinet/sctp_input.c Mon May 18 09:46:51 2020 (r361208) > +++ head/sys/netinet/sctp_input.c Mon May 18 10:07:01 2020 (r361209) > @@ -4692,7 +4692,9 @@ sctp_process_control(struct mbuf *m, int iphlen, int * > } > } > if (stcb == NULL) { > - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); > + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > /* no association, so it's out of the blue... */ > @@ -4734,7 +4736,9 @@ sctp_process_control(struct mbuf *m, int iphlen, int * > if (stcb != NULL) { > SCTP_TCB_UNLOCK(stcb); > } > - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); > + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > sctp_handle_ootb(m, iphlen, *offset, src, dst, > @@ -5671,7 +5675,9 @@ sctp_common_input_processing(struct mbuf **mm, int iph > SCTP_TCB_UNLOCK(stcb); > stcb = NULL; > SCTP_PROBE5(receive, NULL, stcb, m, stcb, sh); > - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); > + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, > @@ -5733,7 +5739,9 @@ sctp_common_input_processing(struct mbuf **mm, int iph > if (stcb == NULL) { > /* out of the blue DATA chunk */ > SCTP_PROBE5(receive, NULL, NULL, m, NULL, sh); > - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); > + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, > @@ -5799,7 +5807,9 @@ sctp_common_input_processing(struct mbuf **mm, int iph > /* > * We consider OOTB any data sent during asoc setup. > */ > - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); > + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, > > Modified: head/sys/netinet/sctp_output.c > ============================================================================== > --- head/sys/netinet/sctp_output.c Mon May 18 09:46:51 2020 (r361208) > +++ head/sys/netinet/sctp_output.c Mon May 18 10:07:01 2020 (r361209) > @@ -5581,7 +5581,9 @@ do_a_abort: > if (op_err == NULL) { > char msg[SCTP_DIAG_INFO_LEN]; > > - snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); > + if (snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > } > @@ -6758,8 +6760,10 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct s > char msg[SCTP_DIAG_INFO_LEN]; > > abort_anyway: > - snprintf(msg, sizeof(msg), > - "%s:%d at %s", __FILE__, __LINE__, __func__); > + if (snprintf(msg, sizeof(msg), > + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > atomic_add_int(&stcb->asoc.refcnt, 1); > @@ -9626,8 +9630,10 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp, > struct mbuf *op_err; > char msg[SCTP_DIAG_INFO_LEN]; > > - snprintf(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up", > - chk->rec.data.tsn, chk->snd_count); > + if (snprintf(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up", > + chk->rec.data.tsn, chk->snd_count) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > atomic_add_int(&stcb->asoc.refcnt, 1); > @@ -13610,8 +13616,10 @@ dataless_eof: > atomic_add_int(&stcb->asoc.refcnt, -1); > free_cnt_applied = 0; > } > - snprintf(msg, sizeof(msg), > - "%s:%d at %s", __FILE__, __LINE__, __func__); > + if (snprintf(msg, sizeof(msg), > + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > NET_EPOCH_ENTER(et); > > Modified: head/sys/netinet/sctp_pcb.c > ============================================================================== > --- head/sys/netinet/sctp_pcb.c Mon May 18 09:46:51 2020 (r361208) > +++ head/sys/netinet/sctp_pcb.c Mon May 18 10:07:01 2020 (r361209) > @@ -544,9 +544,13 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint3 > atomic_add_int(&vrf->refcount, 1); > sctp_ifnp->ifn_mtu = SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, addr->sa_family); > if (if_name != NULL) { > - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name); > + if (snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name) < 0) { > + sctp_ifnp->ifn_name[0] = '\0'; > + } > } else { > - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown"); > + if (snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown") < 0) { > + sctp_ifnp->ifn_name[0] = '\0'; > + } > } > hash_ifn_head = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & SCTP_BASE_INFO(vrf_ifn_hashmark))]; > LIST_INIT(&sctp_ifnp->ifalist); > @@ -6221,8 +6225,10 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s > * in setup state we > * abort this guy > */ > - snprintf(msg, sizeof(msg), > - "%s:%d at %s", __FILE__, __LINE__, __func__); > + if (snprintf(msg, sizeof(msg), > + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > sctp_abort_an_association(stcb_tmp->sctp_ep, > @@ -6321,8 +6327,10 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s > * in setup state we > * abort this guy > */ > - snprintf(msg, sizeof(msg), > - "%s:%d at %s", __FILE__, __LINE__, __func__); > + if (snprintf(msg, sizeof(msg), > + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > + msg[0] = '\0'; > + } > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > msg); > sctp_abort_an_association(stcb_tmp->sctp_ep, From owner-svn-src-all@freebsd.org Mon May 18 15:48: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 BD4512CDCBF; Mon, 18 May 2020 15:48:48 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (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 49Qk2R7233z3g3q; Mon, 18 May 2020 15:48:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi1-f179.google.com with SMTP id j145so9380338oib.5; Mon, 18 May 2020 08:48:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=htTzkF+TJq7AQeybmcf2Rgzje+mu/+lwQh9Be6kiAtc=; b=PR49OVJO7no1UjU6vFwwJQAeimZgYxma5cXnpQdqZ3lQZbhuOGvmFfgVQwB0dXhEue ye4Ool+ENknIVijhToovbpIrQDWJOGN0Lvt5LI0GYINbUG/4urwxUuawj9HrX09sNm23 wMb/0EWiHKoo1lYHtQED2tWMHqgIUwMniCWk6UyGAVK8aEQ6Mg8K+FQASMbftIMC+ZPs DwOfKjI8/vN7k/iu5/W+t4lCGCyP/mGl/L0LlRRjr7si7sP+vdAY1pJ/zGH3TMvyUDpy PW4gMtGMoDt8Ggr49fo1xynqb/s9vDEiXxuWBauR4MMp/YQTE91/YD0yd/9/IvgMFn5y Mosg== X-Gm-Message-State: AOAM533RoP2lx2LyddqQ20wUkssac9+nnRzsl+pLxqPbrUd1nRKd5ozF J5BTOl+HoeWXtMFHXvJ2hochaMrr X-Google-Smtp-Source: ABdhPJxVCtdfutemh9Q/cLwXTlnipKRgcg/2b4WmVH7JMDVox4RySNNHSJb65fgbKgQvXHzXi3X3pQ== X-Received: by 2002:aca:af15:: with SMTP id y21mr15316oie.124.1589816926082; Mon, 18 May 2020 08:48:46 -0700 (PDT) Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com. [209.85.167.170]) by smtp.gmail.com with ESMTPSA id 97sm3010224otm.78.2020.05.18.08.48.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 May 2020 08:48:45 -0700 (PDT) Received: by mail-oi1-f170.google.com with SMTP id 19so9367850oiy.8; Mon, 18 May 2020 08:48:45 -0700 (PDT) X-Received: by 2002:aca:a854:: with SMTP id r81mr11573319oie.81.1589816924905; Mon, 18 May 2020 08:48:44 -0700 (PDT) MIME-Version: 1.0 References: <202005181007.04IA713t089936@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 18 May 2020 08:48:33 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361209 - head/sys/netinet To: Michael Tuexen Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49Qk2R7233z3g3q X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.167.179 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [0.35 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; DMARC_NA(0.00)[freebsd.org]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.179:from]; NEURAL_SPAM_SHORT(0.35)[0.352]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.179: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:+]; 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: Mon, 18 May 2020 15:48:48 -0000 (In fact, I don't believe snprintf(9) can return a negative value at all. And snprintf(3) will only do so in some special circumstances for features snprintf(9) does not support: buffer size or formatted result longer than INT_MAX; invalid *nn$ field width or precision specifiers. I don't think either case applies to these strings, although I did not read all of them thoroughly.) On Mon, May 18, 2020 at 8:38 AM Conrad Meyer wrote: > > Hi Michael, > > These changes are a bit odd. The only reason a standards-compliant > snprintf() would fail to nul-terminate a buffer is if the provided > buffer had length zero. Since this is not the case in any of these > uses, I wonder why this revision was made? Does a SCTP downstream > have a broken snprintf implementation, and if so, wouldn't it make > more sense to create a standards-compliant portability shim for that > platform instead of this more invasive change? > > FreeBSD's snprintf(9) does not have this bug, nor does its snprintf(3). > > Best regards, > Conrad > > On Mon, May 18, 2020 at 3:07 AM Michael Tuexen wrote: > > > > Author: tuexen > > Date: Mon May 18 10:07:01 2020 > > New Revision: 361209 > > URL: https://svnweb.freebsd.org/changeset/base/361209 > > > > Log: > > Handle failures of snprintf(). > > > > MFC after: 3 days > > > > Modified: > > head/sys/netinet/sctp_asconf.c > > head/sys/netinet/sctp_indata.c > > head/sys/netinet/sctp_input.c > > head/sys/netinet/sctp_output.c > > head/sys/netinet/sctp_pcb.c > > > > Modified: head/sys/netinet/sctp_asconf.c > > ============================================================================== > > --- head/sys/netinet/sctp_asconf.c Mon May 18 09:46:51 2020 (r361208) > > +++ head/sys/netinet/sctp_asconf.c Mon May 18 10:07:01 2020 (r361209) > > @@ -1706,8 +1706,9 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset, > > char msg[SCTP_DIAG_INFO_LEN]; > > > > SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf_ack: got unexpected next serial number! Aborting asoc!\n"); > > - snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", > > - serial_num); > > + if (snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", serial_num) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); > > *abort_no_unlock = 1; > > > > Modified: head/sys/netinet/sctp_indata.c > > ============================================================================== > > --- head/sys/netinet/sctp_indata.c Mon May 18 09:46:51 2020 (r361208) > > +++ head/sys/netinet/sctp_indata.c Mon May 18 10:07:01 2020 (r361209) > > @@ -434,22 +434,26 @@ sctp_abort_in_reasm(struct sctp_tcb *stcb, > > struct mbuf *oper; > > > > if (stcb->asoc.idata_supported) { > > - snprintf(msg, sizeof(msg), > > + if (snprintf(msg, sizeof(msg), > > "Reass %x,CF:%x,TSN=%8.8x,SID=%4.4x,FSN=%8.8x,MID:%8.8x", > > opspot, > > control->fsn_included, > > chk->rec.data.tsn, > > chk->rec.data.sid, > > - chk->rec.data.fsn, chk->rec.data.mid); > > + chk->rec.data.fsn, chk->rec.data.mid) < 0) { > > + msg[0] = '\0'; > > + } > > } else { > > - snprintf(msg, sizeof(msg), > > + if (snprintf(msg, sizeof(msg), > > "Reass %x,CI:%x,TSN=%8.8x,SID=%4.4x,FSN=%4.4x,SSN:%4.4x", > > opspot, > > control->fsn_included, > > chk->rec.data.tsn, > > chk->rec.data.sid, > > chk->rec.data.fsn, > > - (uint16_t)chk->rec.data.mid); > > + (uint16_t)chk->rec.data.mid) < 0) { > > + msg[0] = '\0'; > > + } > > } > > oper = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > sctp_m_freem(chk->data); > > @@ -533,15 +537,19 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, > > */ > > TAILQ_INSERT_HEAD(&strm->inqueue, control, next_instrm); > > if (asoc->idata_supported) { > > - snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", > > + if (snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", > > strm->last_mid_delivered, control->sinfo_tsn, > > - control->sinfo_stream, control->mid); > > + control->sinfo_stream, control->mid) < 0) { > > + msg[0] = '\0'; > > + } > > } else { > > - snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", > > + if (snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", > > (uint16_t)strm->last_mid_delivered, > > control->sinfo_tsn, > > control->sinfo_stream, > > - (uint16_t)control->mid); > > + (uint16_t)control->mid) < 0) { > > + msg[0] = '\0'; > > + } > > } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_2; > > @@ -648,9 +656,10 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, > > * to put it on the queue. > > */ > > if (sctp_place_control_in_stream(strm, asoc, control)) { > > - snprintf(msg, sizeof(msg), > > - "Queue to str MID: %u duplicate", > > - control->mid); > > + if (snprintf(msg, sizeof(msg), > > + "Queue to str MID: %u duplicate", control->mid) < 0) { > > + msg[0] = '\0'; > > + } > > sctp_clean_up_control(stcb, control); > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_3; > > @@ -1881,8 +1890,9 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > > * can *not* be fsn 0. XXX: This can happen in case of a > > * wrap around. Ignore is for now. > > */ > > - snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", > > - mid, chk_flags); > > + if (snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", mid, chk_flags) < 0) { > > + msg[0] = '\0'; > > + } > > goto err_out; > > } > > control = sctp_find_reasm_entry(&asoc->strmin[sid], mid, ordered, asoc->idata_supported); > > @@ -1893,7 +1903,9 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > > if (control != NULL) { > > /* We found something, does it belong? */ > > if (ordered && (mid != control->mid)) { > > - snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid); > > + if (snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid) < 0) { > > + msg[0] = '\0'; > > + } > > err_out: > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; > > @@ -1906,8 +1918,11 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > > * We can't have a switched order with an > > * unordered chunk > > */ > > - snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", > > - tsn); > > + if (snprintf(msg, sizeof(msg), > > + "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", > > + tsn) < 0) { > > + msg[0] = '\0'; > > + } > > goto err_out; > > } > > if (!ordered && (((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED) == 0)) { > > @@ -1915,8 +1930,11 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > > * We can't have a switched unordered with a > > * ordered chunk > > */ > > - snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", > > - tsn); > > + if (snprintf(msg, sizeof(msg), > > + "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", > > + tsn) < 0) { > > + msg[0] = '\0'; > > + } > > goto err_out; > > } > > } > > @@ -1930,12 +1948,18 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > > if (ordered || asoc->idata_supported) { > > SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x dup detected on MID: %u\n", > > chk_flags, mid); > > - snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid); > > + if (snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid) < 0) { > > + msg[0] = '\0'; > > + } > > goto err_out; > > } else { > > if ((tsn == control->fsn_included + 1) && > > (control->end_added == 0)) { > > - snprintf(msg, sizeof(msg), "Illegal message sequence, missing end for MID: %8.8x", control->fsn_included); > > + if (snprintf(msg, sizeof(msg), > > + "Illegal message sequence, missing end for MID: %8.8x", > > + control->fsn_included) < 0) { > > + msg[0] = '\0'; > > + } > > goto err_out; > > } else { > > control = NULL; > > @@ -2032,17 +2056,21 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc > > mid, asoc->strmin[sid].last_mid_delivered); > > > > if (asoc->idata_supported) { > > - snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", > > + if (snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", > > asoc->strmin[sid].last_mid_delivered, > > tsn, > > sid, > > - mid); > > + mid) < 0) { > > + msg[0] = '\0'; > > + } > > } else { > > - snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", > > + if (snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", > > (uint16_t)asoc->strmin[sid].last_mid_delivered, > > tsn, > > sid, > > - (uint16_t)mid); > > + (uint16_t)mid) < 0) { > > + msg[0] = '\0'; > > + } > > } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17; > > @@ -2769,7 +2797,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o > > struct mbuf *op_err; > > char msg[SCTP_DIAG_INFO_LEN]; > > > > - snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated"); > > + if (snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated") < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; > > sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); > > @@ -2780,7 +2810,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o > > struct mbuf *op_err; > > char msg[SCTP_DIAG_INFO_LEN]; > > > > - snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated"); > > + if (snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated") < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; > > sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); > > @@ -2803,9 +2835,11 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o > > struct mbuf *op_err; > > char msg[SCTP_DIAG_INFO_LEN]; > > > > - snprintf(msg, sizeof(msg), "%s chunk of length %u", > > + if (snprintf(msg, sizeof(msg), "%s chunk of length %u", > > ch->chunk_type == SCTP_DATA ? "DATA" : "I-DATA", > > - chk_length); > > + chk_length) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_22; > > sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); > > @@ -2874,8 +2908,10 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o > > struct mbuf *op_err; > > char msg[SCTP_DIAG_INFO_LEN]; > > > > - snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", > > - ch->chunk_type); > > + if (snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", > > + ch->chunk_type) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); > > return (2); > > @@ -2893,8 +2929,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o > > struct mbuf *op_err; > > char msg[SCTP_DIAG_INFO_LEN]; > > > > - snprintf(msg, sizeof(msg), "Chunk of length %u", > > - chk_length); > > + if (snprintf(msg, sizeof(msg), "Chunk of length %u", chk_length) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_23; > > sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); > > @@ -4043,8 +4080,11 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 > > > > *abort_now = 1; > > /* XXX */ > > - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", > > - cumack, send_s); > > + if (snprintf(msg, sizeof(msg), > > + "Cum ack %8.8x greater or equal than TSN %8.8x", > > + cumack, send_s) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; > > sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); > > @@ -4585,8 +4625,11 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int o > > hopeless_peer: > > *abort_now = 1; > > /* XXX */ > > - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", > > - cum_ack, send_s); > > + if (snprintf(msg, sizeof(msg), > > + "Cum ack %8.8x greater or equal than TSN %8.8x", > > + cum_ack, send_s) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_28; > > sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); > > @@ -5629,9 +5672,11 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, > > * give out). This must be an attacker. > > */ > > *abort_flag = 1; > > - snprintf(msg, sizeof(msg), > > + if (snprintf(msg, sizeof(msg), > > "New cum ack %8.8x too high, highest TSN %8.8x", > > - new_cum_tsn, asoc->highest_tsn_inside_map); > > + new_cum_tsn, asoc->highest_tsn_inside_map) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); > > stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_36; > > sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); > > > > Modified: head/sys/netinet/sctp_input.c > > ============================================================================== > > --- head/sys/netinet/sctp_input.c Mon May 18 09:46:51 2020 (r361208) > > +++ head/sys/netinet/sctp_input.c Mon May 18 10:07:01 2020 (r361209) > > @@ -4692,7 +4692,9 @@ sctp_process_control(struct mbuf *m, int iphlen, int * > > } > > } > > if (stcb == NULL) { > > - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); > > + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > /* no association, so it's out of the blue... */ > > @@ -4734,7 +4736,9 @@ sctp_process_control(struct mbuf *m, int iphlen, int * > > if (stcb != NULL) { > > SCTP_TCB_UNLOCK(stcb); > > } > > - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); > > + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > sctp_handle_ootb(m, iphlen, *offset, src, dst, > > @@ -5671,7 +5675,9 @@ sctp_common_input_processing(struct mbuf **mm, int iph > > SCTP_TCB_UNLOCK(stcb); > > stcb = NULL; > > SCTP_PROBE5(receive, NULL, stcb, m, stcb, sh); > > - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); > > + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, > > @@ -5733,7 +5739,9 @@ sctp_common_input_processing(struct mbuf **mm, int iph > > if (stcb == NULL) { > > /* out of the blue DATA chunk */ > > SCTP_PROBE5(receive, NULL, NULL, m, NULL, sh); > > - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); > > + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, > > @@ -5799,7 +5807,9 @@ sctp_common_input_processing(struct mbuf **mm, int iph > > /* > > * We consider OOTB any data sent during asoc setup. > > */ > > - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); > > + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, > > > > Modified: head/sys/netinet/sctp_output.c > > ============================================================================== > > --- head/sys/netinet/sctp_output.c Mon May 18 09:46:51 2020 (r361208) > > +++ head/sys/netinet/sctp_output.c Mon May 18 10:07:01 2020 (r361209) > > @@ -5581,7 +5581,9 @@ do_a_abort: > > if (op_err == NULL) { > > char msg[SCTP_DIAG_INFO_LEN]; > > > > - snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); > > + if (snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > } > > @@ -6758,8 +6760,10 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct s > > char msg[SCTP_DIAG_INFO_LEN]; > > > > abort_anyway: > > - snprintf(msg, sizeof(msg), > > - "%s:%d at %s", __FILE__, __LINE__, __func__); > > + if (snprintf(msg, sizeof(msg), > > + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > atomic_add_int(&stcb->asoc.refcnt, 1); > > @@ -9626,8 +9630,10 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp, > > struct mbuf *op_err; > > char msg[SCTP_DIAG_INFO_LEN]; > > > > - snprintf(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up", > > - chk->rec.data.tsn, chk->snd_count); > > + if (snprintf(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up", > > + chk->rec.data.tsn, chk->snd_count) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > atomic_add_int(&stcb->asoc.refcnt, 1); > > @@ -13610,8 +13616,10 @@ dataless_eof: > > atomic_add_int(&stcb->asoc.refcnt, -1); > > free_cnt_applied = 0; > > } > > - snprintf(msg, sizeof(msg), > > - "%s:%d at %s", __FILE__, __LINE__, __func__); > > + if (snprintf(msg, sizeof(msg), > > + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > NET_EPOCH_ENTER(et); > > > > Modified: head/sys/netinet/sctp_pcb.c > > ============================================================================== > > --- head/sys/netinet/sctp_pcb.c Mon May 18 09:46:51 2020 (r361208) > > +++ head/sys/netinet/sctp_pcb.c Mon May 18 10:07:01 2020 (r361209) > > @@ -544,9 +544,13 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint3 > > atomic_add_int(&vrf->refcount, 1); > > sctp_ifnp->ifn_mtu = SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, addr->sa_family); > > if (if_name != NULL) { > > - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name); > > + if (snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name) < 0) { > > + sctp_ifnp->ifn_name[0] = '\0'; > > + } > > } else { > > - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown"); > > + if (snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown") < 0) { > > + sctp_ifnp->ifn_name[0] = '\0'; > > + } > > } > > hash_ifn_head = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & SCTP_BASE_INFO(vrf_ifn_hashmark))]; > > LIST_INIT(&sctp_ifnp->ifalist); > > @@ -6221,8 +6225,10 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s > > * in setup state we > > * abort this guy > > */ > > - snprintf(msg, sizeof(msg), > > - "%s:%d at %s", __FILE__, __LINE__, __func__); > > + if (snprintf(msg, sizeof(msg), > > + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > sctp_abort_an_association(stcb_tmp->sctp_ep, > > @@ -6321,8 +6327,10 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s > > * in setup state we > > * abort this guy > > */ > > - snprintf(msg, sizeof(msg), > > - "%s:%d at %s", __FILE__, __LINE__, __func__); > > + if (snprintf(msg, sizeof(msg), > > + "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { > > + msg[0] = '\0'; > > + } > > op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), > > msg); > > sctp_abort_an_association(stcb_tmp->sctp_ep, From owner-svn-src-all@freebsd.org Mon May 18 15:59: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 A88F92CE5CB; Mon, 18 May 2020 15:59:18 +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 49QkGZ4NMkz3gt9; Mon, 18 May 2020 15:59:18 +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 9178723B62; Mon, 18 May 2020 15:59:18 +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 04IFxIr4004374; Mon, 18 May 2020 15:59:18 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IFxHfN004369; Mon, 18 May 2020 15:59:17 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005181559.04IFxHfN004369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 18 May 2020 15:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r361217 - in releng/11.4: cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/contrib/opensolaris/uts/common/sys sys/cddl/dev/dtrace X-SVN-Group: releng X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in releng/11.4: cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/contrib/opensolaris/uts/common/sys sys/cddl/dev/dtrace X-SVN-Commit-Revision: 361217 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, 18 May 2020 15:59:18 -0000 Author: dim Date: Mon May 18 15:59:17 2020 New Revision: 361217 URL: https://svnweb.freebsd.org/changeset/base/361217 Log: MF11 r361088: Merge changes that enable DTrace-using ports to link correctly with lld 10, avoiding "unknown relocation 8" and other errors. MFC r312658 (by markj): Remove the DTRACEHIOC_ADD ioctl. This ioctl has been considered legacy by upstream since the DTrace code was first imported, and is unused. The removal also allows some simplification of dtrace_helper_slurp(). Also remove a bogus copyout in the DTRACEHIOC_ADDDOF handler. Due to a bug, it would overwrite an in-memory copy of the DOF header rather than the passed-in DOF helper. Moreover, DTRACEHIOC_ADDDOF already copies the helper back out automatically since its argument has the IOC_OUT attribute. MFC r313262 (by markj): Use PC-relative relocations for USDT probe sites on i386 and amd64. When recording probe site addresses in the output DOF file, dtrace -G needs to emit relocations for the .SUNW_dof section in order to obtain the addresses of functions containing probe sites. DTrace expects the addresses to be relative to the base address of the final ELF file, and the amd64 USDT implementation was relying on some unspecified and incorrect behaviour in the base system GNU ld to achieve this. This change reimplements the probe site relocation handling to allow USDT to be used with lld and newer GNU binutils. Specifically, it makes use of R_X86_64_PC64/R_386_PC32 relocations to obtain the probe site address relative to the DOF file address, and adds and uses a new DOF relocation type which computes the final probe site address using these relative offsets. Approved by: re (gjb) Reported by and discussed with: Rafael Esp?ndola Differential Revision: https://reviews.freebsd.org/D9374 Modified: releng/11.4/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c releng/11.4/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c releng/11.4/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c releng/11.4/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c releng/11.4/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h releng/11.4/sys/cddl/dev/dtrace/dtrace_ioctl.c Directory Properties: releng/11.4/ (props changed) Modified: releng/11.4/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c ============================================================================== --- releng/11.4/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c Mon May 18 15:05:59 2020 (r361216) +++ releng/11.4/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c Mon May 18 15:59:17 2020 (r361217) @@ -462,18 +462,8 @@ dof_add_probe(dt_idhash_t *dhp, dt_ident_t *idp, void dt_buf_write(dtp, &ddo->ddo_enoffs, pip->pi_enoffs, pip->pi_nenoffs * sizeof (uint32_t), sizeof (uint32_t)); - /* - * If pi_rname isn't set, the relocation will be against the - * function name. If it is, the relocation will be against - * pi_rname. This will be used if the function is scoped - * locally so an alternate symbol is added for the purpose - * of this relocation. - */ - if (pip->pi_rname == NULL) - dofr.dofr_name = dofpr.dofpr_func; - else - dofr.dofr_name = dof_add_string(ddo, pip->pi_rname); - dofr.dofr_type = DOF_RELO_SETX; + dofr.dofr_name = dof_add_string(ddo, pip->pi_rname); + dofr.dofr_type = DOF_RELO_DOFREL; dofr.dofr_offset = dt_buf_len(&ddo->ddo_probes); dofr.dofr_data = 0; Modified: releng/11.4/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- releng/11.4/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Mon May 18 15:05:59 2020 (r361216) +++ releng/11.4/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Mon May 18 15:59:17 2020 (r361217) @@ -239,7 +239,7 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, rel->r_offset = s->dofs_offset + dofr[j].dofr_offset; rel->r_info = ELF32_R_INFO(count + dep->de_global, - R_386_32); + R_386_PC32); #elif defined(__mips__) /* XXX */ printf("%s:%s(%d): MIPS not implemented\n", @@ -257,15 +257,6 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, /* XXX */ printf("%s:%s(%d): RISC-V not implemented\n", __FUNCTION__, __FILE__, __LINE__); -#elif defined(__sparc) - /* - * Add 4 bytes to hit the low half of this 64-bit - * big-endian address. - */ - rel->r_offset = s->dofs_offset + - dofr[j].dofr_offset + 4; - rel->r_info = ELF32_R_INFO(count + dep->de_global, - R_SPARC_32); #else #error unknown ISA #endif @@ -274,7 +265,7 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, sym->st_value = 0; sym->st_size = 0; sym->st_info = ELF32_ST_INFO(STB_GLOBAL, STT_FUNC); - sym->st_other = 0; + sym->st_other = ELF32_ST_VISIBILITY(STV_HIDDEN); sym->st_shndx = SHN_UNDEF; rel++; @@ -291,11 +282,7 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, sym->st_value = 0; sym->st_size = dof->dofh_filesz; sym->st_info = ELF32_ST_INFO(STB_GLOBAL, STT_OBJECT); -#ifdef illumos - sym->st_other = 0; -#else sym->st_other = ELF32_ST_VISIBILITY(STV_HIDDEN); -#endif sym->st_shndx = ESHDR_DOF; sym++; @@ -452,19 +439,9 @@ prepare_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, #elif defined(__i386) || defined(__amd64) rel->r_offset = s->dofs_offset + dofr[j].dofr_offset; -#ifdef illumos rel->r_info = ELF64_R_INFO(count + dep->de_global, - R_AMD64_64); + R_X86_64_PC64); #else - rel->r_info = ELF64_R_INFO(count + dep->de_global, - R_X86_64_RELATIVE); -#endif -#elif defined(__sparc) - rel->r_offset = s->dofs_offset + - dofr[j].dofr_offset; - rel->r_info = ELF64_R_INFO(count + dep->de_global, - R_SPARC_64); -#else #error unknown ISA #endif @@ -472,7 +449,7 @@ prepare_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, sym->st_value = 0; sym->st_size = 0; sym->st_info = GELF_ST_INFO(STB_GLOBAL, STT_FUNC); - sym->st_other = 0; + sym->st_other = ELF64_ST_VISIBILITY(STV_HIDDEN); sym->st_shndx = SHN_UNDEF; rel++; @@ -489,11 +466,7 @@ prepare_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, sym->st_value = 0; sym->st_size = dof->dofh_filesz; sym->st_info = GELF_ST_INFO(STB_GLOBAL, STT_OBJECT); -#ifdef illumos - sym->st_other = 0; -#else sym->st_other = ELF64_ST_VISIBILITY(STV_HIDDEN); -#endif sym->st_shndx = ESHDR_DOF; sym++; @@ -801,16 +774,15 @@ dump_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, in } static int -dt_symtab_lookup(Elf_Data *data_sym, int nsym, uintptr_t addr, uint_t shn, - GElf_Sym *sym, int uses_funcdesc, Elf *elf) +dt_symtab_lookup(Elf_Data *data_sym, int start, int end, uintptr_t addr, + uint_t shn, GElf_Sym *sym, int uses_funcdesc, Elf *elf) { - int i, ret = -1; Elf64_Addr symval; Elf_Scn *opd_scn; Elf_Data *opd_desc; - GElf_Sym s; + int i; - for (i = 0; i < nsym && gelf_getsym(data_sym, i, sym) != NULL; i++) { + for (i = start; i < end && gelf_getsym(data_sym, i, sym) != NULL; i++) { if (GELF_ST_TYPE(sym->st_info) == STT_FUNC) { symval = sym->st_value; if (uses_funcdesc) { @@ -820,20 +792,12 @@ dt_symtab_lookup(Elf_Data *data_sym, int nsym, uintptr *(uint64_t*)((char *)opd_desc->d_buf + symval); } if ((uses_funcdesc || shn == sym->st_shndx) && - symval <= addr && - addr < symval + sym->st_size) { - if (GELF_ST_BIND(sym->st_info) == STB_GLOBAL) - return (0); - - ret = 0; - s = *sym; - } + symval <= addr && addr < symval + sym->st_size) + return (0); } } - if (ret == 0) - *sym = s; - return (ret); + return (-1); } #if defined(__aarch64__) @@ -1245,7 +1209,7 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e dt_provider_t *pvp; dt_probe_t *prp; uint32_t off, eclass, emachine1, emachine2; - size_t symsize, nsym, isym, istr, len; + size_t symsize, osym, nsym, isym, istr, len; key_t objkey; dt_link_pair_t *pair, *bufs = NULL; dt_strtab_t *strtab; @@ -1382,12 +1346,13 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e * target (text) section to replace the call instruction with * one or more nops. * - * If the function containing the probe is locally scoped - * (static), we create an alias used by the relocation in the - * generated object. The alias, a new symbol, will be global - * (so that the relocation from the generated object can be - * resolved), and hidden (so that it is converted to a local - * symbol at link time). Such aliases have this form: + * To avoid runtime overhead, the relocations added to the + * generated object should be resolved at static link time. We + * therefore create aliases for the functions that contain + * probes. An alias is global (so that the relocation from the + * generated object can be resolved), and hidden (so that its + * address is known at static link time). Such aliases have this + * form: * * $dtrace. * @@ -1425,16 +1390,13 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e if (strncmp(s, dt_prefix, sizeof (dt_prefix) - 1) != 0) continue; - if (dt_symtab_lookup(data_sym, isym, rela.r_offset, - shdr_rel.sh_info, &fsym, - (emachine1 == EM_PPC64), elf) != 0) { + if (dt_symtab_lookup(data_sym, 0, isym, rela.r_offset, + shdr_rel.sh_info, &fsym, (emachine1 == EM_PPC64), + elf) != 0) { dt_strtab_destroy(strtab); goto err; } - if (GELF_ST_BIND(fsym.st_info) != STB_LOCAL) - continue; - if (fsym.st_name > data_str->d_size) { dt_strtab_destroy(strtab); goto err; @@ -1470,12 +1432,12 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e } /* - * If needed, allocate the additional space for the symbol - * table and string table copying the old data into the new - * buffers, and marking the buffers as dirty. We inject those - * newly allocated buffers into the libelf data structures, but - * are still responsible for freeing them once we're done with - * the elf handle. + * If any probes were found, allocate the additional space for + * the symbol table and string table, copying the old data into + * the new buffers, and marking the buffers as dirty. We inject + * those newly allocated buffers into the libelf data + * structures, but are still responsible for freeing them once + * we're done with the elf handle. */ if (nsym > 0) { /* @@ -1524,9 +1486,11 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e shdr_sym.sh_size += nsym * symsize; (void) gelf_update_shdr(scn_sym, &shdr_sym); + osym = isym; nsym += isym; } else { dt_strtab_destroy(strtab); + continue; } /* @@ -1585,8 +1549,11 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e bcopy(s, pname, p - s); pname[p - s] = '\0'; - if (dt_symtab_lookup(data_sym, isym, rela.r_offset, - shdr_rel.sh_info, &fsym, + if (dt_symtab_lookup(data_sym, osym, isym, + rela.r_offset, shdr_rel.sh_info, &fsym, + (emachine1 == EM_PPC64), elf) != 0 && + dt_symtab_lookup(data_sym, 0, osym, + rela.r_offset, shdr_rel.sh_info, &fsym, (emachine1 == EM_PPC64), elf) != 0) goto err; @@ -1596,37 +1563,30 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e assert(GELF_ST_TYPE(fsym.st_info) == STT_FUNC); /* - * If a NULL relocation name is passed to - * dt_probe_define(), the function name is used for the - * relocation. The relocation needs to use a mangled - * name if the symbol is locally scoped; the function - * name may need to change if we've found the global - * alias for the locally scoped symbol (we prefer - * global symbols to locals in dt_symtab_lookup()). + * If this is our first time encountering this symbol, + * emit an alias. */ s = (char *)data_str->d_buf + fsym.st_name; - r = NULL; - if (GELF_ST_BIND(fsym.st_info) == STB_LOCAL) { + if (strncmp(s, dt_symprefix, + sizeof (dt_symprefix) - 1) != 0) { + u_int bind = GELF_ST_BIND(fsym.st_info); + dsym = fsym; dsym.st_name = istr; - dsym.st_info = GELF_ST_INFO(STB_GLOBAL, - STT_FUNC); - dsym.st_other = - ELF64_ST_VISIBILITY(STV_ELIMINATE); + dsym.st_info = GELF_ST_INFO(bind == STB_LOCAL ? + STB_GLOBAL : bind, STT_FUNC); + dsym.st_other = GELF_ST_VISIBILITY(STV_HIDDEN); (void) gelf_update_sym(data_sym, isym, &dsym); - - r = (char *)data_str->d_buf + istr; - istr += 1 + sprintf(r, dt_symfmt, - dt_symprefix, objkey, s); + r = (char *) data_str->d_buf + istr; + istr += 1 + sprintf(r, dt_symfmt, dt_symprefix, objkey, + s); isym++; assert(isym <= nsym); - - } else if (strncmp(s, dt_symprefix, - strlen(dt_symprefix)) == 0) { + } else { r = s; - if ((s = strchr(s, '.')) == NULL) - goto err; + s = strchr(s, '.'); + assert(s != NULL); s++; } Modified: releng/11.4/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c ============================================================================== --- releng/11.4/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c Mon May 18 15:05:59 2020 (r361216) +++ releng/11.4/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c Mon May 18 15:59:17 2020 (r361217) @@ -545,9 +545,7 @@ dt_probe_define(dt_provider_t *pvp, dt_probe_t *prp, for (pip = prp->pr_inst; pip != NULL; pip = pip->pi_next) { if (strcmp(pip->pi_fname, fname) == 0 && - ((rname == NULL && pip->pi_rname == NULL) || - (rname != NULL && pip->pi_rname != NULL && - strcmp(pip->pi_rname, rname) == 0))) + strcmp(pip->pi_rname, rname) == 0) break; } @@ -565,7 +563,7 @@ dt_probe_define(dt_provider_t *pvp, dt_probe_t *prp, if ((pip->pi_fname = strdup(fname)) == NULL) goto nomem; - if (rname != NULL && (pip->pi_rname = strdup(rname)) == NULL) + if ((pip->pi_rname = strdup(rname)) == NULL) goto nomem; pip->pi_noffs = 0; @@ -605,7 +603,7 @@ dt_probe_define(dt_provider_t *pvp, dt_probe_t *prp, dt_dprintf("defined probe %s %s:%s %s() +0x%x (%s)\n", isenabled ? "(is-enabled)" : "", pvp->pv_desc.dtvd_name, prp->pr_ident->di_name, fname, offset, - rname != NULL ? rname : fname); + rname); assert(*noffs < *maxoffs); (*offs)[(*noffs)++] = offset; Modified: releng/11.4/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- releng/11.4/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon May 18 15:05:59 2020 (r361216) +++ releng/11.4/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon May 18 15:59:17 2020 (r361217) @@ -13886,12 +13886,13 @@ err: /* * Apply the relocations from the specified 'sec' (a DOF_SECT_URELHDR) to the - * specified DOF. At present, this amounts to simply adding 'ubase' to the - * site of any user SETX relocations to account for load object base address. - * In the future, if we need other relocations, this function can be extended. + * specified DOF. SETX relocations are computed using 'ubase', the base load + * address of the object containing the DOF, and DOFREL relocations are relative + * to the relocation offset within the DOF. */ static int -dtrace_dof_relocate(dof_hdr_t *dof, dof_sec_t *sec, uint64_t ubase) +dtrace_dof_relocate(dof_hdr_t *dof, dof_sec_t *sec, uint64_t ubase, + uint64_t udaddr) { uintptr_t daddr = (uintptr_t)dof; uintptr_t ts_end; @@ -13931,6 +13932,7 @@ dtrace_dof_relocate(dof_hdr_t *dof, dof_sec_t *sec, ui case DOF_RELO_NONE: break; case DOF_RELO_SETX: + case DOF_RELO_DOFREL: if (r->dofr_offset >= ts->dofs_size || r->dofr_offset + sizeof (uint64_t) > ts->dofs_size) { dtrace_dof_error(dof, "bad relocation offset"); @@ -13947,7 +13949,11 @@ dtrace_dof_relocate(dof_hdr_t *dof, dof_sec_t *sec, ui return (-1); } - *(uint64_t *)taddr += ubase; + if (r->dofr_type == DOF_RELO_SETX) + *(uint64_t *)taddr += ubase; + else + *(uint64_t *)taddr += + udaddr + ts->dofs_offset + r->dofr_offset; break; default: dtrace_dof_error(dof, "invalid relocation type"); @@ -13968,7 +13974,7 @@ dtrace_dof_relocate(dof_hdr_t *dof, dof_sec_t *sec, ui */ static int dtrace_dof_slurp(dof_hdr_t *dof, dtrace_vstate_t *vstate, cred_t *cr, - dtrace_enabling_t **enabp, uint64_t ubase, int noprobes) + dtrace_enabling_t **enabp, uint64_t ubase, uint64_t udaddr, int noprobes) { uint64_t len = dof->dofh_loadsz, seclen; uintptr_t daddr = (uintptr_t)dof; @@ -14130,7 +14136,7 @@ dtrace_dof_slurp(dof_hdr_t *dof, dtrace_vstate_t *vsta switch (sec->dofs_type) { case DOF_SECT_URELHDR: - if (dtrace_dof_relocate(dof, sec, ubase) != 0) + if (dtrace_dof_relocate(dof, sec, ubase, udaddr) != 0) return (-1); break; } @@ -15495,7 +15501,7 @@ dtrace_anon_property(void) } rv = dtrace_dof_slurp(dof, &state->dts_vstate, CRED(), - &dtrace_anon.dta_enabling, 0, B_TRUE); + &dtrace_anon.dta_enabling, 0, 0, B_TRUE); if (rv == 0) rv = dtrace_dof_options(dof, state); @@ -16250,18 +16256,11 @@ dtrace_helper_provider_validate(dof_hdr_t *dof, dof_se } static int -#ifdef __FreeBSD__ dtrace_helper_slurp(dof_hdr_t *dof, dof_helper_t *dhp, struct proc *p) -#else -dtrace_helper_slurp(dof_hdr_t *dof, dof_helper_t *dhp) -#endif { dtrace_helpers_t *help; dtrace_vstate_t *vstate; dtrace_enabling_t *enab = NULL; -#ifndef __FreeBSD__ - proc_t *p = curproc; -#endif int i, gen, rv, nhelpers = 0, nprovs = 0, destroy = 1; uintptr_t daddr = (uintptr_t)dof; @@ -16272,8 +16271,8 @@ dtrace_helper_slurp(dof_hdr_t *dof, dof_helper_t *dhp) vstate = &help->dthps_vstate; - if ((rv = dtrace_dof_slurp(dof, vstate, NULL, &enab, - dhp != NULL ? dhp->dofhp_addr : 0, B_FALSE)) != 0) { + if ((rv = dtrace_dof_slurp(dof, vstate, NULL, &enab, dhp->dofhp_addr, + dhp->dofhp_dof, B_FALSE)) != 0) { dtrace_dof_destroy(dof); return (rv); } @@ -16281,22 +16280,20 @@ dtrace_helper_slurp(dof_hdr_t *dof, dof_helper_t *dhp) /* * Look for helper providers and validate their descriptions. */ - if (dhp != NULL) { - for (i = 0; i < dof->dofh_secnum; i++) { - dof_sec_t *sec = (dof_sec_t *)(uintptr_t)(daddr + - dof->dofh_secoff + i * dof->dofh_secsize); + for (i = 0; i < dof->dofh_secnum; i++) { + dof_sec_t *sec = (dof_sec_t *)(uintptr_t)(daddr + + dof->dofh_secoff + i * dof->dofh_secsize); - if (sec->dofs_type != DOF_SECT_PROVIDER) - continue; + if (sec->dofs_type != DOF_SECT_PROVIDER) + continue; - if (dtrace_helper_provider_validate(dof, sec) != 0) { - dtrace_enabling_destroy(enab); - dtrace_dof_destroy(dof); - return (-1); - } - - nprovs++; + if (dtrace_helper_provider_validate(dof, sec) != 0) { + dtrace_enabling_destroy(enab); + dtrace_dof_destroy(dof); + return (-1); } + + nprovs++; } /* @@ -16337,7 +16334,7 @@ dtrace_helper_slurp(dof_hdr_t *dof, dof_helper_t *dhp) gen = help->dthps_generation++; dtrace_enabling_destroy(enab); - if (dhp != NULL && nprovs > 0) { + if (nprovs > 0) { /* * Now that this is in-kernel, we change the sense of the * members: dofhp_dof denotes the in-kernel copy of the DOF Modified: releng/11.4/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h ============================================================================== --- releng/11.4/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Mon May 18 15:05:59 2020 (r361216) +++ releng/11.4/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Mon May 18 15:59:17 2020 (r361217) @@ -788,6 +788,7 @@ typedef struct dof_relodesc { #define DOF_RELO_NONE 0 /* empty relocation entry */ #define DOF_RELO_SETX 1 /* relocate setx value */ +#define DOF_RELO_DOFREL 2 /* relocate DOF-relative value */ typedef struct dof_optdesc { uint32_t dofo_option; /* option identifier */ @@ -1414,7 +1415,6 @@ typedef struct { #define DTRACEHIOC_REMOVE (DTRACEHIOC | 2) /* remove helper */ #define DTRACEHIOC_ADDDOF (DTRACEHIOC | 3) /* add helper DOF */ #else -#define DTRACEHIOC_ADD _IOWR('z', 1, dof_hdr_t)/* add helper */ #define DTRACEHIOC_REMOVE _IOW('z', 2, int) /* remove helper */ #define DTRACEHIOC_ADDDOF _IOWR('z', 3, dof_helper_t)/* add helper DOF */ #endif Modified: releng/11.4/sys/cddl/dev/dtrace/dtrace_ioctl.c ============================================================================== --- releng/11.4/sys/cddl/dev/dtrace/dtrace_ioctl.c Mon May 18 15:05:59 2020 (r361216) +++ releng/11.4/sys/cddl/dev/dtrace/dtrace_ioctl.c Mon May 18 15:59:17 2020 (r361217) @@ -44,10 +44,8 @@ dtrace_ioctl_helper(struct cdev *dev, u_long cmd, cadd case DTRACEHIOC_ADDDOF: dhp = (dof_helper_t *)addr; addr = (caddr_t)(uintptr_t)dhp->dofhp_dof; - /* FALLTHROUGH */ - case DTRACEHIOC_ADD: - p = curproc; - if (dhp == NULL || p->p_pid == dhp->dofhp_pid) { + if (p->p_pid == dhp->dofhp_pid) { + p = curproc; dof = dtrace_dof_copyin((uintptr_t)addr, &rval); } else { p = pfind(dhp->dofhp_pid); @@ -72,10 +70,7 @@ dtrace_ioctl_helper(struct cdev *dev, u_long cmd, cadd mutex_enter(&dtrace_lock); if ((rval = dtrace_helper_slurp(dof, dhp, p)) != -1) { - if (dhp != NULL) { - dhp->dofhp_gen = rval; - copyout(dhp, addr, sizeof(*dhp)); - } + dhp->dofhp_gen = rval; rval = 0; } else { rval = EINVAL; @@ -432,7 +427,8 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t add return (EBUSY); } - if (dtrace_dof_slurp(dof, vstate, td->td_ucred, &enab, 0, B_TRUE) != 0) { + if (dtrace_dof_slurp(dof, vstate, td->td_ucred, &enab, 0, 0, + B_TRUE) != 0) { mutex_exit(&dtrace_lock); mutex_exit(&cpu_lock); dtrace_dof_destroy(dof); From owner-svn-src-all@freebsd.org Mon May 18 16:07: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 58D352CE877; Mon, 18 May 2020 16:07:15 +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 49QkRk4LZqz3yMb; Mon, 18 May 2020 16:07:14 +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 8C1E024226; Mon, 18 May 2020 16:07:14 +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 04IG7E21010714; Mon, 18 May 2020 16:07:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IG7EcM010713; Mon, 18 May 2020 16:07:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005181607.04IG7EcM010713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 18 May 2020 16:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361218 - head/contrib/binutils/gas X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/binutils/gas X-SVN-Commit-Revision: 361218 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, 18 May 2020 16:07:15 -0000 Author: emaste Date: Mon May 18 16:07:14 2020 New Revision: 361218 URL: https://svnweb.freebsd.org/changeset/base/361218 Log: GNU as: move deprecation message after option parsing Some cmake test parses the output of the first line of as --version, and emits an error if it does not contain some expected strings: Checking whether the ASM compiler is GNU using "--version" did not match "(GNU assembler)|(GCC)|(Free Software Foundation)" Emit the deprecation message later, after parsing argv and thus --version. PR: 246540 Reported by: dch Sponsored by: The FreeBSD Foundation Modified: head/contrib/binutils/gas/as.c Modified: head/contrib/binutils/gas/as.c ============================================================================== --- head/contrib/binutils/gas/as.c Mon May 18 15:59:17 2020 (r361217) +++ head/contrib/binutils/gas/as.c Mon May 18 16:07:14 2020 (r361218) @@ -1089,7 +1089,6 @@ main (int argc, char ** argv) expandargv (&argc, &argv); START_PROGRESS (myname, 0); - fprintf (stderr, _("warning: as 2.17.50 is deprecated in FreeBSD and will be removed\n")); #ifndef OBJ_DEFAULT_OUTPUT_FILE_NAME #define OBJ_DEFAULT_OUTPUT_FILE_NAME "a.out" @@ -1109,6 +1108,7 @@ main (int argc, char ** argv) /* Call parse_args before any of the init/begin functions so that switches like --hash-size can be honored. */ parse_args (&argc, &argv); + fprintf (stderr, _("warning: GNU as %s is deprecated and will be removed\n"), BFD_VERSION_STRING); symbol_begin (); frag_init (); subsegs_begin (); From owner-svn-src-all@freebsd.org Mon May 18 16:33: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 8F6592CEF6E; Mon, 18 May 2020 16:33:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Ql25392Pz40xZ; Mon, 18 May 2020 16:33:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67F7D247FE; Mon, 18 May 2020 16:33:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IGXXDs029166; Mon, 18 May 2020 16:33:33 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IGXXKl029165; Mon, 18 May 2020 16:33:33 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202005181633.04IGXXKl029165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 18 May 2020 16:33:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r361219 - releng/11.4/lib/libz X-SVN-Group: releng X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: releng/11.4/lib/libz X-SVN-Commit-Revision: 361219 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, 18 May 2020 16:33:33 -0000 Author: delphij Date: Mon May 18 16:33:32 2020 New Revision: 361219 URL: https://svnweb.freebsd.org/changeset/base/361219 Log: MFS r361069: MFC r360952: Generate zlib.pc from source. Approved by: re (gjb) Deleted: releng/11.4/lib/libz/zlib.pc Modified: releng/11.4/lib/libz/Makefile Directory Properties: releng/11.4/ (props changed) Modified: releng/11.4/lib/libz/Makefile ============================================================================== --- releng/11.4/lib/libz/Makefile Mon May 18 16:07:14 2020 (r361218) +++ releng/11.4/lib/libz/Makefile Mon May 18 16:33:32 2020 (r361219) @@ -52,6 +52,17 @@ INCS= zconf.h zlib.h .PATH: ${ZLIBSRC}/test +ZLIB_VERSION!= sed -n '/define.*ZLIB_VERSION/{s,[^0-9.],,gp;q;}' ${ZLIBSRC}/zlib.h + +zlib.pc: zlib.pc.in + sed -e 's,@prefix@,/usr,g ; \ + s,@exec_prefix@,$${prefix},g ; \ + s,@libdir@,$${exec_prefix}/lib,g ; \ + s,@sharedlibdir@,$${libdir},g ; \ + s,@includedir@,$${prefix}/include,g ; \ + s,@VERSION@,${ZLIB_VERSION},g ;' \ + ${.ALLSRC} > ${.TARGET} + minigzip: all minigzip.o $(CC) -o minigzip minigzip.o -L. -lz From owner-svn-src-all@freebsd.org Mon May 18 16: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 8EE292CF5E5; Mon, 18 May 2020 16:47:45 +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 49QlLT3Dzlz41nK; Mon, 18 May 2020 16:47:45 +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 6A580248A1; Mon, 18 May 2020 16:47:45 +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 04IGljG2035763; Mon, 18 May 2020 16:47:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IGljXf035762; Mon, 18 May 2020 16:47:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005181647.04IGljXf035762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 18 May 2020 16:47:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361220 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 361220 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, 18 May 2020 16:47:45 -0000 Author: jhb Date: Mon May 18 16:47:44 2020 New Revision: 361220 URL: https://svnweb.freebsd.org/changeset/base/361220 Log: Correct the order of arguments to copyin() for Q_SETQUOTA. MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24656 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon May 18 16:33:32 2020 (r361219) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon May 18 16:47:44 2020 (r361220) @@ -267,7 +267,7 @@ zfs_quotactl(vfs_t *vfsp, int cmds, uid_t id, void *ar vfs_unbusy(vfsp); break; case Q_SETQUOTA: - error = copyin(&dqblk, arg, sizeof(dqblk)); + error = copyin(arg, &dqblk, sizeof(dqblk)); if (error == 0) error = zfs_set_userquota(zfsvfs, quota_type, "", id, dbtob(dqblk.dqb_bhardlimit)); From owner-svn-src-all@freebsd.org Mon May 18 17:35: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 C02032D883C; Mon, 18 May 2020 17:35:20 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QmPN2Lbmz44Ss; Mon, 18 May 2020 17:35:19 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from mbp.fritz.box (ip4d1600c4.dynamic.kabel-deutschland.de [77.22.0.196]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 078627220F406; Mon, 18 May 2020 19:35:13 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r361209 - head/sys/netinet From: Michael Tuexen In-Reply-To: Date: Mon, 18 May 2020 19:35:13 +0200 Cc: src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: References: <202005181007.04IA713t089936@repo.freebsd.org> To: cem@freebsd.org X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 49QmPN2Lbmz44Ss 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:680, ipnet:2001:638::/32, 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: Mon, 18 May 2020 17:35:20 -0000 > On 18. May 2020, at 17:38, Conrad Meyer wrote: >=20 > Hi Michael, >=20 > These changes are a bit odd. The only reason a standards-compliant > snprintf() would fail to nul-terminate a buffer is if the provided > buffer had length zero. Since this is not the case in any of these > uses, I wonder why this revision was made? Does a SCTP downstream Hi Conrad, when compiling the code in userland with gcc 10, it warns that the output might be truncated. That is true and intended. So checking that the call doesn't fail silences this warning and ensures the code works in case snprintf() returns an error. I don't see in the POSIX specification a statement limiting the case where it could fail. > have a broken snprintf implementation, and if so, wouldn't it make > more sense to create a standards-compliant portability shim for that > platform instead of this more invasive change? If you want, I can revert the change and use the code only on = non-FreeBSD platforms. Best regards Michael >=20 > FreeBSD's snprintf(9) does not have this bug, nor does its = snprintf(3). >=20 > Best regards, > Conrad >=20 > On Mon, May 18, 2020 at 3:07 AM Michael Tuexen = wrote: >>=20 >> Author: tuexen >> Date: Mon May 18 10:07:01 2020 >> New Revision: 361209 >> URL: https://svnweb.freebsd.org/changeset/base/361209 >>=20 >> Log: >> Handle failures of snprintf(). >>=20 >> MFC after: 3 days >>=20 >> Modified: >> head/sys/netinet/sctp_asconf.c >> head/sys/netinet/sctp_indata.c >> head/sys/netinet/sctp_input.c >> head/sys/netinet/sctp_output.c >> head/sys/netinet/sctp_pcb.c >>=20 >> Modified: head/sys/netinet/sctp_asconf.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/netinet/sctp_asconf.c Mon May 18 09:46:51 2020 = (r361208) >> +++ head/sys/netinet/sctp_asconf.c Mon May 18 10:07:01 2020 = (r361209) >> @@ -1706,8 +1706,9 @@ sctp_handle_asconf_ack(struct mbuf *m, int = offset, >> char msg[SCTP_DIAG_INFO_LEN]; >>=20 >> SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf_ack: got = unexpected next serial number! Aborting asoc!\n"); >> - snprintf(msg, sizeof(msg), "Never sent serial number = %8.8x", >> - serial_num); >> + if (snprintf(msg, sizeof(msg), "Never sent serial = number %8.8x", serial_num) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, = SCTP_SO_NOT_LOCKED); >> *abort_no_unlock =3D 1; >>=20 >> Modified: head/sys/netinet/sctp_indata.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/netinet/sctp_indata.c Mon May 18 09:46:51 2020 = (r361208) >> +++ head/sys/netinet/sctp_indata.c Mon May 18 10:07:01 2020 = (r361209) >> @@ -434,22 +434,26 @@ sctp_abort_in_reasm(struct sctp_tcb *stcb, >> struct mbuf *oper; >>=20 >> if (stcb->asoc.idata_supported) { >> - snprintf(msg, sizeof(msg), >> + if (snprintf(msg, sizeof(msg), >> "Reass = %x,CF:%x,TSN=3D%8.8x,SID=3D%4.4x,FSN=3D%8.8x,MID:%8.8x", >> opspot, >> control->fsn_included, >> chk->rec.data.tsn, >> chk->rec.data.sid, >> - chk->rec.data.fsn, chk->rec.data.mid); >> + chk->rec.data.fsn, chk->rec.data.mid) < 0) { >> + msg[0] =3D '\0'; >> + } >> } else { >> - snprintf(msg, sizeof(msg), >> + if (snprintf(msg, sizeof(msg), >> "Reass = %x,CI:%x,TSN=3D%8.8x,SID=3D%4.4x,FSN=3D%4.4x,SSN:%4.4x", >> opspot, >> control->fsn_included, >> chk->rec.data.tsn, >> chk->rec.data.sid, >> chk->rec.data.fsn, >> - (uint16_t)chk->rec.data.mid); >> + (uint16_t)chk->rec.data.mid) < 0) { >> + msg[0] =3D '\0'; >> + } >> } >> oper =3D sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, = msg); >> sctp_m_freem(chk->data); >> @@ -533,15 +537,19 @@ sctp_queue_data_to_stream(struct sctp_tcb = *stcb, >> */ >> TAILQ_INSERT_HEAD(&strm->inqueue, control, = next_instrm); >> if (asoc->idata_supported) { >> - snprintf(msg, sizeof(msg), "Delivered = MID=3D%8.8x, got TSN=3D%8.8x, SID=3D%4.4x, MID=3D%8.8x", >> + if (snprintf(msg, sizeof(msg), "Delivered = MID=3D%8.8x, got TSN=3D%8.8x, SID=3D%4.4x, MID=3D%8.8x", >> strm->last_mid_delivered, = control->sinfo_tsn, >> - control->sinfo_stream, control->mid); >> + control->sinfo_stream, control->mid) < 0) = { >> + msg[0] =3D '\0'; >> + } >> } else { >> - snprintf(msg, sizeof(msg), "Delivered = SSN=3D%4.4x, got TSN=3D%8.8x, SID=3D%4.4x, SSN=3D%4.4x", >> + if (snprintf(msg, sizeof(msg), "Delivered = SSN=3D%4.4x, got TSN=3D%8.8x, SID=3D%4.4x, SSN=3D%4.4x", >> (uint16_t)strm->last_mid_delivered, >> control->sinfo_tsn, >> control->sinfo_stream, >> - (uint16_t)control->mid); >> + (uint16_t)control->mid) < 0) { >> + msg[0] =3D '\0'; >> + } >> } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_2; >> @@ -648,9 +656,10 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, >> * to put it on the queue. >> */ >> if (sctp_place_control_in_stream(strm, asoc, control)) = { >> - snprintf(msg, sizeof(msg), >> - "Queue to str MID: %u duplicate", >> - control->mid); >> + if (snprintf(msg, sizeof(msg), >> + "Queue to str MID: %u duplicate", = control->mid) < 0) { >> + msg[0] =3D '\0'; >> + } >> sctp_clean_up_control(stcb, control); >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_3; >> @@ -1881,8 +1890,9 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >> * can *not* be fsn 0. XXX: This can happen in case of = a >> * wrap around. Ignore is for now. >> */ >> - snprintf(msg, sizeof(msg), "FSN zero for MID=3D%8.8x, = but flags=3D%2.2x", >> - mid, chk_flags); >> + if (snprintf(msg, sizeof(msg), "FSN zero for = MID=3D%8.8x, but flags=3D%2.2x", mid, chk_flags) < 0) { >> + msg[0] =3D '\0'; >> + } >> goto err_out; >> } >> control =3D sctp_find_reasm_entry(&asoc->strmin[sid], mid, = ordered, asoc->idata_supported); >> @@ -1893,7 +1903,9 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >> if (control !=3D NULL) { >> /* We found something, does it belong? */ >> if (ordered && (mid !=3D control->mid)) { >> - snprintf(msg, sizeof(msg), = "Reassembly problem (MID=3D%8.8x)", mid); >> + if (snprintf(msg, sizeof(msg), = "Reassembly problem (MID=3D%8.8x)", mid) < 0) { >> + msg[0] =3D '\0'; >> + } >> err_out: >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; >> @@ -1906,8 +1918,11 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >> * We can't have a switched order with = an >> * unordered chunk >> */ >> - snprintf(msg, sizeof(msg), "All = fragments of a user message must be ordered or unordered (TSN=3D%8.8x)", >> - tsn); >> + if (snprintf(msg, sizeof(msg), >> + "All fragments of a user message = must be ordered or unordered (TSN=3D%8.8x)", >> + tsn) < 0) { >> + msg[0] =3D '\0'; >> + } >> goto err_out; >> } >> if (!ordered && (((control->sinfo_flags >> 8) = & SCTP_DATA_UNORDERED) =3D=3D 0)) { >> @@ -1915,8 +1930,11 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >> * We can't have a switched unordered = with a >> * ordered chunk >> */ >> - snprintf(msg, sizeof(msg), "All = fragments of a user message must be ordered or unordered (TSN=3D%8.8x)", >> - tsn); >> + if (snprintf(msg, sizeof(msg), >> + "All fragments of a user message = must be ordered or unordered (TSN=3D%8.8x)", >> + tsn) < 0) { >> + msg[0] =3D '\0'; >> + } >> goto err_out; >> } >> } >> @@ -1930,12 +1948,18 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >> if (ordered || asoc->idata_supported) { >> SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: = 0x%x dup detected on MID: %u\n", >> chk_flags, mid); >> - snprintf(msg, sizeof(msg), "Duplicate = MID=3D%8.8x detected.", mid); >> + if (snprintf(msg, sizeof(msg), = "Duplicate MID=3D%8.8x detected.", mid) < 0) { >> + msg[0] =3D '\0'; >> + } >> goto err_out; >> } else { >> if ((tsn =3D=3D control->fsn_included = + 1) && >> (control->end_added =3D=3D 0)) { >> - snprintf(msg, sizeof(msg), = "Illegal message sequence, missing end for MID: %8.8x", = control->fsn_included); >> + if (snprintf(msg, = sizeof(msg), >> + "Illegal message = sequence, missing end for MID: %8.8x", >> + control->fsn_included) < = 0) { >> + msg[0] =3D '\0'; >> + } >> goto err_out; >> } else { >> control =3D NULL; >> @@ -2032,17 +2056,21 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >> mid, asoc->strmin[sid].last_mid_delivered); >>=20 >> if (asoc->idata_supported) { >> - snprintf(msg, sizeof(msg), "Delivered = MID=3D%8.8x, got TSN=3D%8.8x, SID=3D%4.4x, MID=3D%8.8x", >> + if (snprintf(msg, sizeof(msg), "Delivered = MID=3D%8.8x, got TSN=3D%8.8x, SID=3D%4.4x, MID=3D%8.8x", >> asoc->strmin[sid].last_mid_delivered, >> tsn, >> sid, >> - mid); >> + mid) < 0) { >> + msg[0] =3D '\0'; >> + } >> } else { >> - snprintf(msg, sizeof(msg), "Delivered = SSN=3D%4.4x, got TSN=3D%8.8x, SID=3D%4.4x, SSN=3D%4.4x", >> + if (snprintf(msg, sizeof(msg), "Delivered = SSN=3D%4.4x, got TSN=3D%8.8x, SID=3D%4.4x, SSN=3D%4.4x", >> = (uint16_t)asoc->strmin[sid].last_mid_delivered, >> tsn, >> sid, >> - (uint16_t)mid); >> + (uint16_t)mid) < 0) { >> + msg[0] =3D '\0'; >> + } >> } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17; >> @@ -2769,7 +2797,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, = int *o >> struct mbuf *op_err; >> char msg[SCTP_DIAG_INFO_LEN]; >>=20 >> - snprintf(msg, sizeof(msg), "%s", "I-DATA = chunk received when DATA was negotiated"); >> + if (snprintf(msg, sizeof(msg), "%s", "I-DATA = chunk received when DATA was negotiated") < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; >> sctp_abort_an_association(inp, stcb, op_err, = SCTP_SO_NOT_LOCKED); >> @@ -2780,7 +2810,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, = int *o >> struct mbuf *op_err; >> char msg[SCTP_DIAG_INFO_LEN]; >>=20 >> - snprintf(msg, sizeof(msg), "%s", "DATA chunk = received when I-DATA was negotiated"); >> + if (snprintf(msg, sizeof(msg), "%s", "DATA = chunk received when I-DATA was negotiated") < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; >> sctp_abort_an_association(inp, stcb, op_err, = SCTP_SO_NOT_LOCKED); >> @@ -2803,9 +2835,11 @@ sctp_process_data(struct mbuf **mm, int = iphlen, int *o >> struct mbuf *op_err; >> char msg[SCTP_DIAG_INFO_LEN]; >>=20 >> - snprintf(msg, sizeof(msg), "%s chunk = of length %u", >> + if (snprintf(msg, sizeof(msg), "%s = chunk of length %u", >> ch->chunk_type =3D=3D SCTP_DATA ? = "DATA" : "I-DATA", >> - chk_length); >> + chk_length) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_22; >> sctp_abort_an_association(inp, stcb, = op_err, SCTP_SO_NOT_LOCKED); >> @@ -2874,8 +2908,10 @@ sctp_process_data(struct mbuf **mm, int = iphlen, int *o >> struct mbuf *op_err; >> char msg[SCTP_DIAG_INFO_LEN]; >>=20 >> - snprintf(msg, sizeof(msg), = "DATA chunk followed by chunk of type %2.2x", >> - ch->chunk_type); >> + if (snprintf(msg, = sizeof(msg), "DATA chunk followed by chunk of type %2.2x", >> + ch->chunk_type) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> sctp_abort_an_association(inp, = stcb, op_err, SCTP_SO_NOT_LOCKED); >> return (2); >> @@ -2893,8 +2929,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, = int *o >> struct mbuf *op_err; >> char msg[SCTP_DIAG_INFO_LEN]; >>=20 >> - snprintf(msg, sizeof(msg), = "Chunk of length %u", >> - chk_length); >> + if (snprintf(msg, = sizeof(msg), "Chunk of length %u", chk_length) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code = =3D SCTP_FROM_SCTP_INDATA + SCTP_LOC_23; >> sctp_abort_an_association(inp, = stcb, op_err, SCTP_SO_NOT_LOCKED); >> @@ -4043,8 +4080,11 @@ sctp_express_handle_sack(struct sctp_tcb = *stcb, uint32 >>=20 >> *abort_now =3D 1; >> /* XXX */ >> - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or = equal than TSN %8.8x", >> - cumack, send_s); >> + if (snprintf(msg, sizeof(msg), >> + "Cum ack %8.8x greater or equal than TSN %8.8x", >> + cumack, send_s) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; >> sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, = SCTP_SO_NOT_LOCKED); >> @@ -4585,8 +4625,11 @@ sctp_handle_sack(struct mbuf *m, int = offset_seg, int o >> hopeless_peer: >> *abort_now =3D 1; >> /* XXX */ >> - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or = equal than TSN %8.8x", >> - cum_ack, send_s); >> + if (snprintf(msg, sizeof(msg), >> + "Cum ack %8.8x greater or equal than TSN %8.8x", >> + cum_ack, send_s) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_28; >> sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, = SCTP_SO_NOT_LOCKED); >> @@ -5629,9 +5672,11 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, >> * give out). This must be an attacker. >> */ >> *abort_flag =3D 1; >> - snprintf(msg, sizeof(msg), >> + if (snprintf(msg, sizeof(msg), >> "New cum ack %8.8x too high, highest TSN = %8.8x", >> - new_cum_tsn, = asoc->highest_tsn_inside_map); >> + new_cum_tsn, = asoc->highest_tsn_inside_map) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_36; >> sctp_abort_an_association(stcb->sctp_ep, stcb, = op_err, SCTP_SO_NOT_LOCKED); >>=20 >> Modified: head/sys/netinet/sctp_input.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/netinet/sctp_input.c Mon May 18 09:46:51 2020 = (r361208) >> +++ head/sys/netinet/sctp_input.c Mon May 18 10:07:01 2020 = (r361209) >> @@ -4692,7 +4692,9 @@ sctp_process_control(struct mbuf *m, int = iphlen, int * >> } >> } >> if (stcb =3D=3D NULL) { >> - snprintf(msg, sizeof(msg), "OOTB, %s:%d at = %s", __FILE__, __LINE__, __func__); >> + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d = at %s", __FILE__, __LINE__, __func__) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> /* no association, so it's out of the blue... = */ >> @@ -4734,7 +4736,9 @@ sctp_process_control(struct mbuf *m, int = iphlen, int * >> if (stcb !=3D NULL) { >> SCTP_TCB_UNLOCK(stcb); >> } >> - snprintf(msg, sizeof(msg), "OOTB, = %s:%d at %s", __FILE__, __LINE__, __func__); >> + if (snprintf(msg, sizeof(msg), "OOTB, = %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> sctp_handle_ootb(m, iphlen, *offset, = src, dst, >> @@ -5671,7 +5675,9 @@ sctp_common_input_processing(struct mbuf **mm, = int iph >> SCTP_TCB_UNLOCK(stcb); >> stcb =3D NULL; >> SCTP_PROBE5(receive, NULL, stcb, m, stcb, sh); >> - snprintf(msg, sizeof(msg), "OOTB, %s:%d at = %s", __FILE__, __LINE__, __func__); >> + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d = at %s", __FILE__, __LINE__, __func__) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> sctp_handle_ootb(m, iphlen, offset, src, dst, = sh, inp, op_err, >> @@ -5733,7 +5739,9 @@ sctp_common_input_processing(struct mbuf **mm, = int iph >> if (stcb =3D=3D NULL) { >> /* out of the blue DATA chunk */ >> SCTP_PROBE5(receive, NULL, NULL, m, NULL, sh); >> - snprintf(msg, sizeof(msg), "OOTB, %s:%d at = %s", __FILE__, __LINE__, __func__); >> + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d = at %s", __FILE__, __LINE__, __func__) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> sctp_handle_ootb(m, iphlen, offset, src, dst, = sh, inp, op_err, >> @@ -5799,7 +5807,9 @@ sctp_common_input_processing(struct mbuf **mm, = int iph >> /* >> * We consider OOTB any data sent during asoc = setup. >> */ >> - snprintf(msg, sizeof(msg), "OOTB, %s:%d at = %s", __FILE__, __LINE__, __func__); >> + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d = at %s", __FILE__, __LINE__, __func__) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> sctp_handle_ootb(m, iphlen, offset, src, dst, = sh, inp, op_err, >>=20 >> Modified: head/sys/netinet/sctp_output.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/netinet/sctp_output.c Mon May 18 09:46:51 2020 = (r361208) >> +++ head/sys/netinet/sctp_output.c Mon May 18 10:07:01 2020 = (r361209) >> @@ -5581,7 +5581,9 @@ do_a_abort: >> if (op_err =3D=3D NULL) { >> char msg[SCTP_DIAG_INFO_LEN]; >>=20 >> - snprintf(msg, sizeof(msg), "%s:%d at %s", = __FILE__, __LINE__, __func__); >> + if (snprintf(msg, sizeof(msg), "%s:%d at %s", = __FILE__, __LINE__, __func__) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> } >> @@ -6758,8 +6760,10 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, = struct s >> char = msg[SCTP_DIAG_INFO_LEN]; >>=20 >> abort_anyway: >> - snprintf(msg, = sizeof(msg), >> - "%s:%d at %s", = __FILE__, __LINE__, __func__); >> + if (snprintf(msg, = sizeof(msg), >> + "%s:%d at %s", = __FILE__, __LINE__, __func__) < 0) { >> + msg[0] =3D = '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> = atomic_add_int(&stcb->asoc.refcnt, 1); >> @@ -9626,8 +9630,10 @@ sctp_chunk_retransmission(struct sctp_inpcb = *inp, >> struct mbuf *op_err; >> char msg[SCTP_DIAG_INFO_LEN]; >>=20 >> - snprintf(msg, sizeof(msg), "TSN %8.8x = retransmitted %d times, giving up", >> - chk->rec.data.tsn, chk->snd_count); >> + if (snprintf(msg, sizeof(msg), "TSN %8.8x = retransmitted %d times, giving up", >> + chk->rec.data.tsn, chk->snd_count) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> atomic_add_int(&stcb->asoc.refcnt, 1); >> @@ -13610,8 +13616,10 @@ dataless_eof: >> = atomic_add_int(&stcb->asoc.refcnt, -1); >> free_cnt_applied =3D = 0; >> } >> - snprintf(msg, sizeof(msg), >> - "%s:%d at %s", __FILE__, = __LINE__, __func__); >> + if (snprintf(msg, = sizeof(msg), >> + "%s:%d at %s", __FILE__, = __LINE__, __func__) < 0) { >> + msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> NET_EPOCH_ENTER(et); >>=20 >> Modified: head/sys/netinet/sctp_pcb.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/netinet/sctp_pcb.c Mon May 18 09:46:51 2020 = (r361208) >> +++ head/sys/netinet/sctp_pcb.c Mon May 18 10:07:01 2020 = (r361209) >> @@ -544,9 +544,13 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, = uint3 >> atomic_add_int(&vrf->refcount, 1); >> sctp_ifnp->ifn_mtu =3D = SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, addr->sa_family); >> if (if_name !=3D NULL) { >> - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, = "%s", if_name); >> + if (snprintf(sctp_ifnp->ifn_name, = SCTP_IFNAMSIZ, "%s", if_name) < 0) { >> + sctp_ifnp->ifn_name[0] =3D '\0'; >> + } >> } else { >> - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, = "%s", "unknown"); >> + if (snprintf(sctp_ifnp->ifn_name, = SCTP_IFNAMSIZ, "%s", "unknown") < 0) { >> + sctp_ifnp->ifn_name[0] =3D '\0'; >> + } >> } >> hash_ifn_head =3D = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & = SCTP_BASE_INFO(vrf_ifn_hashmark))]; >> LIST_INIT(&sctp_ifnp->ifalist); >> @@ -6221,8 +6225,10 @@ sctp_load_addresses_from_init(struct sctp_tcb = *stcb, s >> * in setup = state we >> * abort this = guy >> */ >> - snprintf(msg, = sizeof(msg), >> - "%s:%d at = %s", __FILE__, __LINE__, __func__); >> + if = (snprintf(msg, sizeof(msg), >> + "%s:%d at = %s", __FILE__, __LINE__, __func__) < 0) { >> + = msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> = sctp_abort_an_association(stcb_tmp->sctp_ep, >> @@ -6321,8 +6327,10 @@ sctp_load_addresses_from_init(struct sctp_tcb = *stcb, s >> * in setup = state we >> * abort this = guy >> */ >> - snprintf(msg, = sizeof(msg), >> - "%s:%d at = %s", __FILE__, __LINE__, __func__); >> + if = (snprintf(msg, sizeof(msg), >> + "%s:%d at = %s", __FILE__, __LINE__, __func__) < 0) { >> + = msg[0] =3D '\0'; >> + } >> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >> msg); >> = sctp_abort_an_association(stcb_tmp->sctp_ep, From owner-svn-src-all@freebsd.org Mon May 18 17:39: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 968F62D88F3; Mon, 18 May 2020 17:39:04 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QmTh2xgsz44vv; Mon, 18 May 2020 17:39:03 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from mbp.fritz.box (ip4d1600c4.dynamic.kabel-deutschland.de [77.22.0.196]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id B466E7220F406; Mon, 18 May 2020 19:39:00 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r361209 - head/sys/netinet From: Michael Tuexen In-Reply-To: Date: Mon, 18 May 2020 19:39:00 +0200 Cc: src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: <78E9B091-4873-4109-A136-D7479DB0C77C@freebsd.org> References: <202005181007.04IA713t089936@repo.freebsd.org> To: cem@freebsd.org X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 49QmTh2xgsz44vv X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:680, ipnet:2001:638::/32, country:DE]; 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: Mon, 18 May 2020 17:39:04 -0000 > On 18. May 2020, at 17:48, Conrad Meyer wrote: >=20 > (In fact, I don't believe snprintf(9) can return a negative value at > all. And snprintf(3) will only do so in some special circumstances > for features snprintf(9) does not support: buffer size or formatted > result longer than INT_MAX; invalid *nn$ field width or precision > specifiers. I don't think either case applies to these strings, > although I did not read all of them thoroughly.) I have no problem to revert this change for FreeBSD if it is there impossible (and hopefully gcc 10 knows about this in case someone builds the userland stack with gcc 10 on FreeBSD). In the posix specification I don't see this. For FreeBSD, it would be great to update the man page, which currently states RETURN VALUES These functions return the number of characters printed (not = including the trailing `\0' used to end output to strings), except for = snprintf() and vsnprintf(), which return the number of characters that would = have been printed if the size were unlimited (again, not including the = final `\0'). These functions return a negative value if an error occurs. So it would be great to be specific about when an error occurs in the last sentence. Best regards Michael >=20 > On Mon, May 18, 2020 at 8:38 AM Conrad Meyer wrote: >>=20 >> Hi Michael, >>=20 >> These changes are a bit odd. The only reason a standards-compliant >> snprintf() would fail to nul-terminate a buffer is if the provided >> buffer had length zero. Since this is not the case in any of these >> uses, I wonder why this revision was made? Does a SCTP downstream >> have a broken snprintf implementation, and if so, wouldn't it make >> more sense to create a standards-compliant portability shim for that >> platform instead of this more invasive change? >>=20 >> FreeBSD's snprintf(9) does not have this bug, nor does its = snprintf(3). >>=20 >> Best regards, >> Conrad >>=20 >> On Mon, May 18, 2020 at 3:07 AM Michael Tuexen = wrote: >>>=20 >>> Author: tuexen >>> Date: Mon May 18 10:07:01 2020 >>> New Revision: 361209 >>> URL: https://svnweb.freebsd.org/changeset/base/361209 >>>=20 >>> Log: >>> Handle failures of snprintf(). >>>=20 >>> MFC after: 3 days >>>=20 >>> Modified: >>> head/sys/netinet/sctp_asconf.c >>> head/sys/netinet/sctp_indata.c >>> head/sys/netinet/sctp_input.c >>> head/sys/netinet/sctp_output.c >>> head/sys/netinet/sctp_pcb.c >>>=20 >>> Modified: head/sys/netinet/sctp_asconf.c >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/sys/netinet/sctp_asconf.c Mon May 18 09:46:51 2020 = (r361208) >>> +++ head/sys/netinet/sctp_asconf.c Mon May 18 10:07:01 2020 = (r361209) >>> @@ -1706,8 +1706,9 @@ sctp_handle_asconf_ack(struct mbuf *m, int = offset, >>> char msg[SCTP_DIAG_INFO_LEN]; >>>=20 >>> SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf_ack: got = unexpected next serial number! Aborting asoc!\n"); >>> - snprintf(msg, sizeof(msg), "Never sent serial number = %8.8x", >>> - serial_num); >>> + if (snprintf(msg, sizeof(msg), "Never sent serial = number %8.8x", serial_num) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> sctp_abort_an_association(stcb->sctp_ep, stcb, = op_err, SCTP_SO_NOT_LOCKED); >>> *abort_no_unlock =3D 1; >>>=20 >>> Modified: head/sys/netinet/sctp_indata.c >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/sys/netinet/sctp_indata.c Mon May 18 09:46:51 2020 = (r361208) >>> +++ head/sys/netinet/sctp_indata.c Mon May 18 10:07:01 2020 = (r361209) >>> @@ -434,22 +434,26 @@ sctp_abort_in_reasm(struct sctp_tcb *stcb, >>> struct mbuf *oper; >>>=20 >>> if (stcb->asoc.idata_supported) { >>> - snprintf(msg, sizeof(msg), >>> + if (snprintf(msg, sizeof(msg), >>> "Reass = %x,CF:%x,TSN=3D%8.8x,SID=3D%4.4x,FSN=3D%8.8x,MID:%8.8x", >>> opspot, >>> control->fsn_included, >>> chk->rec.data.tsn, >>> chk->rec.data.sid, >>> - chk->rec.data.fsn, chk->rec.data.mid); >>> + chk->rec.data.fsn, chk->rec.data.mid) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> } else { >>> - snprintf(msg, sizeof(msg), >>> + if (snprintf(msg, sizeof(msg), >>> "Reass = %x,CI:%x,TSN=3D%8.8x,SID=3D%4.4x,FSN=3D%4.4x,SSN:%4.4x", >>> opspot, >>> control->fsn_included, >>> chk->rec.data.tsn, >>> chk->rec.data.sid, >>> chk->rec.data.fsn, >>> - (uint16_t)chk->rec.data.mid); >>> + (uint16_t)chk->rec.data.mid) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> } >>> oper =3D sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, = msg); >>> sctp_m_freem(chk->data); >>> @@ -533,15 +537,19 @@ sctp_queue_data_to_stream(struct sctp_tcb = *stcb, >>> */ >>> TAILQ_INSERT_HEAD(&strm->inqueue, control, = next_instrm); >>> if (asoc->idata_supported) { >>> - snprintf(msg, sizeof(msg), "Delivered = MID=3D%8.8x, got TSN=3D%8.8x, SID=3D%4.4x, MID=3D%8.8x", >>> + if (snprintf(msg, sizeof(msg), "Delivered = MID=3D%8.8x, got TSN=3D%8.8x, SID=3D%4.4x, MID=3D%8.8x", >>> strm->last_mid_delivered, = control->sinfo_tsn, >>> - control->sinfo_stream, control->mid); >>> + control->sinfo_stream, control->mid) < = 0) { >>> + msg[0] =3D '\0'; >>> + } >>> } else { >>> - snprintf(msg, sizeof(msg), "Delivered = SSN=3D%4.4x, got TSN=3D%8.8x, SID=3D%4.4x, SSN=3D%4.4x", >>> + if (snprintf(msg, sizeof(msg), "Delivered = SSN=3D%4.4x, got TSN=3D%8.8x, SID=3D%4.4x, SSN=3D%4.4x", >>> (uint16_t)strm->last_mid_delivered, >>> control->sinfo_tsn, >>> control->sinfo_stream, >>> - (uint16_t)control->mid); >>> + (uint16_t)control->mid) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_2; >>> @@ -648,9 +656,10 @@ sctp_queue_data_to_stream(struct sctp_tcb = *stcb, >>> * to put it on the queue. >>> */ >>> if (sctp_place_control_in_stream(strm, asoc, = control)) { >>> - snprintf(msg, sizeof(msg), >>> - "Queue to str MID: %u duplicate", >>> - control->mid); >>> + if (snprintf(msg, sizeof(msg), >>> + "Queue to str MID: %u duplicate", = control->mid) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> sctp_clean_up_control(stcb, control); >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_3; >>> @@ -1881,8 +1890,9 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >>> * can *not* be fsn 0. XXX: This can happen in case = of a >>> * wrap around. Ignore is for now. >>> */ >>> - snprintf(msg, sizeof(msg), "FSN zero for MID=3D%8.8x, = but flags=3D%2.2x", >>> - mid, chk_flags); >>> + if (snprintf(msg, sizeof(msg), "FSN zero for = MID=3D%8.8x, but flags=3D%2.2x", mid, chk_flags) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> goto err_out; >>> } >>> control =3D sctp_find_reasm_entry(&asoc->strmin[sid], mid, = ordered, asoc->idata_supported); >>> @@ -1893,7 +1903,9 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >>> if (control !=3D NULL) { >>> /* We found something, does it belong? */ >>> if (ordered && (mid !=3D control->mid)) { >>> - snprintf(msg, sizeof(msg), = "Reassembly problem (MID=3D%8.8x)", mid); >>> + if (snprintf(msg, sizeof(msg), = "Reassembly problem (MID=3D%8.8x)", mid) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> err_out: >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; >>> @@ -1906,8 +1918,11 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >>> * We can't have a switched order = with an >>> * unordered chunk >>> */ >>> - snprintf(msg, sizeof(msg), "All = fragments of a user message must be ordered or unordered (TSN=3D%8.8x)", >>> - tsn); >>> + if (snprintf(msg, sizeof(msg), >>> + "All fragments of a user message = must be ordered or unordered (TSN=3D%8.8x)", >>> + tsn) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> goto err_out; >>> } >>> if (!ordered && (((control->sinfo_flags >> 8) = & SCTP_DATA_UNORDERED) =3D=3D 0)) { >>> @@ -1915,8 +1930,11 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >>> * We can't have a switched unordered = with a >>> * ordered chunk >>> */ >>> - snprintf(msg, sizeof(msg), "All = fragments of a user message must be ordered or unordered (TSN=3D%8.8x)", >>> - tsn); >>> + if (snprintf(msg, sizeof(msg), >>> + "All fragments of a user message = must be ordered or unordered (TSN=3D%8.8x)", >>> + tsn) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> goto err_out; >>> } >>> } >>> @@ -1930,12 +1948,18 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >>> if (ordered || asoc->idata_supported) { >>> SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: = 0x%x dup detected on MID: %u\n", >>> chk_flags, mid); >>> - snprintf(msg, sizeof(msg), = "Duplicate MID=3D%8.8x detected.", mid); >>> + if (snprintf(msg, sizeof(msg), = "Duplicate MID=3D%8.8x detected.", mid) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> goto err_out; >>> } else { >>> if ((tsn =3D=3D control->fsn_included = + 1) && >>> (control->end_added =3D=3D 0)) { >>> - snprintf(msg, sizeof(msg), = "Illegal message sequence, missing end for MID: %8.8x", = control->fsn_included); >>> + if (snprintf(msg, = sizeof(msg), >>> + "Illegal message = sequence, missing end for MID: %8.8x", >>> + control->fsn_included) < = 0) { >>> + msg[0] =3D '\0'; >>> + } >>> goto err_out; >>> } else { >>> control =3D NULL; >>> @@ -2032,17 +2056,21 @@ sctp_process_a_data_chunk(struct sctp_tcb = *stcb, struc >>> mid, asoc->strmin[sid].last_mid_delivered); >>>=20 >>> if (asoc->idata_supported) { >>> - snprintf(msg, sizeof(msg), "Delivered = MID=3D%8.8x, got TSN=3D%8.8x, SID=3D%4.4x, MID=3D%8.8x", >>> + if (snprintf(msg, sizeof(msg), "Delivered = MID=3D%8.8x, got TSN=3D%8.8x, SID=3D%4.4x, MID=3D%8.8x", >>> asoc->strmin[sid].last_mid_delivered, >>> tsn, >>> sid, >>> - mid); >>> + mid) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> } else { >>> - snprintf(msg, sizeof(msg), "Delivered = SSN=3D%4.4x, got TSN=3D%8.8x, SID=3D%4.4x, SSN=3D%4.4x", >>> + if (snprintf(msg, sizeof(msg), "Delivered = SSN=3D%4.4x, got TSN=3D%8.8x, SID=3D%4.4x, SSN=3D%4.4x", >>> = (uint16_t)asoc->strmin[sid].last_mid_delivered, >>> tsn, >>> sid, >>> - (uint16_t)mid); >>> + (uint16_t)mid) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17; >>> @@ -2769,7 +2797,9 @@ sctp_process_data(struct mbuf **mm, int = iphlen, int *o >>> struct mbuf *op_err; >>> char msg[SCTP_DIAG_INFO_LEN]; >>>=20 >>> - snprintf(msg, sizeof(msg), "%s", "I-DATA = chunk received when DATA was negotiated"); >>> + if (snprintf(msg, sizeof(msg), "%s", "I-DATA = chunk received when DATA was negotiated") < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; >>> sctp_abort_an_association(inp, stcb, op_err, = SCTP_SO_NOT_LOCKED); >>> @@ -2780,7 +2810,9 @@ sctp_process_data(struct mbuf **mm, int = iphlen, int *o >>> struct mbuf *op_err; >>> char msg[SCTP_DIAG_INFO_LEN]; >>>=20 >>> - snprintf(msg, sizeof(msg), "%s", "DATA chunk = received when I-DATA was negotiated"); >>> + if (snprintf(msg, sizeof(msg), "%s", "DATA = chunk received when I-DATA was negotiated") < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; >>> sctp_abort_an_association(inp, stcb, op_err, = SCTP_SO_NOT_LOCKED); >>> @@ -2803,9 +2835,11 @@ sctp_process_data(struct mbuf **mm, int = iphlen, int *o >>> struct mbuf *op_err; >>> char msg[SCTP_DIAG_INFO_LEN]; >>>=20 >>> - snprintf(msg, sizeof(msg), "%s chunk = of length %u", >>> + if (snprintf(msg, sizeof(msg), "%s = chunk of length %u", >>> ch->chunk_type =3D=3D SCTP_DATA ? = "DATA" : "I-DATA", >>> - chk_length); >>> + chk_length) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_22; >>> sctp_abort_an_association(inp, stcb, = op_err, SCTP_SO_NOT_LOCKED); >>> @@ -2874,8 +2908,10 @@ sctp_process_data(struct mbuf **mm, int = iphlen, int *o >>> struct mbuf *op_err; >>> char msg[SCTP_DIAG_INFO_LEN]; >>>=20 >>> - snprintf(msg, sizeof(msg), = "DATA chunk followed by chunk of type %2.2x", >>> - ch->chunk_type); >>> + if (snprintf(msg, = sizeof(msg), "DATA chunk followed by chunk of type %2.2x", >>> + ch->chunk_type) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> = sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); >>> return (2); >>> @@ -2893,8 +2929,9 @@ sctp_process_data(struct mbuf **mm, int = iphlen, int *o >>> struct mbuf *op_err; >>> char msg[SCTP_DIAG_INFO_LEN]; >>>=20 >>> - snprintf(msg, sizeof(msg), = "Chunk of length %u", >>> - chk_length); >>> + if (snprintf(msg, = sizeof(msg), "Chunk of length %u", chk_length) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> = stcb->sctp_ep->last_abort_code =3D SCTP_FROM_SCTP_INDATA + SCTP_LOC_23; >>> = sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); >>> @@ -4043,8 +4080,11 @@ sctp_express_handle_sack(struct sctp_tcb = *stcb, uint32 >>>=20 >>> *abort_now =3D 1; >>> /* XXX */ >>> - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or = equal than TSN %8.8x", >>> - cumack, send_s); >>> + if (snprintf(msg, sizeof(msg), >>> + "Cum ack %8.8x greater or equal than TSN %8.8x", >>> + cumack, send_s) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; >>> sctp_abort_an_association(stcb->sctp_ep, stcb, = op_err, SCTP_SO_NOT_LOCKED); >>> @@ -4585,8 +4625,11 @@ sctp_handle_sack(struct mbuf *m, int = offset_seg, int o >>> hopeless_peer: >>> *abort_now =3D 1; >>> /* XXX */ >>> - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or = equal than TSN %8.8x", >>> - cum_ack, send_s); >>> + if (snprintf(msg, sizeof(msg), >>> + "Cum ack %8.8x greater or equal than TSN %8.8x", >>> + cum_ack, send_s) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_28; >>> sctp_abort_an_association(stcb->sctp_ep, stcb, = op_err, SCTP_SO_NOT_LOCKED); >>> @@ -5629,9 +5672,11 @@ sctp_handle_forward_tsn(struct sctp_tcb = *stcb, >>> * give out). This must be an attacker. >>> */ >>> *abort_flag =3D 1; >>> - snprintf(msg, sizeof(msg), >>> + if (snprintf(msg, sizeof(msg), >>> "New cum ack %8.8x too high, highest TSN = %8.8x", >>> - new_cum_tsn, = asoc->highest_tsn_inside_map); >>> + new_cum_tsn, = asoc->highest_tsn_inside_map) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); >>> stcb->sctp_ep->last_abort_code =3D = SCTP_FROM_SCTP_INDATA + SCTP_LOC_36; >>> sctp_abort_an_association(stcb->sctp_ep, = stcb, op_err, SCTP_SO_NOT_LOCKED); >>>=20 >>> Modified: head/sys/netinet/sctp_input.c >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/sys/netinet/sctp_input.c Mon May 18 09:46:51 2020 = (r361208) >>> +++ head/sys/netinet/sctp_input.c Mon May 18 10:07:01 2020 = (r361209) >>> @@ -4692,7 +4692,9 @@ sctp_process_control(struct mbuf *m, int = iphlen, int * >>> } >>> } >>> if (stcb =3D=3D NULL) { >>> - snprintf(msg, sizeof(msg), "OOTB, %s:%d at = %s", __FILE__, __LINE__, __func__); >>> + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d = at %s", __FILE__, __LINE__, __func__) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> /* no association, so it's out of the blue... = */ >>> @@ -4734,7 +4736,9 @@ sctp_process_control(struct mbuf *m, int = iphlen, int * >>> if (stcb !=3D NULL) { >>> SCTP_TCB_UNLOCK(stcb); >>> } >>> - snprintf(msg, sizeof(msg), "OOTB, = %s:%d at %s", __FILE__, __LINE__, __func__); >>> + if (snprintf(msg, sizeof(msg), = "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> sctp_handle_ootb(m, iphlen, *offset, = src, dst, >>> @@ -5671,7 +5675,9 @@ sctp_common_input_processing(struct mbuf **mm, = int iph >>> SCTP_TCB_UNLOCK(stcb); >>> stcb =3D NULL; >>> SCTP_PROBE5(receive, NULL, stcb, m, stcb, = sh); >>> - snprintf(msg, sizeof(msg), "OOTB, %s:%d at = %s", __FILE__, __LINE__, __func__); >>> + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d = at %s", __FILE__, __LINE__, __func__) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> sctp_handle_ootb(m, iphlen, offset, src, dst, = sh, inp, op_err, >>> @@ -5733,7 +5739,9 @@ sctp_common_input_processing(struct mbuf **mm, = int iph >>> if (stcb =3D=3D NULL) { >>> /* out of the blue DATA chunk */ >>> SCTP_PROBE5(receive, NULL, NULL, m, NULL, = sh); >>> - snprintf(msg, sizeof(msg), "OOTB, %s:%d at = %s", __FILE__, __LINE__, __func__); >>> + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d = at %s", __FILE__, __LINE__, __func__) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> sctp_handle_ootb(m, iphlen, offset, src, dst, = sh, inp, op_err, >>> @@ -5799,7 +5807,9 @@ sctp_common_input_processing(struct mbuf **mm, = int iph >>> /* >>> * We consider OOTB any data sent during asoc = setup. >>> */ >>> - snprintf(msg, sizeof(msg), "OOTB, %s:%d at = %s", __FILE__, __LINE__, __func__); >>> + if (snprintf(msg, sizeof(msg), "OOTB, %s:%d = at %s", __FILE__, __LINE__, __func__) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> sctp_handle_ootb(m, iphlen, offset, src, dst, = sh, inp, op_err, >>>=20 >>> Modified: head/sys/netinet/sctp_output.c >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/sys/netinet/sctp_output.c Mon May 18 09:46:51 2020 = (r361208) >>> +++ head/sys/netinet/sctp_output.c Mon May 18 10:07:01 2020 = (r361209) >>> @@ -5581,7 +5581,9 @@ do_a_abort: >>> if (op_err =3D=3D NULL) { >>> char msg[SCTP_DIAG_INFO_LEN]; >>>=20 >>> - snprintf(msg, sizeof(msg), "%s:%d at %s", = __FILE__, __LINE__, __func__); >>> + if (snprintf(msg, sizeof(msg), "%s:%d at = %s", __FILE__, __LINE__, __func__) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> } >>> @@ -6758,8 +6760,10 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, = struct s >>> char = msg[SCTP_DIAG_INFO_LEN]; >>>=20 >>> abort_anyway: >>> - snprintf(msg, = sizeof(msg), >>> - "%s:%d at %s", = __FILE__, __LINE__, __func__); >>> + if (snprintf(msg, = sizeof(msg), >>> + "%s:%d at %s", = __FILE__, __LINE__, __func__) < 0) { >>> + msg[0] =3D = '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> = atomic_add_int(&stcb->asoc.refcnt, 1); >>> @@ -9626,8 +9630,10 @@ sctp_chunk_retransmission(struct sctp_inpcb = *inp, >>> struct mbuf *op_err; >>> char msg[SCTP_DIAG_INFO_LEN]; >>>=20 >>> - snprintf(msg, sizeof(msg), "TSN %8.8x = retransmitted %d times, giving up", >>> - chk->rec.data.tsn, chk->snd_count); >>> + if (snprintf(msg, sizeof(msg), "TSN %8.8x = retransmitted %d times, giving up", >>> + chk->rec.data.tsn, chk->snd_count) < 0) = { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> atomic_add_int(&stcb->asoc.refcnt, 1); >>> @@ -13610,8 +13616,10 @@ dataless_eof: >>> = atomic_add_int(&stcb->asoc.refcnt, -1); >>> free_cnt_applied =3D = 0; >>> } >>> - snprintf(msg, sizeof(msg), >>> - "%s:%d at %s", __FILE__, = __LINE__, __func__); >>> + if (snprintf(msg, = sizeof(msg), >>> + "%s:%d at %s", __FILE__, = __LINE__, __func__) < 0) { >>> + msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> NET_EPOCH_ENTER(et); >>>=20 >>> Modified: head/sys/netinet/sctp_pcb.c >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/sys/netinet/sctp_pcb.c Mon May 18 09:46:51 2020 = (r361208) >>> +++ head/sys/netinet/sctp_pcb.c Mon May 18 10:07:01 2020 = (r361209) >>> @@ -544,9 +544,13 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void = *ifn, uint3 >>> atomic_add_int(&vrf->refcount, 1); >>> sctp_ifnp->ifn_mtu =3D = SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, addr->sa_family); >>> if (if_name !=3D NULL) { >>> - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, = "%s", if_name); >>> + if (snprintf(sctp_ifnp->ifn_name, = SCTP_IFNAMSIZ, "%s", if_name) < 0) { >>> + sctp_ifnp->ifn_name[0] =3D '\0'; >>> + } >>> } else { >>> - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, = "%s", "unknown"); >>> + if (snprintf(sctp_ifnp->ifn_name, = SCTP_IFNAMSIZ, "%s", "unknown") < 0) { >>> + sctp_ifnp->ifn_name[0] =3D '\0'; >>> + } >>> } >>> hash_ifn_head =3D = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & = SCTP_BASE_INFO(vrf_ifn_hashmark))]; >>> LIST_INIT(&sctp_ifnp->ifalist); >>> @@ -6221,8 +6225,10 @@ sctp_load_addresses_from_init(struct sctp_tcb = *stcb, s >>> * in setup = state we >>> * abort this = guy >>> */ >>> - = snprintf(msg, sizeof(msg), >>> - "%s:%d = at %s", __FILE__, __LINE__, __func__); >>> + if = (snprintf(msg, sizeof(msg), >>> + "%s:%d = at %s", __FILE__, __LINE__, __func__) < 0) { >>> + = msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> = sctp_abort_an_association(stcb_tmp->sctp_ep, >>> @@ -6321,8 +6327,10 @@ sctp_load_addresses_from_init(struct sctp_tcb = *stcb, s >>> * in setup = state we >>> * abort this = guy >>> */ >>> - = snprintf(msg, sizeof(msg), >>> - "%s:%d = at %s", __FILE__, __LINE__, __func__); >>> + if = (snprintf(msg, sizeof(msg), >>> + "%s:%d = at %s", __FILE__, __LINE__, __func__) < 0) { >>> + = msg[0] =3D '\0'; >>> + } >>> op_err =3D = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), >>> msg); >>> = sctp_abort_an_association(stcb_tmp->sctp_ep, From owner-svn-src-all@freebsd.org Mon May 18 18:23: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 34EE32D9CD2; Mon, 18 May 2020 18:23:31 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (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 49QnSy6CBjz47wX; Mon, 18 May 2020 18:23:30 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi1-f176.google.com with SMTP id l6so4004908oic.9; Mon, 18 May 2020 11:23: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:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=XJAmKW9HwsEuori9FroHRrGEb9ZBoppojCR3qtAOXiQ=; b=eTeZNe7FgZEjZEJRPsJdOeyBdx3tTgGw8BummbgEavyPoFF1zzkbnba9084cpJc0l4 F/NAYMZ/QFeOkekHRT/iZznoC5nc4tWGQYZS2m9/ZsZTIwh0ZNM1hKk6M+OhJ06Zcb6y KvCLaCtEapa4Zi2zUn3kqMh1z5mGpHG+1sQxN7pTOFMHRTVRs09hU2qQNuBhArO0i/TG gEqQzF//ZQCxbGGqzG+WzQsabCS9TeFveNu4cfQp4rE1ikjkMhWB3nTEEWJ37HBbP/LT +SOhGoub6GFCvTEdAQn0C3MeKx7OfusQ0JoXsMx9WGfr3fv9F3VouaD/Ueig5owjzCUx JIQQ== X-Gm-Message-State: AOAM532jjaliexO01nr5gW/csWrYFqmMjWlk9t/3lyLZCZqwInA1xvR7 1vRE0EZeYo9OQpxHJnTwivkCPDOt X-Google-Smtp-Source: ABdhPJx/JrbRyL7DD+KDr7z7WJKDmRBmrz1PURThCl9CYzlmgk+QZpd7gvbGcfYY+7cL1qC+sv8sXw== X-Received: by 2002:aca:fd14:: with SMTP id b20mr512039oii.14.1589826209357; Mon, 18 May 2020 11:23:29 -0700 (PDT) Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com. [209.85.167.177]) by smtp.gmail.com with ESMTPSA id k69sm945706oib.26.2020.05.18.11.23.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 May 2020 11:23:29 -0700 (PDT) Received: by mail-oi1-f177.google.com with SMTP id 19so9884796oiy.8; Mon, 18 May 2020 11:23:28 -0700 (PDT) X-Received: by 2002:aca:a854:: with SMTP id r81mr489211oie.81.1589826208690; Mon, 18 May 2020 11:23:28 -0700 (PDT) MIME-Version: 1.0 References: <202005181007.04IA713t089936@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 18 May 2020 11:23:17 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361209 - head/sys/netinet To: Michael Tuexen Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 49QnSy6CBjz47wX 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: Mon, 18 May 2020 18:23:31 -0000 On Mon, May 18, 2020 at 10:35 AM Michael Tuexen wrote: > > > On 18. May 2020, at 17:38, Conrad Meyer wrote: > > > > These changes are a bit odd. The only reason a standards-compliant > > snprintf() would fail to nul-terminate a buffer is if the provided > > buffer had length zero. Since this is not the case in any of these > > uses, I wonder why this revision was made? Does a SCTP downstream > > when compiling the code in userland with gcc 10, it warns that > the output might be truncated. That is true and intended. > So checking that the call doesn't fail silences this warning and > ensures the code works in case snprintf() returns an error. I don't > see in the POSIX specification a statement limiting the case where > it could fail. > > > have a broken snprintf implementation, and if so, wouldn't it make > > more sense to create a standards-compliant portability shim for that > > platform instead of this more invasive change? > > If you want, I can revert the change and use the code only on non-FreeBSD > platforms. Hi Michael, If truncation is intended, the GCC warning is spurious. Given how often snprintf is used in this way, I wonder if it would make sense to just disable it across the entire tree. Regardless, IMO it makes sense to disable the warning, rather than make these changes to check for errors that can't happen. It does not even "fix" the thing GCC is warning about, since we aren't testing for truncation at all; it's just a warning defeat mechanism. -Wno- is a better warning-defeat mechanism. Re: documentation of snprintf nul-termination, I would look at this part of the FreeBSD manual page: The snprintf() and vsnprintf() functions will write at most size-1 of = the characters printed into the output string (the size'th character then gets the terminating =E2=80=98\0=E2=80=99); if the return value is gre= ater than or equal to the size argument, the string was too short and some of the printed characters were discarded. The output is always null-terminated, unle= ss size is 0. Note the last sentence especially. As far as error conditions, those are canonically documented in the ERRORS section of the manual page rather than RETURN VALUES. For whatever reason, mdoc(7) standard puts EXAMPLES between the two sections, and additionally snprintf.3 has a non-standard COMPATIBILITY section between the two, so they are not directly adjacent. Here's that section, though: ERRORS In addition to the errors documented for the write(2) system call, the printf() family of functions may fail if: [EILSEQ] An invalid wide character code was encountered. [ENOMEM] Insufficient storage space is available. [EOVERFLOW] The size argument exceeds INT_MAX + 1, or the retur= n value would be too large to be represented by an in= t. The section is unfortunately generalized and non-specific; snprintf probably cannot fail with ENOMEM, for example, nor write(2) errors. But EOVERFLOW is well-documented. Re: POSIX definition, POSIX is not the canonical definition of snprintf; the C standard is. C (2018) reads: > If n is zero, nothing shall be written and s may be a null pointer. Other= wise, output bytes beyond the n-1st shall be discarded instead of being wri= tten to the array, and a null byte is written at the end of the bytes actua= lly written into the array. Emphasis on the last clause. (POSIX uses the exact same language.) As far as conditions where snprintf may fail, POSIX only defines a single case (covered in snprintf.3 above): > The snprintf() function shall fail if: [EOVERFLOW], The value of n is gre= ater than INT_MAX. That is not the case in any of these invocations. Probably snprintf(9) should be specifically documented; printf(9) does not cover it yet. This is a documentation gap. Additionally, the COMPATIBILITY section of snprintf.3 should probably be moved to STANDARDS (to help move ERRORS and RETURN VALUES closer together). Finally, it might be nice to have kernel snprintf(9) _Static_assert that the provided length is shorter than INT_MAX (when it is a compiler constant, and detect non-constant cases at runtime). Currently, snprintf(9) fails to detect buffers that would produce a result which overflows. Best regards, Conrad From owner-svn-src-all@freebsd.org Mon May 18 18:27: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 2E78E2DA10A; Mon, 18 May 2020 18:27:11 +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 49QnYC0VNHz48MQ; Mon, 18 May 2020 18:27:11 +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 0C38125CB8; Mon, 18 May 2020 18:27:11 +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 04IIRAeP098713; Mon, 18 May 2020 18:27:10 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IIRAi6098712; Mon, 18 May 2020 18:27:10 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005181827.04IIRAi6098712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 May 2020 18:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361221 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361221 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, 18 May 2020 18:27:11 -0000 Author: tuexen Date: Mon May 18 18:27:10 2020 New Revision: 361221 URL: https://svnweb.freebsd.org/changeset/base/361221 Log: Remove redundant check. MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Mon May 18 16:47:44 2020 (r361220) +++ head/sys/netinet/sctp_asconf.c Mon May 18 18:27:10 2020 (r361221) @@ -3026,10 +3026,6 @@ sctp_check_address_list_ep(struct sctp_tcb *stcb, stru "check_addr_list_ep: laddr->ifa is NULL"); continue; } - if (laddr->ifa == NULL) { - SCTPDBG(SCTP_DEBUG_ASCONF1, "check_addr_list_ep: laddr->ifa->ifa_addr is NULL"); - continue; - } /* do i have it implicitly? */ if (sctp_cmpaddr(&laddr->ifa->address.sa, init_addr)) { continue; From owner-svn-src-all@freebsd.org Mon May 18 18:32: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 A95A32DA4A7; Mon, 18 May 2020 18:32:59 +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 49Qngv31T6z48v2; Mon, 18 May 2020 18:32:59 +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 62C8925CD8; Mon, 18 May 2020 18:32:59 +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 04IIWxQC004696; Mon, 18 May 2020 18:32:59 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IIWxcD004695; Mon, 18 May 2020 18:32:59 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005181832.04IIWxcD004695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 May 2020 18:32:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361222 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361222 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, 18 May 2020 18:32:59 -0000 Author: tuexen Date: Mon May 18 18:32:58 2020 New Revision: 361222 URL: https://svnweb.freebsd.org/changeset/base/361222 Log: Avoid an integer underflow. MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Mon May 18 18:27:10 2020 (r361221) +++ head/sys/netinet/sctp_asconf.c Mon May 18 18:32:58 2020 (r361222) @@ -1797,9 +1797,9 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset, } /* switch */ /* update remaining ASCONF-ACK message length to process */ - ack_length -= SCTP_SIZE32(param_length); - if (ack_length <= 0) { - /* no more data in the mbuf chain */ + if (ack_length > SCTP_SIZE32(param_length)) { + ack_length -= SCTP_SIZE32(param_length); + } else { break; } offset += SCTP_SIZE32(param_length); From owner-svn-src-all@freebsd.org Mon May 18 18:36: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 8DAB92DA5BF; Mon, 18 May 2020 18:36:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Qnm13GFbz49Yk; Mon, 18 May 2020 18:36:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B33325F6F; Mon, 18 May 2020 18:36:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IIaXJU005072; Mon, 18 May 2020 18:36:33 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IIaWCJ005070; Mon, 18 May 2020 18:36:32 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005181836.04IIaWCJ005070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 18 May 2020 18:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361223 - head/tests/sys/fs/fusefs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/fs/fusefs X-SVN-Commit-Revision: 361223 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, 18 May 2020 18:36:33 -0000 Author: asomers Date: Mon May 18 18:36:32 2020 New Revision: 361223 URL: https://svnweb.freebsd.org/changeset/base/361223 Log: fusefs: fix intermittency in some ENOENT tests When a FUSE operation other than LOOKUP returns ENOENT, the kernel will reclaim that vnode, resuling in a FUSE_FORGET being sent a short while later. Many of the ENOENT tests weren't expecting those FUSE_FORGET operations. They usually passed by luck since FUSE_FORGET is often delayed. This commit adds appropriate expectations. MFC after: 2 weeks Modified: head/tests/sys/fs/fusefs/getattr.cc head/tests/sys/fs/fusefs/open.cc head/tests/sys/fs/fusefs/opendir.cc Modified: head/tests/sys/fs/fusefs/getattr.cc ============================================================================== --- head/tests/sys/fs/fusefs/getattr.cc Mon May 18 18:32:58 2020 (r361222) +++ head/tests/sys/fs/fusefs/getattr.cc Mon May 18 18:36:32 2020 (r361223) @@ -32,6 +32,8 @@ extern "C" { #include + +#include } #include "mockfs.hh" @@ -172,7 +174,10 @@ TEST_F(Getattr, enoent) const char RELPATH[] = "some_file.txt"; struct stat sb; const uint64_t ino = 42; + sem_t sem; + ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); + expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 1, 0, 0); EXPECT_CALL(*m_mock, process( ResultOf([](auto in) { @@ -181,8 +186,15 @@ TEST_F(Getattr, enoent) }, Eq(true)), _) ).WillOnce(Invoke(ReturnErrno(ENOENT))); + // Since FUSE_GETATTR returns ENOENT, the kernel will reclaim the vnode + // and send a FUSE_FORGET + expect_forget(ino, 1, &sem); + EXPECT_NE(0, stat(FULLPATH, &sb)); EXPECT_EQ(ENOENT, errno); + + sem_wait(&sem); + sem_destroy(&sem); } TEST_F(Getattr, ok) Modified: head/tests/sys/fs/fusefs/open.cc ============================================================================== --- head/tests/sys/fs/fusefs/open.cc Mon May 18 18:32:58 2020 (r361222) +++ head/tests/sys/fs/fusefs/open.cc Mon May 18 18:36:32 2020 (r361223) @@ -32,7 +32,9 @@ extern "C" { #include + #include +#include } #include "mockfs.hh" @@ -105,7 +107,10 @@ TEST_F(Open, enoent) const char FULLPATH[] = "mountpoint/some_file.txt"; const char RELPATH[] = "some_file.txt"; uint64_t ino = 42; + sem_t sem; + ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); + expect_lookup(RELPATH, ino, S_IFREG | 0644, 0, 1); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { @@ -114,8 +119,15 @@ TEST_F(Open, enoent) }, Eq(true)), _) ).WillOnce(Invoke(ReturnErrno(ENOENT))); + // Since FUSE_OPEN returns ENOENT, the kernel will reclaim the vnode + // and send a FUSE_FORGET + expect_forget(ino, 1, &sem); + ASSERT_EQ(-1, open(FULLPATH, O_RDONLY)); EXPECT_EQ(ENOENT, errno); + + sem_wait(&sem); + sem_destroy(&sem); } /* Modified: head/tests/sys/fs/fusefs/opendir.cc ============================================================================== --- head/tests/sys/fs/fusefs/opendir.cc Mon May 18 18:32:58 2020 (r361222) +++ head/tests/sys/fs/fusefs/opendir.cc Mon May 18 18:36:32 2020 (r361223) @@ -32,7 +32,9 @@ extern "C" { #include + #include +#include } #include "mockfs.hh" @@ -82,12 +84,21 @@ TEST_F(Opendir, enoent) const char FULLPATH[] = "mountpoint/some_dir"; const char RELPATH[] = "some_dir"; uint64_t ino = 42; + sem_t sem; + ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); + expect_lookup(RELPATH, ino); expect_opendir(ino, O_RDONLY, ReturnErrno(ENOENT)); + // Since FUSE_OPENDIR returns ENOENT, the kernel will reclaim the vnode + // and send a FUSE_FORGET + expect_forget(ino, 1, &sem); ASSERT_EQ(-1, open(FULLPATH, O_DIRECTORY)); EXPECT_EQ(ENOENT, errno); + + sem_wait(&sem); + sem_destroy(&sem); } /* From owner-svn-src-all@freebsd.org Mon May 18 18:42: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 CB1572DA9A1; Mon, 18 May 2020 18:42:43 +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 49Qnv7572sz49wP; Mon, 18 May 2020 18:42:43 +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 AB43725F8C; Mon, 18 May 2020 18:42:43 +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 04IIghVY011030; Mon, 18 May 2020 18:42:43 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IIghge011029; Mon, 18 May 2020 18:42:43 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005181842.04IIghge011029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 May 2020 18:42:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361224 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361224 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, 18 May 2020 18:42:43 -0000 Author: tuexen Date: Mon May 18 18:42:43 2020 New Revision: 361224 URL: https://svnweb.freebsd.org/changeset/base/361224 Log: Cleanup, no functional change intended. MFC after: 3 days Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon May 18 18:36:32 2020 (r361223) +++ head/sys/netinet/sctp_pcb.c Mon May 18 18:42:43 2020 (r361224) @@ -5203,16 +5203,12 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc SCTP_FREE_SHOULD_USE_GRACEFUL_CLOSE, SCTP_CALLED_DIRECTLY_NOCMPSET); SCTP_INP_DECR_REF(inp); - goto out_of; } else { /* The socket is still open. */ SCTP_INP_DECR_REF(inp); + SCTP_INP_RUNLOCK(inp); } } - if (from_inpcbfree == SCTP_NORMAL_PROC) { - SCTP_INP_RUNLOCK(inp); - } -out_of: /* destroyed the asoc */ #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 11); From owner-svn-src-all@freebsd.org Mon May 18 19:05: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 3DAE72DAD48; Mon, 18 May 2020 19:05:43 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QpPf660Zz4CJq; Mon, 18 May 2020 19:05:42 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from mbp.fritz.box (ip4d1600c4.dynamic.kabel-deutschland.de [77.22.0.196]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id ED7477220F406; Mon, 18 May 2020 21:05:38 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r361209 - head/sys/netinet From: Michael Tuexen In-Reply-To: Date: Mon, 18 May 2020 21:05:38 +0200 Cc: src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: <064C2DCD-6279-4442-A900-0ECCD50CC4FA@freebsd.org> References: <202005181007.04IA713t089936@repo.freebsd.org> To: cem@freebsd.org X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 49QpPf660Zz4CJq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:680, ipnet:193.174.0.0/15, country:DE]; 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: Mon, 18 May 2020 19:05:43 -0000 > On 18. May 2020, at 20:23, Conrad Meyer wrote: >=20 > On Mon, May 18, 2020 at 10:35 AM Michael Tuexen = wrote: >>=20 >>> On 18. May 2020, at 17:38, Conrad Meyer wrote: >>>=20 >>> These changes are a bit odd. The only reason a standards-compliant >>> snprintf() would fail to nul-terminate a buffer is if the provided >>> buffer had length zero. Since this is not the case in any of these >>> uses, I wonder why this revision was made? Does a SCTP downstream >>=20 >> when compiling the code in userland with gcc 10, it warns that >> the output might be truncated. That is true and intended. >> So checking that the call doesn't fail silences this warning and >> ensures the code works in case snprintf() returns an error. I don't >> see in the POSIX specification a statement limiting the case where >> it could fail. >>=20 >>> have a broken snprintf implementation, and if so, wouldn't it make >>> more sense to create a standards-compliant portability shim for that >>> platform instead of this more invasive change? >>=20 >> If you want, I can revert the change and use the code only on = non-FreeBSD >> platforms. >=20 > Hi Michael, >=20 > If truncation is intended, the GCC warning is spurious. Given how > often snprintf is used in this way, I wonder if it would make sense to > just disable it across the entire tree. Regardless, IMO it makes The issue wasn't reported against the kernel code, but running the code in userland. I don't really control the flags people are using. > sense to disable the warning, rather than make these changes to check > for errors that can't happen. It does not even "fix" the thing GCC is OK. I'll revert this change and replace it upstream by something like #if defined(__FreeBSD_) snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", = serial_num) #else if (snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", = serial_num) < 0) { msg[0] =3D '\0'; } #endif I don't know if other platforms guarantee that snprintf() can't fail. If it fails, the stack would send out un-initialized stack memory on the network. > warning about, since we aren't testing for truncation at all; it's > just a warning defeat mechanism. -Wno- is a better warning-defeat > mechanism. >=20 > Re: documentation of snprintf nul-termination, I would look at this > part of the FreeBSD manual page: >=20 > The snprintf() and vsnprintf() functions will write at most size-1 = of the > characters printed into the output string (the size'th character = then > gets the terminating =E2=80=98\0=E2=80=99); if the return value is = greater than or equal > to the size argument, the string was too short and some of the = printed > characters were discarded. The output is always null-terminated, = unless > size is 0. >=20 > Note the last sentence especially. As far as error conditions, those > are canonically documented in the ERRORS section of the manual page > rather than RETURN VALUES. For whatever reason, mdoc(7) standard puts > EXAMPLES between the two sections, and additionally snprintf.3 has a > non-standard COMPATIBILITY section between the two, so they are not > directly adjacent. Here's that section, though: >=20 > ERRORS > In addition to the errors documented for the write(2) system call, = the > printf() family of functions may fail if: >=20 > [EILSEQ] An invalid wide character code was encountered. >=20 > [ENOMEM] Insufficient storage space is available. >=20 > [EOVERFLOW] The size argument exceeds INT_MAX + 1, or the = return > value would be too large to be represented by = an int. >=20 > The section is unfortunately generalized and non-specific; snprintf > probably cannot fail with ENOMEM, for example, nor write(2) errors. > But EOVERFLOW is well-documented. >=20 > Re: POSIX definition, POSIX is not the canonical definition of > snprintf; the C standard is. C (2018) reads: >=20 >> If n is zero, nothing shall be written and s may be a null pointer. = Otherwise, output bytes beyond the n-1st shall be discarded instead of = being written to the array, and a null byte is written at the end of the = bytes actually written into the array. >=20 > Emphasis on the last clause. (POSIX uses the exact same language.) > As far as conditions where snprintf may fail, POSIX only defines a > single case (covered in snprintf.3 above): >=20 >> The snprintf() function shall fail if: [EOVERFLOW], The value of n is = greater than INT_MAX. >=20 > That is not the case in any of these invocations. Just to be clear: My problem is NOT that the output is not zero = terminated. I use snprintf() in a way that it is, if it does not fail. I was just adding protection code for the case it fails and leaves the buffer uninitialized. since I don't want so sent out uninitialized stack = memory. I learnt that on FreeBSD this is not a problem and I'll remove that = protection code for this platform. Best regards Michael >=20 > Probably snprintf(9) should be specifically documented; printf(9) does > not cover it yet. This is a documentation gap. Additionally, the > COMPATIBILITY section of snprintf.3 should probably be moved to > STANDARDS (to help move ERRORS and RETURN VALUES closer together). > Finally, it might be nice to have kernel snprintf(9) _Static_assert > that the provided length is shorter than INT_MAX (when it is a > compiler constant, and detect non-constant cases at runtime). > Currently, snprintf(9) fails to detect buffers that would produce a > result which overflows. >=20 > Best regards, > Conrad From owner-svn-src-all@freebsd.org Mon May 18 19:23: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 901572DB344; Mon, 18 May 2020 19:23:02 +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 49Qpnf2sxdz4D8X; Mon, 18 May 2020 19:23:02 +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 5DD8226880; Mon, 18 May 2020 19:23:02 +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 04IJN2OU036352; Mon, 18 May 2020 19:23:02 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IJN2uK036351; Mon, 18 May 2020 19:23:02 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005181923.04IJN2uK036351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 May 2020 19:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361225 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361225 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, 18 May 2020 19:23:02 -0000 Author: tuexen Date: Mon May 18 19:23:01 2020 New Revision: 361225 URL: https://svnweb.freebsd.org/changeset/base/361225 Log: Remove redundant assignment. MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon May 18 18:42:43 2020 (r361224) +++ head/sys/netinet/sctputil.c Mon May 18 19:23:01 2020 (r361225) @@ -1144,7 +1144,6 @@ sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb asoc->sctp_cmt_on_off = inp->sctp_cmt_on_off; asoc->ecn_supported = inp->ecn_supported; asoc->prsctp_supported = inp->prsctp_supported; - asoc->idata_supported = inp->idata_supported; asoc->auth_supported = inp->auth_supported; asoc->asconf_supported = inp->asconf_supported; asoc->reconfig_supported = inp->reconfig_supported; From owner-svn-src-all@freebsd.org Mon May 18 19: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 E19192DBB9A; Mon, 18 May 2020 19:35:46 +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 49Qq4L5kpdz4F1s; Mon, 18 May 2020 19:35:46 +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 C004326667; Mon, 18 May 2020 19:35:46 +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 04IJZkcb042934; Mon, 18 May 2020 19:35:46 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IJZkWm042932; Mon, 18 May 2020 19:35:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005181935.04IJZkWm042932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 May 2020 19:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361226 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361226 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, 18 May 2020 19:35:46 -0000 Author: tuexen Date: Mon May 18 19:35:46 2020 New Revision: 361226 URL: https://svnweb.freebsd.org/changeset/base/361226 Log: Don't check an unsigned variable for being negative. MFC after: 3 days. Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Mon May 18 19:23:01 2020 (r361225) +++ head/sys/netinet/sctp_usrreq.c Mon May 18 19:35:46 2020 (r361226) @@ -1042,7 +1042,7 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, struct sctp_vrf *vrf; actual = 0; - if (limit <= 0) + if (limit == 0) return (actual); if (stcb) { From owner-svn-src-all@freebsd.org Mon May 18 19:48: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 1838F2DBF94; Mon, 18 May 2020 19:48:39 +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 49QqMB70mwz4FRb; Mon, 18 May 2020 19:48:38 +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 E81BD26D2B; Mon, 18 May 2020 19:48:38 +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 04IJmclp049128; Mon, 18 May 2020 19:48:38 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IJmcpb049127; Mon, 18 May 2020 19:48:38 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005181948.04IJmcpb049127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 May 2020 19:48:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361227 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361227 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, 18 May 2020 19:48:39 -0000 Author: tuexen Date: Mon May 18 19:48:38 2020 New Revision: 361227 URL: https://svnweb.freebsd.org/changeset/base/361227 Log: Remove assignment without effect. MFC after: 3 days Modified: head/sys/netinet/sctp_auth.c Modified: head/sys/netinet/sctp_auth.c ============================================================================== --- head/sys/netinet/sctp_auth.c Mon May 18 19:35:46 2020 (r361226) +++ head/sys/netinet/sctp_auth.c Mon May 18 19:48:38 2020 (r361227) @@ -658,7 +658,6 @@ sctp_free_hmaclist(sctp_hmaclist_t *list) { if (list != NULL) { SCTP_FREE(list, SCTP_M_AUTH_HL); - list = NULL; } } From owner-svn-src-all@freebsd.org Mon May 18 20:17: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 834302DC27C; Mon, 18 May 2020 20:17:44 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi1-f195.google.com (mail-oi1-f195.google.com [209.85.167.195]) (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 49Qr0m2sVfz4Hs8; Mon, 18 May 2020 20:17:44 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi1-f195.google.com with SMTP id y85so5436422oie.11; Mon, 18 May 2020 13:17:44 -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:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=Ms4jPGP6m/mR1GU56bT9w5r+eAlcTC552LBh1ggWsOk=; b=ig2/7FoeXSDCijkbHrOFLjmETDnTwM3K75BsZFRahAAOHdS+ZB4OOOdpvbZNz6XT+o BycTi8k6WLm6MWWJtG1VELZB88PxWFuOWZ0pxhKiqksgjAXW0wOxKdvCohDjd8bVCmxX SvFauCWSf4tybEfmjUy3PQSI1VCEtcoh08PbwbSIdehfAJgP6rE3i7bBVBrzr7IA2roi TfUen+CY/lleWzJCfBfDgN82QwZZLm5rLNDD4dcqrRAhnroxMA53oTAjzbpyPsqo7+M8 M1bQ6Pe3zRD72PYAjm2HPo3LGPFs/GieoQ0P8JZ50kmwPYfmMnJnn9QKxlWahANGcnCt uCjw== X-Gm-Message-State: AOAM531gWJYrBX6vgqn6r5KMgBFgOk2nyeHyIX14lxI12bEI80OS0QrB E66Vd1ktIbnt8SrDtri80KV40j97 X-Google-Smtp-Source: ABdhPJz0yE74wa0vS9ghTLPsnV//NkKZE8iOcsEU/cQmgtzw+sqmU0oQsoSa6A7ZbDqGcjJ+Sph1MA== X-Received: by 2002:a05:6808:282:: with SMTP id z2mr745841oic.101.1589833062983; Mon, 18 May 2020 13:17:42 -0700 (PDT) Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com. [209.85.210.45]) by smtp.gmail.com with ESMTPSA id l196sm3361018oih.25.2020.05.18.13.17.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 May 2020 13:17:42 -0700 (PDT) Received: by mail-ot1-f45.google.com with SMTP id f18so5165457otq.11; Mon, 18 May 2020 13:17:42 -0700 (PDT) X-Received: by 2002:a9d:70ca:: with SMTP id w10mr4086878otj.216.1589833061839; Mon, 18 May 2020 13:17:41 -0700 (PDT) MIME-Version: 1.0 References: <202005181007.04IA713t089936@repo.freebsd.org> <064C2DCD-6279-4442-A900-0ECCD50CC4FA@freebsd.org> In-Reply-To: <064C2DCD-6279-4442-A900-0ECCD50CC4FA@freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 18 May 2020 13:17:30 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361209 - head/sys/netinet To: Michael Tuexen Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 49Qr0m2sVfz4Hs8 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: Mon, 18 May 2020 20:17:44 -0000 Hi Michael, On Mon, May 18, 2020 at 12:05 PM Michael Tuexen wrote: > > > On 18. May 2020, at 20:23, Conrad Meyer wrote: > > > If truncation is intended, the GCC warning is spurious. Given how > > often snprintf is used in this way, I wonder if it would make sense to > > just disable it across the entire tree. Regardless, IMO it makes > > The issue wasn't reported against the kernel code, but running the code > in userland. I don't really control the flags people are using. Sure. You can certainly ignore user reports corresponding to bogus flags, though, and encourage use of various flags. > OK. I'll revert this change and replace it upstream by something like > > #if defined(__FreeBSD_) > snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", seri= al_num) > #else > if (snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", = serial_num) < 0) { > msg[0] =3D '\0'; > } > #endif This seems like a messy solution. I'd suggest either putting unconditional "msg[0] =3D '\0';" before snprintf() invocations, or defining an snprintf wrapper function for non-FreeBSD platforms and using it universally. > I don't know if other platforms guarantee that snprintf() can't fail. > If it fails, the stack would send out un-initialized stack memory on > the network. Sure, that's a good concern. That said, Glibc: https://github.com/bminor/glibc/blob/5f72f9800b250410cad3abfeeb09469= ef12b2438/libio/vsnprintf.c#L93-L114 (always nul terminates) MS: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/snprin= tf-snprintf-snprintf-l-snwprintf-snwprintf-l?view=3Dvs-2019 ("The snprintf function always stores a terminating null character=E2=80=A6= ") OpenBSD: https://github.com/openbsd/src/blob/master/lib/libc/stdio/vsnprint= f.c#L60-L63 (always nul terminates) NetBSD: https://github.com/NetBSD/src/blob/trunk/lib/libc/stdio/vsnprintf.c= #L97-L101 (always nul terminates) Linux (kernel): https://elixir.bootlin.com/linux/latest/source/lib/vsprintf.c#L2645 (always nul terminates) None of these are conditional on error status. The only exception I found is musl libc, and in that it is a case you cannot encounter here (size > INT_MAX). Arguably this is a bug in musl libc. I did not dive deeper into musl and determine whether other errors were nul terminated or not. Conrad P.S., It seems dubious to be sending diagnostic formatted error messages out across the network. From owner-svn-src-all@freebsd.org Mon May 18 20:43: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 2BEF62DD330; Mon, 18 May 2020 20:43:36 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QrZb2l5tz4Kfg; Mon, 18 May 2020 20:43:35 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from mbp.fritz.box (ip4d1600c4.dynamic.kabel-deutschland.de [77.22.0.196]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id A373B7220F40F; Mon, 18 May 2020 22:43:27 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r361209 - head/sys/netinet From: Michael Tuexen In-Reply-To: Date: Mon, 18 May 2020 22:43:27 +0200 Cc: src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: References: <202005181007.04IA713t089936@repo.freebsd.org> <064C2DCD-6279-4442-A900-0ECCD50CC4FA@freebsd.org> To: cem@freebsd.org X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 49QrZb2l5tz4Kfg 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:680, ipnet:2001:638::/32, 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: Mon, 18 May 2020 20:43:36 -0000 > On 18. May 2020, at 22:17, Conrad Meyer wrote: >=20 > Hi Michael, >=20 > On Mon, May 18, 2020 at 12:05 PM Michael Tuexen = wrote: >>=20 >>> On 18. May 2020, at 20:23, Conrad Meyer wrote: >>=20 >>> If truncation is intended, the GCC warning is spurious. Given how >>> often snprintf is used in this way, I wonder if it would make sense = to >>> just disable it across the entire tree. Regardless, IMO it makes >>=20 >> The issue wasn't reported against the kernel code, but running the = code >> in userland. I don't really control the flags people are using. >=20 > Sure. You can certainly ignore user reports corresponding to bogus > flags, though, and encourage use of various flags. I could, but decided to improve the situation for some people, but wasn't realising that I made it worse for others. Sorry about that. >=20 >> OK. I'll revert this change and replace it upstream by something like >>=20 >> #if defined(__FreeBSD_) >> snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", = serial_num) >> #else >> if (snprintf(msg, sizeof(msg), "Never sent serial number = %8.8x", serial_num) < 0) { >> msg[0] =3D '\0'; >> } >> #endif >=20 > This seems like a messy solution. I'd suggest either putting > unconditional "msg[0] =3D '\0';" before snprintf() invocations, or That would assume that in case of an error the first byte is overwitten. > defining an snprintf wrapper function for non-FreeBSD platforms and > using it universally. Yeah, one can use a Macro SCTP_SNPRINTF(). Let me see... >=20 >> I don't know if other platforms guarantee that snprintf() can't fail. >> If it fails, the stack would send out un-initialized stack memory on >> the network. >=20 > Sure, that's a good concern. That said, >=20 > Glibc: = https://github.com/bminor/glibc/blob/5f72f9800b250410cad3abfeeb09469ef12b2= 438/libio/vsnprintf.c#L93-L114 > (always nul terminates) > MS: = https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/snprintf-= snprintf-snprintf-l-snwprintf-snwprintf-l?view=3Dvs-2019 > ("The snprintf function always stores a terminating null = character=E2=80=A6") > OpenBSD: = https://github.com/openbsd/src/blob/master/lib/libc/stdio/vsnprintf.c#L60-= L63 > (always nul terminates) > NetBSD: = https://github.com/NetBSD/src/blob/trunk/lib/libc/stdio/vsnprintf.c#L97-L1= 01 > (always nul terminates) > Linux (kernel): > https://elixir.bootlin.com/linux/latest/source/lib/vsprintf.c#L2645 > (always nul terminates) >=20 > None of these are conditional on error status. >=20 > The only exception I found is musl libc, and in that it is a case you > cannot encounter here (size > INT_MAX). Arguably this is a bug in > musl libc. I did not dive deeper into musl and determine whether > other errors were nul terminated or not. >=20 > Conrad >=20 > P.S., It seems dubious to be sending diagnostic formatted error > messages out across the network. It was and still is very helpful when debuging interop problems if you = only have access to a tracefile and can't change the running code. Like people asking you = why is your implementation sending back an ABORT when it sees this packet. Best regards Michael= From owner-svn-src-all@freebsd.org Mon May 18 20:48: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 EF7882DCDD0 for ; Mon, 18 May 2020 20:48:18 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from 44-233-67-66-mail.ore.mailhop.org (44-233-67-66-mail.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 49Qrh23Yt5z4LDl for ; Mon, 18 May 2020 20:48:18 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1589834891; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Dcyv6QRdKP1lhYHxuZ9ebei0B+2eZNgBvsQP+w7S1lD/Ur5a6F51zybC0fTREcLqrtFjz+P1YA/z6 CbcwTuB2uKPyPfAb5uqCcpmQQU4in/VgtN/l82v17G9SzgScaIm49KI595q2q1p76wGYdF8E8D96Ab WwUayx3wI7mys0ABj1MOjrNRaTQT4lTQcpapOZoAz8hp4+T94tPm/IBUuQ9hwBTLlHaa7Owmh96nrH fV51zmJ2vHwiGB3pXb4zatmVlRlCSyWQ4BDg1kC/X53ldLT1AgsxlNZHPx+BKbnPrFPt2ybmpLp4PS zlgoN0lBNVTfcDlaSrv1Da2Lo+XmWsA== 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=JJeT2QWE78kcllOuHXm5k4PCPYPZc5qZfhiUEkKlYB0=; b=S+ajCtmts8upMBxXSunNiO+I56EirmX5y4kU8HEvfDET6llBI3VZ50+taVb30RS7GDoIpmEmlxBWn tXdnMbhTMvOOw2yD0ENc2kfY5NiXHsH4sOIHSe2dRL+F5EQNJaDaIHY3+OaVYygFIlqVY0dhBrHDNu 4uyp3KuSxH+4r7QWCTW3R+Ibe7LdEv1+j2rLejF4iFON/vhEqBeirFqN5JEoSsWVmiFwxX2tcEC0u/ zPTBamkbfALlYBAxPyKpxxti5YkxVtg9cYxjC+CuhPZWFgnSYDUdkhgJRmdUpCMLhPhtdZBO6BL2DN GRyAq9Jnb1LjdIm3uq2MfseEuMyoUkQ== 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=JJeT2QWE78kcllOuHXm5k4PCPYPZc5qZfhiUEkKlYB0=; b=hmKuZSF7Y/WF5sXoqG2icxEMcUsC6iIuMMCSzo51qsegcNwCQxesPrOAQTlVU2s9yhh8P6hYnOdi6 W8ja/5o0ue7Wqw3CrWiFEiB/H1JMiRravFIWRWC9c95exUMYSb44KpN2WpOFE8KtVfA4HR3ATtRGnN Yq0i0raHO9JpG4Zie/8e8ykJvfFnTafJ0T1Bi2i+/w+QeBagD63HqxzUQZYLrQN/32efrEElgNNsMi hxb4IdAJVhVMBMKLPbDlim9t2UyFLBG1DAk32Lf93ax0S7pKWB0ny1eyynF9M3iW19KVZBFh163FA5 OpelbLPXnG+UTyBAkzmA8k0k3F0n1Hg== X-MHO-RoutePath: aGlwcGll X-MHO-User: e1d5a179-9948-11ea-b10c-b5956a7dd1a1 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 e1d5a179-9948-11ea-b10c-b5956a7dd1a1; Mon, 18 May 2020 20:48:10 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 04IKm9KK003227; Mon, 18 May 2020 14:48:09 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <124078163fc75e82a0acaff85f57859d012c6d98.camel@freebsd.org> Subject: Re: svn commit: r361209 - head/sys/netinet From: Ian Lepore To: Michael Tuexen , cem@freebsd.org Cc: src-committers , svn-src-all , svn-src-head Date: Mon, 18 May 2020 14:48:09 -0600 In-Reply-To: References: <202005181007.04IA713t089936@repo.freebsd.org> <064C2DCD-6279-4442-A900-0ECCD50CC4FA@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: 49Qrh23Yt5z4LDl 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:16509, ipnet:44.224.0.0/11, 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, 18 May 2020 20:48:19 -0000 On Mon, 2020-05-18 at 22:43 +0200, Michael Tuexen wrote: > > Sure. You can certainly ignore user reports corresponding to bogus > > flags, though, and encourage use of various flags. > > I could, but decided to improve the situation for some people, but > wasn't realising that I made it worse for others. Sorry about that. I'm trying to figure out why your original commit was a problem. I understand why it was questioned, but once the answer came out, it's clear that the code you originally committed does what it's supposed to without any harmful side effects. Sure, freebsd doesn't strictly need it, but the code is shared among projects, so what's the harm in the extra check that helps other projects sharing the code? It's certainly a lot less confusion and code clutter than any of the "remedies" that have been discussed. -- Ian From owner-svn-src-all@freebsd.org Mon May 18 21:01: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 2214D2DD3F0; Mon, 18 May 2020 21:01:17 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Qrz05WYBz4MPy; Mon, 18 May 2020 21:01:16 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from mbp.fritz.box (ip4d1600c4.dynamic.kabel-deutschland.de [77.22.0.196]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id E0E137220F411; Mon, 18 May 2020 23:01:13 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r361209 - head/sys/netinet From: Michael Tuexen In-Reply-To: <124078163fc75e82a0acaff85f57859d012c6d98.camel@freebsd.org> Date: Mon, 18 May 2020 23:01:13 +0200 Cc: cem@freebsd.org, src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: <58B8E5E9-8DA1-4453-B1A3-A90D97D5FD43@freebsd.org> References: <202005181007.04IA713t089936@repo.freebsd.org> <064C2DCD-6279-4442-A900-0ECCD50CC4FA@freebsd.org> <124078163fc75e82a0acaff85f57859d012c6d98.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 49Qrz05WYBz4MPy 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:680, ipnet:193.174.0.0/15, 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: Mon, 18 May 2020 21:01:17 -0000 > On 18. May 2020, at 22:48, Ian Lepore wrote: >=20 > On Mon, 2020-05-18 at 22:43 +0200, Michael Tuexen wrote: >>> Sure. You can certainly ignore user reports corresponding to bogus >>> flags, though, and encourage use of various flags. >>=20 >> I could, but decided to improve the situation for some people, but >> wasn't realising that I made it worse for others. Sorry about that. >=20 > I'm trying to figure out why your original commit was a problem. I > understand why it was questioned, but once the answer came out, it's > clear that the code you originally committed does what it's supposed = to > without any harmful side effects. Sure, freebsd doesn't strictly need I guess the point Conrad is making, that on FreeBSD the check is not needed, since the call can not fail. So the FreeBSD code base would not be consistent: within the SCTP related code the return code is checked, in the other code it is not. > it, but the code is shared among projects, so what's the harm in the > extra check that helps other projects sharing the code? It's = certainly > a lot less confusion and code clutter than any of the "remedies" that > have been discussed. Yepp, sharing code between platforms makes things harder. Running the = same code in kernel land and userland does not make it simpler. Different = groups have different opinions/styles/... I'll revert the commit tomorrow and a variadic macros SCTP_SNPRINTF(), = which will map on FreeBSD to snprintf() and on the other platforms will do the = check. If the build problem comes up on FreeBSD userland (and I have no idea if = that is the case, since I don't know how Firefox / Chrome are build on = FreeBSD), I leave it up to the port maintainer of the application to deal with it. Best regards Michael >=20 > -- Ian >=20 From owner-svn-src-all@freebsd.org Mon May 18 21:09: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 959C42DD77E for ; Mon, 18 May 2020 21:09:18 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from 44-233-67-66-mail.ore.mailhop.org (44-233-67-66-mail.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 49Qs8G22sVz4NM8 for ; Mon, 18 May 2020 21:09:18 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1589836156; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=YfMhvxzSmLoaBBTG7lGKLC8auS36e7oZMavVtjGYz/KPzGorgEbQ1GCuzxUWTExUP72JPekSIsgUl kwj0rcW5R67HdJLn2hbcQh3gf9Asddo8pNyr859SlSMmXzpfvq9bFbkRirTdnupNn5fPkbS5q/sh5N eMWa+Byp5DxClvPv0Ig2lzOwOeguM7y8vM6WJ9HnYiF6RDr8jVaW/Zb4XP0tV+dTBkB3arbr2Iy7x2 karZu6RIHvK+H+lkWeRW/jlx1eKjLJDXQsDcTy5ESEz2rHfcKQu+x7XDZEIj3SM6McYEGzivbzErck s8q2ZSw9H4h7VwG203s7abXcVle4IjQ== 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=PNkeR7XS2C3IMBmZhFi0Uespe0wlYubfB/YpxfBNC34=; b=qCRkEtdi6xv6YUSBrug0QC4k99W4sUEWEL+ka0y9SuxB/+j9o4F7/VL8HfsOxKniJ3aGSfmMXmUQu kZNh6UgCqj+zNkP04+HpDsOcH6rBOjIwIf9Ce3BTxWtTOqGYn4yT5mLmFQMNiCZo8WVqih3WZzyi1Q RwVsrWtJgvM/f/xkHvfz5xCON5pTFzALmHNMCglyBaoDrX+QqfF1Jql1CF8wHOCRpdKHCYWjAjgDux T7Mq3CCpkIUJOym5sP3IgKfRzoFNmuUlHREoCXt6IgZk9MYFvX4Ky8AVfrIA88paqFgoAm/djPMZDh HBcA4shO8ua01xXxI0VSwnYN9BA93aQ== 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=PNkeR7XS2C3IMBmZhFi0Uespe0wlYubfB/YpxfBNC34=; b=QSQYx7YPR9s/jD8x0lzwh/xmpwePwe64yjr8bngayPKLIIuho/VzJe2R/v4/YA+7+jHrtCg0ap/wx IdvR0G9Tk/VdxpWDu2Vrz2Hjzq1nbDU2H3VPh7pHchWBr5TvcoLMHjfh2q1thjqIs2+HY6qc5owoR9 jrcX19xr8aVydFNhfpLIBu/Vqr2A3WFXcEoPYQFe4XHUOECX5jL8H+TRbqQlvp1pMpLaHLgqlxqjM8 e8iPIeGYOuRBkBNhFu57r2s4vvd+zhEUMGGzLBXDVpo37DfU5QTirWlY2BH/O6gaVxmbX3GtU4r3oA kiBp2RTVh9BRCCsf37MicPt/fsFeu+Q== X-MHO-RoutePath: aGlwcGll X-MHO-User: d42aabc7-994b-11ea-b10c-b5956a7dd1a1 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 d42aabc7-994b-11ea-b10c-b5956a7dd1a1; Mon, 18 May 2020 21:09:15 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 04IL9EQH003283; Mon, 18 May 2020 15:09:14 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <90bc5fc67941a0b3ad8235351cfc303dc3a37c40.camel@freebsd.org> Subject: Re: svn commit: r361209 - head/sys/netinet From: Ian Lepore To: Michael Tuexen Cc: cem@freebsd.org, src-committers , svn-src-all , svn-src-head Date: Mon, 18 May 2020 15:09:14 -0600 In-Reply-To: <58B8E5E9-8DA1-4453-B1A3-A90D97D5FD43@freebsd.org> References: <202005181007.04IA713t089936@repo.freebsd.org> <064C2DCD-6279-4442-A900-0ECCD50CC4FA@freebsd.org> <124078163fc75e82a0acaff85f57859d012c6d98.camel@freebsd.org> <58B8E5E9-8DA1-4453-B1A3-A90D97D5FD43@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: 49Qs8G22sVz4NM8 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: Mon, 18 May 2020 21:09:18 -0000 On Mon, 2020-05-18 at 23:01 +0200, Michael Tuexen wrote: > > On 18. May 2020, at 22:48, Ian Lepore wrote: > > > > On Mon, 2020-05-18 at 22:43 +0200, Michael Tuexen wrote: > > > > Sure. You can certainly ignore user reports corresponding to > > > > bogus > > > > flags, though, and encourage use of various flags. > > > > > > I could, but decided to improve the situation for some people, > > > but > > > wasn't realising that I made it worse for others. Sorry about > > > that. > > > > I'm trying to figure out why your original commit was a problem. I > > understand why it was questioned, but once the answer came out, > > it's > > clear that the code you originally committed does what it's > > supposed to > > without any harmful side effects. Sure, freebsd doesn't strictly > > need > > I guess the point Conrad is making, that on FreeBSD the check is not > needed, since the call can not fail. So the FreeBSD code base would > not > be consistent: within the SCTP related code the return code is > checked, > in the other code it is not. > > it, but the code is shared among projects, so what's the harm in > > the > > extra check that helps other projects sharing the code? It's > > certainly > > a lot less confusion and code clutter than any of the "remedies" > > that > > have been discussed. > > Yepp, sharing code between platforms makes things harder. Running the > same > code in kernel land and userland does not make it simpler. Different > groups > have different opinions/styles/... > > I'll revert the commit tomorrow and a variadic macros > SCTP_SNPRINTF(), which > will map on FreeBSD to snprintf() and on the other platforms will do > the check. > > If the build problem comes up on FreeBSD userland (and I have no idea > if that > is the case, since I don't know how Firefox / Chrome are build on > FreeBSD), > I leave it up to the port maintainer of the application to deal with > it. > > Best regards > Michael > > > > -- Ian > > > > Well it seems to me you're being asked to do a lot of extra work that has the final result of making the code LESS clear and MORE complex, because of one person's opinion. I'm actually a bit tempted to complain about the change, because to me it reduces rather than improves code quality. -- Ian From owner-svn-src-all@freebsd.org Mon May 18 21:56: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 437DF2DEADC; Mon, 18 May 2020 21:56:12 +0000 (UTC) (envelope-from pfg@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 49QtBN0zf1z4RQN; Mon, 18 May 2020 21:56:12 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from [192.168.0.5] (unknown [181.52.72.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: pfg) by smtp.freebsd.org (Postfix) with ESMTPSA id 99B7E24A62; Mon, 18 May 2020 21:56:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Subject: Re: svn commit: r361136 - head/sys/fs/ext2fs To: Fedor Uporov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005171452.04HEqs7b063888@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Message-ID: <370c8418-0f6e-398e-e32e-0a08b234182b@FreeBSD.org> Date: Mon, 18 May 2020 16:56:09 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <202005171452.04HEqs7b063888@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-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, 18 May 2020 21:56:12 -0000 ... On 17/05/2020 09:52, Fedor Uporov wrote: > Author: fsu > Date: Sun May 17 14:52:54 2020 > New Revision: 361136 > URL: https://svnweb.freebsd.org/changeset/base/361136 > > Log: > Add BE architectures support. > > Author of most initial version: pfg (https://reviews.freebsd.org/D23259) > > Reviewed by: pfg > MFC after: 3 months > > Differential Revision: https://reviews.freebsd.org/D24685 Thanks so much for finishing off my initial code and for testing in PPC! Pedro. From owner-svn-src-all@freebsd.org Mon May 18 21:57: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 BAEA72DEB3E; Mon, 18 May 2020 21:57:04 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QtCN3BCNz4Rd0; Mon, 18 May 2020 21:57:03 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from mbp.fritz.box (ip4d1600c4.dynamic.kabel-deutschland.de [77.22.0.196]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 1FBBE7220F40F; Mon, 18 May 2020 23:57:01 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r361209 - head/sys/netinet From: Michael Tuexen In-Reply-To: <90bc5fc67941a0b3ad8235351cfc303dc3a37c40.camel@freebsd.org> Date: Mon, 18 May 2020 23:57:00 +0200 Cc: cem@freebsd.org, src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: 7bit Message-Id: <99D6D374-B8C6-4D47-812A-6DA5740DDDE9@freebsd.org> References: <202005181007.04IA713t089936@repo.freebsd.org> <064C2DCD-6279-4442-A900-0ECCD50CC4FA@freebsd.org> <124078163fc75e82a0acaff85f57859d012c6d98.camel@freebsd.org> <58B8E5E9-8DA1-4453-B1A3-A90D97D5FD43@freebsd.org> <90bc5fc67941a0b3ad8235351cfc303dc3a37c40.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 49QtCN3BCNz4Rd0 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:680, ipnet:2001:638::/32, 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: Mon, 18 May 2020 21:57:04 -0000 > On 18. May 2020, at 23:09, Ian Lepore wrote: > > On Mon, 2020-05-18 at 23:01 +0200, Michael Tuexen wrote: >>> On 18. May 2020, at 22:48, Ian Lepore wrote: >>> >>> On Mon, 2020-05-18 at 22:43 +0200, Michael Tuexen wrote: >>>>> Sure. You can certainly ignore user reports corresponding to >>>>> bogus >>>>> flags, though, and encourage use of various flags. >>>> >>>> I could, but decided to improve the situation for some people, >>>> but >>>> wasn't realising that I made it worse for others. Sorry about >>>> that. >>> >>> I'm trying to figure out why your original commit was a problem. I >>> understand why it was questioned, but once the answer came out, >>> it's >>> clear that the code you originally committed does what it's >>> supposed to >>> without any harmful side effects. Sure, freebsd doesn't strictly >>> need >> >> I guess the point Conrad is making, that on FreeBSD the check is not >> needed, since the call can not fail. So the FreeBSD code base would >> not >> be consistent: within the SCTP related code the return code is >> checked, >> in the other code it is not. >>> it, but the code is shared among projects, so what's the harm in >>> the >>> extra check that helps other projects sharing the code? It's >>> certainly >>> a lot less confusion and code clutter than any of the "remedies" >>> that >>> have been discussed. >> >> Yepp, sharing code between platforms makes things harder. Running the >> same >> code in kernel land and userland does not make it simpler. Different >> groups >> have different opinions/styles/... >> >> I'll revert the commit tomorrow and a variadic macros >> SCTP_SNPRINTF(), which >> will map on FreeBSD to snprintf() and on the other platforms will do >> the check. >> >> If the build problem comes up on FreeBSD userland (and I have no idea >> if that >> is the case, since I don't know how Firefox / Chrome are build on >> FreeBSD), >> I leave it up to the port maintainer of the application to deal with >> it. >> >> Best regards >> Michael >>> >>> -- Ian >>> >> >> > > Well it seems to me you're being asked to do a lot of extra work that > has the final result of making the code LESS clear and MORE complex, > because of one person's opinion. I'm actually a bit tempted to Yes, it is one person. But it is one person who thinks the change is bad enough that he needs to speak up. So I think this has to be addressed. > complain about the change, because to me it reduces rather than > improves code quality. Well, we have abstracted from FreeBSD specifics by using macros in other cases as well. Adding another macro will make reading a bit harder and you have to lookup the platform specific implementation of the code to figure out what is going on, but that way, I guess, people will get a result they can live with. Best regards Michael > > -- Ian > > From owner-svn-src-all@freebsd.org Mon May 18 22:53: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 1ABC72DF5F7; Mon, 18 May 2020 22:53:14 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QvS96c2qz4VKJ; Mon, 18 May 2020 22:53:13 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCFAB28BDE; Mon, 18 May 2020 22:53:13 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IMrDEv066420; Mon, 18 May 2020 22:53:13 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IMrC5S066415; Mon, 18 May 2020 22:53:12 GMT (envelope-from karels@FreeBSD.org) Message-Id: <202005182253.04IMrC5S066415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Mon, 18 May 2020 22:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361228 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: karels X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 361228 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, 18 May 2020 22:53:14 -0000 Author: karels Date: Mon May 18 22:53:12 2020 New Revision: 361228 URL: https://svnweb.freebsd.org/changeset/base/361228 Log: Allow TCP to reuse local port with different destinations Previously, tcp_connect() would bind a local port before connecting, forcing the local port to be unique across all outgoing TCP connections for the address family. Instead, choose a local port after selecting the destination and the local address, requiring only that the tuple is unique and does not match a wildcard binding. Reviewed by: tuexen (rscheff, rrs previous version) MFC after: 1 month Sponsored by: Forcepoint LLC Differential Revision: https://reviews.freebsd.org/D24781 Modified: head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/tcp_usrreq.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_pcb.h Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Mon May 18 19:48:38 2020 (r361227) +++ head/sys/netinet/in_pcb.c Mon May 18 22:53:12 2020 (r361228) @@ -610,13 +610,15 @@ in_pcbbind(struct inpcb *inp, struct sockaddr *nam, st } #endif +#if defined(INET) || defined(INET6) /* - * Select a local port (number) to use. + * Assign a local port like in_pcb_lport(), but also used with connect() + * and a foreign address and port. If fsa is non-NULL, choose a local port + * that is unused with those, otherwise one that is completely unused. */ -#if defined(INET) || defined(INET6) int -in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp, u_short *lportp, - struct ucred *cred, int lookupflags) +in_pcb_lport_dest(struct inpcb *inp, struct sockaddr *lsa, u_short *lportp, + struct sockaddr *fsa, u_short fport, struct ucred *cred, int lookupflags) { struct inpcbinfo *pcbinfo; struct inpcb *tmpinp; @@ -624,8 +626,11 @@ in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp int count, dorandom, error; u_short aux, first, last, lport; #ifdef INET - struct in_addr laddr; + struct in_addr laddr, faddr; #endif +#ifdef INET6 + struct in6_addr *laddr6, *faddr6; +#endif pcbinfo = inp->inp_pcbinfo; @@ -685,15 +690,22 @@ in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp } #ifdef INET - /* Make the compiler happy. */ - laddr.s_addr = 0; + laddr.s_addr = INADDR_ANY; if ((inp->inp_vflag & (INP_IPV4|INP_IPV6)) == INP_IPV4) { - KASSERT(laddrp != NULL, ("%s: laddrp NULL for v4 inp %p", - __func__, inp)); - laddr = *laddrp; + laddr = ((struct sockaddr_in *)lsa)->sin_addr; + if (fsa != NULL) + faddr = ((struct sockaddr_in *)fsa)->sin_addr; } #endif - tmpinp = NULL; /* Make compiler happy. */ +#ifdef INET6 + if (lsa->sa_family == AF_INET6) { + laddr6 = &((struct sockaddr_in6 *)lsa)->sin6_addr; + if (fsa != NULL) + faddr6 = &((struct sockaddr_in6 *)fsa)->sin6_addr; + } +#endif + + tmpinp = NULL; lport = *lportp; if (dorandom) @@ -709,30 +721,62 @@ in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp *lastport = first; lport = htons(*lastport); + if (fsa != NULL) { + +#ifdef INET + if (lsa->sa_family == AF_INET) { + tmpinp = in_pcblookup_hash_locked(pcbinfo, + faddr, fport, laddr, lport, lookupflags, + NULL); + } +#endif #ifdef INET6 - if ((inp->inp_vflag & INP_IPV6) != 0) - tmpinp = in6_pcblookup_local(pcbinfo, - &inp->in6p_laddr, lport, lookupflags, cred); + if (lsa->sa_family == AF_INET6) { + tmpinp = in6_pcblookup_hash_locked(pcbinfo, + faddr6, fport, laddr6, lport, lookupflags, + NULL); + } #endif + } else { +#ifdef INET6 + if ((inp->inp_vflag & INP_IPV6) != 0) + tmpinp = in6_pcblookup_local(pcbinfo, + &inp->in6p_laddr, lport, lookupflags, cred); +#endif #if defined(INET) && defined(INET6) - else + else #endif #ifdef INET - tmpinp = in_pcblookup_local(pcbinfo, laddr, - lport, lookupflags, cred); + tmpinp = in_pcblookup_local(pcbinfo, laddr, + lport, lookupflags, cred); #endif + } } while (tmpinp != NULL); -#ifdef INET - if ((inp->inp_vflag & (INP_IPV4|INP_IPV6)) == INP_IPV4) - laddrp->s_addr = laddr.s_addr; -#endif *lportp = lport; return (0); } /* + * Select a local port (number) to use. + */ +int +in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp, u_short *lportp, + struct ucred *cred, int lookupflags) +{ + struct sockaddr_in laddr; + + if (laddrp) { + bzero(&laddr, sizeof(laddr)); + laddr.sin_family = AF_INET; + laddr.sin_addr = *laddrp; + } + return (in_pcb_lport_dest(inp, laddrp ? (struct sockaddr *) &laddr : + NULL, lportp, NULL, 0, cred, lookupflags)); +} + +/* * Return cached socket options. */ int @@ -1344,16 +1388,26 @@ in_pcbconnect_setup(struct inpcb *inp, struct sockaddr if (error) return (error); } - oinp = in_pcblookup_hash_locked(inp->inp_pcbinfo, faddr, fport, - laddr, lport, 0, NULL); - if (oinp != NULL) { - if (oinpp != NULL) - *oinpp = oinp; - return (EADDRINUSE); - } - if (lport == 0) { - error = in_pcbbind_setup(inp, NULL, &laddr.s_addr, &lport, - cred); + if (lport != 0) { + oinp = in_pcblookup_hash_locked(inp->inp_pcbinfo, faddr, + fport, laddr, lport, 0, NULL); + if (oinp != NULL) { + if (oinpp != NULL) + *oinpp = oinp; + return (EADDRINUSE); + } + } else { + struct sockaddr_in lsin, fsin; + + bzero(&lsin, sizeof(lsin)); + bzero(&fsin, sizeof(fsin)); + lsin.sin_family = AF_INET; + lsin.sin_addr = laddr; + fsin.sin_family = AF_INET; + fsin.sin_addr = faddr; + error = in_pcb_lport_dest(inp, (struct sockaddr *) &lsin, + &lport, (struct sockaddr *)& fsin, fport, cred, + INPLOOKUP_WILDCARD); if (error) return (error); } Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Mon May 18 19:48:38 2020 (r361227) +++ head/sys/netinet/in_pcb.h Mon May 18 22:53:12 2020 (r361228) @@ -824,6 +824,9 @@ void in_pcbgroup_update_mbuf(struct inpcb *, struct mb void in_pcbpurgeif0(struct inpcbinfo *, struct ifnet *); int in_pcballoc(struct socket *, struct inpcbinfo *); int in_pcbbind(struct inpcb *, struct sockaddr *, struct ucred *); +int in_pcb_lport_dest(struct inpcb *inp, struct sockaddr *lsa, + u_short *lportp, struct sockaddr *fsa, u_short fport, + struct ucred *cred, int lookupflags); int in_pcb_lport(struct inpcb *, struct in_addr *, u_short *, struct ucred *, int); int in_pcbbind_setup(struct inpcb *, struct sockaddr *, in_addr_t *, Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Mon May 18 19:48:38 2020 (r361227) +++ head/sys/netinet/tcp_usrreq.c Mon May 18 22:53:12 2020 (r361228) @@ -147,6 +147,16 @@ static int tcp_pru_options_support(struct tcpcb *tp, i #endif /* + * tcp_require_unique port requires a globally-unique source port for each + * outgoing connection. The default is to require the 4-tuple to be unique. + */ +VNET_DEFINE(int, tcp_require_unique_port) = 0; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, require_unique_port, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_require_unique_port), 0, + "Require globally-unique ephemeral port for outgoing connections"); +#define V_tcp_require_unique_port VNET(tcp_require_unique_port) + +/* * TCP attaches to socket via pru_attach(), reserving space, * and an internet control block. */ @@ -1514,7 +1524,7 @@ tcp_connect(struct tcpcb *tp, struct sockaddr *nam, st INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK(&V_tcbinfo); - if (inp->inp_lport == 0) { + if (V_tcp_require_unique_port && inp->inp_lport == 0) { error = in_pcbbind(inp, (struct sockaddr *)0, td->td_ucred); if (error) goto out; @@ -1535,6 +1545,15 @@ tcp_connect(struct tcpcb *tp, struct sockaddr *nam, st error = EADDRINUSE; goto out; } + /* Handle initial bind if it hadn't been done in advance. */ + if (inp->inp_lport == 0) { + inp->inp_lport = lport; + if (in_pcbinshash(inp) != 0) { + inp->inp_lport = 0; + error = EAGAIN; + goto out; + } + } inp->inp_laddr = laddr; in_pcbrehash(inp); INP_HASH_WUNLOCK(&V_tcbinfo); @@ -1574,7 +1593,7 @@ tcp6_connect(struct tcpcb *tp, struct sockaddr *nam, s INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK(&V_tcbinfo); - if (inp->inp_lport == 0) { + if (V_tcp_require_unique_port && inp->inp_lport == 0) { error = in6_pcbbind(inp, (struct sockaddr *)0, td->td_ucred); if (error) goto out; Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Mon May 18 19:48:38 2020 (r361227) +++ head/sys/netinet6/in6_pcb.c Mon May 18 22:53:12 2020 (r361228) @@ -113,9 +113,6 @@ __FBSDID("$FreeBSD$"); #include #include -static struct inpcb *in6_pcblookup_hash_locked(struct inpcbinfo *, - struct in6_addr *, u_int, struct in6_addr *, u_int, int, struct ifnet *); - int in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, struct ucred *cred) @@ -417,9 +414,12 @@ in6_pcbconnect_mbuf(struct inpcb *inp, struct sockaddr { struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)nam; - struct in6_addr addr6; + struct sockaddr_in6 laddr6; int error; + bzero(&laddr6, sizeof(laddr6)); + laddr6.sin6_family = AF_INET6; + INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(pcbinfo); @@ -427,25 +427,36 @@ in6_pcbconnect_mbuf(struct inpcb *inp, struct sockaddr * Call inner routine, to assign local interface address. * in6_pcbladdr() may automatically fill in sin6_scope_id. */ - if ((error = in6_pcbladdr(inp, nam, &addr6)) != 0) + if ((error = in6_pcbladdr(inp, nam, &laddr6.sin6_addr)) != 0) return (error); if (in6_pcblookup_hash_locked(pcbinfo, &sin6->sin6_addr, sin6->sin6_port, IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr) - ? &addr6 : &inp->in6p_laddr, + ? &laddr6.sin6_addr : &inp->in6p_laddr, inp->inp_lport, 0, NULL) != NULL) { return (EADDRINUSE); } if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) { if (inp->inp_lport == 0) { + /* + * rehash was required to be true in the past for + * this case; retain that convention. However, + * we now call in_pcb_lport_dest rather than + * in6_pcbbind; the former does not insert into + * the hash table, the latter does. Change rehash + * to false to do the in_pcbinshash below. + */ KASSERT(rehash == true, ("Rehashing required for unbound inps")); - error = in6_pcbbind(inp, (struct sockaddr *)0, cred); + rehash = false; + error = in_pcb_lport_dest(inp, + (struct sockaddr *) &laddr6, &inp->inp_lport, + (struct sockaddr *) sin6, sin6->sin6_port, cred, 0); if (error) return (error); } - inp->in6p_laddr = addr6; + inp->in6p_laddr = laddr6.sin6_addr; } inp->in6p_faddr = sin6->sin6_addr; inp->inp_fport = sin6->sin6_port; @@ -1122,9 +1133,9 @@ found: #endif /* PCBGROUP */ /* - * Lookup PCB in hash list. + * Lookup PCB in hash list. Used in in_pcb.c as well as here. */ -static struct inpcb * +struct inpcb * in6_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, struct in6_addr *faddr, u_int fport_arg, struct in6_addr *laddr, u_int lport_arg, int lookupflags, struct ifnet *ifp) Modified: head/sys/netinet6/in6_pcb.h ============================================================================== --- head/sys/netinet6/in6_pcb.h Mon May 18 19:48:38 2020 (r361227) +++ head/sys/netinet6/in6_pcb.h Mon May 18 22:53:12 2020 (r361228) @@ -92,6 +92,10 @@ struct inpcb * in6_pcblookup_local(struct inpcbinfo *, struct in6_addr *, u_short, int, struct ucred *); +struct inpcb * + in6_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, + struct in6_addr *faddr, u_int fport_arg, struct in6_addr *laddr, + u_int lport_arg, int lookupflags, struct ifnet *ifp); struct inpcb * in6_pcblookup(struct inpcbinfo *, struct in6_addr *, u_int, struct in6_addr *, u_int, int, From owner-svn-src-all@freebsd.org Mon May 18 23:43: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 D91402F0A8F; Mon, 18 May 2020 23:43:48 +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 49QwZX5PKHz4X8s; Mon, 18 May 2020 23:43:48 +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 B4BC0297C6; Mon, 18 May 2020 23:43:48 +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 04INhmW8096776; Mon, 18 May 2020 23:43:48 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04INhm77096775; Mon, 18 May 2020 23:43:48 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202005182343.04INhm77096775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 18 May 2020 23:43:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361229 - head/tests/sys/geom/class/multipath X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/geom/class/multipath X-SVN-Commit-Revision: 361229 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, 18 May 2020 23:43:48 -0000 Author: lwhsu Date: Mon May 18 23:43:48 2020 New Revision: 361229 URL: https://svnweb.freebsd.org/changeset/base/361229 Log: Revert 357780, `dtrace -c` has been fixed in head` PR: 244053 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/geom/class/multipath/failloop.sh Modified: head/tests/sys/geom/class/multipath/failloop.sh ============================================================================== --- head/tests/sys/geom/class/multipath/failloop.sh Mon May 18 22:53:12 2020 (r361228) +++ head/tests/sys/geom/class/multipath/failloop.sh Mon May 18 23:43:48 2020 (r361229) @@ -36,10 +36,6 @@ failloop_head() } failloop_body() { - if [ "$(atf_config_get ci false)" = "true" ]; then - atf_skip "https://bugs.freebsd.org/244053" - fi - sysctl -n kern.geom.notaste > kern.geom.notaste.txt load_gnop load_gmultipath From owner-svn-src-all@freebsd.org Tue May 19 00:15: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 DDF6B2F0FFA; Tue, 19 May 2020 00:15: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 49QxGv5c4Rz4Yfr; Tue, 19 May 2020 00:15: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 B750E29DDF; Tue, 19 May 2020 00:15: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 04J0FJ6b015358; Tue, 19 May 2020 00:15:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J0FJR7015357; Tue, 19 May 2020 00:15:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005190015.04J0FJR7015357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 19 May 2020 00:15:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361230 - head/contrib/blacklist/bin X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/blacklist/bin X-SVN-Commit-Revision: 361230 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, 19 May 2020 00:15:19 -0000 Author: emaste Date: Tue May 19 00:15:19 2020 New Revision: 361230 URL: https://svnweb.freebsd.org/changeset/base/361230 Log: blacklistd.conf.5: typo/grammar fixes PR: 246467 Submitted by: Mike Lempriere Modified: head/contrib/blacklist/bin/blacklistd.conf.5 Modified: head/contrib/blacklist/bin/blacklistd.conf.5 ============================================================================== --- head/contrib/blacklist/bin/blacklistd.conf.5 Mon May 18 23:43:48 2020 (r361229) +++ head/contrib/blacklist/bin/blacklistd.conf.5 Tue May 19 00:15:19 2020 (r361230) @@ -125,18 +125,18 @@ The second field is the socket .Dv dgram , or numeric. The third field is the -.Va prococol : +.Va protocol : .Dv tcp , .Dv udp , .Dv tcp6 , .Dv udp6 , or numeric. -The fourth file is the effective user +The fourth field is the effective user .Va ( owner ) of the daemon process reporting the event, either as a username or a userid. .Pp -The rest of the fields are controlling the behavior of the filter. +The rest of the fields control the behavior of the filter. .Pp The .Va name From owner-svn-src-all@freebsd.org Tue May 19 01:05: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 3F0172F2199; Tue, 19 May 2020 01:05:14 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QyNV112xz4ch6; Tue, 19 May 2020 01:05:14 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DCAF2A176; Tue, 19 May 2020 01:05:14 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J15DKt046192; Tue, 19 May 2020 01:05:13 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J15DCQ046191; Tue, 19 May 2020 01:05:13 GMT (envelope-from karels@FreeBSD.org) Message-Id: <202005190105.04J15DCQ046191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Tue, 19 May 2020 01:05:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361231 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: karels X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361231 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, 19 May 2020 01:05:14 -0000 Author: karels Date: Tue May 19 01:05:13 2020 New Revision: 361231 URL: https://svnweb.freebsd.org/changeset/base/361231 Log: Fix NULL-pointer bug from r361228. Note that in_pcb_lport and in_pcb_lport_dest can be called with a NULL local address for IPv6 sockets; handle it. Found by syzkaller. Reported by: cem MFC after: 1 month Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Tue May 19 00:15:19 2020 (r361230) +++ head/sys/netinet/in_pcb.c Tue May 19 01:05:13 2020 (r361231) @@ -615,6 +615,7 @@ in_pcbbind(struct inpcb *inp, struct sockaddr *nam, st * Assign a local port like in_pcb_lport(), but also used with connect() * and a foreign address and port. If fsa is non-NULL, choose a local port * that is unused with those, otherwise one that is completely unused. + * lsa can be NULL for IPv6. */ int in_pcb_lport_dest(struct inpcb *inp, struct sockaddr *lsa, u_short *lportp, @@ -692,14 +693,17 @@ in_pcb_lport_dest(struct inpcb *inp, struct sockaddr * #ifdef INET laddr.s_addr = INADDR_ANY; if ((inp->inp_vflag & (INP_IPV4|INP_IPV6)) == INP_IPV4) { - laddr = ((struct sockaddr_in *)lsa)->sin_addr; + if (lsa != NULL) + laddr = ((struct sockaddr_in *)lsa)->sin_addr; if (fsa != NULL) faddr = ((struct sockaddr_in *)fsa)->sin_addr; } #endif #ifdef INET6 - if (lsa->sa_family == AF_INET6) { - laddr6 = &((struct sockaddr_in6 *)lsa)->sin6_addr; + laddr6 = NULL; + if ((inp->inp_vflag & INP_IPV6) != 0) { + if (lsa != NULL) + laddr6 = &((struct sockaddr_in6 *)lsa)->sin6_addr; if (fsa != NULL) faddr6 = &((struct sockaddr_in6 *)fsa)->sin6_addr; } From owner-svn-src-all@freebsd.org Tue May 19 01: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 BF6942F21AE; Tue, 19 May 2020 01:06:31 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QyPz4hFTz4cx0; Tue, 19 May 2020 01:06:31 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C08E2A57F; Tue, 19 May 2020 01:06:31 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J16VG3046289; Tue, 19 May 2020 01:06:31 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J16VRx046288; Tue, 19 May 2020 01:06:31 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202005190106.04J16VRx046288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 19 May 2020 01:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361232 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 361232 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, 19 May 2020 01:06:31 -0000 Author: jhibbits Date: Tue May 19 01:06:31 2020 New Revision: 361232 URL: https://svnweb.freebsd.org/changeset/base/361232 Log: powerpc/mmu: Don't use the cache instructions to zero pages A page (even physmem) can be marked as cache-inhibited. Attempting to use 'dcbz' to zero a page mapped cache-inhibited triggers an alignment exception, which is fatal in kernel. This was seen when testing hardware acceleration with X on POWER9. At some point in the future, this should be changed to a more straight forward zero loop instead of bzero(), and a similar change be made to the other pmaps. Reported by: pkubaj@ Modified: head/sys/powerpc/aim/mmu_radix.c Modified: head/sys/powerpc/aim/mmu_radix.c ============================================================================== --- head/sys/powerpc/aim/mmu_radix.c Tue May 19 01:05:13 2020 (r361231) +++ head/sys/powerpc/aim/mmu_radix.c Tue May 19 01:06:31 2020 (r361232) @@ -909,10 +909,8 @@ static void pagezero(vm_offset_t va) { va = trunc_page(va); - int off; - for (off = 0; off < PAGE_SIZE; off += cacheline_size) - __asm __volatile("dcbz 0,%0" :: "r"(va + off)); + bzero((void *)va, PAGE_SIZE); } static uint64_t From owner-svn-src-all@freebsd.org Tue May 19 01: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 4BF292F397A; Tue, 19 May 2020 01:39:38 +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 49Qz8B1NQsz3RNS; Tue, 19 May 2020 01:39:38 +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 2A9682AD99; Tue, 19 May 2020 01:39:38 +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 04J1db1g064797; Tue, 19 May 2020 01:39:37 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J1dbUQ064796; Tue, 19 May 2020 01:39:37 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202005190139.04J1dbUQ064796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Tue, 19 May 2020 01:39:37 +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: r361234 - stable/12/sys/dev/acpica X-SVN-Group: stable-12 X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: stable/12/sys/dev/acpica X-SVN-Commit-Revision: 361234 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, 19 May 2020 01:39:38 -0000 Author: cperciva Date: Tue May 19 01:39:37 2020 New Revision: 361234 URL: https://svnweb.freebsd.org/changeset/base/361234 Log: MFC r361097: Send Lid status notification via devd from acpi_lid_status_update. Some laptops don't send ACPI "lid status changed" notifications upon opening the lid if the system was currently suspended. In r358219 this was partially fixed, updating the "lid_status" variable upon resume even if there is no "status changed" notification from ACPI. Unfortunately the fix in r358219 did not include notifying userland via devd; this causes problems on systems using upowerd (e.g. KDE), since upowerd remembers the most recent devd notification about the lid status rather than querying the sysctl to get the current status. This showed up as two symptoms when KDE's "When laptop lid closed: Sleep" option is set: 1. 50% of the time, closing the lid would not trigger S3 sleep. 2. 50% of the time, plugging/unplugging AC power would trigger S3 sleep. PR: 246477 Modified: stable/12/sys/dev/acpica/acpi_lid.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/acpica/acpi_lid.c ============================================================================== --- stable/12/sys/dev/acpica/acpi_lid.c Tue May 19 01:32:15 2020 (r361233) +++ stable/12/sys/dev/acpica/acpi_lid.c Tue May 19 01:39:37 2020 (r361234) @@ -113,6 +113,9 @@ acpi_lid_status_update(struct acpi_lid_softc *sc) /* range check value */ sc->lid_status = lid_status ? 1 : 0; + /* Send notification via devd */ + acpi_UserNotify("Lid", sc->lid_handle, sc->lid_status); + #ifdef EVDEV_SUPPORT /* Notify evdev about lid status */ evdev_push_sw(sc->lid_evdev, SW_LID, lid_status ? 0 : 1); From owner-svn-src-all@freebsd.org Tue May 19 01:40: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 5CC712F3F3E; Tue, 19 May 2020 01:40: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 49Qz9V1rqWz3RdX; Tue, 19 May 2020 01:40:46 +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 3ABCA2AD22; Tue, 19 May 2020 01:40:46 +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 04J1ek3W064955; Tue, 19 May 2020 01:40:46 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J1ekY8064954; Tue, 19 May 2020 01:40:46 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202005190140.04J1ekY8064954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Tue, 19 May 2020 01:40:46 +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: r361235 - stable/12/libexec/rc/rc.d X-SVN-Group: stable-12 X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: stable/12/libexec/rc/rc.d X-SVN-Commit-Revision: 361235 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, 19 May 2020 01:40:46 -0000 Author: cperciva Date: Tue May 19 01:40:45 2020 New Revision: 361235 URL: https://svnweb.freebsd.org/changeset/base/361235 Log: MFC r361114: Move the devmatch rc.d script before netif in the boot process. Prior to this change, using lagg to aggregate wired and wireless networks was broken in the (relatively common) case where wifi drivers + firmware are loaded by devmatch, since the interface didn't exist at the time when the lagg interface was being created. PR: 246506 Modified: stable/12/libexec/rc/rc.d/devmatch Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.d/devmatch ============================================================================== --- stable/12/libexec/rc/rc.d/devmatch Tue May 19 01:39:37 2020 (r361234) +++ stable/12/libexec/rc/rc.d/devmatch Tue May 19 01:40:45 2020 (r361235) @@ -27,6 +27,7 @@ # # PROVIDE: devmatch # REQUIRE: kldxref +# BEFORE: netif # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-all@freebsd.org Tue May 19 01:43: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 CCF172F40F8; Tue, 19 May 2020 01:43:02 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QzD65G4rz3SGg; Tue, 19 May 2020 01:43:02 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9577A2AFA1; Tue, 19 May 2020 01:43:02 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J1h2Ze070557; Tue, 19 May 2020 01:43:02 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J1h13M070549; Tue, 19 May 2020 01:43:01 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005190143.04J1h13M070549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Tue, 19 May 2020 01:43:01 +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: r361236 - in stable: 11/sys/fs/nfs 11/sys/fs/nfsclient 11/sys/fs/nfsserver 12/sys/fs/nfs 12/sys/fs/nfsclient 12/sys/fs/nfsserver X-SVN-Group: stable-11 X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in stable: 11/sys/fs/nfs 11/sys/fs/nfsclient 11/sys/fs/nfsserver 12/sys/fs/nfs 12/sys/fs/nfsclient 12/sys/fs/nfsserver X-SVN-Commit-Revision: 361236 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, 19 May 2020 01:43:02 -0000 Author: freqlabs Date: Tue May 19 01:43:00 2020 New Revision: 361236 URL: https://svnweb.freebsd.org/changeset/base/361236 Log: MFC r360960: nfs: Remove APPLESTATIC macro It is no longer useful. Reviewed by: rmacklem Approved by: mav (mentor) Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D24811 Modified: stable/11/sys/fs/nfs/nfs_commonacl.c stable/11/sys/fs/nfs/nfs_commonsubs.c stable/11/sys/fs/nfs/nfsport.h stable/11/sys/fs/nfsclient/nfs_clcomsubs.c stable/11/sys/fs/nfsclient/nfs_clport.c stable/11/sys/fs/nfsclient/nfs_clrpcops.c stable/11/sys/fs/nfsclient/nfs_clstate.c stable/11/sys/fs/nfsserver/nfs_nfsdcache.c stable/11/sys/fs/nfsserver/nfs_nfsdserv.c stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c stable/11/sys/fs/nfsserver/nfs_nfsdstate.c stable/11/sys/fs/nfsserver/nfs_nfsdsubs.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/fs/nfs/nfs_commonacl.c stable/12/sys/fs/nfs/nfs_commonsubs.c stable/12/sys/fs/nfs/nfsport.h stable/12/sys/fs/nfsclient/nfs_clcomsubs.c stable/12/sys/fs/nfsclient/nfs_clport.c stable/12/sys/fs/nfsclient/nfs_clrpcops.c stable/12/sys/fs/nfsclient/nfs_clstate.c stable/12/sys/fs/nfsserver/nfs_nfsdcache.c stable/12/sys/fs/nfsserver/nfs_nfsdserv.c stable/12/sys/fs/nfsserver/nfs_nfsdsocket.c stable/12/sys/fs/nfsserver/nfs_nfsdstate.c stable/12/sys/fs/nfsserver/nfs_nfsdsubs.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- stable/11/sys/fs/nfs/nfs_commonacl.c Tue May 19 01:40:45 2020 (r361235) +++ stable/11/sys/fs/nfs/nfs_commonacl.c Tue May 19 01:43:00 2020 (r361236) @@ -38,7 +38,7 @@ static int nfsrv_acemasktoperm(u_int32_t acetype, u_in /* * Handle xdr for an ace. */ -APPLESTATIC int +int nfsrv_dissectace(struct nfsrv_descript *nd, struct acl_entry *acep, int *aceerrp, int *acesizep, NFSPROC_T *p) { @@ -386,7 +386,7 @@ nfsrv_buildace(struct nfsrv_descript *nd, u_char *name /* * Build an NFSv4 ACL. */ -APPLESTATIC int +int nfsrv_buildacl(struct nfsrv_descript *nd, NFSACL_T *aclp, enum vtype type, NFSPROC_T *p) { @@ -448,7 +448,7 @@ nfsrv_buildacl(struct nfsrv_descript *nd, NFSACL_T *ac /* * Set an NFSv4 acl. */ -APPLESTATIC int +int nfsrv_setacl(vnode_t vp, NFSACL_T *aclp, struct ucred *cred, NFSPROC_T *p) { @@ -479,7 +479,7 @@ out: * Compare two NFSv4 acls. * Return 0 if they are the same, 1 if not the same. */ -APPLESTATIC int +int nfsrv_compareacl(NFSACL_T *aclp1, NFSACL_T *aclp2) { int i; Modified: stable/11/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/11/sys/fs/nfs/nfs_commonsubs.c Tue May 19 01:40:45 2020 (r361235) +++ stable/11/sys/fs/nfs/nfs_commonsubs.c Tue May 19 01:43:00 2020 (r361236) @@ -286,7 +286,7 @@ out: * This is used by the macro NFSM_DISSECT for tough * cases. */ -APPLESTATIC void * +void * nfsm_dissct(struct nfsrv_descript *nd, int siz, int how) { mbuf_t mp2; @@ -352,7 +352,7 @@ nfsm_dissct(struct nfsrv_descript *nd, int siz, int ho * here than check for offs > 0 for all calls to nfsm_advance. * If left == -1, it should be calculated here. */ -APPLESTATIC int +int nfsm_advance(struct nfsrv_descript *nd, int offs, int left) { int error = 0; @@ -400,7 +400,7 @@ out: * Copy a string into mbuf(s). * Return the number of bytes output, including XDR overheads. */ -APPLESTATIC int +int nfsm_strtom(struct nfsrv_descript *nd, const char *cp, int siz) { mbuf_t m2; @@ -457,7 +457,7 @@ nfsm_strtom(struct nfsrv_descript *nd, const char *cp, /* * Called once to initialize data structures... */ -APPLESTATIC void +void newnfs_init(void) { static int nfs_inited = 0; @@ -487,7 +487,7 @@ newnfs_init(void) * set_true == 1 if there should be an newnfs_true prepended on the file handle. * Return the number of bytes output, including XDR overhead. */ -APPLESTATIC int +int nfsm_fhtom(struct nfsrv_descript *nd, u_int8_t *fhp, int size, int set_true) { u_int32_t *tl; @@ -530,7 +530,7 @@ nfsm_fhtom(struct nfsrv_descript *nd, u_int8_t *fhp, i * The AF_INET family is handled as a special case so that address mbufs * don't need to be saved to store "struct in_addr", which is only 4 bytes. */ -APPLESTATIC int +int nfsaddr_match(int family, union nethostaddr *haddr, NFSSOCKADDR_T nam) { struct sockaddr_in *inetaddr; @@ -563,7 +563,7 @@ nfsaddr_match(int family, union nethostaddr *haddr, NF /* * Similar to the above, but takes to NFSSOCKADDR_T args. */ -APPLESTATIC int +int nfsaddr2_match(NFSSOCKADDR_T nam1, NFSSOCKADDR_T nam2) { struct sockaddr_in *addr1, *addr2; @@ -601,7 +601,7 @@ nfsaddr2_match(NFSSOCKADDR_T nam1, NFSSOCKADDR_T nam2) /* * Trim the stuff already dissected off the mbuf list. */ -APPLESTATIC void +void newnfs_trimleading(nd) struct nfsrv_descript *nd; { @@ -647,7 +647,7 @@ newnfs_trimleading(nd) /* * Trim trailing data off the mbuf list being built. */ -APPLESTATIC void +void newnfs_trimtrailing(nd, mb, bpos) struct nfsrv_descript *nd; mbuf_t mb; @@ -666,7 +666,7 @@ newnfs_trimtrailing(nd, mb, bpos) /* * Dissect a file handle on the client. */ -APPLESTATIC int +int nfsm_getfh(struct nfsrv_descript *nd, struct nfsfh **nfhpp) { u_int32_t *tl; @@ -701,7 +701,7 @@ nfsmout: * Break down the nfsv4 acl. * If the aclp == NULL or won't fit in an acl, just discard the acl info. */ -APPLESTATIC int +int nfsrv_dissectacl(struct nfsrv_descript *nd, NFSACL_T *aclp, int *aclerrp, int *aclsizep, __unused NFSPROC_T *p) { @@ -767,7 +767,7 @@ nfsmout: * Returns EBADRPC for a parsing error, 0 otherwise. * If the clearinvalid flag is set, clear the bits not supported. */ -APPLESTATIC int +int nfsrv_getattrbits(struct nfsrv_descript *nd, nfsattrbit_t *attrbitp, int *cntp, int *retnotsupp) { @@ -813,7 +813,7 @@ nfsmout: * and 0 otherwise. * Returns EBADRPC if it can't be parsed, 0 otherwise. */ -APPLESTATIC int +int nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, struct nfsvattr *nap, struct nfsfh **nfhpp, fhandle_t *fhp, int fhsize, struct nfsv3_pathconf *pc, struct statfs *sbp, struct nfsstatfs *sfp, @@ -1851,7 +1851,7 @@ nfsmout: * and the mp argument indicates to check for a forced dismount, iff not * NULL. */ -APPLESTATIC int +int nfsv4_lock(struct nfsv4lock *lp, int iwantlock, int *isleptp, void *mutex, struct mount *mp) { @@ -1898,7 +1898,7 @@ nfsv4_lock(struct nfsv4lock *lp, int iwantlock, int *i * The second argument is set to 1 to indicate the nfslock_usecnt should be * incremented, as well. */ -APPLESTATIC void +void nfsv4_unlock(struct nfsv4lock *lp, int incref) { @@ -1911,7 +1911,7 @@ nfsv4_unlock(struct nfsv4lock *lp, int incref) /* * Release a reference cnt. */ -APPLESTATIC void +void nfsv4_relref(struct nfsv4lock *lp) { @@ -1931,7 +1931,7 @@ nfsv4_relref(struct nfsv4lock *lp) * If the mp argument is not NULL, check for NFSCL_FORCEDISM() being set and * return without getting a refcnt for that case. */ -APPLESTATIC void +void nfsv4_getref(struct nfsv4lock *lp, int *isleptp, void *mutex, struct mount *mp) { @@ -1961,7 +1961,7 @@ nfsv4_getref(struct nfsv4lock *lp, int *isleptp, void * Get a reference as above, but return failure instead of sleeping if * an exclusive lock is held. */ -APPLESTATIC int +int nfsv4_getref_nonblock(struct nfsv4lock *lp) { @@ -1975,7 +1975,7 @@ nfsv4_getref_nonblock(struct nfsv4lock *lp) /* * Test for a lock. Return 1 if locked, 0 otherwise. */ -APPLESTATIC int +int nfsv4_testlock(struct nfsv4lock *lp) { @@ -2003,7 +2003,7 @@ nfsv4_wanted(struct nfsv4lock *lp) * Return EBADRPC if there is an mbuf error, * 0 otherwise. */ -APPLESTATIC int +int nfsrv_mtostr(struct nfsrv_descript *nd, char *str, int siz) { char *cp; @@ -2054,7 +2054,7 @@ out: /* * Fill in the attributes as marked by the bitmap (V4). */ -APPLESTATIC int +int nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, NFSACL_T *saclp, struct vattr *vap, fhandle_t *fhp, int rderror, nfsattrbit_t *attrbitp, struct ucred *cred, NFSPROC_T *p, int isdgram, @@ -2564,7 +2564,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount * Put the attribute bits onto an mbuf list. * Return the number of bytes of output generated. */ -APPLESTATIC int +int nfsrv_putattrbit(struct nfsrv_descript *nd, nfsattrbit_t *attrbitp) { u_int32_t *tl; @@ -2589,7 +2589,7 @@ nfsrv_putattrbit(struct nfsrv_descript *nd, nfsattrbit * (malloc a larger one, as required) * retlenp - pointer to length to be returned */ -APPLESTATIC void +void nfsv4_uidtostr(uid_t uid, u_char **cpp, int *retlenp, NFSPROC_T *p) { int i; @@ -2748,7 +2748,7 @@ tryagain: * string is made up entirely of digits, just convert the string to * a number. */ -APPLESTATIC int +int nfsv4_strtouid(struct nfsrv_descript *nd, u_char *str, int len, uid_t *uidp, NFSPROC_T *p) { @@ -2851,7 +2851,7 @@ out: * (malloc a larger one, as required) * retlenp - pointer to length to be returned */ -APPLESTATIC void +void nfsv4_gidtostr(gid_t gid, u_char **cpp, int *retlenp, NFSPROC_T *p) { int i; @@ -2964,7 +2964,7 @@ tryagain: * string is made up entirely of digits, just convert the string to * a number. */ -APPLESTATIC int +int nfsv4_strtogid(struct nfsrv_descript *nd, u_char *str, int len, gid_t *gidp, NFSPROC_T *p) { @@ -3090,7 +3090,7 @@ nfsrv_cmpmixedcase(u_char *cp, u_char *cp2, int len) /* * Set the port for the nfsuserd. */ -APPLESTATIC int +int nfsrv_nfsuserdport(struct nfsuserd_args *nargs, NFSPROC_T *p) { struct nfssockreq *rp; @@ -3173,7 +3173,7 @@ out: /* * Delete the nfsuserd port. */ -APPLESTATIC void +void nfsrv_nfsuserddelport(void) { @@ -3260,7 +3260,7 @@ out: * This function is called from the nfssvc(2) system call, to update the * kernel user/group name list(s) for the V4 owner and ownergroup attributes. */ -APPLESTATIC int +int nfssvc_idname(struct nfsd_idargs *nidp) { struct nfsusrgrp *nusrp, *usrp, *newusrp; @@ -3654,7 +3654,7 @@ nfsrv_removeuser(struct nfsusrgrp *usrp, int isuser) * running, since it doesn't do any locking. * This function is meant to be used when the nfscommon module is unloaded. */ -APPLESTATIC void +void nfsrv_cleanusergroup(void) { struct nfsrv_lughash *hp, *hp2; @@ -3701,7 +3701,7 @@ nfsrv_cleanusergroup(void) * This function scans a byte string and checks for UTF-8 compliance. * It returns 0 if it conforms and NFSERR_INVAL if not. */ -APPLESTATIC int +int nfsrv_checkutf8(u_int8_t *cp, int len) { u_int32_t val = 0x0; @@ -3954,7 +3954,7 @@ nfsrv_refstrbigenough(int siz, u_char **cpp, u_char ** /* * Initialize the reply header data structures. */ -APPLESTATIC void +void nfsrvd_rephead(struct nfsrv_descript *nd) { mbuf_t mreq; @@ -4019,7 +4019,7 @@ newnfs_sndunlock(int *flagp) NFSUNLOCKSOCK(); } -APPLESTATIC int +int nfsv4_getipaddr(struct nfsrv_descript *nd, struct sockaddr_storage *sa, int *isudp) { @@ -4201,7 +4201,7 @@ nfsv4_seqsess_cacherep(uint32_t slotid, struct nfsslot /* * Generate the xdr for an NFSv4.1 Sequence Operation. */ -APPLESTATIC void +void nfsv4_setsequence(struct nfsmount *nmp, struct nfsrv_descript *nd, struct nfsclsession *sep, int dont_replycache) { @@ -4305,7 +4305,7 @@ nfsv4_sequencelookup(struct nfsmount *nmp, struct nfsc /* * Free a session slot. */ -APPLESTATIC void +void nfsv4_freeslot(struct nfsclsession *sep, int slot) { uint64_t bitval; Modified: stable/11/sys/fs/nfs/nfsport.h ============================================================================== --- stable/11/sys/fs/nfs/nfsport.h Tue May 19 01:40:45 2020 (r361235) +++ stable/11/sys/fs/nfs/nfsport.h Tue May 19 01:43:00 2020 (r361236) @@ -101,11 +101,6 @@ #include #include -/* - * For Darwin, these functions should be "static" when built in a kext. - * (This is always defined as nil otherwise.) - */ -#define APPLESTATIC #include #include #include Modified: stable/11/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clcomsubs.c Tue May 19 01:40:45 2020 (r361235) +++ stable/11/sys/fs/nfsclient/nfs_clcomsubs.c Tue May 19 01:43:00 2020 (r361236) @@ -127,7 +127,7 @@ static int nfs_bigrequest[NFSV41_NPROCS] = { * Start building a request. Mostly just put the first file handle in * place. */ -APPLESTATIC void +void nfscl_reqstart(struct nfsrv_descript *nd, int procnum, struct nfsmount *nmp, u_int8_t *nfhp, int fhlen, u_int32_t **opcntpp, struct nfsclsession *sep) { @@ -253,7 +253,7 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, * copies a uio scatter/gather list to an mbuf chain. * NOTE: can ony handle iovcnt == 1 */ -APPLESTATIC void +void nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) { char *uiocp; @@ -336,7 +336,7 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *ui * Load vnode attributes from the xdr file attributes. * Returns EBADRPC if they can't be parsed, 0 otherwise. */ -APPLESTATIC int +int nfsm_loadattr(struct nfsrv_descript *nd, struct nfsvattr *nap) { struct nfs_fattr *fp; @@ -402,7 +402,7 @@ nfsmout: * This function finds the directory cookie that corresponds to the * logical byte offset given. */ -APPLESTATIC nfsuint64 * +nfsuint64 * nfscl_getcookie(struct nfsnode *np, off_t off, int add) { struct nfsdmap *dp, *dp2; @@ -454,7 +454,7 @@ nfscl_getcookie(struct nfsnode *np, off_t off, int add * the file handle and the file's attributes. * For V4, it assumes that Getfh and Getattr Op's results are here. */ -APPLESTATIC int +int nfscl_mtofh(struct nfsrv_descript *nd, struct nfsfh **nfhpp, struct nfsvattr *nap, int *attrflagp) { @@ -515,7 +515,7 @@ nfsmout: /* * Put a state Id in the mbuf list. */ -APPLESTATIC void +void nfsm_stateidtom(struct nfsrv_descript *nd, nfsv4stateid_t *stateidp, int flag) { nfsv4stateid_t *st; @@ -547,7 +547,7 @@ nfsm_stateidtom(struct nfsrv_descript *nd, nfsv4statei /* * Initialize the owner/delegation sleep lock. */ -APPLESTATIC void +void nfscl_lockinit(struct nfsv4lock *lckp) { @@ -559,7 +559,7 @@ nfscl_lockinit(struct nfsv4lock *lckp) * Get an exclusive lock. (Not needed for OpenBSD4, since there is only one * thread for each posix process in the kernel.) */ -APPLESTATIC void +void nfscl_lockexcl(struct nfsv4lock *lckp, void *mutex) { int igotlock; @@ -572,7 +572,7 @@ nfscl_lockexcl(struct nfsv4lock *lckp, void *mutex) /* * Release an exclusive lock. */ -APPLESTATIC void +void nfscl_lockunlock(struct nfsv4lock *lckp) { @@ -582,7 +582,7 @@ nfscl_lockunlock(struct nfsv4lock *lckp) /* * Called to derefernce a lock on a stateid (delegation or open owner). */ -APPLESTATIC void +void nfscl_lockderef(struct nfsv4lock *lckp) { Modified: stable/11/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clport.c Tue May 19 01:40:45 2020 (r361235) +++ stable/11/sys/fs/nfsclient/nfs_clport.c Tue May 19 01:43:00 2020 (r361236) @@ -1196,7 +1196,7 @@ nfscl_checksattr(struct vattr *vap, struct nfsvattr *n * error should only be returned for the Open, Create and Setattr Ops. * As such, most calls can just pass in 0 for those arguments. */ -APPLESTATIC int +int nfscl_maperr(struct thread *td, int error, uid_t uid, gid_t gid) { struct proc *p; Modified: stable/11/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clrpcops.c Tue May 19 01:40:45 2020 (r361235) +++ stable/11/sys/fs/nfsclient/nfs_clrpcops.c Tue May 19 01:43:00 2020 (r361236) @@ -151,7 +151,7 @@ static int nfsrpc_layoutgetres(struct nfsmount *, vnod /* * nfs null call from vfs. */ -APPLESTATIC int +int nfsrpc_null(vnode_t vp, struct ucred *cred, NFSPROC_T *p) { int error; @@ -170,7 +170,7 @@ nfsrpc_null(vnode_t vp, struct ucred *cred, NFSPROC_T * For nfs version 3 and 4, use the access rpc to check accessibility. If file * modes are changed on the server, accesses might still fail later. */ -APPLESTATIC int +int nfsrpc_access(vnode_t vp, int acmode, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp) { @@ -213,7 +213,7 @@ nfsrpc_access(vnode_t vp, int acmode, struct ucred *cr /* * The actual rpc, separated out for Darwin. */ -APPLESTATIC int +int nfsrpc_accessrpc(vnode_t vp, u_int32_t mode, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, u_int32_t *rmodep, void *stuff) @@ -274,7 +274,7 @@ nfsmout: /* * nfs open rpc */ -APPLESTATIC int +int nfsrpc_open(vnode_t vp, int amode, struct ucred *cred, NFSPROC_T *p) { struct nfsclopen *op; @@ -406,7 +406,7 @@ else printf(" fhl=0\n"); /* * the actual open rpc */ -APPLESTATIC int +int nfsrpc_openrpc(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, int fhlen, u_int8_t *newfhp, int newfhlen, u_int32_t mode, struct nfsclopen *op, u_int8_t *name, int namelen, struct nfscldeleg **dpp, @@ -609,7 +609,7 @@ nfsmout: /* * open downgrade rpc */ -APPLESTATIC int +int nfsrpc_opendowngrade(vnode_t vp, u_int32_t mode, struct nfsclopen *op, struct ucred *cred, NFSPROC_T *p) { @@ -652,7 +652,7 @@ nfsmout: /* * V4 Close operation. */ -APPLESTATIC int +int nfsrpc_close(vnode_t vp, int doclose, NFSPROC_T *p) { struct nfsclclient *clp; @@ -674,7 +674,7 @@ nfsrpc_close(vnode_t vp, int doclose, NFSPROC_T *p) /* * Close the open. */ -APPLESTATIC void +void nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p) { struct nfsrv_descript nfsd, *nd = &nfsd; @@ -771,7 +771,7 @@ nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen /* * The actual Close RPC. */ -APPLESTATIC int +int nfsrpc_closerpc(struct nfsrv_descript *nd, struct nfsmount *nmp, struct nfsclopen *op, struct ucred *cred, NFSPROC_T *p, int syscred) @@ -810,7 +810,7 @@ nfsmout: /* * V4 Open Confirm RPC. */ -APPLESTATIC int +int nfsrpc_openconfirm(vnode_t vp, u_int8_t *nfhp, int fhlen, struct nfsclopen *op, struct ucred *cred, NFSPROC_T *p) { @@ -852,7 +852,7 @@ nfsmout: * Do the setclientid and setclientid confirm RPCs. Called from nfs_statfs() * when a mount has just occurred and when the server replies NFSERR_EXPIRED. */ -APPLESTATIC int +int nfsrpc_setclient(struct nfsmount *nmp, struct nfsclclient *clp, int reclaim, struct ucred *cred, NFSPROC_T *p) { @@ -1052,7 +1052,7 @@ nfsmout: /* * nfs getattr call. */ -APPLESTATIC int +int nfsrpc_getattr(vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, void *stuff) { @@ -1079,7 +1079,7 @@ nfsrpc_getattr(vnode_t vp, struct ucred *cred, NFSPROC /* * nfs getattr call with non-vnode arguemnts. */ -APPLESTATIC int +int nfsrpc_getattrnovp(struct nfsmount *nmp, u_int8_t *fhp, int fhlen, int syscred, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, u_int64_t *xidp, uint32_t *leasep) @@ -1119,7 +1119,7 @@ nfsrpc_getattrnovp(struct nfsmount *nmp, u_int8_t *fhp /* * Do an nfs setattr operation. */ -APPLESTATIC int +int nfsrpc_setattr(vnode_t vp, struct vattr *vap, NFSACL_T *aclp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *rnap, int *attrflagp, void *stuff) @@ -1246,7 +1246,7 @@ nfsrpc_setattrrpc(vnode_t vp, struct vattr *vap, /* * nfs lookup rpc */ -APPLESTATIC int +int nfsrpc_lookup(vnode_t dvp, char *name, int len, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nap, struct nfsfh **nfhpp, int *attrflagp, int *dattrflagp, void *stuff) @@ -1349,7 +1349,7 @@ nfsmout: /* * Do a readlink rpc. */ -APPLESTATIC int +int nfsrpc_readlink(vnode_t vp, struct uio *uiop, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { @@ -1405,7 +1405,7 @@ nfsmout: /* * Read operation. */ -APPLESTATIC int +int nfsrpc_read(vnode_t vp, struct uio *uiop, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { @@ -1563,7 +1563,7 @@ nfsmout: * the recovery thread could get stuck waiting for the buffer and recovery * will then deadlock. */ -APPLESTATIC int +int nfsrpc_write(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff, int called_from_strategy) @@ -1825,7 +1825,7 @@ nfsmout: * For NFS v2 this is a kludge. Use a create rpc but with the IFMT bits of the * mode set to specify the file type and the size field for rdev. */ -APPLESTATIC int +int nfsrpc_mknod(vnode_t dvp, char *name, int namelen, struct vattr *vap, u_int32_t rdev, enum vtype vtyp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, @@ -1905,7 +1905,7 @@ nfsmout: * Mostly just call the approriate routine. (I separated out v4, so that * error recovery wouldn't be as difficult.) */ -APPLESTATIC int +int nfsrpc_create(vnode_t dvp, char *name, int namelen, struct vattr *vap, nfsquad_t cverf, int fmode, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, @@ -2272,7 +2272,7 @@ nfsmout: /* * Nfs remove rpc */ -APPLESTATIC int +int nfsrpc_remove(vnode_t dvp, char *name, int namelen, vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, int *dattrflagp, void *dstuff) @@ -2349,7 +2349,7 @@ nfsmout: /* * Do an nfs rename rpc. */ -APPLESTATIC int +int nfsrpc_rename(vnode_t fdvp, vnode_t fvp, char *fnameptr, int fnamelen, vnode_t tdvp, vnode_t tvp, char *tnameptr, int tnamelen, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *fnap, struct nfsvattr *tnap, @@ -2507,7 +2507,7 @@ nfsmout: /* * nfs hard link create rpc */ -APPLESTATIC int +int nfsrpc_link(vnode_t dvp, vnode_t vp, char *name, int namelen, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nap, int *attrflagp, int *dattrflagp, void *dstuff) @@ -2570,7 +2570,7 @@ nfsmout: /* * nfs symbolic link create rpc */ -APPLESTATIC int +int nfsrpc_symlink(vnode_t dvp, char *name, int namelen, char *target, struct vattr *vap, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, int *attrflagp, @@ -2631,7 +2631,7 @@ nfsrpc_symlink(vnode_t dvp, char *name, int namelen, c /* * nfs make dir rpc */ -APPLESTATIC int +int nfsrpc_mkdir(vnode_t dvp, char *name, int namelen, struct vattr *vap, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, int *attrflagp, @@ -2713,7 +2713,7 @@ nfsmout: /* * nfs remove directory call */ -APPLESTATIC int +int nfsrpc_rmdir(vnode_t dvp, char *name, int namelen, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, int *dattrflagp, void *dstuff) { @@ -2769,7 +2769,7 @@ nfsrpc_rmdir(vnode_t dvp, char *name, int namelen, str * and returns the one for the next entry after this directory block in * there, as well. */ -APPLESTATIC int +int nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, int *eofp, void *stuff) @@ -3201,7 +3201,7 @@ nfsmout: * (Also used for NFS V4 when mount flag set.) * (ditto above w.r.t. multiple of DIRBLKSIZ, etc.) */ -APPLESTATIC int +int nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, int *eofp, void *stuff) @@ -3692,7 +3692,7 @@ nfsmout: /* * Nfs commit rpc */ -APPLESTATIC int +int nfsrpc_commit(vnode_t vp, u_quad_t offset, int cnt, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { @@ -3743,7 +3743,7 @@ nfsmout: * NFS byte range lock rpc. * (Mostly just calls one of the three lower level RPC routines.) */ -APPLESTATIC int +int nfsrpc_advlock(vnode_t vp, off_t size, int op, struct flock *fl, int reclaim, struct ucred *cred, NFSPROC_T *p, void *id, int flags) { @@ -3910,7 +3910,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, int op, struct /* * The lower level routine for the LockT case. */ -APPLESTATIC int +int nfsrpc_lockt(struct nfsrv_descript *nd, vnode_t vp, struct nfsclclient *clp, u_int64_t off, u_int64_t len, struct flock *fl, struct ucred *cred, NFSPROC_T *p, void *id, int flags) @@ -4035,7 +4035,7 @@ nfsmout: /* * The actual Lock RPC. */ -APPLESTATIC int +int nfsrpc_lock(struct nfsrv_descript *nd, struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, int fhlen, struct nfscllockowner *lp, int newone, int reclaim, u_int64_t off, u_int64_t len, short type, struct ucred *cred, @@ -4124,7 +4124,7 @@ nfsmout: * nfs statfs rpc * (always called with the vp for the mount point) */ -APPLESTATIC int +int nfsrpc_statfs(vnode_t vp, struct nfsstatfs *sbp, struct nfsfsinfo *fsp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) @@ -4203,7 +4203,7 @@ nfsmout: /* * nfs pathconf rpc */ -APPLESTATIC int +int nfsrpc_pathconf(vnode_t vp, struct nfsv3_pathconf *pc, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) @@ -4264,7 +4264,7 @@ nfsmout: /* * nfs version 3 fsinfo rpc call */ -APPLESTATIC int +int nfsrpc_fsinfo(vnode_t vp, struct nfsfsinfo *fsp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { @@ -4303,7 +4303,7 @@ nfsmout: /* * This function performs the Renew RPC. */ -APPLESTATIC int +int nfsrpc_renew(struct nfsclclient *clp, struct nfsclds *dsp, struct ucred *cred, NFSPROC_T *p) { @@ -4353,7 +4353,7 @@ nfsrpc_renew(struct nfsclclient *clp, struct nfsclds * /* * This function performs the Releaselockowner RPC. */ -APPLESTATIC int +int nfsrpc_rellockown(struct nfsmount *nmp, struct nfscllockowner *lp, uint8_t *fh, int fhlen, struct ucred *cred, NFSPROC_T *p) { @@ -4392,7 +4392,7 @@ nfsrpc_rellockown(struct nfsmount *nmp, struct nfscllo /* * This function performs the Compound to get the mount pt FH. */ -APPLESTATIC int +int nfsrpc_getdirpath(struct nfsmount *nmp, u_char *dirpath, struct ucred *cred, NFSPROC_T *p) { @@ -4460,7 +4460,7 @@ nfsmout: /* * This function performs the Delegreturn RPC. */ -APPLESTATIC int +int nfsrpc_delegreturn(struct nfscldeleg *dp, struct ucred *cred, struct nfsmount *nmp, NFSPROC_T *p, int syscred) { @@ -4493,7 +4493,7 @@ nfsrpc_delegreturn(struct nfscldeleg *dp, struct ucred /* * nfs getacl call. */ -APPLESTATIC int +int nfsrpc_getacl(vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct acl *aclp, void *stuff) { @@ -4523,7 +4523,7 @@ nfsrpc_getacl(vnode_t vp, struct ucred *cred, NFSPROC_ /* * nfs setacl call. */ -APPLESTATIC int +int nfsrpc_setacl(vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct acl *aclp, void *stuff) { Modified: stable/11/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clstate.c Tue May 19 01:40:45 2020 (r361235) +++ stable/11/sys/fs/nfsclient/nfs_clstate.c Tue May 19 01:43:00 2020 (r361236) @@ -206,7 +206,7 @@ static short *nfscl_cberrmap[] = { * Called for an open operation. * If the nfhp argument is NULL, just get an openowner. */ -APPLESTATIC int +int nfscl_open(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t amode, int usedeleg, struct ucred *cred, NFSPROC_T *p, struct nfsclowner **owpp, struct nfsclopen **opp, int *newonep, int *retp, int lockit) @@ -422,7 +422,7 @@ nfscl_newopen(struct nfsclclient *clp, struct nfscldel /* * Called to find/add a delegation to a client. */ -APPLESTATIC int +int nfscl_deleg(mount_t mp, struct nfsclclient *clp, u_int8_t *nfhp, int fhlen, struct ucred *cred, NFSPROC_T *p, struct nfscldeleg **dpp) { @@ -493,7 +493,7 @@ nfscl_finddeleg(struct nfsclclient *clp, u_int8_t *fhp * found, return either a lockowner stateid or the open stateid. * If no Open is found, just return error and the special stateid of all zeros. */ -APPLESTATIC int +int nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode, int fords, struct ucred *cred, NFSPROC_T *p, nfsv4stateid_t *stateidp, void **lckpp) @@ -717,7 +717,7 @@ nfscl_getopen(struct nfsclownerhead *ohp, u_int8_t *nf * Release use of an open owner. Called when open operations are done * with the open owner. */ -APPLESTATIC void +void nfscl_ownerrelease(struct nfsmount *nmp, struct nfsclowner *owp, __unused int error, __unused int candelete, int unlocked) { @@ -738,7 +738,7 @@ nfscl_ownerrelease(struct nfsmount *nmp, struct nfsclo /* * Release use of an open structure under an open owner. */ -APPLESTATIC void +void nfscl_openrelease(struct nfsmount *nmp, struct nfsclopen *op, int error, int candelete) { @@ -772,7 +772,7 @@ nfscl_openrelease(struct nfsmount *nmp, struct nfsclop * thread if this creates a new clp. * It always clpp with a reference count on it, unless returning an error. */ -APPLESTATIC int +int nfscl_getcl(struct mount *mp, struct ucred *cred, NFSPROC_T *p, int start_renewthread, struct nfsclclient **clpp) { @@ -935,7 +935,7 @@ nfscl_getcl(struct mount *mp, struct ucred *cred, NFSP /* * Get a reference to a clientid and return it, if valid. */ -APPLESTATIC struct nfsclclient * +struct nfsclclient * nfscl_findcl(struct nfsmount *nmp) { struct nfsclclient *clp; @@ -962,7 +962,7 @@ nfscl_clrelease(struct nfsclclient *clp) /* * External call for nfscl_clrelease. */ -APPLESTATIC void +void nfscl_clientrelease(struct nfsclclient *clp) { @@ -977,7 +977,7 @@ nfscl_clientrelease(struct nfsclclient *clp) /* * Called when wanting to lock a byte region. */ -APPLESTATIC int +int nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t len, short type, struct ucred *cred, NFSPROC_T *p, struct nfsclclient *rclp, int recovery, void *id, int flags, u_int8_t *rownp, u_int8_t *ropenownp, @@ -1177,7 +1177,7 @@ nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t /* * Called to unlock a byte range, for LockU. */ -APPLESTATIC int +int nfscl_relbytelock(vnode_t vp, u_int64_t off, u_int64_t len, __unused struct ucred *cred, NFSPROC_T *p, int callcnt, struct nfsclclient *clp, void *id, int flags, @@ -1289,7 +1289,7 @@ nfscl_relbytelock(vnode_t vp, u_int64_t off, u_int64_t /* * Release all lockowners marked in progess for this process and file. */ -APPLESTATIC void +void nfscl_releasealllocks(struct nfsclclient *clp, vnode_t vp, NFSPROC_T *p, void *id, int flags) { @@ -1327,7 +1327,7 @@ nfscl_releasealllocks(struct nfsclclient *clp, vnode_t * is required before a LockU. * If in doubt, return 1, so the flush will occur. */ -APPLESTATIC int +int nfscl_checkwritelocked(vnode_t vp, struct flock *fl, struct ucred *cred, NFSPROC_T *p, void *id, int flags) { @@ -1433,7 +1433,7 @@ nfscl_checkwritelocked(vnode_t vp, struct flock *fl, /* * Release a byte range lock owner structure. */ -APPLESTATIC void +void nfscl_lockrelease(struct nfscllockowner *lp, int error, int candelete) { struct nfsclclient *clp; @@ -1454,7 +1454,7 @@ nfscl_lockrelease(struct nfscllockowner *lp, int error /* * Free up an open structure and any associated byte range lock structures. */ -APPLESTATIC void +void nfscl_freeopen(struct nfsclopen *op, int local) { @@ -1551,7 +1551,7 @@ nfscl_freeopenowner(struct nfsclowner *owp, int local) /* * Free up a byte range lock owner structure. */ -APPLESTATIC void +void nfscl_freelockowner(struct nfscllockowner *lp, int local) { struct nfscllock *lop, *nlop; @@ -1570,7 +1570,7 @@ nfscl_freelockowner(struct nfscllockowner *lp, int loc /* * Free up a byte range lock structure. */ -APPLESTATIC void +void nfscl_freelock(struct nfscllock *lop, int local) { @@ -1871,7 +1871,7 @@ static int fake_global; /* Used to force visibility of /* * Called from nfs umount to free up the clientid. */ -APPLESTATIC void +void nfscl_umount(struct nfsmount *nmp, NFSPROC_T *p) { struct nfsclclient *clp; @@ -2281,7 +2281,7 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *c * XXX Someday it should post a signal to the process(es) that hold the *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 19 01:43: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 47F762F440B; Tue, 19 May 2020 01:43:04 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QzD81WsXz3SDB; Tue, 19 May 2020 01:43:04 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DB142AE49; Tue, 19 May 2020 01:43:04 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J1h4PI070570; Tue, 19 May 2020 01:43:04 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J1h207070562; Tue, 19 May 2020 01:43:02 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005190143.04J1h207070562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Tue, 19 May 2020 01:43:02 +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: r361236 - in stable: 11/sys/fs/nfs 11/sys/fs/nfsclient 11/sys/fs/nfsserver 12/sys/fs/nfs 12/sys/fs/nfsclient 12/sys/fs/nfsserver X-SVN-Group: stable-12 X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in stable: 11/sys/fs/nfs 11/sys/fs/nfsclient 11/sys/fs/nfsserver 12/sys/fs/nfs 12/sys/fs/nfsclient 12/sys/fs/nfsserver X-SVN-Commit-Revision: 361236 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, 19 May 2020 01:43:04 -0000 Author: freqlabs Date: Tue May 19 01:43:00 2020 New Revision: 361236 URL: https://svnweb.freebsd.org/changeset/base/361236 Log: MFC r360960: nfs: Remove APPLESTATIC macro It is no longer useful. Reviewed by: rmacklem Approved by: mav (mentor) Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D24811 Modified: stable/12/sys/fs/nfs/nfs_commonacl.c stable/12/sys/fs/nfs/nfs_commonsubs.c stable/12/sys/fs/nfs/nfsport.h stable/12/sys/fs/nfsclient/nfs_clcomsubs.c stable/12/sys/fs/nfsclient/nfs_clport.c stable/12/sys/fs/nfsclient/nfs_clrpcops.c stable/12/sys/fs/nfsclient/nfs_clstate.c stable/12/sys/fs/nfsserver/nfs_nfsdcache.c stable/12/sys/fs/nfsserver/nfs_nfsdserv.c stable/12/sys/fs/nfsserver/nfs_nfsdsocket.c stable/12/sys/fs/nfsserver/nfs_nfsdstate.c stable/12/sys/fs/nfsserver/nfs_nfsdsubs.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/fs/nfs/nfs_commonacl.c stable/11/sys/fs/nfs/nfs_commonsubs.c stable/11/sys/fs/nfs/nfsport.h stable/11/sys/fs/nfsclient/nfs_clcomsubs.c stable/11/sys/fs/nfsclient/nfs_clport.c stable/11/sys/fs/nfsclient/nfs_clrpcops.c stable/11/sys/fs/nfsclient/nfs_clstate.c stable/11/sys/fs/nfsserver/nfs_nfsdcache.c stable/11/sys/fs/nfsserver/nfs_nfsdserv.c stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c stable/11/sys/fs/nfsserver/nfs_nfsdstate.c stable/11/sys/fs/nfsserver/nfs_nfsdsubs.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- stable/12/sys/fs/nfs/nfs_commonacl.c Tue May 19 01:40:45 2020 (r361235) +++ stable/12/sys/fs/nfs/nfs_commonacl.c Tue May 19 01:43:00 2020 (r361236) @@ -40,7 +40,7 @@ static int nfsrv_acemasktoperm(u_int32_t acetype, u_in /* * Handle xdr for an ace. */ -APPLESTATIC int +int nfsrv_dissectace(struct nfsrv_descript *nd, struct acl_entry *acep, int *aceerrp, int *acesizep, NFSPROC_T *p) { @@ -388,7 +388,7 @@ nfsrv_buildace(struct nfsrv_descript *nd, u_char *name /* * Build an NFSv4 ACL. */ -APPLESTATIC int +int nfsrv_buildacl(struct nfsrv_descript *nd, NFSACL_T *aclp, enum vtype type, NFSPROC_T *p) { @@ -451,7 +451,7 @@ nfsrv_buildacl(struct nfsrv_descript *nd, NFSACL_T *ac * Compare two NFSv4 acls. * Return 0 if they are the same, 1 if not the same. */ -APPLESTATIC int +int nfsrv_compareacl(NFSACL_T *aclp1, NFSACL_T *aclp2) { int i; Modified: stable/12/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/12/sys/fs/nfs/nfs_commonsubs.c Tue May 19 01:40:45 2020 (r361235) +++ stable/12/sys/fs/nfs/nfs_commonsubs.c Tue May 19 01:43:00 2020 (r361236) @@ -282,7 +282,7 @@ static int nfs_bigrequest[NFSV41_NPROCS] = { * Start building a request. Mostly just put the first file handle in * place. */ -APPLESTATIC void +void nfscl_reqstart(struct nfsrv_descript *nd, int procnum, struct nfsmount *nmp, u_int8_t *nfhp, int fhlen, u_int32_t **opcntpp, struct nfsclsession *sep, int vers, int minorvers) @@ -415,7 +415,7 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, /* * Put a state Id in the mbuf list. */ -APPLESTATIC void +void nfsm_stateidtom(struct nfsrv_descript *nd, nfsv4stateid_t *stateidp, int flag) { nfsv4stateid_t *st; @@ -651,7 +651,7 @@ out: * This is used by the macro NFSM_DISSECT for tough * cases. */ -APPLESTATIC void * +void * nfsm_dissct(struct nfsrv_descript *nd, int siz, int how) { mbuf_t mp2; @@ -717,7 +717,7 @@ nfsm_dissct(struct nfsrv_descript *nd, int siz, int ho * here than check for offs > 0 for all calls to nfsm_advance. * If left == -1, it should be calculated here. */ -APPLESTATIC int +int nfsm_advance(struct nfsrv_descript *nd, int offs, int left) { int error = 0; @@ -765,7 +765,7 @@ out: * Copy a string into mbuf(s). * Return the number of bytes output, including XDR overheads. */ -APPLESTATIC int +int nfsm_strtom(struct nfsrv_descript *nd, const char *cp, int siz) { mbuf_t m2; @@ -822,7 +822,7 @@ nfsm_strtom(struct nfsrv_descript *nd, const char *cp, /* * Called once to initialize data structures... */ -APPLESTATIC void +void newnfs_init(void) { static int nfs_inited = 0; @@ -852,7 +852,7 @@ newnfs_init(void) * set_true == 1 if there should be an newnfs_true prepended on the file handle. * Return the number of bytes output, including XDR overhead. */ -APPLESTATIC int +int nfsm_fhtom(struct nfsrv_descript *nd, u_int8_t *fhp, int size, int set_true) { u_int32_t *tl; @@ -895,7 +895,7 @@ nfsm_fhtom(struct nfsrv_descript *nd, u_int8_t *fhp, i * The AF_INET family is handled as a special case so that address mbufs * don't need to be saved to store "struct in_addr", which is only 4 bytes. */ -APPLESTATIC int +int nfsaddr_match(int family, union nethostaddr *haddr, NFSSOCKADDR_T nam) { struct sockaddr_in *inetaddr; @@ -928,7 +928,7 @@ nfsaddr_match(int family, union nethostaddr *haddr, NF /* * Similar to the above, but takes to NFSSOCKADDR_T args. */ -APPLESTATIC int +int nfsaddr2_match(NFSSOCKADDR_T nam1, NFSSOCKADDR_T nam2) { struct sockaddr_in *addr1, *addr2; @@ -966,7 +966,7 @@ nfsaddr2_match(NFSSOCKADDR_T nam1, NFSSOCKADDR_T nam2) /* * Trim the stuff already dissected off the mbuf list. */ -APPLESTATIC void +void newnfs_trimleading(nd) struct nfsrv_descript *nd; { @@ -1012,7 +1012,7 @@ newnfs_trimleading(nd) /* * Trim trailing data off the mbuf list being built. */ -APPLESTATIC void +void newnfs_trimtrailing(nd, mb, bpos) struct nfsrv_descript *nd; mbuf_t mb; @@ -1031,7 +1031,7 @@ newnfs_trimtrailing(nd, mb, bpos) /* * Dissect a file handle on the client. */ -APPLESTATIC int +int nfsm_getfh(struct nfsrv_descript *nd, struct nfsfh **nfhpp) { u_int32_t *tl; @@ -1066,7 +1066,7 @@ nfsmout: * Break down the nfsv4 acl. * If the aclp == NULL or won't fit in an acl, just discard the acl info. */ -APPLESTATIC int +int nfsrv_dissectacl(struct nfsrv_descript *nd, NFSACL_T *aclp, int *aclerrp, int *aclsizep, __unused NFSPROC_T *p) { @@ -1132,7 +1132,7 @@ nfsmout: * Returns EBADRPC for a parsing error, 0 otherwise. * If the clearinvalid flag is set, clear the bits not supported. */ -APPLESTATIC int +int nfsrv_getattrbits(struct nfsrv_descript *nd, nfsattrbit_t *attrbitp, int *cntp, int *retnotsupp) { @@ -1178,7 +1178,7 @@ nfsmout: * and 0 otherwise. * Returns EBADRPC if it can't be parsed, 0 otherwise. */ -APPLESTATIC int +int nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, struct nfsvattr *nap, struct nfsfh **nfhpp, fhandle_t *fhp, int fhsize, struct nfsv3_pathconf *pc, struct statfs *sbp, struct nfsstatfs *sfp, @@ -2222,7 +2222,7 @@ nfsmout: * and the mp argument indicates to check for a forced dismount, iff not * NULL. */ -APPLESTATIC int +int nfsv4_lock(struct nfsv4lock *lp, int iwantlock, int *isleptp, void *mutex, struct mount *mp) { @@ -2269,7 +2269,7 @@ nfsv4_lock(struct nfsv4lock *lp, int iwantlock, int *i * The second argument is set to 1 to indicate the nfslock_usecnt should be * incremented, as well. */ -APPLESTATIC void +void nfsv4_unlock(struct nfsv4lock *lp, int incref) { @@ -2282,7 +2282,7 @@ nfsv4_unlock(struct nfsv4lock *lp, int incref) /* * Release a reference cnt. */ -APPLESTATIC void +void nfsv4_relref(struct nfsv4lock *lp) { @@ -2302,7 +2302,7 @@ nfsv4_relref(struct nfsv4lock *lp) * If the mp argument is not NULL, check for NFSCL_FORCEDISM() being set and * return without getting a refcnt for that case. */ -APPLESTATIC void +void nfsv4_getref(struct nfsv4lock *lp, int *isleptp, void *mutex, struct mount *mp) { @@ -2332,7 +2332,7 @@ nfsv4_getref(struct nfsv4lock *lp, int *isleptp, void * Get a reference as above, but return failure instead of sleeping if * an exclusive lock is held. */ -APPLESTATIC int +int nfsv4_getref_nonblock(struct nfsv4lock *lp) { @@ -2346,7 +2346,7 @@ nfsv4_getref_nonblock(struct nfsv4lock *lp) /* * Test for a lock. Return 1 if locked, 0 otherwise. */ -APPLESTATIC int +int nfsv4_testlock(struct nfsv4lock *lp) { @@ -2374,7 +2374,7 @@ nfsv4_wanted(struct nfsv4lock *lp) * Return EBADRPC if there is an mbuf error, * 0 otherwise. */ -APPLESTATIC int +int nfsrv_mtostr(struct nfsrv_descript *nd, char *str, int siz) { char *cp; @@ -2425,7 +2425,7 @@ out: /* * Fill in the attributes as marked by the bitmap (V4). */ -APPLESTATIC int +int nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, NFSACL_T *saclp, struct vattr *vap, fhandle_t *fhp, int rderror, nfsattrbit_t *attrbitp, struct ucred *cred, NFSPROC_T *p, int isdgram, @@ -2983,7 +2983,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount * Put the attribute bits onto an mbuf list. * Return the number of bytes of output generated. */ -APPLESTATIC int +int nfsrv_putattrbit(struct nfsrv_descript *nd, nfsattrbit_t *attrbitp) { u_int32_t *tl; @@ -3008,7 +3008,7 @@ nfsrv_putattrbit(struct nfsrv_descript *nd, nfsattrbit * (malloc a larger one, as required) * retlenp - pointer to length to be returned */ -APPLESTATIC void +void nfsv4_uidtostr(uid_t uid, u_char **cpp, int *retlenp, NFSPROC_T *p) { int i; @@ -3167,7 +3167,7 @@ tryagain: * string is made up entirely of digits, just convert the string to * a number. */ -APPLESTATIC int +int nfsv4_strtouid(struct nfsrv_descript *nd, u_char *str, int len, uid_t *uidp, NFSPROC_T *p) { @@ -3270,7 +3270,7 @@ out: * (malloc a larger one, as required) * retlenp - pointer to length to be returned */ -APPLESTATIC void +void nfsv4_gidtostr(gid_t gid, u_char **cpp, int *retlenp, NFSPROC_T *p) { int i; @@ -3383,7 +3383,7 @@ tryagain: * string is made up entirely of digits, just convert the string to * a number. */ -APPLESTATIC int +int nfsv4_strtogid(struct nfsrv_descript *nd, u_char *str, int len, gid_t *gidp, NFSPROC_T *p) { @@ -3509,7 +3509,7 @@ nfsrv_cmpmixedcase(u_char *cp, u_char *cp2, int len) /* * Set the port for the nfsuserd. */ -APPLESTATIC int +int nfsrv_nfsuserdport(struct nfsuserd_args *nargs, NFSPROC_T *p) { struct nfssockreq *rp; @@ -3592,7 +3592,7 @@ out: /* * Delete the nfsuserd port. */ -APPLESTATIC void +void nfsrv_nfsuserddelport(void) { @@ -3679,7 +3679,7 @@ out: * This function is called from the nfssvc(2) system call, to update the * kernel user/group name list(s) for the V4 owner and ownergroup attributes. */ -APPLESTATIC int +int nfssvc_idname(struct nfsd_idargs *nidp) { struct nfsusrgrp *nusrp, *usrp, *newusrp; @@ -4073,7 +4073,7 @@ nfsrv_removeuser(struct nfsusrgrp *usrp, int isuser) * running, since it doesn't do any locking. * This function is meant to be used when the nfscommon module is unloaded. */ -APPLESTATIC void +void nfsrv_cleanusergroup(void) { struct nfsrv_lughash *hp, *hp2; @@ -4120,7 +4120,7 @@ nfsrv_cleanusergroup(void) * This function scans a byte string and checks for UTF-8 compliance. * It returns 0 if it conforms and NFSERR_INVAL if not. */ -APPLESTATIC int +int nfsrv_checkutf8(u_int8_t *cp, int len) { u_int32_t val = 0x0; @@ -4373,7 +4373,7 @@ nfsrv_refstrbigenough(int siz, u_char **cpp, u_char ** /* * Initialize the reply header data structures. */ -APPLESTATIC void +void nfsrvd_rephead(struct nfsrv_descript *nd) { mbuf_t mreq; @@ -4438,7 +4438,7 @@ newnfs_sndunlock(int *flagp) NFSUNLOCKSOCK(); } -APPLESTATIC int +int nfsv4_getipaddr(struct nfsrv_descript *nd, struct sockaddr_in *sin, struct sockaddr_in6 *sin6, sa_family_t *saf, int *isudp) { @@ -4619,7 +4619,7 @@ nfsv4_seqsess_cacherep(uint32_t slotid, struct nfsslot /* * Generate the xdr for an NFSv4.1 Sequence Operation. */ -APPLESTATIC void +void nfsv4_setsequence(struct nfsmount *nmp, struct nfsrv_descript *nd, struct nfsclsession *sep, int dont_replycache) { @@ -4725,7 +4725,7 @@ nfsv4_sequencelookup(struct nfsmount *nmp, struct nfsc /* * Free a session slot. */ -APPLESTATIC void +void nfsv4_freeslot(struct nfsclsession *sep, int slot) { uint64_t bitval; Modified: stable/12/sys/fs/nfs/nfsport.h ============================================================================== --- stable/12/sys/fs/nfs/nfsport.h Tue May 19 01:40:45 2020 (r361235) +++ stable/12/sys/fs/nfs/nfsport.h Tue May 19 01:43:00 2020 (r361236) @@ -103,11 +103,6 @@ #include #include -/* - * For Darwin, these functions should be "static" when built in a kext. - * (This is always defined as nil otherwise.) - */ -#define APPLESTATIC #include #include #include Modified: stable/12/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clcomsubs.c Tue May 19 01:40:45 2020 (r361235) +++ stable/12/sys/fs/nfsclient/nfs_clcomsubs.c Tue May 19 01:43:00 2020 (r361236) @@ -55,7 +55,7 @@ static nfsuint64 nfs_nullcookie = {{ 0, 0 }}; * copies a uio scatter/gather list to an mbuf chain. * NOTE: can ony handle iovcnt == 1 */ -APPLESTATIC void +void nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) { char *uiocp; @@ -207,7 +207,7 @@ nfsm_uiombuflist(struct uio *uiop, int siz, struct mbu * Load vnode attributes from the xdr file attributes. * Returns EBADRPC if they can't be parsed, 0 otherwise. */ -APPLESTATIC int +int nfsm_loadattr(struct nfsrv_descript *nd, struct nfsvattr *nap) { struct nfs_fattr *fp; @@ -274,7 +274,7 @@ nfsmout: * This function finds the directory cookie that corresponds to the * logical byte offset given. */ -APPLESTATIC nfsuint64 * +nfsuint64 * nfscl_getcookie(struct nfsnode *np, off_t off, int add) { struct nfsdmap *dp, *dp2; @@ -326,7 +326,7 @@ nfscl_getcookie(struct nfsnode *np, off_t off, int add * the file handle and the file's attributes. * For V4, it assumes that Getfh and Getattr Op's results are here. */ -APPLESTATIC int +int nfscl_mtofh(struct nfsrv_descript *nd, struct nfsfh **nfhpp, struct nfsvattr *nap, int *attrflagp) { @@ -387,7 +387,7 @@ nfsmout: /* * Initialize the owner/delegation sleep lock. */ -APPLESTATIC void +void nfscl_lockinit(struct nfsv4lock *lckp) { @@ -399,7 +399,7 @@ nfscl_lockinit(struct nfsv4lock *lckp) * Get an exclusive lock. (Not needed for OpenBSD4, since there is only one * thread for each posix process in the kernel.) */ -APPLESTATIC void +void nfscl_lockexcl(struct nfsv4lock *lckp, void *mutex) { int igotlock; @@ -412,7 +412,7 @@ nfscl_lockexcl(struct nfsv4lock *lckp, void *mutex) /* * Release an exclusive lock. */ -APPLESTATIC void +void nfscl_lockunlock(struct nfsv4lock *lckp) { @@ -422,7 +422,7 @@ nfscl_lockunlock(struct nfsv4lock *lckp) /* * Called to derefernce a lock on a stateid (delegation or open owner). */ -APPLESTATIC void +void nfscl_lockderef(struct nfsv4lock *lckp) { Modified: stable/12/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clport.c Tue May 19 01:40:45 2020 (r361235) +++ stable/12/sys/fs/nfsclient/nfs_clport.c Tue May 19 01:43:00 2020 (r361236) @@ -1108,7 +1108,7 @@ nfscl_checksattr(struct vattr *vap, struct nfsvattr *n * error should only be returned for the Open, Create and Setattr Ops. * As such, most calls can just pass in 0 for those arguments. */ -APPLESTATIC int +int nfscl_maperr(struct thread *td, int error, uid_t uid, gid_t gid) { struct proc *p; Modified: stable/12/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clrpcops.c Tue May 19 01:40:45 2020 (r361235) +++ stable/12/sys/fs/nfsclient/nfs_clrpcops.c Tue May 19 01:43:00 2020 (r361236) @@ -204,7 +204,7 @@ int nfs_pnfsio(task_fn_t *, void *); /* * nfs null call from vfs. */ -APPLESTATIC int +int nfsrpc_null(vnode_t vp, struct ucred *cred, NFSPROC_T *p) { int error; @@ -223,7 +223,7 @@ nfsrpc_null(vnode_t vp, struct ucred *cred, NFSPROC_T * For nfs version 3 and 4, use the access rpc to check accessibility. If file * modes are changed on the server, accesses might still fail later. */ -APPLESTATIC int +int nfsrpc_access(vnode_t vp, int acmode, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp) { @@ -266,7 +266,7 @@ nfsrpc_access(vnode_t vp, int acmode, struct ucred *cr /* * The actual rpc, separated out for Darwin. */ -APPLESTATIC int +int nfsrpc_accessrpc(vnode_t vp, u_int32_t mode, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, u_int32_t *rmodep, void *stuff) @@ -327,7 +327,7 @@ nfsmout: /* * nfs open rpc */ -APPLESTATIC int +int nfsrpc_open(vnode_t vp, int amode, struct ucred *cred, NFSPROC_T *p) { struct nfsclopen *op; @@ -459,7 +459,7 @@ else printf(" fhl=0\n"); /* * the actual open rpc */ -APPLESTATIC int +int nfsrpc_openrpc(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, int fhlen, u_int8_t *newfhp, int newfhlen, u_int32_t mode, struct nfsclopen *op, u_int8_t *name, int namelen, struct nfscldeleg **dpp, @@ -662,7 +662,7 @@ nfsmout: /* * open downgrade rpc */ -APPLESTATIC int +int nfsrpc_opendowngrade(vnode_t vp, u_int32_t mode, struct nfsclopen *op, struct ucred *cred, NFSPROC_T *p) { @@ -705,7 +705,7 @@ nfsmout: /* * V4 Close operation. */ -APPLESTATIC int +int nfsrpc_close(vnode_t vp, int doclose, NFSPROC_T *p) { struct nfsclclient *clp; @@ -727,7 +727,7 @@ nfsrpc_close(vnode_t vp, int doclose, NFSPROC_T *p) /* * Close the open. */ -APPLESTATIC void +void nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p) { struct nfsrv_descript nfsd, *nd = &nfsd; @@ -824,7 +824,7 @@ nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen /* * The actual Close RPC. */ -APPLESTATIC int +int nfsrpc_closerpc(struct nfsrv_descript *nd, struct nfsmount *nmp, struct nfsclopen *op, struct ucred *cred, NFSPROC_T *p, int syscred) @@ -863,7 +863,7 @@ nfsmout: /* * V4 Open Confirm RPC. */ -APPLESTATIC int +int nfsrpc_openconfirm(vnode_t vp, u_int8_t *nfhp, int fhlen, struct nfsclopen *op, struct ucred *cred, NFSPROC_T *p) { @@ -906,7 +906,7 @@ nfsmout: * Do the setclientid and setclientid confirm RPCs. Called from nfs_statfs() * when a mount has just occurred and when the server replies NFSERR_EXPIRED. */ -APPLESTATIC int +int nfsrpc_setclient(struct nfsmount *nmp, struct nfsclclient *clp, int reclaim, struct ucred *cred, NFSPROC_T *p) { @@ -1106,7 +1106,7 @@ nfsmout: /* * nfs getattr call. */ -APPLESTATIC int +int nfsrpc_getattr(vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, void *stuff) { @@ -1133,7 +1133,7 @@ nfsrpc_getattr(vnode_t vp, struct ucred *cred, NFSPROC /* * nfs getattr call with non-vnode arguemnts. */ -APPLESTATIC int +int nfsrpc_getattrnovp(struct nfsmount *nmp, u_int8_t *fhp, int fhlen, int syscred, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, u_int64_t *xidp, uint32_t *leasep) @@ -1173,7 +1173,7 @@ nfsrpc_getattrnovp(struct nfsmount *nmp, u_int8_t *fhp /* * Do an nfs setattr operation. */ -APPLESTATIC int +int nfsrpc_setattr(vnode_t vp, struct vattr *vap, NFSACL_T *aclp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *rnap, int *attrflagp, void *stuff) @@ -1300,7 +1300,7 @@ nfsrpc_setattrrpc(vnode_t vp, struct vattr *vap, /* * nfs lookup rpc */ -APPLESTATIC int +int nfsrpc_lookup(vnode_t dvp, char *name, int len, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nap, struct nfsfh **nfhpp, int *attrflagp, int *dattrflagp, void *stuff) @@ -1403,7 +1403,7 @@ nfsmout: /* * Do a readlink rpc. */ -APPLESTATIC int +int nfsrpc_readlink(vnode_t vp, struct uio *uiop, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { @@ -1459,7 +1459,7 @@ nfsmout: /* * Read operation. */ -APPLESTATIC int +int nfsrpc_read(vnode_t vp, struct uio *uiop, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { @@ -1617,7 +1617,7 @@ nfsmout: * the recovery thread could get stuck waiting for the buffer and recovery * will then deadlock. */ -APPLESTATIC int +int nfsrpc_write(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff, int called_from_strategy) @@ -1879,7 +1879,7 @@ nfsmout: * For NFS v2 this is a kludge. Use a create rpc but with the IFMT bits of the * mode set to specify the file type and the size field for rdev. */ -APPLESTATIC int +int nfsrpc_mknod(vnode_t dvp, char *name, int namelen, struct vattr *vap, u_int32_t rdev, enum vtype vtyp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, @@ -1959,7 +1959,7 @@ nfsmout: * Mostly just call the approriate routine. (I separated out v4, so that * error recovery wouldn't be as difficult.) */ -APPLESTATIC int +int nfsrpc_create(vnode_t dvp, char *name, int namelen, struct vattr *vap, nfsquad_t cverf, int fmode, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, @@ -2326,7 +2326,7 @@ nfsmout: /* * Nfs remove rpc */ -APPLESTATIC int +int nfsrpc_remove(vnode_t dvp, char *name, int namelen, vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, int *dattrflagp, void *dstuff) @@ -2403,7 +2403,7 @@ nfsmout: /* * Do an nfs rename rpc. */ -APPLESTATIC int +int nfsrpc_rename(vnode_t fdvp, vnode_t fvp, char *fnameptr, int fnamelen, vnode_t tdvp, vnode_t tvp, char *tnameptr, int tnamelen, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *fnap, struct nfsvattr *tnap, @@ -2561,7 +2561,7 @@ nfsmout: /* * nfs hard link create rpc */ -APPLESTATIC int +int nfsrpc_link(vnode_t dvp, vnode_t vp, char *name, int namelen, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nap, int *attrflagp, int *dattrflagp, void *dstuff) @@ -2624,7 +2624,7 @@ nfsmout: /* * nfs symbolic link create rpc */ -APPLESTATIC int +int nfsrpc_symlink(vnode_t dvp, char *name, int namelen, char *target, struct vattr *vap, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, int *attrflagp, @@ -2685,7 +2685,7 @@ nfsrpc_symlink(vnode_t dvp, char *name, int namelen, c /* * nfs make dir rpc */ -APPLESTATIC int +int nfsrpc_mkdir(vnode_t dvp, char *name, int namelen, struct vattr *vap, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, int *attrflagp, @@ -2767,7 +2767,7 @@ nfsmout: /* * nfs remove directory call */ -APPLESTATIC int +int nfsrpc_rmdir(vnode_t dvp, char *name, int namelen, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, int *dattrflagp, void *dstuff) { @@ -2823,7 +2823,7 @@ nfsrpc_rmdir(vnode_t dvp, char *name, int namelen, str * and returns the one for the next entry after this directory block in * there, as well. */ -APPLESTATIC int +int nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, int *eofp, void *stuff) @@ -3262,7 +3262,7 @@ nfsmout: * (Also used for NFS V4 when mount flag set.) * (ditto above w.r.t. multiple of DIRBLKSIZ, etc.) */ -APPLESTATIC int +int nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, int *eofp, void *stuff) @@ -3763,7 +3763,7 @@ nfsmout: /* * Nfs commit rpc */ -APPLESTATIC int +int nfsrpc_commit(vnode_t vp, u_quad_t offset, int cnt, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { @@ -3814,7 +3814,7 @@ nfsmout: * NFS byte range lock rpc. * (Mostly just calls one of the three lower level RPC routines.) */ -APPLESTATIC int +int nfsrpc_advlock(vnode_t vp, off_t size, int op, struct flock *fl, int reclaim, struct ucred *cred, NFSPROC_T *p, void *id, int flags) { @@ -3981,7 +3981,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, int op, struct /* * The lower level routine for the LockT case. */ -APPLESTATIC int +int nfsrpc_lockt(struct nfsrv_descript *nd, vnode_t vp, struct nfsclclient *clp, u_int64_t off, u_int64_t len, struct flock *fl, struct ucred *cred, NFSPROC_T *p, void *id, int flags) @@ -4106,7 +4106,7 @@ nfsmout: /* * The actual Lock RPC. */ -APPLESTATIC int +int nfsrpc_lock(struct nfsrv_descript *nd, struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, int fhlen, struct nfscllockowner *lp, int newone, int reclaim, u_int64_t off, u_int64_t len, short type, struct ucred *cred, @@ -4195,7 +4195,7 @@ nfsmout: * nfs statfs rpc * (always called with the vp for the mount point) */ -APPLESTATIC int +int nfsrpc_statfs(vnode_t vp, struct nfsstatfs *sbp, struct nfsfsinfo *fsp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) @@ -4274,7 +4274,7 @@ nfsmout: /* * nfs pathconf rpc */ -APPLESTATIC int +int nfsrpc_pathconf(vnode_t vp, struct nfsv3_pathconf *pc, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) @@ -4335,7 +4335,7 @@ nfsmout: /* * nfs version 3 fsinfo rpc call */ -APPLESTATIC int +int nfsrpc_fsinfo(vnode_t vp, struct nfsfsinfo *fsp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { @@ -4374,7 +4374,7 @@ nfsmout: /* * This function performs the Renew RPC. */ -APPLESTATIC int +int nfsrpc_renew(struct nfsclclient *clp, struct nfsclds *dsp, struct ucred *cred, NFSPROC_T *p) { @@ -4428,7 +4428,7 @@ nfsrpc_renew(struct nfsclclient *clp, struct nfsclds * /* * This function performs the Releaselockowner RPC. */ -APPLESTATIC int +int nfsrpc_rellockown(struct nfsmount *nmp, struct nfscllockowner *lp, uint8_t *fh, int fhlen, struct ucred *cred, NFSPROC_T *p) { @@ -4467,7 +4467,7 @@ nfsrpc_rellockown(struct nfsmount *nmp, struct nfscllo /* * This function performs the Compound to get the mount pt FH. */ -APPLESTATIC int +int nfsrpc_getdirpath(struct nfsmount *nmp, u_char *dirpath, struct ucred *cred, NFSPROC_T *p) { @@ -4536,7 +4536,7 @@ nfsmout: /* * This function performs the Delegreturn RPC. */ -APPLESTATIC int +int nfsrpc_delegreturn(struct nfscldeleg *dp, struct ucred *cred, struct nfsmount *nmp, NFSPROC_T *p, int syscred) { @@ -4569,7 +4569,7 @@ nfsrpc_delegreturn(struct nfscldeleg *dp, struct ucred /* * nfs getacl call. */ -APPLESTATIC int +int nfsrpc_getacl(vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct acl *aclp, void *stuff) { @@ -4599,7 +4599,7 @@ nfsrpc_getacl(vnode_t vp, struct ucred *cred, NFSPROC_ /* * nfs setacl call. */ -APPLESTATIC int +int nfsrpc_setacl(vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct acl *aclp, void *stuff) { Modified: stable/12/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clstate.c Tue May 19 01:40:45 2020 (r361235) +++ stable/12/sys/fs/nfsclient/nfs_clstate.c Tue May 19 01:43:00 2020 (r361236) @@ -208,7 +208,7 @@ static short *nfscl_cberrmap[] = { * Called for an open operation. * If the nfhp argument is NULL, just get an openowner. */ -APPLESTATIC int +int nfscl_open(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t amode, int usedeleg, struct ucred *cred, NFSPROC_T *p, struct nfsclowner **owpp, struct nfsclopen **opp, int *newonep, int *retp, int lockit) @@ -424,7 +424,7 @@ nfscl_newopen(struct nfsclclient *clp, struct nfscldel /* * Called to find/add a delegation to a client. */ -APPLESTATIC int +int nfscl_deleg(mount_t mp, struct nfsclclient *clp, u_int8_t *nfhp, int fhlen, struct ucred *cred, NFSPROC_T *p, struct nfscldeleg **dpp) { @@ -495,7 +495,7 @@ nfscl_finddeleg(struct nfsclclient *clp, u_int8_t *fhp * found, return either a lockowner stateid or the open stateid. * If no Open is found, just return error and the special stateid of all zeros. */ -APPLESTATIC int +int nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode, int fords, struct ucred *cred, NFSPROC_T *p, nfsv4stateid_t *stateidp, void **lckpp) @@ -719,7 +719,7 @@ nfscl_getopen(struct nfsclownerhead *ohp, u_int8_t *nf * Release use of an open owner. Called when open operations are done * with the open owner. */ -APPLESTATIC void +void nfscl_ownerrelease(struct nfsmount *nmp, struct nfsclowner *owp, __unused int error, __unused int candelete, int unlocked) { @@ -740,7 +740,7 @@ nfscl_ownerrelease(struct nfsmount *nmp, struct nfsclo /* * Release use of an open structure under an open owner. */ -APPLESTATIC void +void nfscl_openrelease(struct nfsmount *nmp, struct nfsclopen *op, int error, int candelete) { @@ -774,7 +774,7 @@ nfscl_openrelease(struct nfsmount *nmp, struct nfsclop * thread if this creates a new clp. * It always clpp with a reference count on it, unless returning an error. */ -APPLESTATIC int +int nfscl_getcl(struct mount *mp, struct ucred *cred, NFSPROC_T *p, int start_renewthread, struct nfsclclient **clpp) { @@ -937,7 +937,7 @@ nfscl_getcl(struct mount *mp, struct ucred *cred, NFSP /* * Get a reference to a clientid and return it, if valid. */ -APPLESTATIC struct nfsclclient * +struct nfsclclient * nfscl_findcl(struct nfsmount *nmp) { struct nfsclclient *clp; @@ -964,7 +964,7 @@ nfscl_clrelease(struct nfsclclient *clp) /* * External call for nfscl_clrelease. */ -APPLESTATIC void +void nfscl_clientrelease(struct nfsclclient *clp) { @@ -979,7 +979,7 @@ nfscl_clientrelease(struct nfsclclient *clp) /* * Called when wanting to lock a byte region. */ -APPLESTATIC int +int nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t len, short type, struct ucred *cred, NFSPROC_T *p, struct nfsclclient *rclp, int recovery, void *id, int flags, u_int8_t *rownp, u_int8_t *ropenownp, @@ -1179,7 +1179,7 @@ nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t /* * Called to unlock a byte range, for LockU. */ -APPLESTATIC int +int nfscl_relbytelock(vnode_t vp, u_int64_t off, u_int64_t len, __unused struct ucred *cred, NFSPROC_T *p, int callcnt, struct nfsclclient *clp, void *id, int flags, @@ -1291,7 +1291,7 @@ nfscl_relbytelock(vnode_t vp, u_int64_t off, u_int64_t /* * Release all lockowners marked in progess for this process and file. */ -APPLESTATIC void +void nfscl_releasealllocks(struct nfsclclient *clp, vnode_t vp, NFSPROC_T *p, void *id, int flags) { @@ -1329,7 +1329,7 @@ nfscl_releasealllocks(struct nfsclclient *clp, vnode_t * is required before a LockU. * If in doubt, return 1, so the flush will occur. */ -APPLESTATIC int +int nfscl_checkwritelocked(vnode_t vp, struct flock *fl, struct ucred *cred, NFSPROC_T *p, void *id, int flags) { @@ -1435,7 +1435,7 @@ nfscl_checkwritelocked(vnode_t vp, struct flock *fl, /* * Release a byte range lock owner structure. */ -APPLESTATIC void +void nfscl_lockrelease(struct nfscllockowner *lp, int error, int candelete) { struct nfsclclient *clp; @@ -1456,7 +1456,7 @@ nfscl_lockrelease(struct nfscllockowner *lp, int error /* * Free up an open structure and any associated byte range lock structures. */ -APPLESTATIC void +void nfscl_freeopen(struct nfsclopen *op, int local) { @@ -1553,7 +1553,7 @@ nfscl_freeopenowner(struct nfsclowner *owp, int local) /* * Free up a byte range lock owner structure. */ -APPLESTATIC void +void nfscl_freelockowner(struct nfscllockowner *lp, int local) { struct nfscllock *lop, *nlop; @@ -1572,7 +1572,7 @@ nfscl_freelockowner(struct nfscllockowner *lp, int loc /* * Free up a byte range lock structure. */ -APPLESTATIC void +void nfscl_freelock(struct nfscllock *lop, int local) { @@ -1873,7 +1873,7 @@ static int fake_global; /* Used to force visibility of /* * Called from nfs umount to free up the clientid. */ -APPLESTATIC void +void nfscl_umount(struct nfsmount *nmp, NFSPROC_T *p) { struct nfsclclient *clp; @@ -2282,7 +2282,7 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *c * XXX Someday it should post a signal to the process(es) that hold the * state, so they know that lock state has been lost. */ -APPLESTATIC int +int nfscl_hasexpired(struct nfsclclient *clp, u_int32_t clidrev, NFSPROC_T *p) { struct nfsmount *nmp; @@ -2510,7 +2510,7 @@ nfscl_updatelock(struct nfscllockowner *lp, struct nfs * This function must be run as a kernel thread. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 19 02:07:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29FAC2F4AB5; Tue, 19 May 2020 02:07:09 +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 49Qzlx0JSrz3TFq; Tue, 19 May 2020 02:07:09 +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 05BDE2B31D; Tue, 19 May 2020 02:07:09 +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 04J278ju082725; Tue, 19 May 2020 02:07:08 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J278va082724; Tue, 19 May 2020 02:07:08 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202005190207.04J278va082724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 19 May 2020 02:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361237 - head/tests/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/netinet X-SVN-Commit-Revision: 361237 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, 19 May 2020 02:07:09 -0000 Author: lwhsu Date: Tue May 19 02:07:08 2020 New Revision: 361237 URL: https://svnweb.freebsd.org/changeset/base/361237 Log: Temporarily disable test case causes kernel panic in CI: - sys.netinet.so_reuseport_lb_test.basic_ipv6 PR: 246560 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/netinet/so_reuseport_lb_test.c Modified: head/tests/sys/netinet/so_reuseport_lb_test.c ============================================================================== --- head/tests/sys/netinet/so_reuseport_lb_test.c Tue May 19 01:43:00 2020 (r361236) +++ head/tests/sys/netinet/so_reuseport_lb_test.c Tue May 19 02:07:08 2020 (r361237) @@ -188,6 +188,9 @@ ATF_TC_BODY(basic_ipv6, tc) int error, sds[16]; uint16_t port; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/246560"); + sds[0] = lb_listen_socket(PF_INET6, SOCK_NONBLOCK); memset(&addr, 0, sizeof(addr)); From owner-svn-src-all@freebsd.org Tue May 19 02:41: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 A20C42F83EC; Tue, 19 May 2020 02:41: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 49R0W53w4bz3YHJ; Tue, 19 May 2020 02:41: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 8196A2BB15; Tue, 19 May 2020 02:41:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J2f5Se001348; Tue, 19 May 2020 02:41:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J2f54E001347; Tue, 19 May 2020 02:41:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005190241.04J2f54E001347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 19 May 2020 02:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 361238 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, 19 May 2020 02:41:05 -0000 Author: kevans Date: Tue May 19 02:41:05 2020 New Revision: 361238 URL: https://svnweb.freebsd.org/changeset/base/361238 Log: zfs: reject read(2) of a dirfd with EISDIR This is independent of the recently-discussed global change, which is still in review/discussion stage. This is effectively a measure for consistency in the ZFS world, where FreeBSD was the only platform (as far as I could find) that allowed this. What ZFS exposes is decidedly not useful for any real purposes, to paraphrase (hopefully faithfully) jhb's findings when exploring this: The size of a directory in ZFS is the number of directory entries within. When reading a directory, you would instead get the leading part of its raw contents; the amount you get being dictated by the "size," i.e. number of directory entries. There's decidedly (luckily) no stack disclosure happening here, though the behavior is bizarre and almost certainly a historical accident. This change has already been upstreamed to OpenZFS. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue May 19 02:07:08 2020 (r361237) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue May 19 02:41:05 2020 (r361238) @@ -646,6 +646,12 @@ zfs_read(vnode_t *vp, uio_t *uio, int ioflag, cred_t * ZFS_ENTER(zfsvfs); ZFS_VERIFY_ZP(zp); + /* We don't copy out anything useful for directories. */ + if (vp->v_type == VDIR) { + ZFS_EXIT(zfsvfs); + return (SET_ERROR(EISDIR)); + } + if (zp->z_pflags & ZFS_AV_QUARANTINED) { ZFS_EXIT(zfsvfs); return (SET_ERROR(EACCES)); From owner-svn-src-all@freebsd.org Tue May 19 03:19: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 740EF2F91BF; Tue, 19 May 2020 03:19: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 49R1Lt2SqQz3bJL; Tue, 19 May 2020 03:19: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 4FEDF2C2B3; Tue, 19 May 2020 03:19: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 04J3J2MV026608; Tue, 19 May 2020 03:19:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J3J2LA026607; Tue, 19 May 2020 03:19:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005190319.04J3J2LA026607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 19 May 2020 03:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361239 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 361239 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, 19 May 2020 03:19:02 -0000 Author: kevans Date: Tue May 19 03:19:01 2020 New Revision: 361239 URL: https://svnweb.freebsd.org/changeset/base/361239 Log: Belated RELNOTES entry for r361238 This may get revised later if the larger change lands, but we should note this. Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Tue May 19 02:41:05 2020 (r361238) +++ head/RELNOTES Tue May 19 03:19:01 2020 (r361239) @@ -10,6 +10,9 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r361238: + ZFS will now reject read(2) of a dirfd with EISDIR. + r360920,r360923,r360924,r360927,r360928,r360931,r360933,r360936: Remove support for ARC4, Blowfish, Cast, DES, Triple DES, MD5, MD5-KPDK, MD5-HMAC, SHA1-KPDK, and Skipjack algorithms from From owner-svn-src-all@freebsd.org Tue May 19 03:24: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 8231C2F96C2; Tue, 19 May 2020 03:24:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49R1TV2tkXz3bbR; Tue, 19 May 2020 03:24:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DFF52C266; Tue, 19 May 2020 03:24:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J3Ok2r032816; Tue, 19 May 2020 03:24:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J3Oj4p032813; Tue, 19 May 2020 03:24:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005190324.04J3Oj4p032813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 19 May 2020 03:24: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: r361240 - in stable/12: share/man/man4 sys/dev/rtwn/usb sys/dev/usb X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/dev/rtwn/usb sys/dev/usb X-SVN-Commit-Revision: 361240 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, 19 May 2020 03:24:46 -0000 Author: markj Date: Tue May 19 03:24:45 2020 New Revision: 361240 URL: https://svnweb.freebsd.org/changeset/base/361240 Log: MFC r360966: rtwn: Add a USB ID for the TP-Link TL-WN727N. PR: 246417 Modified: stable/12/share/man/man4/rtwn_usb.4 stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h stable/12/sys/dev/usb/usbdevs Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/rtwn_usb.4 ============================================================================== --- stable/12/share/man/man4/rtwn_usb.4 Tue May 19 03:19:01 2020 (r361239) +++ stable/12/share/man/man4/rtwn_usb.4 Tue May 19 03:24:45 2020 (r361240) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd May 9, 2020 +.Dd May 12, 2020 .Dt RTWN_USB 4 .Os .Sh NAME @@ -103,6 +103,7 @@ based USB wireless network adapters, including: .It "TP-Link TL-WN722N v2" Ta RTL8188EU Ta USB 2.0 .It "TP-LINK TL-WN723N v3" Ta RTL8188EU Ta USB 2.0 .It "TP-LINK TL-WN725N v2" Ta RTL8188EU Ta USB 2.0 +.It "TP-LINK TL-WN727N v5" Ta RTL8188EU Ta USB 2.0 .It "TP-LINK TL-WN821N v4" Ta RTL8192CU Ta USB 2.0 .It "TP-LINK TL-WN821N v5" Ta RTL8192EU Ta USB 2.0 .It "TP-LINK TL-WN822N v4" Ta RTL8192EU Ta USB 2.0 Modified: stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h ============================================================================== --- stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h Tue May 19 03:19:01 2020 (r361239) +++ stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h Tue May 19 03:24:45 2020 (r361240) @@ -120,6 +120,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = { RTWN_RTL8188EU_DEV(DLINK, DWA125D1), RTWN_RTL8188EU_DEV(ELECOM, WDC150SU2M), RTWN_RTL8188EU_DEV(TPLINK, WN722NV2), + RTWN_RTL8188EU_DEV(TPLINK, WN727NV5), RTWN_RTL8188EU_DEV(REALTEK, RTL8188ETV), RTWN_RTL8188EU_DEV(REALTEK, RTL8188EU), #undef RTWN_RTL8188EU_DEV Modified: stable/12/sys/dev/usb/usbdevs ============================================================================== --- stable/12/sys/dev/usb/usbdevs Tue May 19 03:19:01 2020 (r361239) +++ stable/12/sys/dev/usb/usbdevs Tue May 19 03:24:45 2020 (r361240) @@ -4663,6 +4663,7 @@ product TPLINK WN821NV5 0x0107 TL-WN821N v5 product TPLINK WN822NV4 0x0108 TL-WN822N v4 product TPLINK WN823NV2 0x0109 TL-WN823N v2 product TPLINK WN722NV2 0x010c TL-WN722N v2 +product TPLINK WN727NV5 0x0111 TL-WN727N v5 product TPLINK T4UV2 0x010d Archer T4U ver 2 product TPLINK T4UHV1 0x0103 Archer T4UH ver 1 product TPLINK T4UHV2 0x010e Archer T4UH ver 2 From owner-svn-src-all@freebsd.org Tue May 19 07:16: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 8CA972FD2E8; Tue, 19 May 2020 07:16:10 +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 49R6cV3Bcxz45rP; Tue, 19 May 2020 07:16:10 +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 68E012ECE4; Tue, 19 May 2020 07:16:10 +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 04J7GAPj075676; Tue, 19 May 2020 07:16:10 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J7GAK9075675; Tue, 19 May 2020 07:16:10 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202005190716.04J7GAK9075675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 19 May 2020 07:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361241 - head/tests/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/netinet X-SVN-Commit-Revision: 361241 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, 19 May 2020 07:16:10 -0000 Author: lwhsu Date: Tue May 19 07:16:09 2020 New Revision: 361241 URL: https://svnweb.freebsd.org/changeset/base/361241 Log: Revert r361237, it's fixed by r361231 PR: 246560 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/netinet/so_reuseport_lb_test.c Modified: head/tests/sys/netinet/so_reuseport_lb_test.c ============================================================================== --- head/tests/sys/netinet/so_reuseport_lb_test.c Tue May 19 03:24:45 2020 (r361240) +++ head/tests/sys/netinet/so_reuseport_lb_test.c Tue May 19 07:16:09 2020 (r361241) @@ -188,9 +188,6 @@ ATF_TC_BODY(basic_ipv6, tc) int error, sds[16]; uint16_t port; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/246560"); - sds[0] = lb_listen_socket(PF_INET6, SOCK_NONBLOCK); memset(&addr, 0, sizeof(addr)); From owner-svn-src-all@freebsd.org Tue May 19 07:21: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 E39242FD576; Tue, 19 May 2020 07:21:12 +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 49R6kJ685pz4698; Tue, 19 May 2020 07:21:12 +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 CE1582F0A3; Tue, 19 May 2020 07:21:12 +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 04J7LCFa076843; Tue, 19 May 2020 07:21:12 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J7LBNr076838; Tue, 19 May 2020 07:21:11 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005190721.04J7LBNr076838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 19 May 2020 07:21:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361242 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361242 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, 19 May 2020 07:21:13 -0000 Author: tuexen Date: Tue May 19 07:21:11 2020 New Revision: 361242 URL: https://svnweb.freebsd.org/changeset/base/361242 Log: Revert r361209: cem noted that on FreeBSD snprintf() can not fail and code should not check for that. A followup commit will replace the usage of snprintf() in the SCTP sources with a variadic macro SCTP_SNPRINTF, which will simply map to snprintf() on FreeBSD and do a checking similar to r361209 on other platforms. Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Tue May 19 07:16:09 2020 (r361241) +++ head/sys/netinet/sctp_asconf.c Tue May 19 07:21:11 2020 (r361242) @@ -1706,9 +1706,8 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset, char msg[SCTP_DIAG_INFO_LEN]; SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf_ack: got unexpected next serial number! Aborting asoc!\n"); - if (snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", serial_num) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", + serial_num); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_no_unlock = 1; Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Tue May 19 07:16:09 2020 (r361241) +++ head/sys/netinet/sctp_indata.c Tue May 19 07:21:11 2020 (r361242) @@ -434,26 +434,22 @@ sctp_abort_in_reasm(struct sctp_tcb *stcb, struct mbuf *oper; if (stcb->asoc.idata_supported) { - if (snprintf(msg, sizeof(msg), + snprintf(msg, sizeof(msg), "Reass %x,CF:%x,TSN=%8.8x,SID=%4.4x,FSN=%8.8x,MID:%8.8x", opspot, control->fsn_included, chk->rec.data.tsn, chk->rec.data.sid, - chk->rec.data.fsn, chk->rec.data.mid) < 0) { - msg[0] = '\0'; - } + chk->rec.data.fsn, chk->rec.data.mid); } else { - if (snprintf(msg, sizeof(msg), + snprintf(msg, sizeof(msg), "Reass %x,CI:%x,TSN=%8.8x,SID=%4.4x,FSN=%4.4x,SSN:%4.4x", opspot, control->fsn_included, chk->rec.data.tsn, chk->rec.data.sid, chk->rec.data.fsn, - (uint16_t)chk->rec.data.mid) < 0) { - msg[0] = '\0'; - } + (uint16_t)chk->rec.data.mid); } oper = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); sctp_m_freem(chk->data); @@ -537,19 +533,15 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, */ TAILQ_INSERT_HEAD(&strm->inqueue, control, next_instrm); if (asoc->idata_supported) { - if (snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", + snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", strm->last_mid_delivered, control->sinfo_tsn, - control->sinfo_stream, control->mid) < 0) { - msg[0] = '\0'; - } + control->sinfo_stream, control->mid); } else { - if (snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", (uint16_t)strm->last_mid_delivered, control->sinfo_tsn, control->sinfo_stream, - (uint16_t)control->mid) < 0) { - msg[0] = '\0'; - } + (uint16_t)control->mid); } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_2; @@ -656,10 +648,9 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, * to put it on the queue. */ if (sctp_place_control_in_stream(strm, asoc, control)) { - if (snprintf(msg, sizeof(msg), - "Queue to str MID: %u duplicate", control->mid) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), + "Queue to str MID: %u duplicate", + control->mid); sctp_clean_up_control(stcb, control); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_3; @@ -1890,9 +1881,8 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc * can *not* be fsn 0. XXX: This can happen in case of a * wrap around. Ignore is for now. */ - if (snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", mid, chk_flags) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", + mid, chk_flags); goto err_out; } control = sctp_find_reasm_entry(&asoc->strmin[sid], mid, ordered, asoc->idata_supported); @@ -1903,9 +1893,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc if (control != NULL) { /* We found something, does it belong? */ if (ordered && (mid != control->mid)) { - if (snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid); err_out: op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; @@ -1918,11 +1906,8 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc * We can't have a switched order with an * unordered chunk */ - if (snprintf(msg, sizeof(msg), - "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", - tsn) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", + tsn); goto err_out; } if (!ordered && (((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED) == 0)) { @@ -1930,11 +1915,8 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc * We can't have a switched unordered with a * ordered chunk */ - if (snprintf(msg, sizeof(msg), - "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", - tsn) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", + tsn); goto err_out; } } @@ -1948,18 +1930,12 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc if (ordered || asoc->idata_supported) { SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x dup detected on MID: %u\n", chk_flags, mid); - if (snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid); goto err_out; } else { if ((tsn == control->fsn_included + 1) && (control->end_added == 0)) { - if (snprintf(msg, sizeof(msg), - "Illegal message sequence, missing end for MID: %8.8x", - control->fsn_included) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "Illegal message sequence, missing end for MID: %8.8x", control->fsn_included); goto err_out; } else { control = NULL; @@ -2056,21 +2032,17 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc mid, asoc->strmin[sid].last_mid_delivered); if (asoc->idata_supported) { - if (snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", + snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", asoc->strmin[sid].last_mid_delivered, tsn, sid, - mid) < 0) { - msg[0] = '\0'; - } + mid); } else { - if (snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", (uint16_t)asoc->strmin[sid].last_mid_delivered, tsn, sid, - (uint16_t)mid) < 0) { - msg[0] = '\0'; - } + (uint16_t)mid); } op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17; @@ -2797,9 +2769,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - if (snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated") < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated"); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -2810,9 +2780,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - if (snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated") < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated"); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -2835,11 +2803,9 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - if (snprintf(msg, sizeof(msg), "%s chunk of length %u", + snprintf(msg, sizeof(msg), "%s chunk of length %u", ch->chunk_type == SCTP_DATA ? "DATA" : "I-DATA", - chk_length) < 0) { - msg[0] = '\0'; - } + chk_length); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_22; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -2908,10 +2874,8 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - if (snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", - ch->chunk_type) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", + ch->chunk_type); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); return (2); @@ -2929,9 +2893,8 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - if (snprintf(msg, sizeof(msg), "Chunk of length %u", chk_length) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "Chunk of length %u", + chk_length); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_23; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -4080,11 +4043,8 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 *abort_now = 1; /* XXX */ - if (snprintf(msg, sizeof(msg), - "Cum ack %8.8x greater or equal than TSN %8.8x", - cumack, send_s) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", + cumack, send_s); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -4625,11 +4585,8 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int o hopeless_peer: *abort_now = 1; /* XXX */ - if (snprintf(msg, sizeof(msg), - "Cum ack %8.8x greater or equal than TSN %8.8x", - cum_ack, send_s) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", + cum_ack, send_s); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_28; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -5672,11 +5629,9 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, * give out). This must be an attacker. */ *abort_flag = 1; - if (snprintf(msg, sizeof(msg), + snprintf(msg, sizeof(msg), "New cum ack %8.8x too high, highest TSN %8.8x", - new_cum_tsn, asoc->highest_tsn_inside_map) < 0) { - msg[0] = '\0'; - } + new_cum_tsn, asoc->highest_tsn_inside_map); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_36; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue May 19 07:16:09 2020 (r361241) +++ head/sys/netinet/sctp_input.c Tue May 19 07:21:11 2020 (r361242) @@ -4692,9 +4692,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * } } if (stcb == NULL) { - if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); /* no association, so it's out of the blue... */ @@ -4736,9 +4734,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * if (stcb != NULL) { SCTP_TCB_UNLOCK(stcb); } - if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, *offset, src, dst, @@ -5675,9 +5671,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph SCTP_TCB_UNLOCK(stcb); stcb = NULL; SCTP_PROBE5(receive, NULL, stcb, m, stcb, sh); - if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, @@ -5739,9 +5733,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph if (stcb == NULL) { /* out of the blue DATA chunk */ SCTP_PROBE5(receive, NULL, NULL, m, NULL, sh); - if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, @@ -5807,9 +5799,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph /* * We consider OOTB any data sent during asoc setup. */ - if (snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue May 19 07:16:09 2020 (r361241) +++ head/sys/netinet/sctp_output.c Tue May 19 07:21:11 2020 (r361242) @@ -5581,9 +5581,7 @@ do_a_abort: if (op_err == NULL) { char msg[SCTP_DIAG_INFO_LEN]; - if (snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); } @@ -6760,10 +6758,8 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct s char msg[SCTP_DIAG_INFO_LEN]; abort_anyway: - if (snprintf(msg, sizeof(msg), - "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), + "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); atomic_add_int(&stcb->asoc.refcnt, 1); @@ -9630,10 +9626,8 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp, struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - if (snprintf(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up", - chk->rec.data.tsn, chk->snd_count) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up", + chk->rec.data.tsn, chk->snd_count); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); atomic_add_int(&stcb->asoc.refcnt, 1); @@ -13616,10 +13610,8 @@ dataless_eof: atomic_add_int(&stcb->asoc.refcnt, -1); free_cnt_applied = 0; } - if (snprintf(msg, sizeof(msg), - "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), + "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); NET_EPOCH_ENTER(et); Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue May 19 07:16:09 2020 (r361241) +++ head/sys/netinet/sctp_pcb.c Tue May 19 07:21:11 2020 (r361242) @@ -544,13 +544,9 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint3 atomic_add_int(&vrf->refcount, 1); sctp_ifnp->ifn_mtu = SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, addr->sa_family); if (if_name != NULL) { - if (snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name) < 0) { - sctp_ifnp->ifn_name[0] = '\0'; - } + snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name); } else { - if (snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown") < 0) { - sctp_ifnp->ifn_name[0] = '\0'; - } + snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown"); } hash_ifn_head = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & SCTP_BASE_INFO(vrf_ifn_hashmark))]; LIST_INIT(&sctp_ifnp->ifalist); @@ -6221,10 +6217,8 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s * in setup state we * abort this guy */ - if (snprintf(msg, sizeof(msg), - "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), + "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_abort_an_association(stcb_tmp->sctp_ep, @@ -6323,10 +6317,8 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s * in setup state we * abort this guy */ - if (snprintf(msg, sizeof(msg), - "%s:%d at %s", __FILE__, __LINE__, __func__) < 0) { - msg[0] = '\0'; - } + snprintf(msg, sizeof(msg), + "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_abort_an_association(stcb_tmp->sctp_ep, From owner-svn-src-all@freebsd.org Tue May 19 07:23: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 420A42FDD06; Tue, 19 May 2020 07:23:37 +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 49R6n51RStz46nG; Tue, 19 May 2020 07:23:37 +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 2C9082F27F; Tue, 19 May 2020 07:23:37 +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 04J7NbSV082083; Tue, 19 May 2020 07:23:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J7NabT082078; Tue, 19 May 2020 07:23:36 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005190723.04J7NabT082078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 19 May 2020 07:23:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361243 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361243 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, 19 May 2020 07:23:37 -0000 Author: tuexen Date: Tue May 19 07:23:35 2020 New Revision: 361243 URL: https://svnweb.freebsd.org/changeset/base/361243 Log: Replace snprintf() by SCTP_SNPRINTF() and let SCTP_SNPRINTF() map to snprintf() on FreeBSD. This allows to check for failures of snprintf() on platforms other than FreeBSD kernel. Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Tue May 19 07:21:11 2020 (r361242) +++ head/sys/netinet/sctp_asconf.c Tue May 19 07:23:35 2020 (r361243) @@ -1706,8 +1706,7 @@ sctp_handle_asconf_ack(struct mbuf *m, int offset, char msg[SCTP_DIAG_INFO_LEN]; SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf_ack: got unexpected next serial number! Aborting asoc!\n"); - snprintf(msg, sizeof(msg), "Never sent serial number %8.8x", - serial_num); + SCTP_SNPRINTF(msg, sizeof(msg), "Never sent serial number %8.8x", serial_num); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_no_unlock = 1; Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Tue May 19 07:21:11 2020 (r361242) +++ head/sys/netinet/sctp_indata.c Tue May 19 07:23:35 2020 (r361243) @@ -434,7 +434,7 @@ sctp_abort_in_reasm(struct sctp_tcb *stcb, struct mbuf *oper; if (stcb->asoc.idata_supported) { - snprintf(msg, sizeof(msg), + SCTP_SNPRINTF(msg, sizeof(msg), "Reass %x,CF:%x,TSN=%8.8x,SID=%4.4x,FSN=%8.8x,MID:%8.8x", opspot, control->fsn_included, @@ -442,7 +442,7 @@ sctp_abort_in_reasm(struct sctp_tcb *stcb, chk->rec.data.sid, chk->rec.data.fsn, chk->rec.data.mid); } else { - snprintf(msg, sizeof(msg), + SCTP_SNPRINTF(msg, sizeof(msg), "Reass %x,CI:%x,TSN=%8.8x,SID=%4.4x,FSN=%4.4x,SSN:%4.4x", opspot, control->fsn_included, @@ -533,11 +533,11 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, */ TAILQ_INSERT_HEAD(&strm->inqueue, control, next_instrm); if (asoc->idata_supported) { - snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", + SCTP_SNPRINTF(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", strm->last_mid_delivered, control->sinfo_tsn, control->sinfo_stream, control->mid); } else { - snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + SCTP_SNPRINTF(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", (uint16_t)strm->last_mid_delivered, control->sinfo_tsn, control->sinfo_stream, @@ -648,9 +648,8 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, * to put it on the queue. */ if (sctp_place_control_in_stream(strm, asoc, control)) { - snprintf(msg, sizeof(msg), - "Queue to str MID: %u duplicate", - control->mid); + SCTP_SNPRINTF(msg, sizeof(msg), + "Queue to str MID: %u duplicate", control->mid); sctp_clean_up_control(stcb, control); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_3; @@ -1881,8 +1880,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc * can *not* be fsn 0. XXX: This can happen in case of a * wrap around. Ignore is for now. */ - snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", - mid, chk_flags); + SCTP_SNPRINTF(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", mid, chk_flags); goto err_out; } control = sctp_find_reasm_entry(&asoc->strmin[sid], mid, ordered, asoc->idata_supported); @@ -1893,7 +1891,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc if (control != NULL) { /* We found something, does it belong? */ if (ordered && (mid != control->mid)) { - snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid); + SCTP_SNPRINTF(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", mid); err_out: op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; @@ -1906,7 +1904,8 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc * We can't have a switched order with an * unordered chunk */ - snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", + SCTP_SNPRINTF(msg, sizeof(msg), + "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", tsn); goto err_out; } @@ -1915,7 +1914,8 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc * We can't have a switched unordered with a * ordered chunk */ - snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", + SCTP_SNPRINTF(msg, sizeof(msg), + "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", tsn); goto err_out; } @@ -1930,12 +1930,14 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc if (ordered || asoc->idata_supported) { SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x dup detected on MID: %u\n", chk_flags, mid); - snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid); + SCTP_SNPRINTF(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", mid); goto err_out; } else { if ((tsn == control->fsn_included + 1) && (control->end_added == 0)) { - snprintf(msg, sizeof(msg), "Illegal message sequence, missing end for MID: %8.8x", control->fsn_included); + SCTP_SNPRINTF(msg, sizeof(msg), + "Illegal message sequence, missing end for MID: %8.8x", + control->fsn_included); goto err_out; } else { control = NULL; @@ -2032,13 +2034,13 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc mid, asoc->strmin[sid].last_mid_delivered); if (asoc->idata_supported) { - snprintf(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", + SCTP_SNPRINTF(msg, sizeof(msg), "Delivered MID=%8.8x, got TSN=%8.8x, SID=%4.4x, MID=%8.8x", asoc->strmin[sid].last_mid_delivered, tsn, sid, mid); } else { - snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + SCTP_SNPRINTF(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", (uint16_t)asoc->strmin[sid].last_mid_delivered, tsn, sid, @@ -2769,7 +2771,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated"); + SCTP_SNPRINTF(msg, sizeof(msg), "%s", "I-DATA chunk received when DATA was negotiated"); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -2780,7 +2782,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated"); + SCTP_SNPRINTF(msg, sizeof(msg), "%s", "DATA chunk received when I-DATA was negotiated"); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_21; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -2803,7 +2805,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "%s chunk of length %u", + SCTP_SNPRINTF(msg, sizeof(msg), "%s chunk of length %u", ch->chunk_type == SCTP_DATA ? "DATA" : "I-DATA", chk_length); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); @@ -2874,7 +2876,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", + SCTP_SNPRINTF(msg, sizeof(msg), "DATA chunk followed by chunk of type %2.2x", ch->chunk_type); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -2893,8 +2895,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "Chunk of length %u", - chk_length); + SCTP_SNPRINTF(msg, sizeof(msg), "Chunk of length %u", chk_length); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_23; sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); @@ -4043,7 +4044,8 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 *abort_now = 1; /* XXX */ - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", + SCTP_SNPRINTF(msg, sizeof(msg), + "Cum ack %8.8x greater or equal than TSN %8.8x", cumack, send_s); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; @@ -4585,7 +4587,8 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int o hopeless_peer: *abort_now = 1; /* XXX */ - snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal than TSN %8.8x", + SCTP_SNPRINTF(msg, sizeof(msg), + "Cum ack %8.8x greater or equal than TSN %8.8x", cum_ack, send_s); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_28; @@ -5629,7 +5632,7 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, * give out). This must be an attacker. */ *abort_flag = 1; - snprintf(msg, sizeof(msg), + SCTP_SNPRINTF(msg, sizeof(msg), "New cum ack %8.8x too high, highest TSN %8.8x", new_cum_tsn, asoc->highest_tsn_inside_map); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue May 19 07:21:11 2020 (r361242) +++ head/sys/netinet/sctp_input.c Tue May 19 07:23:35 2020 (r361243) @@ -4692,7 +4692,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * } } if (stcb == NULL) { - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); + SCTP_SNPRINTF(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); /* no association, so it's out of the blue... */ @@ -4734,7 +4734,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * if (stcb != NULL) { SCTP_TCB_UNLOCK(stcb); } - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); + SCTP_SNPRINTF(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, *offset, src, dst, @@ -5671,7 +5671,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph SCTP_TCB_UNLOCK(stcb); stcb = NULL; SCTP_PROBE5(receive, NULL, stcb, m, stcb, sh); - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); + SCTP_SNPRINTF(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, @@ -5733,7 +5733,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph if (stcb == NULL) { /* out of the blue DATA chunk */ SCTP_PROBE5(receive, NULL, NULL, m, NULL, sh); - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); + SCTP_SNPRINTF(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, @@ -5799,7 +5799,7 @@ sctp_common_input_processing(struct mbuf **mm, int iph /* * We consider OOTB any data sent during asoc setup. */ - snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); + SCTP_SNPRINTF(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Tue May 19 07:21:11 2020 (r361242) +++ head/sys/netinet/sctp_os_bsd.h Tue May 19 07:23:35 2020 (r361243) @@ -295,6 +295,8 @@ typedef struct callout sctp_os_timer_t; #define SCTP_ALIGN_TO_END(m, len) M_ALIGN(m, len) +#define SCTP_SNPRINTF(...) snprintf(__VA_ARGS__) + /* We make it so if you have up to 4 threads * writing based on the default size of * the packet log 65 k, that would be Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue May 19 07:21:11 2020 (r361242) +++ head/sys/netinet/sctp_output.c Tue May 19 07:23:35 2020 (r361243) @@ -5581,7 +5581,7 @@ do_a_abort: if (op_err == NULL) { char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); + SCTP_SNPRINTF(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); } @@ -6758,7 +6758,7 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct s char msg[SCTP_DIAG_INFO_LEN]; abort_anyway: - snprintf(msg, sizeof(msg), + SCTP_SNPRINTF(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); @@ -9626,7 +9626,7 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp, struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up", + SCTP_SNPRINTF(msg, sizeof(msg), "TSN %8.8x retransmitted %d times, giving up", chk->rec.data.tsn, chk->snd_count); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); @@ -13610,7 +13610,7 @@ dataless_eof: atomic_add_int(&stcb->asoc.refcnt, -1); free_cnt_applied = 0; } - snprintf(msg, sizeof(msg), + SCTP_SNPRINTF(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue May 19 07:21:11 2020 (r361242) +++ head/sys/netinet/sctp_pcb.c Tue May 19 07:23:35 2020 (r361243) @@ -544,9 +544,9 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint3 atomic_add_int(&vrf->refcount, 1); sctp_ifnp->ifn_mtu = SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, addr->sa_family); if (if_name != NULL) { - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name); + SCTP_SNPRINTF(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name); } else { - snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown"); + SCTP_SNPRINTF(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown"); } hash_ifn_head = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & SCTP_BASE_INFO(vrf_ifn_hashmark))]; LIST_INIT(&sctp_ifnp->ifalist); @@ -6217,7 +6217,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s * in setup state we * abort this guy */ - snprintf(msg, sizeof(msg), + SCTP_SNPRINTF(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); @@ -6317,7 +6317,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s * in setup state we * abort this guy */ - snprintf(msg, sizeof(msg), + SCTP_SNPRINTF(msg, sizeof(msg), "%s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); From owner-svn-src-all@freebsd.org Tue May 19 07:48: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 2A3672FE443; Tue, 19 May 2020 07:48:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49R7KD0GSdz47t6; Tue, 19 May 2020 07:48:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF90E2F4AB; Tue, 19 May 2020 07:47: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 04J7lxRB094767; Tue, 19 May 2020 07:47:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J7lxPG094766; Tue, 19 May 2020 07:47:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005190747.04J7lxPG094766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 19 May 2020 07:47:59 +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: r361244 - stable/12/include X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/include X-SVN-Commit-Revision: 361244 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, 19 May 2020 07:48:00 -0000 Author: kib Date: Tue May 19 07:47:59 2020 New Revision: 361244 URL: https://svnweb.freebsd.org/changeset/base/361244 Log: MFC r360983: Clear namespace pollution in include/malloc_np.h Modified: stable/12/include/malloc_np.h Directory Properties: stable/12/ (props changed) Modified: stable/12/include/malloc_np.h ============================================================================== --- stable/12/include/malloc_np.h Tue May 19 07:23:35 2020 (r361243) +++ stable/12/include/malloc_np.h Tue May 19 07:47:59 2020 (r361244) @@ -33,29 +33,33 @@ #ifndef _MALLOC_NP_H_ #define _MALLOC_NP_H_ -#include + #include -#include -#include +#ifdef __cplusplus +#define __MyBool bool +#else +#define __MyBool _Bool +#endif + __BEGIN_DECLS typedef struct extent_hooks_s extent_hooks_t; -typedef void *(extent_alloc_t)(extent_hooks_t *, void *, size_t, size_t, bool *, - bool *, unsigned); -typedef bool (extent_dalloc_t)(extent_hooks_t *, void *, size_t, bool, +typedef void *(extent_alloc_t)(extent_hooks_t *, void *, size_t, size_t, + __MyBool *, __MyBool *, unsigned); +typedef __MyBool (extent_dalloc_t)(extent_hooks_t *, void *, size_t, __MyBool, unsigned); -typedef void (extent_destroy_t)(extent_hooks_t *, void *, size_t, bool, +typedef void (extent_destroy_t)(extent_hooks_t *, void *, size_t, __MyBool, unsigned); -typedef bool (extent_commit_t)(extent_hooks_t *, void *, size_t, size_t, size_t, - unsigned); -typedef bool (extent_decommit_t)(extent_hooks_t *, void *, size_t, size_t, +typedef __MyBool (extent_commit_t)(extent_hooks_t *, void *, size_t, size_t, size_t, unsigned); -typedef bool (extent_purge_t)(extent_hooks_t *, void *, size_t, size_t, size_t, +typedef __MyBool (extent_decommit_t)(extent_hooks_t *, void *, size_t, size_t, + size_t, unsigned); +typedef __MyBool (extent_purge_t)(extent_hooks_t *, void *, size_t, size_t, size_t, unsigned); -typedef bool (extent_split_t)(extent_hooks_t *, void *, size_t, size_t, size_t, - bool, unsigned); -typedef bool (extent_merge_t)(extent_hooks_t *, void *, size_t, void *, size_t, - bool, unsigned); +typedef __MyBool (extent_split_t)(extent_hooks_t *, void *, size_t, size_t, size_t, + __MyBool, unsigned); +typedef __MyBool (extent_merge_t)(extent_hooks_t *, void *, size_t, void *, size_t, + __MyBool, unsigned); struct extent_hooks_s { extent_alloc_t *alloc; extent_dalloc_t *dalloc; @@ -119,5 +123,7 @@ void __dallocx(void *ptr, int flags); void __sdallocx(void *ptr, size_t size, int flags); size_t __nallocx(size_t size, int flags); __END_DECLS + +#undef __MyBool #endif /* _MALLOC_NP_H_ */ From owner-svn-src-all@freebsd.org Tue May 19 08:21: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 30F6D2FEED0; Tue, 19 May 2020 08:21:36 +0000 (UTC) (envelope-from kp@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 49R8400XLPz4BGG; Tue, 19 May 2020 08:21:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id D8A1029239; Tue, 19 May 2020 08:21:35 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 830A8439A5; Tue, 19 May 2020 10:21:33 +0200 (CEST) From: "Kristof Provost" To: "Eric Joyner" , "Jacob Keller" , shurd@FreeBSD.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347418 - head/sys/net Date: Tue, 19 May 2020 10:21:32 +0200 X-Mailer: MailMate (1.13.1r5671) Message-ID: <3BBFB371-EA44-4EE9-8A55-542CDE273CC4@FreeBSD.org> In-Reply-To: <201905100041.x4A0fhNT083122@repo.freebsd.org> References: <201905100041.x4A0fhNT083122@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit 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, 19 May 2020 08:21:36 -0000 On 10 May 2019, at 2:41, Eric Joyner wrote: > Author: erj > Date: Fri May 10 00:41:42 2019 > New Revision: 347418 > URL: https://svnweb.freebsd.org/changeset/base/347418 > > Log: > iflib: use default ntxd and nrxd when user value is not power of 2 > > From Jake: > A user may set a sysctl to override the default number of Tx or Rx > descriptors. However, certain calculations in the iflib core expect > the > number of descriptors to be a power of 2. > > Update _iflib_assert to verify that all of the shared context > parameters > for the number of descriptors are powers of 2. > > Modify iflib_reset_qvalues to check that the provided isc_nrxd value > is > a power of 2. If it's not, print a warning message and then use the > default value. > > An alternative might be to try rounding the number down instead. > However, this creates problems in case the rounded down value is > below > the minimum value that the driver would support. > This commit appears to trigger a panic I see on a system with a Broadcom BCM57416 (if_bnxt) nic. It trips over the power of two assertion: panic: Assertion powerof2(sctx->isc_nrxd_max[i]) failed at /usr/src/sys/net/iflib.c:5320 Tracing pid 0 tid 100000 td 0xffffffff81c8c640 kdb_enter() at kdb_enter+0x37/frame 0xffffffff825be990 vpanic() at vpanic+0x19e/frame 0xffffffff825be9e0 panic() at panic+0x43/frame 0xffffffff825bea40 iflib_register() at iflib_register+0x340/frame 0xffffffff825bea80 iflib_device_register() at iflib_device_register+0x9f/frame 0xffffffff825bee10 iflib_device_attach() at iflib_device_attach+0xb5/frame 0xffffffff825bee40 device_attach() at device_attach+0x3ca/frame 0xffffffff825bee80 device_probe_and_attach() at device_probe_and_attach+0x70/frame 0xffffffff825beeb0 bus_generic_attach() at bus_generic_attach+0x18/frame 0xffffffff825beed0 pci_attach() at pci_attach+0xe0/frame 0xffffffff825bef10 acpi_pci_attach() at acpi_pci_attach+0x19/frame 0xffffffff825bf150 device_attach() at device_attach+0x3ca/frame 0xffffffff825bf190 device_probe_and_attach() at device_probe_and_attach+0x70/frame 0xffffffff825bf1c0 bus_generic_attach() at bus_generic_attach+0x18/frame 0xffffffff825bf1e0 acpi_pcib_acpi_attach() at acpi_pcib_acpi_attach+0x431/frame 0xffffffff825bf250 device_attach() at device_attach+0x3ca/frame 0xffffffff825bf290 device_probe_and_attach() at device_probe_and_attach+0x70/frame 0xffffffff825bf2c0 bus_generic_attach() at bus_generic_attach+0x18/frame 0xffffffff825bf2e0 acpi_attach() at acpi_attach+0xbb7/frame 0xffffffff825bf370 device_attach() at device_attach+0x3ca/frame 0xffffffff825bf3b0 device_probe_and_attach() at device_probe_and_attach+0x70/frame 0xffffffff825bf3e0 bus_generic_attach() at bus_generic_attach+0x18/frame 0xffffffff825bf400 device_attach() at device_attach+0x3ca/frame 0xffffffff825bf440 device_probe_and_attach() at device_probe_and_attach+0x70/frame 0xffffffff825bf470 bus_generic_new_pass() at bus_generic_new_pass+0xed/frame 0xffffffff825bf4a0 bus_set_pass() at bus_set_pass+0x46/frame 0xffffffff825bf4d0 configure() at configure+0x9/frame 0xffffffff825bf4e0 mi_startup() at mi_startup+0xec/frame 0xffffffff825bf530 btext() at btext+0x2c The if_bnxt driver initialises `.isc_nrxd_max = {INT32_MAX, INT32_MAX, INT32_MAX},`, so presumably that’s the cause. I don’t know what a sane value would be though. I’ve defaulted to 4096 (because that’s what some other iflib users seems to do) for now, and that seems to work. It doesn’t panic and I can get traffic through it at least: diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 50827106024..3958d95cab9 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -316,11 +316,11 @@ static struct if_shared_ctx bnxt_sctx_init = { .isc_nrxd_default = {PAGE_SIZE / sizeof(struct cmpl_base) * 8, PAGE_SIZE / sizeof(struct rx_prod_pkt_bd), PAGE_SIZE / sizeof(struct rx_prod_pkt_bd)}, - .isc_nrxd_max = {INT32_MAX, INT32_MAX, INT32_MAX}, + .isc_nrxd_max = {4096, 4096, 4096}, .isc_ntxd_min = {16, 16, 16}, .isc_ntxd_default = {PAGE_SIZE / sizeof(struct cmpl_base) * 2, PAGE_SIZE / sizeof(struct tx_bd_short)}, - .isc_ntxd_max = {INT32_MAX, INT32_MAX, INT32_MAX}, + .isc_ntxd_max = {4096, 4096, 4096}, .isc_admin_intrcnt = 1, .isc_vendor_info = bnxt_vendor_info_array, Best regards, Kristof From owner-svn-src-all@freebsd.org Tue May 19 08:43: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 292922FFC07; Tue, 19 May 2020 08:43:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49R8Y209fFz4CNH; Tue, 19 May 2020 08:43:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 011538420; Tue, 19 May 2020 08:43:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J8hHAP031773; Tue, 19 May 2020 08:43:17 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J8hHb1031772; Tue, 19 May 2020 08:43:17 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005190843.04J8hHb1031772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 19 May 2020 08:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361245 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361245 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, 19 May 2020 08:43:18 -0000 Author: manu Date: Tue May 19 08:43:17 2020 New Revision: 361245 URL: https://svnweb.freebsd.org/changeset/base/361245 Log: linuxkpi: Add __init_waitqueue_head The only difference with init_waitqueue_head is that the name and the lock class key are provided but we don't use those so use init_waitqueue_head directly. Sponsored-by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24861 Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/wait.h Tue May 19 07:47:59 2020 (r361244) +++ head/sys/compat/linuxkpi/common/include/linux/wait.h Tue May 19 08:43:17 2020 (r361245) @@ -119,6 +119,8 @@ extern wait_queue_func_t default_wake_function; INIT_LIST_HEAD(&(wqh)->task_list); \ } while (0) +#define __init_waitqueue_head(wqh, name, lk) init_waitqueue_head(wqh) + void linux_init_wait_entry(wait_queue_t *, int); void linux_wake_up(wait_queue_head_t *, unsigned int, int, bool); From owner-svn-src-all@freebsd.org Tue May 19 08: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 DBC8C2FF6EE; Tue, 19 May 2020 08:44:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49R8ZT5WG4z4CqH; Tue, 19 May 2020 08:44:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B88668318; Tue, 19 May 2020 08:44:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J8iXDw031894; Tue, 19 May 2020 08:44:33 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J8iXrB031893; Tue, 19 May 2020 08:44:33 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005190844.04J8iXrB031893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 19 May 2020 08:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361246 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361246 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, 19 May 2020 08:44:33 -0000 Author: manu Date: Tue May 19 08:44:33 2020 New Revision: 361246 URL: https://svnweb.freebsd.org/changeset/base/361246 Log: linuxkpi: add pci_dev_present pci_dev_present shows if a set of pci ids are present in the system. It just wraps pci_find_device. Needed by DRMv5.2 Submitted by: Austing Shafer (ashafer@badland.io) Differential Revision: https://reviews.freebsd.org/D24796 Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Tue May 19 08:43:17 2020 (r361245) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Tue May 19 08:44:33 2020 (r361246) @@ -1050,4 +1050,16 @@ extern int linux_pci_attach_device(device_t, struct pc const struct pci_device_id *, struct pci_dev *); extern int linux_pci_detach_device(struct pci_dev *); +static inline int +pci_dev_present(const struct pci_device_id *cur) +{ + while (cur != NULL && (cur->vendor || cur->device)) { + if (pci_find_device(cur->vendor, cur->device) != NULL) { + return (1); + } + cur++; + } + return (0); +} + #endif /* _LINUX_PCI_H_ */ From owner-svn-src-all@freebsd.org Tue May 19 09:04: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 A193F2C81D3; Tue, 19 May 2020 09:04:35 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49R91b3shHz4Dxp; Tue, 19 May 2020 09:04:35 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FF378668; Tue, 19 May 2020 09:04:35 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J94ZDi044117; Tue, 19 May 2020 09:04:35 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J94ZqJ044116; Tue, 19 May 2020 09:04:35 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005190904.04J94ZqJ044116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 19 May 2020 09:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361247 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361247 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, 19 May 2020 09:04:35 -0000 Author: manu Date: Tue May 19 09:04:35 2020 New Revision: 361247 URL: https://svnweb.freebsd.org/changeset/base/361247 Log: linuxkpi: Add irq_work.h Since handlers are call in a thread context we can simply use a workqueue to emulate those functions. The DRM code was patched to do that already, having it in linuxkpi allows us to not patch the upstream code. Sponsored-by: The FreeBSD Foundation Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D24859 Added: head/sys/compat/linuxkpi/common/include/linux/irq_work.h (contents, props changed) Added: head/sys/compat/linuxkpi/common/include/linux/irq_work.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/irq_work.h Tue May 19 09:04:35 2020 (r361247) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Emmanuel Vadot under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __LINUX_IRQ_WORK_H__ +#define __LINUX_IRQ_WORK_H__ + +#include + +struct irq_work { + struct work_struct work; +}; + +static inline void +init_irq_work(struct irq_work *irqw, void (*func)(struct irq_work *)) +{ + INIT_WORK(&irqw->work, (work_func_t)func); +} + +static inline void +irq_work_queue(struct irq_work *irqw) +{ + schedule_work(&irqw->work); +} + +#endif /* __LINUX_IRQ_WORK_H__ */ From owner-svn-src-all@freebsd.org Tue May 19 09: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 B0B272C85E4; Tue, 19 May 2020 09:17:21 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49R9JK48bSz4Fx2; Tue, 19 May 2020 09:17:21 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8531F86C5; Tue, 19 May 2020 09:17:21 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J9HLFu050340; Tue, 19 May 2020 09:17:21 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J9HLZS050339; Tue, 19 May 2020 09:17:21 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <202005190917.04J9HLZS050339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Tue, 19 May 2020 09:17:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361248 - head/usr.bin/sed X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/usr.bin/sed X-SVN-Commit-Revision: 361248 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, 19 May 2020 09:17:21 -0000 Author: bcr (doc committer) Date: Tue May 19 09:17:20 2020 New Revision: 361248 URL: https://svnweb.freebsd.org/changeset/base/361248 Log: Update SYNOPSIS section to be consistent regarding -u, -i, and -I. Apparently, when the -u, -i and -I options where added to sed(1), it was forgotten to add them to both lines in the SYNOPSIS section. They were only added to the second line, although they apply to both. With the updated SYNOPSIS, it is now allowed (and consistent) to run: sed -i BAK s/foo/bar/g some_file PR: 240556 Submitted by: Oliver Fromme MFC after: 5 days Modified: head/usr.bin/sed/sed.1 Modified: head/usr.bin/sed/sed.1 ============================================================================== --- head/usr.bin/sed/sed.1 Tue May 19 09:04:35 2020 (r361247) +++ head/usr.bin/sed/sed.1 Tue May 19 09:17:20 2020 (r361248) @@ -31,7 +31,7 @@ .\" @(#)sed.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd March 27, 2017 +.Dd May 19, 2020 .Dt SED 1 .Os .Sh NAME @@ -41,9 +41,11 @@ .Nm .Op Fl Ealnru .Ar command +.Op Fl I Ar extension +.Op Fl i Ar extension .Op Ar .Nm -.Op Fl Ealnr +.Op Fl Ealnru .Op Fl e Ar command .Op Fl f Ar command_file .Op Fl I Ar extension @@ -197,7 +199,8 @@ option was specified); .It a context address that consists of a regular expression preceded and followed by a -delimiter. The closing delimiter can also optionally be followed by the +delimiter. +The closing delimiter can also optionally be followed by the .Dq I character, to indicate that the regular expression is to be matched in a case-insensitive way. From owner-svn-src-all@freebsd.org Tue May 19 11:05: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 513952CB692; Tue, 19 May 2020 11:05:28 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RCj41Sthz4N8R; Tue, 19 May 2020 11:05:28 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D98E97DF; Tue, 19 May 2020 11:05:28 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JB5RwT018410; Tue, 19 May 2020 11:05:27 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JB5RIB018409; Tue, 19 May 2020 11:05:27 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <202005191105.04JB5RIB018409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Tue, 19 May 2020 11:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361249 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 361249 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, 19 May 2020 11:05:28 -0000 Author: bcr (doc committer) Date: Tue May 19 11:05:27 2020 New Revision: 361249 URL: https://svnweb.freebsd.org/changeset/base/361249 Log: Fix a typo: argments -> arguments PR: 243294 Submitted by: Igor Ostapenko MFC after: 5 days Modified: head/lib/libc/stdlib/getopt_long.3 Modified: head/lib/libc/stdlib/getopt_long.3 ============================================================================== --- head/lib/libc/stdlib/getopt_long.3 Tue May 19 09:17:20 2020 (r361248) +++ head/lib/libc/stdlib/getopt_long.3 Tue May 19 11:05:27 2020 (r361249) @@ -244,7 +244,7 @@ matching the default behavior of .Xr getopt 3 . The default behavior without .Ql \&+ -is to permute non-option argments to the end of +is to permute non-option arguments to the end of .Fa argv . .Pp A leading From owner-svn-src-all@freebsd.org Tue May 19 12:16: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 9776A2CDC6D; Tue, 19 May 2020 12:16:44 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RFHJ3PHQz4Rky; Tue, 19 May 2020 12:16:44 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70061AC7E; Tue, 19 May 2020 12:16:44 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JCGiIE060774; Tue, 19 May 2020 12:16:44 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JCGiBi060773; Tue, 19 May 2020 12:16:44 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <202005191216.04JCGiBi060773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Tue, 19 May 2020 12:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361250 - head/sbin/swapon X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/sbin/swapon X-SVN-Commit-Revision: 361250 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, 19 May 2020 12:16:44 -0000 Author: bcr (doc committer) Date: Tue May 19 12:16:44 2020 New Revision: 361250 URL: https://svnweb.freebsd.org/changeset/base/361250 Log: The -F flag of swapon(8) requires -a to work. Before this change, swapon(8) implied that -F works as a standalone option, which is not the case and would produce a usage message. This change extends the description of the -F option to mention that -a is required with it. PR: 238551 Submitted by: Christian Baltini MFC after: 5 days Modified: head/sbin/swapon/swapon.8 Modified: head/sbin/swapon/swapon.8 ============================================================================== --- head/sbin/swapon/swapon.8 Tue May 19 11:05:27 2020 (r361249) +++ head/sbin/swapon/swapon.8 Tue May 19 12:16:44 2020 (r361250) @@ -28,7 +28,7 @@ .\" @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 21, 2019 +.Dd May 19, 2020 .Dt SWAPON 8 .Os .Sh NAME @@ -98,7 +98,7 @@ To delay .Nm swapon for a device until after .Nm savecore -has copied the crash dump to another location, use the +has copied the crash dump to another location, use the .Dq late option. .Pp @@ -143,7 +143,8 @@ are as follows: .It Fl F Ar fstab Specify the .Pa fstab -file to use. +file to use (in conjunction with +.Fl a Ns ). .El .Pp The From owner-svn-src-all@freebsd.org Tue May 19 13: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 469DB2CFD48; Tue, 19 May 2020 13:44:33 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RHDd1F7bz4XK6; Tue, 19 May 2020 13:44:33 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25FB7BD06; Tue, 19 May 2020 13:44:33 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JDiXAS015695; Tue, 19 May 2020 13:44:33 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JDiWF2015694; Tue, 19 May 2020 13:44:32 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <202005191344.04JDiWF2015694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Tue, 19 May 2020 13:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361251 - head/usr.sbin/bluetooth/hccontrol X-SVN-Group: head X-SVN-Commit-Author: takawata X-SVN-Commit-Paths: head/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361251 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, 19 May 2020 13:44:33 -0000 Author: takawata Date: Tue May 19 13:44:32 2020 New Revision: 361251 URL: https://svnweb.freebsd.org/changeset/base/361251 Log: Add LE Whitelist commands to hccontrol PR: 214555 Submitted by Marc Veldman Modified: head/usr.sbin/bluetooth/hccontrol/hccontrol.8 head/usr.sbin/bluetooth/hccontrol/le.c Modified: head/usr.sbin/bluetooth/hccontrol/hccontrol.8 ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/hccontrol.8 Tue May 19 12:16:44 2020 (r361250) +++ head/usr.sbin/bluetooth/hccontrol/hccontrol.8 Tue May 19 13:44:32 2020 (r361251) @@ -157,6 +157,10 @@ are: .It Cm LE_Read_Supported_States .It Cm LE_Read_Buffer_Size .It Cm LE Scan +.It Cm LE_Read_White_List_Size +.It Cm LE_Clear_White_List +.It Cm LE_Add_Device_To_White_List +.It Cm LE_Remove_Device_From_White_List .El .Pp The currently supported node commands in Modified: head/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/le.c Tue May 19 12:16:44 2020 (r361250) +++ head/usr.sbin/bluetooth/hccontrol/le.c Tue May 19 13:44:32 2020 (r361251) @@ -63,6 +63,10 @@ static int le_set_advertising_param(int s, int argc, c static int le_read_advertising_channel_tx_power(int s, int argc, char *argv[]); static int le_scan(int s, int argc, char *argv[]); static void handle_le_event(ng_hci_event_pkt_t* e, bool verbose); +static int le_read_white_list_size(int s, int argc, char *argv[]); +static int le_clear_white_list(int s, int argc, char *argv[]); +static int le_add_device_to_white_list(int s, int argc, char *argv[]); +static int le_remove_device_from_white_list(int s, int argc, char *argv[]); static int le_set_scan_param(int s, int argc, char *argv[]) @@ -762,6 +766,173 @@ static void handle_le_event(ng_hci_event_pkt_t* e, boo } } +static int +le_read_white_list_size(int s, int argc, char *argv[]) +{ + ng_hci_le_read_white_list_size_rp rp; + int n; + + n = sizeof(rp); + + if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_READ_WHITE_LIST_SIZE), + (void *)&rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + fprintf(stdout, "White list size: %d\n", + (uint8_t)rp.white_list_size); + + return (OK); +} + +static int +le_clear_white_list(int s, int argc, char *argv[]) +{ + ng_hci_le_clear_white_list_rp rp; + int n; + + n = sizeof(rp); + + if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_CLEAR_WHITE_LIST), + (void *)&rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + fprintf(stdout, "White list cleared\n"); + + return (OK); +} + +static int +le_add_device_to_white_list(int s, int argc, char *argv[]) +{ + ng_hci_le_add_device_to_white_list_cp cp; + ng_hci_le_add_device_to_white_list_rp rp; + int n; + char ch; + optreset = 1; + optind = 0; + bool addr_set = false; + + n = sizeof(rp); + + cp.address_type = 0x00; + + while ((ch = getopt(argc, argv , "t:a:")) != -1) { + switch(ch) { + case 't': + if (strcmp(optarg, "public") == 0) + cp.address_type = 0x00; + else if (strcmp(optarg, "random") == 0) + cp.address_type = 0x01; + else + return (USAGE); + break; + case 'a': + addr_set = true; + if (!bt_aton(optarg, &cp.address)) { + struct hostent *he = NULL; + + if ((he = bt_gethostbyname(optarg)) == NULL) + return (USAGE); + + memcpy(&cp.address, he->h_addr, + sizeof(cp.address)); + } + break; + } + } + + if (addr_set == false) + return (USAGE); + + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_ADD_DEVICE_TO_WHITE_LIST), + (void *)&cp, sizeof(cp), (void *)&rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + fprintf(stdout, "Address added to white list\n"); + + return (OK); +} + +static int +le_remove_device_from_white_list(int s, int argc, char *argv[]) +{ + ng_hci_le_remove_device_from_white_list_cp cp; + ng_hci_le_remove_device_from_white_list_rp rp; + int n; + char ch; + optreset = 1; + optind = 0; + bool addr_set = false; + + n = sizeof(rp); + + cp.address_type = 0x00; + + while ((ch = getopt(argc, argv , "t:a:")) != -1) { + switch(ch) { + case 't': + if (strcmp(optarg, "public") == 0) + cp.address_type = 0x00; + else if (strcmp(optarg, "random") == 0) + cp.address_type = 0x01; + else + return (USAGE); + break; + case 'a': + addr_set = true; + if (!bt_aton(optarg, &cp.address)) { + struct hostent *he = NULL; + + if ((he = bt_gethostbyname(optarg)) == NULL) + return (USAGE); + + memcpy(&cp.address, he->h_addr, + sizeof(cp.address)); + } + break; + } + } + + if (addr_set == false) + return (USAGE); + + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_ADD_DEVICE_TO_WHITE_LIST), + (void *)&cp, sizeof(cp), (void *)&rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + fprintf(stdout, "Address removed from white list\n"); + + return (OK); +} + struct hci_command le_commands[] = { { "le_enable", @@ -839,5 +1010,31 @@ struct hci_command le_commands[] = { "le_scan [-a] [-v] [-n number_of_scans]\n" "Do an LE scan", &le_scan + }, + { + "le_read_white_list_size", + "le_read_white_list_size\n" + "Read total number of white list entries that can be stored", + &le_read_white_list_size + }, + { + "le_clear_white_list", + "le_clear_white_list\n" + "Clear the white list in the controller", + &le_clear_white_list + }, + { + "le_add_device_to_white_list", + "le_add_device_to_white_list\n" + "[-t public|random] -a address\n" + "Add device to the white list", + &le_add_device_to_white_list + }, + { + "le_remove_device_from_white_list", + "le_remove_device_from_white_list\n" + "[-t public|random] -a address\n" + "Remove device from the white list", + &le_remove_device_from_white_list }, }; From owner-svn-src-all@freebsd.org Tue May 19 13:52: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 38D8B2D848B; Tue, 19 May 2020 13:52:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RHPv0pMXz4XtP; Tue, 19 May 2020 13:52:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16BC6BD1F; Tue, 19 May 2020 13:52:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JDqYj6021807; Tue, 19 May 2020 13:52:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JDqYh1021805; Tue, 19 May 2020 13:52:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202005191352.04JDqYh1021805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 19 May 2020 13:52:34 +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: r361252 - stable/12/sys/cam/ctl X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam/ctl X-SVN-Commit-Revision: 361252 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, 19 May 2020 13:52:35 -0000 Author: mav Date: Tue May 19 13:52:34 2020 New Revision: 361252 URL: https://svnweb.freebsd.org/changeset/base/361252 Log: MFC r359686: Fix panic on kern.cam.ctl.ha_role change after r333446. Modified: stable/12/sys/cam/ctl/ctl_backend_block.c stable/12/sys/cam/ctl/ctl_backend_ramdisk.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/12/sys/cam/ctl/ctl_backend_block.c Tue May 19 13:44:32 2020 (r361251) +++ stable/12/sys/cam/ctl/ctl_backend_block.c Tue May 19 13:52:34 2020 (r361252) @@ -2586,8 +2586,10 @@ ctl_be_block_modify(struct ctl_be_block_softc *softc, if (params->lun_size_bytes != 0) be_lun->params.lun_size_bytes = params->lun_size_bytes; - nvlist_destroy(cbe_lun->options); - cbe_lun->options = nvlist_clone(req->args_nvl); + if (req->args_nvl != NULL) { + nvlist_destroy(cbe_lun->options); + cbe_lun->options = nvlist_clone(req->args_nvl); + } wasprim = (cbe_lun->flags & CTL_LUN_FLAG_PRIMARY); value = dnvlist_get_string(cbe_lun->options, "ha_role", NULL); Modified: stable/12/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/12/sys/cam/ctl/ctl_backend_ramdisk.c Tue May 19 13:44:32 2020 (r361251) +++ stable/12/sys/cam/ctl/ctl_backend_ramdisk.c Tue May 19 13:52:34 2020 (r361252) @@ -1252,8 +1252,10 @@ ctl_backend_ramdisk_modify(struct ctl_be_ramdisk_softc if (params->lun_size_bytes != 0) be_lun->params.lun_size_bytes = params->lun_size_bytes; - nvlist_destroy(cbe_lun->options); - cbe_lun->options = nvlist_clone(req->args_nvl); + if (req->args_nvl != NULL) { + nvlist_destroy(cbe_lun->options); + cbe_lun->options = nvlist_clone(req->args_nvl); + } wasprim = (cbe_lun->flags & CTL_LUN_FLAG_PRIMARY); value = dnvlist_get_string(cbe_lun->options, "ha_role", NULL); From owner-svn-src-all@freebsd.org Tue May 19 13:54: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 764652D87C1; Tue, 19 May 2020 13:54: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 49RHSB2Sr3z4YHn; Tue, 19 May 2020 13:54: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 4FFEAB5F8; Tue, 19 May 2020 13:54: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 04JDsYMs021947; Tue, 19 May 2020 13:54:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JDsYC8021946; Tue, 19 May 2020 13:54:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005191354.04JDsYC8021946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 19 May 2020 13:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361253 - head X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 361253 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, 19 May 2020 13:54:34 -0000 Author: markj Date: Tue May 19 13:54:33 2020 New Revision: 361253 URL: https://svnweb.freebsd.org/changeset/base/361253 Log: Belatedly add a RELNOTES entry for r347532. Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Tue May 19 13:52:34 2020 (r361252) +++ head/RELNOTES Tue May 19 13:54:33 2020 (r361253) @@ -174,4 +174,10 @@ r347908-r347923: ed(4), ep(4), ex(4), fe(4), pcn(4), sf(4), sn(4), tl(4), tx(4), txp(4), vx(4), wb(4), xe(4). +r347532: + Wired page accounting has been split into kernel wirings and user + wirings (e.g., by mlock(2)). Kernel wirings no long count towards + the global limit, which is renamed to vm.max_user_wired. bhyve -S + allocates user-wired memory and is now subject to that limit. + $FreeBSD$ From owner-svn-src-all@freebsd.org Tue May 19 13:58: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 8816E2D88FB; Tue, 19 May 2020 13:58:53 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RHY92Gyyz4Yd1; Tue, 19 May 2020 13:58:53 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49431B5FA; Tue, 19 May 2020 13:58:53 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JDwr2A022202; Tue, 19 May 2020 13:58:53 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JDwrhv022201; Tue, 19 May 2020 13:58:53 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <202005191358.04JDwrhv022201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Tue, 19 May 2020 13:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361254 - head/sys/netgraph/bluetooth/include X-SVN-Group: head X-SVN-Commit-Author: takawata X-SVN-Commit-Paths: head/sys/netgraph/bluetooth/include X-SVN-Commit-Revision: 361254 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, 19 May 2020 13:58:53 -0000 Author: takawata Date: Tue May 19 13:58:52 2020 New Revision: 361254 URL: https://svnweb.freebsd.org/changeset/base/361254 Log: Fix Typo in ng_hci_le_connection_complete_ep struct. PR: 246538 Submitted by: Marc Veldman Modified: head/sys/netgraph/bluetooth/include/ng_hci.h Modified: head/sys/netgraph/bluetooth/include/ng_hci.h ============================================================================== --- head/sys/netgraph/bluetooth/include/ng_hci.h Tue May 19 13:54:33 2020 (r361253) +++ head/sys/netgraph/bluetooth/include/ng_hci.h Tue May 19 13:58:52 2020 (r361254) @@ -1964,7 +1964,7 @@ typedef struct { u_int16_t interval; u_int8_t latency; u_int16_t supervision_timeout; - u_int8_t master_clock_accracy; + u_int8_t master_clock_accuracy; } __attribute__ ((packed)) ng_hci_le_connection_complete_ep; From owner-svn-src-all@freebsd.org Tue May 19 14:31: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 BA7DA2D9FDC; Tue, 19 May 2020 14:31:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RJH84pYhz4c3w; Tue, 19 May 2020 14:31:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FE2DC3AC; Tue, 19 May 2020 14:31:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JEVmUf043466; Tue, 19 May 2020 14:31:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JEVl0K043460; Tue, 19 May 2020 14:31:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202005191431.04JEVl0K043460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 19 May 2020 14:31: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: r361255 - stable/12/sys/cam/ctl X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam/ctl X-SVN-Commit-Revision: 361255 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, 19 May 2020 14:31:48 -0000 Author: mav Date: Tue May 19 14:31:47 2020 New Revision: 361255 URL: https://svnweb.freebsd.org/changeset/base/361255 Log: MFC r360564: Cleanup LUN addition/removal. - Make ctl_add_lun() synchronous. Asynchronous addition was used by Copan's proprietary code long ago and never for upstream FreeBSD. - Move LUN enable/disable calls from backends to CTL core. - Serialize LUN modification and partially removal to avoid double frees. - Slightly unify backends code. Modified: stable/12/sys/cam/ctl/ctl.c stable/12/sys/cam/ctl/ctl_backend.c stable/12/sys/cam/ctl/ctl_backend.h stable/12/sys/cam/ctl/ctl_backend_block.c stable/12/sys/cam/ctl/ctl_backend_ramdisk.c stable/12/sys/cam/ctl/ctl_private.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/ctl/ctl.c ============================================================================== --- stable/12/sys/cam/ctl/ctl.c Tue May 19 13:58:52 2020 (r361254) +++ stable/12/sys/cam/ctl/ctl.c Tue May 19 14:31:47 2020 (r361255) @@ -468,10 +468,9 @@ static void ctl_ioctl_fill_ooa(struct ctl_lun *lun, ui struct ctl_ooa_entry *kern_entries); static int ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td); -static int ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_lun *lun, - struct ctl_be_lun *be_lun); +static int ctl_enable_lun(struct ctl_lun *lun); +static int ctl_disable_lun(struct ctl_lun *lun); static int ctl_free_lun(struct ctl_lun *lun); -static void ctl_create_lun(struct ctl_be_lun *be_lun); static int ctl_do_mode_select(union ctl_io *io); static int ctl_pro_preempt(struct ctl_softc *softc, struct ctl_lun *lun, @@ -546,7 +545,6 @@ static int ctl_datamove_remote_xfer(union ctl_io *io, static void ctl_datamove_remote_read(union ctl_io *io); static void ctl_datamove_remote(union ctl_io *io); static void ctl_process_done(union ctl_io *io); -static void ctl_lun_thread(void *arg); static void ctl_thresh_thread(void *arg); static void ctl_work_thread(void *arg); static void ctl_enqueue_incoming(union ctl_io *io); @@ -1944,7 +1942,6 @@ ctl_init(void) "HA link state (0 - offline, 1 - unknown, 2 - online)"); STAILQ_INIT(&softc->lun_list); - STAILQ_INIT(&softc->pending_lun_queue); STAILQ_INIT(&softc->fe_list); STAILQ_INIT(&softc->port_list); STAILQ_INIT(&softc->be_list); @@ -1972,12 +1969,6 @@ ctl_init(void) return (error); } } - error = kproc_kthread_add(ctl_lun_thread, softc, - &softc->ctl_proc, &softc->lun_thread, 0, 0, "ctl", "lun"); - if (error != 0) { - printf("error creating CTL lun thread!\n"); - return (error); - } error = kproc_kthread_add(ctl_thresh_thread, softc, &softc->ctl_proc, &softc->thresh_thread, 0, 0, "ctl", "thresh"); if (error != 0) { @@ -2018,11 +2009,6 @@ ctl_shutdown(void) } mtx_destroy(&thr->queue_lock); } - while (softc->lun_thread != NULL) { - wakeup(&softc->pending_lun_queue); - if (softc->lun_thread != NULL) - pause("CTL thr shutdown", 1); - } while (softc->thresh_thread != NULL) { wakeup(softc->thresh_thread); if (softc->thresh_thread != NULL) @@ -4495,32 +4481,23 @@ hex2bin(const char *str, uint8_t *buf, int buf_size) } /* - * LUN allocation. + * Add LUN. * - * Requirements: - * - caller allocates and zeros LUN storage, or passes in a NULL LUN if he - * wants us to allocate the LUN and he can block. - * - ctl_softc is always set - * - be_lun is set if the LUN has a backend (needed for disk LUNs) - * * Returns 0 for success, non-zero (errno) for failure. */ -static int -ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_lun *ctl_lun, - struct ctl_be_lun *const be_lun) +int +ctl_add_lun(struct ctl_be_lun *be_lun) { + struct ctl_softc *ctl_softc = control_softc; struct ctl_lun *nlun, *lun; struct scsi_vpd_id_descriptor *desc; struct scsi_vpd_id_t10 *t10id; const char *eui, *naa, *scsiname, *uuid, *vendor, *value; - int lun_number, lun_malloced; + int lun_number; int devidlen, idlen1, idlen2 = 0, len; - if (be_lun == NULL) - return (EINVAL); - /* - * We currently only support Direct Access or Processor LUN types. + * We support only Direct Access, CD-ROM or Processor LUN types. */ switch (be_lun->lun_type) { case T_DIRECT: @@ -4530,22 +4507,10 @@ ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_ case T_SEQUENTIAL: case T_CHANGER: default: - be_lun->lun_config_status(be_lun->be_lun, - CTL_LUN_CONFIG_FAILURE); - break; + return (EINVAL); } - if (ctl_lun == NULL) { - lun = malloc(sizeof(*lun), M_CTL, M_WAITOK); - lun_malloced = 1; - } else { - lun_malloced = 0; - lun = ctl_lun; - } + lun = malloc(sizeof(*lun), M_CTL, M_WAITOK | M_ZERO); - memset(lun, 0, sizeof(*lun)); - if (lun_malloced) - lun->flags = CTL_LUN_MALLOCED; - lun->pending_sense = malloc(sizeof(struct scsi_sense_data *) * ctl_max_ports, M_DEVBUF, M_WAITOK | M_ZERO); lun->pending_ua = malloc(sizeof(ctl_ua_type *) * ctl_max_ports, @@ -4656,10 +4621,7 @@ ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_ } fail: free(lun->lun_devid, M_CTL); - if (lun->flags & CTL_LUN_MALLOCED) - free(lun, M_CTL); - be_lun->lun_config_status(be_lun->be_lun, - CTL_LUN_CONFIG_FAILURE); + free(lun, M_CTL); return (ENOSPC); } lun_number = be_lun->req_lun_id; @@ -4685,7 +4647,6 @@ fail: lun->backend = be_lun->be; be_lun->ctl_lun = lun; be_lun->lun_id = lun_number; - atomic_add_int(&be_lun->be->num_luns, 1); if (be_lun->flags & CTL_LUN_FLAG_EJECTED) lun->flags |= CTL_LUN_EJECTED; if (be_lun->flags & CTL_LUN_FLAG_NO_MEDIA) @@ -4741,15 +4702,27 @@ fail: ctl_softc->num_luns++; mtx_unlock(&ctl_softc->ctl_lock); - lun->be_lun->lun_config_status(lun->be_lun->be_lun, CTL_LUN_CONFIG_OK); + /* + * We successfully added the LUN, attempt to enable it. + */ + if (ctl_enable_lun(lun) != 0) { + printf("%s: ctl_enable_lun() failed!\n", __func__); + mtx_lock(&ctl_softc->ctl_lock); + STAILQ_REMOVE(&ctl_softc->lun_list, lun, ctl_lun, links); + ctl_clear_mask(ctl_softc->ctl_lun_mask, lun_number); + ctl_softc->ctl_luns[lun_number] = NULL; + ctl_softc->num_luns--; + mtx_unlock(&ctl_softc->ctl_lock); + free(lun->lun_devid, M_CTL); + free(lun, M_CTL); + return (EIO); + } + return (0); } /* - * Delete a LUN. - * Assumptions: - * - LUN has already been marked invalid and any pending I/O has been taken - * care of. + * Free LUN that has no active requests. */ static int ctl_free_lun(struct ctl_lun *lun) @@ -4776,7 +4749,6 @@ ctl_free_lun(struct ctl_lun *lun) /* * Tell the backend to free resources, if this LUN has a backend. */ - atomic_subtract_int(&lun->be_lun->be->num_luns, 1); lun->be_lun->lun_shutdown(lun->be_lun->be_lun); lun->ie_reportcnt = UINT32_MAX; @@ -4792,57 +4764,24 @@ ctl_free_lun(struct ctl_lun *lun) free(lun->pr_keys, M_DEVBUF); free(lun->write_buffer, M_CTL); free(lun->prevent, M_CTL); - if (lun->flags & CTL_LUN_MALLOCED) - free(lun, M_CTL); + free(lun, M_CTL); return (0); } -static void -ctl_create_lun(struct ctl_be_lun *be_lun) +static int +ctl_enable_lun(struct ctl_lun *lun) { - - /* - * ctl_alloc_lun() should handle all potential failure cases. - */ - ctl_alloc_lun(control_softc, NULL, be_lun); -} - -int -ctl_add_lun(struct ctl_be_lun *be_lun) -{ - struct ctl_softc *softc = control_softc; - - mtx_lock(&softc->ctl_lock); - STAILQ_INSERT_TAIL(&softc->pending_lun_queue, be_lun, links); - mtx_unlock(&softc->ctl_lock); - wakeup(&softc->pending_lun_queue); - - return (0); -} - -int -ctl_enable_lun(struct ctl_be_lun *be_lun) -{ struct ctl_softc *softc; struct ctl_port *port, *nport; - struct ctl_lun *lun; int retval; - lun = (struct ctl_lun *)be_lun->ctl_lun; softc = lun->ctl_softc; mtx_lock(&softc->ctl_lock); mtx_lock(&lun->lun_lock); - if ((lun->flags & CTL_LUN_DISABLED) == 0) { - /* - * eh? Why did we get called if the LUN is already - * enabled? - */ - mtx_unlock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - return (0); - } + KASSERT((lun->flags & CTL_LUN_DISABLED) != 0, + ("%s: LUN not disabled", __func__)); lun->flags &= ~CTL_LUN_DISABLED; mtx_unlock(&lun->lun_lock); @@ -4873,24 +4812,19 @@ ctl_enable_lun(struct ctl_be_lun *be_lun) return (0); } -int -ctl_disable_lun(struct ctl_be_lun *be_lun) +static int +ctl_disable_lun(struct ctl_lun *lun) { struct ctl_softc *softc; struct ctl_port *port; - struct ctl_lun *lun; int retval; - lun = (struct ctl_lun *)be_lun->ctl_lun; softc = lun->ctl_softc; mtx_lock(&softc->ctl_lock); mtx_lock(&lun->lun_lock); - if (lun->flags & CTL_LUN_DISABLED) { - mtx_unlock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - return (0); - } + KASSERT((lun->flags & CTL_LUN_DISABLED) == 0, + ("%s: LUN not enabled", __func__)); lun->flags |= CTL_LUN_DISABLED; mtx_unlock(&lun->lun_lock); @@ -5021,25 +4955,22 @@ ctl_lun_secondary(struct ctl_be_lun *be_lun) return (0); } +/* + * Remove LUN. If there are active requests, wait for completion. + * + * Returns 0 for success, non-zero (errno) for failure. + * Completion is reported to backed via the lun_shutdown() method. + */ int -ctl_invalidate_lun(struct ctl_be_lun *be_lun) +ctl_remove_lun(struct ctl_be_lun *be_lun) { struct ctl_lun *lun; lun = (struct ctl_lun *)be_lun->ctl_lun; - mtx_lock(&lun->lun_lock); + ctl_disable_lun(lun); - /* - * The LUN needs to be disabled before it can be marked invalid. - */ - if ((lun->flags & CTL_LUN_DISABLED) == 0) { - mtx_unlock(&lun->lun_lock); - return (-1); - } - /* - * Mark the LUN invalid. - */ + mtx_lock(&lun->lun_lock); lun->flags |= CTL_LUN_INVALID; /* @@ -13398,35 +13329,6 @@ ctl_work_thread(void *arg) mtx_sleep(thr, &thr->queue_lock, PDROP, "-", 0); } thr->thread = NULL; - kthread_exit(); -} - -static void -ctl_lun_thread(void *arg) -{ - struct ctl_softc *softc = (struct ctl_softc *)arg; - struct ctl_be_lun *be_lun; - - CTL_DEBUG_PRINT(("ctl_lun_thread starting\n")); - thread_lock(curthread); - sched_prio(curthread, PUSER - 1); - thread_unlock(curthread); - - while (!softc->shutdown) { - mtx_lock(&softc->ctl_lock); - be_lun = STAILQ_FIRST(&softc->pending_lun_queue); - if (be_lun != NULL) { - STAILQ_REMOVE_HEAD(&softc->pending_lun_queue, links); - mtx_unlock(&softc->ctl_lock); - ctl_create_lun(be_lun); - continue; - } - - /* Sleep until we have something to do. */ - mtx_sleep(&softc->pending_lun_queue, &softc->ctl_lock, - PDROP, "-", 0); - } - softc->lun_thread = NULL; kthread_exit(); } Modified: stable/12/sys/cam/ctl/ctl_backend.c ============================================================================== --- stable/12/sys/cam/ctl/ctl_backend.c Tue May 19 13:58:52 2020 (r361254) +++ stable/12/sys/cam/ctl/ctl_backend.c Tue May 19 14:31:47 2020 (r361255) @@ -83,7 +83,6 @@ ctl_backend_register(struct ctl_backend_driver *be) #ifdef CS_BE_CONFIG_MOVE_DONE_IS_NOT_USED be->config_move_done = ctl_config_move_done; #endif - be->num_luns = 0; /* Call the backend's initialization routine. */ if (be->init != NULL) { Modified: stable/12/sys/cam/ctl/ctl_backend.h ============================================================================== --- stable/12/sys/cam/ctl/ctl_backend.h Tue May 19 13:58:52 2020 (r361254) +++ stable/12/sys/cam/ctl/ctl_backend.h Tue May 19 14:31:47 2020 (r361255) @@ -80,14 +80,7 @@ typedef enum { MODULE_DEPEND(name, cam, 1, 1, 1) -typedef enum { - CTL_LUN_CONFIG_OK, - CTL_LUN_CONFIG_FAILURE -} ctl_lun_config_status; - typedef void (*be_callback_t)(void *be_lun); -typedef void (*be_lun_config_t)(void *be_lun, - ctl_lun_config_status status); /* * The lun_type field is the SCSI device type of this particular LUN. In @@ -136,16 +129,11 @@ typedef void (*be_lun_config_t)(void *be_lun, * should be padded with ASCII spaces. This field should NOT be NULL * terminated. * - * The lun_shutdown() method is the callback for the ctl_invalidate_lun() + * The lun_shutdown() method is the callback for the ctl_remove_lun() * call. It is called when all outstanding I/O for that LUN has been * completed and CTL has deleted the resources for that LUN. When the CTL * backend gets this call, it can safely free its per-LUN resources. * - * The lun_config_status() method is the callback for the ctl_add_lun() - * call. It is called when the LUN is successfully added, or when LUN - * addition fails. If the LUN is successfully added, the backend may call - * the ctl_enable_lun() method to enable the LUN. - * * The be field is a pointer to the ctl_backend_driver structure, which * contains the backend methods to be called by CTL. * @@ -173,7 +161,6 @@ struct ctl_be_lun { uint8_t serial_num[CTL_SN_LEN]; /* passed to CTL */ uint8_t device_id[CTL_DEVID_LEN];/* passed to CTL */ be_callback_t lun_shutdown; /* passed to CTL */ - be_lun_config_t lun_config_status; /* passed to CTL */ struct ctl_backend_driver *be; /* passed to CTL */ void *ctl_lun; /* used by CTL */ nvlist_t *options; /* passed to CTL */ @@ -212,7 +199,6 @@ struct ctl_backend_driver { #if 0 be_vfunc_t config_write_done; /* passed to backend */ #endif - u_int num_luns; /* used by CTL */ STAILQ_ENTRY(ctl_backend_driver) links; /* used by CTL */ }; @@ -221,22 +207,16 @@ int ctl_backend_deregister(struct ctl_backend_driver * struct ctl_backend_driver *ctl_backend_find(char *backend_name); /* - * To add a LUN, first call ctl_add_lun(). You will get the lun_config_status() - * callback when the LUN addition has either succeeded or failed. - * - * Once you get that callback, you can then call ctl_enable_lun() to enable - * the LUN. + * To add a LUN, call ctl_add_lun(). */ int ctl_add_lun(struct ctl_be_lun *be_lun); -int ctl_enable_lun(struct ctl_be_lun *be_lun); /* - * To delete a LUN, first call ctl_disable_lun(), then - * ctl_invalidate_lun(). You will get the lun_shutdown() callback when all + * To remove a LUN, first call ctl_remove_lun(). + * You will get the lun_shutdown() callback when all * I/O to the LUN has completed and the LUN has been deleted. */ -int ctl_disable_lun(struct ctl_be_lun *be_lun); -int ctl_invalidate_lun(struct ctl_be_lun *be_lun); +int ctl_remove_lun(struct ctl_be_lun *be_lun); /* * To start a LUN (transition from powered off to powered on state) call Modified: stable/12/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/12/sys/cam/ctl/ctl_backend_block.c Tue May 19 13:58:52 2020 (r361254) +++ stable/12/sys/cam/ctl/ctl_backend_block.c Tue May 19 14:31:47 2020 (r361255) @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -121,7 +122,6 @@ SDT_PROVIDER_DEFINE(cbb); typedef enum { CTL_BE_BLOCK_LUN_UNCONFIGURED = 0x01, - CTL_BE_BLOCK_LUN_CONFIG_ERR = 0x02, CTL_BE_BLOCK_LUN_WAITING = 0x04, } ctl_be_block_lun_flags; @@ -153,7 +153,6 @@ typedef uint64_t (*cbb_getattr_t)(struct ctl_be_block_ */ struct ctl_be_block_lun { struct ctl_lun_create_params params; - char lunname[32]; char *dev_path; ctl_be_block_type dev_type; struct vnode *vn; @@ -169,7 +168,7 @@ struct ctl_be_block_lun { struct ctl_be_block_softc *softc; struct devstat *disk_stats; ctl_be_block_lun_flags flags; - STAILQ_ENTRY(ctl_be_block_lun) links; + SLIST_ENTRY(ctl_be_block_lun) links; struct ctl_be_lun cbe_lun; struct taskqueue *io_taskqueue; struct task io_task; @@ -186,10 +185,11 @@ struct ctl_be_block_lun { * Overall softc structure for the block backend module. */ struct ctl_be_block_softc { + struct sx modify_lock; struct mtx lock; uma_zone_t beio_zone; int num_luns; - STAILQ_HEAD(, ctl_be_block_lun) lun_list; + SLIST_HEAD(, ctl_be_block_lun) lun_list; }; static struct ctl_be_block_softc backend_block_softc; @@ -272,8 +272,6 @@ static int ctl_be_block_rm(struct ctl_be_block_softc * static int ctl_be_block_modify(struct ctl_be_block_softc *softc, struct ctl_lun_req *req); static void ctl_be_block_lun_shutdown(void *be_lun); -static void ctl_be_block_lun_config_status(void *be_lun, - ctl_lun_config_status status); static int ctl_be_block_config_write(union ctl_io *io); static int ctl_be_block_config_read(union ctl_io *io); static int ctl_be_block_lun_info(void *be_lun, struct sbuf *sb); @@ -296,7 +294,7 @@ static struct ctl_backend_driver ctl_be_block_driver = .lun_attr = ctl_be_block_lun_attr }; -MALLOC_DEFINE(M_CTLBLK, "ctlblk", "Memory used for CTL block backend"); +MALLOC_DEFINE(M_CTLBLK, "ctlblock", "Memory used for CTL block backend"); CTL_BACKEND_DECLARE(cbb, ctl_be_block_driver); static struct ctl_be_block_io * @@ -1773,13 +1771,10 @@ static int ctl_be_block_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) { - struct ctl_be_block_softc *softc; + struct ctl_be_block_softc *softc = &backend_block_softc; int error; - softc = &backend_block_softc; - error = 0; - switch (cmd) { case CTL_LUN_REQ: { struct ctl_lun_req *lun_req; @@ -2242,11 +2237,10 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, STAILQ_INIT(&be_lun->config_read_queue); STAILQ_INIT(&be_lun->config_write_queue); STAILQ_INIT(&be_lun->datamove_queue); - sprintf(be_lun->lunname, "cblk%d", softc->num_luns); - mtx_init(&be_lun->io_lock, "cblk io lock", NULL, MTX_DEF); - mtx_init(&be_lun->queue_lock, "cblk queue lock", NULL, MTX_DEF); + mtx_init(&be_lun->io_lock, "ctlblock io", NULL, MTX_DEF); + mtx_init(&be_lun->queue_lock, "ctlblock queue", NULL, MTX_DEF); cbe_lun->options = nvlist_clone(req->args_nvl); - be_lun->lun_zone = uma_zcreate(be_lun->lunname, CTLBLK_MAX_SEG, + be_lun->lun_zone = uma_zcreate("ctlblock", CTLBLK_MAX_SEG, NULL, NULL, NULL, NULL, /*align*/ 0, /*flags*/0); if (be_lun->lun_zone == NULL) { snprintf(req->error_str, sizeof(req->error_str), @@ -2258,7 +2252,7 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, cbe_lun->lun_type = params->device_type; else cbe_lun->lun_type = T_DIRECT; - be_lun->flags = CTL_BE_BLOCK_LUN_UNCONFIGURED; + be_lun->flags = 0; cbe_lun->flags = 0; value = dnvlist_get_string(cbe_lun->options, "ha_role", NULL); if (value != NULL) { @@ -2323,7 +2317,6 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, cbe_lun->req_lun_id = 0; cbe_lun->lun_shutdown = ctl_be_block_lun_shutdown; - cbe_lun->lun_config_status = ctl_be_block_lun_config_status; cbe_lun->be = &ctl_be_block_driver; if ((params->flags & CTL_LUN_FLAG_SERIAL_NUM) == 0) { @@ -2356,7 +2349,7 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, TASK_INIT(&be_lun->io_task, /*priority*/0, ctl_be_block_worker, be_lun); - be_lun->io_taskqueue = taskqueue_create(be_lun->lunname, M_WAITOK, + be_lun->io_taskqueue = taskqueue_create("ctlblocktq", M_WAITOK, taskqueue_thread_enqueue, /*context*/&be_lun->io_taskqueue); if (be_lun->io_taskqueue == NULL) { @@ -2383,27 +2376,15 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, /*num threads*/num_threads, /*priority*/PUSER, /*proc*/control_softc->ctl_proc, - /*thread name*/ - "%s taskq", be_lun->lunname); + /*thread name*/"block"); if (retval != 0) goto bailout_error; be_lun->num_threads = num_threads; - mtx_lock(&softc->lock); - softc->num_luns++; - STAILQ_INSERT_TAIL(&softc->lun_list, be_lun, links); - - mtx_unlock(&softc->lock); - retval = ctl_add_lun(&be_lun->cbe_lun); if (retval != 0) { - mtx_lock(&softc->lock); - STAILQ_REMOVE(&softc->lun_list, be_lun, ctl_be_block_lun, - links); - softc->num_luns--; - mtx_unlock(&softc->lock); snprintf(req->error_str, sizeof(req->error_str), "ctl_add_lun() returned error %d, see dmesg for " "details", retval); @@ -2411,42 +2392,20 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, goto bailout_error; } - mtx_lock(&softc->lock); - - /* - * Tell the config_status routine that we're waiting so it won't - * clean up the LUN in the event of an error. - */ - be_lun->flags |= CTL_BE_BLOCK_LUN_WAITING; - - while (be_lun->flags & CTL_BE_BLOCK_LUN_UNCONFIGURED) { - retval = msleep(be_lun, &softc->lock, PCATCH, "ctlblk", 0); - if (retval == EINTR) - break; - } - be_lun->flags &= ~CTL_BE_BLOCK_LUN_WAITING; - - if (be_lun->flags & CTL_BE_BLOCK_LUN_CONFIG_ERR) { - snprintf(req->error_str, sizeof(req->error_str), - "LUN configuration error, see dmesg for details"); - STAILQ_REMOVE(&softc->lun_list, be_lun, ctl_be_block_lun, - links); - softc->num_luns--; - mtx_unlock(&softc->lock); - goto bailout_error; - } else { - params->req_lun_id = cbe_lun->lun_id; - } - - mtx_unlock(&softc->lock); - - be_lun->disk_stats = devstat_new_entry("cbb", params->req_lun_id, + be_lun->disk_stats = devstat_new_entry("cbb", cbe_lun->lun_id, cbe_lun->blocksize, DEVSTAT_ALL_SUPPORTED, cbe_lun->lun_type | DEVSTAT_TYPE_IF_OTHER, DEVSTAT_PRIORITY_OTHER); + mtx_lock(&softc->lock); + softc->num_luns++; + SLIST_INSERT_HEAD(&softc->lun_list, be_lun, links); + mtx_unlock(&softc->lock); + + params->req_lun_id = cbe_lun->lun_id; + return (retval); bailout_error: @@ -2477,12 +2436,18 @@ ctl_be_block_rm(struct ctl_be_block_softc *softc, stru params = &req->reqdata.rm; + sx_xlock(&softc->modify_lock); mtx_lock(&softc->lock); - STAILQ_FOREACH(be_lun, &softc->lun_list, links) { - if (be_lun->cbe_lun.lun_id == params->lun_id) + SLIST_FOREACH(be_lun, &softc->lun_list, links) { + if (be_lun->cbe_lun.lun_id == params->lun_id) { + SLIST_REMOVE(&softc->lun_list, be_lun, + ctl_be_block_lun, links); + softc->num_luns--; break; + } } mtx_unlock(&softc->lock); + sx_xunlock(&softc->modify_lock); if (be_lun == NULL) { snprintf(req->error_str, sizeof(req->error_str), "LUN %u is not managed by the block backend", @@ -2491,14 +2456,6 @@ ctl_be_block_rm(struct ctl_be_block_softc *softc, stru } cbe_lun = &be_lun->cbe_lun; - retval = ctl_disable_lun(cbe_lun); - if (retval != 0) { - snprintf(req->error_str, sizeof(req->error_str), - "error %d returned from ctl_disable_lun() for " - "LUN %d", retval, params->lun_id); - goto bailout_error; - } - if (be_lun->vn != NULL) { cbe_lun->flags |= CTL_LUN_FLAG_NO_MEDIA; ctl_lun_no_media(cbe_lun); @@ -2506,49 +2463,36 @@ ctl_be_block_rm(struct ctl_be_block_softc *softc, stru ctl_be_block_close(be_lun); } - retval = ctl_invalidate_lun(cbe_lun); + mtx_lock(&softc->lock); + be_lun->flags |= CTL_BE_BLOCK_LUN_WAITING; + mtx_unlock(&softc->lock); + + retval = ctl_remove_lun(cbe_lun); if (retval != 0) { snprintf(req->error_str, sizeof(req->error_str), - "error %d returned from ctl_invalidate_lun() for " + "error %d returned from ctl_remove_lun() for " "LUN %d", retval, params->lun_id); + mtx_lock(&softc->lock); + be_lun->flags &= ~CTL_BE_BLOCK_LUN_WAITING; + mtx_unlock(&softc->lock); goto bailout_error; } mtx_lock(&softc->lock); - be_lun->flags |= CTL_BE_BLOCK_LUN_WAITING; while ((be_lun->flags & CTL_BE_BLOCK_LUN_UNCONFIGURED) == 0) { - retval = msleep(be_lun, &softc->lock, PCATCH, "ctlblk", 0); - if (retval == EINTR) - break; - } + retval = msleep(be_lun, &softc->lock, PCATCH, "ctlblockrm", 0); + if (retval == EINTR) + break; + } be_lun->flags &= ~CTL_BE_BLOCK_LUN_WAITING; - - if ((be_lun->flags & CTL_BE_BLOCK_LUN_UNCONFIGURED) == 0) { - snprintf(req->error_str, sizeof(req->error_str), - "interrupted waiting for LUN to be freed"); + if (be_lun->flags & CTL_BE_BLOCK_LUN_UNCONFIGURED) { mtx_unlock(&softc->lock); - goto bailout_error; + free(be_lun, M_CTLBLK); + } else { + mtx_unlock(&softc->lock); + return (EINTR); } - STAILQ_REMOVE(&softc->lun_list, be_lun, ctl_be_block_lun, links); - - softc->num_luns--; - mtx_unlock(&softc->lock); - - taskqueue_drain_all(be_lun->io_taskqueue); - taskqueue_free(be_lun->io_taskqueue); - - if (be_lun->disk_stats != NULL) - devstat_remove_entry(be_lun->disk_stats); - - uma_zdestroy(be_lun->lun_zone); - - nvlist_destroy(cbe_lun->options); - free(be_lun->dev_path, M_CTLBLK); - mtx_destroy(&be_lun->queue_lock); - mtx_destroy(&be_lun->io_lock); - free(be_lun, M_CTLBLK); - req->status = CTL_LUN_OK; return (0); @@ -2569,8 +2513,9 @@ ctl_be_block_modify(struct ctl_be_block_softc *softc, params = &req->reqdata.modify; + sx_xlock(&softc->modify_lock); mtx_lock(&softc->lock); - STAILQ_FOREACH(be_lun, &softc->lun_list, links) { + SLIST_FOREACH(be_lun, &softc->lun_list, links) { if (be_lun->cbe_lun.lun_id == params->lun_id) break; } @@ -2647,66 +2592,41 @@ ctl_be_block_modify(struct ctl_be_block_softc *softc, /* Tell the user the exact size we ended up using */ params->lun_size_bytes = be_lun->size_bytes; + sx_xunlock(&softc->modify_lock); req->status = error ? CTL_LUN_WARNING : CTL_LUN_OK; return (0); bailout_error: + sx_xunlock(&softc->modify_lock); req->status = CTL_LUN_ERROR; return (0); } static void -ctl_be_block_lun_shutdown(void *be_lun) +ctl_be_block_lun_shutdown(void *lun) { - struct ctl_be_block_lun *lun = be_lun; - struct ctl_be_block_softc *softc = lun->softc; + struct ctl_be_block_lun *be_lun = lun; + struct ctl_be_block_softc *softc = be_lun->softc; - mtx_lock(&softc->lock); - lun->flags |= CTL_BE_BLOCK_LUN_UNCONFIGURED; - if (lun->flags & CTL_BE_BLOCK_LUN_WAITING) - wakeup(lun); - mtx_unlock(&softc->lock); -} + taskqueue_drain_all(be_lun->io_taskqueue); + taskqueue_free(be_lun->io_taskqueue); + if (be_lun->disk_stats != NULL) + devstat_remove_entry(be_lun->disk_stats); + uma_zdestroy(be_lun->lun_zone); + nvlist_destroy(be_lun->cbe_lun.options); + free(be_lun->dev_path, M_CTLBLK); + mtx_destroy(&be_lun->queue_lock); + mtx_destroy(&be_lun->io_lock); -static void -ctl_be_block_lun_config_status(void *be_lun, ctl_lun_config_status status) -{ - struct ctl_be_block_lun *lun; - struct ctl_be_block_softc *softc; - - lun = (struct ctl_be_block_lun *)be_lun; - softc = lun->softc; - - if (status == CTL_LUN_CONFIG_OK) { - mtx_lock(&softc->lock); - lun->flags &= ~CTL_BE_BLOCK_LUN_UNCONFIGURED; - if (lun->flags & CTL_BE_BLOCK_LUN_WAITING) - wakeup(lun); - mtx_unlock(&softc->lock); - - /* - * We successfully added the LUN, attempt to enable it. - */ - if (ctl_enable_lun(&lun->cbe_lun) != 0) { - printf("%s: ctl_enable_lun() failed!\n", __func__); - if (ctl_invalidate_lun(&lun->cbe_lun) != 0) { - printf("%s: ctl_invalidate_lun() failed!\n", - __func__); - } - } - - return; - } - - mtx_lock(&softc->lock); - lun->flags &= ~CTL_BE_BLOCK_LUN_UNCONFIGURED; - lun->flags |= CTL_BE_BLOCK_LUN_CONFIG_ERR; - wakeup(lun); + be_lun->flags |= CTL_BE_BLOCK_LUN_UNCONFIGURED; + if (be_lun->flags & CTL_BE_BLOCK_LUN_WAITING) + wakeup(be_lun); + else + free(be_lun, M_CTLBLK); mtx_unlock(&softc->lock); } - static int ctl_be_block_config_write(union ctl_io *io) { @@ -2870,10 +2790,11 @@ ctl_be_block_init(void) { struct ctl_be_block_softc *softc = &backend_block_softc; + sx_init(&softc->modify_lock, "ctlblock modify"); mtx_init(&softc->lock, "ctlblock", NULL, MTX_DEF); softc->beio_zone = uma_zcreate("beio", sizeof(struct ctl_be_block_io), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - STAILQ_INIT(&softc->lun_list); + SLIST_INIT(&softc->lun_list); return (0); } @@ -2882,23 +2803,24 @@ static int ctl_be_block_shutdown(void) { struct ctl_be_block_softc *softc = &backend_block_softc; - struct ctl_be_block_lun *lun, *next_lun; + struct ctl_be_block_lun *lun; mtx_lock(&softc->lock); - STAILQ_FOREACH_SAFE(lun, &softc->lun_list, links, next_lun) { + while ((lun = SLIST_FIRST(&softc->lun_list)) != NULL) { + SLIST_REMOVE_HEAD(&softc->lun_list, links); + softc->num_luns--; /* - * Drop our lock here. Since ctl_invalidate_lun() can call + * Drop our lock here. Since ctl_remove_lun() can call * back into us, this could potentially lead to a recursive * lock of the same mutex, which would cause a hang. */ mtx_unlock(&softc->lock); - ctl_disable_lun(&lun->cbe_lun); - ctl_invalidate_lun(&lun->cbe_lun); + ctl_remove_lun(&lun->cbe_lun); mtx_lock(&softc->lock); } mtx_unlock(&softc->lock); - uma_zdestroy(softc->beio_zone); mtx_destroy(&softc->lock); + sx_destroy(&softc->modify_lock); return (0); } Modified: stable/12/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/12/sys/cam/ctl/ctl_backend_ramdisk.c Tue May 19 13:58:52 2020 (r361254) +++ stable/12/sys/cam/ctl/ctl_backend_ramdisk.c Tue May 19 14:31:47 2020 (r361255) @@ -102,13 +102,11 @@ typedef enum { typedef enum { CTL_BE_RAMDISK_LUN_UNCONFIGURED = 0x01, - CTL_BE_RAMDISK_LUN_CONFIG_ERR = 0x02, CTL_BE_RAMDISK_LUN_WAITING = 0x04 } ctl_be_ramdisk_lun_flags; struct ctl_be_ramdisk_lun { struct ctl_lun_create_params params; - char lunname[32]; int indir; uint8_t **pages; uint8_t *zero_page; @@ -121,7 +119,7 @@ struct ctl_be_ramdisk_lun { uint64_t cap_used; struct ctl_be_ramdisk_softc *softc; ctl_be_ramdisk_lun_flags flags; - STAILQ_ENTRY(ctl_be_ramdisk_lun) links; + SLIST_ENTRY(ctl_be_ramdisk_lun) links; struct ctl_be_lun cbe_lun; struct taskqueue *io_taskqueue; struct task io_task; @@ -130,9 +128,10 @@ struct ctl_be_ramdisk_lun { }; struct ctl_be_ramdisk_softc { + struct sx modify_lock; struct mtx lock; int num_luns; - STAILQ_HEAD(, ctl_be_ramdisk_lun) lun_list; + SLIST_HEAD(, ctl_be_ramdisk_lun) lun_list; }; static struct ctl_be_ramdisk_softc rd_softc; @@ -157,8 +156,6 @@ static int ctl_backend_ramdisk_create(struct ctl_be_ra static int ctl_backend_ramdisk_modify(struct ctl_be_ramdisk_softc *softc, struct ctl_lun_req *req); static void ctl_backend_ramdisk_lun_shutdown(void *be_lun); -static void ctl_backend_ramdisk_lun_config_status(void *be_lun, - ctl_lun_config_status status); static struct ctl_backend_driver ctl_be_ramdisk_driver = { @@ -174,7 +171,7 @@ static struct ctl_backend_driver ctl_be_ramdisk_driver .lun_attr = ctl_backend_ramdisk_lun_attr, }; -MALLOC_DEFINE(M_RAMDISK, "ramdisk", "Memory used for CTL RAMdisk"); +MALLOC_DEFINE(M_RAMDISK, "ctlramdisk", "Memory used for CTL RAMdisk"); CTL_BACKEND_DECLARE(cbr, ctl_be_ramdisk_driver); static int @@ -183,8 +180,9 @@ ctl_backend_ramdisk_init(void) struct ctl_be_ramdisk_softc *softc = &rd_softc; memset(softc, 0, sizeof(*softc)); - mtx_init(&softc->lock, "ctlramdisk", NULL, MTX_DEF); - STAILQ_INIT(&softc->lun_list); + sx_init(&softc->modify_lock, "ctlrammod"); + mtx_init(&softc->lock, "ctlram", NULL, MTX_DEF); + SLIST_INIT(&softc->lun_list); return (0); } @@ -192,22 +190,24 @@ static int ctl_backend_ramdisk_shutdown(void) { struct ctl_be_ramdisk_softc *softc = &rd_softc; - struct ctl_be_ramdisk_lun *lun, *next_lun; + struct ctl_be_ramdisk_lun *lun; mtx_lock(&softc->lock); - STAILQ_FOREACH_SAFE(lun, &softc->lun_list, links, next_lun) { + while ((lun = SLIST_FIRST(&softc->lun_list)) != NULL) { + SLIST_REMOVE_HEAD(&softc->lun_list, links); + softc->num_luns--; /* - * Drop our lock here. Since ctl_invalidate_lun() can call + * Drop our lock here. Since ctl_remove_lun() can call * back into us, this could potentially lead to a recursive * lock of the same mutex, which would cause a hang. */ mtx_unlock(&softc->lock); - ctl_disable_lun(&lun->cbe_lun); - ctl_invalidate_lun(&lun->cbe_lun); + ctl_remove_lun(&lun->cbe_lun); mtx_lock(&softc->lock); } mtx_unlock(&softc->lock); mtx_destroy(&softc->lock); + sx_destroy(&softc->modify_lock); return (0); } @@ -889,12 +889,18 @@ ctl_backend_ramdisk_rm(struct ctl_be_ramdisk_softc *so int retval; params = &req->reqdata.rm; + sx_xlock(&softc->modify_lock); mtx_lock(&softc->lock); - STAILQ_FOREACH(be_lun, &softc->lun_list, links) { - if (be_lun->cbe_lun.lun_id == params->lun_id) + SLIST_FOREACH(be_lun, &softc->lun_list, links) { + if (be_lun->cbe_lun.lun_id == params->lun_id) { + SLIST_REMOVE(&softc->lun_list, be_lun, + ctl_be_ramdisk_lun, links); + softc->num_luns--; break; + } } mtx_unlock(&softc->lock); + sx_xunlock(&softc->modify_lock); if (be_lun == NULL) { snprintf(req->error_str, sizeof(req->error_str), "%s: LUN %u is not managed by the ramdisk backend", @@ -902,14 +908,6 @@ ctl_backend_ramdisk_rm(struct ctl_be_ramdisk_softc *so goto bailout_error; } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 19 14:42: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 63B042DA0D7; Tue, 19 May 2020 14:42:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RJW716bLz4cqw; Tue, 19 May 2020 14:42:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21308C3C6; Tue, 19 May 2020 14:42:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JEgB6X051918; Tue, 19 May 2020 14:42:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JEgAZ2051912; Tue, 19 May 2020 14:42:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202005191442.04JEgAZ2051912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 19 May 2020 14:42:10 +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: r361256 - stable/11/sys/cam/ctl X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/ctl X-SVN-Commit-Revision: 361256 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, 19 May 2020 14:42:11 -0000 Author: mav Date: Tue May 19 14:42:09 2020 New Revision: 361256 URL: https://svnweb.freebsd.org/changeset/base/361256 Log: MFC r360564: Cleanup LUN addition/removal. - Make ctl_add_lun() synchronous. Asynchronous addition was used by Copan's proprietary code long ago and never for upstream FreeBSD. - Move LUN enable/disable calls from backends to CTL core. - Serialize LUN modification and partially removal to avoid double frees. - Slightly unify backends code. Modified: stable/11/sys/cam/ctl/ctl.c stable/11/sys/cam/ctl/ctl_backend.c stable/11/sys/cam/ctl/ctl_backend.h stable/11/sys/cam/ctl/ctl_backend_block.c stable/11/sys/cam/ctl/ctl_backend_ramdisk.c stable/11/sys/cam/ctl/ctl_private.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Tue May 19 14:31:47 2020 (r361255) +++ stable/11/sys/cam/ctl/ctl.c Tue May 19 14:42:09 2020 (r361256) @@ -461,10 +461,9 @@ static void ctl_ioctl_fill_ooa(struct ctl_lun *lun, ui struct ctl_ooa_entry *kern_entries); static int ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td); -static int ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_lun *lun, - struct ctl_be_lun *be_lun); +static int ctl_enable_lun(struct ctl_lun *lun); +static int ctl_disable_lun(struct ctl_lun *lun); static int ctl_free_lun(struct ctl_lun *lun); -static void ctl_create_lun(struct ctl_be_lun *be_lun); static int ctl_do_mode_select(union ctl_io *io); static int ctl_pro_preempt(struct ctl_softc *softc, struct ctl_lun *lun, @@ -538,7 +537,6 @@ static int ctl_datamove_remote_xfer(union ctl_io *io, static void ctl_datamove_remote_read(union ctl_io *io); static void ctl_datamove_remote(union ctl_io *io); static void ctl_process_done(union ctl_io *io); -static void ctl_lun_thread(void *arg); static void ctl_thresh_thread(void *arg); static void ctl_work_thread(void *arg); static void ctl_enqueue_incoming(union ctl_io *io); @@ -1935,7 +1933,6 @@ ctl_init(void) "HA link state (0 - offline, 1 - unknown, 2 - online)"); STAILQ_INIT(&softc->lun_list); - STAILQ_INIT(&softc->pending_lun_queue); STAILQ_INIT(&softc->fe_list); STAILQ_INIT(&softc->port_list); STAILQ_INIT(&softc->be_list); @@ -1963,12 +1960,6 @@ ctl_init(void) return (error); } } - error = kproc_kthread_add(ctl_lun_thread, softc, - &softc->ctl_proc, &softc->lun_thread, 0, 0, "ctl", "lun"); - if (error != 0) { - printf("error creating CTL lun thread!\n"); - return (error); - } error = kproc_kthread_add(ctl_thresh_thread, softc, &softc->ctl_proc, &softc->thresh_thread, 0, 0, "ctl", "thresh"); if (error != 0) { @@ -2009,11 +2000,6 @@ ctl_shutdown(void) } mtx_destroy(&thr->queue_lock); } - while (softc->lun_thread != NULL) { - wakeup(&softc->pending_lun_queue); - if (softc->lun_thread != NULL) - pause("CTL thr shutdown", 1); - } while (softc->thresh_thread != NULL) { wakeup(softc->thresh_thread); if (softc->thresh_thread != NULL) @@ -4512,32 +4498,23 @@ hex2bin(const char *str, uint8_t *buf, int buf_size) } /* - * LUN allocation. + * Add LUN. * - * Requirements: - * - caller allocates and zeros LUN storage, or passes in a NULL LUN if he - * wants us to allocate the LUN and he can block. - * - ctl_softc is always set - * - be_lun is set if the LUN has a backend (needed for disk LUNs) - * * Returns 0 for success, non-zero (errno) for failure. */ -static int -ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_lun *ctl_lun, - struct ctl_be_lun *const be_lun) +int +ctl_add_lun(struct ctl_be_lun *be_lun) { + struct ctl_softc *ctl_softc = control_softc; struct ctl_lun *nlun, *lun; struct scsi_vpd_id_descriptor *desc; struct scsi_vpd_id_t10 *t10id; const char *eui, *naa, *scsiname, *uuid, *vendor, *value; - int lun_number, lun_malloced; + int lun_number; int devidlen, idlen1, idlen2 = 0, len; - if (be_lun == NULL) - return (EINVAL); - /* - * We currently only support Direct Access or Processor LUN types. + * We support only Direct Access, CD-ROM or Processor LUN types. */ switch (be_lun->lun_type) { case T_DIRECT: @@ -4547,22 +4524,10 @@ ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_ case T_SEQUENTIAL: case T_CHANGER: default: - be_lun->lun_config_status(be_lun->be_lun, - CTL_LUN_CONFIG_FAILURE); - break; + return (EINVAL); } - if (ctl_lun == NULL) { - lun = malloc(sizeof(*lun), M_CTL, M_WAITOK); - lun_malloced = 1; - } else { - lun_malloced = 0; - lun = ctl_lun; - } + lun = malloc(sizeof(*lun), M_CTL, M_WAITOK | M_ZERO); - memset(lun, 0, sizeof(*lun)); - if (lun_malloced) - lun->flags = CTL_LUN_MALLOCED; - lun->pending_sense = malloc(sizeof(struct scsi_sense_data *) * ctl_max_ports, M_DEVBUF, M_WAITOK | M_ZERO); lun->pending_ua = malloc(sizeof(ctl_ua_type *) * ctl_max_ports, @@ -4673,10 +4638,7 @@ ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_ } fail: free(lun->lun_devid, M_CTL); - if (lun->flags & CTL_LUN_MALLOCED) - free(lun, M_CTL); - be_lun->lun_config_status(be_lun->be_lun, - CTL_LUN_CONFIG_FAILURE); + free(lun, M_CTL); return (ENOSPC); } lun_number = be_lun->req_lun_id; @@ -4702,7 +4664,6 @@ fail: lun->backend = be_lun->be; be_lun->ctl_lun = lun; be_lun->lun_id = lun_number; - atomic_add_int(&be_lun->be->num_luns, 1); if (be_lun->flags & CTL_LUN_FLAG_EJECTED) lun->flags |= CTL_LUN_EJECTED; if (be_lun->flags & CTL_LUN_FLAG_NO_MEDIA) @@ -4769,15 +4730,27 @@ fail: ctl_softc->num_luns++; mtx_unlock(&ctl_softc->ctl_lock); - lun->be_lun->lun_config_status(lun->be_lun->be_lun, CTL_LUN_CONFIG_OK); + /* + * We successfully added the LUN, attempt to enable it. + */ + if (ctl_enable_lun(lun) != 0) { + printf("%s: ctl_enable_lun() failed!\n", __func__); + mtx_lock(&ctl_softc->ctl_lock); + STAILQ_REMOVE(&ctl_softc->lun_list, lun, ctl_lun, links); + ctl_clear_mask(ctl_softc->ctl_lun_mask, lun_number); + ctl_softc->ctl_luns[lun_number] = NULL; + ctl_softc->num_luns--; + mtx_unlock(&ctl_softc->ctl_lock); + free(lun->lun_devid, M_CTL); + free(lun, M_CTL); + return (EIO); + } + return (0); } /* - * Delete a LUN. - * Assumptions: - * - LUN has already been marked invalid and any pending I/O has been taken - * care of. + * Free LUN that has no active requests. */ static int ctl_free_lun(struct ctl_lun *lun) @@ -4804,7 +4777,6 @@ ctl_free_lun(struct ctl_lun *lun) /* * Tell the backend to free resources, if this LUN has a backend. */ - atomic_subtract_int(&lun->be_lun->be->num_luns, 1); lun->be_lun->lun_shutdown(lun->be_lun->be_lun); lun->ie_reportcnt = UINT32_MAX; @@ -4820,57 +4792,24 @@ ctl_free_lun(struct ctl_lun *lun) free(lun->pr_keys, M_DEVBUF); free(lun->write_buffer, M_CTL); free(lun->prevent, M_CTL); - if (lun->flags & CTL_LUN_MALLOCED) - free(lun, M_CTL); + free(lun, M_CTL); return (0); } -static void -ctl_create_lun(struct ctl_be_lun *be_lun) +static int +ctl_enable_lun(struct ctl_lun *lun) { - - /* - * ctl_alloc_lun() should handle all potential failure cases. - */ - ctl_alloc_lun(control_softc, NULL, be_lun); -} - -int -ctl_add_lun(struct ctl_be_lun *be_lun) -{ - struct ctl_softc *softc = control_softc; - - mtx_lock(&softc->ctl_lock); - STAILQ_INSERT_TAIL(&softc->pending_lun_queue, be_lun, links); - mtx_unlock(&softc->ctl_lock); - wakeup(&softc->pending_lun_queue); - - return (0); -} - -int -ctl_enable_lun(struct ctl_be_lun *be_lun) -{ struct ctl_softc *softc; struct ctl_port *port, *nport; - struct ctl_lun *lun; int retval; - lun = (struct ctl_lun *)be_lun->ctl_lun; softc = lun->ctl_softc; mtx_lock(&softc->ctl_lock); mtx_lock(&lun->lun_lock); - if ((lun->flags & CTL_LUN_DISABLED) == 0) { - /* - * eh? Why did we get called if the LUN is already - * enabled? - */ - mtx_unlock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - return (0); - } + KASSERT((lun->flags & CTL_LUN_DISABLED) != 0, + ("%s: LUN not disabled", __func__)); lun->flags &= ~CTL_LUN_DISABLED; mtx_unlock(&lun->lun_lock); @@ -4901,24 +4840,19 @@ ctl_enable_lun(struct ctl_be_lun *be_lun) return (0); } -int -ctl_disable_lun(struct ctl_be_lun *be_lun) +static int +ctl_disable_lun(struct ctl_lun *lun) { struct ctl_softc *softc; struct ctl_port *port; - struct ctl_lun *lun; int retval; - lun = (struct ctl_lun *)be_lun->ctl_lun; softc = lun->ctl_softc; mtx_lock(&softc->ctl_lock); mtx_lock(&lun->lun_lock); - if (lun->flags & CTL_LUN_DISABLED) { - mtx_unlock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - return (0); - } + KASSERT((lun->flags & CTL_LUN_DISABLED) == 0, + ("%s: LUN not enabled", __func__)); lun->flags |= CTL_LUN_DISABLED; mtx_unlock(&lun->lun_lock); @@ -5049,8 +4983,14 @@ ctl_lun_secondary(struct ctl_be_lun *be_lun) return (0); } +/* + * Remove LUN. If there are active requests, wait for completion. + * + * Returns 0 for success, non-zero (errno) for failure. + * Completion is reported to backed via the lun_shutdown() method. + */ int -ctl_invalidate_lun(struct ctl_be_lun *be_lun) +ctl_remove_lun(struct ctl_be_lun *be_lun) { struct ctl_softc *softc; struct ctl_lun *lun; @@ -5058,18 +4998,9 @@ ctl_invalidate_lun(struct ctl_be_lun *be_lun) lun = (struct ctl_lun *)be_lun->ctl_lun; softc = lun->ctl_softc; - mtx_lock(&lun->lun_lock); + ctl_disable_lun(lun); - /* - * The LUN needs to be disabled before it can be marked invalid. - */ - if ((lun->flags & CTL_LUN_DISABLED) == 0) { - mtx_unlock(&lun->lun_lock); - return (-1); - } - /* - * Mark the LUN invalid. - */ + mtx_lock(&lun->lun_lock); lun->flags |= CTL_LUN_INVALID; /* @@ -13296,35 +13227,6 @@ ctl_work_thread(void *arg) mtx_sleep(thr, &thr->queue_lock, PDROP, "-", 0); } thr->thread = NULL; - kthread_exit(); -} - -static void -ctl_lun_thread(void *arg) -{ - struct ctl_softc *softc = (struct ctl_softc *)arg; - struct ctl_be_lun *be_lun; - - CTL_DEBUG_PRINT(("ctl_lun_thread starting\n")); - thread_lock(curthread); - sched_prio(curthread, PUSER - 1); - thread_unlock(curthread); - - while (!softc->shutdown) { - mtx_lock(&softc->ctl_lock); - be_lun = STAILQ_FIRST(&softc->pending_lun_queue); - if (be_lun != NULL) { - STAILQ_REMOVE_HEAD(&softc->pending_lun_queue, links); - mtx_unlock(&softc->ctl_lock); - ctl_create_lun(be_lun); - continue; - } - - /* Sleep until we have something to do. */ - mtx_sleep(&softc->pending_lun_queue, &softc->ctl_lock, - PDROP, "-", 0); - } - softc->lun_thread = NULL; kthread_exit(); } Modified: stable/11/sys/cam/ctl/ctl_backend.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_backend.c Tue May 19 14:31:47 2020 (r361255) +++ stable/11/sys/cam/ctl/ctl_backend.c Tue May 19 14:42:09 2020 (r361256) @@ -81,7 +81,6 @@ ctl_backend_register(struct ctl_backend_driver *be) #ifdef CS_BE_CONFIG_MOVE_DONE_IS_NOT_USED be->config_move_done = ctl_config_move_done; #endif - be->num_luns = 0; /* Call the backend's initialization routine. */ if (be->init != NULL) { Modified: stable/11/sys/cam/ctl/ctl_backend.h ============================================================================== --- stable/11/sys/cam/ctl/ctl_backend.h Tue May 19 14:31:47 2020 (r361255) +++ stable/11/sys/cam/ctl/ctl_backend.h Tue May 19 14:42:09 2020 (r361256) @@ -77,14 +77,7 @@ typedef enum { MODULE_DEPEND(name, cam, 1, 1, 1) -typedef enum { - CTL_LUN_CONFIG_OK, - CTL_LUN_CONFIG_FAILURE -} ctl_lun_config_status; - typedef void (*be_callback_t)(void *be_lun); -typedef void (*be_lun_config_t)(void *be_lun, - ctl_lun_config_status status); /* * The lun_type field is the SCSI device type of this particular LUN. In @@ -133,16 +126,11 @@ typedef void (*be_lun_config_t)(void *be_lun, * should be padded with ASCII spaces. This field should NOT be NULL * terminated. * - * The lun_shutdown() method is the callback for the ctl_invalidate_lun() + * The lun_shutdown() method is the callback for the ctl_remove_lun() * call. It is called when all outstanding I/O for that LUN has been * completed and CTL has deleted the resources for that LUN. When the CTL * backend gets this call, it can safely free its per-LUN resources. * - * The lun_config_status() method is the callback for the ctl_add_lun() - * call. It is called when the LUN is successfully added, or when LUN - * addition fails. If the LUN is successfully added, the backend may call - * the ctl_enable_lun() method to enable the LUN. - * * The be field is a pointer to the ctl_backend_driver structure, which * contains the backend methods to be called by CTL. * @@ -170,7 +158,6 @@ struct ctl_be_lun { uint8_t serial_num[CTL_SN_LEN]; /* passed to CTL */ uint8_t device_id[CTL_DEVID_LEN];/* passed to CTL */ be_callback_t lun_shutdown; /* passed to CTL */ - be_lun_config_t lun_config_status; /* passed to CTL */ struct ctl_backend_driver *be; /* passed to CTL */ void *ctl_lun; /* used by CTL */ ctl_options_t options; /* passed to CTL */ @@ -209,7 +196,6 @@ struct ctl_backend_driver { #if 0 be_vfunc_t config_write_done; /* passed to backend */ #endif - u_int num_luns; /* used by CTL */ STAILQ_ENTRY(ctl_backend_driver) links; /* used by CTL */ }; @@ -218,22 +204,16 @@ int ctl_backend_deregister(struct ctl_backend_driver * struct ctl_backend_driver *ctl_backend_find(char *backend_name); /* - * To add a LUN, first call ctl_add_lun(). You will get the lun_config_status() - * callback when the LUN addition has either succeeded or failed. - * - * Once you get that callback, you can then call ctl_enable_lun() to enable - * the LUN. + * To add a LUN, call ctl_add_lun(). */ int ctl_add_lun(struct ctl_be_lun *be_lun); -int ctl_enable_lun(struct ctl_be_lun *be_lun); /* - * To delete a LUN, first call ctl_disable_lun(), then - * ctl_invalidate_lun(). You will get the lun_shutdown() callback when all + * To remove a LUN, first call ctl_remove_lun(). + * You will get the lun_shutdown() callback when all * I/O to the LUN has completed and the LUN has been deleted. */ -int ctl_disable_lun(struct ctl_be_lun *be_lun); -int ctl_invalidate_lun(struct ctl_be_lun *be_lun); +int ctl_remove_lun(struct ctl_be_lun *be_lun); /* * To start a LUN (transition from powered off to powered on state) call Modified: stable/11/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_backend_block.c Tue May 19 14:31:47 2020 (r361255) +++ stable/11/sys/cam/ctl/ctl_backend_block.c Tue May 19 14:42:09 2020 (r361256) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -117,7 +118,6 @@ SDT_PROVIDER_DEFINE(cbb); typedef enum { CTL_BE_BLOCK_LUN_UNCONFIGURED = 0x01, - CTL_BE_BLOCK_LUN_CONFIG_ERR = 0x02, CTL_BE_BLOCK_LUN_WAITING = 0x04, } ctl_be_block_lun_flags; @@ -149,7 +149,6 @@ typedef uint64_t (*cbb_getattr_t)(struct ctl_be_block_ */ struct ctl_be_block_lun { struct ctl_lun_create_params params; - char lunname[32]; char *dev_path; ctl_be_block_type dev_type; struct vnode *vn; @@ -165,7 +164,7 @@ struct ctl_be_block_lun { struct ctl_be_block_softc *softc; struct devstat *disk_stats; ctl_be_block_lun_flags flags; - STAILQ_ENTRY(ctl_be_block_lun) links; + SLIST_ENTRY(ctl_be_block_lun) links; struct ctl_be_lun cbe_lun; struct taskqueue *io_taskqueue; struct task io_task; @@ -182,10 +181,11 @@ struct ctl_be_block_lun { * Overall softc structure for the block backend module. */ struct ctl_be_block_softc { + struct sx modify_lock; struct mtx lock; uma_zone_t beio_zone; int num_luns; - STAILQ_HEAD(, ctl_be_block_lun) lun_list; + SLIST_HEAD(, ctl_be_block_lun) lun_list; }; static struct ctl_be_block_softc backend_block_softc; @@ -268,8 +268,6 @@ static int ctl_be_block_rm(struct ctl_be_block_softc * static int ctl_be_block_modify(struct ctl_be_block_softc *softc, struct ctl_lun_req *req); static void ctl_be_block_lun_shutdown(void *be_lun); -static void ctl_be_block_lun_config_status(void *be_lun, - ctl_lun_config_status status); static int ctl_be_block_config_write(union ctl_io *io); static int ctl_be_block_config_read(union ctl_io *io); static int ctl_be_block_lun_info(void *be_lun, struct sbuf *sb); @@ -292,7 +290,7 @@ static struct ctl_backend_driver ctl_be_block_driver = .lun_attr = ctl_be_block_lun_attr }; -MALLOC_DEFINE(M_CTLBLK, "ctlblk", "Memory used for CTL block backend"); +MALLOC_DEFINE(M_CTLBLK, "ctlblock", "Memory used for CTL block backend"); CTL_BACKEND_DECLARE(cbb, ctl_be_block_driver); static struct ctl_be_block_io * @@ -1769,13 +1767,10 @@ static int ctl_be_block_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) { - struct ctl_be_block_softc *softc; + struct ctl_be_block_softc *softc = &backend_block_softc; int error; - softc = &backend_block_softc; - error = 0; - switch (cmd) { case CTL_LUN_REQ: { struct ctl_lun_req *lun_req; @@ -2238,12 +2233,11 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, STAILQ_INIT(&be_lun->config_read_queue); STAILQ_INIT(&be_lun->config_write_queue); STAILQ_INIT(&be_lun->datamove_queue); - sprintf(be_lun->lunname, "cblk%d", softc->num_luns); - mtx_init(&be_lun->io_lock, "cblk io lock", NULL, MTX_DEF); - mtx_init(&be_lun->queue_lock, "cblk queue lock", NULL, MTX_DEF); + mtx_init(&be_lun->io_lock, "ctlblock io", NULL, MTX_DEF); + mtx_init(&be_lun->queue_lock, "ctlblock queue", NULL, MTX_DEF); ctl_init_opts(&cbe_lun->options, req->num_be_args, req->kern_be_args); - be_lun->lun_zone = uma_zcreate(be_lun->lunname, CTLBLK_MAX_SEG, + be_lun->lun_zone = uma_zcreate("ctlblock", CTLBLK_MAX_SEG, NULL, NULL, NULL, NULL, /*align*/ 0, /*flags*/0); if (be_lun->lun_zone == NULL) { snprintf(req->error_str, sizeof(req->error_str), @@ -2255,7 +2249,7 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, cbe_lun->lun_type = params->device_type; else cbe_lun->lun_type = T_DIRECT; - be_lun->flags = CTL_BE_BLOCK_LUN_UNCONFIGURED; + be_lun->flags = 0; cbe_lun->flags = 0; value = ctl_get_opt(&cbe_lun->options, "ha_role"); if (value != NULL) { @@ -2320,7 +2314,6 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, cbe_lun->req_lun_id = 0; cbe_lun->lun_shutdown = ctl_be_block_lun_shutdown; - cbe_lun->lun_config_status = ctl_be_block_lun_config_status; cbe_lun->be = &ctl_be_block_driver; if ((params->flags & CTL_LUN_FLAG_SERIAL_NUM) == 0) { @@ -2353,7 +2346,7 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, TASK_INIT(&be_lun->io_task, /*priority*/0, ctl_be_block_worker, be_lun); - be_lun->io_taskqueue = taskqueue_create(be_lun->lunname, M_WAITOK, + be_lun->io_taskqueue = taskqueue_create("ctlblocktq", M_WAITOK, taskqueue_thread_enqueue, /*context*/&be_lun->io_taskqueue); if (be_lun->io_taskqueue == NULL) { @@ -2379,27 +2372,15 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, retval = taskqueue_start_threads(&be_lun->io_taskqueue, /*num threads*/num_threads, /*priority*/PUSER, - /*thread name*/ - "%s taskq", be_lun->lunname); + /*thread name*/"block"); if (retval != 0) goto bailout_error; be_lun->num_threads = num_threads; - mtx_lock(&softc->lock); - softc->num_luns++; - STAILQ_INSERT_TAIL(&softc->lun_list, be_lun, links); - - mtx_unlock(&softc->lock); - retval = ctl_add_lun(&be_lun->cbe_lun); if (retval != 0) { - mtx_lock(&softc->lock); - STAILQ_REMOVE(&softc->lun_list, be_lun, ctl_be_block_lun, - links); - softc->num_luns--; - mtx_unlock(&softc->lock); snprintf(req->error_str, sizeof(req->error_str), "ctl_add_lun() returned error %d, see dmesg for " "details", retval); @@ -2407,42 +2388,20 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, goto bailout_error; } - mtx_lock(&softc->lock); - - /* - * Tell the config_status routine that we're waiting so it won't - * clean up the LUN in the event of an error. - */ - be_lun->flags |= CTL_BE_BLOCK_LUN_WAITING; - - while (be_lun->flags & CTL_BE_BLOCK_LUN_UNCONFIGURED) { - retval = msleep(be_lun, &softc->lock, PCATCH, "ctlblk", 0); - if (retval == EINTR) - break; - } - be_lun->flags &= ~CTL_BE_BLOCK_LUN_WAITING; - - if (be_lun->flags & CTL_BE_BLOCK_LUN_CONFIG_ERR) { - snprintf(req->error_str, sizeof(req->error_str), - "LUN configuration error, see dmesg for details"); - STAILQ_REMOVE(&softc->lun_list, be_lun, ctl_be_block_lun, - links); - softc->num_luns--; - mtx_unlock(&softc->lock); - goto bailout_error; - } else { - params->req_lun_id = cbe_lun->lun_id; - } - - mtx_unlock(&softc->lock); - - be_lun->disk_stats = devstat_new_entry("cbb", params->req_lun_id, + be_lun->disk_stats = devstat_new_entry("cbb", cbe_lun->lun_id, cbe_lun->blocksize, DEVSTAT_ALL_SUPPORTED, cbe_lun->lun_type | DEVSTAT_TYPE_IF_OTHER, DEVSTAT_PRIORITY_OTHER); + mtx_lock(&softc->lock); + softc->num_luns++; + SLIST_INSERT_HEAD(&softc->lun_list, be_lun, links); + mtx_unlock(&softc->lock); + + params->req_lun_id = cbe_lun->lun_id; + return (retval); bailout_error: @@ -2473,12 +2432,18 @@ ctl_be_block_rm(struct ctl_be_block_softc *softc, stru params = &req->reqdata.rm; + sx_xlock(&softc->modify_lock); mtx_lock(&softc->lock); - STAILQ_FOREACH(be_lun, &softc->lun_list, links) { - if (be_lun->cbe_lun.lun_id == params->lun_id) + SLIST_FOREACH(be_lun, &softc->lun_list, links) { + if (be_lun->cbe_lun.lun_id == params->lun_id) { + SLIST_REMOVE(&softc->lun_list, be_lun, + ctl_be_block_lun, links); + softc->num_luns--; break; + } } mtx_unlock(&softc->lock); + sx_xunlock(&softc->modify_lock); if (be_lun == NULL) { snprintf(req->error_str, sizeof(req->error_str), "LUN %u is not managed by the block backend", @@ -2487,14 +2452,6 @@ ctl_be_block_rm(struct ctl_be_block_softc *softc, stru } cbe_lun = &be_lun->cbe_lun; - retval = ctl_disable_lun(cbe_lun); - if (retval != 0) { - snprintf(req->error_str, sizeof(req->error_str), - "error %d returned from ctl_disable_lun() for " - "LUN %d", retval, params->lun_id); - goto bailout_error; - } - if (be_lun->vn != NULL) { cbe_lun->flags |= CTL_LUN_FLAG_NO_MEDIA; ctl_lun_no_media(cbe_lun); @@ -2502,49 +2459,36 @@ ctl_be_block_rm(struct ctl_be_block_softc *softc, stru ctl_be_block_close(be_lun); } - retval = ctl_invalidate_lun(cbe_lun); + mtx_lock(&softc->lock); + be_lun->flags |= CTL_BE_BLOCK_LUN_WAITING; + mtx_unlock(&softc->lock); + + retval = ctl_remove_lun(cbe_lun); if (retval != 0) { snprintf(req->error_str, sizeof(req->error_str), - "error %d returned from ctl_invalidate_lun() for " + "error %d returned from ctl_remove_lun() for " "LUN %d", retval, params->lun_id); + mtx_lock(&softc->lock); + be_lun->flags &= ~CTL_BE_BLOCK_LUN_WAITING; + mtx_unlock(&softc->lock); goto bailout_error; } mtx_lock(&softc->lock); - be_lun->flags |= CTL_BE_BLOCK_LUN_WAITING; while ((be_lun->flags & CTL_BE_BLOCK_LUN_UNCONFIGURED) == 0) { - retval = msleep(be_lun, &softc->lock, PCATCH, "ctlblk", 0); - if (retval == EINTR) - break; - } + retval = msleep(be_lun, &softc->lock, PCATCH, "ctlblockrm", 0); + if (retval == EINTR) + break; + } be_lun->flags &= ~CTL_BE_BLOCK_LUN_WAITING; - - if ((be_lun->flags & CTL_BE_BLOCK_LUN_UNCONFIGURED) == 0) { - snprintf(req->error_str, sizeof(req->error_str), - "interrupted waiting for LUN to be freed"); + if (be_lun->flags & CTL_BE_BLOCK_LUN_UNCONFIGURED) { mtx_unlock(&softc->lock); - goto bailout_error; + free(be_lun, M_CTLBLK); + } else { + mtx_unlock(&softc->lock); + return (EINTR); } - STAILQ_REMOVE(&softc->lun_list, be_lun, ctl_be_block_lun, links); - - softc->num_luns--; - mtx_unlock(&softc->lock); - - taskqueue_drain_all(be_lun->io_taskqueue); - taskqueue_free(be_lun->io_taskqueue); - - if (be_lun->disk_stats != NULL) - devstat_remove_entry(be_lun->disk_stats); - - uma_zdestroy(be_lun->lun_zone); - - ctl_free_opts(&cbe_lun->options); - free(be_lun->dev_path, M_CTLBLK); - mtx_destroy(&be_lun->queue_lock); - mtx_destroy(&be_lun->io_lock); - free(be_lun, M_CTLBLK); - req->status = CTL_LUN_OK; return (0); @@ -2565,8 +2509,9 @@ ctl_be_block_modify(struct ctl_be_block_softc *softc, params = &req->reqdata.modify; + sx_xlock(&softc->modify_lock); mtx_lock(&softc->lock); - STAILQ_FOREACH(be_lun, &softc->lun_list, links) { + SLIST_FOREACH(be_lun, &softc->lun_list, links) { if (be_lun->cbe_lun.lun_id == params->lun_id) break; } @@ -2639,66 +2584,41 @@ ctl_be_block_modify(struct ctl_be_block_softc *softc, /* Tell the user the exact size we ended up using */ params->lun_size_bytes = be_lun->size_bytes; + sx_xunlock(&softc->modify_lock); req->status = error ? CTL_LUN_WARNING : CTL_LUN_OK; return (0); bailout_error: + sx_xunlock(&softc->modify_lock); req->status = CTL_LUN_ERROR; return (0); } static void -ctl_be_block_lun_shutdown(void *be_lun) +ctl_be_block_lun_shutdown(void *lun) { - struct ctl_be_block_lun *lun = be_lun; - struct ctl_be_block_softc *softc = lun->softc; + struct ctl_be_block_lun *be_lun = lun; + struct ctl_be_block_softc *softc = be_lun->softc; - mtx_lock(&softc->lock); - lun->flags |= CTL_BE_BLOCK_LUN_UNCONFIGURED; - if (lun->flags & CTL_BE_BLOCK_LUN_WAITING) - wakeup(lun); - mtx_unlock(&softc->lock); -} + taskqueue_drain_all(be_lun->io_taskqueue); + taskqueue_free(be_lun->io_taskqueue); + if (be_lun->disk_stats != NULL) + devstat_remove_entry(be_lun->disk_stats); + uma_zdestroy(be_lun->lun_zone); + ctl_free_opts(&be_lun->cbe_lun.options); + free(be_lun->dev_path, M_CTLBLK); + mtx_destroy(&be_lun->queue_lock); + mtx_destroy(&be_lun->io_lock); -static void -ctl_be_block_lun_config_status(void *be_lun, ctl_lun_config_status status) -{ - struct ctl_be_block_lun *lun; - struct ctl_be_block_softc *softc; - - lun = (struct ctl_be_block_lun *)be_lun; - softc = lun->softc; - - if (status == CTL_LUN_CONFIG_OK) { - mtx_lock(&softc->lock); - lun->flags &= ~CTL_BE_BLOCK_LUN_UNCONFIGURED; - if (lun->flags & CTL_BE_BLOCK_LUN_WAITING) - wakeup(lun); - mtx_unlock(&softc->lock); - - /* - * We successfully added the LUN, attempt to enable it. - */ - if (ctl_enable_lun(&lun->cbe_lun) != 0) { - printf("%s: ctl_enable_lun() failed!\n", __func__); - if (ctl_invalidate_lun(&lun->cbe_lun) != 0) { - printf("%s: ctl_invalidate_lun() failed!\n", - __func__); - } - } - - return; - } - - mtx_lock(&softc->lock); - lun->flags &= ~CTL_BE_BLOCK_LUN_UNCONFIGURED; - lun->flags |= CTL_BE_BLOCK_LUN_CONFIG_ERR; - wakeup(lun); + be_lun->flags |= CTL_BE_BLOCK_LUN_UNCONFIGURED; + if (be_lun->flags & CTL_BE_BLOCK_LUN_WAITING) + wakeup(be_lun); + else + free(be_lun, M_CTLBLK); mtx_unlock(&softc->lock); } - static int ctl_be_block_config_write(union ctl_io *io) { @@ -2862,10 +2782,11 @@ ctl_be_block_init(void) { struct ctl_be_block_softc *softc = &backend_block_softc; + sx_init(&softc->modify_lock, "ctlblock modify"); mtx_init(&softc->lock, "ctlblock", NULL, MTX_DEF); softc->beio_zone = uma_zcreate("beio", sizeof(struct ctl_be_block_io), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - STAILQ_INIT(&softc->lun_list); + SLIST_INIT(&softc->lun_list); return (0); } @@ -2874,23 +2795,24 @@ static int ctl_be_block_shutdown(void) { struct ctl_be_block_softc *softc = &backend_block_softc; - struct ctl_be_block_lun *lun, *next_lun; + struct ctl_be_block_lun *lun; mtx_lock(&softc->lock); - STAILQ_FOREACH_SAFE(lun, &softc->lun_list, links, next_lun) { + while ((lun = SLIST_FIRST(&softc->lun_list)) != NULL) { + SLIST_REMOVE_HEAD(&softc->lun_list, links); + softc->num_luns--; /* - * Drop our lock here. Since ctl_invalidate_lun() can call + * Drop our lock here. Since ctl_remove_lun() can call * back into us, this could potentially lead to a recursive * lock of the same mutex, which would cause a hang. */ mtx_unlock(&softc->lock); - ctl_disable_lun(&lun->cbe_lun); - ctl_invalidate_lun(&lun->cbe_lun); + ctl_remove_lun(&lun->cbe_lun); mtx_lock(&softc->lock); } mtx_unlock(&softc->lock); - uma_zdestroy(softc->beio_zone); mtx_destroy(&softc->lock); + sx_destroy(&softc->modify_lock); return (0); } Modified: stable/11/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_backend_ramdisk.c Tue May 19 14:31:47 2020 (r361255) +++ stable/11/sys/cam/ctl/ctl_backend_ramdisk.c Tue May 19 14:42:09 2020 (r361256) @@ -98,13 +98,11 @@ typedef enum { typedef enum { CTL_BE_RAMDISK_LUN_UNCONFIGURED = 0x01, - CTL_BE_RAMDISK_LUN_CONFIG_ERR = 0x02, CTL_BE_RAMDISK_LUN_WAITING = 0x04 } ctl_be_ramdisk_lun_flags; struct ctl_be_ramdisk_lun { struct ctl_lun_create_params params; - char lunname[32]; int indir; uint8_t **pages; uint8_t *zero_page; @@ -117,7 +115,7 @@ struct ctl_be_ramdisk_lun { uint64_t cap_used; struct ctl_be_ramdisk_softc *softc; ctl_be_ramdisk_lun_flags flags; - STAILQ_ENTRY(ctl_be_ramdisk_lun) links; + SLIST_ENTRY(ctl_be_ramdisk_lun) links; struct ctl_be_lun cbe_lun; struct taskqueue *io_taskqueue; struct task io_task; @@ -126,9 +124,10 @@ struct ctl_be_ramdisk_lun { }; struct ctl_be_ramdisk_softc { + struct sx modify_lock; struct mtx lock; int num_luns; - STAILQ_HEAD(, ctl_be_ramdisk_lun) lun_list; + SLIST_HEAD(, ctl_be_ramdisk_lun) lun_list; }; static struct ctl_be_ramdisk_softc rd_softc; @@ -153,8 +152,6 @@ static int ctl_backend_ramdisk_create(struct ctl_be_ra static int ctl_backend_ramdisk_modify(struct ctl_be_ramdisk_softc *softc, struct ctl_lun_req *req); static void ctl_backend_ramdisk_lun_shutdown(void *be_lun); -static void ctl_backend_ramdisk_lun_config_status(void *be_lun, - ctl_lun_config_status status); static struct ctl_backend_driver ctl_be_ramdisk_driver = { @@ -170,7 +167,7 @@ static struct ctl_backend_driver ctl_be_ramdisk_driver .lun_attr = ctl_backend_ramdisk_lun_attr, }; -MALLOC_DEFINE(M_RAMDISK, "ramdisk", "Memory used for CTL RAMdisk"); +MALLOC_DEFINE(M_RAMDISK, "ctlramdisk", "Memory used for CTL RAMdisk"); CTL_BACKEND_DECLARE(cbr, ctl_be_ramdisk_driver); static int @@ -179,8 +176,9 @@ ctl_backend_ramdisk_init(void) struct ctl_be_ramdisk_softc *softc = &rd_softc; memset(softc, 0, sizeof(*softc)); - mtx_init(&softc->lock, "ctlramdisk", NULL, MTX_DEF); - STAILQ_INIT(&softc->lun_list); + sx_init(&softc->modify_lock, "ctlrammod"); + mtx_init(&softc->lock, "ctlram", NULL, MTX_DEF); + SLIST_INIT(&softc->lun_list); return (0); } @@ -188,22 +186,24 @@ static int ctl_backend_ramdisk_shutdown(void) { struct ctl_be_ramdisk_softc *softc = &rd_softc; - struct ctl_be_ramdisk_lun *lun, *next_lun; + struct ctl_be_ramdisk_lun *lun; mtx_lock(&softc->lock); - STAILQ_FOREACH_SAFE(lun, &softc->lun_list, links, next_lun) { + while ((lun = SLIST_FIRST(&softc->lun_list)) != NULL) { + SLIST_REMOVE_HEAD(&softc->lun_list, links); + softc->num_luns--; /* - * Drop our lock here. Since ctl_invalidate_lun() can call + * Drop our lock here. Since ctl_remove_lun() can call * back into us, this could potentially lead to a recursive * lock of the same mutex, which would cause a hang. */ mtx_unlock(&softc->lock); - ctl_disable_lun(&lun->cbe_lun); - ctl_invalidate_lun(&lun->cbe_lun); + ctl_remove_lun(&lun->cbe_lun); mtx_lock(&softc->lock); } mtx_unlock(&softc->lock); mtx_destroy(&softc->lock); + sx_destroy(&softc->modify_lock); return (0); } @@ -885,12 +885,18 @@ ctl_backend_ramdisk_rm(struct ctl_be_ramdisk_softc *so int retval; params = &req->reqdata.rm; + sx_xlock(&softc->modify_lock); mtx_lock(&softc->lock); - STAILQ_FOREACH(be_lun, &softc->lun_list, links) { - if (be_lun->cbe_lun.lun_id == params->lun_id) + SLIST_FOREACH(be_lun, &softc->lun_list, links) { + if (be_lun->cbe_lun.lun_id == params->lun_id) { + SLIST_REMOVE(&softc->lun_list, be_lun, + ctl_be_ramdisk_lun, links); + softc->num_luns--; break; + } } mtx_unlock(&softc->lock); + sx_xunlock(&softc->modify_lock); if (be_lun == NULL) { snprintf(req->error_str, sizeof(req->error_str), "%s: LUN %u is not managed by the ramdisk backend", *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 19 15:02: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 E790E2DB216; Tue, 19 May 2020 15:02:30 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49RJyY3QnGz4f1l; Tue, 19 May 2020 15:02:29 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.1.2] (pool-74-110-182-118.rcmdva.fios.verizon.net [74.110.182.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id 2898C2700092; Tue, 19 May 2020 11:02:28 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu 2898C2700092 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1589900548; bh=UCs2cCLpTnnmn/S+nmUrWIlRIRC/J+ss33J/43D3sqs=; h=Subject:To:From:Date:From; b=bjus9jygTBuK/tiFbnBrv+CR2h92pbhoBj1VyHIEeEenyR/pDOPr3b4fXik6B7W+r Qh8VEn2nrwuXzo4sH0wtTYDcl1tCEMoCuH6+2djg4jte/RDZyjOgJAA0daGwsAod4G HVOfBp0i/jSxhs8SeGm4FFi2WEkKJjCzGTbR4nF9GzxZvUNthIkPiILkJzYRE/0brp qfNGiQAf1hy9fVLMOwkk+t7PAn9+pMFRqZu4ezkhfYEB2z1YooGvAFoSa+/x4XA0ga /ZR0fFzkMhvKGnocdAeHziyw0dJbtU07xlaiGXN6gerSrdhhAjybVl4jx6fmJumlfb zc0m634YLma9A== Subject: Re: svn commit: r347418 - head/sys/net To: Kristof Provost , Eric Joyner , Jacob Keller , shurd@FreeBSD.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905100041.x4A0fhNT083122@repo.freebsd.org> <3BBFB371-EA44-4EE9-8A55-542CDE273CC4@FreeBSD.org> From: Andrew Gallatin Message-ID: Date: Tue, 19 May 2020 11:02:27 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <3BBFB371-EA44-4EE9-8A55-542CDE273CC4@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 49RJyY3QnGz4f1l X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=cs.duke.edu header.s=mail0816 header.b=bjus9jyg; dmarc=pass (policy=none) header.from=cs.duke.edu; spf=pass (mx1.freebsd.org: domain of gallatin@cs.duke.edu designates 152.3.140.1 as permitted sender) smtp.mailfrom=gallatin@cs.duke.edu X-Spamd-Result: default: False [-3.71 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[cs.duke.edu:s=mail0816]; RCVD_IN_DNSWL_LOW(-0.10)[152.3.140.1:from]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:152.3.140.0/23]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_MEDIUM(-0.97)[-0.974]; DWL_DNSWL_LOW(-1.00)[duke.edu:dkim]; RECEIVED_SPAMHAUS_PBL(0.00)[74.110.182.118:received]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[cs.duke.edu:+]; DMARC_POLICY_ALLOW(-0.50)[cs.duke.edu,none]; RCPT_COUNT_SEVEN(0.00)[7]; NEURAL_HAM_SHORT(-0.63)[-0.633]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13371, ipnet:152.3.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; 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, 19 May 2020 15:02:31 -0000 On 2020-05-19 04:21, Kristof Provost wrote: > The if_bnxt driver initialises |.isc_nrxd_max = {INT32_MAX, INT32_MAX, > INT32_MAX},|, so presumably that’s the cause. > I don’t know what a sane value would be though. I’ve defaulted to 4096 > (because that’s what some other iflib users seems to do) for now, and > that seems to work. It doesn’t panic and I can get traffic through it at > least: You seem to be setting the max, not the default, and 4K max descriptors on a 100g device is going to basically cripple it. How about setting to the next power of 2 below max int so as to keep with the authors intent? If we don't already have a macro, something like (INT32_MAX >> 1) + 1 Drew From owner-svn-src-all@freebsd.org Tue May 19 15:19: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 C03BF2DB774; Tue, 19 May 2020 15:19:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RKLM4gSRz4gCD; Tue, 19 May 2020 15:19:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B224CD12; Tue, 19 May 2020 15:19:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JFJdOo071106; Tue, 19 May 2020 15:19:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JFJd7f071105; Tue, 19 May 2020 15:19:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005191519.04JFJd7f071105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 19 May 2020 15:19:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361257 - 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: 361257 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, 19 May 2020 15:19:39 -0000 Author: kevans Date: Tue May 19 15:19:39 2020 New Revision: 361257 URL: https://svnweb.freebsd.org/changeset/base/361257 Log: bsdinstall: do a `certctl rehash` upon installation of configuration If certctl is installed on the system we're configuring, do a certctl rehash. Note that certctl may not be present if the world we've installed was built either WITHOUT_OPENSSL or WITHOUT_CAROOT. In this scenario, we don't currently see if the host has a certctl as this may be an indication that the system *shouldn't* have certs installed into /etc/ssl. Reviewed by: allanjude, dteske MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D24640 Modified: head/usr.sbin/bsdinstall/scripts/config Modified: head/usr.sbin/bsdinstall/scripts/config ============================================================================== --- head/usr.sbin/bsdinstall/scripts/config Tue May 19 14:42:09 2020 (r361256) +++ head/usr.sbin/bsdinstall/scripts/config Tue May 19 15:19:39 2020 (r361257) @@ -55,6 +55,9 @@ 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 Tue May 19 15:23: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 E52A12DB9D6; Tue, 19 May 2020 15:23:39 +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 49RKQz1l08z3RRY; Tue, 19 May 2020 15:23:38 +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 04JFNULQ006637; Tue, 19 May 2020 08:23:30 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04JFNTdn006636; Tue, 19 May 2020 08:23:29 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202005191523.04JFNTdn006636@gndrsh.dnsmgr.net> Subject: Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs In-Reply-To: <202005190241.04J2f54E001347@repo.freebsd.org> To: Kyle Evans Date: Tue, 19 May 2020 08:23:29 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49RKQz1l08z3RRY 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:13868, ipnet:69.59.192.0/19, 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: Tue, 19 May 2020 15:23:40 -0000 > Author: kevans > Date: Tue May 19 02:41:05 2020 > New Revision: 361238 > URL: https://svnweb.freebsd.org/changeset/base/361238 > > Log: > zfs: reject read(2) of a dirfd with EISDIR > > This is independent of the recently-discussed global change, which is still > in review/discussion stage. > > This is effectively a measure for consistency in the ZFS world, where > FreeBSD was the only platform (as far as I could find) that allowed this. > What ZFS exposes is decidedly not useful for any real purposes, to > paraphrase (hopefully faithfully) jhb's findings when exploring this: > > The size of a directory in ZFS is the number of directory entries within. > When reading a directory, you would instead get the leading part of its raw > contents; the amount you get being dictated by the "size," i.e. number of > directory entries. There's decidedly (luckily) no stack disclosure happening > here, though the behavior is bizarre and almost certainly a historical > accident. > > This change has already been upstreamed to OpenZFS. Until the grep -d skip issue is addressed I object to this change as it is going to cause people who do grep with wildcards to see lots of errors that before where pretty much either silent (no match occured) or spit out a "binary file foo matches." > > MFC after: 1 week Please no. > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue May 19 02:07:08 2020 (r361237) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue May 19 02:41:05 2020 (r361238) > @@ -646,6 +646,12 @@ zfs_read(vnode_t *vp, uio_t *uio, int ioflag, cred_t * > ZFS_ENTER(zfsvfs); > ZFS_VERIFY_ZP(zp); > > + /* We don't copy out anything useful for directories. */ > + if (vp->v_type == VDIR) { > + ZFS_EXIT(zfsvfs); > + return (SET_ERROR(EISDIR)); > + } > + > if (zp->z_pflags & ZFS_AV_QUARANTINED) { > ZFS_EXIT(zfsvfs); > return (SET_ERROR(EACCES)); > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue May 19 15:25: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 78F3F2DBE2E; Tue, 19 May 2020 15:25: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 49RKTV2fK9z3RnC; Tue, 19 May 2020 15:25:50 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (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 50C5B2B97E; Tue, 19 May 2020 15:25:50 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f176.google.com with SMTP id i68so11465697qtb.5; Tue, 19 May 2020 08:25:50 -0700 (PDT) X-Gm-Message-State: AOAM531/ybg3eRoDE90pTnS3tcbkvO19inUFEsByxoCy2Rsx+TPLusrB 2EZ+mXw5taip0I8vtZ4cs/v1Gmwazg+rT/a1FCY= X-Google-Smtp-Source: ABdhPJxWMLHSez29Bx5kVv/HAOGGvuB3HJTGwaZyBHwz3FSdCfO9XMeUED/U660D24iaVHl6y6JQB0N3XOMlPb4VEFU= X-Received: by 2002:ac8:361b:: with SMTP id m27mr284075qtb.60.1589901949798; Tue, 19 May 2020 08:25:49 -0700 (PDT) MIME-Version: 1.0 References: <202005190241.04J2f54E001347@repo.freebsd.org> <202005191523.04JFNTdn006636@gndrsh.dnsmgr.net> In-Reply-To: <202005191523.04JFNTdn006636@gndrsh.dnsmgr.net> From: Kyle Evans Date: Tue, 19 May 2020 10:25:36 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: "Rodney W. Grimes" 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: Tue, 19 May 2020 15:25:50 -0000 On Tue, May 19, 2020 at 10:23 AM Rodney W. Grimes wrote: > > > Author: kevans > > Date: Tue May 19 02:41:05 2020 > > New Revision: 361238 > > URL: https://svnweb.freebsd.org/changeset/base/361238 > > > > Log: > > zfs: reject read(2) of a dirfd with EISDIR > > > > This is independent of the recently-discussed global change, which is still > > in review/discussion stage. > > > > This is effectively a measure for consistency in the ZFS world, where > > FreeBSD was the only platform (as far as I could find) that allowed this. > > What ZFS exposes is decidedly not useful for any real purposes, to > > paraphrase (hopefully faithfully) jhb's findings when exploring this: > > > > The size of a directory in ZFS is the number of directory entries within. > > When reading a directory, you would instead get the leading part of its raw > > contents; the amount you get being dictated by the "size," i.e. number of > > directory entries. There's decidedly (luckily) no stack disclosure happening > > here, though the behavior is bizarre and almost certainly a historical > > accident. > > > > This change has already been upstreamed to OpenZFS. > > Until the grep -d skip issue is addressed I object to this change as > it is going to cause people who do grep with wildcards to see lots > of errors that before where pretty much either silent (no match occured) > or spit out a "binary file foo matches." > That seems preferable to grepping random bytes that don't particularly contain any strings? They'd never see "binary file foo matches" in this case. This isn't exactly divergent from the behavior they'd see with ZFS anywhere else. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Tue May 19 15:27: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 F28232DBFD1; Tue, 19 May 2020 15:27:20 +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 49RKWD67KGz3SCp; Tue, 19 May 2020 15:27:20 +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 CD996D019; Tue, 19 May 2020 15:27:20 +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 04JFRK5U077741; Tue, 19 May 2020 15:27:20 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JFRKjG077740; Tue, 19 May 2020 15:27:20 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202005191527.04JFRKjG077740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 19 May 2020 15:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361258 - 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: 361258 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, 19 May 2020 15:27:21 -0000 Author: andrew Date: Tue May 19 15:27:20 2020 New Revision: 361258 URL: https://svnweb.freebsd.org/changeset/base/361258 Log: Create MSI/MSI-X isrcs as needed in the GICv3 ITS driver Previously we would create an isrc for each MSI/MSI-X interrupt. This causes issues for other interrupt sources in the system, e.g. a GPIO driver, as they may be unable to allocate interrupts. This works around this by allocating the isrc only when needed. Reported by: alisaidi@amazon.com Reviewed by: mmel Sponsored by: Innovaate UK Differential Revision: https://reviews.freebsd.org/D24876 Modified: head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Tue May 19 15:19:39 2020 (r361257) +++ head/sys/arm64/arm64/gicv3_its.c Tue May 19 15:27:20 2020 (r361258) @@ -228,6 +228,7 @@ struct gicv3_its_irqsrc { u_int gi_id; u_int gi_lpi; struct its_dev *gi_its_dev; + TAILQ_ENTRY(gicv3_its_irqsrc) gi_link; }; struct gicv3_its_softc { @@ -254,12 +255,14 @@ struct gicv3_its_softc { size_t sc_its_cmd_next_idx; vmem_t *sc_irq_alloc; - struct gicv3_its_irqsrc *sc_irqs; + struct gicv3_its_irqsrc **sc_irqs; u_int sc_irq_base; u_int sc_irq_length; + u_int sc_irq_count; struct mtx sc_its_dev_lock; TAILQ_HEAD(its_dev_list, its_dev) sc_its_dev_list; + TAILQ_HEAD(free_irqs, gicv3_its_irqsrc) sc_free_irqs; #define ITS_FLAGS_CMDQ_FLUSH 0x00000001 #define ITS_FLAGS_LPI_CONF_FLUSH 0x00000002 @@ -800,7 +803,6 @@ static int gicv3_its_attach(device_t dev) { struct gicv3_its_softc *sc; - const char *name; uint32_t iidr; int domain, err, i, rid; @@ -875,6 +877,7 @@ gicv3_its_attach(device_t dev) its_init_cpu(dev, sc); TAILQ_INIT(&sc->sc_its_dev_list); + TAILQ_INIT(&sc->sc_free_irqs); /* * Create the vmem object to allocate INTRNG IRQs from. We try to @@ -887,13 +890,6 @@ gicv3_its_attach(device_t dev) sc->sc_irqs = malloc(sizeof(*sc->sc_irqs) * sc->sc_irq_length, M_GICV3_ITS, M_WAITOK | M_ZERO); - name = device_get_nameunit(dev); - for (i = 0; i < sc->sc_irq_length; i++) { - sc->sc_irqs[i].gi_id = -1; - sc->sc_irqs[i].gi_lpi = i + sc->sc_irq_base - GIC_FIRST_LPI; - err = intr_isrc_register(&sc->sc_irqs[i].gi_isrc, dev, 0, - "%s,%u", name, i); - } /* For GIC-500 install tracking sysctls. */ if ((iidr & (GITS_IIDR_PRODUCT_MASK | GITS_IIDR_IMPLEMENTOR_MASK)) == @@ -975,7 +971,7 @@ gicv3_its_intr(void *arg, uintptr_t irq) struct trapframe *tf; irq -= sc->sc_irq_base; - girq = &sc->sc_irqs[irq]; + girq = sc->sc_irqs[irq]; if (girq == NULL) panic("gicv3_its_intr: Invalid interrupt %ld", irq + sc->sc_irq_base); @@ -1201,6 +1197,53 @@ its_device_release(device_t dev, struct its_dev *its_d free(its_dev, M_GICV3_ITS); } +static struct gicv3_its_irqsrc * +gicv3_its_alloc_irqsrc(device_t dev, struct gicv3_its_softc *sc, u_int irq) +{ + struct gicv3_its_irqsrc *girq = NULL; + + KASSERT(sc->sc_irqs[irq] == NULL, + ("%s: Interrupt %u already allocated", __func__, irq)); + mtx_lock_spin(&sc->sc_its_dev_lock); + if (!TAILQ_EMPTY(&sc->sc_free_irqs)) { + girq = TAILQ_FIRST(&sc->sc_free_irqs); + TAILQ_REMOVE(&sc->sc_free_irqs, girq, gi_link); + } + mtx_unlock_spin(&sc->sc_its_dev_lock); + if (girq == NULL) { + girq = malloc(sizeof(*girq), M_GICV3_ITS, + M_NOWAIT | M_ZERO); + if (girq == NULL) + return (NULL); + girq->gi_id = -1; + if (intr_isrc_register(&girq->gi_isrc, dev, 0, + "%s,%u", device_get_nameunit(dev), irq) != 0) { + free(girq, M_GICV3_ITS); + return (NULL); + } + } + girq->gi_lpi = irq + sc->sc_irq_base - GIC_FIRST_LPI; + sc->sc_irqs[irq] = girq; + + return (girq); +} + +static void +gicv3_its_release_irqsrc(struct gicv3_its_softc *sc, + struct gicv3_its_irqsrc *girq) +{ + u_int irq; + + mtx_assert(&sc->sc_its_dev_lock, MA_OWNED); + + irq = girq->gi_lpi + GIC_FIRST_LPI - sc->sc_irq_base; + sc->sc_irqs[irq] = NULL; + + girq->gi_id = -1; + girq->gi_its_dev = NULL; + TAILQ_INSERT_TAIL(&sc->sc_free_irqs, girq, gi_link); +} + static int gicv3_its_alloc_msi(device_t dev, device_t child, int count, int maxcount, device_t *pic, struct intr_irqsrc **srcs) @@ -1220,12 +1263,35 @@ gicv3_its_alloc_msi(device_t dev, device_t child, int sc = device_get_softc(dev); irq = its_dev->lpis.lpi_base + its_dev->lpis.lpi_num - its_dev->lpis.lpi_free; + + /* Allocate the irqsrc for each MSI */ for (i = 0; i < count; i++, irq++) { its_dev->lpis.lpi_free--; - girq = &sc->sc_irqs[irq]; + srcs[i] = (struct intr_irqsrc *)gicv3_its_alloc_irqsrc(dev, + sc, irq); + if (srcs[i] == NULL) + break; + } + + /* The allocation failed, release them */ + if (i != count) { + mtx_lock_spin(&sc->sc_its_dev_lock); + for (i = 0; i < count; i++) { + girq = (struct gicv3_its_irqsrc *)srcs[i]; + if (girq == NULL) + break; + gicv3_its_release_irqsrc(sc, girq); + srcs[i] = NULL; + } + mtx_unlock_spin(&sc->sc_its_dev_lock); + return (ENXIO); + } + + /* Finish the allocation now we have all MSI irqsrcs */ + for (i = 0; i < count; i++) { + girq = (struct gicv3_its_irqsrc *)srcs[i]; girq->gi_id = i; girq->gi_its_dev = its_dev; - srcs[i] = (struct intr_irqsrc *)girq; /* Map the message to the given IRQ */ gicv3_its_select_cpu(dev, (struct intr_irqsrc *)girq); @@ -1241,6 +1307,7 @@ static int gicv3_its_release_msi(device_t dev, device_t child, int count, struct intr_irqsrc **isrc) { + struct gicv3_its_softc *sc; struct gicv3_its_irqsrc *girq; struct its_dev *its_dev; int i; @@ -1254,11 +1321,14 @@ gicv3_its_release_msi(device_t dev, device_t child, in ("gicv3_its_release_msi: Releasing more interrupts than " "were allocated: releasing %d, allocated %d", count, its_dev->lpis.lpi_busy)); + + sc = device_get_softc(dev); + mtx_lock_spin(&sc->sc_its_dev_lock); for (i = 0; i < count; i++) { girq = (struct gicv3_its_irqsrc *)isrc[i]; - girq->gi_id = -1; - girq->gi_its_dev = NULL; + gicv3_its_release_irqsrc(sc, girq); } + mtx_unlock_spin(&sc->sc_its_dev_lock); its_dev->lpis.lpi_busy -= count; if (its_dev->lpis.lpi_busy == 0) @@ -1286,7 +1356,10 @@ gicv3_its_alloc_msix(device_t dev, device_t child, dev sc = device_get_softc(dev); irq = its_dev->lpis.lpi_base + its_dev->lpis.lpi_num - its_dev->lpis.lpi_free; - girq = &sc->sc_irqs[irq]; + + girq = gicv3_its_alloc_irqsrc(dev, sc, irq); + if (girq == NULL) + return (ENXIO); girq->gi_id = its_dev->lpis.lpi_busy; girq->gi_its_dev = its_dev; @@ -1306,6 +1379,7 @@ gicv3_its_alloc_msix(device_t dev, device_t child, dev static int gicv3_its_release_msix(device_t dev, device_t child, struct intr_irqsrc *isrc) { + struct gicv3_its_softc *sc; struct gicv3_its_irqsrc *girq; struct its_dev *its_dev; @@ -1317,9 +1391,10 @@ gicv3_its_release_msix(device_t dev, device_t child, s KASSERT(its_dev->lpis.lpi_busy > 0, ("gicv3_its_release_msix: Releasing more interrupts than " "were allocated: allocated %d", its_dev->lpis.lpi_busy)); + + sc = device_get_softc(dev); girq = (struct gicv3_its_irqsrc *)isrc; - girq->gi_its_dev = NULL; - girq->gi_id = -1; + gicv3_its_release_irqsrc(sc, girq); its_dev->lpis.lpi_busy--; if (its_dev->lpis.lpi_busy == 0) From owner-svn-src-all@freebsd.org Tue May 19 15:27: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 C4FEE2DC20B; Tue, 19 May 2020 15:27:46 +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 49RKWk36XYz3SGZ; Tue, 19 May 2020 15:27:46 +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 04JFRikf006684; Tue, 19 May 2020 08:27:44 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04JFRiMs006683; Tue, 19 May 2020 08:27:44 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202005191527.04JFRiMs006683@gndrsh.dnsmgr.net> Subject: Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs In-Reply-To: To: Kyle Evans Date: Tue, 19 May 2020 08:27:44 -0700 (PDT) CC: "Rodney W. Grimes" , 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: 49RKWk36XYz3SGZ 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:13868, ipnet:69.59.192.0/19, 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: Tue, 19 May 2020 15:27:46 -0000 > On Tue, May 19, 2020 at 10:23 AM Rodney W. Grimes > wrote: > > > > > Author: kevans > > > Date: Tue May 19 02:41:05 2020 > > > New Revision: 361238 > > > URL: https://svnweb.freebsd.org/changeset/base/361238 > > > > > > Log: > > > zfs: reject read(2) of a dirfd with EISDIR > > > > > > This is independent of the recently-discussed global change, which is still > > > in review/discussion stage. > > > > > > This is effectively a measure for consistency in the ZFS world, where > > > FreeBSD was the only platform (as far as I could find) that allowed this. > > > What ZFS exposes is decidedly not useful for any real purposes, to > > > paraphrase (hopefully faithfully) jhb's findings when exploring this: > > > > > > The size of a directory in ZFS is the number of directory entries within. > > > When reading a directory, you would instead get the leading part of its raw > > > contents; the amount you get being dictated by the "size," i.e. number of > > > directory entries. There's decidedly (luckily) no stack disclosure happening > > > here, though the behavior is bizarre and almost certainly a historical > > > accident. > > > > > > This change has already been upstreamed to OpenZFS. > > > > Until the grep -d skip issue is addressed I object to this change as > > it is going to cause people who do grep with wildcards to see lots > > of errors that before where pretty much either silent (no match occured) > > or spit out a "binary file foo matches." > > > > That seems preferable to grepping random bytes that don't particularly > contain any strings? They'd never see "binary file foo matches" in > this case. The difference is you rarely get a hit, and now your gauranteed to get a hit on every single directory making grep * very noisy, where it was often silent or nearly silent before. > > This isn't exactly divergent from the behavior they'd see with ZFS > anywhere else. It is extremly divergent from 42 years of behavior. > Thanks, > > Kyle Evans > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue May 19 15:31: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 7B5742DC134; Tue, 19 May 2020 15:31:01 +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 49RKbT19pYz3ScY; Tue, 19 May 2020 15:31:00 +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 04JFUxHY006712; Tue, 19 May 2020 08:30:59 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04JFUxCC006711; Tue, 19 May 2020 08:30:59 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202005191530.04JFUxCC006711@gndrsh.dnsmgr.net> Subject: Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs In-Reply-To: <202005191527.04JFRiMs006683@gndrsh.dnsmgr.net> To: rgrimes@freebsd.org Date: Tue, 19 May 2020 08:30:59 -0700 (PDT) CC: Kyle Evans , 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: 49RKbT19pYz3ScY X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, 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: Tue, 19 May 2020 15:31:01 -0000 > > On Tue, May 19, 2020 at 10:23 AM Rodney W. Grimes > > wrote: > > > > > > > Author: kevans > > > > Date: Tue May 19 02:41:05 2020 > > > > New Revision: 361238 > > > > URL: https://svnweb.freebsd.org/changeset/base/361238 > > > > > > > > Log: > > > > zfs: reject read(2) of a dirfd with EISDIR > > > > > > > > This is independent of the recently-discussed global change, which is still > > > > in review/discussion stage. > > > > > > > > This is effectively a measure for consistency in the ZFS world, where > > > > FreeBSD was the only platform (as far as I could find) that allowed this. > > > > What ZFS exposes is decidedly not useful for any real purposes, to > > > > paraphrase (hopefully faithfully) jhb's findings when exploring this: > > > > > > > > The size of a directory in ZFS is the number of directory entries within. > > > > When reading a directory, you would instead get the leading part of its raw > > > > contents; the amount you get being dictated by the "size," i.e. number of > > > > directory entries. There's decidedly (luckily) no stack disclosure happening > > > > here, though the behavior is bizarre and almost certainly a historical > > > > accident. > > > > > > > > This change has already been upstreamed to OpenZFS. > > > > > > Until the grep -d skip issue is addressed I object to this change as > > > it is going to cause people who do grep with wildcards to see lots > > > of errors that before where pretty much either silent (no match occured) > > > or spit out a "binary file foo matches." > > > > > > > That seems preferable to grepping random bytes that don't particularly > > contain any strings? They'd never see "binary file foo matches" in > > this case. > > The difference is you rarely get a hit, and now your gauranteed to > get a hit on every single directory making grep * very noisy, where > it was often silent or nearly silent before. Please, go try this and see if you can see why I am asserting what I am: (on one of your patched systems) cd /etc grep foo * grep -d skip foo * #This makes it closer to old behavior, not exact as binary matches shall be skipped. The first command isg going to return an error for every directory, the second command, closer to historical behavior, is going to be nearly silent. You could run the second command on a pre patched system, ufs or zfs wont matter much. > > This isn't exactly divergent from the behavior they'd see with ZFS > > anywhere else. > > It is extremly divergent from 42 years of behavior. > > > Thanks, > > > > Kyle Evans > > > > -- > Rod Grimes rgrimes@freebsd.org > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue May 19 15:31: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 6D1882DC505; Tue, 19 May 2020 15:31:42 +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 49RKcG1w1Xz3T0v; Tue, 19 May 2020 15:31:41 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (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 970E12C61E; Tue, 19 May 2020 15:31:41 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f171.google.com with SMTP id b6so15603395qkh.11; Tue, 19 May 2020 08:31:41 -0700 (PDT) X-Gm-Message-State: AOAM530mVNhlFvGbTZNtpnFrAU5jPanaHUXZSsbQhtt5Lq/tmzO2yzUe X+3a8MMRoExuKCA+7NKl/1OYq886wL2H8g6c8lc= X-Google-Smtp-Source: ABdhPJySxY22UQ2jLVIsYxGQ7gG5Mt48i6fQzRXuTExxuVvvuyOgPcPNv7AKmOlxb38jAXgyZkCRiwuRYDZDpLgm+tg= X-Received: by 2002:a37:5b47:: with SMTP id p68mr21800981qkb.120.1589902296704; Tue, 19 May 2020 08:31:36 -0700 (PDT) MIME-Version: 1.0 References: <202005191527.04JFRiMs006683@gndrsh.dnsmgr.net> In-Reply-To: <202005191527.04JFRiMs006683@gndrsh.dnsmgr.net> From: Kyle Evans Date: Tue, 19 May 2020 10:31:23 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: "Rodney W. Grimes" 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: Tue, 19 May 2020 15:31:42 -0000 On Tue, May 19, 2020 at 10:27 AM Rodney W. Grimes wrote: > > > On Tue, May 19, 2020 at 10:23 AM Rodney W. Grimes > > wrote: > > > > > > > Author: kevans > > > > Date: Tue May 19 02:41:05 2020 > > > > New Revision: 361238 > > > > URL: https://svnweb.freebsd.org/changeset/base/361238 > > > > > > > > Log: > > > > zfs: reject read(2) of a dirfd with EISDIR > > > > > > > > This is independent of the recently-discussed global change, which is still > > > > in review/discussion stage. > > > > > > > > This is effectively a measure for consistency in the ZFS world, where > > > > FreeBSD was the only platform (as far as I could find) that allowed this. > > > > What ZFS exposes is decidedly not useful for any real purposes, to > > > > paraphrase (hopefully faithfully) jhb's findings when exploring this: > > > > > > > > The size of a directory in ZFS is the number of directory entries within. > > > > When reading a directory, you would instead get the leading part of its raw > > > > contents; the amount you get being dictated by the "size," i.e. number of > > > > directory entries. There's decidedly (luckily) no stack disclosure happening > > > > here, though the behavior is bizarre and almost certainly a historical > > > > accident. > > > > > > > > This change has already been upstreamed to OpenZFS. > > > > > > Until the grep -d skip issue is addressed I object to this change as > > > it is going to cause people who do grep with wildcards to see lots > > > of errors that before where pretty much either silent (no match occured) > > > or spit out a "binary file foo matches." > > > > > > > That seems preferable to grepping random bytes that don't particularly > > contain any strings? They'd never see "binary file foo matches" in > > this case. > > The difference is you rarely get a hit, and now your gauranteed to > get a hit on every single directory making grep * very noisy, where > it was often silent or nearly silent before. > As you noted in the review for the larger change, -d skip is a good option for the people that don't like this. It probably makes sense as a default, but then we'd be diverging from the other popular grep that defaults to -d read and spews out EISDIR more often than not. > > > > This isn't exactly divergent from the behavior they'd see with ZFS > > anywhere else. > > It is extremly divergent from 42 years of behavior. > I don't think ZFS has been implemented on FreeBSD for 42 years, and I don't find this grep argument compelling enough to restore peoples' ability to read the raw znode of a directory. From owner-svn-src-all@freebsd.org Tue May 19 15:34: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 28D082DC550; Tue, 19 May 2020 15:34:50 +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 49RKgs6Kntz3T6K; Tue, 19 May 2020 15:34:49 +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 04JFYlO6006760; Tue, 19 May 2020 08:34:47 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04JFYlSQ006759; Tue, 19 May 2020 08:34:47 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202005191534.04JFYlSQ006759@gndrsh.dnsmgr.net> Subject: Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs In-Reply-To: To: Kyle Evans Date: Tue, 19 May 2020 08:34:47 -0700 (PDT) CC: "Rodney W. Grimes" , 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: 49RKgs6Kntz3T6K 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:13868, ipnet:69.59.192.0/19, 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: Tue, 19 May 2020 15:34:50 -0000 > On Tue, May 19, 2020 at 10:27 AM Rodney W. Grimes > wrote: > > > > > On Tue, May 19, 2020 at 10:23 AM Rodney W. Grimes > > > wrote: > > > > > > > > > Author: kevans > > > > > Date: Tue May 19 02:41:05 2020 > > > > > New Revision: 361238 > > > > > URL: https://svnweb.freebsd.org/changeset/base/361238 > > > > > > > > > > Log: > > > > > zfs: reject read(2) of a dirfd with EISDIR > > > > > > > > > > This is independent of the recently-discussed global change, which is still > > > > > in review/discussion stage. > > > > > > > > > > This is effectively a measure for consistency in the ZFS world, where > > > > > FreeBSD was the only platform (as far as I could find) that allowed this. > > > > > What ZFS exposes is decidedly not useful for any real purposes, to > > > > > paraphrase (hopefully faithfully) jhb's findings when exploring this: > > > > > > > > > > The size of a directory in ZFS is the number of directory entries within. > > > > > When reading a directory, you would instead get the leading part of its raw > > > > > contents; the amount you get being dictated by the "size," i.e. number of > > > > > directory entries. There's decidedly (luckily) no stack disclosure happening > > > > > here, though the behavior is bizarre and almost certainly a historical > > > > > accident. > > > > > > > > > > This change has already been upstreamed to OpenZFS. > > > > > > > > Until the grep -d skip issue is addressed I object to this change as > > > > it is going to cause people who do grep with wildcards to see lots > > > > of errors that before where pretty much either silent (no match occured) > > > > or spit out a "binary file foo matches." > > > > > > > > > > That seems preferable to grepping random bytes that don't particularly > > > contain any strings? They'd never see "binary file foo matches" in > > > this case. > > > > The difference is you rarely get a hit, and now your gauranteed to > > get a hit on every single directory making grep * very noisy, where > > it was often silent or nearly silent before. > > > > As you noted in the review for the larger change, -d skip is a good > option for the people that don't like this. It probably makes sense as > a default, but then we'd be diverging from the other popular grep that > defaults to -d read and spews out EISDIR more often than not. Yet another thing I hate about Linux, thank you for adding it to FreeBSD :-) > > > > > > This isn't exactly divergent from the behavior they'd see with ZFS > > > anywhere else. > > > > It is extremly divergent from 42 years of behavior. > > > > I don't think ZFS has been implemented on FreeBSD for 42 years, and I > don't find this grep argument compelling enough to restore peoples' > ability to read the raw znode of a directory. The EISDIR behavior is what your changing, independent of file system(s) you have done so far. The fact the behavior is now different between UFS and ZFS is sic, IMHO. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue May 19 15:37: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 EA1CB2DC905; Tue, 19 May 2020 15:37:58 +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 49RKlV5wZGz3TVt; Tue, 19 May 2020 15:37:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (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 C13B82C85C; Tue, 19 May 2020 15:37:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f180.google.com with SMTP id v4so11504855qte.3; Tue, 19 May 2020 08:37:58 -0700 (PDT) X-Gm-Message-State: AOAM533T+1IrjoneEohoT9SRdZQ9i3IE89K/uIfRdfX95edV4/t12CIa sP2JmSGhrN1DGnLZb91GGZ00I7JAfl6PqjHm0U4= X-Google-Smtp-Source: ABdhPJzJtXBOd/bkLvjoZVjkzFvN10f5OeSXZpomG0JnEZ7IVERbFfyYnVyGJHLRJgvSTf9gmNwMebqJIWhMnaSW5Pc= X-Received: by 2002:ac8:37e6:: with SMTP id e35mr307742qtc.310.1589902678273; Tue, 19 May 2020 08:37:58 -0700 (PDT) MIME-Version: 1.0 References: <202005191534.04JFYlSQ006759@gndrsh.dnsmgr.net> In-Reply-To: <202005191534.04JFYlSQ006759@gndrsh.dnsmgr.net> From: Kyle Evans Date: Tue, 19 May 2020 10:37:45 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: "Rodney W. Grimes" 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: Tue, 19 May 2020 15:37:59 -0000 On Tue, May 19, 2020 at 10:34 AM Rodney W. Grimes wrote: > > > On Tue, May 19, 2020 at 10:27 AM Rodney W. Grimes > > wrote: > > > > > > > On Tue, May 19, 2020 at 10:23 AM Rodney W. Grimes > > > > wrote: > > > > > > > > > > > Author: kevans > > > > > > Date: Tue May 19 02:41:05 2020 > > > > > > New Revision: 361238 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/361238 > > > > > > > > > > > > Log: > > > > > > zfs: reject read(2) of a dirfd with EISDIR > > > > > > > > > > > > This is independent of the recently-discussed global change, which is still > > > > > > in review/discussion stage. > > > > > > > > > > > > This is effectively a measure for consistency in the ZFS world, where > > > > > > FreeBSD was the only platform (as far as I could find) that allowed this. > > > > > > What ZFS exposes is decidedly not useful for any real purposes, to > > > > > > paraphrase (hopefully faithfully) jhb's findings when exploring this: > > > > > > > > > > > > The size of a directory in ZFS is the number of directory entries within. > > > > > > When reading a directory, you would instead get the leading part of its raw > > > > > > contents; the amount you get being dictated by the "size," i.e. number of > > > > > > directory entries. There's decidedly (luckily) no stack disclosure happening > > > > > > here, though the behavior is bizarre and almost certainly a historical > > > > > > accident. > > > > > > > > > > > > This change has already been upstreamed to OpenZFS. > > > > > > > > > > Until the grep -d skip issue is addressed I object to this change as > > > > > it is going to cause people who do grep with wildcards to see lots > > > > > of errors that before where pretty much either silent (no match occured) > > > > > or spit out a "binary file foo matches." > > > > > > > > > > > > > That seems preferable to grepping random bytes that don't particularly > > > > contain any strings? They'd never see "binary file foo matches" in > > > > this case. > > > > > > The difference is you rarely get a hit, and now your gauranteed to > > > get a hit on every single directory making grep * very noisy, where > > > it was often silent or nearly silent before. > > > > > > > As you noted in the review for the larger change, -d skip is a good > > option for the people that don't like this. It probably makes sense as > > a default, but then we'd be diverging from the other popular grep that > > defaults to -d read and spews out EISDIR more often than not. > > Yet another thing I hate about Linux, thank you for adding it to FreeBSD :-) > > > > > > > > > This isn't exactly divergent from the behavior they'd see with ZFS > > > > anywhere else. > > > > > > It is extremly divergent from 42 years of behavior. > > > > > > > I don't think ZFS has been implemented on FreeBSD for 42 years, and I > > don't find this grep argument compelling enough to restore peoples' > > ability to read the raw znode of a directory. > > The EISDIR behavior is what your changing, independent of file system(s) > you have done so far. The fact the behavior is now different between > UFS and ZFS is sic, IMHO. EISDIR in read(2) denotes that a filesystem does not support reading a directory, this isn't a new kind of error. In particular, ZFS traditionally does NOT support reading a directory like this. The behavior between UFS and ZFS should have always been different, this is correction of a historical *accident*. From owner-svn-src-all@freebsd.org Tue May 19 16: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 325332DCE6C; Tue, 19 May 2020 16:04:28 +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 49RLL40bCfz3W94; Tue, 19 May 2020 16:04:28 +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 0F7CDD905; Tue, 19 May 2020 16:04:28 +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 04JG4RF7002453; Tue, 19 May 2020 16:04:27 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JG4RvR002450; Tue, 19 May 2020 16:04:27 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202005191604.04JG4RvR002450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 19 May 2020 16:04:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361259 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 361259 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, 19 May 2020 16:04:28 -0000 Author: andrew Date: Tue May 19 16:04:27 2020 New Revision: 361259 URL: https://svnweb.freebsd.org/changeset/base/361259 Log: Stop performing a full icache sync when the DIC and IDC flags are set The DIC and IDC bits in the CTR_EL0 register signal to the kernel when it can relax the instruction cache synchronisation operations. The IDC bit means we can relax cleaning the data cache to the point of unification while the DIC bit means we don't need to invalidate the instruction cache for data coherence. In both cases an appropriate barrier is still needed. For now only implement the case where both bits are set, as is the case on the Neoverse-N1 as used in the Amazon AWS Graviton 2 CPU. Note that this behaviour is a optional on the N1 so we may later need to implement only one or the other bit being set. There is a tunable to disable each flag on boot. Testing on a 4 core Graviton 2 instance found a significant improvement in sys and real time when running "make buildkernel -j4", with no significant difference in user time. Reviewed by: markj Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D24853 Modified: head/sys/arm64/arm64/cpufunc_asm.S head/sys/arm64/arm64/identcpu.c head/sys/arm64/include/cpufunc.h Modified: head/sys/arm64/arm64/cpufunc_asm.S ============================================================================== --- head/sys/arm64/arm64/cpufunc_asm.S Tue May 19 15:27:20 2020 (r361258) +++ head/sys/arm64/arm64/cpufunc_asm.S Tue May 19 16:04:27 2020 (r361259) @@ -133,9 +133,20 @@ ENTRY(arm64_dcache_inv_range) END(arm64_dcache_inv_range) /* - * void arm64_icache_sync_range(vm_offset_t, vm_size_t) + * void arm64_dic_idc_icache_sync_range(vm_offset_t, vm_size_t) + * When the CTR_EL0.IDC bit is set cleaning to PoU becomes a dsb. + * When the CTR_EL0.DIC bit is set icache invalidation becomes an isb. */ -ENTRY(arm64_icache_sync_range) +ENTRY(arm64_dic_idc_icache_sync_range) + dsb ishst + isb + ret +END(arm64_dic_idc_icache_sync_range) + +/* + * void arm64_aliasing_icache_sync_range(vm_offset_t, vm_size_t) + */ +ENTRY(arm64_aliasing_icache_sync_range) /* * XXX Temporary solution - I-cache flush should be range based for * PIPT cache or IALLUIS for VIVT or VIPT caches @@ -146,7 +157,7 @@ ENTRY(arm64_icache_sync_range) dsb ish isb ret -END(arm64_icache_sync_range) +END(arm64_aliasing_icache_sync_range) /* * int arm64_icache_sync_range_checked(vm_offset_t, vm_size_t) Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Tue May 19 15:27:20 2020 (r361258) +++ head/sys/arm64/arm64/identcpu.c Tue May 19 16:04:27 2020 (r361259) @@ -56,6 +56,24 @@ char machine[] = "arm64"; extern int adaptive_machine_arch; #endif +static SYSCTL_NODE(_machdep, OID_AUTO, cache, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Cache management tuning"); + +static int allow_dic = 1; +SYSCTL_INT(_machdep_cache, OID_AUTO, allow_dic, CTLFLAG_RDTUN, &allow_dic, 0, + "Allow optimizations based on the DIC cache bit"); + +static int allow_idc = 1; +SYSCTL_INT(_machdep_cache, OID_AUTO, allow_idc, CTLFLAG_RDTUN, &allow_idc, 0, + "Allow optimizations based on the IDC cache bit"); + +/* + * The default implementation of I-cache sync assumes we have an + * aliasing cache until we know otherwise. + */ +void (*arm64_icache_sync_range)(vm_offset_t, vm_size_t) = + &arm64_aliasing_icache_sync_range; + static int sysctl_hw_machine(SYSCTL_HANDLER_ARGS) { @@ -977,6 +995,7 @@ identify_cpu_sysinit(void *dummy __unused) { int cpu; u_long hwcap; + bool dic, idc; /* Create a user visible cpu description with safe values */ memset(&user_cpu_desc, 0, sizeof(user_cpu_desc)); @@ -985,6 +1004,8 @@ identify_cpu_sysinit(void *dummy __unused) ID_AA64PFR0_FP_NONE | ID_AA64PFR0_EL1_64 | ID_AA64PFR0_EL0_64; user_cpu_desc.id_aa64dfr0 = ID_AA64DFR0_DebugVer_8; + dic = (allow_dic != 0); + idc = (allow_idc != 0); CPU_FOREACH(cpu) { print_cpu_features(cpu); hwcap = parse_cpu_features_hwcap(cpu); @@ -993,6 +1014,17 @@ identify_cpu_sysinit(void *dummy __unused) else elf_hwcap &= hwcap; update_user_regs(cpu); + + if (CTR_DIC_VAL(cpu_desc[cpu].ctr) == 0) + dic = false; + if (CTR_IDC_VAL(cpu_desc[cpu].ctr) == 0) + idc = false; + } + + if (dic && idc) { + arm64_icache_sync_range = &arm64_dic_idc_icache_sync_range; + if (bootverbose) + printf("Enabling DIC & IDC ICache sync\n"); } if ((elf_hwcap & HWCAP_ATOMICS) != 0) { Modified: head/sys/arm64/include/cpufunc.h ============================================================================== --- head/sys/arm64/include/cpufunc.h Tue May 19 15:27:20 2020 (r361258) +++ head/sys/arm64/include/cpufunc.h Tue May 19 16:04:27 2020 (r361259) @@ -216,12 +216,15 @@ extern int64_t dczva_line_size; #define cpu_dcache_inv_range(a, s) arm64_dcache_inv_range((a), (s)) #define cpu_dcache_wb_range(a, s) arm64_dcache_wb_range((a), (s)) +extern void (*arm64_icache_sync_range)(vm_offset_t, vm_size_t); + #define cpu_icache_sync_range(a, s) arm64_icache_sync_range((a), (s)) #define cpu_icache_sync_range_checked(a, s) arm64_icache_sync_range_checked((a), (s)) void arm64_nullop(void); void arm64_tlb_flushID(void); -void arm64_icache_sync_range(vm_offset_t, vm_size_t); +void arm64_dic_idc_icache_sync_range(vm_offset_t, vm_size_t); +void arm64_aliasing_icache_sync_range(vm_offset_t, vm_size_t); int arm64_icache_sync_range_checked(vm_offset_t, vm_size_t); void arm64_dcache_wbinv_range(vm_offset_t, vm_size_t); void arm64_dcache_inv_range(vm_offset_t, vm_size_t); From owner-svn-src-all@freebsd.org Tue May 19 16:06: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 1BD192DD508; Tue, 19 May 2020 16:06:04 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RLMv75kGz3WDw; Tue, 19 May 2020 16:06:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAE42D576; Tue, 19 May 2020 16:06:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JG63om002769; Tue, 19 May 2020 16:06:03 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JG63RU002768; Tue, 19 May 2020 16:06:03 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202005191606.04JG63RU002768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 19 May 2020 16:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361260 - head/usr.sbin/ntp/ntpd X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/usr.sbin/ntp/ntpd X-SVN-Commit-Revision: 361260 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, 19 May 2020 16:06:04 -0000 Author: delphij Date: Tue May 19 16:06:03 2020 New Revision: 361260 URL: https://svnweb.freebsd.org/changeset/base/361260 Log: Update leap-seconds to leap-seconds.3676924800. Obtained from: ftp://ftp.nist.gov/pub/time/leap-seconds.3676924800 MFC after: 3 days Modified: head/usr.sbin/ntp/ntpd/leap-seconds Modified: head/usr.sbin/ntp/ntpd/leap-seconds ============================================================================== --- head/usr.sbin/ntp/ntpd/leap-seconds Tue May 19 16:04:27 2020 (r361259) +++ head/usr.sbin/ntp/ntpd/leap-seconds Tue May 19 16:06:03 2020 (r361260) @@ -204,10 +204,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C58 -# File expires on: 28 June 2020 +# Updated through IERS Bulletin C59 +# File expires on: 28 December 2020 # -#@ 3802291200 +#@ 3818102400 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -252,4 +252,4 @@ # the hash line is also ignored in the # computation. # -#h f28827d2 f263b6c3 ec0f19eb a3e0dbf0 97f3fa30 +#h a1c168ae 27c79a7d 9dddcfc3 bcfe616b 2e2c44ea From owner-svn-src-all@freebsd.org Tue May 19 16:28: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 203CE2DE344; Tue, 19 May 2020 16:28:22 +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 49RLsd756nz3Xg9; Tue, 19 May 2020 16:28:21 +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 EE204DD1C; Tue, 19 May 2020 16:28:21 +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 04JGSLcw015033; Tue, 19 May 2020 16:28:21 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JGSKkM015028; Tue, 19 May 2020 16:28:20 GMT (envelope-from np@FreeBSD.org) Message-Id: <202005191628.04JGSKkM015028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 19 May 2020 16:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361261 - in head/sys/dev/cxgbe: . iw_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . iw_cxgbe X-SVN-Commit-Revision: 361261 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, 19 May 2020 16:28:22 -0000 Author: np Date: Tue May 19 16:28:20 2020 New Revision: 361261 URL: https://svnweb.freebsd.org/changeset/base/361261 Log: cxgbe/iw_cxgbe: Add an async callback to notify iw_cxgbe in case of a fatal error. Submitted by: Krishnamraju Eraparaju @ Chelsio MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/iw_cxgbe/cm.c head/sys/dev/cxgbe/iw_cxgbe/device.c head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue May 19 16:06:03 2020 (r361260) +++ head/sys/dev/cxgbe/adapter.h Tue May 19 16:28:20 2020 (r361261) @@ -830,6 +830,7 @@ struct adapter { int sc_do_rxcopy; struct taskqueue *tq[MAX_NCHAN]; /* General purpose taskqueues */ + struct task async_event_task; struct port_info *port[MAX_NPORTS]; uint8_t chan_map[MAX_NCHAN]; /* channel -> port */ Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Tue May 19 16:06:03 2020 (r361260) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Tue May 19 16:28:20 2020 (r361261) @@ -1085,7 +1085,7 @@ c4iw_so_upcall(struct socket *so, void *arg, int waitf * Wake up any threads waiting in rdma_init()/rdma_fini(), * with locks held. */ - if (so->so_error) + if (so->so_error || (ep->com.dev->rdev.flags & T4_FATAL_ERROR)) c4iw_wake_up(&ep->com.wr_wait, -ECONNRESET); add_ep_to_req_list(ep, C4IW_EVENT_SOCKET); @@ -2700,6 +2700,11 @@ c4iw_create_listen(struct iw_cm_id *cm_id, int backlog CTR3(KTR_IW_CXGBE, "%s: cm_id %p, backlog %s", __func__, cm_id, backlog); + if (c4iw_fatal_error(&dev->rdev)) { + CTR2(KTR_IW_CXGBE, "%s: cm_id %p, fatal error", __func__, + cm_id); + return -EIO; + } lep = alloc_ep(sizeof(*lep), GFP_KERNEL); lep->com.cm_id = cm_id; ref_cm_id(&lep->com); @@ -2800,7 +2805,6 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, { int ret = 0; int close = 0; - int fatal = 0; struct c4iw_rdev *rdev; @@ -2809,12 +2813,14 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, rdev = &ep->com.dev->rdev; if (c4iw_fatal_error(rdev)) { - - CTR2(KTR_IW_CXGBE, "%s:ced1 %p", __func__, ep); - fatal = 1; + CTR3(KTR_IW_CXGBE, "%s:ced1 fatal error %p %s", __func__, ep, + states[ep->com.state]); + if (ep->com.state != DEAD) { + send_abort(ep); + ep->com.state = DEAD; + } close_complete_upcall(ep, -ECONNRESET); - send_abort(ep); - ep->com.state = DEAD; + return ECONNRESET; } CTR3(KTR_IW_CXGBE, "%s:ced2 %p %s", __func__, ep, states[ep->com.state]); @@ -2877,9 +2883,7 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, CTR2(KTR_IW_CXGBE, "%s:ced4 %p", __func__, ep); set_bit(EP_DISC_ABORT, &ep->com.history); close_complete_upcall(ep, -ECONNRESET); - ret = send_abort(ep); - if (ret) - fatal = 1; + send_abort(ep); } else { CTR2(KTR_IW_CXGBE, "%s:ced5 %p", __func__, ep); @@ -2889,33 +2893,28 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, ep->com.state = MORIBUND; CURVNET_SET(ep->com.so->so_vnet); - sodisconnect(ep->com.so); + ret = sodisconnect(ep->com.so); CURVNET_RESTORE(); - } - - } - - if (fatal) { - set_bit(EP_DISC_FAIL, &ep->com.history); - if (!abrupt) { - STOP_EP_TIMER(ep); - close_complete_upcall(ep, -EIO); - } - if (ep->com.qp) { - struct c4iw_qp_attributes attrs = {0}; - - attrs.next_state = C4IW_QP_STATE_ERROR; - ret = c4iw_modify_qp(ep->com.dev, ep->com.qp, - C4IW_QP_ATTR_NEXT_STATE, - &attrs, 1); if (ret) { - CTR2(KTR_IW_CXGBE, "%s:ced7 %p", __func__, ep); - printf("%s - qp <- error failed!\n", __func__); + CTR2(KTR_IW_CXGBE, "%s:ced6 %p", __func__, ep); + STOP_EP_TIMER(ep); + send_abort(ep); + ep->com.state = DEAD; + close_complete_upcall(ep, -ECONNRESET); + set_bit(EP_DISC_FAIL, &ep->com.history); + if (ep->com.qp) { + struct c4iw_qp_attributes attrs = {0}; + + attrs.next_state = C4IW_QP_STATE_ERROR; + ret = c4iw_modify_qp( + ep->com.dev, ep->com.qp, + C4IW_QP_ATTR_NEXT_STATE, + &attrs, 1); + CTR3(KTR_IW_CXGBE, "%s:ced7 %p ret %d", + __func__, ep, ret); + } } } - release_ep_resources(ep); - ep->com.state = DEAD; - CTR2(KTR_IW_CXGBE, "%s:ced6 %p", __func__, ep); } c4iw_put_ep(&ep->com); CTR2(KTR_IW_CXGBE, "%s:cedE %p", __func__, ep); Modified: head/sys/dev/cxgbe/iw_cxgbe/device.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/device.c Tue May 19 16:06:03 2020 (r361260) +++ head/sys/dev/cxgbe/iw_cxgbe/device.c Tue May 19 16:28:20 2020 (r361261) @@ -261,11 +261,13 @@ static int c4iw_mod_load(void); static int c4iw_mod_unload(void); static int c4iw_activate(struct adapter *); static int c4iw_deactivate(struct adapter *); +static void c4iw_async_event(struct adapter *); static struct uld_info c4iw_uld_info = { .uld_id = ULD_IWARP, .activate = c4iw_activate, .deactivate = c4iw_deactivate, + .async_event = c4iw_async_event, }; static int @@ -324,6 +326,23 @@ c4iw_deactivate(struct adapter *sc) sc->iwarp_softc = NULL; return (0); +} + +static void +c4iw_async_event(struct adapter *sc) +{ + struct c4iw_dev *iwsc = sc->iwarp_softc; + + if (iwsc) { + struct ib_event event = {0}; + + device_printf(sc->dev, + "iWARP driver received FATAL ERROR event.\n"); + iwsc->rdev.flags |= T4_FATAL_ERROR; + event.event = IB_EVENT_DEVICE_FATAL; + event.device = &iwsc->ibdev; + ib_dispatch_event(&event); + } } static void Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Tue May 19 16:06:03 2020 (r361260) +++ head/sys/dev/cxgbe/offload.h Tue May 19 16:28:20 2020 (r361261) @@ -228,6 +228,7 @@ struct uld_info { int uld_id; int (*activate)(struct adapter *); int (*deactivate)(struct adapter *); + void (*async_event)(struct adapter *); }; struct tom_tunables { Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue May 19 16:06:03 2020 (r361260) +++ head/sys/dev/cxgbe/t4_main.c Tue May 19 16:28:20 2020 (r361261) @@ -758,6 +758,7 @@ static int read_i2c(struct adapter *, struct t4_i2c_da static int clear_stats(struct adapter *, u_int); #ifdef TCP_OFFLOAD static int toe_capability(struct vi_info *, int); +static void t4_async_event(void *, int); #endif static int mod_event(module_t, int, void *); static int notify_siblings(device_t, int); @@ -1063,6 +1064,10 @@ t4_attach(device_t dev) callout_init(&sc->ktls_tick, 1); +#ifdef TCP_OFFLOAD + TASK_INIT(&sc->async_event_task, 0, t4_async_event, sc); +#endif + rc = t4_map_bars_0_and_4(sc); if (rc != 0) goto done; /* error message displayed already */ @@ -1567,6 +1572,10 @@ t4_detach_common(device_t dev) } } +#ifdef TCP_OFFLOAD + taskqueue_drain(taskqueue_thread, &sc->async_event_task); +#endif + for (i = 0; i < sc->intr_count; i++) t4_free_irq(sc, &sc->irq[i]); @@ -2788,6 +2797,9 @@ t4_fatal_err(struct adapter *sc, bool fw_error) sc->flags |= ADAP_ERR; ADAPTER_UNLOCK(sc); } +#ifdef TCP_OFFLOAD + taskqueue_enqueue(taskqueue_thread, &sc->async_event_task); +#endif if (t4_panic_on_fatal_err) { log(LOG_ALERT, "%s: panic on fatal error after 30s", @@ -10857,6 +10869,25 @@ t4_deactivate_uld(struct adapter *sc, int id) sx_sunlock(&t4_uld_list_lock); return (rc); +} + +static void +t4_async_event(void *arg, int n) +{ + struct uld_info *ui; + struct adapter *sc = (struct adapter *)arg; + + if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4async") != 0) + return; + sx_slock(&t4_uld_list_lock); + SLIST_FOREACH(ui, &t4_uld_list, link) { + if (ui->uld_id == ULD_IWARP) { + ui->async_event(sc); + break; + } + } + sx_sunlock(&t4_uld_list_lock); + end_synchronized_op(sc, 0); } int From owner-svn-src-all@freebsd.org Tue May 19 17:58: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 E8BF82F0862; Tue, 19 May 2020 17:58:37 +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 49RNsn5pWHz3dsW; Tue, 19 May 2020 17:58:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-227.local (unknown [IPv6:2601:648:8203:2990:9412:53:a27d:47e8]) (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 1F35B2D785; Tue, 19 May 2020 17:58:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r361238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs To: rgrimes@freebsd.org, Kyle Evans Cc: src-committers , svn-src-all , svn-src-head References: <202005191534.04JFYlSQ006759@gndrsh.dnsmgr.net> 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: Tue, 19 May 2020 10:58:35 -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: <202005191534.04JFYlSQ006759@gndrsh.dnsmgr.net> 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: Tue, 19 May 2020 17:58:38 -0000 On 5/19/20 8:34 AM, Rodney W. Grimes wrote: > The EISDIR behavior is what your changing, independent of file system(s) > you have done so far. The fact the behavior is now different between > UFS and ZFS is sic, IMHO. Oh please. NFS already fails with ESIDIR and has failed to read() directories for 30 years: https://svnweb.freebsd.org/csrg?view=revision&revision=41905 We haven't had riots in the streets over that. If you actually looked at what ZFS was returning for read(), it was useless. -- John Baldwin From owner-svn-src-all@freebsd.org Tue May 19 18:34: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 DCB6F2F1836; Tue, 19 May 2020 18:34:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RPgZ5ZN0z3yK5; Tue, 19 May 2020 18:34:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA73EF68A; Tue, 19 May 2020 18:34:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JIYoOb095794; Tue, 19 May 2020 18:34:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JIYoS3095793; Tue, 19 May 2020 18:34:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005191834.04JIYoS3095793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 19 May 2020 18:34:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361262 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 361262 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, 19 May 2020 18:34:50 -0000 Author: markj Date: Tue May 19 18:34:50 2020 New Revision: 361262 URL: https://svnweb.freebsd.org/changeset/base/361262 Log: Use the symbolic name for "modmetadata_set". MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_linker.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Tue May 19 16:28:20 2020 (r361261) +++ head/sys/kern/kern_linker.c Tue May 19 18:34:50 2020 (r361262) @@ -369,8 +369,7 @@ linker_file_register_modules(linker_file_t lf) sx_assert(&kld_sx, SA_XLOCKED); - if (linker_file_lookup_set(lf, "modmetadata_set", &start, - &stop, NULL) != 0) { + if (linker_file_lookup_set(lf, MDT_SETNAME, &start, &stop, NULL) != 0) { /* * This fallback should be unnecessary, but if we get booted * from boot2 instead of loader and we are missing our From owner-svn-src-all@freebsd.org Tue May 19 18:35:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 64BBE2F189B; Tue, 19 May 2020 18:35:09 +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 49RPgx1z2fz3ygV; Tue, 19 May 2020 18:35:09 +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 3EDD3F68B; Tue, 19 May 2020 18:35:09 +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 04JIZ9Bu095875; Tue, 19 May 2020 18:35:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JIZ8uF095871; Tue, 19 May 2020 18:35:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005191835.04JIZ8uF095871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 19 May 2020 18:35:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361263 - in head/sys: netinet sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: netinet sys X-SVN-Commit-Revision: 361263 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, 19 May 2020 18:35:09 -0000 Author: markj Date: Tue May 19 18:35:08 2020 New Revision: 361263 URL: https://svnweb.freebsd.org/changeset/base/361263 Log: Define a module version for accept filter modules. Otherwise accept filters compiled into the kernel do not preempt preloaded accept filter modules. Then, the preloaded file registers its accept filter module before the kernel, and the kernel's attempt fails since duplicate accept filter list entries are not permitted. This causes the preloaded file's module to be released, since module_register_init() does a lookup by name, so the preloaded file is unloaded, and the accept filter's callback points to random memory since preload_delete_name() unmaps the file on x86 as of r336505. Add a new ACCEPT_FILTER_DEFINE macro which wraps the accept filter and module definitions, and ensures that a module version is defined. PR: 245870 Reported by: Thomas von Dein MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/netinet/accf_data.c head/sys/netinet/accf_dns.c head/sys/netinet/accf_http.c head/sys/sys/socketvar.h Modified: head/sys/netinet/accf_data.c ============================================================================== --- head/sys/netinet/accf_data.c Tue May 19 18:34:50 2020 (r361262) +++ head/sys/netinet/accf_data.c Tue May 19 18:35:08 2020 (r361263) @@ -42,20 +42,7 @@ __FBSDID("$FreeBSD$"); static int sohasdata(struct socket *so, void *arg, int waitflag); -static struct accept_filter accf_data_filter = { - "dataready", - sohasdata, - NULL, - NULL -}; - -static moduledata_t accf_data_mod = { - "accf_data", - accept_filt_generic_mod_event, - &accf_data_filter -}; - -DECLARE_MODULE(accf_data, accf_data_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); +ACCEPT_FILTER_DEFINE(accf_data, "dataready", sohasdata, NULL, NULL, 1); static int sohasdata(struct socket *so, void *arg, int waitflag) Modified: head/sys/netinet/accf_dns.c ============================================================================== --- head/sys/netinet/accf_dns.c Tue May 19 18:34:50 2020 (r361262) +++ head/sys/netinet/accf_dns.c Tue May 19 18:35:08 2020 (r361263) @@ -41,6 +41,8 @@ /* check for full DNS request */ static int sohasdns(struct socket *so, void *arg, int waitflag); +ACCEPT_FILTER_DEFINE(accf_dns, "dnsready", sohasdns, NULL, NULL, 1); + struct packet { struct mbuf *m; /* Current mbuf. */ struct mbuf *n; /* nextpkt mbuf. */ @@ -55,21 +57,6 @@ struct packet { /* check we can skip over various parts of DNS request */ static int skippacket(struct sockbuf *sb); - -static struct accept_filter accf_dns_filter = { - "dnsready", - sohasdns, - NULL, - NULL -}; - -static moduledata_t accf_dns_mod = { - "accf_dns", - accept_filt_generic_mod_event, - &accf_dns_filter -}; - -DECLARE_MODULE(accf_dns, accf_dns_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); static int sohasdns(struct socket *so, void *arg, int waitflag) Modified: head/sys/netinet/accf_http.c ============================================================================== --- head/sys/netinet/accf_http.c Tue May 19 18:34:50 2020 (r361262) +++ head/sys/netinet/accf_http.c Tue May 19 18:35:08 2020 (r361263) @@ -54,29 +54,16 @@ static int mbufstrncmp(struct mbuf *m, struct mbuf *np /* socketbuffer is full */ static int sbfull(struct sockbuf *sb); -static struct accept_filter accf_http_filter = { - "httpready", - sohashttpget, - NULL, - NULL -}; +ACCEPT_FILTER_DEFINE(accf_http, "httpready", sohashttpget, NULL, NULL, 1); -static moduledata_t accf_http_mod = { - "accf_http", - accept_filt_generic_mod_event, - &accf_http_filter -}; - -DECLARE_MODULE(accf_http, accf_http_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); - static int parse_http_version = 1; static SYSCTL_NODE(_net_inet_accf, OID_AUTO, http, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "HTTP accept filter"); SYSCTL_INT(_net_inet_accf_http, OID_AUTO, parsehttpversion, CTLFLAG_RW, -&parse_http_version, 1, -"Parse http version so that non 1.x requests work"); + &parse_http_version, 1, + "Parse http version so that non 1.x requests work"); #ifdef ACCF_HTTP_DEBUG #define DPRINT(fmt, args...) \ Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Tue May 19 18:34:50 2020 (r361262) +++ head/sys/sys/socketvar.h Tue May 19 18:35:08 2020 (r361263) @@ -335,6 +335,22 @@ struct accept_filter { SLIST_ENTRY(accept_filter) accf_next; }; +#define ACCEPT_FILTER_DEFINE(modname, filtname, cb, create, destroy, ver) \ + static struct accept_filter modname##_filter = { \ + .accf_name = filtname, \ + .accf_callback = cb, \ + .accf_create = create, \ + .accf_destroy = destroy, \ + }; \ + static moduledata_t modname##_mod = { \ + .name = __XSTRING(modname), \ + .evhand = accept_filt_generic_mod_event, \ + .priv = &modname##_filter, \ + }; \ + DECLARE_MODULE(modname, modname##_mod, SI_SUB_DRIVERS, \ + SI_ORDER_MIDDLE); \ + MODULE_VERSION(modname, 1) + #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_ACCF); MALLOC_DECLARE(M_PCB); From owner-svn-src-all@freebsd.org Tue May 19 18: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 425792F1CB0; Tue, 19 May 2020 18:38:47 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RPm708KMz3yjY; Tue, 19 May 2020 18:38:47 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00338F3BF; Tue, 19 May 2020 18:38:47 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JIckWH096092; Tue, 19 May 2020 18:38:46 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JIckHk096091; Tue, 19 May 2020 18:38:46 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005191838.04JIckHk096091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Tue, 19 May 2020 18:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361264 - head X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 361264 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, 19 May 2020 18:38:47 -0000 Author: freqlabs Date: Tue May 19 18:38:46 2020 New Revision: 361264 URL: https://svnweb.freebsd.org/changeset/base/361264 Log: Mention new dd flags in RELNOTES Approved by: mmacy (mentor) Sponsored by: iXsystems, Inc. Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Tue May 19 18:35:08 2020 (r361263) +++ head/RELNOTES Tue May 19 18:38:46 2020 (r361264) @@ -87,6 +87,10 @@ r352304: ntpd is no longer by default locked in memory. rlimit memlock 32 or rlimit memlock 0 can be used to restore this behaviour. +r351770,r352920,r352922,r352923: + dd(1) now supports conv=fsync, conv=fdatasync, oflag=fsync, oflag=sync, + and iflag=fullblock flags, compatible with illumos and GNU. + r351522: Add kernel-side support for in-kernel Transport Layer Security (KTLS). KTLS permits using sendfile(2) over sockets using From owner-svn-src-all@freebsd.org Tue May 19 18:41: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 0485F2F1CF7; Tue, 19 May 2020 18:41:47 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RPqZ6PLwz40Yb; Tue, 19 May 2020 18:41:46 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6F26F61C; Tue, 19 May 2020 18:41:46 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JIfks6097725; Tue, 19 May 2020 18:41:46 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JIfkg7097724; Tue, 19 May 2020 18:41:46 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005191841.04JIfkg7097724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Tue, 19 May 2020 18:41:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361265 - head X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 361265 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, 19 May 2020 18:41:47 -0000 Author: freqlabs Date: Tue May 19 18:41:46 2020 New Revision: 361265 URL: https://svnweb.freebsd.org/changeset/base/361265 Log: Mention new jail(8) command hooks in RELNOTES Reported by: 0mp Approved by: mmacy (mentor) Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Tue May 19 18:38:46 2020 (r361264) +++ head/RELNOTES Tue May 19 18:41:46 2020 (r361265) @@ -13,6 +13,12 @@ Changes to this file should not be MFCed. r361238: ZFS will now reject read(2) of a dirfd with EISDIR. +r361066: + Add exec.prepare and exec.release hooks for jail(8) and jail.conf(5). + exec.prepare runs before mounts, so can be used to populate new jails. + exec.release runs after unmounts, so can be used to remove ephemeral + jails. + r360920,r360923,r360924,r360927,r360928,r360931,r360933,r360936: Remove support for ARC4, Blowfish, Cast, DES, Triple DES, MD5, MD5-KPDK, MD5-HMAC, SHA1-KPDK, and Skipjack algorithms from From owner-svn-src-all@freebsd.org Tue May 19 19:53: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 2F5BB2F39E2; Tue, 19 May 2020 19:53:13 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RRQ10XZBz44lx; Tue, 19 May 2020 19:53:13 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D61C1024F; Tue, 19 May 2020 19:53:13 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JJrCcS045656; Tue, 19 May 2020 19:53:12 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JJrCp2045655; Tue, 19 May 2020 19:53:12 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202005191953.04JJrCp2045655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 19 May 2020 19:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361266 - head/sys/cddl/contrib/opensolaris/common/lz4 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/common/lz4 X-SVN-Commit-Revision: 361266 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, 19 May 2020 19:53:13 -0000 Author: tsoome Date: Tue May 19 19:53:12 2020 New Revision: 361266 URL: https://svnweb.freebsd.org/changeset/base/361266 Log: lz4 hash table does not start zeroed illumos issue: https://www.illumos.org/issues/12757 Submitted by: andyf Modified: head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c Modified: head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c Tue May 19 18:41:46 2020 (r361265) +++ head/sys/cddl/contrib/opensolaris/common/lz4/lz4.c Tue May 19 19:53:12 2020 (r361266) @@ -850,7 +850,7 @@ real_LZ4_compress(const char *source, char *dest, int #if defined(_KERNEL) || defined(_FAKE_KERNEL) void *ctx = kmem_cache_alloc(lz4_ctx_cache, KM_NOSLEEP); #else - void *ctx = malloc(sizeof(struct refTables)); + void *ctx = calloc(1, sizeof(struct refTables)); #endif int result; From owner-svn-src-all@freebsd.org Tue May 19 21:47: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 6CF4E2F61E3; Tue, 19 May 2020 21:47:12 +0000 (UTC) (envelope-from kp@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 49RTxX2B2Xz4BC5; Tue, 19 May 2020 21:47:12 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 2CB372F1BC; Tue, 19 May 2020 21:47:12 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id A546D44D10; Tue, 19 May 2020 23:47:10 +0200 (CEST) From: "Kristof Provost" To: "Andrew Gallatin" Cc: "Eric Joyner" , "Jacob Keller" , shurd@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347418 - head/sys/net Date: Tue, 19 May 2020 23:47:10 +0200 X-Mailer: MailMate (1.13.1r5671) Message-ID: In-Reply-To: References: <201905100041.x4A0fhNT083122@repo.freebsd.org> <3BBFB371-EA44-4EE9-8A55-542CDE273CC4@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed; markup=markdown 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, 19 May 2020 21:47:12 -0000 On 19 May 2020, at 17:02, Andrew Gallatin wrote: > On 2020-05-19 04:21, Kristof Provost wrote: > >> The if_bnxt driver initialises |.isc_nrxd_max = {INT32_MAX, >> INT32_MAX, INT32_MAX},|, so presumably that’s the cause. >> I don’t know what a sane value would be though. I’ve defaulted to >> 4096 (because that’s what some other iflib users seems to do) for >> now, and that seems to work. It doesn’t panic and I can get traffic >> through it at least: > > You seem to be setting the max, not the default, and 4K max > descriptors on a 100g device is going to basically cripple it. > Yeah, I just grabbed whatever number other iflib users used. My immediate concern was to get it to stop panicking. > How about setting to the next power of 2 below max int so as to keep > with the authors intent? > Makes sense, yes. > If we don't already have a macro, something like (INT32_MAX >> 1) + 1 > https://reviews.freebsd.org/D24922 Best regards, Kristof From owner-svn-src-all@freebsd.org Tue May 19 21:48: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 9B5F42F5FF6; Tue, 19 May 2020 21:48: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 49RTzL3gmtz4BjK; Tue, 19 May 2020 21:48: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 7976F11A14; Tue, 19 May 2020 21:48: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 04JLmkaF013665; Tue, 19 May 2020 21:48:46 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JLmkGn013663; Tue, 19 May 2020 21:48:46 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202005192148.04JLmkGn013663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 19 May 2020 21:48:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361267 - in head/tests/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/tests/sys: netinet netinet6 X-SVN-Commit-Revision: 361267 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, 19 May 2020 21:48:46 -0000 Author: trasz Date: Tue May 19 21:48:45 2020 New Revision: 361267 URL: https://svnweb.freebsd.org/changeset/base/361267 Log: Make sys.netinet.output and sys.netinet6.output6 tests depend on python; they need to be able to run net_receiver.py. MFC after: 2 weeks Sponsored by: DARPA Modified: head/tests/sys/netinet/Makefile head/tests/sys/netinet6/Makefile Modified: head/tests/sys/netinet/Makefile ============================================================================== --- head/tests/sys/netinet/Makefile Tue May 19 19:53:12 2020 (r361266) +++ head/tests/sys/netinet/Makefile Tue May 19 21:48:45 2020 (r361267) @@ -10,6 +10,7 @@ ATF_TESTS_C= ip_reass_test \ socket_afinet ATF_TESTS_SH= carp fibs_test redirect divert forward output lpm +TEST_METADATA.output+= required_programs="python" PROGS= udp_dontroute tcp_user_cookie Modified: head/tests/sys/netinet6/Makefile ============================================================================== --- head/tests/sys/netinet6/Makefile Tue May 19 19:53:12 2020 (r361266) +++ head/tests/sys/netinet6/Makefile Tue May 19 21:48:45 2020 (r361267) @@ -14,6 +14,7 @@ ATF_TESTS_SH= \ forward6 \ output6 \ lpm6 +TEST_METADATA.output6+= required_programs="python" ${PACKAGE}FILES+= exthdr.py ${PACKAGE}FILES+= mld.py From owner-svn-src-all@freebsd.org Tue May 19 21:55: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 AB8932F649B; Tue, 19 May 2020 21:55:29 +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 49RV7548YBz4CFp; Tue, 19 May 2020 21:55:29 +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 89E6911AA6; Tue, 19 May 2020 21:55:29 +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 04JLtT4h019770; Tue, 19 May 2020 21:55:29 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JLtT1V019769; Tue, 19 May 2020 21:55:29 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202005192155.04JLtT1V019769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 19 May 2020 21:55:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361268 - head/tests/sys/net X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/tests/sys/net X-SVN-Commit-Revision: 361268 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, 19 May 2020 21:55:29 -0000 Author: trasz Date: Tue May 19 21:55:29 2020 New Revision: 361268 URL: https://svnweb.freebsd.org/changeset/base/361268 Log: Make sys.net.if_bridge_test depend on python; sys.net.if_bridge_test.span requires it. MFC after: 2 weeks Sponsored by: DARPA Modified: head/tests/sys/net/Makefile Modified: head/tests/sys/net/Makefile ============================================================================== --- head/tests/sys/net/Makefile Tue May 19 21:48:45 2020 (r361267) +++ head/tests/sys/net/Makefile Tue May 19 21:55:29 2020 (r361268) @@ -7,6 +7,7 @@ BINDIR= ${TESTSDIR} ATF_TESTS_C+= if_epair ATF_TESTS_SH+= if_bridge_test +TEST_METADATA.if_bridge_test+= required_programs="python" ATF_TESTS_SH+= if_clone_test ATF_TESTS_SH+= if_lagg_test ATF_TESTS_SH+= if_tun_test From owner-svn-src-all@freebsd.org Tue May 19 22:17: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 6DA782F6D9E; Tue, 19 May 2020 22:17: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 49RVcX2NVcz4Dg2; Tue, 19 May 2020 22:17: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 C880411A55; Tue, 19 May 2020 22:10:00 +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 04JMA04p026039; Tue, 19 May 2020 22:10:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JM9xOR025995; Tue, 19 May 2020 22:09:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005192209.04JM9xOR025995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 19 May 2020 22:09:59 +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: r361269 - in stable/12/contrib/elftoolchain: elfcopy libelftc X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/12/contrib/elftoolchain: elfcopy libelftc X-SVN-Commit-Revision: 361269 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, 19 May 2020 22:17:32 -0000 Author: emaste Date: Tue May 19 22:09:59 2020 New Revision: 361269 URL: https://svnweb.freebsd.org/changeset/base/361269 Log: MFC r357826: elfcopy: set ELF OS/ABI field when converting from binary PR: 228934 Submitted by: Tiger Gao Sponsored by: The FreeBSD Foundation Modified: stable/12/contrib/elftoolchain/elfcopy/main.c stable/12/contrib/elftoolchain/libelftc/elftc.3 stable/12/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 stable/12/contrib/elftoolchain/libelftc/elftc_bfdtarget.c stable/12/contrib/elftoolchain/libelftc/libelftc.h Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- stable/12/contrib/elftoolchain/elfcopy/main.c Tue May 19 21:55:29 2020 (r361268) +++ stable/12/contrib/elftoolchain/elfcopy/main.c Tue May 19 22:09:59 2020 (r361269) @@ -1394,6 +1394,7 @@ set_output_target(struct elfcopy *ecp, const char *tar ecp->oec = elftc_bfd_target_class(tgt); ecp->oed = elftc_bfd_target_byteorder(tgt); ecp->oem = elftc_bfd_target_machine(tgt); + ecp->abi = elftc_bfd_target_osabi(tgt); } if (ecp->otf == ETF_EFI || ecp->otf == ETF_PE) ecp->oem = elftc_bfd_target_machine(tgt); Modified: stable/12/contrib/elftoolchain/libelftc/elftc.3 ============================================================================== --- stable/12/contrib/elftoolchain/libelftc/elftc.3 Tue May 19 21:55:29 2020 (r361268) +++ stable/12/contrib/elftoolchain/libelftc/elftc.3 Tue May 19 22:09:59 2020 (r361269) @@ -23,7 +23,7 @@ .\" .\" $Id: elftc.3 3645 2018-10-15 20:17:14Z jkoshy $ .\" -.Dd December 24, 2012 +.Dd February 12, 2020 .Dt ELFTC 3 .Os .Sh NAME @@ -57,6 +57,8 @@ Query the byte order for a binary object descriptor. Query the object format for a binary object descriptor. .It Fn elftc_bfd_target_machine Query the target machine for a binary object descriptor. +.It Fn elftc_bfd_target_osabi +Query the target osabi for a binary object descriptor. .El .It "C++ support" .Bl -tag -compact -width indent Modified: stable/12/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 ============================================================================== --- stable/12/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Tue May 19 21:55:29 2020 (r361268) +++ stable/12/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Tue May 19 22:09:59 2020 (r361269) @@ -23,7 +23,7 @@ .\" .\" $Id: elftc_bfd_find_target.3 3752 2019-06-28 01:12:53Z emaste $ .\" -.Dd June 27, 2019 +.Dd February 12, 2020 .Dt ELFTC_BFD_FIND_TARGET 3 .Os .Sh NAME @@ -48,6 +48,8 @@ .Fn elftc_bfd_target_flavor "Elftc_Bfd_Target *target" .Ft "unsigned int" .Fn elftc_bfd_target_machine "Elftc_Bfd_Target *target" +.Ft "unsigned int" +.Fn elftc_bfd_target_osabi "Elftc_Bfd_Target *target" .Sh DESCRIPTION Function .Fn elftc_bfd_find_target Modified: stable/12/contrib/elftoolchain/libelftc/elftc_bfdtarget.c ============================================================================== --- stable/12/contrib/elftoolchain/libelftc/elftc_bfdtarget.c Tue May 19 21:55:29 2020 (r361268) +++ stable/12/contrib/elftoolchain/libelftc/elftc_bfdtarget.c Tue May 19 22:09:59 2020 (r361269) @@ -71,3 +71,10 @@ elftc_bfd_target_machine(Elftc_Bfd_Target *tgt) return (tgt->bt_machine); } + +unsigned int +elftc_bfd_target_osabi(Elftc_Bfd_Target *tgt) +{ + + return (tgt->bt_osabi); +} Modified: stable/12/contrib/elftoolchain/libelftc/libelftc.h ============================================================================== --- stable/12/contrib/elftoolchain/libelftc/libelftc.h Tue May 19 21:55:29 2020 (r361268) +++ stable/12/contrib/elftoolchain/libelftc/libelftc.h Tue May 19 22:09:59 2020 (r361269) @@ -72,6 +72,7 @@ Elftc_Bfd_Target_Flavor elftc_bfd_target_flavor(Elftc unsigned int elftc_bfd_target_byteorder(Elftc_Bfd_Target *_tgt); unsigned int elftc_bfd_target_class(Elftc_Bfd_Target *_tgt); unsigned int elftc_bfd_target_machine(Elftc_Bfd_Target *_tgt); +unsigned int elftc_bfd_target_osabi(Elftc_Bfd_Target *_tgt); int elftc_copyfile(int _srcfd, int _dstfd); int elftc_demangle(const char *_mangledname, char *_buffer, size_t _bufsize, unsigned int _flags); From owner-svn-src-all@freebsd.org Wed May 20 02:33: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 5E8F82FCA0C; Wed, 20 May 2020 02:33:42 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RcJ61qRgz4XtJ; Wed, 20 May 2020 02:33:42 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39D5B15043; Wed, 20 May 2020 02:33:42 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04K2Xg9E099151; Wed, 20 May 2020 02:33:42 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04K2Xfds099148; Wed, 20 May 2020 02:33:41 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202005200233.04K2Xfds099148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 20 May 2020 02:33:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361271 - in head/sys/powerpc: aim include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: aim include X-SVN-Commit-Revision: 361271 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, 20 May 2020 02:33:42 -0000 Author: jhibbits Date: Wed May 20 02:33:41 2020 New Revision: 361271 URL: https://svnweb.freebsd.org/changeset/base/361271 Log: powerpc/radix mmu: No need for delayed TLB invalidation x86 needs delayed TLB invalidation because invalidation requires an expensive IPI. PowerPC has had a TLB invalidation instruction since the POWER1 in 1990, so there's no need to delay anything. Modified: head/sys/powerpc/aim/mmu_radix.c head/sys/powerpc/include/proc.h Modified: head/sys/powerpc/aim/mmu_radix.c ============================================================================== --- head/sys/powerpc/aim/mmu_radix.c Wed May 20 01:25:46 2020 (r361270) +++ head/sys/powerpc/aim/mmu_radix.c Wed May 20 02:33:41 2020 (r361271) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -406,7 +405,6 @@ static u_int64_t KPTphys; /* phys addr of kernel level static vm_offset_t qframe = 0; static struct mtx qframe_mtx; -static epoch_t pmap_epoch; void mmu_radix_activate(mmu_t mmu, struct thread *); void mmu_radix_advise(mmu_t mmu, pmap_t, vm_offset_t, vm_offset_t, int); @@ -849,43 +847,6 @@ pa_cmp(const void *a, const void *b) PG_M | PG_A | RPTE_EAA_MASK | PG_V) -static void -pmap_epoch_init(void *arg __unused) -{ - pmap_epoch = epoch_alloc("pmap", EPOCH_PREEMPT | EPOCH_LOCKED); -} -SYSINIT(epoch, SI_SUB_EPOCH + 1, SI_ORDER_ANY, pmap_epoch_init, NULL); - -static bool -pmap_not_in_di(void) -{ - - return (curthread->td_md.md_invl_gen.gen == 0); -} - -#define PMAP_ASSERT_NOT_IN_DI() \ - KASSERT(pmap_not_in_di(), ("DI already started")) - -static void -pmap_delayed_invl_started(epoch_tracker_t et) -{ - epoch_enter_preempt(pmap_epoch, et); - curthread->td_md.md_invl_gen.gen = 1; -} - -static void -pmap_delayed_invl_finished(epoch_tracker_t et) -{ - curthread->td_md.md_invl_gen.gen = 0; - epoch_exit_preempt(pmap_epoch, et); -} - -static void -pmap_delayed_invl_wait(vm_page_t m __unused) -{ - epoch_wait_preempt(pmap_epoch); -} - static __inline void pmap_resident_count_inc(pmap_t pmap, int count) { @@ -1370,8 +1331,7 @@ out: } static void -reclaim_pv_chunk_leave_pmap(pmap_t pmap, pmap_t locked_pmap, bool start_di, - epoch_tracker_t et) +reclaim_pv_chunk_leave_pmap(pmap_t pmap, pmap_t locked_pmap) { if (pmap == NULL) @@ -1379,8 +1339,6 @@ reclaim_pv_chunk_leave_pmap(pmap_t pmap, pmap_t locked pmap_invalidate_all(pmap); if (pmap != locked_pmap) PMAP_UNLOCK(pmap); - if (start_di) - pmap_delayed_invl_finished(et); } /* @@ -1410,8 +1368,6 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l struct spglist free; uint64_t inuse; int bit, field, freed; - bool start_di; - struct epoch_tracker et; PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED); KASSERT(lockp != NULL, ("reclaim_pv_chunk: lockp is NULL")); @@ -1423,13 +1379,6 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l pc_marker = (struct pv_chunk *)&pc_marker_b; pc_marker_end = (struct pv_chunk *)&pc_marker_end_b; - /* - * A delayed invalidation block should already be active if - * pmap_advise() or pmap_remove() called this function by way - * of pmap_demote_l3e_locked(). - */ - start_di = pmap_not_in_di(); - mtx_lock(&pv_chunks_mutex); active_reclaims++; TAILQ_INSERT_HEAD(&pv_chunks, pc_marker, pc_lru); @@ -1454,21 +1403,16 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l * corresponding pmap is locked. */ if (pmap != next_pmap) { - reclaim_pv_chunk_leave_pmap(pmap, locked_pmap, - start_di, &et); + reclaim_pv_chunk_leave_pmap(pmap, locked_pmap); pmap = next_pmap; /* Avoid deadlock and lock recursion. */ if (pmap > locked_pmap) { RELEASE_PV_LIST_LOCK(lockp); PMAP_LOCK(pmap); - if (start_di) - pmap_delayed_invl_started(&et); mtx_lock(&pv_chunks_mutex); continue; } else if (pmap != locked_pmap) { if (PMAP_TRYLOCK(pmap)) { - if (start_di) - pmap_delayed_invl_started(&et); mtx_lock(&pv_chunks_mutex); continue; } else { @@ -1480,8 +1424,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l continue; goto next_chunk; } - } else if (start_di) - pmap_delayed_invl_started(&et); + } } /* @@ -1570,7 +1513,7 @@ next_chunk: TAILQ_REMOVE(&pv_chunks, pc_marker_end, pc_lru); active_reclaims--; mtx_unlock(&pv_chunks_mutex); - reclaim_pv_chunk_leave_pmap(pmap, locked_pmap, start_di, &et); + reclaim_pv_chunk_leave_pmap(pmap, locked_pmap); if (m_pc == NULL && !SLIST_EMPTY(&free)) { m_pc = SLIST_FIRST(&free); SLIST_REMOVE_HEAD(&free, plinks.s.ss); @@ -2248,12 +2191,10 @@ mmu_radix_advise(mmu_t mmu, pmap_t pmap, vm_offset_t s vm_offset_t va, va_next; vm_page_t m; boolean_t anychanged; - struct epoch_tracker et; if (advice != MADV_DONTNEED && advice != MADV_FREE) return; anychanged = FALSE; - pmap_delayed_invl_started(&et); PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { l1e = pmap_pml1e(pmap, sva); @@ -2347,7 +2288,6 @@ maybe_invlrng: if (anychanged) pmap_invalidate_all(pmap); PMAP_UNLOCK(pmap); - pmap_delayed_invl_finished(&et); } /* @@ -3176,7 +3116,6 @@ pmap_enter_l3e(pmap_t pmap, vm_offset_t va, pml3_entry struct spglist free; pml3_entry_t oldl3e, *l3e; vm_page_t mt, pdpg; - struct epoch_tracker et; KASSERT((newpde & (PG_M | PG_RW)) != PG_RW, ("pmap_enter_pde: newpde is missing PG_M")); @@ -3211,11 +3150,9 @@ pmap_enter_l3e(pmap_t pmap, vm_offset_t va, pml3_entry */ (void)pmap_remove_l3e(pmap, l3e, va, &free, lockp); } else { - pmap_delayed_invl_started(&et); if (pmap_remove_ptes(pmap, va, va + L3_PAGE_SIZE, l3e, &free, lockp)) pmap_invalidate_all(pmap); - pmap_delayed_invl_finished(&et); } vm_page_free_pages_toq(&free, true); if (va >= VM_MAXUSER_ADDRESS) { @@ -4243,7 +4180,6 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str if (lockp != NULL) { RELEASE_PV_LIST_LOCK(lockp); PMAP_UNLOCK(pmap); - PMAP_ASSERT_NOT_IN_DI(); vm_wait(NULL); PMAP_LOCK(pmap); } @@ -4513,26 +4449,6 @@ mmu_radix_protect(mmu_t mmu, pmap_t pmap, vm_offset_t #endif anychanged = FALSE; - /* - * Although this function delays and batches the invalidation - * of stale TLB entries, it does not need to call - * pmap_delayed_invl_started() and - * pmap_delayed_invl_finished(), because it does not - * ordinarily destroy mappings. Stale TLB entries from - * protection-only changes need only be invalidated before the - * pmap lock is released, because protection-only changes do - * not destroy PV entries. Even operations that iterate over - * a physical page's PV list of mappings, like - * pmap_remove_write(), acquire the pmap lock for each - * mapping. Consequently, for protection-only changes, the - * pmap lock suffices to synchronize both page table and TLB - * updates. - * - * This function only destroys a mapping if pmap_demote_l3e() - * fails. In that case, stale TLB entries are immediately - * invalidated. - */ - PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { l1e = pmap_pml1e(pmap, sva); @@ -5194,7 +5110,6 @@ mmu_radix_remove(mmu_t mmu, pmap_t pmap, vm_offset_t s pml2_entry_t *l2e; pml3_entry_t ptpaddr, *l3e; struct spglist free; - struct epoch_tracker et; bool anyvalid; CTR4(KTR_PMAP, "%s(%p, %#x, %#x)", __func__, pmap, sva, eva); @@ -5212,7 +5127,6 @@ mmu_radix_remove(mmu_t mmu, pmap_t pmap, vm_offset_t s sva = (sva + PAGE_MASK) & ~PAGE_MASK; eva = (eva + PAGE_MASK) & ~PAGE_MASK; - pmap_delayed_invl_started(&et); PMAP_LOCK(pmap); /* @@ -5301,7 +5215,6 @@ out: if (anyvalid) pmap_invalidate_all(pmap); PMAP_UNLOCK(pmap); - pmap_delayed_invl_finished(&et); vm_page_free_pages_toq(&free, true); } @@ -5384,7 +5297,6 @@ retry: } vm_page_aflag_clear(m, PGA_WRITEABLE); rw_wunlock(lock); - pmap_delayed_invl_wait(m); vm_page_free_pages_toq(&free, true); } @@ -5661,7 +5573,6 @@ retry: } rw_wunlock(lock); vm_page_aflag_clear(m, PGA_WRITEABLE); - pmap_delayed_invl_wait(m); } /* Modified: head/sys/powerpc/include/proc.h ============================================================================== --- head/sys/powerpc/include/proc.h Wed May 20 01:25:46 2020 (r361270) +++ head/sys/powerpc/include/proc.h Wed May 20 02:33:41 2020 (r361271) @@ -37,18 +37,12 @@ #ifndef _MACHINE_PROC_H_ #define _MACHINE_PROC_H_ -struct pmap_invl_gen { - u_long gen; /* (k) */ - LIST_ENTRY(pmap_invl_gen) link; /* (pp) */ -}; - /* * Machine-dependent part of the proc structure */ struct mdthread { int md_spinlock_count; /* (k) */ register_t md_saved_msr; /* (k) */ - struct pmap_invl_gen md_invl_gen; }; struct mdproc { From owner-svn-src-all@freebsd.org Wed May 20 04:16: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 700EF2FDF1C; Wed, 20 May 2020 04:16:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RfZQ2KDjz4dHZ; Wed, 20 May 2020 04:16:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 468C616685; Wed, 20 May 2020 04:16:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04K4GEet061362; Wed, 20 May 2020 04:16:14 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04K4GEwK061361; Wed, 20 May 2020 04:16:14 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202005200416.04K4GEwK061361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 20 May 2020 04:16:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361272 - head/contrib/wpa/src/drivers X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/wpa/src/drivers X-SVN-Commit-Revision: 361272 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, 20 May 2020 04:16:14 -0000 Author: cy Date: Wed May 20 04:16:13 2020 New Revision: 361272 URL: https://svnweb.freebsd.org/changeset/base/361272 Log: Silence the once per second CTRL-EVENT-SCAN-FAILED errors when the WiFi radio is disabled through the communication device toggle key (also known as the RF raidio kill button). Only the CTRL-EVENT-DISCONNECTED will be issued. Submitted by: avg Reported by: avg MFC after: 1 week Modified: head/contrib/wpa/src/drivers/driver_bsd.c Modified: head/contrib/wpa/src/drivers/driver_bsd.c ============================================================================== --- head/contrib/wpa/src/drivers/driver_bsd.c Wed May 20 02:33:41 2020 (r361271) +++ head/contrib/wpa/src/drivers/driver_bsd.c Wed May 20 04:16:13 2020 (r361272) @@ -1358,14 +1358,18 @@ wpa_driver_bsd_event_receive(int sock, void *ctx, void drv = bsd_get_drvindex(global, ifm->ifm_index); if (drv == NULL) return; - if ((ifm->ifm_flags & IFF_UP) == 0 && - (drv->flags & IFF_UP) != 0) { + if (((ifm->ifm_flags & IFF_UP) == 0 || + (ifm->ifm_flags & IFF_RUNNING) == 0) && + (drv->flags & IFF_UP) != 0 && + (drv->flags & IFF_RUNNING) != 0) { wpa_printf(MSG_DEBUG, "RTM_IFINFO: Interface '%s' DOWN", drv->ifname); wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_DISABLED, NULL); } else if ((ifm->ifm_flags & IFF_UP) != 0 && - (drv->flags & IFF_UP) == 0) { + (ifm->ifm_flags & IFF_RUNNING) != 0 && + ((drv->flags & IFF_UP) == 0 || + (drv->flags & IFF_RUNNING) == 0)) { wpa_printf(MSG_DEBUG, "RTM_IFINFO: Interface '%s' UP", drv->ifname); wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_ENABLED, From owner-svn-src-all@freebsd.org Wed May 20 08:15: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 5134D2CA504; Wed, 20 May 2020 08:15:10 +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 49Rlt61Qmgz3cmV; Wed, 20 May 2020 08:15:10 +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 27A881928B; Wed, 20 May 2020 08:15:10 +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 04K8F9pZ009856; Wed, 20 May 2020 08:15:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04K8F95i009854; Wed, 20 May 2020 08:15:09 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005200815.04K8F95i009854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 20 May 2020 08:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361273 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 361273 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, 20 May 2020 08:15:10 -0000 Author: avg Date: Wed May 20 08:15:09 2020 New Revision: 361273 URL: https://svnweb.freebsd.org/changeset/base/361273 Log: iwm: improve rfkill handling Previously the driver handled the bit within itself, but did not expose the state change to net80211 and interface layers. This change uses net80211 KPI for rfkill signaling. The code is modeled after similar code in iwn and wpi. Reviewed by: adrian MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D24923 Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Wed May 20 04:16:13 2020 (r361272) +++ head/sys/dev/iwm/if_iwm.c Wed May 20 08:15:09 2020 (r361273) @@ -5064,20 +5064,48 @@ iwm_parent(struct ieee80211com *ic) { struct iwm_softc *sc = ic->ic_softc; int startall = 0; + int rfkill = 0; IWM_LOCK(sc); if (ic->ic_nrunning > 0) { if (!(sc->sc_flags & IWM_FLAG_HW_INITED)) { iwm_init(sc); - startall = 1; + rfkill = iwm_check_rfkill(sc); + if (!rfkill) + startall = 1; } } else if (sc->sc_flags & IWM_FLAG_HW_INITED) iwm_stop(sc); IWM_UNLOCK(sc); if (startall) ieee80211_start_all(ic); + else if (rfkill) + taskqueue_enqueue(sc->sc_tq, &sc->sc_rftoggle_task); } +static void +iwm_rftoggle_task(void *arg, int npending __unused) +{ + struct iwm_softc *sc = arg; + struct ieee80211com *ic = &sc->sc_ic; + int rfkill; + + IWM_LOCK(sc); + rfkill = iwm_check_rfkill(sc); + IWM_UNLOCK(sc); + if (rfkill) { + device_printf(sc->sc_dev, + "%s: rfkill switch, disabling interface\n", __func__); + ieee80211_suspend_all(ic); + ieee80211_notify_radio(ic, 0); + } else { + device_printf(sc->sc_dev, + "%s: rfkill cleared, re-enabling interface\n", __func__); + ieee80211_resume_all(ic); + ieee80211_notify_radio(ic, 1); + } +} + /* * The interrupt side of things */ @@ -5814,12 +5842,7 @@ iwm_intr(void *arg) if (r1 & IWM_CSR_INT_BIT_RF_KILL) { handled |= IWM_CSR_INT_BIT_RF_KILL; - if (iwm_check_rfkill(sc)) { - device_printf(sc->sc_dev, - "%s: rfkill switch, disabling interface\n", - __func__); - iwm_stop(sc); - } + taskqueue_enqueue(sc->sc_tq, &sc->sc_rftoggle_task); } /* @@ -6024,7 +6047,17 @@ iwm_attach(device_t dev) callout_init_mtx(&sc->sc_watchdog_to, &sc->sc_mtx, 0); callout_init_mtx(&sc->sc_led_blink_to, &sc->sc_mtx, 0); TASK_INIT(&sc->sc_es_task, 0, iwm_endscan_cb, sc); + TASK_INIT(&sc->sc_rftoggle_task, 0, iwm_rftoggle_task, sc); + sc->sc_tq = taskqueue_create("iwm_taskq", M_WAITOK, + taskqueue_thread_enqueue, &sc->sc_tq); + error = taskqueue_start_threads(&sc->sc_tq, 1, 0, "iwm_taskq"); + if (error != 0) { + device_printf(dev, "can't start taskq thread, error %d\n", + error); + goto fail; + } + error = iwm_dev_check(dev); if (error != 0) goto fail; @@ -6590,6 +6623,8 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 ieee80211_draintask(&sc->sc_ic, &sc->sc_es_task); } iwm_stop_device(sc); + taskqueue_drain_all(sc->sc_tq); + taskqueue_free(sc->sc_tq); if (do_net80211) { IWM_LOCK(sc); iwm_xmit_queue_drain(sc); Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Wed May 20 04:16:13 2020 (r361272) +++ head/sys/dev/iwm/if_iwmvar.h Wed May 20 08:15:09 2020 (r361273) @@ -499,7 +499,9 @@ struct iwm_softc { uint8_t sc_cmd_resp[IWM_CMD_RESP_MAX]; int sc_wantresp; + struct taskqueue *sc_tq; struct task sc_es_task; + struct task sc_rftoggle_task; struct iwm_rx_phy_info sc_last_phy_info; int sc_ampdu_ref; From owner-svn-src-all@freebsd.org Wed May 20 11: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 B7DE72CDC9E; Wed, 20 May 2020 11:01:10 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RqYf4VyMz43xb; Wed, 20 May 2020 11:01:10 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9621A1ADCD; Wed, 20 May 2020 11:01:10 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KB1Ak1009668; Wed, 20 May 2020 11:01:10 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KB1AP0009667; Wed, 20 May 2020 11:01:10 GMT (envelope-from royger@FreeBSD.org) Message-Id: <202005201101.04KB1AP0009667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Wed, 20 May 2020 11:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361274 - head/sys/dev/xen/evtchn X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: head/sys/dev/xen/evtchn X-SVN-Commit-Revision: 361274 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, 20 May 2020 11:01:10 -0000 Author: royger Date: Wed May 20 11:01:10 2020 New Revision: 361274 URL: https://svnweb.freebsd.org/changeset/base/361274 Log: dev/xenstore: fix return with locks held Fix returning from xenstore device with locks held, which triggers the following panic: # cat /dev/xen/xenstore ^C userret: returning with the following locks held: exclusive sx evtchn_ringc_sx (evtchn_ringc_sx) r = 0 (0xfffff8000650be40) locked @ /usr/src/sys/dev/xen/evtchn/evtchn_dev.c:262 Note this is not a security issue since access to the device is limited to root by default. Sponsored by: Citrix Systems R&D MFC after: 1 week Modified: head/sys/dev/xen/evtchn/evtchn_dev.c Modified: head/sys/dev/xen/evtchn/evtchn_dev.c ============================================================================== --- head/sys/dev/xen/evtchn/evtchn_dev.c Wed May 20 08:15:09 2020 (r361273) +++ head/sys/dev/xen/evtchn/evtchn_dev.c Wed May 20 11:01:10 2020 (r361274) @@ -261,9 +261,10 @@ evtchn_read(struct cdev *dev, struct uio *uio, int iof sx_xlock(&u->ring_cons_mutex); for (;;) { - error = EFBIG; - if (u->ring_overflow) + if (u->ring_overflow) { + error = EFBIG; goto unlock_out; + } c = u->ring_cons; p = u->ring_prod; @@ -271,13 +272,13 @@ evtchn_read(struct cdev *dev, struct uio *uio, int iof break; if (ioflag & IO_NDELAY) { - sx_xunlock(&u->ring_cons_mutex); - return (EWOULDBLOCK); + error = EWOULDBLOCK; + goto unlock_out; } error = sx_sleep(u, &u->ring_cons_mutex, PCATCH, "evtchw", 0); if ((error != 0) && (error != EWOULDBLOCK)) - return (error); + goto unlock_out; } /* Byte lengths of two chunks. Chunk split (if any) is at ring wrap. */ From owner-svn-src-all@freebsd.org Wed May 20 11:03: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 F28392CDD13; Wed, 20 May 2020 11:03:59 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Rqcv6MP6z44DN; Wed, 20 May 2020 11:03:59 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCD651B036; Wed, 20 May 2020 11:03:59 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KB3xed013968; Wed, 20 May 2020 11:03:59 GMT (envelope-from whu@FreeBSD.org) Received: (from whu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KB3xTp013965; Wed, 20 May 2020 11:03:59 GMT (envelope-from whu@FreeBSD.org) Message-Id: <202005201103.04KB3xTp013965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: whu set sender to whu@FreeBSD.org using -f From: Wei Hu Date: Wed, 20 May 2020 11:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys X-SVN-Group: head X-SVN-Commit-Author: whu X-SVN-Commit-Paths: in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys X-SVN-Commit-Revision: 361275 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, 20 May 2020 11:04:00 -0000 Author: whu Date: Wed May 20 11:03:59 2020 New Revision: 361275 URL: https://svnweb.freebsd.org/changeset/base/361275 Log: HyperV socket implementation for FreeBSD This change adds Hyper-V socket feature in FreeBSD. New socket address family AF_HYPERV and its kernel support are added. Submitted by: Wei Hu Reviewed by: Dexuan Cui Relnotes: yes Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D24061 Added: head/sys/dev/hyperv/hvsock/ head/sys/dev/hyperv/hvsock/hv_sock.c (contents, props changed) head/sys/dev/hyperv/hvsock/hv_sock.h (contents, props changed) head/sys/modules/hyperv/hvsock/ head/sys/modules/hyperv/hvsock/Makefile (contents, props changed) Modified: head/sys/conf/files.x86 head/sys/dev/hyperv/include/vmbus.h head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_br.c head/sys/dev/hyperv/vmbus/vmbus_brvar.h head/sys/dev/hyperv/vmbus/vmbus_chan.c head/sys/dev/hyperv/vmbus/vmbus_chanvar.h head/sys/dev/hyperv/vmbus/vmbus_reg.h head/sys/modules/hyperv/Makefile head/sys/sys/socket.h Modified: head/sys/conf/files.x86 ============================================================================== --- head/sys/conf/files.x86 Wed May 20 11:01:10 2020 (r361274) +++ head/sys/conf/files.x86 Wed May 20 11:03:59 2020 (r361275) @@ -133,6 +133,7 @@ dev/hwpmc/hwpmc_core.c optional hwpmc dev/hwpmc/hwpmc_uncore.c optional hwpmc dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc +dev/hyperv/hvsock/hv_sock.c optional hyperv dev/hyperv/input/hv_kbd.c optional hyperv dev/hyperv/input/hv_kbdc.c optional hyperv dev/hyperv/pcib/vmbus_pcib.c optional hyperv pci Added: head/sys/dev/hyperv/hvsock/hv_sock.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/hvsock/hv_sock.c Wed May 20 11:03:59 2020 (r361275) @@ -0,0 +1,1748 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Microsoft Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include "hv_sock.h" + +#define HVSOCK_DBG_NONE 0x0 +#define HVSOCK_DBG_INFO 0x1 +#define HVSOCK_DBG_ERR 0x2 +#define HVSOCK_DBG_VERBOSE 0x3 + + +SYSCTL_NODE(_net, OID_AUTO, hvsock, CTLFLAG_RD, 0, "HyperV socket"); + +static int hvs_dbg_level; +SYSCTL_INT(_net_hvsock, OID_AUTO, hvs_dbg_level, CTLFLAG_RWTUN, &hvs_dbg_level, + 0, "hyperv socket debug level: 0 = none, 1 = info, 2 = error, 3 = verbose"); + + +#define HVSOCK_DBG(level, ...) do { \ + if (hvs_dbg_level >= (level)) \ + printf(__VA_ARGS__); \ + } while (0) + +MALLOC_DEFINE(M_HVSOCK, "hyperv_socket", "hyperv socket control structures"); + +/* The MTU is 16KB per host side's design */ +#define HVSOCK_MTU_SIZE (1024 * 16) +#define HVSOCK_SEND_BUF_SZ (PAGE_SIZE - sizeof(struct vmpipe_proto_header)) + +#define HVSOCK_HEADER_LEN (sizeof(struct hvs_pkt_header)) + +#define HVSOCK_PKT_LEN(payload_len) (HVSOCK_HEADER_LEN + \ + roundup2(payload_len, 8) + \ + sizeof(uint64_t)) + + +static struct domain hv_socket_domain; + +/* + * HyperV Transport sockets + */ +static struct pr_usrreqs hvs_trans_usrreqs = { + .pru_attach = hvs_trans_attach, + .pru_bind = hvs_trans_bind, + .pru_listen = hvs_trans_listen, + .pru_accept = hvs_trans_accept, + .pru_connect = hvs_trans_connect, + .pru_peeraddr = hvs_trans_peeraddr, + .pru_sockaddr = hvs_trans_sockaddr, + .pru_soreceive = hvs_trans_soreceive, + .pru_sosend = hvs_trans_sosend, + .pru_disconnect = hvs_trans_disconnect, + .pru_close = hvs_trans_close, + .pru_detach = hvs_trans_detach, + .pru_shutdown = hvs_trans_shutdown, + .pru_abort = hvs_trans_abort, +}; + +/* + * Definitions of protocols supported in HyperV socket domain + */ +static struct protosw hv_socket_protosw[] = { +{ + .pr_type = SOCK_STREAM, + .pr_domain = &hv_socket_domain, + .pr_protocol = HYPERV_SOCK_PROTO_TRANS, + .pr_flags = PR_CONNREQUIRED, + .pr_init = hvs_trans_init, + .pr_usrreqs = &hvs_trans_usrreqs, +}, +}; + +static struct domain hv_socket_domain = { + .dom_family = AF_HYPERV, + .dom_name = "hyperv", + .dom_protosw = hv_socket_protosw, + .dom_protoswNPROTOSW = &hv_socket_protosw[nitems(hv_socket_protosw)] +}; + +VNET_DOMAIN_SET(hv_socket_); + +#define MAX_PORT ((uint32_t)0xFFFFFFFF) +#define MIN_PORT ((uint32_t)0x0) + +/* 00000000-facb-11e6-bd58-64006a7986d3 */ +static const struct hyperv_guid srv_id_template = { + .hv_guid = { + 0x00, 0x00, 0x00, 0x00, 0xcb, 0xfa, 0xe6, 0x11, + 0xbd, 0x58, 0x64, 0x00, 0x6a, 0x79, 0x86, 0xd3 } +}; + +static int hvsock_br_callback(void *, int, void *); +static uint32_t hvsock_canread_check(struct hvs_pcb *); +static uint32_t hvsock_canwrite_check(struct hvs_pcb *); +static int hvsock_send_data(struct vmbus_channel *chan, + struct uio *uio, uint32_t to_write, struct sockbuf *sb); + + + +/* Globals */ +static struct sx hvs_trans_socks_sx; +static struct mtx hvs_trans_socks_mtx; +static LIST_HEAD(, hvs_pcb) hvs_trans_bound_socks; +static LIST_HEAD(, hvs_pcb) hvs_trans_connected_socks; +static uint32_t previous_auto_bound_port; + +static void +hvsock_print_guid(struct hyperv_guid *guid) +{ + unsigned char *p = (unsigned char *)guid; + + HVSOCK_DBG(HVSOCK_DBG_INFO, + "0x%x-0x%x-0x%x-0x%x-0x%x-0x%x-0x%x-0x%x-0x%x-0x%x-0x%x\n", + *(unsigned int *)p, + *((unsigned short *) &p[4]), + *((unsigned short *) &p[6]), + p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15]); +} + +static bool +is_valid_srv_id(const struct hyperv_guid *id) +{ + return !memcmp(&id->hv_guid[4], + &srv_id_template.hv_guid[4], sizeof(struct hyperv_guid) - 4); +} + +static unsigned int +get_port_by_srv_id(const struct hyperv_guid *srv_id) +{ + return *((const unsigned int *)srv_id); +} + +static void +set_port_by_srv_id(struct hyperv_guid *srv_id, unsigned int port) +{ + *((unsigned int *)srv_id) = port; +} + + +static void +__hvs_remove_pcb_from_list(struct hvs_pcb *pcb, unsigned char list) +{ + struct hvs_pcb *p = NULL; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: pcb is %p\n", __func__, pcb); + + if (!pcb) + return; + + if (list & HVS_LIST_BOUND) { + LIST_FOREACH(p, &hvs_trans_bound_socks, bound_next) + if (p == pcb) + LIST_REMOVE(p, bound_next); + } + + if (list & HVS_LIST_CONNECTED) { + LIST_FOREACH(p, &hvs_trans_connected_socks, connected_next) + if (p == pcb) + LIST_REMOVE(pcb, connected_next); + } +} + +static void +__hvs_remove_socket_from_list(struct socket *so, unsigned char list) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: pcb is %p\n", __func__, pcb); + + __hvs_remove_pcb_from_list(pcb, list); +} + +static void +__hvs_insert_socket_on_list(struct socket *so, unsigned char list) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + + if (list & HVS_LIST_BOUND) + LIST_INSERT_HEAD(&hvs_trans_bound_socks, + pcb, bound_next); + + if (list & HVS_LIST_CONNECTED) + LIST_INSERT_HEAD(&hvs_trans_connected_socks, + pcb, connected_next); +} + +void +hvs_remove_socket_from_list(struct socket *so, unsigned char list) +{ + if (!so || !so->so_pcb) { + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: socket or so_pcb is null\n", __func__); + return; + } + + mtx_lock(&hvs_trans_socks_mtx); + __hvs_remove_socket_from_list(so, list); + mtx_unlock(&hvs_trans_socks_mtx); +} + +static void +hvs_insert_socket_on_list(struct socket *so, unsigned char list) +{ + if (!so || !so->so_pcb) { + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: socket or so_pcb is null\n", __func__); + return; + } + + mtx_lock(&hvs_trans_socks_mtx); + __hvs_insert_socket_on_list(so, list); + mtx_unlock(&hvs_trans_socks_mtx); +} + +static struct socket * +__hvs_find_socket_on_list(struct sockaddr_hvs *addr, unsigned char list) +{ + struct hvs_pcb *p = NULL; + + if (list & HVS_LIST_BOUND) + LIST_FOREACH(p, &hvs_trans_bound_socks, bound_next) + if (p->so != NULL && + addr->hvs_port == p->local_addr.hvs_port) + return p->so; + + if (list & HVS_LIST_CONNECTED) + LIST_FOREACH(p, &hvs_trans_connected_socks, connected_next) + if (p->so != NULL && + addr->hvs_port == p->local_addr.hvs_port) + return p->so; + + return NULL; +} + +static struct socket * +hvs_find_socket_on_list(struct sockaddr_hvs *addr, unsigned char list) +{ + struct socket *s = NULL; + + mtx_lock(&hvs_trans_socks_mtx); + s = __hvs_find_socket_on_list(addr, list); + mtx_unlock(&hvs_trans_socks_mtx); + + return s; +} + +static inline void +hvs_addr_set(struct sockaddr_hvs *addr, unsigned int port) +{ + memset(addr, 0, sizeof(*addr)); + addr->sa_family = AF_HYPERV; + addr->hvs_port = port; +} + +void +hvs_addr_init(struct sockaddr_hvs *addr, const struct hyperv_guid *svr_id) +{ + hvs_addr_set(addr, get_port_by_srv_id(svr_id)); +} + +int +hvs_trans_lock(void) +{ + sx_xlock(&hvs_trans_socks_sx); + return (0); +} + +void +hvs_trans_unlock(void) +{ + sx_xunlock(&hvs_trans_socks_sx); +} + +void +hvs_trans_init(void) +{ + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + + if (vm_guest != VM_GUEST_HV) + return; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_init called\n", __func__); + + /* Initialize Globals */ + previous_auto_bound_port = MAX_PORT; + sx_init(&hvs_trans_socks_sx, "hvs_trans_sock_sx"); + mtx_init(&hvs_trans_socks_mtx, + "hvs_trans_socks_mtx", NULL, MTX_DEF); + LIST_INIT(&hvs_trans_bound_socks); + LIST_INIT(&hvs_trans_connected_socks); +} + +/* + * Called in two cases: + * 1) When user calls socket(); + * 2) When we accept new incoming conneciton and call sonewconn(). + */ +int +hvs_trans_attach(struct socket *so, int proto, struct thread *td) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_attach called\n", __func__); + + if (so->so_type != SOCK_STREAM) + return (ESOCKTNOSUPPORT); + + if (proto != 0 && proto != HYPERV_SOCK_PROTO_TRANS) + return (EPROTONOSUPPORT); + + if (pcb != NULL) + return (EISCONN); + pcb = malloc(sizeof(struct hvs_pcb), M_HVSOCK, M_NOWAIT | M_ZERO); + if (pcb == NULL) + return (ENOMEM); + + pcb->so = so; + so->so_pcb = (void *)pcb; + + return (0); +} + +void +hvs_trans_detach(struct socket *so) +{ + struct hvs_pcb *pcb; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_detach called\n", __func__); + + (void) hvs_trans_lock(); + pcb = so2hvspcb(so); + if (pcb == NULL) { + hvs_trans_unlock(); + return; + } + + if (SOLISTENING(so)) { + bzero(pcb, sizeof(*pcb)); + free(pcb, M_HVSOCK); + } + + so->so_pcb = NULL; + + hvs_trans_unlock(); +} + +int +hvs_trans_bind(struct socket *so, struct sockaddr *addr, struct thread *td) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + struct sockaddr_hvs *sa = (struct sockaddr_hvs *) addr; + int error = 0; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_bind called\n", __func__); + + if (sa == NULL) { + return (EINVAL); + } + + if (pcb == NULL) { + return (EINVAL); + } + + if (sa->sa_family != AF_HYPERV) { + HVSOCK_DBG(HVSOCK_DBG_ERR, + "%s: Not supported, sa_family is %u\n", + __func__, sa->sa_family); + return (EAFNOSUPPORT); + } + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: binding port = 0x%x\n", __func__, sa->hvs_port); + + mtx_lock(&hvs_trans_socks_mtx); + if (__hvs_find_socket_on_list(sa, + HVS_LIST_BOUND | HVS_LIST_CONNECTED)) { + error = EADDRINUSE; + } else { + /* + * The address is available for us to bind. + * Add socket to the bound list. + */ + hvs_addr_set(&pcb->local_addr, sa->hvs_port); + hvs_addr_set(&pcb->remote_addr, HVADDR_PORT_ANY); + __hvs_insert_socket_on_list(so, HVS_LIST_BOUND); + } + mtx_unlock(&hvs_trans_socks_mtx); + + return (error); +} + +int +hvs_trans_listen(struct socket *so, int backlog, struct thread *td) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + struct socket *bound_so; + int error; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_listen called\n", __func__); + + if (pcb == NULL) + return (EINVAL); + + /* Check if the address is already bound and it was by us. */ + bound_so = hvs_find_socket_on_list(&pcb->local_addr, HVS_LIST_BOUND); + if (bound_so == NULL || bound_so != so) { + HVSOCK_DBG(HVSOCK_DBG_ERR, + "%s: Address not bound or not by us.\n", __func__); + return (EADDRNOTAVAIL); + } + + SOCK_LOCK(so); + error = solisten_proto_check(so); + if (error == 0) + solisten_proto(so, backlog); + SOCK_UNLOCK(so); + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket listen error = %d\n", __func__, error); + return (error); +} + +int +hvs_trans_accept(struct socket *so, struct sockaddr **nam) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_accept called\n", __func__); + + if (pcb == NULL) + return (EINVAL); + + *nam = sodupsockaddr((struct sockaddr *) &pcb->remote_addr, + M_NOWAIT); + + return ((*nam == NULL) ? ENOMEM : 0); +} + +int +hvs_trans_connect(struct socket *so, struct sockaddr *nam, struct thread *td) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + struct sockaddr_hvs *raddr = (struct sockaddr_hvs *)nam; + bool found_auto_bound_port = false; + int i, error = 0; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_connect called, remote port is %x\n", + __func__, raddr->hvs_port); + + if (pcb == NULL) + return (EINVAL); + + /* Verify the remote address */ + if (raddr == NULL) + return (EINVAL); + if (raddr->sa_family != AF_HYPERV) + return (EAFNOSUPPORT); + + mtx_lock(&hvs_trans_socks_mtx); + if (so->so_state & + (SS_ISCONNECTED|SS_ISDISCONNECTING|SS_ISCONNECTING)) { + HVSOCK_DBG(HVSOCK_DBG_ERR, + "%s: socket connect in progress\n", + __func__); + error = EINPROGRESS; + goto out; + } + + /* + * Find an available port for us to auto bind the local + * address. + */ + hvs_addr_set(&pcb->local_addr, 0); + + for (i = previous_auto_bound_port - 1; + i != previous_auto_bound_port; i --) { + if (i == MIN_PORT) + i = MAX_PORT; + + pcb->local_addr.hvs_port = i; + + if (__hvs_find_socket_on_list(&pcb->local_addr, + HVS_LIST_BOUND | HVS_LIST_CONNECTED) == NULL) { + found_auto_bound_port = true; + previous_auto_bound_port = i; + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: found local bound port is %x\n", + __func__, pcb->local_addr.hvs_port); + break; + } + } + + if (found_auto_bound_port == true) { + /* Found available port for auto bound, put on list */ + __hvs_insert_socket_on_list(so, HVS_LIST_BOUND); + /* Set VM service ID */ + pcb->vm_srv_id = srv_id_template; + set_port_by_srv_id(&pcb->vm_srv_id, pcb->local_addr.hvs_port); + /* Set host service ID and remote port */ + pcb->host_srv_id = srv_id_template; + set_port_by_srv_id(&pcb->host_srv_id, raddr->hvs_port); + hvs_addr_set(&pcb->remote_addr, raddr->hvs_port); + + /* Change the socket state to SS_ISCONNECTING */ + soisconnecting(so); + } else { + HVSOCK_DBG(HVSOCK_DBG_ERR, + "%s: No local port available for auto bound\n", + __func__); + error = EADDRINUSE; + } + + HVSOCK_DBG(HVSOCK_DBG_INFO, "Connect vm_srv_id is "); + hvsock_print_guid(&pcb->vm_srv_id); + HVSOCK_DBG(HVSOCK_DBG_INFO, "Connect host_srv_id is "); + hvsock_print_guid(&pcb->host_srv_id); + +out: + mtx_unlock(&hvs_trans_socks_mtx); + + if (found_auto_bound_port == true) + vmbus_req_tl_connect(&pcb->vm_srv_id, &pcb->host_srv_id); + + return (error); +} + +int +hvs_trans_disconnect(struct socket *so) +{ + struct hvs_pcb *pcb; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_disconnect called\n", __func__); + + (void) hvs_trans_lock(); + pcb = so2hvspcb(so); + if (pcb == NULL) { + hvs_trans_unlock(); + return (EINVAL); + } + + /* If socket is already disconnected, skip this */ + if ((so->so_state & SS_ISDISCONNECTED) == 0) + soisdisconnecting(so); + + hvs_trans_unlock(); + + return (0); +} + +#define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? 0 : SBL_WAIT) +struct hvs_callback_arg { + struct uio *uio; + struct sockbuf *sb; +}; + +int +hvs_trans_soreceive(struct socket *so, struct sockaddr **paddr, + struct uio *uio, struct mbuf **mp0, struct mbuf **controlp, int *flagsp) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + struct sockbuf *sb; + ssize_t orig_resid; + uint32_t canread, to_read; + int flags, error = 0; + struct hvs_callback_arg cbarg; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_soreceive called\n", __func__); + + if (so->so_type != SOCK_STREAM) + return (EINVAL); + if (pcb == NULL) + return (EINVAL); + + if (flagsp != NULL) + flags = *flagsp &~ MSG_EOR; + else + flags = 0; + + if (flags & MSG_PEEK) + return (EOPNOTSUPP); + + /* If no space to copy out anything */ + if (uio->uio_resid == 0 || uio->uio_rw != UIO_READ) + return (EINVAL); + + sb = &so->so_rcv; + + orig_resid = uio->uio_resid; + + /* Prevent other readers from entering the socket. */ + error = sblock(sb, SBLOCKWAIT(flags)); + if (error) { + HVSOCK_DBG(HVSOCK_DBG_ERR, + "%s: sblock returned error = %d\n", __func__, error); + return (error); + } + + SOCKBUF_LOCK(sb); + + cbarg.uio = uio; + cbarg.sb = sb; + /* + * If the socket is closing, there might still be some data + * in rx br to read. However we need to make sure + * the channel is still open. + */ + if ((sb->sb_state & SBS_CANTRCVMORE) && + (so->so_state & SS_ISDISCONNECTED)) { + /* Other thread already closed the channel */ + error = EPIPE; + goto out; + } + + while (true) { + while (uio->uio_resid > 0 && + (canread = hvsock_canread_check(pcb)) > 0) { + to_read = MIN(canread, uio->uio_resid); + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: to_read = %u, skip = %u\n", __func__, to_read, + (unsigned int)(sizeof(struct hvs_pkt_header) + + pcb->recv_data_off)); + + error = vmbus_chan_recv_peek_call(pcb->chan, to_read, + sizeof(struct hvs_pkt_header) + pcb->recv_data_off, + hvsock_br_callback, (void *)&cbarg); + /* + * It is possible socket is disconnected becasue + * we released lock in hvsock_br_callback. So we + * need to check the state to make sure it is not + * disconnected. + */ + if (error || so->so_state & SS_ISDISCONNECTED) { + break; + } + + pcb->recv_data_len -= to_read; + pcb->recv_data_off += to_read; + } + + if (error) + break; + + /* Abort if socket has reported problems. */ + if (so->so_error) { + if (so->so_error == ESHUTDOWN && + orig_resid > uio->uio_resid) { + /* + * Although we got a FIN, we also received + * some data in this round. Delivery it + * to user. + */ + error = 0; + } else { + if (so->so_error != ESHUTDOWN) + error = so->so_error; + } + + break; + } + + /* Cannot received more. */ + if (sb->sb_state & SBS_CANTRCVMORE) + break; + + /* We are done if buffer has been filled */ + if (uio->uio_resid == 0) + break; + + if (!(flags & MSG_WAITALL) && orig_resid > uio->uio_resid) + break; + + /* Buffer ring is empty and we shall not block */ + if ((so->so_state & SS_NBIO) || + (flags & (MSG_DONTWAIT|MSG_NBIO))) { + if (orig_resid == uio->uio_resid) { + /* We have not read anything */ + error = EAGAIN; + } + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: non blocked read return, error %d.\n", + __func__, error); + break; + } + + /* + * Wait and block until (more) data comes in. + * Note: Drops the sockbuf lock during wait. + */ + error = sbwait(sb); + + if (error) + break; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: wake up from sbwait, read available is %u\n", + __func__, vmbus_chan_read_available(pcb->chan)); + } + +out: + SOCKBUF_UNLOCK(sb); + + sbunlock(sb); + + /* We recieved a FIN in this call */ + if (so->so_error == ESHUTDOWN) { + if (so->so_snd.sb_state & SBS_CANTSENDMORE) { + /* Send has already closed */ + soisdisconnecting(so); + } else { + /* Just close the receive side */ + socantrcvmore(so); + } + } + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: returning error = %d, so_error = %d\n", + __func__, error, so->so_error); + + return (error); +} + +int +hvs_trans_sosend(struct socket *so, struct sockaddr *addr, struct uio *uio, + struct mbuf *top, struct mbuf *controlp, int flags, struct thread *td) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + struct sockbuf *sb; + ssize_t orig_resid; + uint32_t canwrite, to_write; + int error = 0; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_sosend called, uio_resid = %lu\n", + __func__, uio->uio_resid); + + if (so->so_type != SOCK_STREAM) + return (EINVAL); + if (pcb == NULL) + return (EINVAL); + + /* If nothing to send */ + if (uio->uio_resid == 0 || uio->uio_rw != UIO_WRITE) + return (EINVAL); + + sb = &so->so_snd; + + orig_resid = uio->uio_resid; + + /* Prevent other writers from entering the socket. */ + error = sblock(sb, SBLOCKWAIT(flags)); + if (error) { + HVSOCK_DBG(HVSOCK_DBG_ERR, + "%s: sblock returned error = %d\n", __func__, error); + return (error); + } + + SOCKBUF_LOCK(sb); + + if ((sb->sb_state & SBS_CANTSENDMORE) || + so->so_error == ESHUTDOWN) { + error = EPIPE; + goto out; + } + + while (uio->uio_resid > 0) { + canwrite = hvsock_canwrite_check(pcb); + if (canwrite == 0) { + /* We have sent some data */ + if (orig_resid > uio->uio_resid) + break; + /* + * We have not sent any data and it is + * non-blocked io + */ + if (so->so_state & SS_NBIO || + (flags & (MSG_NBIO | MSG_DONTWAIT)) != 0) { + error = EWOULDBLOCK; + break; + } else { + /* + * We are here because there is no space on + * send buffer ring. Signal the other side + * to read and free more space. + * Sleep wait until space avaiable to send + * Note: Drops the sockbuf lock during wait. + */ + error = sbwait(sb); + + if (error) + break; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: wake up from sbwait, space avail on " + "tx ring is %u\n", + __func__, + vmbus_chan_write_available(pcb->chan)); + + continue; + } + } + to_write = MIN(canwrite, uio->uio_resid); + to_write = MIN(to_write, HVSOCK_SEND_BUF_SZ); + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: canwrite is %u, to_write = %u\n", __func__, + canwrite, to_write); + error = hvsock_send_data(pcb->chan, uio, to_write, sb); + + if (error) + break; + } + +out: + SOCKBUF_UNLOCK(sb); + sbunlock(sb); + + return (error); +} + +int +hvs_trans_peeraddr(struct socket *so, struct sockaddr **nam) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_peeraddr called\n", __func__); + + if (pcb == NULL) + return (EINVAL); + + *nam = sodupsockaddr((struct sockaddr *) &pcb->remote_addr, M_NOWAIT); + + return ((*nam == NULL)? ENOMEM : 0); +} + +int +hvs_trans_sockaddr(struct socket *so, struct sockaddr **nam) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_sockaddr called\n", __func__); + + if (pcb == NULL) + return (EINVAL); + + *nam = sodupsockaddr((struct sockaddr *) &pcb->local_addr, M_NOWAIT); + + return ((*nam == NULL)? ENOMEM : 0); +} + +void +hvs_trans_close(struct socket *so) +{ + struct hvs_pcb *pcb; + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_close called\n", __func__); + + (void) hvs_trans_lock(); + pcb = so2hvspcb(so); + if (!pcb) { + hvs_trans_unlock(); + return; + } + + if (so->so_state & SS_ISCONNECTED) { + /* Send a FIN to peer */ + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: hvs_trans_close sending a FIN to host\n", __func__); + (void) hvsock_send_data(pcb->chan, NULL, 0, NULL); + } + + if (so->so_state & + (SS_ISCONNECTED|SS_ISCONNECTING|SS_ISDISCONNECTING)) + soisdisconnected(so); + + pcb->chan = NULL; + pcb->so = NULL; + + if (SOLISTENING(so)) { + mtx_lock(&hvs_trans_socks_mtx); + /* Remove from bound list */ + __hvs_remove_socket_from_list(so, HVS_LIST_BOUND); + mtx_unlock(&hvs_trans_socks_mtx); + } + + hvs_trans_unlock(); + + return; +} + +void +hvs_trans_abort(struct socket *so) +{ + struct hvs_pcb *pcb = so2hvspcb(so); + + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, + "%s: HyperV Socket hvs_trans_abort called\n", __func__); + + (void) hvs_trans_lock(); + if (pcb == NULL) { + hvs_trans_unlock(); + return; + } + + if (SOLISTENING(so)) { + mtx_lock(&hvs_trans_socks_mtx); + /* Remove from bound list */ + __hvs_remove_socket_from_list(so, HVS_LIST_BOUND); + mtx_unlock(&hvs_trans_socks_mtx); + } + + if (so->so_state & SS_ISCONNECTED) { + (void) sodisconnect(so); + } + hvs_trans_unlock(); + + return; +} + +int +hvs_trans_shutdown(struct socket *so) +{ + struct hvs_pcb *pcb = so2hvspcb(so); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 20 11:10: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 3189E2CDEDE; Wed, 20 May 2020 11:10:12 +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 49Rqm36VHcz44LM; Wed, 20 May 2020 11:10: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 D2CC81B09D; Wed, 20 May 2020 11:10: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 04KBABtq014393; Wed, 20 May 2020 11:10:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KBABUt014389; Wed, 20 May 2020 11:10:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005201110.04KBABUt014389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 May 2020 11:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361276 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 361276 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, 20 May 2020 11:10:12 -0000 Author: kib Date: Wed May 20 11:10:10 2020 New Revision: 361276 URL: https://svnweb.freebsd.org/changeset/base/361276 Log: mlx5_core: add "PMD type not enabled" port module event type. Reviewed by: hselasky Sponsored by: Mellanox Technologies MFC after: 3 days Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Wed May 20 11:03:59 2020 (r361275) +++ head/sys/dev/mlx5/device.h Wed May 20 11:10:10 2020 (r361276) @@ -564,6 +564,7 @@ enum { MLX5_MODULE_EVENT_ERROR_UNSUPPORTED_CABLE = 0x5, MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, + MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED = 0x8, MLX5_MODULE_EVENT_ERROR_NUM , }; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed May 20 11:03:59 2020 (r361275) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed May 20 11:10:10 2020 (r361276) @@ -659,6 +659,8 @@ static const char *mlx5_port_module_event_error_type_t return "High Temperature"; case MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED: return "Bad or shorted cable/module"; + case MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED: + return "PMD type is not enabled"; default: return "Unknown error type"; } Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 20 11:03:59 2020 (r361275) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 20 11:10:10 2020 (r361276) @@ -1303,7 +1303,8 @@ m(+1, u64, no_eeprom, "no_eeprom", "No EEPROM/retry ti m(+1, u64, enforce_part_number, "enforce_part_number", "Module Enforce part number list") \ m(+1, u64, unknown_id, "unknown_id", "Module Unknown identifier") \ m(+1, u64, high_temp, "high_temp", "Module High Temperature") \ -m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") +m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") \ +m(+1, u64, pmd_type_not_enabled, "pmd_type_not_enabled", "PMD type is not enabled") static const char *mlx5_pme_err_desc[] = { MLX5_PORT_MODULE_ERROR_STATS(MLX5_STATS_DESC) From owner-svn-src-all@freebsd.org Wed May 20 11: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 151B12CE6C6; Wed, 20 May 2020 11: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 49Rr0F6tZ9z45DD; Wed, 20 May 2020 11:20:45 +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 E7A791B06B; Wed, 20 May 2020 11:20:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KBKjXI020597; Wed, 20 May 2020 11:20:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KBKjOv020592; Wed, 20 May 2020 11:20:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005201120.04KBKjOv020592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 May 2020 11:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361277 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 361277 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, 20 May 2020 11:20:46 -0000 Author: kib Date: Wed May 20 11:20:45 2020 New Revision: 361277 URL: https://svnweb.freebsd.org/changeset/base/361277 Log: mlx5_core: add more port module event types to decode. Reviewed by: hselasky Sponsored by: Mellanox Technologies MFC after: 3 days Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Wed May 20 11:10:10 2020 (r361276) +++ head/sys/dev/mlx5/device.h Wed May 20 11:20:45 2020 (r361277) @@ -565,6 +565,12 @@ enum { MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED = 0x8, + MLX5_MODULE_EVENT_ERROR_LASTER_TEC_FAILURE = 0x9, + MLX5_MODULE_EVENT_ERROR_HIGH_CURRENT = 0xa, + MLX5_MODULE_EVENT_ERROR_HIGH_VOLTAGE = 0xb, + MLX5_MODULE_EVENT_ERROR_PCIE_SYS_POWER_SLOT_EXCEEDED = 0xc, + MLX5_MODULE_EVENT_ERROR_HIGH_POWER = 0xd, + MLX5_MODULE_EVENT_ERROR_MODULE_STATE_MACHINE_FAULT = 0xe, MLX5_MODULE_EVENT_ERROR_NUM , }; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed May 20 11:10:10 2020 (r361276) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed May 20 11:20:45 2020 (r361277) @@ -661,6 +661,18 @@ static const char *mlx5_port_module_event_error_type_t return "Bad or shorted cable/module"; case MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED: return "PMD type is not enabled"; + case MLX5_MODULE_EVENT_ERROR_LASTER_TEC_FAILURE: + return "Laster_TEC_failure"; + case MLX5_MODULE_EVENT_ERROR_HIGH_CURRENT: + return "High_current"; + case MLX5_MODULE_EVENT_ERROR_HIGH_VOLTAGE: + return "High_voltage"; + case MLX5_MODULE_EVENT_ERROR_PCIE_SYS_POWER_SLOT_EXCEEDED: + return "pcie_system_power_slot_Exceeded"; + case MLX5_MODULE_EVENT_ERROR_HIGH_POWER: + return "High_power"; + case MLX5_MODULE_EVENT_ERROR_MODULE_STATE_MACHINE_FAULT: + return "Module_state_machine_fault"; default: return "Unknown error type"; } Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 20 11:10:10 2020 (r361276) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed May 20 11:20:45 2020 (r361277) @@ -1304,7 +1304,13 @@ m(+1, u64, enforce_part_number, "enforce_part_number", m(+1, u64, unknown_id, "unknown_id", "Module Unknown identifier") \ m(+1, u64, high_temp, "high_temp", "Module High Temperature") \ m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") \ -m(+1, u64, pmd_type_not_enabled, "pmd_type_not_enabled", "PMD type is not enabled") +m(+1, u64, pmd_type_not_enabled, "pmd_type_not_enabled", "PMD type is not enabled") \ +m(+1, u64, laster_tec_failure, "laster_tec_failure", "Laster TEC failure") \ +m(+1, u64, high_current, "high_current", "High current") \ +m(+1, u64, high_voltage, "high_voltage", "High voltage") \ +m(+1, u64, pcie_sys_power_slot_exceeded, "pcie_sys_power_slot_exceeded", "PCIe system power slot Exceeded") \ +m(+1, u64, high_power, "high_power", "High power") \ +m(+1, u64, module_state_machine_fault, "module_state_machine_fault", "Module State Machine fault") static const char *mlx5_pme_err_desc[] = { MLX5_PORT_MODULE_ERROR_STATS(MLX5_STATS_DESC) From owner-svn-src-all@freebsd.org Wed May 20 13:51: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 730142DA3FA; Wed, 20 May 2020 13:51:28 +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 49RvL82SMTz4FCd; Wed, 20 May 2020 13:51:28 +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 357BD1CF44; Wed, 20 May 2020 13:51:28 +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 04KDpSv5013249; Wed, 20 May 2020 13:51:28 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KDpRPh013247; Wed, 20 May 2020 13:51:27 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202005201351.04KDpRPh013247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 20 May 2020 13:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361278 - in head/sys/dev/hyperv: hvsock vmbus X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: in head/sys/dev/hyperv: hvsock vmbus X-SVN-Commit-Revision: 361278 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, 20 May 2020 13:51:28 -0000 Author: lwhsu Date: Wed May 20 13:51:27 2020 New Revision: 361278 URL: https://svnweb.freebsd.org/changeset/base/361278 Log: Fix i386 build for r361275 kponsored by: The FreeBSD Foundation Modified: head/sys/dev/hyperv/hvsock/hv_sock.c head/sys/dev/hyperv/vmbus/vmbus_br.c Modified: head/sys/dev/hyperv/hvsock/hv_sock.c ============================================================================== --- head/sys/dev/hyperv/hvsock/hv_sock.c Wed May 20 11:20:45 2020 (r361277) +++ head/sys/dev/hyperv/hvsock/hv_sock.c Wed May 20 13:51:27 2020 (r361278) @@ -792,7 +792,7 @@ hvs_trans_sosend(struct socket *so, struct sockaddr *a int error = 0; HVSOCK_DBG(HVSOCK_DBG_VERBOSE, - "%s: HyperV Socket hvs_trans_sosend called, uio_resid = %lu\n", + "%s: HyperV Socket hvs_trans_sosend called, uio_resid = %zd\n", __func__, uio->uio_resid); if (so->so_type != SOCK_STREAM) @@ -1154,7 +1154,7 @@ hvsock_br_callback(void *datap, int cplen, void *cbarg return (EINVAL); HVSOCK_DBG(HVSOCK_DBG_VERBOSE, - "%s: called, uio_rw = %s, uio_resid = %lu, cplen = %u, " + "%s: called, uio_rw = %s, uio_resid = %zd, cplen = %u, " "datap = %p\n", __func__, (uio->uio_rw == UIO_READ) ? "read from br":"write to br", uio->uio_resid, cplen, datap); @@ -1168,7 +1168,7 @@ hvsock_br_callback(void *datap, int cplen, void *cbarg SOCKBUF_LOCK(sb); HVSOCK_DBG(HVSOCK_DBG_VERBOSE, - "%s: after uiomove, uio_resid = %lu, error = %d\n", + "%s: after uiomove, uio_resid = %zd, error = %d\n", __func__, uio->uio_resid, error); return (error); @@ -1372,8 +1372,9 @@ hvsock_canwrite_check(struct hvs_pcb *pcb) * We must always reserve a 0-length-payload packet for the FIN. */ HVSOCK_DBG(HVSOCK_DBG_VERBOSE, - "%s: writeable is %u, should be greater than %lu\n", - __func__, writeable, HVSOCK_PKT_LEN(1) + HVSOCK_PKT_LEN(0)); + "%s: writeable is %u, should be greater than %ju\n", + __func__, writeable, + (uintmax_t)(HVSOCK_PKT_LEN(1) + HVSOCK_PKT_LEN(0))); if (writeable < HVSOCK_PKT_LEN(1) + HVSOCK_PKT_LEN(0)) { /* Modified: head/sys/dev/hyperv/vmbus/vmbus_br.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_br.c Wed May 20 11:20:45 2020 (r361277) +++ head/sys/dev/hyperv/vmbus/vmbus_br.c Wed May 20 13:51:27 2020 (r361278) @@ -66,9 +66,10 @@ vmbus_br_sysctl_state(SYSCTL_HANDLER_ARGS) ravail = br->vbr_dsize - wavail; snprintf(state, sizeof(state), - "intrcnt:%lu rindex:%u windex:%u imask:%u psndsz:%u fvalue:%u " + "intrcnt:%ju rindex:%u windex:%u imask:%u psndsz:%u fvalue:%u " "ravail:%u wavail:%u", - intrcnt, rindex, windex, imask, psndsz, fvalue, ravail, wavail); + (uintmax_t)intrcnt, rindex, windex, imask, psndsz, fvalue, + ravail, wavail); return sysctl_handle_string(oidp, state, sizeof(state), req); } From owner-svn-src-all@freebsd.org Wed May 20 15:11: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 CB6212DC724 for ; Wed, 20 May 2020 15:11:41 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) (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 49Rx6h5QW3z4Kfb for ; Wed, 20 May 2020 15:11:40 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x836.google.com with SMTP id l1so2790895qtp.6 for ; Wed, 20 May 2020 08:11:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=06zYfw5ua2V+P5wY+4b4FevSmsmu34MF8rGiBpedTzA=; b=AZIcKMCYEh93AwCXo7iVrUarGODqNV8WTz2CJj5C24MSNj9YZ5yOUd3404dot+H1Y1 9dD7ALYyEecNw/yLWdznJxSP6qw9ksJCfNf11hCi5n/wnwib32w9ZiO/+ii0HL8ieHe3 T2rgIzcHm8I3li/cminLQiZ/KDbmDHNL5yPWTDtDLDulZQq/7BLBukv2z9tMOn+8fGLB EG13WGepkkafT7rT+zYbWP79E+I4MvrZylPoSB7QdbVPuh7iJNuSIOzlRQbdy0Hb/Gza 3CD2NvnszWQlNL4MHMl5dFNFLj8xrvX137ufvHYUzR/dIGYfH4PhbvUZU2Y8aBTuR6+K QZIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=06zYfw5ua2V+P5wY+4b4FevSmsmu34MF8rGiBpedTzA=; b=iXRbvqVuY14nHxp0ilW+2tmW0z1s/9Mp19gr9L97OaLm3Z6e8o0MKKokCDAp5xthqz n2DLikz8xoRMmrpJuiLyjzbVuXix0aiCM3OJx9uhtcmiB+DjaH9YZgrDw+3ZiVLP0tlM qcHEWkkh99MQ5YpVPq/+Zg4XiXV2Y3+0408VgMLPVAq+aX9l8+8+s5pYTKZsa2y9IH7A +sy0/z79O7+n0Z8m5ZUZOue7iyM4Z4koDiEEWeKoeq9dnGn14xX2/R7EXTWtNnnu3LU+ MNthXTHAk3KACj9LZrZZAR+el7GxA1KmPiqLQFoxXvQnme+ov0UEoXoXsucX/D+N6JQC 57IQ== X-Gm-Message-State: AOAM532YD//7NOY9IGCzpQBQT7TBLslwequOynhS5FEWyY2yvQBUJm6H 4dkerDwlIosDjraRbGFEGYQQDgcXJIdTUA== X-Google-Smtp-Source: ABdhPJwdn2Ox8rgrpazTBW9lpciqQE162zTxdG6QU8Ar40DyOJIa6xQvGayMr/OHE92Hi9aHuyPBiw== X-Received: by 2002:ac8:19ca:: with SMTP id s10mr5764780qtk.11.1589987498025; Wed, 20 May 2020 08:11:38 -0700 (PDT) Received: from mutt-hbsd (pool-100-16-231-224.bltmmd.fios.verizon.net. [100.16.231.224]) by smtp.gmail.com with ESMTPSA id d207sm2345496qkc.49.2020.05.20.08.11.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2020 08:11:36 -0700 (PDT) Date: Wed, 20 May 2020 11:11:28 -0400 From: Shawn Webb To: Wei Hu Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Message-ID: <20200520151128.bglcjxphdf2vo6hk@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0xFF2E67A277F8E1FA References: <202005201103.04KB3xTp013965@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vxcw4cnpqsdkwemn" Content-Disposition: inline In-Reply-To: <202005201103.04KB3xTp013965@repo.freebsd.org> X-Rspamd-Queue-Id: 49Rx6h5QW3z4Kfb X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=AZIcKMCY; dmarc=none; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::836 as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org X-Spamd-Result: default: False [-4.57 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-0.996]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; NEURAL_HAM_LONG(-1.03)[-1.026]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; NEURAL_HAM_SHORT(-0.45)[-0.452]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::836:from]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; MID_RHS_NOT_FQDN(0.50)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[100.16.231.224:received] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 May 2020 15:11:41 -0000 --vxcw4cnpqsdkwemn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 20, 2020 at 11:03:59AM +0000, Wei Hu wrote: > Author: whu > Date: Wed May 20 11:03:59 2020 > New Revision: 361275 > URL: https://svnweb.freebsd.org/changeset/base/361275 >=20 > Log: > HyperV socket implementation for FreeBSD > =20 > This change adds Hyper-V socket feature in FreeBSD. New socket address > family AF_HYPERV and its kernel support are added. > =20 > Submitted by: Wei Hu > Reviewed by: Dexuan Cui > Relnotes: yes > Sponsored by: Microsoft > Differential Revision: https://reviews.freebsd.org/D24061 Hey Wei Hu, Would it be good to bump __FreeBSD_version after a change like this? Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD GPG Key ID: 0xFF2E67A277F8E1FA GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9 3633 C85B 0AF8 AB23 0FB2 https://git-01.md.hardenedbsd.org/HardenedBSD/pubkeys/src/branch/master/Sha= wn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --vxcw4cnpqsdkwemn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAl7FSJoACgkQ/y5nonf4 4frt7Q//R7RCo5qWcADlRsclOHJXs2GYP9C23fAqn+TYTF9+NocxzVmkcFNx78o3 OLtOK7oGhSBrIYtsQqzs/jTZHS1RLiXa+W9MYQJEHbP3zN7UwIOvnTW3OoYn/iDM JeTWygweLut9PugMeYHmwFoRMU/vFCDsUF44LLXz83LiAk9MO1RGBpA0NecSLIxA 5pax0MBOq1A4g2fzU32unhedNuo1KAXyP2ZL2sIAepqRegx9D8LKosbU3rAffinn m8pBdqtY+jjztmyGYH7VobO7VNu438S9H5z9wjzUhzaBxxQF5L9Lrn+mWggcI7ZN fbGJSQxWN7xcAgoQSD1d5Wm48tiaz3tyv8vvu72UV0C4X1hsh5ha+nyge8DxsKe8 18tJL6CNjMRMKpc/C2ft4sPCD87x/N0uTo6inYtyvWb5abZntG8d5EPLNfGoCGHG stFf+CW9TmZy+Av6jrEDBdmE2JtT5nGXCP+XUMSUQKtLG6xlCVWcUbaoKRxyaMht zwc1zm7DtcwwfmUCtNhF5enyMPOAaLH2BxbDy2cL2Z9pHHuI9N8ewTgtDkNUqSUQ 3OfnLcwSz972fKgPY8Fas+/abrDe/xtmhLhSttSjjWbNIXJ7Dwn4nAIq1xhfWZUb 6foP965pT9ZBNgfH9re12vpCKrR+AAjuZG3AidkAhthgQimjSaM= =FLH7 -----END PGP SIGNATURE----- --vxcw4cnpqsdkwemn-- From owner-svn-src-all@freebsd.org Wed May 20 15:54: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 D34852DD4C4; Wed, 20 May 2020 15:54:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (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 49Ry4d6lr7z4NCc; Wed, 20 May 2020 15:54:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x441.google.com with SMTP id y198so1760924pfb.4; Wed, 20 May 2020 08:54:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=3svMv0/CJSD8Uq9xJDfuvjKPcoiLoez5D8vQsDxYOLg=; b=T0mwRCLskDVE0ezEcauNzSA4tth4eUtTJ4UTRU6Yi74P+lI/weKelgnvImU/FldjxQ s7y52+J7q5GCR6ja45NcTZV36wuNpZBJR1t1zYOtY3GHZDHuCtpIMu+eYMYIu3RclHOs U9Cv6vmAuyGsemoO3V85q425oxBV6nCkvDdHZHiMp+duR229mbONG6Y959BYxyS3iJU2 IlZwQ+n1qGVSPekDpaB3p7UWcYBlkU01JdNduyS8AVWseZ/tkmsxGezMu3nHWHiDPTUg 1OHg9AzDyyP4T4KSLAPevJW7Q4TdIxDD/qYNxkhpDdNonfTaeGWsby/HPdXFFPLiBo/t lbmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=3svMv0/CJSD8Uq9xJDfuvjKPcoiLoez5D8vQsDxYOLg=; b=YA9w7BsyDN9iVXSZxVxz6iN0VQPB9ij/BJPJxMGY83N8PfT5Es16bbvHq2eMsK/qyl D5hrcArKOTUfvCPmbqnToDghow7GSB4vVkiihFELJxc56dxeMntSuoYdK0GVxIyfRz6t 4WNfbEyT3Y2TYMd6N2hEphsp8TVumjz9ASNEFowBpx2K/wNMficxfg5hfRMAw5xEUzWw YL8QI6DcJVVmYV2eKE26qs6vOsmPoPlR4LuDJ9EG3U5dCZeTRSHDiz8DX8gFVaWGft2m s6wFs0t3abKaHKqAVBpM07mRjmoF0mnW3HITqken4tLBYDHggvjhPMEGfFRP9TWNXMil qA3A== X-Gm-Message-State: AOAM530Tt78S6rfRIGudi0i4/Hv5mGeZ0yTgITuiuK1elTSj5g5Zl+le ONOedu8bxcoL8aSPjdNibGIT24zbBfM= X-Google-Smtp-Source: ABdhPJwvv3UiRcl+P6kNjqdOf+qfb7tgksVjYCeDWnF7YTawCQRK24VOSrdEegwVpVKGMvlXRGkCnw== X-Received: by 2002:a63:da50:: with SMTP id l16mr4550845pgj.198.1589990096209; Wed, 20 May 2020 08:54:56 -0700 (PDT) Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id k3sm2483275pjc.38.2020.05.20.08.54.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 May 2020 08:54:55 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Enji Cooper Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Date: Wed, 20 May 2020 08:54:54 -0700 Message-Id: References: <20200520151128.bglcjxphdf2vo6hk@mutt-hbsd> Cc: Wei Hu , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <20200520151128.bglcjxphdf2vo6hk@mutt-hbsd> To: Shawn Webb X-Mailer: iPhone Mail (17E262) X-Rspamd-Queue-Id: 49Ry4d6lr7z4NCc X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=T0mwRCLs; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::441 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-2.22 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RECEIVED_SPAMHAUS_PBL(0.00)[73.19.52.228:received]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.92)[-0.925]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.10)[0.099]; NEURAL_HAM_LONG(-0.89)[-0.895]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::441:from]; RCVD_TLS_ALL(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: Wed, 20 May 2020 15:54:58 -0000 > On May 20, 2020, at 08:11, Shawn Webb wrote: >=20 > =EF=BB=BFOn Wed, May 20, 2020 at 11:03:59AM +0000, Wei Hu wrote: >> Author: whu >> Date: Wed May 20 11:03:59 2020 >> New Revision: 361275 >> URL: https://svnweb.freebsd.org/changeset/base/361275 >>=20 >> Log: >> HyperV socket implementation for FreeBSD >>=20 >> This change adds Hyper-V socket feature in FreeBSD. New socket address >> family AF_HYPERV and its kernel support are added. Hi Wei, Could you please further describe what this feature is/does? Thanks, -Enji= From owner-svn-src-all@freebsd.org Wed May 20 15:57: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 6055A2DD4E5; Wed, 20 May 2020 15:57:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (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 49Ry7g5mhwz4NVf; Wed, 20 May 2020 15:57:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x442.google.com with SMTP id b190so1757573pfg.6; Wed, 20 May 2020 08:57:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=B+yFMfsWzpvyk/mjgNzWJrfYfuGaG3edl6DHnm82/IA=; b=eeQZnxnW2oio3H9+cKEnYWDweX4do9wzsOqRC0jaS6ju17jt2aCoEyFi7fS8BknFfZ OZQ9+P52SQtGuAQuXuCCXI02YVME9RqAcFzicjQJpjIxzpZHwzthv6BF/Ukxfzj3WHMe K3xHt3ZfF+l/CvPPm6ULcgD2o+X60d/qqX82CPq7Jo3zEahGxe0XMqdBMlC/N0ICy5W/ mndIEGJD646flVX6R7ZQ4xCjdP+S3YpJwSmWFXy/4+r1dU00gVTRKO8rL6f2mLEYmGti 33OJXV4WQtkxaSxQ2qlgU0oSNJrRI9lf23Kwr7wYNGzj7ICDqo5YS3SoD8Yn7vCxn+kx KjqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=B+yFMfsWzpvyk/mjgNzWJrfYfuGaG3edl6DHnm82/IA=; b=ebRAe4ag8RYDlLqTObOCkiJeI7b84MlHics3WhJlQqSIP++Av+yecsXNBsfL9KFASM 46TrIIb+fWjHOBCD8x1ywxkpL6zPEl1aMtNIhMxr4cJrMksYI7ju9aW+hnLztbGYfxcI kABdpQYGLh5zutB6UVzU2KubvRtadeK3vDt0Cmnwk99W4QkhB39+ckpiWJ3C8c2Hpb/O QFtJBMGekzHdSw5WW5Fh4/AvD9cWIVfL5D+7PGxNjhw6m5rgWsoujpR4GxpxapnP6e/N 60q7zUGzvn0Dorg6MQIu74EHTxkkqpes4qKpQcmgB360FnWXF8B5wBH3IxxZYG8VURiC kbGw== X-Gm-Message-State: AOAM530g39TKoklhNY5WgdswMV3pKbkBbZ6NffmppK0Pa78Jg9cJ72tz t+UYQbZsbiRHKzXBv4458VIz9BsVDKE= X-Google-Smtp-Source: ABdhPJzR732x1FGVDzK8zaPe8pwxFPBzHzGSCVlpnIgV9gNHrMoLsv8yxS10J9thX7HDyxDnDn49cQ== X-Received: by 2002:a63:1854:: with SMTP id 20mr4850646pgy.257.1589990254391; Wed, 20 May 2020 08:57:34 -0700 (PDT) Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id z190sm2436453pfb.1.2020.05.20.08.57.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 May 2020 08:57:33 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Enji Cooper Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Date: Wed, 20 May 2020 08:57:33 -0700 Message-Id: References: Cc: Wei Hu , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: To: Shawn Webb X-Mailer: iPhone Mail (17E262) X-Rspamd-Queue-Id: 49Ry7g5mhwz4NVf X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=eeQZnxnW; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::442 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-2.22 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RECEIVED_SPAMHAUS_PBL(0.00)[73.19.52.228:received]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.92)[-0.921]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.10)[0.097]; NEURAL_HAM_LONG(-0.90)[-0.897]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::442:from]; RCVD_TLS_ALL(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: Wed, 20 May 2020 15:57:36 -0000 > On May 20, 2020, at 08:54, Enji Cooper wrote: > =EF=BB=BF >>> On May 20, 2020, at 08:11, Shawn Webb wrote= : >>>=20 >>> =EF=BB=BFOn Wed, May 20, 2020 at 11:03:59AM +0000, Wei Hu wrote: >>> Author: whu >>> Date: Wed May 20 11:03:59 2020 >>> New Revision: 361275 >>> URL: https://svnweb.freebsd.org/changeset/base/361275 >>>=20 >>> Log: >>> HyperV socket implementation for FreeBSD >>>=20 >>> This change adds Hyper-V socket feature in FreeBSD. New socket address >>> family AF_HYPERV and its kernel support are added. >=20 > Hi Wei, > Could you please further describe what this feature is/does? I realize after looking at the review that it contains the content I was= hoping for. It would have been helpful to folks if this context had been in= cluded in the commit message. Thank you, -Enji= From owner-svn-src-all@freebsd.org Wed May 20 16:07: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 920132DDA04; Wed, 20 May 2020 16:07:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RyMG36xpz4NrJ; Wed, 20 May 2020 16:07:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 620251E763; Wed, 20 May 2020 16:07:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KG7cSB098342; Wed, 20 May 2020 16:07:38 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KG7cfr098341; Wed, 20 May 2020 16:07:38 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202005201607.04KG7cfr098341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 20 May 2020 16:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361279 - head/sys/dev/bnxt X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/dev/bnxt X-SVN-Commit-Revision: 361279 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, 20 May 2020 16:07:38 -0000 Author: kp Date: Wed May 20 16:07:37 2020 New Revision: 361279 URL: https://svnweb.freebsd.org/changeset/base/361279 Log: bnxt: isc_nrxd_max and isc_ntxd_max must be powers of two Reviewed by: gallatin, rpokala MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D24922 Modified: head/sys/dev/bnxt/bnxt.h head/sys/dev/bnxt/if_bnxt.c Modified: head/sys/dev/bnxt/bnxt.h ============================================================================== --- head/sys/dev/bnxt/bnxt.h Wed May 20 13:51:27 2020 (r361278) +++ head/sys/dev/bnxt/bnxt.h Wed May 20 16:07:37 2020 (r361279) @@ -87,6 +87,11 @@ __FBSDID("$FreeBSD$"); #define NETXTREME_E_VF2 0x16d3 #define NETXTREME_E_VF3 0x16dc +/* Maximum numbers of RX and TX descriptors. iflib requires this to be a power + * of two. The hardware has no particular limitation. */ +#define BNXT_MAX_RXD ((INT32_MAX >> 1) + 1) +#define BNXT_MAX_TXD ((INT32_MAX >> 1) + 1) + #define CSUM_OFFLOAD (CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \ CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \ CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP) Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Wed May 20 13:51:27 2020 (r361278) +++ head/sys/dev/bnxt/if_bnxt.c Wed May 20 16:07:37 2020 (r361279) @@ -316,11 +316,11 @@ static struct if_shared_ctx bnxt_sctx_init = { .isc_nrxd_default = {PAGE_SIZE / sizeof(struct cmpl_base) * 8, PAGE_SIZE / sizeof(struct rx_prod_pkt_bd), PAGE_SIZE / sizeof(struct rx_prod_pkt_bd)}, - .isc_nrxd_max = {INT32_MAX, INT32_MAX, INT32_MAX}, + .isc_nrxd_max = {BNXT_MAX_RXD, BNXT_MAX_RXD, BNXT_MAX_RXD}, .isc_ntxd_min = {16, 16, 16}, .isc_ntxd_default = {PAGE_SIZE / sizeof(struct cmpl_base) * 2, PAGE_SIZE / sizeof(struct tx_bd_short)}, - .isc_ntxd_max = {INT32_MAX, INT32_MAX, INT32_MAX}, + .isc_ntxd_max = {BNXT_MAX_TXD, BNXT_MAX_TXD, BNXT_MAX_TXD}, .isc_admin_intrcnt = 1, .isc_vendor_info = bnxt_vendor_info_array, From owner-svn-src-all@freebsd.org Wed May 20 16:13: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 52C252DDCEA; Wed, 20 May 2020 16:13:05 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RyTY1rNDz4Ph6; Wed, 20 May 2020 16:13:05 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39F9D1EA6F; Wed, 20 May 2020 16:13:05 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KGD5tQ004302; Wed, 20 May 2020 16:13:05 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KGD20D004289; Wed, 20 May 2020 16:13:02 GMT (envelope-from mm@FreeBSD.org) Message-Id: <202005201613.04KGD20D004289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Wed, 20 May 2020 16:13:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r361280 - in vendor/libarchive/dist: . build build/ci/github_actions build/cmake contrib/oss-fuzz libarchive libarchive/test tar X-SVN-Group: vendor X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in vendor/libarchive/dist: . build build/ci/github_actions build/cmake contrib/oss-fuzz libarchive libarchive/test tar X-SVN-Commit-Revision: 361280 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, 20 May 2020 16:13:05 -0000 Author: mm Date: Wed May 20 16:13:02 2020 New Revision: 361280 URL: https://svnweb.freebsd.org/changeset/base/361280 Log: Update vendor/libarchive/dist to git fc6563f5130d8a7ee1fc27c0e55baef35119f26c Libarchive 3.4.3 Relevant vendor changes: PR #1352: support negative zstd compression levels PR #1359: improve zstd version checking PR #1348: support RHT.security.selinux from GNU tar PR #1357: support for archives compressed with pzstd PR #1367: fix issues in acl tests PR #1372: child handling cleanup PR #1378: fix memory leak from passphrase callback Added: vendor/libarchive/dist/contrib/oss-fuzz/ vendor/libarchive/dist/contrib/oss-fuzz/corpus.zip (contents, props changed) vendor/libarchive/dist/contrib/oss-fuzz/libarchive_fuzzer.cc (contents, props changed) vendor/libarchive/dist/contrib/oss-fuzz/oss-fuzz-build.sh (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_zstd_2.tar.zst.uu vendor/libarchive/dist/libarchive/test/test_read_pax_xattr_rht_security_selinux.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu vendor/libarchive/dist/libarchive/test/test_read_pax_xattr_schily.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_read_pax_xattr_schily.tar.uu Deleted: vendor/libarchive/dist/libarchive/test/test_read_pax_schily_xattr.c vendor/libarchive/dist/libarchive/test/test_read_pax_schily_xattr.tar.uu Modified: vendor/libarchive/dist/CMakeLists.txt vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/NEWS vendor/libarchive/dist/README.md vendor/libarchive/dist/build/ci/github_actions/ci.cmd vendor/libarchive/dist/build/cmake/CreatePkgConfigFile.cmake vendor/libarchive/dist/build/version vendor/libarchive/dist/configure.ac vendor/libarchive/dist/libarchive/archive.h vendor/libarchive/dist/libarchive/archive_digest.c vendor/libarchive/dist/libarchive/archive_entry.c vendor/libarchive/dist/libarchive/archive_entry_stat.3 vendor/libarchive/dist/libarchive/archive_read_add_passphrase.c vendor/libarchive/dist/libarchive/archive_read_disk_posix.c vendor/libarchive/dist/libarchive/archive_read_support_filter_program.c vendor/libarchive/dist/libarchive/archive_read_support_filter_zstd.c vendor/libarchive/dist/libarchive/archive_read_support_format_rar5.c vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c vendor/libarchive/dist/libarchive/archive_write_add_filter_program.c vendor/libarchive/dist/libarchive/archive_write_add_filter_zstd.c vendor/libarchive/dist/libarchive/archive_write_set_options.3 vendor/libarchive/dist/libarchive/filter_fork.h vendor/libarchive/dist/libarchive/filter_fork_posix.c vendor/libarchive/dist/libarchive/filter_fork_windows.c vendor/libarchive/dist/libarchive/test/CMakeLists.txt vendor/libarchive/dist/libarchive/test/test_acl_platform_nfs4.c vendor/libarchive/dist/libarchive/test/test_acl_platform_posix1e.c vendor/libarchive/dist/libarchive/test/test_compat_zstd.c vendor/libarchive/dist/libarchive/test/test_write_filter_zstd.c vendor/libarchive/dist/tar/bsdtar.1 Modified: vendor/libarchive/dist/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/CMakeLists.txt Wed May 20 16:07:37 2020 (r361279) +++ vendor/libarchive/dist/CMakeLists.txt Wed May 20 16:13:02 2020 (r361280) @@ -18,7 +18,7 @@ endif() # RelWithDebInfo : Release build with Debug Info # MinSizeRel : Release Min Size build IF(NOT CMAKE_BUILD_TYPE) - SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Type" FORCE) + SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type" FORCE) ENDIF(NOT CMAKE_BUILD_TYPE) # Set a value type to properly display CMAKE_BUILD_TYPE on GUI if the # value type is "UNINITIALIZED". @@ -157,32 +157,32 @@ IF (MSVC) # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" # Enable level 4 C4062: The enumerate has no associated handler in a switch # statement and there is no default that can catch it. - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4062") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /w14062") # Enable level 4 C4254: A larger bit field was assigned to a smaller bit # field. - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4254") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /w14254") # Enable level 4 C4295: An array was initialized but the last character in # the array is not a null; accessing the array may # produce unexpected results. - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4295") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /w14295") # Enable level 4 C4296: An unsigned variable was used in a comparison # operation with zero. - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4296") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /w14296") # Enable level 4 C4389: An operation involved signed and unsigned variables. # This could result in a loss of data. - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4389") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /w14389") # Enable level 4 C4505: The given function is local and not referenced in # the body of the module; therefore, the function is # dead code. - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4505") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /w14505") # Enable level 4 C4514: The optimizer removed an inline function that is not # called. - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4514") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /w14514") # Enable level 4 C4702: Unreachable code. - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4702") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /w14702") # Enable level 4 C4706: The test value in a conditional expression was the # result of an assignment. - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4706") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /w14706") # /Oi option enables built-in functions. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Oi") ################################################################# @@ -1449,9 +1449,13 @@ CHECK_C_SOURCE_COMPILES( "#include \nint main() { return major(256); }" MAJOR_IN_SYSMACROS) +IF(ENABLE_LZMA) CHECK_C_SOURCE_COMPILES( "#include \n#if LZMA_VERSION < 50020000\n#error unsupported\n#endif\nint main(void){lzma_stream_encoder_mt(0, 0); return 0;}" HAVE_LZMA_STREAM_ENCODER_MT) +ELSE() + SET(HAVE_LZMA_STREAM_ENCODER_MT 0) +ENDIF(ENABLE_LZMA) IF(HAVE_STRERROR_R) SET(HAVE_DECL_STRERROR_R 1) @@ -2035,6 +2039,11 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} IF(MSVC) ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) ENDIF(MSVC) + +IF(APPLE) + # CC_MD5_Init() functions are deprecated on macOS 10.15, but we want to use them + ADD_DEFINITIONS(-Wno-deprecated-declarations) +ENDIF(APPLE) IF(ENABLE_TEST) ADD_CUSTOM_TARGET(run_all_tests) Modified: vendor/libarchive/dist/Makefile.am ============================================================================== --- vendor/libarchive/dist/Makefile.am Wed May 20 16:07:37 2020 (r361279) +++ vendor/libarchive/dist/Makefile.am Wed May 20 16:13:02 2020 (r361280) @@ -539,7 +539,8 @@ libarchive_test_SOURCES= \ libarchive/test/test_read_format_zip_zip64.c \ libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c \ libarchive/test/test_read_large.c \ - libarchive/test/test_read_pax_schily_xattr.c \ + libarchive/test/test_read_pax_xattr_rht_security_selinux.c \ + libarchive/test/test_read_pax_xattr_schily.c \ libarchive/test/test_read_pax_truncated.c \ libarchive/test/test_read_position.c \ libarchive/test/test_read_set_format.c \ @@ -701,6 +702,7 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_compat_zip_7.xps.uu \ libarchive/test/test_compat_zip_8.zip.uu \ libarchive/test/test_compat_zstd_1.tar.zst.uu \ + libarchive/test/test_compat_zstd_2.tar.zst.uu \ libarchive/test/test_fuzz.cab.uu \ libarchive/test/test_fuzz.lzh.uu \ libarchive/test/test_fuzz_1.iso.Z.uu \ @@ -946,7 +948,8 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_read_large_splitted_rar_ac.uu \ libarchive/test/test_read_large_splitted_rar_ad.uu \ libarchive/test/test_read_large_splitted_rar_ae.uu \ - libarchive/test/test_read_pax_schily_xattr.tar.uu \ + libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu \ + libarchive/test/test_read_pax_xattr_schily.tar.uu \ libarchive/test/test_read_splitted_rar_aa.uu \ libarchive/test/test_read_splitted_rar_ab.uu \ libarchive/test/test_read_splitted_rar_ac.uu \ Modified: vendor/libarchive/dist/NEWS ============================================================================== --- vendor/libarchive/dist/NEWS Wed May 20 16:07:37 2020 (r361279) +++ vendor/libarchive/dist/NEWS Wed May 20 16:13:02 2020 (r361280) @@ -1,3 +1,9 @@ +May 20, 2020: libarchive 3.4.3 released + +Apr 30, 2020: Support for pzstd compressed files + +Apr 16, 2020: Support for RHT.security.selinux tar extended attribute + Feb 11, 2020: libarchive 3.4.2 released Jan 23, 2020: Important fixes for writing XAR archives Modified: vendor/libarchive/dist/README.md ============================================================================== --- vendor/libarchive/dist/README.md Wed May 20 16:07:37 2020 (r361279) +++ vendor/libarchive/dist/README.md Wed May 20 16:13:02 2020 (r361280) @@ -70,7 +70,7 @@ know about any errors or omissions you find. ## Supported Formats -Currently, the library automatically detects and reads the following fomats: +Currently, the library automatically detects and reads the following formats: * Old V7 tar archives * POSIX ustar * GNU tar format (including GNU long filenames, long link names, and sparse files) Modified: vendor/libarchive/dist/build/ci/github_actions/ci.cmd ============================================================================== --- vendor/libarchive/dist/build/ci/github_actions/ci.cmd Wed May 20 16:07:37 2020 (r361279) +++ vendor/libarchive/dist/build/ci/github_actions/ci.cmd Wed May 20 16:13:02 2020 (r361280) @@ -1,7 +1,7 @@ @ECHO OFF SET ZLIB_VERSION=1.2.11 SET BZIP2_VERSION=b7a672291188a6469f71dd13ad14f2f9a7344fc8 -SET XZ_VERSION=292a5c0f9c9b3a66f5a5c652dc46381836d4537f +SET XZ_VERSION=2327a461e1afce862c22269b80d3517801103c1b IF NOT "%BE%"=="mingw-gcc" ( IF NOT "%BE%"=="msvc" ( ECHO Environment variable BE must be mingw-gcc or msvc Modified: vendor/libarchive/dist/build/cmake/CreatePkgConfigFile.cmake ============================================================================== --- vendor/libarchive/dist/build/cmake/CreatePkgConfigFile.cmake Wed May 20 16:07:37 2020 (r361279) +++ vendor/libarchive/dist/build/cmake/CreatePkgConfigFile.cmake Wed May 20 16:13:02 2020 (r361280) @@ -24,10 +24,10 @@ ENDFOREACH() # thus there's a good chance it'll make some binutils versions unhappy... # This only affects Libs.private (looked up for static builds) though. CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/pkgconfig/libarchive.pc.in - ${CMAKE_CURRENT_SOURCE_DIR}/build/pkgconfig/libarchive.pc + ${CMAKE_CURRENT_BINARY_DIR}/build/pkgconfig/libarchive.pc @ONLY) # And install it, of course ;). IF(ENABLE_INSTALL) - INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/build/pkgconfig/libarchive.pc + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/build/pkgconfig/libarchive.pc DESTINATION "lib/pkgconfig") ENDIF() Modified: vendor/libarchive/dist/build/version ============================================================================== --- vendor/libarchive/dist/build/version Wed May 20 16:07:37 2020 (r361279) +++ vendor/libarchive/dist/build/version Wed May 20 16:13:02 2020 (r361280) @@ -1 +1 @@ -3004003dev +3004003 Modified: vendor/libarchive/dist/configure.ac ============================================================================== --- vendor/libarchive/dist/configure.ac Wed May 20 16:07:37 2020 (r361279) +++ vendor/libarchive/dist/configure.ac Wed May 20 16:13:02 2020 (r361280) @@ -4,7 +4,7 @@ dnl First, define all of the version numbers up front. dnl In particular, this allows the version macro to be used in AC_INIT dnl These first two version numbers are updated automatically on each release. -m4_define([LIBARCHIVE_VERSION_S],[3.4.3dev]) +m4_define([LIBARCHIVE_VERSION_S],[3.4.3]) m4_define([LIBARCHIVE_VERSION_N],[3004003]) dnl bsdtar and bsdcpio versioning tracks libarchive Added: vendor/libarchive/dist/contrib/oss-fuzz/corpus.zip ============================================================================== Binary file. No diff available. Added: vendor/libarchive/dist/contrib/oss-fuzz/libarchive_fuzzer.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/contrib/oss-fuzz/libarchive_fuzzer.cc Wed May 20 16:13:02 2020 (r361280) @@ -0,0 +1,49 @@ +#include +#include +#include + +#include "archive.h" + +struct Buffer { + const uint8_t *buf; + size_t len; +}; + +ssize_t reader_callback(struct archive *a, void *client_data, + const void **block) { + Buffer *buffer = reinterpret_cast(client_data); + *block = buffer->buf; + ssize_t len = buffer->len; + buffer->len = 0; + return len; +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) { + int ret; + ssize_t r; + struct archive *a = archive_read_new(); + + archive_read_support_filter_all(a); + archive_read_support_format_all(a); + + Buffer buffer = {buf, len}; + archive_read_open(a, &buffer, NULL, reader_callback, NULL); + + std::vector data_buffer(getpagesize(), 0); + struct archive_entry *entry; + while(1) { + ret = archive_read_next_header(a, &entry); + if (ret == ARCHIVE_EOF || ret == ARCHIVE_FATAL) + break; + if (ret == ARCHIVE_RETRY) + continue; + while ((r = archive_read_data(a, data_buffer.data(), + data_buffer.size())) > 0) + ; + if (r == ARCHIVE_FATAL) + break; + } + + archive_read_free(a); + return 0; +} Added: vendor/libarchive/dist/contrib/oss-fuzz/oss-fuzz-build.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/contrib/oss-fuzz/oss-fuzz-build.sh Wed May 20 16:13:02 2020 (r361280) @@ -0,0 +1,16 @@ +# build the project +./build/autogen.sh +./configure +make -j$(nproc) all + +# build seed +cp $SRC/libarchive/contrib/oss-fuzz/corpus.zip\ + $OUT/libarchive_fuzzer_seed_corpus.zip + +# build fuzzer(s) +$CXX $CXXFLAGS -Ilibarchive \ + $SRC/libarchive/contrib/oss-fuzz/libarchive_fuzzer.cc \ + -o $OUT/libarchive_fuzzer $LIB_FUZZING_ENGINE \ + .libs/libarchive.a -Wl,-Bstatic -lbz2 -llzo2 \ + -lxml2 -llzma -lz -lcrypto -llz4 -licuuc \ + -licudata -Wl,-Bdynamic Modified: vendor/libarchive/dist/libarchive/archive.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive.h Wed May 20 16:07:37 2020 (r361279) +++ vendor/libarchive/dist/libarchive/archive.h Wed May 20 16:13:02 2020 (r361280) @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.4.3dev" +#define ARCHIVE_VERSION_ONLY_STRING "3.4.3" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); Modified: vendor/libarchive/dist/libarchive/archive_digest.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_digest.c Wed May 20 16:07:37 2020 (r361279) +++ vendor/libarchive/dist/libarchive/archive_digest.c Wed May 20 16:13:02 2020 (r361280) @@ -109,14 +109,14 @@ win_crypto_Final(unsigned char *buf, size_t bufsize, D #if defined(ARCHIVE_CRYPTO_MD5_LIBC) static int -__archive_libc_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { MD5Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { MD5Update(ctx, indata, insize); @@ -124,7 +124,7 @@ __archive_libc_md5update(archive_md5_ctx *ctx, const v } static int -__archive_libc_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { MD5Final(md, ctx); return (ARCHIVE_OK); @@ -133,14 +133,14 @@ __archive_libc_md5final(archive_md5_ctx *ctx, void *md #elif defined(ARCHIVE_CRYPTO_MD5_LIBMD) static int -__archive_libmd_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { MD5Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { MD5Update(ctx, indata, insize); @@ -148,7 +148,7 @@ __archive_libmd_md5update(archive_md5_ctx *ctx, const } static int -__archive_libmd_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { MD5Final(md, ctx); return (ARCHIVE_OK); @@ -157,14 +157,14 @@ __archive_libmd_md5final(archive_md5_ctx *ctx, void *m #elif defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM) static int -__archive_libsystem_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { CC_MD5_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { CC_MD5_Update(ctx, indata, insize); @@ -172,7 +172,7 @@ __archive_libsystem_md5update(archive_md5_ctx *ctx, co } static int -__archive_libsystem_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { CC_MD5_Final(md, ctx); return (ARCHIVE_OK); @@ -181,7 +181,7 @@ __archive_libsystem_md5final(archive_md5_ctx *ctx, voi #elif defined(ARCHIVE_CRYPTO_MD5_MBEDTLS) static int -__archive_mbedtls_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { mbedtls_md5_init(ctx); if (mbedtls_md5_starts_ret(ctx) == 0) @@ -191,7 +191,7 @@ __archive_mbedtls_md5init(archive_md5_ctx *ctx) } static int -__archive_mbedtls_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_md5_update_ret(ctx, indata, insize) == 0) @@ -201,7 +201,7 @@ __archive_mbedtls_md5update(archive_md5_ctx *ctx, cons } static int -__archive_mbedtls_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { if (mbedtls_md5_finish_ret(ctx, md) == 0) { mbedtls_md5_free(ctx); @@ -215,14 +215,14 @@ __archive_mbedtls_md5final(archive_md5_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_MD5_NETTLE) static int -__archive_nettle_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { md5_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { md5_update(ctx, insize, indata); @@ -230,7 +230,7 @@ __archive_nettle_md5update(archive_md5_ctx *ctx, const } static int -__archive_nettle_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { md5_digest(ctx, MD5_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -239,7 +239,7 @@ __archive_nettle_md5final(archive_md5_ctx *ctx, void * #elif defined(ARCHIVE_CRYPTO_MD5_OPENSSL) static int -__archive_openssl_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -248,7 +248,7 @@ __archive_openssl_md5init(archive_md5_ctx *ctx) } static int -__archive_openssl_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -256,7 +256,7 @@ __archive_openssl_md5update(archive_md5_ctx *ctx, cons } static int -__archive_openssl_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { /* HACK: archive_write_set_format_xar.c is finalizing empty contexts, so * this is meant to cope with that. Real fix is probably to fix @@ -273,20 +273,20 @@ __archive_openssl_md5final(archive_md5_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_MD5_WIN) static int -__archive_windowsapi_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { return (win_crypto_init(ctx, CALG_MD5)); } static int -__archive_windowsapi_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { return (win_crypto_Update(ctx, indata, insize)); } static int -__archive_windowsapi_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { return (win_crypto_Final(md, 16, ctx)); } @@ -294,14 +294,14 @@ __archive_windowsapi_md5final(archive_md5_ctx *ctx, vo #else static int -__archive_stub_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -311,7 +311,7 @@ __archive_stub_md5update(archive_md5_ctx *ctx, const v } static int -__archive_stub_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -324,14 +324,14 @@ __archive_stub_md5final(archive_md5_ctx *ctx, void *md #if defined(ARCHIVE_CRYPTO_RMD160_LIBC) static int -__archive_libc_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { RMD160Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { RMD160Update(ctx, indata, insize); @@ -339,7 +339,7 @@ __archive_libc_ripemd160update(archive_rmd160_ctx *ctx } static int -__archive_libc_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { RMD160Final(md, ctx); return (ARCHIVE_OK); @@ -348,14 +348,14 @@ __archive_libc_ripemd160final(archive_rmd160_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_RMD160_LIBMD) static int -__archive_libmd_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { RIPEMD160_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { RIPEMD160_Update(ctx, indata, insize); @@ -363,7 +363,7 @@ __archive_libmd_ripemd160update(archive_rmd160_ctx *ct } static int -__archive_libmd_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { RIPEMD160_Final(md, ctx); return (ARCHIVE_OK); @@ -372,7 +372,7 @@ __archive_libmd_ripemd160final(archive_rmd160_ctx *ctx #elif defined(ARCHIVE_CRYPTO_RMD160_MBEDTLS) static int -__archive_mbedtls_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { mbedtls_ripemd160_init(ctx); if (mbedtls_ripemd160_starts_ret(ctx) == 0) @@ -382,7 +382,7 @@ __archive_mbedtls_ripemd160init(archive_rmd160_ctx *ct } static int -__archive_mbedtls_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_ripemd160_update_ret(ctx, indata, insize) == 0) @@ -392,7 +392,7 @@ __archive_mbedtls_ripemd160update(archive_rmd160_ctx * } static int -__archive_mbedtls_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { if (mbedtls_ripemd160_finish_ret(ctx, md) == 0) { mbedtls_ripemd160_free(ctx); @@ -406,14 +406,14 @@ __archive_mbedtls_ripemd160final(archive_rmd160_ctx *c #elif defined(ARCHIVE_CRYPTO_RMD160_NETTLE) static int -__archive_nettle_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { ripemd160_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { ripemd160_update(ctx, insize, indata); @@ -421,7 +421,7 @@ __archive_nettle_ripemd160update(archive_rmd160_ctx *c } static int -__archive_nettle_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { ripemd160_digest(ctx, RIPEMD160_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -430,7 +430,7 @@ __archive_nettle_ripemd160final(archive_rmd160_ctx *ct #elif defined(ARCHIVE_CRYPTO_RMD160_OPENSSL) static int -__archive_openssl_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -439,7 +439,7 @@ __archive_openssl_ripemd160init(archive_rmd160_ctx *ct } static int -__archive_openssl_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -447,7 +447,7 @@ __archive_openssl_ripemd160update(archive_rmd160_ctx * } static int -__archive_openssl_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { if (*ctx) { EVP_DigestFinal(*ctx, md, NULL); @@ -460,14 +460,14 @@ __archive_openssl_ripemd160final(archive_rmd160_ctx *c #else static int -__archive_stub_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -477,7 +477,7 @@ __archive_stub_ripemd160update(archive_rmd160_ctx *ctx } static int -__archive_stub_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -490,14 +490,14 @@ __archive_stub_ripemd160final(archive_rmd160_ctx *ctx, #if defined(ARCHIVE_CRYPTO_SHA1_LIBC) static int -__archive_libc_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { SHA1Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { SHA1Update(ctx, indata, insize); @@ -505,7 +505,7 @@ __archive_libc_sha1update(archive_sha1_ctx *ctx, const } static int -__archive_libc_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { SHA1Final(md, ctx); return (ARCHIVE_OK); @@ -514,14 +514,14 @@ __archive_libc_sha1final(archive_sha1_ctx *ctx, void * #elif defined(ARCHIVE_CRYPTO_SHA1_LIBMD) static int -__archive_libmd_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { SHA1_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { SHA1_Update(ctx, indata, insize); @@ -529,7 +529,7 @@ __archive_libmd_sha1update(archive_sha1_ctx *ctx, cons } static int -__archive_libmd_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { SHA1_Final(md, ctx); return (ARCHIVE_OK); @@ -538,14 +538,14 @@ __archive_libmd_sha1final(archive_sha1_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_SHA1_LIBSYSTEM) static int -__archive_libsystem_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { CC_SHA1_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { CC_SHA1_Update(ctx, indata, insize); @@ -553,7 +553,7 @@ __archive_libsystem_sha1update(archive_sha1_ctx *ctx, } static int -__archive_libsystem_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { CC_SHA1_Final(md, ctx); return (ARCHIVE_OK); @@ -562,7 +562,7 @@ __archive_libsystem_sha1final(archive_sha1_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS) static int -__archive_mbedtls_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { mbedtls_sha1_init(ctx); if (mbedtls_sha1_starts_ret(ctx) == 0) @@ -572,7 +572,7 @@ __archive_mbedtls_sha1init(archive_sha1_ctx *ctx) } static int -__archive_mbedtls_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_sha1_update_ret(ctx, indata, insize) == 0) @@ -582,7 +582,7 @@ __archive_mbedtls_sha1update(archive_sha1_ctx *ctx, co } static int -__archive_mbedtls_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { if (mbedtls_sha1_finish_ret(ctx, md) == 0) { mbedtls_sha1_free(ctx); @@ -596,14 +596,14 @@ __archive_mbedtls_sha1final(archive_sha1_ctx *ctx, voi #elif defined(ARCHIVE_CRYPTO_SHA1_NETTLE) static int -__archive_nettle_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { sha1_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { sha1_update(ctx, insize, indata); @@ -611,7 +611,7 @@ __archive_nettle_sha1update(archive_sha1_ctx *ctx, con } static int -__archive_nettle_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { sha1_digest(ctx, SHA1_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -620,7 +620,7 @@ __archive_nettle_sha1final(archive_sha1_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_SHA1_OPENSSL) static int -__archive_openssl_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -629,7 +629,7 @@ __archive_openssl_sha1init(archive_sha1_ctx *ctx) } static int -__archive_openssl_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -637,7 +637,7 @@ __archive_openssl_sha1update(archive_sha1_ctx *ctx, co } static int -__archive_openssl_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { /* HACK: archive_write_set_format_xar.c is finalizing empty contexts, so * this is meant to cope with that. Real fix is probably to fix @@ -654,20 +654,20 @@ __archive_openssl_sha1final(archive_sha1_ctx *ctx, voi #elif defined(ARCHIVE_CRYPTO_SHA1_WIN) static int -__archive_windowsapi_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { return (win_crypto_init(ctx, CALG_SHA1)); } static int -__archive_windowsapi_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { return (win_crypto_Update(ctx, indata, insize)); } static int -__archive_windowsapi_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { return (win_crypto_Final(md, 20, ctx)); } @@ -675,14 +675,14 @@ __archive_windowsapi_sha1final(archive_sha1_ctx *ctx, #else static int -__archive_stub_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -692,7 +692,7 @@ __archive_stub_sha1update(archive_sha1_ctx *ctx, const } static int -__archive_stub_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -705,14 +705,14 @@ __archive_stub_sha1final(archive_sha1_ctx *ctx, void * #if defined(ARCHIVE_CRYPTO_SHA256_LIBC) static int -__archive_libc_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256_Update(ctx, indata, insize); @@ -720,7 +720,7 @@ __archive_libc_sha256update(archive_sha256_ctx *ctx, c } static int -__archive_libc_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256_Final(md, ctx); return (ARCHIVE_OK); @@ -729,14 +729,14 @@ __archive_libc_sha256final(archive_sha256_ctx *ctx, vo #elif defined(ARCHIVE_CRYPTO_SHA256_LIBC2) static int -__archive_libc2_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc2_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256Update(ctx, indata, insize); @@ -744,7 +744,7 @@ __archive_libc2_sha256update(archive_sha256_ctx *ctx, } static int -__archive_libc2_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256Final(md, ctx); return (ARCHIVE_OK); @@ -753,14 +753,14 @@ __archive_libc2_sha256final(archive_sha256_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA256_LIBC3) static int -__archive_libc3_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc3_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256Update(ctx, indata, insize); @@ -768,7 +768,7 @@ __archive_libc3_sha256update(archive_sha256_ctx *ctx, } static int -__archive_libc3_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256Final(md, ctx); return (ARCHIVE_OK); @@ -777,14 +777,14 @@ __archive_libc3_sha256final(archive_sha256_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA256_LIBMD) static int -__archive_libmd_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256_Update(ctx, indata, insize); @@ -792,7 +792,7 @@ __archive_libmd_sha256update(archive_sha256_ctx *ctx, } static int -__archive_libmd_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256_Final(md, ctx); return (ARCHIVE_OK); @@ -801,14 +801,14 @@ __archive_libmd_sha256final(archive_sha256_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA256_LIBSYSTEM) static int -__archive_libsystem_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { CC_SHA256_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { CC_SHA256_Update(ctx, indata, insize); @@ -816,7 +816,7 @@ __archive_libsystem_sha256update(archive_sha256_ctx *c } static int -__archive_libsystem_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { CC_SHA256_Final(md, ctx); return (ARCHIVE_OK); @@ -825,7 +825,7 @@ __archive_libsystem_sha256final(archive_sha256_ctx *ct #elif defined(ARCHIVE_CRYPTO_SHA256_MBEDTLS) static int -__archive_mbedtls_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { mbedtls_sha256_init(ctx); if (mbedtls_sha256_starts_ret(ctx, 0) == 0) @@ -835,7 +835,7 @@ __archive_mbedtls_sha256init(archive_sha256_ctx *ctx) } static int -__archive_mbedtls_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_sha256_update_ret(ctx, indata, insize) == 0) @@ -845,7 +845,7 @@ __archive_mbedtls_sha256update(archive_sha256_ctx *ctx } static int -__archive_mbedtls_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { if (mbedtls_sha256_finish_ret(ctx, md) == 0) { mbedtls_sha256_free(ctx); @@ -859,14 +859,14 @@ __archive_mbedtls_sha256final(archive_sha256_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_SHA256_NETTLE) static int -__archive_nettle_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { sha256_init(ctx); return (ARCHIVE_OK); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 20 16:14: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 DF5292DDCFC; Wed, 20 May 2020 16:14:07 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RyVl5dhdz4Phr; Wed, 20 May 2020 16:14:07 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2E3B1EB5C; Wed, 20 May 2020 16:14:07 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KGE7LC004396; Wed, 20 May 2020 16:14:07 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KGE7T2004395; Wed, 20 May 2020 16:14:07 GMT (envelope-from mm@FreeBSD.org) Message-Id: <202005201614.04KGE7T2004395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Wed, 20 May 2020 16:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r361281 - vendor/libarchive/3.4.3 X-SVN-Group: vendor X-SVN-Commit-Author: mm X-SVN-Commit-Paths: vendor/libarchive/3.4.3 X-SVN-Commit-Revision: 361281 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, 20 May 2020 16:14:07 -0000 Author: mm Date: Wed May 20 16:14:07 2020 New Revision: 361281 URL: https://svnweb.freebsd.org/changeset/base/361281 Log: Tag vendor/libarchive/3.4.3 Added: vendor/libarchive/3.4.3/ - copied from r361280, vendor/libarchive/dist/ From owner-svn-src-all@freebsd.org Wed May 20 17:20: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 708412DF535; Wed, 20 May 2020 17:20: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 49Rzzj2TpXz4T83; Wed, 20 May 2020 17:20: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 50A361F660; Wed, 20 May 2020 17:20: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 04KHKn0o041219; Wed, 20 May 2020 17:20:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KHKmMM041217; Wed, 20 May 2020 17:20:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005201720.04KHKmMM041217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 May 2020 17:20:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361282 - 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: 361282 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, 20 May 2020 17:20:49 -0000 Author: emaste Date: Wed May 20 17:20:48 2020 New Revision: 361282 URL: https://svnweb.freebsd.org/changeset/base/361282 Log: Update GNU_DIFF knob descriptions After r317209 the WITH_/WITHOUT_GNU_DIFF knob controls only diff3; diff is always BSD diff. MFC after: 1 week Modified: head/tools/build/options/WITHOUT_GNU_DIFF head/tools/build/options/WITH_GNU_DIFF Modified: head/tools/build/options/WITHOUT_GNU_DIFF ============================================================================== --- head/tools/build/options/WITHOUT_GNU_DIFF Wed May 20 16:14:07 2020 (r361281) +++ head/tools/build/options/WITHOUT_GNU_DIFF Wed May 20 17:20:48 2020 (r361282) @@ -1,5 +1,3 @@ .\" $FreeBSD$ Set to not build GNU -.Xr diff 1 -and .Xr diff3 1 . Modified: head/tools/build/options/WITH_GNU_DIFF ============================================================================== --- head/tools/build/options/WITH_GNU_DIFF Wed May 20 16:14:07 2020 (r361281) +++ head/tools/build/options/WITH_GNU_DIFF Wed May 20 17:20:48 2020 (r361282) @@ -1,5 +1,3 @@ .\" $FreeBSD$ Build and install GNU -.Xr diff 1 -and .Xr diff3 1 . From owner-svn-src-all@freebsd.org Wed May 20 17: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 02D852DF926; Wed, 20 May 2020 17:27: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 49S07G6L4tz4Tm9; Wed, 20 May 2020 17:27:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4BBA1FAB8; Wed, 20 May 2020 17:27:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KHRMKj047000; Wed, 20 May 2020 17:27:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KHRMGw046999; Wed, 20 May 2020 17:27:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005201727.04KHRMGw046999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 May 2020 17:27:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361283 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 361283 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, 20 May 2020 17:27:23 -0000 Author: emaste Date: Wed May 20 17:27:22 2020 New Revision: 361283 URL: https://svnweb.freebsd.org/changeset/base/361283 Log: src.conf.5: regen after r361282, GNU_DIFF knob descriptions Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed May 20 17:20:48 2020 (r361282) +++ head/share/man/man5/src.conf.5 Wed May 20 17:27:22 2020 (r361283) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd May 8, 2020 +.Dd May 20, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -690,8 +690,6 @@ 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_GNU_DIFF Set to not build GNU -.Xr diff 1 -and .Xr diff3 1 . .It Va WITHOUT_GNU_GREP Set to not build GNU From owner-svn-src-all@freebsd.org Wed May 20 17:27: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 D8BC02DF9A9; Wed, 20 May 2020 17:27:54 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S07t5Sftz4V0p; Wed, 20 May 2020 17:27:54 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6D141F92E; Wed, 20 May 2020 17:27:54 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KHRs6a047063; Wed, 20 May 2020 17:27:54 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KHRsVL047061; Wed, 20 May 2020 17:27:54 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005201727.04KHRsVL047061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 20 May 2020 17:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361284 - in head/sys/amd64: include vmm X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/amd64: include vmm X-SVN-Commit-Revision: 361284 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, 20 May 2020 17:27:54 -0000 Author: cem Date: Wed May 20 17:27:54 2020 New Revision: 361284 URL: https://svnweb.freebsd.org/changeset/base/361284 Log: vmm(4): Add 12 user ABI compat after r349948 Reported by: kp Reviewed by: jhb, kp Tested by: kp Differential Revision: https://reviews.freebsd.org/D24929 Modified: head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/vmm_dev.c Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Wed May 20 17:27:22 2020 (r361283) +++ head/sys/amd64/include/vmm_dev.h Wed May 20 17:27:54 2020 (r361284) @@ -56,6 +56,13 @@ struct vm_memseg { char name[VM_MAX_SUFFIXLEN + 1]; }; +struct vm_memseg_fbsd12 { + int segid; + size_t len; + char name[64]; +}; +_Static_assert(sizeof(struct vm_memseg_fbsd12) == 80, "COMPAT_FREEBSD12 ABI"); + struct vm_register { int cpuid; int regnum; /* enum vm_reg_name */ @@ -338,8 +345,12 @@ enum { _IOW('v', IOCNUM_SUSPEND, struct vm_suspend) #define VM_REINIT \ _IO('v', IOCNUM_REINIT) +#define VM_ALLOC_MEMSEG_FBSD12 \ + _IOW('v', IOCNUM_ALLOC_MEMSEG, struct vm_memseg_fbsd12) #define VM_ALLOC_MEMSEG \ _IOW('v', IOCNUM_ALLOC_MEMSEG, struct vm_memseg) +#define VM_GET_MEMSEG_FBSD12 \ + _IOWR('v', IOCNUM_GET_MEMSEG, struct vm_memseg_fbsd12) #define VM_GET_MEMSEG \ _IOWR('v', IOCNUM_GET_MEMSEG, struct vm_memseg) #define VM_MMAP_MEMSEG \ Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Wed May 20 17:27:22 2020 (r361283) +++ head/sys/amd64/vmm/vmm_dev.c Wed May 20 17:27:54 2020 (r361284) @@ -252,7 +252,7 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flag CTASSERT(sizeof(((struct vm_memseg *)0)->name) >= VM_MAX_SUFFIXLEN + 1); static int -get_memseg(struct vmmdev_softc *sc, struct vm_memseg *mseg) +get_memseg(struct vmmdev_softc *sc, struct vm_memseg *mseg, size_t len) { struct devmem_softc *dsc; int error; @@ -269,17 +269,16 @@ get_memseg(struct vmmdev_softc *sc, struct vm_memseg * } KASSERT(dsc != NULL, ("%s: devmem segment %d not found", __func__, mseg->segid)); - error = copystr(dsc->name, mseg->name, sizeof(mseg->name), - NULL); + error = copystr(dsc->name, mseg->name, len, NULL); } else { - bzero(mseg->name, sizeof(mseg->name)); + bzero(mseg->name, len); } return (error); } static int -alloc_memseg(struct vmmdev_softc *sc, struct vm_memseg *mseg) +alloc_memseg(struct vmmdev_softc *sc, struct vm_memseg *mseg, size_t len) { char *name; int error; @@ -295,8 +294,8 @@ alloc_memseg(struct vmmdev_softc *sc, struct vm_memseg */ if (VM_MEMSEG_NAME(mseg)) { sysmem = false; - name = malloc(sizeof(mseg->name), M_VMMDEV, M_WAITOK); - error = copystr(mseg->name, name, sizeof(mseg->name), NULL); + name = malloc(len, M_VMMDEV, M_WAITOK); + error = copystr(mseg->name, name, len, NULL); if (error) goto done; } @@ -438,6 +437,9 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da case VM_MAP_PPTDEV_MMIO: case VM_BIND_PPTDEV: case VM_UNBIND_PPTDEV: +#ifdef COMPAT_FREEBSD12 + case VM_ALLOC_MEMSEG_FBSD12: +#endif case VM_ALLOC_MEMSEG: case VM_MMAP_MEMSEG: case VM_REINIT: @@ -451,6 +453,9 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da state_changed = 2; break; +#ifdef COMPAT_FREEBSD12 + case VM_GET_MEMSEG_FBSD12: +#endif case VM_GET_MEMSEG: case VM_MMAP_GETNEXT: /* @@ -633,11 +638,25 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da error = vm_mmap_memseg(sc->vm, mm->gpa, mm->segid, mm->segoff, mm->len, mm->prot, mm->flags); break; +#ifdef COMPAT_FREEBSD12 + case VM_ALLOC_MEMSEG_FBSD12: + error = alloc_memseg(sc, (struct vm_memseg *)data, + sizeof(((struct vm_memseg_fbsd12 *)0)->name)); + break; +#endif case VM_ALLOC_MEMSEG: - error = alloc_memseg(sc, (struct vm_memseg *)data); + error = alloc_memseg(sc, (struct vm_memseg *)data, + sizeof(((struct vm_memseg *)0)->name)); break; +#ifdef COMPAT_FREEBSD12 + case VM_GET_MEMSEG_FBSD12: + error = get_memseg(sc, (struct vm_memseg *)data, + sizeof(((struct vm_memseg_fbsd12 *)0)->name)); + break; +#endif case VM_GET_MEMSEG: - error = get_memseg(sc, (struct vm_memseg *)data); + error = get_memseg(sc, (struct vm_memseg *)data, + sizeof(((struct vm_memseg *)0)->name)); break; case VM_GET_REGISTER: vmreg = (struct vm_register *)data; From owner-svn-src-all@freebsd.org Wed May 20 17:33: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 29C9B2DFA43; Wed, 20 May 2020 17:33:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S0G00HC3z4VGt; Wed, 20 May 2020 17:33: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 04D721FA66; Wed, 20 May 2020 17:33: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 04KHXBkZ053017; Wed, 20 May 2020 17:33:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KHXBLF053016; Wed, 20 May 2020 17:33:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005201733.04KHXBLF053016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 20 May 2020 17:33:11 +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: r361285 - stable/12/sys/arm64/arm64 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/arm64/arm64 X-SVN-Commit-Revision: 361285 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, 20 May 2020 17:33:12 -0000 Author: markj Date: Wed May 20 17:33:11 2020 New Revision: 361285 URL: https://svnweb.freebsd.org/changeset/base/361285 Log: MFC r360690: Simplify arm64's pmap_bootstrap() a bit. Modified: stable/12/sys/arm64/arm64/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/arm64/pmap.c ============================================================================== --- stable/12/sys/arm64/arm64/pmap.c Wed May 20 17:27:54 2020 (r361284) +++ stable/12/sys/arm64/arm64/pmap.c Wed May 20 17:33:11 2020 (r361285) @@ -779,9 +779,7 @@ void pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_paddr_t kernstart, vm_size_t kernlen) { - u_int l1_slot, l2_slot; - pt_entry_t *l2; - vm_offset_t va, freemempos; + vm_offset_t freemempos; vm_offset_t dpcpu, msgbufpv; vm_paddr_t start_pa, pa, min_pa; uint64_t kern_delta; @@ -807,7 +805,7 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_ * Find the minimum physical address. physmap is sorted, * but may contain empty ranges. */ - for (i = 0; i < (physmap_idx * 2); i += 2) { + for (i = 0; i < physmap_idx * 2; i += 2) { if (physmap[i] == physmap[i + 1]) continue; if (physmap[i] <= min_pa) @@ -820,38 +818,14 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_ /* Create a direct map region early so we can use it for pa -> va */ freemempos = pmap_bootstrap_dmap(l1pt, min_pa, freemempos); - va = KERNBASE; start_pa = pa = KERNBASE - kern_delta; /* - * Read the page table to find out what is already mapped. - * This assumes we have mapped a block of memory from KERNBASE - * using a single L1 entry. + * Create the l2 tables up to VM_MAX_KERNEL_ADDRESS. We assume that the + * loader allocated the first and only l2 page table page used to map + * the kernel, preloaded files and module metadata. */ - l2 = pmap_early_page_idx(l1pt, KERNBASE, &l1_slot, &l2_slot); - - /* Sanity check the index, KERNBASE should be the first VA */ - KASSERT(l2_slot == 0, ("The L2 index is non-zero")); - - /* Find how many pages we have mapped */ - for (; l2_slot < Ln_ENTRIES; l2_slot++) { - if ((l2[l2_slot] & ATTR_DESCR_MASK) == 0) - break; - - /* Check locore used L2 blocks */ - KASSERT((l2[l2_slot] & ATTR_DESCR_MASK) == L2_BLOCK, - ("Invalid bootstrap L2 table")); - KASSERT((l2[l2_slot] & ~ATTR_MASK) == pa, - ("Incorrect PA in L2 table")); - - va += L2_SIZE; - pa += L2_SIZE; - } - - va = roundup2(va, L1_SIZE); - - /* Create the l2 tables up to VM_MAX_KERNEL_ADDRESS */ - freemempos = pmap_bootstrap_l2(l1pt, va, freemempos); + freemempos = pmap_bootstrap_l2(l1pt, KERNBASE + L1_SIZE, freemempos); /* And the l3 tables for the early devmap */ freemempos = pmap_bootstrap_l3(l1pt, VM_MAX_KERNEL_ADDRESS - (PMAP_MAPDEV_EARLY_SIZE), freemempos); From owner-svn-src-all@freebsd.org Wed May 20 17:48: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 9C4CD2F002D; Wed, 20 May 2020 17:48: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 49S0bR3lwTz4W5d; Wed, 20 May 2020 17:48: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 7C3B12000F; Wed, 20 May 2020 17:48:19 +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 04KHmJ6U059491; Wed, 20 May 2020 17:48:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KHmJ8d059489; Wed, 20 May 2020 17:48:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005201748.04KHmJ8d059489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 20 May 2020 17:48:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361286 - in head/tests/sys: fifo kern/pipe X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/tests/sys: fifo kern/pipe X-SVN-Commit-Revision: 361286 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, 20 May 2020 17:48:19 -0000 Author: markj Date: Wed May 20 17:48:18 2020 New Revision: 361286 URL: https://svnweb.freebsd.org/changeset/base/361286 Log: Avoid hard-coding pipe buffer sizes in the pipe and fifo kqueue tests. Fix some style issues in the modified tests while here. Reported by: Jenkins via lwhsu MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/fifo/fifo_kqueue.c head/tests/sys/kern/pipe/pipe_kqueue_test.c Modified: head/tests/sys/fifo/fifo_kqueue.c ============================================================================== --- head/tests/sys/fifo/fifo_kqueue.c Wed May 20 17:33:11 2020 (r361285) +++ head/tests/sys/fifo/fifo_kqueue.c Wed May 20 17:48:18 2020 (r361286) @@ -219,10 +219,14 @@ ATF_TC_BODY(fifo_kqueue__connecting_reader, tc) ATF_REQUIRE(close(p[1]) == 0); } +/* Check that EVFILT_READ behaves sensibly on a FIFO reader. */ ATF_TC_WITHOUT_HEAD(fifo_kqueue__reads); ATF_TC_BODY(fifo_kqueue__reads, tc) { - int p[2] = { -1, -1 }; + struct kevent kev[32]; + ssize_t bytes, i, n; + int kq, p[2]; + char c; ATF_REQUIRE(mkfifo("testfifo", 0600) == 0); @@ -231,39 +235,38 @@ ATF_TC_BODY(fifo_kqueue__reads, tc) ATF_REQUIRE((p[1] = open("testfifo", O_WRONLY | O_CLOEXEC | O_NONBLOCK)) >= 0); - /* Check that EVFILT_READ behaves sensibly on a FIFO reader. */ - - char c = 0; - ssize_t r; - while ((r = write(p[1], &c, 1)) == 1) { - } - ATF_REQUIRE(r < 0); + bytes = 0; + c = 0; + while ((n = write(p[1], &c, 1)) == 1) + bytes++; + ATF_REQUIRE(n < 0); ATF_REQUIRE(errno == EAGAIN || errno == EWOULDBLOCK); + ATF_REQUIRE(bytes > 1); - for (int i = 0; i < PIPE_BUF + 1; ++i) { + for (i = 0; i < bytes / 2; i++) ATF_REQUIRE(read(p[0], &c, 1) == 1); - } + bytes -= i; - int kq = kqueue(); + kq = kqueue(); ATF_REQUIRE(kq >= 0); - struct kevent kev[32]; EV_SET(&kev[0], p[0], EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, 0); ATF_REQUIRE(kevent(kq, kev, 1, NULL, 0, NULL) == 0); ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), - &(struct timespec) { 0, 0 }) == 1); + &(struct timespec){ 0, 0 }) == 1); ATF_REQUIRE(kev[0].ident == (uintptr_t)p[0]); ATF_REQUIRE(kev[0].filter == EVFILT_READ); ATF_REQUIRE(kev[0].flags == EV_CLEAR); ATF_REQUIRE(kev[0].fflags == 0); - ATF_REQUIRE(kev[0].data == 65023); + ATF_REQUIRE(kev[0].data == bytes); ATF_REQUIRE(kev[0].udata == 0); - while ((r = read(p[0], &c, 1)) == 1) { - } - ATF_REQUIRE(r < 0); + while (bytes-- > 0) + ATF_REQUIRE(read(p[0], &c, 1) == 1); + n = read(p[0], &c, 1); + ATF_REQUIRE(n < 0); ATF_REQUIRE(errno == EAGAIN || errno == EWOULDBLOCK); ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), Modified: head/tests/sys/kern/pipe/pipe_kqueue_test.c ============================================================================== --- head/tests/sys/kern/pipe/pipe_kqueue_test.c Wed May 20 17:33:11 2020 (r361285) +++ head/tests/sys/kern/pipe/pipe_kqueue_test.c Wed May 20 17:48:18 2020 (r361286) @@ -243,28 +243,30 @@ ATF_TC_BODY(pipe_kqueue__closed_read_end_register_befo ATF_TC_WITHOUT_HEAD(pipe_kqueue__closed_write_end); ATF_TC_BODY(pipe_kqueue__closed_write_end, tc) { - int p[2] = { -1, -1 }; + struct kevent kev[32]; + ssize_t bytes, n; + int kq, p[2]; + char c; ATF_REQUIRE(pipe2(p, O_CLOEXEC | O_NONBLOCK) == 0); ATF_REQUIRE(p[0] >= 0); ATF_REQUIRE(p[1] >= 0); - char c = 0; - ssize_t r; - while ((r = write(p[1], &c, 1)) == 1) { - } - ATF_REQUIRE(r < 0); + bytes = 0; + c = 0; + while ((n = write(p[1], &c, 1)) == 1) + bytes++; + ATF_REQUIRE(n < 0); ATF_REQUIRE(errno == EAGAIN || errno == EWOULDBLOCK); ATF_REQUIRE(close(p[1]) == 0); - int kq = kqueue(); + kq = kqueue(); ATF_REQUIRE(kq >= 0); - struct kevent kev[32]; - EV_SET(&kev[0], p[0], EVFILT_READ, EV_ADD | EV_CLEAR | EV_RECEIPT, /**/ + EV_SET(&kev[0], p[0], EVFILT_READ, EV_ADD | EV_CLEAR | EV_RECEIPT, 0, 0, 0); - EV_SET(&kev[1], p[0], EVFILT_WRITE, EV_ADD | EV_CLEAR | EV_RECEIPT, /**/ + EV_SET(&kev[1], p[0], EVFILT_WRITE, EV_ADD | EV_CLEAR | EV_RECEIPT, 0, 0, 0); /* @@ -284,7 +286,7 @@ ATF_TC_BODY(pipe_kqueue__closed_write_end, tc) ATF_REQUIRE(kev[0].filter == EVFILT_READ); ATF_REQUIRE(kev[0].flags == (EV_EOF | EV_CLEAR | EV_RECEIPT)); ATF_REQUIRE(kev[0].fflags == 0); - ATF_REQUIRE(kev[0].data == 65536); + ATF_REQUIRE(kev[0].data == bytes); ATF_REQUIRE(kev[0].udata == 0); ATF_REQUIRE(close(kq) == 0); @@ -294,19 +296,21 @@ ATF_TC_BODY(pipe_kqueue__closed_write_end, tc) ATF_TC_WITHOUT_HEAD(pipe_kqueue__closed_write_end_register_before_close); ATF_TC_BODY(pipe_kqueue__closed_write_end_register_before_close, tc) { - int p[2] = { -1, -1 }; + struct kevent kev[32]; + ssize_t bytes, n; + int kq, p[2]; + char c; ATF_REQUIRE(pipe2(p, O_CLOEXEC | O_NONBLOCK) == 0); ATF_REQUIRE(p[0] >= 0); ATF_REQUIRE(p[1] >= 0); - int kq = kqueue(); + kq = kqueue(); ATF_REQUIRE(kq >= 0); - struct kevent kev[32]; - EV_SET(&kev[0], p[0], EVFILT_READ, EV_ADD | EV_CLEAR | EV_RECEIPT, /**/ + EV_SET(&kev[0], p[0], EVFILT_READ, EV_ADD | EV_CLEAR | EV_RECEIPT, 0, 0, 0); - EV_SET(&kev[1], p[0], EVFILT_WRITE, EV_ADD | EV_CLEAR | EV_RECEIPT, /**/ + EV_SET(&kev[1], p[0], EVFILT_WRITE, EV_ADD | EV_CLEAR | EV_RECEIPT, 0, 0, 0); /* @@ -320,35 +324,32 @@ ATF_TC_BODY(pipe_kqueue__closed_write_end_register_bef ATF_REQUIRE((kev[1].flags & EV_ERROR) != 0); ATF_REQUIRE(kev[1].data == 0); - char c = 0; - ssize_t r; - while ((r = write(p[1], &c, 1)) == 1) { - } - ATF_REQUIRE(r < 0); + bytes = 0; + c = 0; + while ((n = write(p[1], &c, 1)) == 1) + bytes++; + ATF_REQUIRE(n < 0); ATF_REQUIRE(errno == EAGAIN || errno == EWOULDBLOCK); ATF_REQUIRE(close(p[1]) == 0); ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), - &(struct timespec) { 0, 0 }) == 2); - { - ATF_REQUIRE(kev[0].ident == (uintptr_t)p[0]); - ATF_REQUIRE(kev[0].filter == EVFILT_WRITE); - ATF_REQUIRE(kev[0].flags == - (EV_EOF | EV_CLEAR | EV_ONESHOT | EV_RECEIPT)); - ATF_REQUIRE(kev[0].fflags == 0); - ATF_REQUIRE(kev[0].data == 4096 || - kev[0].data == 512 /* on FreeBSD 11.3 */); - ATF_REQUIRE(kev[0].udata == 0); - } - { - ATF_REQUIRE(kev[1].ident == (uintptr_t)p[0]); - ATF_REQUIRE(kev[1].filter == EVFILT_READ); - ATF_REQUIRE(kev[1].flags == (EV_EOF | EV_CLEAR | EV_RECEIPT)); - ATF_REQUIRE(kev[1].fflags == 0); - ATF_REQUIRE(kev[1].data == 65536); - ATF_REQUIRE(kev[1].udata == 0); - } + &(struct timespec){ 0, 0 }) == 2); + + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[0]); + ATF_REQUIRE(kev[0].filter == EVFILT_WRITE); + ATF_REQUIRE(kev[0].flags == + (EV_EOF | EV_CLEAR | EV_ONESHOT | EV_RECEIPT)); + ATF_REQUIRE(kev[0].fflags == 0); + ATF_REQUIRE(kev[0].data > 0); + ATF_REQUIRE(kev[0].udata == 0); + + ATF_REQUIRE(kev[1].ident == (uintptr_t)p[0]); + ATF_REQUIRE(kev[1].filter == EVFILT_READ); + ATF_REQUIRE(kev[1].flags == (EV_EOF | EV_CLEAR | EV_RECEIPT)); + ATF_REQUIRE(kev[1].fflags == 0); + ATF_REQUIRE(kev[1].data == bytes); + ATF_REQUIRE(kev[1].udata == 0); ATF_REQUIRE(close(kq) == 0); ATF_REQUIRE(close(p[0]) == 0); From owner-svn-src-all@freebsd.org Wed May 20 18:29: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 7CD162F1A12; Wed, 20 May 2020 18:29:24 +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 49S1Vr2V6mz4ZZp; Wed, 20 May 2020 18:29:24 +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 4C32A205E6; Wed, 20 May 2020 18:29:24 +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 04KITOgx083938; Wed, 20 May 2020 18:29:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KITNRs083936; Wed, 20 May 2020 18:29:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005201829.04KITNRs083936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 20 May 2020 18:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361287 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 361287 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, 20 May 2020 18:29:24 -0000 Author: markj Date: Wed May 20 18:29:23 2020 New Revision: 361287 URL: https://svnweb.freebsd.org/changeset/base/361287 Log: Don't block on the range lock in zfs_getpages(). After r358443 the vnode object lock no longer synchronizes concurrent zfs_getpages() and zfs_write() (which must update vnode pages to maintain coherence). This created a potential deadlock between ZFS range locks and VM page busy locks: a fault on a mapped file will cause the fault page to be busied, after which zfs_getpages() locks a range around the file offset in order to map adjacent, resident pages; zfs_write() locks the range first, and then must busy vnode pages when synchronizing. Solve this by adding a non-blocking mode for ZFS range locks, and using it in zfs_getpages(). If zfs_getpages() fails to acquire the range lock, only the fault page will be populated. Reported by: bdrewery Reviewed by: avg Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24839 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h Wed May 20 17:48:18 2020 (r361286) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h Wed May 20 18:29:23 2020 (r361287) @@ -78,6 +78,8 @@ void rangelock_fini(rangelock_t *); locked_range_t *rangelock_enter(rangelock_t *, uint64_t, uint64_t, rangelock_type_t); +locked_range_t *rangelock_tryenter(rangelock_t *, + uint64_t, uint64_t, rangelock_type_t); void rangelock_exit(locked_range_t *); void rangelock_reduce(locked_range_t *, uint64_t, uint64_t); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c Wed May 20 17:48:18 2020 (r361286) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c Wed May 20 18:29:23 2020 (r361287) @@ -136,10 +136,11 @@ rangelock_fini(rangelock_t *rl) } /* - * Check if a write lock can be grabbed, or wait and recheck until available. + * Check if a write lock can be grabbed. If not, fail immediately or sleep and + * recheck until available, depending on the value of the "nonblock" parameter. */ -static void -rangelock_enter_writer(rangelock_t *rl, locked_range_t *new) +static boolean_t +rangelock_enter_writer(rangelock_t *rl, locked_range_t *new, boolean_t nonblock) { avl_tree_t *tree = &rl->rl_tree; locked_range_t *lr; @@ -169,7 +170,7 @@ rangelock_enter_writer(rangelock_t *rl, locked_range_t */ if (avl_numnodes(tree) == 0) { avl_add(tree, new); - return; + return (B_TRUE); } /* @@ -190,8 +191,10 @@ rangelock_enter_writer(rangelock_t *rl, locked_range_t goto wait; avl_insert(tree, new, where); - return; + return (B_TRUE); wait: + if (nonblock) + return (B_FALSE); if (!lr->lr_write_wanted) { cv_init(&lr->lr_write_cv, NULL, CV_DEFAULT, NULL); lr->lr_write_wanted = B_TRUE; @@ -373,10 +376,11 @@ rangelock_add_reader(avl_tree_t *tree, locked_range_t } /* - * Check if a reader lock can be grabbed, or wait and recheck until available. + * Check if a reader lock can be grabbed. If not, fail immediately or sleep and + * recheck until available, depending on the value of the "nonblock" parameter. */ -static void -rangelock_enter_reader(rangelock_t *rl, locked_range_t *new) +static boolean_t +rangelock_enter_reader(rangelock_t *rl, locked_range_t *new, boolean_t nonblock) { avl_tree_t *tree = &rl->rl_tree; locked_range_t *prev, *next; @@ -397,6 +401,8 @@ retry: */ if (prev && (off < prev->lr_offset + prev->lr_length)) { if ((prev->lr_type == RL_WRITER) || (prev->lr_write_wanted)) { + if (nonblock) + return (B_FALSE); if (!prev->lr_read_wanted) { cv_init(&prev->lr_read_cv, NULL, CV_DEFAULT, NULL); @@ -421,6 +427,8 @@ retry: if (off + len <= next->lr_offset) goto got_lock; if ((next->lr_type == RL_WRITER) || (next->lr_write_wanted)) { + if (nonblock) + return (B_FALSE); if (!next->lr_read_wanted) { cv_init(&next->lr_read_cv, NULL, CV_DEFAULT, NULL); @@ -439,6 +447,7 @@ got_lock: * locks and bumping ref counts (r_count). */ rangelock_add_reader(tree, new, prev, where); + return (B_TRUE); } /* @@ -448,13 +457,13 @@ got_lock: * the range lock structure for later unlocking (or reduce range if the * entire file is locked as RL_WRITER). */ -locked_range_t * -rangelock_enter(rangelock_t *rl, uint64_t off, uint64_t len, - rangelock_type_t type) +static locked_range_t * +_rangelock_enter(rangelock_t *rl, uint64_t off, uint64_t len, + rangelock_type_t type, boolean_t nonblock) { ASSERT(type == RL_READER || type == RL_WRITER || type == RL_APPEND); - locked_range_t *new = kmem_alloc(sizeof (locked_range_t), KM_SLEEP); + locked_range_t *new = kmem_alloc(sizeof (*new), KM_SLEEP); new->lr_rangelock = rl; new->lr_offset = off; if (len + off < off) /* overflow */ @@ -471,14 +480,32 @@ rangelock_enter(rangelock_t *rl, uint64_t off, uint64_ /* * First check for the usual case of no locks */ - if (avl_numnodes(&rl->rl_tree) == 0) + if (avl_numnodes(&rl->rl_tree) == 0) { avl_add(&rl->rl_tree, new); - else - rangelock_enter_reader(rl, new); - } else - rangelock_enter_writer(rl, new); /* RL_WRITER or RL_APPEND */ + } else if (!rangelock_enter_reader(rl, new, nonblock)) { + kmem_free(new, sizeof (*new)); + new = NULL; + } + } else if (!rangelock_enter_writer(rl, new, nonblock)) { + kmem_free(new, sizeof (*new)); + new = NULL; + } mutex_exit(&rl->rl_lock); return (new); +} + +locked_range_t * +rangelock_enter(rangelock_t *rl, uint64_t off, uint64_t len, + rangelock_type_t type) +{ + return (_rangelock_enter(rl, off, len, type, B_FALSE)); +} + +locked_range_t * +rangelock_tryenter(rangelock_t *rl, uint64_t off, uint64_t len, + rangelock_type_t type) +{ + return (_rangelock_enter(rl, off, len, type, B_TRUE)); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed May 20 17:48:18 2020 (r361286) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed May 20 18:29:23 2020 (r361287) @@ -4498,13 +4498,27 @@ zfs_getpages(struct vnode *vp, vm_page_t *ma, int coun end = IDX_TO_OFF(ma[count - 1]->pindex + 1); /* - * Lock a range covering all required and optional pages. - * Note that we need to handle the case of the block size growing. + * Try to lock a range covering all required and optional pages, to + * handle the case of the block size growing. It is not safe to block + * on the range lock since the owner may be waiting for the fault page + * to be unbusied. */ for (;;) { blksz = zp->z_blksz; - lr = rangelock_enter(&zp->z_rangelock, rounddown(start, blksz), + lr = rangelock_tryenter(&zp->z_rangelock, + rounddown(start, blksz), roundup(end, blksz) - rounddown(start, blksz), RL_READER); + if (lr == NULL) { + if (rahead != NULL) { + *rahead = 0; + rahead = NULL; + } + if (rbehind != NULL) { + *rbehind = 0; + rbehind = NULL; + } + break; + } if (blksz == zp->z_blksz) break; rangelock_exit(lr); @@ -4515,7 +4529,8 @@ zfs_getpages(struct vnode *vp, vm_page_t *ma, int coun obj_size = object->un_pager.vnp.vnp_size; zfs_vmobject_wunlock(object); if (IDX_TO_OFF(ma[count - 1]->pindex) >= obj_size) { - rangelock_exit(lr); + if (lr != NULL) + rangelock_exit(lr); ZFS_EXIT(zfsvfs); return (zfs_vm_pagerret_bad); } @@ -4543,7 +4558,8 @@ zfs_getpages(struct vnode *vp, vm_page_t *ma, int coun error = dmu_read_pages(os, zp->z_id, ma, count, &pgsin_b, &pgsin_a, MIN(end, obj_size) - (end - PAGE_SIZE)); - rangelock_exit(lr); + if (lr != NULL) + rangelock_exit(lr); ZFS_ACCESSTIME_STAMP(zfsvfs, zp); ZFS_EXIT(zfsvfs); From owner-svn-src-all@freebsd.org Wed May 20 18:30: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 58F8A2F1A8D; Wed, 20 May 2020 18:30:53 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) (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 49S1XX3Q9nz4Zhs; Wed, 20 May 2020 18:30:52 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qv1-xf2d.google.com with SMTP id dh1so1795698qvb.13; Wed, 20 May 2020 11:30:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=7B6GEx2BckVLGrGh8hSI9pgjmNHASJLkwvct6IsDkyc=; b=X2Nw6cufjztZMwFzUTMVIQyXJrCtG8erwJO7znNszbod7nGbMV7P2hn7WZ9hIdAkqH 7XF3VJHQP/BR2v6dCy2ioUara73JYCjeUTr+v53eeeF70kKqcrj0jZU+QsDUZCSmGrZ1 lgVXENqC6KyVU5lWxBc6TEEBNeheedF5DP6dw3nV8gm9NFioVcgErzazojYhjMo9unEE L6nHcT8ER0WGB232oFgdmBFZgeOBqIX8YbfwnvaYC11c45FP4yF/fZ7UR5eza4toVFw4 p3BVjJ5CZpiPdpRCsfiyCe71lWRdLQa/3tCClcn/J3wIzqW4qtBLGBlQxu/yy4eWecMK fI3w== 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:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=7B6GEx2BckVLGrGh8hSI9pgjmNHASJLkwvct6IsDkyc=; b=UK1FatnDTWBedJIfiXujb3Sx0kTU2JrOxXLNUfnSqvgovAyI2xJne0HfKlZ3qi0hK2 /b5GvqY+E2VlC7x/0nExuZPgQ5VkA5B5dwzE1QwLOPhRL8vtkMWmdIya1soOpZPzRWpe W1p9Y2Hw2/SC4Tc6vJGgrzn6DOlBGwp3qNzNIRnU2VNzbbX9pvdVGo94D21Ccq6ly+i1 4xI0oFY/nk6uQPU15fB8t+BRVuErGh7Upcc1BoO570kc1vZ1VbQBZXRtkX/9M2n/Vs1i GiulycBP6yq6GHi9k3L+JEF5/gzoM9UOt5HX5S4SNRPGcvV1BKUrj0cU6AsIcTOKizYm EyQQ== X-Gm-Message-State: AOAM531fKkxiiEiK1r1uO1mhk97b1IR7V04Jgu6PfQrPFIvzR1UWwZPR cuCgxwRpGv/p1JYpmSLZa2TJchJF X-Google-Smtp-Source: ABdhPJxE8DmxGuF3jAGK35cHpN/GFy26Zc+3N/jM2BvmTIkvaUnVvePbO1FXW1mcaSmPh90BMJciTA== X-Received: by 2002:ad4:5692:: with SMTP id bc18mr6115035qvb.233.1589999451111; Wed, 20 May 2020 11:30:51 -0700 (PDT) Received: from raichu (toroon0560w-lp130-15-184-144-87-103.dsl.bell.ca. [184.144.87.103]) by smtp.gmail.com with ESMTPSA id s62sm2766873qke.36.2020.05.20.11.30.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2020 11:30:50 -0700 (PDT) Sender: Mark Johnston Date: Wed, 20 May 2020 14:30:48 -0400 From: Mark Johnston To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r361287 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys Message-ID: <20200520183048.GB59386@raichu> References: <202005201829.04KITNRs083936@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202005201829.04KITNRs083936@repo.freebsd.org> X-Rspamd-Queue-Id: 49S1XX3Q9nz4Zhs X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=X2Nw6cuf; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::f2d as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-1.23 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.90)[-0.904]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-0.31)[-0.310]; RCVD_COUNT_THREE(0.00)[3]; MID_RHS_NOT_FQDN(0.50)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.31)[-0.315]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f2d:from]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[184.144.87.103: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]; RCVD_TLS_ALL(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: Wed, 20 May 2020 18:30:53 -0000 On Wed, May 20, 2020 at 06:29:23PM +0000, Mark Johnston wrote: > Author: markj > Date: Wed May 20 18:29:23 2020 > New Revision: 361287 > URL: https://svnweb.freebsd.org/changeset/base/361287 > > Log: > Don't block on the range lock in zfs_getpages(). > > After r358443 the vnode object lock no longer synchronizes concurrent > zfs_getpages() and zfs_write() (which must update vnode pages to > maintain coherence). This created a potential deadlock between ZFS > range locks and VM page busy locks: a fault on a mapped file will cause > the fault page to be busied, after which zfs_getpages() locks a range > around the file offset in order to map adjacent, resident pages; > zfs_write() locks the range first, and then must busy vnode pages when > synchronizing. > > Solve this by adding a non-blocking mode for ZFS range locks, and using > it in zfs_getpages(). If zfs_getpages() fails to acquire the range > lock, only the fault page will be populated. I will work on getting this submitted to OpenZFS. From owner-svn-src-all@freebsd.org Wed May 20 19:34: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 E69692F3038; Wed, 20 May 2020 19:34:51 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S2yM60qrz4g8j; Wed, 20 May 2020 19:34:51 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFC1621593; Wed, 20 May 2020 19:34:51 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KJYpig027873; Wed, 20 May 2020 19:34:51 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KJYmiv027858; Wed, 20 May 2020 19:34:48 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <202005201934.04KJYmiv027858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Wed, 20 May 2020 19:34:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r361288 - in vendor/NetBSD/bmake/dist: . filemon mk mk/sys unit-tests X-SVN-Group: vendor X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in vendor/NetBSD/bmake/dist: . filemon mk mk/sys unit-tests X-SVN-Commit-Revision: 361288 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, 20 May 2020 19:34:52 -0000 Author: sjg Date: Wed May 20 19:34:48 2020 New Revision: 361288 URL: https://svnweb.freebsd.org/changeset/base/361288 Log: Import bmake-20200517 Changes since 20181221 are mostly portability related hence the large gap in versions imported. There are however some bug fixes, and a rework of filemon handling. In NetBSD make/filemon/filemon_ktrace.c allows use of fktrace and elimination of filemon(4) which has not had the TLC it needs. FreeBSD filemon(4) is in much better shape, so bmake/filemon/filemon_dev.c allows use of that, with a bit less overhead than the ktrace model. Summary of changes from ChangeLog o str.c: empty string does not match % pattern plus unit-test changes o var.c: import handling of old sysV style modifier using '%' o str.c: refactor brk_string o meta.c: meta_oodate, CHECK_VALID_META is too aggressive for CMD a blank command is perfectly valid. o meta.c: meta_oodate, check for corrupted meta file earlier and more often. * meta.c: meta_compat_parent check for USE_FILEMON patch from Soeren Tempel o meta.c: fix compat mode, need to call meta_job_output() o job.c: extra fds for meta mode not needed if using filemon_dev o meta.c: avoid passing NULL to filemon_*() when meta_needed() returns FALSE. o filemon/filemon_{dev,ktrace}.c: allow selection of filemon implementation. filemon_dev.c uses the kernel module while filemon_ktrace.c leverages the fktrace api available in NetBSD. filemon_ktrace.c can hopefully form the basis for adding support for other tracing mechanisms such as strace on Linux. o meta.c: when target is out-of-date per normal make rules record value of .OODATE in meta file. o parse.c: don't pass NULL to realpath(3) some versions cannot handle it. o parse.c: ParseDoDependency: free paths rather than assert plus more unit-tests Added: vendor/NetBSD/bmake/dist/filemon/ vendor/NetBSD/bmake/dist/filemon/filemon.h (contents, props changed) vendor/NetBSD/bmake/dist/filemon/filemon_dev.c (contents, props changed) vendor/NetBSD/bmake/dist/filemon/filemon_ktrace.c (contents, props changed) vendor/NetBSD/bmake/dist/mk/compiler.mk (contents, props changed) vendor/NetBSD/bmake/dist/mk/dirdeps-targets.mk (contents, props changed) vendor/NetBSD/bmake/dist/unit-tests/Makefile (contents, props changed) vendor/NetBSD/bmake/dist/unit-tests/Makefile.config.in (contents, props changed) vendor/NetBSD/bmake/dist/unit-tests/cond-late.exp vendor/NetBSD/bmake/dist/unit-tests/cond-late.mk (contents, props changed) vendor/NetBSD/bmake/dist/unit-tests/dollar.exp vendor/NetBSD/bmake/dist/unit-tests/dollar.mk (contents, props changed) vendor/NetBSD/bmake/dist/unit-tests/include-main.exp vendor/NetBSD/bmake/dist/unit-tests/include-main.mk (contents, props changed) vendor/NetBSD/bmake/dist/unit-tests/include-sub.mk (contents, props changed) vendor/NetBSD/bmake/dist/unit-tests/include-subsub.mk (contents, props changed) vendor/NetBSD/bmake/dist/unit-tests/varmod-edge.exp vendor/NetBSD/bmake/dist/unit-tests/varmod-edge.mk (contents, props changed) Deleted: vendor/NetBSD/bmake/dist/unit-tests/Makefile.in Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/FILES vendor/NetBSD/bmake/dist/Makefile vendor/NetBSD/bmake/dist/Makefile.config.in vendor/NetBSD/bmake/dist/VERSION vendor/NetBSD/bmake/dist/arch.c vendor/NetBSD/bmake/dist/boot-strap vendor/NetBSD/bmake/dist/bsd.after-import.mk vendor/NetBSD/bmake/dist/compat.c vendor/NetBSD/bmake/dist/config.h.in vendor/NetBSD/bmake/dist/configure vendor/NetBSD/bmake/dist/configure.in vendor/NetBSD/bmake/dist/job.c vendor/NetBSD/bmake/dist/make-bootstrap.sh.in vendor/NetBSD/bmake/dist/make.1 vendor/NetBSD/bmake/dist/make.h vendor/NetBSD/bmake/dist/meta.c vendor/NetBSD/bmake/dist/meta.h vendor/NetBSD/bmake/dist/mk/ChangeLog vendor/NetBSD/bmake/dist/mk/FILES vendor/NetBSD/bmake/dist/mk/autodep.mk vendor/NetBSD/bmake/dist/mk/dirdeps.mk vendor/NetBSD/bmake/dist/mk/doc.mk vendor/NetBSD/bmake/dist/mk/dpadd.mk vendor/NetBSD/bmake/dist/mk/gendirdeps.mk vendor/NetBSD/bmake/dist/mk/init.mk vendor/NetBSD/bmake/dist/mk/install-mk vendor/NetBSD/bmake/dist/mk/lib.mk vendor/NetBSD/bmake/dist/mk/meta.stage.mk vendor/NetBSD/bmake/dist/mk/meta.sys.mk vendor/NetBSD/bmake/dist/mk/meta2deps.py vendor/NetBSD/bmake/dist/mk/options.mk vendor/NetBSD/bmake/dist/mk/sys.mk vendor/NetBSD/bmake/dist/mk/sys.vars.mk vendor/NetBSD/bmake/dist/mk/sys/AIX.mk vendor/NetBSD/bmake/dist/mk/sys/Darwin.mk vendor/NetBSD/bmake/dist/mk/sys/Generic.mk vendor/NetBSD/bmake/dist/mk/sys/HP-UX.mk vendor/NetBSD/bmake/dist/mk/sys/IRIX.mk vendor/NetBSD/bmake/dist/mk/sys/Linux.mk vendor/NetBSD/bmake/dist/mk/sys/NetBSD.mk vendor/NetBSD/bmake/dist/mk/sys/OSF1.mk vendor/NetBSD/bmake/dist/mk/sys/OpenBSD.mk vendor/NetBSD/bmake/dist/mk/sys/SunOS.mk vendor/NetBSD/bmake/dist/mk/sys/UnixWare.mk vendor/NetBSD/bmake/dist/mk/whats.mk vendor/NetBSD/bmake/dist/nonints.h vendor/NetBSD/bmake/dist/parse.c vendor/NetBSD/bmake/dist/str.c vendor/NetBSD/bmake/dist/unit-tests/escape.mk vendor/NetBSD/bmake/dist/unit-tests/forloop.exp vendor/NetBSD/bmake/dist/unit-tests/forloop.mk vendor/NetBSD/bmake/dist/unit-tests/modorder.mk vendor/NetBSD/bmake/dist/unit-tests/sysv.exp vendor/NetBSD/bmake/dist/unit-tests/sysv.mk vendor/NetBSD/bmake/dist/util.c vendor/NetBSD/bmake/dist/var.c Modified: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/ChangeLog Wed May 20 18:29:23 2020 (r361287) +++ vendor/NetBSD/bmake/dist/ChangeLog Wed May 20 19:34:48 2020 (r361288) @@ -1,3 +1,138 @@ +2020-05-17 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200517 + Merge with NetBSD make, pick up + o modified dollar tests to avoid shell dependencies + o new tests for .INCLUDEFROM + +2020-05-16 Simon J Gerraty + + * unit-tests/dollar.mk: tweak '1 dollar literal' test + to not depend so much on shell behavior + +2020-05-10 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200510 + Merge with NetBSD make, pick up + o unit test for dollar handling + +2020-05-06 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200506 + Merge with NetBSD make, pick up + o str.c: empty string does not match % pattern + plus unit-test changes + +2020-05-04 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200504 + May the 4th be with you + Merge with NetBSD make, pick up + o var.c: import handling of old sysV style modifier using '%' + o str.c: refactor brk_string + o unit-tests: add test case for lazy conditions + +2020-04-18 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200418 + + * configure.in: use_makefile=no for cygwin et al. + case insensitive filesystems just don't work if both + makefile and Makefile exist. + NOTE: bmake does not support cygwin and likely never will, + but if brave souls want to try it - help them out. + +2020-04-02 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200402 + Merge with NetBSD make, pick up + o meta.c: meta_oodate, CHECK_VALID_META is too aggressive for CMD + a blank command is perfectly valid. + +2020-03-30 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200330 + Merge with NetBSD make, pick up + o make.h: extern debug_file + +2020-03-18 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200318 + Merge with NetBSD make, pick up + o meta.c: meta_oodate, check for corrupted meta file + earlier and more often. + +2020-02-20 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200220 + +2020-02-19 Simon J Gerraty + + * boot-strap: unset MAKEFLAGS + +2020-02-12 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200212 + * meta.c: meta_compat_parent check for USE_FILEMON + patch from Soeren Tempel + +2020-02-05 Simon J Gerraty + + * VERSION: 20200205 + Merge with NetBSD make, pick up + o meta.c: fix compat mode, need to call meta_job_output() + o job.c: extra fds for meta mode not needed if using filemon_dev + +2020-01-22 Simon J Gerraty + + * VERSION: 20200122 + Merge with NetBSD make, pick up + o meta.c: avoid passing NULL to filemon_*() when meta_needed() + returns FALSE. + +2020-01-21 Simon J Gerraty + + * VERSION: 20200121 + Merge with NetBSD make, pick up + o filemon/filemon_{dev,ktrace}.c: allow selection of + filemon implementation. filemon_dev.c uses the kernel module + while filemon_ktrace.c leverages the fktrace api available in + NetBSD. filemon_ktrace.c can hopefully form the basis for + adding support for other tracing mechanisms such as strace on + Linux. + o meta.c: when target is out-of-date per normal make rules + record value of .OODATE in meta file. + +2019-09-26 Simon J Gerraty + + * VERSION: 20190926 + Merge with NetBSD make, pick up + o parse.c: don't pass NULL to realpath(3) + some versions cannot handle it. + +2019-04-09 Simon J Gerraty + + * VERSION: 20190409 + Merge with NetBSD make, pick up + o parse.c: ParseDoDependency: free paths rather than assert + +2018-12-22 Simon J Gerraty + + * VERSION: 20181222 + + * configure.in: add --without-makefile to avoid generating + makefile and make-bootstrap.sh + + * include Makefile.inc if it exists + + * Use Makefile and Makefile.config.in in unit-tests + so we can use just: make obj && make && make test + when bmake is already available. + We add --without-makefile to CONFIGURE_ARGS in this case. + + * tweak bsd.after-import.mk (captures Makefile.config etc + after import to FreeBSD for example) to cope with all the above. + 2018-12-21 Simon J Gerraty * VERSION: 20181221 Modified: vendor/NetBSD/bmake/dist/FILES ============================================================================== --- vendor/NetBSD/bmake/dist/FILES Wed May 20 18:29:23 2020 (r361287) +++ vendor/NetBSD/bmake/dist/FILES Wed May 20 19:34:48 2020 (r361288) @@ -22,6 +22,9 @@ configure.in dir.c dir.h dirname.c +filemon/filemon.h +filemon/filemon_dev.c +filemon/filemon_ktrace.c find_lib.sh for.c getopt.c @@ -94,13 +97,18 @@ suff.c targ.c trace.c trace.h -unit-tests/Makefile.in +unit-tests/Makefile +unit-tests/Makefile.config.in unit-tests/comment.exp unit-tests/comment.mk unit-tests/cond1.exp unit-tests/cond1.mk unit-tests/cond2.exp unit-tests/cond2.mk +unit-tests/cond-late.mk +unit-tests/cond-late.exp +unit-tests/dollar.exp +unit-tests/dollar.mk unit-tests/doterror.exp unit-tests/doterror.mk unit-tests/dotwait.exp @@ -123,6 +131,10 @@ unit-tests/hash.exp unit-tests/hash.mk unit-tests/impsrc.exp unit-tests/impsrc.mk +unit-tests/include-main.exp +unit-tests/include-main.mk +unit-tests/include-sub.mk +unit-tests/include-subsub.mk unit-tests/misc.exp unit-tests/misc.mk unit-tests/moderrs.exp @@ -163,6 +175,8 @@ unit-tests/varcmd.exp unit-tests/varcmd.mk unit-tests/varmisc.exp unit-tests/varmisc.mk +unit-tests/varmod-edge.exp +unit-tests/varmod-edge.mk unit-tests/varquote.exp unit-tests/varquote.mk unit-tests/varshell.exp Modified: vendor/NetBSD/bmake/dist/Makefile ============================================================================== --- vendor/NetBSD/bmake/dist/Makefile Wed May 20 18:29:23 2020 (r361287) +++ vendor/NetBSD/bmake/dist/Makefile Wed May 20 19:34:48 2020 (r361288) @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.99 2017/08/13 20:12:53 sjg Exp $ +# $Id: Makefile,v 1.104 2020/02/06 01:33:54 sjg Exp $ PROG= bmake @@ -56,6 +56,7 @@ SRCS+= \ lstSucc.c .-include "VERSION" +.-include "Makefile.inc" # this file gets generated by configure .-include "Makefile.config" @@ -77,12 +78,24 @@ CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}} COPTS.main.c+= "-DMAKE_VERSION=\"${_MAKE_VERSION}\"" -# meta mode can be useful even without filemon +# meta mode can be useful even without filemon +# should be set by now +USE_FILEMON ?= no +.if ${USE_FILEMON:tl} != "no" +.PATH: ${.CURDIR}/filemon +SRCS+= filemon_${USE_FILEMON}.c +COPTS.meta.c+= -DUSE_FILEMON -DUSE_FILEMON_${USE_FILEMON:tu} +COPTS.job.c+= ${COPTS.meta.c} + +.if ${USE_FILEMON} == "dev" FILEMON_H ?= /usr/include/dev/filemon/filemon.h .if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h" -COPTS.meta.c += -DHAVE_FILEMON_H -I${FILEMON_H:H} +COPTS.filemon_dev.c += -DHAVE_FILEMON_H -I${FILEMON_H:H} .endif +.endif # USE_FILEMON == dev +.endif # USE_FILEMON + .PATH: ${srcdir} .PATH: ${srcdir}/lst.lib @@ -198,6 +211,8 @@ main.o: ${SRCS} ${.CURDIR}/VERSION .if ${MK_AUTOCONF_MK} == "yes" CONFIGURE_DEPS += ${.CURDIR}/VERSION +# we do not need or want the generated makefile +CONFIGURE_ARGS += --without-makefile .include .endif SHARE_MK?=${SHAREDIR}/mk Modified: vendor/NetBSD/bmake/dist/Makefile.config.in ============================================================================== --- vendor/NetBSD/bmake/dist/Makefile.config.in Wed May 20 18:29:23 2020 (r361287) +++ vendor/NetBSD/bmake/dist/Makefile.config.in Wed May 20 19:34:48 2020 (r361288) @@ -14,7 +14,8 @@ CFLAGS+= ${CPPFLAGS} @DEFS@ LDFLAGS+= @LDFLAGS@ LIBOBJS+= @LIBOBJS@ LDADD+= @LIBS@ -USE_META= @use_meta@ +USE_META?= @use_meta@ +USE_FILEMON?= @use_filemon@ FILEMON_H?= @filemon_h@ BMAKE_PATH_MAX?= @bmake_path_max@ # used if MAXPATHLEN not defined Modified: vendor/NetBSD/bmake/dist/VERSION ============================================================================== --- vendor/NetBSD/bmake/dist/VERSION Wed May 20 18:29:23 2020 (r361287) +++ vendor/NetBSD/bmake/dist/VERSION Wed May 20 19:34:48 2020 (r361288) @@ -1,2 +1,2 @@ # keep this compatible with sh and make -_MAKE_VERSION=20181221 +_MAKE_VERSION=20200517 Modified: vendor/NetBSD/bmake/dist/arch.c ============================================================================== --- vendor/NetBSD/bmake/dist/arch.c Wed May 20 18:29:23 2020 (r361287) +++ vendor/NetBSD/bmake/dist/arch.c Wed May 20 19:34:48 2020 (r361288) @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $ */ +/* $NetBSD: arch.c,v 1.71 2019/10/05 23:35:57 mrg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $"; +static char rcsid[] = "$NetBSD: arch.c,v 1.71 2019/10/05 23:35:57 mrg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $"); +__RCSID("$NetBSD: arch.c,v 1.71 2019/10/05 23:35:57 mrg Exp $"); #endif #endif /* not lint */ #endif @@ -682,7 +682,7 @@ ArchStatMember(char *archive, char *member, Boolean ha arh.AR_SIZE[sizeof(arh.AR_SIZE)-1] = '\0'; size = (int)strtol(arh.AR_SIZE, NULL, 10); - (void)strncpy(memName, arh.AR_NAME, sizeof(arh.AR_NAME)); + memcpy(memName, arh.AR_NAME, sizeof(arh.AR_NAME)); for (cp = &memName[AR_MAX_NAME_LEN]; *cp == ' '; cp--) { continue; } Modified: vendor/NetBSD/bmake/dist/boot-strap ============================================================================== --- vendor/NetBSD/bmake/dist/boot-strap Wed May 20 18:29:23 2020 (r361287) +++ vendor/NetBSD/bmake/dist/boot-strap Wed May 20 19:34:48 2020 (r361288) @@ -89,6 +89,10 @@ # disable use of filemon(9) which is currently only # available for NetBSD and FreeBSD. # +# --with-filemon=ktrace +# on NetBSD or others with fktrace(2), use ktrace +# version of filemon. +# # --with-filemon="path/to/filemon.h" # enables use of filemon(9) by meta mode. # @@ -111,7 +115,7 @@ # Simon J. Gerraty # RCSid: -# $Id: boot-strap,v 1.49 2016/05/29 00:09:14 sjg Exp $ +# $Id: boot-strap,v 1.51 2020/02/19 16:46:23 sjg Exp $ # # @(#) Copyright (c) 2001 Simon J. Gerraty # @@ -161,6 +165,8 @@ cmd_args="$@" # clear some things from the environment that we care about unset MAKEOBJDIR MAKEOBJDIRPREFIX +# or that might be incompatible +unset MAKE MAKEFLAGS # --install[-host-target] will set this INSTALL_PREFIX= Modified: vendor/NetBSD/bmake/dist/bsd.after-import.mk ============================================================================== --- vendor/NetBSD/bmake/dist/bsd.after-import.mk Wed May 20 18:29:23 2020 (r361287) +++ vendor/NetBSD/bmake/dist/bsd.after-import.mk Wed May 20 19:34:48 2020 (r361288) @@ -1,4 +1,4 @@ -# $Id: bsd.after-import.mk,v 1.13 2017/08/13 00:56:10 sjg Exp $ +# $Id: bsd.after-import.mk,v 1.15 2018/12/30 17:14:24 sjg Exp $ # This makefile is for use when integrating bmake into a BSD build # system. Use this makefile after importing bmake. @@ -63,7 +63,7 @@ MAKEFILE_SED = sed -e '/^MACHINE/d' \ -e 's,${SRCTOP},$${SRCTOP},g' # These are the simple files we want to capture -configured_files= config.h Makefile.config unit-tests/Makefile +configured_files= config.h Makefile.config unit-tests/Makefile.config after-import: bootstrap ${MAKEFILE} .for f in ${configured_files:M*.[ch]} @@ -87,7 +87,6 @@ _makefile: bootstrap ${MAKEFILE} @(echo '# This is a generated file, do NOT edit!'; \ echo '# See ${_this:S,${SRCTOP}/,,}'; \ echo '#'; echo '# $$${HOST_OS}$$'; \ - echo; echo '.sinclude "Makefile.inc"'; \ echo; echo 'SRCTOP?= $${.CURDIR:${.CURDIR:S,${SRCTOP}/,,:C,[^/]+,H,g:S,/,:,g}}'; \ echo; echo '# look here first for config.h'; \ echo 'CFLAGS+= -I$${.CURDIR}'; echo; \ Modified: vendor/NetBSD/bmake/dist/compat.c ============================================================================== --- vendor/NetBSD/bmake/dist/compat.c Wed May 20 18:29:23 2020 (r361287) +++ vendor/NetBSD/bmake/dist/compat.c Wed May 20 19:34:48 2020 (r361288) @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.107 2017/07/20 19:29:54 sjg Exp $ */ +/* $NetBSD: compat.c,v 1.110 2020/01/19 19:42:32 riastradh Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: compat.c,v 1.107 2017/07/20 19:29:54 sjg Exp $"; +static char rcsid[] = "$NetBSD: compat.c,v 1.110 2020/01/19 19:42:32 riastradh Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: compat.c,v 1.107 2017/07/20 19:29:54 sjg Exp $"); +__RCSID("$NetBSD: compat.c,v 1.110 2020/01/19 19:42:32 riastradh Exp $"); #endif #endif /* not lint */ #endif @@ -407,7 +407,7 @@ again: #ifdef USE_META if (useMeta) { - meta_compat_parent(); + meta_compat_parent(cpid); } #endif Modified: vendor/NetBSD/bmake/dist/config.h.in ============================================================================== --- vendor/NetBSD/bmake/dist/config.h.in Wed May 20 18:29:23 2020 (r361287) +++ vendor/NetBSD/bmake/dist/config.h.in Wed May 20 19:34:48 2020 (r361288) @@ -143,7 +143,7 @@ /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL -/* Define to 1 if `struct stat' is a member of `st_rdev'. */ +/* Define to 1 if `st_rdev' is a member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_RDEV /* Define to 1 if your `struct stat' has `st_rdev'. Deprecated, use Modified: vendor/NetBSD/bmake/dist/configure ============================================================================== Binary file (source and/or target). No diff available. Modified: vendor/NetBSD/bmake/dist/configure.in ============================================================================== --- vendor/NetBSD/bmake/dist/configure.in Wed May 20 18:29:23 2020 (r361287) +++ vendor/NetBSD/bmake/dist/configure.in Wed May 20 19:34:48 2020 (r361288) @@ -1,11 +1,11 @@ dnl dnl RCSid: -dnl $Id: configure.in,v 1.59 2017/11/26 22:39:20 sjg Exp $ +dnl $Id: configure.in,v 1.63 2020/04/19 05:17:57 sjg Exp $ dnl dnl Process this file with autoconf to produce a configure script dnl AC_PREREQ(2.50) -AC_INIT([bmake], [20171126], [sjg@NetBSD.org]) +AC_INIT([bmake], [20200418], [sjg@NetBSD.org]) AC_CONFIG_HEADERS(config.h) dnl make srcdir absolute @@ -16,6 +16,7 @@ esac dnl get _MAKE_VERSION . $srcdir/VERSION +OS=`uname -s` dnl AC_ARG_WITH(defshell, @@ -32,6 +33,17 @@ no) ;; ;; esac]) dnl +case "$OS" in +CYGWIN*|MINGW*) use_makefile=no;; +*) use_makefile=yes;; +esac +AC_ARG_WITH(makefile, +[ --without-makefile dissable use of generated makefile], +[case "${withval}" in +yes|no) use_makefile=${withval};; +*) AC_MSG_ERROR(bad value ${withval} given for makefile) ;; +esac]) +dnl use_meta=yes AC_ARG_WITH(meta, [ --without-meta dissable use of meta-mode], @@ -41,30 +53,41 @@ yes|no) use_meta=${withval};; esac]) dnl AC_ARG_WITH(filemon, -[ --with-filemon=path/filemon.h indicate path to filemon.h for meta-mode], +[ --with-filemon={no,dev,ktrace,path/filemon.h} indicate filemon method for meta-mode. Path to filemon.h implies dev], [ case "/${withval}" in -/no|*/filemon.h) filemon_h="${withval}";; +/no) use_filemon=no;; +/*trace) filemon_h=no use_filemon="${withval}";; +*/filemon.h) filemon_h="${withval}";; */filemon*) filemon_h="${withval}/filemon.h";; *) AC_MSG_ERROR(bad value ${withval} given for filemon) ;; esac], [ -OS=`uname -s` -for d in "/usr/include/dev/filemon" "$prefix/include/dev/filemon" "$srcdir/filemon" "$srcdir/../filemon" "$srcdir/../../sys/dev/filemon" -do - for x in "/$OS" "" - do - filemon_h="$d$x/filemon.h" - test -s "$filemon_h" && break - done - test -s "$filemon_h" && break -done -test -s "${filemon_h:-/dev/null}" || filemon_h=no +case "$OS" in +NetBSD) filemon_h=no use_filemon=ktrace;; +*) + for d in "/usr/include/dev/filemon" "$prefix/include/dev/filemon" "$srcdir/../../sys/dev/filemon" + do + for x in "/$OS" "" + do + filemon_h="$d$x/filemon.h" + test -s "$filemon_h" && break + done + test -s "$filemon_h" && { use_filemon=dev; break; } + done + ;; +esac +use_filemon=${use_filemon:-no} +case "$use_filemon" in +dev) ;; +*) filemon_h=no;; +esac ]) -dnl echo "Note: use_meta=$use_meta filemon_h=$filemon_h" >&6 +dnl echo "Note: use_meta=$use_meta use_filemon=$use_filemon filemon_h=$filemon_h" >&6 case "$use_meta" in yes) - case "$filemon_h" in - *.h) echo "Using: filemon=$filemon_h" >&6;; + case "$use_filemon" in + no) ;; + *) echo "Using: filemon_${use_filemon}.c" >&6;; esac ;; esac @@ -388,10 +411,14 @@ AC_SUBST(INSTALL) AC_SUBST(GCC) AC_SUBST(diff_u) AC_SUBST(use_meta) +AC_SUBST(use_filemon) AC_SUBST(filemon_h) AC_SUBST(_MAKE_VERSION) -AC_OUTPUT(makefile Makefile.config make-bootstrap.sh unit-tests/Makefile) - +bm_outfiles="Makefile.config unit-tests/Makefile.config make-bootstrap.sh" +if test $use_makefile = yes; then + bm_outfiles="makefile $bm_outfiles" +fi +AC_OUTPUT($bm_outfiles) cat < + +struct filemon; + +const char * + filemon_path(void); + +struct filemon * + filemon_open(void); +int filemon_close(struct filemon *); + +int filemon_setfd(struct filemon *, int); +void filemon_setpid_parent(struct filemon *, pid_t); +int filemon_setpid_child(const struct filemon *, pid_t); + +int filemon_readfd(const struct filemon *); +int filemon_process(struct filemon *); + +#endif /* FILEMON_H_ */ Added: vendor/NetBSD/bmake/dist/filemon/filemon_dev.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/bmake/dist/filemon/filemon_dev.c Wed May 20 19:34:48 2020 (r361288) @@ -0,0 +1,151 @@ +/* $NetBSD: filemon_dev.c,v 1.1 2020/01/19 19:49:37 riastradh Exp $ */ + +/*- + * Copyright (c) 2020 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Taylor R. Campbell. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 "filemon.h" + +#include + +#include +#include +#include +#include + +#ifdef HAVE_FILEMON_H +# include +#endif + +#ifndef _PATH_FILEMON +#define _PATH_FILEMON "/dev/filemon" +#endif + +struct filemon { + int fd; +}; + +const char * +filemon_path(void) +{ + + return _PATH_FILEMON; +} + +struct filemon * +filemon_open(void) +{ + struct filemon *F; + unsigned i; + int error; + + /* Allocate and zero a struct filemon object. */ + F = calloc(1, sizeof(*F)); + if (F == NULL) + return NULL; + + /* Try opening /dev/filemon, up to six times (cargo cult!). */ + for (i = 0; (F->fd = open(_PATH_FILEMON, O_RDWR)) == -1; i++) { + if (i == 5) { + error = errno; + goto fail0; + } + } + + /* Success! */ + return F; + +fail0: free(F); + errno = error; + return NULL; +} + +int +filemon_setfd(struct filemon *F, int fd) +{ + + /* Point the kernel at this file descriptor. */ + if (ioctl(F->fd, FILEMON_SET_FD, &fd) == -1) + return -1; + + /* No need for it in userland any more; close it. */ + (void)close(fd); + + /* Success! */ + return 0; +} + +void +filemon_setpid_parent(struct filemon *F, pid_t pid) +{ + /* Nothing to do! */ +} + +int +filemon_setpid_child(const struct filemon *F, pid_t pid) +{ + + /* Just pass it on to the kernel. */ + return ioctl(F->fd, FILEMON_SET_PID, &pid); +} + +int +filemon_close(struct filemon *F) +{ + int error = 0; + + /* Close the filemon device fd. */ + if (close(F->fd) == -1 && error == 0) + error = errno; + + /* Free the filemon descriptor. */ + free(F); + + /* Set errno and return -1 if anything went wrong. */ + if (error) { + errno = error; + return -1; + } + + /* Success! */ + return 0; +} + +int +filemon_readfd(const struct filemon *F) +{ + + return -1; +} + +int +filemon_process(struct filemon *F) +{ + + return 0; +} Added: vendor/NetBSD/bmake/dist/filemon/filemon_ktrace.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/bmake/dist/filemon/filemon_ktrace.c Wed May 20 19:34:48 2020 (r361288) @@ -0,0 +1,878 @@ +/* $NetBSD: filemon_ktrace.c,v 1.2 2020/01/19 20:22:57 riastradh Exp $ */ + +/*- + * Copyright (c) 2019 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Taylor R. Campbell. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + */ + +#define _KERNTYPES /* register_t */ + +#include "filemon.h" + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef AT_CWD +#define AT_CWD -1 +#endif + +struct filemon; +struct filemon_key; +struct filemon_state; + +typedef struct filemon_state *filemon_syscall_t(struct filemon *, + const struct filemon_key *, const struct ktr_syscall *); + +static filemon_syscall_t filemon_sys_chdir; +static filemon_syscall_t filemon_sys_execve; +static filemon_syscall_t filemon_sys_exit; +static filemon_syscall_t filemon_sys_fork; +static filemon_syscall_t filemon_sys_link; +static filemon_syscall_t filemon_sys_open; +static filemon_syscall_t filemon_sys_openat; +static filemon_syscall_t filemon_sys_symlink; +static filemon_syscall_t filemon_sys_unlink; +static filemon_syscall_t filemon_sys_rename; + +static filemon_syscall_t *const filemon_syscalls[] = { + [SYS_chdir] = &filemon_sys_chdir, + [SYS_execve] = &filemon_sys_execve, + [SYS_exit] = &filemon_sys_exit, + [SYS_fork] = &filemon_sys_fork, + [SYS_link] = &filemon_sys_link, + [SYS_open] = &filemon_sys_open, + [SYS_openat] = &filemon_sys_openat, + [SYS_symlink] = &filemon_sys_symlink, + [SYS_unlink] = &filemon_sys_unlink, + [SYS_rename] = &filemon_sys_rename, +}; + +struct filemon { + int ktrfd; /* kernel writes ktrace events here */ + FILE *in; /* we read ktrace events from here */ + FILE *out; /* we write filemon events to here */ + rb_tree_t active; + pid_t child; + + /* I/O state machine. */ + enum { + FILEMON_START = 0, + FILEMON_HEADER, + FILEMON_PAYLOAD, + FILEMON_ERROR, + } state; + unsigned char *p; + size_t resid; + + /* I/O buffer. */ + struct ktr_header hdr; + union { + struct ktr_syscall syscall; + struct ktr_sysret sysret; + char namei[PATH_MAX]; + unsigned char buf[4096]; + } payload; +}; + +struct filemon_state { + struct filemon_key { + pid_t pid; + lwpid_t lid; + } key; + struct rb_node node; + int syscode; + void (*show)(struct filemon *, const struct filemon_state *, + const struct ktr_sysret *); + unsigned i; + unsigned npath; + char *path[/*npath*/]; +}; + +static int +compare_filemon_states(void *cookie, const void *na, const void *nb) +{ + const struct filemon_state *Sa = na; + const struct filemon_state *Sb = nb; + + if (Sa->key.pid < Sb->key.pid) + return -1; + if (Sa->key.pid > Sb->key.pid) + return +1; + if (Sa->key.lid < Sb->key.lid) + return -1; + if (Sa->key.lid > Sb->key.lid) + return +1; + return 0; +} + +static int +compare_filemon_key(void *cookie, const void *n, const void *k) +{ + const struct filemon_state *S = n; + const struct filemon_key *key = k; + + if (S->key.pid < key->pid) + return -1; + if (S->key.pid > key->pid) + return +1; + if (S->key.lid < key->lid) + return -1; + if (S->key.lid > key->lid) + return +1; + return 0; +} + +static const rb_tree_ops_t filemon_rb_ops = { + .rbto_compare_nodes = &compare_filemon_states, + .rbto_compare_key = &compare_filemon_key, + .rbto_node_offset = offsetof(struct filemon_state, node), + .rbto_context = NULL, +}; + +/* + * filemon_path() + * + * Return a pointer to a constant string denoting the `path' of + * the filemon. + */ +const char * +filemon_path(void) +{ + + return "ktrace"; +} + +/* + * filemon_open() + * + * Allocate a filemon descriptor. Returns NULL and sets errno on + * failure. + */ +struct filemon * +filemon_open(void) +{ + struct filemon *F; + int ktrpipe[2]; + int error; + + /* Allocate and zero a struct filemon object. */ + F = calloc(1, sizeof(*F)); + if (F == NULL) + return NULL; + + /* Create a pipe for ktrace events. */ + if (pipe2(ktrpipe, O_CLOEXEC|O_NONBLOCK) == -1) { + error = errno; + goto fail0; + } + + /* Create a file stream for reading the ktrace events. */ + if ((F->in = fdopen(ktrpipe[0], "r")) == NULL) { + error = errno; + goto fail1; + } + ktrpipe[0] = -1; /* claimed by fdopen */ + + /* + * Set the fd for writing ktrace events and initialize the + * rbtree. The rest can be safely initialized to zero. + */ + F->ktrfd = ktrpipe[1]; + rb_tree_init(&F->active, &filemon_rb_ops); + + /* Success! */ + return F; + +fail2: __unused + (void)fclose(F->in); +fail1: (void)close(ktrpipe[0]); + (void)close(ktrpipe[1]); +fail0: free(F); + errno = error; + return NULL; +} + +/* + * filemon_closefd(F) + * + * Internal subroutine to try to flush and close the output file. + * If F is not open for output, do nothing. Never leaves F open + * for output even on failure. Returns 0 on success; sets errno + * and return -1 on failure. + */ +static int +filemon_closefd(struct filemon *F) +{ + int error = 0; + + /* If we're not open, nothing to do. */ + if (F->out == NULL) + return 0; + + /* + * Flush it, close it, and null it unconditionally, but be + * careful to return the earliest error in errno. + */ + if (fflush(F->out) == EOF && error == 0) + error = errno; + if (fclose(F->out) == EOF && error == 0) + error = errno; + F->out = NULL; + + /* Set errno and return -1 if anything went wrong. */ + if (error) { + errno = error; + return -1; + } + + /* Success! */ + return 0; +} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 20 19:35: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 679F42F329C; Wed, 20 May 2020 19:35:39 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S2zH28Kzz3RPl; Wed, 20 May 2020 19:35:39 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C9B721512; Wed, 20 May 2020 19:35:39 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KJZdYL027973; Wed, 20 May 2020 19:35:39 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KJZdfY027972; Wed, 20 May 2020 19:35:39 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <202005201935.04KJZdfY027972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Wed, 20 May 2020 19:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r361289 - vendor/NetBSD/bmake/20200517 X-SVN-Group: vendor X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: vendor/NetBSD/bmake/20200517 X-SVN-Commit-Revision: 361289 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, 20 May 2020 19:35:39 -0000 Author: sjg Date: Wed May 20 19:35:38 2020 New Revision: 361289 URL: https://svnweb.freebsd.org/changeset/base/361289 Log: tag bmake-20200517 Added: vendor/NetBSD/bmake/20200517/ - copied from r361288, vendor/NetBSD/bmake/dist/ From owner-svn-src-all@freebsd.org Wed May 20 19:45: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 F30562F32CE; Wed, 20 May 2020 19:45: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 49S3BW6BqGz3RxV; Wed, 20 May 2020 19:45: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 CFBD821786; Wed, 20 May 2020 19:45: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 04KJjN8q033845; Wed, 20 May 2020 19:45:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KJjM0E033838; Wed, 20 May 2020 19:45:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005201945.04KJjM0E033838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 May 2020 19:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361290 - in head: . release/packages release/scripts share/mk sys/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: . release/packages release/scripts share/mk sys/conf X-SVN-Commit-Revision: 361290 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, 20 May 2020 19:45:24 -0000 Author: emaste Date: Wed May 20 19:45:22 2020 New Revision: 361290 URL: https://svnweb.freebsd.org/changeset/base/361290 Log: pkgbase: use -dev,-dbg instead of -development,-debug -development is long and awkward, and is also inconsistent with prior art from the Linux world, which uses -dev (Debian) or -devel (Red Hat). Follow the Debian convention, and similarly for debug info packages. Also remove redundant pkgbase development tag from includes. We already tag include files with package=runtime,dev; there is no need to separately tag them as dev. Discussed with: bapt Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24139 Modified: head/Makefile.inc1 head/release/packages/generate-ucl.sh head/release/scripts/mtree-to-plist.awk head/share/mk/bsd.incs.mk head/share/mk/bsd.lib.mk head/share/mk/bsd.prog.mk head/sys/conf/kmod.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed May 20 19:35:38 2020 (r361289) +++ head/Makefile.inc1 Wed May 20 19:45:22 2020 (r361290) @@ -1889,7 +1889,7 @@ create-world-package-${pkgname}: .PHONY _default_flavor= -default .if make(*package*) && exists(${KSTAGEDIR}/kernel.meta) . if ${MK_DEBUG_FILES} != "no" -_debug=-debug +_debug=-dbg . endif create-kernel-packages: .PHONY . for flavor in "" ${_debug} @@ -1923,7 +1923,7 @@ create-kernel-packages-flavor${flavor:C,^""$,${_defaul . for _kernel in ${BUILDKERNELS:[2..-1]} . if exists(${KSTAGEDIR}/kernel.${_kernel}.meta) . if ${MK_DEBUG_FILES} != "no" -_debug=-debug +_debug=-dbg . endif . for flavor in "" ${_debug} create-kernel-packages: create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel} Modified: head/release/packages/generate-ucl.sh ============================================================================== --- head/release/packages/generate-ucl.sh Wed May 20 19:35:38 2020 (r361289) +++ head/release/packages/generate-ucl.sh Wed May 20 19:45:22 2020 (r361290) @@ -61,13 +61,13 @@ main() { pkgdeps="runtime" _descr="$(make -C ${srctree}/release/packages -f Makefile.package -V ${outname}_DESCR)" ;; - *_lib32_development) - outname="${outname%%_lib32_development}" + *_lib32_dev) + outname="${outname%%_lib32_dev}" _descr="32-bit Libraries, Development Files" pkgdeps="${outname}" ;; - *_lib32_debug) - outname="${outname%%_lib32_debug}" + *_lib32_dbg) + outname="${outname%%_lib32_dbg}" _descr="32-bit Libraries, Debugging Symbols" pkgdeps="${outname}" ;; @@ -76,13 +76,13 @@ main() { _descr="32-bit Libraries" pkgdeps="${outname}" ;; - *_development) - outname="${outname%%_development}" + *_dev) + outname="${outname%%_dev}" _descr="Development Files" pkgdeps="${outname}" ;; - *_debug) - outname="${outname%%_debug}" + *_dbg) + outname="${outname%%_dbg}" _descr="Debugging Symbols" pkgdeps="${outname}" ;; Modified: head/release/scripts/mtree-to-plist.awk ============================================================================== --- head/release/scripts/mtree-to-plist.awk Wed May 20 19:35:38 2020 (r361289) +++ head/release/scripts/mtree-to-plist.awk Wed May 20 19:45:22 2020 (r361290) @@ -70,7 +70,7 @@ output=output"."_kernconf } if ($1 ~ /^\/usr\/lib\/debug\/boot/) { - output=output"-debug.plist" + output=output"-dbg.plist" } else { output=output".plist" } Modified: head/share/mk/bsd.incs.mk ============================================================================== --- head/share/mk/bsd.incs.mk Wed May 20 19:35:38 2020 (r361289) +++ head/share/mk/bsd.incs.mk Wed May 20 19:45:22 2020 (r361290) @@ -60,7 +60,7 @@ stage_includes: stage_as.${header:T} installincludes: _${group}INS_${header:T} _${group}INS_${header:T}: ${header} - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -C -o ${${group}OWN_${.ALLSRC:T}} \ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C -o ${${group}OWN_${.ALLSRC:T}} \ -g ${${group}GRP_${.ALLSRC:T}} -m ${${group}MODE_${.ALLSRC:T}} \ ${.ALLSRC} \ ${DESTDIR}${${group}DIR_${.ALLSRC:T}}/${${group}NAME_${.ALLSRC:T}} @@ -75,10 +75,10 @@ stage_includes: stage_files.${group} installincludes: _${group}INS _${group}INS: ${_${group}INCS} .if defined(${group}NAME) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ ${.ALLSRC} ${DESTDIR}${${group}DIR}/${${group}NAME} .else - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \ ${.ALLSRC} ${DESTDIR}${${group}DIR}/ .endif .endif @@ -89,7 +89,7 @@ _${group}INS: ${_${group}INCS} .if defined(INCSLINKS) && !empty(INCSLINKS) installincludes: .for s t in ${INCSLINKS} - ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${s} ${DESTDIR}${t} + ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ${s} ${DESTDIR}${t} .endfor .endif .endif # !target(installincludes) Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Wed May 20 19:35:38 2020 (r361289) +++ head/share/mk/bsd.lib.mk Wed May 20 19:45:22 2020 (r361290) @@ -316,7 +316,7 @@ ${SHLIB_NAME_FULL}: ${SOBJS} @${ECHO} building shared library ${SHLIB_NAME} @rm -f ${SHLIB_NAME} ${SHLIB_LINK} .if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) && ${MK_DEBUG_FILES} == "no" - @${INSTALL_LIBSYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${SHLIB_NAME} ${SHLIB_LINK} + @${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} \ @@ -332,7 +332,7 @@ ${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug ${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.debug \ ${SHLIB_NAME_FULL} ${.TARGET} .if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) - @${INSTALL_LIBSYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${SHLIB_NAME} ${SHLIB_LINK} + @${INSTALL_LIBSYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ${SHLIB_NAME} ${SHLIB_LINK} .endif ${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} @@ -428,11 +428,11 @@ realinstall: _libinstall .ORDER: beforeinstall _libinstall _libinstall: .if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}.a ${DESTDIR}${_LIBDIR}/ .endif .if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}_p.a ${DESTDIR}${_LIBDIR}/ .endif .if defined(SHLIB_NAME) @@ -441,15 +441,15 @@ _libinstall: ${SHLIB_NAME} ${DESTDIR}${_SHLIBDIR}/ .if ${MK_DEBUG_FILES} != "no" .if defined(DEBUGMKDIR) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},debug} -d ${DESTDIR}${DEBUGFILEDIR}/ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -d ${DESTDIR}${DEBUGFILEDIR}/ .endif - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},debug} -o ${LIBOWN} -g ${LIBGRP} -m ${DEBUGMODE} \ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -o ${LIBOWN} -g ${LIBGRP} -m ${DEBUGMODE} \ ${_INSTALLFLAGS} \ ${SHLIB_NAME}.debug ${DESTDIR}${DEBUGFILEDIR}/ .endif .if defined(SHLIB_LINK) .if commands(${SHLIB_LINK:R}.ld) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} ${SHLIB_LINK:R}.ld \ ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .for _SHLIB_LINK_LINK in ${SHLIB_LDSCRIPT_LINKS} @@ -458,14 +458,14 @@ _libinstall: .else .if ${_SHLIBDIR} == ${_LIBDIR} .if ${SHLIB_LINK:Mlib*} - ${INSTALL_RSYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} + ${INSTALL_RSYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .else ${INSTALL_RSYMLINK} ${TAG_ARGS} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \ ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .endif .else .if ${SHLIB_LINK:Mlib*} - ${INSTALL_RSYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \ + ${INSTALL_RSYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \ ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} .else ${INSTALL_RSYMLINK} ${TAG_ARGS} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \ @@ -480,7 +480,7 @@ _libinstall: .endif # SHLIB_LINK .endif # SHIB_NAME .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${_LIBDIR}/ .endif .endif # !defined(INTERNALLIB) Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Wed May 20 19:35:38 2020 (r361289) +++ head/share/mk/bsd.prog.mk Wed May 20 19:45:22 2020 (r361290) @@ -270,9 +270,9 @@ _proginstall: ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${BINDIR}/${PROGNAME} .if ${MK_DEBUG_FILES} != "no" .if defined(DEBUGMKDIR) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},debug} -d ${DESTDIR}${DEBUGFILEDIR}/ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -d ${DESTDIR}${DEBUGFILEDIR}/ .endif - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},debug} -o ${BINOWN} -g ${BINGRP} -m ${DEBUGMODE} \ + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -o ${BINOWN} -g ${BINGRP} -m ${DEBUGMODE} \ ${PROGNAME}.debug ${DESTDIR}${DEBUGFILEDIR}/${PROGNAME}.debug .endif .endif Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Wed May 20 19:35:38 2020 (r361289) +++ head/sys/conf/kmod.mk Wed May 20 19:45:22 2020 (r361290) @@ -338,7 +338,7 @@ _kmodinstall: .PHONY ${INSTALL} -T release -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${KMODDIR}/ .if defined(DEBUG_FLAGS) && !defined(INSTALL_NODEBUG) && ${MK_KERNEL_SYMBOLS} != "no" - ${INSTALL} -T debug -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ + ${INSTALL} -T dbg -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ ${_INSTALLFLAGS} ${PROG}.debug ${DESTDIR}${KERN_DEBUGDIR}${KMODDIR}/ .endif From owner-svn-src-all@freebsd.org Wed May 20 19:51: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 95FD42F38B2; Wed, 20 May 2020 19:51:40 +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 49S3Km3XwCz3RtH; Wed, 20 May 2020 19:51:40 +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 74F4621651; Wed, 20 May 2020 19:51:40 +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 04KJpekP038660; Wed, 20 May 2020 19:51:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KJpeYw038659; Wed, 20 May 2020 19:51:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005201951.04KJpeYw038659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 20 May 2020 19:51:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361291 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 361291 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, 20 May 2020 19:51:40 -0000 Author: jhb Date: Wed May 20 19:51:39 2020 New Revision: 361291 URL: https://svnweb.freebsd.org/changeset/base/361291 Log: Merge freebsd32_exec_setregs() into exec_setregs() on MIPS. The stack pointer was being decremented by 64k twice previously. Reviewed by: brooks Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24930 Modified: head/sys/mips/mips/freebsd32_machdep.c head/sys/mips/mips/pm_machdep.c Modified: head/sys/mips/mips/freebsd32_machdep.c ============================================================================== --- head/sys/mips/mips/freebsd32_machdep.c Wed May 20 19:45:22 2020 (r361290) +++ head/sys/mips/mips/freebsd32_machdep.c Wed May 20 19:51:39 2020 (r361291) @@ -68,8 +68,6 @@ #include #include -static void freebsd32_exec_setregs(struct thread *, struct image_params *, - uintptr_t); static int get_mcontext32(struct thread *, mcontext32_t *, int); static int set_mcontext32(struct thread *, mcontext32_t *); static void freebsd32_sendsig(sig_t, ksiginfo_t *, sigset_t *); @@ -97,7 +95,7 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_stackprot = VM_PROT_ALL, .sv_copyout_auxargs = __elfN(freebsd_copyout_auxargs), .sv_copyout_strings = freebsd32_copyout_strings, - .sv_setregs = freebsd32_exec_setregs, + .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_FREEBSD | SV_ILP32, @@ -125,26 +123,6 @@ static Elf32_Brandinfo freebsd_brand_info = { SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t) elf32_insert_brand_entry, &freebsd_brand_info); - -static void -freebsd32_exec_setregs(struct thread *td, struct image_params *imgp, - uintptr_t stack) -{ - exec_setregs(td, imgp, stack); - - /* - * See comment in exec_setregs about running 32-bit binaries with 64-bit - * registers. - */ - td->td_frame->sp -= 65536; - - /* - * Clear extended address space bit for userland. - */ - td->td_frame->sr &= ~MIPS_SR_UX; - - td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE32; -} int set_regs32(struct thread *td, struct reg32 *regs) Modified: head/sys/mips/mips/pm_machdep.c ============================================================================== --- head/sys/mips/mips/pm_machdep.c Wed May 20 19:45:22 2020 (r361290) +++ head/sys/mips/mips/pm_machdep.c Wed May 20 19:51:39 2020 (r361291) @@ -441,11 +441,14 @@ exec_setregs(struct thread *td, struct image_params *i td->td_frame->t9 = imgp->entry_addr & ~3; /* abicall req */ td->td_frame->sr = MIPS_SR_KSU_USER | MIPS_SR_EXL | MIPS_SR_INT_IE | (mips_rd_status() & MIPS_SR_INT_MASK); -#if defined(__mips_n32) +#if defined(__mips_n32) || defined(__mips_n64) td->td_frame->sr |= MIPS_SR_PX; -#elif defined(__mips_n64) - td->td_frame->sr |= MIPS_SR_PX | MIPS_SR_UX | MIPS_SR_KX; #endif +#if defined(__mips_n64) + if (SV_PROC_FLAG(td->td_proc, SV_LP64)) + td->td_frame->sr |= MIPS_SR_UX; + td->td_frame->sr |= MIPS_SR_KX; +#endif /* * FREEBSD_DEVELOPERS_FIXME: * Setup any other CPU-Specific registers (Not MIPS Standard) @@ -470,7 +473,12 @@ exec_setregs(struct thread *td, struct image_params *i PCPU_SET(fpcurthread, (struct thread *)0); td->td_md.md_ss_addr = 0; - td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE; +#ifdef COMPAT_FREEBSD32 + if (!SV_PROC_FLAG(td->td_proc, SV_LP64)) + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE32; + else +#endif + td->td_md.md_tls_tcb_offset = TLS_TP_OFFSET + TLS_TCB_SIZE; } int From owner-svn-src-all@freebsd.org Wed May 20 20:24: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 312472F3EAC; Wed, 20 May 2020 20:24:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S43p0RY9z3TlH; Wed, 20 May 2020 20:24:38 +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 0A1EE21D1F; Wed, 20 May 2020 20:24:38 +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 04KKObg8058318; Wed, 20 May 2020 20:24:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KKObst058317; Wed, 20 May 2020 20:24:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005202024.04KKObst058317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 May 2020 20:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361292 - head/share/vt/keymaps X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/vt/keymaps X-SVN-Commit-Revision: 361292 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, 20 May 2020 20:24:38 -0000 Author: emaste Date: Wed May 20 20:24:37 2020 New Revision: 361292 URL: https://svnweb.freebsd.org/changeset/base/361292 Log: vt: fix duplicate keymap descriptions PR: 246495 Submitted by: Jorge Maidana MFC after: 1 week Modified: head/share/vt/keymaps/INDEX.keymaps Modified: head/share/vt/keymaps/INDEX.keymaps ============================================================================== --- head/share/vt/keymaps/INDEX.keymaps Wed May 20 19:51:39 2020 (r361291) +++ head/share/vt/keymaps/INDEX.keymaps Wed May 20 20:24:37 2020 (r361292) @@ -309,10 +309,10 @@ kz.kst.kbd:da:Kasakhisk kz.kst.kbd:de:Kasachisch kz.kst.kbd:fr:Kazakh -kz.io.kbd:en:Kazakh -kz.io.kbd:da:Kasakhisk -kz.io.kbd:de:Kasachisch -kz.io.kbd:fr:Kazakh +kz.io.kbd:en:Kazakh (with IO) +kz.io.kbd:da:Kasakhisk (IO) +kz.io.kbd:de:Kasachisch (mit IO) +kz.io.kbd:fr:Kazakh (avec IO) latinamerican.kbd:en:Latin American latinamerican.kbd:da:Latinamerikansk @@ -412,19 +412,19 @@ es.dvorak.kbd:fr:Espagnol Dvorak es.dvorak.kbd:pt:Espanhol Dvorak es.dvorak.kbd:es:Español Dvorak +es.kbd:en:Spanish +es.kbd:da:Spansk +es.kbd:de:Spanisch +es.kbd:fr:Espagnol +es.kbd:pt:Espanhol +es.kbd:es:Español + es.acc.kbd:en:Spanish (accent keys) es.acc.kbd:da:Spansk (accenttaster) es.acc.kbd:de:Spanisch (accent keys) es.acc.kbd:fr:Espagnol (avec accents) es.acc.kbd:pt:Espanhol (com acentos) es.acc.kbd:es:Español (con acentos) - -es.kbd:en:Spanish (accent keys) -es.kbd:da:Spansk (accenttaster) -es.kbd:de:Spanisch (accent keys) -es.kbd:fr:Espagnol (avec accents) -es.kbd:pt:Espanhol (com acentos) -es.kbd:es:Español (con acentos) si.kbd:en:Slovenian si.kbd:da:Slovensk From owner-svn-src-all@freebsd.org Wed May 20 20:39: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 E81A12F47DE; Wed, 20 May 2020 20:39:57 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49S4PT4Sw5z3VyD; Wed, 20 May 2020 20:39:57 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 005265C0135; Wed, 20 May 2020 16:39:57 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 20 May 2020 16:39:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm3; bh=H LxZM9aM8SuxFZ2BW5a1dD66jreA0jF8MVS7cb5D0CU=; b=Y+NtOQxfOFKkBZA/l xSY4RLxgNMO+NUSnaJcAIFcVmknYmEnhVuWYbnsDP6/Y6X8BVG/4tZ1J2YF8ePNX OVP32zPTSgg+M7apDZJjphGCE43opMGmWmwqRMIAfAqyNhs8FrwB8XQjl4O62Nxq Z5DdHLY0a3k+HV6nCn0508WJFlY6cFMfRtQ89sbHxw5Z1JwiF/1hTLIxKGHnvGrc cq1o4IZA/X7xAaUgtLVbZqNHGNiRAnKAZiiMuklriOgQ3eH72S4QQuvSGlYO1LtL L9ArDhmgKN3N2XUUl6YK9WWN52e93b60ApU1XmdhM131lIG3PvsHecNZ6eFqEgoH CV2lg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=HLxZM9aM8SuxFZ2BW5a1dD66jreA0jF8MVS7cb5D0 CU=; b=VED8ar7quHU0C8yup0coMxkB8ImFA5G9hQ/qxZ1oxmkmL8+tdWBQPwNr7 zhpdEQP4WNtpAmwl/gKT2Ckh7d17tFYMuaiuzmGuWcWMFnsyBSDXvsDXTIUzM46H a78x3Miqma53qnh27BKQeTQESTODlGUnYVVNj94mcsliKm4esXznKrMN9XENaFXI PUxRNKeAiMfV7pKrfLZMBVHcQqz7vzQhS8khVvC0xSSDkm8h9NSN0VaYSoVsO1uQ VdUAKBFsDli4MAavFZrsE7EiTccJPFbr5KwSNqueHIfDwRcFVUw0KNAvErhLEYBR jINuYvmDKP7rbmUoiKkyWN6CAg3yg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedruddtledgudehtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurheptggguffhjgffgffkfhfvofesth hqmhdthhdtjeenucfhrhhomhepufgtohhtthcunfhonhhguceoshgtohhtthhlsehsrghm shgtohdrohhrgheqnecuggftrfgrthhtvghrnhepudduveekheehiedukeekleelvedufe evfeetudfgtdffteffleehheffueffgfehnecuffhomhgrihhnpehfrhgvvggsshgurdho rhhgnecukfhppeekrdegiedrkeelrddvudefnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepshgtohhtthhlsehsrghmshgtohdrohhrgh X-ME-Proxy: Received: from [192.168.0.206] (unknown [8.46.89.213]) by mail.messagingengine.com (Postfix) with ESMTPA id 7DAA8306645E; Wed, 20 May 2020 16:39:56 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r361284 - in head/sys/amd64: include vmm From: Scott Long In-Reply-To: <202005201727.04KHRsVL047061@repo.freebsd.org> Date: Wed, 20 May 2020 14:39:55 -0600 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <0790972B-65C1-4C88-A4F2-FEFE656F2E66@samsco.org> References: <202005201727.04KHRsVL047061@repo.freebsd.org> To: "Conrad E. Meyer" X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 49S4PT4Sw5z3VyD 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:11403, ipnet:66.111.4.0/24, 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: Wed, 20 May 2020 20:39:58 -0000 There=E2=80=99s a better way to do this. People have been wanting = larger names to be merged into 12.x and 11.x, and that was going to be hard with how I originally did this. Your compat shim doesn=E2=80=99t make it any = easier. What I was going to do was return the ioctl in HEAD to the original size, and = create a new ioctl for the larger size, That would fix the compatibility issue = (since we don=E2=80=99t support a newer userland on an older kernel) and make it possible to = merge to -stable branches. I=E2=80=99d like to revert this commit and go in = that direction. Scott > On May 20, 2020, at 11:27 AM, Conrad Meyer wrote: >=20 > Author: cem > Date: Wed May 20 17:27:54 2020 > New Revision: 361284 > URL: https://svnweb.freebsd.org/changeset/base/361284 >=20 > Log: > vmm(4): Add 12 user ABI compat after r349948 >=20 > Reported by: kp > Reviewed by: jhb, kp > Tested by: kp > Differential Revision: https://reviews.freebsd.org/D24929 >=20 > Modified: > head/sys/amd64/include/vmm_dev.h > head/sys/amd64/vmm/vmm_dev.c From owner-svn-src-all@freebsd.org Wed May 20 20:50: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 E92302F4BD3; Wed, 20 May 2020 20:50:12 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49S4dH5krVz3WhW; Wed, 20 May 2020 20:50:11 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id E86173C0199; Wed, 20 May 2020 20:50:04 +0000 (UTC) Date: Wed, 20 May 2020 20:50:04 +0000 From: Brooks Davis To: Brooks Davis Cc: Kyle Evans , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r360833 - head Message-ID: <20200520205004.GA83149@spindle.one-eyed-alien.net> References: <202005090201.04921Tpf028388@repo.freebsd.org> <20200511181027.GA60902@spindle.one-eyed-alien.net> <20200512221603.GB60902@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l" Content-Disposition: inline In-Reply-To: <20200512221603.GB60902@spindle.one-eyed-alien.net> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 49S4dH5krVz3WhW X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [-0.30 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.06)[-0.062]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.60)[0.595]; RCPT_COUNT_FIVE(0.00)[5]; TO_DN_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.07)[0.069]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_ZERO(0.00)[0]; R_SPF_NA(0.00)[no SPF record]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 May 2020 20:50:13 -0000 --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 12, 2020 at 10:16:03PM +0000, Brooks Davis wrote: > On Mon, May 11, 2020 at 01:45:14PM -0500, Kyle Evans wrote: > > On Mon, May 11, 2020 at 1:10 PM Brooks Davis wrote: > > > > > > On Sat, May 09, 2020 at 02:01:29AM +0000, Kyle Evans wrote: > > > > Author: kevans > > > > Date: Sat May 9 02:01:29 2020 > > > > New Revision: 360833 > > > > URL: https://svnweb.freebsd.org/changeset/base/360833 > > > > > > > > Log: > > > > installworld: attempt a certctl rehash at the tail end > > > > > > > > This can be run as root or normal user with no problem; if they h= adn't > > > > twisted the WITHOUT_CAROOT knob, we'll attempt to use the host ce= rtctl to > > > > rehash the DESTDIR. This would allow one to build systems WITHOUT= _OPENSSL + > > > > WITH_CAROOT with a populated /etc/ssl that they can then use with= an > > > > appropriate *ssl from somewhere else. > > > > > > > > Cross-builds are fine because this will always use the host certc= tl, or just > > > > nag if it's missing and it wasn't a WITHOUT_CAROOT build. > > > > > > > > MFC after: 1 week > > > > Differential Revision: https://reviews.freebsd.org/D24641 > > > > > > > > Modified: > > > > head/Makefile.inc1 > > > > > > > > Modified: head/Makefile.inc1 > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > > > > --- head/Makefile.inc1 Sat May 9 01:48:08 2020 (r360= 832) > > > > +++ head/Makefile.inc1 Sat May 9 02:01:29 2020 (r360= 833) > > > > @@ -1403,6 +1403,16 @@ distributeworld installworld stageworld: _in= stallcheck > > > > ${DESTDIR}/${DISTDIR}/${dist}.debug.meta > > > > .endfor > > > > .endif > > > > +.elif make(installworld) && ${MK_CAROOT} !=3D "no" > > > > + # We could make certctl a bootstrap tool, but it requires Ope= nSSL and > > > > + # friends, which we likely don't want. We'll rehash on a bes= t-effort > > > > + # basis, otherwise we'll just mention that we're not doing it= to raise > > > > + # awareness. > > > > + @if which certctl>/dev/null; then \ > > > > + certctl rehash \ > > > > > > Does this update METALOG with the added links? > > > > > > It seems a little weird to rely on DESTDIR from the environment. > > > > > > In general I'm not enthusiastic about additions to installworld that = do > > > anything other than copying files, creating links, etc in simple ways. > >=20 > > I will happily back this out if I can get some qualified eyes to > > review/improve it. It does not update METALOG, and it probably should. > > Agreed on DESTDIR. As for point #3, I guess we can continue spreading > > `certctl rehash` all over the tree in various points that may need it; > > the release(7) scripts will need to be done if we don't do it here at > > a minimum, and I haven't put much thought into it beyond that. >=20 > I'm not in a rush to back this out given that it's solving a real > problem, but lets talk about improvements. >=20 > I kind of feel like this belongs in distribution (which I think would > deal with release scripts) or in etcupdate/mergemaster, but I'm not > sure either of those are correct. I'd be happy to review changes to > update the METALOG (I guess we'd extend certctl with an option to do > that?) I think that's the most important things because we really > should be routinely validating that DESTDIR only contains things in the > METALOG. A quick and dirty fix for the DESTDIR weirdness might be adding > "env DESTDIR=3D${DESTDIR}" so it's explicit. I did discover that this is causing me a minor hassle downstream in CheriBSD. Our crossbuild tool (cheribuild) checks for files not in the METALOG and prompts to ask if they should be included when run interactively. This means all my disk image builds now stall unless I remember to wait until I'm past that stage. Without addressing the question of which stage (if any) the certctl rehash should take place in, I have a potential fix for the failure to handle METALOG files in https://reviews.freebsd.org/D24932. It needs some documentation updates before it can land, but I think it's complete. -- Brooks --XsQoSWH+UP9D9v3l Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJexZf8AAoJEKzQXbSebgfArJ8H/3pFKvS6OAhW4TTlhW7kMg9/ iqKBiTdwuXo54xWANz/Sgk6JTwZnPs4o3Ftb17CGRKm/OQ5TPR4NttGTYx2mzjUM XvmvqtuIPlDOnv8xPhrPREoB7pJunXDtK+7K/TKfGtoVQXOSXbaIFHH3d8QDySDd tAg3Rmz10gFVd461vYXUvt2zDi9n2jOYftTcv4qeeGDVH5FeBSMDfzbXzSpHJzUO mBHGWZD06i+Iw7HBHSfzQLCljD3N99qCmLu0YuT+sftF6BE+JrEizSyk7gyq6xnp QdRs+BQVa70UmuRbUdfnBpeH23yfOIEYmG+l8HMv04cdub4DUT/6JR1wtlGPeDY= =Zua5 -----END PGP SIGNATURE----- --XsQoSWH+UP9D9v3l-- From owner-svn-src-all@freebsd.org Wed May 20 20:58: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 C56BC2F5112; Wed, 20 May 2020 20:58:18 +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 49S4pf4srvz3XQ3; Wed, 20 May 2020 20:58:18 +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 8823722262; Wed, 20 May 2020 20:58:18 +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 04KKwIve077036; Wed, 20 May 2020 20:58:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KKwIqW077034; Wed, 20 May 2020 20:58:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005202058.04KKwIqW077034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 20 May 2020 20:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361293 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 361293 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, 20 May 2020 20:58:18 -0000 Author: jhb Date: Wed May 20 20:58:17 2020 New Revision: 361293 URL: https://svnweb.freebsd.org/changeset/base/361293 Log: Remove copyinfrom() and copyinstrfrom(). These functions were added in 2001 and are currently unused. copyinfrom() looks to have never been used. copyinstrfrom() was used for two weeks before the code was refactored to remove it's sole use. Reviewed by: brooks, kib Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24928 Modified: head/sys/kern/subr_uio.c head/sys/sys/uio.h Modified: head/sys/kern/subr_uio.c ============================================================================== --- head/sys/kern/subr_uio.c Wed May 20 20:24:37 2020 (r361292) +++ head/sys/kern/subr_uio.c Wed May 20 20:58:17 2020 (r361293) @@ -346,44 +346,6 @@ again: } int -copyinfrom(const void * __restrict src, void * __restrict dst, size_t len, - int seg) -{ - int error = 0; - - switch (seg) { - case UIO_USERSPACE: - error = copyin(src, dst, len); - break; - case UIO_SYSSPACE: - bcopy(src, dst, len); - break; - default: - panic("copyinfrom: bad seg %d\n", seg); - } - return (error); -} - -int -copyinstrfrom(const void * __restrict src, void * __restrict dst, size_t len, - size_t * __restrict copied, int seg) -{ - int error = 0; - - switch (seg) { - case UIO_USERSPACE: - error = copyinstr(src, dst, len, copied); - break; - case UIO_SYSSPACE: - error = copystr(src, dst, len, copied); - break; - default: - panic("copyinstrfrom: bad seg %d\n", seg); - } - return (error); -} - -int copyiniov(const struct iovec *iovp, u_int iovcnt, struct iovec **iov, int error) { u_int iovlen; Modified: head/sys/sys/uio.h ============================================================================== --- head/sys/sys/uio.h Wed May 20 20:24:37 2020 (r361292) +++ head/sys/sys/uio.h Wed May 20 20:58:17 2020 (r361293) @@ -80,12 +80,8 @@ struct vm_page; struct bus_dma_segment; struct uio *cloneuio(struct uio *uiop); -int copyinfrom(const void * __restrict src, void * __restrict dst, - size_t len, int seg); int copyiniov(const struct iovec *iovp, u_int iovcnt, struct iovec **iov, int error); -int copyinstrfrom(const void * __restrict src, void * __restrict dst, - size_t len, size_t * __restrict copied, int seg); int copyinuio(const struct iovec *iovp, u_int iovcnt, struct uio **uiop); int copyout_map(struct thread *td, vm_offset_t *addr, size_t sz); int copyout_unmap(struct thread *td, vm_offset_t addr, size_t sz); From owner-svn-src-all@freebsd.org Wed May 20 20:58: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 6AEB62F528B; Wed, 20 May 2020 20:58:49 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S4qF2VBnz3Xkq; Wed, 20 May 2020 20:58:49 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5071922396; Wed, 20 May 2020 20:58:49 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KKwnfc077109; Wed, 20 May 2020 20:58:49 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KKwmMP077102; Wed, 20 May 2020 20:58:48 GMT (envelope-from mm@FreeBSD.org) Message-Id: <202005202058.04KKwmMP077102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Wed, 20 May 2020 20:58:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361294 - in head: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar lib/libarchive/tests usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in head: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar lib/libarchive/tests usr.bin/bsdcat usr.bin/cpio usr.bin/tar X-SVN-Commit-Revision: 361294 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, 20 May 2020 20:58:49 -0000 Author: mm Date: Wed May 20 20:58:48 2020 New Revision: 361294 URL: https://svnweb.freebsd.org/changeset/base/361294 Log: MFV r361280: Update libarchive to 3.4.3 Relevant vendor changes: PR #1352: support negative zstd compression levels PR #1359: improve zstd version checking PR #1348: support RHT.security.selinux from GNU tar PR #1357: support for archives compressed with pzstd PR #1367: fix issues in acl tests PR #1372: child handling cleanup PR #1378: fix memory leak from passphrase callback Added: head/contrib/libarchive/libarchive/test/test_compat_zstd_2.tar.zst.uu - copied unchanged from r361280, vendor/libarchive/dist/libarchive/test/test_compat_zstd_2.tar.zst.uu head/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.c - copied unchanged from r361280, vendor/libarchive/dist/libarchive/test/test_read_pax_xattr_rht_security_selinux.c head/contrib/libarchive/libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu - copied unchanged from r361280, vendor/libarchive/dist/libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu head/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.c - copied unchanged from r361280, vendor/libarchive/dist/libarchive/test/test_read_pax_xattr_schily.c head/contrib/libarchive/libarchive/test/test_read_pax_xattr_schily.tar.uu - copied unchanged from r361280, vendor/libarchive/dist/libarchive/test/test_read_pax_xattr_schily.tar.uu Deleted: head/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.c head/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.tar.uu Modified: head/contrib/libarchive/NEWS head/contrib/libarchive/README.md head/contrib/libarchive/libarchive/archive.h head/contrib/libarchive/libarchive/archive_digest.c head/contrib/libarchive/libarchive/archive_entry.c head/contrib/libarchive/libarchive/archive_entry.h head/contrib/libarchive/libarchive/archive_entry_stat.3 head/contrib/libarchive/libarchive/archive_read_add_passphrase.c head/contrib/libarchive/libarchive/archive_read_disk_posix.c head/contrib/libarchive/libarchive/archive_read_support_filter_program.c head/contrib/libarchive/libarchive/archive_read_support_filter_zstd.c head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/libarchive/archive_write_add_filter_program.c head/contrib/libarchive/libarchive/archive_write_add_filter_zstd.c head/contrib/libarchive/libarchive/archive_write_set_options.3 head/contrib/libarchive/libarchive/filter_fork.h head/contrib/libarchive/libarchive/filter_fork_posix.c head/contrib/libarchive/libarchive/test/test_acl_platform_nfs4.c head/contrib/libarchive/libarchive/test/test_acl_platform_posix1e.c head/contrib/libarchive/libarchive/test/test_compat_zstd.c head/contrib/libarchive/libarchive/test/test_write_filter_zstd.c head/contrib/libarchive/tar/bsdtar.1 head/lib/libarchive/tests/Makefile head/usr.bin/bsdcat/Makefile head/usr.bin/cpio/Makefile head/usr.bin/tar/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/NEWS ============================================================================== --- head/contrib/libarchive/NEWS Wed May 20 20:58:17 2020 (r361293) +++ head/contrib/libarchive/NEWS Wed May 20 20:58:48 2020 (r361294) @@ -1,3 +1,9 @@ +May 20, 2020: libarchive 3.4.3 released + +Apr 30, 2020: Support for pzstd compressed files + +Apr 16, 2020: Support for RHT.security.selinux tar extended attribute + Feb 11, 2020: libarchive 3.4.2 released Jan 23, 2020: Important fixes for writing XAR archives Modified: head/contrib/libarchive/README.md ============================================================================== --- head/contrib/libarchive/README.md Wed May 20 20:58:17 2020 (r361293) +++ head/contrib/libarchive/README.md Wed May 20 20:58:48 2020 (r361294) @@ -70,7 +70,7 @@ know about any errors or omissions you find. ## Supported Formats -Currently, the library automatically detects and reads the following fomats: +Currently, the library automatically detects and reads the following formats: * Old V7 tar archives * POSIX ustar * GNU tar format (including GNU long filenames, long link names, and sparse files) Modified: head/contrib/libarchive/libarchive/archive.h ============================================================================== --- head/contrib/libarchive/libarchive/archive.h Wed May 20 20:58:17 2020 (r361293) +++ head/contrib/libarchive/libarchive/archive.h Wed May 20 20:58:48 2020 (r361294) @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3004002 +#define ARCHIVE_VERSION_NUMBER 3004003 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.4.2" +#define ARCHIVE_VERSION_ONLY_STRING "3.4.3" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); Modified: head/contrib/libarchive/libarchive/archive_digest.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_digest.c Wed May 20 20:58:17 2020 (r361293) +++ head/contrib/libarchive/libarchive/archive_digest.c Wed May 20 20:58:48 2020 (r361294) @@ -109,14 +109,14 @@ win_crypto_Final(unsigned char *buf, size_t bufsize, D #if defined(ARCHIVE_CRYPTO_MD5_LIBC) static int -__archive_libc_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { MD5Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { MD5Update(ctx, indata, insize); @@ -124,7 +124,7 @@ __archive_libc_md5update(archive_md5_ctx *ctx, const v } static int -__archive_libc_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { MD5Final(md, ctx); return (ARCHIVE_OK); @@ -133,14 +133,14 @@ __archive_libc_md5final(archive_md5_ctx *ctx, void *md #elif defined(ARCHIVE_CRYPTO_MD5_LIBMD) static int -__archive_libmd_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { MD5Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { MD5Update(ctx, indata, insize); @@ -148,7 +148,7 @@ __archive_libmd_md5update(archive_md5_ctx *ctx, const } static int -__archive_libmd_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { MD5Final(md, ctx); return (ARCHIVE_OK); @@ -157,14 +157,14 @@ __archive_libmd_md5final(archive_md5_ctx *ctx, void *m #elif defined(ARCHIVE_CRYPTO_MD5_LIBSYSTEM) static int -__archive_libsystem_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { CC_MD5_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { CC_MD5_Update(ctx, indata, insize); @@ -172,7 +172,7 @@ __archive_libsystem_md5update(archive_md5_ctx *ctx, co } static int -__archive_libsystem_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { CC_MD5_Final(md, ctx); return (ARCHIVE_OK); @@ -181,7 +181,7 @@ __archive_libsystem_md5final(archive_md5_ctx *ctx, voi #elif defined(ARCHIVE_CRYPTO_MD5_MBEDTLS) static int -__archive_mbedtls_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { mbedtls_md5_init(ctx); if (mbedtls_md5_starts_ret(ctx) == 0) @@ -191,7 +191,7 @@ __archive_mbedtls_md5init(archive_md5_ctx *ctx) } static int -__archive_mbedtls_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_md5_update_ret(ctx, indata, insize) == 0) @@ -201,7 +201,7 @@ __archive_mbedtls_md5update(archive_md5_ctx *ctx, cons } static int -__archive_mbedtls_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { if (mbedtls_md5_finish_ret(ctx, md) == 0) { mbedtls_md5_free(ctx); @@ -215,14 +215,14 @@ __archive_mbedtls_md5final(archive_md5_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_MD5_NETTLE) static int -__archive_nettle_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { md5_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { md5_update(ctx, insize, indata); @@ -230,7 +230,7 @@ __archive_nettle_md5update(archive_md5_ctx *ctx, const } static int -__archive_nettle_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { md5_digest(ctx, MD5_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -239,7 +239,7 @@ __archive_nettle_md5final(archive_md5_ctx *ctx, void * #elif defined(ARCHIVE_CRYPTO_MD5_OPENSSL) static int -__archive_openssl_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -248,7 +248,7 @@ __archive_openssl_md5init(archive_md5_ctx *ctx) } static int -__archive_openssl_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -256,7 +256,7 @@ __archive_openssl_md5update(archive_md5_ctx *ctx, cons } static int -__archive_openssl_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { /* HACK: archive_write_set_format_xar.c is finalizing empty contexts, so * this is meant to cope with that. Real fix is probably to fix @@ -273,20 +273,20 @@ __archive_openssl_md5final(archive_md5_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_MD5_WIN) static int -__archive_windowsapi_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { return (win_crypto_init(ctx, CALG_MD5)); } static int -__archive_windowsapi_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { return (win_crypto_Update(ctx, indata, insize)); } static int -__archive_windowsapi_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { return (win_crypto_Final(md, 16, ctx)); } @@ -294,14 +294,14 @@ __archive_windowsapi_md5final(archive_md5_ctx *ctx, vo #else static int -__archive_stub_md5init(archive_md5_ctx *ctx) +__archive_md5init(archive_md5_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_md5update(archive_md5_ctx *ctx, const void *indata, +__archive_md5update(archive_md5_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -311,7 +311,7 @@ __archive_stub_md5update(archive_md5_ctx *ctx, const v } static int -__archive_stub_md5final(archive_md5_ctx *ctx, void *md) +__archive_md5final(archive_md5_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -324,14 +324,14 @@ __archive_stub_md5final(archive_md5_ctx *ctx, void *md #if defined(ARCHIVE_CRYPTO_RMD160_LIBC) static int -__archive_libc_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { RMD160Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { RMD160Update(ctx, indata, insize); @@ -339,7 +339,7 @@ __archive_libc_ripemd160update(archive_rmd160_ctx *ctx } static int -__archive_libc_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { RMD160Final(md, ctx); return (ARCHIVE_OK); @@ -348,14 +348,14 @@ __archive_libc_ripemd160final(archive_rmd160_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_RMD160_LIBMD) static int -__archive_libmd_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { RIPEMD160_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { RIPEMD160_Update(ctx, indata, insize); @@ -363,7 +363,7 @@ __archive_libmd_ripemd160update(archive_rmd160_ctx *ct } static int -__archive_libmd_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { RIPEMD160_Final(md, ctx); return (ARCHIVE_OK); @@ -372,7 +372,7 @@ __archive_libmd_ripemd160final(archive_rmd160_ctx *ctx #elif defined(ARCHIVE_CRYPTO_RMD160_MBEDTLS) static int -__archive_mbedtls_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { mbedtls_ripemd160_init(ctx); if (mbedtls_ripemd160_starts_ret(ctx) == 0) @@ -382,7 +382,7 @@ __archive_mbedtls_ripemd160init(archive_rmd160_ctx *ct } static int -__archive_mbedtls_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_ripemd160_update_ret(ctx, indata, insize) == 0) @@ -392,7 +392,7 @@ __archive_mbedtls_ripemd160update(archive_rmd160_ctx * } static int -__archive_mbedtls_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { if (mbedtls_ripemd160_finish_ret(ctx, md) == 0) { mbedtls_ripemd160_free(ctx); @@ -406,14 +406,14 @@ __archive_mbedtls_ripemd160final(archive_rmd160_ctx *c #elif defined(ARCHIVE_CRYPTO_RMD160_NETTLE) static int -__archive_nettle_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { ripemd160_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { ripemd160_update(ctx, insize, indata); @@ -421,7 +421,7 @@ __archive_nettle_ripemd160update(archive_rmd160_ctx *c } static int -__archive_nettle_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { ripemd160_digest(ctx, RIPEMD160_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -430,7 +430,7 @@ __archive_nettle_ripemd160final(archive_rmd160_ctx *ct #elif defined(ARCHIVE_CRYPTO_RMD160_OPENSSL) static int -__archive_openssl_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -439,7 +439,7 @@ __archive_openssl_ripemd160init(archive_rmd160_ctx *ct } static int -__archive_openssl_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -447,7 +447,7 @@ __archive_openssl_ripemd160update(archive_rmd160_ctx * } static int -__archive_openssl_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { if (*ctx) { EVP_DigestFinal(*ctx, md, NULL); @@ -460,14 +460,14 @@ __archive_openssl_ripemd160final(archive_rmd160_ctx *c #else static int -__archive_stub_ripemd160init(archive_rmd160_ctx *ctx) +__archive_ripemd160init(archive_rmd160_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, +__archive_ripemd160update(archive_rmd160_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -477,7 +477,7 @@ __archive_stub_ripemd160update(archive_rmd160_ctx *ctx } static int -__archive_stub_ripemd160final(archive_rmd160_ctx *ctx, void *md) +__archive_ripemd160final(archive_rmd160_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -490,14 +490,14 @@ __archive_stub_ripemd160final(archive_rmd160_ctx *ctx, #if defined(ARCHIVE_CRYPTO_SHA1_LIBC) static int -__archive_libc_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { SHA1Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { SHA1Update(ctx, indata, insize); @@ -505,7 +505,7 @@ __archive_libc_sha1update(archive_sha1_ctx *ctx, const } static int -__archive_libc_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { SHA1Final(md, ctx); return (ARCHIVE_OK); @@ -514,14 +514,14 @@ __archive_libc_sha1final(archive_sha1_ctx *ctx, void * #elif defined(ARCHIVE_CRYPTO_SHA1_LIBMD) static int -__archive_libmd_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { SHA1_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { SHA1_Update(ctx, indata, insize); @@ -529,7 +529,7 @@ __archive_libmd_sha1update(archive_sha1_ctx *ctx, cons } static int -__archive_libmd_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { SHA1_Final(md, ctx); return (ARCHIVE_OK); @@ -538,14 +538,14 @@ __archive_libmd_sha1final(archive_sha1_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_SHA1_LIBSYSTEM) static int -__archive_libsystem_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { CC_SHA1_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { CC_SHA1_Update(ctx, indata, insize); @@ -553,7 +553,7 @@ __archive_libsystem_sha1update(archive_sha1_ctx *ctx, } static int -__archive_libsystem_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { CC_SHA1_Final(md, ctx); return (ARCHIVE_OK); @@ -562,7 +562,7 @@ __archive_libsystem_sha1final(archive_sha1_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA1_MBEDTLS) static int -__archive_mbedtls_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { mbedtls_sha1_init(ctx); if (mbedtls_sha1_starts_ret(ctx) == 0) @@ -572,7 +572,7 @@ __archive_mbedtls_sha1init(archive_sha1_ctx *ctx) } static int -__archive_mbedtls_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_sha1_update_ret(ctx, indata, insize) == 0) @@ -582,7 +582,7 @@ __archive_mbedtls_sha1update(archive_sha1_ctx *ctx, co } static int -__archive_mbedtls_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { if (mbedtls_sha1_finish_ret(ctx, md) == 0) { mbedtls_sha1_free(ctx); @@ -596,14 +596,14 @@ __archive_mbedtls_sha1final(archive_sha1_ctx *ctx, voi #elif defined(ARCHIVE_CRYPTO_SHA1_NETTLE) static int -__archive_nettle_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { sha1_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { sha1_update(ctx, insize, indata); @@ -611,7 +611,7 @@ __archive_nettle_sha1update(archive_sha1_ctx *ctx, con } static int -__archive_nettle_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { sha1_digest(ctx, SHA1_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -620,7 +620,7 @@ __archive_nettle_sha1final(archive_sha1_ctx *ctx, void #elif defined(ARCHIVE_CRYPTO_SHA1_OPENSSL) static int -__archive_openssl_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -629,7 +629,7 @@ __archive_openssl_sha1init(archive_sha1_ctx *ctx) } static int -__archive_openssl_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -637,7 +637,7 @@ __archive_openssl_sha1update(archive_sha1_ctx *ctx, co } static int -__archive_openssl_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { /* HACK: archive_write_set_format_xar.c is finalizing empty contexts, so * this is meant to cope with that. Real fix is probably to fix @@ -654,20 +654,20 @@ __archive_openssl_sha1final(archive_sha1_ctx *ctx, voi #elif defined(ARCHIVE_CRYPTO_SHA1_WIN) static int -__archive_windowsapi_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { return (win_crypto_init(ctx, CALG_SHA1)); } static int -__archive_windowsapi_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { return (win_crypto_Update(ctx, indata, insize)); } static int -__archive_windowsapi_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { return (win_crypto_Final(md, 20, ctx)); } @@ -675,14 +675,14 @@ __archive_windowsapi_sha1final(archive_sha1_ctx *ctx, #else static int -__archive_stub_sha1init(archive_sha1_ctx *ctx) +__archive_sha1init(archive_sha1_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_sha1update(archive_sha1_ctx *ctx, const void *indata, +__archive_sha1update(archive_sha1_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -692,7 +692,7 @@ __archive_stub_sha1update(archive_sha1_ctx *ctx, const } static int -__archive_stub_sha1final(archive_sha1_ctx *ctx, void *md) +__archive_sha1final(archive_sha1_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -705,14 +705,14 @@ __archive_stub_sha1final(archive_sha1_ctx *ctx, void * #if defined(ARCHIVE_CRYPTO_SHA256_LIBC) static int -__archive_libc_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256_Update(ctx, indata, insize); @@ -720,7 +720,7 @@ __archive_libc_sha256update(archive_sha256_ctx *ctx, c } static int -__archive_libc_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256_Final(md, ctx); return (ARCHIVE_OK); @@ -729,14 +729,14 @@ __archive_libc_sha256final(archive_sha256_ctx *ctx, vo #elif defined(ARCHIVE_CRYPTO_SHA256_LIBC2) static int -__archive_libc2_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc2_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256Update(ctx, indata, insize); @@ -744,7 +744,7 @@ __archive_libc2_sha256update(archive_sha256_ctx *ctx, } static int -__archive_libc2_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256Final(md, ctx); return (ARCHIVE_OK); @@ -753,14 +753,14 @@ __archive_libc2_sha256final(archive_sha256_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA256_LIBC3) static int -__archive_libc3_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc3_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256Update(ctx, indata, insize); @@ -768,7 +768,7 @@ __archive_libc3_sha256update(archive_sha256_ctx *ctx, } static int -__archive_libc3_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256Final(md, ctx); return (ARCHIVE_OK); @@ -777,14 +777,14 @@ __archive_libc3_sha256final(archive_sha256_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA256_LIBMD) static int -__archive_libmd_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { SHA256_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libmd_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { SHA256_Update(ctx, indata, insize); @@ -792,7 +792,7 @@ __archive_libmd_sha256update(archive_sha256_ctx *ctx, } static int -__archive_libmd_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { SHA256_Final(md, ctx); return (ARCHIVE_OK); @@ -801,14 +801,14 @@ __archive_libmd_sha256final(archive_sha256_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA256_LIBSYSTEM) static int -__archive_libsystem_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { CC_SHA256_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { CC_SHA256_Update(ctx, indata, insize); @@ -816,7 +816,7 @@ __archive_libsystem_sha256update(archive_sha256_ctx *c } static int -__archive_libsystem_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { CC_SHA256_Final(md, ctx); return (ARCHIVE_OK); @@ -825,7 +825,7 @@ __archive_libsystem_sha256final(archive_sha256_ctx *ct #elif defined(ARCHIVE_CRYPTO_SHA256_MBEDTLS) static int -__archive_mbedtls_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { mbedtls_sha256_init(ctx); if (mbedtls_sha256_starts_ret(ctx, 0) == 0) @@ -835,7 +835,7 @@ __archive_mbedtls_sha256init(archive_sha256_ctx *ctx) } static int -__archive_mbedtls_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { if (mbedtls_sha256_update_ret(ctx, indata, insize) == 0) @@ -845,7 +845,7 @@ __archive_mbedtls_sha256update(archive_sha256_ctx *ctx } static int -__archive_mbedtls_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { if (mbedtls_sha256_finish_ret(ctx, md) == 0) { mbedtls_sha256_free(ctx); @@ -859,14 +859,14 @@ __archive_mbedtls_sha256final(archive_sha256_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_SHA256_NETTLE) static int -__archive_nettle_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { sha256_init(ctx); return (ARCHIVE_OK); } static int -__archive_nettle_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { sha256_update(ctx, insize, indata); @@ -874,7 +874,7 @@ __archive_nettle_sha256update(archive_sha256_ctx *ctx, } static int -__archive_nettle_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { sha256_digest(ctx, SHA256_DIGEST_SIZE, md); return (ARCHIVE_OK); @@ -883,7 +883,7 @@ __archive_nettle_sha256final(archive_sha256_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_SHA256_OPENSSL) static int -__archive_openssl_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { if ((*ctx = EVP_MD_CTX_new()) == NULL) return (ARCHIVE_FAILED); @@ -892,7 +892,7 @@ __archive_openssl_sha256init(archive_sha256_ctx *ctx) } static int -__archive_openssl_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { EVP_DigestUpdate(*ctx, indata, insize); @@ -900,7 +900,7 @@ __archive_openssl_sha256update(archive_sha256_ctx *ctx } static int -__archive_openssl_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { if (*ctx) { EVP_DigestFinal(*ctx, md, NULL); @@ -913,20 +913,20 @@ __archive_openssl_sha256final(archive_sha256_ctx *ctx, #elif defined(ARCHIVE_CRYPTO_SHA256_WIN) static int -__archive_windowsapi_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { return (win_crypto_init(ctx, CALG_SHA_256)); } static int -__archive_windowsapi_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { return (win_crypto_Update(ctx, indata, insize)); } static int -__archive_windowsapi_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { return (win_crypto_Final(md, 32, ctx)); } @@ -934,14 +934,14 @@ __archive_windowsapi_sha256final(archive_sha256_ctx *c #else static int -__archive_stub_sha256init(archive_sha256_ctx *ctx) +__archive_sha256init(archive_sha256_ctx *ctx) { (void)ctx; /* UNUSED */ return (ARCHIVE_FAILED); } static int -__archive_stub_sha256update(archive_sha256_ctx *ctx, const void *indata, +__archive_sha256update(archive_sha256_ctx *ctx, const void *indata, size_t insize) { (void)ctx; /* UNUSED */ @@ -951,7 +951,7 @@ __archive_stub_sha256update(archive_sha256_ctx *ctx, c } static int -__archive_stub_sha256final(archive_sha256_ctx *ctx, void *md) +__archive_sha256final(archive_sha256_ctx *ctx, void *md) { (void)ctx; /* UNUSED */ (void)md; /* UNUSED */ @@ -964,14 +964,14 @@ __archive_stub_sha256final(archive_sha256_ctx *ctx, vo #if defined(ARCHIVE_CRYPTO_SHA384_LIBC) static int -__archive_libc_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { SHA384_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { SHA384_Update(ctx, indata, insize); @@ -979,7 +979,7 @@ __archive_libc_sha384update(archive_sha384_ctx *ctx, c } static int -__archive_libc_sha384final(archive_sha384_ctx *ctx, void *md) +__archive_sha384final(archive_sha384_ctx *ctx, void *md) { SHA384_Final(md, ctx); return (ARCHIVE_OK); @@ -988,14 +988,14 @@ __archive_libc_sha384final(archive_sha384_ctx *ctx, vo #elif defined(ARCHIVE_CRYPTO_SHA384_LIBC2) static int -__archive_libc2_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { SHA384Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc2_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { SHA384Update(ctx, indata, insize); @@ -1003,7 +1003,7 @@ __archive_libc2_sha384update(archive_sha384_ctx *ctx, } static int -__archive_libc2_sha384final(archive_sha384_ctx *ctx, void *md) +__archive_sha384final(archive_sha384_ctx *ctx, void *md) { SHA384Final(md, ctx); return (ARCHIVE_OK); @@ -1012,14 +1012,14 @@ __archive_libc2_sha384final(archive_sha384_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA384_LIBC3) static int -__archive_libc3_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { SHA384Init(ctx); return (ARCHIVE_OK); } static int -__archive_libc3_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { SHA384Update(ctx, indata, insize); @@ -1027,7 +1027,7 @@ __archive_libc3_sha384update(archive_sha384_ctx *ctx, } static int -__archive_libc3_sha384final(archive_sha384_ctx *ctx, void *md) +__archive_sha384final(archive_sha384_ctx *ctx, void *md) { SHA384Final(md, ctx); return (ARCHIVE_OK); @@ -1036,14 +1036,14 @@ __archive_libc3_sha384final(archive_sha384_ctx *ctx, v #elif defined(ARCHIVE_CRYPTO_SHA384_LIBSYSTEM) static int -__archive_libsystem_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { CC_SHA384_Init(ctx); return (ARCHIVE_OK); } static int -__archive_libsystem_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { CC_SHA384_Update(ctx, indata, insize); @@ -1051,7 +1051,7 @@ __archive_libsystem_sha384update(archive_sha384_ctx *c } static int -__archive_libsystem_sha384final(archive_sha384_ctx *ctx, void *md) +__archive_sha384final(archive_sha384_ctx *ctx, void *md) { CC_SHA384_Final(md, ctx); return (ARCHIVE_OK); @@ -1060,7 +1060,7 @@ __archive_libsystem_sha384final(archive_sha384_ctx *ct #elif defined(ARCHIVE_CRYPTO_SHA384_MBEDTLS) static int -__archive_mbedtls_sha384init(archive_sha384_ctx *ctx) +__archive_sha384init(archive_sha384_ctx *ctx) { mbedtls_sha512_init(ctx); if (mbedtls_sha512_starts_ret(ctx, 1) == 0) @@ -1070,7 +1070,7 @@ __archive_mbedtls_sha384init(archive_sha384_ctx *ctx) } static int -__archive_mbedtls_sha384update(archive_sha384_ctx *ctx, const void *indata, +__archive_sha384update(archive_sha384_ctx *ctx, const void *indata, size_t insize) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 20 21:02:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 10B8A2F513E; Wed, 20 May 2020 21:02:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S4v46l7Sz3Xwy; Wed, 20 May 2020 21:02:08 +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 E23FA225D3; Wed, 20 May 2020 21:02:08 +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 04KL28LG082693; Wed, 20 May 2020 21:02:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KL28th082692; Wed, 20 May 2020 21:02:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005202102.04KL28th082692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 20 May 2020 21:02:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361295 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 361295 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, 20 May 2020 21:02:09 -0000 Author: kevans Date: Wed May 20 21:02:08 2020 New Revision: 361295 URL: https://svnweb.freebsd.org/changeset/base/361295 Log: loader: fix userboot's ability to detect a guest's interpreter Some time after r338418, I believe with -Os/-Oz -ffunction-sections -fdata-sections, the bootprog_interp variable that held our "$Interpreter:" marker started getting strip from all loaders, with exception to userboot since it used bootprog_interp to determine what flavor of userboot it was. At some point, it had been brought to my attention that this was no longer working and I had worked up some potential solutions to use the variable that involved printing it out. My vague recollection is that this was rejected, and I forgot to explore the alternatives; I cannot find records of this discussion anymore. Fast forward to present day, Andrew reported that it was non-functional and offered (effectively) this patch (sans comment) to stop the compiler from optimizing it out by assigning it to a volatile variable. This removes concerns about user-facing change while retaining the interpreter marker. Furthermore, it could certainly be uglier. Reported and tested by: Andrew Gierth MFC after: 3 days Modified: head/stand/common/interp.c Modified: head/stand/common/interp.c ============================================================================== --- head/stand/common/interp.c Wed May 20 20:58:48 2020 (r361294) +++ head/stand/common/interp.c Wed May 20 21:02:08 2020 (r361295) @@ -45,8 +45,17 @@ __FBSDID("$FreeBSD$"); void interact(void) { - static char input[256]; /* big enough? */ + static char input[256]; /* big enough? */ + const char * volatile interp_identifier; + /* + * Because interp_identifier is volatile, it cannot be optimized out by + * the compiler as it's considered an externally observable event. This + * prevents the compiler from optimizing out our carefully placed + * $Interpreter:4th string that userboot may use to determine that + * we need to switch interpreters. + */ + interp_identifier = bootprog_interp; interp_init(); printf("\n"); From owner-svn-src-all@freebsd.org Wed May 20 21:15: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 DB7D62F5628; Wed, 20 May 2020 21:15:44 +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 49S5Bm5W3Dz3Yrw; Wed, 20 May 2020 21:15:44 +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 B7EFC2263E; Wed, 20 May 2020 21:15:44 +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 04KLFiBo089583; Wed, 20 May 2020 21:15:44 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KLFiig089580; Wed, 20 May 2020 21:15:44 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005202115.04KLFiig089580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 20 May 2020 21:15:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361296 - in head/sys/mips: include mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/mips: include mips X-SVN-Commit-Revision: 361296 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, 20 May 2020 21:15:44 -0000 Author: jhb Date: Wed May 20 21:15:43 2020 New Revision: 361296 URL: https://svnweb.freebsd.org/changeset/base/361296 Log: Simplify hot-patching cpu_switch() for lack of UserLocal register. Rather than walking all of cpu_switch looking for the sequence of instructions to patch, add a global label at the location that needs the patch applied. Reviewed by: brooks, Alfredo Mazzinghi Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24931 Modified: head/sys/mips/include/md_var.h head/sys/mips/mips/cpu.c head/sys/mips/mips/swtch.S Modified: head/sys/mips/include/md_var.h ============================================================================== --- head/sys/mips/include/md_var.h Wed May 20 21:02:08 2020 (r361295) +++ head/sys/mips/include/md_var.h Wed May 20 21:15:43 2020 (r361296) @@ -75,6 +75,7 @@ void mips_cpu_init(void); void mips_pcpu0_init(void); void mips_proc0_init(void); void mips_postboot_fixup(void); +void cpu_switch_set_userlocal(void) __asm(__STRING(cpu_switch_set_userlocal)); extern int busdma_swi_pending; void busdma_swi(void); Modified: head/sys/mips/mips/cpu.c ============================================================================== --- head/sys/mips/mips/cpu.c Wed May 20 21:02:08 2020 (r361295) +++ head/sys/mips/mips/cpu.c Wed May 20 21:15:43 2020 (r361296) @@ -68,44 +68,6 @@ struct mips_cpuinfo cpuinfo; #define _ENCODE_INSN(a,b,c,d,e) \ ((uint32_t)(((a) << 26)|((b) << 21)|((c) << 16)|((d) << 11)|(e))) -#if defined(__mips_n64) - -# define _LOAD_T0_MDTLS_A1 \ - _ENCODE_INSN(OP_LD, A1, T0, 0, offsetof(struct thread, td_md.md_tls)) - -# define _LOAD_T0_MDTLS_TCV_OFFSET_A1 \ - _ENCODE_INSN(OP_LD, A1, T1, 0, \ - offsetof(struct thread, td_md.md_tls_tcb_offset)) - -# define _ADDU_V0_T0_T1 \ - _ENCODE_INSN(0, T0, T1, V0, OP_DADDU) - -#else /* mips 32 */ - -# define _LOAD_T0_MDTLS_A1 \ - _ENCODE_INSN(OP_LW, A1, T0, 0, offsetof(struct thread, td_md.md_tls)) - -# define _LOAD_T0_MDTLS_TCV_OFFSET_A1 \ - _ENCODE_INSN(OP_LW, A1, T1, 0, \ - offsetof(struct thread, td_md.md_tls_tcb_offset)) - -# define _ADDU_V0_T0_T1 \ - _ENCODE_INSN(0, T0, T1, V0, OP_ADDU) - -#endif /* ! __mips_n64 */ - -#if defined(__mips_n64) || defined(__mips_n32) - -# define _MTC0_V0_USERLOCAL \ - _ENCODE_INSN(OP_COP0, OP_DMT, V0, 4, 2) - -#else /* mips o32 */ - -# define _MTC0_V0_USERLOCAL \ - _ENCODE_INSN(OP_COP0, OP_MT, V0, 4, 2) - -#endif /* ! (__mips_n64 || __mipsn32) */ - #define _JR_RA _ENCODE_INSN(OP_SPECIAL, RA, 0, 0, OP_JR) #define _NOP 0 @@ -120,18 +82,9 @@ remove_userlocal_code(uint32_t *cpu_switch_code) { uint32_t *instructp; - for (instructp = cpu_switch_code;; instructp++) { - if (instructp[0] == _JR_RA) - panic("%s: Unable to patch cpu_switch().", __func__); - if (instructp[0] == _LOAD_T0_MDTLS_A1 && - instructp[1] == _LOAD_T0_MDTLS_TCV_OFFSET_A1 && - instructp[2] == _ADDU_V0_T0_T1 && - instructp[3] == _MTC0_V0_USERLOCAL) { - instructp[0] = _JR_RA; - instructp[1] = _NOP; - break; - } - } + instructp = cpu_switch_code; + instructp[0] = _JR_RA; + instructp[1] = _NOP; } /* @@ -202,7 +155,7 @@ mips_get_identity(struct mips_cpuinfo *cpuinfo) * cpu_switch() and remove unsupported code. */ cpuinfo->userlocal_reg = false; - remove_userlocal_code((uint32_t *)cpu_switch); + remove_userlocal_code((uint32_t *)cpu_switch_set_userlocal); } Modified: head/sys/mips/mips/swtch.S ============================================================================== --- head/sys/mips/mips/swtch.S Wed May 20 21:02:08 2020 (r361295) +++ head/sys/mips/mips/swtch.S Wed May 20 21:15:43 2020 (r361296) @@ -383,6 +383,8 @@ sw2: * Note that this code is removed if the CPU doesn't support ULRI by * remove_userlocal_code() in cpu.c. */ + .globl cpu_switch_set_userlocal +cpu_switch_set_userlocal: PTR_L t0, TD_MDTLS(a1) # Get TLS pointer PTR_L t1, TD_MDTLS_TCB_OFFSET(a1) # Get TLS/TCB offset PTR_ADDU v0, t0, t1 From owner-svn-src-all@freebsd.org Wed May 20 21:16: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 588392F55E1; Wed, 20 May 2020 21:16:56 +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 49S5D81mjxz3Yt5; Wed, 20 May 2020 21:16:56 +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 380FB22903; Wed, 20 May 2020 21:16:56 +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 04KLGtaC089683; Wed, 20 May 2020 21:16:56 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KLGsdC089676; Wed, 20 May 2020 21:16:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005202116.04KLGsdC089676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 20 May 2020 21:16:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361297 - in head/sys/mips: atheros atheros/ar531x cavium include mediatek mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/mips: atheros atheros/ar531x cavium include mediatek mips X-SVN-Commit-Revision: 361297 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, 20 May 2020 21:16:56 -0000 Author: jhb Date: Wed May 20 21:16:54 2020 New Revision: 361297 URL: https://svnweb.freebsd.org/changeset/base/361297 Log: Print CPU informtion later in boot. Match other architectures and print CPU information during cpu_startup(). In particular, this prints the information after the message buffer is initialized which allows it to be retrieved after boot via dmesg(8). While here, add some extern declarations to in place of duplicated declarations in various source files. Reviewed by: brooks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24936 Modified: head/sys/mips/atheros/ar531x/ar5315_machdep.c head/sys/mips/atheros/ar71xx_machdep.c head/sys/mips/cavium/octeon_machdep.c head/sys/mips/include/md_var.h head/sys/mips/mediatek/mtk_soc.c head/sys/mips/mips/cpu.c head/sys/mips/mips/machdep.c Modified: head/sys/mips/atheros/ar531x/ar5315_machdep.c ============================================================================== --- head/sys/mips/atheros/ar531x/ar5315_machdep.c Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/atheros/ar531x/ar5315_machdep.c Wed May 20 21:16:54 2020 (r361297) @@ -148,8 +148,6 @@ SYSCTL_STRING(_hw_device, OID_AUTO, revision, CTLFLAG_ "Board revision"); #endif -extern char cpu_model[]; - void platform_start(__register_t a0 __unused, __register_t a1 __unused, __register_t a2 __unused, __register_t a3 __unused) Modified: head/sys/mips/atheros/ar71xx_machdep.c ============================================================================== --- head/sys/mips/atheros/ar71xx_machdep.c Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/atheros/ar71xx_machdep.c Wed May 20 21:16:54 2020 (r361297) @@ -275,8 +275,6 @@ ar71xx_platform_check_mac_hints(void) return (0); } -extern char cpu_model[]; - void platform_start(__register_t a0 __unused, __register_t a1 __unused, __register_t a2 __unused, __register_t a3 __unused) Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/cavium/octeon_machdep.c Wed May 20 21:16:54 2020 (r361297) @@ -97,8 +97,6 @@ struct octeon_feature_description { }; extern int *end; -extern char cpu_model[]; -extern char cpu_board[]; static char octeon_kenv[0x2000]; static const struct octeon_feature_description octeon_feature_descriptions[] = { Modified: head/sys/mips/include/md_var.h ============================================================================== --- head/sys/mips/include/md_var.h Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/include/md_var.h Wed May 20 21:16:54 2020 (r361297) @@ -42,6 +42,8 @@ * Miscellaneous machine-dependent declarations. */ extern long Maxmem; +extern char cpu_board[]; +extern char cpu_model[]; extern char sigcode[]; extern int szsigcode; #if defined(__mips_n32) || defined(__mips_n64) @@ -75,6 +77,7 @@ void mips_cpu_init(void); void mips_pcpu0_init(void); void mips_proc0_init(void); void mips_postboot_fixup(void); +void cpu_identify(void); void cpu_switch_set_userlocal(void) __asm(__STRING(cpu_switch_set_userlocal)); extern int busdma_swi_pending; Modified: head/sys/mips/mediatek/mtk_soc.c ============================================================================== --- head/sys/mips/mediatek/mtk_soc.c Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/mediatek/mtk_soc.c Wed May 20 21:16:54 2020 (r361297) @@ -396,8 +396,6 @@ mtk_soc_try_early_detect(void) bus_space_unmap(bst, bsh, MTK_DEFAULT_SIZE); } -extern char cpu_model[]; - void mtk_soc_set_cpu_model(void) { Modified: head/sys/mips/mips/cpu.c ============================================================================== --- head/sys/mips/mips/cpu.c Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/mips/cpu.c Wed May 20 21:16:54 2020 (r361297) @@ -61,8 +61,6 @@ __FBSDID("$FreeBSD$"); #include #endif -static void cpu_identify(void); - struct mips_cpuinfo cpuinfo; #define _ENCODE_INSN(a,b,c,d,e) \ @@ -294,18 +292,16 @@ mips_cpu_init(void) mips_icache_sync_all(); mips_dcache_wbinv_all(); - /* Print some info about CPU */ - cpu_identify(); } -static void +void cpu_identify(void) { uint32_t cfg0, cfg1, cfg2, cfg3; #if defined(CPU_MIPS1004K) || defined (CPU_MIPS74K) || defined (CPU_MIPS24K) uint32_t cfg7; #endif - printf("cpu%d: ", 0); /* XXX per-cpu */ + printf("CPU: "); switch (cpuinfo.cpu_vendor) { case MIPS_PRID_CID_MTI: printf("MIPS Technologies"); @@ -347,6 +343,8 @@ cpu_identify(void) printf("Unknown cid %#x", cpuinfo.cpu_vendor); break; } + if (cpu_model[0] != '\0') + printf(" (%s)", cpu_model); printf(" processor v%d.%d\n", cpuinfo.cpu_rev, cpuinfo.cpu_impl); printf(" MMU: "); Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Wed May 20 21:15:43 2020 (r361296) +++ head/sys/mips/mips/machdep.c Wed May 20 21:16:54 2020 (r361297) @@ -185,7 +185,7 @@ cpu_startup(void *dummy) if (boothowto & RB_VERBOSE) bootverbose++; - printf("CPU model: %s\n", cpu_model); + cpu_identify(); printf("real memory = %ju (%juK bytes)\n", ptoa((uintmax_t)realmem), ptoa((uintmax_t)realmem) / 1024); From owner-svn-src-all@freebsd.org Wed May 20 21:21: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 6EE6D2F58F8; Wed, 20 May 2020 21:21:04 +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 49S5Jw2XWPz3ZYN; Wed, 20 May 2020 21:21:04 +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 37A9E2264C; Wed, 20 May 2020 21:21:04 +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 04KLL4Yg091685; Wed, 20 May 2020 21:21:04 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KLL25E091670; Wed, 20 May 2020 21:21:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005202121.04KLL25E091670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 20 May 2020 21:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361298 - in head/sys: crypto/chacha20 dev/cxgbe/crypto opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: crypto/chacha20 dev/cxgbe/crypto opencrypto X-SVN-Commit-Revision: 361298 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, 20 May 2020 21:21:04 -0000 Author: jhb Date: Wed May 20 21:21:01 2020 New Revision: 361298 URL: https://svnweb.freebsd.org/changeset/base/361298 Log: Various cleanups to the software encryption transform interface. - Consistently use 'void *' for key schedules / key contexts instead of a mix of 'caddr_t', 'uint8_t *', and 'void *'. - Add a ctxsize member to enc_xform similar to what auth transforms use and require callers to malloc/zfree the context. The setkey callback now supplies the caller-allocated context pointer and the zerokey callback is removed. Callers now always use zfree() to ensure key contexts are zeroed. - Consistently use C99 initializers for all statically-initialized instances of 'struct enc_xform'. - Change the encrypt and decrypt functions to accept separate in and out buffer pointers. Almost all of the backend crypto functions already supported separate input and output buffers and this makes it simpler to support separate buffers in OCF. - Remove xform_userland.h shim to permit transforms to be compiled in userland. Transforms no longer call malloc/free directly. Reviewed by: cem (earlier version) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D24855 Deleted: head/sys/opencrypto/xform_userland.h Modified: head/sys/crypto/chacha20/chacha-sw.c head/sys/dev/cxgbe/crypto/t4_crypto.c head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform_aes_icm.c head/sys/opencrypto/xform_aes_xts.c head/sys/opencrypto/xform_auth.h head/sys/opencrypto/xform_cml.c head/sys/opencrypto/xform_comp.h head/sys/opencrypto/xform_enc.h head/sys/opencrypto/xform_gmac.c head/sys/opencrypto/xform_null.c head/sys/opencrypto/xform_rijndael.c Modified: head/sys/crypto/chacha20/chacha-sw.c ============================================================================== --- head/sys/crypto/chacha20/chacha-sw.c Wed May 20 21:16:54 2020 (r361297) +++ head/sys/crypto/chacha20/chacha-sw.c Wed May 20 21:21:01 2020 (r361298) @@ -7,63 +7,42 @@ __FBSDID("$FreeBSD$"); #include static int -chacha20_xform_setkey(u_int8_t **sched, const u_int8_t *key, int len) +chacha20_xform_setkey(void *ctx, const uint8_t *key, int len) { - struct chacha_ctx *ctx; if (len != CHACHA_MINKEYLEN && len != 32) return (EINVAL); - ctx = malloc(sizeof(*ctx), M_CRYPTO_DATA, M_NOWAIT | M_ZERO); - *sched = (void *)ctx; - if (ctx == NULL) - return (ENOMEM); - chacha_keysetup(ctx, key, len * 8); return (0); } static void -chacha20_xform_reinit(caddr_t key, const u_int8_t *iv) +chacha20_xform_reinit(void *ctx, const u_int8_t *iv) { - struct chacha_ctx *ctx; - ctx = (void *)key; chacha_ivsetup(ctx, iv + 8, iv); } static void -chacha20_xform_zerokey(u_int8_t **sched) +chacha20_xform_crypt(void *ctx, const uint8_t *in, uint8_t *out) { - struct chacha_ctx *ctx; - ctx = (void *)*sched; - explicit_bzero(ctx, sizeof(*ctx)); - free(ctx, M_CRYPTO_DATA); - *sched = NULL; + chacha_encrypt_bytes(ctx, in, out, 1); } static void -chacha20_xform_crypt(caddr_t cctx, u_int8_t *bytes) +chacha20_xform_crypt_multi(void *ctx, const uint8_t *in, uint8_t *out, + size_t len) { - struct chacha_ctx *ctx; - ctx = (void *)cctx; - chacha_encrypt_bytes(ctx, bytes, bytes, 1); + chacha_encrypt_bytes(ctx, in, out, len); } -static void -chacha20_xform_crypt_multi(void *vctx, uint8_t *bytes, size_t len) -{ - struct chacha_ctx *ctx; - - ctx = vctx; - chacha_encrypt_bytes(ctx, bytes, bytes, len); -} - struct enc_xform enc_xform_chacha20 = { .type = CRYPTO_CHACHA20, .name = "chacha20", + .ctxsize = sizeof(struct chacha_ctx), .blocksize = 1, .ivsize = CHACHA_NONCELEN + CHACHA_CTRLEN, .minkey = CHACHA_MINKEYLEN, @@ -71,7 +50,6 @@ struct enc_xform enc_xform_chacha20 = { .encrypt = chacha20_xform_crypt, .decrypt = chacha20_xform_crypt, .setkey = chacha20_xform_setkey, - .zerokey = chacha20_xform_zerokey, .reinit = chacha20_xform_reinit, .encrypt_multi = chacha20_xform_crypt_multi, .decrypt_multi = chacha20_xform_crypt_multi, Modified: head/sys/dev/cxgbe/crypto/t4_crypto.c ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_crypto.c Wed May 20 21:16:54 2020 (r361297) +++ head/sys/dev/cxgbe/crypto/t4_crypto.c Wed May 20 21:21:01 2020 (r361298) @@ -1354,8 +1354,7 @@ ccr_gcm_soft(struct ccr_session *s, struct cryptop *cr { struct auth_hash *axf; struct enc_xform *exf; - void *auth_ctx; - uint8_t *kschedule; + void *auth_ctx, *kschedule; char block[GMAC_BLOCK_LEN]; char digest[GMAC_DIGEST_LEN]; char iv[AES_BLOCK_LEN]; @@ -1389,7 +1388,12 @@ ccr_gcm_soft(struct ccr_session *s, struct cryptop *cr /* Initialize the cipher. */ exf = &enc_xform_aes_nist_gcm; - error = exf->setkey(&kschedule, s->blkcipher.enckey, + kschedule = malloc(exf->ctxsize, M_CCR, M_NOWAIT); + if (kschedule == NULL) { + error = ENOMEM; + goto out; + } + error = exf->setkey(kschedule, s->blkcipher.enckey, s->blkcipher.key_len); if (error) goto out; @@ -1423,7 +1427,7 @@ ccr_gcm_soft(struct ccr_session *s, struct cryptop *cr crypto_copydata(crp, crp->crp_payload_start + i, len, block); bzero(block + len, sizeof(block) - len); if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { - exf->encrypt(kschedule, block); + exf->encrypt(kschedule, block, block); axf->Update(auth_ctx, block, len); crypto_copyback(crp, crp->crp_payload_start + i, len, block); @@ -1462,7 +1466,7 @@ ccr_gcm_soft(struct ccr_session *s, struct cryptop *cr crypto_copydata(crp, crp->crp_payload_start + i, len, block); bzero(block + len, sizeof(block) - len); - exf->decrypt(kschedule, block); + exf->decrypt(kschedule, block, block); crypto_copyback(crp, crp->crp_payload_start + i, len, block); } @@ -1470,12 +1474,9 @@ ccr_gcm_soft(struct ccr_session *s, struct cryptop *cr error = EBADMSG; } - exf->zerokey(&kschedule); out: - if (auth_ctx != NULL) { - memset(auth_ctx, 0, axf->ctxsize); - free(auth_ctx, M_CCR); - } + zfree(kschedule, M_CCR); + zfree(auth_ctx, M_CCR); crp->crp_etype = error; crypto_done(crp); } @@ -1810,7 +1811,7 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *cr struct auth_hash *axf; struct enc_xform *exf; union authctx *auth_ctx; - uint8_t *kschedule; + void *kschedule; char block[CCM_CBC_BLOCK_LEN]; char digest[AES_CBC_MAC_HASH_LEN]; char iv[AES_CCM_IV_LEN]; @@ -1844,7 +1845,12 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *cr /* Initialize the cipher. */ exf = &enc_xform_ccm; - error = exf->setkey(&kschedule, s->blkcipher.enckey, + kschedule = malloc(exf->ctxsize, M_CCR, M_NOWAIT); + if (kschedule == NULL) { + error = ENOMEM; + goto out; + } + error = exf->setkey(kschedule, s->blkcipher.enckey, s->blkcipher.key_len); if (error) goto out; @@ -1876,11 +1882,11 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *cr bzero(block + len, sizeof(block) - len); if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { axf->Update(auth_ctx, block, len); - exf->encrypt(kschedule, block); + exf->encrypt(kschedule, block, block); crypto_copyback(crp, crp->crp_payload_start + i, len, block); } else { - exf->decrypt(kschedule, block); + exf->decrypt(kschedule, block, block); axf->Update(auth_ctx, block, len); } } @@ -1910,7 +1916,7 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *cr crypto_copydata(crp, crp->crp_payload_start + i, len, block); bzero(block + len, sizeof(block) - len); - exf->decrypt(kschedule, block); + exf->decrypt(kschedule, block, block); crypto_copyback(crp, crp->crp_payload_start + i, len, block); } @@ -1918,12 +1924,9 @@ ccr_ccm_soft(struct ccr_session *s, struct cryptop *cr error = EBADMSG; } - exf->zerokey(&kschedule); out: - if (auth_ctx != NULL) { - memset(auth_ctx, 0, axf->ctxsize); - free(auth_ctx, M_CCR); - } + zfree(kschedule, M_CCR); + zfree(auth_ctx, M_CCR); crp->crp_etype = error; crypto_done(crp); } Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Wed May 20 21:16:54 2020 (r361297) +++ head/sys/opencrypto/cryptosoft.c Wed May 20 21:21:01 2020 (r361298) @@ -65,7 +65,7 @@ struct swcr_auth { }; struct swcr_encdec { - uint8_t *sw_kschedule; + void *sw_kschedule; struct enc_xform *sw_exf; }; @@ -131,11 +131,8 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * crypto_read_iv(crp, iv); if (crp->crp_cipher_key != NULL) { - if (sw->sw_kschedule) - exf->zerokey(&(sw->sw_kschedule)); - csp = crypto_get_params(crp->crp_session); - error = exf->setkey(&sw->sw_kschedule, + error = exf->setkey(sw->sw_kschedule, crp->crp_cipher_key, csp->csp_cipher_klen); if (error) return (error); @@ -197,10 +194,10 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * /* Actual encryption/decryption */ if (exf->reinit) { if (encrypting) { - exf->encrypt(sw->sw_kschedule, + exf->encrypt(sw->sw_kschedule, blk, blk); } else { - exf->decrypt(sw->sw_kschedule, + exf->decrypt(sw->sw_kschedule, blk, blk); } } else if (encrypting) { @@ -208,7 +205,7 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * for (j = 0; j < blks; j++) blk[j] ^= ivp[j]; - exf->encrypt(sw->sw_kschedule, blk); + exf->encrypt(sw->sw_kschedule, blk, blk); /* * Keep encrypted block for XOR'ing @@ -224,7 +221,7 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * nivp = (ivp == iv) ? iv2 : iv; bcopy(blk, nivp, blks); - exf->decrypt(sw->sw_kschedule, blk); + exf->decrypt(sw->sw_kschedule, blk, blk); /* XOR with previous block */ for (j = 0; j < blks; j++) @@ -264,25 +261,25 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * if (exf->reinit) { if (encrypting && exf->encrypt_multi == NULL) exf->encrypt(sw->sw_kschedule, - idat); + idat, idat); else if (encrypting) { nb = rounddown(rem, blks); exf->encrypt_multi(sw->sw_kschedule, - idat, nb); + idat, idat, nb); } else if (exf->decrypt_multi == NULL) exf->decrypt(sw->sw_kschedule, - idat); + idat, idat); else { nb = rounddown(rem, blks); exf->decrypt_multi(sw->sw_kschedule, - idat, nb); + idat, idat, nb); } } else if (encrypting) { /* XOR with previous block/IV */ for (j = 0; j < blks; j++) idat[j] ^= ivp[j]; - exf->encrypt(sw->sw_kschedule, idat); + exf->encrypt(sw->sw_kschedule, idat, idat); ivp = idat; } else { /* decrypt */ /* @@ -292,7 +289,7 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * nivp = (ivp == iv) ? iv2 : iv; bcopy(idat, nivp, blks); - exf->decrypt(sw->sw_kschedule, idat); + exf->decrypt(sw->sw_kschedule, idat, idat); /* XOR with previous block/IV */ for (j = 0; j < blks; j++) @@ -543,7 +540,7 @@ swcr_gcm(struct swcr_session *ses, struct cryptop *crp bzero(blk, blksz); crypto_copydata(crp, crp->crp_payload_start + i, len, blk); if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { - exf->encrypt(swe->sw_kschedule, blk); + exf->encrypt(swe->sw_kschedule, blk, blk); axf->Update(&ctx, blk, len); crypto_copyback(crp, crp->crp_payload_start + i, len, blk); @@ -579,7 +576,7 @@ swcr_gcm(struct swcr_session *ses, struct cryptop *crp bzero(blk, blksz); crypto_copydata(crp, crp->crp_payload_start + i, len, blk); - exf->decrypt(swe->sw_kschedule, blk); + exf->decrypt(swe->sw_kschedule, blk, blk); crypto_copyback(crp, crp->crp_payload_start + i, len, blk); } @@ -704,7 +701,7 @@ swcr_ccm(struct swcr_session *ses, struct cryptop *crp crypto_copydata(crp, crp->crp_payload_start + i, len, blk); if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { axf->Update(&ctx, blk, len); - exf->encrypt(swe->sw_kschedule, blk); + exf->encrypt(swe->sw_kschedule, blk, blk); crypto_copyback(crp, crp->crp_payload_start + i, len, blk); } else { @@ -716,7 +713,7 @@ swcr_ccm(struct swcr_session *ses, struct cryptop *crp * the tag and a second time after the tag is * verified. */ - exf->decrypt(swe->sw_kschedule, blk); + exf->decrypt(swe->sw_kschedule, blk, blk); axf->Update(&ctx, blk, len); } } @@ -741,7 +738,7 @@ swcr_ccm(struct swcr_session *ses, struct cryptop *crp bzero(blk, blksz); crypto_copydata(crp, crp->crp_payload_start + i, len, blk); - exf->decrypt(swe->sw_kschedule, blk); + exf->decrypt(swe->sw_kschedule, blk, blk); crypto_copyback(crp, crp->crp_payload_start + i, len, blk); } @@ -854,7 +851,7 @@ swcr_compdec(struct swcr_session *ses, struct cryptop } static int -swcr_setup_encdec(struct swcr_session *ses, +swcr_setup_cipher(struct swcr_session *ses, const struct crypto_session_params *csp) { struct swcr_encdec *swe; @@ -864,8 +861,14 @@ swcr_setup_encdec(struct swcr_session *ses, swe = &ses->swcr_encdec; txf = crypto_cipher(csp); MPASS(txf->ivsize == csp->csp_ivlen); + if (txf->ctxsize != 0) { + swe->sw_kschedule = malloc(txf->ctxsize, M_CRYPTO_DATA, + M_NOWAIT); + if (swe->sw_kschedule == NULL) + return (ENOMEM); + } if (csp->csp_cipher_key != NULL) { - error = txf->setkey(&swe->sw_kschedule, + error = txf->setkey(swe->sw_kschedule, csp->csp_cipher_key, csp->csp_cipher_klen); if (error) return (error); @@ -962,11 +965,8 @@ static int swcr_setup_gcm(struct swcr_session *ses, const struct crypto_session_params *csp) { - struct swcr_encdec *swe; struct swcr_auth *swa; - struct enc_xform *txf; struct auth_hash *axf; - int error; if (csp->csp_ivlen != AES_GCM_IV_LEN) return (EINVAL); @@ -1002,28 +1002,15 @@ swcr_setup_gcm(struct swcr_session *ses, csp->csp_cipher_klen); /* Second, setup the cipher side. */ - swe = &ses->swcr_encdec; - txf = &enc_xform_aes_nist_gcm; - if (csp->csp_cipher_key != NULL) { - error = txf->setkey(&swe->sw_kschedule, - csp->csp_cipher_key, csp->csp_cipher_klen); - if (error) - return (error); - } - swe->sw_exf = txf; - - return (0); + return (swcr_setup_cipher(ses, csp)); } static int swcr_setup_ccm(struct swcr_session *ses, const struct crypto_session_params *csp) { - struct swcr_encdec *swe; struct swcr_auth *swa; - struct enc_xform *txf; struct auth_hash *axf; - int error; if (csp->csp_ivlen != AES_CCM_IV_LEN) return (EINVAL); @@ -1059,17 +1046,7 @@ swcr_setup_ccm(struct swcr_session *ses, csp->csp_cipher_klen); /* Second, setup the cipher side. */ - swe = &ses->swcr_encdec; - txf = &enc_xform_ccm; - if (csp->csp_cipher_key != NULL) { - error = txf->setkey(&swe->sw_kschedule, - csp->csp_cipher_key, csp->csp_cipher_klen); - if (error) - return (error); - } - swe->sw_exf = txf; - - return (0); + return (swcr_setup_cipher(ses, csp)); } static bool @@ -1246,7 +1223,7 @@ swcr_newsession(device_t dev, crypto_session_t cses, panic("bad cipher algo"); #endif default: - error = swcr_setup_encdec(ses, csp); + error = swcr_setup_cipher(ses, csp); if (error == 0) ses->swcr_process = swcr_encdec; } @@ -1295,7 +1272,7 @@ swcr_newsession(device_t dev, crypto_session_t cses, break; } - error = swcr_setup_encdec(ses, csp); + error = swcr_setup_cipher(ses, csp); if (error == 0) ses->swcr_process = swcr_eta; break; @@ -1313,18 +1290,13 @@ swcr_freesession(device_t dev, crypto_session_t cses) { struct swcr_session *ses; struct swcr_auth *swa; - struct enc_xform *txf; struct auth_hash *axf; ses = crypto_get_driver_session(cses); mtx_destroy(&ses->swcr_lock); - txf = ses->swcr_encdec.sw_exf; - if (txf != NULL) { - if (ses->swcr_encdec.sw_kschedule != NULL) - txf->zerokey(&(ses->swcr_encdec.sw_kschedule)); - } + zfree(ses->swcr_encdec.sw_kschedule, M_CRYPTO_DATA); axf = ses->swcr_auth.sw_axf; if (axf != NULL) { Modified: head/sys/opencrypto/xform_aes_icm.c ============================================================================== --- head/sys/opencrypto/xform_aes_icm.c Wed May 20 21:16:54 2020 (r361297) +++ head/sys/opencrypto/xform_aes_icm.c Wed May 20 21:21:01 2020 (r361298) @@ -52,43 +52,50 @@ __FBSDID("$FreeBSD$"); #include -static int aes_icm_setkey(u_int8_t **, const u_int8_t *, int); -static void aes_icm_crypt(caddr_t, u_int8_t *); -static void aes_icm_zerokey(u_int8_t **); -static void aes_icm_reinit(caddr_t, const u_int8_t *); -static void aes_gcm_reinit(caddr_t, const u_int8_t *); -static void aes_ccm_reinit(caddr_t, const u_int8_t *); +static int aes_icm_setkey(void *, const uint8_t *, int); +static void aes_icm_crypt(void *, const uint8_t *, uint8_t *); +static void aes_icm_reinit(void *, const uint8_t *); +static void aes_gcm_reinit(void *, const uint8_t *); +static void aes_ccm_reinit(void *, const uint8_t *); /* Encryption instances */ struct enc_xform enc_xform_aes_icm = { - CRYPTO_AES_ICM, "AES-ICM", - AES_BLOCK_LEN, AES_BLOCK_LEN, AES_MIN_KEY, AES_MAX_KEY, - aes_icm_crypt, - aes_icm_crypt, - aes_icm_setkey, - aes_icm_zerokey, - aes_icm_reinit, + .type = CRYPTO_AES_ICM, + .name = "AES-ICM", + .ctxsize = sizeof(struct aes_icm_ctx), + .blocksize = AES_BLOCK_LEN, + .ivsize = AES_BLOCK_LEN, + .minkey = AES_MIN_KEY, + .maxkey = AES_MAX_KEY, + .encrypt = aes_icm_crypt, + .decrypt = aes_icm_crypt, + .setkey = aes_icm_setkey, + .reinit = aes_icm_reinit, }; struct enc_xform enc_xform_aes_nist_gcm = { - CRYPTO_AES_NIST_GCM_16, "AES-GCM", - AES_ICM_BLOCK_LEN, AES_GCM_IV_LEN, AES_MIN_KEY, AES_MAX_KEY, - aes_icm_crypt, - aes_icm_crypt, - aes_icm_setkey, - aes_icm_zerokey, - aes_gcm_reinit, + .type = CRYPTO_AES_NIST_GCM_16, + .name = "AES-GCM", + .ctxsize = sizeof(struct aes_icm_ctx), + .blocksize = AES_ICM_BLOCK_LEN, + .ivsize = AES_GCM_IV_LEN, + .minkey = AES_MIN_KEY, + .maxkey = AES_MAX_KEY, + .encrypt = aes_icm_crypt, + .decrypt = aes_icm_crypt, + .setkey = aes_icm_setkey, + .reinit = aes_gcm_reinit, }; struct enc_xform enc_xform_ccm = { .type = CRYPTO_AES_CCM_16, .name = "AES-CCM", + .ctxsize = sizeof(struct aes_icm_ctx), .blocksize = AES_ICM_BLOCK_LEN, .ivsize = AES_CCM_IV_LEN, .minkey = AES_MIN_KEY, .maxkey = AES_MAX_KEY, .encrypt = aes_icm_crypt, .decrypt = aes_icm_crypt, .setkey = aes_icm_setkey, - .zerokey = aes_icm_zerokey, .reinit = aes_ccm_reinit, }; @@ -96,33 +103,33 @@ struct enc_xform enc_xform_ccm = { * Encryption wrapper routines. */ static void -aes_icm_reinit(caddr_t key, const u_int8_t *iv) +aes_icm_reinit(void *key, const uint8_t *iv) { struct aes_icm_ctx *ctx; - ctx = (struct aes_icm_ctx *)key; + ctx = key; bcopy(iv, ctx->ac_block, AESICM_BLOCKSIZE); } static void -aes_gcm_reinit(caddr_t key, const u_int8_t *iv) +aes_gcm_reinit(void *key, const uint8_t *iv) { struct aes_icm_ctx *ctx; aes_icm_reinit(key, iv); - ctx = (struct aes_icm_ctx *)key; + ctx = key; /* GCM starts with 2 as counter 1 is used for final xor of tag. */ bzero(&ctx->ac_block[AESICM_BLOCKSIZE - 4], 4); ctx->ac_block[AESICM_BLOCKSIZE - 1] = 2; } static void -aes_ccm_reinit(caddr_t key, const u_int8_t *iv) +aes_ccm_reinit(void *key, const uint8_t *iv) { struct aes_icm_ctx *ctx; - ctx = (struct aes_icm_ctx*)key; + ctx = key; /* CCM has flags, then the IV, then the counter, which starts at 1 */ bzero(ctx->ac_block, sizeof(ctx->ac_block)); @@ -133,16 +140,16 @@ aes_ccm_reinit(caddr_t key, const u_int8_t *iv) } static void -aes_icm_crypt(caddr_t key, u_int8_t *data) +aes_icm_crypt(void *key, const uint8_t *in, uint8_t *out) { struct aes_icm_ctx *ctx; - u_int8_t keystream[AESICM_BLOCKSIZE]; + uint8_t keystream[AESICM_BLOCKSIZE]; int i; - ctx = (struct aes_icm_ctx *)key; + ctx = key; rijndaelEncrypt(ctx->ac_ek, ctx->ac_nr, ctx->ac_block, keystream); for (i = 0; i < AESICM_BLOCKSIZE; i++) - data[i] ^= keystream[i]; + out[i] = in[i] ^ keystream[i]; explicit_bzero(keystream, sizeof(keystream)); /* increment counter */ @@ -153,28 +160,14 @@ aes_icm_crypt(caddr_t key, u_int8_t *data) } static int -aes_icm_setkey(u_int8_t **sched, const u_int8_t *key, int len) +aes_icm_setkey(void *sched, const uint8_t *key, int len) { struct aes_icm_ctx *ctx; if (len != 16 && len != 24 && len != 32) - return EINVAL; + return (EINVAL); - *sched = KMALLOC(sizeof(struct aes_icm_ctx), M_CRYPTO_DATA, - M_NOWAIT | M_ZERO); - if (*sched == NULL) - return ENOMEM; - - ctx = (struct aes_icm_ctx *)*sched; + ctx = sched; ctx->ac_nr = rijndaelKeySetupEnc(ctx->ac_ek, key, len * 8); - return 0; -} - -static void -aes_icm_zerokey(u_int8_t **sched) -{ - - bzero(*sched, sizeof(struct aes_icm_ctx)); - KFREE(*sched, M_CRYPTO_DATA); - *sched = NULL; + return (0); } Modified: head/sys/opencrypto/xform_aes_xts.c ============================================================================== --- head/sys/opencrypto/xform_aes_xts.c Wed May 20 21:16:54 2020 (r361297) +++ head/sys/opencrypto/xform_aes_xts.c Wed May 20 21:21:01 2020 (r361298) @@ -52,31 +52,34 @@ __FBSDID("$FreeBSD$"); #include -static int aes_xts_setkey(u_int8_t **, const u_int8_t *, int); -static void aes_xts_encrypt(caddr_t, u_int8_t *); -static void aes_xts_decrypt(caddr_t, u_int8_t *); -static void aes_xts_zerokey(u_int8_t **); -static void aes_xts_reinit(caddr_t, const u_int8_t *); +static int aes_xts_setkey(void *, const uint8_t *, int); +static void aes_xts_encrypt(void *, const uint8_t *, uint8_t *); +static void aes_xts_decrypt(void *, const uint8_t *, uint8_t *); +static void aes_xts_reinit(void *, const uint8_t *); /* Encryption instances */ struct enc_xform enc_xform_aes_xts = { - CRYPTO_AES_XTS, "AES-XTS", - AES_BLOCK_LEN, AES_XTS_IV_LEN, AES_XTS_MIN_KEY, AES_XTS_MAX_KEY, - aes_xts_encrypt, - aes_xts_decrypt, - aes_xts_setkey, - aes_xts_zerokey, - aes_xts_reinit + .type = CRYPTO_AES_XTS, + .name = "AES-XTS", + .ctxsize = sizeof(struct aes_xts_ctx), + .blocksize = AES_BLOCK_LEN, + .ivsize = AES_XTS_IV_LEN, + .minkey = AES_XTS_MIN_KEY, + .maxkey = AES_XTS_MAX_KEY, + .encrypt = aes_xts_encrypt, + .decrypt = aes_xts_decrypt, + .setkey = aes_xts_setkey, + .reinit = aes_xts_reinit }; /* * Encryption wrapper routines. */ static void -aes_xts_reinit(caddr_t key, const u_int8_t *iv) +aes_xts_reinit(void *key, const uint8_t *iv) { - struct aes_xts_ctx *ctx = (struct aes_xts_ctx *)key; - u_int64_t blocknum; + struct aes_xts_ctx *ctx = key; + uint64_t blocknum; u_int i; /* @@ -95,21 +98,22 @@ aes_xts_reinit(caddr_t key, const u_int8_t *iv) } static void -aes_xts_crypt(struct aes_xts_ctx *ctx, u_int8_t *data, u_int do_encrypt) +aes_xts_crypt(struct aes_xts_ctx *ctx, const uint8_t *in, uint8_t *out, + u_int do_encrypt) { - u_int8_t block[AES_XTS_BLOCKSIZE]; + uint8_t block[AES_XTS_BLOCKSIZE]; u_int i, carry_in, carry_out; for (i = 0; i < AES_XTS_BLOCKSIZE; i++) - block[i] = data[i] ^ ctx->tweak[i]; + block[i] = in[i] ^ ctx->tweak[i]; if (do_encrypt) - rijndael_encrypt(&ctx->key1, block, data); + rijndael_encrypt(&ctx->key1, block, out); else - rijndael_decrypt(&ctx->key1, block, data); + rijndael_decrypt(&ctx->key1, block, out); for (i = 0; i < AES_XTS_BLOCKSIZE; i++) - data[i] ^= ctx->tweak[i]; + out[i] ^= ctx->tweak[i]; /* Exponentiate tweak */ carry_in = 0; @@ -120,45 +124,33 @@ aes_xts_crypt(struct aes_xts_ctx *ctx, u_int8_t *data, } if (carry_in) ctx->tweak[0] ^= AES_XTS_ALPHA; - bzero(block, sizeof(block)); + explicit_bzero(block, sizeof(block)); } static void -aes_xts_encrypt(caddr_t key, u_int8_t *data) +aes_xts_encrypt(void *key, const uint8_t *in, uint8_t *out) { - aes_xts_crypt((struct aes_xts_ctx *)key, data, 1); + aes_xts_crypt(key, in, out, 1); } static void -aes_xts_decrypt(caddr_t key, u_int8_t *data) +aes_xts_decrypt(void *key, const uint8_t *in, uint8_t *out) { - aes_xts_crypt((struct aes_xts_ctx *)key, data, 0); + aes_xts_crypt(key, in, out, 0); } static int -aes_xts_setkey(u_int8_t **sched, const u_int8_t *key, int len) +aes_xts_setkey(void *sched, const uint8_t *key, int len) { struct aes_xts_ctx *ctx; if (len != 32 && len != 64) - return EINVAL; + return (EINVAL); - *sched = KMALLOC(sizeof(struct aes_xts_ctx), M_CRYPTO_DATA, - M_NOWAIT | M_ZERO); - if (*sched == NULL) - return ENOMEM; - ctx = (struct aes_xts_ctx *)*sched; + ctx = sched; rijndael_set_key(&ctx->key1, key, len * 4); rijndael_set_key(&ctx->key2, key + (len / 2), len * 4); - return 0; -} - -static void -aes_xts_zerokey(u_int8_t **sched) -{ - bzero(*sched, sizeof(struct aes_xts_ctx)); - KFREE(*sched, M_CRYPTO_DATA); - *sched = NULL; + return (0); } Modified: head/sys/opencrypto/xform_auth.h ============================================================================== --- head/sys/opencrypto/xform_auth.h Wed May 20 21:16:54 2020 (r361297) +++ head/sys/opencrypto/xform_auth.h Wed May 20 21:21:01 2020 (r361298) @@ -44,7 +44,6 @@ #include #include -#include /* XXX use a define common with other hash stuff ! */ #define AH_ALEN_MAX 64 /* max authenticator hash length */ Modified: head/sys/opencrypto/xform_cml.c ============================================================================== --- head/sys/opencrypto/xform_cml.c Wed May 20 21:16:54 2020 (r361297) +++ head/sys/opencrypto/xform_cml.c Wed May 20 21:21:01 2020 (r361298) @@ -53,61 +53,46 @@ __FBSDID("$FreeBSD$"); #include #include -static int cml_setkey(u_int8_t **, const u_int8_t *, int); -static void cml_encrypt(caddr_t, u_int8_t *); -static void cml_decrypt(caddr_t, u_int8_t *); -static void cml_zerokey(u_int8_t **); +static int cml_setkey(void *, const uint8_t *, int); +static void cml_encrypt(void *, const uint8_t *, uint8_t *); +static void cml_decrypt(void *, const uint8_t *, uint8_t *); /* Encryption instances */ struct enc_xform enc_xform_camellia = { - CRYPTO_CAMELLIA_CBC, "Camellia", - CAMELLIA_BLOCK_LEN, CAMELLIA_BLOCK_LEN, CAMELLIA_MIN_KEY, - CAMELLIA_MAX_KEY, - cml_encrypt, - cml_decrypt, - cml_setkey, - cml_zerokey, - NULL, + .type = CRYPTO_CAMELLIA_CBC, + .name = "Camellia-CBC", + .ctxsize = sizeof(camellia_ctx), + .blocksize = CAMELLIA_BLOCK_LEN, + .ivsize = CAMELLIA_BLOCK_LEN, + .minkey = CAMELLIA_MIN_KEY, + .maxkey = CAMELLIA_MAX_KEY, + .encrypt = cml_encrypt, + .decrypt = cml_decrypt, + .setkey = cml_setkey, }; /* * Encryption wrapper routines. */ static void -cml_encrypt(caddr_t key, u_int8_t *blk) +cml_encrypt(void *ctx, const uint8_t *in, uint8_t *out) { - camellia_encrypt((camellia_ctx *) key, (u_char *) blk, (u_char *) blk); + camellia_encrypt(ctx, in, out); } static void -cml_decrypt(caddr_t key, u_int8_t *blk) +cml_decrypt(void *ctx, const uint8_t *in, uint8_t *out) { - camellia_decrypt(((camellia_ctx *) key), (u_char *) blk, - (u_char *) blk); + camellia_decrypt(ctx, in, out); } static int -cml_setkey(u_int8_t **sched, const u_int8_t *key, int len) +cml_setkey(void *ctx, const uint8_t *key, int len) { - int err; if (len != 16 && len != 24 && len != 32) return (EINVAL); - *sched = KMALLOC(sizeof(camellia_ctx), M_CRYPTO_DATA, - M_NOWAIT|M_ZERO); - if (*sched != NULL) { - camellia_set_key((camellia_ctx *) *sched, key, - len * 8); - err = 0; - } else - err = ENOMEM; - return err; -} -static void -cml_zerokey(u_int8_t **sched) -{ - bzero(*sched, sizeof(camellia_ctx)); - KFREE(*sched, M_CRYPTO_DATA); - *sched = NULL; + camellia_set_key(ctx, key, len * 8); + return (0); } Modified: head/sys/opencrypto/xform_comp.h ============================================================================== --- head/sys/opencrypto/xform_comp.h Wed May 20 21:16:54 2020 (r361297) +++ head/sys/opencrypto/xform_comp.h Wed May 20 21:21:01 2020 (r361298) @@ -36,7 +36,6 @@ #include #include -#include /* Declarations */ struct comp_algo { Modified: head/sys/opencrypto/xform_enc.h ============================================================================== --- head/sys/opencrypto/xform_enc.h Wed May 20 21:16:54 2020 (r361297) +++ head/sys/opencrypto/xform_enc.h Wed May 20 21:21:01 2020 (r361298) @@ -36,7 +36,6 @@ #include #include #include -#include #define AESICM_BLOCKSIZE AES_BLOCK_LEN #define AES_XTS_BLOCKSIZE 16 @@ -47,22 +46,22 @@ struct enc_xform { int type; char *name; + size_t ctxsize; u_int16_t blocksize; /* Required input block size -- 1 for stream ciphers. */ u_int16_t ivsize; u_int16_t minkey, maxkey; - void (*encrypt) (caddr_t, u_int8_t *); - void (*decrypt) (caddr_t, u_int8_t *); - int (*setkey) (u_int8_t **, const u_int8_t *, int len); - void (*zerokey) (u_int8_t **); - void (*reinit) (caddr_t, const u_int8_t *); + void (*encrypt) (void *, const uint8_t *, uint8_t *); + void (*decrypt) (void *, const uint8_t *, uint8_t *); + int (*setkey) (void *, const uint8_t *, int len); + void (*reinit) (void *, const u_int8_t *); /* * Encrypt/decrypt 1+ blocks of input -- total size is 'len' bytes. * Len is guaranteed to be a multiple of the defined 'blocksize'. * Optional interface -- most useful for stream ciphers with a small * blocksize (1). */ - void (*encrypt_multi) (void *, uint8_t *, size_t len); - void (*decrypt_multi) (void *, uint8_t *, size_t len); + void (*encrypt_multi) (void *, const uint8_t *, uint8_t *, size_t len); + void (*decrypt_multi) (void *, const uint8_t *, uint8_t *, size_t len); }; Modified: head/sys/opencrypto/xform_gmac.c ============================================================================== --- head/sys/opencrypto/xform_gmac.c Wed May 20 21:16:54 2020 (r361297) +++ head/sys/opencrypto/xform_gmac.c Wed May 20 21:21:01 2020 (r361298) @@ -55,13 +55,12 @@ __FBSDID("$FreeBSD$"); /* Encryption instances */ struct enc_xform enc_xform_aes_nist_gmac = { - CRYPTO_AES_NIST_GMAC, "AES-GMAC", - AES_ICM_BLOCK_LEN, AES_GCM_IV_LEN, AES_MIN_KEY, AES_MAX_KEY, - NULL, - NULL, - NULL, - NULL, - NULL, + .type = CRYPTO_AES_NIST_GMAC, + .name = "AES-GMAC", + .blocksize = AES_ICM_BLOCK_LEN, + .ivsize = AES_GCM_IV_LEN, + .minkey = AES_MIN_KEY, + .maxkey = AES_MAX_KEY, }; /* Authentication instances */ Modified: head/sys/opencrypto/xform_null.c ============================================================================== --- head/sys/opencrypto/xform_null.c Wed May 20 21:16:54 2020 (r361297) +++ head/sys/opencrypto/xform_null.c Wed May 20 21:21:01 2020 (r361298) @@ -53,10 +53,8 @@ __FBSDID("$FreeBSD$"); #include #include -static int null_setkey(u_int8_t **, const u_int8_t *, int); -static void null_encrypt(caddr_t, u_int8_t *); -static void null_decrypt(caddr_t, u_int8_t *); -static void null_zerokey(u_int8_t **); +static int null_setkey(void *, const u_int8_t *, int); +static void null_crypt(void *, const uint8_t *, uint8_t *); static void null_init(void *); static void null_reinit(void *ctx, const u_int8_t *buf, u_int16_t len); @@ -65,14 +63,16 @@ static void null_final(u_int8_t *, void *); /* Encryption instances */ struct enc_xform enc_xform_null = { - CRYPTO_NULL_CBC, "NULL", + .type = CRYPTO_NULL_CBC, + .name = "NULL", /* NB: blocksize of 4 is to generate a properly aligned ESP header */ - NULL_BLOCK_LEN, 0, NULL_MIN_KEY, NULL_MAX_KEY, - null_encrypt, - null_decrypt, - null_setkey, - null_zerokey, - NULL, + .blocksize = NULL_BLOCK_LEN, + .ivsize = 0, + .minkey = NULL_MIN_KEY, + .maxkey = NULL_MAX_KEY, + .encrypt = null_crypt, + .decrypt = null_crypt, + .setkey = null_setkey, }; /* Authentication instances */ @@ -94,26 +94,14 @@ struct auth_hash auth_hash_null = { * Encryption wrapper routines. */ static void -null_encrypt(caddr_t key, u_int8_t *blk) +null_crypt(void *key, const uint8_t *in, uint8_t *out) { } -static void -null_decrypt(caddr_t key, u_int8_t *blk) -{ -} - static int -null_setkey(u_int8_t **sched, const u_int8_t *key, int len) +null_setkey(void *sched, const uint8_t *key, int len) { - *sched = NULL; - return 0; -} - -static void -null_zerokey(u_int8_t **sched) -{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 20 21:22: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 383F12F5C3A; Wed, 20 May 2020 21:22:26 +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 49S5LV0q1Xz3Zh2; Wed, 20 May 2020 21:22:26 +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 174DB22660; Wed, 20 May 2020 21:22:26 +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 04KLMPZS095662; Wed, 20 May 2020 21:22:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KLMPFK095661; Wed, 20 May 2020 21:22:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005202122.04KLMPFK095661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 May 2020 21:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361299 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 361299 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, 20 May 2020 21:22:26 -0000 Author: kib Date: Wed May 20 21:22:25 2020 New Revision: 361299 URL: https://svnweb.freebsd.org/changeset/base/361299 Log: Do not consider CAP_RDCL_NO as an indicator for all MDS vulnerabilities handled by hardware. Reported by: Anthony Steinhauser admbugs: 962 Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/x86/cpu_machdep.c Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Wed May 20 21:21:01 2020 (r361298) +++ head/sys/x86/x86/cpu_machdep.c Wed May 20 21:22:25 2020 (r361299) @@ -1078,11 +1078,11 @@ hw_mds_recalculate(void) * reported. For instance, hypervisor might unknowingly * filter the cap out. * For the similar reasons, and for testing, allow to enable - * mitigation even for RDCL_NO or MDS_NO caps. + * mitigation even when MDS_NO cap is set. */ if (cpu_vendor_id != CPU_VENDOR_INTEL || hw_mds_disable == 0 || - ((cpu_ia32_arch_caps & (IA32_ARCH_CAP_RDCL_NO | - IA32_ARCH_CAP_MDS_NO)) != 0 && hw_mds_disable == 3)) { + ((cpu_ia32_arch_caps & IA32_ARCH_CAP_MDS_NO) != 0 && + hw_mds_disable == 3)) { mds_handler = mds_handler_void; } else if (((cpu_stdext_feature3 & CPUID_STDEXT3_MD_CLEAR) != 0 && hw_mds_disable == 3) || hw_mds_disable == 1) { From owner-svn-src-all@freebsd.org Wed May 20 21:39: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 B09682F5C68; Wed, 20 May 2020 21:39:20 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S5k040pSz3bD3; Wed, 20 May 2020 21:39:20 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80685227BB; Wed, 20 May 2020 21:39:20 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KLdKm8001938; Wed, 20 May 2020 21:39:20 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KLdKS0001937; Wed, 20 May 2020 21:39:20 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <202005202139.04KLdKS0001937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 20 May 2020 21:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361300 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 361300 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, 20 May 2020 21:39:20 -0000 Author: dteske Date: Wed May 20 21:39:19 2020 New Revision: 361300 URL: https://svnweb.freebsd.org/changeset/base/361300 Log: Fix indentation in bsdinstall-created wpa_supplicant.conf PR: base/221982 Reported by: emaste Reviewed by: emaste, allanjude MFC after: 0 days X-MFC-to: stable/11 Differential Revision: https://reviews.freebsd.org/D23641 Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/wlanconfig Wed May 20 21:22:25 2020 (r361299) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Wed May 20 21:39:19 2020 (r361300) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn -# Copyright (c) 2013-2016 Devin Teske +# Copyright (c) 2013-2020 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -60,8 +60,7 @@ country_set() 'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \ "$WLAN_IFACE" "$BSDINSTALL_TMPETC" if [ "$error_str" ]; then - $DIALOG \ - --title "$msg_error" \ + $DIALOG --title "$msg_error" \ --backtitle "$DIALOG_BACKTITLE" \ --yes-label Change \ --no-label Ignore \ @@ -70,8 +69,7 @@ country_set() 0 0 || return $SUCCESS # Skip return $FAILURE # Restart else - awk 'sub(/^\t\t/,"")||1' \ - > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF + cat > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF create_args_$WLAN_IFACE="$ifconfig_args" EOF fi @@ -101,7 +99,8 @@ dialog_country_select() sub(/Country codes:/, ""), sub(/Regulatory.*/, "") { while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) { country = substr($0, RSTART) - sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", country) + sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", + country) code = substr(country, 1, 2) desc = substr(country, 4) sub(/[[:space:]]*$/, "", desc) @@ -153,7 +152,7 @@ dialog_country_select() : > "$BSDINSTALL_TMPETC/wpa_supplicant.conf" chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf" -cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF +cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ psk="$PASS" + \ priority=5 + } + EOF elif echo "$ENCRYPTION" | grep -q EAP; then USERPASS=$( $DIALOG \ --title "WPA-Enterprise Setup" \ @@ -300,19 +299,19 @@ elif echo "$ENCRYPTION" | grep -q EAP; then "Password" 3 0 "" 3 12 25 63 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=WPA-EAP$( + echo "$USERPASS" | awk ' + NR == 1 { printf "\n\tidentity=\"%s\"", $1 } + NR == 2 { printf "\n\tpassword=\"%s\"", $1 } + ' ) + \ priority=5 + } + EOF elif echo "$ENCRYPTION" | grep -q WEP; then WEPKEY=$( $DIALOG \ --title "WEP Setup" \ @@ -324,31 +323,31 @@ elif echo "$ENCRYPTION" | grep -q WEP; then "WEP Key 0" 2 0 "" 2 12 15 0 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=NONE + \ wep_key0="$WEPKEY" + \ wep_tx_keyidx=0 + \ priority=5 + } + EOF else # Open - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=NONE + \ priority=5 + } + EOF fi # Connect to any open networks policy -cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF +cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" < Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA45A2F652F; Wed, 20 May 2020 21:41:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S5md4j0hz3bmt; Wed, 20 May 2020 21:41:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 833FA2296C; Wed, 20 May 2020 21:41:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KLfbci003565; Wed, 20 May 2020 21:41:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KLfbP6003562; Wed, 20 May 2020 21:41:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005202141.04KLfbP6003562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 May 2020 21:41:37 +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: r361301 - in stable/12: contrib/elftoolchain/common contrib/elftoolchain/libelftc lib/libelf X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/12: contrib/elftoolchain/common contrib/elftoolchain/libelftc lib/libelf X-SVN-Commit-Revision: 361301 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, 20 May 2020 21:41:37 -0000 Author: emaste Date: Wed May 20 21:41:36 2020 New Revision: 361301 URL: https://svnweb.freebsd.org/changeset/base/361301 Log: MFC r349577 (arichardson): Allow bootstrapping elftoolchain on MacOS and Linux This is required in order to build on non-FreeBSD systems without setting all the XAR/XSTRINGS/etc. variables Modified: stable/12/contrib/elftoolchain/common/_elftc.h stable/12/contrib/elftoolchain/libelftc/elftc_set_timestamps.c stable/12/lib/libelf/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/common/_elftc.h ============================================================================== --- stable/12/contrib/elftoolchain/common/_elftc.h Wed May 20 21:39:19 2020 (r361300) +++ stable/12/contrib/elftoolchain/common/_elftc.h Wed May 20 21:41:36 2020 (r361301) @@ -374,11 +374,14 @@ extern const char *__progname; #include #define htobe32(x) OSSwapHostToBigInt32(x) +#define htole32(x) OSSwapHostToLittleInt32(x) +#ifndef roundup2 #define roundup2 roundup +#endif -#define ELFTC_BYTE_ORDER _BYTE_ORDER -#define ELFTC_BYTE_ORDER_LITTLE_ENDIAN _LITTLE_ENDIAN -#define ELFTC_BYTE_ORDER_BIG_ENDIAN _BIG_ENDIAN +#define ELFTC_BYTE_ORDER __DARWIN_BYTE_ORDER +#define ELFTC_BYTE_ORDER_LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN +#define ELFTC_BYTE_ORDER_BIG_ENDIAN __DARWIN_BIG_ENDIAN #define ELFTC_HAVE_MMAP 1 #define ELFTC_HAVE_STRMODE 1 @@ -418,7 +421,9 @@ extern const char *__progname; /* Whether we need to supply {be,le}32dec. */ #define ELFTC_NEED_BYTEORDER_EXTENSIONS 1 +#ifndef roundup2 #define roundup2 roundup +#endif #endif /* __GLIBC__ || __linux__ */ Modified: stable/12/contrib/elftoolchain/libelftc/elftc_set_timestamps.c ============================================================================== --- stable/12/contrib/elftoolchain/libelftc/elftc_set_timestamps.c Wed May 20 21:39:19 2020 (r361300) +++ stable/12/contrib/elftoolchain/libelftc/elftc_set_timestamps.c Wed May 20 21:41:36 2020 (r361301) @@ -37,7 +37,7 @@ ELFTC_VCSID("$Id$"); * stat'. */ -#if defined(__FreeBSD__) || defined(__NetBSD__) +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) #define ATIME st_atimespec #define MTIME st_mtimespec #define LIBELFTC_HAVE_UTIMES 1 Modified: stable/12/lib/libelf/Makefile ============================================================================== --- stable/12/lib/libelf/Makefile Wed May 20 21:39:19 2020 (r361300) +++ stable/12/lib/libelf/Makefile Wed May 20 21:41:36 2020 (r361301) @@ -79,6 +79,13 @@ INCS= libelf.h gelf.h # SRCS+= sys/elf32.h sys/elf64.h sys/elf_common.h +# Allow bootstrapping elftoolchain on Linux: +.if defined(BOOTSTRAPPING) && ${.MAKE.OS} == "Linux" +native-elf-format.h: + ${ELFTCDIR}/common/native-elf-format > ${.TARGET} || rm ${.TARGET} +SRCS+= native-elf-format.h +.endif + GENSRCS= libelf_fsize.c libelf_msize.c libelf_convert.c CLEANFILES= ${GENSRCS} CLEANDIRS= sys From owner-svn-src-all@freebsd.org Wed May 20 22:00: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 506972F60EC; Wed, 20 May 2020 22:00: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 49S6BT1T35z3cZ7; Wed, 20 May 2020 22:00: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 2DC6222DF3; Wed, 20 May 2020 22:00: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 04KM0XTu014999; Wed, 20 May 2020 22:00:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KM0VbJ014990; Wed, 20 May 2020 22:00:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005202200.04KM0VbJ014990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 May 2020 22:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361302 - in head: share/man/man7 sys/amd64/amd64 sys/i386/i386 sys/x86/include sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: share/man/man7 sys/amd64/amd64 sys/i386/i386 sys/x86/include sys/x86/x86 X-SVN-Commit-Revision: 361302 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, 20 May 2020 22:00:33 -0000 Author: kib Date: Wed May 20 22:00:31 2020 New Revision: 361302 URL: https://svnweb.freebsd.org/changeset/base/361302 Log: amd64: Add a knob to flush RSB on context switches if machine has SMEP. The flush is needed to prevent cross-process ret2spec, which is not handled on kernel entry if IBPB is enabled but SMEP is present. While there, add i386 RSB flush. Reported by: Anthony Steinhauser Reviewed by: markj, Anthony Steinhauser Discussed with: philip admbugs: 961 Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/share/man/man7/security.7 head/sys/amd64/amd64/cpu_switch.S head/sys/amd64/amd64/initcpu.c head/sys/amd64/amd64/support.S head/sys/i386/i386/support.s head/sys/x86/include/x86_var.h head/sys/x86/x86/cpu_machdep.c Modified: head/share/man/man7/security.7 ============================================================================== --- head/share/man/man7/security.7 Wed May 20 21:41:36 2020 (r361301) +++ head/share/man/man7/security.7 Wed May 20 22:00:31 2020 (r361302) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 4, 2020 +.Dd May 16, 2020 .Dt SECURITY 7 .Os .Sh NAME @@ -992,6 +992,13 @@ See also .Xr proccontrol 1 mode .Dv kpti . +.It Dv machdep.mitigations.flush_rsb_ctxsw +amd64. +Controls Return Stack Buffer flush on context switch, to prevent +cross-process ret2spec attacks. +Only needed, and only enabled by default, if the machine +supports SMEP, otherwise IBRS would do necessary flushing on kernel +entry anyway. .It Dv hw.mds_disable amd64 and i386. Controls Microarchitectural Data Sampling hardware information leak Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Wed May 20 21:41:36 2020 (r361301) +++ head/sys/amd64/amd64/cpu_switch.S Wed May 20 22:00:31 2020 (r361302) @@ -221,6 +221,8 @@ done_load_dr: movq %rax,(%rsp) movq PCPU(CURTHREAD),%rdi call fpu_activate_sw + cmpb $0,cpu_flush_rsb_ctxsw(%rip) + jne rsb_flush ret /* Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Wed May 20 21:41:36 2020 (r361301) +++ head/sys/amd64/amd64/initcpu.c Wed May 20 22:00:31 2020 (r361302) @@ -238,12 +238,24 @@ initializecpu(void) cr4 |= CR4_PKE; /* + * If SMEP is present, we only need to flush RSB (by default) + * on context switches, to prevent cross-process ret2spec + * attacks. Do it automatically if ibrs_disable is set, to + * complete the mitigation. + * * Postpone enabling the SMEP on the boot CPU until the page * tables are switched from the boot loader identity mapping * to the kernel tables. The boot loader enables the U bit in * its tables. */ - if (!IS_BSP()) { + if (IS_BSP()) { + if (cpu_stdext_feature & CPUID_STDEXT_SMEP && + !TUNABLE_INT_FETCH( + "machdep.mitigations.cpu_flush_rsb_ctxsw", + &cpu_flush_rsb_ctxsw) && + hw_ibrs_disable) + cpu_flush_rsb_ctxsw = 1; + } else { if (cpu_stdext_feature & CPUID_STDEXT_SMEP) cr4 |= CR4_SMEP; if (cpu_stdext_feature & CPUID_STDEXT_SMAP) Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Wed May 20 21:41:36 2020 (r361301) +++ head/sys/amd64/amd64/support.S Wed May 20 22:00:31 2020 (r361302) @@ -1613,23 +1613,27 @@ ENTRY(pmap_pti_pcid_invlrng) retq .altmacro - .macro ibrs_seq_label l -handle_ibrs_\l: + .macro rsb_seq_label l +rsb_seq_\l: .endm - .macro ibrs_call_label l - call handle_ibrs_\l + .macro rsb_call_label l + call rsb_seq_\l .endm - .macro ibrs_seq count + .macro rsb_seq count ll=1 .rept \count - ibrs_call_label %(ll) + rsb_call_label %(ll) nop - ibrs_seq_label %(ll) + rsb_seq_label %(ll) addq $8,%rsp ll=ll+1 .endr .endm +ENTRY(rsb_flush) + rsb_seq 32 + ret + /* all callers already saved %rax, %rdx, and %rcx */ ENTRY(handle_ibrs_entry) cmpb $0,hw_ibrs_ibpb_active(%rip) @@ -1641,8 +1645,7 @@ ENTRY(handle_ibrs_entry) wrmsr movb $1,PCPU(IBPB_SET) testl $CPUID_STDEXT_SMEP,cpu_stdext_feature(%rip) - jne 1f - ibrs_seq 32 + je rsb_flush 1: ret END(handle_ibrs_entry) Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Wed May 20 21:41:36 2020 (r361301) +++ head/sys/i386/i386/support.s Wed May 20 22:00:31 2020 (r361302) @@ -445,6 +445,28 @@ msr_onfault: movl $EFAULT,%eax ret + .altmacro + .macro rsb_seq_label l +rsb_seq_\l: + .endm + .macro rsb_call_label l + call rsb_seq_\l + .endm + .macro rsb_seq count + ll=1 + .rept \count + rsb_call_label %(ll) + nop + rsb_seq_label %(ll) + addl $4,%esp + ll=ll+1 + .endr + .endm + +ENTRY(rsb_flush) + rsb_seq 32 + ret + ENTRY(handle_ibrs_entry) cmpb $0,hw_ibrs_ibpb_active je 1f @@ -455,10 +477,9 @@ ENTRY(handle_ibrs_entry) wrmsr movb $1,PCPU(IBPB_SET) /* - * i386 does not implement SMEP, but the 4/4 split makes this not - * that important. + * i386 does not implement SMEP. */ -1: ret +1: jmp rsb_flush END(handle_ibrs_entry) ENTRY(handle_ibrs_exit) Modified: head/sys/x86/include/x86_var.h ============================================================================== --- head/sys/x86/include/x86_var.h Wed May 20 21:41:36 2020 (r361301) +++ head/sys/x86/include/x86_var.h Wed May 20 22:00:31 2020 (r361302) @@ -94,6 +94,7 @@ extern int hw_ibrs_ibpb_active; extern int hw_mds_disable; extern int hw_ssb_active; extern int x86_taa_enable; +extern int cpu_flush_rsb_ctxsw; struct pcb; struct thread; Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Wed May 20 21:41:36 2020 (r361301) +++ head/sys/x86/x86/cpu_machdep.c Wed May 20 22:00:31 2020 (r361302) @@ -1397,6 +1397,11 @@ SYSCTL_PROC(_machdep_mitigations_taa, OID_AUTO, state, sysctl_taa_state_handler, "A", "TAA Mitigation state"); +int __read_frequently cpu_flush_rsb_ctxsw; +SYSCTL_INT(_machdep_mitigations, OID_AUTO, flush_rsb_ctxsw, + CTLFLAG_RW | CTLFLAG_NOFETCH, &cpu_flush_rsb_ctxsw, 0, + "Flush Return Stack Buffer on context switch"); + /* * Enable and restore kernel text write permissions. * Callers must ensure that disable_wp()/restore_wp() are executed From owner-svn-src-all@freebsd.org Wed May 20 22:05: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 29B1C2F6899; Wed, 20 May 2020 22:05:25 +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 49S6J41N1Zz3d16; Wed, 20 May 2020 22:05:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 04KM59th038381 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 21 May 2020 01:05:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 04KM59th038381 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 04KM593T038379; Thu, 21 May 2020 01:05:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 21 May 2020 01:05:09 +0300 From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r361302 - in head: share/man/man7 sys/amd64/amd64 sys/i386/i386 sys/x86/include sys/x86/x86 Message-ID: <20200520220509.GA64045@kib.kiev.ua> References: <202005202200.04KM0VbJ014990@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202005202200.04KM0VbJ014990@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: 49S6J41N1Zz3d16 X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [2.75 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; NEURAL_SPAM_MEDIUM(0.96)[0.959]; NEURAL_SPAM_SHORT(0.85)[0.849]; NEURAL_SPAM_LONG(0.94)[0.939]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 20 May 2020 22:05:25 -0000 On Wed, May 20, 2020 at 10:00:31PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Wed May 20 22:00:31 2020 > New Revision: 361302 > URL: https://svnweb.freebsd.org/changeset/base/361302 > > Log: > amd64: Add a knob to flush RSB on context switches if machine has SMEP. > > The flush is needed to prevent cross-process ret2spec, which is not handled > on kernel entry if IBPB is enabled but SMEP is present. > While there, add i386 RSB flush. > > Reported by: Anthony Steinhauser > Reviewed by: markj, Anthony Steinhauser > Discussed with: philip > admbugs: 961 > Sponsored by: The FreeBSD Foundation > MFC after: 1 week https://reviews.freebsd.org/D24868 From owner-svn-src-all@freebsd.org Wed May 20 22:08: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 4F6052F67B7; Wed, 20 May 2020 22:08:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S6Mb1S76z3dCV; Wed, 20 May 2020 22:08:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D0A223285; Wed, 20 May 2020 22:08: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 04KM8RVd020710; Wed, 20 May 2020 22:08:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KM8QPA020707; Wed, 20 May 2020 22:08:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005202208.04KM8QPA020707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 May 2020 22:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libc/gen libexec/rtld-elf sys/sys X-SVN-Commit-Revision: 361303 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, 20 May 2020 22:08:27 -0000 Author: kib Date: Wed May 20 22:08:26 2020 New Revision: 361303 URL: https://svnweb.freebsd.org/changeset/base/361303 Log: Change the samantic of struct link_map l_addr member. It previously returned the object map base address, while all other ELF operating systems return load offset, i.e. the difference between map base and the link base. Explain the meaning of the field in the man page. Stop filling the mips-only l_offs member, which is apparently unused. PR: 246561 Requested by: Damjan Jovanovic Reviewed by: emaste, jhb, cem (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24918 Modified: head/lib/libc/gen/dlinfo.3 head/libexec/rtld-elf/rtld.c head/sys/sys/link_elf.h Modified: head/lib/libc/gen/dlinfo.3 ============================================================================== --- head/lib/libc/gen/dlinfo.3 Wed May 20 22:00:31 2020 (r361302) +++ head/lib/libc/gen/dlinfo.3 Wed May 20 22:08:26 2020 (r361303) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 14, 2003 +.Dd May 19, 2020 .Dt DLINFO 3 .Os .Sh NAME @@ -105,7 +105,7 @@ structure is defined in .In link.h and has the following members: .Bd -literal -offset indent -caddr_t l_addr; /* Base Address of library */ +caddr_t l_addr; /* Load Offset of library */ const char *l_name; /* Absolute Path to Library */ const void *l_ld; /* Pointer to .dynamic in memory */ struct link_map *l_next, /* linked list of mapped libs */ @@ -113,7 +113,9 @@ struct link_map *l_next, /* linked list of mapped li .Ed .Bl -tag -width ".Va l_addr" .It Va l_addr -The base address of the object loaded into memory. +The load offset of the object, that is, the difference between +the actual load address and the base virtual address the object +was linked at. .It Va l_name The full name of the loaded shared object. .It Va l_ld Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed May 20 22:00:31 2020 (r361302) +++ head/libexec/rtld-elf/rtld.c Wed May 20 22:08:26 2020 (r361303) @@ -4032,12 +4032,8 @@ linkmap_add(Obj_Entry *obj) struct link_map *prev; obj->linkmap.l_name = obj->path; - obj->linkmap.l_addr = obj->mapbase; + obj->linkmap.l_addr = obj->relocbase; obj->linkmap.l_ld = obj->dynamic; -#ifdef __mips__ - /* GDB needs load offset on MIPS to use the symbols */ - obj->linkmap.l_offs = obj->relocbase; -#endif if (r_debug.r_map == NULL) { r_debug.r_map = l; Modified: head/sys/sys/link_elf.h ============================================================================== --- head/sys/sys/link_elf.h Wed May 20 22:00:31 2020 (r361302) +++ head/sys/sys/link_elf.h Wed May 20 22:08:26 2020 (r361303) @@ -57,9 +57,9 @@ #define LA_SER_SECURE 0x80 /* default (secure) path prepended */ typedef struct link_map { - caddr_t l_addr; /* Base Address of library */ + caddr_t l_addr; /* Load Offset of library */ #ifdef __mips__ - caddr_t l_offs; /* Load Offset of library */ + caddr_t l_xxx; /* unused */ #endif const char *l_name; /* Absolute Path to Library */ const void *l_ld; /* Pointer to .dynamic in memory */ From owner-svn-src-all@freebsd.org Wed May 20 22:19: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 BEF0C2F67FD; Wed, 20 May 2020 22:19:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S6cb4dC1z3dWh; Wed, 20 May 2020 22:19:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95CFB23122; Wed, 20 May 2020 22:19:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KMJhwL026668; Wed, 20 May 2020 22:19:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KMJhig026667; Wed, 20 May 2020 22:19:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005202219.04KMJhig026667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 May 2020 22:19:43 +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: r361304 - stable/12/contrib/elftoolchain/libelf X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/contrib/elftoolchain/libelf X-SVN-Commit-Revision: 361304 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, 20 May 2020 22:19:43 -0000 Author: emaste Date: Wed May 20 22:19:43 2020 New Revision: 361304 URL: https://svnweb.freebsd.org/changeset/base/361304 Log: MFC r361104 (jhibbits): elftoolchain: Add powerpc64 definition powerpc is already in place, but powerpc64 is needed separately. Modified: stable/12/contrib/elftoolchain/libelf/_libelf_config.h Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/libelf/_libelf_config.h ============================================================================== --- stable/12/contrib/elftoolchain/libelf/_libelf_config.h Wed May 20 22:08:26 2020 (r361303) +++ stable/12/contrib/elftoolchain/libelf/_libelf_config.h Wed May 20 22:19:43 2020 (r361304) @@ -91,6 +91,12 @@ #endif #define LIBELF_CLASS ELFCLASS32 +#elif defined(__powerpc64__) + +#define LIBELF_ARCH EM_PPC64 +#define LIBELF_BYTEORDER ELFDATA2MSB +#define LIBELF_CLASS ELFCLASS64 + #elif defined(__powerpc__) #define LIBELF_ARCH EM_PPC From owner-svn-src-all@freebsd.org Wed May 20 22:20: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 623CE2F6E83; Wed, 20 May 2020 22:20:54 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S6dy22M5z3dp1; Wed, 20 May 2020 22:20:54 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40F3922E6F; Wed, 20 May 2020 22:20:54 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KMKswX028742; Wed, 20 May 2020 22:20:54 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KMKsdj028741; Wed, 20 May 2020 22:20:54 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <202005202220.04KMKsdj028741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 20 May 2020 22:20:54 +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: r361305 - stable/11/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-11 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: stable/11/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 361305 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, 20 May 2020 22:20:54 -0000 Author: dteske Date: Wed May 20 22:20:53 2020 New Revision: 361305 URL: https://svnweb.freebsd.org/changeset/base/361305 Log: MFC r361300: Fix indentation in bsdinstall-created wpa_supplicant.conf PR: base/221982 Reported by: emaste Reviewed by: emaste, allanjude Differential Revision: https://reviews.freebsd.org/D23641 Modified: stable/11/usr.sbin/bsdinstall/scripts/wlanconfig Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdinstall/scripts/wlanconfig ============================================================================== --- stable/11/usr.sbin/bsdinstall/scripts/wlanconfig Wed May 20 22:19:43 2020 (r361304) +++ stable/11/usr.sbin/bsdinstall/scripts/wlanconfig Wed May 20 22:20:53 2020 (r361305) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn -# Copyright (c) 2013-2016 Devin Teske +# Copyright (c) 2013-2020 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -60,8 +60,7 @@ country_set() 'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \ "$WLAN_IFACE" "$BSDINSTALL_TMPETC" if [ "$error_str" ]; then - $DIALOG \ - --title "$msg_error" \ + $DIALOG --title "$msg_error" \ --backtitle "$DIALOG_BACKTITLE" \ --yes-label Change \ --no-label Ignore \ @@ -70,8 +69,7 @@ country_set() 0 0 || return $SUCCESS # Skip return $FAILURE # Restart else - awk 'sub(/^\t\t/,"")||1' \ - > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF + cat > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF create_args_$WLAN_IFACE="$ifconfig_args" EOF fi @@ -101,7 +99,8 @@ dialog_country_select() sub(/Country codes:/, ""), sub(/Regulatory.*/, "") { while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) { country = substr($0, RSTART) - sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", country) + sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", + country) code = substr(country, 1, 2) desc = substr(country, 4) sub(/[[:space:]]*$/, "", desc) @@ -153,7 +152,7 @@ dialog_country_select() : > "$BSDINSTALL_TMPETC/wpa_supplicant.conf" chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf" -cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF +cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ psk="$PASS" + \ priority=5 + } + EOF elif echo "$ENCRYPTION" | grep -q EAP; then USERPASS=$( $DIALOG \ --title "WPA-Enterprise Setup" \ @@ -300,19 +299,19 @@ elif echo "$ENCRYPTION" | grep -q EAP; then "Password" 3 0 "" 3 12 25 63 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=WPA-EAP$( + echo "$USERPASS" | awk ' + NR == 1 { printf "\n\tidentity=\"%s\"", $1 } + NR == 2 { printf "\n\tpassword=\"%s\"", $1 } + ' ) + \ priority=5 + } + EOF elif echo "$ENCRYPTION" | grep -q WEP; then WEPKEY=$( $DIALOG \ --title "WEP Setup" \ @@ -324,31 +323,31 @@ elif echo "$ENCRYPTION" | grep -q WEP; then "WEP Key 0" 2 0 "" 2 12 15 0 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=NONE + \ wep_key0="$WEPKEY" + \ wep_tx_keyidx=0 + \ priority=5 + } + EOF else # Open - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=NONE + \ priority=5 + } + EOF fi # Connect to any open networks policy -cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF +cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" < Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7036A2F6D54; Wed, 20 May 2020 22:22:58 +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 49S6hL2LlMz3fBL; Wed, 20 May 2020 22:22:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:c7d:9a4b:586:998a]) (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 D615312427; Wed, 20 May 2020 22:22:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005202208.04KM8QPA020707@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: Wed, 20 May 2020 15:22:56 -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: <202005202208.04KM8QPA020707@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: Wed, 20 May 2020 22:22:58 -0000 On 5/20/20 3:08 PM, Konstantin Belousov wrote: > Author: kib > Date: Wed May 20 22:08:26 2020 > New Revision: 361303 > URL: https://svnweb.freebsd.org/changeset/base/361303 > > Log: > Change the samantic of struct link_map l_addr member. > > It previously returned the object map base address, while all other > ELF operating systems return load offset, i.e. the difference between > map base and the link base. > > Explain the meaning of the field in the man page. > > Stop filling the mips-only l_offs member, which is apparently unused. Thanks! -- John Baldwin From owner-svn-src-all@freebsd.org Wed May 20 22:25: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 DC9992F6DC6; Wed, 20 May 2020 22:25:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S6lT5Mbqz3fNh; Wed, 20 May 2020 22:25:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEC382304B; Wed, 20 May 2020 22:25:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KMPfP6033287; Wed, 20 May 2020 22:25:41 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KMPfoF033285; Wed, 20 May 2020 22:25:41 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005202225.04KMPfoF033285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 20 May 2020 22:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361306 - in head: stand/libsa/geli sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: stand/libsa/geli sys/opencrypto X-SVN-Commit-Revision: 361306 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, 20 May 2020 22:25:41 -0000 Author: jhb Date: Wed May 20 22:25:41 2020 New Revision: 361306 URL: https://svnweb.freebsd.org/changeset/base/361306 Log: Fix libstand build breakage after r361298. - Use enc_xform_aes_xts.setkey() directly instead of duplicating the code now that it no longer calls malloc(). - Rather than bringing back all of xform_userland.h, add a conditional #include of to xform_enc.h. - Update calls to encrypt/decrypt callbacks in enc_xform_aes_xts for separate input/output pointers. Pointy hat to: jhb Modified: head/stand/libsa/geli/geliboot_crypto.c head/sys/opencrypto/xform_enc.h Modified: head/stand/libsa/geli/geliboot_crypto.c ============================================================================== --- head/stand/libsa/geli/geliboot_crypto.c Wed May 20 22:20:53 2020 (r361305) +++ head/stand/libsa/geli/geliboot_crypto.c Wed May 20 22:25:41 2020 (r361306) @@ -78,20 +78,20 @@ geliboot_crypt(u_int algo, int enc, u_char *data, size xts_len = keysize << 1; ctxp = &xtsctx; - rijndael_set_key(&ctxp->key1, key, xts_len / 2); - rijndael_set_key(&ctxp->key2, key + (xts_len / 16), xts_len / 2); + enc_xform_aes_xts.setkey(ctxp, key, xts_len / 8); + enc_xform_aes_xts.reinit(ctxp, iv); - enc_xform_aes_xts.reinit((caddr_t)ctxp, iv); - switch (enc) { case 0: /* decrypt */ for (i = 0; i < datasize; i += AES_XTS_BLOCKSIZE) { - enc_xform_aes_xts.decrypt((caddr_t)ctxp, data + i); + enc_xform_aes_xts.decrypt(ctxp, data + i, + data + i); } break; case 1: /* encrypt */ for (i = 0; i < datasize; i += AES_XTS_BLOCKSIZE) { - enc_xform_aes_xts.encrypt((caddr_t)ctxp, data + i); + enc_xform_aes_xts.encrypt(ctxp, data + i, + data + 1); } break; } Modified: head/sys/opencrypto/xform_enc.h ============================================================================== --- head/sys/opencrypto/xform_enc.h Wed May 20 22:20:53 2020 (r361305) +++ head/sys/opencrypto/xform_enc.h Wed May 20 22:25:41 2020 (r361306) @@ -36,6 +36,9 @@ #include #include #include +#ifdef _STANDALONE +#include +#endif #define AESICM_BLOCKSIZE AES_BLOCK_LEN #define AES_XTS_BLOCKSIZE 16 From owner-svn-src-all@freebsd.org Wed May 20 22:25: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 5DD272F6EBB; Wed, 20 May 2020 22:25:51 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S6lf2b7Xz3fGJ; Wed, 20 May 2020 22:25:50 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D57AE232CB; Wed, 20 May 2020 22:25:49 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KMPnu3033356; Wed, 20 May 2020 22:25:49 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KMPkUp033338; Wed, 20 May 2020 22:25:46 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <202005202225.04KMPkUp033338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Wed, 20 May 2020 22:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361307 - in head: contrib/bmake contrib/bmake/filemon contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head: contrib/bmake contrib/bmake/filemon contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake X-SVN-Commit-Revision: 361307 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, 20 May 2020 22:25:51 -0000 Author: sjg Date: Wed May 20 22:25:46 2020 New Revision: 361307 URL: https://svnweb.freebsd.org/changeset/base/361307 Log: Merge bmake-20200517 Changes since 20181221 are mostly portability related hence the large gap in versions imported. There are however some bug fixes, and a rework of filemon handling. In NetBSD make/filemon/filemon_ktrace.c allows use of fktrace and elimination of filemon(4) which has not had the TLC it needs. FreeBSD filemon(4) is in much better shape, so bmake/filemon/filemon_dev.c allows use of that, with a bit less overhead than the ktrace model. Summary of changes from ChangeLog o str.c: empty string does not match % pattern plus unit-test changes o var.c: import handling of old sysV style modifier using '%' o str.c: refactor brk_string o meta.c: meta_oodate, CHECK_VALID_META is too aggressive for CMD a blank command is perfectly valid. o meta.c: meta_oodate, check for corrupted meta file earlier and more often. * meta.c: meta_compat_parent check for USE_FILEMON patch from Soeren Tempel o meta.c: fix compat mode, need to call meta_job_output() o job.c: extra fds for meta mode not needed if using filemon_dev o meta.c: avoid passing NULL to filemon_*() when meta_needed() returns FALSE. o filemon/filemon_{dev,ktrace}.c: allow selection of filemon implementation. filemon_dev.c uses the kernel module while filemon_ktrace.c leverages the fktrace api available in NetBSD. filemon_ktrace.c can hopefully form the basis for adding support for other tracing mechanisms such as strace on Linux. o meta.c: when target is out-of-date per normal make rules record value of .OODATE in meta file. o parse.c: don't pass NULL to realpath(3) some versions cannot handle it. o parse.c: ParseDoDependency: free paths rather than assert plus more unit-tests Added: head/contrib/bmake/filemon/ - copied from r361291, vendor/NetBSD/bmake/dist/filemon/ head/contrib/bmake/mk/compiler.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/mk/compiler.mk head/contrib/bmake/mk/dirdeps-targets.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/mk/dirdeps-targets.mk head/contrib/bmake/unit-tests/Makefile - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/Makefile head/contrib/bmake/unit-tests/Makefile.config.in - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/Makefile.config.in head/contrib/bmake/unit-tests/cond-late.exp - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/cond-late.exp head/contrib/bmake/unit-tests/cond-late.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/cond-late.mk head/contrib/bmake/unit-tests/dollar.exp - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/dollar.exp head/contrib/bmake/unit-tests/dollar.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/dollar.mk head/contrib/bmake/unit-tests/include-main.exp - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/include-main.exp head/contrib/bmake/unit-tests/include-main.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/include-main.mk head/contrib/bmake/unit-tests/include-sub.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/include-sub.mk head/contrib/bmake/unit-tests/include-subsub.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/include-subsub.mk head/contrib/bmake/unit-tests/varmod-edge.exp - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/varmod-edge.exp head/contrib/bmake/unit-tests/varmod-edge.mk - copied unchanged from r361291, vendor/NetBSD/bmake/dist/unit-tests/varmod-edge.mk Deleted: head/contrib/bmake/unit-tests/Makefile.in Modified: head/contrib/bmake/ChangeLog head/contrib/bmake/FILES head/contrib/bmake/Makefile head/contrib/bmake/Makefile.config.in head/contrib/bmake/VERSION head/contrib/bmake/arch.c head/contrib/bmake/boot-strap head/contrib/bmake/bsd.after-import.mk head/contrib/bmake/compat.c head/contrib/bmake/config.h.in head/contrib/bmake/configure head/contrib/bmake/configure.in head/contrib/bmake/job.c head/contrib/bmake/make-bootstrap.sh.in head/contrib/bmake/make.1 head/contrib/bmake/make.h head/contrib/bmake/meta.c head/contrib/bmake/meta.h head/contrib/bmake/mk/ChangeLog head/contrib/bmake/mk/FILES head/contrib/bmake/mk/autodep.mk head/contrib/bmake/mk/dirdeps.mk head/contrib/bmake/mk/doc.mk head/contrib/bmake/mk/dpadd.mk head/contrib/bmake/mk/gendirdeps.mk head/contrib/bmake/mk/init.mk head/contrib/bmake/mk/install-mk head/contrib/bmake/mk/lib.mk head/contrib/bmake/mk/meta.stage.mk head/contrib/bmake/mk/meta.sys.mk head/contrib/bmake/mk/meta2deps.py head/contrib/bmake/mk/options.mk head/contrib/bmake/mk/sys.mk head/contrib/bmake/mk/sys.vars.mk head/contrib/bmake/mk/sys/AIX.mk head/contrib/bmake/mk/sys/Darwin.mk head/contrib/bmake/mk/sys/Generic.mk head/contrib/bmake/mk/sys/HP-UX.mk head/contrib/bmake/mk/sys/IRIX.mk head/contrib/bmake/mk/sys/Linux.mk head/contrib/bmake/mk/sys/NetBSD.mk head/contrib/bmake/mk/sys/OSF1.mk head/contrib/bmake/mk/sys/OpenBSD.mk head/contrib/bmake/mk/sys/SunOS.mk head/contrib/bmake/mk/sys/UnixWare.mk head/contrib/bmake/mk/whats.mk head/contrib/bmake/nonints.h head/contrib/bmake/parse.c head/contrib/bmake/str.c head/contrib/bmake/unit-tests/escape.mk head/contrib/bmake/unit-tests/forloop.exp head/contrib/bmake/unit-tests/forloop.mk head/contrib/bmake/unit-tests/modorder.mk head/contrib/bmake/unit-tests/sysv.exp head/contrib/bmake/unit-tests/sysv.mk head/contrib/bmake/util.c head/contrib/bmake/var.c head/usr.bin/bmake/Makefile head/usr.bin/bmake/Makefile.config head/usr.bin/bmake/Makefile.depend head/usr.bin/bmake/config.h Directory Properties: head/contrib/bmake/ (props changed) Modified: head/contrib/bmake/ChangeLog ============================================================================== --- head/contrib/bmake/ChangeLog Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/ChangeLog Wed May 20 22:25:46 2020 (r361307) @@ -1,3 +1,138 @@ +2020-05-17 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200517 + Merge with NetBSD make, pick up + o modified dollar tests to avoid shell dependencies + o new tests for .INCLUDEFROM + +2020-05-16 Simon J Gerraty + + * unit-tests/dollar.mk: tweak '1 dollar literal' test + to not depend so much on shell behavior + +2020-05-10 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200510 + Merge with NetBSD make, pick up + o unit test for dollar handling + +2020-05-06 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200506 + Merge with NetBSD make, pick up + o str.c: empty string does not match % pattern + plus unit-test changes + +2020-05-04 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200504 + May the 4th be with you + Merge with NetBSD make, pick up + o var.c: import handling of old sysV style modifier using '%' + o str.c: refactor brk_string + o unit-tests: add test case for lazy conditions + +2020-04-18 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200418 + + * configure.in: use_makefile=no for cygwin et al. + case insensitive filesystems just don't work if both + makefile and Makefile exist. + NOTE: bmake does not support cygwin and likely never will, + but if brave souls want to try it - help them out. + +2020-04-02 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200402 + Merge with NetBSD make, pick up + o meta.c: meta_oodate, CHECK_VALID_META is too aggressive for CMD + a blank command is perfectly valid. + +2020-03-30 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200330 + Merge with NetBSD make, pick up + o make.h: extern debug_file + +2020-03-18 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200318 + Merge with NetBSD make, pick up + o meta.c: meta_oodate, check for corrupted meta file + earlier and more often. + +2020-02-20 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200220 + +2020-02-19 Simon J Gerraty + + * boot-strap: unset MAKEFLAGS + +2020-02-12 Simon J Gerraty + + * VERSION (_MAKE_VERSION): 20200212 + * meta.c: meta_compat_parent check for USE_FILEMON + patch from Soeren Tempel + +2020-02-05 Simon J Gerraty + + * VERSION: 20200205 + Merge with NetBSD make, pick up + o meta.c: fix compat mode, need to call meta_job_output() + o job.c: extra fds for meta mode not needed if using filemon_dev + +2020-01-22 Simon J Gerraty + + * VERSION: 20200122 + Merge with NetBSD make, pick up + o meta.c: avoid passing NULL to filemon_*() when meta_needed() + returns FALSE. + +2020-01-21 Simon J Gerraty + + * VERSION: 20200121 + Merge with NetBSD make, pick up + o filemon/filemon_{dev,ktrace}.c: allow selection of + filemon implementation. filemon_dev.c uses the kernel module + while filemon_ktrace.c leverages the fktrace api available in + NetBSD. filemon_ktrace.c can hopefully form the basis for + adding support for other tracing mechanisms such as strace on + Linux. + o meta.c: when target is out-of-date per normal make rules + record value of .OODATE in meta file. + +2019-09-26 Simon J Gerraty + + * VERSION: 20190926 + Merge with NetBSD make, pick up + o parse.c: don't pass NULL to realpath(3) + some versions cannot handle it. + +2019-04-09 Simon J Gerraty + + * VERSION: 20190409 + Merge with NetBSD make, pick up + o parse.c: ParseDoDependency: free paths rather than assert + +2018-12-22 Simon J Gerraty + + * VERSION: 20181222 + + * configure.in: add --without-makefile to avoid generating + makefile and make-bootstrap.sh + + * include Makefile.inc if it exists + + * Use Makefile and Makefile.config.in in unit-tests + so we can use just: make obj && make && make test + when bmake is already available. + We add --without-makefile to CONFIGURE_ARGS in this case. + + * tweak bsd.after-import.mk (captures Makefile.config etc + after import to FreeBSD for example) to cope with all the above. + 2018-12-21 Simon J Gerraty * VERSION: 20181221 Modified: head/contrib/bmake/FILES ============================================================================== --- head/contrib/bmake/FILES Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/FILES Wed May 20 22:25:46 2020 (r361307) @@ -22,6 +22,9 @@ configure.in dir.c dir.h dirname.c +filemon/filemon.h +filemon/filemon_dev.c +filemon/filemon_ktrace.c find_lib.sh for.c getopt.c @@ -94,13 +97,18 @@ suff.c targ.c trace.c trace.h -unit-tests/Makefile.in +unit-tests/Makefile +unit-tests/Makefile.config.in unit-tests/comment.exp unit-tests/comment.mk unit-tests/cond1.exp unit-tests/cond1.mk unit-tests/cond2.exp unit-tests/cond2.mk +unit-tests/cond-late.mk +unit-tests/cond-late.exp +unit-tests/dollar.exp +unit-tests/dollar.mk unit-tests/doterror.exp unit-tests/doterror.mk unit-tests/dotwait.exp @@ -123,6 +131,10 @@ unit-tests/hash.exp unit-tests/hash.mk unit-tests/impsrc.exp unit-tests/impsrc.mk +unit-tests/include-main.exp +unit-tests/include-main.mk +unit-tests/include-sub.mk +unit-tests/include-subsub.mk unit-tests/misc.exp unit-tests/misc.mk unit-tests/moderrs.exp @@ -163,6 +175,8 @@ unit-tests/varcmd.exp unit-tests/varcmd.mk unit-tests/varmisc.exp unit-tests/varmisc.mk +unit-tests/varmod-edge.exp +unit-tests/varmod-edge.mk unit-tests/varquote.exp unit-tests/varquote.mk unit-tests/varshell.exp Modified: head/contrib/bmake/Makefile ============================================================================== --- head/contrib/bmake/Makefile Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/Makefile Wed May 20 22:25:46 2020 (r361307) @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.99 2017/08/13 20:12:53 sjg Exp $ +# $Id: Makefile,v 1.104 2020/02/06 01:33:54 sjg Exp $ PROG= bmake @@ -56,6 +56,7 @@ SRCS+= \ lstSucc.c .-include "VERSION" +.-include "Makefile.inc" # this file gets generated by configure .-include "Makefile.config" @@ -77,12 +78,24 @@ CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}} COPTS.main.c+= "-DMAKE_VERSION=\"${_MAKE_VERSION}\"" -# meta mode can be useful even without filemon +# meta mode can be useful even without filemon +# should be set by now +USE_FILEMON ?= no +.if ${USE_FILEMON:tl} != "no" +.PATH: ${.CURDIR}/filemon +SRCS+= filemon_${USE_FILEMON}.c +COPTS.meta.c+= -DUSE_FILEMON -DUSE_FILEMON_${USE_FILEMON:tu} +COPTS.job.c+= ${COPTS.meta.c} + +.if ${USE_FILEMON} == "dev" FILEMON_H ?= /usr/include/dev/filemon/filemon.h .if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h" -COPTS.meta.c += -DHAVE_FILEMON_H -I${FILEMON_H:H} +COPTS.filemon_dev.c += -DHAVE_FILEMON_H -I${FILEMON_H:H} .endif +.endif # USE_FILEMON == dev +.endif # USE_FILEMON + .PATH: ${srcdir} .PATH: ${srcdir}/lst.lib @@ -198,6 +211,8 @@ main.o: ${SRCS} ${.CURDIR}/VERSION .if ${MK_AUTOCONF_MK} == "yes" CONFIGURE_DEPS += ${.CURDIR}/VERSION +# we do not need or want the generated makefile +CONFIGURE_ARGS += --without-makefile .include .endif SHARE_MK?=${SHAREDIR}/mk Modified: head/contrib/bmake/Makefile.config.in ============================================================================== --- head/contrib/bmake/Makefile.config.in Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/Makefile.config.in Wed May 20 22:25:46 2020 (r361307) @@ -14,7 +14,8 @@ CFLAGS+= ${CPPFLAGS} @DEFS@ LDFLAGS+= @LDFLAGS@ LIBOBJS+= @LIBOBJS@ LDADD+= @LIBS@ -USE_META= @use_meta@ +USE_META?= @use_meta@ +USE_FILEMON?= @use_filemon@ FILEMON_H?= @filemon_h@ BMAKE_PATH_MAX?= @bmake_path_max@ # used if MAXPATHLEN not defined Modified: head/contrib/bmake/VERSION ============================================================================== --- head/contrib/bmake/VERSION Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/VERSION Wed May 20 22:25:46 2020 (r361307) @@ -1,2 +1,2 @@ # keep this compatible with sh and make -_MAKE_VERSION=20181221 +_MAKE_VERSION=20200517 Modified: head/contrib/bmake/arch.c ============================================================================== --- head/contrib/bmake/arch.c Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/arch.c Wed May 20 22:25:46 2020 (r361307) @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $ */ +/* $NetBSD: arch.c,v 1.71 2019/10/05 23:35:57 mrg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $"; +static char rcsid[] = "$NetBSD: arch.c,v 1.71 2019/10/05 23:35:57 mrg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $"); +__RCSID("$NetBSD: arch.c,v 1.71 2019/10/05 23:35:57 mrg Exp $"); #endif #endif /* not lint */ #endif @@ -682,7 +682,7 @@ ArchStatMember(char *archive, char *member, Boolean ha arh.AR_SIZE[sizeof(arh.AR_SIZE)-1] = '\0'; size = (int)strtol(arh.AR_SIZE, NULL, 10); - (void)strncpy(memName, arh.AR_NAME, sizeof(arh.AR_NAME)); + memcpy(memName, arh.AR_NAME, sizeof(arh.AR_NAME)); for (cp = &memName[AR_MAX_NAME_LEN]; *cp == ' '; cp--) { continue; } Modified: head/contrib/bmake/boot-strap ============================================================================== --- head/contrib/bmake/boot-strap Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/boot-strap Wed May 20 22:25:46 2020 (r361307) @@ -89,6 +89,10 @@ # disable use of filemon(9) which is currently only # available for NetBSD and FreeBSD. # +# --with-filemon=ktrace +# on NetBSD or others with fktrace(2), use ktrace +# version of filemon. +# # --with-filemon="path/to/filemon.h" # enables use of filemon(9) by meta mode. # @@ -111,7 +115,7 @@ # Simon J. Gerraty # RCSid: -# $Id: boot-strap,v 1.49 2016/05/29 00:09:14 sjg Exp $ +# $Id: boot-strap,v 1.51 2020/02/19 16:46:23 sjg Exp $ # # @(#) Copyright (c) 2001 Simon J. Gerraty # @@ -161,6 +165,8 @@ cmd_args="$@" # clear some things from the environment that we care about unset MAKEOBJDIR MAKEOBJDIRPREFIX +# or that might be incompatible +unset MAKE MAKEFLAGS # --install[-host-target] will set this INSTALL_PREFIX= Modified: head/contrib/bmake/bsd.after-import.mk ============================================================================== --- head/contrib/bmake/bsd.after-import.mk Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/bsd.after-import.mk Wed May 20 22:25:46 2020 (r361307) @@ -1,4 +1,4 @@ -# $Id: bsd.after-import.mk,v 1.13 2017/08/13 00:56:10 sjg Exp $ +# $Id: bsd.after-import.mk,v 1.15 2018/12/30 17:14:24 sjg Exp $ # This makefile is for use when integrating bmake into a BSD build # system. Use this makefile after importing bmake. @@ -63,7 +63,7 @@ MAKEFILE_SED = sed -e '/^MACHINE/d' \ -e 's,${SRCTOP},$${SRCTOP},g' # These are the simple files we want to capture -configured_files= config.h Makefile.config unit-tests/Makefile +configured_files= config.h Makefile.config unit-tests/Makefile.config after-import: bootstrap ${MAKEFILE} .for f in ${configured_files:M*.[ch]} @@ -87,7 +87,6 @@ _makefile: bootstrap ${MAKEFILE} @(echo '# This is a generated file, do NOT edit!'; \ echo '# See ${_this:S,${SRCTOP}/,,}'; \ echo '#'; echo '# $$${HOST_OS}$$'; \ - echo; echo '.sinclude "Makefile.inc"'; \ echo; echo 'SRCTOP?= $${.CURDIR:${.CURDIR:S,${SRCTOP}/,,:C,[^/]+,H,g:S,/,:,g}}'; \ echo; echo '# look here first for config.h'; \ echo 'CFLAGS+= -I$${.CURDIR}'; echo; \ Modified: head/contrib/bmake/compat.c ============================================================================== --- head/contrib/bmake/compat.c Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/compat.c Wed May 20 22:25:46 2020 (r361307) @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.107 2017/07/20 19:29:54 sjg Exp $ */ +/* $NetBSD: compat.c,v 1.110 2020/01/19 19:42:32 riastradh Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: compat.c,v 1.107 2017/07/20 19:29:54 sjg Exp $"; +static char rcsid[] = "$NetBSD: compat.c,v 1.110 2020/01/19 19:42:32 riastradh Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: compat.c,v 1.107 2017/07/20 19:29:54 sjg Exp $"); +__RCSID("$NetBSD: compat.c,v 1.110 2020/01/19 19:42:32 riastradh Exp $"); #endif #endif /* not lint */ #endif @@ -407,7 +407,7 @@ again: #ifdef USE_META if (useMeta) { - meta_compat_parent(); + meta_compat_parent(cpid); } #endif Modified: head/contrib/bmake/config.h.in ============================================================================== --- head/contrib/bmake/config.h.in Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/config.h.in Wed May 20 22:25:46 2020 (r361307) @@ -143,7 +143,7 @@ /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL -/* Define to 1 if `struct stat' is a member of `st_rdev'. */ +/* Define to 1 if `st_rdev' is a member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_RDEV /* Define to 1 if your `struct stat' has `st_rdev'. Deprecated, use Modified: head/contrib/bmake/configure ============================================================================== Binary file (source and/or target). No diff available. Modified: head/contrib/bmake/configure.in ============================================================================== --- head/contrib/bmake/configure.in Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/configure.in Wed May 20 22:25:46 2020 (r361307) @@ -1,11 +1,11 @@ dnl dnl RCSid: -dnl $Id: configure.in,v 1.59 2017/11/26 22:39:20 sjg Exp $ +dnl $Id: configure.in,v 1.63 2020/04/19 05:17:57 sjg Exp $ dnl dnl Process this file with autoconf to produce a configure script dnl AC_PREREQ(2.50) -AC_INIT([bmake], [20171126], [sjg@NetBSD.org]) +AC_INIT([bmake], [20200418], [sjg@NetBSD.org]) AC_CONFIG_HEADERS(config.h) dnl make srcdir absolute @@ -16,6 +16,7 @@ esac dnl get _MAKE_VERSION . $srcdir/VERSION +OS=`uname -s` dnl AC_ARG_WITH(defshell, @@ -32,6 +33,17 @@ no) ;; ;; esac]) dnl +case "$OS" in +CYGWIN*|MINGW*) use_makefile=no;; +*) use_makefile=yes;; +esac +AC_ARG_WITH(makefile, +[ --without-makefile dissable use of generated makefile], +[case "${withval}" in +yes|no) use_makefile=${withval};; +*) AC_MSG_ERROR(bad value ${withval} given for makefile) ;; +esac]) +dnl use_meta=yes AC_ARG_WITH(meta, [ --without-meta dissable use of meta-mode], @@ -41,30 +53,41 @@ yes|no) use_meta=${withval};; esac]) dnl AC_ARG_WITH(filemon, -[ --with-filemon=path/filemon.h indicate path to filemon.h for meta-mode], +[ --with-filemon={no,dev,ktrace,path/filemon.h} indicate filemon method for meta-mode. Path to filemon.h implies dev], [ case "/${withval}" in -/no|*/filemon.h) filemon_h="${withval}";; +/no) use_filemon=no;; +/*trace) filemon_h=no use_filemon="${withval}";; +*/filemon.h) filemon_h="${withval}";; */filemon*) filemon_h="${withval}/filemon.h";; *) AC_MSG_ERROR(bad value ${withval} given for filemon) ;; esac], [ -OS=`uname -s` -for d in "/usr/include/dev/filemon" "$prefix/include/dev/filemon" "$srcdir/filemon" "$srcdir/../filemon" "$srcdir/../../sys/dev/filemon" -do - for x in "/$OS" "" - do - filemon_h="$d$x/filemon.h" - test -s "$filemon_h" && break - done - test -s "$filemon_h" && break -done -test -s "${filemon_h:-/dev/null}" || filemon_h=no +case "$OS" in +NetBSD) filemon_h=no use_filemon=ktrace;; +*) + for d in "/usr/include/dev/filemon" "$prefix/include/dev/filemon" "$srcdir/../../sys/dev/filemon" + do + for x in "/$OS" "" + do + filemon_h="$d$x/filemon.h" + test -s "$filemon_h" && break + done + test -s "$filemon_h" && { use_filemon=dev; break; } + done + ;; +esac +use_filemon=${use_filemon:-no} +case "$use_filemon" in +dev) ;; +*) filemon_h=no;; +esac ]) -dnl echo "Note: use_meta=$use_meta filemon_h=$filemon_h" >&6 +dnl echo "Note: use_meta=$use_meta use_filemon=$use_filemon filemon_h=$filemon_h" >&6 case "$use_meta" in yes) - case "$filemon_h" in - *.h) echo "Using: filemon=$filemon_h" >&6;; + case "$use_filemon" in + no) ;; + *) echo "Using: filemon_${use_filemon}.c" >&6;; esac ;; esac @@ -388,10 +411,14 @@ AC_SUBST(INSTALL) AC_SUBST(GCC) AC_SUBST(diff_u) AC_SUBST(use_meta) +AC_SUBST(use_filemon) AC_SUBST(filemon_h) AC_SUBST(_MAKE_VERSION) -AC_OUTPUT(makefile Makefile.config make-bootstrap.sh unit-tests/Makefile) - +bm_outfiles="Makefile.config unit-tests/Makefile.config make-bootstrap.sh" +if test $use_makefile = yes; then + bm_outfiles="makefile $bm_outfiles" +fi +AC_OUTPUT($bm_outfiles) cat < #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.195 2018/05/13 22:13:28 sjg Exp $"); +__RCSID("$NetBSD: job.c,v 1.197 2020/02/06 01:13:19 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -358,6 +358,8 @@ static Job childExitJob; /* child exit pseudo-job */ #define CHILD_EXIT "." #define DO_JOB_RESUME "R" +static const int npseudojobs = 2; /* number of pseudo-jobs */ + #define TARG_FMT "%s %s ---\n" /* Default format */ #define MESSAGE(fp, gn) \ if (maxJobs != 1 && targPrefix && *targPrefix) \ @@ -389,6 +391,16 @@ static void JobSigReset(void); #endif const char *malloc_options= MALLOC_OPTIONS; +static unsigned +nfds_per_job(void) +{ +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + if (useMeta) + return 2; +#endif + return 1; +} + static void job_table_dump(const char *where) { @@ -1475,6 +1487,12 @@ JobExec(Job *job, char **argv) Trace_Log(JOBSTART, job); +#ifdef USE_META + if (useMeta) { + meta_job_parent(job, cpid); + } +#endif + /* * Set the current position in the buffer to the beginning * and mark another stream to watch in the outputs mask @@ -2157,12 +2175,24 @@ Job_CatchOutput(void) if (nready == 0) return; - for (i = 2; i < nfds; i++) { + for (i = npseudojobs*nfds_per_job(); i < nfds; i++) { if (!fds[i].revents) continue; job = jobfds[i]; if (job->job_state == JOB_ST_RUNNING) JobDoOutput(job, FALSE); +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + /* + * With meta mode, we may have activity on the job's filemon + * descriptor too, which at the moment is any pollfd other than + * job->inPollfd. + */ + if (useMeta && job->inPollfd != &fds[i]) { + if (meta_job_event(job) <= 0) { + fds[i].events = 0; /* never mind */ + } + } +#endif if (--nready == 0) return; } @@ -2313,9 +2343,11 @@ Job_Init(void) JobCreatePipe(&childExitJob, 3); - /* We can only need to wait for tokens, children and output from each job */ - fds = bmake_malloc(sizeof (*fds) * (2 + maxJobs)); - jobfds = bmake_malloc(sizeof (*jobfds) * (2 + maxJobs)); + /* Preallocate enough for the maximum number of jobs. */ + fds = bmake_malloc(sizeof(*fds) * + (npseudojobs + maxJobs) * nfds_per_job()); + jobfds = bmake_malloc(sizeof(*jobfds) * + (npseudojobs + maxJobs) * nfds_per_job()); /* These are permanent entries and take slots 0 and 1 */ watchfd(&tokenWaitJob); @@ -2834,6 +2866,14 @@ watchfd(Job *job) jobfds[nfds] = job; job->inPollfd = &fds[nfds]; nfds++; +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + if (useMeta) { + fds[nfds].fd = meta_job_fd(job); + fds[nfds].events = fds[nfds].fd == -1 ? 0 : POLLIN; + jobfds[nfds] = job; + nfds++; + } +#endif } static void @@ -2844,6 +2884,18 @@ clearfd(Job *job) Punt("Unwatching unwatched job"); i = job->inPollfd - fds; nfds--; +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + if (useMeta) { + /* + * Sanity check: there should be two fds per job, so the job's + * pollfd number should be even. + */ + assert(nfds_per_job() == 2); + if (i % 2) + Punt("odd-numbered fd with meta"); + nfds--; + } +#endif /* * Move last job in table into hole made by dead job. */ @@ -2851,6 +2903,12 @@ clearfd(Job *job) fds[i] = fds[nfds]; jobfds[i] = jobfds[nfds]; jobfds[i]->inPollfd = &fds[i]; +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + if (useMeta) { + fds[i + 1] = fds[nfds + 1]; + jobfds[i + 1] = jobfds[nfds + 1]; + } +#endif } job->inPollfd = NULL; } Modified: head/contrib/bmake/make-bootstrap.sh.in ============================================================================== --- head/contrib/bmake/make-bootstrap.sh.in Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/make-bootstrap.sh.in Wed May 20 22:25:46 2020 (r361307) @@ -23,6 +23,10 @@ MDEFS="-DMAKE_VERSION=\"$MAKE_VERSION\" \ LDFLAGS="@LDFLAGS@" LIBS="@LIBS@" +toUpper() { + ${TR:-tr} abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ +} + do_compile2() { obj="$1"; shift src="$1"; shift @@ -32,7 +36,10 @@ do_compile2() { do_compile() { obj="$1"; shift - src=`basename "$obj" .o`.c + case "$1" in + *.c) src=$1; shift;; + *) src=`basename "$obj" .o`.c;; + esac for d in "$srcdir" "$srcdir/lst.lib" do @@ -52,7 +59,7 @@ do_link() { } BASE_OBJECTS="arch.o buf.o compat.o cond.o dir.o for.o getopt hash.o \ -job.o make.o make_malloc.o metachar.o parse.o sigcompat.o str.o strlist.o \ +make.o make_malloc.o metachar.o parse.o sigcompat.o str.o strlist.o \ suff.o targ.o trace.o var.o util.o" LST_OBJECTS="lstAppend.o lstDupl.o lstInit.o lstOpen.o \ @@ -73,12 +80,22 @@ done case "@use_meta@" in yes) - case "@filemon_h@" in - */filemon.h) FDEFS="-DHAVE_FILEMON_H -I`dirname @filemon_h@`";; + case "@use_filemon@" in + no) MDEFS=;; + *) + MDEFS="-DUSE_FILEMON -DUSE_FILEMON_`echo @use_filemon@ | toUpper`" + case "@use_filemon@,@filemon_h@" in + dev,*/filemon.h) FDEFS="-DHAVE_FILEMON_H -I`dirname @filemon_h@`";; + *) FDEFS=;; + esac + do_compile filemon_@use_filemon@.o filemon/filemon_@use_filemon@.c ${FDEFS} + BASE_OBJECTS="filemon_@use_filemon@.o $BASE_OBJECTS" + ;; esac - do_compile meta.o ${FDEFS} - BASE_OBJECTS="meta.o ${BASE_OBJECTS}" - ;; + do_compile meta.o ${MDEFS} + BASE_OBJECTS="meta.o ${BASE_OBJECTS}" + ;; esac +do_compile job.o ${MDEFS} -do_link bmake main.o ${BASE_OBJECTS} ${LST_OBJECTS} ${LIB_OBJECTS} +do_link bmake main.o job.o ${BASE_OBJECTS} ${LST_OBJECTS} ${LIB_OBJECTS} Modified: head/contrib/bmake/make.1 ============================================================================== --- head/contrib/bmake/make.1 Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/make.1 Wed May 20 22:25:46 2020 (r361307) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.273 2018/05/27 01:14:51 christos Exp $ +.\" $NetBSD: make.1,v 1.280 2020/04/27 20:03:08 christos Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd December 5, 2018 +.Dd April 27, 2020 .Dt MAKE 1 .Os .Sh NAME @@ -272,7 +272,7 @@ that do not depend on the target whose creation caused .It Fl m Ar directory Specify a directory in which to search for sys.mk and makefiles included via the -.Ao Ar file Ac Ns -style +.Li \&< Ns Ar file Ns Li \&> Ns -style include statement. The .Fl m @@ -280,7 +280,7 @@ option can be used multiple times to form a search pat This path will override the default system include path: /usr/share/mk. Furthermore the system include path will be appended to the search path used for -.Qo Ar file Qc Ns -style +.Li \*q Ns Ar file Ns Li \*q Ns -style include statements (see the .Fl I option). @@ -1245,7 +1245,7 @@ Quotes every shell meta-character in the variable, and characters so that it can be passed safely through recursive invocations of .Nm . -This is equivalent to: +This is equivalent to: .Sq \&:S/\e\&$/&&/g:Q . .It Cm \&:R Replaces each word in the variable with everything but its suffix. @@ -1440,6 +1440,29 @@ is the substring of .Ar old_string to be replaced in .Ar new_string . +If only +.Ar old_string +contains the pattern matching character +.Ar % , +and +.Ar old_string +matches, then the result is the +.Ar new_string . +If only the +.Ar new_string +contains the pattern matching character +.Ar % , +then it is not treated specially and it is printed as a literal +.Ar % +on match. +If there is more than one pattern matching character +.Ar ( % ) +in either the +.Ar new_string +or +.Ar old_string , +only the first instance is treated specially (as the pattern character); +all subsequent instances are treated as regular characters .Pp Variable expansion occurs in the normal fashion inside both .Ar old_string @@ -1634,9 +1657,9 @@ dot .Pq Ql \&. character. Files are included with either -.Cm \&.include Aq Ar file +.Cm \&.include \&< Ns Ar file Ns Cm \&> or -.Cm \&.include Pf \*q Ar file Ns \*q . +.Cm \&.include \&\*q Ns Ar file Ns Cm \&\*q . Variables between the angle brackets or double quotes are expanded to form the file name. If angle brackets are used, the included makefile is expected to be in @@ -2416,9 +2439,9 @@ file). .Sh BUGS The .Nm -syntax is difficult to parse without actually acting of the data. -For instance finding the end of a variable use should involve scanning each -the modifiers using the correct terminator for each field. +syntax is difficult to parse without actually acting on the data. +For instance, finding the end of a variable's use should involve scanning +each of the modifiers, using the correct terminator for each field. In many places .Nm just counts {} and () in order to find the end of a variable expansion. Modified: head/contrib/bmake/make.h ============================================================================== --- head/contrib/bmake/make.h Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/make.h Wed May 20 22:25:46 2020 (r361307) @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.105 2020/03/30 02:41:06 sjg Exp $ */ +/* $NetBSD: make.h,v 1.107 2020/04/03 03:35:16 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 Modified: head/contrib/bmake/meta.c ============================================================================== --- head/contrib/bmake/meta.c Wed May 20 22:25:41 2020 (r361306) +++ head/contrib/bmake/meta.c Wed May 20 22:25:46 2020 (r361307) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.70 2018/02/13 19:37:30 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.81 2020/04/03 03:32:28 sjg Exp $ */ /* * Implement 'meta' mode. @@ -36,7 +36,6 @@ # include "config.h" #endif #include -#include #ifdef HAVE_LIBGEN_H #include #elif !defined(HAVE_DIRNAME) @@ -50,12 +49,9 @@ char * dirname(char *); #include "make.h" #include "job.h" -#ifdef HAVE_FILEMON_H -# include +#ifdef USE_FILEMON +#include "filemon/filemon.h" #endif -#if !defined(USE_FILEMON) && defined(FILEMON_SET_FD) -# define USE_FILEMON -#endif static BuildMon Mybm; /* for compat */ static Lst metaBailiwick; /* our scope of control */ @@ -121,30 +117,24 @@ extern char **environ; * the benefits are more limited. */ #ifdef USE_FILEMON -# ifndef _PATH_FILEMON -# define _PATH_FILEMON "/dev/filemon" -# endif /* * Open the filemon device. */ static void -filemon_open(BuildMon *pbm) +meta_open_filemon(BuildMon *pbm) { - int retry; - - pbm->mon_fd = pbm->filemon_fd = -1; - if (!useFilemon) + int dupfd; + + pbm->mon_fd = -1; + pbm->filemon = NULL; + if (!useFilemon || !pbm->mfp) return; - for (retry = 5; retry >= 0; retry--) { - if ((pbm->filemon_fd = open(_PATH_FILEMON, O_RDWR)) >= 0) - break; - } - - if (pbm->filemon_fd < 0) { + pbm->filemon = filemon_open(); + if (pbm->filemon == NULL) { useFilemon = FALSE; - warn("Could not open %s", _PATH_FILEMON); + warn("Could not open filemon %s", filemon_path()); return; } @@ -155,12 +145,15 @@ filemon_open(BuildMon *pbm) * We only care about the descriptor. */ pbm->mon_fd = mkTempFile("filemon.XXXXXX", NULL); - if (ioctl(pbm->filemon_fd, FILEMON_SET_FD, &pbm->mon_fd) < 0) { + if ((dupfd = dup(pbm->mon_fd)) == -1) { + err(1, "Could not dup filemon output!"); + } + (void)fcntl(dupfd, F_SETFD, FD_CLOEXEC); + if (filemon_setfd(pbm->filemon, dupfd) == -1) { err(1, "Could not set filemon file descriptor!"); } /* we don't need these once we exec */ (void)fcntl(pbm->mon_fd, F_SETFD, FD_CLOEXEC); - (void)fcntl(pbm->filemon_fd, F_SETFD, FD_CLOEXEC); } /* @@ -473,7 +466,7 @@ meta_create(BuildMon *pbm, GNode *gn) const char *tname; char *fname; const char *cp; - char *p[4]; /* >= possible uses */ + char *p[5]; /* >= possible uses */ int i; mf.fp = NULL; @@ -528,7 +521,10 @@ meta_create(BuildMon *pbm, GNode *gn) fprintf(mf.fp, "CWD %s\n", getcwd(buf, sizeof(buf))); fprintf(mf.fp, "TARGET %s\n", tname); - + cp = Var_Value(".OODATE", gn, &p[i++]); + if (cp && *cp) { + fprintf(mf.fp, "OODATE %s\n", cp); + } if (metaEnv) { for (ptr = environ; *ptr != NULL; ptr++) fprintf(mf.fp, "ENV %s\n", *ptr); @@ -574,7 +570,7 @@ meta_init(void) { #ifdef USE_FILEMON /* this allows makefiles to test if we have filemon support */ - Var_Set(".MAKE.PATH_FILEMON", _PATH_FILEMON, VAR_GLOBAL, 0); + Var_Set(".MAKE.PATH_FILEMON", filemon_path(), VAR_GLOBAL, 0); #endif } @@ -684,9 +680,10 @@ meta_job_start(Job *job, GNode *gn) #endif #ifdef USE_FILEMON if (pbm->mfp != NULL && useFilemon) { - filemon_open(pbm); + meta_open_filemon(pbm); } else { - pbm->mon_fd = pbm->filemon_fd = -1; + pbm->mon_fd = -1; + pbm->filemon = NULL; } #endif } @@ -708,11 +705,11 @@ meta_job_child(Job *job) } if (pbm->mfp != NULL) { close(fileno(pbm->mfp)); - if (useFilemon) { + if (useFilemon && pbm->filemon) { pid_t pid; pid = getpid(); - if (ioctl(pbm->filemon_fd, FILEMON_SET_PID, &pid) < 0) { + if (filemon_setpid_child(pbm->filemon, pid) == -1) { err(1, "Could not set filemon pid!"); } } @@ -721,6 +718,59 @@ meta_job_child(Job *job) } void +meta_job_parent(Job *job, pid_t pid) +{ +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + BuildMon *pbm; + + if (job != NULL) { + pbm = &job->bm; + } else { + pbm = &Mybm; + } + if (useFilemon && pbm->filemon) { + filemon_setpid_parent(pbm->filemon, pid); + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 20 23: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 8FA212F7A5E; Wed, 20 May 2020 23:27:02 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S86G31lbz3ysL; Wed, 20 May 2020 23:27:02 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E45824108; Wed, 20 May 2020 23:27:02 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KNR2Sr069354; Wed, 20 May 2020 23:27:02 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KNR2vO069353; Wed, 20 May 2020 23:27:02 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <202005202327.04KNR2vO069353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 20 May 2020 23:27:02 +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: r361309 - stable/12/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-12 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: stable/12/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 361309 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, 20 May 2020 23:27:02 -0000 Author: dteske Date: Wed May 20 23:27:01 2020 New Revision: 361309 URL: https://svnweb.freebsd.org/changeset/base/361309 Log: MFC r361300: Fix indentation in bsdinstall-created wpa_supplicant.conf PR: base/221982 Reported by: emaste Reviewed by: emaste, allanjude Differential Revision: https://reviews.freebsd.org/D23641 Modified: stable/12/usr.sbin/bsdinstall/scripts/wlanconfig Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bsdinstall/scripts/wlanconfig ============================================================================== --- stable/12/usr.sbin/bsdinstall/scripts/wlanconfig Wed May 20 23:18:47 2020 (r361308) +++ stable/12/usr.sbin/bsdinstall/scripts/wlanconfig Wed May 20 23:27:01 2020 (r361309) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn -# Copyright (c) 2013-2016 Devin Teske +# Copyright (c) 2013-2020 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -60,8 +60,7 @@ country_set() 'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \ "$WLAN_IFACE" "$BSDINSTALL_TMPETC" if [ "$error_str" ]; then - $DIALOG \ - --title "$msg_error" \ + $DIALOG --title "$msg_error" \ --backtitle "$DIALOG_BACKTITLE" \ --yes-label Change \ --no-label Ignore \ @@ -70,8 +69,7 @@ country_set() 0 0 || return $SUCCESS # Skip return $FAILURE # Restart else - awk 'sub(/^\t\t/,"")||1' \ - > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF + cat > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF create_args_$WLAN_IFACE="$ifconfig_args" EOF fi @@ -101,7 +99,8 @@ dialog_country_select() sub(/Country codes:/, ""), sub(/Regulatory.*/, "") { while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) { country = substr($0, RSTART) - sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", country) + sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", + country) code = substr(country, 1, 2) desc = substr(country, 4) sub(/[[:space:]]*$/, "", desc) @@ -153,7 +152,7 @@ dialog_country_select() : > "$BSDINSTALL_TMPETC/wpa_supplicant.conf" chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf" -cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF +cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ psk="$PASS" + \ priority=5 + } + EOF elif echo "$ENCRYPTION" | grep -q EAP; then USERPASS=$( $DIALOG \ --title "WPA-Enterprise Setup" \ @@ -300,19 +299,19 @@ elif echo "$ENCRYPTION" | grep -q EAP; then "Password" 3 0 "" 3 12 25 63 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=WPA-EAP$( + echo "$USERPASS" | awk ' + NR == 1 { printf "\n\tidentity=\"%s\"", $1 } + NR == 2 { printf "\n\tpassword=\"%s\"", $1 } + ' ) + \ priority=5 + } + EOF elif echo "$ENCRYPTION" | grep -q WEP; then WEPKEY=$( $DIALOG \ --title "WEP Setup" \ @@ -324,31 +323,31 @@ elif echo "$ENCRYPTION" | grep -q WEP; then "WEP Key 0" 2 0 "" 2 12 15 0 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=NONE + \ wep_key0="$WEPKEY" + \ wep_tx_keyidx=0 + \ priority=5 + } + EOF else # Open - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=NONE + \ priority=5 + } + EOF fi # Connect to any open networks policy -cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF +cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" < Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC7022FAD22; Thu, 21 May 2020 01:24:00 +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 49SBjD5YRfz45h5; Thu, 21 May 2020 01:24:00 +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 BA08425690; Thu, 21 May 2020 01:24:00 +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 04L1O0wR042791; Thu, 21 May 2020 01:24:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L1O0HZ042790; Thu, 21 May 2020 01:24:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005210124.04L1O0HZ042790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 May 2020 01:24: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: r361310 - 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: 361310 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, 21 May 2020 01:24:00 -0000 Author: kevans Date: Thu May 21 01:23:59 2020 New Revision: 361310 URL: https://svnweb.freebsd.org/changeset/base/361310 Log: MFC r361022-r361023, r361148: certctl(8) fixes r361022: certctl(8): don't completely nuke $CERTDESTDIR It's been reported/noted that a well-timed `certctl rehash` will completely obliterate $CERTDESTDIR, which may get used by ports or system administrators. While we can't guarantee the certctl semantics when other non-certctl-controlled bits live here, we should make some amount of effort to play nice. Pruning all existing links, which we'll subsequently rebuild as needed, is sufficient for our needs. This can still be destructive, but it's perhaps less likely to cause issues. I also note that we should probably be pruning /etc/ssl/blacklisted upon rehash as well. r361023: certctl: follow-up to r361022, prune blacklist as well Otherwise, removals from the blacklist may not get processed as they should. While we're here, restructure these to not bother with mkdir(1) if we've already tested them to exist. r361148: certctl: don't fall over flat with relative DESTDIR Up until now, all of our DESTDIR use has been with absolute paths. It turned out that the cd in/out dance we do here breaks us down later on, as the relative path no longer resolves. Convert EXTENSIONS to an ERE that we'll use to grep ls -1 of the dir we're inspecting, rather than cd'ing into it and globbing it up. 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 Wed May 20 23:27:01 2020 (r361309) +++ stable/12/usr.sbin/certctl/certctl.sh Thu May 21 01:23:59 2020 (r361310) @@ -34,7 +34,7 @@ : ${BLACKLISTPATH:=${DESTDIR}/usr/share/certs/blacklisted:${DESTDIR}/usr/local/etc/ssl/blacklisted} : ${CERTDESTDIR:=${DESTDIR}/etc/ssl/certs} : ${BLACKLISTDESTDIR:=${DESTDIR}/etc/ssl/blacklisted} -: ${EXTENSIONS:="*.pem *.crt *.cer *.crl *.0"} +: ${FILEPAT:="\.pem$|\.crt$|\.cer$|\.crl$|\.0$"} : ${VERBOSE:=0} ############################################################ GLOBALS @@ -104,13 +104,11 @@ do_scan() for CPATH in "$@"; do [ -d "$CPATH" ] || continue echo "Scanning $CPATH for certificates..." - cd "$CPATH" - for CFILE in $EXTENSIONS; do - [ -e "$CFILE" ] || continue + for CFILE in $(ls -1 "${CPATH}" | grep -Ee "${FILEPAT}"); do + [ -e "$CPATH/$CFILE" ] || continue [ $VERBOSE -gt 0 ] && echo "Reading $CFILE" "$CFUNC" "$CPATH/$CFILE" done - cd - done } @@ -142,9 +140,18 @@ do_list() cmd_rehash() { - [ $NOOP -eq 0 ] && rm -rf "$CERTDESTDIR" - [ $NOOP -eq 0 ] && mkdir -p "$CERTDESTDIR" - [ $NOOP -eq 0 ] && mkdir -p "$BLACKLISTDESTDIR" + if [ $NOOP -eq 0 ]; then + if [ -e "$CERTDESTDIR" ]; then + find "$CERTDESTDIR" -type link -delete + else + mkdir -p "$CERTDESTDIR" + fi + if [ -e "$BLACKLISTDESTDIR" ]; then + find "$BLACKLISTDESTDIR" -type link -delete + else + mkdir -p "$BLACKLISTDESTDIR" + fi + fi do_scan create_blacklisted "$BLACKLISTPATH" do_scan create_trusted_link "$TRUSTPATH" From owner-svn-src-all@freebsd.org Thu May 21 01:24: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 890792FAB42; Thu, 21 May 2020 01:24:00 +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 49SBjD36mYz45Y2; Thu, 21 May 2020 01:24:00 +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 664ED254CA; Thu, 21 May 2020 01:24:00 +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 04L1O05o042785; Thu, 21 May 2020 01:24:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L1O00j042784; Thu, 21 May 2020 01:24:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005210124.04L1O00j042784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 May 2020 01:24: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: r361310 - 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: 361310 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, 21 May 2020 01:24:00 -0000 Author: kevans Date: Thu May 21 01:23:59 2020 New Revision: 361310 URL: https://svnweb.freebsd.org/changeset/base/361310 Log: MFC r361022-r361023, r361148: certctl(8) fixes r361022: certctl(8): don't completely nuke $CERTDESTDIR It's been reported/noted that a well-timed `certctl rehash` will completely obliterate $CERTDESTDIR, which may get used by ports or system administrators. While we can't guarantee the certctl semantics when other non-certctl-controlled bits live here, we should make some amount of effort to play nice. Pruning all existing links, which we'll subsequently rebuild as needed, is sufficient for our needs. This can still be destructive, but it's perhaps less likely to cause issues. I also note that we should probably be pruning /etc/ssl/blacklisted upon rehash as well. r361023: certctl: follow-up to r361022, prune blacklist as well Otherwise, removals from the blacklist may not get processed as they should. While we're here, restructure these to not bother with mkdir(1) if we've already tested them to exist. r361148: certctl: don't fall over flat with relative DESTDIR Up until now, all of our DESTDIR use has been with absolute paths. It turned out that the cd in/out dance we do here breaks us down later on, as the relative path no longer resolves. Convert EXTENSIONS to an ERE that we'll use to grep ls -1 of the dir we're inspecting, rather than cd'ing into it and globbing it up. 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 Wed May 20 23:27:01 2020 (r361309) +++ stable/11/usr.sbin/certctl/certctl.sh Thu May 21 01:23:59 2020 (r361310) @@ -34,7 +34,7 @@ : ${BLACKLISTPATH:=${DESTDIR}/usr/share/certs/blacklisted:${DESTDIR}/usr/local/etc/ssl/blacklisted} : ${CERTDESTDIR:=${DESTDIR}/etc/ssl/certs} : ${BLACKLISTDESTDIR:=${DESTDIR}/etc/ssl/blacklisted} -: ${EXTENSIONS:="*.pem *.crt *.cer *.crl *.0"} +: ${FILEPAT:="\.pem$|\.crt$|\.cer$|\.crl$|\.0$"} : ${VERBOSE:=0} ############################################################ GLOBALS @@ -104,13 +104,11 @@ do_scan() for CPATH in "$@"; do [ -d "$CPATH" ] || continue echo "Scanning $CPATH for certificates..." - cd "$CPATH" - for CFILE in $EXTENSIONS; do - [ -e "$CFILE" ] || continue + for CFILE in $(ls -1 "${CPATH}" | grep -Ee "${FILEPAT}"); do + [ -e "$CPATH/$CFILE" ] || continue [ $VERBOSE -gt 0 ] && echo "Reading $CFILE" "$CFUNC" "$CPATH/$CFILE" done - cd - done } @@ -142,9 +140,18 @@ do_list() cmd_rehash() { - [ $NOOP -eq 0 ] && rm -rf "$CERTDESTDIR" - [ $NOOP -eq 0 ] && mkdir -p "$CERTDESTDIR" - [ $NOOP -eq 0 ] && mkdir -p "$BLACKLISTDESTDIR" + if [ $NOOP -eq 0 ]; then + if [ -e "$CERTDESTDIR" ]; then + find "$CERTDESTDIR" -type link -delete + else + mkdir -p "$CERTDESTDIR" + fi + if [ -e "$BLACKLISTDESTDIR" ]; then + find "$BLACKLISTDESTDIR" -type link -delete + else + mkdir -p "$BLACKLISTDESTDIR" + fi + fi do_scan create_blacklisted "$BLACKLISTPATH" do_scan create_trusted_link "$TRUSTPATH" From owner-svn-src-all@freebsd.org Thu May 21 01:50: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 6D2682FBE87; Thu, 21 May 2020 01:50:43 +0000 (UTC) (envelope-from weh@microsoft.com) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-eopbgr1310104.outbound.protection.outlook.com [40.107.131.104]) (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 49SCJ21JR0z47fW; Thu, 21 May 2020 01:50:41 +0000 (UTC) (envelope-from weh@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G5UeO2wrq8U/8t0T0RoeRg7f4aMFb1iQZEONDT3S/dbxSHK8XRI61xP8j8ZKrWADMmtRhq1dm1zJdluTDlPbpiy5TDOanNRpmQz6nCqxuj+YeRG6UKIw+VSmU4N9OHr4FrZ1BTHw/4whHll7b0T+1ahunf2d/+ZbXbhz0EKoIjfjFNf7d1PcGajM7GSZh7GiMA+S71dwAidyqeEJKlN2MVWJa2UnDILfepIFUdZ/5X+ZTNuiW8XDmgDQHFHUaxLeu7aBX4eVZvx7z0SQc9YrJDUcM6JWeJWySv7oGYkLBNdiRHnOodt9uxN4OQuPzTt6ILZBh12fvZDOVHUZ+FwPxA== 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=NajyPzDQreuHeidRnp8j4kvjh3b5yh8rk4Uj7xsDdVg=; b=VSZhfQCfD1r5jHL/wROLsig5hfLXB0L+uDJlzUDMvgmsYUbPGFmfpvK0vvr3P94KGOblS6NkMlwe/YDM3uXxZruhugkdO3JAkIPmcWqJILl9lnKf+YRkFZpyZ1RC4clH7EKWJJjwDkC+6fASIDuaS3Vkd9zqppjalbA65A9w0DSoOadHhNXaT8mIkAXipYAyK4Fb6qahQi3rMxFhDXmwqRp0Dk+V0v2o8+mlKu6ww4FK5mm09K6LihAcKmR0N16wx0kBrIPpycVg/dNm6IwYsRow7qqeEztLqj0+ExUsx59cnQUeD4C8HJrwn536oKFpgXUeCueZec9oGTYuFWrtTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none Received: from SG2P153MB0377.APCP153.PROD.OUTLOOK.COM (2603:1096:0:1::15) by SG2P153MB0377.APCP153.PROD.OUTLOOK.COM (2603:1096:0:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.5; Thu, 21 May 2020 01:50:38 +0000 Received: from SG2P153MB0377.APCP153.PROD.OUTLOOK.COM ([fe80::798e:2eb8:f18e:7a0]) by SG2P153MB0377.APCP153.PROD.OUTLOOK.COM ([fe80::798e:2eb8:f18e:7a0%7]) with mapi id 15.20.3045.005; Thu, 21 May 2020 01:50:38 +0000 From: Wei Hu To: Shawn Webb , Wei Hu CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: RE: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Thread-Topic: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Thread-Index: AQHWLpZljJNzTG7+okeOAs3l3mz20qixFLIAgACwD1A= Date: Thu, 21 May 2020 01:50:38 +0000 Message-ID: References: <202005201103.04KB3xTp013965@repo.freebsd.org> <20200520151128.bglcjxphdf2vo6hk@mutt-hbsd> In-Reply-To: <20200520151128.bglcjxphdf2vo6hk@mutt-hbsd> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-05-21T01:50:36Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=049815fc-3d30-4ede-b1f4-1561d3ec723f; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0 x-originating-ip: [2404:f801:9000:18:6fed::496b] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: dce3ea74-bd4b-4113-69cb-08d7fd295c99 x-ms-traffictypediagnostic: SG2P153MB0377: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:425; x-forefront-prvs: 041032FF37 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: co90fs6n3rs/ViA3WEYRG3NjVUSS11X/J1AhhneRUCh06kk4XJVy1rAF5zwYfZrHUyUc08XJSz1R+YbWR9Tr8uHBdBiGLkuzJ8Hj1jBMxhNh+eGTZ3gzOnGIpIT04OqfBYP3K95f6jDLkorAAeaOaOhTCc2Vj3ecpYDjjmNaQ3eH3lQSZSdr5LaFvkRx9S284mi2geDzL+tuGmKLHx+7hiqk+/CZmUwQa69s4DgK8MfLIsfYuBpBUrTHXtwqV8wL3x8/V0hdvu2Nt1wW9QSrFzOxyEm/YdL0tPsGNULOOgK1WGzM0EXcgJU/0SEBFd7qRm+PfGb27sT89jxLYrEzf82osVzZtyQSvOP1LGgCzW3xe6mOLrxn847MNwt2bvKLeoKvGgpRN90PSdN8BGUuEg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SG2P153MB0377.APCP153.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(136003)(346002)(39860400002)(366004)(396003)(7696005)(33656002)(6506007)(53546011)(8990500004)(966005)(478600001)(66946007)(5660300002)(55016002)(64756008)(76116006)(52536014)(110136005)(316002)(66446008)(9686003)(66476007)(66556008)(54906003)(186003)(82950400001)(82960400001)(4326008)(10290500003)(71200400001)(86362001)(8676002)(8936002)(2906002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: kErVyqtf395D0k7v32fOotMjuS6KIP4P1fLke6/Iq1sdfTVg7qOK2x/INtPeOyTfJU7ZvXx0XxdVw8t8ISzKlZYtzF4c3TY0GpGEB4w21nzYpEbH3a3nG3DSvsiyK38Y4oVKBSy8H0cORO3fWhj4tGWgSdHZl6TiBr9TLLCchhuabL9/F0rlC4apBd2CepZUEel6aw5XlcKpVI0tlkvragmrFZSB+U6UK/jnKAWcLSqFs6mlZMwbxvdevWd6SwD1lVyp1bzEwWuBaGB4IQmGDGnFBJLjRC1VmSUHC+cBRq2SPJ58o95o2yiDQqqSh8Oy0rWmJ7mzBcoR9Eko5WvWQU3hxFar9aqYofzNwP7huuZ6aODvkhhJSGjbV2DoBIQBZO9P1cveXDbST8cDARmv11ul9w8QLwIIcFxNBI6evKGSc0XBRkCw+n3Ai/ftm4TETTUZ7+ZO6dn2OjPUcS6abyk/DVe8tyO+BxO9egLrBB3RAOEIVrfGC5lkj0UCzGV8Uli7OA45frCUOrGBArjxMA== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: dce3ea74-bd4b-4113-69cb-08d7fd295c99 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 May 2020 01:50:38.0539 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Txv7acLjWx1S48TgLC5N9+gWyS7egxKnJX42zp/wgtuvnDHStngN3qSB5EK1EF7J4Ps/3mz2oC7TDxTlqDsZpA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2P153MB0377 X-Rspamd-Queue-Id: 49SCJ21JR0z47fW X-Spamd-Bar: ---------- X-Spamd-Result: default: False [-10.19 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.980]; R_DKIM_ALLOW(-0.20)[microsoft.com:s=selector2]; HAS_XOIP(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:40.107.0.0/16]; NEURAL_HAM_LONG(-1.03)[-1.026]; MIME_GOOD(-0.10)[text/plain]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[microsoft.com:+]; DMARC_POLICY_ALLOW(-0.50)[microsoft.com,reject]; DWL_DNSWL_MED(-2.00)[microsoft.com:dkim]; WHITELIST_SPF_DKIM(-3.00)[microsoft.com:d:+,microsoft.com:s:+]; NEURAL_HAM_SHORT(-1.08)[-1.083]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:8075, ipnet:40.64.0.0/10, country:US]; RWL_MAILSPIKE_POSSIBLE(0.00)[40.107.131.104:from]; RCVD_IN_DNSWL_LOW(-0.10)[40.107.131.104:from] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 May 2020 01:50:43 -0000 > -----Original Message----- > From: Shawn Webb > Sent: Wednesday, May 20, 2020 11:11 PM > To: Wei Hu > Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src- > head@freebsd.org > Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock > dev/hyperv/include dev/hyperv/vmbus modules/hyperv > modules/hyperv/hvsock sys >=20 > On Wed, May 20, 2020 at 11:03:59AM +0000, Wei Hu wrote: > > Author: whu > > Date: Wed May 20 11:03:59 2020 > > New Revision: 361275 > > URL: https://svnweb.freebsd.org/changeset/base/361275 > > > > Log: > > HyperV socket implementation for FreeBSD > > > > This change adds Hyper-V socket feature in FreeBSD. New socket addres= s > > family AF_HYPERV and its kernel support are added. > > > > Submitted by: Wei Hu > > Reviewed by: Dexuan Cui > > Relnotes: yes > > Sponsored by: Microsoft > > Differential Revision: https://reviews.freebsd.org/D24061 >=20 > Hey Wei Hu, >=20 > Would it be good to bump __FreeBSD_version after a change like this? >=20 Hi Shawn, I was not familiar to the mechanism of __FreeBSD_version. But it looks like a good idea. However I am not sure if I have the right to update the chapter.xml file. Can you help on what I need to do the update this=20 version number? Thanks, Wei From owner-svn-src-all@freebsd.org Thu May 21 01:53: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 2D5962FBDF9; Thu, 21 May 2020 01:53: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 49SCLm0Pw8z47pD; Thu, 21 May 2020 01:53: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 095D425C6C; Thu, 21 May 2020 01:53: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 04L1r3gZ061757; Thu, 21 May 2020 01:53:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L1r3cw061756; Thu, 21 May 2020 01:53:03 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005210153.04L1r3cw061756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 May 2020 01:53:03 +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: r361311 - in stable: 11/usr.sbin/inetd 12/usr.sbin/inetd X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/usr.sbin/inetd 12/usr.sbin/inetd X-SVN-Commit-Revision: 361311 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, 21 May 2020 01:53:04 -0000 Author: kevans Date: Thu May 21 01:53:03 2020 New Revision: 361311 URL: https://svnweb.freebsd.org/changeset/base/361311 Log: MFC r361000, r361036: improve inetd(8) examples r361000: inetd(8): Provide HTTP proxy example using netcat One of the fortunes that are included in freebsd-tips talks about how the superserver can be used to proxy connections with netcat, but there are no examples provided. This commit adds an example with comment explaining what it does. r361036: inetd(8): Add comments to all examples Modified: stable/11/usr.sbin/inetd/inetd.8 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.sbin/inetd/inetd.8 Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.sbin/inetd/inetd.8 ============================================================================== --- stable/11/usr.sbin/inetd/inetd.8 Thu May 21 01:23:59 2020 (r361310) +++ stable/11/usr.sbin/inetd/inetd.8 Thu May 21 01:53:03 2020 (r361311) @@ -28,7 +28,7 @@ .\" from: @(#)inetd.8 8.3 (Berkeley) 4/13/94 .\" $FreeBSD$ .\" -.Dd January 12, 2008 +.Dd May 14, 2020 .Dt INETD 8 .Os .Sh NAME @@ -793,14 +793,30 @@ the pid of the currently running .Sh "EXAMPLES" Here are several example service entries for the various types of services: .Bd -literal +# The first four launch the relevant daemon when a connection on a port +# as defined by /etc/services is opened. ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l ntalk dgram udp wait root /usr/libexec/ntalkd ntalkd telnet stream tcp6 nowait root /usr/libexec/telnetd telnetd shell stream tcp46 nowait root /usr/libexec/rshd rshd + +# Let the system respond to date requests via tcpmux tcpmux/+date stream tcp nowait guest /bin/date date + +# Let people access the system phonebook via tcpmux tcpmux/phonebook stream tcp nowait guest /usr/local/bin/phonebook phonebook + +# Make kernel statistics accessible rstatd/1-3 dgram rpc/udp wait root /usr/libexec/rpc.rstatd rpc.rstatd -/var/run/echo stream unix nowait root internal + +# Use netcat as a one-shot HTTP proxy with nc (from freebsd-tips fortune) +http stream tcp nowait nobody /usr/bin/nc nc -N dest-ip 80 + +# Set up a unix socket at /var/run/echo that echo's back whatever is written +# to it. +/var/run/echo stream unix nowait root internal + +# Run chargen for IPsec Authentication Headers #@ ipsec ah/require chargen stream tcp nowait root internal #@ @@ -914,6 +930,7 @@ in the database. .El .Sh SEE ALSO +.Xr nc 1 , .Xr ipsec_set_policy 3 , .Xr hosts_access 5 , .Xr hosts_options 5 , From owner-svn-src-all@freebsd.org Thu May 21 01:53: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 9888B2FC0EE; Thu, 21 May 2020 01:53: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 49SCLm3bHfz47XW; Thu, 21 May 2020 01:53: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 76769259D7; Thu, 21 May 2020 01:53: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 04L1r4K2061763; Thu, 21 May 2020 01:53:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L1r4aH061762; Thu, 21 May 2020 01:53:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005210153.04L1r4aH061762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 May 2020 01:53: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: r361311 - in stable: 11/usr.sbin/inetd 12/usr.sbin/inetd X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/usr.sbin/inetd 12/usr.sbin/inetd X-SVN-Commit-Revision: 361311 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, 21 May 2020 01:53:04 -0000 Author: kevans Date: Thu May 21 01:53:03 2020 New Revision: 361311 URL: https://svnweb.freebsd.org/changeset/base/361311 Log: MFC r361000, r361036: improve inetd(8) examples r361000: inetd(8): Provide HTTP proxy example using netcat One of the fortunes that are included in freebsd-tips talks about how the superserver can be used to proxy connections with netcat, but there are no examples provided. This commit adds an example with comment explaining what it does. r361036: inetd(8): Add comments to all examples Modified: stable/12/usr.sbin/inetd/inetd.8 Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.sbin/inetd/inetd.8 Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.sbin/inetd/inetd.8 ============================================================================== --- stable/12/usr.sbin/inetd/inetd.8 Thu May 21 01:23:59 2020 (r361310) +++ stable/12/usr.sbin/inetd/inetd.8 Thu May 21 01:53:03 2020 (r361311) @@ -28,7 +28,7 @@ .\" from: @(#)inetd.8 8.3 (Berkeley) 4/13/94 .\" $FreeBSD$ .\" -.Dd January 12, 2008 +.Dd May 14, 2020 .Dt INETD 8 .Os .Sh NAME @@ -793,14 +793,30 @@ the pid of the currently running .Sh "EXAMPLES" Here are several example service entries for the various types of services: .Bd -literal +# The first four launch the relevant daemon when a connection on a port +# as defined by /etc/services is opened. ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l ntalk dgram udp wait root /usr/libexec/ntalkd ntalkd telnet stream tcp6 nowait root /usr/libexec/telnetd telnetd shell stream tcp46 nowait root /usr/libexec/rshd rshd + +# Let the system respond to date requests via tcpmux tcpmux/+date stream tcp nowait guest /bin/date date + +# Let people access the system phonebook via tcpmux tcpmux/phonebook stream tcp nowait guest /usr/local/bin/phonebook phonebook + +# Make kernel statistics accessible rstatd/1-3 dgram rpc/udp wait root /usr/libexec/rpc.rstatd rpc.rstatd -/var/run/echo stream unix nowait root internal + +# Use netcat as a one-shot HTTP proxy with nc (from freebsd-tips fortune) +http stream tcp nowait nobody /usr/bin/nc nc -N dest-ip 80 + +# Set up a unix socket at /var/run/echo that echo's back whatever is written +# to it. +/var/run/echo stream unix nowait root internal + +# Run chargen for IPsec Authentication Headers #@ ipsec ah/require chargen stream tcp nowait root internal #@ @@ -914,6 +930,7 @@ in the database. .El .Sh SEE ALSO +.Xr nc 1 , .Xr ipsec_set_policy 3 , .Xr hosts_access 5 , .Xr hosts_options 5 , From owner-svn-src-all@freebsd.org Thu May 21 01:53:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1D892FBEA5; Thu, 21 May 2020 01:53:09 +0000 (UTC) (envelope-from weh@microsoft.com) Received: from APC01-PU1-obe.outbound.protection.outlook.com (mail-pu1apc01on070c.outbound.protection.outlook.com [IPv6:2a01:111:f400:febe::70c]) (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 49SCLn6Qfdz47kY; Thu, 21 May 2020 01:53:05 +0000 (UTC) (envelope-from weh@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l3wmK9BnoYJWq6mANDr3CefEjurZ0AhjJb1ptPz4wqZTziBnVtuIXut8RGxYkeWDYgc6aEywTH79MDtp72+P7eDriMLn3TcCyKGaWZ4sg0I2PV1mSkB6i7h8PRU0vyzZi5H1RZPItVmTvkXNLzKG8YQiT0W2yiEuCQlbliK7m3mVZBWz7/VsapLMzhqXN06s7+liB0JQHCS1lao6PDuNCUG8oIw0eHPRsJyOEeg7tmXPR4Xs2WsAtLnO5Z5b0kjuo0EVGIf7r6yidkHL4gvsYU2w/hG7XMzg8u3AWYPAWcy8e6rhHyIQ1EOTh8vSlCV28CZLjxu30ppOmWybxAKdbQ== 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=6U4iVDV7xusrQbHjmfISlQUqrL3wP8OplwdQ9BVGhkI=; b=LPcHneJd2NF7t1/a2Yium2yj/juE0f9sCYBkzSnrYsnDhi2u/WvSLm+FWKAvw7aVzRT+1I2Bm+B7U2nrya0LAX+yDHhSwRacB16jJeXHmixji28S1diMOcsmcq4msXdRm8ARUakas9jnMGyh4f8immHvpQjzjPzOz/81LHvaxxUtdxV/BxVmnTDHXK99lLODBQKPBnLjB76qh1W5fi9FH9dhpPfLqYG/OKyFvxXM2AA6Jddbds37RgH7ImR+kG7VL7NVe7oZUWFZpPBN8fhSFsSN/L8cazigUi7CpqgSBOwi1VxDwqYU/QY9HoO0Vpupxx3xPXNKmGtLhxYC0r2y2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none Received: from SG2P153MB0377.APCP153.PROD.OUTLOOK.COM (2603:1096:0:1::15) by SG2P153MB0377.APCP153.PROD.OUTLOOK.COM (2603:1096:0:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.5; Thu, 21 May 2020 01:53:01 +0000 Received: from SG2P153MB0377.APCP153.PROD.OUTLOOK.COM ([fe80::798e:2eb8:f18e:7a0]) by SG2P153MB0377.APCP153.PROD.OUTLOOK.COM ([fe80::798e:2eb8:f18e:7a0%7]) with mapi id 15.20.3045.005; Thu, 21 May 2020 01:53:01 +0000 From: Wei Hu To: Enji Cooper , Shawn Webb CC: Wei Hu , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: RE: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Thread-Topic: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Thread-Index: AQHWLpZljJNzTG7+okeOAs3l3mz20qixFLIAgAAMIgCAAAC+gIAApboA Date: Thu, 21 May 2020 01:53:00 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-05-21T01:52:59Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=2019a919-b4b1-40af-ae99-c0bc2b909b87; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0 x-originating-ip: [2404:f801:9000:18:6fed::496b] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 974285eb-76e8-4d00-a6d1-08d7fd29b1c2 x-ms-traffictypediagnostic: SG2P153MB0377: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 041032FF37 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: WunR6rBpgr17ptBU/b04ZA5xkrICyZzkGZ4Zkl5sUOKnlmo32qLxryhLYGnLk6ysmi5W6SAA4/kLdk6Pb52jC0oHl+kap6s10Mwt11l6K6/C0WFGCM61XJRZOBL5R7Wqc2Y0jzSsxV3egm8yBDdbwsVI+s+J+cC2GJH+COLKL4kVjOGYdsOAsLweOo77GqsCRJs0U/pHZ2hI9ef2mJ2uWK5ipTO/VpqpaTbbeme2jkkVZiFStJr5hhgOI2OgigIDZWBCFaCTWtnT/U3KN6PO3dD64cUUQGS8NnOxmhww2HNp2bzlKQiC2vgcaXOELGQxrlszcv/8Icsa2o1IemwPLTKTXJUKoHZ45flmr3VAoeGNpLva2BJuS+tELhmDmLObUrNk3mg/C6XXi5R8r5sWPg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SG2P153MB0377.APCP153.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(136003)(346002)(39860400002)(366004)(396003)(7696005)(33656002)(6506007)(53546011)(8990500004)(966005)(478600001)(66946007)(5660300002)(55016002)(64756008)(76116006)(52536014)(110136005)(316002)(66446008)(9686003)(66476007)(66556008)(54906003)(186003)(82950400001)(82960400001)(4326008)(10290500003)(83080400001)(71200400001)(86362001)(8676002)(8936002)(2906002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: YOhrCVbrlR/LGBMyO0CuDP3+c+fSKj6GlROz6Ur959FyiqfTw6BlSLChY5V10U9MQVFCfk8MADn1Eh41jhoCi+WHw9hXrPoo5SArhNWa7XbJXJd0tMf+zw+ZsszeTpulfW4gJhljxrJvoPXxnaxM1fG/KXNZNi6JhhEoUeAn41po9iLIEpq3jS3CxsapV7ULA2ktChpgPcTDgZnF0L4QIw/0DSh6F/YGZsYbUWpk3A/T0MAalZ1t9WLUhs7gBwM2sKvc1juHuOIb2KbIXOmgA7aPM64OLap8UxTkPAqVuWF9AUo5Jtvc0S6UMHHKwByxmB1zDc6zQXWqVF+ZKYOUGqc+2P9/JybfzUFqtfuz+8/ItV6iP59znrZlMShzFGQJRDbfVvWMkCe6n8LG+hBeJSX51djXr654tNbdaSV44bqqUtga1FSvDDbdmIzFCpmJsTBlbiCZrQ0qIM4gkIUpwdPB5l5x/dYZRL0iVQtgLuxOxdjzZjELthJz8k5QJE3fksoUIHaHWOd6H/SrEbQX6Q== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 974285eb-76e8-4d00-a6d1-08d7fd29b1c2 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 May 2020 01:53:00.9265 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Dt8H720QdFE6jbnwQHV7WPF6eD7qwPsatBZ4T0ov2bwgR2MjLh1CFh+ZgmSGD1VX3N8eIbnszNTuoA082gnNVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2P153MB0377 X-Rspamd-Queue-Id: 49SCLn6Qfdz47kY X-Spamd-Bar: --------- X-Spamd-Result: default: False [-9.88 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.987]; R_DKIM_ALLOW(-0.20)[microsoft.com:s=selector2]; HAS_XOIP(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a01:111:f400::/48:c]; NEURAL_HAM_LONG(-1.03)[-1.030]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DWL_DNSWL_MED(-2.00)[microsoft.com:dkim]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[microsoft.com:+]; MIME_BASE64_TEXT(0.10)[]; DMARC_POLICY_ALLOW(-0.50)[microsoft.com,reject]; NEURAL_HAM_SHORT(-0.96)[-0.959]; FREEMAIL_TO(0.00)[gmail.com,hardenedbsd.org]; WHITELIST_SPF_DKIM(-3.00)[microsoft.com:d:+,microsoft.com:s:+]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8075, ipnet:2a01:111:f000::/36, country:US]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 May 2020 01:53:10 -0000 DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogRW5qaSBDb29wZXIgPHlh bmV1cmFiZXlhQGdtYWlsLmNvbT4NCj4gU2VudDogV2VkbmVzZGF5LCBNYXkgMjAsIDIwMjAgMTE6 NTggUE0NCj4gVG86IFNoYXduIFdlYmIgPHNoYXduLndlYmJAaGFyZGVuZWRic2Qub3JnPg0KPiBD YzogV2VpIEh1IDx3aHVAZnJlZWJzZC5vcmc+OyBzcmMtY29tbWl0dGVyc0BmcmVlYnNkLm9yZzsg c3ZuLXNyYy0NCj4gYWxsQGZyZWVic2Qub3JnOyBzdm4tc3JjLWhlYWRAZnJlZWJzZC5vcmcNCj4g U3ViamVjdDogUmU6IHN2biBjb21taXQ6IHIzNjEyNzUgLSBpbiBoZWFkL3N5czogY29uZiBkZXYv aHlwZXJ2L2h2c29jaw0KPiBkZXYvaHlwZXJ2L2luY2x1ZGUgZGV2L2h5cGVydi92bWJ1cyBtb2R1 bGVzL2h5cGVydg0KPiBtb2R1bGVzL2h5cGVydi9odnNvY2sgc3lzDQo+IA0KPiANCj4gPiBPbiBN YXkgMjAsIDIwMjAsIGF0IDA4OjU0LCBFbmppIENvb3BlciA8eWFuZXVyYWJleWFAZ21haWwuY29t PiB3cm90ZToNCj4gPiANCj4gPj4+IE9uIE1heSAyMCwgMjAyMCwgYXQgMDg6MTEsIFNoYXduIFdl YmIgPHNoYXduLndlYmJAaGFyZGVuZWRic2Qub3JnPg0KPiB3cm90ZToNCj4gPj4+DQo+ID4+PiDv u79PbiBXZWQsIE1heSAyMCwgMjAyMCBhdCAxMTowMzo1OUFNICswMDAwLCBXZWkgSHUgd3JvdGU6 DQo+ID4+PiBBdXRob3I6IHdodQ0KPiA+Pj4gRGF0ZTogV2VkIE1heSAyMCAxMTowMzo1OSAyMDIw DQo+ID4+PiBOZXcgUmV2aXNpb246IDM2MTI3NQ0KPiA+Pj4gVVJMOg0KPiA+Pj4gaHR0cHM6Ly9u YW0wNi5zYWZlbGlua3MucHJvdGVjdGlvbi5vdXRsb29rLmNvbS8/dXJsPWh0dHBzJTNBJTJGJTJG c3YNCj4gPj4+DQo+IG53ZWIuZnJlZWJzZC5vcmclMkZjaGFuZ2VzZXQlMkZiYXNlJTJGMzYxMjc1 JmFtcDtkYXRhPTAyJTdDMDElN0MNCj4gd2VoJQ0KPiA+Pj4NCj4gNDBtaWNyb3NvZnQuY29tJTdD ZDZmZjM2MTdiZmZhNDNkMTBhNzcwOGQ3ZmNkNjg0NzAlN0M3MmY5ODhiZjg2ZjE0MQ0KPiBhDQo+ ID4+Pg0KPiBmOTFhYjJkN2NkMDExZGI0NyU3QzElN0MwJTdDNjM3MjU1ODcwNTgxMTEwODg4JmFt cDtzZGF0YT1teno2Ug0KPiBJTENWQmsNCj4gPj4+IHEwNlJJMVBBZlZOS1daTzJ5N2pCTzBDMUUl MkYlMkZFSndVWSUzRCZhbXA7cmVzZXJ2ZWQ9MA0KPiA+Pj4NCj4gPj4+IExvZzoNCj4gPj4+IEh5 cGVyViBzb2NrZXQgaW1wbGVtZW50YXRpb24gZm9yIEZyZWVCU0QNCj4gPj4+DQo+ID4+PiBUaGlz IGNoYW5nZSBhZGRzIEh5cGVyLVYgc29ja2V0IGZlYXR1cmUgaW4gRnJlZUJTRC4gTmV3IHNvY2tl dA0KPiA+Pj4gYWRkcmVzcyBmYW1pbHkgQUZfSFlQRVJWIGFuZCBpdHMga2VybmVsIHN1cHBvcnQg YXJlIGFkZGVkLg0KPiA+DQo+ID4gSGkgV2VpLA0KPiA+ICAgIENvdWxkIHlvdSBwbGVhc2UgZnVy dGhlciBkZXNjcmliZSB3aGF0IHRoaXMgZmVhdHVyZSBpcy9kb2VzPw0KPiANCj4gICAgIEkgcmVh bGl6ZSBhZnRlciBsb29raW5nIGF0IHRoZSByZXZpZXcgdGhhdCBpdCBjb250YWlucyB0aGUgY29u dGVudCBJIHdhcyBob3BpbmcNCj4gZm9yLiBJdCB3b3VsZCBoYXZlIGJlZW4gaGVscGZ1bCB0byBm b2xrcyBpZiB0aGlzIGNvbnRleHQgaGFkIGJlZW4gaW5jbHVkZWQgaW4gdGhlDQo+IGNvbW1pdCBt ZXNzYWdlLg0KDQpIaSBFbmppLA0KDQpJIHRob3VnaHQgSSBqdXN0IGtlZXAgaXQgc2ltcGxlIGZv ciB0aGUgY29tbWl0IGxvZyBtZXNzYWdlIHdoaWxlIHBlb3BsZSBjYW4NCnJlZmVyIHRvIHRoZSBy ZXZpZXcgc2l0ZSBmb3IgZGV0YWlscy4gU29ycnkgYWJvdXQgdGhhdC4gTGV0IG1lIGtub3cgaWYg dGhlcmUgaXMNCmFueXdheSB0byBtYWtlIHVwIGZvciBpdC4NCg0KV2VpDQo= From owner-svn-src-all@freebsd.org Thu May 21 01:55: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 C00232FBFD5; Thu, 21 May 2020 01:55:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SCPB3mdSz48LS; Thu, 21 May 2020 01:55:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C9BB257DE; Thu, 21 May 2020 01:55:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L1tAdk061960; Thu, 21 May 2020 01:55:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L1tA8l061959; Thu, 21 May 2020 01:55:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005210155.04L1tA8l061959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 May 2020 01:55: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: r361312 - stable/12/tests/sys/netpfil/pf/ioctl X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/tests/sys/netpfil/pf/ioctl X-SVN-Commit-Revision: 361312 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, 21 May 2020 01:55:10 -0000 Author: kevans Date: Thu May 21 01:55:10 2020 New Revision: 361312 URL: https://svnweb.freebsd.org/changeset/base/361312 Log: MFC r361065: pf tests: fix up a couple WARNS= 6 nits common_init_tbl is only used within this single CU, so it should be marked static. WARNS=6 also complained about the var defined by `ATF_TC_WITH_CLEANUP(getastats);` being unused, which turns out to be because it's not been hooked up in ATF_TP_ADD_TCS. kp@ did not immediately recall any reason for this, and the case passes on my local system, so hook it up. Note that I've not yet set WARNS= 6 here. Investigation is underway to see if we can feasibly default WARNS to 6 for src builds to catch directories too deep to inherit a WARNS from the top-level subdirectories' Makefile.inc. Those particular WARNS settings will be subsequently removed as they become redundant with a more-global default. Modified: stable/12/tests/sys/netpfil/pf/ioctl/validation.c Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/netpfil/pf/ioctl/validation.c ============================================================================== --- stable/12/tests/sys/netpfil/pf/ioctl/validation.c Thu May 21 01:53:03 2020 (r361311) +++ stable/12/tests/sys/netpfil/pf/ioctl/validation.c Thu May 21 01:55:10 2020 (r361312) @@ -51,7 +51,7 @@ static int dev; #define COMMON_CLEANUP() \ close(dev); -void +static void common_init_tbl(struct pfr_table *tbl) { bzero(tbl, sizeof(struct pfr_table)); @@ -795,6 +795,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, addtables); ATF_TP_ADD_TC(tp, deltables); ATF_TP_ADD_TC(tp, gettables); + ATF_TP_ADD_TC(tp, getastats); ATF_TP_ADD_TC(tp, gettstats); ATF_TP_ADD_TC(tp, clrtstats); ATF_TP_ADD_TC(tp, settflags); From owner-svn-src-all@freebsd.org Thu May 21 01:55: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 3A5B72FBFE3; Thu, 21 May 2020 01:55:38 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SCPk14X0z48MG; Thu, 21 May 2020 01:55:38 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FE0D259D8; Thu, 21 May 2020 01:55:38 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L1tclb062040; Thu, 21 May 2020 01:55:38 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L1tZlU062027; Thu, 21 May 2020 01:55:35 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005210155.04L1tZlU062027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Thu, 21 May 2020 01:55:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361313 - in head: lib/libugidfw sbin/mksnap_ffs sbin/umount sys/fs/nfs sys/fs/nfsserver sys/kern sys/security/mac_bsdextended sys/sys usr.sbin/autofs usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in head: lib/libugidfw sbin/mksnap_ffs sbin/umount sys/fs/nfs sys/fs/nfsserver sys/kern sys/security/mac_bsdextended sys/sys usr.sbin/autofs usr.sbin/mountd X-SVN-Commit-Revision: 361313 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, 21 May 2020 01:55:38 -0000 Author: freqlabs Date: Thu May 21 01:55:35 2020 New Revision: 361313 URL: https://svnweb.freebsd.org/changeset/base/361313 Log: Deduplicate fsid comparisons Comparing fsid_t objects requires internal knowledge of the fsid structure and yet this is duplicated across a number of places in the code. Simplify by creating a fsidcmp function (macro). Reviewed by: mjg, rmacklem Approved by: mav (mentor) MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D24749 Modified: head/lib/libugidfw/ugidfw.c head/sbin/mksnap_ffs/mksnap_ffs.c head/sbin/umount/umount.c head/sys/fs/nfs/nfsdport.h head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdsocket.c head/sys/fs/nfsserver/nfs_nfsdstate.c head/sys/kern/vfs_subr.c head/sys/security/mac_bsdextended/mac_bsdextended.c head/sys/security/mac_bsdextended/mac_bsdextended.h head/sys/sys/mount.h head/usr.sbin/autofs/autounmountd.c head/usr.sbin/mountd/mountd.c Modified: head/lib/libugidfw/ugidfw.c ============================================================================== --- head/lib/libugidfw/ugidfw.c Thu May 21 01:55:10 2020 (r361312) +++ head/lib/libugidfw/ugidfw.c Thu May 21 01:55:35 2020 (r361313) @@ -334,9 +334,8 @@ bsde_rule_to_string(struct mac_bsdextended_rule *rule, if (rule->mbr_object.mbo_flags & MBO_FSID_DEFINED) { numfs = getmntinfo(&mntbuf, MNT_NOWAIT); for (i = 0; i < numfs; i++) - if (memcmp(&(rule->mbr_object.mbo_fsid), - &(mntbuf[i].f_fsid), - sizeof(mntbuf[i].f_fsid)) == 0) + if (fsidcmp(&rule->mbr_object.mbo_fsid, + &mntbuf[i].f_fsid) == 0) break; len = snprintf(cur, left, "filesys %s ", i == numfs ? "???" : mntbuf[i].f_mntonname); Modified: head/sbin/mksnap_ffs/mksnap_ffs.c ============================================================================== --- head/sbin/mksnap_ffs/mksnap_ffs.c Thu May 21 01:55:10 2020 (r361312) +++ head/sbin/mksnap_ffs/mksnap_ffs.c Thu May 21 01:55:35 2020 (r361313) @@ -81,8 +81,7 @@ issamefs(const char *path, struct statfs *stfsp) return (-1); if (statfs(path, &stfsbuf) < 0) return (-1); - if ((stfsbuf.f_fsid.val[0] != stfsp->f_fsid.val[0]) || - (stfsbuf.f_fsid.val[1] != stfsp->f_fsid.val[1])) + if (fsidcmp(&stfsbuf.f_fsid, &stfsp->f_fsid) != 0) return (0); return (1); } Modified: head/sbin/umount/umount.c ============================================================================== --- head/sbin/umount/umount.c Thu May 21 01:55:10 2020 (r361312) +++ head/sbin/umount/umount.c Thu May 21 01:55:35 2020 (r361313) @@ -505,8 +505,7 @@ getmntentry(const char *fromname, const char *onname, continue; if (onname != NULL && strcmp(sfs->f_mntonname, onname) != 0) continue; - if (fsid != NULL && bcmp(&sfs->f_fsid, fsid, - sizeof(*fsid)) != 0) + if (fsid != NULL && fsidcmp(&sfs->f_fsid, fsid) != 0) continue; switch (what) { Modified: head/sys/fs/nfs/nfsdport.h ============================================================================== --- head/sys/fs/nfs/nfsdport.h Thu May 21 01:55:10 2020 (r361312) +++ head/sys/fs/nfs/nfsdport.h Thu May 21 01:55:35 2020 (r361313) @@ -85,8 +85,7 @@ struct nfsexstuff { #define NFSVNO_SETEXRDONLY(e) ((e)->nes_exflag = (MNT_EXPORTED|MNT_EXRDONLY)) #define NFSVNO_CMPFH(f1, f2) \ - ((f1)->fh_fsid.val[0] == (f2)->fh_fsid.val[0] && \ - (f1)->fh_fsid.val[1] == (f2)->fh_fsid.val[1] && \ + (fsidcmp(&(f1)->fh_fsid, &(f2)->fh_fsid) == 0 && \ bcmp(&(f1)->fh_fid, &(f2)->fh_fid, sizeof(struct fid)) == 0) #define NFSLOCKHASH(f) \ Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Thu May 21 01:55:10 2020 (r361312) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Thu May 21 01:55:35 2020 (r361313) @@ -4019,11 +4019,8 @@ nfsrv_pnfscreate(struct vnode *vp, struct vattr *vap, if (tds->nfsdev_nmp != NULL) { if (tds->nfsdev_mdsisset == 0 && ds == NULL) ds = tds; - else if (tds->nfsdev_mdsisset != 0 && - mp->mnt_stat.f_fsid.val[0] == - tds->nfsdev_mdsfsid.val[0] && - mp->mnt_stat.f_fsid.val[1] == - tds->nfsdev_mdsfsid.val[1]) { + else if (tds->nfsdev_mdsisset != 0 && fsidcmp( + &mp->mnt_stat.f_fsid, &tds->nfsdev_mdsfsid) == 0) { ds = fds = tds; break; } @@ -4043,10 +4040,8 @@ nfsrv_pnfscreate(struct vnode *vp, struct vattr *vap, if (tds->nfsdev_nmp != NULL && ((tds->nfsdev_mdsisset == 0 && fds == NULL) || (tds->nfsdev_mdsisset != 0 && fds != NULL && - mp->mnt_stat.f_fsid.val[0] == - tds->nfsdev_mdsfsid.val[0] && - mp->mnt_stat.f_fsid.val[1] == - tds->nfsdev_mdsfsid.val[1]))) { + fsidcmp(&mp->mnt_stat.f_fsid, + &tds->nfsdev_mdsfsid) == 0))) { dsdir[mirrorcnt] = i; dvp[mirrorcnt] = tds->nfsdev_dsdir[i]; mirrorcnt++; @@ -4778,10 +4773,8 @@ nfsrv_dsgetsockmnt(struct vnode *vp, int lktype, char fndds->nfsdev_mdsisset == 0) || (tds->nfsdev_mdsisset != 0 && fndds->nfsdev_mdsisset != 0 && - tds->nfsdev_mdsfsid.val[0] == - mp->mnt_stat.f_fsid.val[0] && - tds->nfsdev_mdsfsid.val[1] == - mp->mnt_stat.f_fsid.val[1]))) { + fsidcmp(&tds->nfsdev_mdsfsid, + &mp->mnt_stat.f_fsid) == 0))) { *newnmpp = tds->nfsdev_nmp; break; } @@ -5968,8 +5961,7 @@ nfsrv_pnfsstatfs(struct statfs *sf, struct mount *mp) /* First, search for matches for same file system. */ TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { if (ds->nfsdev_nmp != NULL && ds->nfsdev_mdsisset != 0 && - ds->nfsdev_mdsfsid.val[0] == mp->mnt_stat.f_fsid.val[0] && - ds->nfsdev_mdsfsid.val[1] == mp->mnt_stat.f_fsid.val[1]) { + fsidcmp(&ds->nfsdev_mdsfsid, &mp->mnt_stat.f_fsid) == 0) { if (++i > nfsrv_devidcnt) break; *tdvpp++ = ds->nfsdev_dvp; Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdsocket.c Thu May 21 01:55:10 2020 (r361312) +++ head/sys/fs/nfsserver/nfs_nfsdsocket.c Thu May 21 01:55:35 2020 (r361313) @@ -1059,10 +1059,7 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram if (!error && !nd->nd_repstat) { if (op == NFSV4OP_LOOKUP || op == NFSV4OP_LOOKUPP) { new_mp = nvp->v_mount; - if (cur_fsid.val[0] != - new_mp->mnt_stat.f_fsid.val[0] || - cur_fsid.val[1] != - new_mp->mnt_stat.f_fsid.val[1]) { + if (fsidcmp(&cur_fsid, &new_mp->mnt_stat.f_fsid) != 0) { /* crossed a server mount point */ nd->nd_repstat = nfsvno_checkexp(new_mp, nd->nd_nam, &nes, &credanon); @@ -1091,8 +1088,7 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram if (vp == NULL || savevp == NULL) { nd->nd_repstat = NFSERR_NOFILEHANDLE; break; - } else if (cur_fsid.val[0] != save_fsid.val[0] || - cur_fsid.val[1] != save_fsid.val[1]) { + } else if (fsidcmp(&cur_fsid, &save_fsid) != 0) { nd->nd_repstat = NFSERR_XDEV; break; } Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Thu May 21 01:55:10 2020 (r361312) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Thu May 21 01:55:35 2020 (r361313) @@ -7535,8 +7535,7 @@ nfsrv_freelayouts(nfsquad_t *clid, fsid_t *fs, int lay TAILQ_FOREACH_SAFE(lyp, &lhyp->list, lay_list, nlyp) { if (clid->qval != lyp->lay_clientid.qval) continue; - if (fs != NULL && (fs->val[0] != lyp->lay_fsid.val[0] || - fs->val[1] != lyp->lay_fsid.val[1])) + if (fs != NULL && fsidcmp(fs, &lyp->lay_fsid) != 0) continue; if (laytype != lyp->lay_type) continue; @@ -7830,10 +7829,8 @@ nfsrv_delds(char *devid, NFSPROC_T *p) TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { if (ds != fndds && ds->nfsdev_nmp != NULL && ds->nfsdev_mdsisset != 0 && - ds->nfsdev_mdsfsid.val[0] == - fndds->nfsdev_mdsfsid.val[0] && - ds->nfsdev_mdsfsid.val[1] == - fndds->nfsdev_mdsfsid.val[1]) { + fsidcmp(&ds->nfsdev_mdsfsid, + &fndds->nfsdev_mdsfsid) == 0) { fndmirror = 1; break; } @@ -8737,10 +8734,8 @@ nfsrv_findmirroredds(struct nfsmount *nmp) TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { if (ds != fndds && ds->nfsdev_nmp != NULL && ds->nfsdev_mdsisset != 0 && - ds->nfsdev_mdsfsid.val[0] == - fndds->nfsdev_mdsfsid.val[0] && - ds->nfsdev_mdsfsid.val[1] == - fndds->nfsdev_mdsfsid.val[1]) { + fsidcmp(&ds->nfsdev_mdsfsid, + &fndds->nfsdev_mdsfsid) == 0) { fndmirror = 1; break; } Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu May 21 01:55:10 2020 (r361312) +++ head/sys/kern/vfs_subr.c Thu May 21 01:55:35 2020 (r361313) @@ -841,8 +841,7 @@ vfs_getvfs(fsid_t *fsid) CTR2(KTR_VFS, "%s: fsid %p", __func__, fsid); mtx_lock(&mountlist_mtx); TAILQ_FOREACH(mp, &mountlist, mnt_list) { - if (mp->mnt_stat.f_fsid.val[0] == fsid->val[0] && - mp->mnt_stat.f_fsid.val[1] == fsid->val[1]) { + if (fsidcmp(&mp->mnt_stat.f_fsid, fsid) == 0) { vfs_ref(mp); mtx_unlock(&mountlist_mtx); return (mp); @@ -877,16 +876,13 @@ vfs_busyfs(fsid_t *fsid) hash = fsid->val[0] ^ fsid->val[1]; hash = (hash >> 16 ^ hash) & (FSID_CACHE_SIZE - 1); mp = cache[hash]; - if (mp == NULL || - mp->mnt_stat.f_fsid.val[0] != fsid->val[0] || - mp->mnt_stat.f_fsid.val[1] != fsid->val[1]) + if (mp == NULL || fsidcmp(&mp->mnt_stat.f_fsid, fsid) != 0) goto slow; if (vfs_busy(mp, 0) != 0) { cache[hash] = NULL; goto slow; } - if (mp->mnt_stat.f_fsid.val[0] == fsid->val[0] && - mp->mnt_stat.f_fsid.val[1] == fsid->val[1]) + if (fsidcmp(&mp->mnt_stat.f_fsid, fsid) == 0) return (mp); else vfs_unbusy(mp); @@ -894,8 +890,7 @@ vfs_busyfs(fsid_t *fsid) slow: mtx_lock(&mountlist_mtx); TAILQ_FOREACH(mp, &mountlist, mnt_list) { - if (mp->mnt_stat.f_fsid.val[0] == fsid->val[0] && - mp->mnt_stat.f_fsid.val[1] == fsid->val[1]) { + if (fsidcmp(&mp->mnt_stat.f_fsid, fsid) == 0) { error = vfs_busy(mp, MBF_MNTLSTLOCK); if (error) { cache[hash] = NULL; Modified: head/sys/security/mac_bsdextended/mac_bsdextended.c ============================================================================== --- head/sys/security/mac_bsdextended/mac_bsdextended.c Thu May 21 01:55:10 2020 (r361312) +++ head/sys/security/mac_bsdextended/mac_bsdextended.c Thu May 21 01:55:35 2020 (r361313) @@ -302,9 +302,8 @@ ugidfw_rulecheck(struct mac_bsdextended_rule *rule, } if (rule->mbr_object.mbo_flags & MBO_FSID_DEFINED) { - match = (bcmp(&(vp->v_mount->mnt_stat.f_fsid), - &(rule->mbr_object.mbo_fsid), - sizeof(rule->mbr_object.mbo_fsid)) == 0); + match = (fsidcmp(&vp->v_mount->mnt_stat.f_fsid, + &rule->mbr_object.mbo_fsid) == 0); if (rule->mbr_object.mbo_neg & MBO_FSID_DEFINED) match = !match; if (!match) Modified: head/sys/security/mac_bsdextended/mac_bsdextended.h ============================================================================== --- head/sys/security/mac_bsdextended/mac_bsdextended.h Thu May 21 01:55:10 2020 (r361312) +++ head/sys/security/mac_bsdextended/mac_bsdextended.h Thu May 21 01:55:35 2020 (r361313) @@ -101,7 +101,7 @@ struct mac_bsdextended_object { uid_t mbo_uid_max; gid_t mbo_gid_min; gid_t mbo_gid_max; - struct fsid mbo_fsid; + fsid_t mbo_fsid; int mbo_type; }; Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Thu May 21 01:55:10 2020 (r361312) +++ head/sys/sys/mount.h Thu May 21 01:55:35 2020 (r361313) @@ -52,6 +52,8 @@ typedef struct fsid { int32_t val[2]; } fsid_t; /* filesystem id type */ +#define fsidcmp(a, b) memcmp((a), (b), sizeof(fsid_t)) + /* * File identifier. * These are unique per filesystem on a single machine. Modified: head/usr.sbin/autofs/autounmountd.c ============================================================================== --- head/usr.sbin/autofs/autounmountd.c Thu May 21 01:55:10 2020 (r361312) +++ head/usr.sbin/autofs/autounmountd.c Thu May 21 01:55:35 2020 (r361313) @@ -67,8 +67,7 @@ automounted_find(fsid_t fsid) struct automounted_fs *af; TAILQ_FOREACH(af, &automounted, af_next) { - if (af->af_fsid.val[0] == fsid.val[0] && - af->af_fsid.val[1] == fsid.val[1]) + if (fsidcmp(&af->af_fsid, &fsid) == 0) return (af); } Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Thu May 21 01:55:10 2020 (r361312) +++ head/usr.sbin/mountd/mountd.c Thu May 21 01:55:35 2020 (r361313) @@ -1568,10 +1568,8 @@ get_exportlist_one(int passno) ep = get_exp(); } else { if (ep) { - if (ep->ex_fs.val[0] != - fsb.f_fsid.val[0] || - ep->ex_fs.val[1] != - fsb.f_fsid.val[1]) { + if (fsidcmp(&ep->ex_fs, &fsb.f_fsid) + != 0) { getexp_err(ep, tgrp, "fsid mismatch"); goto nextline; @@ -2088,8 +2086,7 @@ compare_nmount_exportlist(struct iovec *iov, int iovle if ((oep->ex_flag & EX_DONE) == 0) { LOGDEBUG("not done delete=%s", oep->ex_fsdir); if (statfs(oep->ex_fsdir, &ofs) >= 0 && - oep->ex_fs.val[0] == ofs.f_fsid.val[0] && - oep->ex_fs.val[1] == ofs.f_fsid.val[1]) { + fsidcmp(&oep->ex_fs, &ofs.f_fsid) == 0) { LOGDEBUG("do delete"); /* * Clear has_publicfh if if was set @@ -2353,8 +2350,7 @@ ex_search(fsid_t *fsid, struct exportlisthead *exhp) i = EXPHASH(fsid); SLIST_FOREACH(ep, &exhp[i], entries) { - if (ep->ex_fs.val[0] == fsid->val[0] && - ep->ex_fs.val[1] == fsid->val[1]) + if (fsidcmp(&ep->ex_fs, fsid) == 0) return (ep); } @@ -3122,8 +3118,7 @@ do_mount(struct exportlist *ep, struct grouplist *grp, * filesystem. */ if (statfs(dirp, &fsb1) != 0 || - bcmp(&fsb1.f_fsid, &fsb->f_fsid, - sizeof (fsb1.f_fsid)) != 0) { + fsidcmp(&fsb1.f_fsid, &fsb->f_fsid) != 0) { *cp = savedc; syslog(LOG_ERR, "can't export %s %s", dirp, From owner-svn-src-all@freebsd.org Thu May 21 02:04: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 2BC172FC5C6; Thu, 21 May 2020 02:04:12 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SCbc0NhYz48g0; Thu, 21 May 2020 02:04:12 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0866D25AD8; Thu, 21 May 2020 02:04:12 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L24BVv068331; Thu, 21 May 2020 02:04:11 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L24AeU068324; Thu, 21 May 2020 02:04:11 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005210204.04L24AeU068324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Thu, 21 May 2020 02:04: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: r361314 - stable/12/usr.sbin/jail X-SVN-Group: stable-12 X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: stable/12/usr.sbin/jail X-SVN-Commit-Revision: 361314 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, 21 May 2020 02:04:12 -0000 Author: freqlabs Date: Thu May 21 02:04:10 2020 New Revision: 361314 URL: https://svnweb.freebsd.org/changeset/base/361314 Log: MFC r361066: jail: Add exec.prepare and exec.release command hooks This change introduces new jail command hooks that run before and after any other actions. The exec.prepare hook can be used for example to invoke a script that checks if the jail's root exists, creating it if it does not. Since arbitrary variables in jail.conf can be passed to the command, it can be pretty useful for templating jails. An example use case for exec.release would be to remove the filesystem of an ephemeral jail. The names "prepare" and "release" are borrowed from the names of similar hooks in libvirt. Reviewed by: jamie, manpages, mmacy Approved by: mmacy (mentor) Differential Revision: https://reviews.freebsd.org/D24829 Modified: stable/12/usr.sbin/jail/command.c stable/12/usr.sbin/jail/config.c stable/12/usr.sbin/jail/jail.8 stable/12/usr.sbin/jail/jail.c stable/12/usr.sbin/jail/jailp.h Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/jail/command.c ============================================================================== --- stable/12/usr.sbin/jail/command.c Thu May 21 01:55:35 2020 (r361313) +++ stable/12/usr.sbin/jail/command.c Thu May 21 02:04:10 2020 (r361314) @@ -148,7 +148,8 @@ next_command(struct cfjail *j) if (j->comstring == NULL || j->comstring->len == 0 || (create_failed && (comparam == IP_EXEC_PRESTART || comparam == IP_EXEC_CREATED || comparam == IP_EXEC_START || - comparam == IP_COMMAND || comparam == IP_EXEC_POSTSTART))) + comparam == IP_COMMAND || comparam == IP_EXEC_POSTSTART || + comparam == IP_EXEC_PREPARE))) continue; switch (run_command(j)) { case -1: Modified: stable/12/usr.sbin/jail/config.c ============================================================================== --- stable/12/usr.sbin/jail/config.c Thu May 21 01:55:35 2020 (r361313) +++ stable/12/usr.sbin/jail/config.c Thu May 21 02:04:10 2020 (r361314) @@ -71,8 +71,10 @@ static const struct ipspec intparams[] = { [IP_EXEC_JAIL_USER] = {"exec.jail_user", PF_INTERNAL}, [IP_EXEC_POSTSTART] = {"exec.poststart", PF_INTERNAL}, [IP_EXEC_POSTSTOP] = {"exec.poststop", PF_INTERNAL}, + [IP_EXEC_PREPARE] = {"exec.prepare", PF_INTERNAL}, [IP_EXEC_PRESTART] = {"exec.prestart", PF_INTERNAL}, [IP_EXEC_PRESTOP] = {"exec.prestop", PF_INTERNAL}, + [IP_EXEC_RELEASE] = {"exec.release", PF_INTERNAL}, [IP_EXEC_CREATED] = {"exec.created", PF_INTERNAL}, [IP_EXEC_START] = {"exec.start", PF_INTERNAL}, [IP_EXEC_STOP] = {"exec.stop", PF_INTERNAL}, Modified: stable/12/usr.sbin/jail/jail.8 ============================================================================== --- stable/12/usr.sbin/jail/jail.8 Thu May 21 01:55:35 2020 (r361313) +++ stable/12/usr.sbin/jail/jail.8 Thu May 21 02:04:10 2020 (r361314) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 17, 2020 +.Dd May 14, 2020 .Dt JAIL 8 .Os .Sh NAME @@ -724,6 +724,11 @@ not be created or removed, as appropriate. .Pp The pseudo-parameters are: .Bl -tag -width indent +.It Va exec.prepare +Command(s) to run in the system environment to prepare a jail for creation. +These commands are executed before assigning IP addresses and mounting +filesystems, so they may be used to create a new jail filesystem if it does +not already exist. .It Va exec.prestart Command(s) to run in the system environment before a jail is created. .It Va exec.created @@ -758,6 +763,11 @@ A typical command to run is .Dq sh /etc/rc.shutdown jail . .It Va exec.poststop Command(s) to run in the system environment after a jail is removed. +.It Va exec.release +Command(s) to run in the system environment after all other actions are done. +These commands are executed after unmounting filesystems and removing IP +addresses, so they may be used to remove a jail filesystem if it is no longer +needed. .It Va exec.clean Run commands in a clean environment. The environment is discarded except for Modified: stable/12/usr.sbin/jail/jail.c ============================================================================== --- stable/12/usr.sbin/jail/jail.c Thu May 21 01:55:35 2020 (r361313) +++ stable/12/usr.sbin/jail/jail.c Thu May 21 02:04:10 2020 (r361314) @@ -87,6 +87,7 @@ static struct permspec perm_sysctl[] = { static const enum intparam startcommands[] = { IP__NULL, + IP_EXEC_PREPARE, #ifdef INET IP__IP4_IFADDR, #endif @@ -126,6 +127,7 @@ static const enum intparam stopcommands[] = { #ifdef INET IP__IP4_IFADDR, #endif + IP_EXEC_RELEASE, IP__NULL }; Modified: stable/12/usr.sbin/jail/jailp.h ============================================================================== --- stable/12/usr.sbin/jail/jailp.h Thu May 21 01:55:35 2020 (r361313) +++ stable/12/usr.sbin/jail/jailp.h Thu May 21 02:04:10 2020 (r361314) @@ -87,8 +87,10 @@ enum intparam { IP_EXEC_JAIL_USER, /* Run jailed commands as this user */ IP_EXEC_POSTSTART, /* Commands run outside jail after creating */ IP_EXEC_POSTSTOP, /* Commands run outside jail after removing */ + IP_EXEC_PREPARE, /* Commands run outside jail before addrs and mounting */ IP_EXEC_PRESTART, /* Commands run outside jail before creating */ IP_EXEC_PRESTOP, /* Commands run outside jail before removing */ + IP_EXEC_RELEASE, /* Commands run outside jail after addrs and unmounted */ IP_EXEC_CREATED, /* Commands run outside jail right after it was started */ IP_EXEC_START, /* Commands run inside jail on creation */ IP_EXEC_STOP, /* Commands run inside jail on removal */ From owner-svn-src-all@freebsd.org Thu May 21 02:08: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 AF9252FC88F; Thu, 21 May 2020 02:08:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SChg4B0Yz497v; Thu, 21 May 2020 02:08:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AB1D25F84; Thu, 21 May 2020 02:08:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L28ZK4068594; Thu, 21 May 2020 02:08:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L28Y5u068587; Thu, 21 May 2020 02:08:34 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005210208.04L28Y5u068587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 May 2020 02:08:34 +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: r361315 - in stable/12/sys: ddb dev/nvdimm dev/ow net sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12/sys: ddb dev/nvdimm dev/ow net sys X-SVN-Commit-Revision: 361315 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, 21 May 2020 02:08:35 -0000 Author: kevans Date: Thu May 21 02:08:34 2020 New Revision: 361315 URL: https://svnweb.freebsd.org/changeset/base/361315 Log: MFC r361011: kernel: provide panicky version of __unreachable __builtin_unreachable doesn't raise any compile-time warnings/errors on its own, so problems with its usage can't be easily detected. While it would be nice for this situation to change and compilers to at least add a warning for trivial cases where local state means the instruction can't be reached, this isn't the case at the moment and likely will not happen. This commit adds an __assert_unreachable, whose intent is incredibly clear: it asserts that this instruction is unreachable. On INVARIANTS builds, it's a panic(), and on non-INVARIANTS it expands to __unreachable(). Existing users of __unreachable() are converted to __assert_unreachable, to improve debuggability if this assumption is violated. Modified: stable/12/sys/ddb/db_expr.c stable/12/sys/dev/nvdimm/nvdimm.c stable/12/sys/dev/ow/ow.c stable/12/sys/net/mppcc.c stable/12/sys/sys/systm.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/ddb/db_expr.c ============================================================================== --- stable/12/sys/ddb/db_expr.c Thu May 21 02:04:10 2020 (r361314) +++ stable/12/sys/ddb/db_expr.c Thu May 21 02:08:34 2020 (r361315) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -229,7 +230,7 @@ db_add_expr(db_expr_t *valuep) lhs |= rhs; break; default: - __unreachable(); + __assert_unreachable(); } t = db_read_token(); } @@ -313,7 +314,7 @@ db_logical_relation_expr( lhs = (lhs <= rhs); break; default: - __unreachable(); + __assert_unreachable(); } t = db_read_token(); } Modified: stable/12/sys/dev/nvdimm/nvdimm.c ============================================================================== --- stable/12/sys/dev/nvdimm/nvdimm.c Thu May 21 02:04:10 2020 (r361314) +++ stable/12/sys/dev/nvdimm/nvdimm.c Thu May 21 02:08:34 2020 (r361315) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include +#include #include #include #include @@ -235,7 +236,7 @@ read_label(struct nvdimm_dev *nv, int num) return (0); } } - __unreachable(); + __assert_unreachable(); } static int Modified: stable/12/sys/dev/ow/ow.c ============================================================================== --- stable/12/sys/dev/ow/ow.c Thu May 21 02:04:10 2020 (r361314) +++ stable/12/sys/dev/ow/ow.c Thu May 21 02:08:34 2020 (r361315) @@ -505,7 +505,7 @@ again: return (EIO); goto again; default: /* NOTREACHED */ - __unreachable(); + __assert_unreachable(); } if (dir) { OWLL_WRITE_ONE(lldev, &timing_regular); Modified: stable/12/sys/net/mppcc.c ============================================================================== --- stable/12/sys/net/mppcc.c Thu May 21 02:04:10 2020 (r361314) +++ stable/12/sys/net/mppcc.c Thu May 21 02:08:34 2020 (r361315) @@ -232,7 +232,7 @@ int MPPC_Compress(u_char **src, u_char **dst, u_long * } else if (off < 8192) { /* 16-bit offset; 320 <= offset < 8192 */ putbits16(*dst, 0xc000|(off-320), 16, &olen, &l); } else { /* NOTREACHED */ - __unreachable(); + __assert_unreachable(); rtn &= ~MPPC_OK; return (rtn); } Modified: stable/12/sys/sys/systm.h ============================================================================== --- stable/12/sys/sys/systm.h Thu May 21 02:04:10 2020 (r361314) +++ stable/12/sys/sys/systm.h Thu May 21 02:08:34 2020 (r361315) @@ -108,12 +108,16 @@ void kassert_panic(const char *fmt, ...) __printflike kassert_panic msg; \ } \ } while (0) +#define __assert_unreachable() \ + panic("executing segment marked as unreachable at %s:%d (%s)\n", \ + __FILE__, __LINE__, __func__) #else #define KASSERT(exp,msg) do { \ } while (0) #define VNASSERT(exp, vp, msg) do { \ } while (0) +#define __assert_unreachable() __unreachable() #endif #ifndef CTASSERT /* Allow lint to override */ From owner-svn-src-all@freebsd.org Thu May 21 02:09: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 029F12FC98D; Thu, 21 May 2020 02:09:01 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yb1-f195.google.com (mail-yb1-f195.google.com [209.85.219.195]) (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 49SCj81fdZz49Mf; Thu, 21 May 2020 02:09:00 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yb1-f195.google.com with SMTP id a10so2030412ybc.3; Wed, 20 May 2020 19:09:00 -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=HbuLSBhTmaFxy9dk611V0yncOhkhC7ronYs6oQp1tiw=; b=AV+BG/5s7NHGxXyGipdP5j6V9Xd7xXZ0jAS42/oETlHnXw5i6XgEKLQO67RndgjFwI LqWNppWTjyM8exLNrgyqau7cykFUzLa75H+t6/LEiv4kFSkhV7WLyBLY35GzTiXMZb8b kJUxvehkBfGrGq6nEboKO1eSC4aHJLGX5UCenLFJEwRdedZgwm08gPd7Cmi/VA4y+FDO 4kAdBMQsfPpuksXVH7TDPD3Rpw+jvXY+aO7etFmrbofNuPGI43uWx6hxfj7Tp+y1BumQ Z1fPfg5CZM2LtO5yEOpfsBoSsoeRKm5aHuGB1mkPbGVsILe/ajmRL69CxNUfxUwqVPXV xWQg== X-Gm-Message-State: AOAM531KTEexZ0Ik/GLRao+l+9pg/g6SELGjfr/sc7S6BN4L17R8HPpS nd8DN0FYOmmMsaLZD3Ez8572KhxJteB/tcBDGbk= X-Google-Smtp-Source: ABdhPJzPua1XPWlIHytQwwvkFXjMY2Eq99OJkHeQ4VKC4VeFq6QXJF+Im8whCSqf5Y+3KStQOMb5CBTVwePoLsB501I= X-Received: by 2002:a25:cace:: with SMTP id a197mr11988249ybg.405.1590026939035; Wed, 20 May 2020 19:08:59 -0700 (PDT) MIME-Version: 1.0 References: <202005201103.04KB3xTp013965@repo.freebsd.org> <20200520151128.bglcjxphdf2vo6hk@mutt-hbsd> In-Reply-To: From: Li-Wen Hsu Date: Thu, 21 May 2020 10:08:47 +0800 Message-ID: Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys To: Wei Hu Cc: Shawn Webb , Wei Hu , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49SCj81fdZz49Mf X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of lwhsufreebsd@gmail.com designates 209.85.219.195 as permitted sender) smtp.mailfrom=lwhsufreebsd@gmail.com X-Spamd-Result: default: False [-1.11 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-0.23)[-0.227]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.01)[-0.012]; RCVD_IN_DNSWL_NONE(0.00)[209.85.219.195:from]; NEURAL_HAM_MEDIUM(-0.87)[-0.871]; FORGED_SENDER(0.30)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.219.195: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:+]; TAGGED_FROM(0.00)[]; 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: Thu, 21 May 2020 02:09:01 -0000 On Thu, May 21, 2020 at 9:50 AM Wei Hu wrote: > I was not familiar to the mechanism of __FreeBSD_version. But it looks > like a good idea. However I am not sure if I have the right to update the > chapter.xml file. Can you help on what I need to do the update this > version number? It's no problem (actually it's required) to update doc/head/en_US.ISO8859-1/books/porters-handbook/versions/chapter.xml after you bump __FreeBSD_version in src/sys/sys/param.h Best, Li-Wen From owner-svn-src-all@freebsd.org Thu May 21 02:10: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 5582E2FCA21; Thu, 21 May 2020 02:10:46 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SClB1dzgz49M5; Thu, 21 May 2020 02:10:46 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 339C925F16; Thu, 21 May 2020 02:10:46 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L2Ak0K068775; Thu, 21 May 2020 02:10:46 GMT (envelope-from csjp@FreeBSD.org) Received: (from csjp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L2AkSn068774; Thu, 21 May 2020 02:10:46 GMT (envelope-from csjp@FreeBSD.org) Message-Id: <202005210210.04L2AkSn068774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: csjp set sender to csjp@FreeBSD.org using -f From: "Christian S.J. Peron" Date: Thu, 21 May 2020 02:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361316 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: csjp X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 361316 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, 21 May 2020 02:10:46 -0000 Author: csjp Date: Thu May 21 02:10:45 2020 New Revision: 361316 URL: https://svnweb.freebsd.org/changeset/base/361316 Log: Decode the file descriptor argument to closefrom(2) as an Integer. This is consistent with what we are doing for close(2) and it makes it a bit easier to follow when debugging file descriptor operations. i.e. many other syscalls are decoding fds as integers rather than base 16 numbers. MFC after: 1 week Modified: head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Thu May 21 02:08:34 2020 (r361315) +++ head/usr.bin/truss/syscalls.c Thu May 21 02:10:45 2020 (r361316) @@ -157,6 +157,8 @@ static struct syscall decoded_syscalls[] = { .args = { { Int, 0 }, { Timespec | OUT, 1 } } }, { .name = "close", .ret_type = 1, .nargs = 1, .args = { { Int, 0 } } }, + { .name = "closefrom", .ret_type = 1, .nargs = 1, + .args = { { Int, 0 } } }, { .name = "compat11.fstat", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Stat11 | OUT, 1 } } }, { .name = "compat11.fstatat", .ret_type = 1, .nargs = 4, From owner-svn-src-all@freebsd.org Thu May 21 02: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 F17B92FDC3F for ; Thu, 21 May 2020 02:41:11 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from 44-233-67-66-mail.ore.mailhop.org (44-233-67-66-mail.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 49SDQH16lMz4CYN for ; Thu, 21 May 2020 02:41:10 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1590028869; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=lTH1KJJCtGnVFSKqjmchBMRGR57l7imJ2cr3o+rnj6yRg0O2YiStGL0gkzBbWbdSRBFHl+qBIogqb T4dNBkQZU0rMg00M5MPbqAglzRgJSTkxsUIvaT3YP0dDgoiANWeBOK9UvAu0qvDDWs/sflQ9Pvx0Yx s5Q9top+pGEz08tGk83pecQnf512U1U1ei54VNL3ADj90pfIY9YXlG1AcVSjPu1PHdXClswP7MdPHg iE9FExIb7e3E0SZz4fmnG2+3sioYOMk9Xlpj6S9GWmMCPpjRH5PNfOy8+gk682LVbyRSbu2ZtHdLem T1m4pRUnUicw74cJis9qzZkmbdY5gbg== 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=1wC2H0fjTO3DY0a+2GROUANMyTkiFDLBaaxbHlHRf44=; b=muZuUAublVDNfjBRgpeeO1nPRcZ783BuQS7lsNz5/KggdW+OauVvXy3EajKZO+agpRB7pwKMF23DM D1+73qRz/t6sRZfbDFteHPt55mjwSGky4zaAF6GrG0dm8XuLGLTZwG3On4BR6UkVDOt1hwoGhQwWiL lxM63AJq9gBKqs65526fMIlK0giivGsqKWjKnhVJzKITJKNEgLX7PLysaqaaU+SZhzn2egUoxkGfXg vPa4eACoDR11JmnWseo2ZVohp+dzFF9ABaa2o+FmwM3Q6CEjUnt4nox8PY+nlIH8fUcQK9xkcWikPu UCln4d8tvjXaiWo+bBVMBTdljcvms/A== 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=1wC2H0fjTO3DY0a+2GROUANMyTkiFDLBaaxbHlHRf44=; b=cqXuLDDQIDTUeTSEGgAoJgFf5oDyWY8v1PopdxiyiaRGxLrtubuCRLNPxior++CoHMQ2OJjfJvx/i IhnpBZuYqv7AmVlyIBQfuvI2YpKMFq97vs6yxUOFKRYfIbV2xxLiRS6QtAguUaFYavGC3DARHuItdl vXD3U11bFC+vHRCQqm7voCnnJZqbtpTTUreAduuM0gwyks2m6syU1WYxcUo0JtFXPVSzJ2Lzzlotv0 vqbl7Hyfy4lfBJE+CUIG7VsEcA+fKybOT7N9gSN+aKrWn7vr3WMvZiUPbHIP4XldzLmTZP+ShpG6o5 w7MB4unh+3e2hABBzsxQ8UpZLeV49nA== X-MHO-RoutePath: aGlwcGll X-MHO-User: 851979c5-9b0c-11ea-b10c-b5956a7dd1a1 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 851979c5-9b0c-11ea-b10c-b5956a7dd1a1; Thu, 21 May 2020 02:41:08 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 04L2f5K5012589; Wed, 20 May 2020 20:41:06 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <761b75a4ad0a4630bce26aad1b03137ac45509fd.camel@freebsd.org> Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys From: Ian Lepore To: Wei Hu , Enji Cooper , Shawn Webb Cc: Wei Hu , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Date: Wed, 20 May 2020 20:41:05 -0600 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 49SDQH16lMz4CYN 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: Thu, 21 May 2020 02:41:12 -0000 On Thu, 2020-05-21 at 01:53 +0000, Wei Hu wrote: > > -----Original Message----- > > From: Enji Cooper > > Sent: Wednesday, May 20, 2020 11:58 PM > > To: Shawn Webb > > Cc: Wei Hu ; src-committers@freebsd.org; svn-src- > > all@freebsd.org; svn-src-head@freebsd.org > > Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock > > dev/hyperv/include dev/hyperv/vmbus modules/hyperv > > modules/hyperv/hvsock sys > > > > > > > On May 20, 2020, at 08:54, Enji Cooper wrote: > > > > > > > > On May 20, 2020, at 08:11, Shawn Webb > > > > wrote: > > > > > > > > > > On Wed, May 20, 2020 at 11:03:59AM +0000, Wei Hu wrote: > > > > > Author: whu > > > > > Date: Wed May 20 11:03:59 2020 > > > > > New Revision: 361275 > > > > > URL: > > > > > https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsv > > > > > > > > > nweb.freebsd.org%2Fchangeset%2Fbase%2F361275&data=02%7C01%7C > > weh% > > > > > > > > > 40microsoft.com%7Cd6ff3617bffa43d10a7708d7fcd68470%7C72f988bf86f141 > > a > > > > > > > > > f91ab2d7cd011db47%7C1%7C0%7C637255870581110888&sdata=mzz6R > > ILCVBk > > > > > q06RI1PAfVNKWZO2y7jBO0C1E%2F%2FEJwUY%3D&reserved=0 > > > > > > > > > > Log: > > > > > HyperV socket implementation for FreeBSD > > > > > > > > > > This change adds Hyper-V socket feature in FreeBSD. New socket > > > > > address family AF_HYPERV and its kernel support are added. > > > > > > Hi Wei, > > > Could you please further describe what this feature is/does? > > > > I realize after looking at the review that it contains the content I was hoping > > for. It would have been helpful to folks if this context had been included in the > > commit message. > > Hi Enji, > > I thought I just keep it simple for the commit log message while people can > refer to the review site for details. Sorry about that. Let me know if there is > anyway to make up for it. > > Wei > Ten years from now, phabricator may just be a fading memory, but the source code repo lives forever. Usually when I put something in phab for review, the description I enter in phab is exactly the text I intend to use when committing the change. That helps the people doing the review... the description is an overview of what is being changed, and most importantly, why it is being changed (fixes a bug, adds a new feature, better performance, etc). Everything you say there to help reviewers will be equally helpful in the repo history when someone needs to research some day why a change got made. -- Ian From owner-svn-src-all@freebsd.org Thu May 21 03:33: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 1E4882FF2B4; Thu, 21 May 2020 03:33:22 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SFZT727xz4GXD; Thu, 21 May 2020 03:33:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC03626C78; Thu, 21 May 2020 03:33:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L3XLrp023938; Thu, 21 May 2020 03:33:21 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L3XKSK023931; Thu, 21 May 2020 03:33:20 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202005210333.04L3XKSK023931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 21 May 2020 03:33:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361317 - in head/sys/powerpc: aim include powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: aim include powerpc X-SVN-Commit-Revision: 361317 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, 21 May 2020 03:33:22 -0000 Author: jhibbits Date: Thu May 21 03:33:20 2020 New Revision: 361317 URL: https://svnweb.freebsd.org/changeset/base/361317 Log: powerpc: Handle machine checks caused by D-ERAT multihit Instead of crashing the user process when a D-ERAT multihit is detected, try to flush the ERAT, and continue. This machine check indicates a likely PMAP invalidation shortcoming that will need to be addressed, but it's recoverable, so just recover. The recovery is pmap-specific to flush the ERAT, so add a pmap function to do so, currently only implemented by the POWER9 radix pmap. Modified: head/sys/powerpc/aim/aim_machdep.c head/sys/powerpc/aim/mmu_radix.c head/sys/powerpc/include/pmap.h head/sys/powerpc/powerpc/mmu_if.m head/sys/powerpc/powerpc/pmap_dispatch.c Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Thu May 21 02:10:45 2020 (r361316) +++ head/sys/powerpc/aim/aim_machdep.c Thu May 21 03:33:20 2020 (r361317) @@ -539,6 +539,10 @@ cpu_machine_check(struct thread *td, struct trapframe /* SLB multi-hit is recoverable. */ if ((frame->cpu.aim.dsisr & DSISR_MC_SLB_MULTIHIT) != 0) return (0); + if ((frame->cpu.aim.dsisr & DSISR_MC_DERAT_MULTIHIT) != 0) { + pmap_tlbie_all(); + return (0); + } /* TODO: Add other machine check recovery procedures. */ } else { if ((frame->srr1 & SRR1_MCHK_IFETCH_M) == SRR1_MCHK_IFETCH_SLBMH) Modified: head/sys/powerpc/aim/mmu_radix.c ============================================================================== --- head/sys/powerpc/aim/mmu_radix.c Thu May 21 02:10:45 2020 (r361316) +++ head/sys/powerpc/aim/mmu_radix.c Thu May 21 03:33:20 2020 (r361317) @@ -482,6 +482,7 @@ static void mmu_radix_dumpsys_map(mmu_t mmu, vm_paddr_ void **va); static void mmu_radix_scan_init(mmu_t mmu); static void mmu_radix_cpu_bootstrap(mmu_t, int ap); +static void mmu_radix_tlbie_all(mmu_t); static mmu_method_t mmu_radix_methods[] = { MMUMETHOD(mmu_bootstrap, mmu_radix_bootstrap), @@ -543,6 +544,8 @@ static mmu_method_t mmu_radix_methods[] = { MMUMETHOD(mmu_change_attr, mmu_radix_change_attr), MMUMETHOD(mmu_map_user_ptr, mmu_radix_map_user_ptr), MMUMETHOD(mmu_decode_kernel_ptr, mmu_radix_decode_kernel_ptr), + + MMUMETHOD(mmu_tlbie_all, mmu_radix_tlbie_all), { 0, 0 } }; @@ -772,6 +775,13 @@ mmu_radix_tlbiel_flush(int scope) tlbiel_flush_isa3(POWER9_TLB_SETS_RADIX, is); __asm __volatile(PPC_INVALIDATE_ERAT "; isync" : : :"memory"); +} + +static void +mmu_radix_tlbie_all(mmu_t __unused mmu) +{ + /* TODO: LPID invalidate */ + mmu_radix_tlbiel_flush(TLB_INVAL_SCOPE_GLOBAL); } static void Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Thu May 21 02:10:45 2020 (r361316) +++ head/sys/powerpc/include/pmap.h Thu May 21 03:33:20 2020 (r361317) @@ -341,6 +341,7 @@ vm_offset_t pmap_early_io_map(vm_paddr_t pa, vm_size_t void pmap_early_io_unmap(vm_offset_t va, vm_size_t size); void pmap_track_page(pmap_t pmap, vm_offset_t va); void pmap_page_print_mappings(vm_page_t m); +void pmap_tlbie_all(void); static inline int pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) Modified: head/sys/powerpc/powerpc/mmu_if.m ============================================================================== --- head/sys/powerpc/powerpc/mmu_if.m Thu May 21 02:10:45 2020 (r361316) +++ head/sys/powerpc/powerpc/mmu_if.m Thu May 21 03:33:20 2020 (r361317) @@ -1100,3 +1100,11 @@ METHOD boolean_t ps_enabled { mmu_t _mmu; pmap_t _pmap; } DEFAULT mmu_null_ps_enabled; + + +/** + * @brief Flush the TLB (used by machine check handler). + */ +METHOD void tlbie_all { + mmu_t _mmu; +}; Modified: head/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- head/sys/powerpc/powerpc/pmap_dispatch.c Thu May 21 02:10:45 2020 (r361316) +++ head/sys/powerpc/powerpc/pmap_dispatch.c Thu May 21 03:33:20 2020 (r361317) @@ -631,6 +631,13 @@ pmap_ps_enabled(pmap_t pmap) return (MMU_PS_ENABLED(mmu_obj, pmap)); } +void +pmap_tlbie_all(void) +{ + CTR1(KTR_PMAP, "%s()", __func__); + return (MMU_TLBIE_ALL(mmu_obj)); +} + /* * MMU install routines. Highest priority wins, equal priority also * overrides allowing last-set to win. From owner-svn-src-all@freebsd.org Thu May 21 03:50: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 14E0F2FF8A7; Thu, 21 May 2020 03:50:57 +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 49SFym6sbPz4H17; Thu, 21 May 2020 03:50:56 +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 E6DC9270B1; Thu, 21 May 2020 03:50:56 +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 04L3ouJX031526; Thu, 21 May 2020 03:50:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L3ouOR031524; Thu, 21 May 2020 03:50:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005210350.04L3ouOR031524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 May 2020 03:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361318 - head/bin/ls X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/bin/ls X-SVN-Commit-Revision: 361318 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, 21 May 2020 03:50:57 -0000 Author: kevans Date: Thu May 21 03:50:56 2020 New Revision: 361318 URL: https://svnweb.freebsd.org/changeset/base/361318 Log: ls: fix a --color regression from r337956 The regression is in-fact that I flipped the default from never to auto. The incorrect impression was based on an alias that I failed to notice, installed by the Linux distribution that I used for testing compatibility here. Users that want the old default should be doing so with a shell alias as is done elsewhere, rather than making this decision in ls(1). Many thanks to rgrimes for pointing out the alias that I clearly overlooked that resulted in this; if you despised colors in your terminal from this, consider buying him a beer at the next venue that you see him at. MFC after: 1 week Relnotes: yes Modified: head/bin/ls/ls.1 head/bin/ls/ls.c Modified: head/bin/ls/ls.1 ============================================================================== --- head/bin/ls/ls.1 Thu May 21 03:33:20 2020 (r361317) +++ head/bin/ls/ls.1 Thu May 21 03:50:56 2020 (r361318) @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd August 18, 2018 +.Dd May 20, 2020 .Dt LS 1 .Os .Sh NAME @@ -216,8 +216,8 @@ Output colored escape sequences based on .Ar when , which may be set to either .Cm always , -.Cm auto -(default), or +.Cm auto , +or .Cm never . .Pp .Cm always @@ -252,6 +252,12 @@ environment variable is set and not empty. .Pp .Cm never will disable color regardless of environment variables. +.Cm never +is the default when neither +.Fl -color +nor +.Fl G +is specified. .Pp For compatibility with GNU coreutils, .Nm Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Thu May 21 03:33:20 2020 (r361317) +++ head/bin/ls/ls.c Thu May 21 03:50:56 2020 (r361318) @@ -152,7 +152,7 @@ static int f_timesort; /* sort by time vice name */ int f_type; /* add type character for non-regular files */ static int f_whiteout; /* show whiteout entries */ #ifdef COLORLS - int colorflag = COLORFLAG_AUTO; /* passed in colorflag */ + int colorflag = COLORFLAG_NEVER; /* passed in colorflag */ int f_color; /* add type in color for non-regular files */ bool explicitansi; /* Explicit ANSI sequences, no termcap(5) */ char *ansi_bgcol; /* ANSI sequence to set background colour */ From owner-svn-src-all@freebsd.org Thu May 21 03:53: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 64EF22FFB21; Thu, 21 May 2020 03:53:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SG2220YTz4HY2; Thu, 21 May 2020 03:53:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F4812713A; Thu, 21 May 2020 03:53:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L3rk7L036381; Thu, 21 May 2020 03:53:46 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L3rkE7036380; Thu, 21 May 2020 03:53:46 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005210353.04L3rkE7036380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 21 May 2020 03:53:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361319 - head/sys/dev/ath/ath_rate/sample X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/ath/ath_rate/sample X-SVN-Commit-Revision: 361319 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, 21 May 2020 03:53:46 -0000 Author: adrian Date: Thu May 21 03:53:45 2020 New Revision: 361319 URL: https://svnweb.freebsd.org/changeset/base/361319 Log: [ath_rate_sample] Obey the maximum frame length even when using static rates. I wasn't enforcing the maximum packet length when using static rates so although the driver was enforcing it itself OK, the statistics were sometimes going into the wrong bin. Tested: * AR9380, STA mode Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Thu May 21 03:50:56 2020 (r361318) +++ head/sys/dev/ath/ath_rate/sample/sample.c Thu May 21 03:53:45 2020 (r361319) @@ -165,6 +165,11 @@ static int ath_rate_sample_max_4ms_framelen[4][32] = { * MCS rate in the transmit schedule. * * Returns -1 if it's a legacy rate or no MRR. + * + * XXX TODO: this needs to be limited by the RTS/CTS AR5416 8KB bug limit! + * (by checking rts/cts flags and applying sc_rts_aggr_limit) + * + * XXX TODO: apply per-node max-ampdu size and driver ampdu size limits too. */ static int ath_rate_sample_find_min_pktlength(struct ath_softc *sc, @@ -693,6 +698,17 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod if (sn->static_rix != -1) { rix = sn->static_rix; *try0 = ATH_TXMAXTRY; + + /* + * Ensure we limit max packet length here too! + */ + max_pkt_len = ath_rate_sample_find_min_pktlength(sc, an, + sn->static_rix, + is_aggr); + if (max_pkt_len > 0) { + *maxpktlen = frameLen = MIN(frameLen, max_pkt_len); + size_bin = size_to_bin(frameLen); + } goto done; } From owner-svn-src-all@freebsd.org Thu May 21 04:26: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 5A8813287AC; Thu, 21 May 2020 04:26:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SGld1pFQz4K9D; Thu, 21 May 2020 04:26:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 390B627361; Thu, 21 May 2020 04:26:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L4QLMp055188; Thu, 21 May 2020 04:26:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L4QLhU055187; Thu, 21 May 2020 04:26:21 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005210426.04L4QLhU055187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 21 May 2020 04:26:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361320 - head/sys/dev/ath X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/ath X-SVN-Commit-Revision: 361320 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, 21 May 2020 04:26:21 -0000 Author: adrian Date: Thu May 21 04:26:20 2020 New Revision: 361320 URL: https://svnweb.freebsd.org/changeset/base/361320 Log: [ath] reset hardware if this particular mac bug is seen. I have to dig into why I'm seeing it on chips as late as the AR9380 era stuff (as it's marked as an AR5416 bug, but who knows!) but i'm seeing aggregate TX frames complete with no blockack bit set. So, everything should be treated as a failure and do a hardware reset for good measure. Tested: * AR9380, STA mode * AR9580 (5GHz), AP mode Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Thu May 21 03:53:45 2020 (r361319) +++ head/sys/dev/ath/if_ath_tx.c Thu May 21 04:26:20 2020 (r361320) @@ -5011,7 +5011,11 @@ ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath "%s: AR5416 bug: hasba=%d; txok=%d, isaggr=%d, " "seq_st=%d\n", __func__, hasba, tx_ok, isaggr, seq_st); - /* XXX TODO: schedule an interface reset */ + taskqueue_enqueue(sc->sc_tq, &sc->sc_fataltask); + /* And as we can't really trust the BA here .. */ + ba[0] = 0; + ba[1] = 0; + seq_st = 0; #ifdef ATH_DEBUG ath_printtxbuf(sc, bf_first, sc->sc_ac2q[atid->ac]->axq_qnum, 0, 0); From owner-svn-src-all@freebsd.org Thu May 21 04:35: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 08900328B99; Thu, 21 May 2020 04:35:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SGxr6DbHz4KQv; Thu, 21 May 2020 04:35:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D08E027859; Thu, 21 May 2020 04:35:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L4ZCHZ061230; Thu, 21 May 2020 04:35:12 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L4ZCvc061228; Thu, 21 May 2020 04:35:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005210435.04L4ZCvc061228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 21 May 2020 04:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361321 - head/sys/dev/ath X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/ath X-SVN-Commit-Revision: 361321 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, 21 May 2020 04:35:13 -0000 Author: adrian Date: Thu May 21 04:35:12 2020 New Revision: 361321 URL: https://svnweb.freebsd.org/changeset/base/361321 Log: [ath] Hopefully recover better-er upon RX restart on AR9380. This is all very long-standing bug stuff that is touchy and still poorly documented. Ok, here goes. The basic bug: * deleting a VAP causes the RX path (and TX path too) to be restarted without a full chip reset, which causes RX hangs on the AR9380 and later. (ie, the ones with the newer DMA engine.) The basic fix: * do an RX flush when stopping RX in ath_vap_delete() to match what happens when RX is stopped elsewhere. This ensures any pending frames are completed and we restart at the right spot; it also ensures we don't push new RX buffers into the hardware if we're stopping receive. The other issues I found: * Don't bother checking the RX packet ring in the deferred read taskqueue; that's specifically supposed to be for completing frames rather than just yanking them off the receive ring. * Cancel/drain any pending deferred read taskqueue. This isn't done inside any locks so we should be super careful here. This stops the hardware being reprogrammed at the same time in another thread/CPU whilst we're stopping RX. * .. (yes, this should be better serialised, but that's for another day. maybe.) * Add more debugging to trace what's going on here. And the fun bit: * Reinitialise the RX FIFO ONLY if we've been reset or stopped, rather than just reset. I noticed that after all the above was done I was STILL seeing RXEOL. RXEOL isn't enabled on the AR9380 so I'd only see it if I was sending TX frames (ie a ping where it'd be transmitted but never received) so I was not being spammed by RXEOL. So, as long as stuff is stopped, restart it. This seems to be doing the right thing in both AP and STA modes. What I should do next, if I ever get time: * as I said above, serialise the receive stop/start to include taskqueues * monitor RXEOL on the AR9380 and I keep seeing it spammed / lockups, just go do a full chip reset to get things back on track. It sucks, but it is better than nothing. Tested: * AR9380 AP/STA mode, adding/deleting a hostap VAP to trigger the TX/RX queue stop/start; whilst also running an iperf through it. Lots of times. Lots. Of.. Times. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_rx_edma.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu May 21 04:26:20 2020 (r361320) +++ head/sys/dev/ath/if_ath.c Thu May 21 04:35:12 2020 (r361321) @@ -1801,6 +1801,7 @@ ath_vap_delete(struct ieee80211vap *vap) ath_hal_intrset(ah, 0); /* disable interrupts */ /* XXX Do all frames from all vaps/nodes need draining here? */ ath_stoprecv(sc, 1); /* stop recv side */ + ath_rx_flush(sc); ath_draintxq(sc, ATH_RESET_DEFAULT); /* stop hw xmit side */ } Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Thu May 21 04:26:20 2020 (r361320) +++ head/sys/dev/ath/if_ath_rx_edma.c Thu May 21 04:35:12 2020 (r361321) @@ -162,6 +162,9 @@ ath_edma_stoprecv(struct ath_softc *sc, int dodelay) { struct ath_hal *ah = sc->sc_ah; + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: called, dodelay=%d\n", + __func__, dodelay); + ATH_RX_LOCK(sc); ath_hal_stoppcurecv(ah); @@ -191,6 +194,8 @@ ath_edma_stoprecv(struct ath_softc *sc, int dodelay) sc->sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending = NULL; } ATH_RX_UNLOCK(sc); + + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: done\n", __func__); } /* @@ -205,6 +210,8 @@ ath_edma_reinit_fifo(struct ath_softc *sc, HAL_RX_QUEU struct ath_buf *bf; int i, j; + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: called\n", __func__); + ATH_RX_LOCK_ASSERT(sc); i = re->m_fifo_head; @@ -227,6 +234,7 @@ ath_edma_reinit_fifo(struct ath_softc *sc, HAL_RX_QUEU i, re->m_fifo_tail); } + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: done\n", __func__); } /* @@ -237,6 +245,10 @@ ath_edma_startrecv(struct ath_softc *sc) { struct ath_hal *ah = sc->sc_ah; + DPRINTF(sc, ATH_DEBUG_EDMA_RX, + "%s: called; resetted=%d, stopped=%d\n", __func__, + sc->sc_rx_resetted, sc->sc_rx_stopped); + ATH_RX_LOCK(sc); /* @@ -252,7 +264,7 @@ ath_edma_startrecv(struct ath_softc *sc) /* * In theory the hardware has been initialised, right? */ - if (sc->sc_rx_resetted == 1) { + if (sc->sc_rx_resetted == 1 || sc->sc_rx_stopped == 1) { DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: Re-initing HP FIFO\n", __func__); ath_edma_reinit_fifo(sc, HAL_RX_QUEUE_HP); @@ -262,8 +274,11 @@ ath_edma_startrecv(struct ath_softc *sc) sc->sc_rx_resetted = 0; } else { device_printf(sc->sc_dev, - "%s: called without resetting chip?\n", - __func__); + "%s: called without resetting chip? " + "resetted=%d, stopped=%d\n", + __func__, + sc->sc_rx_resetted, + sc->sc_rx_stopped); } /* Add up to m_fifolen entries in each queue */ @@ -290,6 +305,7 @@ ath_edma_startrecv(struct ath_softc *sc) sc->sc_rx_stopped = 0; ATH_RX_UNLOCK(sc); + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: ready\n", __func__); return (0); } @@ -298,6 +314,8 @@ static void ath_edma_recv_sched_queue(struct ath_softc *sc, HAL_RX_QUEUE qtype, int dosched) { + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: called; qtype=%d, dosched=%d\n", + __func__, qtype, dosched); ATH_LOCK(sc); ath_power_set_power_state(sc, HAL_PM_AWAKE); @@ -309,13 +327,19 @@ ath_edma_recv_sched_queue(struct ath_softc *sc, HAL_RX ath_power_restore_power_state(sc); ATH_UNLOCK(sc); + /* XXX TODO: methodize */ taskqueue_enqueue(sc->sc_tq, &sc->sc_rxtask); + + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: done\n", __func__); } static void ath_edma_recv_sched(struct ath_softc *sc, int dosched) { + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: called; dosched=%d\n", + __func__, dosched); + ATH_LOCK(sc); ath_power_set_power_state(sc, HAL_PM_AWAKE); ATH_UNLOCK(sc); @@ -327,19 +351,27 @@ ath_edma_recv_sched(struct ath_softc *sc, int dosched) ath_power_restore_power_state(sc); ATH_UNLOCK(sc); + /* XXX TODO: methodize */ taskqueue_enqueue(sc->sc_tq, &sc->sc_rxtask); + + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: done\n", __func__); } static void ath_edma_recv_flush(struct ath_softc *sc) { - DPRINTF(sc, ATH_DEBUG_RECV, "%s: called\n", __func__); + DPRINTF(sc, ATH_DEBUG_RECV | ATH_DEBUG_EDMA_RX, "%s: called\n", __func__); ATH_PCU_LOCK(sc); sc->sc_rxproc_cnt++; ATH_PCU_UNLOCK(sc); + // XXX TODO: methodize; make it an RX stop/block + while (taskqueue_cancel(sc->sc_tq, &sc->sc_rxtask, NULL) != 0) { + taskqueue_drain(sc->sc_tq, &sc->sc_rxtask); + } + ATH_LOCK(sc); ath_power_set_power_state(sc, HAL_PM_AWAKE); ATH_UNLOCK(sc); @@ -368,6 +400,8 @@ ath_edma_recv_flush(struct ath_softc *sc) ATH_PCU_LOCK(sc); sc->sc_rxproc_cnt--; ATH_PCU_UNLOCK(sc); + + DPRINTF(sc, ATH_DEBUG_RECV | ATH_DEBUG_EDMA_RX, "%s: done\n", __func__); } /* @@ -391,6 +425,8 @@ ath_edma_recv_proc_queue(struct ath_softc *sc, HAL_RX_ nf = ath_hal_getchannoise(ah, sc->sc_curchan); sc->sc_stats.ast_rx_noise = nf; + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: called; qtype=%d, dosched=%d\n", __func__, qtype, dosched); + ATH_RX_LOCK(sc); #if 1 @@ -608,9 +644,6 @@ ath_edma_recv_tasklet(void *arg, int npending) ath_power_set_power_state(sc, HAL_PM_AWAKE); ATH_UNLOCK(sc); - ath_edma_recv_proc_queue(sc, HAL_RX_QUEUE_HP, 1); - ath_edma_recv_proc_queue(sc, HAL_RX_QUEUE_LP, 1); - ath_edma_recv_proc_deferred_queue(sc, HAL_RX_QUEUE_HP, 1); ath_edma_recv_proc_deferred_queue(sc, HAL_RX_QUEUE_LP, 1); @@ -632,6 +665,8 @@ ath_edma_recv_tasklet(void *arg, int npending) ATH_PCU_LOCK(sc); sc->sc_rxproc_cnt--; ATH_PCU_UNLOCK(sc); + + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: called; done!\n", __func__); } /* From owner-svn-src-all@freebsd.org Thu May 21 05:01: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 5C688329424; Thu, 21 May 2020 05:01:53 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SHXd1FHRz4Nbj; Thu, 21 May 2020 05:01:53 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A93C82DC; Thu, 21 May 2020 05:01:53 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L51rFM082165; Thu, 21 May 2020 05:01:53 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L51qas082161; Thu, 21 May 2020 05:01:52 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202005210501.04L51qas082161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 21 May 2020 05:01:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r361322 - in vendor/unbound/dist: . .github cachedb compat contrib daemon doc edns-subnet iterator libunbound respip services services/cache sldns smallapp testcode testdata testdata/dn... X-SVN-Group: vendor X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in vendor/unbound/dist: . .github cachedb compat contrib daemon doc edns-subnet iterator libunbound respip services services/cache sldns smallapp testcode testdata testdata/dnscrypt_queries.tdir testd... X-SVN-Commit-Revision: 361322 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, 21 May 2020 05:01:53 -0000 Author: cy Date: Thu May 21 05:01:52 2020 New Revision: 361322 URL: https://svnweb.freebsd.org/changeset/base/361322 Log: Vendor import of Unbound 1.10.1. Security: CVE-2020-12662, CVE-2020-12663 Added: vendor/unbound/dist/.github/ vendor/unbound/dist/.github/FUNDING.yml vendor/unbound/dist/contrib/drop2rpz vendor/unbound/dist/contrib/unbound_portable.service.in (contents, props changed) vendor/unbound/dist/contrib/unbound_smf23.tar.gz (contents, props changed) vendor/unbound/dist/services/rpz.c (contents, props changed) vendor/unbound/dist/services/rpz.h (contents, props changed) vendor/unbound/dist/testdata/rpz_axfr.rpl vendor/unbound/dist/testdata/rpz_ixfr.rpl vendor/unbound/dist/testdata/rpz_qname.rpl vendor/unbound/dist/testdata/rpz_qname_override.rpl vendor/unbound/dist/testdata/rpz_respip.rpl vendor/unbound/dist/testdata/rpz_respip_override.rpl vendor/unbound/dist/testdata/serve_expired.rpl vendor/unbound/dist/testdata/serve_expired_client_timeout.rpl vendor/unbound/dist/testdata/serve_expired_reply_ttl.rpl vendor/unbound/dist/testdata/serve_expired_servfail.rpl vendor/unbound/dist/testdata/serve_expired_ttl.rpl vendor/unbound/dist/testdata/serve_expired_ttl_client_timeout.rpl vendor/unbound/dist/testdata/serve_expired_zerottl.rpl Deleted: vendor/unbound/dist/contrib/unbound_smf22.tar.gz vendor/unbound/dist/testdata/dnscrypt_queries.tdir/1.cert vendor/unbound/dist/testdata/dnscrypt_queries.tdir/1.key vendor/unbound/dist/testdata/dnscrypt_queries.tdir/1_chacha.cert vendor/unbound/dist/testdata/dnscrypt_queries.tdir/1_salsa.cert vendor/unbound/dist/testdata/dnscrypt_queries.tdir/2.cert vendor/unbound/dist/testdata/dnscrypt_queries.tdir/2.key vendor/unbound/dist/testdata/dnscrypt_queries.tdir/2_chacha.cert vendor/unbound/dist/testdata/dnscrypt_queries.tdir/2_salsa.cert vendor/unbound/dist/testdata/dnscrypt_queries.tdir/dnscrypt_queries.conf vendor/unbound/dist/testdata/dnscrypt_queries.tdir/dnscrypt_queries.dsc vendor/unbound/dist/testdata/dnscrypt_queries.tdir/dnscrypt_queries.post vendor/unbound/dist/testdata/dnscrypt_queries.tdir/dnscrypt_queries.pre vendor/unbound/dist/testdata/dnscrypt_queries.tdir/dnscrypt_queries.test vendor/unbound/dist/testdata/dnscrypt_queries.tdir/dnscrypt_queries.testns vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/1.key vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/1_chacha.cert vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/1_salsa.cert vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/2.key vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/2_chacha.cert vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/2_salsa.cert vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/dnscrypt_queries_chacha.conf vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/dnscrypt_queries_chacha.dsc vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/dnscrypt_queries_chacha.post vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/dnscrypt_queries_chacha.pre vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/dnscrypt_queries_chacha.test vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/dnscrypt_queries_chacha.testns vendor/unbound/dist/testdata/dnscrypt_queries_chacha.tdir/precheck.sh Modified: vendor/unbound/dist/.gitignore vendor/unbound/dist/Makefile.in vendor/unbound/dist/README.md vendor/unbound/dist/aclocal.m4 vendor/unbound/dist/cachedb/cachedb.c vendor/unbound/dist/compat/getentropy_solaris.c vendor/unbound/dist/config.guess vendor/unbound/dist/config.h.in vendor/unbound/dist/config.sub vendor/unbound/dist/configure vendor/unbound/dist/configure.ac vendor/unbound/dist/contrib/README vendor/unbound/dist/contrib/fastrpz.patch vendor/unbound/dist/contrib/libunbound.pc.in vendor/unbound/dist/contrib/unbound.service.in vendor/unbound/dist/contrib/unbound_munin_ vendor/unbound/dist/daemon/daemon.c vendor/unbound/dist/daemon/daemon.h vendor/unbound/dist/daemon/remote.c vendor/unbound/dist/daemon/stats.c vendor/unbound/dist/daemon/unbound.c vendor/unbound/dist/daemon/worker.c vendor/unbound/dist/doc/Changelog vendor/unbound/dist/doc/README vendor/unbound/dist/doc/example.conf.in vendor/unbound/dist/doc/libunbound.3.in vendor/unbound/dist/doc/unbound-anchor.8.in vendor/unbound/dist/doc/unbound-checkconf.8.in vendor/unbound/dist/doc/unbound-control.8.in vendor/unbound/dist/doc/unbound-host.1.in vendor/unbound/dist/doc/unbound.8.in vendor/unbound/dist/doc/unbound.conf.5.in vendor/unbound/dist/edns-subnet/subnetmod.c vendor/unbound/dist/install-sh vendor/unbound/dist/iterator/iter_delegpt.c vendor/unbound/dist/iterator/iter_delegpt.h vendor/unbound/dist/iterator/iter_scrub.c vendor/unbound/dist/iterator/iter_utils.c vendor/unbound/dist/iterator/iterator.c vendor/unbound/dist/iterator/iterator.h vendor/unbound/dist/libunbound/context.c vendor/unbound/dist/libunbound/libworker.c vendor/unbound/dist/libunbound/unbound.h vendor/unbound/dist/respip/respip.c vendor/unbound/dist/respip/respip.h vendor/unbound/dist/services/authzone.c vendor/unbound/dist/services/authzone.h vendor/unbound/dist/services/cache/dns.c vendor/unbound/dist/services/cache/dns.h vendor/unbound/dist/services/localzone.c vendor/unbound/dist/services/localzone.h vendor/unbound/dist/services/mesh.c vendor/unbound/dist/services/mesh.h vendor/unbound/dist/services/outside_network.c vendor/unbound/dist/services/view.c vendor/unbound/dist/sldns/parse.c vendor/unbound/dist/sldns/str2wire.c vendor/unbound/dist/smallapp/unbound-checkconf.c vendor/unbound/dist/smallapp/unbound-control.c vendor/unbound/dist/testcode/petal.c vendor/unbound/dist/testcode/replay.h vendor/unbound/dist/testcode/unitdname.c vendor/unbound/dist/testdata/auth_zonefile_dnssec_fail.rpl vendor/unbound/dist/testdata/remote-threaded.tdir/remote-threaded.test vendor/unbound/dist/testdata/subnet_cached.crpl vendor/unbound/dist/testdata/subnet_val_positive.crpl vendor/unbound/dist/testdata/subnet_val_positive_client.crpl vendor/unbound/dist/testdata/tcp_req_size.tdir/tcp_req_size.test vendor/unbound/dist/util/config_file.c vendor/unbound/dist/util/config_file.h vendor/unbound/dist/util/configlexer.c vendor/unbound/dist/util/configlexer.lex vendor/unbound/dist/util/configparser.c vendor/unbound/dist/util/configparser.h vendor/unbound/dist/util/configparser.y vendor/unbound/dist/util/data/dname.c vendor/unbound/dist/util/data/dname.h vendor/unbound/dist/util/data/msgencode.c vendor/unbound/dist/util/data/msgparse.c vendor/unbound/dist/util/data/msgparse.h vendor/unbound/dist/util/data/msgreply.c vendor/unbound/dist/util/data/packed_rrset.c vendor/unbound/dist/util/data/packed_rrset.h vendor/unbound/dist/util/fptr_wlist.c vendor/unbound/dist/util/fptr_wlist.h vendor/unbound/dist/util/iana_ports.inc vendor/unbound/dist/util/log.c vendor/unbound/dist/util/log.h vendor/unbound/dist/util/module.h vendor/unbound/dist/util/net_help.c vendor/unbound/dist/util/net_help.h vendor/unbound/dist/util/netevent.c vendor/unbound/dist/util/random.c vendor/unbound/dist/util/storage/dnstree.c vendor/unbound/dist/util/storage/dnstree.h vendor/unbound/dist/validator/val_secalgo.c vendor/unbound/dist/validator/validator.c Added: vendor/unbound/dist/.github/FUNDING.yml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/unbound/dist/.github/FUNDING.yml Thu May 21 05:01:52 2020 (r361322) @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: ['https://nlnetlabs.nl/funding/'] Modified: vendor/unbound/dist/.gitignore ============================================================================== --- vendor/unbound/dist/.gitignore Thu May 21 04:35:12 2020 (r361321) +++ vendor/unbound/dist/.gitignore Thu May 21 05:01:52 2020 (r361322) @@ -42,6 +42,7 @@ /contrib/libunbound.pc /contrib/unbound.service /contrib/unbound.socket +/contrib/unbound_portable.service /dnstap/dnstap.pb-c.c /dnstap/dnstap.pb-c.h /libunbound/python/libunbound_wrap.c Modified: vendor/unbound/dist/Makefile.in ============================================================================== --- vendor/unbound/dist/Makefile.in Thu May 21 04:35:12 2020 (r361321) +++ vendor/unbound/dist/Makefile.in Thu May 21 05:01:52 2020 (r361322) @@ -110,6 +110,7 @@ iterator/iter_delegpt.c iterator/iter_donotq.c iterato iterator/iter_hints.c iterator/iter_priv.c iterator/iter_resptype.c \ iterator/iter_scrub.c iterator/iter_utils.c services/listen_dnsport.c \ services/localzone.c services/mesh.c services/modstack.c services/view.c \ +services/rpz.c \ services/outbound_list.c services/outside_network.c util/alloc.c \ util/config_file.c util/configlexer.c util/configparser.c \ util/shm_side/shm_main.c services/authzone.c \ @@ -135,7 +136,7 @@ outbound_list.lo alloc.lo config_file.lo configlexer.l fptr_wlist.lo edns.lo locks.lo log.lo mini_event.lo module.lo net_help.lo \ random.lo rbtree.lo regional.lo rtt.lo dnstree.lo lookup3.lo lruhash.lo \ slabhash.lo tcp_conn_limit.lo timehist.lo tube.lo winsock_event.lo \ -autotrust.lo val_anchor.lo \ +autotrust.lo val_anchor.lo rpz.lo \ validator.lo val_kcache.lo val_kentry.lo val_neg.lo val_nsec3.lo val_nsec.lo \ val_secalgo.lo val_sigcrypt.lo val_utils.lo dns64.lo cachedb.lo redis.lo authzone.lo \ $(SUBNET_OBJ) $(PYTHONMOD_OBJ) $(CHECKLOCK_OBJ) $(DNSTAP_OBJ) $(DNSCRYPT_OBJ) \ @@ -642,6 +643,9 @@ depend: fi rm -f $(DEPEND_TMP) $(DEPEND_TMP2) +# build rules +ipset.lo ipset.o: $(srcdir)/ipset/ipset.c + # Dependencies dns.lo dns.o: $(srcdir)/services/cache/dns.c config.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/util/log.h \ $(srcdir)/iterator/iter_utils.h $(srcdir)/iterator/iter_resptype.h $(srcdir)/validator/val_nsec.h \ @@ -654,9 +658,9 @@ infra.lo infra.o: $(srcdir)/services/cache/infra.c con $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/data/msgreply.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lookup3.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h $(srcdir)/iterator/iterator.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/data/dname.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h $(srcdir)/iterator/iterator.h \ $(srcdir)/services/outbound_list.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h rrset.lo rrset.o: $(srcdir)/services/cache/rrset.c config.h $(srcdir)/services/cache/rrset.h \ @@ -681,11 +685,14 @@ msgparse.lo msgparse.o: $(srcdir)/util/data/msgparse.c msgreply.lo msgreply.o: $(srcdir)/util/data/msgreply.c config.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/storage/lookup3.h $(srcdir)/util/alloc.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/regional.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgencode.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h \ - $(srcdir)/util/module.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ - $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h + $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h \ + $(srcdir)/util/regional.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/util/data/msgencode.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/module.h \ + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ + $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/respip/respip.h packed_rrset.lo packed_rrset.o: $(srcdir)/util/data/packed_rrset.c config.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/alloc.h $(srcdir)/util/regional.h \ @@ -699,11 +706,12 @@ iterator.lo iterator.o: $(srcdir)/iterator/iterator.c $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_scrub.h $(srcdir)/iterator/iter_priv.h \ $(srcdir)/validator/val_neg.h $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/services/authzone.h \ - $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \ + $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/random.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h \ - $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/sbuffer.h + $(srcdir)/util/random.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/parseutil.h iter_delegpt.lo iter_delegpt.o: $(srcdir)/iterator/iter_delegpt.c config.h $(srcdir)/iterator/iter_delegpt.h \ $(srcdir)/util/log.h $(srcdir)/services/cache/dns.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/regional.h \ @@ -745,88 +753,106 @@ iter_utils.lo iter_utils.o: $(srcdir)/iterator/iter_ut $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/iterator/iter_fwd.h \ $(srcdir)/iterator/iter_donotq.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_priv.h \ $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/services/cache/dns.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/data/dname.h $(srcdir)/util/random.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h \ + $(srcdir)/util/regional.h $(srcdir)/util/data/dname.h $(srcdir)/util/random.h $(srcdir)/util/fptr_wlist.h \ + $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_kentry.h \ - $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_sigcrypt.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/str2wire.h + $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_sigcrypt.h $(srcdir)/sldns/str2wire.h listen_dnsport.lo listen_dnsport.o: $(srcdir)/services/listen_dnsport.c config.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/mesh.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h \ + $(srcdir)/util/log.h $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/services/mesh.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/services/modstack.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/services/authzone.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h localzone.lo localzone.o: $(srcdir)/services/localzone.c config.h $(srcdir)/services/localzone.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h \ $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/data/msgencode.h $(srcdir)/util/net_help.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/as112.h + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/as112.h mesh.lo mesh.o: $(srcdir)/services/mesh.c config.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/modstack.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/dns.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/regional.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/timehist.h $(srcdir)/util/fptr_wlist.h \ - $(srcdir)/util/tube.h $(srcdir)/util/alloc.h $(srcdir)/util/config_file.h $(srcdir)/util/edns.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ - $(srcdir)/services/view.h $(srcdir)/util/data/dname.h $(srcdir)/respip/respip.h \ + $(srcdir)/util/regional.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ + $(srcdir)/util/alloc.h $(srcdir)/util/edns.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/data/dname.h \ $(srcdir)/services/listen_dnsport.h modstack.lo modstack.o: $(srcdir)/services/modstack.c config.h $(srcdir)/services/modstack.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/dns64/dns64.h \ - $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/validator/validator.h \ - $(srcdir)/validator/val_utils.h $(srcdir)/respip/respip.h $(srcdir)/services/localzone.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(PYTHONMOD_HEADER) $(srcdir)/ipsecmod/ipsecmod.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h \ - $(srcdir)/ipset/ipset.h + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/dns64/dns64.h $(srcdir)/iterator/iterator.h \ + $(srcdir)/services/outbound_list.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h view.lo view.o: $(srcdir)/services/view.c config.h $(srcdir)/services/view.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/util/config_file.h + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h +rpz.lo rpz.o: $(srcdir)/services/rpz.c config.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h \ + $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/services/modstack.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h $(srcdir)/sldns/wire2str.h \ + $(srcdir)/sldns/str2wire.h $(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h outbound_list.lo outbound_list.o: $(srcdir)/services/outbound_list.c config.h \ $(srcdir)/services/outbound_list.h $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h + outside_network.lo outside_network.o: $(srcdir)/services/outside_network.c config.h \ $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/storage/dnstree.h \ - $(srcdir)/util/rtt.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgencode.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/random.h $(srcdir)/util/fptr_wlist.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/dnstap/dnstap.h \ - + $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/iterator/iterator.h \ + $(srcdir)/services/outbound_list.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/random.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ + $(srcdir)/dnstap/dnstap.h alloc.lo alloc.o: $(srcdir)/util/alloc.c config.h $(srcdir)/util/alloc.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/regional.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h + $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h config_file.lo config_file.o: $(srcdir)/util/config_file.c config.h $(srcdir)/util/log.h \ $(srcdir)/util/configyyrename.h $(srcdir)/util/config_file.h util/configparser.h \ $(srcdir)/util/net_help.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/regional.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/modstack.h $(srcdir)/util/data/dname.h $(srcdir)/util/rtt.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h \ + $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/data/dname.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/cache/infra.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h \ $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/util/iana_ports.inc configlexer.lo configlexer.o: util/configlexer.c config.h $(srcdir)/util/configyyrename.h \ $(srcdir)/util/config_file.h util/configparser.h @@ -837,71 +863,83 @@ shm_main.lo shm_main.o: $(srcdir)/util/shm_side/shm_ma $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h \ $(srcdir)/util/timehist.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/services/mesh.h \ - $(srcdir)/util/rbtree.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h \ - $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h + $(srcdir)/util/rbtree.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/respip/respip.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/util/fptr_wlist.h \ + $(srcdir)/util/tube.h authzone.lo authzone.o: $(srcdir)/services/authzone.c config.h $(srcdir)/services/authzone.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/services/modstack.h $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgencode.h \ - $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h $(srcdir)/util/random.h \ + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/modstack.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/data/dname.h \ + $(srcdir)/util/data/msgencode.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/random.h \ $(srcdir)/services/cache/dns.h $(srcdir)/services/outside_network.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/keyraw.h \ - $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_secalgo.h + $(srcdir)/services/listen_dnsport.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h \ + $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/keyraw.h $(srcdir)/validator/val_nsec3.h \ + $(srcdir)/validator/val_secalgo.h fptr_wlist.lo fptr_wlist.o: $(srcdir)/util/fptr_wlist.c config.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/util/mini_event.h \ - $(srcdir)/services/outside_network.h $(srcdir)/services/localzone.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/services/authzone.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/services/cache/rrset.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/dns64/dns64.h $(srcdir)/iterator/iterator.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/validator/validator.h \ - $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_anchor.h $(srcdir)/validator/val_nsec3.h \ - $(srcdir)/validator/val_sigcrypt.h $(srcdir)/validator/val_kentry.h $(srcdir)/validator/val_neg.h \ - $(srcdir)/validator/autotrust.h $(srcdir)/libunbound/libworker.h $(srcdir)/libunbound/context.h \ - $(srcdir)/util/alloc.h $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h \ - $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/respip/respip.h \ - $(PYTHONMOD_HEADER) $(srcdir)/ipsecmod/ipsecmod.h $(srcdir)/edns-subnet/subnetmod.h $(srcdir)/util/net_help.h \ - $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h $(srcdir)/ipset/ipset.h + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/dns64/dns64.h \ + $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_fwd.h \ + $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_anchor.h \ + $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_sigcrypt.h $(srcdir)/validator/val_kentry.h \ + $(srcdir)/validator/val_neg.h $(srcdir)/validator/autotrust.h $(srcdir)/libunbound/libworker.h \ + $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/libunbound/unbound-event.h \ + $(srcdir)/libunbound/worker.h locks.lo locks.o: $(srcdir)/util/locks.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h log.lo log.o: $(srcdir)/util/log.c config.h $(srcdir)/util/log.h $(srcdir)/util/locks.h $(srcdir)/sldns/sbuffer.h -mini_event.lo mini_event.o: $(srcdir)/util/mini_event.c config.h $(srcdir)/util/mini_event.h +mini_event.lo mini_event.o: $(srcdir)/util/mini_event.c config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h module.lo module.o: $(srcdir)/util/module.c config.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h netevent.lo netevent.o: $(srcdir)/util/netevent.c config.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/ub_event.h $(srcdir)/util/net_help.h $(srcdir)/util/tcp_conn_limit.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/fptr_wlist.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/services/listen_dnsport.h \ - + $(srcdir)/util/ub_event.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/tcp_conn_limit.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h \ + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/sldns/str2wire.h \ + $(srcdir)/dnstap/dnstap.h $(srcdir)/services/listen_dnsport.h net_help.lo net_help.o: $(srcdir)/util/net_help.c config.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/module.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h \ - $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h \ - + $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h random.lo random.o: $(srcdir)/util/random.c config.h $(srcdir)/util/random.h $(srcdir)/util/log.h rbtree.lo rbtree.o: $(srcdir)/util/rbtree.c config.h $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h regional.lo regional.o: $(srcdir)/util/regional.c config.h $(srcdir)/util/log.h $(srcdir)/util/regional.h rtt.lo rtt.o: $(srcdir)/util/rtt.c config.h $(srcdir)/util/rtt.h $(srcdir)/iterator/iterator.h \ $(srcdir)/services/outbound_list.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ @@ -909,19 +947,22 @@ rtt.lo rtt.o: $(srcdir)/util/rtt.c config.h $(srcdir)/ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h edns.lo edns.o: $(srcdir)/util/edns.c config.h $(srcdir)/util/edns.h $(srcdir)/util/config_file.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/regional.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h + $(srcdir)/util/regional.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h dnstree.lo dnstree.o: $(srcdir)/util/storage/dnstree.c config.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/net_help.h lookup3.lo lookup3.o: $(srcdir)/util/storage/lookup3.c config.h $(srcdir)/util/storage/lookup3.h lruhash.lo lruhash.o: $(srcdir)/util/storage/lruhash.c config.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h slabhash.lo slabhash.o: $(srcdir)/util/storage/slabhash.c config.h $(srcdir)/util/storage/slabhash.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h tcp_conn_limit.lo tcp_conn_limit.o: $(srcdir)/util/tcp_conn_limit.c config.h $(srcdir)/util/regional.h \ @@ -929,26 +970,30 @@ tcp_conn_limit.lo tcp_conn_limit.o: $(srcdir)/util/tcp $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/services/localzone.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/str2wire.h + $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h timehist.lo timehist.o: $(srcdir)/util/timehist.c config.h $(srcdir)/util/timehist.h $(srcdir)/util/log.h tube.lo tube.o: $(srcdir)/util/tube.c config.h $(srcdir)/util/tube.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/services/mesh.h \ - $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/util/ub_event.h + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/ub_event.h ub_event.lo ub_event.o: $(srcdir)/util/ub_event.c config.h $(srcdir)/util/ub_event.h $(srcdir)/util/log.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/tube.h \ - + $(srcdir)/util/tube.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h ub_event_pluggable.lo ub_event_pluggable.o: $(srcdir)/util/ub_event_pluggable.c config.h $(srcdir)/util/ub_event.h \ $(srcdir)/libunbound/unbound-event.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/modstack.h \ - + $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h winsock_event.lo winsock_event.o: $(srcdir)/util/winsock_event.c config.h autotrust.lo autotrust.o: $(srcdir)/validator/autotrust.c config.h $(srcdir)/validator/autotrust.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ @@ -957,10 +1002,11 @@ autotrust.lo autotrust.o: $(srcdir)/validator/autotrus $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/random.h $(srcdir)/services/mesh.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/services/modstack.h $(srcdir)/services/cache/rrset.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/validator/val_kcache.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/keyraw.h \ - + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/respip/respip.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ + $(srcdir)/validator/val_kcache.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/keyraw.h val_anchor.lo val_anchor.o: $(srcdir)/validator/val_anchor.c config.h $(srcdir)/validator/val_anchor.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_sigcrypt.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h \ @@ -977,8 +1023,11 @@ validator.lo validator.o: $(srcdir)/validator/validato $(srcdir)/validator/autotrust.h $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h \ $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ - $(srcdir)/services/modstack.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h + $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/respip/respip.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h val_kcache.lo val_kcache.o: $(srcdir)/validator/val_kcache.c config.h $(srcdir)/validator/val_kcache.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/validator/val_kentry.h $(srcdir)/util/config_file.h $(srcdir)/util/data/dname.h \ @@ -987,13 +1036,11 @@ val_kcache.lo val_kcache.o: $(srcdir)/validator/val_kc val_kentry.lo val_kentry.o: $(srcdir)/validator/val_kentry.c config.h $(srcdir)/validator/val_kentry.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ - -val_neg.lo val_neg.o: $(srcdir)/validator/val_neg.c config.h \ - $(srcdir)/validator/val_neg.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \ - $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_utils.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/net_help.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h +val_neg.lo val_neg.o: $(srcdir)/validator/val_neg.c config.h $(srcdir)/validator/val_neg.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/rbtree.h $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_utils.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ $(srcdir)/services/cache/dns.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h val_nsec3.lo val_nsec3.o: $(srcdir)/validator/val_nsec3.c config.h $(srcdir)/validator/val_nsec3.h \ @@ -1011,17 +1058,15 @@ val_nsec.lo val_nsec.o: $(srcdir)/validator/val_nsec.c val_secalgo.lo val_secalgo.o: $(srcdir)/validator/val_secalgo.c config.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_secalgo.h \ $(srcdir)/validator/val_nsec3.h $(srcdir)/util/rbtree.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ - $(srcdir)/sldns/sbuffer.h \ - + $(srcdir)/sldns/sbuffer.h val_sigcrypt.lo val_sigcrypt.o: $(srcdir)/validator/val_sigcrypt.c config.h \ $(srcdir)/validator/val_sigcrypt.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/sldns/pkthdr.h $(srcdir)/validator/val_secalgo.h \ $(srcdir)/validator/validator.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/rrdef.h $(srcdir)/validator/val_utils.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/rbtree.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \ - $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h \ - + $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h \ + $(srcdir)/sldns/wire2str.h val_utils.lo val_utils.o: $(srcdir)/validator/val_utils.c config.h $(srcdir)/validator/val_utils.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/validator/validator.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ @@ -1037,9 +1082,11 @@ dns64.lo dns64.o: $(srcdir)/dns64/dns64.c config.h $(s $(srcdir)/sldns/rrdef.h $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/util/config_file.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/modstack.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/str2wire.h + $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/regional.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/str2wire.h edns-subnet.lo edns-subnet.o: $(srcdir)/edns-subnet/edns-subnet.c config.h subnetmod.lo subnetmod.o: $(srcdir)/edns-subnet/subnetmod.c config.h addrtree.lo addrtree.o: $(srcdir)/edns-subnet/addrtree.c config.h $(srcdir)/util/log.h \ @@ -1053,36 +1100,16 @@ respip.lo respip.o: $(srcdir)/respip/respip.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/module.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h \ - $(srcdir)/services/cache/dns.h $(srcdir)/sldns/str2wire.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ - $(srcdir)/services/modstack.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h $(srcdir)/respip/respip.h + $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h \ + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/services/modstack.h \ + $(srcdir)/services/rpz.h $(srcdir)/util/config_file.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/services/cache/dns.h \ + $(srcdir)/sldns/str2wire.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/regional.h checklocks.lo checklocks.o: $(srcdir)/testcode/checklocks.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/testcode/checklocks.h -dnstap.lo dnstap.o: $(srcdir)/dnstap/dnstap.c config.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/locks.h $(srcdir)/dnstap/dnstap.h \ - dnstap/dnstap.pb-c.h -dnstap.pb-c.lo dnstap.pb-c.o: dnstap/dnstap.pb-c.c dnstap/dnstap.pb-c.h \ - -dnscrypt.lo dnscrypt.o: $(srcdir)/dnscrypt/dnscrypt.c config.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/locks.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/storage/lookup3.h ipsecmod.lo ipsecmod.o: $(srcdir)/ipsecmod/ipsecmod.c config.h -ipsecmod-whitelist.lo ipsecmod-whitelist.o: $(srcdir)/ipsecmod/ipsecmod-whitelist.c config.h \ - $(srcdir)/ipsecmod/ipsecmod.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/rbtree.h \ - $(srcdir)/ipsecmod/ipsecmod-whitelist.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/regional.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/str2wire.h -ipset.lo ipset.o: $(srcdir)/ipset/ipset.c config.h $(srcdir)/ipset/ipset.h $(srcdir)/util/module.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/services/cache/dns.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h +ipsecmod-whitelist.lo ipsecmod-whitelist.o: $(srcdir)/ipsecmod/ipsecmod-whitelist.c config.h unitanchor.lo unitanchor.o: $(srcdir)/testcode/unitanchor.c config.h $(srcdir)/util/log.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/testcode/unitmain.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/util/rbtree.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/rrdef.h @@ -1091,16 +1118,15 @@ unitdname.lo unitdname.o: $(srcdir)/testcode/unitdname $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h unitlruhash.lo unitlruhash.o: $(srcdir)/testcode/unitlruhash.c config.h $(srcdir)/testcode/unitmain.h \ $(srcdir)/util/log.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/storage/slabhash.h -unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ +unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ $(srcdir)/util/log.h $(srcdir)/testcode/unitmain.h $(srcdir)/util/alloc.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/util/rtt.h $(srcdir)/util/timehist.h $(srcdir)/iterator/iterator.h \ $(srcdir)/services/outbound_list.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/libunbound/unbound.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/random.h $(srcdir)/respip/respip.h \ - $(srcdir)/services/localzone.h $(srcdir)/services/view.h + $(srcdir)/util/random.h $(srcdir)/respip/respip.h \ + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h unitmsgparse.lo unitmsgparse.o: $(srcdir)/testcode/unitmsgparse.c config.h $(srcdir)/util/log.h \ $(srcdir)/testcode/unitmain.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ @@ -1134,59 +1160,59 @@ unitldns.lo unitldns.o: $(srcdir)/testcode/unitldns.c unitecs.lo unitecs.o: $(srcdir)/testcode/unitecs.c config.h unitauth.lo unitauth.o: $(srcdir)/testcode/unitauth.c config.h $(srcdir)/services/authzone.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/services/modstack.h $(srcdir)/testcode/unitmain.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/config_file.h $(srcdir)/services/cache/dns.h $(srcdir)/sldns/str2wire.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/sbuffer.h + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/modstack.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/testcode/unitmain.h \ + $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/services/cache/dns.h $(srcdir)/sldns/str2wire.h \ + $(srcdir)/sldns/wire2str.h acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/acl_list.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h \ $(srcdir)/services/localzone.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/str2wire.h -cachedump.lo cachedump.o: $(srcdir)/daemon/cachedump.c config.h \ - $(srcdir)/daemon/cachedump.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/alloc.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h \ - $(srcdir)/dnstap/dnstap.h $(srcdir)/services/cache/rrset.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/regional.h \ - $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/iterator/iterator.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h +cachedump.lo cachedump.o: $(srcdir)/daemon/cachedump.c config.h $(srcdir)/daemon/cachedump.h \ + $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/dns.h \ + $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h \ + $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/iterator/iterator.h \ $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_utils.h \ $(srcdir)/iterator/iter_resptype.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h -daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/worker.h \ +daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h \ + $(srcdir)/util/storage/lookup3.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/localzone.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/rpz.h $(srcdir)/respip/respip.h $(srcdir)/util/random.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ + $(srcdir)/sldns/keyraw.h +remote.lo remote.o: $(srcdir)/daemon/remote.c config.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h \ $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ - $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h $(srcdir)/util/storage/lookup3.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/localzone.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/util/random.h \ - $(srcdir)/util/tube.h $(srcdir)/util/net_help.h $(srcdir)/sldns/keyraw.h $(srcdir)/respip/respip.h -remote.lo remote.o: $(srcdir)/daemon/remote.c config.h \ - $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/cachedump.h $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/mesh.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/services/authzone.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/alloc.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h \ + $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ + $(srcdir)/services/modstack.h $(srcdir)/daemon/cachedump.h $(srcdir)/util/config_file.h \ + $(srcdir)/util/net_help.h $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/services/authzone.h $(srcdir)/respip/respip.h \ $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/data/dname.h $(srcdir)/validator/validator.h \ $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_kentry.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h \ @@ -1197,56 +1223,59 @@ stats.lo stats.o: $(srcdir)/daemon/stats.c config.h $( $(srcdir)/libunbound/unbound.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/outside_network.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/util/config_file.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ - $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/iterator/iterator.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/authzone.h $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h \ - + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/respip/respip.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/listen_dnsport.h $(srcdir)/util/tube.h \ + $(srcdir)/util/net_help.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h \ + $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h unbound.lo unbound.o: $(srcdir)/daemon/unbound.c config.h $(srcdir)/util/log.h $(srcdir)/daemon/daemon.h \ $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/remote.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/net_help.h $(srcdir)/util/ub_event.h + $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h $(srcdir)/services/listen_dnsport.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/fptr_wlist.h \ + $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/ub_event.h worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ $(srcdir)/util/random.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/rtt.h $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ - $(srcdir)/services/localzone.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h $(srcdir)/iterator/iter_fwd.h \ - $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h $(srcdir)/validator/val_anchor.h \ - $(srcdir)/respip/respip.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ + $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ + $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/listen_dnsport.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/outbound_list.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/respip/respip.h $(srcdir)/util/data/msgencode.h \ + $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \ + $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/shm_side/shm_main.h testbound.lo testbound.o: $(srcdir)/testcode/testbound.c config.h $(srcdir)/testcode/testpkts.h \ $(srcdir)/testcode/replay.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/rbtree.h $(srcdir)/testcode/fake_event.h $(srcdir)/daemon/remote.h \ - $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/daemon/unbound.c $(srcdir)/daemon/daemon.h \ - $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/fptr_wlist.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/net_help.h $(srcdir)/util/ub_event.h + $(srcdir)/util/rbtree.h $(srcdir)/testcode/fake_event.h \ + $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/daemon/unbound.c \ + $(srcdir)/util/log.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/util/rtt.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h $(srcdir)/util/ub_event.h testpkts.lo testpkts.o: $(srcdir)/testcode/testpkts.c config.h $(srcdir)/testcode/testpkts.h \ $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h @@ -1254,77 +1283,79 @@ worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/random.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/rtt.h $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ - $(srcdir)/services/localzone.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h $(srcdir)/iterator/iter_fwd.h \ - $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h $(srcdir)/validator/val_anchor.h \ - $(srcdir)/respip/respip.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ + $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ + $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/listen_dnsport.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/outbound_list.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/respip/respip.h $(srcdir)/util/data/msgencode.h \ + $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \ + $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/shm_side/shm_main.h acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/acl_list.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h \ $(srcdir)/services/localzone.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/str2wire.h -daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/worker.h \ - $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ - $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h $(srcdir)/util/storage/lookup3.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/localzone.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/util/random.h \ - $(srcdir)/util/tube.h $(srcdir)/util/net_help.h $(srcdir)/sldns/keyraw.h $(srcdir)/respip/respip.h + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h +daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h \ + $(srcdir)/util/storage/lookup3.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/localzone.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/rpz.h $(srcdir)/respip/respip.h $(srcdir)/util/random.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ + $(srcdir)/sldns/keyraw.h stats.lo stats.o: $(srcdir)/daemon/stats.c config.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ $(srcdir)/libunbound/unbound.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/outside_network.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/util/config_file.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ - $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/iterator/iterator.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/authzone.h $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h \ - + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/respip/respip.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/listen_dnsport.h $(srcdir)/util/tube.h \ + $(srcdir)/util/net_help.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h \ + $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h replay.lo replay.o: $(srcdir)/testcode/replay.c config.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/testcode/replay.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h \ - $(srcdir)/testcode/testpkts.h $(srcdir)/util/rbtree.h $(srcdir)/testcode/fake_event.h $(srcdir)/sldns/str2wire.h \ - $(srcdir)/sldns/rrdef.h + $(srcdir)/testcode/testpkts.h $(srcdir)/util/rbtree.h \ + $(srcdir)/testcode/fake_event.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h fake_event.lo fake_event.o: $(srcdir)/testcode/fake_event.c config.h $(srcdir)/testcode/fake_event.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgencode.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/config_file.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h \ - $(srcdir)/testcode/replay.h $(srcdir)/testcode/testpkts.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h + $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ + $(srcdir)/util/rbtree.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h $(srcdir)/testcode/replay.h $(srcdir)/testcode/testpkts.h \ + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h lock_verify.lo lock_verify.o: $(srcdir)/testcode/lock_verify.c config.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h pktview.lo pktview.o: $(srcdir)/testcode/pktview.c config.h $(srcdir)/util/log.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/testcode/unitmain.h $(srcdir)/testcode/readhex.h $(srcdir)/sldns/sbuffer.h \ @@ -1333,10 +1364,13 @@ readhex.lo readhex.o: $(srcdir)/testcode/readhex.c con $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h memstats.lo memstats.o: $(srcdir)/testcode/memstats.c config.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h unbound-checkconf.lo unbound-checkconf.o: $(srcdir)/smallapp/unbound-checkconf.c config.h $(srcdir)/util/log.h \ $(srcdir)/util/config_file.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ @@ -1344,27 +1378,31 @@ unbound-checkconf.lo unbound-checkconf.o: $(srcdir)/sm $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_fwd.h \ $(srcdir)/util/rbtree.h $(srcdir)/iterator/iter_hints.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/services/localzone.h \ - $(srcdir)/services/view.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/services/modstack.h $(srcdir)/respip/respip.h $(srcdir)/sldns/sbuffer.h + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h worker_cb.lo worker_cb.o: $(srcdir)/smallapp/worker_cb.c config.h $(srcdir)/libunbound/context.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h + $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ + $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h context.lo context.o: $(srcdir)/libunbound/context.c config.h $(srcdir)/libunbound/context.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/config_file.h \ $(srcdir)/util/net_help.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ - $(srcdir)/services/view.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/services/authzone.h \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu May 21 05: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 122D1329167; Thu, 21 May 2020 05:02:59 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SHYt6jV2z4NgR; Thu, 21 May 2020 05:02:58 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C795727EB0; Thu, 21 May 2020 05:02:58 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L52w1O082249; Thu, 21 May 2020 05:02:58 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L52wDx082248; Thu, 21 May 2020 05:02:58 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202005210502.04L52wDx082248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 21 May 2020 05:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r361323 - vendor/unbound/1.10.1 X-SVN-Group: vendor X-SVN-Commit-Author: cy X-SVN-Commit-Paths: vendor/unbound/1.10.1 X-SVN-Commit-Revision: 361323 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, 21 May 2020 05:02:59 -0000 Author: cy Date: Thu May 21 05:02:58 2020 New Revision: 361323 URL: https://svnweb.freebsd.org/changeset/base/361323 Log: Tag unbound 1.10.1. Added: vendor/unbound/1.10.1/ - copied from r361322, vendor/unbound/dist/ From owner-svn-src-all@freebsd.org Thu May 21 05: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 BD0F7329F53; Thu, 21 May 2020 05:34:02 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SJFk4dl7z4QFv; Thu, 21 May 2020 05:34:02 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A0A38355; Thu, 21 May 2020 05:34:02 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L5Y2l2001035; Thu, 21 May 2020 05:34:02 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L5Y2VB001034; Thu, 21 May 2020 05:34:02 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <202005210534.04L5Y2VB001034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Thu, 21 May 2020 05:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361324 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 361324 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, 21 May 2020 05:34:02 -0000 Author: dougm Date: Thu May 21 05:34:02 2020 New Revision: 361324 URL: https://svnweb.freebsd.org/changeset/base/361324 Log: For the case when RB_REMOVE requires a nontrivial search to find the node to replace the one being removed, restructure to first remove the replacement node and correct the parent pointers around it, and then let the all-cases code at the end deal with the parent of the deleted node, making it point to the replacement node. This removes one or two conditional branches. Reviewed by: markj Tested by: pho Differential Revision: https://reviews.freebsd.org/D24845 Modified: head/sys/sys/tree.h Modified: head/sys/sys/tree.h ============================================================================== --- head/sys/sys/tree.h Thu May 21 05:02:58 2020 (r361323) +++ head/sys/sys/tree.h Thu May 21 05:34:02 2020 (r361324) @@ -562,48 +562,44 @@ name##_RB_REMOVE_COLOR(struct name *head, struct type attr struct type * \ name##_RB_REMOVE(struct name *head, struct type *elm) \ { \ - struct type *child, *parent, *old = elm; \ + struct type *child, *parent, *parent_old, *old = elm; \ int color; \ - if (RB_LEFT(elm, field) == NULL) \ - child = RB_RIGHT(elm, field); \ - else if (RB_RIGHT(elm, field) == NULL) \ - child = RB_LEFT(elm, field); \ - else { \ + parent_old = parent = RB_PARENT(elm, field); \ + color = RB_COLOR(elm, field); \ + if (RB_LEFT(elm, field) == NULL) { \ + elm = child = RB_RIGHT(elm, field); \ + if (elm != NULL) \ + RB_PARENT(elm, field) = parent; \ + } else if (RB_RIGHT(elm, field) == NULL) { \ + elm = child = RB_LEFT(elm, field); \ + RB_PARENT(elm, field) = parent; \ + } else { \ elm = RB_RIGHT(old, field); \ if ((child = RB_LEFT(elm, field)) == NULL) { \ child = RB_RIGHT(elm, field); \ RB_RIGHT(old, field) = child; \ - RB_PARENT(elm, field) = elm; \ + parent = elm; \ } else { \ do \ elm = child; \ while ((child = RB_LEFT(elm, field)) != NULL); \ child = RB_RIGHT(elm, field); \ + parent = RB_PARENT(elm, field); \ + RB_LEFT(parent, field) = child; \ + if (child != NULL) \ + RB_PARENT(child, field) = parent; \ RB_PARENT(RB_RIGHT(old, field), field) = elm; \ } \ RB_PARENT(RB_LEFT(old, field), field) = elm; \ - parent = RB_PARENT(old, field); \ - if (parent != NULL) { \ - if (RB_LEFT(parent, field) == old) \ - RB_LEFT(parent, field) = elm; \ - else \ - RB_RIGHT(parent, field) = elm; \ - } else \ - RB_ROOT(head) = elm; \ + color = RB_COLOR(elm, field); \ + elm->field = old->field; \ } \ - parent = RB_PARENT(elm, field); \ - color = RB_COLOR(elm, field); \ - if (child != NULL) \ - RB_PARENT(child, field) = parent; \ - if (parent != NULL) { \ - if (RB_LEFT(parent, field) == elm) \ - RB_LEFT(parent, field) = child; \ - else \ - RB_RIGHT(parent, field) = child; \ - } else \ - RB_ROOT(head) = child; \ - if (elm != old) \ - (elm)->field = (old)->field; \ + if (parent_old == NULL) \ + RB_ROOT(head) = elm; \ + else if (RB_LEFT(parent_old, field) == old) \ + RB_LEFT(parent_old, field) = elm; \ + else \ + RB_RIGHT(parent_old, field) = elm; \ if (color == RB_BLACK) \ name##_RB_REMOVE_COLOR(head, parent, child); \ while (parent != NULL) { \ From owner-svn-src-all@freebsd.org Thu May 21 06:17: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 7262532A932; Thu, 21 May 2020 06:17:55 +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 49SKDM2Pp0z4S7w; Thu, 21 May 2020 06:17:55 +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 4D8D09074; Thu, 21 May 2020 06:17:55 +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 04L6HtO1025601; Thu, 21 May 2020 06:17:55 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L6Ht8S025600; Thu, 21 May 2020 06:17:55 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <202005210617.04L6Ht8S025600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Thu, 21 May 2020 06:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361325 - head/sys/arm/xilinx X-SVN-Group: head X-SVN-Commit-Author: jmg X-SVN-Commit-Paths: head/sys/arm/xilinx X-SVN-Commit-Revision: 361325 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, 21 May 2020 06:17:55 -0000 Author: jmg Date: Thu May 21 06:17:54 2020 New Revision: 361325 URL: https://svnweb.freebsd.org/changeset/base/361325 Log: minor cleanup of white space, and function name in panic... This is a partial commit of the review. Submitted by: Thomas Skibo Differential Revision: https://reviews.freebsd.org/D23319 Reviewed by: andrew Modified: head/sys/arm/xilinx/zy7_mp.c Modified: head/sys/arm/xilinx/zy7_mp.c ============================================================================== --- head/sys/arm/xilinx/zy7_mp.c Thu May 21 05:34:02 2020 (r361324) +++ head/sys/arm/xilinx/zy7_mp.c Thu May 21 06:17:54 2020 (r361325) @@ -58,7 +58,7 @@ zynq7_mp_setmaxid(platform_t plat) mp_ncpus = 2; } -void +void zynq7_mp_start_ap(platform_t plat) { bus_space_handle_t scu_handle; @@ -67,8 +67,8 @@ zynq7_mp_start_ap(platform_t plat) /* Map in SCU control register. */ if (bus_space_map(fdtbus_bs_tag, SCU_CONTROL_REG, 4, - 0, &scu_handle) != 0) - panic("platform_mp_start_ap: Couldn't map SCU config reg\n"); + 0, &scu_handle) != 0) + panic("%s: Could not map SCU control reg.\n", __func__); /* Set SCU enable bit. */ scu_ctrl = bus_space_read_4(fdtbus_bs_tag, scu_handle, 0); @@ -80,7 +80,7 @@ zynq7_mp_start_ap(platform_t plat) /* Map in magic location to give entry address to CPU1. */ if (bus_space_map(fdtbus_bs_tag, ZYNQ7_CPU1_ENTRY, 4, 0, &ocm_handle) != 0) - panic("platform_mp_start_ap: Couldn't map OCM\n"); + panic("%s: Could not map OCM\n", __func__); /* Write start address for CPU1. */ bus_space_write_4(fdtbus_bs_tag, ocm_handle, 0, From owner-svn-src-all@freebsd.org Thu May 21 06:40: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 BB68132B1E5; Thu, 21 May 2020 06:40:51 +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 49SKkq4xbqz4SvF; Thu, 21 May 2020 06:40:51 +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 A4C798D70; Thu, 21 May 2020 06:40:51 +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 04L6epTN038750; Thu, 21 May 2020 06:40:51 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L6epG6038748; Thu, 21 May 2020 06:40:51 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <202005210640.04L6epG6038748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Thu, 21 May 2020 06:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361326 - head/sys/arm/xilinx X-SVN-Group: head X-SVN-Commit-Author: jmg X-SVN-Commit-Paths: head/sys/arm/xilinx X-SVN-Commit-Revision: 361326 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, 21 May 2020 06:40:51 -0000 Author: jmg Date: Thu May 21 06:40:51 2020 New Revision: 361326 URL: https://svnweb.freebsd.org/changeset/base/361326 Log: Bring in support for single core Zynq devices. Turns out that real hardware, the registers appear like there's two cores, but the second core does not work, so base the number of cores upon the chip id. Tested on a XC7Z007S. also, previous commit was suppose to be D14429. Submitted by: Thomas Skibo Differential Revision: https://reviews.freebsd.org/D14429 Modified: head/sys/arm/xilinx/zy7_mp.c head/sys/arm/xilinx/zy7_slcr.h Modified: head/sys/arm/xilinx/zy7_mp.c ============================================================================== --- head/sys/arm/xilinx/zy7_mp.c Thu May 21 06:17:54 2020 (r361325) +++ head/sys/arm/xilinx/zy7_mp.c Thu May 21 06:40:51 2020 (r361326) @@ -44,18 +44,59 @@ __FBSDID("$FreeBSD$"); #include #include +#include -#define ZYNQ7_CPU1_ENTRY 0xfffffff0 +#define ZYNQ7_CPU1_ENTRY 0xfffffff0 -#define SCU_CONTROL_REG 0xf8f00000 -#define SCU_CONTROL_ENABLE (1 << 0) +#define SCU_CONTROL_REG 0xf8f00000 +#define SCU_CONTROL_ENABLE 1 +#define SCU_CONFIG_REG 0xf8f00004 +#define SCU_CONFIG_N_CPUS_MASK 3 +#define SLCR_PSS_IDCODE 0xf8000530 + void zynq7_mp_setmaxid(platform_t plat) { + bus_space_handle_t slcr_handle; + int device_id; + bus_space_handle_t scu_handle; - mp_maxid = 1; - mp_ncpus = 2; + if (mp_ncpus != 0) + return; + + /* Map in SLCR PSS_IDCODE register. */ + if (bus_space_map(fdtbus_bs_tag, SLCR_PSS_IDCODE, 4, 0, + &slcr_handle) != 0) + panic("%s: Could not map SLCR IDCODE reg.\n", __func__); + + device_id = bus_space_read_4(fdtbus_bs_tag, slcr_handle, 0) & + ZY7_SLCR_PSS_IDCODE_DEVICE_MASK; + + bus_space_unmap(fdtbus_bs_tag, slcr_handle, 4); + + /* + * Zynq XC7z0xxS single core chips indicate incorrect number of CPUs in + * SCU configuration register. + */ + if (device_id == ZY7_SLCR_PSS_IDCODE_DEVICE_7Z007S || + device_id == ZY7_SLCR_PSS_IDCODE_DEVICE_7Z012S || + device_id == ZY7_SLCR_PSS_IDCODE_DEVICE_7Z014S) { + mp_maxid = 0; + mp_ncpus = 1; + return; + } + + /* Map in SCU config register. */ + if (bus_space_map(fdtbus_bs_tag, SCU_CONFIG_REG, 4, 0, + &scu_handle) != 0) + panic("zynq7_mp_setmaxid: Could not map SCU config reg.\n"); + + mp_maxid = bus_space_read_4(fdtbus_bs_tag, scu_handle, 0) & + SCU_CONFIG_N_CPUS_MASK; + mp_ncpus = mp_maxid + 1; + + bus_space_unmap(fdtbus_bs_tag, scu_handle, 4); } void Modified: head/sys/arm/xilinx/zy7_slcr.h ============================================================================== --- head/sys/arm/xilinx/zy7_slcr.h Thu May 21 06:17:54 2020 (r361325) +++ head/sys/arm/xilinx/zy7_slcr.h Thu May 21 06:40:51 2020 (r361326) @@ -53,91 +53,91 @@ #define ZY7_SLCR_ARM_PLL_CTRL 0x0100 #define ZY7_SLCR_DDR_PLL_CTRL 0x0104 #define ZY7_SLCR_IO_PLL_CTRL 0x0108 -#define ZY7_SLCR_PLL_CTRL_RESET (1<<0) -#define ZY7_SLCR_PLL_CTRL_PWRDWN (1<<1) -#define ZY7_SLCR_PLL_CTRL_BYPASS_QUAL (1<<3) -#define ZY7_SLCR_PLL_CTRL_BYPASS_FORCE (1<<4) +#define ZY7_SLCR_PLL_CTRL_RESET (1 << 0) +#define ZY7_SLCR_PLL_CTRL_PWRDWN (1 << 1) +#define ZY7_SLCR_PLL_CTRL_BYPASS_QUAL (1 << 3) +#define ZY7_SLCR_PLL_CTRL_BYPASS_FORCE (1 << 4) #define ZY7_SLCR_PLL_CTRL_FDIV_SHIFT 12 -#define ZY7_SLCR_PLL_CTRL_FDIV_MASK (0x7f<<12) +#define ZY7_SLCR_PLL_CTRL_FDIV_MASK (0x7f << 12) #define ZY7_SLCR_PLL_STATUS 0x010c -#define ZY7_SLCR_PLL_STAT_ARM_PLL_LOCK (1<<0) -#define ZY7_SLCR_PLL_STAT_DDR_PLL_LOCK (1<<1) -#define ZY7_SLCR_PLL_STAT_IO_PLL_LOCK (1<<2) -#define ZY7_SLCR_PLL_STAT_ARM_PLL_STABLE (1<<3) -#define ZY7_SLCR_PLL_STAT_DDR_PLL_STABLE (1<<4) -#define ZY7_SLCR_PLL_STAT_IO_PLL_STABLE (1<<5) +#define ZY7_SLCR_PLL_STAT_ARM_PLL_LOCK (1 << 0) +#define ZY7_SLCR_PLL_STAT_DDR_PLL_LOCK (1 << 1) +#define ZY7_SLCR_PLL_STAT_IO_PLL_LOCK (1 << 2) +#define ZY7_SLCR_PLL_STAT_ARM_PLL_STABLE (1 << 3) +#define ZY7_SLCR_PLL_STAT_DDR_PLL_STABLE (1 << 4) +#define ZY7_SLCR_PLL_STAT_IO_PLL_STABLE (1 << 5) #define ZY7_SLCR_ARM_PLL_CFG 0x0110 #define ZY7_SLCR_DDR_PLL_CFG 0x0114 #define ZY7_SLCR_IO_PLL_CFG 0x0118 #define ZY7_SLCR_PLL_CFG_RES_SHIFT 4 -#define ZY7_SLCR_PLL_CFG_RES_MASK (0xf<<4) +#define ZY7_SLCR_PLL_CFG_RES_MASK (0xf << 4) #define ZY7_SLCR_PLL_CFG_PLL_CP_SHIFT 8 -#define ZY7_SLCR_PLL_CFG_PLL_CP_MASK (0xf<<8) +#define ZY7_SLCR_PLL_CFG_PLL_CP_MASK (0xf << 8) #define ZY7_SLCR_PLL_CFG_LOCK_CNT_SHIFT 12 -#define ZY7_SLCR_PLL_CFG_LOCK_CNT_MASK (0x3ff<<12) +#define ZY7_SLCR_PLL_CFG_LOCK_CNT_MASK (0x3ff << 12) /* Clock controls. */ #define ZY7_SLCR_ARM_CLK_CTRL 0x0120 -#define ZY7_SLCR_ARM_CLK_CTRL_CPU_PERI_CLKACT (1<<28) -#define ZY7_SLCR_ARM_CLK_CTRL_CPU_1XCLKACT (1<<27) -#define ZY7_SLCR_ARM_CLK_CTRL_CPU_2XCLKACT (1<<26) -#define ZY7_SLCR_ARM_CLK_CTRL_CPU_3OR2XCLKACT (1<<25) -#define ZY7_SLCR_ARM_CLK_CTRL_CPU_6OR4XCLKACT (1<<24) -#define ZY7_SLCR_ARM_CLK_CTRL_SRCSEL_MASK (3<<4) -#define ZY7_SLCR_ARM_CLK_CTRL_SRCSEL_ARM_PLL (0<<4) -#define ZY7_SLCR_ARM_CLK_CTRL_SRCSEL_DDR_PLL (2<<4) -#define ZY7_SLCR_ARM_CLK_CTRL_SRCSEL_IO_PLL (3<<4) +#define ZY7_SLCR_ARM_CLK_CTRL_CPU_PERI_CLKACT (1 << 28) +#define ZY7_SLCR_ARM_CLK_CTRL_CPU_1XCLKACT (1 << 27) +#define ZY7_SLCR_ARM_CLK_CTRL_CPU_2XCLKACT (1 << 26) +#define ZY7_SLCR_ARM_CLK_CTRL_CPU_3OR2XCLKACT (1 << 25) +#define ZY7_SLCR_ARM_CLK_CTRL_CPU_6OR4XCLKACT (1 << 24) +#define ZY7_SLCR_ARM_CLK_CTRL_SRCSEL_MASK (3 << 4) +#define ZY7_SLCR_ARM_CLK_CTRL_SRCSEL_ARM_PLL (0 << 4) +#define ZY7_SLCR_ARM_CLK_CTRL_SRCSEL_DDR_PLL (2 << 4) +#define ZY7_SLCR_ARM_CLK_CTRL_SRCSEL_IO_PLL (3 << 4) #define ZY7_SLCR_ARM_CLK_CTRL_DIVISOR_SHIFT 8 -#define ZY7_SLCR_ARM_CLK_CTRL_DIVISOR_MASK (0x3f<<8) +#define ZY7_SLCR_ARM_CLK_CTRL_DIVISOR_MASK (0x3f << 8) #define ZY7_SLCR_DDR_CLK_CTRL 0x0124 -#define ZY7_SLCR_DDR_CLK_CTRL_2XCLK_DIV_SHIFT 26 -#define ZY7_SLCR_DDR_CLK_CTRL_2XCLK_DIV_MASK (0x3f<<26) +#define ZY7_SLCR_DDR_CLK_CTRL_2XCLK_DIV_SHIFT 26 +#define ZY7_SLCR_DDR_CLK_CTRL_2XCLK_DIV_MASK (0x3f << 26) #define ZY7_SLCR_DDR_CLK_CTRL_3XCLK_DIV_SHIFT 20 -#define ZY7_SLCR_DDR_CLK_CTRL_3XCLK_DIV_MASK (0x3f<<20) -#define ZY7_SLCR_DDR_CLK_CTRL_2XCLKACT (1<<1) -#define ZY7_SLCR_DDR_CLK_CTRL_3XCLKACT (1<<0) +#define ZY7_SLCR_DDR_CLK_CTRL_3XCLK_DIV_MASK (0x3f << 20) +#define ZY7_SLCR_DDR_CLK_CTRL_2XCLKACT (1 << 1) +#define ZY7_SLCR_DDR_CLK_CTRL_3XCLKACT (1 << 0) #define ZY7_SLCR_DCI_CLK_CTRL 0x0128 #define ZY7_SLCR_DCI_CLK_CTRL_DIVISOR1_SHIFT 20 -#define ZY7_SLCR_DCI_CLK_CTRL_DIVISOR1_MASK (0x3f<<20) +#define ZY7_SLCR_DCI_CLK_CTRL_DIVISOR1_MASK (0x3f << 20) #define ZY7_SLCR_DCI_CLK_CTRL_DIVISOR0_SHIFT 8 -#define ZY7_SLCR_DCI_CLK_CTRL_DIVISOR0_MASK (0x3f<<8) -#define ZY7_SLCR_DCI_CLK_CTRL_CLKACT (1<<0) +#define ZY7_SLCR_DCI_CLK_CTRL_DIVISOR0_MASK (0x3f << 8) +#define ZY7_SLCR_DCI_CLK_CTRL_CLKACT (1 << 0) #define ZY7_SLCR_APER_CLK_CTRL 0x012c /* amba periph clk ctrl */ -#define ZY7_SLCR_APER_CLK_CTRL_SMC_CPU_1XCLKACT (1<<24) -#define ZY7_SLCR_APER_CLK_CTRL_LQSPI_CPU_1XCLKACT (1<<23) -#define ZY7_SLCR_APER_CLK_CTRL_GPIO_CPU_1XCLKACT (1<<22) -#define ZY7_SLCR_APER_CLK_CTRL_UART1_CPU_1XCLKACT (1<<21) -#define ZY7_SLCR_APER_CLK_CTRL_UART0_CPU_1XCLKACT (1<<20) -#define ZY7_SLCR_APER_CLK_CTRL_I2C1_CPU_1XCLKACT (1<<19) -#define ZY7_SLCR_APER_CLK_CTRL_I2C0_CPU_1XCLKACT (1<<18) -#define ZY7_SLCR_APER_CLK_CTRL_CAN1_CPU_1XCLKACT (1<<17) -#define ZY7_SLCR_APER_CLK_CTRL_CAN0_CPU_1XCLKACT (1<<16) -#define ZY7_SLCR_APER_CLK_CTRL_SPI1_CPU_1XCLKACT (1<<15) -#define ZY7_SLCR_APER_CLK_CTRL_SPI0_CPU_1XCLKACT (1<<14) -#define ZY7_SLCR_APER_CLK_CTRL_SDI1_CPU_1XCLKACT (1<<11) -#define ZY7_SLCR_APER_CLK_CTRL_SDI0_CPU_1XCLKACT (1<<10) -#define ZY7_SLCR_APER_CLK_CTRL_GEM1_CPU_1XCLKACT (1<<7) -#define ZY7_SLCR_APER_CLK_CTRL_GEM0_CPU_1XCLKACT (1<<6) -#define ZY7_SLCR_APER_CLK_CTRL_USB1_CPU_1XCLKACT (1<<3) -#define ZY7_SLCR_APER_CLK_CTRL_USB0_CPU_1XCLKACT (1<<2) -#define ZY7_SLCR_APER_CLK_CTRL_DMA_CPU_1XCLKACT (1<<0) +#define ZY7_SLCR_APER_CLK_CTRL_SMC_CPU_1XCLKACT (1 << 24) +#define ZY7_SLCR_APER_CLK_CTRL_LQSPI_CPU_1XCLKACT (1 << 23) +#define ZY7_SLCR_APER_CLK_CTRL_GPIO_CPU_1XCLKACT (1 << 22) +#define ZY7_SLCR_APER_CLK_CTRL_UART1_CPU_1XCLKACT (1 << 21) +#define ZY7_SLCR_APER_CLK_CTRL_UART0_CPU_1XCLKACT (1 << 20) +#define ZY7_SLCR_APER_CLK_CTRL_I2C1_CPU_1XCLKACT (1 << 19) +#define ZY7_SLCR_APER_CLK_CTRL_I2C0_CPU_1XCLKACT (1 << 18) +#define ZY7_SLCR_APER_CLK_CTRL_CAN1_CPU_1XCLKACT (1 << 17) +#define ZY7_SLCR_APER_CLK_CTRL_CAN0_CPU_1XCLKACT (1 << 16) +#define ZY7_SLCR_APER_CLK_CTRL_SPI1_CPU_1XCLKACT (1 << 15) +#define ZY7_SLCR_APER_CLK_CTRL_SPI0_CPU_1XCLKACT (1 << 14) +#define ZY7_SLCR_APER_CLK_CTRL_SDI1_CPU_1XCLKACT (1 << 11) +#define ZY7_SLCR_APER_CLK_CTRL_SDI0_CPU_1XCLKACT (1 << 10) +#define ZY7_SLCR_APER_CLK_CTRL_GEM1_CPU_1XCLKACT (1 << 7) +#define ZY7_SLCR_APER_CLK_CTRL_GEM0_CPU_1XCLKACT (1 << 6) +#define ZY7_SLCR_APER_CLK_CTRL_USB1_CPU_1XCLKACT (1 << 3) +#define ZY7_SLCR_APER_CLK_CTRL_USB0_CPU_1XCLKACT (1 << 2) +#define ZY7_SLCR_APER_CLK_CTRL_DMA_CPU_1XCLKACT (1 << 0) #define ZY7_SLCR_USB0_CLK_CTRL 0x0130 #define ZY7_SLCR_USB1_CLK_CTRL 0x0134 #define ZY7_SLCR_GEM0_RCLK_CTRL 0x0138 #define ZY7_SLCR_GEM1_RCLK_CTRL 0x013c #define ZY7_SLCR_GEM0_CLK_CTRL 0x0140 #define ZY7_SLCR_GEM1_CLK_CTRL 0x0144 -#define ZY7_SLCR_GEM_CLK_CTRL_DIVISOR1_MASK (0x3f<<20) +#define ZY7_SLCR_GEM_CLK_CTRL_DIVISOR1_MASK (0x3f << 20) #define ZY7_SLCR_GEM_CLK_CTRL_DIVISOR1_SHIFT 20 #define ZY7_SLCR_GEM_CLK_CTRL_DIVISOR1_MAX 0x3f -#define ZY7_SLCR_GEM_CLK_CTRL_DIVISOR_MASK (0x3f<<8) +#define ZY7_SLCR_GEM_CLK_CTRL_DIVISOR_MASK (0x3f << 8) #define ZY7_SLCR_GEM_CLK_CTRL_DIVISOR_SHIFT 8 #define ZY7_SLCR_GEM_CLK_CTRL_DIVISOR_MAX 0x3f -#define ZY7_SLCR_GEM_CLK_CTRL_SRCSEL_MASK (7<<4) -#define ZY7_SLCR_GEM_CLK_CTRL_SRCSEL_IO_PLL (0<<4) -#define ZY7_SLCR_GEM_CLK_CTRL_SRCSEL_ARM_PLL (2<<4) -#define ZY7_SLCR_GEM_CLK_CTRL_SRCSEL_DDR_PLL (3<<4) -#define ZY7_SLCR_GEM_CLK_CTRL_SRCSEL_EMIO_CLK (4<<4) +#define ZY7_SLCR_GEM_CLK_CTRL_SRCSEL_MASK (7 << 4) +#define ZY7_SLCR_GEM_CLK_CTRL_SRCSEL_IO_PLL (0 << 4) +#define ZY7_SLCR_GEM_CLK_CTRL_SRCSEL_ARM_PLL (2 << 4) +#define ZY7_SLCR_GEM_CLK_CTRL_SRCSEL_DDR_PLL (3 << 4) +#define ZY7_SLCR_GEM_CLK_CTRL_SRCSEL_EMIO_CLK (4 << 4) #define ZY7_SLCR_GEM_CLK_CTRL_CLKACT 1 #define ZY7_SLCR_SMC_CLK_CTRL 0x0148 #define ZY7_SLCR_LQSPI_CLK_CTRL 0x014c @@ -149,24 +149,24 @@ #define ZY7_SLCR_DBG_CLK_CTRL 0x0164 #define ZY7_SLCR_PCAP_CLK_CTRL 0x0168 #define ZY7_SLCR_TOPSW_CLK_CTRL 0x016c /* central intercnn clk ctrl */ -#define ZY7_SLCR_FPGA_CLK_CTRL(unit) (0x0170 + 0x10*(unit)) -#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR1_SHIFT 20 -#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR1_MASK (0x3f << 20) -#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR0_SHIFT 8 -#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR0_MASK (0x3f << 8) -#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR_MAX 0x3f -#define ZY7_SLCR_FPGA_CLK_CTRL_SRCSEL_SHIFT 4 -#define ZY7_SLCR_FPGA_CLK_CTRL_SRCSEL_MASK (3 << 4) -#define ZY7_SLCR_FPGA_THR_CTRL(unit) (0x0174 + 0x10*(unit)) -#define ZY7_SLCR_FPGA_THR_CTRL_CNT_RST (1 << 1) -#define ZY7_SLCR_FPGA_THR_CTRL_CPU_START (1 << 0) -#define ZY7_SLCR_FPGA_THR_CNT(unit) (0x0178 + 0x10*(unit)) -#define ZY7_SLCR_FPGA_THR_STA(unit) (0x017c + 0x10*(unit)) +#define ZY7_SLCR_FPGA_CLK_CTRL(unit) (0x0170 + 0x10 * (unit)) +#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR1_SHIFT 20 +#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR1_MASK (0x3f << 20) +#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR0_SHIFT 8 +#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR0_MASK (0x3f << 8) +#define ZY7_SLCR_FPGA_CLK_CTRL_DIVISOR_MAX 0x3f +#define ZY7_SLCR_FPGA_CLK_CTRL_SRCSEL_SHIFT 4 +#define ZY7_SLCR_FPGA_CLK_CTRL_SRCSEL_MASK (3 << 4) +#define ZY7_SLCR_FPGA_THR_CTRL(unit) (0x0174 + 0x10 * (unit)) +#define ZY7_SLCR_FPGA_THR_CTRL_CNT_RST (1 << 1) +#define ZY7_SLCR_FPGA_THR_CTRL_CPU_START (1 << 0) +#define ZY7_SLCR_FPGA_THR_CNT(unit) (0x0178 + 0x10 * (unit)) +#define ZY7_SLCR_FPGA_THR_STA(unit) (0x017c + 0x10 * (unit)) #define ZY7_SLCR_CLK_621_TRUE 0x01c4 /* cpu clock ratio mode */ /* Reset controls. */ #define ZY7_SLCR_PSS_RST_CTRL 0x0200 -#define ZY7_SLCR_PSS_RST_CTRL_SOFT_RESET (1<<0) +#define ZY7_SLCR_PSS_RST_CTRL_SOFT_RESET (1 << 0) #define ZY7_SLCR_DDR_RST_CTRL 0x0204 #define ZY7_SLCR_TOPSW_RST_CTRL 0x0208 #define ZY7_SLCR_DMAC_RST_CTRL 0x020c @@ -183,27 +183,27 @@ #define ZY7_SLCR_OCM_RST_CTRL 0x0238 #define ZY7_SLCR_DEVCI_RST_CTRL 0x023c #define ZY7_SLCR_FPGA_RST_CTRL 0x0240 -#define ZY7_SLCR_FPGA_RST_CTRL_FPGA3_OUT_RST (1<<3) -#define ZY7_SLCR_FPGA_RST_CTRL_FPGA2_OUT_RST (1<<2) -#define ZY7_SLCR_FPGA_RST_CTRL_FPGA1_OUT_RST (1<<1) -#define ZY7_SLCR_FPGA_RST_CTRL_FPGA0_OUT_RST (1<<0) +#define ZY7_SLCR_FPGA_RST_CTRL_FPGA3_OUT_RST (1 << 3) +#define ZY7_SLCR_FPGA_RST_CTRL_FPGA2_OUT_RST (1 << 2) +#define ZY7_SLCR_FPGA_RST_CTRL_FPGA1_OUT_RST (1 << 1) +#define ZY7_SLCR_FPGA_RST_CTRL_FPGA0_OUT_RST (1 << 0) #define ZY7_SLCR_FPGA_RST_CTRL_RST_ALL 0xf #define ZY7_SLCR_A9_CPU_RST_CTRL 0x0244 #define ZY7_SLCR_RS_AWDT_CTRL 0x024c #define ZY7_SLCR_REBOOT_STAT 0x0258 -#define ZY7_SLCR_REBOOT_STAT_STATE_MASK (0xff<<24) -#define ZY7_SLCR_REBOOT_STAT_POR (1<<22) -#define ZY7_SLCR_REBOOT_STAT_SRST_B (1<<21) -#define ZY7_SLCR_REBOOT_STAT_DBG_RST (1<<20) -#define ZY7_SLCR_REBOOT_STAT_SLC_RST (1<<19) -#define ZY7_SLCR_REBOOT_STAT_AWDT1_RST (1<<18) -#define ZY7_SLCR_REBOOT_STAT_AWDT0_RST (1<<17) -#define ZY7_SLCR_REBOOT_STAT_SWDT_RST (1<<16) -#define ZY7_SLCR_REBOOT_STAT_BOOTROM_ERR_CODE_MASK (0xffff) +#define ZY7_SLCR_REBOOT_STAT_STATE_MASK (0xffU << 24) +#define ZY7_SLCR_REBOOT_STAT_POR (1 << 22) +#define ZY7_SLCR_REBOOT_STAT_SRST_B (1 << 21) +#define ZY7_SLCR_REBOOT_STAT_DBG_RST (1 << 20) +#define ZY7_SLCR_REBOOT_STAT_SLC_RST (1 << 19) +#define ZY7_SLCR_REBOOT_STAT_AWDT1_RST (1 << 18) +#define ZY7_SLCR_REBOOT_STAT_AWDT0_RST (1 << 17) +#define ZY7_SLCR_REBOOT_STAT_SWDT_RST (1 << 16) +#define ZY7_SLCR_REBOOT_STAT_BOOTROM_ERR_CODE_MASK (0xffff) #define ZY7_SLCR_BOOT_MODE 0x025c -#define ZY7_SLCR_BOOT_MODE_PLL_BYPASS (1<<4) -#define ZY7_SLCR_BOOT_MODE_JTAG_INDEP (1<<3) +#define ZY7_SLCR_BOOT_MODE_PLL_BYPASS (1 << 4) +#define ZY7_SLCR_BOOT_MODE_JTAG_INDEP (1 << 3) #define ZY7_SLCR_BOOT_MODE_BOOTDEV_MASK 7 #define ZY7_SLCR_BOOT_MODE_BOOTDEV_JTAG 0 #define ZY7_SLCR_BOOT_MODE_BOOTDEV_QUAD_SPI 1 @@ -214,15 +214,24 @@ #define ZY7_SLCR_WDT_CLK_SEL 0x0304 #define ZY7_SLCR_PSS_IDCODE 0x0530 -#define ZY7_SLCR_PSS_IDCODE_REVISION_MASK (0xf<<28) +#define ZY7_SLCR_PSS_IDCODE_REVISION_MASK (0xfU << 28) #define ZY7_SLCR_PSS_IDCODE_REVISION_SHIFT 28 -#define ZY7_SLCR_PSS_IDCODE_FAMILY_MASK (0x7f<<21) +#define ZY7_SLCR_PSS_IDCODE_FAMILY_MASK (0x7f << 21) #define ZY7_SLCR_PSS_IDCODE_FAMILY_SHIFT 21 -#define ZY7_SLCR_PSS_IDCODE_SUB_FAMILY_MASK (0xf<<17) +#define ZY7_SLCR_PSS_IDCODE_SUB_FAMILY_MASK (0xf << 17) #define ZY7_SLCR_PSS_IDCODE_SUB_FAMILY_SHIFT 17 -#define ZY7_SLCR_PSS_IDCODE_DEVICE_MASK (0x1f<<12) +#define ZY7_SLCR_PSS_IDCODE_DEVICE_MASK (0x1f << 12) +#define ZY7_SLCR_PSS_IDCODE_DEVICE_7Z007S (0x03 << 12) +#define ZY7_SLCR_PSS_IDCODE_DEVICE_7Z010 (0x02 << 12) +#define ZY7_SLCR_PSS_IDCODE_DEVICE_7Z012S (0x1c << 12) +#define ZY7_SLCR_PSS_IDCODE_DEVICE_7Z014S (0x08 << 12) +#define ZY7_SLCR_PSS_IDCODE_DEVICE_7Z015 (0x1b << 12) +#define ZY7_SLCR_PSS_IDCODE_DEVICE_7Z020 (0x07 << 12) +#define ZY7_SLCR_PSS_IDCODE_DEVICE_7Z030 (0x0c << 12) +#define ZY7_SLCR_PSS_IDCODE_DEVICE_7Z045 (0x11 << 12) +#define ZY7_SLCR_PSS_IDCODE_DEVICE_7Z100 (0x16 << 12) #define ZY7_SLCR_PSS_IDCODE_DEVICE_SHIFT 12 -#define ZY7_SLCR_PSS_IDCODE_MNFR_ID_MASK (0x7ff<<1) +#define ZY7_SLCR_PSS_IDCODE_MNFR_ID_MASK (0x7ff << 1) #define ZY7_SLCR_PSS_IDCODE_MNFR_ID_SHIFT 1 #define ZY7_SLCR_DDR_URGENT 0x0600 @@ -233,29 +242,29 @@ #define ZY7_SLCR_DDR_DFI_STATUS 0x0620 /* MIO Pin controls */ -#define ZY7_SLCR_MIO_PIN(n) (0x0700+(n)*4) /* 0-53 */ -#define ZY7_SLCR_MIO_PIN_RCVR_DIS (1<<13) -#define ZY7_SLCR_MIO_PIN_PULLUP_EN (1<<12) -#define ZY7_SLCR_MIO_PIN_IO_TYPE_MASK (7<<9) -#define ZY7_SLCR_MIO_PIN_IO_TYPE_LVTTL (0<<9) -#define ZY7_SLCR_MIO_PIN_IO_TYPE_LVCMOS18 (1<<9) -#define ZY7_SLCR_MIO_PIN_IO_TYPE_LVCMOS25 (2<<9) -#define ZY7_SLCR_MIO_PIN_IO_TYPE_LVCMOS33 (3<<9) -#define ZY7_SLCR_MIO_PIN_IO_TYPE_HSTL (4<<9) -#define ZY7_SLCR_MIO_PIN_L2_SEL_MASK (3<<3) -#define ZY7_SLCR_MIO_PIN_L2_SEL_L3_MUX (0<<3) -#define ZY7_SLCR_MIO_PIN_L2_SEL_SRAM_NOR_CS0 (1<<3) -#define ZY7_SLCR_MIO_PIN_L2_SEL_NAND_CS (2<<3) -#define ZY7_SLCR_MIO_PIN_L2_SEL_SDIO0_PC (3<<3) -#define ZY7_SLCR_MIO_PIN_L1_SEL (1<<2) -#define ZY7_SLCR_MIO_PIN_L0_SEL (1<<1) -#define ZY7_SLCR_MIO_PIN_TRI_EN (1<<0) +#define ZY7_SLCR_MIO_PIN(n) (0x0700 + (n) * 4) /* 0-53 */ +#define ZY7_SLCR_MIO_PIN_RCVR_DIS (1 << 13) +#define ZY7_SLCR_MIO_PIN_PULLUP_EN (1 << 12) +#define ZY7_SLCR_MIO_PIN_IO_TYPE_MASK (7 << 9) +#define ZY7_SLCR_MIO_PIN_IO_TYPE_LVTTL (0 << 9) +#define ZY7_SLCR_MIO_PIN_IO_TYPE_LVCMOS18 (1 << 9) +#define ZY7_SLCR_MIO_PIN_IO_TYPE_LVCMOS25 (2 << 9) +#define ZY7_SLCR_MIO_PIN_IO_TYPE_LVCMOS33 (3 << 9) +#define ZY7_SLCR_MIO_PIN_IO_TYPE_HSTL (4 << 9) +#define ZY7_SLCR_MIO_PIN_L2_SEL_MASK (3 << 3) +#define ZY7_SLCR_MIO_PIN_L2_SEL_L3_MUX (0 << 3) +#define ZY7_SLCR_MIO_PIN_L2_SEL_SRAM_NOR_CS0 (1 << 3) +#define ZY7_SLCR_MIO_PIN_L2_SEL_NAND_CS (2 << 3) +#define ZY7_SLCR_MIO_PIN_L2_SEL_SDIO0_PC (3 << 3) +#define ZY7_SLCR_MIO_PIN_L1_SEL (1 << 2) +#define ZY7_SLCR_MIO_PIN_L0_SEL (1 << 1) +#define ZY7_SLCR_MIO_PIN_TRI_EN (1 << 0) #define ZY7_SLCR_MIO_LOOPBACK 0x0804 -#define ZY7_SLCR_MIO_LOOPBACK_I2C0_I2C1 (1<<3) -#define ZY7_SLCR_MIO_LOOPBACK_CAN0_CAN1 (1<<2) -#define ZY7_SLCR_MIO_LOOPBACK_UA0_UA1 (1<<1) -#define ZY7_SLCR_MIO_LOOPBACK_SPI0_SPI1 (1<<0) +#define ZY7_SLCR_MIO_LOOPBACK_I2C0_I2C1 (1 << 3) +#define ZY7_SLCR_MIO_LOOPBACK_CAN0_CAN1 (1 << 2) +#define ZY7_SLCR_MIO_LOOPBACK_UA0_UA1 (1 << 1) +#define ZY7_SLCR_MIO_LOOPBACK_SPI0_SPI1 (1 << 0) #define ZY7_SLCR_MIO_MST_TRI0 0x080c #define ZY7_SLCR_MIO_MST_TRI1 0x0810 #define ZY7_SLCR_SD0_WP_CD_SEL 0x0830 @@ -263,10 +272,10 @@ /* PS-PL level shifter control. */ #define ZY7_SLCR_LVL_SHFTR_EN 0x900 -#define ZY7_SLCR_LVL_SHFTR_EN_USER_LVL_IN_EN_0 (1<<3) /* PL to PS */ -#define ZY7_SLCR_LVL_SHFTR_EN_USER_LVL_OUT_EN_0 (1<<2) /* PS to PL */ -#define ZY7_SLCR_LVL_SHFTR_EN_USER_LVL_IN_EN_1 (1<<1) /* PL to PS */ -#define ZY7_SLCR_LVL_SHFTR_EN_USER_LVL_OUT_EN_1 (1<<0) /* PS to PL */ +#define ZY7_SLCR_LVL_SHFTR_EN_USER_LVL_IN_EN_0 (1 << 3) /* PL to PS */ +#define ZY7_SLCR_LVL_SHFTR_EN_USER_LVL_OUT_EN_0 (1 << 2) /* PS to PL */ +#define ZY7_SLCR_LVL_SHFTR_EN_USER_LVL_IN_EN_1 (1 << 1) /* PL to PS */ +#define ZY7_SLCR_LVL_SHFTR_EN_USER_LVL_OUT_EN_1 (1 << 0) /* PS to PL */ #define ZY7_SLCR_LVL_SHFTR_EN_ALL 0xf #define ZY7_SLCR_OCM_CFG 0x0910 @@ -289,7 +298,7 @@ #define ZY7_SLCR_DDRIOB_DRIVE_SLEW_ADDR 0x0b5c #define ZY7_SLCR_DDRIOB_DRIVE_SLEW_DATA 0x0b60 #define ZY7_SLCR_DDRIOB_DRIVE_SLEW_DIFF 0x0b64 -#define ZY7_SLCR_DDRIOB_DRIVE_SLEW_CLK 0x0b68 +#define ZY7_SLCR_DDRIOB_DRIVE_SLEW_CLK 0x0b68 #define ZY7_SLCR_DDRIOB_DDR_CTRL 0x0b6c #define ZY7_SLCR_DDRIOB_DCI_CTRL 0x0b70 #define ZY7_SLCR_DDRIOB_DCI_STATUS 0x0b74 @@ -300,7 +309,7 @@ extern void zy7_slcr_postload_pl(int en_level_shifters extern int cgem_set_ref_clk(int unit, int frequency); /* Should be consistent with SRCSEL field of FPGAx_CLK_CTRL */ -#define ZY7_PL_FCLK_SRC_IO 0 +#define ZY7_PL_FCLK_SRC_IO 0 #define ZY7_PL_FCLK_SRC_IO_ALT 1 /* ZY7_PL_FCLK_SRC_IO is b0x */ #define ZY7_PL_FCLK_SRC_ARM 2 #define ZY7_PL_FCLK_SRC_DDR 3 From owner-svn-src-all@freebsd.org Thu May 21 11:12: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 CD7432CA2D6; Thu, 21 May 2020 11:12: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 49SRmD4KwFz4nQp; Thu, 21 May 2020 11:12: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 8285DC4CB; Thu, 21 May 2020 11:12:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LBCSVu012347; Thu, 21 May 2020 11:12:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LBCSIs012346; Thu, 21 May 2020 11:12:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005211112.04LBCSIs012346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 21 May 2020 11:12:28 +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: r361327 - 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: 361327 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, 21 May 2020 11:12:28 -0000 Author: kib Date: Thu May 21 11:12:27 2020 New Revision: 361327 URL: https://svnweb.freebsd.org/changeset/base/361327 Log: MFC r361037, r361056: Fix spurious ENOTCONN from closed unix domain socket other' side. Modified: stable/12/sys/kern/uipc_socket.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/uipc_socket.c ============================================================================== --- stable/12/sys/kern/uipc_socket.c Thu May 21 06:40:51 2020 (r361326) +++ stable/12/sys/kern/uipc_socket.c Thu May 21 11:12:27 2020 (r361327) @@ -1792,8 +1792,9 @@ restart: m = so->so_rcv.sb_mb; goto dontblock; } - if ((so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING)) == 0 && - (so->so_proto->pr_flags & PR_CONNREQUIRED)) { + if ((so->so_state & (SS_ISCONNECTING | SS_ISCONNECTED | + SS_ISDISCONNECTING | SS_ISDISCONNECTED)) == 0 && + (so->so_proto->pr_flags & PR_CONNREQUIRED) != 0) { SOCKBUF_UNLOCK(&so->so_rcv); error = ENOTCONN; goto release; @@ -3814,8 +3815,17 @@ soisdisconnected(struct socket *so) { SOCK_LOCK(so); - so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING); + + /* + * There is at least one reader of so_state that does not + * acquire socket lock, namely soreceive_generic(). Ensure + * that it never sees all flags that track connection status + * cleared, by ordering the update with a barrier semantic of + * our release thread fence. + */ so->so_state |= SS_ISDISCONNECTED; + atomic_thread_fence_rel(); + so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING); if (!SOLISTENING(so)) { SOCK_UNLOCK(so); From owner-svn-src-all@freebsd.org Thu May 21 11: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 26AF32CA351; Thu, 21 May 2020 11:14:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SRpG05v5z4nfG; Thu, 21 May 2020 11:14:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2CA9C4CD; Thu, 21 May 2020 11:14:13 +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 04LBEDRh012488; Thu, 21 May 2020 11:14:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LBEDEf012487; Thu, 21 May 2020 11:14:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005211114.04LBEDEf012487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 21 May 2020 11:14:13 +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: r361328 - 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: 361328 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, 21 May 2020 11:14:14 -0000 Author: kib Date: Thu May 21 11:14:13 2020 New Revision: 361328 URL: https://svnweb.freebsd.org/changeset/base/361328 Log: MFC r361037, r361056: Fix spurious ENOTCONN from closed unix domain socket other' side. Modified: stable/11/sys/kern/uipc_socket.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/uipc_socket.c ============================================================================== --- stable/11/sys/kern/uipc_socket.c Thu May 21 11:12:27 2020 (r361327) +++ stable/11/sys/kern/uipc_socket.c Thu May 21 11:14:13 2020 (r361328) @@ -1565,8 +1565,9 @@ restart: m = so->so_rcv.sb_mb; goto dontblock; } - if ((so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING)) == 0 && - (so->so_proto->pr_flags & PR_CONNREQUIRED)) { + if ((so->so_state & (SS_ISCONNECTING | SS_ISCONNECTED | + SS_ISDISCONNECTING | SS_ISDISCONNECTED)) == 0 && + (so->so_proto->pr_flags & PR_CONNREQUIRED) != 0) { SOCKBUF_UNLOCK(&so->so_rcv); error = ENOTCONN; goto release; @@ -3516,8 +3517,17 @@ soisdisconnected(struct socket *so) * SOCKBUF_LOCK(&so->so_rcv) are the same. */ SOCKBUF_LOCK(&so->so_rcv); - so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING); + + /* + * There is at least one reader of so_state that does not + * acquire socket lock, namely soreceive_generic(). Ensure + * that it never sees all flags that track connection status + * cleared, by ordering the update with a barrier semantic of + * our release thread fence. + */ so->so_state |= SS_ISDISCONNECTED; + atomic_thread_fence_rel(); + so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING); socantrcvmore_locked(so); SOCKBUF_LOCK(&so->so_snd); sbdrop_locked(&so->so_snd, sbused(&so->so_snd)); From owner-svn-src-all@freebsd.org Thu May 21 12:22:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 879E32CDB3E for ; Thu, 21 May 2020 12:22:09 +0000 (UTC) (envelope-from 684b5780-9b5b-11ea-b56d-525400432308@service.prmsend.com) Received: from ucmailus04.sendcloud.org (ucmailus04.sendcloud.org [107.150.107.77]) by mx1.freebsd.org (Postfix) with ESMTP id 49STJX5l1Zz4tgc for ; Thu, 21 May 2020 12:22:03 +0000 (UTC) (envelope-from 684b5780-9b5b-11ea-b56d-525400432308@service.prmsend.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=service.prmsend.com; i=@service.prmsend.com; q=dns/txt; s=mail; t=1590062748; h=date : from : reply-to : to : message-id : subject : mime-version : content-type : list-unsubscribe : from; bh=L6QsjJ5TM3FEjngQXr952iCrrtYvhF+zWGtNl7Ate0Y=; b=B6txr+qrK0NG7B19IMkCsvpT2EdrrQvvMxKgxWqW552FPLx40uT3ASrivBxVdCJms4tmY X8HOnD0tVqUTDf1U6U1uGwX9T7aWLC2OwB5Nr4mrrjmmXs5M0WZxXpJMi6sGozEnjInpmWp 1FQFTZUHSULMfGESN6CND1y7+9CVv6E= Received: from sendcloud.api (Unknown [127.0.0.1]) by SendCloud Inbound Server with ESMTPA id 54CBB27F-A23A-439C-8A9C-C99DA0AA2253.1 envelope-from (authenticated bits=0); Thu, 21 May 2020 20:05:48 +0800 Date: Thu, 21 May 2020 20:05:48 +0800 (CST) From: Yolanda Tung Reply-To: Yolanda Tung To: svn-src-all@freebsd.org Message-ID: <1590062748139_99612_21652_4412.sc-10_9_40_164-inbound0$svn-src-all@freebsd.org> Subject: =?utf-8?q?Hot_sale=3A_18W_PD_Charger_---From_Andar_Technology_YolandaTung?= SC-Custom-nodeId: 183 SC-Custom-originalTaskCode: 375f337b-d900-4cae-99e6-95afef8a3cb9 SC-Custom-channelId: 180 X-SMTPAPI: X-SENDCLOUD-UUID: 1590062748139_99612_21652_4412.sc-10_9_40_164-inbound0$svn-src-all@freebsd.org X-SENDCLOUD-LOG: 1590062748139_99612_21652_4412.sc-10_9_40_164-inbound0$svn-src-all@freebsd.org#svn-src-all@freebsd.org#165128#99612#0 X-Rspamd-Queue-Id: 49STJX5l1Zz4tgc X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=service.prmsend.com header.s=mail header.b=B6txr+qr; dmarc=pass (policy=none) header.from=service.prmsend.com; spf=pass (mx1.freebsd.org: domain of 684b5780-9b5b-11ea-b56d-525400432308@service.prmsend.com designates 107.150.107.77 as permitted sender) smtp.mailfrom=684b5780-9b5b-11ea-b56d-525400432308@service.prmsend.com X-Spamd-Result: default: False [2.62 / 15.00]; HAS_REPLYTO(0.00)[yolanda_tung@andar-sz.com]; MID_CONTAINS_TO(1.00)[]; MIME_MA_MISSING_TEXT(2.00)[]; REPLYTO_DN_EQ_FROM_DN(0.00)[]; TO_DN_NONE(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:107.150.96.0/20]; DKIM_TRACE(0.00)[service.prmsend.com:+]; DMARC_POLICY_ALLOW(-0.50)[service.prmsend.com,none]; SUBJ_EXCESS_QP(1.20)[]; FORGED_SENDER(0.30)[yolanda_tung@service.prmsend.com,684b5780-9b5b-11ea-b56d-525400432308@service.prmsend.com]; RCVD_NO_TLS_LAST(0.10)[]; MIME_TRACE(0.00)[0:+,1:~]; NEURAL_HAM_SHORT(-0.51)[-0.510]; ASN(0.00)[asn:135377, ipnet:107.150.104.0/21, country:HK]; FROM_NEQ_ENVFROM(0.00)[yolanda_tung@service.prmsend.com,684b5780-9b5b-11ea-b56d-525400432308@service.prmsend.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.50)[-0.501]; R_DKIM_ALLOW(-0.20)[service.prmsend.com:s=mail]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.66)[-0.664]; MIME_GOOD(-0.10)[multipart/alternative]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; HTML_SHORT_LINK_IMG_3(0.50)[]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; MIME_HTML_ONLY(0.20)[]; RCVD_COUNT_TWO(0.00)[2]; GREYLIST(0.00)[pass,body] 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: Thu, 21 May 2020 12:22:09 -0000 From owner-svn-src-all@freebsd.org Thu May 21 12:24: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 D04342CDB4A; Thu, 21 May 2020 12:24:25 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay05.pair.com (relay05.pair.com [216.92.24.67]) (using TLSv1.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 49STMF0Wm3z4thX; Thu, 21 May 2020 12:24:24 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x8.osted.lan (ip-5-186-118-155.cgn.fibianet.dk [5.186.118.155]) by relay05.pair.com (Postfix) with ESMTP id DD3A71A23AA; Thu, 21 May 2020 08:24:23 -0400 (EDT) Received: from x8.osted.lan (localhost [127.0.0.1]) by x8.osted.lan (8.15.2/8.15.2) with ESMTPS id 04LCOMfe065684 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 21 May 2020 14:24:22 +0200 (CEST) (envelope-from pho@x8.osted.lan) Received: (from pho@localhost) by x8.osted.lan (8.15.2/8.15.2/Submit) id 04LCOM6C065683; Thu, 21 May 2020 14:24:22 +0200 (CEST) (envelope-from pho) Date: Thu, 21 May 2020 14:24:22 +0200 From: Peter Holm To: Wei Hu Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Message-ID: <20200521122422.GA65523@x8.osted.lan> References: <202005201103.04KB3xTp013965@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202005201103.04KB3xTp013965@repo.freebsd.org> X-Rspamd-Queue-Id: 49STMF0Wm3z4thX X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of pho@holm.cc has no SPF policy when checking 216.92.24.67) smtp.mailfrom=pho@holm.cc X-Spamd-Result: default: False [-0.02 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.57)[-0.567]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-0.50)[-0.498]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.06)[-0.058]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[pho@freebsd.org,pho@holm.cc]; RCVD_IN_DNSWL_LOW(-0.10)[216.92.24.67:from]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:7859, ipnet:216.92.0.0/16, country:US]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[pho@freebsd.org,pho@holm.cc]; RECEIVED_SPAMHAUS_PBL(0.00)[5.186.118.155:received] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 May 2020 12:24:25 -0000 On Wed, May 20, 2020 at 11:03:59AM +0000, Wei Hu wrote: > Author: whu > Date: Wed May 20 11:03:59 2020 > New Revision: 361275 > URL: https://svnweb.freebsd.org/changeset/base/361275 > > Log: > HyperV socket implementation for FreeBSD > > This change adds Hyper-V socket feature in FreeBSD. New socket address > family AF_HYPERV and its kernel support are added. > Found this with a syscall fuzz test: panic: page fault cpuid = 2 time = 1590050529 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe033d21d530 vpanic() at vpanic+0x182/frame 0xfffffe033d21d580 panic() at panic+0x43/frame 0xfffffe033d21d5e0 trap_fatal() at trap_fatal+0x387/frame 0xfffffe033d21d640 trap_pfault() at trap_pfault+0x99/frame 0xfffffe033d21d6a0 trap() at trap+0x2a5/frame 0xfffffe033d21d7b0 calltrap() at calltrap+0x8/frame 0xfffffe033d21d7b0 --- trap 0xc, rip = 0xffffffff80bcd3ba, rsp = 0xfffffe033d21d880, rbp = 0xfffffe033d21d910 --- _sx_xlock_hard() at _sx_xlock_hard+0x17a/frame 0xfffffe033d21d910 _sx_xlock() at _sx_xlock+0xba/frame 0xfffffe033d21d950 hvs_trans_close() at hvs_trans_close+0x42/frame 0xfffffe033d21d970 soclose() at soclose+0x161/frame 0xfffffe033d21d9e0 _fdrop() at _fdrop+0x1a/frame 0xfffffe033d21da00 closef() at closef+0x1db/frame 0xfffffe033d21da90 closefp() at closefp+0x96/frame 0xfffffe033d21dad0 amd64_syscall() at amd64_syscall+0x159/frame 0xfffffe033d21dbf0 fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe033d21dbf0 --- syscall (6, FreeBSD ELF64, sys_close), rip = 0x8004283ca, rsp = 0x7fffffffe328, rbp = 0x7fffffffe460 --- https://people.freebsd.org/~pho/stress/log/setsockopt2-2.txt Could this be yours? - Peter From owner-svn-src-all@freebsd.org Thu May 21 12:43: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 0031B2CE4F9; Thu, 21 May 2020 12:43: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 49STnL6Cf3z4vhH; Thu, 21 May 2020 12:43:34 +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 D0805D859; Thu, 21 May 2020 12:43:34 +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 04LChYCn069800; Thu, 21 May 2020 12:43:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LChYQj069799; Thu, 21 May 2020 12:43:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005211243.04LChYQj069799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 21 May 2020 12:43:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r361329 - releng/11.4/sys/kern X-SVN-Group: releng X-SVN-Commit-Author: kib X-SVN-Commit-Paths: releng/11.4/sys/kern X-SVN-Commit-Revision: 361329 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, 21 May 2020 12:43:35 -0000 Author: kib Date: Thu May 21 12:43:34 2020 New Revision: 361329 URL: https://svnweb.freebsd.org/changeset/base/361329 Log: MFC r361037, r361056: Fix spurious ENOTCONN from closed unix domain socket other' side. Approved by: re (gjb) Modified: releng/11.4/sys/kern/uipc_socket.c Directory Properties: releng/11.4/ (props changed) Modified: releng/11.4/sys/kern/uipc_socket.c ============================================================================== --- releng/11.4/sys/kern/uipc_socket.c Thu May 21 11:14:13 2020 (r361328) +++ releng/11.4/sys/kern/uipc_socket.c Thu May 21 12:43:34 2020 (r361329) @@ -1565,8 +1565,9 @@ restart: m = so->so_rcv.sb_mb; goto dontblock; } - if ((so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING)) == 0 && - (so->so_proto->pr_flags & PR_CONNREQUIRED)) { + if ((so->so_state & (SS_ISCONNECTING | SS_ISCONNECTED | + SS_ISDISCONNECTING | SS_ISDISCONNECTED)) == 0 && + (so->so_proto->pr_flags & PR_CONNREQUIRED) != 0) { SOCKBUF_UNLOCK(&so->so_rcv); error = ENOTCONN; goto release; @@ -3516,8 +3517,17 @@ soisdisconnected(struct socket *so) * SOCKBUF_LOCK(&so->so_rcv) are the same. */ SOCKBUF_LOCK(&so->so_rcv); - so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING); + + /* + * There is at least one reader of so_state that does not + * acquire socket lock, namely soreceive_generic(). Ensure + * that it never sees all flags that track connection status + * cleared, by ordering the update with a barrier semantic of + * our release thread fence. + */ so->so_state |= SS_ISDISCONNECTED; + atomic_thread_fence_rel(); + so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING); socantrcvmore_locked(so); SOCKBUF_LOCK(&so->so_snd); sbdrop_locked(&so->so_snd, sbused(&so->so_snd)); From owner-svn-src-all@freebsd.org Thu May 21 12:59: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 947FF2CF006; Thu, 21 May 2020 12:59:46 +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 49SV816b3Jz3SBJ; Thu, 21 May 2020 12:59:45 +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 04LCxhph016513; Thu, 21 May 2020 05:59:43 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04LCxh0C016512; Thu, 21 May 2020 05:59:43 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202005211259.04LCxh0C016512@gndrsh.dnsmgr.net> Subject: Re: svn commit: r361318 - head/bin/ls In-Reply-To: <202005210350.04L3ouOR031524@repo.freebsd.org> To: Kyle Evans Date: Thu, 21 May 2020 05:59:43 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49SV816b3Jz3SBJ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, 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: Thu, 21 May 2020 12:59:46 -0000 > Author: kevans > Date: Thu May 21 03:50:56 2020 > New Revision: 361318 > URL: https://svnweb.freebsd.org/changeset/base/361318 > > Log: > ls: fix a --color regression from r337956 > > The regression is in-fact that I flipped the default from never to auto. The > incorrect impression was based on an alias that I failed to notice, > installed by the Linux distribution that I used for testing compatibility > here. Users that want the old default should be doing so with a shell alias > as is done elsewhere, rather than making this decision in ls(1). > > Many thanks to rgrimes for pointing out the alias that I clearly overlooked > that resulted in this; if you despised colors in your terminal from this, > consider buying him a beer at the next venue that you see him at. Thanks Kyle, but this is likely to get me more rocks than beers :-) > > MFC after: 1 week > Relnotes: yes > > Modified: > head/bin/ls/ls.1 > head/bin/ls/ls.c > > Modified: head/bin/ls/ls.1 > ============================================================================== > --- head/bin/ls/ls.1 Thu May 21 03:33:20 2020 (r361317) > +++ head/bin/ls/ls.1 Thu May 21 03:50:56 2020 (r361318) > @@ -32,7 +32,7 @@ > .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 > .\" $FreeBSD$ > .\" > -.Dd August 18, 2018 > +.Dd May 20, 2020 > .Dt LS 1 > .Os > .Sh NAME > @@ -216,8 +216,8 @@ Output colored escape sequences based on > .Ar when , > which may be set to either > .Cm always , > -.Cm auto > -(default), or > +.Cm auto , > +or > .Cm never . > .Pp > .Cm always > @@ -252,6 +252,12 @@ environment variable is set and not empty. > .Pp > .Cm never > will disable color regardless of environment variables. > +.Cm never > +is the default when neither > +.Fl -color > +nor > +.Fl G > +is specified. > .Pp > For compatibility with GNU coreutils, > .Nm > > Modified: head/bin/ls/ls.c > ============================================================================== > --- head/bin/ls/ls.c Thu May 21 03:33:20 2020 (r361317) > +++ head/bin/ls/ls.c Thu May 21 03:50:56 2020 (r361318) > @@ -152,7 +152,7 @@ static int f_timesort; /* sort by time vice name */ > int f_type; /* add type character for non-regular files */ > static int f_whiteout; /* show whiteout entries */ > #ifdef COLORLS > - int colorflag = COLORFLAG_AUTO; /* passed in colorflag */ > + int colorflag = COLORFLAG_NEVER; /* passed in colorflag */ > int f_color; /* add type in color for non-regular files */ > bool explicitansi; /* Explicit ANSI sequences, no termcap(5) */ > char *ansi_bgcol; /* ANSI sequence to set background colour */ > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu May 21 13:01: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 6FDD32CEDFB; Thu, 21 May 2020 13:01:25 +0000 (UTC) (envelope-from weh@microsoft.com) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sg2apc01on0718.outbound.protection.outlook.com [IPv6:2a01:111:f400:febd::718]) (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 49SV9w5LFNz3Sbf; Thu, 21 May 2020 13:01:24 +0000 (UTC) (envelope-from weh@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I2XL207ig6As3puYOhP2jmDBLF1N+WG8yi+GPf/tJDdF05X4A/oh3jf9jMTekAz6Sg73CM18J1bz8feO+LF1KQSROf8LPlzgSrj2urnPOHkR+nWzWKSeqW7wN7ZNQXK1HsooMpSyLSoCf2yXV646W2hfZBe/CoJeDDz9doQeq+HhsZJcq88QQET+KBr5gHkzL+NNIA5v/cbwZ7BUmdjrmF6WENjV8sE6oqIeLk+TbcuNH3BdYECk08XaKyfFhFLuU9y1tIAoBwn+UiVCKcmnZ1wYGrKDO7ZjRUfUC7TliQbgK45nCPBtZsp20UKSi9xiJg34w1Ctk6AXpqC7wNLlPg== 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=KI0v1sWm4JR1QHEBzZwAPuIy0lI0aj5iJOQ2nVSlhEY=; b=DIvlH0wLDQrTAct1Co2WZDMN2Fy0rIdzXJiyFyf7xZciSYcnKmZsGdTxExjLxh9YyXv2iNfR3VIf6UMETMHF6crf4ek7h2uPkj1uX6NVtDKb8HmgvRdgxn+W7jMVGKZ9MJLftkPbxnCO3Rbpwji8iZWxk6kFTV9MsgO3ZAdLXrhShj+qwSsb/sbl5JOCgNFtZMH0e4hkULiXr1Prr8lEWoJaPSQriEJUeMwN9MVt8MW7hyAjFtf9SGJmVplpqBlwQKHBKWbWSdUjltBWY82//VIRUM2yFPS8nep5FJb09SMuepEOJ+yIcmh5gY++LBrfzXDeJ0RlaD5/rUSCH/O/PQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none Received: from SG2P153MB0377.APCP153.PROD.OUTLOOK.COM (2603:1096:0:1::15) by SG2P153MB0255.APCP153.PROD.OUTLOOK.COM (2603:1096:4:ae::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.7; Thu, 21 May 2020 13:01:19 +0000 Received: from SG2P153MB0377.APCP153.PROD.OUTLOOK.COM ([fe80::798e:2eb8:f18e:7a0]) by SG2P153MB0377.APCP153.PROD.OUTLOOK.COM ([fe80::798e:2eb8:f18e:7a0%7]) with mapi id 15.20.3045.005; Thu, 21 May 2020 13:01:19 +0000 From: Wei Hu To: Peter Holm , Wei Hu CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: RE: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Thread-Topic: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Thread-Index: AQHWLpZljJNzTG7+okeOAs3l3mz20qiyeFYAgAAJc+A= Date: Thu, 21 May 2020 13:01:18 +0000 Message-ID: References: <202005201103.04KB3xTp013965@repo.freebsd.org> <20200521122422.GA65523@x8.osted.lan> In-Reply-To: <20200521122422.GA65523@x8.osted.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-05-21T13:01:17Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=9a22f5a9-5911-4d80-9d5f-05d7c2283187; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0 x-originating-ip: [2404:f801:9000:18:6fed::496b] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: c6041649-9aaf-44f4-c52e-08d7fd870dfc x-ms-traffictypediagnostic: SG2P153MB0255: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:277; x-forefront-prvs: 041032FF37 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: YRsPjxi17o6umhxzl6JRYLSfs+d5PptaB/kCrlSIMoeIdo2dP+hkpQaVrxW5MwhK+nvPFjaoQOOFcoj9+x1EkmQqw+f7ajVgCxuA/jtCQNkARZulxyW1A8Hd7K7GQ1vLPvCyw+jWYOFdK8jb0j04AIQpY62KNCM1dmcGq1eC0GpGiSfhIMbi6tpG0KchrD5KBqG5Jx2f0S7u4f+iXh4AMk8TJvHyFVYlvgVY9Pi8MUA8AKmes5vAzsijPs4SFe2pFtc6oC5/giXskQYlCGy9RH+bDZWIak3KhRiNHyeNQzHAd6QWu06JyhWKy7bnNnAc49q/gL29EB0cUDcUSSK6OH7B9LXGfjQZivNx+nXrpl2yeO6i/sTArIBEo40h5zOXiUUhSRBPOpMRwmJ3qm2XY+YJNVpvInfiwBpHS7EcuoZEP3dAA+ZliDBSr6f21AipLkehGhsg+mqqbaN3E15b6QJSJT9+V/bnjO3qsWvqXQEnhvMXwF6wGKj504r1+xI3 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SG2P153MB0377.APCP153.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(396003)(39860400002)(136003)(376002)(366004)(86362001)(2906002)(71200400001)(83080400001)(450100002)(4326008)(82950400001)(82960400001)(66446008)(66556008)(66476007)(66946007)(64756008)(53546011)(6506007)(478600001)(33656002)(966005)(110136005)(52536014)(8936002)(76116006)(8676002)(5660300002)(316002)(54906003)(7696005)(9686003)(10290500003)(8990500004)(186003)(55016002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: j1S+IsB3WK3t5VKs+Oij3zzUfMwdbO+8jSN0jTAMP7npbcqtrwLoZ0zp8Zk5ZBPCwYIgV//I3WUn5ngTJKcQItQPBbREND8W6LtHxJUkL05hEr4ig0mKRRSkPegNXK1+C+OjTDxjgBVIdMsVafNcyqbA9KNzeOGRhbbLdCalMZ87PUiQPGw31FN2f3frYEBUBTrXHXGWwqAJuPwiBwBtiMS1FqX7hsdB8JrkgkL+rdTfWIvxEgSLq1mjQEEICOvZ4SgIdQoqCh1XKJY4JD+RRtOHBuMOGqp1rEtB7+mQrxBEKFrllnYbJwBKd07xZZRNXN8UbkDymPp5/F3jgczbK1wOiWShNx1v1nYArFb9R27e5/4ChysTKDWP5ISbjzXNubgurO0/wJrs6973R6Wg0GAC3ITW9BnTLotzU55cCCxlBmOF20IX0qOinHBzAMCUY8w0Iu+TraWo+nuDtHduLhCU37Gd/c2fK6TV9xmHoM8FLQ9J0rJxxWawYj1/M/Pk/K7imep5ZcCmVt1oYOSuog== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: c6041649-9aaf-44f4-c52e-08d7fd870dfc X-MS-Exchange-CrossTenant-originalarrivaltime: 21 May 2020 13:01:18.8208 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: cUbauwh9UXqGv4UNmvD1jR2B1NPREphk8nTcMsuCNmbjfyX5POeNIJJVeeu9LPwzcmeBilhSlxokYBRkEkCvmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2P153MB0255 X-Rspamd-Queue-Id: 49SV9w5LFNz3Sbf X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:8075, ipnet:2a01:111:f000::/36, 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: Thu, 21 May 2020 13:01:25 -0000 > -----Original Message----- > From: Peter Holm > Sent: Thursday, May 21, 2020 8:24 PM > To: Wei Hu > Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src- > head@freebsd.org > Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock > dev/hyperv/include dev/hyperv/vmbus modules/hyperv > modules/hyperv/hvsock sys >=20 > On Wed, May 20, 2020 at 11:03:59AM +0000, Wei Hu wrote: > > Author: whu > > Date: Wed May 20 11:03:59 2020 > > New Revision: 361275 > > URL: > https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fsvnwe= b > .freebsd.org%2Fchangeset%2Fbase%2F361275&data=3D02%7C01%7Cweh% > 40microsoft.com%7C61c524b5022b47b2c4e108d7fd81e75f%7C72f988bf86f14 > 1af91ab2d7cd011db47%7C1%7C0%7C637256606689750658&sdata=3Dmw > 4IXP3DnxICnK4U%2F8MzLbvMAzCuxih2f0waDyMSCTE%3D&reserved=3D0 > > > > Log: > > HyperV socket implementation for FreeBSD > > > > This change adds Hyper-V socket feature in FreeBSD. New socket addres= s > > family AF_HYPERV and its kernel support are added. > > >=20 > Found this with a syscall fuzz test: >=20 > panic: page fault > cpuid =3D 2 > time =3D 1590050529 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xfffffe033d21d530 > vpanic() at vpanic+0x182/frame 0xfffffe033d21d580 > panic() at panic+0x43/frame 0xfffffe033d21d5e0 > trap_fatal() at trap_fatal+0x387/frame 0xfffffe033d21d640 > trap_pfault() at trap_pfault+0x99/frame 0xfffffe033d21d6a0 > trap() at trap+0x2a5/frame 0xfffffe033d21d7b0 > calltrap() at calltrap+0x8/frame 0xfffffe033d21d7b0 > --- trap 0xc, rip =3D 0xffffffff80bcd3ba, rsp =3D 0xfffffe033d21d880, rbp= =3D > 0xfffffe033d21d910 --- > _sx_xlock_hard() at _sx_xlock_hard+0x17a/frame 0xfffffe033d21d910 > _sx_xlock() at _sx_xlock+0xba/frame 0xfffffe033d21d950 > hvs_trans_close() at hvs_trans_close+0x42/frame 0xfffffe033d21d970 > soclose() at soclose+0x161/frame 0xfffffe033d21d9e0 > _fdrop() at _fdrop+0x1a/frame 0xfffffe033d21da00 > closef() at closef+0x1db/frame 0xfffffe033d21da90 > closefp() at closefp+0x96/frame 0xfffffe033d21dad0 > amd64_syscall() at amd64_syscall+0x159/frame 0xfffffe033d21dbf0 > fast_syscall_common() at fast_syscall_common+0x101/frame > 0xfffffe033d21dbf0 > --- syscall (6, FreeBSD ELF64, sys_close), rip =3D 0x8004283ca, rsp =3D 0= x7fffffffe328, > rbp =3D 0x7fffffffe460 --- >=20 > https://nam06.safelinks.protection.outlook.com/?url=3Dhttps:%2F%2Fpeople.= free > bsd.org%2F~pho%2Fstress%2Flog%2Fsetsockopt2- > 2.txt&data=3D02%7C01%7Cweh%40microsoft.com%7C61c524b5022b47b2c > 4e108d7fd81e75f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63 > 7256606689750658&sdata=3DRuBmWrBv7lGnhF2IHZ5NOP2rmV0c%2BJXuk > RZl260KSIw%3D&reserved=3D0 >=20 > Could this be yours? Yes. Looks the lock was not initialized. The lock only gets initialized whe= n it is running on HyperV. This type of socket only works on HyperV.=20 How to reproduce it? Was it on HyperV? I am not sure how it can enter this = state. Wei From owner-svn-src-all@freebsd.org Thu May 21 13:02: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 23DF72CF380; Thu, 21 May 2020 13:02:21 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-qv1-f66.google.com (mail-qv1-f66.google.com [209.85.219.66]) (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 49SVC061f3z3StQ; Thu, 21 May 2020 13:02:20 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-qv1-f66.google.com with SMTP id z5so3009730qvw.4; Thu, 21 May 2020 06:02:20 -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=OjMwOs/Lvs1aikdqR/RwTzkREBYkgubMU4hxEdaoVGc=; b=oST/RD4RhoUIHxhvU23ns/EMyVsvF0jmwE24VCL6E18MI0B9zKEni3jt1/M0DD53it eNSBJR5YjM17qKZ/f4DyhH/s5k/XC0q18xfBF7VNR1AL9S6MIeldcK5PYeuD4gyoXhfk y7e0OjT8Y0Rl2eho84hJdEFNOtRW2ydUd54WA2LMZJNl6SZQ7wA1VaPRblumCEpZsTva I3Yx3eC3dGuEFgzh3MZsnDvGNWc79rcmdiDVl/LSheWL+160m7avQudTxWkO8ZPHZuM7 6bgadtkZNF1yzKYVblp+zdQR1Cr+KGy4zu49QBMDg9PRbPkYxrw8aqJu0booEPw6gulT oSmA== X-Gm-Message-State: AOAM530fLs6jNUot/Fsp1helumlPg45oe4tmP8TN3hLJtod+7svMGBxA DZ0Ikt9snpkUr7uYTCZ3h+4J+OTXYb4ugSK0gfKh+F2Q X-Google-Smtp-Source: ABdhPJwEbyC1XV22YmR21smLm/wF/WCncyR+bgE09wWWWrdVEkhqGFNlBD5XlXHCjyUwSk4OmOv1Ghe6xsLJZef0qZI= X-Received: by 2002:ad4:58cb:: with SMTP id dh11mr5857329qvb.211.1590066139393; Thu, 21 May 2020 06:02:19 -0700 (PDT) MIME-Version: 1.0 References: <202005202208.04KM8QPA020707@repo.freebsd.org> In-Reply-To: <202005202208.04KM8QPA020707@repo.freebsd.org> From: Antoine Brodin Date: Thu, 21 May 2020 15:02:07 +0200 Message-ID: Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys To: Konstantin Belousov Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49SVC061f3z3StQ 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, 21 May 2020 13:02:21 -0000 On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: > > Author: kib > Date: Wed May 20 22:08:26 2020 > New Revision: 361303 > URL: https://svnweb.freebsd.org/changeset/base/361303 > > Log: > Change the samantic of struct link_map l_addr member. > > It previously returned the object map base address, while all other > ELF operating systems return load offset, i.e. the difference between > map base and the link base. > > Explain the meaning of the field in the man page. > > Stop filling the mips-only l_offs member, which is apparently unused. > > PR: 246561 > Requested by: Damjan Jovanovic > Reviewed by: emaste, jhb, cem (previous version) > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D24918 > > Modified: > head/lib/libc/gen/dlinfo.3 > head/libexec/rtld-elf/rtld.c > head/sys/sys/link_elf.h Hi, After this commit, some ports fail to build with signal 11. For instance lang/perl5.30 fails to build with default options (DTRACE on) Disabling the DTRACE option makes it able to build again. Cheers, Antoine From owner-svn-src-all@freebsd.org Thu May 21 13: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 6795F2CF951; Thu, 21 May 2020 13:22:20 +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 49SVf425Vkz3Tpk; Thu, 21 May 2020 13:22:20 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.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: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 3DD6219184; Thu, 21 May 2020 13:22:20 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f175.google.com with SMTP id 190so7191651qki.1; Thu, 21 May 2020 06:22:20 -0700 (PDT) X-Gm-Message-State: AOAM533L+q3akYZH8Hm3AktGLTYBVsIDRSvomesUt8MasgJbIOJ2uUKn RkOg5L4Xy3Dfj7yiAeclcOm2lV1zXf4gGh0H/UI= X-Google-Smtp-Source: ABdhPJwPNlOz8DvXWrAubV9uWBalHosO8xx70hqb4oCgaVHzKhEgqVLMNV5wj85z1FNAMVQfrODDR2Ko09SPT9Wp6MQ= X-Received: by 2002:a37:9f44:: with SMTP id i65mr4153785qke.103.1590067339676; Thu, 21 May 2020 06:22:19 -0700 (PDT) MIME-Version: 1.0 References: <202005210350.04L3ouOR031524@repo.freebsd.org> <202005211259.04LCxh0C016512@gndrsh.dnsmgr.net> In-Reply-To: <202005211259.04LCxh0C016512@gndrsh.dnsmgr.net> From: Kyle Evans Date: Thu, 21 May 2020 08:22:07 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361318 - head/bin/ls To: "Rodney W. Grimes" 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, 21 May 2020 13:22:20 -0000 On Thu, May 21, 2020 at 7:59 AM Rodney W. Grimes wrote: > > > Author: kevans > > Date: Thu May 21 03:50:56 2020 > > New Revision: 361318 > > URL: https://svnweb.freebsd.org/changeset/base/361318 > > > > Log: > > ls: fix a --color regression from r337956 > > > > The regression is in-fact that I flipped the default from never to auto. The > > incorrect impression was based on an alias that I failed to notice, > > installed by the Linux distribution that I used for testing compatibility > > here. Users that want the old default should be doing so with a shell alias > > as is done elsewhere, rather than making this decision in ls(1). > > > > Many thanks to rgrimes for pointing out the alias that I clearly overlooked > > that resulted in this; if you despised colors in your terminal from this, > > consider buying him a beer at the next venue that you see him at. > > Thanks Kyle, but this is likely to get me more rocks than beers :-) > FWIW- I received a not-insignificant number of valid complaints about the original default change because default color schemes are hard, and continued to receive an insignificant number of complaints as recent as a couple months ago (~2 years after the change?). This is considerably more flack than I expect to receive from other controversial proposals I've made and it was based on a fundamental misunderstanding of coreutils. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Thu May 21 13:39: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 745C92D854F; Thu, 21 May 2020 13:39:27 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay05.pair.com (relay05.pair.com [216.92.24.67]) (using TLSv1.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 49SW1p3hdjz3VhP; Thu, 21 May 2020 13:39:26 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x8.osted.lan (ip-5-186-118-155.cgn.fibianet.dk [5.186.118.155]) by relay05.pair.com (Postfix) with ESMTP id F17BF1A2D63; Thu, 21 May 2020 09:39:24 -0400 (EDT) Received: from x8.osted.lan (localhost [127.0.0.1]) by x8.osted.lan (8.15.2/8.15.2) with ESMTPS id 04LDdOLr066570 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 21 May 2020 15:39:24 +0200 (CEST) (envelope-from pho@x8.osted.lan) Received: (from pho@localhost) by x8.osted.lan (8.15.2/8.15.2/Submit) id 04LDdO7Q066569; Thu, 21 May 2020 15:39:24 +0200 (CEST) (envelope-from pho) Date: Thu, 21 May 2020 15:39:24 +0200 From: Peter Holm To: Wei Hu Cc: Wei Hu , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys Message-ID: <20200521133924.GA66412@x8.osted.lan> References: <202005201103.04KB3xTp013965@repo.freebsd.org> <20200521122422.GA65523@x8.osted.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 49SW1p3hdjz3VhP X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of pho@holm.cc has no SPF policy when checking 216.92.24.67) smtp.mailfrom=pho@holm.cc X-Spamd-Result: default: False [1.09 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.66)[-0.658]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.68)[0.680]; NEURAL_HAM_LONG(-0.03)[-0.033]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[pho@freebsd.org,pho@holm.cc]; RCVD_IN_DNSWL_LOW(-0.10)[216.92.24.67:from]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:7859, ipnet:216.92.0.0/16, country:US]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[pho@freebsd.org,pho@holm.cc]; RECEIVED_SPAMHAUS_PBL(0.00)[5.186.118.155:received] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 21 May 2020 13:39:27 -0000 On Thu, May 21, 2020 at 01:01:18PM +0000, Wei Hu wrote: > > -----Original Message----- > > From: Peter Holm > > Sent: Thursday, May 21, 2020 8:24 PM > > To: Wei Hu > > Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src- > > head@freebsd.org > > Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock > > dev/hyperv/include dev/hyperv/vmbus modules/hyperv > > modules/hyperv/hvsock sys > > > > On Wed, May 20, 2020 at 11:03:59AM +0000, Wei Hu wrote: > > > Author: whu > > > Date: Wed May 20 11:03:59 2020 > > > New Revision: 361275 > > > URL: > > https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsvnweb > > .freebsd.org%2Fchangeset%2Fbase%2F361275&data=02%7C01%7Cweh% > > 40microsoft.com%7C61c524b5022b47b2c4e108d7fd81e75f%7C72f988bf86f14 > > 1af91ab2d7cd011db47%7C1%7C0%7C637256606689750658&sdata=mw > > 4IXP3DnxICnK4U%2F8MzLbvMAzCuxih2f0waDyMSCTE%3D&reserved=0 > > > > > > Log: > > > HyperV socket implementation for FreeBSD > > > > > > This change adds Hyper-V socket feature in FreeBSD. New socket address > > > family AF_HYPERV and its kernel support are added. > > > > > > > Found this with a syscall fuzz test: > > > > panic: page fault > > cpuid = 2 > > time = 1590050529 > > KDB: stack backtrace: > > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > > 0xfffffe033d21d530 > > vpanic() at vpanic+0x182/frame 0xfffffe033d21d580 > > panic() at panic+0x43/frame 0xfffffe033d21d5e0 > > trap_fatal() at trap_fatal+0x387/frame 0xfffffe033d21d640 > > trap_pfault() at trap_pfault+0x99/frame 0xfffffe033d21d6a0 > > trap() at trap+0x2a5/frame 0xfffffe033d21d7b0 > > calltrap() at calltrap+0x8/frame 0xfffffe033d21d7b0 > > --- trap 0xc, rip = 0xffffffff80bcd3ba, rsp = 0xfffffe033d21d880, rbp = > > 0xfffffe033d21d910 --- > > _sx_xlock_hard() at _sx_xlock_hard+0x17a/frame 0xfffffe033d21d910 > > _sx_xlock() at _sx_xlock+0xba/frame 0xfffffe033d21d950 > > hvs_trans_close() at hvs_trans_close+0x42/frame 0xfffffe033d21d970 > > soclose() at soclose+0x161/frame 0xfffffe033d21d9e0 > > _fdrop() at _fdrop+0x1a/frame 0xfffffe033d21da00 > > closef() at closef+0x1db/frame 0xfffffe033d21da90 > > closefp() at closefp+0x96/frame 0xfffffe033d21dad0 > > amd64_syscall() at amd64_syscall+0x159/frame 0xfffffe033d21dbf0 > > fast_syscall_common() at fast_syscall_common+0x101/frame > > 0xfffffe033d21dbf0 > > --- syscall (6, FreeBSD ELF64, sys_close), rip = 0x8004283ca, rsp = 0x7fffffffe328, > > rbp = 0x7fffffffe460 --- > > > > https://nam06.safelinks.protection.outlook.com/?url=https:%2F%2Fpeople.free > > bsd.org%2F~pho%2Fstress%2Flog%2Fsetsockopt2- > > 2.txt&data=02%7C01%7Cweh%40microsoft.com%7C61c524b5022b47b2c > > 4e108d7fd81e75f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63 > > 7256606689750658&sdata=RuBmWrBv7lGnhF2IHZ5NOP2rmV0c%2BJXuk > > RZl260KSIw%3D&reserved=0 > > > > Could this be yours? > > > Yes. Looks the lock was not initialized. The lock only gets initialized when it is running > on HyperV. This type of socket only works on HyperV. > > How to reproduce it? Was it on HyperV? I am not sure how it can enter this state. > > Wei The test is syscall() fuzzing, which typically flushes out missing parameter validations. This was *not* run on HyperV. You can find the test case here: https://svnweb.freebsd.org/base/user/pho/stress2/misc/setsockopt2.sh - Peter From owner-svn-src-all@freebsd.org Thu May 21 13:42: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 600082D87AD; Thu, 21 May 2020 13:42:01 +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 49SW4m5bzYz3Wdg; Thu, 21 May 2020 13:42:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 04LDfrIp076844 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 21 May 2020 16:41:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 04LDfrIp076844 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 04LDfr8Z076843; Thu, 21 May 2020 16:41:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 21 May 2020 16:41:52 +0300 From: Konstantin Belousov To: Antoine Brodin Cc: jhb@freebsd.org, markj@freebsd.org, src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys Message-ID: <20200521134152.GE64045@kib.kiev.ua> References: <202005202208.04KM8QPA020707@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 49SW4m5bzYz3Wdg X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, 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: Thu, 21 May 2020 13:42:01 -0000 On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: > On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: > > > > Author: kib > > Date: Wed May 20 22:08:26 2020 > > New Revision: 361303 > > URL: https://svnweb.freebsd.org/changeset/base/361303 > > > > Log: > > Change the samantic of struct link_map l_addr member. > > > > It previously returned the object map base address, while all other > > ELF operating systems return load offset, i.e. the difference between > > map base and the link base. > > > > Explain the meaning of the field in the man page. > > > > Stop filling the mips-only l_offs member, which is apparently unused. > > > > PR: 246561 > > Requested by: Damjan Jovanovic > > Reviewed by: emaste, jhb, cem (previous version) > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > Differential revision: https://reviews.freebsd.org/D24918 > > > > Modified: > > head/lib/libc/gen/dlinfo.3 > > head/libexec/rtld-elf/rtld.c > > head/sys/sys/link_elf.h > > Hi, > > After this commit, some ports fail to build with signal 11. > For instance lang/perl5.30 fails to build with default options (DTRACE on) > Disabling the DTRACE option makes it able to build again. > I see, thank you for reporting. So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes that l_addr is the base, not relocbase. Mark, was dofhp_addr initialization changed comparing to Solaris ? From owner-svn-src-all@freebsd.org Thu May 21 13:46: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 701F42D8A58; Thu, 21 May 2020 13:46:31 +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 49SW9z2LlKz3Wnv; Thu, 21 May 2020 13:46:31 +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 4BBF4E1FD; Thu, 21 May 2020 13:46:31 +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 04LDkVOj007202; Thu, 21 May 2020 13:46:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LDkVuV007201; Thu, 21 May 2020 13:46:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005211346.04LDkVuV007201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 21 May 2020 13:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361330 - head/lib/libprocstat X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/lib/libprocstat X-SVN-Commit-Revision: 361330 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, 21 May 2020 13:46:31 -0000 Author: avg Date: Thu May 21 13:46:30 2020 New Revision: 361330 URL: https://svnweb.freebsd.org/changeset/base/361330 Log: libprocstat: fix reading of file descriptor table via kvm This seems to have been broken since r247602 (from year 2013!). Can be easily tested with fstat -N /boot/kernel/kernel -M /var/crash/vmcore.last MFC after: 1 week Sponsored by: Panzura Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Thu May 21 12:43:34 2020 (r361329) +++ head/lib/libprocstat/libprocstat.c Thu May 21 13:46:30 2020 (r361330) @@ -467,7 +467,7 @@ procstat_getfiles_kvm(struct procstat *procstat, struc vm_map_entry_t entryp; vm_object_t objp; struct vnode *vp; - struct file **ofiles; + struct filedescent *ofiles; struct filestat *entry; struct filestat_list *head; kvm_t *kd; @@ -554,25 +554,25 @@ procstat_getfiles_kvm(struct procstat *procstat, struc } nfiles = filed.fd_lastfile + 1; - ofiles = malloc(nfiles * sizeof(struct file *)); + ofiles = malloc(nfiles * sizeof(struct filedescent)); if (ofiles == NULL) { - warn("malloc(%zu)", nfiles * sizeof(struct file *)); + warn("malloc(%zu)", nfiles * sizeof(struct filedescent)); goto do_mmapped; } if (!kvm_read_all(kd, (unsigned long)filed.fd_ofiles, ofiles, - nfiles * sizeof(struct file *))) { + nfiles * sizeof(struct filedescent))) { warnx("cannot read file structures at %p", (void *)filed.fd_ofiles); free(ofiles); goto do_mmapped; } for (i = 0; i <= filed.fd_lastfile; i++) { - if (ofiles[i] == NULL) + if (ofiles[i].fde_file == NULL) continue; - if (!kvm_read_all(kd, (unsigned long)ofiles[i], &file, + if (!kvm_read_all(kd, (unsigned long)ofiles[i].fde_file, &file, sizeof(struct file))) { warnx("can't read file %d at %p", i, - (void *)ofiles[i]); + (void *)ofiles[i].fde_file); continue; } switch (file.f_type) { From owner-svn-src-all@freebsd.org Thu May 21 14:39: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 70A292DAD32; Thu, 21 May 2020 14:39:01 +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 49SXLY2LG0z3bDy; Thu, 21 May 2020 14:39:01 +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 4B766ED36; Thu, 21 May 2020 14:39:01 +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 04LEd1TK038266; Thu, 21 May 2020 14:39:01 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LEd0G0038264; Thu, 21 May 2020 14:39:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005211439.04LEd0G0038264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 May 2020 14:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361331 - head/bin/ls X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/bin/ls X-SVN-Commit-Revision: 361331 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, 21 May 2020 14:39:01 -0000 Author: kevans Date: Thu May 21 14:39:00 2020 New Revision: 361331 URL: https://svnweb.freebsd.org/changeset/base/361331 Log: ls(1): actually restore proper behavior Highlights: - CLICOLOR in the environment should imply --color=auto to maintain compatibility with historical behavior - -G should set CLICOLOR and imply --color=auto The manpage has been updated to draw the connection between -G and --color; the former is in-fact a sort of compromise between --color=always and --color=auto, where we'll output color regardless of the environment lacking CLICOLOR/COLORTERM assuming stdout is a tty. X-MFC-With: r361318 Modified: head/bin/ls/ls.1 head/bin/ls/ls.c Modified: head/bin/ls/ls.1 ============================================================================== --- head/bin/ls/ls.1 Thu May 21 13:46:30 2020 (r361330) +++ head/bin/ls/ls.1 Thu May 21 14:39:00 2020 (r361331) @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd May 20, 2020 +.Dd May 21, 2020 .Dt LS 1 .Os .Sh NAME @@ -135,7 +135,8 @@ This option is equivalent to defining .Ev CLICOLOR or .Ev COLORTERM -in the environment. +in the environment and setting +.Fl -color Ns = Ns Ar auto . (See below.) This functionality can be compiled out by removing the definition of .Ev COLORLS . Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Thu May 21 13:46:30 2020 (r361330) +++ head/bin/ls/ls.c Thu May 21 14:39:00 2020 (r361331) @@ -265,6 +265,13 @@ main(int argc, char *argv[]) fts_options = FTS_PHYSICAL; if (getenv("LS_SAMESORT")) f_samesort = 1; + + /* + * For historical compatibility, we'll use our autodetection if CLICOLOR + * is set. + */ + if (getenv("CLICOLOR")) + colorflag = COLORFLAG_AUTO; while ((ch = getopt_long(argc, argv, "+1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,", long_opts, NULL)) != -1) { @@ -342,7 +349,13 @@ main(int argc, char *argv[]) f_slash = 0; break; case 'G': + /* + * We both set CLICOLOR here and set colorflag to + * COLORFLAG_AUTO, because -G should not force color if + * stdout isn't a tty. + */ setenv("CLICOLOR", "", 1); + colorflag = COLORFLAG_AUTO; break; case 'H': fts_options |= FTS_COMFOLLOW; From owner-svn-src-all@freebsd.org Thu May 21 15:12: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 8BFEC2DBBDF; Thu, 21 May 2020 15:12:56 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) (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 49SY5g6vffz3d3Z; Thu, 21 May 2020 15:12:55 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x741.google.com with SMTP id i5so7463050qkl.12; Thu, 21 May 2020 08:12:55 -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=VKCEuJYJ8YkIe1lbAvbVynDVmPPNWye5Fcme50TyaFI=; b=DAmGUb81wBfKzkEh+jhtdlO7F5svt1PbyvvTiSm/TFeoEK1LSxP3D+1stxTXVVGppF cjRBr9aUXpEkuTDRh3ud95psC8t57PtF/PBk29wrq/oBlurWuNO/Tqp+TH/s+QMfSciS KVAEBunK4siNZgchqKH3zufEcJ639UbGpiljeN/xysQXiB6E6MN6gJbKOR6hyIG16b6n vtx+w1ziv7LAdxwgj/dmZUk6bmTFgGC06umpeWzFWK4qNfUp6R8jFyV5bClbFYNdxIGt jMRKp+W3WrkRnfRa4+hgq/W5p+2gsLCY6XOzGf+o81/Qbc+5kbm25Udttrr1ZYwaoe0g UGUQ== 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=VKCEuJYJ8YkIe1lbAvbVynDVmPPNWye5Fcme50TyaFI=; b=P34/WFwQWsV4emwdQB2Y0nPopms/Q9tG2VJxycW39GgZDCm/BXqeBeNIW0wzSc1a3H Jnv2pFixEW+/U1DFbyYAQXpU5LvmbYBPeGuSR4r705dSaN4K8tjbZIrOOrs/kIA3WHZp fPkqCnrAThV1cEpqruDfgne0/CC7Ab6L3dVretBe2Vcf2pz8Jqo6Ig2smUXJiJRaVRzk 6MAJ2EtpwWmMQ4Rycn09BKDtmWZZkwdbyuPxJ3VsNtPtgU7CuZz8BCz5fpyKLp5gVhuo yRlySvkGiPRTMr/pQ4e2Q0TgP7OnvzYJbBtwm9EYmggw7Hq7gK+Keq7evB1Y/x64VgQE oHLg== X-Gm-Message-State: AOAM533no2uFsL7M7Qn7BgW7/HPQv7f7jUyAN67HxeD9ehjoV8Ra09tA GNYfZheKjjHOAbhlWoyExoI= X-Google-Smtp-Source: ABdhPJwWNILCxg07NoBurZlGiuZ75NApEQIKJGQyHl+cJiKowiXnSdOAI0IM9FX6kYUlxKeagTllvA== X-Received: by 2002:a05:620a:1455:: with SMTP id i21mr9947083qkl.124.1590073975017; Thu, 21 May 2020 08:12:55 -0700 (PDT) Received: from raichu (toroon0560w-lp130-15-184-144-87-103.dsl.bell.ca. [184.144.87.103]) by smtp.gmail.com with ESMTPSA id i3sm5063665qkf.39.2020.05.21.08.12.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 08:12:53 -0700 (PDT) Sender: Mark Johnston Date: Thu, 21 May 2020 11:12:48 -0400 From: Mark Johnston To: Konstantin Belousov Cc: Antoine Brodin , jhb@freebsd.org, src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys Message-ID: <20200521151248.GA85681@raichu> References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200521134152.GE64045@kib.kiev.ua> X-Rspamd-Queue-Id: 49SY5g6vffz3d3Z X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=DAmGUb81; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::741 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-0.74 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.66)[-0.661]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-0.41)[-0.406]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.03)[0.029]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::741:from]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[184.144.87.103: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]; RCVD_TLS_ALL(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: Thu, 21 May 2020 15:12:56 -0000 On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote: > On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: > > On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: > > > > > > Author: kib > > > Date: Wed May 20 22:08:26 2020 > > > New Revision: 361303 > > > URL: https://svnweb.freebsd.org/changeset/base/361303 > > > > > > Log: > > > Change the samantic of struct link_map l_addr member. > > > > > > It previously returned the object map base address, while all other > > > ELF operating systems return load offset, i.e. the difference between > > > map base and the link base. > > > > > > Explain the meaning of the field in the man page. > > > > > > Stop filling the mips-only l_offs member, which is apparently unused. > > > > > > PR: 246561 > > > Requested by: Damjan Jovanovic > > > Reviewed by: emaste, jhb, cem (previous version) > > > Sponsored by: The FreeBSD Foundation > > > MFC after: 1 week > > > Differential revision: https://reviews.freebsd.org/D24918 > > > > > > Modified: > > > head/lib/libc/gen/dlinfo.3 > > > head/libexec/rtld-elf/rtld.c > > > head/sys/sys/link_elf.h > > > > Hi, > > > > After this commit, some ports fail to build with signal 11. > > For instance lang/perl5.30 fails to build with default options (DTRACE on) > > Disabling the DTRACE option makes it able to build again. > > > I see, thank you for reporting. > > So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes > that l_addr is the base, not relocbase. > > Mark, was dofhp_addr initialization changed comparing to Solaris ? It appears it has been the same since DTrace was imported. illumos still has similar code. Note that drti.o is linked into any executable and shlib that defines static probes, so the ABI change affects more than just dtrace(1). Would it be possible to define a new value for RTLD_DI_LINKMAP, and preserve the old behaviour for the old value? From owner-svn-src-all@freebsd.org Thu May 21 15:15: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 1317E2DBA68; Thu, 21 May 2020 15:15:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SY926lcrz3cnj; Thu, 21 May 2020 15:15:50 +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 E3021F159; Thu, 21 May 2020 15:15:50 +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 04LFFo88062238; Thu, 21 May 2020 15:15:50 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LFFo3C062237; Thu, 21 May 2020 15:15:50 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005211515.04LFFo3C062237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 May 2020 15:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361332 - head/bin/ls X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/bin/ls X-SVN-Commit-Revision: 361332 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, 21 May 2020 15:15:51 -0000 Author: kevans Date: Thu May 21 15:15:50 2020 New Revision: 361332 URL: https://svnweb.freebsd.org/changeset/base/361332 Log: ls: fix WITHOUT_LS_COLORS build *sigh* references to colorflags should be gated by COLORLS. Pointy hat to: kevans Reported by: jenkins (rescue build) X-MFC-With: r361318 Modified: head/bin/ls/ls.c Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Thu May 21 14:39:00 2020 (r361331) +++ head/bin/ls/ls.c Thu May 21 15:15:50 2020 (r361332) @@ -270,8 +270,10 @@ main(int argc, char *argv[]) * For historical compatibility, we'll use our autodetection if CLICOLOR * is set. */ +#ifdef COLORLS if (getenv("CLICOLOR")) colorflag = COLORFLAG_AUTO; +#endif while ((ch = getopt_long(argc, argv, "+1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,", long_opts, NULL)) != -1) { @@ -355,7 +357,9 @@ main(int argc, char *argv[]) * stdout isn't a tty. */ setenv("CLICOLOR", "", 1); +#ifdef COLORLS colorflag = COLORFLAG_AUTO; +#endif break; case 'H': fts_options |= FTS_COMFOLLOW; From owner-svn-src-all@freebsd.org Thu May 21 15:18: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 934AC2DBE93; Thu, 21 May 2020 15:18:59 +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 49SYDg3LgXz3dJV; Thu, 21 May 2020 15:18:59 +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 6DFD0F725; Thu, 21 May 2020 15:18:59 +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 04LFIxoM062417; Thu, 21 May 2020 15:18:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LFIxOk062416; Thu, 21 May 2020 15:18:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005211518.04LFIxOk062416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 21 May 2020 15:18:59 +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: r361333 - stable/12/sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/amd64/amd64 X-SVN-Commit-Revision: 361333 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, 21 May 2020 15:18:59 -0000 Author: markj Date: Thu May 21 15:18:59 2020 New Revision: 361333 URL: https://svnweb.freebsd.org/changeset/base/361333 Log: MFC r361031: Assert that page table traversal functions don't operate on superpages. Modified: stable/12/sys/amd64/amd64/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/pmap.c ============================================================================== --- stable/12/sys/amd64/amd64/pmap.c Thu May 21 15:15:50 2020 (r361332) +++ stable/12/sys/amd64/amd64/pmap.c Thu May 21 15:18:59 2020 (r361333) @@ -1243,6 +1243,8 @@ pmap_pdpe_to_pde(pdp_entry_t *pdpe, vm_offset_t va) { pd_entry_t *pde; + KASSERT((*pdpe & PG_PS) == 0, + ("%s: pdpe %#lx is a leaf", __func__, *pdpe)); pde = (pd_entry_t *)PHYS_TO_DMAP(*pdpe & PG_FRAME); return (&pde[pmap_pde_index(va)]); } @@ -1267,6 +1269,8 @@ pmap_pde_to_pte(pd_entry_t *pde, vm_offset_t va) { pt_entry_t *pte; + KASSERT((*pde & PG_PS) == 0, + ("%s: pde %#lx is a leaf", __func__, *pde)); pte = (pt_entry_t *)PHYS_TO_DMAP(*pde & PG_FRAME); return (&pte[pmap_pte_index(va)]); } From owner-svn-src-all@freebsd.org Thu May 21 15:28: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 0FE5F2DBF3B; Thu, 21 May 2020 15:28: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 49SYRm6PZDz3drF; Thu, 21 May 2020 15:28:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCDE0F278; Thu, 21 May 2020 15:28:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LFSa21068448; Thu, 21 May 2020 15:28:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LFSZFF068443; Thu, 21 May 2020 15:28:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005211528.04LFSZFF068443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 21 May 2020 15:28:35 +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: r361334 - in stable/12/sys: amd64/amd64 arm64/arm64 dev/acpica i386/i386 x86/acpica X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 arm64/arm64 dev/acpica i386/i386 x86/acpica X-SVN-Commit-Revision: 361334 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, 21 May 2020 15:28:37 -0000 Author: markj Date: Thu May 21 15:28:35 2020 New Revision: 361334 URL: https://svnweb.freebsd.org/changeset/base/361334 Log: MFC r361033: Call acpi_pxm_set_proximity_info() slightly earlier on x86. Modified: stable/12/sys/amd64/amd64/mp_machdep.c stable/12/sys/arm64/arm64/mp_machdep.c stable/12/sys/dev/acpica/acpi_pxm.c stable/12/sys/dev/acpica/acpivar.h stable/12/sys/i386/i386/mp_machdep.c stable/12/sys/x86/acpica/srat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/12/sys/amd64/amd64/mp_machdep.c Thu May 21 15:18:59 2020 (r361333) +++ stable/12/sys/amd64/amd64/mp_machdep.c Thu May 21 15:28:35 2020 (r361334) @@ -265,8 +265,9 @@ cpu_mp_start(void) init_ops.start_all_aps(); set_interrupt_apic_ids(); -} + acpi_pxm_set_cpu_locality(); +} /* * AP CPU's call this to initialize themselves. Modified: stable/12/sys/arm64/arm64/mp_machdep.c ============================================================================== --- stable/12/sys/arm64/arm64/mp_machdep.c Thu May 21 15:18:59 2020 (r361333) +++ stable/12/sys/arm64/arm64/mp_machdep.c Thu May 21 15:28:35 2020 (r361334) @@ -595,9 +595,7 @@ cpu_init_acpi(void) acpi_unmap_table(madt); #if MAXMEMDOM > 1 - /* set proximity info */ acpi_pxm_set_cpu_locality(); - acpi_pxm_free(); #endif } #endif Modified: stable/12/sys/dev/acpica/acpi_pxm.c ============================================================================== --- stable/12/sys/dev/acpica/acpi_pxm.c Thu May 21 15:18:59 2020 (r361333) +++ stable/12/sys/dev/acpica/acpi_pxm.c Thu May 21 15:28:35 2020 (r361334) @@ -628,7 +628,8 @@ srat_walk_table(acpi_subtable_handler *handler, void * } /* - * Setup per-CPU domain IDs from information saved in 'cpus'. + * Set up per-CPU domain IDs from information saved in 'cpus' and tear down data + * structures allocated by acpi_pxm_init(). */ void acpi_pxm_set_cpu_locality(void) @@ -651,6 +652,10 @@ acpi_pxm_set_cpu_locality(void) printf("SRAT: CPU %u has memory domain %d\n", i, pc->pc_domain); } + /* XXXMJ the page is leaked. */ + pmap_unmapbios((vm_offset_t)cpus, sizeof(*cpus) * max_cpus); + srat_physaddr = 0; + cpus = NULL; } int @@ -662,20 +667,6 @@ acpi_pxm_get_cpu_locality(int apic_id) if (cpu == NULL) panic("SRAT: CPU with ID %u is not known", apic_id); return (cpu->domain); -} - -/* - * Free data structures allocated during acpi_pxm_init. - */ -void -acpi_pxm_free(void) -{ - - if (srat_physaddr == 0) - return; - pmap_unmapbios((vm_offset_t)cpus, sizeof(*cpus) * max_cpus); - srat_physaddr = 0; - cpus = NULL; } /* Modified: stable/12/sys/dev/acpica/acpivar.h ============================================================================== --- stable/12/sys/dev/acpica/acpivar.h Thu May 21 15:18:59 2020 (r361333) +++ stable/12/sys/dev/acpica/acpivar.h Thu May 21 15:28:35 2020 (r361334) @@ -536,7 +536,6 @@ void acpi_pxm_parse_tables(void); void acpi_pxm_set_mem_locality(void); void acpi_pxm_set_cpu_locality(void); int acpi_pxm_get_cpu_locality(int apic_id); -void acpi_pxm_free(void); /* * Map a PXM to a VM domain. Modified: stable/12/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/12/sys/i386/i386/mp_machdep.c Thu May 21 15:18:59 2020 (r361333) +++ stable/12/sys/i386/i386/mp_machdep.c Thu May 21 15:28:35 2020 (r361334) @@ -199,6 +199,8 @@ cpu_mp_start(void) start_all_aps(); set_interrupt_apic_ids(); + + acpi_pxm_set_cpu_locality(); } /* Modified: stable/12/sys/x86/acpica/srat.c ============================================================================== --- stable/12/sys/x86/acpica/srat.c Thu May 21 15:18:59 2020 (r361333) +++ stable/12/sys/x86/acpica/srat.c Thu May 21 15:28:35 2020 (r361334) @@ -56,13 +56,4 @@ parse_acpi_tables(void *dummy) SYSINIT(parse_acpi_tables, SI_SUB_VM - 1, SI_ORDER_FIRST, parse_acpi_tables, NULL); -static void -srat_set_cpus(void *dummy) -{ - - acpi_pxm_set_cpu_locality(); - acpi_pxm_free(); -} -SYSINIT(srat_set_cpus, SI_SUB_CPU, SI_ORDER_ANY, srat_set_cpus, NULL); - #endif /* MAXMEMDOM > 1 */ From owner-svn-src-all@freebsd.org Thu May 21 15:29: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 5189A2DBFBB; Thu, 21 May 2020 15:29:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SYSJ1Rsfz3f0N; Thu, 21 May 2020 15:29:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D094F740; Thu, 21 May 2020 15:29:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LFT3C5068514; Thu, 21 May 2020 15:29:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LFT3De068513; Thu, 21 May 2020 15:29:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005211529.04LFT3De068513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 21 May 2020 15:29: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: r361335 - stable/12/sys/i386/i386 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/i386/i386 X-SVN-Commit-Revision: 361335 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, 21 May 2020 15:29:04 -0000 Author: markj Date: Thu May 21 15:29:03 2020 New Revision: 361335 URL: https://svnweb.freebsd.org/changeset/base/361335 Log: MFC r361039: Fix the i386 build after r361033. Modified: stable/12/sys/i386/i386/mp_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/12/sys/i386/i386/mp_machdep.c Thu May 21 15:28:35 2020 (r361334) +++ stable/12/sys/i386/i386/mp_machdep.c Thu May 21 15:29:03 2020 (r361335) @@ -83,6 +83,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #define WARMBOOT_TARGET 0 #define WARMBOOT_OFF (PMAP_MAP_LOW + 0x0467) #define WARMBOOT_SEG (PMAP_MAP_LOW + 0x0469) @@ -200,7 +203,9 @@ cpu_mp_start(void) set_interrupt_apic_ids(); +#if MAXMEMDOM > 1 acpi_pxm_set_cpu_locality(); +#endif } /* From owner-svn-src-all@freebsd.org Thu May 21 15:53: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 873BD2DCA14; Thu, 21 May 2020 15:53:17 +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 49SZ0F31KXz3gYm; Thu, 21 May 2020 15:53:17 +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 62B8EFD9C; Thu, 21 May 2020 15:53:17 +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 04LFrHfG086489; Thu, 21 May 2020 15:53:17 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LFrH3m086488; Thu, 21 May 2020 15:53:17 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202005211553.04LFrH3m086488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Thu, 21 May 2020 15:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361336 - 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: 361336 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, 21 May 2020 15:53:17 -0000 Author: bdragon Date: Thu May 21 15:53:16 2020 New Revision: 361336 URL: https://svnweb.freebsd.org/changeset/base/361336 Log: [PowerPC] Fix kernel boot on powerpc Recent changes have caused the vmspace objects to start coming from KVA instead of direct-mapped memory on powerpc. As far as I can tell, this is not actually a problem, so we should stop arbitrarily asserting that it is. I do not know why this was not being triggered before. Approved by: jhibbits Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/powerpc/aim/mmu_oea.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Thu May 21 15:29:03 2020 (r361335) +++ head/sys/powerpc/aim/mmu_oea.c Thu May 21 15:53:16 2020 (r361336) @@ -1703,7 +1703,6 @@ moea_pinit(mmu_t mmu, pmap_t pmap) int i, mask; u_int entropy; - KASSERT((int)pmap < VM_MIN_KERNEL_ADDRESS, ("moea_pinit: virt pmap")); RB_INIT(&pmap->pmap_pvo); entropy = 0; From owner-svn-src-all@freebsd.org Thu May 21 16:03: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 B09E52DD01E; Thu, 21 May 2020 16:03:46 +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 49SZDL4KqCz3gwK; Thu, 21 May 2020 16:03:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:c7d:9a4b:586:998a]) (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 E55E719760; Thu, 21 May 2020 16:03:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys To: Mark Johnston , Konstantin Belousov Cc: Antoine Brodin , src-committers , svn-src-all , svn-src-head@freebsd.org References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> <20200521151248.GA85681@raichu> 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, 21 May 2020 09:03:44 -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: <20200521151248.GA85681@raichu> 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, 21 May 2020 16:03:46 -0000 On 5/21/20 8:12 AM, Mark Johnston wrote: > On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote: >> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: >>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: >>>> >>>> Author: kib >>>> Date: Wed May 20 22:08:26 2020 >>>> New Revision: 361303 >>>> URL: https://svnweb.freebsd.org/changeset/base/361303 >>>> >>>> Log: >>>> Change the samantic of struct link_map l_addr member. >>>> >>>> It previously returned the object map base address, while all other >>>> ELF operating systems return load offset, i.e. the difference between >>>> map base and the link base. >>>> >>>> Explain the meaning of the field in the man page. >>>> >>>> Stop filling the mips-only l_offs member, which is apparently unused. >>>> >>>> PR: 246561 >>>> Requested by: Damjan Jovanovic >>>> Reviewed by: emaste, jhb, cem (previous version) >>>> Sponsored by: The FreeBSD Foundation >>>> MFC after: 1 week >>>> Differential revision: https://reviews.freebsd.org/D24918 >>>> >>>> Modified: >>>> head/lib/libc/gen/dlinfo.3 >>>> head/libexec/rtld-elf/rtld.c >>>> head/sys/sys/link_elf.h >>> >>> Hi, >>> >>> After this commit, some ports fail to build with signal 11. >>> For instance lang/perl5.30 fails to build with default options (DTRACE on) >>> Disabling the DTRACE option makes it able to build again. >>> >> I see, thank you for reporting. >> >> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes >> that l_addr is the base, not relocbase. >> >> Mark, was dofhp_addr initialization changed comparing to Solaris ? > > It appears it has been the same since DTrace was imported. illumos > still has similar code. > > Note that drti.o is linked into any executable and shlib that defines > static probes, so the ABI change affects more than just dtrace(1). > Would it be possible to define a new value for RTLD_DI_LINKMAP, and > preserve the old behaviour for the old value? I think a bigger question is if Solaris/illumos treat l_addr as mapbase (absolute address) or relocbase (relative address). In the discussion in the phabricator I had assumed that all other OS's treated l_addr as the relative offset (relocbase). Does the code for illumos assume an absolute address or does it assume a relative address in l_addr? -- John Baldwin From owner-svn-src-all@freebsd.org Thu May 21 16:54: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 946E52DDB55; Thu, 21 May 2020 16:54:54 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) (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 49SbML3Nvfz4194; Thu, 21 May 2020 16:54:54 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x843.google.com with SMTP id a23so6054693qto.1; Thu, 21 May 2020 09:54:54 -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=V/yhRE5cR5xjhxY4k2hyZFhOGaDfir+doKx077jMm8A=; b=uEQxjRYuSrvbIU03x4pYUAg1OxJ0zEOlwG3E4osMf95JcLqPlmyTeKm7hWKoILzwPJ PR5bJqHH5PqnUV7EdazUaJWjXA2qoXK8KoxX6zpMONhB4n1iVmeUVUGZLWdO5BCIYBjC KNBj/SQZezM+VLnoXlWUoX8hemiHOPGDIh75wWKBmOxPkVQTGHgroK68v2bZkYJqQ8lN yDVRaRb5ti3vRKn7273VQXM5JF5x5aFLhDlRjOJT3Glmmo3lYy5bO3thwsnYl+rKfmv6 aC3vJ9fMSpWa24TJjslr6TC1w57EDuL2rPz9kBFDeePO4fIRl+xZeh8qUXKYMdHhWOPV x5Eg== 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=V/yhRE5cR5xjhxY4k2hyZFhOGaDfir+doKx077jMm8A=; b=OwNPbNGnqEFlDHyuZ/KfJZUB2Gz0bS2X+VdrBVYp8nMG6Fjy2++KKCbhQbLRIaeZbE Q8trdAR0IMZEZBnCIwBrhIrcNCPOOjvNihd7osJzdSJpUxFmbExgOC2B+45W7Rm0CUtb FlgTUZlOTnfQSXrpL104DmIf4a7fJ4Pjt+Zgo7nbyJ4jskVBhC+qnwnNWyMilWYnS483 14zRgvfwHoOYXfTzkULlVm7CiAJrx5jBbjlJPJmEl1hpu9jRZSTvr92ZHJlu++udNdEz PhwAkKM6Q+NlsvNauCQafWUxeoEZHusnYdWQVcsvVPDQZALQ/ZyyIAJhhEwAeNFfyfhj 9MdA== X-Gm-Message-State: AOAM5305IFdnvbk5ZdVOqvj0K81PqJ28hnsp7jS0qBIbMZuIlZM/9bJ8 e0YXmOz58zESFDjtIO0RgBXYtZ/v X-Google-Smtp-Source: ABdhPJw5OGU9Y86OJx+ZWOQ46C/ajZJDGxC4pDlaeWQv6hoNSrvEs9haOVxscaO9CgycjN68JDM9sA== X-Received: by 2002:aed:3fe8:: with SMTP id w37mr11200375qth.335.1590080093331; Thu, 21 May 2020 09:54:53 -0700 (PDT) Received: from raichu (toroon0560w-lp130-15-184-144-87-103.dsl.bell.ca. [184.144.87.103]) by smtp.gmail.com with ESMTPSA id g26sm5685087qtk.76.2020.05.21.09.54.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 09:54:52 -0700 (PDT) Sender: Mark Johnston Date: Thu, 21 May 2020 12:54:50 -0400 From: Mark Johnston To: John Baldwin Cc: Konstantin Belousov , Antoine Brodin , src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys Message-ID: <20200521165450.GC85681@raichu> References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> <20200521151248.GA85681@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 49SbML3Nvfz4194 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: Thu, 21 May 2020 16:54:54 -0000 On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote: > On 5/21/20 8:12 AM, Mark Johnston wrote: > > On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote: > >> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: > >>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: > >>>> > >>>> Author: kib > >>>> Date: Wed May 20 22:08:26 2020 > >>>> New Revision: 361303 > >>>> URL: https://svnweb.freebsd.org/changeset/base/361303 > >>>> > >>>> Log: > >>>> Change the samantic of struct link_map l_addr member. > >>>> > >>>> It previously returned the object map base address, while all other > >>>> ELF operating systems return load offset, i.e. the difference between > >>>> map base and the link base. > >>>> > >>>> Explain the meaning of the field in the man page. > >>>> > >>>> Stop filling the mips-only l_offs member, which is apparently unused. > >>>> > >>>> PR: 246561 > >>>> Requested by: Damjan Jovanovic > >>>> Reviewed by: emaste, jhb, cem (previous version) > >>>> Sponsored by: The FreeBSD Foundation > >>>> MFC after: 1 week > >>>> Differential revision: https://reviews.freebsd.org/D24918 > >>>> > >>>> Modified: > >>>> head/lib/libc/gen/dlinfo.3 > >>>> head/libexec/rtld-elf/rtld.c > >>>> head/sys/sys/link_elf.h > >>> > >>> Hi, > >>> > >>> After this commit, some ports fail to build with signal 11. > >>> For instance lang/perl5.30 fails to build with default options (DTRACE on) > >>> Disabling the DTRACE option makes it able to build again. > >>> > >> I see, thank you for reporting. > >> > >> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes > >> that l_addr is the base, not relocbase. > >> > >> Mark, was dofhp_addr initialization changed comparing to Solaris ? > > > > It appears it has been the same since DTrace was imported. illumos > > still has similar code. > > > > Note that drti.o is linked into any executable and shlib that defines > > static probes, so the ABI change affects more than just dtrace(1). > > Would it be possible to define a new value for RTLD_DI_LINKMAP, and > > preserve the old behaviour for the old value? > > I think a bigger question is if Solaris/illumos treat l_addr as mapbase > (absolute address) or relocbase (relative address). In the discussion > in the phabricator I had assumed that all other OS's treated l_addr as > the relative offset (relocbase). Does the code for illumos assume an > absolute address or does it assume a relative address in l_addr? It should be an absolute address, since dtrace appears to assume that an ELF header is mapped at l_addr. Here, "addr" is the value of l_addr for the RTLD_SELF linkmap: https://github.com/joyent/illumos-joyent/blob/master/usr/src/lib/libdtrace/common/dlink_common.c#L124 From owner-svn-src-all@freebsd.org Thu May 21 16:56: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 B4CF12DDEA2; Thu, 21 May 2020 16:56:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49SbPf1MsSz417X; Thu, 21 May 2020 16:56:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 04LGukch022188 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 21 May 2020 19:56:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 04LGukch022188 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 04LGukV6022187; Thu, 21 May 2020 19:56:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 21 May 2020 19:56:46 +0300 From: Konstantin Belousov To: John Baldwin Cc: Mark Johnston , Antoine Brodin , src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys Message-ID: <20200521165646.GF64045@kib.kiev.ua> References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> <20200521151248.GA85681@raichu> 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: 49SbPf1MsSz417X 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:6939, ipnet:2001:470::/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: Thu, 21 May 2020 16:56:54 -0000 On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote: > On 5/21/20 8:12 AM, Mark Johnston wrote: > > On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote: > >> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: > >>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: > >>>> > >>>> Author: kib > >>>> Date: Wed May 20 22:08:26 2020 > >>>> New Revision: 361303 > >>>> URL: https://svnweb.freebsd.org/changeset/base/361303 > >>>> > >>>> Log: > >>>> Change the samantic of struct link_map l_addr member. > >>>> > >>>> It previously returned the object map base address, while all other > >>>> ELF operating systems return load offset, i.e. the difference between > >>>> map base and the link base. > >>>> > >>>> Explain the meaning of the field in the man page. > >>>> > >>>> Stop filling the mips-only l_offs member, which is apparently unused. > >>>> > >>>> PR: 246561 > >>>> Requested by: Damjan Jovanovic > >>>> Reviewed by: emaste, jhb, cem (previous version) > >>>> Sponsored by: The FreeBSD Foundation > >>>> MFC after: 1 week > >>>> Differential revision: https://reviews.freebsd.org/D24918 > >>>> > >>>> Modified: > >>>> head/lib/libc/gen/dlinfo.3 > >>>> head/libexec/rtld-elf/rtld.c > >>>> head/sys/sys/link_elf.h > >>> > >>> Hi, > >>> > >>> After this commit, some ports fail to build with signal 11. > >>> For instance lang/perl5.30 fails to build with default options (DTRACE on) > >>> Disabling the DTRACE option makes it able to build again. > >>> > >> I see, thank you for reporting. > >> > >> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes > >> that l_addr is the base, not relocbase. > >> > >> Mark, was dofhp_addr initialization changed comparing to Solaris ? > > > > It appears it has been the same since DTrace was imported. illumos > > still has similar code. > > > > Note that drti.o is linked into any executable and shlib that defines > > static probes, so the ABI change affects more than just dtrace(1). > > Would it be possible to define a new value for RTLD_DI_LINKMAP, and > > preserve the old behaviour for the old value? > > I think a bigger question is if Solaris/illumos treat l_addr as mapbase > (absolute address) or relocbase (relative address). In the discussion > in the phabricator I had assumed that all other OS's treated l_addr as > the relative offset (relocbase). Does the code for illumos assume an > absolute address or does it assume a relative address in l_addr? It is rather clear, since the dtrace code was pristine, that Solaris provides the mapbase. I do not have Solaris/Illumos box anymore (for quite some time), so I cannot check directly. My current PoV is that l_addr semantic must be restored, and relocbase provided by newly added member. BTW, it is strange that perl triggers it, is it linked as PIE on HEAD ? From owner-svn-src-all@freebsd.org Thu May 21 17:01: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 A369B2DE3F9; Thu, 21 May 2020 17:01:29 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (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 49SbVw6ps3z41Qt; Thu, 21 May 2020 17:01:28 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x844.google.com with SMTP id a23so6074065qto.1; Thu, 21 May 2020 10:01:28 -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=YrZ/xlc2m8ejjRTlJX3nv5gPbrfyK2uvwg5Z+HBmBz8=; b=fio+83qPivCTeET29WjgbzGU32aI9oWj6bT+ijVETvj7nVAkws7PgwY62/KxyxGGDG 5V9FuuuI1/sjFZCfvC8w2e1PgnL1U5eonyK1mf+wyjAvASkmByselfUIgxhxbthiks/f lziYOYOvs5LD80olARTDYsqazdcwZCAAEgmAazjGzLKKP5mpwgtsVKcqsbqgwgBB0arx VohEKX/1IIOXar2zDrhlNtk8aauD8IUwHqb9v2oV+GHEwuA6qHh59crWUiZjgiZi9fl8 0jDLJe0VDnbvKUsYTag7oJPrtWIowqg5i0GWXe9u1xHY4Czrkdr9WqdlInov6XHFqqiX 7iuA== 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=YrZ/xlc2m8ejjRTlJX3nv5gPbrfyK2uvwg5Z+HBmBz8=; b=RC414EnTs0dbemcjpHv7PXQsFSw6tSQNRhlagmOZaQQNMpPZl1YITWohZ7J4NEv0L2 HMkn04PY0DHXUzEiksWBMdEEbujAiZmTroGP5sxuMgoDpU0Z1d+vGUGTUXewZXXduMtU XsfOjb81DO5XMW17XI1wTrXpsP92u1S5x0gXRdlBHjsTol6Dqnplp02Svl+kyTXXSvPx Xo2sbZpS8EW6jJr3s018kD17/krpkMNnO4J3XVB2Mlz3D8i5rTstzpk/PgRTLsn+znx6 Ev/m7gVjdRyA3JuE4epKLxJ79frPfJblAJ42hF5Xu/PG9DJIvYwtSThyLHXbt8Q1V0A6 BjAg== X-Gm-Message-State: AOAM532HE6EZZrHvH18O7Ubz1rcJ5K3Aw/FlxBY3u7dv/WREQBXUQKLz Jt838ixrn+IIPi7dViRRP78= X-Google-Smtp-Source: ABdhPJzVg42PRPQOfJlaQvEorAy//JmnQk/yzBXTmGboa7C67a4Le8btklyWADLCIF8Lk4M5f6y7oA== X-Received: by 2002:ac8:47c4:: with SMTP id d4mr11944539qtr.110.1590080487837; Thu, 21 May 2020 10:01:27 -0700 (PDT) Received: from raichu (toroon0560w-lp130-15-184-144-87-103.dsl.bell.ca. [184.144.87.103]) by smtp.gmail.com with ESMTPSA id r14sm3627558qke.62.2020.05.21.10.01.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 10:01:26 -0700 (PDT) Sender: Mark Johnston Date: Thu, 21 May 2020 13:01:24 -0400 From: Mark Johnston To: Konstantin Belousov Cc: John Baldwin , Antoine Brodin , src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys Message-ID: <20200521170124.GE85681@raichu> References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> <20200521151248.GA85681@raichu> <20200521165646.GF64045@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200521165646.GF64045@kib.kiev.ua> X-Rspamd-Queue-Id: 49SbVw6ps3z41Qt X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=fio+83qP; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::844 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-1.32 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.66)[-0.663]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-0.41)[-0.408]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.55)[-0.548]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::844:from]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[184.144.87.103: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]; RCVD_TLS_ALL(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: Thu, 21 May 2020 17:01:29 -0000 On Thu, May 21, 2020 at 07:56:46PM +0300, Konstantin Belousov wrote: > On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote: > > On 5/21/20 8:12 AM, Mark Johnston wrote: > > > On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote: > > >> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: > > >>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: > > >>>> > > >>>> Author: kib > > >>>> Date: Wed May 20 22:08:26 2020 > > >>>> New Revision: 361303 > > >>>> URL: https://svnweb.freebsd.org/changeset/base/361303 > > >>>> > > >>>> Log: > > >>>> Change the samantic of struct link_map l_addr member. > > >>>> > > >>>> It previously returned the object map base address, while all other > > >>>> ELF operating systems return load offset, i.e. the difference between > > >>>> map base and the link base. > > >>>> > > >>>> Explain the meaning of the field in the man page. > > >>>> > > >>>> Stop filling the mips-only l_offs member, which is apparently unused. > > >>>> > > >>>> PR: 246561 > > >>>> Requested by: Damjan Jovanovic > > >>>> Reviewed by: emaste, jhb, cem (previous version) > > >>>> Sponsored by: The FreeBSD Foundation > > >>>> MFC after: 1 week > > >>>> Differential revision: https://reviews.freebsd.org/D24918 > > >>>> > > >>>> Modified: > > >>>> head/lib/libc/gen/dlinfo.3 > > >>>> head/libexec/rtld-elf/rtld.c > > >>>> head/sys/sys/link_elf.h > > >>> > > >>> Hi, > > >>> > > >>> After this commit, some ports fail to build with signal 11. > > >>> For instance lang/perl5.30 fails to build with default options (DTRACE on) > > >>> Disabling the DTRACE option makes it able to build again. > > >>> > > >> I see, thank you for reporting. > > >> > > >> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes > > >> that l_addr is the base, not relocbase. > > >> > > >> Mark, was dofhp_addr initialization changed comparing to Solaris ? > > > > > > It appears it has been the same since DTrace was imported. illumos > > > still has similar code. > > > > > > Note that drti.o is linked into any executable and shlib that defines > > > static probes, so the ABI change affects more than just dtrace(1). > > > Would it be possible to define a new value for RTLD_DI_LINKMAP, and > > > preserve the old behaviour for the old value? > > > > I think a bigger question is if Solaris/illumos treat l_addr as mapbase > > (absolute address) or relocbase (relative address). In the discussion > > in the phabricator I had assumed that all other OS's treated l_addr as > > the relative offset (relocbase). Does the code for illumos assume an > > absolute address or does it assume a relative address in l_addr? > > It is rather clear, since the dtrace code was pristine, that Solaris > provides the mapbase. I do not have Solaris/Illumos box anymore > (for quite some time), so I cannot check directly. > > My current PoV is that l_addr semantic must be restored, and relocbase > provided by newly added member. > > BTW, it is strange that perl triggers it, is it linked as PIE on HEAD ? Isn't the problem when perl is *not* linked as PIE? In this case relocbase is 0, so the ELF header access becomes a NULL pointer dereference. From owner-svn-src-all@freebsd.org Thu May 21 17:09: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 1E5B72DE27D; Thu, 21 May 2020 17:09:58 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) (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 49Sbhj6gmsz427v; Thu, 21 May 2020 17:09:57 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x843.google.com with SMTP id d7so6026206qtn.11; Thu, 21 May 2020 10:09:57 -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=Fwxi6IE7uLYMM1zNlo5EvguEHNEJZW/CwZjvuXN+gzM=; b=sH5Jlncpz/JXLkSdcg4AAcWb7+DaVbWacRaaFbKpLwDQpcn4GG7dM0SzixXYCpmKju HWFTo8QhVF7ami/7YvAyRRcQUYMGS/JtemTl5ejJlxbBsi/kXuYouzdF/naDME0+LdLu NjEWJMeNhVljkyh5hDUhfzt6acBauSkBnJznAL5DCRbX1RjIJ7BaAydr/wcf/1FqtMrf tFrzxhvzIjekfcYg7qQZHTkl73tu60PtCVAtNrqOuN5V7ZSQ8M4VALP2YH34p9qs6NJS yB4CsZD+PFiT9SPYoj2KaP+tyX9Upnk9MUhU9AcKhUD/FiXn1eESqVwzadJ7btkE3n4k x/oQ== 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=Fwxi6IE7uLYMM1zNlo5EvguEHNEJZW/CwZjvuXN+gzM=; b=WOHjh2n+/gIVDicCS6q7b7V2JJXsNl65rpHA+CNGjbMJG7a89jU63dGaDpXhr8KO4I Rkx3NzJE8C2h4wWfgZAHsCxUO1OLbaenaqWnsJSO7knWGqyredDzdX37QT5AReOR3fPa 7aIPy81vIPiclWFo78/KeALKcp99rVbXeAmkwPGu2tUQHU1IxbJn+071A+ZRyN+/d/lC FVQVl0iNiAdBeORcBsAk8ApA48TNzpZbSOqr5KCL5sgZhxM1760blk4EhGgXxsCEVo0T Sd3KnEWPFh2BmIK3hJec9ZhwdYDtpmH1SXK72NYBuv4wO8ojY5gVbsYegWM5TZULjPuK einw== X-Gm-Message-State: AOAM530rSToZ9vEqIjladFTLH+XTejfwtBuHP2t2mPp7ZSiTF+uucAQl mT+KbvJwuyPuHS+f8kS4lWcFFvse X-Google-Smtp-Source: ABdhPJzSpUtiAVgDkY/P+Z8aIdNl8DEvO3VlvCZGae+V0OXBoN4EOpkf1NH/PWDeQCQ/2KHRQB5fqQ== X-Received: by 2002:ac8:1194:: with SMTP id d20mr12209863qtj.359.1590080996468; Thu, 21 May 2020 10:09:56 -0700 (PDT) Received: from raichu (toroon0560w-lp130-15-184-144-87-103.dsl.bell.ca. [184.144.87.103]) by smtp.gmail.com with ESMTPSA id v1sm2114833qkb.19.2020.05.21.10.09.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 10:09:55 -0700 (PDT) Sender: Mark Johnston Date: Thu, 21 May 2020 13:09:53 -0400 From: Mark Johnston To: Brandon Bergren Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r361336 - head/sys/powerpc/aim Message-ID: <20200521170953.GF85681@raichu> References: <202005211553.04LFrH3m086488@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202005211553.04LFrH3m086488@repo.freebsd.org> X-Rspamd-Queue-Id: 49Sbhj6gmsz427v 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: Thu, 21 May 2020 17:09:58 -0000 On Thu, May 21, 2020 at 03:53:17PM +0000, Brandon Bergren wrote: > Author: bdragon > Date: Thu May 21 15:53:16 2020 > New Revision: 361336 > URL: https://svnweb.freebsd.org/changeset/base/361336 > > Log: > [PowerPC] Fix kernel boot on powerpc > > Recent changes have caused the vmspace objects to start coming from KVA > instead of direct-mapped memory on powerpc. As far as I can tell, this is > not actually a problem, so we should stop arbitrarily asserting that it is. > > I do not know why this was not being triggered before. UMA was recently changed in r357549 to use multi-page slabs if doing so would reduce internal fragmentation to a certain degree. In that case the slabs will be mapped into KVA. vmspace objects are quite large but smaller than a page, so they benefit from this. You can verify by checking the vm.uma.VMSPACE.keg.ppera sysctl, which gives the number of pages per slab. From owner-svn-src-all@freebsd.org Thu May 21 17:10: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 546EE2DE536; Thu, 21 May 2020 17:10:07 +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 49Sbht4KCqz426B; Thu, 21 May 2020 17:10:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 04LH9w5u024629 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 21 May 2020 20:10:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 04LH9w5u024629 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 04LH9wfT024628; Thu, 21 May 2020 20:09:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 21 May 2020 20:09:58 +0300 From: Konstantin Belousov To: Mark Johnston Cc: John Baldwin , Antoine Brodin , src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys Message-ID: <20200521170958.GG64045@kib.kiev.ua> References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> <20200521151248.GA85681@raichu> <20200521165646.GF64045@kib.kiev.ua> <20200521170124.GE85681@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200521170124.GE85681@raichu> 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: 49Sbht4KCqz426B X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, 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: Thu, 21 May 2020 17:10:07 -0000 On Thu, May 21, 2020 at 01:01:24PM -0400, Mark Johnston wrote: > On Thu, May 21, 2020 at 07:56:46PM +0300, Konstantin Belousov wrote: > > On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote: > > > On 5/21/20 8:12 AM, Mark Johnston wrote: > > > > On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote: > > > >> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: > > > >>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: > > > >>>> > > > >>>> Author: kib > > > >>>> Date: Wed May 20 22:08:26 2020 > > > >>>> New Revision: 361303 > > > >>>> URL: https://svnweb.freebsd.org/changeset/base/361303 > > > >>>> > > > >>>> Log: > > > >>>> Change the samantic of struct link_map l_addr member. > > > >>>> > > > >>>> It previously returned the object map base address, while all other > > > >>>> ELF operating systems return load offset, i.e. the difference between > > > >>>> map base and the link base. > > > >>>> > > > >>>> Explain the meaning of the field in the man page. > > > >>>> > > > >>>> Stop filling the mips-only l_offs member, which is apparently unused. > > > >>>> > > > >>>> PR: 246561 > > > >>>> Requested by: Damjan Jovanovic > > > >>>> Reviewed by: emaste, jhb, cem (previous version) > > > >>>> Sponsored by: The FreeBSD Foundation > > > >>>> MFC after: 1 week > > > >>>> Differential revision: https://reviews.freebsd.org/D24918 > > > >>>> > > > >>>> Modified: > > > >>>> head/lib/libc/gen/dlinfo.3 > > > >>>> head/libexec/rtld-elf/rtld.c > > > >>>> head/sys/sys/link_elf.h > > > >>> > > > >>> Hi, > > > >>> > > > >>> After this commit, some ports fail to build with signal 11. > > > >>> For instance lang/perl5.30 fails to build with default options (DTRACE on) > > > >>> Disabling the DTRACE option makes it able to build again. > > > >>> > > > >> I see, thank you for reporting. > > > >> > > > >> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes > > > >> that l_addr is the base, not relocbase. > > > >> > > > >> Mark, was dofhp_addr initialization changed comparing to Solaris ? > > > > > > > > It appears it has been the same since DTrace was imported. illumos > > > > still has similar code. > > > > > > > > Note that drti.o is linked into any executable and shlib that defines > > > > static probes, so the ABI change affects more than just dtrace(1). > > > > Would it be possible to define a new value for RTLD_DI_LINKMAP, and > > > > preserve the old behaviour for the old value? > > > > > > I think a bigger question is if Solaris/illumos treat l_addr as mapbase > > > (absolute address) or relocbase (relative address). In the discussion > > > in the phabricator I had assumed that all other OS's treated l_addr as > > > the relative offset (relocbase). Does the code for illumos assume an > > > absolute address or does it assume a relative address in l_addr? > > > > It is rather clear, since the dtrace code was pristine, that Solaris > > provides the mapbase. I do not have Solaris/Illumos box anymore > > (for quite some time), so I cannot check directly. > > > > My current PoV is that l_addr semantic must be restored, and relocbase > > provided by newly added member. > > > > BTW, it is strange that perl triggers it, is it linked as PIE on HEAD ? > > Isn't the problem when perl is *not* linked as PIE? In this case > relocbase is 0, so the ELF header access becomes a NULL pointer > dereference. drti checks for ET_DYN, only then it uses l_addr at all. PIE binaries are dso with non-zero base, non-PIE binaries are ET_EXEC, which should make dtri.c ignore the l_addr value. From owner-svn-src-all@freebsd.org Thu May 21 17:13: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 9AF202DE636; Thu, 21 May 2020 17:13:04 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (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 49SbmJ0fYmz42XW; Thu, 21 May 2020 17:13:03 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x844.google.com with SMTP id c24so6070648qtw.7; Thu, 21 May 2020 10:13:03 -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=NBDsI+qr84dPVJLbT/b6zIwLekn5fluTJ4mnvqOwepw=; b=OW7zNKHsooh44N3rKVZRJaYPZxGMq/50Yo1+3j2X+mPSrH8SmdgSG/aZcnfhuUaUCY IYnwm9dQ18gQ7OgTIJF72K1eyh3nZMHs8D2r4FSpOv0Aoye71UkfTwhx/rpdD/+ogDgC qaORkeG9AJq5tXim9ZLRhRVZesfR2Cxsp/ooRYrzuIhSFYpXfRLnHyCzTFOUBiRk5Gpq j7G0eBgj6t/WjL3hiBpVmOOiS2MMbsiJNE0hyP7iOYbrfv3wT741D++f9wsHaHO5zBAZ acXmiQsWtmfeI8kPy+QVWunsRlvtmNP4npOrwRzAjdZjS3h1LISiuRMN2r33vI93dcTH 9ZAg== 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=NBDsI+qr84dPVJLbT/b6zIwLekn5fluTJ4mnvqOwepw=; b=l/+Hs1USWyDhA3K6e0iWxaV9DV7OfwkcP10UGaAKi3M24JiQMFd+wKljYK86chLeKK d7zwES/YXaawNw7XWa2Y5Yiq9urSWMVE6r40325qrUFaAe3Lwgsmbi2OheLMKbCunPHC 5lgnpR6nXlnOo/MSlvGPGOf3eRw8WxSwrkoSgG41PKJbbon52T9E/05hnLqz5g4GcypF y1EsLy+WKKfBkhGXLErQ6g4fPzFfguCwzUBOPsnZ/Nvcd+05/w39PSgDOdR9JiwM+bb4 91scKAwmXGehzVVhEBXzcXGFcyDjyIRZr6iM59g4Zf0FXKm8pYvPlEUeB5c2Z3r0MpHd 6ExQ== X-Gm-Message-State: AOAM5310/1MRiQcrLZP/3wdcZZ0FlTgl5WUg4/hbPXwX1nku9IE01ZQ/ BwlrI/kQRY+z4FOlGWn5AKI= X-Google-Smtp-Source: ABdhPJyL3OYlugIRsHfz2X/i1881xUg6UktuBT/BLufaSLNHHACNNEDx8QD6u7jt8gaKuuXNAY6ojQ== X-Received: by 2002:ac8:1621:: with SMTP id p30mr10171634qtj.321.1590081183420; Thu, 21 May 2020 10:13:03 -0700 (PDT) Received: from raichu (toroon0560w-lp130-15-184-144-87-103.dsl.bell.ca. [184.144.87.103]) by smtp.gmail.com with ESMTPSA id h15sm3744066qkh.18.2020.05.21.10.13.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 10:13:02 -0700 (PDT) Sender: Mark Johnston Date: Thu, 21 May 2020 13:13:00 -0400 From: Mark Johnston To: Konstantin Belousov Cc: John Baldwin , Antoine Brodin , src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys Message-ID: <20200521171300.GG85681@raichu> References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> <20200521151248.GA85681@raichu> <20200521165646.GF64045@kib.kiev.ua> <20200521170124.GE85681@raichu> <20200521170958.GG64045@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200521170958.GG64045@kib.kiev.ua> X-Rspamd-Queue-Id: 49SbmJ0fYmz42XW X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=OW7zNKHs; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::844 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-1.42 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.69)[-0.693]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; NEURAL_HAM_LONG(-0.50)[-0.504]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.52)[-0.521]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::844:from]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[184.144.87.103: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]; RCVD_TLS_ALL(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: Thu, 21 May 2020 17:13:04 -0000 On Thu, May 21, 2020 at 08:09:58PM +0300, Konstantin Belousov wrote: > On Thu, May 21, 2020 at 01:01:24PM -0400, Mark Johnston wrote: > > On Thu, May 21, 2020 at 07:56:46PM +0300, Konstantin Belousov wrote: > > > On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote: > > > > On 5/21/20 8:12 AM, Mark Johnston wrote: > > > > > On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote: > > > > >> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: > > > > >>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: > > > > >>>> > > > > >>>> Author: kib > > > > >>>> Date: Wed May 20 22:08:26 2020 > > > > >>>> New Revision: 361303 > > > > >>>> URL: https://svnweb.freebsd.org/changeset/base/361303 > > > > >>>> > > > > >>>> Log: > > > > >>>> Change the samantic of struct link_map l_addr member. > > > > >>>> > > > > >>>> It previously returned the object map base address, while all other > > > > >>>> ELF operating systems return load offset, i.e. the difference between > > > > >>>> map base and the link base. > > > > >>>> > > > > >>>> Explain the meaning of the field in the man page. > > > > >>>> > > > > >>>> Stop filling the mips-only l_offs member, which is apparently unused. > > > > >>>> > > > > >>>> PR: 246561 > > > > >>>> Requested by: Damjan Jovanovic > > > > >>>> Reviewed by: emaste, jhb, cem (previous version) > > > > >>>> Sponsored by: The FreeBSD Foundation > > > > >>>> MFC after: 1 week > > > > >>>> Differential revision: https://reviews.freebsd.org/D24918 > > > > >>>> > > > > >>>> Modified: > > > > >>>> head/lib/libc/gen/dlinfo.3 > > > > >>>> head/libexec/rtld-elf/rtld.c > > > > >>>> head/sys/sys/link_elf.h > > > > >>> > > > > >>> Hi, > > > > >>> > > > > >>> After this commit, some ports fail to build with signal 11. > > > > >>> For instance lang/perl5.30 fails to build with default options (DTRACE on) > > > > >>> Disabling the DTRACE option makes it able to build again. > > > > >>> > > > > >> I see, thank you for reporting. > > > > >> > > > > >> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes > > > > >> that l_addr is the base, not relocbase. > > > > >> > > > > >> Mark, was dofhp_addr initialization changed comparing to Solaris ? > > > > > > > > > > It appears it has been the same since DTrace was imported. illumos > > > > > still has similar code. > > > > > > > > > > Note that drti.o is linked into any executable and shlib that defines > > > > > static probes, so the ABI change affects more than just dtrace(1). > > > > > Would it be possible to define a new value for RTLD_DI_LINKMAP, and > > > > > preserve the old behaviour for the old value? > > > > > > > > I think a bigger question is if Solaris/illumos treat l_addr as mapbase > > > > (absolute address) or relocbase (relative address). In the discussion > > > > in the phabricator I had assumed that all other OS's treated l_addr as > > > > the relative offset (relocbase). Does the code for illumos assume an > > > > absolute address or does it assume a relative address in l_addr? > > > > > > It is rather clear, since the dtrace code was pristine, that Solaris > > > provides the mapbase. I do not have Solaris/Illumos box anymore > > > (for quite some time), so I cannot check directly. > > > > > > My current PoV is that l_addr semantic must be restored, and relocbase > > > provided by newly added member. > > > > > > BTW, it is strange that perl triggers it, is it linked as PIE on HEAD ? > > > > Isn't the problem when perl is *not* linked as PIE? In this case > > relocbase is 0, so the ELF header access becomes a NULL pointer > > dereference. > drti checks for ET_DYN, only then it uses l_addr at all. The problem is before that, where it treats l_addr as a pointer to the ELF header so it can check the type. > PIE binaries are dso with non-zero base, non-PIE binaries are ET_EXEC, > which should make dtri.c ignore the l_addr value. From owner-svn-src-all@freebsd.org Thu May 21 17:34: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 1515B2DEDB5; Thu, 21 May 2020 17:34:32 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ScF36nw4z43YZ; Thu, 21 May 2020 17:34:31 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E491511331; Thu, 21 May 2020 17:34:31 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LHYVoR047007; Thu, 21 May 2020 17:34:31 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LHYVON047006; Thu, 21 May 2020 17:34:31 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <202005211734.04LHYVON047006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Thu, 21 May 2020 17:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361337 - head/usr.bin/indent X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/usr.bin/indent X-SVN-Commit-Revision: 361337 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, 21 May 2020 17:34:32 -0000 Author: pstef Date: Thu May 21 17:34:31 2020 New Revision: 361337 URL: https://svnweb.freebsd.org/changeset/base/361337 Log: indent(1): add fallthrough markers This silences -Wimplicit-fallthrough warnings. Submitted by: Michael Paquier Obtained from: postgresql.org MFC after: 3 days Modified: head/usr.bin/indent/indent.c head/usr.bin/indent/parse.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Thu May 21 15:53:16 2020 (r361336) +++ head/usr.bin/indent/indent.c Thu May 21 17:34:31 2020 (r361337) @@ -967,6 +967,7 @@ check_type: case structure: if (ps.p_l_follow > 0) goto copy_id; + /* FALLTHROUGH */ case decl: /* we have a declaration type (int, etc.) */ parse(decl); /* let parser worry about indentation */ if (ps.last_token == rparen && ps.tos <= 1) { Modified: head/usr.bin/indent/parse.c ============================================================================== --- head/usr.bin/indent/parse.c Thu May 21 15:53:16 2020 (r361336) +++ head/usr.bin/indent/parse.c Thu May 21 17:34:31 2020 (r361337) @@ -107,6 +107,7 @@ parse(int tk) /* tk: the code for the construct scanne */ ps.i_l_follow = ps.il[ps.tos--]; /* the rest is the same as for dolit and forstmt */ + /* FALLTHROUGH */ case dolit: /* 'do' */ case forstmt: /* for (...) */ ps.p_stack[++ps.tos] = tk; From owner-svn-src-all@freebsd.org Thu May 21 18:38: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 840102F0E8D; Thu, 21 May 2020 18:38: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 49Sdg62yXWz46ny; Thu, 21 May 2020 18:38: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 609FE11BAB; Thu, 21 May 2020 18:38: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 04LIcgg1084102; Thu, 21 May 2020 18:38:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LIcgdS084101; Thu, 21 May 2020 18:38:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005211838.04LIcgdS084101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 21 May 2020 18:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361338 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 361338 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, 21 May 2020 18:38:42 -0000 Author: markj Date: Thu May 21 18:38:41 2020 New Revision: 361338 URL: https://svnweb.freebsd.org/changeset/base/361338 Log: Fix ACCEPT_FILTER_DEFINE to pass the version to MODULE_VERSION. MFC with: r361263 Modified: head/sys/sys/socketvar.h Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Thu May 21 17:34:31 2020 (r361337) +++ head/sys/sys/socketvar.h Thu May 21 18:38:41 2020 (r361338) @@ -349,7 +349,7 @@ struct accept_filter { }; \ DECLARE_MODULE(modname, modname##_mod, SI_SUB_DRIVERS, \ SI_ORDER_MIDDLE); \ - MODULE_VERSION(modname, 1) + MODULE_VERSION(modname, ver) #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_ACCF); From owner-svn-src-all@freebsd.org Thu May 21 18:50: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 DA8AE2F1203; Thu, 21 May 2020 18:50: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 49SdwF5Psrz47P1; Thu, 21 May 2020 18:50: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 B4E6011ADC; Thu, 21 May 2020 18:50:05 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LIo5bj090153; Thu, 21 May 2020 18:50:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LIo5Kl090152; Thu, 21 May 2020 18:50:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005211850.04LIo5Kl090152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 May 2020 18:50:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r361339 - releng/11.4/usr.sbin/certctl X-SVN-Group: releng X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: releng/11.4/usr.sbin/certctl X-SVN-Commit-Revision: 361339 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, 21 May 2020 18:50:05 -0000 Author: kevans Date: Thu May 21 18:50:05 2020 New Revision: 361339 URL: https://svnweb.freebsd.org/changeset/base/361339 Log: MFS r361310: MFC r361022-361023, 361148: certctl(8) fixes r361022: certctl(8): don't completely nuke $CERTDESTDIR It's been reported/noted that a well-timed `certctl rehash` will completely obliterate $CERTDESTDIR, which may get used by ports or system administrators. While we can't guarantee the certctl semantics when other non-certctl-controlled bits live here, we should make some amount of effort to play nice. Pruning all existing links, which we'll subsequently rebuild as needed, is sufficient for our needs. This can still be destructive, but it's perhaps less likely to cause issues. I also note that we should probably be pruning /etc/ssl/blacklisted upon rehash as well. r361023: certctl: follow-up to r361022, prune blacklist as well Otherwise, removals from the blacklist may not get processed as they should. While we're here, restructure these to not bother with mkdir(1) if we've already tested them to exist. r361148: certctl: don't fall over flat with relative DESTDIR Up until now, all of our DESTDIR use has been with absolute paths. It turned out that the cd in/out dance we do here breaks us down later on, as the relative path no longer resolves. Convert EXTENSIONS to an ERE that we'll use to grep ls -1 of the dir we're inspecting, rather than cd'ing into it and globbing it up. Approved by: re (kib) Modified: releng/11.4/usr.sbin/certctl/certctl.sh Directory Properties: releng/11.4/ (props changed) Modified: releng/11.4/usr.sbin/certctl/certctl.sh ============================================================================== --- releng/11.4/usr.sbin/certctl/certctl.sh Thu May 21 18:38:41 2020 (r361338) +++ releng/11.4/usr.sbin/certctl/certctl.sh Thu May 21 18:50:05 2020 (r361339) @@ -34,7 +34,7 @@ : ${BLACKLISTPATH:=${DESTDIR}/usr/share/certs/blacklisted:${DESTDIR}/usr/local/etc/ssl/blacklisted} : ${CERTDESTDIR:=${DESTDIR}/etc/ssl/certs} : ${BLACKLISTDESTDIR:=${DESTDIR}/etc/ssl/blacklisted} -: ${EXTENSIONS:="*.pem *.crt *.cer *.crl *.0"} +: ${FILEPAT:="\.pem$|\.crt$|\.cer$|\.crl$|\.0$"} : ${VERBOSE:=0} ############################################################ GLOBALS @@ -104,13 +104,11 @@ do_scan() for CPATH in "$@"; do [ -d "$CPATH" ] || continue echo "Scanning $CPATH for certificates..." - cd "$CPATH" - for CFILE in $EXTENSIONS; do - [ -e "$CFILE" ] || continue + for CFILE in $(ls -1 "${CPATH}" | grep -Ee "${FILEPAT}"); do + [ -e "$CPATH/$CFILE" ] || continue [ $VERBOSE -gt 0 ] && echo "Reading $CFILE" "$CFUNC" "$CPATH/$CFILE" done - cd - done } @@ -142,9 +140,18 @@ do_list() cmd_rehash() { - [ $NOOP -eq 0 ] && rm -rf "$CERTDESTDIR" - [ $NOOP -eq 0 ] && mkdir -p "$CERTDESTDIR" - [ $NOOP -eq 0 ] && mkdir -p "$BLACKLISTDESTDIR" + if [ $NOOP -eq 0 ]; then + if [ -e "$CERTDESTDIR" ]; then + find "$CERTDESTDIR" -type link -delete + else + mkdir -p "$CERTDESTDIR" + fi + if [ -e "$BLACKLISTDESTDIR" ]; then + find "$BLACKLISTDESTDIR" -type link -delete + else + mkdir -p "$BLACKLISTDESTDIR" + fi + fi do_scan create_blacklisted "$BLACKLISTPATH" do_scan create_trusted_link "$TRUSTPATH" From owner-svn-src-all@freebsd.org Thu May 21 19:30: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 ECD302F23EC; Thu, 21 May 2020 19:30:49 +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 49SfqF63SJz4B31; Thu, 21 May 2020 19:30:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:fd49:a52a:25ad:4719]) (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 1445C1B168; Thu, 21 May 2020 19:30:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys To: Konstantin Belousov Cc: Mark Johnston , Antoine Brodin , src-committers , svn-src-all , svn-src-head@freebsd.org References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> <20200521151248.GA85681@raichu> <20200521165646.GF64045@kib.kiev.ua> 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: <25dcdfaa-fea9-98a1-c731-db37489ccc6b@FreeBSD.org> Date: Thu, 21 May 2020 12:30:47 -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: <20200521165646.GF64045@kib.kiev.ua> 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, 21 May 2020 19:30:50 -0000 On 5/21/20 9:56 AM, Konstantin Belousov wrote: > On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote: >> On 5/21/20 8:12 AM, Mark Johnston wrote: >>> On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote: >>>> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: >>>>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: >>>>>> >>>>>> Author: kib >>>>>> Date: Wed May 20 22:08:26 2020 >>>>>> New Revision: 361303 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/361303 >>>>>> >>>>>> Log: >>>>>> Change the samantic of struct link_map l_addr member. >>>>>> >>>>>> It previously returned the object map base address, while all other >>>>>> ELF operating systems return load offset, i.e. the difference between >>>>>> map base and the link base. >>>>>> >>>>>> Explain the meaning of the field in the man page. >>>>>> >>>>>> Stop filling the mips-only l_offs member, which is apparently unused. >>>>>> >>>>>> PR: 246561 >>>>>> Requested by: Damjan Jovanovic >>>>>> Reviewed by: emaste, jhb, cem (previous version) >>>>>> Sponsored by: The FreeBSD Foundation >>>>>> MFC after: 1 week >>>>>> Differential revision: https://reviews.freebsd.org/D24918 >>>>>> >>>>>> Modified: >>>>>> head/lib/libc/gen/dlinfo.3 >>>>>> head/libexec/rtld-elf/rtld.c >>>>>> head/sys/sys/link_elf.h >>>>> >>>>> Hi, >>>>> >>>>> After this commit, some ports fail to build with signal 11. >>>>> For instance lang/perl5.30 fails to build with default options (DTRACE on) >>>>> Disabling the DTRACE option makes it able to build again. >>>>> >>>> I see, thank you for reporting. >>>> >>>> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes >>>> that l_addr is the base, not relocbase. >>>> >>>> Mark, was dofhp_addr initialization changed comparing to Solaris ? >>> >>> It appears it has been the same since DTrace was imported. illumos >>> still has similar code. >>> >>> Note that drti.o is linked into any executable and shlib that defines >>> static probes, so the ABI change affects more than just dtrace(1). >>> Would it be possible to define a new value for RTLD_DI_LINKMAP, and >>> preserve the old behaviour for the old value? >> >> I think a bigger question is if Solaris/illumos treat l_addr as mapbase >> (absolute address) or relocbase (relative address). In the discussion >> in the phabricator I had assumed that all other OS's treated l_addr as >> the relative offset (relocbase). Does the code for illumos assume an >> absolute address or does it assume a relative address in l_addr? > > It is rather clear, since the dtrace code was pristine, that Solaris > provides the mapbase. I do not have Solaris/Illumos box anymore > (for quite some time), so I cannot check directly. > > My current PoV is that l_addr semantic must be restored, and relocbase > provided by newly added member. I am fine with reverting the l_addr semantic. I'm still not sure how to resolve the original PR, though perhaps Wine just has to carry a local patch forever? GDB will work via the current accident so long as we never pre-link libraries. As long as PIE binaries have a starting VA of 0 like our shared libraries then I think GDB will be ok with our PIE binaries as well. -- John Baldwin From owner-svn-src-all@freebsd.org Thu May 21 19:41: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 DB4782F28F4; Thu, 21 May 2020 19:41:25 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Sg3T5Y5lz4CTT; Thu, 21 May 2020 19:41:25 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B98EB12AE1; Thu, 21 May 2020 19:41:25 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LJfPJJ023813; Thu, 21 May 2020 19:41:25 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LJfPQ0023810; Thu, 21 May 2020 19:41:25 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202005211941.04LJfPQ0023810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Thu, 21 May 2020 19:41:25 +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: r361340 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 361340 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, 21 May 2020 19:41:25 -0000 Author: rscheff Date: Thu May 21 19:41:25 2020 New Revision: 361340 URL: https://svnweb.freebsd.org/changeset/base/361340 Log: MFC r360479: Prevent premature shrinking of the scaled receive window which can cause a TCP client to use invalid or stale TCP sequence numbers for ACK packets. Packets with old sequence numbers are ignored and not used to update the send window size. This might cause the TCP session to hang indefinitely under some circumstances. Reported by: Cui Cheng Reviewed by: tuexen (mentor), rgrimes (mentor, blanket) Approved by: tuexen (mentor), rgrimes (mentor, blanket) MFC after: 3 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D24515 Modified: stable/12/sys/netinet/tcp_output.c stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_output.c ============================================================================== --- stable/12/sys/netinet/tcp_output.c Thu May 21 18:50:05 2020 (r361339) +++ stable/12/sys/netinet/tcp_output.c Thu May 21 19:41:25 2020 (r361340) @@ -1206,8 +1206,11 @@ send: if (flags & TH_SYN) th->th_win = htons((u_short) (min(sbspace(&so->so_rcv), TCP_MAXWIN))); - else + else { + /* Avoid shrinking window with window scaling. */ + recwin = roundup2(recwin, 1 << tp->rcv_scale); th->th_win = htons((u_short)(recwin >> tp->rcv_scale)); + } /* * Adjust the RXWIN0SENT flag - indicate that we have advertised Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu May 21 18:50:05 2020 (r361339) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu May 21 19:41:25 2020 (r361340) @@ -8355,8 +8355,11 @@ send: if (flags & TH_SYN) th->th_win = htons((u_short) (min(sbspace(&so->so_rcv), TCP_MAXWIN))); - else + else { + /* Avoid shrinking window with window scaling. */ + recwin = roundup2(recwin, 1 << tp->rcv_scale); th->th_win = htons((u_short)(recwin >> tp->rcv_scale)); + } /* * Adjust the RXWIN0SENT flag - indicate that we have advertised a 0 * window. This may cause the remote transmitter to stall. This From owner-svn-src-all@freebsd.org Thu May 21 19:45: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 7F15A2F2D37; Thu, 21 May 2020 19:45:15 +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 49Sg7v2lLZz4D9n; Thu, 21 May 2020 19:45:15 +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 593FF12D87; Thu, 21 May 2020 19:45:15 +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 04LJjF0n027238; Thu, 21 May 2020 19:45:15 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LJjFgi027237; Thu, 21 May 2020 19:45:15 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005211945.04LJjFgi027237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 May 2020 19:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r361341 - releng/11.4/secure/caroot/trusted X-SVN-Group: releng X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: releng/11.4/secure/caroot/trusted X-SVN-Commit-Revision: 361341 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, 21 May 2020 19:45:15 -0000 Author: kevans Date: Thu May 21 19:45:14 2020 New Revision: 361341 URL: https://svnweb.freebsd.org/changeset/base/361341 Log: Revert r360395: MFC r353095, r355376: add root bundle certctl(8) demonstrably has some logistics issues that still need to be worked out, as pointed out in at least PR 228913, 246614. I do not feel comfortable with proceeding with my original plan for the impending release without resolving at least PR 246614 and being able to get the release(7) scripts into a state where they're producing VM images that more closesly resemble a bsdinstall-produced install. 11.4 will still maintain the current version of certctl(8) that works well for most cases, and it still includes the caroot infrastructure. I do not currently intend to revert this in stable/11, as I would still like folks along stable/11 to be able to participate in Q/A'ing this feature. Approved by: re (gjb) Deleted: releng/11.4/secure/caroot/trusted/ACCVRAIZ1.pem releng/11.4/secure/caroot/trusted/AC_RAIZ_FNMT-RCM.pem releng/11.4/secure/caroot/trusted/Actalis_Authentication_Root_CA.pem releng/11.4/secure/caroot/trusted/AddTrust_External_Root.pem releng/11.4/secure/caroot/trusted/AddTrust_Low-Value_Services_Root.pem releng/11.4/secure/caroot/trusted/AffirmTrust_Commercial.pem releng/11.4/secure/caroot/trusted/AffirmTrust_Networking.pem releng/11.4/secure/caroot/trusted/AffirmTrust_Premium.pem releng/11.4/secure/caroot/trusted/AffirmTrust_Premium_ECC.pem releng/11.4/secure/caroot/trusted/Amazon_Root_CA_1.pem releng/11.4/secure/caroot/trusted/Amazon_Root_CA_2.pem releng/11.4/secure/caroot/trusted/Amazon_Root_CA_3.pem releng/11.4/secure/caroot/trusted/Amazon_Root_CA_4.pem releng/11.4/secure/caroot/trusted/Atos_TrustedRoot_2011.pem releng/11.4/secure/caroot/trusted/Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.pem releng/11.4/secure/caroot/trusted/Baltimore_CyberTrust_Root.pem releng/11.4/secure/caroot/trusted/Buypass_Class_2_Root_CA.pem releng/11.4/secure/caroot/trusted/Buypass_Class_3_Root_CA.pem releng/11.4/secure/caroot/trusted/CA_Disig_Root_R2.pem releng/11.4/secure/caroot/trusted/CFCA_EV_ROOT.pem releng/11.4/secure/caroot/trusted/COMODO_Certification_Authority.pem releng/11.4/secure/caroot/trusted/COMODO_ECC_Certification_Authority.pem releng/11.4/secure/caroot/trusted/COMODO_RSA_Certification_Authority.pem releng/11.4/secure/caroot/trusted/Camerfirma_Chambers_of_Commerce_Root.pem releng/11.4/secure/caroot/trusted/Camerfirma_Global_Chambersign_Root.pem releng/11.4/secure/caroot/trusted/Certigna.pem releng/11.4/secure/caroot/trusted/Certigna_Root_CA.pem releng/11.4/secure/caroot/trusted/Certum_Root_CA.pem releng/11.4/secure/caroot/trusted/Certum_Trusted_Network_CA.pem releng/11.4/secure/caroot/trusted/Certum_Trusted_Network_CA_2.pem releng/11.4/secure/caroot/trusted/Chambers_of_Commerce_Root_-_2008.pem releng/11.4/secure/caroot/trusted/Comodo_AAA_Services_root.pem releng/11.4/secure/caroot/trusted/Cybertrust_Global_Root.pem releng/11.4/secure/caroot/trusted/D-TRUST_Root_CA_3_2013.pem releng/11.4/secure/caroot/trusted/D-TRUST_Root_Class_3_CA_2_2009.pem releng/11.4/secure/caroot/trusted/D-TRUST_Root_Class_3_CA_2_EV_2009.pem releng/11.4/secure/caroot/trusted/DST_Root_CA_X3.pem releng/11.4/secure/caroot/trusted/DigiCert_Assured_ID_Root_CA.pem releng/11.4/secure/caroot/trusted/DigiCert_Assured_ID_Root_G2.pem releng/11.4/secure/caroot/trusted/DigiCert_Assured_ID_Root_G3.pem releng/11.4/secure/caroot/trusted/DigiCert_Global_Root_CA.pem releng/11.4/secure/caroot/trusted/DigiCert_Global_Root_G2.pem releng/11.4/secure/caroot/trusted/DigiCert_Global_Root_G3.pem releng/11.4/secure/caroot/trusted/DigiCert_High_Assurance_EV_Root_CA.pem releng/11.4/secure/caroot/trusted/DigiCert_Trusted_Root_G4.pem releng/11.4/secure/caroot/trusted/E-Tugra_Certification_Authority.pem releng/11.4/secure/caroot/trusted/EC-ACC.pem releng/11.4/secure/caroot/trusted/EE_Certification_Centre_Root_CA.pem releng/11.4/secure/caroot/trusted/Entrust_Root_Certification_Authority.pem releng/11.4/secure/caroot/trusted/Entrust_Root_Certification_Authority_-_EC1.pem releng/11.4/secure/caroot/trusted/Entrust_Root_Certification_Authority_-_G2.pem releng/11.4/secure/caroot/trusted/Entrust_Root_Certification_Authority_-_G4.pem releng/11.4/secure/caroot/trusted/Entrust_net_Premium_2048_Secure_Server_CA.pem releng/11.4/secure/caroot/trusted/GDCA_TrustAUTH_R5_ROOT.pem releng/11.4/secure/caroot/trusted/GTS_Root_R1.pem releng/11.4/secure/caroot/trusted/GTS_Root_R2.pem releng/11.4/secure/caroot/trusted/GTS_Root_R3.pem releng/11.4/secure/caroot/trusted/GTS_Root_R4.pem releng/11.4/secure/caroot/trusted/GeoTrust_Global_CA.pem releng/11.4/secure/caroot/trusted/GeoTrust_Primary_Certification_Authority.pem releng/11.4/secure/caroot/trusted/GeoTrust_Primary_Certification_Authority_-_G2.pem releng/11.4/secure/caroot/trusted/GeoTrust_Primary_Certification_Authority_-_G3.pem releng/11.4/secure/caroot/trusted/GeoTrust_Universal_CA.pem releng/11.4/secure/caroot/trusted/GeoTrust_Universal_CA_2.pem releng/11.4/secure/caroot/trusted/GlobalSign_ECC_Root_CA_-_R4.pem releng/11.4/secure/caroot/trusted/GlobalSign_ECC_Root_CA_-_R5.pem releng/11.4/secure/caroot/trusted/GlobalSign_Root_CA.pem releng/11.4/secure/caroot/trusted/GlobalSign_Root_CA_-_R2.pem releng/11.4/secure/caroot/trusted/GlobalSign_Root_CA_-_R3.pem releng/11.4/secure/caroot/trusted/GlobalSign_Root_CA_-_R6.pem releng/11.4/secure/caroot/trusted/Global_Chambersign_Root_-_2008.pem releng/11.4/secure/caroot/trusted/Go_Daddy_Class_2_CA.pem releng/11.4/secure/caroot/trusted/Go_Daddy_Root_Certificate_Authority_-_G2.pem releng/11.4/secure/caroot/trusted/Hellenic_Academic_and_Research_Institutions_ECC_RootCA_2015.pem releng/11.4/secure/caroot/trusted/Hellenic_Academic_and_Research_Institutions_RootCA_2011.pem releng/11.4/secure/caroot/trusted/Hellenic_Academic_and_Research_Institutions_RootCA_2015.pem releng/11.4/secure/caroot/trusted/Hongkong_Post_Root_CA_1.pem releng/11.4/secure/caroot/trusted/Hongkong_Post_Root_CA_3.pem releng/11.4/secure/caroot/trusted/ISRG_Root_X1.pem releng/11.4/secure/caroot/trusted/IdenTrust_Commercial_Root_CA_1.pem releng/11.4/secure/caroot/trusted/IdenTrust_Public_Sector_Root_CA_1.pem releng/11.4/secure/caroot/trusted/Izenpe_com.pem releng/11.4/secure/caroot/trusted/LuxTrust_Global_Root_2.pem releng/11.4/secure/caroot/trusted/Microsec_e-Szigno_Root_CA_2009.pem releng/11.4/secure/caroot/trusted/NetLock_Arany__Class_Gold__F__tan__s__tv__ny.pem releng/11.4/secure/caroot/trusted/Network_Solutions_Certificate_Authority.pem releng/11.4/secure/caroot/trusted/OISTE_WISeKey_Global_Root_GA_CA.pem releng/11.4/secure/caroot/trusted/OISTE_WISeKey_Global_Root_GB_CA.pem releng/11.4/secure/caroot/trusted/OISTE_WISeKey_Global_Root_GC_CA.pem releng/11.4/secure/caroot/trusted/QuoVadis_Root_CA.pem releng/11.4/secure/caroot/trusted/QuoVadis_Root_CA_1_G3.pem releng/11.4/secure/caroot/trusted/QuoVadis_Root_CA_2.pem releng/11.4/secure/caroot/trusted/QuoVadis_Root_CA_2_G3.pem releng/11.4/secure/caroot/trusted/QuoVadis_Root_CA_3.pem releng/11.4/secure/caroot/trusted/QuoVadis_Root_CA_3_G3.pem releng/11.4/secure/caroot/trusted/SSL_com_EV_Root_Certification_Authority_ECC.pem releng/11.4/secure/caroot/trusted/SSL_com_EV_Root_Certification_Authority_RSA_R2.pem releng/11.4/secure/caroot/trusted/SSL_com_Root_Certification_Authority_ECC.pem releng/11.4/secure/caroot/trusted/SSL_com_Root_Certification_Authority_RSA.pem releng/11.4/secure/caroot/trusted/SZAFIR_ROOT_CA2.pem releng/11.4/secure/caroot/trusted/SecureSign_RootCA11.pem releng/11.4/secure/caroot/trusted/SecureTrust_CA.pem releng/11.4/secure/caroot/trusted/Secure_Global_CA.pem releng/11.4/secure/caroot/trusted/Security_Communication_RootCA2.pem releng/11.4/secure/caroot/trusted/Security_Communication_Root_CA.pem releng/11.4/secure/caroot/trusted/Sonera_Class_2_Root_CA.pem releng/11.4/secure/caroot/trusted/Staat_der_Nederlanden_EV_Root_CA.pem releng/11.4/secure/caroot/trusted/Staat_der_Nederlanden_Root_CA_-_G2.pem releng/11.4/secure/caroot/trusted/Staat_der_Nederlanden_Root_CA_-_G3.pem releng/11.4/secure/caroot/trusted/Starfield_Class_2_CA.pem releng/11.4/secure/caroot/trusted/Starfield_Root_Certificate_Authority_-_G2.pem releng/11.4/secure/caroot/trusted/Starfield_Services_Root_Certificate_Authority_-_G2.pem releng/11.4/secure/caroot/trusted/SwissSign_Gold_CA_-_G2.pem releng/11.4/secure/caroot/trusted/SwissSign_Platinum_CA_-_G2.pem releng/11.4/secure/caroot/trusted/SwissSign_Silver_CA_-_G2.pem releng/11.4/secure/caroot/trusted/Symantec_Class_1_Public_Primary_Certification_Authority_-_G4.pem releng/11.4/secure/caroot/trusted/Symantec_Class_1_Public_Primary_Certification_Authority_-_G6.pem releng/11.4/secure/caroot/trusted/Symantec_Class_2_Public_Primary_Certification_Authority_-_G4.pem releng/11.4/secure/caroot/trusted/Symantec_Class_2_Public_Primary_Certification_Authority_-_G6.pem releng/11.4/secure/caroot/trusted/T-TeleSec_GlobalRoot_Class_2.pem releng/11.4/secure/caroot/trusted/T-TeleSec_GlobalRoot_Class_3.pem releng/11.4/secure/caroot/trusted/TUBITAK_Kamu_SM_SSL_Kok_Sertifikasi_-_Surum_1.pem releng/11.4/secure/caroot/trusted/TWCA_Global_Root_CA.pem releng/11.4/secure/caroot/trusted/TWCA_Root_Certification_Authority.pem releng/11.4/secure/caroot/trusted/Taiwan_GRCA.pem releng/11.4/secure/caroot/trusted/TeliaSonera_Root_CA_v1.pem releng/11.4/secure/caroot/trusted/TrustCor_ECA-1.pem releng/11.4/secure/caroot/trusted/TrustCor_RootCert_CA-1.pem releng/11.4/secure/caroot/trusted/TrustCor_RootCert_CA-2.pem releng/11.4/secure/caroot/trusted/Trustis_FPS_Root_CA.pem releng/11.4/secure/caroot/trusted/UCA_Extended_Validation_Root.pem releng/11.4/secure/caroot/trusted/UCA_Global_G2_Root.pem releng/11.4/secure/caroot/trusted/USERTrust_ECC_Certification_Authority.pem releng/11.4/secure/caroot/trusted/USERTrust_RSA_Certification_Authority.pem releng/11.4/secure/caroot/trusted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G4.pem releng/11.4/secure/caroot/trusted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5.pem releng/11.4/secure/caroot/trusted/VeriSign_Universal_Root_Certification_Authority.pem releng/11.4/secure/caroot/trusted/Verisign_Class_1_Public_Primary_Certification_Authority_-_G3.pem releng/11.4/secure/caroot/trusted/Verisign_Class_2_Public_Primary_Certification_Authority_-_G3.pem releng/11.4/secure/caroot/trusted/Verisign_Class_3_Public_Primary_Certification_Authority_-_G3.pem releng/11.4/secure/caroot/trusted/XRamp_Global_CA_Root.pem releng/11.4/secure/caroot/trusted/certSIGN_ROOT_CA.pem releng/11.4/secure/caroot/trusted/ePKI_Root_Certification_Authority.pem releng/11.4/secure/caroot/trusted/emSign_ECC_Root_CA_-_C3.pem releng/11.4/secure/caroot/trusted/emSign_ECC_Root_CA_-_G3.pem releng/11.4/secure/caroot/trusted/emSign_Root_CA_-_C1.pem releng/11.4/secure/caroot/trusted/emSign_Root_CA_-_G1.pem releng/11.4/secure/caroot/trusted/thawte_Primary_Root_CA.pem releng/11.4/secure/caroot/trusted/thawte_Primary_Root_CA_-_G2.pem releng/11.4/secure/caroot/trusted/thawte_Primary_Root_CA_-_G3.pem From owner-svn-src-all@freebsd.org Thu May 21 19:46: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 50A072F2CBA; Thu, 21 May 2020 19:46:12 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Sg901Q0fz4Cvb; Thu, 21 May 2020 19:46:12 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B66D12C88; Thu, 21 May 2020 19:46:12 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LJkC33027324; Thu, 21 May 2020 19:46:12 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LJkBme027322; Thu, 21 May 2020 19:46:11 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202005211946.04LJkBme027322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Thu, 21 May 2020 19:46:11 +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: r361342 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 361342 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, 21 May 2020 19:46:12 -0000 Author: rscheff Date: Thu May 21 19:46:11 2020 New Revision: 361342 URL: https://svnweb.freebsd.org/changeset/base/361342 Log: MFC r360477: Correctly set up the initial TCP congestion window in all cases by not including the SYN bit sequence space in cwnd related calculations. Snd_und is adjusted explicitly in all cases, outside the cwnd update, instead. This fixes an off-by-one conformance issue with regular TCP sessions not using Appropriate Byte Counting (RFC3465), sending one more packet during the initial window than expected. PR: 235256 Reviewed by: tuexen (mentor), rgrimes (mentor, blanket) Approved by: tuexen (mentor), rgrimes (mentor, blanket) MFC after: 3 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D19000 Modified: stable/12/sys/netinet/tcp_input.c stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Thu May 21 19:45:14 2020 (r361341) +++ stable/12/sys/netinet/tcp_input.c Thu May 21 19:46:11 2020 (r361342) @@ -1519,7 +1519,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru struct tcpcb *tp, int drop_hdrlen, int tlen, uint8_t iptos) { int thflags, acked, ourfinisacked, needoutput = 0, sack_changed; - int rstreason, todrop, win; + int rstreason, todrop, win, incforsyn = 0; uint32_t tiwin; uint16_t nsegs; char *s; @@ -2432,12 +2432,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru if (IS_FASTOPEN(tp->t_flags) && tp->t_tfo_pending) { tcp_fastopen_decrement_counter(tp->t_tfo_pending); tp->t_tfo_pending = NULL; - - /* - * Account for the ACK of our SYN prior to - * regular ACK processing below. - */ - tp->snd_una++; } if (tp->t_flags & TF_NEEDFIN) { tcp_state_change(tp, TCPS_FIN_WAIT_1); @@ -2458,6 +2452,13 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); } /* + * Account for the ACK of our SYN prior to + * regular ACK processing below, except for + * simultaneous SYN, which is handled later. + */ + if (SEQ_GT(th->th_ack, tp->snd_una) && !(tp->t_flags & TF_NEEDSYN)) + incforsyn = 1; + /* * If segment contains data or ACK, will call tcp_reass() * later; if not, do so now to pass queued data to user. */ @@ -2751,6 +2752,15 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru process_ACK: INP_WLOCK_ASSERT(tp->t_inpcb); + /* + * Adjust for the SYN bit in sequence space, + * but don't account for it in cwnd calculations. + * This is for the SYN_RECEIVED, non-simultaneous + * SYN case. SYN_SENT and simultaneous SYN are + * treated elsewhere. + */ + if (incforsyn) + tp->snd_una++; acked = BYTES_THIS_ACK(tp, th); KASSERT(acked >= 0, ("%s: acked unexepectedly negative " "(tp->snd_una=%u, th->th_ack=%u, tp=%p, m=%p)", __func__, Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu May 21 19:45:14 2020 (r361341) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu May 21 19:46:11 2020 (r361342) @@ -5580,12 +5580,6 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st if (IS_FASTOPEN(tp->t_flags) && tp->t_tfo_pending) { tcp_fastopen_decrement_counter(tp->t_tfo_pending); tp->t_tfo_pending = NULL; - - /* - * Account for the ACK of our SYN prior to - * regular ACK processing below. - */ - tp->snd_una++; } if (tp->t_flags & TF_NEEDFIN) { tcp_state_change(tp, TCPS_FIN_WAIT_1); @@ -5603,6 +5597,13 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st if (!IS_FASTOPEN(tp->t_flags)) cc_conn_init(tp); } + /* + * Account for the ACK of our SYN prior to + * regular ACK processing below, except for + * simultaneous SYN, which is handled later. + */ + if (SEQ_GT(th->th_ack, tp->snd_una) && !(tp->t_flags & TF_NEEDSYN)) + tp->snd_una++; /* * If segment contains data or ACK, will call tcp_reass() later; if * not, do so now to pass queued data to user. From owner-svn-src-all@freebsd.org Thu May 21 19:50: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 C5C962F318B; Thu, 21 May 2020 19:50:19 +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 49SgFk6ltmz4DXQ; Thu, 21 May 2020 19:50:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 04LJoAmp062897 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 21 May 2020 22:50:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 04LJoAmp062897 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 04LJoAVC062895; Thu, 21 May 2020 22:50:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 21 May 2020 22:50:10 +0300 From: Konstantin Belousov To: John Baldwin Cc: Mark Johnston , Antoine Brodin , src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r361303 - in head: lib/libc/gen libexec/rtld-elf sys/sys Message-ID: <20200521195010.GJ64045@kib.kiev.ua> References: <202005202208.04KM8QPA020707@repo.freebsd.org> <20200521134152.GE64045@kib.kiev.ua> <20200521151248.GA85681@raichu> <20200521165646.GF64045@kib.kiev.ua> <25dcdfaa-fea9-98a1-c731-db37489ccc6b@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <25dcdfaa-fea9-98a1-c731-db37489ccc6b@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: 49SgFk6ltmz4DXQ 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:6939, ipnet:2001:470::/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: Thu, 21 May 2020 19:50:19 -0000 On Thu, May 21, 2020 at 12:30:47PM -0700, John Baldwin wrote: > On 5/21/20 9:56 AM, Konstantin Belousov wrote: > > On Thu, May 21, 2020 at 09:03:44AM -0700, John Baldwin wrote: > >> On 5/21/20 8:12 AM, Mark Johnston wrote: > >>> On Thu, May 21, 2020 at 04:41:52PM +0300, Konstantin Belousov wrote: > >>>> On Thu, May 21, 2020 at 03:02:07PM +0200, Antoine Brodin wrote: > >>>>> On Thu, May 21, 2020 at 12:08 AM Konstantin Belousov wrote: > >>>>>> > >>>>>> Author: kib > >>>>>> Date: Wed May 20 22:08:26 2020 > >>>>>> New Revision: 361303 > >>>>>> URL: https://svnweb.freebsd.org/changeset/base/361303 > >>>>>> > >>>>>> Log: > >>>>>> Change the samantic of struct link_map l_addr member. > >>>>>> > >>>>>> It previously returned the object map base address, while all other > >>>>>> ELF operating systems return load offset, i.e. the difference between > >>>>>> map base and the link base. > >>>>>> > >>>>>> Explain the meaning of the field in the man page. > >>>>>> > >>>>>> Stop filling the mips-only l_offs member, which is apparently unused. > >>>>>> > >>>>>> PR: 246561 > >>>>>> Requested by: Damjan Jovanovic > >>>>>> Reviewed by: emaste, jhb, cem (previous version) > >>>>>> Sponsored by: The FreeBSD Foundation > >>>>>> MFC after: 1 week > >>>>>> Differential revision: https://reviews.freebsd.org/D24918 > >>>>>> > >>>>>> Modified: > >>>>>> head/lib/libc/gen/dlinfo.3 > >>>>>> head/libexec/rtld-elf/rtld.c > >>>>>> head/sys/sys/link_elf.h > >>>>> > >>>>> Hi, > >>>>> > >>>>> After this commit, some ports fail to build with signal 11. > >>>>> For instance lang/perl5.30 fails to build with default options (DTRACE on) > >>>>> Disabling the DTRACE option makes it able to build again. > >>>>> > >>>> I see, thank you for reporting. > >>>> > >>>> So drti.c:dtrace_dof_init() does read l_addr, and the dtrace code assumes > >>>> that l_addr is the base, not relocbase. > >>>> > >>>> Mark, was dofhp_addr initialization changed comparing to Solaris ? > >>> > >>> It appears it has been the same since DTrace was imported. illumos > >>> still has similar code. > >>> > >>> Note that drti.o is linked into any executable and shlib that defines > >>> static probes, so the ABI change affects more than just dtrace(1). > >>> Would it be possible to define a new value for RTLD_DI_LINKMAP, and > >>> preserve the old behaviour for the old value? > >> > >> I think a bigger question is if Solaris/illumos treat l_addr as mapbase > >> (absolute address) or relocbase (relative address). In the discussion > >> in the phabricator I had assumed that all other OS's treated l_addr as > >> the relative offset (relocbase). Does the code for illumos assume an > >> absolute address or does it assume a relative address in l_addr? > > > > It is rather clear, since the dtrace code was pristine, that Solaris > > provides the mapbase. I do not have Solaris/Illumos box anymore > > (for quite some time), so I cannot check directly. > > > > My current PoV is that l_addr semantic must be restored, and relocbase > > provided by newly added member. > > I am fine with reverting the l_addr semantic. I'm still not sure how to > resolve the original PR, though perhaps Wine just has to carry a local > patch forever? GDB will work via the current accident so long as we > never pre-link libraries. As long as PIE binaries have a starting VA of > 0 like our shared libraries then I think GDB will be ok with our PIE > binaries as well. Wine should work without patch now, and after the D24918 is applied, too. I do not intend to revert l_addr to the 'load address' semantic. I am actually trying to find a solaris box to compile the test program. From owner-svn-src-all@freebsd.org Thu May 21 20:18: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 D6CB62F3B58; Thu, 21 May 2020 20:18:38 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SgtQ5FmGz4Fq9; Thu, 21 May 2020 20:18:38 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF7B012D76; Thu, 21 May 2020 20:18:38 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LKIcxO045752; Thu, 21 May 2020 20:18:38 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LKIcJ7045750; Thu, 21 May 2020 20:18:38 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005212018.04LKIcJ7045750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 21 May 2020 20:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361343 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 361343 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, 21 May 2020 20:18:38 -0000 Author: manu Date: Thu May 21 20:18:38 2020 New Revision: 361343 URL: https://svnweb.freebsd.org/changeset/base/361343 Log: linuxkpi: Add rcu_work functions The rcu_work function helps to queue some work after waiting for a grace period. This is needed by DRM drivers. Sponsored-by: The FreeBSD Foundation Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D24942 Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h head/sys/compat/linuxkpi/common/src/linux_work.c Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/workqueue.h Thu May 21 19:46:11 2020 (r361342) +++ head/sys/compat/linuxkpi/common/include/linux/workqueue.h Thu May 21 20:18:38 2020 (r361343) @@ -72,6 +72,13 @@ struct work_struct { atomic_t state; }; +struct rcu_work { + struct work_struct work; + struct rcu_head rcu; + + struct workqueue_struct *wq; +}; + #define DECLARE_WORK(name, fn) \ struct work_struct name; \ static void name##_init(void *arg) \ @@ -112,6 +119,9 @@ do { \ TASK_INIT(&(work)->work_task, 0, linux_work_fn, (work)); \ } while (0) +#define INIT_RCU_WORK(_work, _fn) \ + INIT_WORK(&(_work)->work, (_fn)) + #define INIT_WORK_ONSTACK(work, fn) \ INIT_WORK(work, fn) @@ -192,6 +202,12 @@ do { \ #define flush_work(work) \ linux_flush_work(work) +#define queue_rcu_work(wq, rwork) \ + linux_queue_rcu_work(wq, rwork) + +#define flush_rcu_work(rwork) \ + linux_flush_rcu_work(rwork) + #define flush_delayed_work(dwork) \ linux_flush_delayed_work(dwork) @@ -237,5 +253,7 @@ extern bool linux_flush_delayed_work(struct delayed_wo extern bool linux_work_pending(struct work_struct *); extern bool linux_work_busy(struct work_struct *); extern struct work_struct *linux_current_work(void); +extern bool linux_queue_rcu_work(struct workqueue_struct *wq, struct rcu_work *rwork); +extern bool linux_flush_rcu_work(struct rcu_work *rwork); #endif /* _LINUX_WORKQUEUE_H_ */ Modified: head/sys/compat/linuxkpi/common/src/linux_work.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_work.c Thu May 21 19:46:11 2020 (r361342) +++ head/sys/compat/linuxkpi/common/src/linux_work.c Thu May 21 20:18:38 2020 (r361343) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -153,6 +154,53 @@ linux_queue_work_on(int cpu __unused, struct workqueue default: return (false); /* already on a queue */ } +} + +/* + * Callback func for linux_queue_rcu_work + */ +static void +rcu_work_func(struct rcu_head *rcu) +{ + struct rcu_work *rwork; + + rwork = container_of(rcu, struct rcu_work, rcu); + linux_queue_work_on(WORK_CPU_UNBOUND, rwork->wq, &rwork->work); +} + +/* + * This function queue a work after a grace period + * If the work was already pending it returns false, + * if not it calls call_rcu and returns true. + */ +bool +linux_queue_rcu_work(struct workqueue_struct *wq, struct rcu_work *rwork) +{ + + if (!linux_work_pending(&rwork->work)) { + rwork->wq = wq; + linux_call_rcu(RCU_TYPE_REGULAR, &rwork->rcu, rcu_work_func); + return (true); + } + return (false); +} + +/* + * This function waits for the last execution of a work and then + * flush the work. + * It returns true if the work was pending and we waited, it returns + * false otherwise. + */ +bool +linux_flush_rcu_work(struct rcu_work *rwork) +{ + + if (linux_work_pending(&rwork->work)) { + linux_rcu_barrier(RCU_TYPE_REGULAR); + linux_flush_work(&rwork->work); + return (true); + } + return (linux_flush_work(&rwork->work)); } /* From owner-svn-src-all@freebsd.org Thu May 21 21:00: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 27A6E2F4B70; Thu, 21 May 2020 21:00:47 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Shq30Vnxz4L6N; Thu, 21 May 2020 21:00:47 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BE7013BAC; Thu, 21 May 2020 21:00:47 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LL0lF0073879; Thu, 21 May 2020 21:00:47 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LL0l4p073877; Thu, 21 May 2020 21:00:47 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202005212100.04LL0l4p073877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 21 May 2020 21:00:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361344 - in head: contrib/unbound contrib/unbound/.github contrib/unbound/cachedb contrib/unbound/compat contrib/unbound/contrib contrib/unbound/daemon contrib/unbound/doc contrib/unbo... X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head: contrib/unbound contrib/unbound/.github contrib/unbound/cachedb contrib/unbound/compat contrib/unbound/contrib contrib/unbound/daemon contrib/unbound/doc contrib/unbound/edns-subnet contrib/u... X-SVN-Commit-Revision: 361344 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, 21 May 2020 21:00:47 -0000 Author: cy Date: Thu May 21 21:00:46 2020 New Revision: 361344 URL: https://svnweb.freebsd.org/changeset/base/361344 Log: MFV r361322: Update unbound 1.9.6 --> 1.10.1. Bug Fixes: - CVE-2020-12662 Unbound can be tricked into amplifying an incoming query into a large number of queries directed to a target. - CVE-2020-12663 Malformed answers from upstream name servers can be used to make Unbound unresponsive. Reported by: emaste MFC after: 3 days Relnotes: yes Security: CVE-2020-12662, CVE-2020-12663 Added: head/contrib/unbound/.github/ - copied from r361322, vendor/unbound/dist/.github/ head/contrib/unbound/contrib/drop2rpz - copied unchanged from r361322, vendor/unbound/dist/contrib/drop2rpz head/contrib/unbound/contrib/unbound_portable.service.in - copied unchanged from r361322, vendor/unbound/dist/contrib/unbound_portable.service.in head/contrib/unbound/contrib/unbound_smf23.tar.gz - copied unchanged from r361322, vendor/unbound/dist/contrib/unbound_smf23.tar.gz head/contrib/unbound/services/rpz.c - copied unchanged from r361322, vendor/unbound/dist/services/rpz.c head/contrib/unbound/services/rpz.h - copied unchanged from r361322, vendor/unbound/dist/services/rpz.h Deleted: head/contrib/unbound/contrib/unbound_smf22.tar.gz Modified: head/contrib/unbound/Makefile.in head/contrib/unbound/README.md head/contrib/unbound/aclocal.m4 head/contrib/unbound/cachedb/cachedb.c head/contrib/unbound/compat/getentropy_solaris.c head/contrib/unbound/config.guess head/contrib/unbound/config.h.in head/contrib/unbound/config.sub head/contrib/unbound/configure head/contrib/unbound/configure.ac head/contrib/unbound/contrib/README head/contrib/unbound/contrib/fastrpz.patch head/contrib/unbound/contrib/libunbound.pc.in head/contrib/unbound/contrib/unbound.service.in head/contrib/unbound/contrib/unbound_munin_ head/contrib/unbound/daemon/daemon.c head/contrib/unbound/daemon/daemon.h head/contrib/unbound/daemon/remote.c head/contrib/unbound/daemon/stats.c head/contrib/unbound/daemon/unbound.c head/contrib/unbound/daemon/worker.c head/contrib/unbound/doc/Changelog head/contrib/unbound/doc/README head/contrib/unbound/doc/example.conf.in head/contrib/unbound/doc/libunbound.3.in head/contrib/unbound/doc/unbound-anchor.8.in head/contrib/unbound/doc/unbound-checkconf.8.in head/contrib/unbound/doc/unbound-control.8.in head/contrib/unbound/doc/unbound-host.1.in head/contrib/unbound/doc/unbound.8.in head/contrib/unbound/doc/unbound.conf.5.in head/contrib/unbound/edns-subnet/subnetmod.c head/contrib/unbound/install-sh head/contrib/unbound/iterator/iter_delegpt.c head/contrib/unbound/iterator/iter_delegpt.h head/contrib/unbound/iterator/iter_scrub.c head/contrib/unbound/iterator/iter_utils.c head/contrib/unbound/iterator/iterator.c head/contrib/unbound/iterator/iterator.h head/contrib/unbound/libunbound/context.c head/contrib/unbound/libunbound/libworker.c head/contrib/unbound/libunbound/unbound.h head/contrib/unbound/respip/respip.c head/contrib/unbound/respip/respip.h head/contrib/unbound/services/authzone.c head/contrib/unbound/services/authzone.h head/contrib/unbound/services/cache/dns.c head/contrib/unbound/services/cache/dns.h head/contrib/unbound/services/localzone.c head/contrib/unbound/services/localzone.h head/contrib/unbound/services/mesh.c head/contrib/unbound/services/mesh.h head/contrib/unbound/services/outside_network.c head/contrib/unbound/services/view.c head/contrib/unbound/sldns/parse.c head/contrib/unbound/sldns/str2wire.c head/contrib/unbound/smallapp/unbound-checkconf.c head/contrib/unbound/smallapp/unbound-control.c head/contrib/unbound/util/config_file.c head/contrib/unbound/util/config_file.h head/contrib/unbound/util/configlexer.lex head/contrib/unbound/util/configparser.y head/contrib/unbound/util/data/dname.c head/contrib/unbound/util/data/dname.h head/contrib/unbound/util/data/msgencode.c head/contrib/unbound/util/data/msgparse.c head/contrib/unbound/util/data/msgparse.h head/contrib/unbound/util/data/msgreply.c head/contrib/unbound/util/data/packed_rrset.c head/contrib/unbound/util/data/packed_rrset.h head/contrib/unbound/util/fptr_wlist.c head/contrib/unbound/util/fptr_wlist.h head/contrib/unbound/util/iana_ports.inc head/contrib/unbound/util/log.c head/contrib/unbound/util/log.h head/contrib/unbound/util/module.h head/contrib/unbound/util/net_help.c head/contrib/unbound/util/net_help.h head/contrib/unbound/util/netevent.c head/contrib/unbound/util/random.c head/contrib/unbound/util/storage/dnstree.c head/contrib/unbound/util/storage/dnstree.h head/contrib/unbound/validator/val_secalgo.c head/contrib/unbound/validator/validator.c head/lib/libunbound/Makefile Directory Properties: head/contrib/unbound/ (props changed) Modified: head/contrib/unbound/Makefile.in ============================================================================== --- head/contrib/unbound/Makefile.in Thu May 21 20:18:38 2020 (r361343) +++ head/contrib/unbound/Makefile.in Thu May 21 21:00:46 2020 (r361344) @@ -110,6 +110,7 @@ iterator/iter_delegpt.c iterator/iter_donotq.c iterato iterator/iter_hints.c iterator/iter_priv.c iterator/iter_resptype.c \ iterator/iter_scrub.c iterator/iter_utils.c services/listen_dnsport.c \ services/localzone.c services/mesh.c services/modstack.c services/view.c \ +services/rpz.c \ services/outbound_list.c services/outside_network.c util/alloc.c \ util/config_file.c util/configlexer.c util/configparser.c \ util/shm_side/shm_main.c services/authzone.c \ @@ -135,7 +136,7 @@ outbound_list.lo alloc.lo config_file.lo configlexer.l fptr_wlist.lo edns.lo locks.lo log.lo mini_event.lo module.lo net_help.lo \ random.lo rbtree.lo regional.lo rtt.lo dnstree.lo lookup3.lo lruhash.lo \ slabhash.lo tcp_conn_limit.lo timehist.lo tube.lo winsock_event.lo \ -autotrust.lo val_anchor.lo \ +autotrust.lo val_anchor.lo rpz.lo \ validator.lo val_kcache.lo val_kentry.lo val_neg.lo val_nsec3.lo val_nsec.lo \ val_secalgo.lo val_sigcrypt.lo val_utils.lo dns64.lo cachedb.lo redis.lo authzone.lo \ $(SUBNET_OBJ) $(PYTHONMOD_OBJ) $(CHECKLOCK_OBJ) $(DNSTAP_OBJ) $(DNSCRYPT_OBJ) \ @@ -642,6 +643,9 @@ depend: fi rm -f $(DEPEND_TMP) $(DEPEND_TMP2) +# build rules +ipset.lo ipset.o: $(srcdir)/ipset/ipset.c + # Dependencies dns.lo dns.o: $(srcdir)/services/cache/dns.c config.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/util/log.h \ $(srcdir)/iterator/iter_utils.h $(srcdir)/iterator/iter_resptype.h $(srcdir)/validator/val_nsec.h \ @@ -654,9 +658,9 @@ infra.lo infra.o: $(srcdir)/services/cache/infra.c con $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/data/msgreply.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lookup3.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h $(srcdir)/iterator/iterator.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/data/dname.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h $(srcdir)/iterator/iterator.h \ $(srcdir)/services/outbound_list.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h rrset.lo rrset.o: $(srcdir)/services/cache/rrset.c config.h $(srcdir)/services/cache/rrset.h \ @@ -681,11 +685,14 @@ msgparse.lo msgparse.o: $(srcdir)/util/data/msgparse.c msgreply.lo msgreply.o: $(srcdir)/util/data/msgreply.c config.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/storage/lookup3.h $(srcdir)/util/alloc.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/regional.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgencode.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h \ - $(srcdir)/util/module.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ - $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h + $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h \ + $(srcdir)/util/regional.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/util/data/msgencode.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/module.h \ + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ + $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/respip/respip.h packed_rrset.lo packed_rrset.o: $(srcdir)/util/data/packed_rrset.c config.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/alloc.h $(srcdir)/util/regional.h \ @@ -699,11 +706,12 @@ iterator.lo iterator.o: $(srcdir)/iterator/iterator.c $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_scrub.h $(srcdir)/iterator/iter_priv.h \ $(srcdir)/validator/val_neg.h $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/services/authzone.h \ - $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \ + $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/random.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h \ - $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/sbuffer.h + $(srcdir)/util/random.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/parseutil.h iter_delegpt.lo iter_delegpt.o: $(srcdir)/iterator/iter_delegpt.c config.h $(srcdir)/iterator/iter_delegpt.h \ $(srcdir)/util/log.h $(srcdir)/services/cache/dns.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/regional.h \ @@ -745,88 +753,106 @@ iter_utils.lo iter_utils.o: $(srcdir)/iterator/iter_ut $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/iterator/iter_fwd.h \ $(srcdir)/iterator/iter_donotq.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_priv.h \ $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/services/cache/dns.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/data/dname.h $(srcdir)/util/random.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h \ + $(srcdir)/util/regional.h $(srcdir)/util/data/dname.h $(srcdir)/util/random.h $(srcdir)/util/fptr_wlist.h \ + $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_kentry.h \ - $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_sigcrypt.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/str2wire.h + $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_sigcrypt.h $(srcdir)/sldns/str2wire.h listen_dnsport.lo listen_dnsport.o: $(srcdir)/services/listen_dnsport.c config.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/mesh.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h \ + $(srcdir)/util/log.h $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/services/mesh.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/services/modstack.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/services/authzone.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h localzone.lo localzone.o: $(srcdir)/services/localzone.c config.h $(srcdir)/services/localzone.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h \ $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/data/msgencode.h $(srcdir)/util/net_help.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/as112.h + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/as112.h mesh.lo mesh.o: $(srcdir)/services/mesh.c config.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/modstack.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/dns.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/regional.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/timehist.h $(srcdir)/util/fptr_wlist.h \ - $(srcdir)/util/tube.h $(srcdir)/util/alloc.h $(srcdir)/util/config_file.h $(srcdir)/util/edns.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ - $(srcdir)/services/view.h $(srcdir)/util/data/dname.h $(srcdir)/respip/respip.h \ + $(srcdir)/util/regional.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ + $(srcdir)/util/alloc.h $(srcdir)/util/edns.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/data/dname.h \ $(srcdir)/services/listen_dnsport.h modstack.lo modstack.o: $(srcdir)/services/modstack.c config.h $(srcdir)/services/modstack.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/dns64/dns64.h \ - $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/validator/validator.h \ - $(srcdir)/validator/val_utils.h $(srcdir)/respip/respip.h $(srcdir)/services/localzone.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(PYTHONMOD_HEADER) $(srcdir)/ipsecmod/ipsecmod.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h \ - $(srcdir)/ipset/ipset.h + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/dns64/dns64.h $(srcdir)/iterator/iterator.h \ + $(srcdir)/services/outbound_list.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h view.lo view.o: $(srcdir)/services/view.c config.h $(srcdir)/services/view.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/util/config_file.h + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h +rpz.lo rpz.o: $(srcdir)/services/rpz.c config.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h \ + $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/services/modstack.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h $(srcdir)/sldns/wire2str.h \ + $(srcdir)/sldns/str2wire.h $(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h outbound_list.lo outbound_list.o: $(srcdir)/services/outbound_list.c config.h \ $(srcdir)/services/outbound_list.h $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h + outside_network.lo outside_network.o: $(srcdir)/services/outside_network.c config.h \ $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/storage/dnstree.h \ - $(srcdir)/util/rtt.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgencode.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/random.h $(srcdir)/util/fptr_wlist.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/dnstap/dnstap.h \ - + $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/iterator/iterator.h \ + $(srcdir)/services/outbound_list.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h \ + $(srcdir)/util/net_help.h $(srcdir)/util/random.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h \ + $(srcdir)/dnstap/dnstap.h alloc.lo alloc.o: $(srcdir)/util/alloc.c config.h $(srcdir)/util/alloc.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/regional.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h + $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h config_file.lo config_file.o: $(srcdir)/util/config_file.c config.h $(srcdir)/util/log.h \ $(srcdir)/util/configyyrename.h $(srcdir)/util/config_file.h util/configparser.h \ $(srcdir)/util/net_help.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/regional.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/modstack.h $(srcdir)/util/data/dname.h $(srcdir)/util/rtt.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h \ + $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/data/dname.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/cache/infra.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h \ $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/util/iana_ports.inc configlexer.lo configlexer.o: util/configlexer.c config.h $(srcdir)/util/configyyrename.h \ $(srcdir)/util/config_file.h util/configparser.h @@ -837,71 +863,83 @@ shm_main.lo shm_main.o: $(srcdir)/util/shm_side/shm_ma $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h \ $(srcdir)/util/timehist.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/services/mesh.h \ - $(srcdir)/util/rbtree.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h \ - $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h + $(srcdir)/util/rbtree.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/respip/respip.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/util/fptr_wlist.h \ + $(srcdir)/util/tube.h authzone.lo authzone.o: $(srcdir)/services/authzone.c config.h $(srcdir)/services/authzone.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/services/modstack.h $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgencode.h \ - $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h $(srcdir)/util/random.h \ + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/modstack.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/data/dname.h \ + $(srcdir)/util/data/msgencode.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/random.h \ $(srcdir)/services/cache/dns.h $(srcdir)/services/outside_network.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/keyraw.h \ - $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_secalgo.h + $(srcdir)/services/listen_dnsport.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h \ + $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/keyraw.h $(srcdir)/validator/val_nsec3.h \ + $(srcdir)/validator/val_secalgo.h fptr_wlist.lo fptr_wlist.o: $(srcdir)/util/fptr_wlist.c config.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/util/mini_event.h \ - $(srcdir)/services/outside_network.h $(srcdir)/services/localzone.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/services/authzone.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/services/cache/rrset.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/dns64/dns64.h $(srcdir)/iterator/iterator.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/validator/validator.h \ - $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_anchor.h $(srcdir)/validator/val_nsec3.h \ - $(srcdir)/validator/val_sigcrypt.h $(srcdir)/validator/val_kentry.h $(srcdir)/validator/val_neg.h \ - $(srcdir)/validator/autotrust.h $(srcdir)/libunbound/libworker.h $(srcdir)/libunbound/context.h \ - $(srcdir)/util/alloc.h $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h \ - $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/respip/respip.h \ - $(PYTHONMOD_HEADER) $(srcdir)/ipsecmod/ipsecmod.h $(srcdir)/edns-subnet/subnetmod.h $(srcdir)/util/net_help.h \ - $(srcdir)/edns-subnet/addrtree.h $(srcdir)/edns-subnet/edns-subnet.h $(srcdir)/ipset/ipset.h + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/dns64/dns64.h \ + $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_fwd.h \ + $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_anchor.h \ + $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_sigcrypt.h $(srcdir)/validator/val_kentry.h \ + $(srcdir)/validator/val_neg.h $(srcdir)/validator/autotrust.h $(srcdir)/libunbound/libworker.h \ + $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/libunbound/unbound-event.h \ + $(srcdir)/libunbound/worker.h locks.lo locks.o: $(srcdir)/util/locks.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h log.lo log.o: $(srcdir)/util/log.c config.h $(srcdir)/util/log.h $(srcdir)/util/locks.h $(srcdir)/sldns/sbuffer.h -mini_event.lo mini_event.o: $(srcdir)/util/mini_event.c config.h $(srcdir)/util/mini_event.h +mini_event.lo mini_event.o: $(srcdir)/util/mini_event.c config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h module.lo module.o: $(srcdir)/util/module.c config.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h netevent.lo netevent.o: $(srcdir)/util/netevent.c config.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/ub_event.h $(srcdir)/util/net_help.h $(srcdir)/util/tcp_conn_limit.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/fptr_wlist.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/services/listen_dnsport.h \ - + $(srcdir)/util/ub_event.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/tcp_conn_limit.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h \ + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/sldns/str2wire.h \ + $(srcdir)/dnstap/dnstap.h $(srcdir)/services/listen_dnsport.h net_help.lo net_help.o: $(srcdir)/util/net_help.c config.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/module.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h \ - $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h \ - + $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h random.lo random.o: $(srcdir)/util/random.c config.h $(srcdir)/util/random.h $(srcdir)/util/log.h rbtree.lo rbtree.o: $(srcdir)/util/rbtree.c config.h $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h regional.lo regional.o: $(srcdir)/util/regional.c config.h $(srcdir)/util/log.h $(srcdir)/util/regional.h rtt.lo rtt.o: $(srcdir)/util/rtt.c config.h $(srcdir)/util/rtt.h $(srcdir)/iterator/iterator.h \ $(srcdir)/services/outbound_list.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ @@ -909,19 +947,22 @@ rtt.lo rtt.o: $(srcdir)/util/rtt.c config.h $(srcdir)/ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h edns.lo edns.o: $(srcdir)/util/edns.c config.h $(srcdir)/util/edns.h $(srcdir)/util/config_file.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/regional.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h + $(srcdir)/util/regional.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h dnstree.lo dnstree.o: $(srcdir)/util/storage/dnstree.c config.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/net_help.h lookup3.lo lookup3.o: $(srcdir)/util/storage/lookup3.c config.h $(srcdir)/util/storage/lookup3.h lruhash.lo lruhash.o: $(srcdir)/util/storage/lruhash.c config.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h slabhash.lo slabhash.o: $(srcdir)/util/storage/slabhash.c config.h $(srcdir)/util/storage/slabhash.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h tcp_conn_limit.lo tcp_conn_limit.o: $(srcdir)/util/tcp_conn_limit.c config.h $(srcdir)/util/regional.h \ @@ -929,26 +970,30 @@ tcp_conn_limit.lo tcp_conn_limit.o: $(srcdir)/util/tcp $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/services/localzone.h \ $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/str2wire.h + $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h timehist.lo timehist.o: $(srcdir)/util/timehist.c config.h $(srcdir)/util/timehist.h $(srcdir)/util/log.h tube.lo tube.o: $(srcdir)/util/tube.c config.h $(srcdir)/util/tube.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/services/mesh.h \ - $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/util/ub_event.h + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/ub_event.h ub_event.lo ub_event.o: $(srcdir)/util/ub_event.c config.h $(srcdir)/util/ub_event.h $(srcdir)/util/log.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/tube.h \ - + $(srcdir)/util/tube.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h ub_event_pluggable.lo ub_event_pluggable.o: $(srcdir)/util/ub_event_pluggable.c config.h $(srcdir)/util/ub_event.h \ $(srcdir)/libunbound/unbound-event.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/modstack.h \ - + $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h winsock_event.lo winsock_event.o: $(srcdir)/util/winsock_event.c config.h autotrust.lo autotrust.o: $(srcdir)/validator/autotrust.c config.h $(srcdir)/validator/autotrust.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ @@ -957,10 +1002,11 @@ autotrust.lo autotrust.o: $(srcdir)/validator/autotrus $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/random.h $(srcdir)/services/mesh.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/services/modstack.h $(srcdir)/services/cache/rrset.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/validator/val_kcache.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/keyraw.h \ - + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/respip/respip.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ + $(srcdir)/validator/val_kcache.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/keyraw.h val_anchor.lo val_anchor.o: $(srcdir)/validator/val_anchor.c config.h $(srcdir)/validator/val_anchor.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_sigcrypt.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h \ @@ -977,8 +1023,11 @@ validator.lo validator.o: $(srcdir)/validator/validato $(srcdir)/validator/autotrust.h $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h \ $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ - $(srcdir)/services/modstack.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h + $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/respip/respip.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h val_kcache.lo val_kcache.o: $(srcdir)/validator/val_kcache.c config.h $(srcdir)/validator/val_kcache.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/validator/val_kentry.h $(srcdir)/util/config_file.h $(srcdir)/util/data/dname.h \ @@ -987,13 +1036,11 @@ val_kcache.lo val_kcache.o: $(srcdir)/validator/val_kc val_kentry.lo val_kentry.o: $(srcdir)/validator/val_kentry.c config.h $(srcdir)/validator/val_kentry.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ - -val_neg.lo val_neg.o: $(srcdir)/validator/val_neg.c config.h \ - $(srcdir)/validator/val_neg.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \ - $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_utils.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/net_help.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h +val_neg.lo val_neg.o: $(srcdir)/validator/val_neg.c config.h $(srcdir)/validator/val_neg.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/rbtree.h $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_utils.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ $(srcdir)/services/cache/dns.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h val_nsec3.lo val_nsec3.o: $(srcdir)/validator/val_nsec3.c config.h $(srcdir)/validator/val_nsec3.h \ @@ -1011,17 +1058,15 @@ val_nsec.lo val_nsec.o: $(srcdir)/validator/val_nsec.c val_secalgo.lo val_secalgo.o: $(srcdir)/validator/val_secalgo.c config.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_secalgo.h \ $(srcdir)/validator/val_nsec3.h $(srcdir)/util/rbtree.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ - $(srcdir)/sldns/sbuffer.h \ - + $(srcdir)/sldns/sbuffer.h val_sigcrypt.lo val_sigcrypt.o: $(srcdir)/validator/val_sigcrypt.c config.h \ $(srcdir)/validator/val_sigcrypt.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/sldns/pkthdr.h $(srcdir)/validator/val_secalgo.h \ $(srcdir)/validator/validator.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/rrdef.h $(srcdir)/validator/val_utils.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/rbtree.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \ - $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h \ - + $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h \ + $(srcdir)/sldns/wire2str.h val_utils.lo val_utils.o: $(srcdir)/validator/val_utils.c config.h $(srcdir)/validator/val_utils.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/validator/validator.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ @@ -1037,9 +1082,11 @@ dns64.lo dns64.o: $(srcdir)/dns64/dns64.c config.h $(s $(srcdir)/sldns/rrdef.h $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/util/config_file.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/modstack.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/str2wire.h + $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/regional.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/str2wire.h edns-subnet.lo edns-subnet.o: $(srcdir)/edns-subnet/edns-subnet.c config.h subnetmod.lo subnetmod.o: $(srcdir)/edns-subnet/subnetmod.c config.h addrtree.lo addrtree.o: $(srcdir)/edns-subnet/addrtree.c config.h $(srcdir)/util/log.h \ @@ -1053,36 +1100,16 @@ respip.lo respip.o: $(srcdir)/respip/respip.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/module.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/services/view.h \ - $(srcdir)/services/cache/dns.h $(srcdir)/sldns/str2wire.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ - $(srcdir)/services/modstack.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h $(srcdir)/respip/respip.h + $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h \ + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/services/modstack.h \ + $(srcdir)/services/rpz.h $(srcdir)/util/config_file.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/services/cache/dns.h \ + $(srcdir)/sldns/str2wire.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/regional.h checklocks.lo checklocks.o: $(srcdir)/testcode/checklocks.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/testcode/checklocks.h -dnstap.lo dnstap.o: $(srcdir)/dnstap/dnstap.c config.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/locks.h $(srcdir)/dnstap/dnstap.h \ - dnstap/dnstap.pb-c.h -dnstap.pb-c.lo dnstap.pb-c.o: dnstap/dnstap.pb-c.c dnstap/dnstap.pb-c.h \ - -dnscrypt.lo dnscrypt.o: $(srcdir)/dnscrypt/dnscrypt.c config.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/locks.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/storage/lookup3.h ipsecmod.lo ipsecmod.o: $(srcdir)/ipsecmod/ipsecmod.c config.h -ipsecmod-whitelist.lo ipsecmod-whitelist.o: $(srcdir)/ipsecmod/ipsecmod-whitelist.c config.h \ - $(srcdir)/ipsecmod/ipsecmod.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ - $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/rbtree.h \ - $(srcdir)/ipsecmod/ipsecmod-whitelist.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/regional.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/str2wire.h -ipset.lo ipset.o: $(srcdir)/ipset/ipset.c config.h $(srcdir)/ipset/ipset.h $(srcdir)/util/module.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/services/cache/dns.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h +ipsecmod-whitelist.lo ipsecmod-whitelist.o: $(srcdir)/ipsecmod/ipsecmod-whitelist.c config.h unitanchor.lo unitanchor.o: $(srcdir)/testcode/unitanchor.c config.h $(srcdir)/util/log.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/testcode/unitmain.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/util/rbtree.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/rrdef.h @@ -1091,16 +1118,15 @@ unitdname.lo unitdname.o: $(srcdir)/testcode/unitdname $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h unitlruhash.lo unitlruhash.o: $(srcdir)/testcode/unitlruhash.c config.h $(srcdir)/testcode/unitmain.h \ $(srcdir)/util/log.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/storage/slabhash.h -unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ +unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ $(srcdir)/util/log.h $(srcdir)/testcode/unitmain.h $(srcdir)/util/alloc.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/util/rtt.h $(srcdir)/util/timehist.h $(srcdir)/iterator/iterator.h \ $(srcdir)/services/outbound_list.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/libunbound/unbound.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/random.h $(srcdir)/respip/respip.h \ - $(srcdir)/services/localzone.h $(srcdir)/services/view.h + $(srcdir)/util/random.h $(srcdir)/respip/respip.h \ + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h unitmsgparse.lo unitmsgparse.o: $(srcdir)/testcode/unitmsgparse.c config.h $(srcdir)/util/log.h \ $(srcdir)/testcode/unitmain.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ @@ -1134,59 +1160,59 @@ unitldns.lo unitldns.o: $(srcdir)/testcode/unitldns.c unitecs.lo unitecs.o: $(srcdir)/testcode/unitecs.c config.h unitauth.lo unitauth.o: $(srcdir)/testcode/unitauth.c config.h $(srcdir)/services/authzone.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/services/modstack.h $(srcdir)/testcode/unitmain.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/config_file.h $(srcdir)/services/cache/dns.h $(srcdir)/sldns/str2wire.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/sbuffer.h + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/modstack.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/config_file.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/testcode/unitmain.h \ + $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/services/cache/dns.h $(srcdir)/sldns/str2wire.h \ + $(srcdir)/sldns/wire2str.h acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/acl_list.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h \ $(srcdir)/services/localzone.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/str2wire.h -cachedump.lo cachedump.o: $(srcdir)/daemon/cachedump.c config.h \ - $(srcdir)/daemon/cachedump.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/alloc.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h \ - $(srcdir)/dnstap/dnstap.h $(srcdir)/services/cache/rrset.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/regional.h \ - $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/iterator/iterator.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h +cachedump.lo cachedump.o: $(srcdir)/daemon/cachedump.c config.h $(srcdir)/daemon/cachedump.h \ + $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/dns.h \ + $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h \ + $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/iterator/iterator.h \ $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_utils.h \ $(srcdir)/iterator/iter_resptype.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h -daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/worker.h \ +daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h \ + $(srcdir)/util/storage/lookup3.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/localzone.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/rpz.h $(srcdir)/respip/respip.h $(srcdir)/util/random.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ + $(srcdir)/sldns/keyraw.h +remote.lo remote.o: $(srcdir)/daemon/remote.c config.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h \ $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ - $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h $(srcdir)/util/storage/lookup3.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/localzone.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/util/random.h \ - $(srcdir)/util/tube.h $(srcdir)/util/net_help.h $(srcdir)/sldns/keyraw.h $(srcdir)/respip/respip.h -remote.lo remote.o: $(srcdir)/daemon/remote.c config.h \ - $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/cachedump.h $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/mesh.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/services/authzone.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/alloc.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h \ + $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ + $(srcdir)/services/modstack.h $(srcdir)/daemon/cachedump.h $(srcdir)/util/config_file.h \ + $(srcdir)/util/net_help.h $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/services/view.h $(srcdir)/services/authzone.h $(srcdir)/respip/respip.h \ $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/data/dname.h $(srcdir)/validator/validator.h \ $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_kentry.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h \ @@ -1197,56 +1223,59 @@ stats.lo stats.o: $(srcdir)/daemon/stats.c config.h $( $(srcdir)/libunbound/unbound.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/outside_network.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/util/config_file.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ - $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/iterator/iterator.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/authzone.h $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h \ - + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/respip/respip.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/listen_dnsport.h $(srcdir)/util/tube.h \ + $(srcdir)/util/net_help.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h \ + $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h unbound.lo unbound.o: $(srcdir)/daemon/unbound.c config.h $(srcdir)/util/log.h $(srcdir)/daemon/daemon.h \ $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/remote.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/net_help.h $(srcdir)/util/ub_event.h + $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h $(srcdir)/services/listen_dnsport.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/fptr_wlist.h \ + $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/ub_event.h worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ $(srcdir)/util/random.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/rtt.h $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ - $(srcdir)/services/localzone.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h $(srcdir)/iterator/iter_fwd.h \ - $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h $(srcdir)/validator/val_anchor.h \ - $(srcdir)/respip/respip.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ + $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ + $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/listen_dnsport.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/outbound_list.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/respip/respip.h $(srcdir)/util/data/msgencode.h \ + $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \ + $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/shm_side/shm_main.h testbound.lo testbound.o: $(srcdir)/testcode/testbound.c config.h $(srcdir)/testcode/testpkts.h \ $(srcdir)/testcode/replay.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/rbtree.h $(srcdir)/testcode/fake_event.h $(srcdir)/daemon/remote.h \ - $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/daemon/unbound.c $(srcdir)/daemon/daemon.h \ - $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/fptr_wlist.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/net_help.h $(srcdir)/util/ub_event.h + $(srcdir)/util/rbtree.h $(srcdir)/testcode/fake_event.h \ + $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/daemon/unbound.c \ + $(srcdir)/util/log.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/util/rtt.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/net_help.h $(srcdir)/util/ub_event.h testpkts.lo testpkts.o: $(srcdir)/testcode/testpkts.c config.h $(srcdir)/testcode/testpkts.h \ $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h @@ -1254,77 +1283,79 @@ worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/random.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/rtt.h $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ - $(srcdir)/services/localzone.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h \ - $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h $(srcdir)/iterator/iter_fwd.h \ - $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h $(srcdir)/validator/val_anchor.h \ - $(srcdir)/respip/respip.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ + $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ + $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ + $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/listen_dnsport.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/outbound_list.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h \ + $(srcdir)/services/localzone.h $(srcdir)/respip/respip.h $(srcdir)/util/data/msgencode.h \ + $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/edns.h \ + $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \ + $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound-event.h \ $(srcdir)/libunbound/libworker.h $(srcdir)/sldns/wire2str.h $(srcdir)/util/shm_side/shm_main.h acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/acl_list.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/regional.h $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h \ $(srcdir)/services/localzone.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/str2wire.h -daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/worker.h \ - $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h \ - $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/services/view.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h $(srcdir)/util/storage/lookup3.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/localzone.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/util/random.h \ - $(srcdir)/util/tube.h $(srcdir)/util/net_help.h $(srcdir)/sldns/keyraw.h $(srcdir)/respip/respip.h + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/str2wire.h +daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/libunbound/unbound.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/util/shm_side/shm_main.h \ + $(srcdir)/util/storage/lookup3.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/tcp_conn_limit.h \ + $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/rtt.h $(srcdir)/services/localzone.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/rpz.h $(srcdir)/respip/respip.h $(srcdir)/util/random.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ + $(srcdir)/sldns/keyraw.h stats.lo stats.o: $(srcdir)/daemon/stats.c config.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ $(srcdir)/libunbound/unbound.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h \ - $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/outside_network.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/util/config_file.h $(srcdir)/util/tube.h $(srcdir)/util/net_help.h \ - $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/iterator/iterator.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h \ - $(srcdir)/services/authzone.h $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h \ - + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/daemon/daemon.h $(srcdir)/services/modstack.h $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h \ + $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ + $(srcdir)/services/view.h $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/respip/respip.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/listen_dnsport.h $(srcdir)/util/tube.h \ + $(srcdir)/util/net_help.h $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h \ + $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/validator/val_kcache.h $(srcdir)/validator/val_neg.h replay.lo replay.o: $(srcdir)/testcode/replay.c config.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/testcode/replay.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h \ - $(srcdir)/testcode/testpkts.h $(srcdir)/util/rbtree.h $(srcdir)/testcode/fake_event.h $(srcdir)/sldns/str2wire.h \ - $(srcdir)/sldns/rrdef.h + $(srcdir)/testcode/testpkts.h $(srcdir)/util/rbtree.h \ + $(srcdir)/testcode/fake_event.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h fake_event.lo fake_event.o: $(srcdir)/testcode/fake_event.c config.h $(srcdir)/testcode/fake_event.h \ $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgencode.h \ - $(srcdir)/util/data/dname.h $(srcdir)/util/config_file.h $(srcdir)/services/listen_dnsport.h \ - $(srcdir)/services/outside_network.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h \ - $(srcdir)/testcode/replay.h $(srcdir)/testcode/testpkts.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h + $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/data/msgparse.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/locks.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ + $(srcdir)/util/rbtree.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h $(srcdir)/testcode/replay.h $(srcdir)/testcode/testpkts.h \ + $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h $(srcdir)/services/view.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h lock_verify.lo lock_verify.o: $(srcdir)/testcode/lock_verify.c config.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h pktview.lo pktview.o: $(srcdir)/testcode/pktview.c config.h $(srcdir)/util/log.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/testcode/unitmain.h $(srcdir)/testcode/readhex.h $(srcdir)/sldns/sbuffer.h \ @@ -1333,10 +1364,13 @@ readhex.lo readhex.o: $(srcdir)/testcode/readhex.c con $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h memstats.lo memstats.o: $(srcdir)/testcode/memstats.c config.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/locks.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ - $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h unbound-checkconf.lo unbound-checkconf.o: $(srcdir)/smallapp/unbound-checkconf.c config.h $(srcdir)/util/log.h \ $(srcdir)/util/config_file.h $(srcdir)/util/module.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ @@ -1344,27 +1378,31 @@ unbound-checkconf.lo unbound-checkconf.o: $(srcdir)/sm $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_fwd.h \ $(srcdir)/util/rbtree.h $(srcdir)/iterator/iter_hints.h $(srcdir)/util/storage/dnstree.h \ $(srcdir)/validator/validator.h $(srcdir)/validator/val_utils.h $(srcdir)/services/localzone.h \ - $(srcdir)/services/view.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/dnscrypt/cert.h \ - $(srcdir)/services/modstack.h $(srcdir)/respip/respip.h $(srcdir)/sldns/sbuffer.h + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/services/modstack.h $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h worker_cb.lo worker_cb.o: $(srcdir)/smallapp/worker_cb.c config.h $(srcdir)/libunbound/context.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h + $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ + $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/services/localzone.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h $(srcdir)/util/config_file.h \ + $(srcdir)/services/authzone.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h context.lo context.o: $(srcdir)/libunbound/context.c config.h $(srcdir)/libunbound/context.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/config_file.h \ $(srcdir)/util/net_help.h $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h \ - $(srcdir)/services/view.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/services/authzone.h \ - $(srcdir)/services/mesh.h $(srcdir)/sldns/sbuffer.h + $(srcdir)/services/view.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ + $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h $(srcdir)/services/rpz.h $(srcdir)/daemon/stats.h \ + $(srcdir)/util/timehist.h $(srcdir)/respip/respip.h libunbound.lo libunbound.o: $(srcdir)/libunbound/libunbound.c $(srcdir)/libunbound/unbound.h \ $(srcdir)/libunbound/unbound-event.h config.h $(srcdir)/libunbound/context.h $(srcdir)/util/locks.h \ $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ @@ -1373,70 +1411,70 @@ libunbound.lo libunbound.o: $(srcdir)/libunbound/libun $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h \ $(srcdir)/util/random.h $(srcdir)/util/net_help.h $(srcdir)/util/tube.h $(srcdir)/util/ub_event.h \ $(srcdir)/services/localzone.h $(srcdir)/util/storage/dnstree.h $(srcdir)/services/view.h \ - $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ - $(srcdir)/dnscrypt/cert.h $(srcdir)/services/cache/rrset.h \ + $(srcdir)/sldns/sbuffer.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h \ + $(srcdir)/dnscrypt/dnscrypt.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/authzone.h $(srcdir)/services/mesh.h \ - $(srcdir)/sldns/sbuffer.h -libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h \ - $(srcdir)/libunbound/libworker.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/modstack.h $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/unbound-event.h \ - $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/services/outside_network.h \ - $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu May 21 21:15: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 054A72F5A94; Thu, 21 May 2020 21:15:26 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Sj7x6Jghz4MBF; Thu, 21 May 2020 21:15:25 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3B5613F81; Thu, 21 May 2020 21:15:25 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LLFPl8085738; Thu, 21 May 2020 21:15:25 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LLFPA6085735; Thu, 21 May 2020 21:15:25 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202005212115.04LLFPA6085735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Thu, 21 May 2020 21:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361345 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 361345 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, 21 May 2020 21:15:26 -0000 Author: rscheff Date: Thu May 21 21:15:25 2020 New Revision: 361345 URL: https://svnweb.freebsd.org/changeset/base/361345 Log: Handle ECN handshake in simultaneous open While testing simultaneous open TCP with ECN, found that negotiation fails to arrive at the expected final state. Reviewed by: tuexen (mentor) Approved by: tuexen (mentor), rgrimes (mentor) MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D23373 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu May 21 21:00:46 2020 (r361344) +++ head/sys/netinet/tcp_input.c Thu May 21 21:15:25 2020 (r361345) @@ -1611,6 +1611,14 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru * XXX this is traditional behavior, may need to be cleaned up. */ if (tp->t_state == TCPS_SYN_SENT && (thflags & TH_SYN)) { + /* Handle parallel SYN for ECN */ + if (!(thflags & TH_ACK) && + ((thflags & (TH_CWR | TH_ECE)) == (TH_CWR | TH_ECE)) && + ((V_tcp_do_ecn == 1) || (V_tcp_do_ecn == 2))) { + tp->t_flags2 |= TF2_ECN_PERMIT; + tp->t_flags2 |= TF2_ECN_SND_ECE; + TCPSTAT_INC(tcps_ecn_shs); + } if ((to.to_flags & TOF_SCALE) && (tp->t_flags & TF_REQ_SCALE)) { tp->t_flags |= TF_RCVD_SCALE; Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu May 21 21:00:46 2020 (r361344) +++ head/sys/netinet/tcp_output.c Thu May 21 21:15:25 2020 (r361345) @@ -1154,6 +1154,12 @@ send: } else flags |= TH_ECE|TH_CWR; } + /* Handle parallel SYN for ECN */ + if ((tp->t_state == TCPS_SYN_RECEIVED) && + (tp->t_flags2 & TF2_ECN_SND_ECE)) { + flags |= TH_ECE; + tp->t_flags2 &= ~TF2_ECN_SND_ECE; + } if (tp->t_state == TCPS_ESTABLISHED && (tp->t_flags2 & TF2_ECN_PERMIT)) { Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu May 21 21:00:46 2020 (r361344) +++ head/sys/netinet/tcp_stacks/rack.c Thu May 21 21:15:25 2020 (r361345) @@ -11070,6 +11070,14 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr * this is traditional behavior, may need to be cleaned up. */ if (tp->t_state == TCPS_SYN_SENT && (thflags & TH_SYN)) { + /* Handle parallel SYN for ECN */ + if (!(thflags & TH_ACK) && + ((thflags & (TH_CWR | TH_ECE)) == (TH_CWR | TH_ECE)) && + ((V_tcp_do_ecn == 1) || (V_tcp_do_ecn == 2))) { + tp->t_flags2 |= TF2_ECN_PERMIT; + tp->t_flags2 |= TF2_ECN_SND_ECE; + TCPSTAT_INC(tcps_ecn_shs); + } if ((to.to_flags & TOF_SCALE) && (tp->t_flags & TF_REQ_SCALE)) { tp->t_flags |= TF_RCVD_SCALE; @@ -13522,6 +13530,12 @@ send: flags |= TH_ECE | TH_CWR; } else flags |= TH_ECE | TH_CWR; + } + /* Handle parallel SYN for ECN */ + if ((tp->t_state == TCPS_SYN_RECEIVED) && + (tp->t_flags2 & TF2_ECN_SND_ECE)) { + flags |= TH_ECE; + tp->t_flags2 &= ~TF2_ECN_SND_ECE; } if (tp->t_state == TCPS_ESTABLISHED && (tp->t_flags2 & TF2_ECN_PERMIT)) { From owner-svn-src-all@freebsd.org Thu May 21 21:26: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 F280E2F5B29; Thu, 21 May 2020 21:26:22 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SjNZ65VHz4MqX; Thu, 21 May 2020 21:26:22 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC94D13BEA; Thu, 21 May 2020 21:26:22 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LLQMXj091814; Thu, 21 May 2020 21:26:22 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LLQMw3091812; Thu, 21 May 2020 21:26:22 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202005212126.04LLQMw3091812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Thu, 21 May 2020 21:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361346 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 361346 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, 21 May 2020 21:26:23 -0000 Author: rscheff Date: Thu May 21 21:26:21 2020 New Revision: 361346 URL: https://svnweb.freebsd.org/changeset/base/361346 Log: Retain only mutually supported TCP options after simultaneous SYN When receiving a parallel SYN in SYN-SENT state, remove all the options only we supported locally before sending the SYN,ACK. This addresses a consistency issue on parallel opens. Also, on such a parallel open, the stack could be coaxed into running with timestamps enabled, even if administratively disabled. Reviewed by: tuexen (mentor) Approved by: tuexen (mentor) MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D23371 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/bbr.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu May 21 21:15:25 2020 (r361345) +++ head/sys/netinet/tcp_input.c Thu May 21 21:26:21 2020 (r361346) @@ -1623,17 +1623,20 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru (tp->t_flags & TF_REQ_SCALE)) { tp->t_flags |= TF_RCVD_SCALE; tp->snd_scale = to.to_wscale; - } + } else + tp->t_flags &= ~TF_REQ_SCALE; /* * Initial send window. It will be updated with * the next incoming segment to the scaled value. */ tp->snd_wnd = th->th_win; - if (to.to_flags & TOF_TS) { + if ((to.to_flags & TOF_TS) && + (tp->t_flags & TF_REQ_TSTMP)) { tp->t_flags |= TF_RCVD_TSTMP; tp->ts_recent = to.to_tsval; tp->ts_recent_age = tcp_ts_getticks(); - } + } else + tp->t_flags &= ~TF_REQ_TSTMP; if (to.to_flags & TOF_MSS) tcp_mss(tp, to.to_mss); if ((tp->t_flags & TF_SACK_PERMIT) && Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Thu May 21 21:15:25 2020 (r361345) +++ head/sys/netinet/tcp_stacks/bbr.c Thu May 21 21:26:21 2020 (r361346) @@ -11595,17 +11595,20 @@ bbr_do_segment_nounlock(struct mbuf *m, struct tcphdr (tp->t_flags & TF_REQ_SCALE)) { tp->t_flags |= TF_RCVD_SCALE; tp->snd_scale = to.to_wscale; - } + } else + tp->t_flags &= ~TF_REQ_SCALE; /* * Initial send window. It will be updated with the * next incoming segment to the scaled value. */ tp->snd_wnd = th->th_win; - if (to.to_flags & TOF_TS) { + if ((to.to_flags & TOF_TS) && + (tp->t_flags & TF_REQ_TSTMP)) { tp->t_flags |= TF_RCVD_TSTMP; tp->ts_recent = to.to_tsval; tp->ts_recent_age = tcp_tv_to_mssectick(&bbr->rc_tv); - } + } else + tp->t_flags &= ~TF_REQ_TSTMP; if (to.to_flags & TOF_MSS) tcp_mss(tp, to.to_mss); if ((tp->t_flags & TF_SACK_PERMIT) && Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu May 21 21:15:25 2020 (r361345) +++ head/sys/netinet/tcp_stacks/rack.c Thu May 21 21:26:21 2020 (r361346) @@ -11082,17 +11082,20 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr (tp->t_flags & TF_REQ_SCALE)) { tp->t_flags |= TF_RCVD_SCALE; tp->snd_scale = to.to_wscale; - } + } else + tp->t_flags &= ~TF_REQ_SCALE; /* * Initial send window. It will be updated with the * next incoming segment to the scaled value. */ tp->snd_wnd = th->th_win; - if (to.to_flags & TOF_TS) { + if ((to.to_flags & TOF_TS) && + (tp->t_flags & TF_REQ_TSTMP)) { tp->t_flags |= TF_RCVD_TSTMP; tp->ts_recent = to.to_tsval; tp->ts_recent_age = cts; - } + } else + tp->t_flags &= ~TF_REQ_TSTMP; if (to.to_flags & TOF_MSS) tcp_mss(tp, to.to_mss); if ((tp->t_flags & TF_SACK_PERMIT) && From owner-svn-src-all@freebsd.org Thu May 21 21:33: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 E6CBB2F5AFA; Thu, 21 May 2020 21:33:16 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SjXX5n06z4NRC; Thu, 21 May 2020 21:33:16 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C18CD13FAB; Thu, 21 May 2020 21:33:16 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LLXGgI098068; Thu, 21 May 2020 21:33:16 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LLXGEI098066; Thu, 21 May 2020 21:33:16 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202005212133.04LLXGEI098066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Thu, 21 May 2020 21:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361347 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 361347 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, 21 May 2020 21:33:17 -0000 Author: rscheff Date: Thu May 21 21:33:15 2020 New Revision: 361347 URL: https://svnweb.freebsd.org/changeset/base/361347 Log: With RFC3168 ECN, CWR SHOULD only be sent with new data Overly conservative data receivers may ignore the CWR flag on other packets, and keep ECE latched. This can result in continous reduction of the congestion window, and very poor performance when ECN is enabled. Reviewed by: rgrimes (mentor), rrs Approved by: rgrimes (mentor), tuexen (mentor) MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D23364 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu May 21 21:26:21 2020 (r361346) +++ head/sys/netinet/tcp_input.c Thu May 21 21:33:15 2020 (r361347) @@ -447,9 +447,15 @@ cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, ui } break; case CC_ECN: - if (!IN_CONGRECOVERY(tp->t_flags)) { + if (!IN_CONGRECOVERY(tp->t_flags) || + /* + * Allow ECN reaction on ACK to CWR, if + * that data segment was also CE marked. + */ + SEQ_GEQ(th->th_ack, tp->snd_recover)) { + EXIT_CONGRECOVERY(tp->t_flags); TCPSTAT_INC(tcps_ecn_rcwnd); - tp->snd_recover = tp->snd_max; + tp->snd_recover = tp->snd_max + 1; if (tp->t_flags2 & TF2_ECN_PERMIT) tp->t_flags2 |= TF2_ECN_SND_CWR; } Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu May 21 21:26:21 2020 (r361346) +++ head/sys/netinet/tcp_output.c Thu May 21 21:33:15 2020 (r361347) @@ -1170,7 +1170,8 @@ send: */ if (len > 0 && SEQ_GEQ(tp->snd_nxt, tp->snd_max) && (sack_rxmit == 0) && - !((tp->t_flags & TF_FORCEDATA) && len == 1)) { + !((tp->t_flags & TF_FORCEDATA) && len == 1 && + SEQ_LT(tp->snd_una, tp->snd_max))) { #ifdef INET6 if (isipv6) ip6->ip6_flow |= htonl(IPTOS_ECN_ECT0 << 20); @@ -1178,14 +1179,14 @@ send: #endif ip->ip_tos |= IPTOS_ECN_ECT0; TCPSTAT_INC(tcps_ecn_ect0); - } - - /* - * Reply with proper ECN notifications. - */ - if (tp->t_flags2 & TF2_ECN_SND_CWR) { - flags |= TH_CWR; - tp->t_flags2 &= ~TF2_ECN_SND_CWR; + /* + * Reply with proper ECN notifications. + * Only set CWR on new data segments. + */ + if (tp->t_flags2 & TF2_ECN_SND_CWR) { + flags |= TH_CWR; + tp->t_flags2 &= ~TF2_ECN_SND_CWR; + } } if (tp->t_flags2 & TF2_ECN_SND_ECE) flags |= TH_ECE; Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu May 21 21:26:21 2020 (r361346) +++ head/sys/netinet/tcp_stacks/rack.c Thu May 21 21:33:15 2020 (r361347) @@ -4095,9 +4095,15 @@ rack_cong_signal(struct tcpcb *tp, struct tcphdr *th, } break; case CC_ECN: - if (!IN_CONGRECOVERY(tp->t_flags)) { + if (!IN_CONGRECOVERY(tp->t_flags) || + /* + * Allow ECN reaction on ACK to CWR, if + * that data segment was also CE marked. + */ + SEQ_GEQ(th->th_ack, tp->snd_recover)) { + EXIT_CONGRECOVERY(tp->t_flags); KMOD_TCPSTAT_INC(tcps_ecn_rcwnd); - tp->snd_recover = tp->snd_max; + tp->snd_recover = tp->snd_max + 1; if (tp->t_flags2 & TF2_ECN_PERMIT) tp->t_flags2 |= TF2_ECN_SND_CWR; } @@ -13556,13 +13562,14 @@ send: #endif ip->ip_tos |= IPTOS_ECN_ECT0; KMOD_TCPSTAT_INC(tcps_ecn_ect0); - } - /* - * Reply with proper ECN notifications. - */ - if (tp->t_flags2 & TF2_ECN_SND_CWR) { - flags |= TH_CWR; - tp->t_flags2 &= ~TF2_ECN_SND_CWR; + /* + * Reply with proper ECN notifications. + * Only set CWR on new data segments. + */ + if (tp->t_flags2 & TF2_ECN_SND_CWR) { + flags |= TH_CWR; + tp->t_flags2 &= ~TF2_ECN_SND_CWR; + } } if (tp->t_flags2 & TF2_ECN_SND_ECE) flags |= TH_ECE; From owner-svn-src-all@freebsd.org Thu May 21 21: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 67EFC2F6552; Thu, 21 May 2020 21:42:50 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SjlZ28D8z4PDn; Thu, 21 May 2020 21:42:50 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4474F14580; Thu, 21 May 2020 21:42:50 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LLgo3Z003968; Thu, 21 May 2020 21:42:50 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LLgobu003967; Thu, 21 May 2020 21:42:50 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202005212142.04LLgobu003967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Thu, 21 May 2020 21:42:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361348 - head/sys/netinet/cc X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: head/sys/netinet/cc X-SVN-Commit-Revision: 361348 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, 21 May 2020 21:42:50 -0000 Author: rscheff Date: Thu May 21 21:42:49 2020 New Revision: 361348 URL: https://svnweb.freebsd.org/changeset/base/361348 Log: DCTCP: update alpha only once after loss recovery. In mixed ECN marking and loss scenarios it was found, that the alpha value of DCTCP is updated two times. The second update happens with freshly initialized counters indicating to ECN loss. Overall this leads to alpha not adjusting as quickly as expected to ECN markings, and therefore lead to excessive loss. Reported by: Cheng Cui Reviewed by: chengc_netapp.com, rrs, tuexen (mentor) Approved by: tuexen (mentor) MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D24817 Modified: head/sys/netinet/cc/cc_dctcp.c Modified: head/sys/netinet/cc/cc_dctcp.c ============================================================================== --- head/sys/netinet/cc/cc_dctcp.c Thu May 21 21:33:15 2020 (r361347) +++ head/sys/netinet/cc/cc_dctcp.c Thu May 21 21:42:49 2020 (r361348) @@ -154,10 +154,8 @@ dctcp_ack_received(struct cc_var *ccv, uint16_t type) * Update the fraction of marked bytes at the end of * current window size. */ - if ((IN_FASTRECOVERY(CCV(ccv, t_flags)) && - SEQ_GEQ(ccv->curack, CCV(ccv, snd_recover))) || - (!IN_FASTRECOVERY(CCV(ccv, t_flags)) && - SEQ_GT(ccv->curack, dctcp_data->save_sndnxt))) + if (!IN_FASTRECOVERY(CCV(ccv, t_flags)) && + SEQ_GT(ccv->curack, dctcp_data->save_sndnxt)) dctcp_update_alpha(ccv); } else newreno_cc_algo.ack_received(ccv, type); From owner-svn-src-all@freebsd.org Thu May 21 22:24: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 913542F6A31; Thu, 21 May 2020 22:24: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 49SkgX21yHz4R03; Thu, 21 May 2020 22:24:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C5651485B; Thu, 21 May 2020 22:24:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LMONMg028798; Thu, 21 May 2020 22:24:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LMONEF028795; Thu, 21 May 2020 22:24:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005212224.04LMONEF028795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 21 May 2020 22:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361349 - in head: cddl/contrib/opensolaris/lib/libdtrace/common lib/libc/gen libexec/rtld-elf sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/lib/libdtrace/common lib/libc/gen libexec/rtld-elf sys/sys X-SVN-Commit-Revision: 361349 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, 21 May 2020 22:24:24 -0000 Author: kib Date: Thu May 21 22:24:23 2020 New Revision: 361349 URL: https://svnweb.freebsd.org/changeset/base/361349 Log: Restore the binary compatibility for link_map l_addr. Keep link_map l_addr binary layout compatible, rename l_addr to l_base where rtld returns map base. Provide relocbase in newly added l_addr. This effectively reverts the patch to the initial version of D24918. Reported by: antoine (portmgr) Reviewed by: jhb, markj Tested by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24946 Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c head/lib/libc/gen/dlinfo.3 head/libexec/rtld-elf/rtld.c head/sys/sys/link_elf.h Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Thu May 21 21:42:49 2020 (r361348) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Thu May 21 22:24:23 2020 (r361349) @@ -143,12 +143,18 @@ dtrace_dof_init(void) return; } +#ifdef __FreeBSD__ + elf = (void *)lmp->l_base; +#else elf = (void *)lmp->l_addr; +#endif dh.dofhp_dof = (uintptr_t)dof; - dh.dofhp_addr = elf->e_type == ET_DYN ? (uintptr_t) lmp->l_addr : 0; #ifdef __FreeBSD__ + dh.dofhp_addr = elf->e_type == ET_DYN ? (uintptr_t) lmp->l_base : 0; dh.dofhp_pid = getpid(); +#else + dh.dofhp_addr = elf->e_type == ET_DYN ? (uintptr_t) lmp->l_addr : 0; #endif if (lmid == 0) { Modified: head/lib/libc/gen/dlinfo.3 ============================================================================== --- head/lib/libc/gen/dlinfo.3 Thu May 21 21:42:49 2020 (r361348) +++ head/lib/libc/gen/dlinfo.3 Thu May 21 22:24:23 2020 (r361349) @@ -105,17 +105,16 @@ structure is defined in .In link.h and has the following members: .Bd -literal -offset indent -caddr_t l_addr; /* Load Offset of library */ +caddr_t l_base; /* Base Address of library */ const char *l_name; /* Absolute Path to Library */ const void *l_ld; /* Pointer to .dynamic in memory */ struct link_map *l_next, /* linked list of mapped libs */ *l_prev; +caddr_t l_addr; /* Load Offset of library */ .Ed .Bl -tag -width ".Va l_addr" -.It Va l_addr -The load offset of the object, that is, the difference between -the actual load address and the base virtual address the object -was linked at. +.It Va l_base +The base address of the object loaded into memory. .It Va l_name The full name of the loaded shared object. .It Va l_ld @@ -130,6 +129,10 @@ structure on the link-map list. The previous .Vt Link_map structure on the link-map list. +.It Va l_addr +The load offset of the object, that is, the difference between +the actual load address and the base virtual address the object +was linked at. .El .It Dv RTLD_DI_SERINFO Retrieve the library search paths associated with the given Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Thu May 21 21:42:49 2020 (r361348) +++ head/libexec/rtld-elf/rtld.c Thu May 21 22:24:23 2020 (r361349) @@ -4032,8 +4032,9 @@ linkmap_add(Obj_Entry *obj) struct link_map *prev; obj->linkmap.l_name = obj->path; - obj->linkmap.l_addr = obj->relocbase; + obj->linkmap.l_base = obj->mapbase; obj->linkmap.l_ld = obj->dynamic; + obj->linkmap.l_addr = obj->relocbase; if (r_debug.r_map == NULL) { r_debug.r_map = l; Modified: head/sys/sys/link_elf.h ============================================================================== --- head/sys/sys/link_elf.h Thu May 21 21:42:49 2020 (r361348) +++ head/sys/sys/link_elf.h Thu May 21 22:24:23 2020 (r361349) @@ -57,13 +57,14 @@ #define LA_SER_SECURE 0x80 /* default (secure) path prepended */ typedef struct link_map { - caddr_t l_addr; /* Load Offset of library */ + caddr_t l_base; /* Base Address of library */ #ifdef __mips__ caddr_t l_xxx; /* unused */ #endif const char *l_name; /* Absolute Path to Library */ const void *l_ld; /* Pointer to .dynamic in memory */ struct link_map *l_next, *l_prev; /* linked list of of mapped libs */ + caddr_t l_addr; /* Load Offset of library */ } Link_map; struct r_debug { From owner-svn-src-all@freebsd.org Thu May 21 22:45: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 42FC62F77DC; Thu, 21 May 2020 22:45:14 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [94.130.200.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail.bsd4all.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Sl7Y6Bc5z4SNc; Thu, 21 May 2020 22:45:13 +0000 (UTC) (envelope-from herbert@gojira.at) Date: Fri, 22 May 2020 00:45:03 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail202005; t=1590101105; bh=3vaAlI/8XTo6dyosB+S/bMjhumBfGo2VEsZofyo0L1Y=; h=Date:Message-ID:From:To:Cc:Subject:MIME-Version:Content-Type; b=BNmZh21wYy4/P1nxO7Gl6hr/bFxY9eJ1NvyVo+v2Ik/ljmkvCvgyZKZfyXsd9QyvK eWE1Xfq9QgqCepw+ZPm18NDOVkL4D2JQ11Xi/jUuFMnttTIdG1MqUnOM/j+0hqCEHj Ml57/Fo+d6x5L2Iif6XWsaafAxKW28NC45WXbcUfGTsTHGmbg08rdPaoEQ4/PGn985 XIdeXWgDgAIAnsDBSQ/gwYZAXQptJ2m9zSjCQJdTBCAYBWn9t1rGAalbYtwzVCbYHK Iz1Wj0zuXxPkBJQYah42bI1IBhpFEDdyH70eRQFD0mXBT7iq31F+QFFtP7kaXSgQJv 8Id/Fc/fVpBKA== Message-ID: <87a720aowg.wl-herbert@gojira.at> From: "Herbert J. Skuhra" To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: Re: svn commit: r361334 - in stable/12/sys: amd64/amd64 arm64/arm64 dev/acpica i386/i386 x86/acpica In-Reply-To: <202005211528.04LFSZFF068443@repo.freebsd.org> References: <202005211528.04LFSZFF068443@repo.freebsd.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/28.0 Mule/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49Sl7Y6Bc5z4SNc 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:24940, ipnet:94.130.0.0/16, 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, 21 May 2020 22:45:14 -0000 On Thu, 21 May 2020 17:28:35 +0200, Mark Johnston wrote: > > Author: markj > Date: Thu May 21 15:28:35 2020 > New Revision: 361334 > URL: https://svnweb.freebsd.org/changeset/base/361334 > > Log: > MFC r361033: > Call acpi_pxm_set_proximity_info() slightly earlier on x86. > > Modified: > stable/12/sys/amd64/amd64/mp_machdep.c > stable/12/sys/arm64/arm64/mp_machdep.c > stable/12/sys/dev/acpica/acpi_pxm.c > stable/12/sys/dev/acpica/acpivar.h > stable/12/sys/i386/i386/mp_machdep.c > stable/12/sys/x86/acpica/srat.c > Directory Properties: > stable/12/ (props changed) > > Modified: stable/12/sys/amd64/amd64/mp_machdep.c > ============================================================================== > --- stable/12/sys/amd64/amd64/mp_machdep.c Thu May 21 15:18:59 2020 (r361333) > +++ stable/12/sys/amd64/amd64/mp_machdep.c Thu May 21 15:28:35 2020 (r361334) > @@ -265,8 +265,9 @@ cpu_mp_start(void) > init_ops.start_all_aps(); > > set_interrupt_apic_ids(); > -} > > + acpi_pxm_set_cpu_locality(); > +} > > /* > * AP CPU's call this to initialize themselves. Until now it was possible to build a kernel (amd64) without 'device acpi'. After this commit it fails with this error: --- kernel.full --- linking kernel.full ld: error: undefined symbol: acpi_pxm_set_cpu_locality >>> referenced by mp_machdep.c:269 (/usr/src/sys/amd64/amd64/mp_machdep.c:269) >>> mp_machdep.o:(cpu_mp_start) *** [kernel.full] Error code 1 Was that intended? -- Herbert From owner-svn-src-all@freebsd.org Thu May 21 22:47: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 40AB92F7B11; Thu, 21 May 2020 22:47:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SlBR1CxKz4S7N; Thu, 21 May 2020 22:47:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2055314FDD; Thu, 21 May 2020 22:47:43 +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 04LMlhNS041393; Thu, 21 May 2020 22:47:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LMleEo041378; Thu, 21 May 2020 22:47:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005212247.04LMleEo041378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 21 May 2020 22:47:40 +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: r361350 - in stable/12: contrib/netbsd-tests/lib/libc/sys lib/libc/sys lib/libc/tests/sys sys/amd64/vmm sys/sys sys/vm usr.bin/vmstat X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: contrib/netbsd-tests/lib/libc/sys lib/libc/sys lib/libc/tests/sys sys/amd64/vmm sys/sys sys/vm usr.bin/vmstat X-SVN-Commit-Revision: 361350 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, 21 May 2020 22:47:43 -0000 Author: markj Date: Thu May 21 22:47:39 2020 New Revision: 361350 URL: https://svnweb.freebsd.org/changeset/base/361350 Log: MFC r347532, r347541 Provide separate accounting for user-wired pages. Modified: stable/12/contrib/netbsd-tests/lib/libc/sys/t_mlock.c stable/12/lib/libc/sys/mlock.2 stable/12/lib/libc/sys/mlockall.2 stable/12/lib/libc/tests/sys/mlock_helper.c stable/12/sys/amd64/vmm/vmm.c stable/12/sys/sys/param.h stable/12/sys/sys/vmmeter.h stable/12/sys/vm/vm_glue.c stable/12/sys/vm/vm_map.c stable/12/sys/vm/vm_map.h stable/12/sys/vm/vm_meter.c stable/12/sys/vm/vm_mmap.c stable/12/sys/vm/vm_pageout.c stable/12/sys/vm/vm_pageout.h stable/12/sys/vm/vm_unix.c stable/12/usr.bin/vmstat/vmstat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/netbsd-tests/lib/libc/sys/t_mlock.c ============================================================================== --- stable/12/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Thu May 21 22:24:23 2020 (r361349) +++ stable/12/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Thu May 21 22:47:39 2020 (r361350) @@ -51,7 +51,7 @@ __RCSID("$NetBSD: t_mlock.c,v 1.6 2016/08/09 12:02:44 #define _KMEMUSER #include -void set_vm_max_wired(int); +void set_vm_max_wired(u_long); void restore_vm_max_wired(void); #endif Modified: stable/12/lib/libc/sys/mlock.2 ============================================================================== --- stable/12/lib/libc/sys/mlock.2 Thu May 21 22:24:23 2020 (r361349) +++ stable/12/lib/libc/sys/mlock.2 Thu May 21 22:47:39 2020 (r361350) @@ -28,7 +28,7 @@ .\" @(#)mlock.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd March 20, 2018 +.Dd May 13, 2019 .Dt MLOCK 2 .Os .Sh NAME @@ -97,13 +97,13 @@ resource limit and the system-wide .Dq wired pages limit -.Va vm.max_wired . -.Va vm.max_wired +.Va vm.max_user_wired . +.Va vm.max_user_wired applies to the system as a whole, so the amount available to a single process at any given time is the difference between -.Va vm.max_wired +.Va vm.max_user_wired and -.Va vm.stats.vm.v_wire_count . +.Va vm.stats.vm.v_user_wire_count . .Pp If .Va security.bsd.unprivileged_mlock @@ -124,13 +124,11 @@ will fail if: is set to 0 and the caller is not the super-user. .It Bq Er EINVAL The address range given wraps around zero. -.It Bq Er EAGAIN -Locking the indicated range would exceed the system limit for locked memory. .It Bq Er ENOMEM Some portion of the indicated address range is not allocated. There was an error faulting/mapping a page. -Locking the indicated range would exceed the per-process limit for locked -memory. +Locking the indicated range would exceed the per-process or system-wide limits +for locked memory. .El The .Fn munlock @@ -171,11 +169,11 @@ system calls first appeared in Allocating too much wired memory can lead to a memory-allocation deadlock which requires a reboot to recover from. .Pp -The per-process resource limit is a limit on the amount of virtual -memory locked, while the system-wide limit is for the number of locked -physical pages. -Hence a process with two distinct locked mappings of the same physical page -counts as 2 pages against the per-process limit and as only a single page -in the system limit. +The per-process and system-wide resource limits of locked memory apply +to the amount of virtual memory locked, not the amount of locked physical +pages. +Hence two distinct locked mappings of the same physical page counts as +2 pages aginst the system limit, and also against the per-process limit +if both mappings belong to the same physical map. .Pp The per-process resource limit is not currently supported. Modified: stable/12/lib/libc/sys/mlockall.2 ============================================================================== --- stable/12/lib/libc/sys/mlockall.2 Thu May 21 22:24:23 2020 (r361349) +++ stable/12/lib/libc/sys/mlockall.2 Thu May 21 22:47:39 2020 (r361350) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 25, 2012 +.Dd May 13, 2019 .Dt MLOCKALL 2 .Os .Sh NAME @@ -69,7 +69,7 @@ limited in how much they can lock down. A single process can lock the minimum of a system-wide .Dq wired pages limit -.Va vm.max_wired +.Va vm.max_user_wired and the per-process .Dv RLIMIT_MEMLOCK resource limit. @@ -138,9 +138,9 @@ and functions first appeared in .Fx 5.1 . .Sh BUGS -The per-process resource limit is a limit on the amount of virtual -memory locked, while the system-wide limit is for the number of locked -physical pages. -Hence a process with two distinct locked mappings of the same physical page -counts as 2 pages against the per-process limit and as only a single page -in the system limit. +The per-process and system-wide resource limits of locked memory apply +to the amount of virtual memory locked, not the amount of locked physical +pages. +Hence two distinct locked mappings of the same physical page counts as +2 pages aginst the system limit, and also against the per-process limit +if both mappings belong to the same physical map. Modified: stable/12/lib/libc/tests/sys/mlock_helper.c ============================================================================== --- stable/12/lib/libc/tests/sys/mlock_helper.c Thu May 21 22:24:23 2020 (r361349) +++ stable/12/lib/libc/tests/sys/mlock_helper.c Thu May 21 22:47:39 2020 (r361350) @@ -39,16 +39,16 @@ __FBSDID("$FreeBSD$"); #include #include -#define VM_MAX_WIRED "vm.max_wired" +#define VM_MAX_WIRED "vm.max_user_wired" static void -vm_max_wired_sysctl(int *old_value, int *new_value) +vm_max_wired_sysctl(u_long *old_value, u_long *new_value) { size_t old_len; - size_t new_len = (new_value == NULL ? 0 : sizeof(int)); + size_t new_len = (new_value == NULL ? 0 : sizeof(*new_value)); if (old_value == NULL) - printf("Setting the new value to %d\n", *new_value); + printf("Setting the new value to %lu\n", *new_value); else { ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, NULL, &old_len, new_value, new_len) == 0, @@ -60,14 +60,14 @@ vm_max_wired_sysctl(int *old_value, int *new_value) "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); if (old_value != NULL) - printf("Saved the old value (%d)\n", *old_value); + printf("Saved the old value (%lu)\n", *old_value); } void -set_vm_max_wired(int new_value) +set_vm_max_wired(u_long new_value) { FILE *fp; - int old_value; + u_long old_value; fp = fopen(VM_MAX_WIRED, "w"); if (fp == NULL) { @@ -78,7 +78,7 @@ set_vm_max_wired(int new_value) vm_max_wired_sysctl(&old_value, NULL); - ATF_REQUIRE_MSG(fprintf(fp, "%d", old_value) > 0, + ATF_REQUIRE_MSG(fprintf(fp, "%lu", old_value) > 0, "saving %s failed", VM_MAX_WIRED); fclose(fp); @@ -90,7 +90,7 @@ void restore_vm_max_wired(void) { FILE *fp; - int saved_max_wired; + u_long saved_max_wired; fp = fopen(VM_MAX_WIRED, "r"); if (fp == NULL) { @@ -98,14 +98,14 @@ restore_vm_max_wired(void) return; } - if (fscanf(fp, "%d", &saved_max_wired) != 1) { + if (fscanf(fp, "%lu", &saved_max_wired) != 1) { perror("fscanf failed\n"); fclose(fp); return; } fclose(fp); - printf("old value in %s: %d\n", VM_MAX_WIRED, saved_max_wired); + printf("old value in %s: %lu\n", VM_MAX_WIRED, saved_max_wired); if (saved_max_wired == 0) /* This will cripple the test host */ return; Modified: stable/12/sys/amd64/vmm/vmm.c ============================================================================== --- stable/12/sys/amd64/vmm/vmm.c Thu May 21 22:24:23 2020 (r361349) +++ stable/12/sys/amd64/vmm/vmm.c Thu May 21 22:47:39 2020 (r361350) @@ -754,7 +754,8 @@ vm_mmap_memseg(struct vm *vm, vm_paddr_t gpa, int segi VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); if (error != KERN_SUCCESS) { vm_map_remove(&vm->vmspace->vm_map, gpa, gpa + len); - return (EFAULT); + return (error == KERN_RESOURCE_SHORTAGE ? ENOMEM : + EFAULT); } } Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Thu May 21 22:24:23 2020 (r361349) +++ stable/12/sys/sys/param.h Thu May 21 22:47:39 2020 (r361350) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1201516 /* Master, propagated to newvers */ +#define __FreeBSD_version 1201517 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: stable/12/sys/sys/vmmeter.h ============================================================================== --- stable/12/sys/sys/vmmeter.h Thu May 21 22:24:23 2020 (r361349) +++ stable/12/sys/sys/vmmeter.h Thu May 21 22:47:39 2020 (r361350) @@ -153,6 +153,8 @@ extern domainset_t vm_severe_domains; #define VM_CNT_INC(var) VM_CNT_ADD(var, 1) #define VM_CNT_FETCH(var) counter_u64_fetch(vm_cnt.var) +extern u_long vm_user_wire_count; + static inline void vm_wire_add(int cnt) { Modified: stable/12/sys/vm/vm_glue.c ============================================================================== --- stable/12/sys/vm/vm_glue.c Thu May 21 22:24:23 2020 (r361349) +++ stable/12/sys/vm/vm_glue.c Thu May 21 22:47:39 2020 (r361350) @@ -181,21 +181,8 @@ vslock(void *addr, size_t len) if (last < (vm_offset_t)addr || end < (vm_offset_t)addr) return (EINVAL); npages = atop(end - start); - if (npages > vm_page_max_wired) + if (npages > (u_long)vm_page_max_user_wired) return (ENOMEM); -#if 0 - /* - * XXX - not yet - * - * The limit for transient usage of wired pages should be - * larger than for "permanent" wired pages (mlock()). - * - * Also, the sysctl code, which is the only present user - * of vslock(), does a hard loop on EAGAIN. - */ - if (npages + vm_wire_count() > vm_page_max_wired) - return (EAGAIN); -#endif error = vm_map_wire(&curproc->p_vmspace->vm_map, start, end, VM_MAP_WIRE_SYSTEM | VM_MAP_WIRE_NOHOLES); if (error == KERN_SUCCESS) { Modified: stable/12/sys/vm/vm_map.c ============================================================================== --- stable/12/sys/vm/vm_map.c Thu May 21 22:24:23 2020 (r361349) +++ stable/12/sys/vm/vm_map.c Thu May 21 22:47:39 2020 (r361350) @@ -91,6 +91,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2987,12 +2988,12 @@ done: if (rv == KERN_SUCCESS && (!user_unwire || (entry->eflags & MAP_ENTRY_USER_WIRED))) { - if (user_unwire) - entry->eflags &= ~MAP_ENTRY_USER_WIRED; if (entry->wired_count == 1) vm_map_entry_unwire(map, entry); else entry->wired_count--; + if (user_unwire) + entry->eflags &= ~MAP_ENTRY_USER_WIRED; } KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0, ("vm_map_unwire: in-transition flag missing %p", entry)); @@ -3012,6 +3013,28 @@ done: return (rv); } +static void +vm_map_wire_user_count_sub(u_long npages) +{ + + atomic_subtract_long(&vm_user_wire_count, npages); +} + +static bool +vm_map_wire_user_count_add(u_long npages) +{ + u_long wired; + + wired = vm_user_wire_count; + do { + if (npages + wired > (u_long)vm_page_max_user_wired) + return (false); + } while (!atomic_fcmpset_long(&vm_user_wire_count, &wired, + npages + wired)); + + return (true); +} + /* * vm_map_wire_entry_failure: * @@ -3048,37 +3071,49 @@ vm_map_wire_entry_failure(vm_map_t map, vm_map_entry_t entry->wired_count = -1; } +int +vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags) +{ + int rv; + + vm_map_lock(map); + rv = vm_map_wire_locked(map, start, end, flags); + vm_map_unlock(map); + return (rv); +} + + /* - * vm_map_wire: + * vm_map_wire_locked: * - * Implements both kernel and user wiring. + * Implements both kernel and user wiring. Returns with the map locked, + * the map lock may be dropped. */ int -vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, - int flags) +vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags) { vm_map_entry_t entry, first_entry, tmp_entry; vm_offset_t faddr, saved_end, saved_start; - unsigned int last_timestamp; + u_long npages; + u_int last_timestamp; int rv; boolean_t need_wakeup, result, user_wire; vm_prot_t prot; + VM_MAP_ASSERT_LOCKED(map); + if (start == end) return (KERN_SUCCESS); prot = 0; if (flags & VM_MAP_WIRE_WRITE) prot |= VM_PROT_WRITE; user_wire = (flags & VM_MAP_WIRE_USER) ? TRUE : FALSE; - vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); if (!vm_map_lookup_entry(map, start, &first_entry)) { if (flags & VM_MAP_WIRE_HOLESOK) first_entry = first_entry->next; - else { - vm_map_unlock(map); + else return (KERN_INVALID_ADDRESS); - } } last_timestamp = map->timestamp; entry = first_entry; @@ -3112,7 +3147,6 @@ vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset /* * first_entry has been deleted. */ - vm_map_unlock(map); return (KERN_INVALID_ADDRESS); } end = saved_start; @@ -3152,13 +3186,22 @@ vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset } if (entry->wired_count == 0) { entry->wired_count++; - saved_start = entry->start; - saved_end = entry->end; + npages = atop(entry->end - entry->start); + if (user_wire && !vm_map_wire_user_count_add(npages)) { + vm_map_wire_entry_failure(map, entry, + entry->start); + end = entry->end; + rv = KERN_RESOURCE_SHORTAGE; + goto done; + } + /* * Release the map lock, relying on the in-transition * mark. Mark the map busy for fork. */ + saved_start = entry->start; + saved_end = entry->end; vm_map_busy(map); vm_map_unlock(map); @@ -3207,6 +3250,8 @@ vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset last_timestamp = map->timestamp; if (rv != KERN_SUCCESS) { vm_map_wire_entry_failure(map, entry, faddr); + if (user_wire) + vm_map_wire_user_count_sub(npages); end = entry->end; goto done; } @@ -3272,9 +3317,12 @@ done: * Undo the wiring. Wiring succeeded on this entry * but failed on a later entry. */ - if (entry->wired_count == 1) + if (entry->wired_count == 1) { vm_map_entry_unwire(map, entry); - else + if (user_wire) + vm_map_wire_user_count_sub( + atop(entry->end - entry->start)); + } else entry->wired_count--; } next_entry_done: @@ -3291,7 +3339,6 @@ done: } vm_map_simplify_entry(map, entry); } - vm_map_unlock(map); if (need_wakeup) vm_map_wakeup(map); return (rv); @@ -3409,13 +3456,18 @@ vm_map_sync( static void vm_map_entry_unwire(vm_map_t map, vm_map_entry_t entry) { + vm_size_t size; VM_MAP_ASSERT_LOCKED(map); KASSERT(entry->wired_count > 0, ("vm_map_entry_unwire: entry %p isn't wired", entry)); + + size = entry->end - entry->start; + if ((entry->eflags & MAP_ENTRY_USER_WIRED) != 0) + vm_map_wire_user_count_sub(atop(size)); pmap_unwire(map->pmap, entry->start, entry->end); - vm_object_unwire(entry->object.vm_object, entry->offset, entry->end - - entry->start, PQ_ACTIVE); + vm_object_unwire(entry->object.vm_object, entry->offset, size, + PQ_ACTIVE); entry->wired_count = 0; } @@ -4401,12 +4453,11 @@ retry: * Heed the MAP_WIREFUTURE flag if it was set for this process. */ if (rv == KERN_SUCCESS && (map->flags & MAP_WIREFUTURE) != 0) { - vm_map_unlock(map); - vm_map_wire(map, grow_start, grow_start + grow_amount, + rv = vm_map_wire_locked(map, grow_start, + grow_start + grow_amount, VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); - vm_map_lock_read(map); - } else - vm_map_lock_downgrade(map); + } + vm_map_lock_downgrade(map); out: #ifdef RACCT Modified: stable/12/sys/vm/vm_map.h ============================================================================== --- stable/12/sys/vm/vm_map.h Thu May 21 22:24:23 2020 (r361349) +++ stable/12/sys/vm/vm_map.h Thu May 21 22:47:39 2020 (r361350) @@ -427,7 +427,8 @@ int vm_map_madvise (vm_map_t, vm_offset_t, vm_offset_t int vm_map_stack (vm_map_t, vm_offset_t, vm_size_t, vm_prot_t, vm_prot_t, int); int vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags); -int vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, +int vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags); +int vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags); long vmspace_swap_count(struct vmspace *vmspace); void vm_map_entry_set_vnode_text(vm_map_entry_t entry, bool add); Modified: stable/12/sys/vm/vm_meter.c ============================================================================== --- stable/12/sys/vm/vm_meter.c Thu May 21 22:24:23 2020 (r361349) +++ stable/12/sys/vm/vm_meter.c Thu May 21 22:47:39 2020 (r361350) @@ -97,6 +97,8 @@ struct vmmeter __read_mostly vm_cnt = { .v_wire_count = EARLY_COUNTER, }; +u_long __exclusive_cache_line vm_user_wire_count; + static void vmcounter_startup(void) { @@ -394,6 +396,8 @@ sysctl_handle_vmstat_proc(SYSCTL_HANDLER_ARGS) #define VM_STATS_UINT(var, descr) \ SYSCTL_UINT(_vm_stats_vm, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, 0, descr) +#define VM_STATS_ULONG(var, descr) \ + SYSCTL_ULONG(_vm_stats_vm, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, 0, descr) VM_STATS_UINT(v_page_size, "Page size in bytes"); VM_STATS_UINT(v_page_count, "Total number of pages in system"); @@ -410,6 +414,9 @@ VM_STATS_PROC(v_laundry_count, "Pages eligible for lau VM_STATS_UINT(v_pageout_free_min, "Min pages reserved for kernel"); VM_STATS_UINT(v_interrupt_free_min, "Reserved pages for interrupt code"); VM_STATS_UINT(v_free_severe, "Severe page depletion point"); + +SYSCTL_ULONG(_vm_stats_vm, OID_AUTO, v_user_wire_count, CTLFLAG_RD, + &vm_user_wire_count, 0, "User-wired virtual memory"); #ifdef COMPAT_FREEBSD11 /* Modified: stable/12/sys/vm/vm_mmap.c ============================================================================== --- stable/12/sys/vm/vm_mmap.c Thu May 21 22:24:23 2020 (r361349) +++ stable/12/sys/vm/vm_mmap.c Thu May 21 22:47:39 2020 (r361350) @@ -1026,7 +1026,7 @@ kern_mlock(struct proc *proc, struct ucred *cred, uint if (last < addr || end < addr) return (EINVAL); npages = atop(end - start); - if (npages > vm_page_max_wired) + if ((u_int)npages > vm_page_max_user_wired) return (ENOMEM); map = &proc->p_vmspace->vm_map; PROC_LOCK(proc); @@ -1036,8 +1036,6 @@ kern_mlock(struct proc *proc, struct ucred *cred, uint return (ENOMEM); } PROC_UNLOCK(proc); - if (npages + vm_wire_count() > vm_page_max_wired) - return (EAGAIN); #ifdef RACCT if (racct_enable) { PROC_LOCK(proc); @@ -1114,7 +1112,12 @@ sys_mlockall(struct thread *td, struct mlockall_args * */ error = vm_map_wire(map, vm_map_min(map), vm_map_max(map), VM_MAP_WIRE_USER|VM_MAP_WIRE_HOLESOK); - error = (error == KERN_SUCCESS ? 0 : EAGAIN); + if (error == KERN_SUCCESS) + error = 0; + else if (error == KERN_RESOURCE_SHORTAGE) + error = ENOMEM; + else + error = EAGAIN; } #ifdef RACCT if (racct_enable && error != KERN_SUCCESS) { @@ -1581,10 +1584,14 @@ vm_mmap_object(vm_map_t map, vm_offset_t *addr, vm_siz * If the process has requested that all future mappings * be wired, then heed this. */ - if (map->flags & MAP_WIREFUTURE) { - vm_map_wire(map, *addr, *addr + size, - VM_MAP_WIRE_USER | ((flags & MAP_STACK) ? - VM_MAP_WIRE_HOLESOK : VM_MAP_WIRE_NOHOLES)); + if ((map->flags & MAP_WIREFUTURE) != 0) { + vm_map_lock(map); + if ((map->flags & MAP_WIREFUTURE) != 0) + (void)vm_map_wire_locked(map, *addr, + *addr + size, VM_MAP_WIRE_USER | + ((flags & MAP_STACK) ? VM_MAP_WIRE_HOLESOK : + VM_MAP_WIRE_NOHOLES)); + vm_map_unlock(map); } } return (vm_mmap_to_errno(rv)); Modified: stable/12/sys/vm/vm_pageout.c ============================================================================== --- stable/12/sys/vm/vm_pageout.c Thu May 21 22:24:23 2020 (r361349) +++ stable/12/sys/vm/vm_pageout.c Thu May 21 22:47:39 2020 (r361350) @@ -194,9 +194,10 @@ SYSCTL_UINT(_vm, OID_AUTO, background_launder_max, CTL int vm_pageout_page_count = 32; -int vm_page_max_wired; /* XXX max # of wired pages system-wide */ -SYSCTL_INT(_vm, OID_AUTO, max_wired, - CTLFLAG_RW, &vm_page_max_wired, 0, "System-wide limit to wired page count"); +u_int vm_page_max_user_wired; +SYSCTL_UINT(_vm, OID_AUTO, max_wired, CTLFLAG_RW, + &vm_page_max_user_wired, 0, + "system-wide limit to user-wired page count"); static u_int isqrt(u_int num); static int vm_pageout_launder(struct vm_domain *vmd, int launder, @@ -2072,8 +2073,8 @@ vm_pageout_init(void) if (vm_pageout_update_period == 0) vm_pageout_update_period = 600; - if (vm_page_max_wired == 0) - vm_page_max_wired = freecount / 3; + if (vm_page_max_user_wired == 0) + vm_page_max_user_wired = freecount / 3; } /* Modified: stable/12/sys/vm/vm_pageout.h ============================================================================== --- stable/12/sys/vm/vm_pageout.h Thu May 21 22:24:23 2020 (r361349) +++ stable/12/sys/vm/vm_pageout.h Thu May 21 22:47:39 2020 (r361350) @@ -75,7 +75,7 @@ * Exported data structures. */ -extern int vm_page_max_wired; +extern u_int vm_page_max_user_wired; extern int vm_pageout_page_count; #define VM_OOM_MEM 1 Modified: stable/12/sys/vm/vm_unix.c ============================================================================== --- stable/12/sys/vm/vm_unix.c Thu May 21 22:24:23 2020 (r361349) +++ stable/12/sys/vm/vm_unix.c Thu May 21 22:47:39 2020 (r361350) @@ -92,13 +92,11 @@ kern_break(struct thread *td, uintptr_t *addr) rlim_t datalim, lmemlim, vmemlim; int prot, rv; int error = 0; - boolean_t do_map_wirefuture; datalim = lim_cur(td, RLIMIT_DATA); lmemlim = lim_cur(td, RLIMIT_MEMLOCK); vmemlim = lim_cur(td, RLIMIT_VMEM); - do_map_wirefuture = FALSE; new = round_page(*addr); vm_map_lock(map); @@ -183,7 +181,14 @@ kern_break(struct thread *td, uintptr_t *addr) prot |= VM_PROT_EXECUTE; #endif #endif - rv = vm_map_insert(map, NULL, 0, old, new, prot, VM_PROT_ALL, 0); + rv = vm_map_insert(map, NULL, 0, old, new, prot, VM_PROT_ALL, + 0); + if (rv == KERN_SUCCESS && (map->flags & MAP_WIREFUTURE) != 0) { + 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); + } if (rv != KERN_SUCCESS) { #ifdef RACCT if (racct_enable) { @@ -204,17 +209,6 @@ kern_break(struct thread *td, uintptr_t *addr) goto done; } vm->vm_dsize += btoc(new - old); - /* - * Handle the MAP_WIREFUTURE case for legacy applications, - * by marking the newly mapped range of pages as wired. - * We are not required to perform a corresponding - * vm_map_unwire() before vm_map_delete() below, as - * it will forcibly unwire the pages in the range. - * - * XXX If the pages cannot be wired, no error is returned. - */ - if ((map->flags & MAP_WIREFUTURE) == MAP_WIREFUTURE) - do_map_wirefuture = TRUE; } else if (new < old) { rv = vm_map_delete(map, new, old); if (rv != KERN_SUCCESS) { @@ -237,10 +231,6 @@ kern_break(struct thread *td, uintptr_t *addr) } done: vm_map_unlock(map); - - if (do_map_wirefuture) - (void) vm_map_wire(map, old, new, - VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES); if (error == 0) *addr = new; Modified: stable/12/usr.bin/vmstat/vmstat.c ============================================================================== --- stable/12/usr.bin/vmstat/vmstat.c Thu May 21 22:24:23 2020 (r361349) +++ stable/12/usr.bin/vmstat/vmstat.c Thu May 21 22:47:39 2020 (r361350) @@ -156,6 +156,7 @@ static struct __vmmeter { u_int v_free_min; u_int v_free_count; u_int v_wire_count; + u_long v_user_wire_count; u_int v_active_count; u_int v_inactive_target; u_int v_inactive_count; @@ -566,6 +567,7 @@ fill_vmmeter(struct __vmmeter *vmmp) GET_VM_STATS(vm, v_free_min); GET_VM_STATS(vm, v_free_count); GET_VM_STATS(vm, v_wire_count); + GET_VM_STATS(vm, v_user_wire_count); GET_VM_STATS(vm, v_active_count); GET_VM_STATS(vm, v_inactive_target); GET_VM_STATS(vm, v_inactive_count); @@ -1057,6 +1059,8 @@ dosum(void) sum.v_laundry_count); xo_emit("{:wired-pages/%9u} {N:pages wired down}\n", sum.v_wire_count); + xo_emit("{:virtual-user-wired-pages/%9lu} {N:virtual user pages wired " + "down}\n", sum.v_user_wire_count); xo_emit("{:free-pages/%9u} {N:pages free}\n", sum.v_free_count); xo_emit("{:bytes-per-page/%9u} {N:bytes per page}\n", sum.v_page_size); From owner-svn-src-all@freebsd.org Thu May 21 23:31: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 66D132F80F0; Thu, 21 May 2020 23:31:59 +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 49Sm9W0dnyz4VZQ; Thu, 21 May 2020 23:31:58 +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 04LNVv9C018958; Thu, 21 May 2020 16:31:57 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04LNVvac018957; Thu, 21 May 2020 16:31:57 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202005212331.04LNVvac018957@gndrsh.dnsmgr.net> Subject: Re: svn commit: r361340 - in stable/12/sys/netinet: . tcp_stacks In-Reply-To: <202005211941.04LJfPQ0023810@repo.freebsd.org> To: Richard Scheffenegger Date: Thu, 21 May 2020 16:31:57 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49Sm9W0dnyz4VZQ 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:13868, ipnet:69.59.192.0/19, 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, 21 May 2020 23:31:59 -0000 > Author: rscheff > Date: Thu May 21 19:41:25 2020 > New Revision: 361340 > URL: https://svnweb.freebsd.org/changeset/base/361340 > > Log: > MFC r360479: Prevent premature shrinking of the scaled receive window > > which can cause a TCP client to use invalid or stale TCP sequence numbers for ACK packets. > > Packets with old sequence numbers are ignored and not used to update the send window size. > This might cause the TCP session to hang indefinitely under some circumstances. There should of been a note here: This does NOT contain the merge of the change to bbrv1 since at this time that code does not exist in stable/12, and there is no plan to merge that code to stable/12. > Reported by: Cui Cheng > Reviewed by: tuexen (mentor), rgrimes (mentor, blanket) > Approved by: tuexen (mentor), rgrimes (mentor, blanket) > MFC after: 3 weeks > Sponsored by: NetApp, Inc. > Differential Revision: https://reviews.freebsd.org/D24515 > > Modified: > stable/12/sys/netinet/tcp_output.c > stable/12/sys/netinet/tcp_stacks/rack.c > Directory Properties: > stable/12/ (props changed) > > Modified: stable/12/sys/netinet/tcp_output.c > ============================================================================== > --- stable/12/sys/netinet/tcp_output.c Thu May 21 18:50:05 2020 (r361339) > +++ stable/12/sys/netinet/tcp_output.c Thu May 21 19:41:25 2020 (r361340) > @@ -1206,8 +1206,11 @@ send: > if (flags & TH_SYN) > th->th_win = htons((u_short) > (min(sbspace(&so->so_rcv), TCP_MAXWIN))); > - else > + else { > + /* Avoid shrinking window with window scaling. */ > + recwin = roundup2(recwin, 1 << tp->rcv_scale); > th->th_win = htons((u_short)(recwin >> tp->rcv_scale)); > + } > > /* > * Adjust the RXWIN0SENT flag - indicate that we have advertised > > Modified: stable/12/sys/netinet/tcp_stacks/rack.c > ============================================================================== > --- stable/12/sys/netinet/tcp_stacks/rack.c Thu May 21 18:50:05 2020 (r361339) > +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu May 21 19:41:25 2020 (r361340) > @@ -8355,8 +8355,11 @@ send: > if (flags & TH_SYN) > th->th_win = htons((u_short) > (min(sbspace(&so->so_rcv), TCP_MAXWIN))); > - else > + else { > + /* Avoid shrinking window with window scaling. */ > + recwin = roundup2(recwin, 1 << tp->rcv_scale); > th->th_win = htons((u_short)(recwin >> tp->rcv_scale)); > + } > /* > * Adjust the RXWIN0SENT flag - indicate that we have advertised a 0 > * window. This may cause the remote transmitter to stall. This > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu May 21 23:34: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 E33F32F85C8; Thu, 21 May 2020 23:34:16 +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 49SmD84Swkz4VjG; Thu, 21 May 2020 23:34:16 +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 04LNYELm018984; Thu, 21 May 2020 16:34:14 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04LNYEY9018983; Thu, 21 May 2020 16:34:14 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202005212334.04LNYEY9018983@gndrsh.dnsmgr.net> Subject: Re: svn commit: r361342 - in stable/12/sys/netinet: . tcp_stacks In-Reply-To: <202005211946.04LJkBme027322@repo.freebsd.org> To: Richard Scheffenegger Date: Thu, 21 May 2020 16:34:14 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49SmD84Swkz4VjG 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:13868, ipnet:69.59.192.0/19, 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, 21 May 2020 23:34:17 -0000 > Author: rscheff > Date: Thu May 21 19:46:11 2020 > New Revision: 361342 > URL: https://svnweb.freebsd.org/changeset/base/361342 > > Log: Partial merge of r360477: > MFC r360477: Correctly set up the initial TCP congestion window in all cases > > by not including the SYN bit sequence space in cwnd related calculations. > Snd_und is adjusted explicitly in all cases, outside the cwnd update, instead. > > This fixes an off-by-one conformance issue with regular TCP sessions > not using Appropriate Byte Counting (RFC3465), sending one more > packet during the initial window than expected. There should of been a note here: This does NOT contain the merge of the change to bbrv1 since at this time that code does not exist in stable/12, and there is no plan to merge that code to stable/12. > > PR: 235256 > Reviewed by: tuexen (mentor), rgrimes (mentor, blanket) > Approved by: tuexen (mentor), rgrimes (mentor, blanket) > MFC after: 3 weeks > Sponsored by: NetApp, Inc. > Differential Revision: https://reviews.freebsd.org/D19000 > > Modified: > stable/12/sys/netinet/tcp_input.c > stable/12/sys/netinet/tcp_stacks/rack.c > Directory Properties: > stable/12/ (props changed) > > Modified: stable/12/sys/netinet/tcp_input.c > ============================================================================== > --- stable/12/sys/netinet/tcp_input.c Thu May 21 19:45:14 2020 (r361341) > +++ stable/12/sys/netinet/tcp_input.c Thu May 21 19:46:11 2020 (r361342) > @@ -1519,7 +1519,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru > struct tcpcb *tp, int drop_hdrlen, int tlen, uint8_t iptos) > { > int thflags, acked, ourfinisacked, needoutput = 0, sack_changed; > - int rstreason, todrop, win; > + int rstreason, todrop, win, incforsyn = 0; > uint32_t tiwin; > uint16_t nsegs; > char *s; > @@ -2432,12 +2432,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru > if (IS_FASTOPEN(tp->t_flags) && tp->t_tfo_pending) { > tcp_fastopen_decrement_counter(tp->t_tfo_pending); > tp->t_tfo_pending = NULL; > - > - /* > - * Account for the ACK of our SYN prior to > - * regular ACK processing below. > - */ > - tp->snd_una++; > } > if (tp->t_flags & TF_NEEDFIN) { > tcp_state_change(tp, TCPS_FIN_WAIT_1); > @@ -2458,6 +2452,13 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru > tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); > } > /* > + * Account for the ACK of our SYN prior to > + * regular ACK processing below, except for > + * simultaneous SYN, which is handled later. > + */ > + if (SEQ_GT(th->th_ack, tp->snd_una) && !(tp->t_flags & TF_NEEDSYN)) > + incforsyn = 1; > + /* > * If segment contains data or ACK, will call tcp_reass() > * later; if not, do so now to pass queued data to user. > */ > @@ -2751,6 +2752,15 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru > process_ACK: > INP_WLOCK_ASSERT(tp->t_inpcb); > > + /* > + * Adjust for the SYN bit in sequence space, > + * but don't account for it in cwnd calculations. > + * This is for the SYN_RECEIVED, non-simultaneous > + * SYN case. SYN_SENT and simultaneous SYN are > + * treated elsewhere. > + */ > + if (incforsyn) > + tp->snd_una++; > acked = BYTES_THIS_ACK(tp, th); > KASSERT(acked >= 0, ("%s: acked unexepectedly negative " > "(tp->snd_una=%u, th->th_ack=%u, tp=%p, m=%p)", __func__, > > Modified: stable/12/sys/netinet/tcp_stacks/rack.c > ============================================================================== > --- stable/12/sys/netinet/tcp_stacks/rack.c Thu May 21 19:45:14 2020 (r361341) > +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu May 21 19:46:11 2020 (r361342) > @@ -5580,12 +5580,6 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st > if (IS_FASTOPEN(tp->t_flags) && tp->t_tfo_pending) { > tcp_fastopen_decrement_counter(tp->t_tfo_pending); > tp->t_tfo_pending = NULL; > - > - /* > - * Account for the ACK of our SYN prior to > - * regular ACK processing below. > - */ > - tp->snd_una++; > } > if (tp->t_flags & TF_NEEDFIN) { > tcp_state_change(tp, TCPS_FIN_WAIT_1); > @@ -5603,6 +5597,13 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st > if (!IS_FASTOPEN(tp->t_flags)) > cc_conn_init(tp); > } > + /* > + * Account for the ACK of our SYN prior to > + * regular ACK processing below, except for > + * simultaneous SYN, which is handled later. > + */ > + if (SEQ_GT(th->th_ack, tp->snd_una) && !(tp->t_flags & TF_NEEDSYN)) > + tp->snd_una++; > /* > * If segment contains data or ACK, will call tcp_reass() later; if > * not, do so now to pass queued data to user. > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri May 22 00:00: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 E55302F9142; Fri, 22 May 2020 00:00:55 +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 49Smpv4bdpz4Wpn; Fri, 22 May 2020 00:00:55 +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 9497815E11; Fri, 22 May 2020 00:00:55 +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 04M00tbh085712; Fri, 22 May 2020 00:00:55 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04M00tGZ085711; Fri, 22 May 2020 00:00:55 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202005220000.04M00tGZ085711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 22 May 2020 00:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r361351 - releng/11.4/sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.4/sys/conf X-SVN-Commit-Revision: 361351 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, 22 May 2020 00:00:56 -0000 Author: gjb Date: Fri May 22 00:00:55 2020 New Revision: 361351 URL: https://svnweb.freebsd.org/changeset/base/361351 Log: Update releng/11.4 to RC1 as part of the 11.4-RELEASE cycle. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/11.4/sys/conf/newvers.sh Modified: releng/11.4/sys/conf/newvers.sh ============================================================================== --- releng/11.4/sys/conf/newvers.sh Thu May 21 22:47:39 2020 (r361350) +++ releng/11.4/sys/conf/newvers.sh Fri May 22 00:00:55 2020 (r361351) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.4" -BRANCH="BETA2" +BRANCH="RC1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri May 22 01:18: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 CE61C2FA99F; Fri, 22 May 2020 01:18:55 +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 49SpXv54Q6z4Ztq; Fri, 22 May 2020 01:18:55 +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 A4BF316B32; Fri, 22 May 2020 01:18:55 +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 04M1Itgr032878; Fri, 22 May 2020 01:18:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04M1ItwO032876; Fri, 22 May 2020 01:18:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005220118.04M1ItwO032876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 22 May 2020 01:18:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361352 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 361352 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, 22 May 2020 01:18:55 -0000 Author: markj Date: Fri May 22 01:18:55 2020 New Revision: 361352 URL: https://svnweb.freebsd.org/changeset/base/361352 Log: Fix the build after r361033 when ACPI is disabled. Reported by: Herbert J. Skuhra Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/i386/i386/mp_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Fri May 22 00:00:55 2020 (r361351) +++ head/sys/amd64/amd64/mp_machdep.c Fri May 22 01:18:55 2020 (r361352) @@ -29,6 +29,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_acpi.h" #include "opt_cpu.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" @@ -78,8 +79,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef DEV_ACPI #include #include +#endif #define WARMBOOT_TARGET 0 #define WARMBOOT_OFF (KERNBASE + 0x0467) @@ -265,7 +268,9 @@ cpu_mp_start(void) set_interrupt_apic_ids(); +#if defined(DEV_ACPI) && MAXMEMDOM > 1 acpi_pxm_set_cpu_locality(); +#endif } /* Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Fri May 22 00:00:55 2020 (r361351) +++ head/sys/i386/i386/mp_machdep.c Fri May 22 01:18:55 2020 (r361352) @@ -28,6 +28,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_acpi.h" #include "opt_apic.h" #include "opt_cpu.h" #include "opt_kstack_pages.h" @@ -83,8 +84,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef DEV_ACPI #include #include +#endif #define WARMBOOT_TARGET 0 #define WARMBOOT_OFF (PMAP_MAP_LOW + 0x0467) @@ -202,7 +205,7 @@ cpu_mp_start(void) set_interrupt_apic_ids(); -#if MAXMEMDOM > 1 +#if defined(DEV_ACPI) && MAXMEMDOM > 1 acpi_pxm_set_cpu_locality(); #endif } From owner-svn-src-all@freebsd.org Fri May 22 01:30: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 32D992FA8E3; Fri, 22 May 2020 01:30:17 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf42.google.com (mail-qv1-xf42.google.com [IPv6:2607:f8b0:4864:20::f42]) (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 49Spp057sXz4bFl; Fri, 22 May 2020 01:30:16 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qv1-xf42.google.com with SMTP id r3so4069347qve.1; Thu, 21 May 2020 18:30:16 -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=e0owCijb/mxyU4tlNffIfomcbYpMgnINIx1ohlr/NT4=; b=ANxxxtUK6DBZBJ7Sjt4SZkBOjf1lSrfN+hcf3KHzKxa/pJoN7tZ/H4H+d6VbHX60ra Aea7rqSHPKDigDwR22hA0iO4rx+TwWq7eEg1CH6kI1n4CYH0BJ/MOgASkJbEx2g69DtP YoGScDt3qAt6L+V6CFaFHEQBkh8gqqFhQjdVllyw55VzLsAu7k2esUdxtPUqdgfEg1Rh d5z/LZxx8K/Fuyz8basT5ERCo3rrX6+4ZIN9EPYmt7ofy9CBi9QoTENUrdvi5hvKwpzO jV3JEDgePJmGSyKG3FkUp1wU1KgW84qiDInOwP7tvLaDRFh4dumSbreFYLc5cTsrBxtc 5NzA== 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=e0owCijb/mxyU4tlNffIfomcbYpMgnINIx1ohlr/NT4=; b=ZHRLT95TIe4LEyAXhAnvgiyoStgkIyFB9liqOEQ8SYPZfGJ56yEwqmnva17aE9QOT/ RH3ePePAuKE0CEPPieNEO1UQ4ExhNKlt3ugkGPV2vOmXQJv21v/v7/DjL/NfLuTjqYqT RMBpM/ZdbYlU+lhSeqBb9jh46yUKFAI+OIypu8cS6VItruvKcizj4meWKT5dOGVeQqzy xqTyWo0DTGtojlqdQgKNFupMcdlf8qy6H2FGip/86AUiU31+C/Db2HyPw2o6yPpZ6NH9 nQ3l6lBOWcnaPjULFCioaDOpYxJypSmzR2qoI9WU54sabvO9tfCWG4iH/rYxrJ7vwA8C THwg== X-Gm-Message-State: AOAM531DqAin+5p33oaglhl/n2OZvApMtXJqAx+TEQWrsydIMpNJAB0k TKLnsI192Xp9zgm0MLMedHYgXBFNOso= X-Google-Smtp-Source: ABdhPJzxOz63BVIhM0kszB+I0xY4OYopoylAr+SVFY/yCQ6bOQ+DnlMKWbsIT4Qs1cAP5dSUtswvbg== X-Received: by 2002:a0c:aa4b:: with SMTP id e11mr1555265qvb.14.1590111015413; Thu, 21 May 2020 18:30:15 -0700 (PDT) Received: from raichu (toroon0560w-lp130-15-184-144-87-103.dsl.bell.ca. [184.144.87.103]) by smtp.gmail.com with ESMTPSA id a12sm5923769qko.103.2020.05.21.18.30.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 18:30:14 -0700 (PDT) Sender: Mark Johnston Date: Thu, 21 May 2020 21:30:12 -0400 From: Mark Johnston To: "Herbert J. Skuhra" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: Re: svn commit: r361334 - in stable/12/sys: amd64/amd64 arm64/arm64 dev/acpica i386/i386 x86/acpica Message-ID: <20200522013012.GK85681@raichu> References: <202005211528.04LFSZFF068443@repo.freebsd.org> <87a720aowg.wl-herbert@gojira.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a720aowg.wl-herbert@gojira.at> X-Rspamd-Queue-Id: 49Spp057sXz4bFl X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=ANxxxtUK; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::f42 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-1.13 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.78)[-0.779]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; NEURAL_HAM_LONG(-0.94)[-0.941]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.29)[0.290]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f42:from]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[184.144.87.103: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]; RCVD_TLS_ALL(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, 22 May 2020 01:30:17 -0000 On Fri, May 22, 2020 at 12:45:03AM +0200, Herbert J. Skuhra wrote: > On Thu, 21 May 2020 17:28:35 +0200, Mark Johnston wrote: > > > > Author: markj > > Date: Thu May 21 15:28:35 2020 > > New Revision: 361334 > > URL: https://svnweb.freebsd.org/changeset/base/361334 > > > > Log: > > MFC r361033: > > Call acpi_pxm_set_proximity_info() slightly earlier on x86. > > > > Modified: > > stable/12/sys/amd64/amd64/mp_machdep.c > > stable/12/sys/arm64/arm64/mp_machdep.c > > stable/12/sys/dev/acpica/acpi_pxm.c > > stable/12/sys/dev/acpica/acpivar.h > > stable/12/sys/i386/i386/mp_machdep.c > > stable/12/sys/x86/acpica/srat.c > > Directory Properties: > > stable/12/ (props changed) > > > > Modified: stable/12/sys/amd64/amd64/mp_machdep.c > > ============================================================================== > > --- stable/12/sys/amd64/amd64/mp_machdep.c Thu May 21 15:18:59 2020 (r361333) > > +++ stable/12/sys/amd64/amd64/mp_machdep.c Thu May 21 15:28:35 2020 (r361334) > > @@ -265,8 +265,9 @@ cpu_mp_start(void) > > init_ops.start_all_aps(); > > > > set_interrupt_apic_ids(); > > -} > > > > + acpi_pxm_set_cpu_locality(); > > +} > > > > /* > > * AP CPU's call this to initialize themselves. > > Until now it was possible to build a kernel (amd64) without 'device > acpi'. After this commit it fails with this error: > > --- kernel.full --- > linking kernel.full > ld: error: undefined symbol: acpi_pxm_set_cpu_locality > >>> referenced by mp_machdep.c:269 (/usr/src/sys/amd64/amd64/mp_machdep.c:269) > >>> mp_machdep.o:(cpu_mp_start) > *** [kernel.full] Error code 1 > > Was that intended? It was unintentional. I committed a fix to head in r361352 and will merge to stable/12 shortly. From owner-svn-src-all@freebsd.org Fri May 22 02:06: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 2E9F92FB7D0; Fri, 22 May 2020 02:06:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SqcK0Qkdz4dTx; Fri, 22 May 2020 02:06:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09D0916FF7; Fri, 22 May 2020 02:06:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04M26ub6063304; Fri, 22 May 2020 02:06:56 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04M26uhT063303; Fri, 22 May 2020 02:06:56 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202005220206.04M26uhT063303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 22 May 2020 02:06: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: r361353 - stable/12/usr.sbin/ntp/ntpd X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/12/usr.sbin/ntp/ntpd X-SVN-Commit-Revision: 361353 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, 22 May 2020 02:06:57 -0000 Author: delphij Date: Fri May 22 02:06:56 2020 New Revision: 361353 URL: https://svnweb.freebsd.org/changeset/base/361353 Log: MFC r361260: Update leap-seconds to leap-seconds.3676924800. Modified: stable/12/usr.sbin/ntp/ntpd/leap-seconds Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/ntp/ntpd/leap-seconds ============================================================================== --- stable/12/usr.sbin/ntp/ntpd/leap-seconds Fri May 22 01:18:55 2020 (r361352) +++ stable/12/usr.sbin/ntp/ntpd/leap-seconds Fri May 22 02:06:56 2020 (r361353) @@ -204,10 +204,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C58 -# File expires on: 28 June 2020 +# Updated through IERS Bulletin C59 +# File expires on: 28 December 2020 # -#@ 3802291200 +#@ 3818102400 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -252,4 +252,4 @@ # the hash line is also ignored in the # computation. # -#h f28827d2 f263b6c3 ec0f19eb a3e0dbf0 97f3fa30 +#h a1c168ae 27c79a7d 9dddcfc3 bcfe616b 2e2c44ea From owner-svn-src-all@freebsd.org Fri May 22 03:11: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 796CC2FC46D; Fri, 22 May 2020 03:11:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Ss2t2hYVz3S71; Fri, 22 May 2020 03:11:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57AD918039; Fri, 22 May 2020 03:11:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04M3BYxh006004; Fri, 22 May 2020 03:11:34 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04M3BYfU006003; Fri, 22 May 2020 03:11:34 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202005220311.04M3BYfU006003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 22 May 2020 03:11:34 +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: r361354 - stable/11/etc/ntp X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/etc/ntp X-SVN-Commit-Revision: 361354 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, 22 May 2020 03:11:34 -0000 Author: delphij Date: Fri May 22 03:11:33 2020 New Revision: 361354 URL: https://svnweb.freebsd.org/changeset/base/361354 Log: MFC r361260: Update leap-seconds to leap-seconds.3676924800. Modified: stable/11/etc/ntp/leap-seconds Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/ntp/leap-seconds ============================================================================== --- stable/11/etc/ntp/leap-seconds Fri May 22 02:06:56 2020 (r361353) +++ stable/11/etc/ntp/leap-seconds Fri May 22 03:11:33 2020 (r361354) @@ -204,10 +204,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C58 -# File expires on: 28 June 2020 +# Updated through IERS Bulletin C59 +# File expires on: 28 December 2020 # -#@ 3802291200 +#@ 3818102400 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -252,4 +252,4 @@ # the hash line is also ignored in the # computation. # -#h f28827d2 f263b6c3 ec0f19eb a3e0dbf0 97f3fa30 +#h a1c168ae 27c79a7d 9dddcfc3 bcfe616b 2e2c44ea From owner-svn-src-all@freebsd.org Fri May 22 03:13: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 99ED02FC8B9; Fri, 22 May 2020 03:13:29 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Ss553VV3z3S5g; Fri, 22 May 2020 03:13:29 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7337D18214; Fri, 22 May 2020 03:13:29 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04M3DTdt007545; Fri, 22 May 2020 03:13:29 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04M3DTuZ007544; Fri, 22 May 2020 03:13:29 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <202005220313.04M3DTuZ007544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Fri, 22 May 2020 03:13:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361355 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 361355 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, 22 May 2020 03:13:29 -0000 Author: rgrimes Date: Fri May 22 03:13:29 2020 New Revision: 361355 URL: https://svnweb.freebsd.org/changeset/base/361355 Log: Include all currently present kernel options for IPFW Also fix igor complaint about manpage/s/man page Reported by: rgrimes@freebsd.org PR: 219075 Submitted by: Dries Michiels driesm.michiels_gmail.com Reported by: rgrimes Reviewed by: bcr (manpages), 0mp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D24541 Modified: head/share/man/man4/ipfirewall.4 Modified: head/share/man/man4/ipfirewall.4 ============================================================================== --- head/share/man/man4/ipfirewall.4 Fri May 22 03:11:33 2020 (r361354) +++ head/share/man/man4/ipfirewall.4 Fri May 22 03:13:29 2020 (r361355) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 25, 2012 +.Dd May 21, 2020 .Dt IPFW 4 .Os .Sh NAME @@ -20,8 +20,14 @@ Other related kernel options which may also be useful are: .Bd -ragged -offset indent .Cd "options IPFIREWALL_DEFAULT_TO_ACCEPT" +.Cd "options IPDIVERT" +.Cd "options IPFIREWALL_NAT" +.Cd "options IPFIREWALL_NAT64" +.Cd "options IPFIREWALL_NPTV6" +.Cd "options IPFIREWALL_PMOD" .Cd "options IPFIREWALL_VERBOSE" .Cd "options IPFIREWALL_VERBOSE_LIMIT=100" +.Cd "options LIBALIAS" .Ed .Pp To load @@ -57,6 +63,54 @@ If the default behavior is to allow everything, it is easier to cope with firewall-tuning mistakes which may accidentally block all traffic. .Pp +When using +.Xr natd 8 +in conjunction with +.Nm +as +.Tn NAT +facility, the kernel option +.Dv IPDIVERT +enables diverting packets to +.Xr natd 8 +for translation. +.Pp +When using the in-kernel +.Tn NAT +facility of +.Nm , +the kernel option +.Dv IPFIREWALL_NAT +enables basic +.Xr libalias 3 +functionality in the kernel. +.Pp +When using any of the +.Tn IPv4 +to +.Tn IPv6 +transition mechanisms in +.Nm , +the kernel option +.Dv IPFIREWALL_NAT64 +enables all of these +.Tn NAT64 +methods in the kernel. +.Pp +When using the +.Tn IPv6 +network prefix translation facility of +.Nm , +the kernel option +.Dv IPFIREWALL_NPTV6 +enables this functionality in the kernel. +.Pp +When using the packet modification facility of +.Nm , +the kernel option +.Dv IPFIREWALL_PMOD +enables this functionality in the kernel. +.Pp To enable logging of packets passing through .Nm , enable the @@ -70,20 +124,39 @@ from flooding system logs or causing local Denial of S This option may be set to the number of packets which will be logged on a per-entry basis before the entry is rate-limited. .Pp +When using the in-kernel +.Tn NAT +facility of +.Nm , +the kernel option +.Dv LIBALIAS +enables full +.Xr libalias 3 +functionality in the kernel. +Full functionality refers to included support for cuseeme, ftp, bbt, +skinny, irc, pptp and smedia packets, which are missing in the basic +.Xr libalias 3 +functionality accomplished with the +.Dv IPFIREWALL_NAT +kernel option. +.Pp The user interface for .Nm is implemented by the .Xr ipfw 8 utility, so please refer to the .Xr ipfw 8 -manpage for a complete description of the +man page for a complete description of the .Nm capabilities and how to use it. .Sh SEE ALSO .Xr setsockopt 2 , .Xr divert 4 , .Xr ip 4 , +.Xr ip6 4 , .Xr ipfw 8 , +.Xr libalias 3 , +.Xr natd 8 , .Xr sysctl 8 , .Xr syslogd 8 , .Xr pfil 9 From owner-svn-src-all@freebsd.org Fri May 22 08:59: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 93DCD32AC9B; Fri, 22 May 2020 08:59:13 +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 49T0m13LpGz421k; Fri, 22 May 2020 08:59:13 +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 69F3A1BCEC; Fri, 22 May 2020 08:59:13 +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 04M8xD6s016310; Fri, 22 May 2020 08:59:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04M8xDjP016309; Fri, 22 May 2020 08:59:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005220859.04M8xDjP016309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 22 May 2020 08:59: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: r361356 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 361356 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, 22 May 2020 08:59:13 -0000 Author: hselasky Date: Fri May 22 08:59:12 2020 New Revision: 361356 URL: https://svnweb.freebsd.org/changeset/base/361356 Log: MFC r361075: Assign process group of the TTY under the "proctree_lock". This fixes a race where concurrent calls to doenterpgrp() and leavepgrp() while TIOCSCTTY is executing may result in tp->t_pgrp changing value so that tty_rel_pgrp() misses clearing it to NULL. For more details refer to the use of pgdelete() in the kernel. No functional change intended. Panic backtrace: __mtx_lock_sleep() # page fault due to using destroyed mutex tty_signal_pgrp() tty_ioctl() ptsdev_ioctl() kern_ioctl() sys_ioctl() amd64_syscall() Sponsored by: Mellanox Technologies Modified: stable/12/sys/kern/tty.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/tty.c ============================================================================== --- stable/12/sys/kern/tty.c Fri May 22 03:13:29 2020 (r361355) +++ stable/12/sys/kern/tty.c Fri May 22 08:59:12 2020 (r361356) @@ -1808,7 +1808,6 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *da tp->t_session = p->p_session; tp->t_session->s_ttyp = tp; tp->t_sessioncnt++; - sx_xunlock(&proctree_lock); /* Assign foreground process group. */ tp->t_pgrp = p->p_pgrp; @@ -1816,6 +1815,7 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *da p->p_flag |= P_CONTROLT; PROC_UNLOCK(p); + sx_xunlock(&proctree_lock); return (0); } case TIOCSPGRP: { From owner-svn-src-all@freebsd.org Fri May 22 09:00: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 B294032AC3C; Fri, 22 May 2020 09:00:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T0nL4Gb8z42BB; Fri, 22 May 2020 09:00:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DCA81C294; Fri, 22 May 2020 09:00:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04M90MZp016492; Fri, 22 May 2020 09:00:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04M90Me5016491; Fri, 22 May 2020 09:00:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005220900.04M90Me5016491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 22 May 2020 09:00: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: r361357 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 361357 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, 22 May 2020 09:00:22 -0000 Author: hselasky Date: Fri May 22 09:00:22 2020 New Revision: 361357 URL: https://svnweb.freebsd.org/changeset/base/361357 Log: MFC r361075: Assign process group of the TTY under the "proctree_lock". This fixes a race where concurrent calls to doenterpgrp() and leavepgrp() while TIOCSCTTY is executing may result in tp->t_pgrp changing value so that tty_rel_pgrp() misses clearing it to NULL. For more details refer to the use of pgdelete() in the kernel. No functional change intended. Panic backtrace: __mtx_lock_sleep() # page fault due to using destroyed mutex tty_signal_pgrp() tty_ioctl() ptsdev_ioctl() kern_ioctl() sys_ioctl() amd64_syscall() Sponsored by: Mellanox Technologies Modified: stable/11/sys/kern/tty.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/tty.c ============================================================================== --- stable/11/sys/kern/tty.c Fri May 22 08:59:12 2020 (r361356) +++ stable/11/sys/kern/tty.c Fri May 22 09:00:22 2020 (r361357) @@ -1807,7 +1807,6 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *da tp->t_session = p->p_session; tp->t_session->s_ttyp = tp; tp->t_sessioncnt++; - sx_xunlock(&proctree_lock); /* Assign foreground process group. */ tp->t_pgrp = p->p_pgrp; @@ -1815,6 +1814,7 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *da p->p_flag |= P_CONTROLT; PROC_UNLOCK(p); + sx_xunlock(&proctree_lock); return (0); } case TIOCSPGRP: { From owner-svn-src-all@freebsd.org Fri May 22 09:01: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 9BBF532AE41; Fri, 22 May 2020 09:01:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T0pZ3f2nz42TV; Fri, 22 May 2020 09:01:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 783D01BCF4; Fri, 22 May 2020 09:01:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04M91QCY019962; Fri, 22 May 2020 09:01:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04M91QNg019961; Fri, 22 May 2020 09:01:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005220901.04M91QNg019961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 22 May 2020 09:01:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r361358 - stable/10/sys/kern X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/kern X-SVN-Commit-Revision: 361358 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, 22 May 2020 09:01:26 -0000 Author: hselasky Date: Fri May 22 09:01:26 2020 New Revision: 361358 URL: https://svnweb.freebsd.org/changeset/base/361358 Log: MFC r361075: Assign process group of the TTY under the "proctree_lock". This fixes a race where concurrent calls to doenterpgrp() and leavepgrp() while TIOCSCTTY is executing may result in tp->t_pgrp changing value so that tty_rel_pgrp() misses clearing it to NULL. For more details refer to the use of pgdelete() in the kernel. No functional change intended. Panic backtrace: __mtx_lock_sleep() # page fault due to using destroyed mutex tty_signal_pgrp() tty_ioctl() ptsdev_ioctl() kern_ioctl() sys_ioctl() amd64_syscall() Sponsored by: Mellanox Technologies Modified: stable/10/sys/kern/tty.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/tty.c ============================================================================== --- stable/10/sys/kern/tty.c Fri May 22 09:00:22 2020 (r361357) +++ stable/10/sys/kern/tty.c Fri May 22 09:01:26 2020 (r361358) @@ -1721,7 +1721,6 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *da tp->t_session = p->p_session; tp->t_session->s_ttyp = tp; tp->t_sessioncnt++; - sx_xunlock(&proctree_lock); /* Assign foreground process group. */ tp->t_pgrp = p->p_pgrp; @@ -1729,6 +1728,7 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *da p->p_flag |= P_CONTROLT; PROC_UNLOCK(p); + sx_xunlock(&proctree_lock); return (0); } case TIOCSPGRP: { From owner-svn-src-all@freebsd.org Fri May 22 09:02: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 C932C32B0B4; Fri, 22 May 2020 09:02:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T0r050Kqz42q0; Fri, 22 May 2020 09:02:40 +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 A139C1C484; Fri, 22 May 2020 09:02:40 +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 04M92eZl022296; Fri, 22 May 2020 09:02:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04M92ecr022295; Fri, 22 May 2020 09:02:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005220902.04M92ecr022295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 22 May 2020 09:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r361359 - stable/9/sys/kern X-SVN-Group: stable-9 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/9/sys/kern X-SVN-Commit-Revision: 361359 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, 22 May 2020 09:02:40 -0000 Author: hselasky Date: Fri May 22 09:02:40 2020 New Revision: 361359 URL: https://svnweb.freebsd.org/changeset/base/361359 Log: MFC r361075: Assign process group of the TTY under the "proctree_lock". This fixes a race where concurrent calls to doenterpgrp() and leavepgrp() while TIOCSCTTY is executing may result in tp->t_pgrp changing value so that tty_rel_pgrp() misses clearing it to NULL. For more details refer to the use of pgdelete() in the kernel. No functional change intended. Panic backtrace: __mtx_lock_sleep() # page fault due to using destroyed mutex tty_signal_pgrp() tty_ioctl() ptsdev_ioctl() kern_ioctl() sys_ioctl() amd64_syscall() Sponsored by: Mellanox Technologies Modified: stable/9/sys/kern/tty.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/tty.c ============================================================================== --- stable/9/sys/kern/tty.c Fri May 22 09:01:26 2020 (r361358) +++ stable/9/sys/kern/tty.c Fri May 22 09:02:40 2020 (r361359) @@ -1611,7 +1611,6 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *da tp->t_session = p->p_session; tp->t_session->s_ttyp = tp; tp->t_sessioncnt++; - sx_xunlock(&proctree_lock); /* Assign foreground process group. */ tp->t_pgrp = p->p_pgrp; @@ -1619,6 +1618,7 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *da p->p_flag |= P_CONTROLT; PROC_UNLOCK(p); + sx_xunlock(&proctree_lock); return (0); } case TIOCSPGRP: { From owner-svn-src-all@freebsd.org Fri May 22 09:17: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 B9AE732B6A0; Fri, 22 May 2020 09:17:07 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T18g4Yjgz43L7; Fri, 22 May 2020 09:17:07 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 97C151C68D; Fri, 22 May 2020 09:17:07 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04M9H7mx028709; Fri, 22 May 2020 09:17:07 GMT (envelope-from whu@FreeBSD.org) Received: (from whu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04M9H7oE028708; Fri, 22 May 2020 09:17:07 GMT (envelope-from whu@FreeBSD.org) Message-Id: <202005220917.04M9H7oE028708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: whu set sender to whu@FreeBSD.org using -f From: Wei Hu Date: Fri, 22 May 2020 09:17:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361360 - head/sys/dev/hyperv/hvsock X-SVN-Group: head X-SVN-Commit-Author: whu X-SVN-Commit-Paths: head/sys/dev/hyperv/hvsock X-SVN-Commit-Revision: 361360 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, 22 May 2020 09:17:07 -0000 Author: whu Date: Fri May 22 09:17:07 2020 New Revision: 361360 URL: https://svnweb.freebsd.org/changeset/base/361360 Log: Socket AF_HYPERV should return failure when it is not running on HyperV Reported by: pho Sponsored by: Microsoft Modified: head/sys/dev/hyperv/hvsock/hv_sock.c Modified: head/sys/dev/hyperv/hvsock/hv_sock.c ============================================================================== --- head/sys/dev/hyperv/hvsock/hv_sock.c Fri May 22 09:02:40 2020 (r361359) +++ head/sys/dev/hyperv/hvsock/hv_sock.c Fri May 22 09:17:07 2020 (r361360) @@ -354,6 +354,9 @@ hvs_trans_attach(struct socket *so, int proto, struct { struct hvs_pcb *pcb = so2hvspcb(so); + if (vm_guest != VM_GUEST_HV) + return (ESOCKTNOSUPPORT); + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_attach called\n", __func__); @@ -380,6 +383,9 @@ hvs_trans_detach(struct socket *so) { struct hvs_pcb *pcb; + if (vm_guest != VM_GUEST_HV) + return; + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_detach called\n", __func__); @@ -589,6 +595,9 @@ hvs_trans_disconnect(struct socket *so) { struct hvs_pcb *pcb; + if (vm_guest != VM_GUEST_HV) + return (ESOCKTNOSUPPORT); + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_disconnect called\n", __func__); @@ -916,6 +925,9 @@ hvs_trans_close(struct socket *so) { struct hvs_pcb *pcb; + if (vm_guest != VM_GUEST_HV) + return; + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_close called\n", __func__); @@ -956,6 +968,9 @@ void hvs_trans_abort(struct socket *so) { struct hvs_pcb *pcb = so2hvspcb(so); + + if (vm_guest != VM_GUEST_HV) + return; HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_abort called\n", __func__); From owner-svn-src-all@freebsd.org Fri May 22 09: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 CBB5232BA42; Fri, 22 May 2020 09:38:44 +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 49T1dc5L1yz44QJ; Fri, 22 May 2020 09:38:44 +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 B20481C54F; Fri, 22 May 2020 09:38:44 +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 04M9ciCq040981; Fri, 22 May 2020 09:38:44 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04M9ciK7040980; Fri, 22 May 2020 09:38:44 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202005220938.04M9ciK7040980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 22 May 2020 09:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361361 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 361361 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, 22 May 2020 09:38:44 -0000 Author: bapt Date: Fri May 22 09:38:44 2020 New Revision: 361361 URL: https://svnweb.freebsd.org/changeset/base/361361 Log: Update pciids to 2020.05.22 MFC after: 2 days Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Fri May 22 09:17:07 2020 (r361360) +++ head/share/misc/pci_vendors Fri May 22 09:38:44 2020 (r361361) @@ -2,8 +2,8 @@ # List of PCI ID's # -# Version: 2020.02.22 -# Date: 2020-02-22 03:15:04 +# Version: 2020.05.22 +# Date: 2020-05-22 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at https://pci-ids.ucw.cz/. @@ -438,8 +438,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 +456,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 +656,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 @@ -929,11 +933,13 @@ 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 +1126,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 +1197,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 +1211,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 +1221,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 +1234,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 @@ -1878,9 +1889,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 @@ -1903,6 +1914,7 @@ 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 +2573,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 @@ -2844,7 +2858,7 @@ 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] @@ -3349,7 +3363,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 @@ -3917,6 +3932,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 @@ -4694,13 +4710,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 +4989,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 @@ -10974,6 +10997,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] @@ -11772,6 +11796,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 +11812,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 +11895,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 +11928,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] @@ -11926,6 +11954,7 @@ 1e30 TU102GL [Quadro RTX 6000/8000] 10de 129e Quadro RTX 8000 10de 12ba Quadro RTX 6000 + 1e36 TU102GL 1e37 TU102GL [GRID RTX T10-4/T10-8/T10-16] 10de 1347 GRID RTX T10-8 10de 1348 GRID RTX T10-4 @@ -11943,6 +11972,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,25 +11986,35 @@ 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] 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] 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] 1f81 TU117 1f82 TU117 [GeForce GTX 1650] 1f91 TU117M [GeForce GTX 1650 Mobile / Max-Q] 1f92 TU117M [GeForce GTX 1650 Mobile] + 1f94 TU117M + 1f95 TU117M [GeForce GTX 1650 Ti Mobile] 1f96 TU117M [GeForce GTX 1650 Mobile / Max-Q] + 1f99 TU117M 1fae TU117GL 1fb8 TU117GLM [Quadro T2000 Mobile / Max-Q] 1fb9 TU117GLM [Quadro T1000 Mobile] @@ -11983,6 +12024,7 @@ 2184 TU116 [GeForce GTX 1660] 2187 TU116 [GeForce GTX 1650 SUPER] 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 +12243,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 +12339,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 +12370,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 +12425,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 @@ -12485,6 +12536,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 +12580,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 @@ -16224,6 +16282,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 @@ -18118,6 +18180,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. @@ -19817,6 +19903,12 @@ 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 @@ -19830,8 +19922,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 @@ -19922,9 +20012,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 +20069,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 @@ -20541,6 +20642,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 +20653,7 @@ 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 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 +20881,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. @@ -21126,11 +21240,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 @@ -21860,6 +21998,7 @@ 1987 Phison Electronics Corporation 5007 E7 NVMe Controller 5012 E12 NVMe Controller + 5013 PS5013 E13 NVMe Controller 5016 E16 PCIe4 NVMe Controller 1989 Montilio Inc. 0001 RapidFile Bridge @@ -21944,16 +22083,22 @@ 19e5 3036 NVMe SSD ES3600C V3 3200GB HHHL AIC 0200 Hi1822 Family (2*100GE) 19e5 d139 Hi1822 SP572 (2*100GE) + 19e5 d13d Hi1822 SC371 (2*100GE) + 19e5 d147 Hi1822 SP573 (2*100GE) 0202 Hi1822 Family (2*32G FC) + 19e5 d149 Hi1822 SP528 (2*32G FC) 19e5 d302 Hi1822 SP521 (2*32G FC) 19e5 d304 Hi1822 SP526 (2*32G FC) 0203 Hi1822 Family (2*16G FC) + 19e5 d148 Hi1822 SP527 (2*16G FC) 19e5 d301 Hi1822 SP520 (2*16G FC) 19e5 d305 Hi1822 SP525 (2*16G FC) 0205 Hi1822 Family (2*100GE) 19e5 df27 Hi1822 MZ731 MEZZ (2*100GE) 0206 Hi1822 Family (2*25GE) 19e5 d138 Hi1822 SP582 (2*25GE) + 19e5 d13a Hi1822 SC381 (2*25GE) + 19e5 d145 Hi1822 SP586 (2*25GE) 0210 Hi1822 Family (4*25GE) 19e5 df2e Hi1822 MZ532 MEZZ (4*25GE) 0211 Hi1822 Family (4*25GE) @@ -21969,6 +22114,7 @@ 19e5 d129 Hi1822 SP570 (4*25GE) 19e5 d136 Hi1822 SP580 (4*25GE) 19e5 d141 Hi1822 SP583 (4*25GE) + 19e5 d146 Hi1822 SP585 (4*25GE) 371e Hi1822 Family Virtual Bridge 375e Hi1822 Family Virtual Function 379e Hi1822 Family Virtual Function @@ -21982,6 +22128,10 @@ a12a HiSilicon Add-on PCI-PCI Bridge a220 HNS GE Network Controller a221 HNS GE/10GE/25GE Network Controller + 19e5 0454 TM280 + 19e5 04cc TM210 + 19e5 d14a TM280 4*25G + 19e5 d14b TM210 4*GE a222 HNS GE/10GE/25GE RDMA Network Controller a224 HNS GE/10GE/25GE/50GE RDMA Network Controller a226 HNS GE/10GE/25GE/50GE/100GE RDMA Network Controller @@ -22337,6 +22487,7 @@ 0007 DELTA-3G-elp-d 1b6f Etron Technology, Inc. 7023 EJ168 USB 3.0 Host Controller + 1458 5007 GA-880GMA-USB3 7052 EJ188/EJ198 USB 3.0 Host Controller 1849 7052 QC5000-ITX/PH 1b73 Fresco Logic @@ -22442,6 +22593,7 @@ 1102 OmniBusBox II Multi-Protocol Interface Core 1103 OmniBus II cPCIe/PXIe Multi-Protocol Interface Card 1bd4 Inspur Electronic Information Industry Co., Ltd. + 0911 Arria10_PCIe_F10A1150 1bee IXXAT Automation GmbH 0003 CAN-IB200/PCIe 1bef Lantiq @@ -22466,6 +22618,12 @@ 1c1c Symphony 0001 82C101 1c1f SoftLab-NSK + 0015 FD842 + 0019 FD722 + 001a FD788 + 001b FD720 + 001c FD922 + 001d Vega 1c28 Lite-On IT Corp. / Plextor 0122 M6e PCI Express SSD [Marvell 88SS9183] # previously Fiberblaze @@ -22495,8 +22653,12 @@ a00a FBC2CGG3 Capture 8x10Gb [Mango] a00e FB2CG Capture 2x100Gb [Savona] a00f FB2CG Capture 2x40Gb [Savona] + a010 FB2CGHH Capture 2x40Gb [Tivoli] a011 FB2CG Capture 2x25Gb [Savona] a012 FB2CG Capture 8x10Gb [Savona] + a013 FB2CGHH Capture 2x25Gb [Tivoli] + a014 FB2CGHH Capture 8x10Gb [Tivoli] + a015 FB2CGHH Capture 2x100Gb [Tivoli] # Used on V120 VME Crate Controller 1c32 Highland Technology, Inc. 1c33 Daktronics, Inc @@ -22521,6 +22683,7 @@ 1283 PC300 NVMe Solid State Drive 256GB 1284 PC300 NVMe Solid State Drive 512GB 1285 PC300 NVMe Solid State Drive 1TB + 1327 BC501 NVMe Solid State Drive 512GB 1504 SC300 512GB M.2 2280 SATA Solid State Drive 1c5f Beijing Memblaze Technology Co. Ltd. 000d PBlaze5 520/526 AIC @@ -22577,6 +22740,10 @@ 0010 Pro Capture Endpoint 0014 PRO CAPTURE AIO 4K PLUS 0017 PRO CAPTURE AIO 4K + 0051 Eco Capture Dual HDMI M.2 + 0052 Eco Capture HDMI 4K M.2 + 0053 Eco Capture Dual SDI M.2 + 0054 Eco Capture Quad SDI M.2 1cdd secunet Security Networks AG 1ce4 Exablaze 0001 ExaNIC X4 @@ -22691,6 +22858,7 @@ 04de Taurus/McKinley 1d6a Aquantia Corp. 0001 AQC107 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] + 00b1 AQC100 10G Ethernet MAC controller [AQtion] 07b1 AQC107 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] 08b1 AQC108 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] 11b1 AQC111 NBase-T/IEEE 802.3bz Ethernet Controller [AQtion] @@ -22787,26 +22955,32 @@ 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 4008 DSC-25 10/25G 2-port SFP28 x8 4GB RAM 8GB eMMC 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 4008 DSC-25 10/25G 2-port SFP28 x8 4GB RAM 8GB eMMC 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 4008 DSC-25 10/25G 2-port SFP28 x8 4GB RAM 8GB eMMC 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 4008 DSC-25 10/25G 2-port SFP28 x8 4GB RAM 8GB eMMC 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 4008 DSC-25 10/25G 2-port SFP28 x8 4GB RAM 8GB eMMC 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 4008 DSC-25 10/25G 2-port SFP28 x8 4GB RAM 8GB eMMC 1de0 Groq 0000 Q100 Tensor Streaming Processor 1de1 Tekram Technology Co.,Ltd. @@ -22849,6 +23023,8 @@ 0003 alst4x 1dfc JSC NT-COM 1181 TDM 8 Port E1/T1/J1 Adapter +1e0f KIOXIA Corporation + 0007 NVMe SSD Controller Cx6 1e17 Arnold & Richter Cine Technik GmbH & Co. Betriebs KG 1e24 Squirrels Research Labs 0101 Acorn CLE-101 @@ -22862,6 +23038,8 @@ # JungleCat VU35P Module 1635 JCM35 1e26 Fujitsu Client Computing Limited +1e36 Shanghai Enflame Technology Co. Ltd + 0001 T10 [CloudBlazer] # nee Thinci, Inc 1e38 Blaize, Inc 1e3d Burlywood, Inc @@ -22874,11 +23052,13 @@ 0100 The device has already been deleted. 0000 0100 PY8800 64GB Accelerator 1e6b Axiado Corp. +1e85 Heitec AG 1e89 ID Quantique SA 0002 Quantis-PCIe-40M 0003 Quantis-PCIe-240M # aka SED Systems 1e94 Calian SED +1e95 Solid State Storage Technology Corporation # nee Tumsan Oy 1fc0 Ascom (Finland) Oy 0300 E2200 Dual E1/Rawpipe Card @@ -23793,6 +23973,7 @@ 02d3 Comet Lake SATA AHCI Controller 02e0 Comet Lake Management Engine Interface 02e8 Serial IO I2C Host Controller + 02e9 Comet Lake Serial IO I2C Host Controller 02f0 Wireless-AC 9462 02f9 Comet Lake Thermal Subsytem 02fc Comet Lake Integrated Sensor Solution @@ -23875,6 +24056,27 @@ 8086 01f7 SCRU32 # uninitialized SRCU32 RAID Controller 061f 80303 I/O Processor + 068d Comet Lake LPC Controller + 06a3 Comet Lake PCH SMBus Controller + 06a4 Comet Lake PCH SPI Controller + 06a8 Comet Lake PCH Serial IO UART Host Controller #0 + 06a9 Comet Lake PCH Serial IO UART Host Controller #1 + 06aa Comet Lake PCH Serial IO SPI Controller #0 + 06ab Comet Lake PCH Serial IO SPI Controller #1 + 06ac Comet Lake PCI Express Root Port #21 + 06b0 Comet Lake PCI Express Root Port #9 + 06c0 Comet Lake PCI Express Root Port #17 + 06c8 Comet Lake PCH cAVS + 06e0 Comet Lake HECI Controller + 06e8 Comet Lake PCH Serial IO I2C Controller #0 + 06e9 Comet Lake PCH Serial IO I2C Controller #1 + 06ea Comet Lake PCH Serial IO I2C Controller #2 + 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 + 06f9 Comet Lake PCH Thermal Controller + 06fb Comet Lake PCH Serial IO SPI Controller #2 0700 CE Media Processor A/V Bridge 0701 CE Media Processor NAND Flash Controller 0703 CE Media Processor Media Control Unit 1 @@ -24345,6 +24547,13 @@ 1028 1fe7 Express Flash NVMe 3.2TB 2.5" U.2 (P4600) 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 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) 0be0 Atom Processor D2xxx/N2xxx Integrated Graphics Controller 0be1 Atom Processor D2xxx/N2xxx Integrated Graphics Controller 105b 0d7c D270S/D250S Motherboard @@ -24440,6 +24649,7 @@ 0d58 Ethernet Controller XXV710 Intel(R) FPGA Programmable Acceleration Card N3000 for Networking 8086 0000 Ethernet Controller XXV710 Intel(R) FPGA Programmable Acceleration Card N3000 for Networking 8086 0001 Ethernet Controller XXV710 Intel(R) FPGA Programmable Acceleration Card N3000 for Networking + 0d9f Ethernet Controller (2) I225-IT 0e00 Xeon E7 v2/Xeon E5 v2/Core i7 DMI2 1028 04f7 Xeon E5 v2 on PowerEdge R320 server 15d9 066b X9SRL-F @@ -24756,6 +24966,7 @@ 1014 0549 Thinkpad 1179 0001 PRO/1000 MT Mobile Connection 8086 101e PRO/1000 MT Mobile Connection + 101f Ethernet Controller V710 for 5GBASE-T 1026 82545GM Gigabit Ethernet Controller 1028 0168 Precision Workstation 670 Mainboard 1028 0169 Precision 470 @@ -25499,6 +25710,7 @@ 108e 7b15 Sun Dual Port 10 GbE PCIe 2.0 Low Profile Adapter, Base-T 1137 00bf Ethernet Converged Network Adapter X540-T2 1170 0052 Ethernet Controller 10-Gigabit X540-AT2 + 15d9 0734 AOC-STG-I2T 17aa 1073 ThinkServer X540-T2 AnyFabric 17aa 4006 Ethernet Controller 10-Gigabit X540-AT2 1bd4 001a 10G base-T DP ER102Ti3 Rack Adapter @@ -25743,21 +25955,35 @@ 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 + 1137 02bf E810CQDA2 2x100 GbE QSFP28 PCIe NIC 8086 0002 Ethernet Network Adapter E810-C-Q2 8086 0004 Ethernet Network Adapter E810-C-Q2 8086 0005 Ethernet Network Adapter E810-C-Q1 for OCP3.0 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 1593 Ethernet Controller E810-C for SFP + 1137 02c3 E810XXVDA4 4x25/10 GbE SFP28 PCIe NIC 8086 0002 Ethernet Network Adapter E810-L-2 8086 0005 Ethernet Network Adapter E810-XXV-4 8086 0006 Ethernet Network Adapter E810-XXV-4 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 + 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 + 8086 0001 Ethernet 25G 2P E810-XXV OCP + 8086 0002 Ethernet 25G 2P E810-XXV Adapter + 8086 0003 Ethernet Network Adapter E810-XXV-2 + 8086 0005 Ethernet Network Adapter E810-XXV-2 for OCP 3.0 + 8086 4001 Ethernet Network Adapter E810-XXV-2 + 8086 4002 Ethernet Network Adapter E810-XXV-2 for OCP 3.0 15a0 Ethernet Connection (2) I218-LM 15a1 Ethernet Connection (2) I218-V 15a2 Ethernet Connection (3) I218-LM @@ -25834,6 +26060,8 @@ 15ec JHL7540 Thunderbolt 3 USB Controller [Titan Ridge 4C 2018] 15ef JHL7540 Thunderbolt 3 Bridge [Titan Ridge DD 2018] 15f0 JHL7540 Thunderbolt 3 USB Controller [Titan Ridge DD 2018] + 15f2 Intel(R) Ethernet Controller I225-LM + 15f3 Intel(R) Ethernet Controller I225-V 15f4 Ethernet Connection (15) I219-LM 15f5 Ethernet Connection (15) I219-V 15f6 I210 Gigabit Ethernet Connection @@ -25904,6 +26132,7 @@ 1901 Xeon E3-1200 v5/E3-1500 v5/6th 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 1028 06dc Latitude E7470 1028 06e4 XPS 15 9550 103c 825b OMEN-17-w001nv @@ -25919,11 +26148,13 @@ 1908 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers 1909 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x4) 190c Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers + 1028 06d6 Latitude 7275 tablet 190f Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers 1910 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers 1028 06e4 XPS 15 9550 103c 825b OMEN-17-w001nv 1911 Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th/8th Gen Core Processor Gaussian Mixture Model + 1028 0869 Vostro 3470 17aa 2247 ThinkPad T570 17aa 224f ThinkPad X1 Carbon 5th Gen 17aa 225d ThinkPad T480 @@ -25934,11 +26165,13 @@ 103c 8079 EliteBook 840 G3 1918 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers 1919 Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Imaging Unit + 1028 06d6 Latitude 7275 tablet 191b HD Graphics 530 1028 06e4 XPS 15 9550 103c 825b OMEN-17-w001nv 191d HD Graphics P530 191e HD Graphics 515 + 1028 06d6 Latitude 7275 tablet 191f Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers 1921 HD Graphics 520 1926 Iris Graphics 540 @@ -29252,6 +29485,7 @@ # Stone Peak 1x1 8086 4210 Dual Band Wireless AC 3165 3166 Dual Band Wireless-AC 3165 Plus Bluetooth + 8086 4210 Dual Band Wireless-AC 3165 3184 UHD Graphics 605 3185 UHD Graphics 605 318c Celeron/Pentium Silver Processor Dynamic Platform and Thermal Framework Processor Participant @@ -29986,6 +30220,7 @@ 3e89 8th Gen Core Processor PCIe Controller (x4) 3e91 8th Gen Core Processor Gaussian Mixture Model 3e92 UHD Graphics 630 (Desktop) + 1028 0869 Vostro 3470 3e93 UHD Graphics 610 3e96 HD Graphics P630 3e98 UHD Graphics 630 (Desktop 9 Series) @@ -29994,6 +30229,7 @@ 1028 089e Inspiron 5482 3ea5 Iris Plus Graphics 655 3ec2 8th Gen Core Processor Host Bridge/DRAM Registers + 1028 0869 Vostro 3470 1043 8694 PRIME H310M-D 3ec4 8th Gen Core Processor Host Bridge/DRAM Registers 3ec6 8th Gen Core Processor Host Bridge/DRAM Registers @@ -30175,12 +30411,14 @@ 5201 EtherExpress PRO/100 Intelligent Server Fast Ethernet Controller 8086 0001 EtherExpress PRO/100 Server Ethernet Adapter 530d 80310 (IOP) IO Processor + 5502 Ethernet Controller (2) I225-LMvP 5845 QEMU NVM Express Controller 1af4 1100 QEMU Virtual Machine 5900 Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers 5901 Xeon E3-1200 v6/7th Gen Core Processor PCIe Controller (x16) 5902 HD Graphics 610 5904 Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers + 1025 115f Aspire E5-575G 17aa 2247 ThinkPad T570 17aa 224f ThinkPad X1 Carbon 5th Gen 5905 Xeon E3-1200 v6/7th Gen Core Processor PCIe Controller (x8) @@ -30194,6 +30432,7 @@ 5914 Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers 17aa 225d ThinkPad T480 5916 HD Graphics 620 + 1025 1094 Aspire E5-575G 17aa 2248 ThinkPad T570 17aa 224f ThinkPad X1 Carbon 5th Gen 5917 UHD Graphics 620 @@ -30604,7 +30843,11 @@ 8a1f Ice Lake Thunderbolt 3 PCI Express Root Port #1 8a21 Ice Lake Thunderbolt 3 PCI Express Root Port #2 8a23 Ice Lake Thunderbolt 3 PCI Express Root Port #3 + 8a51 Intel Iris Plus Graphics G7 (Ice Lake) 8a52 Iris Plus Graphics G7 + 8a56 Iris Plus Graphics G1 (Ice Lake) + 8a5a Iris Plus Graphics G4 (Ice Lake) + 8a5c Intel Iris Plus Graphics G4 (Ice Lake) 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] @@ -30621,6 +30864,7 @@ 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 + 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 @@ -30822,8 +31066,23 @@ 9622 Integrated RAID 9641 Integrated RAID 96a1 Integrated RAID + 9a09 11th Gen Core Processor PCIe Controller 9a0b Volume Management Device NVMe RAID Controller + 9a13 Tiger Lake-LP Thunderbolt USB Controller + 9a14 11th Gen Core Processor Host Bridge/DRAM Registers + 9a1b Tiger Lake-LP Thunderbolt NHI #0 + 9a1d Tiger Lake-LP Thunderbolt NHI #1 + 9a23 Tiger Lake-LP Thunderbolt PCI Express Root Port #0 + 9a25 Tiger Lake-LP Thunderbolt PCI Express Root Port #1 + 9a27 Tiger Lake-LP Thunderbolt PCI Express Root Port #2 + 9a29 Tiger Lake-LP Thunderbolt PCI Express Root Port #3 + 9a33 Tiger Lake Trace Hub + 9a49 UHD Graphics 9b41 UHD Graphics + 9b44 10th Gen Core Processor Host Bridge/DRAM Registers + 9b54 10th Gen Core Processor Host Bridge/DRAM Registers + 9b64 10th Gen Core Processor Host Bridge/DRAM Registers + 9bc4 UHD Graphics 9c00 8 Series SATA Controller 1 [IDE mode] 9c01 8 Series SATA Controller 1 [IDE mode] 9c02 8 Series SATA Controller 1 [AHCI mode] @@ -30930,6 +31189,7 @@ 9ce5 Wildcat Point-LP Serial IO GSPI Controller #0 9ce6 Wildcat Point-LP Serial IO GSPI Controller #1 9d03 Sunrise Point-LP SATA Controller [AHCI mode] + 1025 115f Acer Aspire E5-575G 1028 06dc Latitude E7470 1028 06f3 Latitude 3570 103c 8079 EliteBook 840 G3 @@ -30950,6 +31210,8 @@ 9d19 Sunrise Point-LP PCI Express Root Port #10 9d1a Sunrise Point-LP PCI Express Root Port #11 9d21 Sunrise Point-LP PMC + 1025 115f Acer Aspire E5-575G + 1028 06d6 Latitude 7275 tablet 1028 06dc Latitude E7470 1028 06f3 Latitude 3570 103c 8079 EliteBook 840 G3 @@ -30957,6 +31219,8 @@ 17aa 225d ThinkPad T480 17aa 382a B51-80 Laptop 9d23 Sunrise Point-LP SMBus + 1025 115f Acer Aspire E5-575G + 1028 06d6 Latitude 7275 tablet 1028 06dc Latitude E7470 1028 06f3 Latitude 3570 103c 8079 EliteBook 840 G3 @@ -30970,6 +31234,8 @@ 9d2a Sunrise Point-LP Serial IO SPI Controller #1 9d2d Sunrise Point-LP Secure Digital IO Controller 9d2f Sunrise Point-LP USB 3.0 xHCI Controller + 1025 115f Acer Aspire E5-575G + 1028 06d6 Latitude 7275 tablet 1028 06dc Latitude E7470 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri May 22 10:50: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 8B3BB32CDF0; Fri, 22 May 2020 10:50:30 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T3DQ2rsGz47gB; Fri, 22 May 2020 10:50:30 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 576E71CF79; Fri, 22 May 2020 10:50:30 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MAoUu6084247; Fri, 22 May 2020 10:50:30 GMT (envelope-from whu@FreeBSD.org) Received: (from whu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MAoUMV084246; Fri, 22 May 2020 10:50:30 GMT (envelope-from whu@FreeBSD.org) Message-Id: <202005221050.04MAoUMV084246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: whu set sender to whu@FreeBSD.org using -f From: Wei Hu Date: Fri, 22 May 2020 10:50:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361362 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: whu X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 361362 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, 22 May 2020 10:50:30 -0000 Author: whu Date: Fri May 22 10:50:29 2020 New Revision: 361362 URL: https://svnweb.freebsd.org/changeset/base/361362 Log: Bump __FreeBSD_version after r361275, HyperV socket support Sponsored by: Microsoft Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri May 22 09:38:44 2020 (r361361) +++ head/sys/sys/param.h Fri May 22 10:50:29 2020 (r361362) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300094 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300095 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Fri May 22 11:20: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 4B36E32D8B4; Fri, 22 May 2020 11:20:25 +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 49T3tx1GFSz491K; Fri, 22 May 2020 11:20:25 +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 267901DE8A; Fri, 22 May 2020 11:20:25 +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 04MBKOOE003195; Fri, 22 May 2020 11:20:24 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MBKOiH003190; Fri, 22 May 2020 11:20:24 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005221120.04MBKOiH003190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 May 2020 11:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361363 - in head/lib/libprocstat: . zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/lib/libprocstat: . zfs X-SVN-Commit-Revision: 361363 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, 22 May 2020 11:20:25 -0000 Author: avg Date: Fri May 22 11:20:23 2020 New Revision: 361363 URL: https://svnweb.freebsd.org/changeset/base/361363 Log: libprocstat: fix ZFS support First of all, znode_phys_t hasn't been used for storing file attributes for a long time now. Modern ZFS versions use a System Attribute table with a flexible layout. But more importantly all the required information is available in znode_t itself. It's not easy to include zfs_znode.h in userland without breaking code because the most interesting parts of the header are kernel-only. And hardcoding field offsets is too fragile. So, I created a new compilation unit that includes zfs_znode.h using some mild kludges to get it and its dependencies to compile in userland. The compilation unit exports interesting field offsets and does not have any other code. PR: 194117 Reviewed by: markj MFC after: 2 weeks Sponsored by: Panzura Differential Revision: https://reviews.freebsd.org/D24941 Added: head/lib/libprocstat/zfs_defs.c (contents, props changed) head/lib/libprocstat/zfs_defs.h (contents, props changed) Modified: head/lib/libprocstat/Makefile head/lib/libprocstat/zfs.c head/lib/libprocstat/zfs/Makefile Modified: head/lib/libprocstat/Makefile ============================================================================== --- head/lib/libprocstat/Makefile Fri May 22 10:50:29 2020 (r361362) +++ head/lib/libprocstat/Makefile Fri May 22 11:20:23 2020 (r361363) @@ -57,16 +57,17 @@ MLINKS+=libprocstat.3 procstat_close.3 \ # XXX This is a hack. .if ${MK_CDDL} != "no" CFLAGS+= -DLIBPROCSTAT_ZFS -OBJS+= zfs/zfs.o -SOBJS+= zfs/zfs.pico -POBJS+= zfs/zfs.po +SRCS+= zfs.c +OBJS+= zfs/zfs_defs.o +SOBJS+= zfs/zfs_defs.pico +POBJS+= zfs/zfs_defs.po SUBDIR= zfs -zfs/zfs.o: .PHONY - @cd ${.CURDIR}/zfs && ${MAKE} zfs.o -zfs/zfs.pico: .PHONY - @cd ${.CURDIR}/zfs && ${MAKE} zfs.pico -zfs/zfs.po: .PHONY - @cd ${.CURDIR}/zfs && ${MAKE} zfs.po +zfs/zfs_defs.o: .PHONY + @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.o +zfs/zfs_defs.pico: .PHONY + @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.pico +zfs/zfs_defs.po: .PHONY + @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.po .endif .include Modified: head/lib/libprocstat/zfs.c ============================================================================== --- head/lib/libprocstat/zfs.c Fri May 22 10:50:29 2020 (r361362) +++ head/lib/libprocstat/zfs.c Fri May 22 11:20:23 2020 (r361363) @@ -31,22 +31,13 @@ #include #define _KERNEL #include -#include #undef _KERNEL +#include +#include #include +#include +#include -#undef lbolt -#undef lbolt64 -#undef gethrestime_sec -#include -#include -#include -#include -#include -#include -#include -#include - #include #include @@ -57,24 +48,15 @@ #define ZFS #include "libprocstat.h" #include "common_kvm.h" +#include "zfs_defs.h" -/* - * Offset calculations that are used to get data from znode without having the - * definition. - */ -#define LOCATION_ZID (2 * sizeof(void *)) -#define LOCATION_ZPHYS(zsize) ((zsize) - (2 * sizeof(void *) + sizeof(struct task))) - int zfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn) { - znode_phys_t zphys; struct mount mount, *mountptr; - uint64_t *zid; - void *znodeptr, *vnodeptr; + void *znodeptr; char *dataptr; - void *zphys_addr; size_t len; int size; @@ -83,33 +65,27 @@ zfs_filestat(kvm_t *kd, struct vnode *vp, struct vnsta warnx("error getting sysctl"); return (1); } - znodeptr = malloc(size); - if (znodeptr == NULL) { + dataptr = malloc(size); + if (dataptr == NULL) { warnx("error allocating memory for znode storage"); return (1); } - /* Since we have problems including vnode.h, we'll use the wrappers. */ - vnodeptr = getvnodedata(vp); - if (!kvm_read_all(kd, (unsigned long)vnodeptr, znodeptr, - (size_t)size)) { - warnx("can't read znode at %p", (void *)vnodeptr); + + if ((size_t)size < offsetof_z_id + sizeof(uint64_t) || + (size_t)size < offsetof_z_mode + sizeof(mode_t) || + (size_t)size < offsetof_z_size + sizeof(uint64_t)) { + warnx("znode_t size is too small"); goto bad; } - /* - * z_id field is stored in the third pointer. We therefore skip the two - * first bytes. - * - * Pointer to the z_phys structure is the next last pointer. Therefore - * go back two bytes from the end. - */ - dataptr = znodeptr; - zid = (uint64_t *)(dataptr + LOCATION_ZID); - zphys_addr = *(void **)(dataptr + LOCATION_ZPHYS(size)); + if ((size_t)size != sizeof_znode_t) + warnx("znode_t size mismatch, data could be wrong"); - if (!kvm_read_all(kd, (unsigned long)zphys_addr, &zphys, - sizeof(zphys))) { - warnx("can't read znode_phys at %p", zphys_addr); + /* Since we have problems including vnode.h, we'll use the wrappers. */ + znodeptr = getvnodedata(vp); + if (!kvm_read_all(kd, (unsigned long)znodeptr, dataptr, + (size_t)size)) { + warnx("can't read znode at %p", (void *)znodeptr); goto bad; } @@ -119,18 +95,18 @@ zfs_filestat(kvm_t *kd, struct vnode *vp, struct vnsta warnx("can't read mount at %p", (void *)mountptr); goto bad; } - vn->vn_fsid = mount.mnt_stat.f_fsid.val[0]; - vn->vn_fileid = *zid; + /* - * XXX: Shows up wrong in output, but UFS has this error too. Could - * be that we're casting mode-variables from 64-bit to 8-bit or simply - * error in the mode-to-string function. + * XXX Assume that this is a znode, but it can be a special node + * under .zfs/. */ - vn->vn_mode = (mode_t)zphys.zp_mode; - vn->vn_size = (u_long)zphys.zp_size; - free(znodeptr); + vn->vn_fsid = mount.mnt_stat.f_fsid.val[0]; + vn->vn_fileid = *(uint64_t *)(void *)(dataptr + offsetof_z_id); + vn->vn_mode = *(mode_t *)(void *)(dataptr + offsetof_z_mode); + vn->vn_size = *(uint64_t *)(void *)(dataptr + offsetof_z_size); + free(dataptr); return (0); bad: - free(znodeptr); + free(dataptr); return (1); } Modified: head/lib/libprocstat/zfs/Makefile ============================================================================== --- head/lib/libprocstat/zfs/Makefile Fri May 22 10:50:29 2020 (r361362) +++ head/lib/libprocstat/zfs/Makefile Fri May 22 11:20:23 2020 (r361363) @@ -2,20 +2,20 @@ .PATH: ${.CURDIR:H} -SRCS= zfs.c -OBJS= zfs.o +SRCS= zfs_defs.c +OBJS= zfs_defs.o WARNS?= 1 CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head CFLAGS+= -I${.CURDIR:H} CFLAGS+= -DNEED_SOLARIS_BOOLEAN +CFLAGS+= -fno-builtin -nostdlib all: ${OBJS} CLEANFILES= ${OBJS} Added: head/lib/libprocstat/zfs_defs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libprocstat/zfs_defs.c Fri May 22 11:20:23 2020 (r361363) @@ -0,0 +1,59 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Andriy Gapon + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* Pretend we are kernel to get the same binary layout. */ +#define _KERNEL + +/* A hack to deal with kpilite.h. */ +#define KLD_MODULE + +/* + * Prevent some headers from getting included and fake some types + * in order to allow this file to compile without bringing in + * too many kernel build dependencies. + */ +#define _OPENSOLARIS_SYS_PATHNAME_H_ +#define _OPENSOLARIS_SYS_POLICY_H_ +#define _OPENSOLARIS_SYS_VNODE_H_ +#define _VNODE_PAGER_ + +typedef struct vnode vnode_t; +typedef struct vattr vattr_t; +typedef struct xvattr xvattr_t; +typedef struct vsecattr vsecattr_t; +typedef enum vtype vtype_t; + +#include +#include + +size_t sizeof_znode_t = sizeof(znode_t); +size_t offsetof_z_id = offsetof(znode_t, z_id); +size_t offsetof_z_size = offsetof(znode_t, z_size); +size_t offsetof_z_mode = offsetof(znode_t, z_mode); Added: head/lib/libprocstat/zfs_defs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libprocstat/zfs_defs.h Fri May 22 11:20:23 2020 (r361363) @@ -0,0 +1,38 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Andriy Gapon + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LIBPROCSTAT_ZFS_DEFS_H +#define _LIBPROCSTAT_ZFS_DEFS_H + +extern size_t sizeof_znode_t; +extern size_t offsetof_z_id; +extern size_t offsetof_z_size; +extern size_t offsetof_z_mode; + +#endif /* _LIBPROCSTAT_ZFS_DEFS_H */ From owner-svn-src-all@freebsd.org Fri May 22 11:25: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 A841032D7F7; Fri, 22 May 2020 11:25:46 +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 49T4163ymhz49SP; Fri, 22 May 2020 11:25:46 +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 65D591DDBF; Fri, 22 May 2020 11:25:46 +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 04MBPk4G009307; Fri, 22 May 2020 11:25:46 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MBPj7r009305; Fri, 22 May 2020 11:25:45 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005221125.04MBPj7r009305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 May 2020 11:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361364 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 361364 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, 22 May 2020 11:25:46 -0000 Author: avg Date: Fri May 22 11:25:45 2020 New Revision: 361364 URL: https://svnweb.freebsd.org/changeset/base/361364 Log: net80211: post RTM_IFINFO notification after toggling IFF_DRV_RUNNING This is useful when a wireless driver is stopped or started in response to events like an RF Kill button press. Applications like wpa_supplicant depend on such events to have a correct view of interface state. Reviewed by: adrian, cy, melifaro MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24925 Modified: head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_proto.h Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Fri May 22 11:20:23 2020 (r361363) +++ head/sys/net80211/ieee80211_freebsd.c Fri May 22 11:25:45 2020 (r361364) @@ -963,6 +963,19 @@ ieee80211_notify_radio(struct ieee80211com *ic, int st } void +ieee80211_notify_ifnet_change(struct ieee80211vap *vap) +{ + struct ifnet *ifp = vap->iv_ifp; + + IEEE80211_DPRINTF(vap, IEEE80211_MSG_DEBUG, "%s\n", + "interface state change"); + + CURVNET_SET(ifp->if_vnet); + rt_ifmsg(ifp); + CURVNET_RESTORE(); +} + +void ieee80211_load_module(const char *modname) { Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Fri May 22 11:20:23 2020 (r361363) +++ head/sys/net80211/ieee80211_proto.c Fri May 22 11:25:45 2020 (r361364) @@ -1511,6 +1511,8 @@ ieee80211_start_locked(struct ieee80211vap *vap) * back in here and complete the work. */ ifp->if_drv_flags |= IFF_DRV_RUNNING; + ieee80211_notify_ifnet_change(vap); + /* * We are not running; if this we are the first vap * to be brought up auto-up the parent if necessary. @@ -1624,6 +1626,7 @@ ieee80211_stop_locked(struct ieee80211vap *vap) ieee80211_new_state_locked(vap, IEEE80211_S_INIT, -1); if (ifp->if_drv_flags & IFF_DRV_RUNNING) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; /* mark us stopped */ + ieee80211_notify_ifnet_change(vap); if (--ic->ic_nrunning == 0) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG, Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Fri May 22 11:20:23 2020 (r361363) +++ head/sys/net80211/ieee80211_proto.h Fri May 22 11:25:45 2020 (r361364) @@ -455,4 +455,5 @@ void ieee80211_notify_node_auth(struct ieee80211_node void ieee80211_notify_country(struct ieee80211vap *, const uint8_t [], const uint8_t cc[2]); void ieee80211_notify_radio(struct ieee80211com *, int); +void ieee80211_notify_ifnet_change(struct ieee80211vap *); #endif /* _NET80211_IEEE80211_PROTO_H_ */ From owner-svn-src-all@freebsd.org Fri May 22 11:41:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0904532DD39; Fri, 22 May 2020 11:41:09 +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 49T4Lr6RjLz4BK4; Fri, 22 May 2020 11:41:08 +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 D87CB1DD72; Fri, 22 May 2020 11:41:08 +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 04MBf8IM017919; Fri, 22 May 2020 11:41:08 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MBf8nY017918; Fri, 22 May 2020 11:41:08 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005221141.04MBf8nY017918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 May 2020 11:41: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: r361365 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 361365 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, 22 May 2020 11:41:09 -0000 Author: avg Date: Fri May 22 11:41:08 2020 New Revision: 361365 URL: https://svnweb.freebsd.org/changeset/base/361365 Log: MFC r358380,r358382: dsl_dataset_promote_sync: populate 'oldname' before using it It's very unlikely that zfsvfs_update_fromname() and zvol_rename_minors() ever did anything during the promote operation as the old name was not initialized. Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri May 22 11:25:45 2020 (r361364) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri May 22 11:41:08 2020 (r361365) @@ -3109,6 +3109,10 @@ dsl_dataset_promote_sync(void *arg, dmu_tx_t *tx) ds->ds_objset = NULL; } +#if defined(__FreeBSD__) && defined(_KERNEL) + dsl_dataset_name(ds, oldname); +#endif + /* move snap name entry */ VERIFY0(dsl_dataset_get_snapname(ds)); VERIFY0(dsl_dataset_snap_remove(origin_head, From owner-svn-src-all@freebsd.org Fri May 22 11:53: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 A885632DE7C; Fri, 22 May 2020 11:53:08 +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 49T4ch3ydpz4C5k; Fri, 22 May 2020 11:53:08 +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 696181E48F; Fri, 22 May 2020 11:53:08 +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 04MBr8BH027388; Fri, 22 May 2020 11:53:08 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MBr88I027387; Fri, 22 May 2020 11:53:08 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005221153.04MBr88I027387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 May 2020 11:53: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: r361366 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 361366 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, 22 May 2020 11:53:08 -0000 Author: avg Date: Fri May 22 11:53:07 2020 New Revision: 361366 URL: https://svnweb.freebsd.org/changeset/base/361366 Log: MFC r358381: use ZFS_MAX_DATASET_NAME_LEN instead of MAXPATHLEN for dataset names The change affects only FreeBSD specific code as the common code already mostly uses the more idiomatic and correct ZFS_MAX_DATASET_NAME_LEN. Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri May 22 11:41:08 2020 (r361365) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri May 22 11:53:07 2020 (r361366) @@ -2528,16 +2528,16 @@ dsl_dataset_rename_snapshot_sync_impl(dsl_pool_t *dp, #ifdef __FreeBSD__ #ifdef _KERNEL - oldname = kmem_alloc(MAXPATHLEN, KM_SLEEP); - newname = kmem_alloc(MAXPATHLEN, KM_SLEEP); - snprintf(oldname, MAXPATHLEN, "%s@%s", ddrsa->ddrsa_fsname, - ddrsa->ddrsa_oldsnapname); - snprintf(newname, MAXPATHLEN, "%s@%s", ddrsa->ddrsa_fsname, - ddrsa->ddrsa_newsnapname); + oldname = kmem_alloc(ZFS_MAX_DATASET_NAME_LEN, KM_SLEEP); + newname = kmem_alloc(ZFS_MAX_DATASET_NAME_LEN, KM_SLEEP); + snprintf(oldname, ZFS_MAX_DATASET_NAME_LEN, "%s@%s", + ddrsa->ddrsa_fsname, ddrsa->ddrsa_oldsnapname); + snprintf(newname, ZFS_MAX_DATASET_NAME_LEN, "%s@%s", + ddrsa->ddrsa_fsname, ddrsa->ddrsa_newsnapname); zfsvfs_update_fromname(oldname, newname); zvol_rename_minors(oldname, newname); - kmem_free(newname, MAXPATHLEN); - kmem_free(oldname, MAXPATHLEN); + kmem_free(newname, ZFS_MAX_DATASET_NAME_LEN); + kmem_free(oldname, ZFS_MAX_DATASET_NAME_LEN); #endif #endif dsl_dataset_rele(ds, FTAG); @@ -3090,8 +3090,8 @@ dsl_dataset_promote_sync(void *arg, dmu_tx_t *tx) /* Take the spa_namespace_lock early so zvol renames don't deadlock. */ mutex_enter(&spa_namespace_lock); - oldname = kmem_alloc(MAXPATHLEN, KM_SLEEP); - newname = kmem_alloc(MAXPATHLEN, KM_SLEEP); + oldname = kmem_alloc(ZFS_MAX_DATASET_NAME_LEN, KM_SLEEP); + newname = kmem_alloc(ZFS_MAX_DATASET_NAME_LEN, KM_SLEEP); #endif /* move snapshots to this dir */ @@ -3179,8 +3179,8 @@ dsl_dataset_promote_sync(void *arg, dmu_tx_t *tx) #if defined(__FreeBSD__) && defined(_KERNEL) mutex_exit(&spa_namespace_lock); - kmem_free(newname, MAXPATHLEN); - kmem_free(oldname, MAXPATHLEN); + kmem_free(newname, ZFS_MAX_DATASET_NAME_LEN); + kmem_free(oldname, ZFS_MAX_DATASET_NAME_LEN); #endif /* * Change space accounting. From owner-svn-src-all@freebsd.org Fri May 22 11:55: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 9261832E4B1; Fri, 22 May 2020 11:55:54 +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 49T4gt3NCjz4CHV; Fri, 22 May 2020 11:55:54 +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 6EB811E490; Fri, 22 May 2020 11:55:54 +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 04MBtsjP027614; Fri, 22 May 2020 11:55:54 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MBtsU8027613; Fri, 22 May 2020 11:55:54 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005221155.04MBtsU8027613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 May 2020 11:55:54 +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: r361367 - stable/12/sys/dev/ichiic X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/ichiic X-SVN-Commit-Revision: 361367 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, 22 May 2020 11:55:54 -0000 Author: avg Date: Fri May 22 11:55:54 2020 New Revision: 361367 URL: https://svnweb.freebsd.org/changeset/base/361367 Log: MFC r360241: ig4: ensure that drivers always attach in correct order Use DRIVER_MODULE_ORDERED(SI_ORDER_ANY) so that ig4's ACPI attachment happens after iicbus and acpi_iicbus drivers are registered. Modified: stable/12/sys/dev/ichiic/ig4_acpi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/ichiic/ig4_acpi.c ============================================================================== --- stable/12/sys/dev/ichiic/ig4_acpi.c Fri May 22 11:53:07 2020 (r361366) +++ stable/12/sys/dev/ichiic/ig4_acpi.c Fri May 22 11:55:54 2020 (r361367) @@ -192,5 +192,6 @@ static driver_t ig4iic_acpi_driver = { sizeof(struct ig4iic_softc), }; -DRIVER_MODULE(ig4iic, acpi, ig4iic_acpi_driver, ig4iic_devclass, 0, 0); +DRIVER_MODULE_ORDERED(ig4iic, acpi, ig4iic_acpi_driver, ig4iic_devclass, 0, 0, + SI_ORDER_ANY); MODULE_DEPEND(ig4iic, acpi, 1, 1, 1); From owner-svn-src-all@freebsd.org Fri May 22 11:57: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 2A85632E1C7; Fri, 22 May 2020 11:57:49 +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 49T4k50D8tz4CJD; Fri, 22 May 2020 11:57:49 +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 02DA81E603; Fri, 22 May 2020 11:57:49 +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 04MBvmig027765; Fri, 22 May 2020 11:57:48 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MBvm8R027764; Fri, 22 May 2020 11:57:48 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005221157.04MBvm8R027764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 May 2020 11:57: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: r361368 - stable/12/sys/dev/iicbus X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/iicbus X-SVN-Commit-Revision: 361368 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, 22 May 2020 11:57:49 -0000 Author: avg Date: Fri May 22 11:57:48 2020 New Revision: 361368 URL: https://svnweb.freebsd.org/changeset/base/361368 Log: MFC r360242: acpi_iicbus: set device description in the probe method Kernel prints the device announcement before the attach method is called, so if the correct description is not set by the probe method, then the announcement would have an incorrect one. Modified: stable/12/sys/dev/iicbus/acpi_iicbus.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/iicbus/acpi_iicbus.c ============================================================================== --- stable/12/sys/dev/iicbus/acpi_iicbus.c Fri May 22 11:55:54 2020 (r361367) +++ stable/12/sys/dev/iicbus/acpi_iicbus.c Fri May 22 11:57:48 2020 (r361368) @@ -573,6 +573,7 @@ acpi_iicbus_probe(device_t dev) if (handle == NULL) return (ENXIO); + device_set_desc(dev, "Philips I2C bus (ACPI-hinted)"); return (BUS_PROBE_DEFAULT); } @@ -581,8 +582,6 @@ acpi_iicbus_attach(device_t dev) { struct acpi_iicbus_softc *sc = device_get_softc(dev); int error; - - device_set_desc(dev, "Philips I2C bus (ACPI-hinted)"); if (ACPI_FAILURE(acpi_iicbus_enumerate_children(dev))) device_printf(dev, "children enumeration failed\n"); From owner-svn-src-all@freebsd.org Fri May 22 11:59: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 F2F4A32E244; Fri, 22 May 2020 11:59:50 +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 49T4mQ6DqGz4CHD; Fri, 22 May 2020 11:59:50 +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 CD24A1E491; Fri, 22 May 2020 11:59:50 +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 04MBxofU027922; Fri, 22 May 2020 11:59:50 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MBxoPs027921; Fri, 22 May 2020 11:59:50 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005221159.04MBxoPs027921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 May 2020 11:59:50 +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: r361369 - stable/12/sys/dev/acpica X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/acpica X-SVN-Commit-Revision: 361369 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, 22 May 2020 11:59:51 -0000 Author: avg Date: Fri May 22 11:59:50 2020 New Revision: 361369 URL: https://svnweb.freebsd.org/changeset/base/361369 Log: MFC r360246: acpi_video: fix a crash in detach with an LCD output The crash happened because of a video output object was removed from a wrong container, crt_units instead of lcd_units. Modified: stable/12/sys/dev/acpica/acpi_video.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/acpica/acpi_video.c ============================================================================== --- stable/12/sys/dev/acpica/acpi_video.c Fri May 22 11:57:48 2020 (r361368) +++ stable/12/sys/dev/acpica/acpi_video.c Fri May 22 11:59:50 2020 (r361369) @@ -640,7 +640,10 @@ acpi_video_vo_destroy(struct acpi_video_output *vo) switch (vo->adr & DOD_DEVID_MASK) { case DOD_DEVID_MONITOR: - voqh = &crt_units; + if ((vo->adr & DOD_DEVID_MASK_FULL) == DOD_DEVID_LCD) + voqh = &lcd_units; + else + voqh = &crt_units; break; case DOD_DEVID_TV: voqh = &tv_units; From owner-svn-src-all@freebsd.org Fri May 22 12:01: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 CE05932F0E1; Fri, 22 May 2020 12:01:29 +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 49T4pK4vhzz4D8m; Fri, 22 May 2020 12:01:29 +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 A36DB1E32F; Fri, 22 May 2020 12:01:29 +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 04MC1TJ9031412; Fri, 22 May 2020 12:01:29 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MC1T7D031411; Fri, 22 May 2020 12:01:29 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005221201.04MC1T7D031411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 May 2020 12:01:29 +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: r361370 - stable/12/sys/dev/ichiic X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/ichiic X-SVN-Commit-Revision: 361370 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, 22 May 2020 12:01:29 -0000 Author: avg Date: Fri May 22 12:01:29 2020 New Revision: 361370 URL: https://svnweb.freebsd.org/changeset/base/361370 Log: MFC r360499: ig4iic_acpi_probe: remove set but unused variable Modified: stable/12/sys/dev/ichiic/ig4_acpi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/ichiic/ig4_acpi.c ============================================================================== --- stable/12/sys/dev/ichiic/ig4_acpi.c Fri May 22 11:59:50 2020 (r361369) +++ stable/12/sys/dev/ichiic/ig4_acpi.c Fri May 22 12:01:29 2020 (r361370) @@ -68,9 +68,7 @@ static char *ig4iic_ids[] = { static int ig4iic_acpi_probe(device_t dev) { - ig4iic_softc_t *sc; - sc = device_get_softc(dev); if (acpi_disabled("ig4iic")) return (ENXIO); From owner-svn-src-all@freebsd.org Fri May 22 12: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 44E0532F5DC; Fri, 22 May 2020 12:03:18 +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 49T4rQ16JQz4DTy; Fri, 22 May 2020 12:03:18 +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 2141A1E706; Fri, 22 May 2020 12:03:18 +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 04MC3IIT033897; Fri, 22 May 2020 12:03:18 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MC3HcX033896; Fri, 22 May 2020 12:03:17 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005221203.04MC3HcX033896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 May 2020 12:03:17 +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: r361371 - stable/12/sys/dev/usb X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/usb X-SVN-Commit-Revision: 361371 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, 22 May 2020 12:03:18 -0000 Author: avg Date: Fri May 22 12:03:17 2020 New Revision: 361371 URL: https://svnweb.freebsd.org/changeset/base/361371 Log: MFC r360692: usbhid: add several missing usages from Digitizer page Modified: stable/12/sys/dev/usb/usbhid.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/usb/usbhid.h ============================================================================== --- stable/12/sys/dev/usb/usbhid.h Fri May 22 12:01:29 2020 (r361370) +++ stable/12/sys/dev/usb/usbhid.h Fri May 22 12:03:17 2020 (r361371) @@ -174,7 +174,10 @@ struct usb_hid_descriptor { #define HUD_CONTACTCOUNT 0x0054 #define HUD_CONTACT_MAX 0x0055 #define HUD_SCAN_TIME 0x0056 +#define HUD_SURFACE_SWITCH 0x0057 +#define HUD_BUTTONS_SWITCH 0x0058 #define HUD_BUTTON_TYPE 0x0059 +#define HUD_LATENCY_MODE 0x0060 /* Usages, Consumer */ #define HUC_AC_PAN 0x0238 From owner-svn-src-all@freebsd.org Fri May 22 12:05: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 D0B4232F610; Fri, 22 May 2020 12:05:01 +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 49T4tP57lrz4DXv; Fri, 22 May 2020 12:05:01 +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 AB9591E3B4; Fri, 22 May 2020 12:05:01 +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 04MC512d034051; Fri, 22 May 2020 12:05:01 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MC51rY034050; Fri, 22 May 2020 12:05:01 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005221205.04MC51rY034050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 May 2020 12:05: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: r361372 - stable/12/sys/dev/gpio X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/gpio X-SVN-Commit-Revision: 361372 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, 22 May 2020 12:05:01 -0000 Author: avg Date: Fri May 22 12:05:01 2020 New Revision: 361372 URL: https://svnweb.freebsd.org/changeset/base/361372 Log: MFC r360779: gpioiic_attach: fix a NULL pointer crash on hints-based systems The attach method uses GPIO_GET_BUS() to get a "newbus" device that provides a pin. But on hints-based systems a GPIO controller driver might not be fully initialized yet and it does not know gpiobus hanging off it. Thus, GPIO_GET_BUS() cannot be called yet. The reason is that controller drivers typically create a child gpiobus using gpiobus_attach_bus() and that leads to the following call chain: gpiobus_attach_bus() -> gpiobus_attach() -> bus_generic_attach(gpiobus) -> gpioiic_attach(). So, gpioiic_attach() is called before gpiobus_attach_bus() returns. I observed this bug with nctgpio driver on amd64. I think that the problem was introduced in r355276. The fix is to avoid calling GPIO_GET_BUS() from the attach method. Instead, we know that on hints-based systems only the parent gpiobus can provide the pins. Nothing is changed for FDT-based systems. Modified: stable/12/sys/dev/gpio/gpioiic.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/gpio/gpioiic.c ============================================================================== --- stable/12/sys/dev/gpio/gpioiic.c Fri May 22 12:03:17 2020 (r361371) +++ stable/12/sys/dev/gpio/gpioiic.c Fri May 22 12:05:01 2020 (r361372) @@ -303,10 +303,20 @@ gpioiic_attach(device_t dev) return (ENXIO); } - /* Say what we came up with for pin config. */ + /* + * Say what we came up with for pin config. + * NB: in the !FDT case the controller driver might not be set up enough + * for GPIO_GET_BUS() to work. Also, our parent is the only gpiobus + * that can provide our pins. + */ device_printf(dev, "SCL pin: %s:%d, SDA pin: %s:%d\n", +#ifdef FDT device_get_nameunit(GPIO_GET_BUS(sc->sclpin->dev)), sc->sclpin->pin, device_get_nameunit(GPIO_GET_BUS(sc->sdapin->dev)), sc->sdapin->pin); +#else + device_get_nameunit(device_get_parent(dev)), sc->sclpin->pin, + device_get_nameunit(device_get_parent(dev)), sc->sdapin->pin); +#endif /* Add the bitbang driver as our only child; it will add iicbus. */ device_add_child(sc->dev, "iicbb", -1); From owner-svn-src-all@freebsd.org Fri May 22 12:06: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 6EA2432F702; Fri, 22 May 2020 12:06:54 +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 49T4wZ2Hqtz4DkS; Fri, 22 May 2020 12:06:54 +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 4573F1E5B2; Fri, 22 May 2020 12:06:54 +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 04MC6s6Q034187; Fri, 22 May 2020 12:06:54 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MC6sl0034186; Fri, 22 May 2020 12:06:54 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005221206.04MC6sl0034186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 May 2020 12:06:54 +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: r361373 - stable/12/sys/dev/sound/pci/hda X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 361373 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, 22 May 2020 12:06:54 -0000 Author: avg Date: Fri May 22 12:06:53 2020 New Revision: 361373 URL: https://svnweb.freebsd.org/changeset/base/361373 Log: MFC r361001: sound/hda: newer AMD devices still require the same PCIe snoop So, replicate the ATI vendor snoop configuration for the AMD vendor. I think that this should fix a number of cases where users currently have to resort to polling or disabling MSI. Modified: stable/12/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/12/sys/dev/sound/pci/hda/hdac.c Fri May 22 12:05:01 2020 (r361372) +++ stable/12/sys/dev/sound/pci/hda/hdac.c Fri May 22 12:06:53 2020 (r361373) @@ -193,6 +193,7 @@ static const struct { } hdac_pcie_snoop[] = { { INTEL_VENDORID, 0x00, 0x00, 0x00 }, { ATI_VENDORID, 0x42, 0xf8, 0x02 }, + { AMD_VENDORID, 0x42, 0xf8, 0x02 }, { NVIDIA_VENDORID, 0x4e, 0xf0, 0x0f }, }; From owner-svn-src-all@freebsd.org Fri May 22 12:08: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 8841F32F2EE; Fri, 22 May 2020 12:08:32 +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 49T4yS324rz4Dqv; Fri, 22 May 2020 12:08:32 +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 633F81E3B5; Fri, 22 May 2020 12:08:32 +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 04MC8W0R034340; Fri, 22 May 2020 12:08:32 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MC8WAf034339; Fri, 22 May 2020 12:08:32 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005221208.04MC8WAf034339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 May 2020 12:08: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: r361374 - stable/12/sys/dev/sound/pci/hda X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 361374 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, 22 May 2020 12:08:32 -0000 Author: avg Date: Fri May 22 12:08:31 2020 New Revision: 361374 URL: https://svnweb.freebsd.org/changeset/base/361374 Log: MFC r361002: snd_hda: fix typos related to quirks set via 'config' tunable Modified: stable/12/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/12/sys/dev/sound/pci/hda/hdac.c Fri May 22 12:06:53 2020 (r361373) +++ stable/12/sys/dev/sound/pci/hda/hdac.c Fri May 22 12:08:31 2020 (r361374) @@ -66,7 +66,7 @@ static const struct { const char *key; uint32_t value; } hdac_quirks_tab[] = { - { "64bit", HDAC_QUIRK_DMAPOS }, + { "64bit", HDAC_QUIRK_64BIT }, { "dmapos", HDAC_QUIRK_DMAPOS }, { "msi", HDAC_QUIRK_MSI }, }; @@ -278,10 +278,10 @@ hdac_config_fetch(struct hdac_softc *sc, uint32_t *on, ); if (inv == 0) { *on |= hdac_quirks_tab[k].value; - *on &= ~hdac_quirks_tab[k].value; + *off &= ~hdac_quirks_tab[k].value; } else if (inv != 0) { *off |= hdac_quirks_tab[k].value; - *off &= ~hdac_quirks_tab[k].value; + *on &= ~hdac_quirks_tab[k].value; } break; } From owner-svn-src-all@freebsd.org Fri May 22 12: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 1875832F4F3; Fri, 22 May 2020 12:10:17 +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 49T50S6qqtz4F96; Fri, 22 May 2020 12:10:16 +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 E5AD31E4BA; Fri, 22 May 2020 12:10:16 +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 04MCAGbi034521; Fri, 22 May 2020 12:10:16 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MCAGXw034520; Fri, 22 May 2020 12:10:16 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005221210.04MCAGXw034520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 May 2020 12:10: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: r361375 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361375 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, 22 May 2020 12:10:17 -0000 Author: avg Date: Fri May 22 12:10:16 2020 New Revision: 361375 URL: https://svnweb.freebsd.org/changeset/base/361375 Log: MFC r361006: linuxkpi: print stack trace in WARN_ON macros Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Fri May 22 12:08:31 2020 (r361374) +++ stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Fri May 22 12:10:16 2020 (r361375) @@ -107,6 +107,7 @@ if (__ret) { \ printf("WARNING %s failed at %s:%d\n", \ __stringify(cond), __FILE__, __LINE__); \ + linux_dump_stack(); \ } \ unlikely(__ret); \ }) @@ -120,6 +121,7 @@ __warn_on_once = 1; \ printf("WARNING %s failed at %s:%d\n", \ __stringify(cond), __FILE__, __LINE__); \ + linux_dump_stack(); \ } \ unlikely(__ret); \ }) From owner-svn-src-all@freebsd.org Fri May 22 12:20: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 EAC3332F7CE; Fri, 22 May 2020 12:20:50 +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 49T5Df5zv8z4Ffw; Fri, 22 May 2020 12:20:50 +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 C8E011E8C3; Fri, 22 May 2020 12:20:50 +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 04MCKonJ041360; Fri, 22 May 2020 12:20:50 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MCKoVX041358; Fri, 22 May 2020 12:20:50 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005221220.04MCKoVX041358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 May 2020 12:20:50 +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: r361376 - stable/12/share/man/man9 X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/share/man/man9 X-SVN-Commit-Revision: 361376 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, 22 May 2020 12:20:51 -0000 Author: avg Date: Fri May 22 12:20:50 2020 New Revision: 361376 URL: https://svnweb.freebsd.org/changeset/base/361376 Log: MFC r353679: document taskqueue_start_threads_in_proc While here, fix taskqueue_start_threads_cpuset that was documented under old name of taskqueue_start_threads_pinned. Modified: stable/12/share/man/man9/Makefile stable/12/share/man/man9/taskqueue.9 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/Makefile ============================================================================== --- stable/12/share/man/man9/Makefile Fri May 22 12:10:16 2020 (r361375) +++ stable/12/share/man/man9/Makefile Fri May 22 12:20:50 2020 (r361376) @@ -2076,7 +2076,8 @@ MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 taskqueue_run.9 \ taskqueue.9 taskqueue_set_callback.9 \ taskqueue.9 taskqueue_start_threads.9 \ - taskqueue.9 taskqueue_start_threads_pinned.9 \ + taskqueue.9 taskqueue_start_threads_cpuset.9 \ + taskqueue.9 taskqueue_start_threads_in_proc.9 \ taskqueue.9 taskqueue_unblock.9 \ taskqueue.9 TIMEOUT_TASK_INIT.9 MLINKS+=tcp_functions.9 register_tcp_functions.9 \ Modified: stable/12/share/man/man9/taskqueue.9 ============================================================================== --- stable/12/share/man/man9/taskqueue.9 Fri May 22 12:10:16 2020 (r361375) +++ stable/12/share/man/man9/taskqueue.9 Fri May 22 12:20:50 2020 (r361376) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 21, 2018 +.Dd October 17, 2019 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -69,10 +69,15 @@ struct timeout_task; .Ft int .Fn taskqueue_start_threads "struct taskqueue **tqp" "int count" "int pri" "const char *name" "..." .Ft int -.Fo taskqueue_start_threads_pinned -.Fa "struct taskqueue **tqp" "int count" "int pri" "int cpu_id" +.Fo taskqueue_start_threads_cpuset +.Fa "struct taskqueue **tqp" "int count" "int pri" "cpuset_t *mask" .Fa "const char *name" "..." .Fc +.Ft int +.Fo taskqueue_start_threads_in_proc +.Fa "struct taskqueue **tqp" "int count" "int pri" "struct proc *proc" +.Fa "const char *name" "..." +.Fc .Ft void .Fn taskqueue_set_callback "struct taskqueue *queue" "enum taskqueue_callback_type cb_type" "taskqueue_callback_fn callback" "void *context" .Ft void @@ -152,14 +157,20 @@ Any tasks that are on the queue will be executed at th which the thread servicing the queue will be signaled that it should exit. .Pp Once a taskqueue has been created, its threads should be started using -.Fn taskqueue_start_threads +.Fn taskqueue_start_threads , +.Fn taskqueue_start_threads_cpuset or -.Fn taskqueue_start_threads_pinned . -.Fn taskqueue_start_threads_pinned +.Fn taskqueue_start_threads_in_proc . +.Fn taskqueue_start_threads_cpuset takes a -.Va cpu_id +.Va cpuset argument which will cause the threads which are started for the taskqueue -to be pinned to run on the given CPU. +to be restricted to run on the given CPUs. +.Fn taskqueue_start_threads_in_proc +takes a +.Va proc +argument which will cause the threads which are started for the taskqueue +to be assigned to the given kernel process. Callbacks may optionally be registered using .Fn taskqueue_set_callback . Currently, callbacks may be registered for the following purposes: From owner-svn-src-all@freebsd.org Fri May 22 12:26: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 44FBA32FD0E; Fri, 22 May 2020 12:26:00 +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 49T5Lc0TmHz4Fql; Fri, 22 May 2020 12:26:00 +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 0B7DB1E7A6; Fri, 22 May 2020 12:26:00 +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 04MCPxR8046294; Fri, 22 May 2020 12:25:59 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MCPwCm046286; Fri, 22 May 2020 12:25:58 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005221225.04MCPwCm046286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 May 2020 12:25: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: r361377 - in stable/12/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/12/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 361377 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, 22 May 2020 12:26:00 -0000 Author: avg Date: Fri May 22 12:25:57 2020 New Revision: 361377 URL: https://svnweb.freebsd.org/changeset/base/361377 Log: MFC r354333,r354359: zfs: enable SPA_PROCESS on the kernel side The purpose of this change is to group kernel threads specific to a particular ZFS pool under a kernel process. There can be many dozens of threads per pool. This change improves observability of those threads. This change consists of several subchanges: 1. illumos taskq_create_proc can now pass its process parameter to taskqueue. Also, use zfsproc instead of NULL for taskq_create. Caveat: zfsproc might not be initialized yet. But in that case it is still NULL, so not worse than before. 2. illumos sys/proc.h: kthread id is stored in t_did field, not t_tid. 3. zfs: enable SPA_PROCESS on the kernel side. The change is a bit hairy as newproc() is implemented privately to spa.c. I couldn't think of a better way to populate process name than to poke inside the argument for the process routine. 4. illumos thread_create: allow assigning thread to process other than zfsproc. 5. zfs: expose spa_proc to other users, assign sync and quiesce threads to it. Pool-specific threads created using (relatively new) zthr mechanism are still assigned to the zfskern process rather than to a respective zpool-xxx process. I am going to address this a bit later. Modified: stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c stable/12/sys/cddl/compat/opensolaris/sys/proc.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c ============================================================================== --- stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Fri May 22 12:20:50 2020 (r361376) +++ stable/12/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Fri May 22 12:25:57 2020 (r361377) @@ -42,6 +42,8 @@ static uma_zone_t taskq_zone; taskq_t *system_taskq = NULL; +struct proc *system_proc; + static void system_taskq_init(void *arg) { @@ -62,9 +64,9 @@ system_taskq_fini(void *arg) } SYSUNINIT(system_taskq_fini, SI_SUB_CONFIGURE, SI_ORDER_ANY, system_taskq_fini, NULL); -taskq_t * -taskq_create(const char *name, int nthreads, pri_t pri, int minalloc __unused, - int maxalloc __unused, uint_t flags) +static taskq_t * +taskq_create_impl(const char *name, int nthreads, pri_t pri, proc_t *proc, + uint_t flags) { taskq_t *tq; @@ -74,17 +76,24 @@ taskq_create(const char *name, int nthreads, pri_t pri tq = kmem_alloc(sizeof(*tq), KM_SLEEP); tq->tq_queue = taskqueue_create(name, M_WAITOK, taskqueue_thread_enqueue, &tq->tq_queue); - (void) taskqueue_start_threads(&tq->tq_queue, nthreads, pri, "%s", name); + (void) taskqueue_start_threads_in_proc(&tq->tq_queue, nthreads, pri, + proc, "%s", name); return ((taskq_t *)tq); } taskq_t * -taskq_create_proc(const char *name, int nthreads, pri_t pri, int minalloc, - int maxalloc, proc_t *proc __unused, uint_t flags) +taskq_create(const char *name, int nthreads, pri_t pri, int minalloc __unused, + int maxalloc __unused, uint_t flags) { + return (taskq_create_impl(name, nthreads, pri, system_proc, flags)); +} - return (taskq_create(name, nthreads, pri, minalloc, maxalloc, flags)); +taskq_t * +taskq_create_proc(const char *name, int nthreads, pri_t pri, int minalloc, + int maxalloc, proc_t *proc, uint_t flags) +{ + return (taskq_create_impl(name, nthreads, pri, proc, flags)); } void Modified: stable/12/sys/cddl/compat/opensolaris/sys/proc.h ============================================================================== --- stable/12/sys/cddl/compat/opensolaris/sys/proc.h Fri May 22 12:20:50 2020 (r361376) +++ stable/12/sys/cddl/compat/opensolaris/sys/proc.h Fri May 22 12:25:57 2020 (r361377) @@ -47,12 +47,13 @@ #define maxclsyspri PVM #define max_ncpus (mp_maxid + 1) #define boot_max_ncpus (mp_maxid + 1) +#define syscid 1 #define TS_RUN 0 #define p0 proc0 -#define t_tid td_tid +#define t_did td_tid typedef short pri_t; typedef struct thread _kthread; @@ -60,13 +61,14 @@ typedef struct thread kthread_t; typedef struct thread *kthread_id_t; typedef struct proc proc_t; -extern struct proc *zfsproc; +extern struct proc *system_proc; static __inline kthread_t * do_thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg, size_t len, proc_t *pp, int state, pri_t pri) { kthread_t *td = NULL; + proc_t **ppp; int error; /* @@ -75,9 +77,13 @@ do_thread_create(caddr_t stk, size_t stksize, void (*p ASSERT(stk == NULL); ASSERT(len == 0); ASSERT(state == TS_RUN); - ASSERT(pp == &p0); + ASSERT(pp != NULL); - error = kproc_kthread_add(proc, arg, &zfsproc, &td, RFSTOPPED, + if (pp == &p0) + ppp = &system_proc; + else + ppp = &pp; + error = kproc_kthread_add(proc, arg, ppp, &td, RFSTOPPED, stksize / PAGE_SIZE, "zfskern", "solthread %p", proc); if (error == 0) { thread_lock(td); 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 Fri May 22 12:20:50 2020 (r361376) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri May 22 12:25:57 2020 (r361377) @@ -176,7 +176,11 @@ boolean_t zio_taskq_sysdc = B_TRUE; /* use SDC schedul uint_t zio_taskq_basedc = 80; /* base duty cycle */ #endif +#ifdef _KERNEL +#define SPA_PROCESS +#endif boolean_t spa_create_process = B_TRUE; /* no process ==> no sysdc */ + extern int zfs_sync_pass_deferred_free; /* @@ -1094,23 +1098,49 @@ spa_create_zio_taskqs(spa_t *spa) } } -#ifdef _KERNEL #ifdef SPA_PROCESS +static int +newproc(void (*pc)(void *), void *arg, id_t cid, int pri, + void **ct, pid_t pid) +{ + va_list ap; + spa_t *spa = (spa_t *)arg; /* XXX */ + struct proc *newp; + struct thread *td; + int error; + + ASSERT(ct == NULL); + ASSERT(pid == 0); + ASSERT(cid == syscid); + + error = kproc_create(pc, arg, &newp, 0, 0, "zpool-%s", spa->spa_name); + if (error != 0) + return (error); + td = FIRST_THREAD_IN_PROC(newp); + thread_lock(td); + sched_prio(td, pri); + thread_unlock(td); + return (0); +} + static void spa_thread(void *arg) { callb_cpr_t cprinfo; spa_t *spa = arg; +#ifdef illumos user_t *pu = PTOU(curproc); - +#endif CALLB_CPR_INIT(&cprinfo, &spa->spa_proc_lock, callb_generic_cpr, spa->spa_name); ASSERT(curproc != &p0); +#ifdef illumos (void) snprintf(pu->u_psargs, sizeof (pu->u_psargs), "zpool-%s", spa->spa_name); (void) strlcpy(pu->u_comm, pu->u_psargs, sizeof (pu->u_comm)); +#endif #ifdef PSRSET_BIND /* bind this thread to the requested psrset */ @@ -1164,11 +1194,14 @@ spa_thread(void *arg) cv_broadcast(&spa->spa_proc_cv); CALLB_CPR_EXIT(&cprinfo); /* drops spa_proc_lock */ +#ifdef illumos mutex_enter(&curproc->p_lock); lwp_exit(); +#else + kthread_exit(); +#endif } #endif /* SPA_PROCESS */ -#endif /* * Activate an uninitialized pool. @@ -1215,7 +1248,9 @@ spa_activate(spa_t *spa, int mode) mutex_exit(&spa->spa_proc_lock); /* If we didn't create a process, we need to create our taskqs. */ +#ifndef SPA_PROCESS ASSERT(spa->spa_proc == &p0); +#endif /* SPA_PROCESS */ if (spa->spa_proc == &p0) { spa_create_zio_taskqs(spa); } @@ -1319,6 +1354,7 @@ spa_deactivate(spa_t *spa) mutex_exit(&spa->spa_proc_lock); #ifdef SPA_PROCESS +#ifdef illumos /* * We want to make sure spa_thread() has actually exited the ZFS * module, so that the module can't be unloaded out from underneath @@ -1328,6 +1364,7 @@ spa_deactivate(spa_t *spa) thread_join(spa->spa_did); spa->spa_did = 0; } +#endif #endif /* SPA_PROCESS */ } Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri May 22 12:20:50 2020 (r361376) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri May 22 12:25:57 2020 (r361377) @@ -1935,6 +1935,12 @@ spa_deadman_synctime(spa_t *spa) return (spa->spa_deadman_synctime); } +struct proc * +spa_proc(spa_t *spa) +{ + return (spa->spa_proc); +} + uint64_t dva_get_dsize_sync(spa_t *spa, const dva_t *dva) { Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Fri May 22 12:20:50 2020 (r361376) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Fri May 22 12:25:57 2020 (r361377) @@ -833,6 +833,7 @@ extern uint64_t spa_bootfs(spa_t *spa); extern uint64_t spa_delegation(spa_t *spa); extern objset_t *spa_meta_objset(spa_t *spa); extern uint64_t spa_deadman_synctime(spa_t *spa); +extern struct proc *spa_proc(spa_t *spa); extern uint64_t spa_dirty_data(spa_t *spa); /* Miscellaneous support routines */ Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri May 22 12:20:50 2020 (r361376) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri May 22 12:25:57 2020 (r361377) @@ -209,7 +209,7 @@ txg_sync_start(dsl_pool_t *dp) tx->tx_threads = 2; tx->tx_quiesce_thread = thread_create(NULL, 0, txg_quiesce_thread, - dp, 0, &p0, TS_RUN, minclsyspri); + dp, 0, spa_proc(dp->dp_spa), TS_RUN, minclsyspri); /* * The sync thread can need a larger-than-default stack size on @@ -217,7 +217,7 @@ txg_sync_start(dsl_pool_t *dp) * scrub_visitbp() recursion. */ tx->tx_sync_thread = thread_create(NULL, 32<<10, txg_sync_thread, - dp, 0, &p0, TS_RUN, minclsyspri); + dp, 0, spa_proc(dp->dp_spa), TS_RUN, minclsyspri); mutex_exit(&tx->tx_sync_lock); } Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri May 22 12:20:50 2020 (r361376) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri May 22 12:25:57 2020 (r361377) @@ -7138,7 +7138,6 @@ zfsdev_fini(void) } static struct root_hold_token *zfs_root_token; -struct proc *zfsproc; #ifdef illumos int 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 Fri May 22 12:20:50 2020 (r361376) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Fri May 22 12:25:57 2020 (r361377) @@ -2685,7 +2685,7 @@ zvol_geom_run(zvol_state_t *zv) pp = zv->zv_provider; g_error_provider(pp, 0); - kproc_kthread_add(zvol_geom_worker, zv, &zfsproc, NULL, 0, 0, + kproc_kthread_add(zvol_geom_worker, zv, &system_proc, NULL, 0, 0, "zfskern", "zvol %s", pp->name + sizeof(ZVOL_DRIVER)); } From owner-svn-src-all@freebsd.org Fri May 22 12:53: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 352672C8416; Fri, 22 May 2020 12:53:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T5yZ0W7Cz4GyY; Fri, 22 May 2020 12:53:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C4B71F005; Fri, 22 May 2020 12:53:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MCrfR4064568; Fri, 22 May 2020 12:53:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MCrfhR064567; Fri, 22 May 2020 12:53:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005221253.04MCrfhR064567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 22 May 2020 12:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r361378 - releng/11.4/usr.sbin/bsdinstall/scripts X-SVN-Group: releng X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: releng/11.4/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 361378 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, 22 May 2020 12:53:42 -0000 Author: emaste Date: Fri May 22 12:53:41 2020 New Revision: 361378 URL: https://svnweb.freebsd.org/changeset/base/361378 Log: MFS11 r361305 (dteske): bsdinstall: fix wpa_supplicant.conf indentation Approved by: re (delphij) Modified: releng/11.4/usr.sbin/bsdinstall/scripts/wlanconfig Directory Properties: releng/11.4/ (props changed) Modified: releng/11.4/usr.sbin/bsdinstall/scripts/wlanconfig ============================================================================== --- releng/11.4/usr.sbin/bsdinstall/scripts/wlanconfig Fri May 22 12:25:57 2020 (r361377) +++ releng/11.4/usr.sbin/bsdinstall/scripts/wlanconfig Fri May 22 12:53:41 2020 (r361378) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn -# Copyright (c) 2013-2016 Devin Teske +# Copyright (c) 2013-2020 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -60,8 +60,7 @@ country_set() 'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \ "$WLAN_IFACE" "$BSDINSTALL_TMPETC" if [ "$error_str" ]; then - $DIALOG \ - --title "$msg_error" \ + $DIALOG --title "$msg_error" \ --backtitle "$DIALOG_BACKTITLE" \ --yes-label Change \ --no-label Ignore \ @@ -70,8 +69,7 @@ country_set() 0 0 || return $SUCCESS # Skip return $FAILURE # Restart else - awk 'sub(/^\t\t/,"")||1' \ - > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF + cat > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF create_args_$WLAN_IFACE="$ifconfig_args" EOF fi @@ -101,7 +99,8 @@ dialog_country_select() sub(/Country codes:/, ""), sub(/Regulatory.*/, "") { while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) { country = substr($0, RSTART) - sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", country) + sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", + country) code = substr(country, 1, 2) desc = substr(country, 4) sub(/[[:space:]]*$/, "", desc) @@ -153,7 +152,7 @@ dialog_country_select() : > "$BSDINSTALL_TMPETC/wpa_supplicant.conf" chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf" -cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF +cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ psk="$PASS" + \ priority=5 + } + EOF elif echo "$ENCRYPTION" | grep -q EAP; then USERPASS=$( $DIALOG \ --title "WPA-Enterprise Setup" \ @@ -300,19 +299,19 @@ elif echo "$ENCRYPTION" | grep -q EAP; then "Password" 3 0 "" 3 12 25 63 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=WPA-EAP$( + echo "$USERPASS" | awk ' + NR == 1 { printf "\n\tidentity=\"%s\"", $1 } + NR == 2 { printf "\n\tpassword=\"%s\"", $1 } + ' ) + \ priority=5 + } + EOF elif echo "$ENCRYPTION" | grep -q WEP; then WEPKEY=$( $DIALOG \ --title "WEP Setup" \ @@ -324,31 +323,31 @@ elif echo "$ENCRYPTION" | grep -q WEP; then "WEP Key 0" 2 0 "" 2 12 15 0 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=NONE + \ wep_key0="$WEPKEY" + \ wep_tx_keyidx=0 + \ priority=5 + } + EOF else # Open - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=NONE + \ priority=5 + } + EOF fi # Connect to any open networks policy -cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF +cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" < Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B5F062C894A; Fri, 22 May 2020 13:13: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 49T6PW39Zxz4J1D; Fri, 22 May 2020 13:13: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 681EB1F487; Fri, 22 May 2020 13:13: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 04MDDZvH077513; Fri, 22 May 2020 13:13:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MDDZIn077511; Fri, 22 May 2020 13:13:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005221313.04MDDZIn077511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 May 2020 13:13:35 +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: r361379 - stable/12/lib/libc/gen X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/lib/libc/gen X-SVN-Commit-Revision: 361379 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, 22 May 2020 13:13:35 -0000 Author: kib Date: Fri May 22 13:13:34 2020 New Revision: 361379 URL: https://svnweb.freebsd.org/changeset/base/361379 Log: MFC r342743 (by romain): Add man page for dlvsym(3). Modified: stable/12/lib/libc/gen/Makefile.inc stable/12/lib/libc/gen/dlopen.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/gen/Makefile.inc ============================================================================== --- stable/12/lib/libc/gen/Makefile.inc Fri May 22 12:53:41 2020 (r361378) +++ stable/12/lib/libc/gen/Makefile.inc Fri May 22 13:13:34 2020 (r361379) @@ -342,7 +342,8 @@ MLINKS+=dlopen.3 fdlopen.3 \ dlopen.3 dlclose.3 \ dlopen.3 dlerror.3 \ dlopen.3 dlfunc.3 \ - dlopen.3 dlsym.3 + dlopen.3 dlsym.3 \ + dlopen.3 dlvsym.3 MLINKS+=err.3 err_set_exit.3 \ err.3 err_set_file.3 \ err.3 errc.3 \ Modified: stable/12/lib/libc/gen/dlopen.3 ============================================================================== --- stable/12/lib/libc/gen/dlopen.3 Fri May 22 12:53:41 2020 (r361378) +++ stable/12/lib/libc/gen/dlopen.3 Fri May 22 13:13:34 2020 (r361379) @@ -32,13 +32,14 @@ .\" @(#) dlopen.3 1.6 90/01/31 SMI .\" $FreeBSD$ .\" -.Dd July 7, 2017 +.Dd January 2, 2019 .Dt DLOPEN 3 .Os .Sh NAME .Nm dlopen , .Nm fdlopen , .Nm dlsym , +.Nm dlvsym , .Nm dlfunc , .Nm dlerror , .Nm dlclose @@ -53,6 +54,8 @@ .Fn fdlopen "int fd" "int mode" .Ft void * .Fn dlsym "void * restrict handle" "const char * restrict symbol" +.Ft void * +.Fn dlvsym "void * restrict handle" "const char * restrict symbol" "const char * restrict version" .Ft dlfunc_t .Fn dlfunc "void * restrict handle" "const char * restrict symbol" .Ft char * @@ -74,7 +77,8 @@ provides access to the shared object in .Fa path , returning a descriptor that can be used for later references to the object in calls to -.Fn dlsym +.Fn dlsym , +.Fn dlvsym and .Fn dlclose . If @@ -300,6 +304,16 @@ condition which may be queried with .Fn dlerror . .Pp The +.Fn dlvsym +function behaves like +.Fn dlsym , +but takes an extra argument +.Fa version : +a null-terminated character string which is used to request a specific version +of +.Fa symbol . +.Pp +The .Fn dlfunc function implements all of the behavior of @@ -328,6 +342,7 @@ occurred during a call to .Fn dladdr , .Fn dlinfo , .Fn dlsym , +.Fn dlvsym , .Fn dlfunc , or .Fn dlclose . @@ -375,7 +390,10 @@ using the option to .Xr ld 1 for symbols defined in the executable to become visible to -.Fn dlsym . +.Fn dlsym , +.Fn dlvsym +or +.Fn dlfunc .Pp Other ELF platforms require linking with .Lb libdl @@ -397,6 +415,7 @@ The .Fn dlopen , .Fn fdlopen , .Fn dlsym , +.Fn dlvsym , and .Fn dlfunc functions From owner-svn-src-all@freebsd.org Fri May 22 13:14: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 9B80E2C8964; Fri, 22 May 2020 13:14: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 49T6QQ3gBZz4JMb; Fri, 22 May 2020 13:14: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 788F61F0CF; Fri, 22 May 2020 13:14: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 04MDEMXR077609; Fri, 22 May 2020 13:14:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MDELfK077605; Fri, 22 May 2020 13:14:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005221314.04MDELfK077605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 May 2020 13:14:21 +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: r361380 - in stable/12: include lib/libc/gen libexec/rtld-elf X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12: include lib/libc/gen libexec/rtld-elf X-SVN-Commit-Revision: 361380 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, 22 May 2020 13:14:22 -0000 Author: kib Date: Fri May 22 13:14:21 2020 New Revision: 361380 URL: https://svnweb.freebsd.org/changeset/base/361380 Log: MFC r361073: Implement RTLD_DEEPBIND. PR: 246462 Modified: stable/12/include/dlfcn.h stable/12/lib/libc/gen/dlopen.3 stable/12/libexec/rtld-elf/rtld.c stable/12/libexec/rtld-elf/rtld.h Directory Properties: stable/12/ (props changed) Modified: stable/12/include/dlfcn.h ============================================================================== --- stable/12/include/dlfcn.h Fri May 22 13:13:34 2020 (r361379) +++ stable/12/include/dlfcn.h Fri May 22 13:14:21 2020 (r361380) @@ -47,6 +47,8 @@ #define RTLD_TRACE 0x200 /* Trace loaded objects and exit. */ #define RTLD_NODELETE 0x01000 /* Do not remove members. */ #define RTLD_NOLOAD 0x02000 /* Do not load if not already loaded. */ +#define RTLD_DEEPBIND 0x04000 /* Put symbols from the dso ahead of + the global list */ /* * Request arguments for dlinfo(). Modified: stable/12/lib/libc/gen/dlopen.3 ============================================================================== --- stable/12/lib/libc/gen/dlopen.3 Fri May 22 13:13:34 2020 (r361379) +++ stable/12/lib/libc/gen/dlopen.3 Fri May 22 13:14:21 2020 (r361380) @@ -32,7 +32,7 @@ .\" @(#) dlopen.3 1.6 90/01/31 SMI .\" $FreeBSD$ .\" -.Dd January 2, 2019 +.Dd May 14, 2020 .Dt DLOPEN 3 .Os .Sh NAME @@ -162,6 +162,9 @@ the process address space, otherwise is returned. Other mode flags may be specified, which will be applied for promotion for the found object. +.It Dv RTLD_DEEPBIND +Symbols from the loaded library are put before global symbols when +resolving symbolic references originated from the library. .El .Pp If Modified: stable/12/libexec/rtld-elf/rtld.c ============================================================================== --- stable/12/libexec/rtld-elf/rtld.c Fri May 22 13:13:34 2020 (r361379) +++ stable/12/libexec/rtld-elf/rtld.c Fri May 22 13:14:21 2020 (r361380) @@ -3319,6 +3319,8 @@ rtld_dlopen(const char *name, int fd, int mode) lo_flags |= RTLD_LO_NODELETE; if (mode & RTLD_NOLOAD) lo_flags |= RTLD_LO_NOLOAD; + if (mode & RTLD_DEEPBIND) + lo_flags |= RTLD_LO_DEEPBIND; if (ld_tracing != NULL) lo_flags |= RTLD_LO_TRACE | RTLD_LO_IGNSTLS; @@ -3370,6 +3372,8 @@ dlopen_object(const char *name, int fd, Obj_Entry *ref if (globallist_next(old_obj_tail) != NULL) { /* We loaded something new. */ assert(globallist_next(old_obj_tail) == obj); + if ((lo_flags & RTLD_LO_DEEPBIND) != 0) + obj->symbolic = true; result = 0; if ((lo_flags & (RTLD_LO_EARLY | RTLD_LO_IGNSTLS)) == 0 && obj->static_tls && !allocate_tls_offset(obj)) { Modified: stable/12/libexec/rtld-elf/rtld.h ============================================================================== --- stable/12/libexec/rtld-elf/rtld.h Fri May 22 13:13:34 2020 (r361379) +++ stable/12/libexec/rtld-elf/rtld.h Fri May 22 13:14:21 2020 (r361380) @@ -310,6 +310,7 @@ TAILQ_HEAD(obj_entry_q, Struct_Obj_Entry); #define RTLD_LO_EARLY 0x20 /* Do not call ctors, postpone it to the initialization during the image start. */ #define RTLD_LO_IGNSTLS 0x40 /* Do not allocate static TLS */ +#define RTLD_LO_DEEPBIND 0x80 /* Force symbolic for this object */ /* * Symbol cache entry used during relocation to avoid multiple lookups From owner-svn-src-all@freebsd.org Fri May 22 13:17: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 77DEC2C8672; Fri, 22 May 2020 13:17: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 49T6VZ2dnmz4JRV; Fri, 22 May 2020 13:17: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 386391F0D2; Fri, 22 May 2020 13:17:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MDHvFd077866; Fri, 22 May 2020 13:17:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MDHvjS077865; Fri, 22 May 2020 13:17:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005221317.04MDHvjS077865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 May 2020 13:17:57 +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: r361381 - stable/11/lib/libc/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/lib/libc/gen X-SVN-Commit-Revision: 361381 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, 22 May 2020 13:17:58 -0000 Author: kib Date: Fri May 22 13:17:57 2020 New Revision: 361381 URL: https://svnweb.freebsd.org/changeset/base/361381 Log: MFC r342743 (by romain): Add man page for dlvsym(3). Modified: stable/11/lib/libc/gen/Makefile.inc stable/11/lib/libc/gen/dlopen.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/Makefile.inc ============================================================================== --- stable/11/lib/libc/gen/Makefile.inc Fri May 22 13:14:21 2020 (r361380) +++ stable/11/lib/libc/gen/Makefile.inc Fri May 22 13:17:57 2020 (r361381) @@ -321,7 +321,8 @@ MLINKS+=dlopen.3 fdlopen.3 \ dlopen.3 dlclose.3 \ dlopen.3 dlerror.3 \ dlopen.3 dlfunc.3 \ - dlopen.3 dlsym.3 + dlopen.3 dlsym.3 \ + dlopen.3 dlvsym.3 MLINKS+=err.3 err_set_exit.3 \ err.3 err_set_file.3 \ err.3 errc.3 \ Modified: stable/11/lib/libc/gen/dlopen.3 ============================================================================== --- stable/11/lib/libc/gen/dlopen.3 Fri May 22 13:14:21 2020 (r361380) +++ stable/11/lib/libc/gen/dlopen.3 Fri May 22 13:17:57 2020 (r361381) @@ -32,13 +32,14 @@ .\" @(#) dlopen.3 1.6 90/01/31 SMI .\" $FreeBSD$ .\" -.Dd July 7, 2017 +.Dd January 2, 2019 .Dt DLOPEN 3 .Os .Sh NAME .Nm dlopen , .Nm fdlopen , .Nm dlsym , +.Nm dlvsym , .Nm dlfunc , .Nm dlerror , .Nm dlclose @@ -53,6 +54,8 @@ .Fn fdlopen "int fd" "int mode" .Ft void * .Fn dlsym "void * restrict handle" "const char * restrict symbol" +.Ft void * +.Fn dlvsym "void * restrict handle" "const char * restrict symbol" "const char * restrict version" .Ft dlfunc_t .Fn dlfunc "void * restrict handle" "const char * restrict symbol" .Ft char * @@ -74,7 +77,8 @@ provides access to the shared object in .Fa path , returning a descriptor that can be used for later references to the object in calls to -.Fn dlsym +.Fn dlsym , +.Fn dlvsym and .Fn dlclose . If @@ -300,6 +304,16 @@ condition which may be queried with .Fn dlerror . .Pp The +.Fn dlvsym +function behaves like +.Fn dlsym , +but takes an extra argument +.Fa version : +a null-terminated character string which is used to request a specific version +of +.Fa symbol . +.Pp +The .Fn dlfunc function implements all of the behavior of @@ -328,6 +342,7 @@ occurred during a call to .Fn dladdr , .Fn dlinfo , .Fn dlsym , +.Fn dlvsym , .Fn dlfunc , or .Fn dlclose . @@ -375,7 +390,10 @@ using the option to .Xr ld 1 for symbols defined in the executable to become visible to -.Fn dlsym . +.Fn dlsym , +.Fn dlvsym +or +.Fn dlfunc .Pp Other ELF platforms require linking with .Lb libdl @@ -397,6 +415,7 @@ The .Fn dlopen , .Fn fdlopen , .Fn dlsym , +.Fn dlvsym , and .Fn dlfunc functions From owner-svn-src-all@freebsd.org Fri May 22 13:18: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 B516A2C8BB2; Fri, 22 May 2020 13:18:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T6WS4MTgz4JX9; Fri, 22 May 2020 13:18:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90FB01F293; Fri, 22 May 2020 13:18:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MDIiSo077958; Fri, 22 May 2020 13:18:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MDIhi7077954; Fri, 22 May 2020 13:18:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005221318.04MDIhi7077954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 May 2020 13:18:43 +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: r361382 - in stable/11: include lib/libc/gen libexec/rtld-elf X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11: include lib/libc/gen libexec/rtld-elf X-SVN-Commit-Revision: 361382 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, 22 May 2020 13:18:44 -0000 Author: kib Date: Fri May 22 13:18:43 2020 New Revision: 361382 URL: https://svnweb.freebsd.org/changeset/base/361382 Log: MFC r361073: Implement RTLD_DEEPBIND. PR: 246462 Modified: stable/11/include/dlfcn.h stable/11/lib/libc/gen/dlopen.3 stable/11/libexec/rtld-elf/rtld.c stable/11/libexec/rtld-elf/rtld.h Directory Properties: stable/11/ (props changed) Modified: stable/11/include/dlfcn.h ============================================================================== --- stable/11/include/dlfcn.h Fri May 22 13:17:57 2020 (r361381) +++ stable/11/include/dlfcn.h Fri May 22 13:18:43 2020 (r361382) @@ -45,6 +45,8 @@ #define RTLD_TRACE 0x200 /* Trace loaded objects and exit. */ #define RTLD_NODELETE 0x01000 /* Do not remove members. */ #define RTLD_NOLOAD 0x02000 /* Do not load if not already loaded. */ +#define RTLD_DEEPBIND 0x04000 /* Put symbols from the dso ahead of + the global list */ /* * Request arguments for dlinfo(). Modified: stable/11/lib/libc/gen/dlopen.3 ============================================================================== --- stable/11/lib/libc/gen/dlopen.3 Fri May 22 13:17:57 2020 (r361381) +++ stable/11/lib/libc/gen/dlopen.3 Fri May 22 13:18:43 2020 (r361382) @@ -32,7 +32,7 @@ .\" @(#) dlopen.3 1.6 90/01/31 SMI .\" $FreeBSD$ .\" -.Dd January 2, 2019 +.Dd May 14, 2020 .Dt DLOPEN 3 .Os .Sh NAME @@ -162,6 +162,9 @@ the process address space, otherwise is returned. Other mode flags may be specified, which will be applied for promotion for the found object. +.It Dv RTLD_DEEPBIND +Symbols from the loaded library are put before global symbols when +resolving symbolic references originated from the library. .El .Pp If Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Fri May 22 13:17:57 2020 (r361381) +++ stable/11/libexec/rtld-elf/rtld.c Fri May 22 13:18:43 2020 (r361382) @@ -3300,6 +3300,8 @@ rtld_dlopen(const char *name, int fd, int mode) lo_flags |= RTLD_LO_NODELETE; if (mode & RTLD_NOLOAD) lo_flags |= RTLD_LO_NOLOAD; + if (mode & RTLD_DEEPBIND) + lo_flags |= RTLD_LO_DEEPBIND; if (ld_tracing != NULL) lo_flags |= RTLD_LO_TRACE; @@ -3351,6 +3353,8 @@ dlopen_object(const char *name, int fd, Obj_Entry *ref if (globallist_next(old_obj_tail) != NULL) { /* We loaded something new. */ assert(globallist_next(old_obj_tail) == obj); + if ((lo_flags & RTLD_LO_DEEPBIND) != 0) + obj->symbolic = true; result = 0; if ((lo_flags & RTLD_LO_EARLY) == 0 && obj->static_tls && !allocate_tls_offset(obj)) { Modified: stable/11/libexec/rtld-elf/rtld.h ============================================================================== --- stable/11/libexec/rtld-elf/rtld.h Fri May 22 13:17:57 2020 (r361381) +++ stable/11/libexec/rtld-elf/rtld.h Fri May 22 13:18:43 2020 (r361382) @@ -303,6 +303,7 @@ TAILQ_HEAD(obj_entry_q, Struct_Obj_Entry); #define RTLD_LO_FILTEES 0x10 /* Loading filtee. */ #define RTLD_LO_EARLY 0x20 /* Do not call ctors, postpone it to the initialization during the image start. */ +#define RTLD_LO_DEEPBIND 0x80 /* Force symbolic for this object */ /* * Symbol cache entry used during relocation to avoid multiple lookups From owner-svn-src-all@freebsd.org Fri May 22 13:27: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 8A0E02C89E2; Fri, 22 May 2020 13:27:03 +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 49T6j33NJZz4Jyg; Fri, 22 May 2020 13:27:03 +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 6F0331F2B8; Fri, 22 May 2020 13:27:03 +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 04MDR307083897; Fri, 22 May 2020 13:27:03 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MDR2WQ083890; Fri, 22 May 2020 13:27:02 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005221327.04MDR2WQ083890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 May 2020 13:27:02 +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: r361383 - in stable/12: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest cddl/contrib/opensolari... X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/12: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest cddl/contrib/opensolaris/lib/libzfs/common cddl/... X-SVN-Commit-Revision: 361383 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, 22 May 2020 13:27:03 -0000 Author: avg Date: Fri May 22 13:27:02 2020 New Revision: 361383 URL: https://svnweb.freebsd.org/changeset/base/361383 Log: MFC r354804,r354806,r354807,r354885: 10499 Multi-modifier protection (MMP) MFV r354378,r354379,r354386: 10499 Multi-modifier protection (MMP) 10499 Multi-modifier protection (MMP) illumos/illumos-gate@e0f1c0afa46cc84d4b1e40124032a9a87310386e https://github.com/illumos/illumos-gate/commit/e0f1c0afa46cc84d4b1e40124032a9a87310386e https://www.illumos.org/issues/10499 Port the following ZFS commits from ZoL to illumos. 379ca9cf2 Multi-modifier protection (MMP) bbffb59ef Fix multihost stale cache file import 0d398b256 Do not initiate MMP writes while pool is suspended 10701 Correct lock ASSERTs in vdev_label_read/write illumos/illumos-gate@58447f688d5e308373ab16a3b129bc0ba0fbc154 https://github.com/illumos/illumos-gate/commit/58447f688d5e308373ab16a3b129bc0ba0fbc154 https://www.illumos.org/issues/10701 Port of ZoL commit: 0091d66f4e Correct lock ASSERTs in vdev_label_read/write At a minimum, this fixes a blown assert during an MMP test run when running on a DEBUG build. 11770 additional mmp fixes illumos/illumos-gate@4348eb901228d2f8fa50bb132a34248e8662074e https://github.com/illumos/illumos-gate/commit/4348eb901228d2f8fa50bb132a34248e8662074e https://www.illumos.org/issues/11770 Port a few additional MMP fixes from ZoL that came in after our initial MMP port. 4ca457b065 ZTS: Fix mmp_interval failure ca95f70dff zpool import progress kstat (only minimal changes from above can be pulled in right now) 060f0226e6 MMP interval and fail_intervals in uberblock Note from the committer (me). I do not have any use for this feature and I have not tested it. I only did smoke testing with multihost=off. Please be aware. I merged the code only to make future merges easier. Since r354804 libzpool depends on libzfs for get_system_hostid symbol. Except for zstreamdump, all binaries linked with libzpool were already linked with libzfs. So, zstreamdump is the only fall-out. Added: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/mmp.c - copied unchanged from r354804, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/mmp.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/mmp.h - copied unchanged from r354804, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/mmp.h Modified: stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/12/cddl/contrib/opensolaris/cmd/zhack/zhack.c stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/12/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c stable/12/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/12/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h stable/12/cddl/lib/libzpool/Makefile stable/12/cddl/usr.bin/zstreamdump/Makefile stable/12/cddl/usr.bin/ztest/Makefile stable/12/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h 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/dsl_pool.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/uberblock.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/uberblock_impl.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/uberblock.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/12/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h stable/12/sys/conf/files Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri May 22 13:18:43 2020 (r361382) +++ stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri May 22 13:27:02 2020 (r361383) @@ -24,6 +24,7 @@ * Copyright (c) 2011, 2017 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2017 Nexenta Systems, Inc. + * Copyright (c) 2017, 2018 Lawrence Livermore National Security, LLC. * Copyright 2017 RackTop Systems. */ @@ -2436,6 +2437,26 @@ dump_uberblock(uberblock_t *ub, const char *header, co (void) printf("\tguid_sum = %llu\n", (u_longlong_t)ub->ub_guid_sum); (void) printf("\ttimestamp = %llu UTC = %s", (u_longlong_t)ub->ub_timestamp, asctime(localtime(×tamp))); + + (void) printf("\tmmp_magic = %016llx\n", + (u_longlong_t)ub->ub_mmp_magic); + if (MMP_VALID(ub)) { + (void) printf("\tmmp_delay = %0llu\n", + (u_longlong_t)ub->ub_mmp_delay); + if (MMP_SEQ_VALID(ub)) + (void) printf("\tmmp_seq = %u\n", + (unsigned int) MMP_SEQ(ub)); + if (MMP_FAIL_INT_VALID(ub)) + (void) printf("\tmmp_fail = %u\n", + (unsigned int) MMP_FAIL_INT(ub)); + if (MMP_INTERVAL_VALID(ub)) + (void) printf("\tmmp_write = %u\n", + (unsigned int) MMP_INTERVAL(ub)); + /* After MMP_* to make summarize_uberblock_mmp cleaner */ + (void) printf("\tmmp_valid = %x\n", + (unsigned int) ub->ub_mmp_config & 0xFF); + } + if (dump_opt['u'] >= 3) { char blkbuf[BP_SPRINTF_LEN]; snprintf_blkptr(blkbuf, sizeof (blkbuf), &ub->ub_rootbp); @@ -2534,6 +2555,12 @@ dump_label_uberblocks(vdev_label_t *lbl, uint64_t ashi if (uberblock_verify(ub)) continue; + + if ((dump_opt['u'] < 4) && + (ub->ub_mmp_magic == MMP_MAGIC) && ub->ub_mmp_delay && + (i >= VDEV_UBERBLOCK_COUNT(&vd) - MMP_BLOCKS_PER_LABEL)) + continue; + (void) snprintf(header, ZDB_MAX_UB_HEADER_SIZE, "Uberblock[%d]\n", i); dump_uberblock(ub, header, ""); @@ -4173,6 +4200,22 @@ verify_device_removal_feature_counts(spa_t *spa) return (ret); } +static void +zdb_set_skip_mmp(char *target) +{ + spa_t *spa; + + /* + * Disable the activity check to allow examination of + * active pools. + */ + mutex_enter(&spa_namespace_lock); + if ((spa = spa_lookup(target)) != NULL) { + spa->spa_import_flags |= ZFS_IMPORT_SKIP_MMP; + } + mutex_exit(&spa_namespace_lock); +} + #define BOGUS_SUFFIX "_CHECKPOINTED_UNIVERSE" /* * Import the checkpointed state of the pool specified by the target @@ -4207,6 +4250,7 @@ import_checkpointed_state(char *target, nvlist_t *cfg, } if (cfg == NULL) { + zdb_set_skip_mmp(poolname); error = spa_get_stats(poolname, &cfg, NULL, 0); if (error != 0) { fatal("Tried to read config of pool \"%s\" but " @@ -4219,7 +4263,8 @@ import_checkpointed_state(char *target, nvlist_t *cfg, fnvlist_add_string(cfg, ZPOOL_CONFIG_POOL_NAME, bogus_name); error = spa_import(bogus_name, cfg, NULL, - ZFS_IMPORT_MISSING_LOG | ZFS_IMPORT_CHECKPOINT); + ZFS_IMPORT_MISSING_LOG | ZFS_IMPORT_CHECKPOINT | + ZFS_IMPORT_SKIP_MMP); if (error != 0) { fatal("Tried to import pool \"%s\" but spa_import() failed " "with error %d\n", bogus_name, error); @@ -5222,90 +5267,6 @@ zdb_embedded_block(char *thing) free(buf); } -static boolean_t -pool_match(nvlist_t *cfg, char *tgt) -{ - uint64_t v, guid = strtoull(tgt, NULL, 0); - char *s; - - if (guid != 0) { - if (nvlist_lookup_uint64(cfg, ZPOOL_CONFIG_POOL_GUID, &v) == 0) - return (v == guid); - } else { - if (nvlist_lookup_string(cfg, ZPOOL_CONFIG_POOL_NAME, &s) == 0) - return (strcmp(s, tgt) == 0); - } - return (B_FALSE); -} - -static char * -find_zpool(char **target, nvlist_t **configp, int dirc, char **dirv) -{ - nvlist_t *pools; - nvlist_t *match = NULL; - char *name = NULL; - char *sepp = NULL; - char sep = '\0'; - int count = 0; - importargs_t args; - - bzero(&args, sizeof (args)); - args.paths = dirc; - args.path = dirv; - args.can_be_active = B_TRUE; - - if ((sepp = strpbrk(*target, "/@")) != NULL) { - sep = *sepp; - *sepp = '\0'; - } - - pools = zpool_search_import(g_zfs, &args); - - if (pools != NULL) { - nvpair_t *elem = NULL; - while ((elem = nvlist_next_nvpair(pools, elem)) != NULL) { - verify(nvpair_value_nvlist(elem, configp) == 0); - if (pool_match(*configp, *target)) { - count++; - if (match != NULL) { - /* print previously found config */ - if (name != NULL) { - (void) printf("%s\n", name); - dump_nvlist(match, 8); - name = NULL; - } - (void) printf("%s\n", - nvpair_name(elem)); - dump_nvlist(*configp, 8); - } else { - match = *configp; - name = nvpair_name(elem); - } - } - } - } - if (count > 1) - (void) fatal("\tMatched %d pools - use pool GUID " - "instead of pool name or \n" - "\tpool name part of a dataset name to select pool", count); - - if (sepp) - *sepp = sep; - /* - * If pool GUID was specified for pool id, replace it with pool name - */ - if (name && (strstr(*target, name) != *target)) { - int sz = 1 + strlen(name) + ((sepp) ? strlen(sepp) : 0); - - *target = umem_alloc(sz, UMEM_NOFAIL); - (void) snprintf(*target, sz, "%s%s", name, sepp ? sepp : ""); - } - - *configp = name ? match : NULL; - - return (name); -} - int main(int argc, char **argv) { @@ -5318,7 +5279,7 @@ main(int argc, char **argv) int error = 0; char **searchdirs = NULL; int nsearch = 0; - char *target; + char *target, *target_pool; nvlist_t *policy = NULL; uint64_t max_txg = UINT64_MAX; int flags = ZFS_IMPORT_MISSING_LOG; @@ -5526,22 +5487,48 @@ main(int argc, char **argv) error = 0; target = argv[0]; + if (strpbrk(target, "/@") != NULL) { + size_t targetlen; + + target_pool = strdup(target); + *strpbrk(target_pool, "/@") = '\0'; + + target_is_spa = B_FALSE; + targetlen = strlen(target); + if (targetlen && target[targetlen - 1] == '/') + target[targetlen - 1] = '\0'; + } else { + target_pool = target; + } + if (dump_opt['e']) { - char *name = find_zpool(&target, &cfg, nsearch, searchdirs); + importargs_t args = { 0 }; - error = ENOENT; - if (name) { - if (dump_opt['C'] > 1) { - (void) printf("\nConfiguration for import:\n"); - dump_nvlist(cfg, 8); - } + args.paths = nsearch; + args.path = searchdirs; + args.can_be_active = B_TRUE; + error = zpool_tryimport(g_zfs, target_pool, &cfg, &args); + + if (error == 0) { + if (nvlist_add_nvlist(cfg, ZPOOL_LOAD_POLICY, policy) != 0) { fatal("can't open '%s': %s", target, strerror(ENOMEM)); } - error = spa_import(name, cfg, NULL, flags); + + if (dump_opt['C'] > 1) { + (void) printf("\nConfiguration for import:\n"); + dump_nvlist(cfg, 8); + } + + /* + * Disable the activity check to allow examination of + * active pools. + */ + error = spa_import(target_pool, cfg, NULL, + flags | ZFS_IMPORT_SKIP_MMP); } } @@ -5556,21 +5543,6 @@ main(int argc, char **argv) } - if (strpbrk(target, "/@") != NULL) { - size_t targetlen; - - target_is_spa = B_FALSE; - /* - * Remove any trailing slash. Later code would get confused - * by it, but we want to allow it so that "pool/" can - * indicate that we want to dump the topmost filesystem, - * rather than the whole pool. - */ - targetlen = strlen(target); - if (targetlen != 0 && target[targetlen - 1] == '/') - target[targetlen - 1] = '\0'; - } - if (error == 0) { if (dump_opt['k'] && (target_is_spa || dump_opt['R'])) { ASSERT(checkpoint_pool != NULL); @@ -5584,6 +5556,7 @@ main(int argc, char **argv) } } else if (target_is_spa || dump_opt['R']) { + zdb_set_skip_mmp(target); error = spa_open_rewind(target, &spa, FTAG, policy, NULL); if (error) { @@ -5606,6 +5579,7 @@ main(int argc, char **argv) } } } else { + zdb_set_skip_mmp(target); error = open_objset(target, DMU_OST_ANY, FTAG, &os); } } Modified: stable/12/cddl/contrib/opensolaris/cmd/zhack/zhack.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zhack/zhack.c Fri May 22 13:18:43 2020 (r361382) +++ stable/12/cddl/contrib/opensolaris/cmd/zhack/zhack.c Fri May 22 13:27:02 2020 (r361383) @@ -121,16 +121,11 @@ space_delta_cb(dmu_object_type_t bonustype, void *data * Target is the dataset whose pool we want to open. */ static void -import_pool(const char *target, boolean_t readonly) +zhack_import(char *target, boolean_t readonly) { nvlist_t *config; - nvlist_t *pools; - int error; - char *sepp; - spa_t *spa; - nvpair_t *elem; nvlist_t *props; - const char *name; + int error; kernel_init(readonly ? FREAD : (FREAD | FWRITE)); g_zfs = libzfs_init(); @@ -139,68 +134,40 @@ import_pool(const char *target, boolean_t readonly) dmu_objset_register_type(DMU_OST_ZFS, space_delta_cb); g_readonly = readonly; - - /* - * If we only want readonly access, it's OK if we find - * a potentially-active (ie, imported into the kernel) pool from the - * default cachefile. - */ - if (readonly && spa_open(target, &spa, FTAG) == 0) { - spa_close(spa, FTAG); - return; - } - g_importargs.unique = B_TRUE; g_importargs.can_be_active = readonly; g_pool = strdup(target); - if ((sepp = strpbrk(g_pool, "/@")) != NULL) - *sepp = '\0'; - g_importargs.poolname = g_pool; - pools = zpool_search_import(g_zfs, &g_importargs); - if (nvlist_empty(pools)) { - if (!g_importargs.can_be_active) { - g_importargs.can_be_active = B_TRUE; - if (zpool_search_import(g_zfs, &g_importargs) != NULL || - spa_open(target, &spa, FTAG) == 0) { - fatal(spa, FTAG, "cannot import '%s': pool is " - "active; run " "\"zpool export %s\" " - "first\n", g_pool, g_pool); - } - } + error = zpool_tryimport(g_zfs, target, &config, &g_importargs); + if (error) + fatal(NULL, FTAG, "cannot import '%s': %s", target, + libzfs_error_description(g_zfs)); - fatal(NULL, FTAG, "cannot import '%s': no such pool " - "available\n", g_pool); - } - - elem = nvlist_next_nvpair(pools, NULL); - name = nvpair_name(elem); - verify(nvpair_value_nvlist(elem, &config) == 0); - props = NULL; if (readonly) { - verify(nvlist_alloc(&props, NV_UNIQUE_NAME, 0) == 0); - verify(nvlist_add_uint64(props, + VERIFY(nvlist_alloc(&props, NV_UNIQUE_NAME, 0) == 0); + VERIFY(nvlist_add_uint64(props, zpool_prop_to_name(ZPOOL_PROP_READONLY), 1) == 0); } zfeature_checks_disable = B_TRUE; - error = spa_import(name, config, props, ZFS_IMPORT_NORMAL); + error = spa_import(target, config, props, + (readonly ? ZFS_IMPORT_SKIP_MMP : ZFS_IMPORT_NORMAL)); zfeature_checks_disable = B_FALSE; if (error == EEXIST) error = 0; if (error) - fatal(NULL, FTAG, "can't import '%s': %s", name, + fatal(NULL, FTAG, "can't import '%s': %s", target, strerror(error)); } static void -zhack_spa_open(const char *target, boolean_t readonly, void *tag, spa_t **spa) +zhack_spa_open(char *target, boolean_t readonly, void *tag, spa_t **spa) { int err; - import_pool(target, readonly); + zhack_import(target, readonly); zfeature_checks_disable = B_TRUE; err = spa_open(target, spa, tag); Modified: stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri May 22 13:18:43 2020 (r361382) +++ stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri May 22 13:27:02 2020 (r361383) @@ -481,6 +481,11 @@ If a pool has a shared spare that is currently being u exported since other pools may use this shared spare, which may lead to potential data corruption. .Pp +Shared spares add some risk. +If the pools are imported on different hosts, and both pools suffer a device +failure at the same time, both could attempt to use the spare at the same time. +This may not be detected, resulting in data corruption. +.Pp An in-progress spare replacement can be cancelled by detaching the hot spare. If the original faulted device is detached, then the hot spare assumes its place in the configuration, and is removed from the spare list of all active @@ -806,7 +811,7 @@ to the enabled state. See .Xr zpool-features 7 for details on feature states. -.It Sy listsnaps Ns = Ns Cm on No | Cm off +.It Sy listsnapshots Ns = Ns Cm on No | Cm off Controls whether information about snapshots associated with this pool is output when .Qq Nm zfs Cm list @@ -814,6 +819,31 @@ is run without the .Fl t option. The default value is .Cm off . +This property can also be referred to by its shortened name, +.Sy listsnaps . +.It Sy multihost Ns = Ns Sy on No | Sy off +Controls whether a pool activity check should be performed during +.Nm zpool Cm import . +When a pool is determined to be active it cannot be imported, even with the +.Fl f +option. +This property is intended to be used in failover configurations +where multiple hosts have access to a pool on shared storage. +.Pp +Multihost provides protection on import only. +It does not protect against an +individual device being used in multiple pools, regardless of the type of vdev. +See the discussion under +.Sy zpool create. +.Pp +When this property is on, periodic writes to storage occur to show the pool is +in use. +See +.Sy vfs.zfs.multihost_interval +sysctl. +In order to enable this property each host must set a unique hostid. +The default value is +.Sy off . .It Sy version Ns = Ns Ar version The current on-disk version of the pool. This can be increased, but never decreased. The preferred method of updating pools is with the @@ -941,9 +971,14 @@ Discards an existing checkpoint from .Op Ar device .Xc .Pp -Clears device errors in a pool. If no arguments are specified, all device -errors within the pool are cleared. If one or more devices is specified, only -those errors associated with the specified device or devices are cleared. +Clears device errors in a pool. +If no arguments are specified, all device errors within the pool are cleared. +If one or more devices is specified, only those errors associated with the +specified device or devices are cleared. +If multihost is enabled, and the pool has been suspended, this will not +resume I/O. +While the pool was suspended, it may have been imported on +another host, and resuming I/O could result in pool damage. .Bl -tag -width indent .It Fl F Initiates recovery mode for an unopenable pool. Attempts to discard the last @@ -980,14 +1015,28 @@ specification is described in the .Qq Sx Virtual Devices section. .Pp -The command verifies that each device specified is accessible and not currently -in use by another subsystem. There are some uses, such as being currently -mounted, or specified as the dedicated dump device, that prevents a device from -ever being used by -.Tn ZFS -Other uses, such as having a preexisting -.Sy UFS -file system, can be overridden with the +The command attempts to verify that each device specified is accessible and not +currently in use by another subsystem. +However this check is not robust enough +to detect simultaneous attempts to use a new device in different pools, even if +.Sy multihost +is +.Sy enabled. +The +administrator must ensure that simultaneous invocations of any combination of +.Sy zpool replace , +.Sy zpool create , +.Sy zpool add , +or +.Sy zpool labelclear , +do not refer to the same device. +Using the same device in two pools will +result in pool corruption. +.Pp +There are some uses, such as being currently mounted, or specified as the +dedicated dump device, that prevents a device from ever being used by ZFS. +Other uses, such as having a preexisting UFS file system, can be overridden +with the .Fl f option. .Pp @@ -1642,7 +1691,7 @@ devices in this pool are online and healthy before per Removes the specified device from the pool. This command currently only supports removing hot spares, cache, log devices and mirrored top-level vdevs (mirror of leaf devices); but not raidz. -.sp +.Pp Removing a top-level vdev reduces the total amount of space in the storage pool. The specified device will be evacuated by copying all allocated space from it to the other devices in the pool. Modified: stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri May 22 13:18:43 2020 (r361382) +++ stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri May 22 13:27:02 2020 (r361383) @@ -53,6 +53,7 @@ #include #include #include +#include #include @@ -1637,6 +1638,10 @@ print_status_config(zpool_handle_t *zhp, const char *n (void) printf(gettext("split into new pool")); break; + case VDEV_AUX_ACTIVE: + (void) printf(gettext("currently in use")); + break; + case VDEV_AUX_CHILDREN_OFFLINE: (void) printf(gettext("all children offline")); break; @@ -1771,6 +1776,10 @@ print_import_config(const char *name, nvlist_t *nv, in (void) printf(gettext("too many errors")); break; + case VDEV_AUX_ACTIVE: + (void) printf(gettext("currently in use")); + break; + case VDEV_AUX_CHILDREN_OFFLINE: (void) printf(gettext("all children offline")); break; @@ -1868,8 +1877,10 @@ show_import(nvlist_t *config) vdev_stat_t *vs; char *name; uint64_t guid; + uint64_t hostid = 0; char *msgid; - nvlist_t *nvroot; + char *hostname = "unknown"; + nvlist_t *nvroot, *nvinfo; int reason; const char *health; uint_t vsc; @@ -1956,6 +1967,17 @@ show_import(nvlist_t *config) zpool_print_unsup_feat(config); break; + case ZPOOL_STATUS_HOSTID_ACTIVE: + (void) printf(gettext(" status: The pool is currently " + "imported by another system.\n")); + break; + + case ZPOOL_STATUS_HOSTID_REQUIRED: + (void) printf(gettext(" status: The pool has the " + "multihost property on. It cannot\n\tbe safely imported " + "when the system hostid is not set.\n")); + break; + case ZPOOL_STATUS_HOSTID_MISMATCH: (void) printf(gettext(" status: The pool was last accessed by " "another system.\n")); @@ -2042,6 +2064,27 @@ show_import(nvlist_t *config) "imported. Attach the missing\n\tdevices and try " "again.\n")); break; + case ZPOOL_STATUS_HOSTID_ACTIVE: + VERIFY0(nvlist_lookup_nvlist(config, + ZPOOL_CONFIG_LOAD_INFO, &nvinfo)); + + if (nvlist_exists(nvinfo, ZPOOL_CONFIG_MMP_HOSTNAME)) + hostname = fnvlist_lookup_string(nvinfo, + ZPOOL_CONFIG_MMP_HOSTNAME); + + if (nvlist_exists(nvinfo, ZPOOL_CONFIG_MMP_HOSTID)) + hostid = fnvlist_lookup_uint64(nvinfo, + ZPOOL_CONFIG_MMP_HOSTID); + + (void) printf(gettext(" action: The pool must be " + "exported from %s (hostid=%lx)\n\tbefore it " + "can be safely imported.\n"), hostname, + (unsigned long) hostid); + break; + case ZPOOL_STATUS_HOSTID_REQUIRED: + (void) printf(gettext(" action: Check the SMF " + "svc:/system/hostid service.\n")); + break; default: (void) printf(gettext(" action: The pool cannot be " "imported due to damaged devices or data.\n")); @@ -2089,6 +2132,31 @@ show_import(nvlist_t *config) } } +static boolean_t +zfs_force_import_required(nvlist_t *config) +{ + uint64_t state; + uint64_t hostid = 0; + nvlist_t *nvinfo; + + state = fnvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_STATE); + (void) nvlist_lookup_uint64(config, ZPOOL_CONFIG_HOSTID, &hostid); + + if (state != POOL_STATE_EXPORTED && hostid != get_system_hostid()) + return (B_TRUE); + + nvinfo = fnvlist_lookup_nvlist(config, ZPOOL_CONFIG_LOAD_INFO); + if (nvlist_exists(nvinfo, ZPOOL_CONFIG_MMP_STATE)) { + mmp_state_t mmp_state = fnvlist_lookup_uint64(nvinfo, + ZPOOL_CONFIG_MMP_STATE); + + if (mmp_state != MMP_STATE_INACTIVE) + return (B_TRUE); + } + + return (B_FALSE); +} + /* * Perform the import for the given configuration. This passes the heavy * lifting off to zpool_import_props(), and then mounts the datasets contained @@ -2100,53 +2168,73 @@ do_import(nvlist_t *config, const char *newname, const { zpool_handle_t *zhp; char *name; - uint64_t state; uint64_t version; - verify(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME, - &name) == 0); + name = fnvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME); + version = fnvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION); - verify(nvlist_lookup_uint64(config, - ZPOOL_CONFIG_POOL_STATE, &state) == 0); - verify(nvlist_lookup_uint64(config, - ZPOOL_CONFIG_VERSION, &version) == 0); if (!SPA_VERSION_IS_SUPPORTED(version)) { (void) fprintf(stderr, gettext("cannot import '%s': pool " "is formatted using an unsupported ZFS version\n"), name); return (1); - } else if (state != POOL_STATE_EXPORTED && + } else if (zfs_force_import_required(config) && !(flags & ZFS_IMPORT_ANY_HOST)) { - uint64_t hostid; + mmp_state_t mmp_state = MMP_STATE_INACTIVE; + nvlist_t *nvinfo; - if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_HOSTID, - &hostid) == 0) { - if ((unsigned long)hostid != gethostid()) { - char *hostname; - uint64_t timestamp; - time_t t; + nvinfo = fnvlist_lookup_nvlist(config, ZPOOL_CONFIG_LOAD_INFO); + if (nvlist_exists(nvinfo, ZPOOL_CONFIG_MMP_STATE)) + mmp_state = fnvlist_lookup_uint64(nvinfo, + ZPOOL_CONFIG_MMP_STATE); - verify(nvlist_lookup_string(config, - ZPOOL_CONFIG_HOSTNAME, &hostname) == 0); - verify(nvlist_lookup_uint64(config, - ZPOOL_CONFIG_TIMESTAMP, ×tamp) == 0); - t = timestamp; - (void) fprintf(stderr, gettext("cannot import " - "'%s': pool may be in use from other " - "system, it was last accessed by %s " - "(hostid: 0x%lx) on %s"), name, hostname, - (unsigned long)hostid, - asctime(localtime(&t))); - (void) fprintf(stderr, gettext("use '-f' to " - "import anyway\n")); - return (1); - } + if (mmp_state == MMP_STATE_ACTIVE) { + char *hostname = ""; + uint64_t hostid = 0; + + if (nvlist_exists(nvinfo, ZPOOL_CONFIG_MMP_HOSTNAME)) + hostname = fnvlist_lookup_string(nvinfo, + ZPOOL_CONFIG_MMP_HOSTNAME); + + if (nvlist_exists(nvinfo, ZPOOL_CONFIG_MMP_HOSTID)) + hostid = fnvlist_lookup_uint64(nvinfo, + ZPOOL_CONFIG_MMP_HOSTID); + + (void) fprintf(stderr, gettext("cannot import '%s': " + "pool is imported on %s (hostid: " + "0x%lx)\nExport the pool on the other system, " + "then run 'zpool import'.\n"), + name, hostname, (unsigned long) hostid); + } else if (mmp_state == MMP_STATE_NO_HOSTID) { + (void) fprintf(stderr, gettext("Cannot import '%s': " + "pool has the multihost property on and the\n" + "system's hostid is not set.\n"), name); } else { + char *hostname = ""; + uint64_t timestamp = 0; + uint64_t hostid = 0; + + if (nvlist_exists(config, ZPOOL_CONFIG_HOSTNAME)) + hostname = fnvlist_lookup_string(config, + ZPOOL_CONFIG_HOSTNAME); + + if (nvlist_exists(config, ZPOOL_CONFIG_TIMESTAMP)) + timestamp = fnvlist_lookup_uint64(config, + ZPOOL_CONFIG_TIMESTAMP); + + if (nvlist_exists(config, ZPOOL_CONFIG_HOSTID)) + hostid = fnvlist_lookup_uint64(config, + ZPOOL_CONFIG_HOSTID); + (void) fprintf(stderr, gettext("cannot import '%s': " - "pool may be in use from other system\n"), name); - (void) fprintf(stderr, gettext("use '-f' to import " - "anyway\n")); - return (1); + "pool was previously in use from another system.\n" + "Last accessed by %s (hostid=%lx) at %s" + "The pool can be imported, use 'zpool import -f' " + "to import the pool.\n"), name, hostname, + (unsigned long)hostid, ctime((time_t *)×tamp)); + } + + return (1); } if (zpool_import_props(g_zfs, config, newname, props, flags) != 0) @@ -5108,6 +5196,15 @@ status_callback(zpool_handle_t *zhp, void *data) "from a backup source. Manually marking the device\n" "\trepaired using 'zpool clear' may allow some data " "to be recovered.\n")); + break; + + case ZPOOL_STATUS_IO_FAILURE_MMP: + (void) printf(gettext("status: The pool is suspended because " + "multihost writes failed or were delayed;\n\tanother " + "system could import the pool undetected.\n")); + (void) printf(gettext("action: Make sure the pool's devices " + "are connected, then reboot your system and\n\timport the " + "pool.\n")); break; case ZPOOL_STATUS_IO_FAILURE_WAIT: Modified: stable/12/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri May 22 13:18:43 2020 (r361382) +++ stable/12/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri May 22 13:27:02 2020 (r361383) @@ -128,6 +128,7 @@ #include #include #include +#include #include static int ztest_fd_data = -1; @@ -166,6 +167,7 @@ typedef struct ztest_shared_opts { uint64_t zo_time; uint64_t zo_maxloops; uint64_t zo_metaslab_force_ganging; + int zo_mmp_test; } ztest_shared_opts_t; static const ztest_shared_opts_t ztest_opts_defaults = { @@ -184,6 +186,7 @@ static const ztest_shared_opts_t ztest_opts_defaults = .zo_passtime = 60, /* 60 seconds */ .zo_killrate = 70, /* 70% kill rate */ .zo_verbose = 0, + .zo_mmp_test = 0, .zo_init = 1, .zo_time = 300, /* 5 minutes */ .zo_maxloops = 50, /* max loops during spa_freeze() */ @@ -343,6 +346,7 @@ ztest_func_t ztest_spa_create_destroy; ztest_func_t ztest_fault_inject; ztest_func_t ztest_ddt_repair; ztest_func_t ztest_dmu_snapshot_hold; +ztest_func_t ztest_mmp_enable_disable; ztest_func_t ztest_scrub; ztest_func_t ztest_dsl_dataset_promote_busy; ztest_func_t ztest_vdev_attach_detach; @@ -388,6 +392,7 @@ ztest_info_t ztest_info[] = { { ztest_fault_inject, 1, &zopt_incessant }, { ztest_ddt_repair, 1, &zopt_sometimes }, { ztest_dmu_snapshot_hold, 1, &zopt_sometimes }, + { ztest_mmp_enable_disable, 1, &zopt_sometimes }, { ztest_reguid, 1, &zopt_rarely }, { ztest_scrub, 1, &zopt_often }, { ztest_spa_upgrade, 1, &zopt_rarely }, @@ -601,6 +606,7 @@ usage(boolean_t requested) "\t[-k kill_percentage (default: %llu%%)]\n" "\t[-p pool_name (default: %s)]\n" "\t[-f dir (default: %s)] file directory for vdev files\n" + "\t[-M] Multi-host simulate pool imported on remote host\n" "\t[-V] verbose (use multiple times for ever more blather)\n" "\t[-E] use existing pool instead of creating new one\n" "\t[-T time (default: %llu sec)] total run time\n" @@ -644,7 +650,7 @@ process_options(int argc, char **argv) bcopy(&ztest_opts_defaults, zo, sizeof (*zo)); while ((opt = getopt(argc, argv, - "v:s:a:m:r:R:d:t:g:i:k:p:f:VET:P:hF:B:o:")) != EOF) { + "v:s:a:m:r:R:d:t:g:i:k:p:f:MVET:P:hF:B:o:")) != EOF) { value = 0; switch (opt) { case 'v': @@ -713,6 +719,9 @@ process_options(int argc, char **argv) sizeof (zo->zo_dir)); } break; + case 'M': + zo->zo_mmp_test = 1; + break; case 'V': zo->zo_verbose++; break; @@ -2480,6 +2489,9 @@ ztest_spa_create_destroy(ztest_ds_t *zd, uint64_t id) spa_t *spa; nvlist_t *nvroot; + if (zo->zo_mmp_test) + return; + /* * Attempt to create using a bad file. */ @@ -2511,8 +2523,58 @@ ztest_spa_create_destroy(ztest_ds_t *zd, uint64_t id) rw_exit(&ztest_name_lock); } +/* + * Start and then stop the MMP threads to ensure the startup and shutdown code + * works properly. Actual protection and property-related code tested via ZTS. + */ /* ARGSUSED */ void +ztest_mmp_enable_disable(ztest_ds_t *zd, uint64_t id) +{ + ztest_shared_opts_t *zo = &ztest_opts; + spa_t *spa = ztest_spa; + + if (zo->zo_mmp_test) + return; + + /* + * Since enabling MMP involves setting a property, it could not be done + * while the pool is suspended. + */ + if (spa_suspended(spa)) + return; + + spa_config_enter(spa, SCL_CONFIG, FTAG, RW_READER); + mutex_enter(&spa->spa_props_lock); + + zfs_multihost_fail_intervals = 0; + + if (!spa_multihost(spa)) { + spa->spa_multihost = B_TRUE; + mmp_thread_start(spa); + } + + mutex_exit(&spa->spa_props_lock); + spa_config_exit(spa, SCL_CONFIG, FTAG); + + txg_wait_synced(spa_get_dsl(spa), 0); + mmp_signal_all_threads(); + txg_wait_synced(spa_get_dsl(spa), 0); + + spa_config_enter(spa, SCL_CONFIG, FTAG, RW_READER); + mutex_enter(&spa->spa_props_lock); + + if (spa_multihost(spa)) { + mmp_thread_stop(spa); + spa->spa_multihost = B_FALSE; + } + + mutex_exit(&spa->spa_props_lock); + spa_config_exit(spa, SCL_CONFIG, FTAG); +} + +/* ARGSUSED */ +void ztest_spa_upgrade(ztest_ds_t *zd, uint64_t id) { spa_t *spa; @@ -2521,6 +2583,9 @@ ztest_spa_upgrade(ztest_ds_t *zd, uint64_t id) nvlist_t *nvroot, *props; char *name; + if (ztest_opts.zo_mmp_test) + return; + mutex_enter(&ztest_vdev_lock); name = kmem_asprintf("%s_upgrade", ztest_opts.zo_pool); @@ -2689,6 +2754,9 @@ ztest_vdev_add_remove(ztest_ds_t *zd, uint64_t id) nvlist_t *nvroot; int error; + if (ztest_opts.zo_mmp_test) + return; + mutex_enter(&ztest_vdev_lock); leaves = MAX(zs->zs_mirrors + zs->zs_splits, 1) * ztest_opts.zo_raidz; @@ -2771,6 +2839,9 @@ ztest_vdev_aux_add_remove(ztest_ds_t *zd, uint64_t id) uint64_t guid = 0; int error; + if (ztest_opts.zo_mmp_test) + return; + if (ztest_random(2) == 0) { sav = &spa->spa_spares; aux = ZPOOL_CONFIG_SPARES; @@ -2866,6 +2937,9 @@ ztest_split_pool(ztest_ds_t *zd, uint64_t id) uint_t c, children, schildren = 0, lastlogid = 0; int error = 0; + if (ztest_opts.zo_mmp_test) + return; + mutex_enter(&ztest_vdev_lock); /* ensure we have a useable config; mirrors of raidz aren't supported */ @@ -2972,6 +3046,9 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id) int oldvd_is_log; int error, expected_error; + if (ztest_opts.zo_mmp_test) + return; + mutex_enter(&ztest_vdev_lock); leaves = MAX(zs->zs_mirrors, 1) * ztest_opts.zo_raidz; @@ -5564,6 +5641,9 @@ ztest_reguid(ztest_ds_t *zd, uint64_t id) uint64_t orig, load; int error; + if (ztest_opts.zo_mmp_test) + return; + orig = spa_guid(spa); load = spa_load_guid(spa); @@ -6249,7 +6329,7 @@ ztest_run(ztest_shared_t *zs) * Verify that we can export the pool and reimport it under a * different name. */ - if (ztest_random(2) == 0) { + if ((ztest_random(2) == 0) && !ztest_opts.zo_mmp_test) { char name[ZFS_MAX_DATASET_NAME_LEN]; (void) snprintf(name, sizeof (name), "%s_import", ztest_opts.zo_pool); @@ -6398,6 +6478,56 @@ make_random_props() } /* + * Import a storage pool with the given name. + */ +static void +ztest_import(ztest_shared_t *zs) +{ + libzfs_handle_t *hdl; + importargs_t args = { 0 }; + spa_t *spa; + nvlist_t *cfg = NULL; + int nsearch = 1; + char *searchdirs[nsearch]; + char *name = ztest_opts.zo_pool; + int flags = ZFS_IMPORT_MISSING_LOG; + int error; + + mutex_init(&ztest_vdev_lock, NULL, MUTEX_DEFAULT, NULL); + rw_init(&ztest_name_lock, NULL, USYNC_THREAD, NULL); + + kernel_init(FREAD | FWRITE); + hdl = libzfs_init(); + + searchdirs[0] = ztest_opts.zo_dir; + args.paths = nsearch; + args.path = searchdirs; + args.can_be_active = B_FALSE; + + error = zpool_tryimport(hdl, name, &cfg, &args); + if (error) + (void) fatal(0, "No pools found\n"); + + VERIFY0(spa_import(name, cfg, NULL, flags)); + VERIFY0(spa_open(name, &spa, FTAG)); + zs->zs_metaslab_sz = + 1ULL << spa->spa_root_vdev->vdev_child[0]->vdev_ms_shift; + spa_close(spa, FTAG); + + libzfs_fini(hdl); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri May 22 14:46: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 826642CAD02; Fri, 22 May 2020 14:46:24 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T8Sc2g9Vz4P1J; Fri, 22 May 2020 14:46:24 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56DE22003F; Fri, 22 May 2020 14:46:24 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MEkONq033250; Fri, 22 May 2020 14:46:24 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MEkO7f033249; Fri, 22 May 2020 14:46:24 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <202005221446.04MEkO7f033249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 22 May 2020 14:46:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361384 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 361384 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, 22 May 2020 14:46:24 -0000 Author: jilles Date: Fri May 22 14:46:23 2020 New Revision: 361384 URL: https://svnweb.freebsd.org/changeset/base/361384 Log: sh: Remove a comment that was obsoleted by r358152 Since r358152, the read builtin has used a buffer. Also, remove a space at the end of the line in a comment. No functional change is intended. Modified: head/bin/sh/miscbltin.c Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Fri May 22 13:27:02 2020 (r361383) +++ head/bin/sh/miscbltin.c Fri May 22 14:46:23 2020 (r361384) @@ -124,7 +124,7 @@ fdctx_destroy(struct fdctx *fdc) * Reposition the file offset. Here is the layout of buf: * * | off - * v + * v * |*****************|-------| * buf ep buf+buflen * |<- residue ->| @@ -142,8 +142,6 @@ fdctx_destroy(struct fdctx *fdc) /* * The read builtin. The -r option causes backslashes to be treated like * ordinary characters. - * - * This uses unbuffered input, which may be avoidable in some cases. * * Note that if IFS=' :' then read x y should work so that: * 'a b' x='a', y='b' From owner-svn-src-all@freebsd.org Fri May 22 15:11: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 1F5082CB35F; Fri, 22 May 2020 15:11:14 +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 49T91F4t9Nz4QSl; Fri, 22 May 2020 15:11:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 04MFAxtE077205 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 22 May 2020 18:11:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 04MFAxtE077205 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 04MFAx27077204; Fri, 22 May 2020 18:10:59 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 22 May 2020 18:10:59 +0300 From: Konstantin Belousov To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r361352 - in head/sys: amd64/amd64 i386/i386 Message-ID: <20200522151059.GK64045@kib.kiev.ua> References: <202005220118.04M1ItwO032876@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202005220118.04M1ItwO032876@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: 49T91F4t9Nz4QSl X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, 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: Fri, 22 May 2020 15:11:14 -0000 On Fri, May 22, 2020 at 01:18:55AM +0000, Mark Johnston wrote: > Author: markj > Date: Fri May 22 01:18:55 2020 > New Revision: 361352 > URL: https://svnweb.freebsd.org/changeset/base/361352 > > Log: > Fix the build after r361033 when ACPI is disabled. What is the sense in doing this for amd64 ? I doubt that we can boot with ACPI disabled. > > Reported by: Herbert J. Skuhra > > Modified: > head/sys/amd64/amd64/mp_machdep.c > head/sys/i386/i386/mp_machdep.c > > Modified: head/sys/amd64/amd64/mp_machdep.c > ============================================================================== > --- head/sys/amd64/amd64/mp_machdep.c Fri May 22 00:00:55 2020 (r361351) > +++ head/sys/amd64/amd64/mp_machdep.c Fri May 22 01:18:55 2020 (r361352) > @@ -29,6 +29,7 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include "opt_acpi.h" > #include "opt_cpu.h" > #include "opt_ddb.h" > #include "opt_kstack_pages.h" > @@ -78,8 +79,10 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#ifdef DEV_ACPI > #include > #include > +#endif > > #define WARMBOOT_TARGET 0 > #define WARMBOOT_OFF (KERNBASE + 0x0467) > @@ -265,7 +268,9 @@ cpu_mp_start(void) > > set_interrupt_apic_ids(); > > +#if defined(DEV_ACPI) && MAXMEMDOM > 1 > acpi_pxm_set_cpu_locality(); > +#endif > } > > /* > > Modified: head/sys/i386/i386/mp_machdep.c > ============================================================================== > --- head/sys/i386/i386/mp_machdep.c Fri May 22 00:00:55 2020 (r361351) > +++ head/sys/i386/i386/mp_machdep.c Fri May 22 01:18:55 2020 (r361352) > @@ -28,6 +28,7 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include "opt_acpi.h" > #include "opt_apic.h" > #include "opt_cpu.h" > #include "opt_kstack_pages.h" > @@ -83,8 +84,10 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#ifdef DEV_ACPI > #include > #include > +#endif > > #define WARMBOOT_TARGET 0 > #define WARMBOOT_OFF (PMAP_MAP_LOW + 0x0467) > @@ -202,7 +205,7 @@ cpu_mp_start(void) > > set_interrupt_apic_ids(); > > -#if MAXMEMDOM > 1 > +#if defined(DEV_ACPI) && MAXMEMDOM > 1 > acpi_pxm_set_cpu_locality(); > #endif > } From owner-svn-src-all@freebsd.org Fri May 22 15:15: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 E982C2CB51F; Fri, 22 May 2020 15:15:43 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) (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 49T96R4nlGz4Qs7; Fri, 22 May 2020 15:15:43 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f42.google.com with SMTP id h7so8492140otr.3; Fri, 22 May 2020 08:15:43 -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:reply-to :from:date:message-id:subject:to:cc; bh=e1/Dmks/v/RA9RP/XSf7ki7g1Ee51JEZmUdsDTZXj0w=; b=VZVvPx2tEHZLblsbdVvFo8WhUnfoi2raRaUg0rXJ+r/aDu9fKgHJcDoyTporKSCNss ZBmMsqx1JK8xgsMQOk2h5Tg0j9sN7zAnbOmtZLpNvnhexD8YtajQRFURmcZnOvXXaW9T X3cqbY0zT89v5CLahl+BJzNJ3ksYTE1/VIKnZPJr1hToJMP2SpUDYdl01YZ6lgs7nZuD x9fGjKWL1W5tQpGMDg7tcmNp/jqDe/9E8cEdtwuvmkVdkMQIyk2Adkubr7iU5DLpgZgI iqAw/uj+QPJl222I98TFv2MJ0Eg+ceIkcbzTal9NUklIZ1pJVLdGGcjJDhqw0YJsIuA5 /P/Q== X-Gm-Message-State: AOAM5321/oe233nMR0eYL1g7vQYQ3WSkV+xlWDXSRQNr2/vSpm91mEAi qtzDJVeOhpth69eQfT/+LU/dgqce X-Google-Smtp-Source: ABdhPJxcG9Kom0l9f1S9jHKPQmHZeqr+rMJhlQE/M8Id++zSKvXop4ETOoB3lw7SSOolMjpe8k928w== X-Received: by 2002:a9d:70d4:: with SMTP id w20mr11469684otj.179.1590160541458; Fri, 22 May 2020 08:15:41 -0700 (PDT) Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com. [209.85.167.181]) by smtp.gmail.com with ESMTPSA id p67sm2646568oic.46.2020.05.22.08.15.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 May 2020 08:15:41 -0700 (PDT) Received: by mail-oi1-f181.google.com with SMTP id l6so9569517oic.9; Fri, 22 May 2020 08:15:41 -0700 (PDT) X-Received: by 2002:aca:eb96:: with SMTP id j144mr2746581oih.48.1590160540784; Fri, 22 May 2020 08:15:40 -0700 (PDT) MIME-Version: 1.0 References: <202005221120.04MBKOiH003190@repo.freebsd.org> In-Reply-To: <202005221120.04MBKOiH003190@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Fri, 22 May 2020 08:15:29 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361363 - in head/lib/libprocstat: . zfs To: Andriy Gapon Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49T96R4nlGz4Qs7 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, 22 May 2020 15:15:44 -0000 Hi Andriy, Would it make sense to also export sizes of those members? Currently the code assumes the members may be relocated in the struct, but never changed in size. If they can be moved around, maybe they might be enlarged or shrunk at some time too? Maybe not; I am not very familiar with ZFS. Best, Conrad On Fri, May 22, 2020 at 4:20 AM Andriy Gapon wrote: > > Author: avg > Date: Fri May 22 11:20:23 2020 > New Revision: 361363 > URL: https://svnweb.freebsd.org/changeset/base/361363 > > Log: > libprocstat: fix ZFS support > > First of all, znode_phys_t hasn't been used for storing file attributes > for a long time now. Modern ZFS versions use a System Attribute table > with a flexible layout. But more importantly all the required > information is available in znode_t itself. > > It's not easy to include zfs_znode.h in userland without breaking code > because the most interesting parts of the header are kernel-only. And > hardcoding field offsets is too fragile. So, I created a new > compilation unit that includes zfs_znode.h using some mild kludges to > get it and its dependencies to compile in userland. The compilation > unit exports interesting field offsets and does not have any other code. > > PR: 194117 > Reviewed by: markj > MFC after: 2 weeks > Sponsored by: Panzura > Differential Revision: https://reviews.freebsd.org/D24941 > > Added: > head/lib/libprocstat/zfs_defs.c (contents, props changed) > head/lib/libprocstat/zfs_defs.h (contents, props changed) > Modified: > head/lib/libprocstat/Makefile > head/lib/libprocstat/zfs.c > head/lib/libprocstat/zfs/Makefile > > Modified: head/lib/libprocstat/Makefile > ============================================================================== > --- head/lib/libprocstat/Makefile Fri May 22 10:50:29 2020 (r361362) > +++ head/lib/libprocstat/Makefile Fri May 22 11:20:23 2020 (r361363) > @@ -57,16 +57,17 @@ MLINKS+=libprocstat.3 procstat_close.3 \ > # XXX This is a hack. > .if ${MK_CDDL} != "no" > CFLAGS+= -DLIBPROCSTAT_ZFS > -OBJS+= zfs/zfs.o > -SOBJS+= zfs/zfs.pico > -POBJS+= zfs/zfs.po > +SRCS+= zfs.c > +OBJS+= zfs/zfs_defs.o > +SOBJS+= zfs/zfs_defs.pico > +POBJS+= zfs/zfs_defs.po > SUBDIR= zfs > -zfs/zfs.o: .PHONY > - @cd ${.CURDIR}/zfs && ${MAKE} zfs.o > -zfs/zfs.pico: .PHONY > - @cd ${.CURDIR}/zfs && ${MAKE} zfs.pico > -zfs/zfs.po: .PHONY > - @cd ${.CURDIR}/zfs && ${MAKE} zfs.po > +zfs/zfs_defs.o: .PHONY > + @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.o > +zfs/zfs_defs.pico: .PHONY > + @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.pico > +zfs/zfs_defs.po: .PHONY > + @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.po > .endif > > .include > > Modified: head/lib/libprocstat/zfs.c > ============================================================================== > --- head/lib/libprocstat/zfs.c Fri May 22 10:50:29 2020 (r361362) > +++ head/lib/libprocstat/zfs.c Fri May 22 11:20:23 2020 (r361363) > @@ -31,22 +31,13 @@ > #include > #define _KERNEL > #include > -#include > #undef _KERNEL > +#include > +#include > #include > +#include > +#include > > -#undef lbolt > -#undef lbolt64 > -#undef gethrestime_sec > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > - > #include > > #include > @@ -57,24 +48,15 @@ > #define ZFS > #include "libprocstat.h" > #include "common_kvm.h" > +#include "zfs_defs.h" > > -/* > - * Offset calculations that are used to get data from znode without having the > - * definition. > - */ > -#define LOCATION_ZID (2 * sizeof(void *)) > -#define LOCATION_ZPHYS(zsize) ((zsize) - (2 * sizeof(void *) + sizeof(struct task))) > - > int > zfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn) > { > > - znode_phys_t zphys; > struct mount mount, *mountptr; > - uint64_t *zid; > - void *znodeptr, *vnodeptr; > + void *znodeptr; > char *dataptr; > - void *zphys_addr; > size_t len; > int size; > > @@ -83,33 +65,27 @@ zfs_filestat(kvm_t *kd, struct vnode *vp, struct vnsta > warnx("error getting sysctl"); > return (1); > } > - znodeptr = malloc(size); > - if (znodeptr == NULL) { > + dataptr = malloc(size); > + if (dataptr == NULL) { > warnx("error allocating memory for znode storage"); > return (1); > } > - /* Since we have problems including vnode.h, we'll use the wrappers. */ > - vnodeptr = getvnodedata(vp); > - if (!kvm_read_all(kd, (unsigned long)vnodeptr, znodeptr, > - (size_t)size)) { > - warnx("can't read znode at %p", (void *)vnodeptr); > + > + if ((size_t)size < offsetof_z_id + sizeof(uint64_t) || > + (size_t)size < offsetof_z_mode + sizeof(mode_t) || > + (size_t)size < offsetof_z_size + sizeof(uint64_t)) { > + warnx("znode_t size is too small"); > goto bad; > } > > - /* > - * z_id field is stored in the third pointer. We therefore skip the two > - * first bytes. > - * > - * Pointer to the z_phys structure is the next last pointer. Therefore > - * go back two bytes from the end. > - */ > - dataptr = znodeptr; > - zid = (uint64_t *)(dataptr + LOCATION_ZID); > - zphys_addr = *(void **)(dataptr + LOCATION_ZPHYS(size)); > + if ((size_t)size != sizeof_znode_t) > + warnx("znode_t size mismatch, data could be wrong"); > > - if (!kvm_read_all(kd, (unsigned long)zphys_addr, &zphys, > - sizeof(zphys))) { > - warnx("can't read znode_phys at %p", zphys_addr); > + /* Since we have problems including vnode.h, we'll use the wrappers. */ > + znodeptr = getvnodedata(vp); > + if (!kvm_read_all(kd, (unsigned long)znodeptr, dataptr, > + (size_t)size)) { > + warnx("can't read znode at %p", (void *)znodeptr); > goto bad; > } > > @@ -119,18 +95,18 @@ zfs_filestat(kvm_t *kd, struct vnode *vp, struct vnsta > warnx("can't read mount at %p", (void *)mountptr); > goto bad; > } > - vn->vn_fsid = mount.mnt_stat.f_fsid.val[0]; > - vn->vn_fileid = *zid; > + > /* > - * XXX: Shows up wrong in output, but UFS has this error too. Could > - * be that we're casting mode-variables from 64-bit to 8-bit or simply > - * error in the mode-to-string function. > + * XXX Assume that this is a znode, but it can be a special node > + * under .zfs/. > */ > - vn->vn_mode = (mode_t)zphys.zp_mode; > - vn->vn_size = (u_long)zphys.zp_size; > - free(znodeptr); > + vn->vn_fsid = mount.mnt_stat.f_fsid.val[0]; > + vn->vn_fileid = *(uint64_t *)(void *)(dataptr + offsetof_z_id); > + vn->vn_mode = *(mode_t *)(void *)(dataptr + offsetof_z_mode); > + vn->vn_size = *(uint64_t *)(void *)(dataptr + offsetof_z_size); > + free(dataptr); > return (0); > bad: > - free(znodeptr); > + free(dataptr); > return (1); > } > > Modified: head/lib/libprocstat/zfs/Makefile > ============================================================================== > --- head/lib/libprocstat/zfs/Makefile Fri May 22 10:50:29 2020 (r361362) > +++ head/lib/libprocstat/zfs/Makefile Fri May 22 11:20:23 2020 (r361363) > @@ -2,20 +2,20 @@ > > .PATH: ${.CURDIR:H} > > -SRCS= zfs.c > -OBJS= zfs.o > +SRCS= zfs_defs.c > +OBJS= zfs_defs.o > WARNS?= 1 > > CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris > CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include > CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem > -CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common > CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs > CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs > CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common > CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head > CFLAGS+= -I${.CURDIR:H} > CFLAGS+= -DNEED_SOLARIS_BOOLEAN > +CFLAGS+= -fno-builtin -nostdlib > > all: ${OBJS} > CLEANFILES= ${OBJS} > > Added: head/lib/libprocstat/zfs_defs.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libprocstat/zfs_defs.c Fri May 22 11:20:23 2020 (r361363) > @@ -0,0 +1,59 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2020 Andriy Gapon > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +/* Pretend we are kernel to get the same binary layout. */ > +#define _KERNEL > + > +/* A hack to deal with kpilite.h. */ > +#define KLD_MODULE > + > +/* > + * Prevent some headers from getting included and fake some types > + * in order to allow this file to compile without bringing in > + * too many kernel build dependencies. > + */ > +#define _OPENSOLARIS_SYS_PATHNAME_H_ > +#define _OPENSOLARIS_SYS_POLICY_H_ > +#define _OPENSOLARIS_SYS_VNODE_H_ > +#define _VNODE_PAGER_ > + > +typedef struct vnode vnode_t; > +typedef struct vattr vattr_t; > +typedef struct xvattr xvattr_t; > +typedef struct vsecattr vsecattr_t; > +typedef enum vtype vtype_t; > + > +#include > +#include > + > +size_t sizeof_znode_t = sizeof(znode_t); > +size_t offsetof_z_id = offsetof(znode_t, z_id); > +size_t offsetof_z_size = offsetof(znode_t, z_size); > +size_t offsetof_z_mode = offsetof(znode_t, z_mode); > > Added: head/lib/libprocstat/zfs_defs.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libprocstat/zfs_defs.h Fri May 22 11:20:23 2020 (r361363) > @@ -0,0 +1,38 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2020 Andriy Gapon > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#ifndef _LIBPROCSTAT_ZFS_DEFS_H > +#define _LIBPROCSTAT_ZFS_DEFS_H > + > +extern size_t sizeof_znode_t; > +extern size_t offsetof_z_id; > +extern size_t offsetof_z_size; > +extern size_t offsetof_z_mode; > + > +#endif /* _LIBPROCSTAT_ZFS_DEFS_H */ From owner-svn-src-all@freebsd.org Fri May 22 15:23: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 879AB2CB938; Fri, 22 May 2020 15:23:19 +0000 (UTC) (envelope-from agapon@gmail.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 49T9HB3nHFz4RDp; Fri, 22 May 2020 15:23:18 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-wm1-f67.google.com with SMTP id u13so258983wml.1; Fri, 22 May 2020 08:23:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=CEaXavwen6NvHtINPVOH+44ASWzhFXHuhQW4CJat4a0=; b=gGWsetJjNKBPth7ckmlB5oDsb1M0DtlDQ/PpKlRBrDkSp3M2Ir4TDBpoVg5EVOaDNH yKhyYfO1tdPkwT0uLuhmczvhM8zhZVqcLNc6Xu2iA68UNK+GvKEqRLy+4E5FLU/Oq2Sj 4+EYfrczOpLUsULzfucONsCOuWxtFwwxmKAN3TJ3dhqocJrm2ELN15EKZ5zjp92PZtWJ NUCuFsaxwANvSEf5Aa3E6xh2FO1GTRv/05ytXRzLdsOElx6pLVVdqzwaqyaiIT7ITZXi iNIdZUkRURdRAc99gdzKi4Ri9RjfIQYb4j21wJiJBX3Tbq0szCcCfOyMQILZXyW1R9Ak AEdA== X-Gm-Message-State: AOAM5321QiVqmi3omhLM58/eBQBaGJVruXs/k2izce10J1OmGz8ydqEj K7FNtLZQPnAQn8R3n3nd3hLJ3ORo X-Google-Smtp-Source: ABdhPJxNY7is1KMmTi+qXV2g/iPCbfP0eGJBzhhXNueQTtYuqkrZJ8pcL/lv2RsaFZDoosfZ46WpeA== X-Received: by 2002:a1c:5541:: with SMTP id j62mr12891740wmb.64.1590160996821; Fri, 22 May 2020 08:23:16 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id 128sm10679429wme.39.2020.05.22.08.23.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 May 2020 08:23:16 -0700 (PDT) Subject: Re: svn commit: r361363 - in head/lib/libprocstat: . zfs To: cem@freebsd.org Cc: src-committers , svn-src-all , svn-src-head References: <202005221120.04MBKOiH003190@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <323574a0-b8ae-af80-d06c-0646e0d3e4f5@FreeBSD.org> Date: Fri, 22 May 2020 18:23:15 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49T9HB3nHFz4RDp X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.128.67 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-1.45 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; ARC_NA(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-0.64)[-0.643]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.83)[-0.828]; NEURAL_SPAM_SHORT(0.02)[0.018]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.67:from]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.67:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; RCVD_TLS_ALL(0.00)[]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[93.72.151.96:received] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 May 2020 15:23:19 -0000 On 22/05/2020 18:15, Conrad Meyer wrote: > Hi Andriy, > > Would it make sense to also export sizes of those members? Currently > the code assumes the members may be relocated in the struct, but never > changed in size. If they can be moved around, maybe they might be > enlarged or shrunk at some time too? Maybe not; I am not very > familiar with ZFS. I think that's less likely to happen. I mean, moving around may be as simple as adding a new field in the middle of the struct and people typically don't give much thought to such changes. Changing a member's type is more likely to prompt a check of possible uses. But less likely does not equal will never happen, of course. So, I think that this is a good suggestion. > On Fri, May 22, 2020 at 4:20 AM Andriy Gapon wrote: >> >> Author: avg >> Date: Fri May 22 11:20:23 2020 >> New Revision: 361363 >> URL: https://svnweb.freebsd.org/changeset/base/361363 >> >> Log: >> libprocstat: fix ZFS support >> >> First of all, znode_phys_t hasn't been used for storing file attributes >> for a long time now. Modern ZFS versions use a System Attribute table >> with a flexible layout. But more importantly all the required >> information is available in znode_t itself. >> >> It's not easy to include zfs_znode.h in userland without breaking code >> because the most interesting parts of the header are kernel-only. And >> hardcoding field offsets is too fragile. So, I created a new >> compilation unit that includes zfs_znode.h using some mild kludges to >> get it and its dependencies to compile in userland. The compilation >> unit exports interesting field offsets and does not have any other code. >> >> PR: 194117 >> Reviewed by: markj >> MFC after: 2 weeks >> Sponsored by: Panzura -- Andriy Gapon From owner-svn-src-all@freebsd.org Fri May 22 15:26: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 938992CBC2B; Fri, 22 May 2020 15:26:28 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 49T9Lq5Z8Gz4RWl; Fri, 22 May 2020 15:26:27 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-wm1-f54.google.com with SMTP id u1so9004833wmn.3; Fri, 22 May 2020 08:26:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=X4NCHjQo4b9SLBB3tFXhZhD7P+0JtB3AgPEZyCpEvG0=; b=UMC8apMthgSG4CCyhzb59SE+wbekscza1Dmj+51qs+RJRq6CMLPC5wzjhrSMtuoTNU 0qWKo4qcSSIH80qiHyO7dPd1fxAkw0TWIbQ6W5trEqtS0BohiZsRX7lcd9VJDH8Zo+q5 hcYpCinGVxUgPCyudeXY+5XEqJTJ7mnk1JoMzt4082VNsZiYSjSVfLKrBUmOCg0Bun1I eExhNQX3aM6Vhhr3aYxW4t2pG56zhI98OFAqEs54gNPXR9YMXWrCxVQJYUegvx/+lOYr yxUCnT+OynWXfb2QKCGjsIhP6SwIrq/e5PlxTX4hVJQHPzDHT03hNLPF18Pi3U4Cqt0u mcvg== X-Gm-Message-State: AOAM5336Wbpv5h1EBlgZ/g7mPK0I66E0CS+Py818NvCf/RENhuXwDHcS 5xNdWmlwQEkd5xMdyUCkP6Nt0bhj X-Google-Smtp-Source: ABdhPJyvVBfh12GFR2iHEPUVOR4bTA6EwtG9wWFusIpNpB0WkTJnmlQ8ETQra2wRGMHUcmeoIS8z1A== X-Received: by 2002:a1c:ed04:: with SMTP id l4mr13976397wmh.93.1590161185924; Fri, 22 May 2020 08:26:25 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id m13sm9552368wmi.42.2020.05.22.08.26.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 May 2020 08:26:25 -0700 (PDT) Subject: Re: svn commit: r361363 - in head/lib/libprocstat: . zfs From: Andriy Gapon To: cem@freebsd.org Cc: src-committers , svn-src-all , svn-src-head References: <202005221120.04MBKOiH003190@repo.freebsd.org> <323574a0-b8ae-af80-d06c-0646e0d3e4f5@FreeBSD.org> Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <89c8638a-ed49-3fbd-ee36-175fd7ede15c@FreeBSD.org> Date: Fri, 22 May 2020 18:26:24 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <323574a0-b8ae-af80-d06c-0646e0d3e4f5@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49T9Lq5Z8Gz4RWl X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.128.54 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-1.39 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-0.60)[-0.599]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.83)[-0.832]; NEURAL_SPAM_SHORT(0.04)[0.040]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.54:from]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.54:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[93.72.151.96:received] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 22 May 2020 15:26:28 -0000 On 22/05/2020 18:23, Andriy Gapon wrote: > On 22/05/2020 18:15, Conrad Meyer wrote: >> Hi Andriy, >> >> Would it make sense to also export sizes of those members? Currently >> the code assumes the members may be relocated in the struct, but never >> changed in size. If they can be moved around, maybe they might be >> enlarged or shrunk at some time too? Maybe not; I am not very >> familiar with ZFS. > I think that's less likely to happen. I mean, moving around may be as simple as > adding a new field in the middle of the struct and people typically don't give > much thought to such changes. Changing a member's type is more likely to prompt > a check of possible uses. > But less likely does not equal will never happen, of course. > So, I think that this is a good suggestion. > OTOH, z_id and z_size probably won't grow larger than 64-bit soon. Size of mode_t has been pretty stable over the years as well. So, this is not a priority for now. -- Andriy Gapon From owner-svn-src-all@freebsd.org Fri May 22 15:30: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 C0DF42CBE97; Fri, 22 May 2020 15:30:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T9RB4jt5z4S0K; Fri, 22 May 2020 15:30:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D0E220BB3; Fri, 22 May 2020 15:30:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MFUErL058019; Fri, 22 May 2020 15:30:14 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MFUEMt058018; Fri, 22 May 2020 15:30:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005221530.04MFUEMt058018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 22 May 2020 15:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361385 - head/contrib/tzcode/stdtime X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/contrib/tzcode/stdtime X-SVN-Commit-Revision: 361385 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, 22 May 2020 15:30:14 -0000 Author: cem Date: Fri May 22 15:30:14 2020 New Revision: 361385 URL: https://svnweb.freebsd.org/changeset/base/361385 Log: ctime.3: Use ASCII asterisks for C, not special unicode math glyphs PR: 246656 Reported by: danfe Modified: head/contrib/tzcode/stdtime/ctime.3 Modified: head/contrib/tzcode/stdtime/ctime.3 ============================================================================== --- head/contrib/tzcode/stdtime/ctime.3 Fri May 22 14:46:23 2020 (r361384) +++ head/contrib/tzcode/stdtime/ctime.3 Fri May 22 15:30:14 2020 (r361385) @@ -30,7 +30,7 @@ .\" From: @(#)ctime.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 2, 1999 +.Dd May 22, 2020 .Dt CTIME 3 .Os .Sh NAME @@ -266,17 +266,17 @@ External declarations as well as the tm structure defi include file. The tm structure includes at least the following fields: .Bd -literal -offset indent -int tm_sec; /\(** seconds (0 - 60) \(**/ -int tm_min; /\(** minutes (0 - 59) \(**/ -int tm_hour; /\(** hours (0 - 23) \(**/ -int tm_mday; /\(** day of month (1 - 31) \(**/ -int tm_mon; /\(** month of year (0 - 11) \(**/ -int tm_year; /\(** year \- 1900 \(**/ -int tm_wday; /\(** day of week (Sunday = 0) \(**/ -int tm_yday; /\(** day of year (0 - 365) \(**/ -int tm_isdst; /\(** is summer time in effect? \(**/ -char \(**tm_zone; /\(** abbreviation of timezone name \(**/ -long tm_gmtoff; /\(** offset from UTC in seconds \(**/ +int tm_sec; /* seconds (0 - 60) */ +int tm_min; /* minutes (0 - 59) */ +int tm_hour; /* hours (0 - 23) */ +int tm_mday; /* day of month (1 - 31) */ +int tm_mon; /* month of year (0 - 11) */ +int tm_year; /* year \- 1900 */ +int tm_wday; /* day of week (Sunday = 0) */ +int tm_yday; /* day of year (0 - 365) */ +int tm_isdst; /* is summer time in effect? */ +char *tm_zone; /* abbreviation of timezone name */ +long tm_gmtoff; /* offset from UTC in seconds */ .Ed .Pp The From owner-svn-src-all@freebsd.org Fri May 22 15:37: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 8C6932CC17B; Fri, 22 May 2020 15:37:47 +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 49T9bt6GZxz4Sq1; Fri, 22 May 2020 15:37:46 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x744.google.com with SMTP id f189so11098126qkd.5; Fri, 22 May 2020 08:37:46 -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=hutpUQxRPprtmDkFAkKWrZMwDEgflfpBu0uespJU2w0=; b=t16oXTRy4nBrHweWBaR+/mTVcHwqL6fmBxEskWGDzt6A8bv6RZBJVg22jJoeVu2Tns GWl0IiD7mzmiLilhVotxMq75lNvmu9yrX/sa6FUkxNLjt2sk87+T9F5hoRxQiH9EWtIo b89Qqh6ZLeHaoTp5YOQVA6k/lRPW5zcyCNktsSX3vp/VBNP/0bW0U5t5lJsNnkoyelfx jggrrw2BG4+xia3iG5k/P6Ooi1ujE7MIF0jieNVZjrvyw2tUnIT6PTJQgSiJ0klBUbrQ a4/NvDGi6YA4M7bzi1U8W66jiPBbHz0n7UMklLVH0KE7QPLWyxGsWDtFmGMLotBJAOBj LNyw== 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=hutpUQxRPprtmDkFAkKWrZMwDEgflfpBu0uespJU2w0=; b=W6UsBQpLJmj5k0F8FGos7UML8q3W8Nzyn5NYaO6sYpAekYB2OtC032pVL4xLWYgrig bW+vmU/rnDZSi0khjVr5i7qL/bEsPlgo2KXRS9vRqWAt3EXULzKtrnl3w1UpfYPcZjx3 aj/jaZj3jQDslMf2niNswFYPiDzZI9mZ0+wAR1hrEo05B2rnvZbK9ibguk/dfUKdtZQy 5IpqUHbjTkftGNZuy8WpuzRY8GdB7BA+VJsAJUgnw+lFsJlw8+dpc4Yh3J2efd5u98VF ptBRiq0CQ6meXfbCvX3A/mqcCUMiA+nwgRyAmocFKomGbjpeULyp+alyEk+iAR3i1JqF 5bxQ== X-Gm-Message-State: AOAM532mqSigMRQ4wSMWqapfr9qk3PFNaIUNyPGnIP/YzhTB2l6uBfaL sUpdCDIbsZ3EY5Lsqk1dqe8= X-Google-Smtp-Source: ABdhPJxHfWhB4dmEubBaL7ClamA0alLVWVPa9tqWl+avISgxjNFcNqyyv4ocSpZdggCemA6LiNsvYQ== X-Received: by 2002:a05:620a:64f:: with SMTP id a15mr9228992qka.10.1590161865868; Fri, 22 May 2020 08:37:45 -0700 (PDT) Received: from raichu (toroon0560w-lp130-11-70-50-21-250.dsl.bell.ca. [70.50.21.250]) by smtp.gmail.com with ESMTPSA id n20sm7851705qtk.89.2020.05.22.08.37.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 08:37:44 -0700 (PDT) Sender: Mark Johnston Date: Fri, 22 May 2020 11:37:43 -0400 From: Mark Johnston To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r361352 - in head/sys: amd64/amd64 i386/i386 Message-ID: <20200522153743.GC2512@raichu> References: <202005220118.04M1ItwO032876@repo.freebsd.org> <20200522151059.GK64045@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200522151059.GK64045@kib.kiev.ua> X-Rspamd-Queue-Id: 49T9bt6GZxz4Sq1 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=t16oXTRy; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::744 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-1.84 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.001]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-0.98)[-0.980]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.16)[-0.159]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::744:from]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; 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]; RCVD_TLS_ALL(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, 22 May 2020 15:37:47 -0000 On Fri, May 22, 2020 at 06:10:59PM +0300, Konstantin Belousov wrote: > On Fri, May 22, 2020 at 01:18:55AM +0000, Mark Johnston wrote: > > Author: markj > > Date: Fri May 22 01:18:55 2020 > > New Revision: 361352 > > URL: https://svnweb.freebsd.org/changeset/base/361352 > > > > Log: > > Fix the build after r361033 when ACPI is disabled. > What is the sense in doing this for amd64 ? I doubt that we can boot > with ACPI disabled. It is possible to boot in virtualized environments without ACPI. I'm not sure why it is especially useful, but I wanted to avoid regressing a stable branch since at least one person noticed the breakage fairly quickly, and it is easy to fix. From owner-svn-src-all@freebsd.org Fri May 22 15:42: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 1140D2CC51F; Fri, 22 May 2020 15:42:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T9jd6g2Cz4T0M; Fri, 22 May 2020 15:42:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFE1F20FE8; Fri, 22 May 2020 15:42:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MFgjrX069694; Fri, 22 May 2020 15:42:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MFgjsl069692; Fri, 22 May 2020 15:42:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005221542.04MFgjsl069692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 22 May 2020 15:42: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: r361386 - in stable/12/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 361386 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, 22 May 2020 15:42:46 -0000 Author: markj Date: Fri May 22 15:42:45 2020 New Revision: 361386 URL: https://svnweb.freebsd.org/changeset/base/361386 Log: MFC r361352: Fix the build after r361033 when ACPI is disabled. Modified: stable/12/sys/amd64/amd64/mp_machdep.c stable/12/sys/i386/i386/mp_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/12/sys/amd64/amd64/mp_machdep.c Fri May 22 15:30:14 2020 (r361385) +++ stable/12/sys/amd64/amd64/mp_machdep.c Fri May 22 15:42:45 2020 (r361386) @@ -29,6 +29,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_acpi.h" #include "opt_cpu.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" @@ -78,8 +79,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef DEV_ACPI #include #include +#endif #define WARMBOOT_TARGET 0 #define WARMBOOT_OFF (KERNBASE + 0x0467) @@ -266,7 +269,9 @@ cpu_mp_start(void) set_interrupt_apic_ids(); +#if defined(DEV_ACPI) && MAXMEMDOM > 1 acpi_pxm_set_cpu_locality(); +#endif } /* Modified: stable/12/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/12/sys/i386/i386/mp_machdep.c Fri May 22 15:30:14 2020 (r361385) +++ stable/12/sys/i386/i386/mp_machdep.c Fri May 22 15:42:45 2020 (r361386) @@ -28,6 +28,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_acpi.h" #include "opt_apic.h" #include "opt_cpu.h" #include "opt_kstack_pages.h" @@ -83,8 +84,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef DEV_ACPI #include #include +#endif #define WARMBOOT_TARGET 0 #define WARMBOOT_OFF (PMAP_MAP_LOW + 0x0467) @@ -203,7 +206,7 @@ cpu_mp_start(void) set_interrupt_apic_ids(); -#if MAXMEMDOM > 1 +#if defined(DEV_ACPI) && MAXMEMDOM > 1 acpi_pxm_set_cpu_locality(); #endif } From owner-svn-src-all@freebsd.org Fri May 22 15:51: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 CBFFB2CC773; Fri, 22 May 2020 15:51:36 +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 49T9vr548nz4Tkv; Fri, 22 May 2020 15:51:36 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (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 A2BFA24C67; Fri, 22 May 2020 15:51:36 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f182.google.com with SMTP id i5so11077655qkl.12; Fri, 22 May 2020 08:51:36 -0700 (PDT) X-Gm-Message-State: AOAM532Q8ptJlIEQMFHUDX8YEo9CETMbY2NEbMxj31hG0shmqe2T0SKk LCgoGkH4dBpme8GSGr9xK1SDzLHbcC+xW31DkXA= X-Google-Smtp-Source: ABdhPJzhH1t4bRAbjrQUNNEJoXVXDen7p0Iz6JZzWJiKIaARwVA7GYJva6Zm7VmImiVUSctEX/rpXngemvR5EEIwEow= X-Received: by 2002:a37:2711:: with SMTP id n17mr15676461qkn.430.1590162696094; Fri, 22 May 2020 08:51:36 -0700 (PDT) MIME-Version: 1.0 References: <202005220917.04M9H7oE028708@repo.freebsd.org> In-Reply-To: <202005220917.04M9H7oE028708@repo.freebsd.org> From: Kyle Evans Date: Fri, 22 May 2020 10:51:22 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361360 - head/sys/dev/hyperv/hvsock To: Wei Hu 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, 22 May 2020 15:51:36 -0000 On Fri, May 22, 2020 at 4:17 AM Wei Hu wrote: > > Author: whu > Date: Fri May 22 09:17:07 2020 > New Revision: 361360 > URL: https://svnweb.freebsd.org/changeset/base/361360 > > Log: > Socket AF_HYPERV should return failure when it is not running on HyperV > > [... snip ...] > @@ -354,6 +354,9 @@ hvs_trans_attach(struct socket *so, int proto, struct > { > struct hvs_pcb *pcb = so2hvspcb(so); > > + if (vm_guest != VM_GUEST_HV) > + return (ESOCKTNOSUPPORT); > + > HVSOCK_DBG(HVSOCK_DBG_VERBOSE, > "%s: HyperV Socket hvs_trans_attach called\n", __func__); > This one may be OK, but none of these other methods should be able to be invoked if the attach failed. See this comment at around ^/sys/kern/uipc_socket.c#50: 50 * pru_detach() disassociates protocol layer state from an attached socket, 51 * and will be called exactly once for sockets in which pru_attach() has 52 * been successfully called. If pru_attach() returned an error, 53 * pru_detach() will not be called. Socket layer private. That said, I wonder if VNET_DOMAIN_SET provides the correct semantics here at all. You can't fail domain_init, but I don't think there's any value in this domain actually getting registered on non-HyperV guests, a fact which presumably won't change at runtime. I have some concerns about how hvsock works out with vnets, but I'll drop those on the initial commit thread. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Fri May 22 15: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 36B992CC9DA; Fri, 22 May 2020 15:56:53 +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 49TB1x0jmkz4V22; Fri, 22 May 2020 15:56:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:112f:d17b:daab:c6ca]) (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 88C0525073; Fri, 22 May 2020 15:56:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r361352 - in head/sys: amd64/amd64 i386/i386 To: Mark Johnston , Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005220118.04M1ItwO032876@repo.freebsd.org> <20200522151059.GK64045@kib.kiev.ua> <20200522153743.GC2512@raichu> 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: <1e73eb03-a734-64df-f1c8-9fccc85a3bf0@FreeBSD.org> Date: Fri, 22 May 2020 08:56:50 -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: <20200522153743.GC2512@raichu> 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: Fri, 22 May 2020 15:56:53 -0000 On 5/22/20 8:37 AM, Mark Johnston wrote: > On Fri, May 22, 2020 at 06:10:59PM +0300, Konstantin Belousov wrote: >> On Fri, May 22, 2020 at 01:18:55AM +0000, Mark Johnston wrote: >>> Author: markj >>> Date: Fri May 22 01:18:55 2020 >>> New Revision: 361352 >>> URL: https://svnweb.freebsd.org/changeset/base/361352 >>> >>> Log: >>> Fix the build after r361033 when ACPI is disabled. >> What is the sense in doing this for amd64 ? I doubt that we can boot >> with ACPI disabled. > > It is possible to boot in virtualized environments without ACPI. I'm > not sure why it is especially useful, but I wanted to avoid regressing a > stable branch since at least one person noticed the breakage fairly > quickly, and it is easy to fix. I agree it mostly seems dubious. I believe at one point that NetApp at least was using FreeBSD/amd64 on gear that didn't have a "real" BIOS and didn't have ACPI. That was probably 10 years ago though when I last heard that, so it may no longer be true. That said, even the !ACPI code we have now is a runtime check so it should still fallback if ACPI isn't detected at runtime or is disabled via a hint. I'm not sure how much we should go out of our way to permit compiling without ACPI. On any modern consumer hardware you are going to want ACPI. -- John Baldwin From owner-svn-src-all@freebsd.org Fri May 22 15:57: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 9B8362CCAC0; Fri, 22 May 2020 15:57:46 +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 49TB2y3f4yz4VB5; Fri, 22 May 2020 15:57:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:112f:d17b:daab:c6ca]) (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 C9B542513F; Fri, 22 May 2020 15:57:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r361334 - in stable/12/sys: amd64/amd64 arm64/arm64 dev/acpica i386/i386 x86/acpica To: "Herbert J. Skuhra" , Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <202005211528.04LFSZFF068443@repo.freebsd.org> <87a720aowg.wl-herbert@gojira.at> 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: <6c46560e-cc5b-ec15-d352-a3bf8eeede6a@FreeBSD.org> Date: Fri, 22 May 2020 08:57:44 -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: <87a720aowg.wl-herbert@gojira.at> 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: Fri, 22 May 2020 15:57:46 -0000 On 5/21/20 3:45 PM, Herbert J. Skuhra wrote: > > Until now it was possible to build a kernel (amd64) without 'device > acpi'. After this commit it fails with this error: > > --- kernel.full --- > linking kernel.full > ld: error: undefined symbol: acpi_pxm_set_cpu_locality >>>> referenced by mp_machdep.c:269 (/usr/src/sys/amd64/amd64/mp_machdep.c:269) >>>> mp_machdep.o:(cpu_mp_start) > *** [kernel.full] Error code 1 > > Was that intended? I know Mark has already fixed this, but can you elaborate on your use case for not compiling ACPI support into the kernel? -- John Baldwin From owner-svn-src-all@freebsd.org Fri May 22 16:12: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 6EDDC2CD0C4; Fri, 22 May 2020 16:12:24 +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 49TBMr2Tznz4Vpb; Fri, 22 May 2020 16:12:24 +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 37141215FD; Fri, 22 May 2020 16:12:24 +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 04MGCOIF087545; Fri, 22 May 2020 16:12:24 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MGCIp8087516; Fri, 22 May 2020 16:12:18 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005221612.04MGCIp8087516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 22 May 2020 16:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r361387 - in vendor/llvm-project/release-10.x: clang/include/clang/AST clang/include/clang/Basic clang/lib/AST clang/lib/CodeGen clang/lib/Driver/ToolChains clang/lib/Format clang/lib/S... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/llvm-project/release-10.x: clang/include/clang/AST clang/include/clang/Basic clang/lib/AST clang/lib/CodeGen clang/lib/Driver/ToolChains clang/lib/Format clang/lib/Sema compiler-rt/lib/profi... X-SVN-Commit-Revision: 361387 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, 22 May 2020 16:12:24 -0000 Author: dim Date: Fri May 22 16:12:18 2020 New Revision: 361387 URL: https://svnweb.freebsd.org/changeset/base/361387 Log: Vendor import of llvm-project branch release/10.x llvmorg-10.0.1-rc1-0-gf79cd71e145. Modified: vendor/llvm-project/release-10.x/clang/include/clang/AST/DeclBase.h vendor/llvm-project/release-10.x/clang/include/clang/Basic/Attr.td vendor/llvm-project/release-10.x/clang/lib/AST/DeclBase.cpp vendor/llvm-project/release-10.x/clang/lib/AST/ExprConstant.cpp vendor/llvm-project/release-10.x/clang/lib/AST/RawCommentList.cpp vendor/llvm-project/release-10.x/clang/lib/CodeGen/CGVTables.cpp vendor/llvm-project/release-10.x/clang/lib/CodeGen/CodeGenModule.cpp vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Darwin.cpp vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Gnu.cpp vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Gnu.h vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Hurd.cpp vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Hurd.h vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Linux.cpp vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Linux.h vendor/llvm-project/release-10.x/clang/lib/Format/TokenAnnotator.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaTemplateInstantiate.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/TreeTransform.h vendor/llvm-project/release-10.x/compiler-rt/lib/profile/GCDAProfiling.c vendor/llvm-project/release-10.x/lld/COFF/MarkLive.cpp vendor/llvm-project/release-10.x/lld/ELF/Driver.cpp vendor/llvm-project/release-10.x/lld/ELF/InputSection.cpp vendor/llvm-project/release-10.x/lld/ELF/InputSection.h vendor/llvm-project/release-10.x/lld/ELF/OutputSections.cpp vendor/llvm-project/release-10.x/lld/ELF/Writer.cpp vendor/llvm-project/release-10.x/llvm/include/llvm/Analysis/ValueLattice.h vendor/llvm-project/release-10.x/llvm/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h vendor/llvm-project/release-10.x/llvm/lib/Analysis/LazyValueInfo.cpp vendor/llvm-project/release-10.x/llvm/lib/Analysis/ValueLattice.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/MachineSink.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp vendor/llvm-project/release-10.x/llvm/lib/DebugInfo/CodeView/MergingTypeTableBuilder.cpp vendor/llvm-project/release-10.x/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp vendor/llvm-project/release-10.x/llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp vendor/llvm-project/release-10.x/llvm/lib/MC/MCObjectFileInfo.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/ARM/ARMISelLowering.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/PowerPC/PPCISelLowering.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86ISelLowering.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86IndirectBranchTracking.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86TargetMachine.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86TargetMachine.h vendor/llvm-project/release-10.x/llvm/lib/Transforms/Coroutines/CoroSplit.cpp vendor/llvm-project/release-10.x/llvm/lib/Transforms/IPO/GlobalOpt.cpp vendor/llvm-project/release-10.x/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp vendor/llvm-project/release-10.x/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp vendor/llvm-project/release-10.x/llvm/tools/llvm-objcopy/ELF/Object.cpp vendor/llvm-project/release-10.x/llvm/tools/llvm-objcopy/llvm-objcopy.cpp Modified: vendor/llvm-project/release-10.x/clang/include/clang/AST/DeclBase.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/AST/DeclBase.h Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/clang/include/clang/AST/DeclBase.h Fri May 22 16:12:18 2020 (r361387) @@ -856,14 +856,15 @@ class alignas(8) Decl { (public) return getParentFunctionOrMethod() == nullptr; } - /// Returns true if this declaration lexically is inside a function. - /// It recognizes non-defining declarations as well as members of local - /// classes: + /// Returns true if this declaration is lexically inside a function or inside + /// a variable initializer. It recognizes non-defining declarations as well + /// as members of local classes: /// \code /// void foo() { void bar(); } /// void foo2() { class ABC { void bar(); }; } + /// inline int x = [](){ return 0; }; /// \endcode - bool isLexicallyWithinFunctionOrMethod() const; + bool isInLocalScope() const; /// If this decl is defined inside a function/method/block it returns /// the corresponding DeclContext, otherwise it returns null. Modified: vendor/llvm-project/release-10.x/clang/include/clang/Basic/Attr.td ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/Basic/Attr.td Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/clang/include/clang/Basic/Attr.td Fri May 22 16:12:18 2020 (r361387) @@ -685,7 +685,7 @@ def XRayLogArgs : InheritableAttr { def PatchableFunctionEntry : InheritableAttr, - TargetSpecificAttr> { + TargetSpecificAttr> { let Spellings = [GCC<"patchable_function_entry">]; let Subjects = SubjectList<[Function, ObjCMethod]>; let Args = [UnsignedArgument<"Count">, DefaultIntArgument<"Offset", 0>]; Modified: vendor/llvm-project/release-10.x/clang/lib/AST/DeclBase.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/AST/DeclBase.cpp Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/clang/lib/AST/DeclBase.cpp Fri May 22 16:12:18 2020 (r361387) @@ -332,13 +332,16 @@ void Decl::setDeclContextsImpl(DeclContext *SemaDC, De } } -bool Decl::isLexicallyWithinFunctionOrMethod() const { +bool Decl::isInLocalScope() const { const DeclContext *LDC = getLexicalDeclContext(); while (true) { if (LDC->isFunctionOrMethod()) return true; if (!isa(LDC)) return false; + if (const auto *CRD = dyn_cast(LDC)) + if (CRD->isLambda()) + return true; LDC = LDC->getLexicalParent(); } return false; Modified: vendor/llvm-project/release-10.x/clang/lib/AST/ExprConstant.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/AST/ExprConstant.cpp Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/clang/lib/AST/ExprConstant.cpp Fri May 22 16:12:18 2020 (r361387) @@ -8593,6 +8593,10 @@ bool PointerExprEvaluator::VisitBuiltinCallExpr(const static bool EvaluateArrayNewInitList(EvalInfo &Info, LValue &This, APValue &Result, const InitListExpr *ILE, QualType AllocType); +static bool EvaluateArrayNewConstructExpr(EvalInfo &Info, LValue &This, + APValue &Result, + const CXXConstructExpr *CCE, + QualType AllocType); bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNewExpr *E) { if (!Info.getLangOpts().CPlusPlus2a) @@ -8642,6 +8646,7 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNe const Expr *Init = E->getInitializer(); const InitListExpr *ResizedArrayILE = nullptr; + const CXXConstructExpr *ResizedArrayCCE = nullptr; QualType AllocType = E->getAllocatedType(); if (Optional ArraySize = E->getArraySize()) { @@ -8685,7 +8690,7 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNe // -- the new-initializer is a braced-init-list and the number of // array elements for which initializers are provided [...] // exceeds the number of elements to initialize - if (Init) { + if (Init && !isa(Init)) { auto *CAT = Info.Ctx.getAsConstantArrayType(Init->getType()); assert(CAT && "unexpected type for array initializer"); @@ -8708,6 +8713,8 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNe // special handling for this case when we initialize. if (InitBound != AllocBound) ResizedArrayILE = cast(Init); + } else if (Init) { + ResizedArrayCCE = cast(Init); } AllocType = Info.Ctx.getConstantArrayType(AllocType, ArrayBound, nullptr, @@ -8772,6 +8779,10 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNe if (!EvaluateArrayNewInitList(Info, Result, *Val, ResizedArrayILE, AllocType)) return false; + } else if (ResizedArrayCCE) { + if (!EvaluateArrayNewConstructExpr(Info, Result, *Val, ResizedArrayCCE, + AllocType)) + return false; } else if (Init) { if (!EvaluateInPlace(*Val, Info, Result, Init)) return false; @@ -9595,6 +9606,16 @@ static bool EvaluateArrayNewInitList(EvalInfo &Info, L "not an array rvalue"); return ArrayExprEvaluator(Info, This, Result) .VisitInitListExpr(ILE, AllocType); +} + +static bool EvaluateArrayNewConstructExpr(EvalInfo &Info, LValue &This, + APValue &Result, + const CXXConstructExpr *CCE, + QualType AllocType) { + assert(CCE->isRValue() && CCE->getType()->isArrayType() && + "not an array rvalue"); + return ArrayExprEvaluator(Info, This, Result) + .VisitCXXConstructExpr(CCE, This, &Result, AllocType); } // Return true iff the given array filler may depend on the element index. Modified: vendor/llvm-project/release-10.x/clang/lib/AST/RawCommentList.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/AST/RawCommentList.cpp Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/clang/lib/AST/RawCommentList.cpp Fri May 22 16:12:18 2020 (r361387) @@ -430,7 +430,7 @@ std::string RawComment::getFormattedText(const SourceM }; auto DropTrailingNewLines = [](std::string &Str) { - while (Str.back() == '\n') + while (!Str.empty() && Str.back() == '\n') Str.pop_back(); }; Modified: vendor/llvm-project/release-10.x/clang/lib/CodeGen/CGVTables.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/CodeGen/CGVTables.cpp Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/clang/lib/CodeGen/CGVTables.cpp Fri May 22 16:12:18 2020 (r361387) @@ -437,7 +437,8 @@ void CodeGenFunction::EmitMustTailThunk(GlobalDecl GD, // Finish the function to maintain CodeGenFunction invariants. // FIXME: Don't emit unreachable code. EmitBlock(createBasicBlock()); - FinishFunction(); + + FinishThunk(); } void CodeGenFunction::generateThunk(llvm::Function *Fn, @@ -564,7 +565,7 @@ llvm::Constant *CodeGenVTables::maybeEmitThunk(GlobalD CGM.SetLLVMFunctionAttributesForDefinition(GD.getDecl(), ThunkFn); // Thunks for variadic methods are special because in general variadic - // arguments cannot be perferctly forwarded. In the general case, clang + // arguments cannot be perfectly forwarded. In the general case, clang // implements such thunks by cloning the original function body. However, for // thunks with no return adjustment on targets that support musttail, we can // use musttail to perfectly forward the variadic arguments. Modified: vendor/llvm-project/release-10.x/clang/lib/CodeGen/CodeGenModule.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/CodeGen/CodeGenModule.cpp Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/clang/lib/CodeGen/CodeGenModule.cpp Fri May 22 16:12:18 2020 (r361387) @@ -1847,9 +1847,16 @@ void CodeGenModule::SetFunctionAttributes(GlobalDecl G else if (const auto *SA = FD->getAttr()) F->setSection(SA->getName()); + // If we plan on emitting this inline builtin, we can't treat it as a builtin. if (FD->isInlineBuiltinDeclaration()) { - F->addAttribute(llvm::AttributeList::FunctionIndex, - llvm::Attribute::NoBuiltin); + const FunctionDecl *FDBody; + bool HasBody = FD->hasBody(FDBody); + (void)HasBody; + assert(HasBody && "Inline builtin declarations should always have an " + "available body!"); + if (shouldEmitFunction(FDBody)) + F->addAttribute(llvm::AttributeList::FunctionIndex, + llvm::Attribute::NoBuiltin); } if (FD->isReplaceableGlobalAllocationFunction()) { Modified: vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Darwin.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Darwin.cpp Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Darwin.cpp Fri May 22 16:12:18 2020 (r361387) @@ -1146,6 +1146,7 @@ void Darwin::addProfileRTLibs(const ArgList &Args, addExportedSymbol(CmdArgs, "___gcov_flush"); addExportedSymbol(CmdArgs, "_flush_fn_list"); addExportedSymbol(CmdArgs, "_writeout_fn_list"); + addExportedSymbol(CmdArgs, "_reset_fn_list"); } else { addExportedSymbol(CmdArgs, "___llvm_profile_filename"); addExportedSymbol(CmdArgs, "___llvm_profile_raw_version"); Modified: vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Gnu.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Gnu.cpp Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Gnu.cpp Fri May 22 16:12:18 2020 (r361387) @@ -309,7 +309,7 @@ static const char *getLDMOption(const llvm::Triple &T, } } -static bool getPIE(const ArgList &Args, const toolchains::Linux &ToolChain) { +static bool getPIE(const ArgList &Args, const ToolChain &TC) { if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_static) || Args.hasArg(options::OPT_r) || Args.hasArg(options::OPT_static_pie)) return false; @@ -317,17 +317,16 @@ static bool getPIE(const ArgList &Args, const toolchai Arg *A = Args.getLastArg(options::OPT_pie, options::OPT_no_pie, options::OPT_nopie); if (!A) - return ToolChain.isPIEDefault(); + return TC.isPIEDefault(); return A->getOption().matches(options::OPT_pie); } -static bool getStaticPIE(const ArgList &Args, - const toolchains::Linux &ToolChain) { +static bool getStaticPIE(const ArgList &Args, const ToolChain &TC) { bool HasStaticPIE = Args.hasArg(options::OPT_static_pie); // -no-pie is an alias for -nopie. So, handling -nopie takes care of // -no-pie as well. if (HasStaticPIE && Args.hasArg(options::OPT_nopie)) { - const Driver &D = ToolChain.getDriver(); + const Driver &D = TC.getDriver(); const llvm::opt::OptTable &Opts = D.getOpts(); const char *StaticPIEName = Opts.getOptionName(options::OPT_static_pie); const char *NoPIEName = Opts.getOptionName(options::OPT_nopie); @@ -346,8 +345,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation const InputInfoList &Inputs, const ArgList &Args, const char *LinkingOutput) const { - const toolchains::Linux &ToolChain = - static_cast(getToolChain()); + // FIXME: The Linker class constructor takes a ToolChain and not a + // Generic_ELF, so the static_cast might return a reference to a invalid + // instance (see PR45061). Ideally, the Linker constructor needs to take a + // Generic_ELF instead. + const toolchains::Generic_ELF &ToolChain = + static_cast(getToolChain()); const Driver &D = ToolChain.getDriver(); const llvm::Triple &Triple = getToolChain().getEffectiveTriple(); @@ -418,8 +421,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation if (isAndroid) CmdArgs.push_back("--warn-shared-textrel"); - for (const auto &Opt : ToolChain.ExtraOpts) - CmdArgs.push_back(Opt.c_str()); + ToolChain.addExtraOpts(CmdArgs); CmdArgs.push_back("--eh-frame-hdr"); Modified: vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Gnu.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Gnu.h Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Gnu.h Fri May 22 16:12:18 2020 (r361387) @@ -356,6 +356,12 @@ class LLVM_LIBRARY_VISIBILITY Generic_ELF : public Gen void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, Action::OffloadKind DeviceOffloadKind) const override; + + virtual std::string getDynamicLinker(const llvm::opt::ArgList &Args) const { + return {}; + } + + virtual void addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const {} }; } // end namespace toolchains Modified: vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Hurd.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Hurd.cpp Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Hurd.cpp Fri May 22 16:12:18 2020 (r361387) @@ -61,8 +61,7 @@ static StringRef getOSLibDir(const llvm::Triple &Tripl return Triple.isArch32Bit() ? "lib" : "lib64"; } -Hurd::Hurd(const Driver &D, const llvm::Triple &Triple, - const ArgList &Args) +Hurd::Hurd(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) : Generic_ELF(D, Triple, Args) { std::string SysRoot = computeSysRoot(); path_list &Paths = getFilePaths(); @@ -169,4 +168,9 @@ void Hurd::AddClangSystemIncludeArgs(const ArgList &Dr addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/include"); addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); +} + +void Hurd::addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const { + for (const auto &Opt : ExtraOpts) + CmdArgs.push_back(Opt.c_str()); } Modified: vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Hurd.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Hurd.h Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Hurd.h Fri May 22 16:12:18 2020 (r361387) @@ -27,9 +27,11 @@ class LLVM_LIBRARY_VISIBILITY Hurd : public Generic_EL AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; - virtual std::string computeSysRoot() const; + std::string computeSysRoot() const; - virtual std::string getDynamicLinker(const llvm::opt::ArgList &Args) const; + std::string getDynamicLinker(const llvm::opt::ArgList &Args) const override; + + void addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const override; std::vector ExtraOpts; Modified: vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Linux.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Linux.cpp Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Linux.cpp Fri May 22 16:12:18 2020 (r361387) @@ -986,3 +986,8 @@ void Linux::addProfileRTLibs(const llvm::opt::ArgList Twine("-u", llvm::getInstrProfRuntimeHookVarName()))); ToolChain::addProfileRTLibs(Args, CmdArgs); } + +void Linux::addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const { + for (const auto &Opt : ExtraOpts) + CmdArgs.push_back(Opt.c_str()); +} Modified: vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Linux.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Linux.h Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Linux.h Fri May 22 16:12:18 2020 (r361387) @@ -42,7 +42,9 @@ class LLVM_LIBRARY_VISIBILITY Linux : public Generic_E llvm::opt::ArgStringList &CmdArgs) const override; virtual std::string computeSysRoot() const; - virtual std::string getDynamicLinker(const llvm::opt::ArgList &Args) const; + std::string getDynamicLinker(const llvm::opt::ArgList &Args) const override; + + void addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const override; std::vector ExtraOpts; Modified: vendor/llvm-project/release-10.x/clang/lib/Format/TokenAnnotator.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Format/TokenAnnotator.cpp Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/clang/lib/Format/TokenAnnotator.cpp Fri May 22 16:12:18 2020 (r361387) @@ -2176,6 +2176,10 @@ static bool isFunctionDeclarationName(const FormatToke Next = Next->Next; continue; } + if (Next->is(TT_TemplateOpener) && Next->MatchingParen) { + Next = Next->MatchingParen; + continue; + } break; } @@ -2705,20 +2709,40 @@ bool TokenAnnotator::spaceRequiredBetween(const Annota tok::l_square)); if (Right.is(tok::star) && Left.is(tok::l_paren)) return false; - if (Right.isOneOf(tok::star, tok::amp, tok::ampamp) && - (Left.is(tok::identifier) || Left.isSimpleTypeSpecifier()) && - // Space between the type and the * in: - // operator void*() - // operator char*() - // operator /*comment*/ const char*() - // operator volatile /*comment*/ char*() - // operator Foo*() - // dependent on PointerAlignment style. - Left.Previous && - (Left.Previous->endsSequence(tok::kw_operator) || - Left.Previous->endsSequence(tok::kw_const, tok::kw_operator) || - Left.Previous->endsSequence(tok::kw_volatile, tok::kw_operator))) - return (Style.PointerAlignment != FormatStyle::PAS_Left); + if (Right.is(tok::star) && Left.is(tok::star)) + return false; + if (Right.isOneOf(tok::star, tok::amp, tok::ampamp)) { + const FormatToken *Previous = &Left; + while (Previous && !Previous->is(tok::kw_operator)) { + if (Previous->is(tok::identifier) || Previous->isSimpleTypeSpecifier()) { + Previous = Previous->getPreviousNonComment(); + continue; + } + if (Previous->is(TT_TemplateCloser) && Previous->MatchingParen) { + Previous = Previous->MatchingParen->getPreviousNonComment(); + continue; + } + if (Previous->is(tok::coloncolon)) { + Previous = Previous->getPreviousNonComment(); + continue; + } + break; + } + // Space between the type and the * in: + // operator void*() + // operator char*() + // operator /*comment*/ const char*() + // operator volatile /*comment*/ char*() + // operator Foo*() + // operator C*() + // operator std::Foo*() + // operator C::D*() + // dependent on PointerAlignment style. + if (Previous && (Previous->endsSequence(tok::kw_operator) || + Previous->endsSequence(tok::kw_const, tok::kw_operator) || + Previous->endsSequence(tok::kw_volatile, tok::kw_operator))) + return (Style.PointerAlignment != FormatStyle::PAS_Left); + } const auto SpaceRequiredForArrayInitializerLSquare = [](const FormatToken &LSquareTok, const FormatStyle &Style) { return Style.SpacesInContainerLiterals || Modified: vendor/llvm-project/release-10.x/clang/lib/Sema/SemaTemplateInstantiate.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Sema/SemaTemplateInstantiate.cpp Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/clang/lib/Sema/SemaTemplateInstantiate.cpp Fri May 22 16:12:18 2020 (r361387) @@ -2343,7 +2343,7 @@ ParmVarDecl *Sema::SubstParmVarDecl(ParmVarDecl *OldPa UnparsedDefaultArgInstantiations[OldParm].push_back(NewParm); } else if (Expr *Arg = OldParm->getDefaultArg()) { FunctionDecl *OwningFunc = cast(OldParm->getDeclContext()); - if (OwningFunc->isLexicallyWithinFunctionOrMethod()) { + if (OwningFunc->isInLocalScope()) { // Instantiate default arguments for methods of local classes (DR1484) // and non-defining declarations. Sema::ContextRAII SavedContext(*this, OwningFunc); Modified: vendor/llvm-project/release-10.x/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp Fri May 22 16:12:18 2020 (r361387) @@ -4367,7 +4367,7 @@ TemplateDeclInstantiator::InitFunctionInstantiation(Fu EPI.ExceptionSpec.Type != EST_None && EPI.ExceptionSpec.Type != EST_DynamicNone && EPI.ExceptionSpec.Type != EST_BasicNoexcept && - !Tmpl->isLexicallyWithinFunctionOrMethod()) { + !Tmpl->isInLocalScope()) { FunctionDecl *ExceptionSpecTemplate = Tmpl; if (EPI.ExceptionSpec.Type == EST_Uninstantiated) ExceptionSpecTemplate = EPI.ExceptionSpec.SourceTemplate; Modified: vendor/llvm-project/release-10.x/clang/lib/Sema/TreeTransform.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/lib/Sema/TreeTransform.h Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/clang/lib/Sema/TreeTransform.h Fri May 22 16:12:18 2020 (r361387) @@ -4022,50 +4022,8 @@ template void TreeTransform::InventTemplateArgumentLoc( const TemplateArgument &Arg, TemplateArgumentLoc &Output) { - SourceLocation Loc = getDerived().getBaseLocation(); - switch (Arg.getKind()) { - case TemplateArgument::Null: - llvm_unreachable("null template argument in TreeTransform"); - break; - - case TemplateArgument::Type: - Output = TemplateArgumentLoc(Arg, - SemaRef.Context.getTrivialTypeSourceInfo(Arg.getAsType(), Loc)); - - break; - - case TemplateArgument::Template: - case TemplateArgument::TemplateExpansion: { - NestedNameSpecifierLocBuilder Builder; - TemplateName Template = Arg.getAsTemplateOrTemplatePattern(); - if (DependentTemplateName *DTN = Template.getAsDependentTemplateName()) - Builder.MakeTrivial(SemaRef.Context, DTN->getQualifier(), Loc); - else if (QualifiedTemplateName *QTN = Template.getAsQualifiedTemplateName()) - Builder.MakeTrivial(SemaRef.Context, QTN->getQualifier(), Loc); - - if (Arg.getKind() == TemplateArgument::Template) - Output = TemplateArgumentLoc(Arg, - Builder.getWithLocInContext(SemaRef.Context), - Loc); - else - Output = TemplateArgumentLoc(Arg, - Builder.getWithLocInContext(SemaRef.Context), - Loc, Loc); - - break; - } - - case TemplateArgument::Expression: - Output = TemplateArgumentLoc(Arg, Arg.getAsExpr()); - break; - - case TemplateArgument::Declaration: - case TemplateArgument::Integral: - case TemplateArgument::Pack: - case TemplateArgument::NullPtr: - Output = TemplateArgumentLoc(Arg, TemplateArgumentLocInfo()); - break; - } + Output = getSema().getTrivialTemplateArgumentLoc( + Arg, QualType(), getDerived().getBaseLocation()); } template @@ -4075,12 +4033,45 @@ bool TreeTransform::TransformTemplateArgument const TemplateArgument &Arg = Input.getArgument(); switch (Arg.getKind()) { case TemplateArgument::Null: - case TemplateArgument::Integral: case TemplateArgument::Pack: - case TemplateArgument::Declaration: - case TemplateArgument::NullPtr: llvm_unreachable("Unexpected TemplateArgument"); + case TemplateArgument::Integral: + case TemplateArgument::NullPtr: + case TemplateArgument::Declaration: { + // Transform a resolved template argument straight to a resolved template + // argument. We get here when substituting into an already-substituted + // template type argument during concept satisfaction checking. + QualType T = Arg.getNonTypeTemplateArgumentType(); + QualType NewT = getDerived().TransformType(T); + if (NewT.isNull()) + return true; + + ValueDecl *D = Arg.getKind() == TemplateArgument::Declaration + ? Arg.getAsDecl() + : nullptr; + ValueDecl *NewD = D ? cast_or_null(getDerived().TransformDecl( + getDerived().getBaseLocation(), D)) + : nullptr; + if (D && !NewD) + return true; + + if (NewT == T && D == NewD) + Output = Input; + else if (Arg.getKind() == TemplateArgument::Integral) + Output = TemplateArgumentLoc( + TemplateArgument(getSema().Context, Arg.getAsIntegral(), NewT), + TemplateArgumentLocInfo()); + else if (Arg.getKind() == TemplateArgument::NullPtr) + Output = TemplateArgumentLoc(TemplateArgument(NewT, /*IsNullPtr=*/true), + TemplateArgumentLocInfo()); + else + Output = TemplateArgumentLoc(TemplateArgument(NewD, NewT), + TemplateArgumentLocInfo()); + + return false; + } + case TemplateArgument::Type: { TypeSourceInfo *DI = Input.getTypeSourceInfo(); if (!DI) @@ -11836,19 +11827,6 @@ TreeTransform::TransformLambdaExpr(LambdaExpr NewTrailingRequiresClause.get()); LSI->CallOperator = NewCallOperator; - - for (unsigned I = 0, NumParams = NewCallOperator->getNumParams(); - I != NumParams; ++I) { - auto *P = NewCallOperator->getParamDecl(I); - if (P->hasUninstantiatedDefaultArg()) { - EnterExpressionEvaluationContext Eval( - getSema(), - Sema::ExpressionEvaluationContext::PotentiallyEvaluatedIfUsed, P); - ExprResult R = getDerived().TransformExpr( - E->getCallOperator()->getParamDecl(I)->getDefaultArg()); - P->setDefaultArg(R.get()); - } - } getDerived().transformAttrs(E->getCallOperator(), NewCallOperator); getDerived().transformedLocalDecl(E->getCallOperator(), {NewCallOperator}); Modified: vendor/llvm-project/release-10.x/compiler-rt/lib/profile/GCDAProfiling.c ============================================================================== --- vendor/llvm-project/release-10.x/compiler-rt/lib/profile/GCDAProfiling.c Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/compiler-rt/lib/profile/GCDAProfiling.c Fri May 22 16:12:18 2020 (r361387) @@ -32,8 +32,10 @@ #include #include "WindowsMMap.h" #else -#include #include +#include +#include +#include #endif #if defined(__FreeBSD__) && defined(__i386__) @@ -119,6 +121,11 @@ struct fn_list writeout_fn_list; */ struct fn_list flush_fn_list; +/* + * A list of reset functions, shared between all dynamic objects. + */ +struct fn_list reset_fn_list; + static void fn_list_insert(struct fn_list* list, fn_ptr fn) { struct fn_node* new_node = malloc(sizeof(struct fn_node)); new_node->fn = fn; @@ -634,7 +641,46 @@ void llvm_delete_flush_function_list(void) { } COMPILER_RT_VISIBILITY -void llvm_gcov_init(fn_ptr wfn, fn_ptr ffn) { +void llvm_register_reset_function(fn_ptr fn) { + fn_list_insert(&reset_fn_list, fn); +} + +COMPILER_RT_VISIBILITY +void llvm_delete_reset_function_list(void) { fn_list_remove(&reset_fn_list); } + +COMPILER_RT_VISIBILITY +void llvm_reset_counters(void) { + struct fn_node *curr = reset_fn_list.head; + + while (curr) { + if (curr->id == CURRENT_ID) { + curr->fn(); + } + curr = curr->next; + } +} + +#if !defined(_WIN32) +COMPILER_RT_VISIBILITY +pid_t __gcov_fork() { + pid_t parent_pid = getpid(); + pid_t pid = fork(); + + if (pid == 0) { + pid_t child_pid = getpid(); + if (child_pid != parent_pid) { + // The pid changed so we've a fork (one could have its own fork function) + // Just reset the counters for this child process + // threads. + llvm_reset_counters(); + } + } + return pid; +} +#endif + +COMPILER_RT_VISIBILITY +void llvm_gcov_init(fn_ptr wfn, fn_ptr ffn, fn_ptr rfn) { static int atexit_ran = 0; if (wfn) @@ -643,10 +689,14 @@ void llvm_gcov_init(fn_ptr wfn, fn_ptr ffn) { if (ffn) llvm_register_flush_function(ffn); + if (rfn) + llvm_register_reset_function(rfn); + if (atexit_ran == 0) { atexit_ran = 1; /* Make sure we write out the data and delete the data structures. */ + atexit(llvm_delete_reset_function_list); atexit(llvm_delete_flush_function_list); atexit(llvm_delete_writeout_function_list); atexit(llvm_writeout_files); Modified: vendor/llvm-project/release-10.x/lld/COFF/MarkLive.cpp ============================================================================== --- vendor/llvm-project/release-10.x/lld/COFF/MarkLive.cpp Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/lld/COFF/MarkLive.cpp Fri May 22 16:12:18 2020 (r361387) @@ -28,10 +28,12 @@ void markLive(ArrayRef chunks) { // as we push, so sections never appear twice in the list. SmallVector worklist; - // COMDAT section chunks are dead by default. Add non-COMDAT chunks. + // COMDAT section chunks are dead by default. Add non-COMDAT chunks. Do not + // traverse DWARF sections. They are live, but they should not keep other + // sections alive. for (Chunk *c : chunks) if (auto *sc = dyn_cast(c)) - if (sc->live) + if (sc->live && !sc->isDWARF()) worklist.push_back(sc); auto enqueue = [&](SectionChunk *c) { Modified: vendor/llvm-project/release-10.x/lld/ELF/Driver.cpp ============================================================================== --- vendor/llvm-project/release-10.x/lld/ELF/Driver.cpp Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/lld/ELF/Driver.cpp Fri May 22 16:12:18 2020 (r361387) @@ -1906,8 +1906,17 @@ template void LinkerDriver::link(opt::Inp // We do not want to emit debug sections if --strip-all // or -strip-debug are given. - return config->strip != StripPolicy::None && - (s->name.startswith(".debug") || s->name.startswith(".zdebug")); + if (config->strip == StripPolicy::None) + return false; + + if (isDebugSection(*s)) + return true; + if (auto *isec = dyn_cast(s)) + if (InputSectionBase *rel = isec->getRelocatedSection()) + if (isDebugSection(*rel)) + return true; + + return false; }); // Now that the number of partitions is fixed, save a pointer to the main Modified: vendor/llvm-project/release-10.x/lld/ELF/InputSection.cpp ============================================================================== --- vendor/llvm-project/release-10.x/lld/ELF/InputSection.cpp Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/lld/ELF/InputSection.cpp Fri May 22 16:12:18 2020 (r361387) @@ -441,8 +441,7 @@ void InputSection::copyRelocations(uint8_t *buf, Array // See the comment in maybeReportUndefined for PPC64 .toc . auto *d = dyn_cast(&sym); if (!d) { - if (!sec->name.startswith(".debug") && - !sec->name.startswith(".zdebug") && sec->name != ".eh_frame" && + if (!isDebugSection(*sec) && sec->name != ".eh_frame" && sec->name != ".gcc_except_table" && sec->name != ".toc") { uint32_t secIdx = cast(sym).discardedSecIdx; Elf_Shdr_Impl sec = Modified: vendor/llvm-project/release-10.x/lld/ELF/InputSection.h ============================================================================== --- vendor/llvm-project/release-10.x/lld/ELF/InputSection.h Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/lld/ELF/InputSection.h Fri May 22 16:12:18 2020 (r361387) @@ -357,6 +357,10 @@ class InputSection : public InputSectionBase { (privat template void copyShtGroup(uint8_t *buf); }; +inline bool isDebugSection(const InputSectionBase &sec) { + return sec.name.startswith(".debug") || sec.name.startswith(".zdebug"); +} + // The list of all input sections. extern std::vector inputSections; Modified: vendor/llvm-project/release-10.x/lld/ELF/OutputSections.cpp ============================================================================== --- vendor/llvm-project/release-10.x/lld/ELF/OutputSections.cpp Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/lld/ELF/OutputSections.cpp Fri May 22 16:12:18 2020 (r361387) @@ -114,8 +114,7 @@ void OutputSection::commitSection(InputSection *isec) flags = isec->flags; } else { // Otherwise, check if new type or flags are compatible with existing ones. - unsigned mask = SHF_TLS | SHF_LINK_ORDER; - if ((flags & mask) != (isec->flags & mask)) + if ((flags ^ isec->flags) & SHF_TLS) error("incompatible section flags for " + name + "\n>>> " + toString(isec) + ": 0x" + utohexstr(isec->flags) + "\n>>> output section " + name + ": 0x" + utohexstr(flags)); @@ -367,8 +366,9 @@ void OutputSection::finalize() { // all InputSections in the OutputSection have the same dependency. if (auto *ex = dyn_cast(first)) link = ex->getLinkOrderDep()->getParent()->sectionIndex; - else if (auto *d = first->getLinkOrderDep()) - link = d->getParent()->sectionIndex; + else if (first->flags & SHF_LINK_ORDER) + if (auto *d = first->getLinkOrderDep()) + link = d->getParent()->sectionIndex; } if (type == SHT_GROUP) { Modified: vendor/llvm-project/release-10.x/lld/ELF/Writer.cpp ============================================================================== --- vendor/llvm-project/release-10.x/lld/ELF/Writer.cpp Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/lld/ELF/Writer.cpp Fri May 22 16:12:18 2020 (r361387) @@ -1523,17 +1523,30 @@ template void Writer::resolveShfLin // but sort must consider them all at once. std::vector scriptSections; std::vector sections; + bool started = false, stopped = false; for (BaseCommand *base : sec->sectionCommands) { if (auto *isd = dyn_cast(base)) { for (InputSection *&isec : isd->sections) { - scriptSections.push_back(&isec); - sections.push_back(isec); + if (!(isec->flags & SHF_LINK_ORDER)) { + if (started) + stopped = true; + } else if (stopped) { + error(toString(isec) + ": SHF_LINK_ORDER sections in " + sec->name + + " are not contiguous"); + } else { + started = true; - InputSection *link = isec->getLinkOrderDep(); - if (!link->getParent()) - error(toString(isec) + ": sh_link points to discarded section " + - toString(link)); + scriptSections.push_back(&isec); + sections.push_back(isec); + + InputSection *link = isec->getLinkOrderDep(); + if (!link->getParent()) + error(toString(isec) + ": sh_link points to discarded section " + + toString(link)); + } } + } else if (started) { + stopped = true; } } Modified: vendor/llvm-project/release-10.x/llvm/include/llvm/Analysis/ValueLattice.h ============================================================================== --- vendor/llvm-project/release-10.x/llvm/include/llvm/Analysis/ValueLattice.h Fri May 22 15:42:45 2020 (r361386) +++ vendor/llvm-project/release-10.x/llvm/include/llvm/Analysis/ValueLattice.h Fri May 22 16:12:18 2020 (r361387) @@ -29,7 +29,7 @@ class ValueLatticeElement { /// producing instruction is dead. Caution: We use this as the starting /// state in our local meet rules. In this usage, it's taken to mean /// "nothing known yet". - undefined, + unknown, /// This Value has a specific constant value. (For constant integers, /// constantrange is used instead. Integer typed constantexprs can appear @@ -45,7 +45,12 @@ class ValueLatticeElement { constantrange, /// We can not precisely model the dynamic values this value might take. - overdefined + overdefined, + + /// This Value is an UndefValue constant or produces undef. Undefined values + /// can be merged with constants (or single element constant ranges), + /// assuming all uses of the result will be replaced. + undef }; ValueLatticeElementTy Tag; @@ -60,14 +65,15 @@ class ValueLatticeElement { public: // Const and Range are initialized on-demand. - ValueLatticeElement() : Tag(undefined) {} + ValueLatticeElement() : Tag(unknown) {} /// Custom destructor to ensure Range is properly destroyed, when the object /// is deallocated. ~ValueLatticeElement() { switch (Tag) { case overdefined: - case undefined: + case unknown: + case undef: case constant: case notconstant: break; @@ -79,7 +85,7 @@ class ValueLatticeElement { /// Custom copy constructor, to ensure Range gets initialized when /// copying a constant range lattice element. - ValueLatticeElement(const ValueLatticeElement &Other) : Tag(undefined) { + ValueLatticeElement(const ValueLatticeElement &Other) : Tag(unknown) { *this = Other; } @@ -109,7 +115,8 @@ class ValueLatticeElement { ConstVal = Other.ConstVal; break; case overdefined: - case undefined: + case unknown: + case undef: break; } Tag = Other.Tag; @@ -118,14 +125,16 @@ class ValueLatticeElement { static ValueLatticeElement get(Constant *C) { ValueLatticeElement Res; - if (!isa(C)) + if (isa(C)) + Res.markUndef(); + else Res.markConstant(C); return Res; } static ValueLatticeElement getNot(Constant *C) { ValueLatticeElement Res; - if (!isa(C)) - Res.markNotConstant(C); + assert(!isa(C) && "!= undef is not supported"); + Res.markNotConstant(C); return Res; } static ValueLatticeElement getRange(ConstantRange CR) { @@ -139,7 +148,10 @@ class ValueLatticeElement { return Res; } - bool isUndefined() const { return Tag == undefined; } + bool isUndef() const { return Tag == undef; } + bool isUnknown() const { return Tag == unknown; } + bool isUnknownOrUndef() const { return Tag == unknown || Tag == undef; } + bool isUndefined() const { return isUnknownOrUndef(); } bool isConstant() const { return Tag == constant; } bool isNotConstant() const { return Tag == notconstant; } bool isConstantRange() const { return Tag == constantrange; } @@ -170,89 +182,123 @@ class ValueLatticeElement { return None; } -private: - void markOverdefined() { + bool markOverdefined() { if (isOverdefined()) - return; + return false; if (isConstant() || isNotConstant()) ConstVal = nullptr; if (isConstantRange()) Range.~ConstantRange(); Tag = overdefined; + return true; } - void markConstant(Constant *V) { - assert(V && "Marking constant with NULL"); - if (ConstantInt *CI = dyn_cast(V)) { - markConstantRange(ConstantRange(CI->getValue())); - return; - } + bool markUndef() { + if (isUndef()) + return false; + + assert(isUnknown()); + Tag = undef; + return true; + } + + bool markConstant(Constant *V) { if (isa(V)) - return; + return markUndef(); - assert((!isConstant() || getConstant() == V) && - "Marking constant with different value"); - assert(isUndefined()); + if (isConstant()) { + assert(getConstant() == V && "Marking constant with different value"); + return false; + } + + if (ConstantInt *CI = dyn_cast(V)) + return markConstantRange(ConstantRange(CI->getValue())); + + assert(isUnknown() || isUndef()); Tag = constant; ConstVal = V; + return true; } - void markNotConstant(Constant *V) { + bool markNotConstant(Constant *V) { assert(V && "Marking constant with NULL"); - if (ConstantInt *CI = dyn_cast(V)) { - markConstantRange(ConstantRange(CI->getValue() + 1, CI->getValue())); - return; - } + if (ConstantInt *CI = dyn_cast(V)) + return markConstantRange( + ConstantRange(CI->getValue() + 1, CI->getValue())); + if (isa(V)) - return; + return false; - assert((!isConstant() || getConstant() != V) && - "Marking constant !constant with same value"); - assert((!isNotConstant() || getNotConstant() == V) && - "Marking !constant with different value"); - assert(isUndefined() || isConstant()); + if (isNotConstant()) { + assert(getNotConstant() == V && "Marking !constant with different value"); + return false; + } + + assert(isUnknown()); Tag = notconstant; ConstVal = V; + return true; } - void markConstantRange(ConstantRange NewR) { + /// Mark the object as constant range with \p NewR. If the object is already a + /// constant range, nothing changes if the existing range is equal to \p + /// NewR. Otherwise \p NewR must be a superset of the existing range or the + /// object must be undef. + bool markConstantRange(ConstantRange NewR) { if (isConstantRange()) { + if (getConstantRange() == NewR) + return false; + if (NewR.isEmptySet()) - markOverdefined(); - else { - Range = std::move(NewR); - } - return; + return markOverdefined(); + + assert(NewR.contains(getConstantRange()) && + "Existing range must be a subset of NewR"); + Range = std::move(NewR); + return true; } - assert(isUndefined()); + assert(isUnknown() || isUndef()); if (NewR.isEmptySet()) - markOverdefined(); - else { - Tag = constantrange; - new (&Range) ConstantRange(std::move(NewR)); - } + return markOverdefined(); + + Tag = constantrange; + new (&Range) ConstantRange(std::move(NewR)); + return true; } -public: /// Updates this object to approximate both this object and RHS. Returns /// true if this object has been changed. bool mergeIn(const ValueLatticeElement &RHS, const DataLayout &DL) { - if (RHS.isUndefined() || isOverdefined()) + if (RHS.isUnknown() || isOverdefined()) return false; if (RHS.isOverdefined()) { markOverdefined(); return true; } - if (isUndefined()) { + if (isUndef()) { + assert(!RHS.isUnknown()); + if (RHS.isUndef()) + return false; + if (RHS.isConstant()) + return markConstant(RHS.getConstant()); + if (RHS.isConstantRange() && RHS.getConstantRange().isSingleElement()) + return markConstantRange(RHS.getConstantRange()); + return markOverdefined(); + } + + if (isUnknown()) { + assert(!RHS.isUnknown() && "Unknow RHS should be handled earlier"); *this = RHS; - return !RHS.isUndefined(); + return true; } if (isConstant()) { if (RHS.isConstant() && getConstant() == RHS.getConstant()) return false; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri May 22 16:12: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 DBCD12CCDD3; Fri, 22 May 2020 16:12:35 +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 49TBN35bCGz4WFf; Fri, 22 May 2020 16:12:35 +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 BB28625495; Fri, 22 May 2020 16:12:35 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f170.google.com with SMTP id w3so5705223qkb.6; Fri, 22 May 2020 09:12:35 -0700 (PDT) X-Gm-Message-State: AOAM531EDtgYrnprKzK8trjZSK43Unlath3u4hI1nykysdImzfRXYlmW vT9AWZjL9+d3p+istvM5q+rzh8RGwESD9N2oxyw= X-Google-Smtp-Source: ABdhPJy2IDbJ0vNtwYPCInXwtMTgkmqZzuSO5BSJJVmSllznLoq/64tpdaYzNazQu2ulAqT3qVDXIK/WOl4ufoo7QXI= X-Received: by 2002:a37:a20c:: with SMTP id l12mr7805847qke.34.1590163955375; Fri, 22 May 2020 09:12:35 -0700 (PDT) MIME-Version: 1.0 References: <202005201103.04KB3xTp013965@repo.freebsd.org> In-Reply-To: <202005201103.04KB3xTp013965@repo.freebsd.org> From: Kyle Evans Date: Fri, 22 May 2020 11:12:22 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys To: Wei Hu 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, 22 May 2020 16:12:35 -0000 On Wed, May 20, 2020 at 6:04 AM Wei Hu wrote: > > Author: whu > Date: Wed May 20 11:03:59 2020 > New Revision: 361275 > URL: https://svnweb.freebsd.org/changeset/base/361275 > > Log: > HyperV socket implementation for FreeBSD > > This change adds Hyper-V socket feature in FreeBSD. New socket address > family AF_HYPERV and its kernel support are added. > > [... snip ...] > +void > +hvs_trans_init(void) > +{ > + /* Skip initialization of globals for non-default instances. */ > + if (!IS_DEFAULT_VNET(curvnet)) > + return; > + > + if (vm_guest != VM_GUEST_HV) > + return; > + > + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, > + "%s: HyperV Socket hvs_trans_init called\n", __func__); > + > + /* Initialize Globals */ > + previous_auto_bound_port = MAX_PORT; > + sx_init(&hvs_trans_socks_sx, "hvs_trans_sock_sx"); > + mtx_init(&hvs_trans_socks_mtx, > + "hvs_trans_socks_mtx", NULL, MTX_DEF); > + LIST_INIT(&hvs_trans_bound_socks); > + LIST_INIT(&hvs_trans_connected_socks); > +} > + I have a suspicion that all of these should really be per-vnet for correct semantics with VIMAGE, with the IS_DEFAULT_VNET check earlier dropped completely. I haven't read around the rest all that much, but this would at least seem to prevent port re-use by a different vnet, which is perhaps "good enough" but I think this is something that should be fixed in the mid-term. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Fri May 22 16:13: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 B533A2CCEE7; Fri, 22 May 2020 16:13:03 +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 49TBNb3wXBz4WNZ; Fri, 22 May 2020 16:13:03 +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 697D92164B; Fri, 22 May 2020 16:13:03 +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 04MGD3v2088468; Fri, 22 May 2020 16:13:03 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MGD370088467; Fri, 22 May 2020 16:13:03 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005221613.04MGD370088467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 22 May 2020 16:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r361388 - vendor/llvm-project/llvmorg-10.0.1-rc1-0-gf79cd71e145 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm-project/llvmorg-10.0.1-rc1-0-gf79cd71e145 X-SVN-Commit-Revision: 361388 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, 22 May 2020 16:13:03 -0000 Author: dim Date: Fri May 22 16:13:03 2020 New Revision: 361388 URL: https://svnweb.freebsd.org/changeset/base/361388 Log: Tag llvm-project branch release/10.x llvmorg-10.0.1-rc1-0-gf79cd71e145. Added: vendor/llvm-project/llvmorg-10.0.1-rc1-0-gf79cd71e145/ - copied from r361387, vendor/llvm-project/release-10.x/ From owner-svn-src-all@freebsd.org Fri May 22 16:29: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 9AB682CD898; Fri, 22 May 2020 16:29:10 +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 49TBlB3Z6Sz4XGb; Fri, 22 May 2020 16:29:10 +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 716BE2152A; Fri, 22 May 2020 16:29:10 +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 04MGTAwV095016; Fri, 22 May 2020 16:29:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MGT9fx095011; Fri, 22 May 2020 16:29:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005221629.04MGT9fx095011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 22 May 2020 16:29:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361390 - in head: share/man/man7 sys/crypto/chacha20 sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man7 sys/crypto/chacha20 sys/opencrypto X-SVN-Commit-Revision: 361390 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, 22 May 2020 16:29:10 -0000 Author: jhb Date: Fri May 22 16:29:09 2020 New Revision: 361390 URL: https://svnweb.freebsd.org/changeset/base/361390 Log: Improve support for stream ciphers in the software encryption interface. Add a 'native_blocksize' member to 'struct enc_xform' that ciphers can use if they support a partial final block. This is particular useful for stream ciphers, but can also apply to other ciphers. cryptosoft will only pass in native blocks to the encrypt and decrypt hooks. For the final partial block, 'struct enc_xform' now has new encrypt_last/decrypt_last hooks which accept the length of the final block. The multi_block methods are also retired. Mark AES-ICM (AES-CTR) as a stream cipher. This has some interesting effects on IPsec in that FreeBSD can now properly receive all packets sent by Linux when using AES-CTR, but FreeBSD can no longer interoperate with OpenBSD and older verisons of FreeBSD which assume AES-CTR packets have a payload padded to a 16-byte boundary. Kornel has offered to work on a patch to add a compatiblity sysctl to enforce additional padding for AES-CTR in esp_output to permit compatibility with OpenBSD and older versions of FreeBSD. AES-XTS continues to use a block size of a single AES block length. It is possible to adjust it to support partial final blocks by implementing cipher text stealing via encrypt_last/decrypt_last hooks, but I have not done so. Reviewed by: cem (earlier version) Tested by: Kornel Dulęba (AES-CTR with IPsec) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D24906 Modified: head/share/man/man7/crypto.7 head/sys/crypto/chacha20/chacha-sw.c head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform_aes_icm.c head/sys/opencrypto/xform_enc.h Modified: head/share/man/man7/crypto.7 ============================================================================== --- head/share/man/man7/crypto.7 Fri May 22 16:22:01 2020 (r361389) +++ head/share/man/man7/crypto.7 Fri May 22 16:29:09 2020 (r361390) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 3, 2020 +.Dd May 22, 2020 .Dt CRYPTO 7 .Os .Sh NAME @@ -82,7 +82,7 @@ Note: You must provide an IV on every call. .It IV size : 16 .It Block size : -1 (aesni), 16 (software) +1 .It Key size : 16, 24 or 32 .El Modified: head/sys/crypto/chacha20/chacha-sw.c ============================================================================== --- head/sys/crypto/chacha20/chacha-sw.c Fri May 22 16:22:01 2020 (r361389) +++ head/sys/crypto/chacha20/chacha-sw.c Fri May 22 16:29:09 2020 (r361390) @@ -28,11 +28,11 @@ static void chacha20_xform_crypt(void *ctx, const uint8_t *in, uint8_t *out) { - chacha_encrypt_bytes(ctx, in, out, 1); + chacha_encrypt_bytes(ctx, in, out, CHACHA_BLOCKLEN); } static void -chacha20_xform_crypt_multi(void *ctx, const uint8_t *in, uint8_t *out, +chacha20_xform_crypt_last(void *ctx, const uint8_t *in, uint8_t *out, size_t len) { @@ -44,6 +44,7 @@ struct enc_xform enc_xform_chacha20 = { .name = "chacha20", .ctxsize = sizeof(struct chacha_ctx), .blocksize = 1, + .native_blocksize = CHACHA_BLOCKLEN, .ivsize = CHACHA_NONCELEN + CHACHA_CTRLEN, .minkey = CHACHA_MINKEYLEN, .maxkey = 32, @@ -51,6 +52,6 @@ struct enc_xform enc_xform_chacha20 = { .decrypt = chacha20_xform_crypt, .setkey = chacha20_xform_setkey, .reinit = chacha20_xform_reinit, - .encrypt_multi = chacha20_xform_crypt_multi, - .decrypt_multi = chacha20_xform_crypt_multi, + .encrypt_last = chacha20_xform_crypt_last, + .decrypt_last = chacha20_xform_crypt_last, }; Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Fri May 22 16:22:01 2020 (r361389) +++ head/sys/opencrypto/cryptosoft.c Fri May 22 16:29:09 2020 (r361390) @@ -117,13 +117,17 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * sw = &ses->swcr_encdec; exf = sw->sw_exf; - blks = exf->blocksize; ivlen = exf->ivsize; - /* Check for non-padded data */ - if ((crp->crp_payload_length % blks) != 0) - return EINVAL; + if (exf->native_blocksize == 0) { + /* Check for non-padded data */ + if ((crp->crp_payload_length % exf->blocksize) != 0) + return (EINVAL); + blks = exf->blocksize; + } else + blks = exf->native_blocksize; + if (exf == &enc_xform_aes_icm && (crp->crp_flags & CRYPTO_F_IV_SEPARATE) == 0) return (EINVAL); @@ -182,7 +186,7 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * i = crp->crp_payload_length; encrypting = CRYPTO_OP_IS_ENCRYPT(crp->crp_op); - while (i > 0) { + while (i >= blks) { /* * If there's insufficient data at the end of * an iovec, we have to do some copying. @@ -249,31 +253,18 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * break; } - while (uio->uio_iov[ind].iov_len >= k + blks && i > 0) { + while (uio->uio_iov[ind].iov_len >= k + blks && i >= blks) { uint8_t *idat; - size_t nb, rem; - nb = blks; - rem = MIN((size_t)i, - uio->uio_iov[ind].iov_len - (size_t)k); idat = (uint8_t *)uio->uio_iov[ind].iov_base + k; if (exf->reinit) { - if (encrypting && exf->encrypt_multi == NULL) + if (encrypting) exf->encrypt(sw->sw_kschedule, idat, idat); - else if (encrypting) { - nb = rounddown(rem, blks); - exf->encrypt_multi(sw->sw_kschedule, - idat, idat, nb); - } else if (exf->decrypt_multi == NULL) + else exf->decrypt(sw->sw_kschedule, idat, idat); - else { - nb = rounddown(rem, blks); - exf->decrypt_multi(sw->sw_kschedule, - idat, idat, nb); - } } else if (encrypting) { /* XOR with previous block/IV */ for (j = 0; j < blks; j++) @@ -298,9 +289,9 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * ivp = nivp; } - count += nb; - k += nb; - i -= nb; + count += blks; + k += blks; + i -= blks; } /* @@ -319,6 +310,25 @@ swcr_encdec(struct swcr_session *ses, struct cryptop * } } + /* Handle trailing partial block for stream ciphers. */ + if (i > 0) { + KASSERT(exf->native_blocksize != 0, + ("%s: partial block of %d bytes for cipher %s", + __func__, i, exf->name)); + KASSERT(exf->reinit != NULL, + ("%s: partial block cipher %s without reinit hook", + __func__, exf->name)); + KASSERT(i < blks, ("%s: partial block too big", __func__)); + + cuio_copydata(uio, count, i, blk); + if (encrypting) { + exf->encrypt_last(sw->sw_kschedule, blk, blk, i); + } else { + exf->decrypt_last(sw->sw_kschedule, blk, blk, i); + } + cuio_copyback(uio, count, i, blk); + } + out: if (iovalloc) free(iov, M_CRYPTO_DATA); @@ -512,6 +522,8 @@ swcr_gcm(struct swcr_session *ses, struct cryptop *crp swe = &ses->swcr_encdec; exf = swe->sw_exf; + KASSERT(axf->blocksize == exf->native_blocksize, + ("%s: blocksize mismatch", __func__)); if ((crp->crp_flags & CRYPTO_F_IV_SEPARATE) == 0) return (EINVAL); @@ -665,6 +677,8 @@ swcr_ccm(struct swcr_session *ses, struct cryptop *crp swe = &ses->swcr_encdec; exf = swe->sw_exf; + KASSERT(axf->blocksize == exf->native_blocksize, + ("%s: blocksize mismatch", __func__)); if ((crp->crp_flags & CRYPTO_F_IV_SEPARATE) == 0) return (EINVAL); Modified: head/sys/opencrypto/xform_aes_icm.c ============================================================================== --- head/sys/opencrypto/xform_aes_icm.c Fri May 22 16:22:01 2020 (r361389) +++ head/sys/opencrypto/xform_aes_icm.c Fri May 22 16:29:09 2020 (r361390) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); static int aes_icm_setkey(void *, const uint8_t *, int); static void aes_icm_crypt(void *, const uint8_t *, uint8_t *); +static void aes_icm_crypt_last(void *, const uint8_t *, uint8_t *, size_t); static void aes_icm_reinit(void *, const uint8_t *); static void aes_gcm_reinit(void *, const uint8_t *); static void aes_ccm_reinit(void *, const uint8_t *); @@ -63,7 +64,8 @@ struct enc_xform enc_xform_aes_icm = { .type = CRYPTO_AES_ICM, .name = "AES-ICM", .ctxsize = sizeof(struct aes_icm_ctx), - .blocksize = AES_BLOCK_LEN, + .blocksize = 1, + .native_blocksize = AES_BLOCK_LEN, .ivsize = AES_BLOCK_LEN, .minkey = AES_MIN_KEY, .maxkey = AES_MAX_KEY, @@ -71,13 +73,16 @@ struct enc_xform enc_xform_aes_icm = { .decrypt = aes_icm_crypt, .setkey = aes_icm_setkey, .reinit = aes_icm_reinit, + .encrypt_last = aes_icm_crypt_last, + .decrypt_last = aes_icm_crypt_last, }; struct enc_xform enc_xform_aes_nist_gcm = { .type = CRYPTO_AES_NIST_GCM_16, .name = "AES-GCM", .ctxsize = sizeof(struct aes_icm_ctx), - .blocksize = AES_ICM_BLOCK_LEN, + .blocksize = 1, + .native_blocksize = AES_BLOCK_LEN, .ivsize = AES_GCM_IV_LEN, .minkey = AES_MIN_KEY, .maxkey = AES_MAX_KEY, @@ -85,18 +90,24 @@ struct enc_xform enc_xform_aes_nist_gcm = { .decrypt = aes_icm_crypt, .setkey = aes_icm_setkey, .reinit = aes_gcm_reinit, + .encrypt_last = aes_icm_crypt_last, + .decrypt_last = aes_icm_crypt_last, }; struct enc_xform enc_xform_ccm = { .type = CRYPTO_AES_CCM_16, .name = "AES-CCM", .ctxsize = sizeof(struct aes_icm_ctx), - .blocksize = AES_ICM_BLOCK_LEN, .ivsize = AES_CCM_IV_LEN, + .blocksize = 1, + .native_blocksize = AES_BLOCK_LEN, + .ivsize = AES_CCM_IV_LEN, .minkey = AES_MIN_KEY, .maxkey = AES_MAX_KEY, .encrypt = aes_icm_crypt, .decrypt = aes_icm_crypt, .setkey = aes_icm_setkey, .reinit = aes_ccm_reinit, + .encrypt_last = aes_icm_crypt_last, + .decrypt_last = aes_icm_crypt_last, }; /* @@ -143,20 +154,30 @@ static void aes_icm_crypt(void *key, const uint8_t *in, uint8_t *out) { struct aes_icm_ctx *ctx; - uint8_t keystream[AESICM_BLOCKSIZE]; int i; ctx = key; - rijndaelEncrypt(ctx->ac_ek, ctx->ac_nr, ctx->ac_block, keystream); - for (i = 0; i < AESICM_BLOCKSIZE; i++) - out[i] = in[i] ^ keystream[i]; - explicit_bzero(keystream, sizeof(keystream)); + aes_icm_crypt_last(key, in, out, AESICM_BLOCKSIZE); /* increment counter */ for (i = AESICM_BLOCKSIZE - 1; i >= 0; i--) if (++ctx->ac_block[i]) /* continue on overflow */ break; +} + +static void +aes_icm_crypt_last(void *key, const uint8_t *in, uint8_t *out, size_t len) +{ + struct aes_icm_ctx *ctx; + uint8_t keystream[AESICM_BLOCKSIZE]; + int i; + + ctx = key; + rijndaelEncrypt(ctx->ac_ek, ctx->ac_nr, ctx->ac_block, keystream); + for (i = 0; i < len; i++) + out[i] = in[i] ^ keystream[i]; + explicit_bzero(keystream, sizeof(keystream)); } static int Modified: head/sys/opencrypto/xform_enc.h ============================================================================== --- head/sys/opencrypto/xform_enc.h Fri May 22 16:22:01 2020 (r361389) +++ head/sys/opencrypto/xform_enc.h Fri May 22 16:29:09 2020 (r361390) @@ -51,20 +51,25 @@ struct enc_xform { char *name; size_t ctxsize; u_int16_t blocksize; /* Required input block size -- 1 for stream ciphers. */ + uint16_t native_blocksize; /* Used for stream ciphers. */ u_int16_t ivsize; u_int16_t minkey, maxkey; + + /* + * Encrypt/decrypt a single block. For stream ciphers this + * encrypts/decrypts a single "native" block. + */ void (*encrypt) (void *, const uint8_t *, uint8_t *); void (*decrypt) (void *, const uint8_t *, uint8_t *); int (*setkey) (void *, const uint8_t *, int len); void (*reinit) (void *, const u_int8_t *); + /* - * Encrypt/decrypt 1+ blocks of input -- total size is 'len' bytes. - * Len is guaranteed to be a multiple of the defined 'blocksize'. - * Optional interface -- most useful for stream ciphers with a small - * blocksize (1). + * For stream ciphers, encrypt/decrypt the final partial block + * of 'len' bytes. */ - void (*encrypt_multi) (void *, const uint8_t *, uint8_t *, size_t len); - void (*decrypt_multi) (void *, const uint8_t *, uint8_t *, size_t len); + void (*encrypt_last) (void *, const uint8_t *, uint8_t *, size_t len); + void (*decrypt_last) (void *, const uint8_t *, uint8_t *, size_t len); }; From owner-svn-src-all@freebsd.org Fri May 22 16:51: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 83B272CE50D; Fri, 22 May 2020 16:51:01 +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 49TCDP36Vzz4YmW; Fri, 22 May 2020 16:51:01 +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 659FD21C1D; Fri, 22 May 2020 16:51:01 +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 04MGp1i4010401; Fri, 22 May 2020 16:51:01 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MGp0ET010395; Fri, 22 May 2020 16:51:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005221651.04MGp0ET010395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 May 2020 16:51: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: r361391 - in stable/12: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest cddl/contrib/opensolaris/... X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/12: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest cddl/contrib/opensolaris/lib/libzfs/common cddl/co... X-SVN-Commit-Revision: 361391 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, 22 May 2020 16:51:01 -0000 Author: avg Date: Fri May 22 16:51:00 2020 New Revision: 361391 URL: https://svnweb.freebsd.org/changeset/base/361391 Log: MFC r354941,r354948: 10601 10757 Pool allocation classes MFV r354382,r354385: 10601 10757 Pool allocation classes illumos/illumos-gate@663207adb1669640c01c5ec6949ce78fd806efae https://github.com/illumos/illumos-gate/commit/663207adb1669640c01c5ec6949ce78fd806efae 10601 Pool allocation classes https://www.illumos.org/issues/10601 illumos port of ZoL Pool allocation classes. Includes at least these two commits: 441709695 Pool allocation classes misplacing small file blocks cc99f275a Pool allocation classes 10757 Add -gLp to zpool subcommands for alt vdev names https://www.illumos.org/issues/10757 Port from ZoL of d2f3e292d Add -gLp to zpool subcommands for alt vdev names Note that a subsequent ZoL commit changed -p to -P a77f29f93 Change full path subcommand flag from -p to -P Portions contributed by: Jerry Jelinek Portions contributed by: Håkan Johansson Portions contributed by: Richard Yao Portions contributed by: Chunwei Chen Portions contributed by: loli10K Author: Don Brady 11541 allocation_classes feature must be enabled to add log device illumos/illumos-gate@c1064fd7ce62fe763a4475e9988ffea3b22137de https://github.com/illumos/illumos-gate/commit/c1064fd7ce62fe763a4475e9988ffea3b22137de https://www.illumos.org/issues/11541 After the allocation_classes feature was integrated, one can no longer add a log device to a pool unless that feature is enabled. There is an explicit check for this, but it is unnecessary in the case of log devices, so we should handle this better instead of forcing the feature to be enabled. Author: Jerry Jelinek FreeBSD notes. I faithfully added the new -g, -L, -P flags, but only -g does something: vdev GUIDs are displayed instead of device names. -L, resolve symlinks, and -P, display full disk paths, do nothing at the moment. The use of special vdevs is backward compatible for read-only access, so root pools should be bootable, but exercise caution. MFV r354383: 10592 misc. metaslab and vdev related ZoL bug fixes illumos/illumos-gate@555d674d5d4b8191dc83723188349d28278b2431 https://github.com/illumos/illumos-gate/commit/555d674d5d4b8191dc83723188349d28278b2431 https://www.illumos.org/issues/10592 This is a collection of recent fixes from ZoL: 8eef997679b Error path in metaslab_load_impl() forgets to drop ms_sync_lock 928e8ad47d3 Introduce auxiliary metaslab histograms 425d3237ee8 Get rid of space_map_update() for ms_synced_length 6c926f426a2 Simplify log vdev removal code 21e7cf5da89 zdb -L should skip leak detection altogether df72b8bebe0 Rename range_tree_verify to range_tree_verify_not_present 75058f33034 Remove unused vdev_t fields Modified: stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.8 stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c stable/12/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/12/cddl/contrib/opensolaris/lib/libzpool/common/util.c stable/12/stand/libsa/zfs/zfsimpl.c stable/12/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/12/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/12/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_checkpoint.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect_mapping.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_initialize.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/12/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Fri May 22 16:29:09 2020 (r361390) +++ stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Fri May 22 16:51:00 2020 (r361391) @@ -10,7 +10,7 @@ .\" .\" .\" Copyright 2012, Richard Lowe. -.\" Copyright (c) 2012, 2017 by Delphix. All rights reserved. +.\" Copyright (c) 2012, 2018 by Delphix. All rights reserved. .\" Copyright 2017 Nexenta Systems, Inc. .\" .Dd October 06, 2017 @@ -187,7 +187,7 @@ If the .Fl u option is also specified, also display the uberblocks on this device. .It Fl L -Disable leak tracing and the loading of space maps. +Disable leak detection and the loading of space maps. By default, .Nm verifies that all non-free blocks are referenced, which can be very expensive. Modified: stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri May 22 16:29:09 2020 (r361390) +++ stable/12/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri May 22 16:51:00 2020 (r361391) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2017 by Delphix. All rights reserved. + * Copyright (c) 2011, 2018 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2017 Nexenta Systems, Inc. * Copyright (c) 2017, 2018 Lawrence Livermore National Security, LLC. @@ -785,18 +785,21 @@ dump_spacemap(objset_t *os, space_map_t *sm) return; (void) printf("space map object %llu:\n", - (longlong_t)sm->sm_phys->smp_object); - (void) printf(" smp_objsize = 0x%llx\n", - (longlong_t)sm->sm_phys->smp_objsize); + (longlong_t)sm->sm_object); + (void) printf(" smp_length = 0x%llx\n", + (longlong_t)sm->sm_phys->smp_length); (void) printf(" smp_alloc = 0x%llx\n", (longlong_t)sm->sm_phys->smp_alloc); + if (dump_opt['d'] < 6 && dump_opt['m'] < 4) + return; + /* * Print out the freelist entries in both encoded and decoded form. */ uint8_t mapshift = sm->sm_shift; int64_t alloc = 0; - uint64_t word; + uint64_t word, entry_id = 0; for (uint64_t offset = 0; offset < space_map_length(sm); offset += sizeof (word)) { @@ -804,11 +807,12 @@ dump_spacemap(objset_t *os, space_map_t *sm) sizeof (word), &word, DMU_READ_PREFETCH)); if (sm_entry_is_debug(word)) { - (void) printf("\t [%6llu] %s: txg %llu, pass %llu\n", - (u_longlong_t)(offset / sizeof (word)), + (void) printf("\t [%6llu] %s: txg %llu pass %llu\n", + (u_longlong_t)entry_id, ddata[SM_DEBUG_ACTION_DECODE(word)], (u_longlong_t)SM_DEBUG_TXG_DECODE(word), (u_longlong_t)SM_DEBUG_SYNCPASS_DECODE(word)); + entry_id++; continue; } @@ -846,7 +850,7 @@ dump_spacemap(objset_t *os, space_map_t *sm) (void) printf("\t [%6llu] %c range:" " %010llx-%010llx size: %06llx vdev: %06llu words: %u\n", - (u_longlong_t)(offset / sizeof (word)), + (u_longlong_t)entry_id, entry_type, (u_longlong_t)entry_off, (u_longlong_t)(entry_off + entry_run), (u_longlong_t)entry_run, @@ -856,8 +860,9 @@ dump_spacemap(objset_t *os, space_map_t *sm) alloc += entry_run; else alloc -= entry_run; + entry_id++; } - if ((uint64_t)alloc != space_map_allocated(sm)) { + if (alloc != space_map_allocated(sm)) { (void) printf("space_map_object alloc (%lld) INCONSISTENT " "with space map summary (%lld)\n", (longlong_t)space_map_allocated(sm), (longlong_t)alloc); @@ -921,23 +926,30 @@ dump_metaslab(metaslab_t *msp) SPACE_MAP_HISTOGRAM_SIZE, sm->sm_shift); } - if (dump_opt['d'] > 5 || dump_opt['m'] > 3) { - ASSERT(msp->ms_size == (1ULL << vd->vdev_ms_shift)); - - dump_spacemap(spa->spa_meta_objset, msp->ms_sm); - } + ASSERT(msp->ms_size == (1ULL << vd->vdev_ms_shift)); + dump_spacemap(spa->spa_meta_objset, msp->ms_sm); } static void print_vdev_metaslab_header(vdev_t *vd) { - (void) printf("\tvdev %10llu\n\t%-10s%5llu %-19s %-15s %-10s\n", - (u_longlong_t)vd->vdev_id, + vdev_alloc_bias_t alloc_bias = vd->vdev_alloc_bias; + const char *bias_str; + + bias_str = (alloc_bias == VDEV_BIAS_LOG || vd->vdev_islog) ? + VDEV_ALLOC_BIAS_LOG : + (alloc_bias == VDEV_BIAS_SPECIAL) ? VDEV_ALLOC_BIAS_SPECIAL : + (alloc_bias == VDEV_BIAS_DEDUP) ? VDEV_ALLOC_BIAS_DEDUP : + vd->vdev_islog ? "log" : ""; + + (void) printf("\tvdev %10llu %s\n" + "\t%-10s%5llu %-19s %-15s %-12s\n", + (u_longlong_t)vd->vdev_id, bias_str, "metaslabs", (u_longlong_t)vd->vdev_ms_count, "offset", "spacemap", "free"); - (void) printf("\t%15s %19s %15s %10s\n", + (void) printf("\t%15s %19s %15s %12s\n", "---------------", "-------------------", - "---------------", "-------------"); + "---------------", "------------"); } static void @@ -953,7 +965,7 @@ dump_metaslab_groups(spa_t *spa) vdev_t *tvd = rvd->vdev_child[c]; metaslab_group_t *mg = tvd->vdev_mg; - if (mg->mg_class != mc) + if (mg == NULL || mg->mg_class != mc) continue; metaslab_group_histogram_verify(mg); @@ -2807,6 +2819,7 @@ typedef struct zdb_blkstats { uint64_t zb_count; uint64_t zb_gangs; uint64_t zb_ditto_samevdev; + uint64_t zb_ditto_same_ms; uint64_t zb_psize_histogram[PSIZE_HISTO_SIZE]; } zdb_blkstats_t; @@ -2846,6 +2859,16 @@ typedef struct zdb_cb { uint32_t **zcb_vd_obsolete_counts; } zdb_cb_t; +/* test if two DVA offsets from same vdev are within the same metaslab */ +static boolean_t +same_metaslab(spa_t *spa, uint64_t vdev, uint64_t off1, uint64_t off2) +{ + vdev_t *vd = vdev_lookup_top(spa, vdev); + uint64_t ms_shift = vd->vdev_ms_shift; + + return ((off1 >> ms_shift) == (off2 >> ms_shift)); +} + static void zdb_count_block(zdb_cb_t *zcb, zilog_t *zilog, const blkptr_t *bp, dmu_object_type_t type) @@ -2857,6 +2880,8 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t *zilog, const b if (zilog && zil_bp_tree_add(zilog, bp) != 0) return; + spa_config_enter(zcb->zcb_spa, SCL_CONFIG, FTAG, RW_READER); + for (int i = 0; i < 4; i++) { int l = (i < 2) ? BP_GET_LEVEL(bp) : ZB_TOTAL; int t = (i & 1) ? type : ZDB_OT_TOTAL; @@ -2882,8 +2907,15 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t *zilog, const b switch (BP_GET_NDVAS(bp)) { case 2: if (DVA_GET_VDEV(&bp->blk_dva[0]) == - DVA_GET_VDEV(&bp->blk_dva[1])) + DVA_GET_VDEV(&bp->blk_dva[1])) { zb->zb_ditto_samevdev++; + + if (same_metaslab(zcb->zcb_spa, + DVA_GET_VDEV(&bp->blk_dva[0]), + DVA_GET_OFFSET(&bp->blk_dva[0]), + DVA_GET_OFFSET(&bp->blk_dva[1]))) + zb->zb_ditto_same_ms++; + } break; case 3: equal = (DVA_GET_VDEV(&bp->blk_dva[0]) == @@ -2892,13 +2924,37 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t *zilog, const b DVA_GET_VDEV(&bp->blk_dva[2])) + (DVA_GET_VDEV(&bp->blk_dva[1]) == DVA_GET_VDEV(&bp->blk_dva[2])); - if (equal != 0) + if (equal != 0) { zb->zb_ditto_samevdev++; + + if (DVA_GET_VDEV(&bp->blk_dva[0]) == + DVA_GET_VDEV(&bp->blk_dva[1]) && + same_metaslab(zcb->zcb_spa, + DVA_GET_VDEV(&bp->blk_dva[0]), + DVA_GET_OFFSET(&bp->blk_dva[0]), + DVA_GET_OFFSET(&bp->blk_dva[1]))) + zb->zb_ditto_same_ms++; + else if (DVA_GET_VDEV(&bp->blk_dva[0]) == + DVA_GET_VDEV(&bp->blk_dva[2]) && + same_metaslab(zcb->zcb_spa, + DVA_GET_VDEV(&bp->blk_dva[0]), + DVA_GET_OFFSET(&bp->blk_dva[0]), + DVA_GET_OFFSET(&bp->blk_dva[2]))) + zb->zb_ditto_same_ms++; + else if (DVA_GET_VDEV(&bp->blk_dva[1]) == + DVA_GET_VDEV(&bp->blk_dva[2]) && + same_metaslab(zcb->zcb_spa, + DVA_GET_VDEV(&bp->blk_dva[1]), + DVA_GET_OFFSET(&bp->blk_dva[1]), + DVA_GET_OFFSET(&bp->blk_dva[2]))) + zb->zb_ditto_same_ms++; + } break; } - } + spa_config_exit(zcb->zcb_spa, SCL_CONFIG, FTAG); + if (BP_IS_EMBEDDED(bp)) { zcb->zcb_embedded_blocks[BPE_GET_ETYPE(bp)]++; zcb->zcb_embedded_histogram[BPE_GET_ETYPE(bp)] @@ -3086,6 +3142,8 @@ zdb_ddt_leak_init(spa_t *spa, zdb_cb_t *zcb) ddt_entry_t dde; int error; + ASSERT(!dump_opt['L']); + bzero(&ddb, sizeof (ddb)); while ((error = ddt_walk(spa, &ddb, &dde)) == 0) { blkptr_t blk; @@ -3109,12 +3167,10 @@ zdb_ddt_leak_init(spa_t *spa, zdb_cb_t *zcb) zcb->zcb_dedup_blocks++; } } - if (!dump_opt['L']) { - ddt_t *ddt = spa->spa_ddt[ddb.ddb_checksum]; - ddt_enter(ddt); - VERIFY(ddt_lookup(ddt, &blk, B_TRUE) != NULL); - ddt_exit(ddt); - } + ddt_t *ddt = spa->spa_ddt[ddb.ddb_checksum]; + ddt_enter(ddt); + VERIFY(ddt_lookup(ddt, &blk, B_TRUE) != NULL); + ddt_exit(ddt); } ASSERT(error == ENOENT); @@ -3156,6 +3212,9 @@ claim_segment_cb(void *arg, uint64_t offset, uint64_t static void zdb_claim_removing(spa_t *spa, zdb_cb_t *zcb) { + if (dump_opt['L']) + return; + if (spa->spa_vdev_removal == NULL) return; @@ -3247,7 +3306,6 @@ zdb_load_obsolete_counts(vdev_t *vd) space_map_t *prev_obsolete_sm = NULL; VERIFY0(space_map_open(&prev_obsolete_sm, spa->spa_meta_objset, scip->scip_prev_obsolete_sm_object, 0, vd->vdev_asize, 0)); - space_map_update(prev_obsolete_sm); vdev_indirect_mapping_load_obsolete_spacemap(vim, counts, prev_obsolete_sm); space_map_close(prev_obsolete_sm); @@ -3341,9 +3399,9 @@ zdb_leak_init_vdev_exclude_checkpoint(vdev_t *vd, zdb_ VERIFY0(space_map_open(&checkpoint_sm, spa_meta_objset(spa), checkpoint_sm_obj, 0, vd->vdev_asize, vd->vdev_ashift)); - space_map_update(checkpoint_sm); VERIFY0(space_map_iterate(checkpoint_sm, + space_map_length(checkpoint_sm), checkpoint_sm_exclude_entry_cb, &cseea)); space_map_close(checkpoint_sm); @@ -3353,6 +3411,8 @@ zdb_leak_init_vdev_exclude_checkpoint(vdev_t *vd, zdb_ static void zdb_leak_init_exclude_checkpoint(spa_t *spa, zdb_cb_t *zcb) { + ASSERT(!dump_opt['L']); + vdev_t *rvd = spa->spa_root_vdev; for (uint64_t c = 0; c < rvd->vdev_children; c++) { ASSERT3U(c, ==, rvd->vdev_child[c]->vdev_id); @@ -3449,6 +3509,8 @@ load_indirect_ms_allocatable_tree(vdev_t *vd, metaslab static void zdb_leak_init_prepare_indirect_vdevs(spa_t *spa, zdb_cb_t *zcb) { + ASSERT(!dump_opt['L']); + vdev_t *rvd = spa->spa_root_vdev; for (uint64_t c = 0; c < rvd->vdev_children; c++) { vdev_t *vd = rvd->vdev_child[c]; @@ -3495,67 +3557,63 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb) { zcb->zcb_spa = spa; - if (!dump_opt['L']) { - dsl_pool_t *dp = spa->spa_dsl_pool; - vdev_t *rvd = spa->spa_root_vdev; + if (dump_opt['L']) + return; - /* - * We are going to be changing the meaning of the metaslab's - * ms_allocatable. Ensure that the allocator doesn't try to - * use the tree. - */ - spa->spa_normal_class->mc_ops = &zdb_metaslab_ops; - spa->spa_log_class->mc_ops = &zdb_metaslab_ops; + dsl_pool_t *dp = spa->spa_dsl_pool; + vdev_t *rvd = spa->spa_root_vdev; - zcb->zcb_vd_obsolete_counts = - umem_zalloc(rvd->vdev_children * sizeof (uint32_t *), - UMEM_NOFAIL); + /* + * We are going to be changing the meaning of the metaslab's + * ms_allocatable. Ensure that the allocator doesn't try to + * use the tree. + */ + spa->spa_normal_class->mc_ops = &zdb_metaslab_ops; + spa->spa_log_class->mc_ops = &zdb_metaslab_ops; - /* - * For leak detection, we overload the ms_allocatable trees - * to contain allocated segments instead of free segments. - * As a result, we can't use the normal metaslab_load/unload - * interfaces. - */ - zdb_leak_init_prepare_indirect_vdevs(spa, zcb); - load_concrete_ms_allocatable_trees(spa, SM_ALLOC); + zcb->zcb_vd_obsolete_counts = + umem_zalloc(rvd->vdev_children * sizeof (uint32_t *), + UMEM_NOFAIL); - /* - * On load_concrete_ms_allocatable_trees() we loaded all the - * allocated entries from the ms_sm to the ms_allocatable for - * each metaslab. If the pool has a checkpoint or is in the - * middle of discarding a checkpoint, some of these blocks - * may have been freed but their ms_sm may not have been - * updated because they are referenced by the checkpoint. In - * order to avoid false-positives during leak-detection, we - * go through the vdev's checkpoint space map and exclude all - * its entries from their relevant ms_allocatable. - * - * We also aggregate the space held by the checkpoint and add - * it to zcb_checkpoint_size. - * - * Note that at this point we are also verifying that all the - * entries on the checkpoint_sm are marked as allocated in - * the ms_sm of their relevant metaslab. - * [see comment in checkpoint_sm_exclude_entry_cb()] - */ - zdb_leak_init_exclude_checkpoint(spa, zcb); + /* + * For leak detection, we overload the ms_allocatable trees + * to contain allocated segments instead of free segments. + * As a result, we can't use the normal metaslab_load/unload + * interfaces. + */ + zdb_leak_init_prepare_indirect_vdevs(spa, zcb); + load_concrete_ms_allocatable_trees(spa, SM_ALLOC); - /* for cleaner progress output */ - (void) fprintf(stderr, "\n"); + /* + * On load_concrete_ms_allocatable_trees() we loaded all the + * allocated entries from the ms_sm to the ms_allocatable for + * each metaslab. If the pool has a checkpoint or is in the + * middle of discarding a checkpoint, some of these blocks + * may have been freed but their ms_sm may not have been + * updated because they are referenced by the checkpoint. In + * order to avoid false-positives during leak-detection, we + * go through the vdev's checkpoint space map and exclude all + * its entries from their relevant ms_allocatable. + * + * We also aggregate the space held by the checkpoint and add + * it to zcb_checkpoint_size. + * + * Note that at this point we are also verifying that all the + * entries on the checkpoint_sm are marked as allocated in + * the ms_sm of their relevant metaslab. + * [see comment in checkpoint_sm_exclude_entry_cb()] + */ + zdb_leak_init_exclude_checkpoint(spa, zcb); + ASSERT3U(zcb->zcb_checkpoint_size, ==, spa_get_checkpoint_space(spa)); - if (bpobj_is_open(&dp->dp_obsolete_bpobj)) { - ASSERT(spa_feature_is_enabled(spa, - SPA_FEATURE_DEVICE_REMOVAL)); - (void) bpobj_iterate_nofree(&dp->dp_obsolete_bpobj, - increment_indirect_mapping_cb, zcb, NULL); - } - } else { - /* - * If leak tracing is disabled, we still need to consider - * any checkpointed space in our space verification. - */ - zcb->zcb_checkpoint_size += spa_get_checkpoint_space(spa); + /* for cleaner progress output */ + (void) fprintf(stderr, "\n"); + + if (bpobj_is_open(&dp->dp_obsolete_bpobj)) { + ASSERT(spa_feature_is_enabled(spa, + SPA_FEATURE_DEVICE_REMOVAL)); + (void) bpobj_iterate_nofree(&dp->dp_obsolete_bpobj, + increment_indirect_mapping_cb, zcb, NULL); } spa_config_enter(spa, SCL_CONFIG, FTAG, RW_READER); @@ -3636,52 +3694,58 @@ zdb_check_for_obsolete_leaks(vdev_t *vd, zdb_cb_t *zcb static boolean_t zdb_leak_fini(spa_t *spa, zdb_cb_t *zcb) { + if (dump_opt['L']) + return (B_FALSE); + boolean_t leaks = B_FALSE; - if (!dump_opt['L']) { - vdev_t *rvd = spa->spa_root_vdev; - for (unsigned c = 0; c < rvd->vdev_children; c++) { - vdev_t *vd = rvd->vdev_child[c]; - metaslab_group_t *mg = vd->vdev_mg; - if (zcb->zcb_vd_obsolete_counts[c] != NULL) { - leaks |= zdb_check_for_obsolete_leaks(vd, zcb); - } + vdev_t *rvd = spa->spa_root_vdev; + for (unsigned c = 0; c < rvd->vdev_children; c++) { + vdev_t *vd = rvd->vdev_child[c]; +#if DEBUG + metaslab_group_t *mg = vd->vdev_mg; +#endif - for (uint64_t m = 0; m < vd->vdev_ms_count; m++) { - metaslab_t *msp = vd->vdev_ms[m]; - ASSERT3P(mg, ==, msp->ms_group); + if (zcb->zcb_vd_obsolete_counts[c] != NULL) { + leaks |= zdb_check_for_obsolete_leaks(vd, zcb); + } - /* - * ms_allocatable has been overloaded - * to contain allocated segments. Now that - * we finished traversing all blocks, any - * block that remains in the ms_allocatable - * represents an allocated block that we - * did not claim during the traversal. - * Claimed blocks would have been removed - * from the ms_allocatable. For indirect - * vdevs, space remaining in the tree - * represents parts of the mapping that are - * not referenced, which is not a bug. - */ - if (vd->vdev_ops == &vdev_indirect_ops) { - range_tree_vacate(msp->ms_allocatable, - NULL, NULL); - } else { - range_tree_vacate(msp->ms_allocatable, - zdb_leak, vd); - } + for (uint64_t m = 0; m < vd->vdev_ms_count; m++) { + metaslab_t *msp = vd->vdev_ms[m]; + ASSERT3P(mg, ==, msp->ms_group); - if (msp->ms_loaded) { - msp->ms_loaded = B_FALSE; - } + /* + * ms_allocatable has been overloaded + * to contain allocated segments. Now that + * we finished traversing all blocks, any + * block that remains in the ms_allocatable + * represents an allocated block that we + * did not claim during the traversal. + * Claimed blocks would have been removed + * from the ms_allocatable. For indirect + * vdevs, space remaining in the tree + * represents parts of the mapping that are + * not referenced, which is not a bug. + */ + if (vd->vdev_ops == &vdev_indirect_ops) { + range_tree_vacate(msp->ms_allocatable, + NULL, NULL); + } else { + range_tree_vacate(msp->ms_allocatable, + zdb_leak, vd); } + + if (msp->ms_loaded) { + msp->ms_loaded = B_FALSE; + } } - umem_free(zcb->zcb_vd_obsolete_counts, - rvd->vdev_children * sizeof (uint32_t *)); - zcb->zcb_vd_obsolete_counts = NULL; } + + umem_free(zcb->zcb_vd_obsolete_counts, + rvd->vdev_children * sizeof (uint32_t *)); + zcb->zcb_vd_obsolete_counts = NULL; + return (leaks); } @@ -3709,6 +3773,7 @@ dump_block_stats(spa_t *spa) uint64_t norm_alloc, norm_space, total_alloc, total_found; int flags = TRAVERSE_PRE | TRAVERSE_PREFETCH_METADATA | TRAVERSE_HARD; boolean_t leaks = B_FALSE; + int err; bzero(&zcb, sizeof (zcb)); (void) printf("\nTraversing all blocks %s%s%s%s%s...\n\n", @@ -3719,13 +3784,18 @@ dump_block_stats(spa_t *spa) !dump_opt['L'] ? "nothing leaked " : ""); /* - * Load all space maps as SM_ALLOC maps, then traverse the pool - * claiming each block we discover. If the pool is perfectly - * consistent, the space maps will be empty when we're done. - * Anything left over is a leak; any block we can't claim (because - * it's not part of any space map) is a double allocation, - * reference to a freed block, or an unclaimed log block. + * When leak detection is enabled we load all space maps as SM_ALLOC + * maps, then traverse the pool claiming each block we discover. If + * the pool is perfectly consistent, the segment trees will be empty + * when we're done. Anything left over is a leak; any block we can't + * claim (because it's not part of any space map) is a double + * allocation, reference to a freed block, or an unclaimed log block. + * + * When leak detection is disabled (-L option) we still traverse the + * pool claiming each block we discover, but we skip opening any space + * maps. */ + bzero(&zcb, sizeof (zdb_cb_t)); zdb_leak_init(spa, &zcb); /* @@ -3751,8 +3821,10 @@ dump_block_stats(spa_t *spa) flags |= TRAVERSE_PREFETCH_DATA; zcb.zcb_totalasize = metaslab_class_get_alloc(spa_normal_class(spa)); + zcb.zcb_totalasize += metaslab_class_get_alloc(spa_special_class(spa)); + zcb.zcb_totalasize += metaslab_class_get_alloc(spa_dedup_class(spa)); zcb.zcb_start = zcb.zcb_lastprint = gethrtime(); - zcb.zcb_haderrors |= traverse_pool(spa, 0, flags, zdb_blkptr_cb, &zcb); + err = traverse_pool(spa, 0, flags, zdb_blkptr_cb, &zcb); /* * If we've traversed the data blocks then we need to wait for those @@ -3768,6 +3840,12 @@ dump_block_stats(spa_t *spa) } } + /* + * Done after zio_wait() since zcb_haderrors is modified in + * zdb_blkptr_done() + */ + zcb.zcb_haderrors |= err; + if (zcb.zcb_haderrors) { (void) printf("\nError counts:\n\n"); (void) printf("\t%5s %s\n", "errno", "count"); @@ -3789,15 +3867,17 @@ dump_block_stats(spa_t *spa) norm_alloc = metaslab_class_get_alloc(spa_normal_class(spa)); norm_space = metaslab_class_get_space(spa_normal_class(spa)); - total_alloc = norm_alloc + metaslab_class_get_alloc(spa_log_class(spa)); + total_alloc = norm_alloc + + metaslab_class_get_alloc(spa_log_class(spa)) + + metaslab_class_get_alloc(spa_special_class(spa)) + + metaslab_class_get_alloc(spa_dedup_class(spa)); total_found = tzb->zb_asize - zcb.zcb_dedup_asize + zcb.zcb_removing_size + zcb.zcb_checkpoint_size; - if (total_found == total_alloc) { - if (!dump_opt['L']) - (void) printf("\n\tNo leaks (block sum matches space" - " maps exactly)\n"); - } else { + if (total_found == total_alloc && !dump_opt['L']) { + (void) printf("\n\tNo leaks (block sum matches space" + " maps exactly)\n"); + } else if (!dump_opt['L']) { (void) printf("block traversal size %llu != alloc %llu " "(%s %lld)\n", (u_longlong_t)total_found, @@ -3811,31 +3891,50 @@ dump_block_stats(spa_t *spa) return (2); (void) printf("\n"); - (void) printf("\tbp count: %10llu\n", + (void) printf("\t%-16s %14llu\n", "bp count:", (u_longlong_t)tzb->zb_count); - (void) printf("\tganged count: %10llu\n", + (void) printf("\t%-16s %14llu\n", "ganged count:", (longlong_t)tzb->zb_gangs); - (void) printf("\tbp logical: %10llu avg: %6llu\n", + (void) printf("\t%-16s %14llu avg: %6llu\n", "bp logical:", (u_longlong_t)tzb->zb_lsize, (u_longlong_t)(tzb->zb_lsize / tzb->zb_count)); - (void) printf("\tbp physical: %10llu avg:" - " %6llu compression: %6.2f\n", - (u_longlong_t)tzb->zb_psize, + (void) printf("\t%-16s %14llu avg: %6llu compression: %6.2f\n", + "bp physical:", (u_longlong_t)tzb->zb_psize, (u_longlong_t)(tzb->zb_psize / tzb->zb_count), (double)tzb->zb_lsize / tzb->zb_psize); - (void) printf("\tbp allocated: %10llu avg:" - " %6llu compression: %6.2f\n", - (u_longlong_t)tzb->zb_asize, + (void) printf("\t%-16s %14llu avg: %6llu compression: %6.2f\n", + "bp allocated:", (u_longlong_t)tzb->zb_asize, (u_longlong_t)(tzb->zb_asize / tzb->zb_count), (double)tzb->zb_lsize / tzb->zb_asize); - (void) printf("\tbp deduped: %10llu ref>1:" - " %6llu deduplication: %6.2f\n", - (u_longlong_t)zcb.zcb_dedup_asize, + (void) printf("\t%-16s %14llu ref>1: %6llu deduplication: %6.2f\n", + "bp deduped:", (u_longlong_t)zcb.zcb_dedup_asize, (u_longlong_t)zcb.zcb_dedup_blocks, (double)zcb.zcb_dedup_asize / tzb->zb_asize + 1.0); - (void) printf("\tSPA allocated: %10llu used: %5.2f%%\n", + (void) printf("\t%-16s %14llu used: %5.2f%%\n", "Normal class:", (u_longlong_t)norm_alloc, 100.0 * norm_alloc / norm_space); + if (spa_special_class(spa)->mc_rotor != NULL) { + uint64_t alloc = metaslab_class_get_alloc( + spa_special_class(spa)); + uint64_t space = metaslab_class_get_space( + spa_special_class(spa)); + + (void) printf("\t%-16s %14llu used: %5.2f%%\n", + "Special class", (u_longlong_t)alloc, + 100.0 * alloc / space); + } + + if (spa_dedup_class(spa)->mc_rotor != NULL) { + uint64_t alloc = metaslab_class_get_alloc( + spa_dedup_class(spa)); + uint64_t space = metaslab_class_get_space( + spa_dedup_class(spa)); + + (void) printf("\t%-16s %14llu used: %5.2f%%\n", + "Dedup class", (u_longlong_t)alloc, + 100.0 * alloc / space); + } + for (bp_embedded_type_t i = 0; i < NUM_BP_EMBEDDED_TYPES; i++) { if (zcb.zcb_embedded_blocks[i] == 0) continue; @@ -3857,6 +3956,10 @@ dump_block_stats(spa_t *spa) (void) printf("\tDittoed blocks on same vdev: %llu\n", (longlong_t)tzb->zb_ditto_samevdev); } + if (tzb->zb_ditto_same_ms != 0) { + (void) printf("\tDittoed blocks in same metaslab: %llu\n", + (longlong_t)tzb->zb_ditto_same_ms); + } for (uint64_t v = 0; v < spa->spa_root_vdev->vdev_children; v++) { vdev_t *vd = spa->spa_root_vdev->vdev_child[v]; @@ -4114,7 +4217,6 @@ verify_device_removal_feature_counts(spa_t *spa) spa->spa_meta_objset, scip->scip_prev_obsolete_sm_object, 0, vd->vdev_asize, 0)); - space_map_update(prev_obsolete_sm); dump_spacemap(spa->spa_meta_objset, prev_obsolete_sm); (void) printf("\n"); space_map_close(prev_obsolete_sm); @@ -4320,7 +4422,8 @@ verify_checkpoint_sm_entry_cb(space_map_entry_t *sme, * their respective ms_allocateable trees should not contain them. */ mutex_enter(&ms->ms_lock); - range_tree_verify(ms->ms_allocatable, sme->sme_offset, sme->sme_run); + range_tree_verify_not_present(ms->ms_allocatable, + sme->sme_offset, sme->sme_run); mutex_exit(&ms->ms_lock); return (0); @@ -4383,7 +4486,6 @@ verify_checkpoint_vdev_spacemaps(spa_t *checkpoint, sp VERIFY0(space_map_open(&checkpoint_sm, spa_meta_objset(current), checkpoint_sm_obj, 0, current_vd->vdev_asize, current_vd->vdev_ashift)); - space_map_update(checkpoint_sm); verify_checkpoint_sm_entry_cb_arg_t vcsec; vcsec.vcsec_vd = ckpoint_vd; @@ -4391,6 +4493,7 @@ verify_checkpoint_vdev_spacemaps(spa_t *checkpoint, sp vcsec.vcsec_num_entries = space_map_length(checkpoint_sm) / sizeof (uint64_t); VERIFY0(space_map_iterate(checkpoint_sm, + space_map_length(checkpoint_sm), verify_checkpoint_sm_entry_cb, &vcsec)); dump_spacemap(current->spa_meta_objset, checkpoint_sm); space_map_close(checkpoint_sm); @@ -4470,7 +4573,7 @@ verify_checkpoint_ms_spacemaps(spa_t *checkpoint, spa_ * are part of the checkpoint were freed by mistake. */ range_tree_walk(ckpoint_msp->ms_allocatable, - (range_tree_func_t *)range_tree_verify, + (range_tree_func_t *)range_tree_verify_not_present, current_msp->ms_allocatable); } } @@ -4482,6 +4585,8 @@ verify_checkpoint_ms_spacemaps(spa_t *checkpoint, spa_ static void verify_checkpoint_blocks(spa_t *spa) { + ASSERT(!dump_opt['L']); + spa_t *checkpoint_spa; char *checkpoint_pool; nvlist_t *config = NULL; @@ -4547,7 +4652,6 @@ dump_leftover_checkpoint_blocks(spa_t *spa) VERIFY0(space_map_open(&checkpoint_sm, spa_meta_objset(spa), checkpoint_sm_obj, 0, vd->vdev_asize, vd->vdev_ashift)); - space_map_update(checkpoint_sm); dump_spacemap(spa->spa_meta_objset, checkpoint_sm); space_map_close(checkpoint_sm); } Modified: stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri May 22 16:29:09 2020 (r361390) +++ stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri May 22 16:51:00 2020 (r361391) @@ -1134,8 +1134,23 @@ This feature must be enabled to be used .Po see .Xr zpool-features 7 .Pc . +.It Sy special_small_blocks Ns = Ns Ar size +This value represents the threshold block size for including small file +blocks into the special allocation class. +Blocks smaller than or equal to this value will be assigned to the special +allocation class while greater blocks will be assigned to the regular class. +Valid values are zero or a power of two from 512B up to 128K. +The default size is 0 which means no small file blocks will be allocated in +the special class. +.Pp +Before setting this property, a special class vdev must be added to the +pool. +See +.Xr zpool 8 +for more details on the special allocation class. .It Sy mountpoint Ns = Ns Ar path | Cm none | legacy -Controls the mount point used for this file system. See the +Controls the mount point used for this file system. +See the .Qq Sx Mount Points section for more information on how this property is used. .Pp @@ -3021,7 +3036,7 @@ property of the filesystem or volume which is received To use this flag, the storage pool must have the .Sy extensible_dataset feature enabled. See -.Xr zpool-features 5 +.Xr zpool-features 7 for details on ZFS feature flags. .El .It Xo Modified: stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Fri May 22 16:29:09 2020 (r361390) +++ stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Fri May 22 16:51:00 2020 (r361391) @@ -632,6 +632,25 @@ and will return to being once all filesystems that have ever had their checksum set to .Sy skein are destroyed. +.It Sy allocation_classes +.Bl -column "READ\-ONLY COMPATIBLE" "com.intel:allocation_classes" +.It GUID Ta com.intel:allocation_classes +.It READ\-ONLY COMPATIBLE Ta yes +.It DEPENDENCIES Ta none +.El +.Pp +This feature enables support for separate allocation classes. +.Pp +This feature becomes +.Sy active +when a dedicated allocation class vdev +(dedup or special) is created with +.Dq zpool create +or +.Dq zpool add . +With device removal, it can be returned to the +.Sy enabled +state if all the top-level vdevs from an allocation class are removed. .El .Sh SEE ALSO .Xr zpool 8 Modified: stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri May 22 16:29:09 2020 (r361390) +++ stable/12/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri May 22 16:51:00 2020 (r361391) @@ -24,6 +24,8 @@ .\" Copyright (c) 2012, 2017 by Delphix. All Rights Reserved. .\" Copyright 2017 Nexenta Systems, Inc. .\" Copyright (c) 2017 Datto Inc. +.\" Copyright (c) 2017 George Melikov. All Rights Reserved. +.\" Copyright 2019 Joyent, Inc. .\" .\" $FreeBSD$ .\" @@ -38,7 +40,7 @@ .Op Fl \&? .Nm .Cm add -.Op Fl fn +.Op Fl fgLnP .Ar pool vdev ... .Nm .Cm attach @@ -127,17 +129,19 @@ .Op Ar device Ns ... .Nm .Cm iostat -.Op Fl T Cm d Ns | Ns Cm u .Op Fl v +.Op Fl T Cm d Ns | Ns Cm u +.Op Fl gLP .Op Ar pool .Ar ... +.Op Ar inverval Op Ar count .Nm .Cm labelclear .Op Fl f .Ar device .Nm .Cm list -.Op Fl Hpv +.Op Fl HgLpPv .Op Fl o Ar property Ns Op , Ns Ar ... .Op Fl T Cm d Ns | Ns Cm u .Op Ar pool @@ -179,7 +183,7 @@ .Ar property Ns = Ns Ar value pool .Nm .Cm split -.Op Fl n +.Op Fl gLnP .Op Fl R Ar altroot .Op Fl o Ar mntopts .Op Fl o Ar property Ns = Ns Ar value @@ -187,7 +191,7 @@ .Op Ar device ... .Nm .Cm status -.Op Fl Dvx +.Op Fl DgLPvx .Op Fl T Cm d Ns | Ns Cm u .Op Ar pool .Ar ... @@ -320,11 +324,27 @@ types are not supported for the intent log. For more i see the .Qq Sx Intent Log section. +.It Sy dedup +A device dedicated solely for allocating dedup data. +The redundancy of this device should match the redundancy of the other normal +devices in the pool. +If more than one dedup device is specified, then allocations are load-balanced +between devices. +.It Sy special +A device dedicated solely for allocating various kinds of internal metadata, +and optionally small file data. +The redundancy of this device should match the redundancy of the other normal +devices in the pool. +If more than one special device is specified, then allocations are +load-balanced between devices. +.Pp +For more information on special allocations, see the +.Sx Special Allocation Class +section. .It Sy cache -A device used to cache storage pool data. A cache device cannot be configured -as a mirror or -.No raidz -group. For more information, see the +A device used to cache storage pool data. +A cache device cannot be configured as a mirror or raidz group. +For more information, see the .Qq Sx Cache Devices section. .El @@ -602,6 +622,31 @@ zfs properties) may be unenforceable while a checkpoin checkpoint is allowed to consume the dataset's reservation. Finally, data that is part of the checkpoint but has been freed in the current state of the pool won't be scanned during a scrub. +.Ss Special Allocation Class +The allocations in the special class are dedicated to specific block types. +By default this includes all metadata, the indirect blocks of user data, and +any dedup data. +The class can also be provisioned to accept a limited percentage of small file +data blocks. +.Pp +A pool must always have at least one general (non-specified) vdev before +other devices can be assigned to the special class. +If the special class becomes full, then allocations intended for it will spill +back into the normal class. +.Pp +Dedup data can be excluded from the special class by setting the +.Sy vfs.zfs.ddt_data_is_special +sysctl to false (0). +.Pp +Inclusion of small file blocks in the special class is opt-in. +Each dataset can control the size of small file blocks allowed in the special +class by setting the +.Sy special_small_blocks +dataset property. +It defaults to zero so you must opt-in by setting it to a non-zero value. +See +.Xr zfs 1M +for more info on setting this property. .Ss Properties Each pool has several properties associated with it. Some properties are read-only statistics while others are configurable and change the behavior of @@ -872,7 +917,7 @@ Displays a help message. .It Xo .Nm .Cm add -.Op Fl fn +.Op Fl fgLnP .Ar pool vdev ... .Xc .Pp @@ -891,11 +936,30 @@ Forces use of .Ar vdev , even if they appear in use or specify a conflicting replication level. Not all devices can be overridden in this manner. +.It Fl g +Display +.Ar vdev , +GUIDs instead of the normal device names. +These GUIDs can be used in place of +device names for the zpool detach/offline/remove/replace commands. +.It Fl L +Display real paths for +.Ar vdev Ns s +resolving all symbolic links. +This can be used to look up the current block +device name regardless of the /dev/disk/ path used to open it. .It Fl n Displays the configuration that would be used without actually adding the .Ar vdev Ns s. -The actual pool creation can still fail due to insufficient privileges or device -sharing. +The actual pool creation can still fail due to insufficient privileges or +device sharing. +.It Fl P +Display real paths for +.Ar vdev Ns s +instead of only the last component of the path. +This can be used in conjunction with the +.Fl L +flag. .El .It Xo .Nm @@ -1512,7 +1576,7 @@ with no flags on the relevant target devices. .Nm .Cm iostat .Op Fl T Cm d Ns | Ns Cm u -.Op Fl v +.Op Fl gLPv .Op Ar pool .Ar ... .Op Ar interval Op Ar count @@ -1544,10 +1608,25 @@ Use modifier .Cm u for unixtime .Pq equals Qq Ic date +%s . +.It Fl g +Display vdev GUIDs instead of the normal device names. +These GUIDs can be used in place of device names for the zpool +detach/offline/remove/replace commands. +.It Fl L +Display real paths for vdevs resolving all symbolic links. +This can be used to look up the current block device name regardless of the +.Pa /dev/disk/ +path used to open it. +.It Fl P +Display full paths for vdevs instead of only the last component of +the path. +This can be used in conjunction with the +.Fl L +flag. .It Fl v -Verbose statistics. Reports usage statistics for individual -.No vdev Ns s -within the pool, in addition to the pool-wide statistics. +Verbose statistics. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri May 22 16:53: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 A99812CE538; Fri, 22 May 2020 16:53: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 49TCHS2vWsz4ZBj; Fri, 22 May 2020 16:53: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 5E6F22194C; Fri, 22 May 2020 16:53: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 04MGre8B013697; Fri, 22 May 2020 16:53:40 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MGre6i013696; Fri, 22 May 2020 16:53:40 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202005221653.04MGre6i013696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Fri, 22 May 2020 16:53:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361392 - head/secure/lib/libcrypto X-SVN-Group: head X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: head/secure/lib/libcrypto X-SVN-Commit-Revision: 361392 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, 22 May 2020 16:53:40 -0000 Author: gordon Date: Fri May 22 16:53:39 2020 New Revision: 361392 URL: https://svnweb.freebsd.org/changeset/base/361392 Log: Remove support for SSLv3 from the OpenSSL build. This is the default configuration in OpenSSL 1.1.1 already. This moves to align with that default. Reported by: jmg Approved by: jkim, cem, emaste, philip Differential Revision: https://reviews.freebsd.org/D24945 Modified: head/secure/lib/libcrypto/opensslconf.h.in Modified: head/secure/lib/libcrypto/opensslconf.h.in ============================================================================== --- head/secure/lib/libcrypto/opensslconf.h.in Fri May 22 16:51:00 2020 (r361391) +++ head/secure/lib/libcrypto/opensslconf.h.in Fri May 22 16:53:39 2020 (r361392) @@ -76,6 +76,12 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL3 +# define OPENSSL_NO_SSL3 +#endif +#ifndef OPENSSL_NO_SSL3_METHOD +# define OPENSSL_NO_SSL3_METHOD +#endif #ifndef OPENSSL_NO_UBSAN # define OPENSSL_NO_UBSAN #endif From owner-svn-src-all@freebsd.org Fri May 22 17:21: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 AD5A32CEED5; Fri, 22 May 2020 17:21:22 +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 49TCvQ45Q7z4bNY; Fri, 22 May 2020 17:21:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87F7421F99; Fri, 22 May 2020 17:21:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MHLMo7027279; Fri, 22 May 2020 17:21:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MHLM8Z027278; Fri, 22 May 2020 17:21:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005221721.04MHLM8Z027278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 22 May 2020 17:21:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361393 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 361393 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, 22 May 2020 17:21:22 -0000 Author: jhb Date: Fri May 22 17:21:22 2020 New Revision: 361393 URL: https://svnweb.freebsd.org/changeset/base/361393 Log: Correct the minimum key length for Camellia to 16 bytes (128 bits). MFC after: 1 week Modified: head/sys/opencrypto/cryptodev.h Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Fri May 22 16:53:39 2020 (r361392) +++ head/sys/opencrypto/cryptodev.h Fri May 22 17:21:22 2020 (r361393) @@ -134,7 +134,7 @@ #define AES_MAX_KEY RIJNDAEL_MAX_KEY #define AES_XTS_MIN_KEY (2 * AES_MIN_KEY) #define AES_XTS_MAX_KEY (2 * AES_MAX_KEY) -#define CAMELLIA_MIN_KEY 8 +#define CAMELLIA_MIN_KEY 16 #define CAMELLIA_MAX_KEY 32 /* Maximum hash algorithm result length */ From owner-svn-src-all@freebsd.org Fri May 22 17:23:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B06692CEEDE; Fri, 22 May 2020 17:23:09 +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 49TCxT4Dbcz4bS1; Fri, 22 May 2020 17:23:09 +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 72F1822480; Fri, 22 May 2020 17:23:09 +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 04MHN953032116; Fri, 22 May 2020 17:23:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MHN9dx032115; Fri, 22 May 2020 17:23:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005221723.04MHN9dx032115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 May 2020 17:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361394 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 361394 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, 22 May 2020 17:23:09 -0000 Author: kib Date: Fri May 22 17:23:09 2020 New Revision: 361394 URL: https://svnweb.freebsd.org/changeset/base/361394 Log: Convert linkmap_add() and linkmap_delete() to style(8). Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri May 22 17:21:22 2020 (r361393) +++ head/libexec/rtld-elf/rtld.c Fri May 22 17:23:09 2020 (r361394) @@ -4028,49 +4028,50 @@ rtld_dirname_abs(const char *path, char *base) static void linkmap_add(Obj_Entry *obj) { - struct link_map *l = &obj->linkmap; - struct link_map *prev; + struct link_map *l, *prev; - obj->linkmap.l_name = obj->path; - obj->linkmap.l_base = obj->mapbase; - obj->linkmap.l_ld = obj->dynamic; - obj->linkmap.l_addr = obj->relocbase; + l = &obj->linkmap; + l->l_name = obj->path; + l->l_base = obj->mapbase; + l->l_ld = obj->dynamic; + l->l_addr = obj->relocbase; - if (r_debug.r_map == NULL) { - r_debug.r_map = l; - return; - } + if (r_debug.r_map == NULL) { + r_debug.r_map = l; + return; + } - /* - * Scan to the end of the list, but not past the entry for the - * dynamic linker, which we want to keep at the very end. - */ - for (prev = r_debug.r_map; - prev->l_next != NULL && prev->l_next != &obj_rtld.linkmap; - prev = prev->l_next) - ; + /* + * Scan to the end of the list, but not past the entry for the + * dynamic linker, which we want to keep at the very end. + */ + for (prev = r_debug.r_map; + prev->l_next != NULL && prev->l_next != &obj_rtld.linkmap; + prev = prev->l_next) + ; - /* Link in the new entry. */ - l->l_prev = prev; - l->l_next = prev->l_next; - if (l->l_next != NULL) - l->l_next->l_prev = l; - prev->l_next = l; + /* Link in the new entry. */ + l->l_prev = prev; + l->l_next = prev->l_next; + if (l->l_next != NULL) + l->l_next->l_prev = l; + prev->l_next = l; } static void linkmap_delete(Obj_Entry *obj) { - struct link_map *l = &obj->linkmap; + struct link_map *l; - if (l->l_prev == NULL) { - if ((r_debug.r_map = l->l_next) != NULL) - l->l_next->l_prev = NULL; - return; - } + l = &obj->linkmap; + if (l->l_prev == NULL) { + if ((r_debug.r_map = l->l_next) != NULL) + l->l_next->l_prev = NULL; + return; + } - if ((l->l_prev->l_next = l->l_next) != NULL) - l->l_next->l_prev = l->l_prev; + if ((l->l_prev->l_next = l->l_next) != NULL) + l->l_next->l_prev = l->l_prev; } /* From owner-svn-src-all@freebsd.org Fri May 22 17:23: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 EFA042CEFD4; Fri, 22 May 2020 17:23:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TCy75Z1rz4bkq; Fri, 22 May 2020 17:23:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA6AD2229F; Fri, 22 May 2020 17:23:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MHNhTL032197; Fri, 22 May 2020 17:23:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MHNhUF032196; Fri, 22 May 2020 17:23:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005221723.04MHNhUF032196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 22 May 2020 17:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361395 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 361395 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, 22 May 2020 17:23:44 -0000 Author: jhb Date: Fri May 22 17:23:43 2020 New Revision: 361395 URL: https://svnweb.freebsd.org/changeset/base/361395 Log: Update name of description of vfs.ffs.setsize in comment. Previously it used the name 'adjsize' instead of 'setsize'. Modified: head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Fri May 22 17:23:09 2020 (r361394) +++ head/sys/ufs/ffs/ffs_alloc.c Fri May 22 17:23:43 2020 (r361395) @@ -3065,7 +3065,7 @@ ffs_fserr(fs, inum, cp) * the count to zero will cause the inode to be freed. * adjblkcnt(inode, amt) - adjust the number of blocks used by the * inode by the specified amount. - * adjsize(inode, size) - set the size of the inode to the + * setsize(inode, size) - set the size of the inode to the * specified size. * adjndir, adjbfree, adjifree, adjffree, adjnumclusters(amt) - * adjust the superblock summary. From owner-svn-src-all@freebsd.org Fri May 22 17:30: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 37B3D2CF504; Fri, 22 May 2020 17:30:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TD650n5bz4c6M; Fri, 22 May 2020 17:30:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1614822405; Fri, 22 May 2020 17:30:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MHUa25032595; Fri, 22 May 2020 17:30:36 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MHUaVw032594; Fri, 22 May 2020 17:30:36 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202005221730.04MHUaVw032594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 22 May 2020 17:30:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r361396 - releng/11.4/etc/ntp X-SVN-Group: releng X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: releng/11.4/etc/ntp X-SVN-Commit-Revision: 361396 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, 22 May 2020 17:30:37 -0000 Author: delphij Date: Fri May 22 17:30:36 2020 New Revision: 361396 URL: https://svnweb.freebsd.org/changeset/base/361396 Log: MFS r361354: MFC r361260: Update leap-seconds to leap-seconds.3676924800. Approved by: re (gjb) Modified: releng/11.4/etc/ntp/leap-seconds Directory Properties: releng/11.4/ (props changed) Modified: releng/11.4/etc/ntp/leap-seconds ============================================================================== --- releng/11.4/etc/ntp/leap-seconds Fri May 22 17:23:43 2020 (r361395) +++ releng/11.4/etc/ntp/leap-seconds Fri May 22 17:30:36 2020 (r361396) @@ -204,10 +204,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C58 -# File expires on: 28 June 2020 +# Updated through IERS Bulletin C59 +# File expires on: 28 December 2020 # -#@ 3802291200 +#@ 3818102400 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -252,4 +252,4 @@ # the hash line is also ignored in the # computation. # -#h f28827d2 f263b6c3 ec0f19eb a3e0dbf0 97f3fa30 +#h a1c168ae 27c79a7d 9dddcfc3 bcfe616b 2e2c44ea From owner-svn-src-all@freebsd.org Fri May 22 17:45: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 6412D2CFA1B; Fri, 22 May 2020 17:45:08 +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 49TDQr25Dvz4d0r; Fri, 22 May 2020 17:45:08 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43062225A6; Fri, 22 May 2020 17:45:08 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MHj8uN044443; Fri, 22 May 2020 17:45:08 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MHj7Pv044441; Fri, 22 May 2020 17:45:07 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202005221745.04MHj7Pv044441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 22 May 2020 17:45:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361397 - head/usr.sbin/certctl X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/usr.sbin/certctl X-SVN-Commit-Revision: 361397 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, 22 May 2020 17:45:08 -0000 Author: brooks Date: Fri May 22 17:45:07 2020 New Revision: 361397 URL: https://svnweb.freebsd.org/changeset/base/361397 Log: 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 Reviewed by: kevans Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24932 Modified: head/usr.sbin/certctl/certctl.8 head/usr.sbin/certctl/certctl.sh Modified: head/usr.sbin/certctl/certctl.8 ============================================================================== --- head/usr.sbin/certctl/certctl.8 Fri May 22 17:30:36 2020 (r361396) +++ head/usr.sbin/certctl/certctl.8 Fri May 22 17:45:07 2020 (r361397) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2019 +.Dd May 22, 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: Modified: head/usr.sbin/certctl/certctl.sh ============================================================================== --- head/usr.sbin/certctl/certctl.sh Fri May 22 17:30:36 2020 (r361396) +++ head/usr.sbin/certctl/certctl.sh Fri May 22 17:45:07 2020 (r361397) @@ -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" && $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 Fri May 22 17:52: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 4DCDD2CF159; Fri, 22 May 2020 17:52:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TDZy1Rv7z4dNN; Fri, 22 May 2020 17:52:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13F702282A; Fri, 22 May 2020 17:52:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MHq9Hl050209; Fri, 22 May 2020 17:52:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MHq9cv050207; Fri, 22 May 2020 17:52:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005221752.04MHq9cv050207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 May 2020 17:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361398 - in head: lib/libc/gen libexec/rtld-elf sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libc/gen libexec/rtld-elf sys/sys X-SVN-Commit-Revision: 361398 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, 22 May 2020 17:52:10 -0000 Author: kib Date: Fri May 22 17:52:09 2020 New Revision: 361398 URL: https://svnweb.freebsd.org/changeset/base/361398 Log: Implement Solaris-like link_map l_refname member. The implementation is based on the public documentation, in particular dlinfo(3) from Solaris. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/gen/dlinfo.3 head/libexec/rtld-elf/rtld.c head/sys/sys/link_elf.h Modified: head/lib/libc/gen/dlinfo.3 ============================================================================== --- head/lib/libc/gen/dlinfo.3 Fri May 22 17:45:07 2020 (r361397) +++ head/lib/libc/gen/dlinfo.3 Fri May 22 17:52:09 2020 (r361398) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 19, 2020 +.Dd May 21, 2020 .Dt DLINFO 3 .Os .Sh NAME @@ -111,6 +111,7 @@ const void *l_ld; /* Pointer to .dynamic in m struct link_map *l_next, /* linked list of mapped libs */ *l_prev; caddr_t l_addr; /* Load Offset of library */ +const char *l_refname; /* Object this one filters for */ .Ed .Bl -tag -width ".Va l_addr" .It Va l_base @@ -133,6 +134,11 @@ structure on the link-map list. The load offset of the object, that is, the difference between the actual load address and the base virtual address the object was linked at. +.It Va l_refname +A name of the object this object filters for, if any. +If there are more then one filtee, a name from the first +.Dv DT_FILTER +dynamic entry is supplied. .El .It Dv RTLD_DI_SERINFO Retrieve the library search paths associated with the given Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri May 22 17:45:07 2020 (r361397) +++ head/libexec/rtld-elf/rtld.c Fri May 22 17:52:09 2020 (r361398) @@ -1207,6 +1207,9 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_D *needed_filtees_tail = nep; needed_filtees_tail = &nep->next; + + if (obj->linkmap.l_refname == NULL) + obj->linkmap.l_refname = (char *)dynp->d_un.d_val; } break; @@ -1402,6 +1405,10 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_D } obj->dynsymcount += obj->symndx_gnu; } + + if (obj->linkmap.l_refname != NULL) + obj->linkmap.l_refname = obj->strtab + (unsigned long)obj-> + linkmap.l_refname; } static bool Modified: head/sys/sys/link_elf.h ============================================================================== --- head/sys/sys/link_elf.h Fri May 22 17:45:07 2020 (r361397) +++ head/sys/sys/link_elf.h Fri May 22 17:52:09 2020 (r361398) @@ -65,6 +65,7 @@ typedef struct link_map { const void *l_ld; /* Pointer to .dynamic in memory */ struct link_map *l_next, *l_prev; /* linked list of of mapped libs */ caddr_t l_addr; /* Load Offset of library */ + const char *l_refname; /* object we are filtering for */ } Link_map; struct r_debug { From owner-svn-src-all@freebsd.org Fri May 22 18:03: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 7AF202CFDB0; Fri, 22 May 2020 18:03:15 +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 49TDql1PPjz4f7m; Fri, 22 May 2020 18:03:15 +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 2B67E22A18; Fri, 22 May 2020 18:03:15 +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 04MI3FmL056892; Fri, 22 May 2020 18:03:15 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MI3Fvu056891; Fri, 22 May 2020 18:03:15 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005221803.04MI3Fvu056891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 22 May 2020 18:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361399 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 361399 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, 22 May 2020 18:03:15 -0000 Author: asomers Date: Fri May 22 18:03:14 2020 New Revision: 361399 URL: https://svnweb.freebsd.org/changeset/base/361399 Log: Disable nullfs cacheing on top of fusefs Nullfs cacheing can keep a large number of vnodes active. That results in more active FUSE file handles, causing some FUSE servers to use extra resources. Disable nullfs cacheing for fusefs, just like we already do for NFSv4. PR: 245688 Reported by: MooseFS FreeBSD Team MFC after: 2 weeks Modified: head/sys/fs/fuse/fuse_vfsops.c Modified: head/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- head/sys/fs/fuse/fuse_vfsops.c Fri May 22 17:52:09 2020 (r361398) +++ head/sys/fs/fuse/fuse_vfsops.c Fri May 22 18:03:14 2020 (r361399) @@ -425,6 +425,11 @@ fuse_vfsop_mount(struct mount *mp) */ mp->mnt_flag &= ~MNT_LOCAL; mp->mnt_kern_flag |= MNTK_USES_BCACHE; + /* + * Disable nullfs cacheing because it can consume too many resources in + * the FUSE server. + */ + mp->mnt_kern_flag |= MNTK_NULL_NOCACHE; MNT_IUNLOCK(mp); /* We need this here as this slot is used by getnewvnode() */ mp->mnt_stat.f_iosize = maxbcachebuf; From owner-svn-src-all@freebsd.org Fri May 22 18:10: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 16CA22D8012; Fri, 22 May 2020 18:10:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TF0Q6vlQz4fSc; Fri, 22 May 2020 18:10:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6F3A227E0; Fri, 22 May 2020 18:10:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MIAksX060357; Fri, 22 May 2020 18:10:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MIAkHv060356; Fri, 22 May 2020 18:10:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202005221810.04MIAkHv060356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 22 May 2020 18:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361400 - head/sys/dev/iscsi X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/iscsi X-SVN-Commit-Revision: 361400 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, 22 May 2020 18:10:47 -0000 Author: mav Date: Fri May 22 18:10:46 2020 New Revision: 361400 URL: https://svnweb.freebsd.org/changeset/base/361400 Log: Do not try to fill socket send buffer to the last byte. Setting so_snd.sb_lowat to at least 1/8 of the socket buffer size allows send thread more actively use PDUs coalescing, that dramatically reduces TCP lock congestion and number of context switches, when the socket is full and PDUs are small. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/dev/iscsi/icl_soft.c Modified: head/sys/dev/iscsi/icl_soft.c ============================================================================== --- head/sys/dev/iscsi/icl_soft.c Fri May 22 18:03:14 2020 (r361399) +++ head/sys/dev/iscsi/icl_soft.c Fri May 22 18:10:46 2020 (r361400) @@ -914,7 +914,8 @@ icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu "have %ld, need %ld", available, size); #endif - so->so_snd.sb_lowat = size; + so->so_snd.sb_lowat = max(size, + so->so_snd.sb_hiwat / 8); SOCKBUF_UNLOCK(&so->so_snd); return; } From owner-svn-src-all@freebsd.org Fri May 22 18:11: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 38CD72D8045; Fri, 22 May 2020 18:11:20 +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 49TF14190Wz4fJh; Fri, 22 May 2020 18:11:20 +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 0989722CCB; Fri, 22 May 2020 18:11:20 +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 04MIBKUb060461; Fri, 22 May 2020 18:11:20 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MIBILR060451; Fri, 22 May 2020 18:11:18 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005221811.04MIBILR060451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 22 May 2020 18:11:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361401 - in head: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Commit-Revision: 361401 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, 22 May 2020 18:11:20 -0000 Author: asomers Date: Fri May 22 18:11:17 2020 New Revision: 361401 URL: https://svnweb.freebsd.org/changeset/base/361401 Log: Fix issues with FUSE_ACCESS when default_permissions is disabled This patch fixes two issues relating to FUSE_ACCESS when the default_permissions mount option is disabled: * VOP_ACCESS() calls with VADMIN set should never be sent to a fuse server in the form of FUSE_ACCESS operations. The FUSE protocol has no equivalent of VADMIN, so we must evaluate such things kernel-side, regardless of the default_permissions setting. * The FUSE protocol only requires FUSE_ACCESS to be sent for two purposes: for the access(2) syscall and to check directory permissions for searchability during lookup. FreeBSD sends it much more frequently, due to differences between our VFS and Linux's, for which FUSE was designed. But this patch does eliminate several cases not required by the FUSE protocol: * for any FUSE_*XATTR operation * when creating a new file * when deleting a file * when setting timestamps, such as by utimensat(2). * Additionally, when default_permissions is disabled, this patch removes one FUSE_GETATTR operation when deleting a file. PR: 245689 Reported by: MooseFS FreeBSD Team Reviewed by: cem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D24777 Modified: head/sys/fs/fuse/fuse_internal.c head/sys/fs/fuse/fuse_vnops.c head/tests/sys/fs/fusefs/access.cc head/tests/sys/fs/fusefs/rename.cc head/tests/sys/fs/fusefs/rmdir.cc head/tests/sys/fs/fusefs/unlink.cc head/tests/sys/fs/fusefs/utils.cc head/tests/sys/fs/fusefs/utils.hh head/tests/sys/fs/fusefs/xattr.cc Modified: head/sys/fs/fuse/fuse_internal.c ============================================================================== --- head/sys/fs/fuse/fuse_internal.c Fri May 22 18:10:46 2020 (r361400) +++ head/sys/fs/fuse/fuse_internal.c Fri May 22 18:11:17 2020 (r361401) @@ -158,6 +158,7 @@ fuse_internal_get_cached_vnode(struct mount* mp, ino_t return 0; } +SDT_PROBE_DEFINE0(fusefs, , internal, access_vadmin); /* Synchronously send a FUSE_ACCESS operation */ int fuse_internal_access(struct vnode *vp, @@ -210,10 +211,18 @@ fuse_internal_access(struct vnode *vp, va.va_gid, mode, cred, NULL); } + if (mode & VADMIN) { + /* + * The FUSE protocol doesn't have an equivalent of VADMIN, so + * it's a bug if we ever reach this point with that bit set. + */ + SDT_PROBE0(fusefs, , internal, access_vadmin); + } + if (!fsess_isimpl(mp, FUSE_ACCESS)) return 0; - if ((mode & (VWRITE | VAPPEND | VADMIN)) != 0) + if ((mode & (VWRITE | VAPPEND)) != 0) mask |= W_OK; if ((mode & VREAD) != 0) mask |= R_OK; Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Fri May 22 18:10:46 2020 (r361400) +++ head/sys/fs/fuse/fuse_vnops.c Fri May 22 18:11:17 2020 (r361401) @@ -235,6 +235,7 @@ fuse_extattr_check_cred(struct vnode *vp, int ns, stru { struct mount *mp = vnode_mount(vp); struct fuse_data *data = fuse_get_mpdata(mp); + int default_permissions = data->dataflags & FSESS_DEFAULT_PERMISSIONS; /* * Kernel-invoked always succeeds. @@ -248,12 +249,15 @@ fuse_extattr_check_cred(struct vnode *vp, int ns, stru */ switch (ns) { case EXTATTR_NAMESPACE_SYSTEM: - if (data->dataflags & FSESS_DEFAULT_PERMISSIONS) { + if (default_permissions) { return (priv_check_cred(cred, PRIV_VFS_EXTATTR_SYSTEM)); } - /* FALLTHROUGH */ + return (0); case EXTATTR_NAMESPACE_USER: - return (fuse_internal_access(vp, accmode, td, cred)); + if (default_permissions) { + return (fuse_internal_access(vp, accmode, td, cred)); + } + return (0); default: return (EPERM); } @@ -985,6 +989,8 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) int wantparent = flags & (LOCKPARENT | WANTPARENT); int islastcn = flags & ISLASTCN; struct mount *mp = vnode_mount(dvp); + struct fuse_data *data = fuse_get_mpdata(mp); + int default_permissions = data->dataflags & FSESS_DEFAULT_PERMISSIONS; int err = 0; int lookup_err = 0; @@ -1108,7 +1114,11 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) if (lookup_err) { /* Entry not found */ if ((nameiop == CREATE || nameiop == RENAME) && islastcn) { - err = fuse_internal_access(dvp, VWRITE, td, cred); + if (default_permissions) + err = fuse_internal_access(dvp, VWRITE, td, + cred); + else + err = 0; if (!err) { /* * Set the SAVENAME flag to hold onto the @@ -1191,7 +1201,7 @@ fuse_vnop_lookup(struct vop_lookup_args *ap) &fvdat->entry_cache_timeout); if ((nameiop == DELETE || nameiop == RENAME) && - islastcn) + islastcn && default_permissions) { struct vattr dvattr; @@ -1828,7 +1838,11 @@ fuse_vnop_setattr(struct vop_setattr_args *ap) if (vfs_isrdonly(mp)) return EROFS; - err = fuse_internal_access(vp, accmode, td, cred); + if (checkperm) { + err = fuse_internal_access(vp, accmode, td, cred); + } else { + err = 0; + } if (err) return err; else Modified: head/tests/sys/fs/fusefs/access.cc ============================================================================== --- head/tests/sys/fs/fusefs/access.cc Fri May 22 18:10:46 2020 (r361400) +++ head/tests/sys/fs/fusefs/access.cc Fri May 22 18:11:17 2020 (r361401) @@ -31,6 +31,9 @@ */ extern "C" { +#include +#include + #include #include } @@ -42,10 +45,33 @@ using namespace testing; class Access: public FuseTest { public: +virtual void SetUp() { + FuseTest::SetUp(); + // Clear the default FUSE_ACCESS expectation + Mock::VerifyAndClearExpectations(m_mock); +} + void expect_lookup(const char *relpath, uint64_t ino) { FuseTest::expect_lookup(relpath, ino, S_IFREG | 0644, 0, 1); } + +/* + * Expect tha FUSE_ACCESS will never be called for the given inode, with any + * bits in the supplied access_mask set + */ +void expect_noaccess(uint64_t ino, mode_t access_mask) +{ + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_ACCESS && + in.header.nodeid == ino && + in.body.access.mask & access_mask); + }, Eq(true)), + _) + ).Times(0); +} + }; class RofsAccess: public Access { @@ -56,6 +82,68 @@ virtual void SetUp() { } }; +/* + * Change the mode of a file. + * + * There should never be a FUSE_ACCESS sent for this operation, except for + * search permissions on the parent directory. + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245689 + */ +TEST_F(Access, chmod) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + const uint64_t ino = 42; + const mode_t newmode = 0644; + + expect_access(FUSE_ROOT_ID, X_OK, 0); + expect_lookup(RELPATH, ino); + expect_noaccess(ino, 0); + EXPECT_CALL(*m_mock, process( + ResultOf([](auto in) { + return (in.header.opcode == FUSE_SETATTR && + in.header.nodeid == ino); + }, Eq(true)), + _) + ).WillOnce(Invoke(ReturnImmediate([](auto in __unused, auto& out) { + SET_OUT_HEADER_LEN(out, attr); + out.body.attr.attr.ino = ino; // Must match nodeid + out.body.attr.attr.mode = S_IFREG | newmode; + }))); + + EXPECT_EQ(0, chmod(FULLPATH, newmode)) << strerror(errno); +} + +/* + * Create a new file + * + * There should never be a FUSE_ACCESS sent for this operation, except for + * search permissions on the parent directory. + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245689 + */ +TEST_F(Access, create) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + mode_t mode = S_IFREG | 0755; + uint64_t ino = 42; + + expect_access(FUSE_ROOT_ID, X_OK, 0); + expect_noaccess(FUSE_ROOT_ID, R_OK | W_OK); + EXPECT_LOOKUP(FUSE_ROOT_ID, RELPATH) + .WillOnce(Invoke(ReturnErrno(ENOENT))); + expect_noaccess(ino, 0); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_CREATE); + }, Eq(true)), + _) + ).WillOnce(ReturnErrno(EPERM)); + + EXPECT_EQ(-1, open(FULLPATH, O_CREAT | O_EXCL, mode)); + EXPECT_EQ(EPERM, errno); +} + /* The error case of FUSE_ACCESS. */ TEST_F(Access, eaccess) { @@ -105,6 +193,33 @@ TEST_F(RofsAccess, erofs) ASSERT_EQ(EROFS, errno); } + +/* + * Lookup an extended attribute + * + * There should never be a FUSE_ACCESS sent for this operation, except for + * search permissions on the parent directory. + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245689 + */ +TEST_F(Access, Getxattr) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + uint64_t ino = 42; + char data[80]; + int ns = EXTATTR_NAMESPACE_USER; + ssize_t r; + + expect_access(FUSE_ROOT_ID, X_OK, 0); + expect_lookup(RELPATH, ino); + expect_noaccess(ino, 0); + expect_getxattr(ino, "user.foo", ReturnErrno(ENOATTR)); + + r = extattr_get_file(FULLPATH, ns, "foo", data, sizeof(data)); + ASSERT_EQ(-1, r); + ASSERT_EQ(ENOATTR, errno); +} + /* The successful case of FUSE_ACCESS. */ TEST_F(Access, ok) { @@ -118,4 +233,71 @@ TEST_F(Access, ok) expect_access(ino, access_mode, 0); ASSERT_EQ(0, access(FULLPATH, access_mode)) << strerror(errno); +} + +/* + * Unlink a file + * + * There should never be a FUSE_ACCESS sent for this operation, except for + * search permissions on the parent directory. + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245689 + */ +TEST_F(Access, unlink) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + uint64_t ino = 42; + + expect_access(FUSE_ROOT_ID, X_OK, 0); + expect_noaccess(FUSE_ROOT_ID, W_OK | R_OK); + expect_noaccess(ino, 0); + expect_lookup(RELPATH, ino); + expect_unlink(1, RELPATH, EPERM); + + ASSERT_NE(0, unlink(FULLPATH)); + ASSERT_EQ(EPERM, errno); +} + +/* + * Unlink a file whose parent diretory's sticky bit is set + * + * There should never be a FUSE_ACCESS sent for this operation, except for + * search permissions on the parent directory. + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245689 + */ +TEST_F(Access, unlink_sticky_directory) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + uint64_t ino = 42; + + expect_access(FUSE_ROOT_ID, X_OK, 0); + expect_noaccess(FUSE_ROOT_ID, W_OK | R_OK); + expect_noaccess(ino, 0); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_GETATTR && + in.header.nodeid == FUSE_ROOT_ID); + }, Eq(true)), + _) + ).WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto& out) + { + SET_OUT_HEADER_LEN(out, attr); + out.body.attr.attr.ino = FUSE_ROOT_ID; + out.body.attr.attr.mode = S_IFDIR | 01777; + out.body.attr.attr.uid = 0; + out.body.attr.attr_valid = UINT64_MAX; + }))); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_ACCESS && + in.header.nodeid == ino); + }, Eq(true)), + _) + ).Times(0); + expect_lookup(RELPATH, ino); + expect_unlink(FUSE_ROOT_ID, RELPATH, EPERM); + + ASSERT_EQ(-1, unlink(FULLPATH)); + ASSERT_EQ(EPERM, errno); } Modified: head/tests/sys/fs/fusefs/rename.cc ============================================================================== --- head/tests/sys/fs/fusefs/rename.cc Fri May 22 18:10:46 2020 (r361400) +++ head/tests/sys/fs/fusefs/rename.cc Fri May 22 18:11:17 2020 (r361401) @@ -53,24 +53,6 @@ class Rename: public FuseTest { FuseTest::TearDown(); } - - void expect_getattr(uint64_t ino, mode_t mode) - { - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - return (in.header.opcode == FUSE_GETATTR && - in.header.nodeid == ino); - }, Eq(true)), - _) - ).WillOnce(Invoke( - ReturnImmediate([=](auto i __unused, auto& out) { - SET_OUT_HEADER_LEN(out, attr); - out.body.attr.attr.ino = ino; // Must match nodeid - out.body.attr.attr.mode = mode; - out.body.attr.attr_valid = UINT64_MAX; - }))); - } - }; // EINVAL, dst is subdir of src @@ -82,7 +64,6 @@ TEST_F(Rename, einval) const char RELSRC[] = "src"; uint64_t src_ino = 42; - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELSRC, src_ino, S_IFDIR | 0755, 0, 2); EXPECT_LOOKUP(src_ino, RELDST).WillOnce(Invoke(ReturnErrno(ENOENT))); @@ -123,7 +104,6 @@ TEST_F(Rename, entry_cache_negative) */ struct timespec entry_valid = {.tv_sec = 0, .tv_nsec = 0}; - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELSRC, ino, S_IFREG | 0644, 0, 1); /* LOOKUP returns a negative cache entry for dst */ EXPECT_LOOKUP(FUSE_ROOT_ID, RELDST) @@ -158,7 +138,6 @@ TEST_F(Rename, entry_cache_negative_purge) uint64_t ino = 42; struct timespec entry_valid = {.tv_sec = TIME_T_MAX, .tv_nsec = 0}; - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELSRC, ino, S_IFREG | 0644, 0, 1); /* LOOKUP returns a negative cache entry for dst */ EXPECT_LOOKUP(FUSE_ROOT_ID, RELDST) @@ -196,7 +175,6 @@ TEST_F(Rename, exdev) tmpfd = mkstemp(tmpfile); ASSERT_LE(0, tmpfd) << strerror(errno); - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELB, b_ino, S_IFREG | 0644, 0, 2); ASSERT_NE(0, rename(tmpfile, FULLB)); @@ -215,7 +193,6 @@ TEST_F(Rename, ok) uint64_t dst_dir_ino = FUSE_ROOT_ID; uint64_t ino = 42; - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELSRC, ino, S_IFREG | 0644, 0, 1); EXPECT_LOOKUP(FUSE_ROOT_ID, RELDST) .WillOnce(Invoke(ReturnErrno(ENOENT))); @@ -251,7 +228,6 @@ TEST_F(Rename, parent) struct stat sb; expect_lookup(RELSRC, ino, S_IFDIR | 0755, 0, 1); - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); EXPECT_LOOKUP(FUSE_ROOT_ID, RELDSTDIR) .WillRepeatedly(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { SET_OUT_HEADER_LEN(out, entry); @@ -303,7 +279,6 @@ TEST_F(Rename, overwrite) uint64_t dst_dir_ino = FUSE_ROOT_ID; uint64_t ino = 42; - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELSRC, ino, S_IFREG | 0644, 0, 1); expect_lookup(RELDST, dst_ino, S_IFREG | 0644, 0, 1); EXPECT_CALL(*m_mock, process( Modified: head/tests/sys/fs/fusefs/rmdir.cc ============================================================================== --- head/tests/sys/fs/fusefs/rmdir.cc Fri May 22 18:10:46 2020 (r361400) +++ head/tests/sys/fs/fusefs/rmdir.cc Fri May 22 18:11:17 2020 (r361401) @@ -42,22 +42,6 @@ using namespace testing; class Rmdir: public FuseTest { public: -void expect_getattr(uint64_t ino, mode_t mode) -{ - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - return (in.header.opcode == FUSE_GETATTR && - in.header.nodeid == ino); - }, Eq(true)), - _) - ).WillOnce(Invoke(ReturnImmediate([=](auto i __unused, auto& out) { - SET_OUT_HEADER_LEN(out, attr); - out.body.attr.attr.ino = ino; // Must match nodeid - out.body.attr.attr.mode = mode; - out.body.attr.attr_valid = UINT64_MAX; - }))); -} - void expect_lookup(const char *relpath, uint64_t ino, int times=1) { EXPECT_LOOKUP(FUSE_ROOT_ID, relpath) @@ -95,25 +79,34 @@ TEST_F(Rmdir, parent_attr_cache) struct stat sb; sem_t sem; uint64_t ino = 42; + Sequence seq; ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); + expect_lookup(RELPATH, ino); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { + return (in.header.opcode == FUSE_RMDIR && + 0 == strcmp(RELPATH, in.body.rmdir) && + in.header.nodeid == FUSE_ROOT_ID); + }, Eq(true)), + _) + ).InSequence(seq) + .WillOnce(Invoke(ReturnErrno(0))); + expect_forget(ino, 1, &sem); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { return (in.header.opcode == FUSE_GETATTR && in.header.nodeid == FUSE_ROOT_ID); }, Eq(true)), _) - ).Times(2) + ).InSequence(seq) .WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto& out) { SET_OUT_HEADER_LEN(out, attr); - out.body.attr.attr.ino = ino; // Must match nodeid + out.body.attr.attr.ino = FUSE_ROOT_ID; out.body.attr.attr.mode = S_IFDIR | 0755; out.body.attr.attr_valid = UINT64_MAX; }))); - expect_lookup(RELPATH, ino); - expect_rmdir(FUSE_ROOT_ID, RELPATH, 0); - expect_forget(ino, 1, &sem); ASSERT_EQ(0, rmdir(FULLPATH)) << strerror(errno); EXPECT_EQ(0, stat("mountpoint", &sb)) << strerror(errno); @@ -127,7 +120,6 @@ TEST_F(Rmdir, enotempty) const char RELPATH[] = "some_dir"; uint64_t ino = 42; - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELPATH, ino); expect_rmdir(FUSE_ROOT_ID, RELPATH, ENOTEMPTY); @@ -143,7 +135,6 @@ TEST_F(Rmdir, entry_cache) sem_t sem; uint64_t ino = 42; - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH, ino, 2); expect_rmdir(FUSE_ROOT_ID, RELPATH, 0); expect_forget(ino, 1, &sem); @@ -163,7 +154,6 @@ TEST_F(Rmdir, ok) ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); - expect_getattr(FUSE_ROOT_ID, S_IFDIR | 0755); expect_lookup(RELPATH, ino); expect_rmdir(FUSE_ROOT_ID, RELPATH, 0); expect_forget(ino, 1, &sem); Modified: head/tests/sys/fs/fusefs/unlink.cc ============================================================================== --- head/tests/sys/fs/fusefs/unlink.cc Fri May 22 18:10:46 2020 (r361400) +++ head/tests/sys/fs/fusefs/unlink.cc Fri May 22 18:11:17 2020 (r361401) @@ -41,22 +41,6 @@ using namespace testing; class Unlink: public FuseTest { public: -void expect_getattr(uint64_t ino, mode_t mode) -{ - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - return (in.header.opcode == FUSE_GETATTR && - in.header.nodeid == ino); - }, Eq(true)), - _) - ).WillOnce(Invoke(ReturnImmediate([=](auto i __unused, auto& out) { - SET_OUT_HEADER_LEN(out, attr); - out.body.attr.attr.ino = ino; // Must match nodeid - out.body.attr.attr.mode = mode; - out.body.attr.attr_valid = UINT64_MAX; - }))); -} - void expect_lookup(const char *relpath, uint64_t ino, int times, int nlink=1) { EXPECT_LOOKUP(FUSE_ROOT_ID, relpath) @@ -89,7 +73,6 @@ TEST_F(Unlink, attr_cache) struct stat sb_old, sb_new; int fd1; - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH0, ino, 1, 2); expect_lookup(RELPATH1, ino, 1, 2); expect_open(ino, 0, 1); @@ -117,23 +100,32 @@ TEST_F(Unlink, parent_attr_cache) const char RELPATH[] = "some_file.txt"; struct stat sb; uint64_t ino = 42; + Sequence seq; + /* Use nlink=2 so we don't get a FUSE_FORGET */ + expect_lookup(RELPATH, ino, 1, 2); EXPECT_CALL(*m_mock, process( ResultOf([=](auto in) { + return (in.header.opcode == FUSE_UNLINK && + 0 == strcmp(RELPATH, in.body.unlink) && + in.header.nodeid == FUSE_ROOT_ID); + }, Eq(true)), + _) + ).InSequence(seq) + .WillOnce(Invoke(ReturnErrno(0))); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { return (in.header.opcode == FUSE_GETATTR && in.header.nodeid == FUSE_ROOT_ID); }, Eq(true)), _) - ).Times(2) + ).InSequence(seq) .WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto& out) { SET_OUT_HEADER_LEN(out, attr); - out.body.attr.attr.ino = ino; // Must match nodeid + out.body.attr.attr.ino = FUSE_ROOT_ID; out.body.attr.attr.mode = S_IFDIR | 0755; out.body.attr.attr_valid = UINT64_MAX; }))); - /* Use nlink=2 so we don't get a FUSE_FORGET */ - expect_lookup(RELPATH, ino, 1, 2); - expect_unlink(1, RELPATH, 0); ASSERT_EQ(0, unlink(FULLPATH)) << strerror(errno); EXPECT_EQ(0, stat("mountpoint", &sb)) << strerror(errno); @@ -145,7 +137,6 @@ TEST_F(Unlink, eperm) const char RELPATH[] = "some_file.txt"; uint64_t ino = 42; - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH, ino, 1); expect_unlink(1, RELPATH, EPERM); @@ -162,7 +153,6 @@ TEST_F(Unlink, entry_cache) const char RELPATH[] = "some_file.txt"; uint64_t ino = 42; - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH, ino, 2, 2); expect_unlink(1, RELPATH, 0); @@ -182,7 +172,6 @@ TEST_F(Unlink, multiply_linked) const char RELPATH1[] = "other_file.txt"; uint64_t ino = 42; - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH0, ino, 1, 2); expect_unlink(1, RELPATH0, 0); EXPECT_CALL(*m_mock, process( @@ -213,7 +202,6 @@ TEST_F(Unlink, ok) ASSERT_EQ(0, sem_init(&sem, 0, 0)) << strerror(errno); - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH, ino, 1); expect_unlink(1, RELPATH, 0); expect_forget(ino, 1, &sem); @@ -233,7 +221,6 @@ TEST_F(Unlink, open_but_deleted) uint64_t ino = 42; int fd; - expect_getattr(1, S_IFDIR | 0755); expect_lookup(RELPATH0, ino, 2); expect_open(ino, 0, 1); expect_unlink(1, RELPATH0, 0); Modified: head/tests/sys/fs/fusefs/utils.cc ============================================================================== --- head/tests/sys/fs/fusefs/utils.cc Fri May 22 18:10:46 2020 (r361400) +++ head/tests/sys/fs/fusefs/utils.cc Fri May 22 18:11:17 2020 (r361401) @@ -273,6 +273,20 @@ void FuseTest::expect_getattr(uint64_t ino, uint64_t s }))); } +void FuseTest::expect_getxattr(uint64_t ino, const char *attr, ProcessMockerT r) +{ + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + const char *a = (const char*)in.body.bytes + + sizeof(fuse_getxattr_in); + return (in.header.opcode == FUSE_GETXATTR && + in.header.nodeid == ino && + 0 == strcmp(attr, a)); + }, Eq(true)), + _) + ).WillOnce(Invoke(r)); +} + void FuseTest::expect_lookup(const char *relpath, uint64_t ino, mode_t mode, uint64_t size, int times, uint64_t attr_valid, uid_t uid, gid_t gid) { Modified: head/tests/sys/fs/fusefs/utils.hh ============================================================================== --- head/tests/sys/fs/fusefs/utils.hh Fri May 22 18:10:46 2020 (r361400) +++ head/tests/sys/fs/fusefs/utils.hh Fri May 22 18:11:17 2020 (r361401) @@ -133,6 +133,12 @@ class FuseTest : public ::testing::Test { void expect_getattr(uint64_t ino, uint64_t size); /* + * Create an expectation that FUSE_GETXATTR will be called once for the + * given inode. + */ + void expect_getxattr(uint64_t ino, const char *attr, ProcessMockerT r); + + /* * Create an expectation that FUSE_LOOKUP will be called for the given * path exactly times times and cache validity period. It will respond * with inode ino, mode mode, filesize size. Modified: head/tests/sys/fs/fusefs/xattr.cc ============================================================================== --- head/tests/sys/fs/fusefs/xattr.cc Fri May 22 18:10:46 2020 (r361400) +++ head/tests/sys/fs/fusefs/xattr.cc Fri May 22 18:11:17 2020 (r361401) @@ -62,20 +62,6 @@ void* killer(void* target) { class Xattr: public FuseTest { public: -void expect_getxattr(uint64_t ino, const char *attr, ProcessMockerT r) -{ - EXPECT_CALL(*m_mock, process( - ResultOf([=](auto in) { - const char *a = (const char*)in.body.bytes + - sizeof(fuse_getxattr_in); - return (in.header.opcode == FUSE_GETXATTR && - in.header.nodeid == ino && - 0 == strcmp(attr, a)); - }, Eq(true)), - _) - ).WillOnce(Invoke(r)); -} - void expect_listxattr(uint64_t ino, uint32_t size, ProcessMockerT r, Sequence *seq = NULL) { From owner-svn-src-all@freebsd.org Fri May 22 18:44: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 480B22D92B0; Fri, 22 May 2020 18:44:16 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [IPv6:2a01:4f8:13b:240c::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail.bsd4all.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TFl36R30z3Shg; Fri, 22 May 2020 18:44:15 +0000 (UTC) (envelope-from herbert@gojira.at) Date: Fri, 22 May 2020 20:44:06 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail202005; t=1590173046; bh=eRzc54+X3bCcmTow94PzA8N5hRCXhdC6Vr8Q/y9096M=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=rkWBOjEzJiqHK+b0l0GVXWG24eb4lJeU+KQWhoKEv8edpfNWt5YvGxbx+zeUb7w/y zzOcCgnj0KmgXhdd+e2hoGb2NXP2xI3dE5NUDc9UJnNnagbqeyt1pkWqP+e2y56W6o FEXWWKPntKTcCkkBDMMHjP7curOQQ47RnWwBtGFSGIIWRcM6m+c0uMHut7qtLaSpEb ljwjlKvavai7jENjcDjXNW8+VeNkTiS2wJN9VwPXsADNq21JuZzLIUDKCaGoD4uh9t +o9YPd3kOdbo3xp1sclq7OA6hWoVh67YUYNIPEpqo9zz26FwY6Wr95XEWLlziNm2vW XYJ6n/VHPKksQ== From: "Herbert J. Skuhra" To: John Baldwin Cc: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: Re: svn commit: r361334 - in stable/12/sys: amd64/amd64 arm64/arm64 dev/acpica i386/i386 x86/acpica Message-ID: <20200522184406.GA99475@mail.bsd4all.net> References: <202005211528.04LFSZFF068443@repo.freebsd.org> <87a720aowg.wl-herbert@gojira.at> <6c46560e-cc5b-ec15-d352-a3bf8eeede6a@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6c46560e-cc5b-ec15-d352-a3bf8eeede6a@FreeBSD.org> X-Rspamd-Queue-Id: 49TFl36R30z3Shg 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:24940, ipnet:2a01:4f8::/29, 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: Fri, 22 May 2020 18:44:16 -0000 On Fri, May 22, 2020 at 08:57:44AM -0700, John Baldwin wrote: > On 5/21/20 3:45 PM, Herbert J. Skuhra wrote: > > > > Until now it was possible to build a kernel (amd64) without 'device > > acpi'. After this commit it fails with this error: > > > > --- kernel.full --- > > linking kernel.full > > ld: error: undefined symbol: acpi_pxm_set_cpu_locality > >>>> referenced by mp_machdep.c:269 (/usr/src/sys/amd64/amd64/mp_machdep.c:269) > >>>> mp_machdep.o:(cpu_mp_start) > > *** [kernel.full] Error code 1 > > > > Was that intended? > > I know Mark has already fixed this, but can you elaborate on your use case for > not compiling ACPI support into the kernel? Yes, thanks! I still use a Soekris Net6501-70 board. It shows the following errors when ACPI is enabled: Firmware Error (ACPI): A valid RSDP was not found (20200430/tbxfroot-369) [...] ACPI: Table initialisation failed: AE_NOT_FOUND ACPI: Try disabling either ACPI or apic support. It works fine without ACPI so I removed it. I need a custom kernel anyway (the kernel panics without 'device atpic'). -- Herbert From owner-svn-src-all@freebsd.org Fri May 22 18:54: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 B3AD82D963B; Fri, 22 May 2020 18:54:56 +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 49TFzN4J58z3T13; Fri, 22 May 2020 18:54:56 +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 8EDF92339C; Fri, 22 May 2020 18:54:56 +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 04MIsuFr088262; Fri, 22 May 2020 18:54:56 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MIsuns088261; Fri, 22 May 2020 18:54:56 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202005221854.04MIsuns088261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 22 May 2020 18:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361402 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 361402 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, 22 May 2020 18:54:56 -0000 Author: mhorne Date: Fri May 22 18:54:56 2020 New Revision: 361402 URL: https://svnweb.freebsd.org/changeset/base/361402 Log: Simplify the RISC-V kernel linker invocation Remove our custom SYSTEM_LD definition. This generates program headers that are more consistent with other architectures, and more importantly, are in line with what loader(8) expects when loading a kernel. As noted in https://reviews.freebsd.org/D22920, there is no apparent reason why the kernel would need a writable text segment, so removal of the -N flag isn't likely to cause issue. Reviewed by: kp, br MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24909 Modified: head/sys/conf/Makefile.riscv Modified: head/sys/conf/Makefile.riscv ============================================================================== --- head/sys/conf/Makefile.riscv Fri May 22 18:11:17 2020 (r361401) +++ head/sys/conf/Makefile.riscv Fri May 22 18:54:56 2020 (r361402) @@ -35,12 +35,7 @@ INCLUDES+= -I$S/contrib/libfdt # We set this value using --defsym rather than hardcoding it in ldscript.riscv # so that different kernel configs can override the load address. KERNEL_LMA?= 0x80200000 - -SYSTEM_LD= @${LD} -N -m ${LD_EMULATION} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} \ - --no-warn-mismatch --warn-common --export-dynamic \ - --defsym='kernel_lma=${KERNEL_LMA}' \ - --dynamic-linker /red/herring \ - -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o +LDFLAGS+= --defsym='kernel_lma=${KERNEL_LMA}' .if !empty(DDB_ENABLED) CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls From owner-svn-src-all@freebsd.org Fri May 22 19:09: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 7608B2D92DF; Fri, 22 May 2020 19:09:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TGJS2Nccz3TS4; Fri, 22 May 2020 19:09:44 +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 48AD8234AD; Fri, 22 May 2020 19:09:44 +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 04MJ9iKo094435; Fri, 22 May 2020 19:09:44 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MJ9imG094434; Fri, 22 May 2020 19:09:44 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005221909.04MJ9imG094434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 22 May 2020 19:09: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: r361403 - stable/12/tests/sys/geom/class/multipath X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/tests/sys/geom/class/multipath X-SVN-Commit-Revision: 361403 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, 22 May 2020 19:09:44 -0000 Author: asomers Date: Fri May 22 19:09:43 2020 New Revision: 361403 URL: https://svnweb.freebsd.org/changeset/base/361403 Log: MFC r360807: Fix the sys.geom.class.multipath.misc.fail_on_error test on stable/12 This test uses a gnop feature (delay probability) that isn't available on stable/12. But it's unnecessary; the test works fine without it. Removing it simplifies the test and, once MFCed, will allow it to pass on stable/12. PR: 244158 Reported by: lwhsu Modified: stable/12/tests/sys/geom/class/multipath/misc.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/geom/class/multipath/misc.sh ============================================================================== --- stable/12/tests/sys/geom/class/multipath/misc.sh Fri May 22 18:54:56 2020 (r361402) +++ stable/12/tests/sys/geom/class/multipath/misc.sh Fri May 22 19:09:43 2020 (r361403) @@ -190,7 +190,7 @@ fail_on_error_body() atf_check -s exit:0 gmultipath create "$name" ${md0}.nop ${md1}.nop # The first I/O to the first path should fail, causing gmultipath to # fail over to the second path. - atf_check gnop configure -q 100 -r 100 -w 100 -x 100 ${md0}.nop + atf_check gnop configure -r 100 -w 100 ${md0}.nop atf_check -s exit:0 -o ignore -e ignore dd if=/dev/zero of=/dev/multipath/"$name" bs=4096 count=1 check_multipath_state ${md1}.nop "DEGRADED" "FAIL" "ACTIVE" } From owner-svn-src-all@freebsd.org Fri May 22 20:52: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 90A0A2DC652; Fri, 22 May 2020 20:52:37 +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 49TJb93Gkwz3cPc; Fri, 22 May 2020 20:52:37 +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 52E1E2457B; Fri, 22 May 2020 20:52:37 +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 04MKqbTM065913; Fri, 22 May 2020 20:52:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MKqbJW065912; Fri, 22 May 2020 20:52:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005222052.04MKqbJW065912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 22 May 2020 20:52:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361404 - head/sys/crypto/ccp X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/crypto/ccp X-SVN-Commit-Revision: 361404 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, 22 May 2020 20:52:37 -0000 Author: jhb Date: Fri May 22 20:52:36 2020 New Revision: 361404 URL: https://svnweb.freebsd.org/changeset/base/361404 Log: Remove a workaround for GCM requests with an empty payload. This was copied from ccr(4) (which does require the workaround), but is reportedly not needed for ccp(4). Discussed with: cem Sponsored by: Netflix Modified: head/sys/crypto/ccp/ccp.c Modified: head/sys/crypto/ccp/ccp.c ============================================================================== --- head/sys/crypto/ccp/ccp.c Fri May 22 19:09:43 2020 (r361403) +++ head/sys/crypto/ccp/ccp.c Fri May 22 20:52:36 2020 (r361404) @@ -113,67 +113,6 @@ ccp_populate_sglist(struct sglist *sg, struct cryptop return (error); } -/* - * Handle a GCM request with an empty payload by performing the - * operation in software. - */ -static void -ccp_gcm_soft(struct ccp_session *s, struct cryptop *crp) -{ - struct aes_gmac_ctx gmac_ctx; - char block[GMAC_BLOCK_LEN]; - char digest[GMAC_DIGEST_LEN]; - char iv[AES_BLOCK_LEN]; - int i, len; - - /* - * This assumes a 12-byte IV from the crp. See longer comment - * above in ccp_gcm() for more details. - */ - if ((crp->crp_flags & CRYPTO_F_IV_SEPARATE) == 0) { - crp->crp_etype = EINVAL; - goto out; - } - memcpy(iv, crp->crp_iv, 12); - *(uint32_t *)&iv[12] = htobe32(1); - - /* Initialize the MAC. */ - AES_GMAC_Init(&gmac_ctx); - AES_GMAC_Setkey(&gmac_ctx, s->blkcipher.enckey, s->blkcipher.key_len); - AES_GMAC_Reinit(&gmac_ctx, iv, sizeof(iv)); - - /* MAC the AAD. */ - for (i = 0; i < crp->crp_aad_length; i += sizeof(block)) { - len = imin(crp->crp_aad_length - i, sizeof(block)); - crypto_copydata(crp, crp->crp_aad_start + i, len, block); - bzero(block + len, sizeof(block) - len); - AES_GMAC_Update(&gmac_ctx, block, sizeof(block)); - } - - /* Length block. */ - bzero(block, sizeof(block)); - ((uint32_t *)block)[1] = htobe32(crp->crp_aad_length * 8); - AES_GMAC_Update(&gmac_ctx, block, sizeof(block)); - AES_GMAC_Final(digest, &gmac_ctx); - - if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { - crypto_copyback(crp, crp->crp_digest_start, sizeof(digest), - digest); - crp->crp_etype = 0; - } else { - char digest2[GMAC_DIGEST_LEN]; - - crypto_copydata(crp, crp->crp_digest_start, sizeof(digest2), - digest2); - if (timingsafe_bcmp(digest, digest2, sizeof(digest)) == 0) - crp->crp_etype = 0; - else - crp->crp_etype = EBADMSG; - } -out: - crypto_done(crp); -} - static int ccp_probe(device_t dev) { @@ -643,11 +582,6 @@ ccp_process(device_t dev, struct cryptop *crp, int hin error = ccp_authenc(qp, s, crp); break; case GCM: - if (crp->crp_payload_length == 0) { - mtx_unlock(&qp->cq_lock); - ccp_gcm_soft(s, crp); - return (0); - } if (s->pending != 0) { error = EAGAIN; break; From owner-svn-src-all@freebsd.org Fri May 22 22:12: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 38D602DF4A7; Fri, 22 May 2020 22:12:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TLLw0gRvz3yyW; Fri, 22 May 2020 22:12:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1259C25930; Fri, 22 May 2020 22:12:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MMC7lB014608; Fri, 22 May 2020 22:12:07 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MMC7qV014607; Fri, 22 May 2020 22:12:07 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005222212.04MMC7qV014607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 22 May 2020 22:12:07 +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: r361405 - stable/12/sys/fs/fuse X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/sys/fs/fuse X-SVN-Commit-Revision: 361405 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, 22 May 2020 22:12:08 -0000 Author: asomers Date: Fri May 22 22:12:07 2020 New Revision: 361405 URL: https://svnweb.freebsd.org/changeset/base/361405 Log: MFC r360828: fusefs: better dtrace probes for asynchronous invalidation operations Modified: stable/12/sys/fs/fuse/fuse_internal.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/fuse/fuse_internal.c ============================================================================== --- stable/12/sys/fs/fuse/fuse_internal.c Fri May 22 20:52:36 2020 (r361404) +++ stable/12/sys/fs/fuse/fuse_internal.c Fri May 22 22:12:07 2020 (r361405) @@ -377,8 +377,8 @@ fuse_internal_fsync(struct vnode *vp, } /* Asynchronous invalidation */ -SDT_PROBE_DEFINE2(fusefs, , internal, invalidate_cache_hit, - "struct vnode*", "struct vnode*"); +SDT_PROBE_DEFINE3(fusefs, , internal, invalidate_entry, + "struct vnode*", "struct fuse_notify_inval_entry_out*", "char*"); int fuse_internal_invalidate_entry(struct mount *mp, struct uio *uio) { @@ -407,6 +407,7 @@ fuse_internal_invalidate_entry(struct mount *mp, struc else err = fuse_internal_get_cached_vnode( mp, fnieo.parent, LK_SHARED, &dvp); + SDT_PROBE3(fusefs, , internal, invalidate_entry, dvp, &fnieo, name); /* * If dvp is not in the cache, then it must've been reclaimed. And * since fuse_vnop_reclaim does a cache_purge, name's entry must've @@ -435,6 +436,8 @@ fuse_internal_invalidate_entry(struct mount *mp, struc return (0); } +SDT_PROBE_DEFINE2(fusefs, , internal, invalidate_inode, + "struct vnode*", "struct fuse_notify_inval_inode_out *"); int fuse_internal_invalidate_inode(struct mount *mp, struct uio *uio) { @@ -450,6 +453,7 @@ fuse_internal_invalidate_inode(struct mount *mp, struc else err = fuse_internal_get_cached_vnode(mp, fniio.ino, LK_SHARED, &vp); + SDT_PROBE2(fusefs, , internal, invalidate_inode, vp, &fniio); if (err != 0 || vp == NULL) return (err); /* From owner-svn-src-all@freebsd.org Fri May 22 22:13: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 65E7C2DF51E; Fri, 22 May 2020 22:13:56 +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 49TLP023MZz400T; Fri, 22 May 2020 22:13:56 +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 4193825753; Fri, 22 May 2020 22:13:56 +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 04MMDu49015711; Fri, 22 May 2020 22:13:56 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MMDtxH015709; Fri, 22 May 2020 22:13:55 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005222213.04MMDtxH015709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 22 May 2020 22:13: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: r361406 - stable/12/tests/sys/fs/fusefs X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/tests/sys/fs/fusefs X-SVN-Commit-Revision: 361406 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, 22 May 2020 22:13:56 -0000 Author: asomers Date: Fri May 22 22:13:55 2020 New Revision: 361406 URL: https://svnweb.freebsd.org/changeset/base/361406 Log: MFC r360829: fusefs: fix two small bugs in the tests' expectations These two errors have been present since the tests' introduction. Coincidentally every test (I think there's only one) that cares about that field also works when the field's value is 0. Modified: stable/12/tests/sys/fs/fusefs/default_permissions.cc stable/12/tests/sys/fs/fusefs/default_permissions_privileged.cc Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/fs/fusefs/default_permissions.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/default_permissions.cc Fri May 22 22:12:07 2020 (r361405) +++ stable/12/tests/sys/fs/fusefs/default_permissions.cc Fri May 22 22:13:55 2020 (r361406) @@ -125,7 +125,7 @@ void expect_getattr(uint64_t ino, mode_t mode, uint64_ out.body.attr.attr.mode = mode; out.body.attr.attr.size = 0; out.body.attr.attr.uid = uid; - out.body.attr.attr.uid = gid; + out.body.attr.attr.gid = gid; out.body.attr.attr_valid = attr_valid; }))); } Modified: stable/12/tests/sys/fs/fusefs/default_permissions_privileged.cc ============================================================================== --- stable/12/tests/sys/fs/fusefs/default_permissions_privileged.cc Fri May 22 22:12:07 2020 (r361405) +++ stable/12/tests/sys/fs/fusefs/default_permissions_privileged.cc Fri May 22 22:13:55 2020 (r361406) @@ -85,7 +85,7 @@ void expect_getattr(uint64_t ino, mode_t mode, uint64_ out.body.attr.attr.mode = mode; out.body.attr.attr.size = 0; out.body.attr.attr.uid = uid; - out.body.attr.attr.uid = gid; + out.body.attr.attr.gid = gid; out.body.attr.attr_valid = attr_valid; }))); } From owner-svn-src-all@freebsd.org Fri May 22 22:17: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 41D102DF892; Fri, 22 May 2020 22:17:45 +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 49TLTP162mz40cG; Fri, 22 May 2020 22:17:45 +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 213E125BB3; Fri, 22 May 2020 22:17:45 +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 04MMHjUd015947; Fri, 22 May 2020 22:17:45 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MMHjIu015946; Fri, 22 May 2020 22:17:45 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005222217.04MMHjIu015946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 22 May 2020 22:17: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: r361407 - stable/12/tests/sys/geom/class/multipath X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/tests/sys/geom/class/multipath X-SVN-Commit-Revision: 361407 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, 22 May 2020 22:17:45 -0000 Author: asomers Date: Fri May 22 22:17:44 2020 New Revision: 361407 URL: https://svnweb.freebsd.org/changeset/base/361407 Log: Reenable sys.geom.class.multipath.misc.fail_on_error on stable/12 The failing test was fixed by r361403. Direct commit to stable/12 because the test was never disabled on head. PR: 244158 Reported by: lwhsu Modified: stable/12/tests/sys/geom/class/multipath/misc.sh Modified: stable/12/tests/sys/geom/class/multipath/misc.sh ============================================================================== --- stable/12/tests/sys/geom/class/multipath/misc.sh Fri May 22 22:13:55 2020 (r361406) +++ stable/12/tests/sys/geom/class/multipath/misc.sh Fri May 22 22:17:44 2020 (r361407) @@ -176,10 +176,6 @@ fail_on_error_head() } fail_on_error_body() { - if [ "$(atf_config_get ci false)" = "true" ]; then - atf_skip "https://bugs.freebsd.org/244158" - fi - load_gnop load_gmultipath md0=$(alloc_md) From owner-svn-src-all@freebsd.org Sat May 23 03:32:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 813752F6481; Sat, 23 May 2020 03:32:09 +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 49TTS92w2sz4H5T; Sat, 23 May 2020 03:32:09 +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 455159A03; Sat, 23 May 2020 03:32:09 +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 04N3W92s010848; Sat, 23 May 2020 03:32:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04N3W9x0010847; Sat, 23 May 2020 03:32:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005230332.04N3W9x0010847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 23 May 2020 03:32:09 +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: r361408 - stable/12/lib/libc/tests/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/lib/libc/tests/sys X-SVN-Commit-Revision: 361408 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, 23 May 2020 03:32:09 -0000 Author: markj Date: Sat May 23 03:32:08 2020 New Revision: 361408 URL: https://svnweb.freebsd.org/changeset/base/361408 Log: Revert mlock_helper.c test code changes from r361350. They were not intended to be merged, since the MFC did not change the max_wired sysctl name. This is a direct commit to stable/12. Reported by: lwhsu Modified: stable/12/lib/libc/tests/sys/mlock_helper.c Modified: stable/12/lib/libc/tests/sys/mlock_helper.c ============================================================================== --- stable/12/lib/libc/tests/sys/mlock_helper.c Fri May 22 22:17:44 2020 (r361407) +++ stable/12/lib/libc/tests/sys/mlock_helper.c Sat May 23 03:32:08 2020 (r361408) @@ -39,16 +39,16 @@ __FBSDID("$FreeBSD$"); #include #include -#define VM_MAX_WIRED "vm.max_user_wired" +#define VM_MAX_WIRED "vm.max_wired" static void -vm_max_wired_sysctl(u_long *old_value, u_long *new_value) +vm_max_wired_sysctl(int *old_value, int *new_value) { size_t old_len; - size_t new_len = (new_value == NULL ? 0 : sizeof(*new_value)); + size_t new_len = (new_value == NULL ? 0 : sizeof(int)); if (old_value == NULL) - printf("Setting the new value to %lu\n", *new_value); + printf("Setting the new value to %d\n", *new_value); else { ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, NULL, &old_len, new_value, new_len) == 0, @@ -60,14 +60,14 @@ vm_max_wired_sysctl(u_long *old_value, u_long *new_val "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); if (old_value != NULL) - printf("Saved the old value (%lu)\n", *old_value); + printf("Saved the old value (%d)\n", *old_value); } void -set_vm_max_wired(u_long new_value) +set_vm_max_wired(int new_value) { FILE *fp; - u_long old_value; + int old_value; fp = fopen(VM_MAX_WIRED, "w"); if (fp == NULL) { @@ -78,7 +78,7 @@ set_vm_max_wired(u_long new_value) vm_max_wired_sysctl(&old_value, NULL); - ATF_REQUIRE_MSG(fprintf(fp, "%lu", old_value) > 0, + ATF_REQUIRE_MSG(fprintf(fp, "%d", old_value) > 0, "saving %s failed", VM_MAX_WIRED); fclose(fp); @@ -90,7 +90,7 @@ void restore_vm_max_wired(void) { FILE *fp; - u_long saved_max_wired; + int saved_max_wired; fp = fopen(VM_MAX_WIRED, "r"); if (fp == NULL) { @@ -98,14 +98,14 @@ restore_vm_max_wired(void) return; } - if (fscanf(fp, "%lu", &saved_max_wired) != 1) { + if (fscanf(fp, "%d", &saved_max_wired) != 1) { perror("fscanf failed\n"); fclose(fp); return; } fclose(fp); - printf("old value in %s: %lu\n", VM_MAX_WIRED, saved_max_wired); + printf("old value in %s: %d\n", VM_MAX_WIRED, saved_max_wired); if (saved_max_wired == 0) /* This will cripple the test host */ return; From owner-svn-src-all@freebsd.org Sat May 23 10:21: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 181902FE134; Sat, 23 May 2020 10:21:05 +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 49TfX10BSKz3RkM; Sat, 23 May 2020 10:21:05 +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 01A63E2C1; Sat, 23 May 2020 10:21:05 +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 04NAL4uS063868; Sat, 23 May 2020 10:21:04 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NAL2SU063855; Sat, 23 May 2020 10:21:02 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005231021.04NAL2SU063855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 23 May 2020 10:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361409 - in head/sys: fs/nfsclient net net/route netinet6 nfs X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys: fs/nfsclient net net/route netinet6 nfs X-SVN-Commit-Revision: 361409 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, 23 May 2020 10:21:05 -0000 Author: melifaro Date: Sat May 23 10:21:02 2020 New Revision: 361409 URL: https://svnweb.freebsd.org/changeset/base/361409 Log: Use epoch(9) for rtentries to simplify control plane operations. Currently the only reason of refcounting rtentries is the need to report the rtable operation details immediately after the execution. Delaying rtentry reclamation allows to stop refcounting and simplify the code. Additionally, this change allows to reimplement rib_lookup_info(), which is used by some of the customers to get the matching prefix along with nexthops, in more efficient way. The change keeps per-vnet rtzone uma zone. It adds nh_vnet field to nhop_priv to be able to reliably set curvnet even during vnet teardown. Rest of the reference counting code will be removed in the D24867 . Differential Revision: https://reviews.freebsd.org/D24866 Modified: head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/net/if.c head/sys/net/route.c head/sys/net/route.h head/sys/net/route/nhop.h head/sys/net/route/nhop_ctl.c head/sys/net/route/nhop_var.h head/sys/net/route/route_var.h head/sys/net/rtsock.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_rtr.c head/sys/nfs/bootp_subr.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Sat May 23 03:32:08 2020 (r361408) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Sat May 23 10:21:02 2020 (r361409) @@ -465,18 +465,21 @@ nfs_mountroot(struct mount *mp) if (nd->mygateway.sin_len != 0 && nd->mygateway.sin_addr.s_addr != 0) { struct sockaddr_in mask, sin; + struct epoch_tracker et; bzero((caddr_t)&mask, sizeof(mask)); sin = mask; sin.sin_family = AF_INET; sin.sin_len = sizeof(sin); /* XXX MRT use table 0 for this sort of thing */ + NET_EPOCH_ENTER(et); CURVNET_SET(TD_TO_VNET(td)); error = rtrequest_fib(RTM_ADD, (struct sockaddr *)&sin, (struct sockaddr *)&nd->mygateway, (struct sockaddr *)&mask, RTF_UP | RTF_GATEWAY, NULL, RT_DEFAULT_FIB); CURVNET_RESTORE(); + NET_EPOCH_EXIT(et); if (error) panic("nfs_mountroot: RTM_ADD: %d", error); } Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sat May 23 03:32:08 2020 (r361408) +++ head/sys/net/if.c Sat May 23 10:21:02 2020 (r361409) @@ -1854,18 +1854,17 @@ ifa_maintain_loopback_route(int cmd, const char *otype ifp = ifa->ifa_ifp; + NET_EPOCH_ENTER(et); bzero(&info, sizeof(info)); if (cmd != RTM_DELETE) info.rti_ifp = V_loif; if (cmd == RTM_ADD) { /* explicitly specify (loopback) ifa */ if (info.rti_ifp != NULL) { - NET_EPOCH_ENTER(et); rti_ifa = ifaof_ifpforaddr(ifa->ifa_addr, info.rti_ifp); if (rti_ifa != NULL) ifa_ref(rti_ifa); info.rti_ifa = rti_ifa; - NET_EPOCH_EXIT(et); } } info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC | RTF_PINNED; @@ -1874,6 +1873,7 @@ ifa_maintain_loopback_route(int cmd, const char *otype link_init_sdl(ifp, (struct sockaddr *)&null_sdl, ifp->if_type); error = rtrequest1_fib(cmd, &info, NULL, ifp->if_fib); + NET_EPOCH_EXIT(et); if (rti_ifa != NULL) ifa_free(rti_ifa); Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat May 23 03:32:08 2020 (r361408) +++ head/sys/net/route.c Sat May 23 10:21:02 2020 (r361409) @@ -120,10 +120,7 @@ VNET_PCPUSTAT_SYSUNINIT(rtstat); VNET_DEFINE(struct rib_head *, rt_tables); #define V_rt_tables VNET(rt_tables) -VNET_DEFINE(int, rttrash); /* routes not in table but not freed */ -#define V_rttrash VNET(rttrash) - /* * Convert a 'struct radix_node *' to a 'struct rtentry *'. * The operation can be done safely (in this code) because a @@ -148,6 +145,7 @@ static int rt_ifdelroute(const struct rtentry *rt, con static struct rtentry *rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo *info, int *perror); static void rt_notifydelete(struct rtentry *rt, struct rt_addrinfo *info); +static void destroy_rtentry_epoch(epoch_context_t ctx); #ifdef RADIX_MPATH static struct radix_node *rt_mpath_unlink(struct rib_head *rnh, struct rt_addrinfo *info, struct rtentry *rto, int *perror); @@ -332,6 +330,16 @@ vnet_route_uninit(const void *unused __unused) } } + /* + * dom_rtdetach calls rt_table_destroy(), which + * schedules deletion for all rtentries, nexthops and control + * structures. Wait for the destruction callbacks to fire. + * Note that this should result in freeing all rtentries, but + * nexthops deletions will be scheduled for the next epoch run + * and will be completed after vnet teardown. + */ + epoch_drain_callbacks(net_epoch_preempt); + free(V_rt_tables, M_RTABLE); uma_zdestroy(V_rtzone); } @@ -449,41 +457,54 @@ rtfree(struct rtentry *rt) if ((rt->rt_flags & RTF_UP) == 0) { if (rt->rt_nodes->rn_flags & (RNF_ACTIVE | RNF_ROOT)) panic("rtfree 2"); - /* - * the rtentry must have been removed from the routing table - * so it is represented in rttrash.. remove that now. - */ - V_rttrash--; #ifdef DIAGNOSTIC if (rt->rt_refcnt < 0) { printf("rtfree: %p not freed (neg refs)\n", rt); goto done; } #endif + epoch_call(net_epoch_preempt, destroy_rtentry_epoch, + &rt->rt_epoch_ctx); - /* Unreference nexthop */ - nhop_free(rt->rt_nhop); - /* - * and the rtentry itself of course + * FALLTHROUGH to RT_UNLOCK() so the reporting functions + * have consistent behaviour of operating on unlocked entry. */ - uma_zfree(V_rtzone, rt); - return; } done: RT_UNLOCK(rt); } +static void +destroy_rtentry(struct rtentry *rt) +{ + + /* + * At this moment rnh, nh_control may be already freed. + * nhop interface may have been migrated to a different vnet. + * Use vnet stored in the nexthop to delete the entry. + */ + CURVNET_SET(nhop_get_vnet(rt->rt_nhop)); + + /* Unreference nexthop */ + nhop_free(rt->rt_nhop); + + uma_zfree(V_rtzone, rt); + + CURVNET_RESTORE(); +} + /* - * Temporary RTFREE() function wrapper. - * Intended to use in control plane code to - * avoid exposing internal layout of 'struct rtentry'. + * Epoch callback indicating rtentry is safe to destroy */ -void -rtfree_func(struct rtentry *rt) +static void +destroy_rtentry_epoch(epoch_context_t ctx) { + struct rtentry *rt; - RTFREE(rt); + rt = __containerof(ctx, struct rtentry, rt_epoch_ctx); + + destroy_rtentry(rt); } /* @@ -546,7 +567,7 @@ rib_add_redirect(u_int fibnum, struct sockaddr *dst, s RT_LOCK(rt); flags = rt->rt_flags; - RTFREE_LOCKED(rt); + RT_UNLOCK(rt); RTSTAT_INC(rts_dynamic); @@ -1112,13 +1133,6 @@ rt_notifydelete(struct rtentry *rt, struct rt_addrinfo ifa = rt->rt_nhop->nh_ifa; if (ifa != NULL && ifa->ifa_rtrequest != NULL) ifa->ifa_rtrequest(RTM_DELETE, rt, rt->rt_nhop, info); - - /* - * One more rtentry floating around that is not - * linked to the routing table. rttrash will be decremented - * when RTFREE(rt) is eventually called. - */ - V_rttrash++; } @@ -1386,6 +1400,7 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, stru KASSERT((fibnum < rt_numfibs), ("rtrequest1_fib: bad fibnum")); KASSERT((info->rti_flags & RTF_RNH_LOCKED) == 0, ("rtrequest1_fib: locked")); + NET_EPOCH_ASSERT(); dst = info->rti_info[RTAX_DST]; @@ -1580,13 +1595,10 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in ifa->ifa_rtrequest(RTM_ADD, rt, rt->rt_nhop, info); /* - * actually return a resultant rtentry and - * give the caller a single reference. + * actually return a resultant rtentry */ - if (ret_nrt) { + if (ret_nrt) *ret_nrt = rt; - RT_ADDREF(rt); - } rnh->rnh_gen++; /* Routing table updated */ RT_UNLOCK(rt); @@ -1622,15 +1634,13 @@ del_route(struct rib_head *rnh, struct rt_addrinfo *in /* * If the caller wants it, then it can have it, - * but it's up to it to free the rtentry as we won't be - * doing it. + * the entry will be deleted after the end of the current epoch. */ - if (ret_nrt) { + if (ret_nrt) *ret_nrt = rt; - RT_UNLOCK(rt); - } else - RTFREE_LOCKED(rt); - + + RTFREE_LOCKED(rt); + return (0); } @@ -1736,10 +1746,8 @@ change_route_one(struct rib_head *rnh, struct rt_addri if ((nh_orig->nh_ifa != nh->nh_ifa) && nh_orig->nh_ifa->ifa_rtrequest) nh_orig->nh_ifa->ifa_rtrequest(RTM_DELETE, rt, nh_orig, info); - if (ret_nrt != NULL) { + if (ret_nrt != NULL) *ret_nrt = rt; - RT_ADDREF(rt); - } RT_UNLOCK(rt); @@ -1757,7 +1765,6 @@ static int change_route(struct rib_head *rnh, struct rt_addrinfo *info, struct rtentry **ret_nrt) { - struct epoch_tracker et; int error; /* Check if updated gateway exists */ @@ -1765,8 +1772,6 @@ change_route(struct rib_head *rnh, struct rt_addrinfo (info->rti_info[RTAX_GATEWAY] == NULL)) return (EINVAL); - NET_EPOCH_ENTER(et); - /* * route change is done in multiple steps, with dropping and * reacquiring lock. In the situations with multiple processes @@ -1779,7 +1784,6 @@ change_route(struct rib_head *rnh, struct rt_addrinfo if (error != EAGAIN) break; } - NET_EPOCH_EXIT(et); return (error); } @@ -1825,6 +1829,7 @@ static inline int rtinit1(struct ifaddr *ifa, int cmd, int flags, int fibnum) { RIB_RLOCK_TRACKER; + struct epoch_tracker et; struct sockaddr *dst; struct sockaddr *netmask; struct rtentry *rt = NULL; @@ -1957,38 +1962,18 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi else info.rti_info[RTAX_GATEWAY] = ifa->ifa_addr; info.rti_info[RTAX_NETMASK] = netmask; + NET_EPOCH_ENTER(et); error = rtrequest1_fib(cmd, &info, &rt, fibnum); if (error == 0 && rt != NULL) { /* * notify any listening routing agents of the change */ - RT_LOCK(rt); /* TODO: interface routes/aliases */ - RT_ADDREF(rt); - RT_UNLOCK(rt); rt_newaddrmsg_fib(cmd, ifa, rt, fibnum); - RT_LOCK(rt); - RT_REMREF(rt); - if (cmd == RTM_DELETE) { - /* - * If we are deleting, and we found an entry, - * then it's been removed from the tree.. - * now throw it away. - */ - RTFREE_LOCKED(rt); - } else { - if (cmd == RTM_ADD) { - /* - * We just wanted to add it.. - * we don't actually need a reference. - */ - RT_REMREF(rt); - } - RT_UNLOCK(rt); - } didwork = 1; } + NET_EPOCH_EXIT(et); if (error) a_failure = error; } Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sat May 23 03:32:08 2020 (r361408) +++ head/sys/net/route.h Sat May 23 10:21:02 2020 (r361409) @@ -332,8 +332,6 @@ struct rt_addrinfo { #define RT_LINK_IS_UP(ifp) (!((ifp)->if_capabilities & IFCAP_LINKSTATE) \ || (ifp)->if_link_state == LINK_STATE_UP) -#define RTFREE_FUNC(_rt) rtfree_func(_rt) - #define RO_NHFREE(_ro) do { \ if ((_ro)->ro_nh) { \ NH_FREE((_ro)->ro_nh); \ Modified: head/sys/net/route/nhop.h ============================================================================== --- head/sys/net/route/nhop.h Sat May 23 03:32:08 2020 (r361408) +++ head/sys/net/route/nhop.h Sat May 23 10:21:02 2020 (r361409) @@ -176,6 +176,7 @@ struct rib_head; uint32_t nhop_get_idx(const struct nhop_object *nh); enum nhop_type nhop_get_type(const struct nhop_object *nh); int nhop_get_rtflags(const struct nhop_object *nh); +struct vnet *nhop_get_vnet(const struct nhop_object *nh); #endif /* _KERNEL */ Modified: head/sys/net/route/nhop_ctl.c ============================================================================== --- head/sys/net/route/nhop_ctl.c Sat May 23 03:32:08 2020 (r361408) +++ head/sys/net/route/nhop_ctl.c Sat May 23 10:21:02 2020 (r361409) @@ -500,6 +500,9 @@ finalize_nhop(struct nh_control *ctl, struct rt_addrin return (ENOMEM); } + /* Save vnet to ease destruction */ + nh_priv->nh_vnet = curvnet; + /* Reference external objects and calculate (referenced) ifa */ if_ref(nh->nh_ifp); ifa_ref(nh->nh_ifa); @@ -696,6 +699,13 @@ nhop_set_rtflags(struct nhop_object *nh, int rt_flags) { nh->nh_priv->rt_flags = rt_flags; +} + +struct vnet * +nhop_get_vnet(const struct nhop_object *nh) +{ + + return (nh->nh_priv->nh_vnet); } void Modified: head/sys/net/route/nhop_var.h ============================================================================== --- head/sys/net/route/nhop_var.h Sat May 23 03:32:08 2020 (r361408) +++ head/sys/net/route/nhop_var.h Sat May 23 10:21:02 2020 (r361409) @@ -78,6 +78,7 @@ struct nhop_priv { struct nhop_object *nh; /* backreference to the dataplane nhop */ struct nh_control *nh_control; /* backreference to the rnh */ struct nhop_priv *nh_next; /* hash table membership */ + struct vnet *nh_vnet; /* vnet nhop belongs to */ struct epoch_context nh_epoch_ctx; /* epoch data for nhop */ }; Modified: head/sys/net/route/route_var.h ============================================================================== --- head/sys/net/route/route_var.h Sat May 23 03:32:08 2020 (r361408) +++ head/sys/net/route/route_var.h Sat May 23 10:21:02 2020 (r361409) @@ -35,6 +35,7 @@ #ifndef RNF_NORMAL #include #endif +#include #include /* struct sockaddr_in */ #include @@ -148,6 +149,7 @@ struct rtentry { #define rt_endzero rt_mtx struct mtx rt_mtx; /* mutex for routing entry */ struct rtentry *rt_chain; /* pointer to next rtentry to delete */ + struct epoch_context rt_epoch_ctx; /* net epoch tracker */ }; #define RT_LOCK_INIT(_rt) \ Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sat May 23 03:32:08 2020 (r361408) +++ head/sys/net/rtsock.c Sat May 23 10:21:02 2020 (r361409) @@ -742,7 +742,6 @@ handle_rtm_get(struct rt_addrinfo *info, u_int fibnum, } } RT_LOCK(rt); - RT_ADDREF(rt); RIB_RUNLOCK(rnh); *ret_nrt = rt; @@ -930,7 +929,6 @@ route_output(struct mbuf *m, struct socket *so, ...) #endif RT_LOCK(saved_nrt); rtm->rtm_index = saved_nrt->rt_nhop->nh_ifp->if_index; - RT_REMREF(saved_nrt); RT_UNLOCK(saved_nrt); } break; @@ -987,8 +985,7 @@ report: flush: NET_EPOCH_EXIT(et); - if (rt != NULL) - RTFREE(rt); + rt = NULL; #ifdef INET6 if (rtm != NULL) { Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Sat May 23 03:32:08 2020 (r361408) +++ head/sys/netinet6/nd6.c Sat May 23 10:21:02 2020 (r361409) @@ -1566,14 +1566,17 @@ nd6_free_redirect(const struct llentry *ln) int fibnum; struct sockaddr_in6 sin6; struct rt_addrinfo info; + struct epoch_tracker et; lltable_fill_sa_entry(ln, (struct sockaddr *)&sin6); memset(&info, 0, sizeof(info)); info.rti_info[RTAX_DST] = (struct sockaddr *)&sin6; info.rti_filter = nd6_isdynrte; + NET_EPOCH_ENTER(et); for (fibnum = 0; fibnum < rt_numfibs; fibnum++) rtrequest1_fib(RTM_DELETE, &info, NULL, fibnum); + NET_EPOCH_EXIT(et); } /* Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Sat May 23 03:32:08 2020 (r361408) +++ head/sys/netinet6/nd6_rtr.c Sat May 23 10:21:02 2020 (r361409) @@ -690,10 +690,8 @@ defrouter_addreq(struct nd_defrouter *new) error = in6_rtrequest(RTM_ADD, (struct sockaddr *)&def, (struct sockaddr *)&gate, (struct sockaddr *)&mask, RTF_GATEWAY, &newrt, fibnum); - if (newrt) { + if (newrt != NULL) rt_routemsg(RTM_ADD, newrt, new->ifp, 0, fibnum); - RTFREE_FUNC(newrt); - } if (error == 0) new->installed = 1; } @@ -708,6 +706,7 @@ defrouter_delreq(struct nd_defrouter *dr) { struct sockaddr_in6 def, mask, gate; struct rtentry *oldrt = NULL; + struct epoch_tracker et; unsigned int fibnum; bzero(&def, sizeof(def)); @@ -720,13 +719,13 @@ defrouter_delreq(struct nd_defrouter *dr) gate.sin6_addr = dr->rtaddr; fibnum = dr->ifp->if_fib; + NET_EPOCH_ENTER(et); in6_rtrequest(RTM_DELETE, (struct sockaddr *)&def, (struct sockaddr *)&gate, (struct sockaddr *)&mask, RTF_GATEWAY, &oldrt, fibnum); - if (oldrt) { + if (oldrt != NULL) rt_routemsg(RTM_DELETE, oldrt, dr->ifp, 0, fibnum); - RTFREE_FUNC(oldrt); - } + NET_EPOCH_EXIT(et); dr->installed = 0; } @@ -1022,6 +1021,7 @@ defrouter_select_fib(int fibnum) } ND6_RUNLOCK(); + NET_EPOCH_ENTER(et); /* * If we selected a router for this FIB and it's different * than the installed one, remove the installed router and @@ -1037,6 +1037,7 @@ defrouter_select_fib(int fibnum) } if (selected_dr != NULL) defrouter_rele(selected_dr); + NET_EPOCH_EXIT(et); } static struct nd_defrouter * @@ -2064,7 +2065,6 @@ nd6_prefix_onlink_rtrequest(struct nd_prefix *pr, stru pr->ndpr_stateflags |= NDPRF_ONLINK; rt_routemsg(RTM_ADD, rt, pr->ndpr_ifp, 0, fibnum); - RTFREE_FUNC(rt); } /* Return the last error we got. */ @@ -2132,7 +2132,6 @@ nd6_prefix_onlink(struct nd_prefix *pr) } /* should we care about ia6_flags? */ } - NET_EPOCH_EXIT(et); if (ifa == NULL) { /* * This can still happen, when, for example, we receive an RA @@ -2145,14 +2144,13 @@ nd6_prefix_onlink(struct nd_prefix *pr) "prefix(%s/%d) on %s\n", __func__, ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), pr->ndpr_plen, if_name(ifp))); - return (0); + error = 0; + } else { + error = nd6_prefix_onlink_rtrequest(pr, ifa); + ifa_free(ifa); } + NET_EPOCH_EXIT(et); - error = nd6_prefix_onlink_rtrequest(pr, ifa); - - if (ifa != NULL) - ifa_free(ifa); - return (error); } @@ -2167,6 +2165,7 @@ nd6_prefix_offlink(struct nd_prefix *pr) char ip6buf[INET6_ADDRSTRLEN]; uint64_t genid; int fibnum, maxfib, a_failure; + struct epoch_tracker et; ND6_ONLINK_LOCK_ASSERT(); ND6_UNLOCK_ASSERT(); @@ -2193,6 +2192,7 @@ nd6_prefix_offlink(struct nd_prefix *pr) } a_failure = 0; + NET_EPOCH_ENTER(et); for (; fibnum < maxfib; fibnum++) { rt = NULL; error = in6_rtrequest(RTM_DELETE, (struct sockaddr *)&sa6, NULL, @@ -2205,8 +2205,8 @@ nd6_prefix_offlink(struct nd_prefix *pr) /* report route deletion to the routing socket. */ rt_routemsg(RTM_DELETE, rt, ifp, 0, fibnum); - RTFREE_FUNC(rt); } + NET_EPOCH_EXIT(et); error = a_failure; a_failure = 1; if (error == 0) { Modified: head/sys/nfs/bootp_subr.c ============================================================================== --- head/sys/nfs/bootp_subr.c Sat May 23 03:32:08 2020 (r361408) +++ head/sys/nfs/bootp_subr.c Sat May 23 10:21:02 2020 (r361409) @@ -1664,14 +1664,17 @@ retry: goto out; if (gctx->gotrootpath != 0) { + struct epoch_tracker et; kern_setenv("boot.netif.name", ifctx->ifp->if_xname); + NET_EPOCH_ENTER(et); bootpc_add_default_route(ifctx); error = md_mount(&nd->root_saddr, nd->root_hostnam, nd->root_fh, &nd->root_fhsize, &nd->root_args, td); bootpc_remove_default_route(ifctx); + NET_EPOCH_EXIT(et); if (error != 0) { if (gctx->any_root_overrides == 0) panic("nfs_boot: mount root, error=%d", error); From owner-svn-src-all@freebsd.org Sat May 23 10:32: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 CFB3B2FE2A8; Sat, 23 May 2020 10:32:24 +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 49Tfn45JWbz3Shn; Sat, 23 May 2020 10:32:24 +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 B0874E631; Sat, 23 May 2020 10:32:24 +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 04NAWOfp072630; Sat, 23 May 2020 10:32:24 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NAWJJg072601; Sat, 23 May 2020 10:32:19 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005231032.04NAWJJg072601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 23 May 2020 10:32:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361410 - in head: . contrib/llvm-project contrib/llvm-project/clang/include/clang/AST contrib/llvm-project/clang/include/clang/Basic contrib/llvm-project/clang/lib/AST contrib/llvm-pro... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: . contrib/llvm-project 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/CodeGen co... X-SVN-Commit-Revision: 361410 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, 23 May 2020 10:32:24 -0000 Author: dim Date: Sat May 23 10:32:18 2020 New Revision: 361410 URL: https://svnweb.freebsd.org/changeset/base/361410 Log: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp llvmorg-10.0.1-rc1-0-gf79cd71e145 (aka 10.0.1 rc1). MFC after: 3 weeks Modified: head/ObsoleteFiles.inc head/UPDATING head/contrib/llvm-project/FREEBSD-Xlist head/contrib/llvm-project/clang/include/clang/AST/DeclBase.h head/contrib/llvm-project/clang/include/clang/Basic/Attr.td head/contrib/llvm-project/clang/lib/AST/DeclBase.cpp head/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp head/contrib/llvm-project/clang/lib/AST/RawCommentList.cpp head/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp head/contrib/llvm-project/clang/lib/Driver/ToolChains/Darwin.cpp head/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp head/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.h head/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.cpp head/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.h head/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.cpp head/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.h head/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp head/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp head/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp head/contrib/llvm-project/clang/lib/Sema/TreeTransform.h head/contrib/llvm-project/compiler-rt/lib/profile/GCDAProfiling.c head/contrib/llvm-project/lld/COFF/MarkLive.cpp head/contrib/llvm-project/lld/ELF/Driver.cpp head/contrib/llvm-project/lld/ELF/InputSection.cpp head/contrib/llvm-project/lld/ELF/InputSection.h head/contrib/llvm-project/lld/ELF/OutputSections.cpp head/contrib/llvm-project/lld/ELF/Writer.cpp head/contrib/llvm-project/llvm/include/llvm/Analysis/ValueLattice.h head/contrib/llvm-project/llvm/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h head/contrib/llvm-project/llvm/lib/Analysis/LazyValueInfo.cpp head/contrib/llvm-project/llvm/lib/Analysis/ValueLattice.cpp head/contrib/llvm-project/llvm/lib/CodeGen/MachineSink.cpp head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp head/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp head/contrib/llvm-project/llvm/lib/DebugInfo/CodeView/MergingTypeTableBuilder.cpp head/contrib/llvm-project/llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp head/contrib/llvm-project/llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp head/contrib/llvm-project/llvm/lib/MC/MCObjectFileInfo.cpp head/contrib/llvm-project/llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp head/contrib/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm-project/llvm/lib/Target/X86/X86IndirectBranchTracking.cpp head/contrib/llvm-project/llvm/lib/Target/X86/X86TargetMachine.cpp head/contrib/llvm-project/llvm/lib/Target/X86/X86TargetMachine.h head/contrib/llvm-project/llvm/lib/Transforms/Coroutines/CoroSplit.cpp head/contrib/llvm-project/llvm/lib/Transforms/IPO/GlobalOpt.cpp head/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp head/contrib/llvm-project/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp head/contrib/llvm-project/llvm/tools/llvm-objcopy/ELF/Object.cpp head/contrib/llvm-project/llvm/tools/llvm-objcopy/llvm-objcopy.cpp head/etc/mtree/BSD.debug.dist head/etc/mtree/BSD.usr.dist head/lib/clang/headers/Makefile head/lib/clang/include/VCSVersion.inc head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/clang/Config/config.h head/lib/clang/include/lld/Common/Version.inc head/lib/clang/include/llvm/Config/config.h head/lib/clang/include/llvm/Config/llvm-config.h head/lib/clang/include/llvm/Support/VCSRevision.h head/lib/libclang_rt/Makefile.inc head/sys/sys/param.h head/tools/build/mk/OptionalObsoleteFiles.inc 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/lld/ (props changed) head/contrib/llvm-project/llvm/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat May 23 10:21:02 2020 (r361409) +++ head/ObsoleteFiles.inc Sat May 23 10:32:18 2020 (r361410) @@ -36,6 +36,257 @@ # xargs -n1 | sort | uniq -d; # done +# 20200523: new clang import which bumps version from 10.0.0 to 10.0.1.s +OLD_FILES+=usr/lib/clang/10.0.0/include/cuda_wrappers/algorithm +OLD_FILES+=usr/lib/clang/10.0.0/include/cuda_wrappers/complex +OLD_FILES+=usr/lib/clang/10.0.0/include/cuda_wrappers/new +OLD_DIRS+=usr/lib/clang/10.0.0/include/cuda_wrappers +OLD_FILES+=usr/lib/clang/10.0.0/include/fuzzer/FuzzedDataProvider.h +OLD_DIRS+=usr/lib/clang/10.0.0/include/fuzzer +OLD_FILES+=usr/lib/clang/10.0.0/include/openmp_wrappers/__clang_openmp_math.h +OLD_FILES+=usr/lib/clang/10.0.0/include/openmp_wrappers/__clang_openmp_math_declares.h +OLD_FILES+=usr/lib/clang/10.0.0/include/openmp_wrappers/cmath +OLD_FILES+=usr/lib/clang/10.0.0/include/openmp_wrappers/math.h +OLD_DIRS+=usr/lib/clang/10.0.0/include/openmp_wrappers +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/emmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/mm_malloc.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/mmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/pmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/smmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/tmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ppc_wrappers/xmmintrin.h +OLD_DIRS+=usr/lib/clang/10.0.0/include/ppc_wrappers +OLD_FILES+=usr/lib/clang/10.0.0/include/profile/InstrProfData.inc +OLD_DIRS+=usr/lib/clang/10.0.0/include/profile +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/hwasan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/netbsd_syscall_hooks.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/scudo_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/tsan_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/tsan_interface_atomic.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sanitizer/ubsan_interface.h +OLD_DIRS+=usr/lib/clang/10.0.0/include/sanitizer +OLD_FILES+=usr/lib/clang/10.0.0/include/xray/xray_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xray/xray_log_interface.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xray/xray_records.h +OLD_DIRS+=usr/lib/clang/10.0.0/include/xray +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_cmath.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_complex_builtins.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_device_functions.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_intrinsics.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_libdevice_declares.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_math_forward_declares.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__clang_cuda_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/10.0.0/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/10.0.0/include/adxintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/altivec.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ammintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm64intr.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm_acle.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm_cmse.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm_fp16.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm_mve.h +OLD_FILES+=usr/lib/clang/10.0.0/include/arm_neon.h +OLD_FILES+=usr/lib/clang/10.0.0/include/armintr.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512bf16intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512bitalgintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512ifmaintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512ifmavlintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512pfintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vbmi2intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vbmiintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vbmivlintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlbf16intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlbitalgintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlcdintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlvbmi2intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlvnniintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vlvp2intersectintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vnniintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vp2intersectintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vpopcntdqintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avx512vpopcntdqvlintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/avxintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/cetintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/cldemoteintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/clflushoptintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/clwbintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/clzerointrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/cpuid.h +OLD_FILES+=usr/lib/clang/10.0.0/include/emmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/enqcmdintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/gfniintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/htmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/immintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/invpcidintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/lwpintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/10.0.0/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/10.0.0/include/mmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/module.modulemap +OLD_FILES+=usr/lib/clang/10.0.0/include/movdirintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/msa.h +OLD_FILES+=usr/lib/clang/10.0.0/include/mwaitxintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/opencl-c-base.h +OLD_FILES+=usr/lib/clang/10.0.0/include/opencl-c.h +OLD_FILES+=usr/lib/clang/10.0.0/include/pconfigintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/pkuintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/ptwriteintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/s390intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/sgxintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/shaintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/smmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/vadefs.h +OLD_FILES+=usr/lib/clang/10.0.0/include/vaesintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/vecintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/vpclmulqdqintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/waitpkgintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/wbnoinvdintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/x86intrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xopintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xsavecintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xsaveintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xsaveoptintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xsavesintrin.h +OLD_FILES+=usr/lib/clang/10.0.0/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/10.0.0/include +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-aarch64.so +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-arm.so +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-armhf.so +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-i386.so +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-preinit-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-preinit-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-preinit-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-preinit-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-preinit-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan-x86_64.so +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan_cxx-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan_cxx-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi_diag-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi_diag-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi_diag-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi_diag-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.cfi_diag-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.dd-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.dd-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.fuzzer-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.fuzzer-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.fuzzer_no_main-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.fuzzer_no_main-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.msan-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.msan-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.msan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.msan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-powerpc.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-powerpc64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.safestack-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats_client-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats_client-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats_client-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats_client-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.stats_client-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.tsan-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.tsan-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.tsan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.tsan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_minimal-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_minimal-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_minimal-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_minimal-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_minimal-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-basic-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-basic-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-basic-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-basic-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-fdr-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-fdr-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-fdr-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-fdr-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-profiling-aarch64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-profiling-arm.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-profiling-armhf.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-profiling-x86_64.a +OLD_FILES+=usr/lib/clang/10.0.0/lib/freebsd/libclang_rt.xray-x86_64.a +OLD_DIRS+=usr/lib/clang/10.0.0/lib/freebsd +OLD_DIRS+=usr/lib/clang/10.0.0/lib +OLD_DIRS+=usr/lib/clang/10.0.0 + # 20200515: libalias cuseeme protocol support retired OLD_LIBS+=lib/libalias_cuseeme.so OLD_FILES+=usr/lib/libalias_cuseeme.a Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat May 23 10:21:02 2020 (r361409) +++ head/UPDATING Sat May 23 10:32:18 2020 (r361410) @@ -26,6 +26,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20200523: + Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have + been upgraded to 10.0.1. Please see the 20141231 entry below for + information about prerequisites and upgrading, if you are not already + using clang 3.5.0 or higher. + 20200424: closefrom(2) has been moved under COMPAT12, and replaced in libc with a stub that calls close_range(2). If using a custom kernel configuration, Modified: head/contrib/llvm-project/FREEBSD-Xlist ============================================================================== --- head/contrib/llvm-project/FREEBSD-Xlist Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/FREEBSD-Xlist Sat May 23 10:32:18 2020 (r361410) @@ -3,6 +3,7 @@ .clang-format .clang-tidy .git-blame-ignore-revs +.github/ .gitignore CONTRIBUTING.md README.md @@ -264,6 +265,7 @@ lldb/.clang-format lldb/.gitignore lldb/CMakeLists.txt lldb/CODE_OWNERS.txt +lldb/bindings/CMakeLists.txt lldb/cmake/ lldb/docs/.htaccess lldb/docs/CMakeLists.txt Modified: head/contrib/llvm-project/clang/include/clang/AST/DeclBase.h ============================================================================== --- head/contrib/llvm-project/clang/include/clang/AST/DeclBase.h Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/include/clang/AST/DeclBase.h Sat May 23 10:32:18 2020 (r361410) @@ -856,14 +856,15 @@ class alignas(8) Decl { (public) return getParentFunctionOrMethod() == nullptr; } - /// Returns true if this declaration lexically is inside a function. - /// It recognizes non-defining declarations as well as members of local - /// classes: + /// Returns true if this declaration is lexically inside a function or inside + /// a variable initializer. It recognizes non-defining declarations as well + /// as members of local classes: /// \code /// void foo() { void bar(); } /// void foo2() { class ABC { void bar(); }; } + /// inline int x = [](){ return 0; }; /// \endcode - bool isLexicallyWithinFunctionOrMethod() const; + bool isInLocalScope() const; /// If this decl is defined inside a function/method/block it returns /// the corresponding DeclContext, otherwise it returns null. Modified: head/contrib/llvm-project/clang/include/clang/Basic/Attr.td ============================================================================== --- head/contrib/llvm-project/clang/include/clang/Basic/Attr.td Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/include/clang/Basic/Attr.td Sat May 23 10:32:18 2020 (r361410) @@ -685,7 +685,7 @@ def XRayLogArgs : InheritableAttr { def PatchableFunctionEntry : InheritableAttr, - TargetSpecificAttr> { + TargetSpecificAttr> { let Spellings = [GCC<"patchable_function_entry">]; let Subjects = SubjectList<[Function, ObjCMethod]>; let Args = [UnsignedArgument<"Count">, DefaultIntArgument<"Offset", 0>]; Modified: head/contrib/llvm-project/clang/lib/AST/DeclBase.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/AST/DeclBase.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/AST/DeclBase.cpp Sat May 23 10:32:18 2020 (r361410) @@ -332,13 +332,16 @@ void Decl::setDeclContextsImpl(DeclContext *SemaDC, De } } -bool Decl::isLexicallyWithinFunctionOrMethod() const { +bool Decl::isInLocalScope() const { const DeclContext *LDC = getLexicalDeclContext(); while (true) { if (LDC->isFunctionOrMethod()) return true; if (!isa(LDC)) return false; + if (const auto *CRD = dyn_cast(LDC)) + if (CRD->isLambda()) + return true; LDC = LDC->getLexicalParent(); } return false; Modified: head/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp Sat May 23 10:32:18 2020 (r361410) @@ -8593,6 +8593,10 @@ bool PointerExprEvaluator::VisitBuiltinCallExpr(const static bool EvaluateArrayNewInitList(EvalInfo &Info, LValue &This, APValue &Result, const InitListExpr *ILE, QualType AllocType); +static bool EvaluateArrayNewConstructExpr(EvalInfo &Info, LValue &This, + APValue &Result, + const CXXConstructExpr *CCE, + QualType AllocType); bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNewExpr *E) { if (!Info.getLangOpts().CPlusPlus2a) @@ -8642,6 +8646,7 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNe const Expr *Init = E->getInitializer(); const InitListExpr *ResizedArrayILE = nullptr; + const CXXConstructExpr *ResizedArrayCCE = nullptr; QualType AllocType = E->getAllocatedType(); if (Optional ArraySize = E->getArraySize()) { @@ -8685,7 +8690,7 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNe // -- the new-initializer is a braced-init-list and the number of // array elements for which initializers are provided [...] // exceeds the number of elements to initialize - if (Init) { + if (Init && !isa(Init)) { auto *CAT = Info.Ctx.getAsConstantArrayType(Init->getType()); assert(CAT && "unexpected type for array initializer"); @@ -8708,6 +8713,8 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNe // special handling for this case when we initialize. if (InitBound != AllocBound) ResizedArrayILE = cast(Init); + } else if (Init) { + ResizedArrayCCE = cast(Init); } AllocType = Info.Ctx.getConstantArrayType(AllocType, ArrayBound, nullptr, @@ -8772,6 +8779,10 @@ bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNe if (!EvaluateArrayNewInitList(Info, Result, *Val, ResizedArrayILE, AllocType)) return false; + } else if (ResizedArrayCCE) { + if (!EvaluateArrayNewConstructExpr(Info, Result, *Val, ResizedArrayCCE, + AllocType)) + return false; } else if (Init) { if (!EvaluateInPlace(*Val, Info, Result, Init)) return false; @@ -9595,6 +9606,16 @@ static bool EvaluateArrayNewInitList(EvalInfo &Info, L "not an array rvalue"); return ArrayExprEvaluator(Info, This, Result) .VisitInitListExpr(ILE, AllocType); +} + +static bool EvaluateArrayNewConstructExpr(EvalInfo &Info, LValue &This, + APValue &Result, + const CXXConstructExpr *CCE, + QualType AllocType) { + assert(CCE->isRValue() && CCE->getType()->isArrayType() && + "not an array rvalue"); + return ArrayExprEvaluator(Info, This, Result) + .VisitCXXConstructExpr(CCE, This, &Result, AllocType); } // Return true iff the given array filler may depend on the element index. Modified: head/contrib/llvm-project/clang/lib/AST/RawCommentList.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/AST/RawCommentList.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/AST/RawCommentList.cpp Sat May 23 10:32:18 2020 (r361410) @@ -430,7 +430,7 @@ std::string RawComment::getFormattedText(const SourceM }; auto DropTrailingNewLines = [](std::string &Str) { - while (Str.back() == '\n') + while (!Str.empty() && Str.back() == '\n') Str.pop_back(); }; Modified: head/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp Sat May 23 10:32:18 2020 (r361410) @@ -1847,9 +1847,16 @@ void CodeGenModule::SetFunctionAttributes(GlobalDecl G else if (const auto *SA = FD->getAttr()) F->setSection(SA->getName()); + // If we plan on emitting this inline builtin, we can't treat it as a builtin. if (FD->isInlineBuiltinDeclaration()) { - F->addAttribute(llvm::AttributeList::FunctionIndex, - llvm::Attribute::NoBuiltin); + const FunctionDecl *FDBody; + bool HasBody = FD->hasBody(FDBody); + (void)HasBody; + assert(HasBody && "Inline builtin declarations should always have an " + "available body!"); + if (shouldEmitFunction(FDBody)) + F->addAttribute(llvm::AttributeList::FunctionIndex, + llvm::Attribute::NoBuiltin); } if (FD->isReplaceableGlobalAllocationFunction()) { Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Darwin.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Darwin.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Darwin.cpp Sat May 23 10:32:18 2020 (r361410) @@ -1146,6 +1146,7 @@ void Darwin::addProfileRTLibs(const ArgList &Args, addExportedSymbol(CmdArgs, "___gcov_flush"); addExportedSymbol(CmdArgs, "_flush_fn_list"); addExportedSymbol(CmdArgs, "_writeout_fn_list"); + addExportedSymbol(CmdArgs, "_reset_fn_list"); } else { addExportedSymbol(CmdArgs, "___llvm_profile_filename"); addExportedSymbol(CmdArgs, "___llvm_profile_raw_version"); Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp Sat May 23 10:32:18 2020 (r361410) @@ -309,7 +309,7 @@ static const char *getLDMOption(const llvm::Triple &T, } } -static bool getPIE(const ArgList &Args, const toolchains::Linux &ToolChain) { +static bool getPIE(const ArgList &Args, const ToolChain &TC) { if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_static) || Args.hasArg(options::OPT_r) || Args.hasArg(options::OPT_static_pie)) return false; @@ -317,17 +317,16 @@ static bool getPIE(const ArgList &Args, const toolchai Arg *A = Args.getLastArg(options::OPT_pie, options::OPT_no_pie, options::OPT_nopie); if (!A) - return ToolChain.isPIEDefault(); + return TC.isPIEDefault(); return A->getOption().matches(options::OPT_pie); } -static bool getStaticPIE(const ArgList &Args, - const toolchains::Linux &ToolChain) { +static bool getStaticPIE(const ArgList &Args, const ToolChain &TC) { bool HasStaticPIE = Args.hasArg(options::OPT_static_pie); // -no-pie is an alias for -nopie. So, handling -nopie takes care of // -no-pie as well. if (HasStaticPIE && Args.hasArg(options::OPT_nopie)) { - const Driver &D = ToolChain.getDriver(); + const Driver &D = TC.getDriver(); const llvm::opt::OptTable &Opts = D.getOpts(); const char *StaticPIEName = Opts.getOptionName(options::OPT_static_pie); const char *NoPIEName = Opts.getOptionName(options::OPT_nopie); @@ -346,8 +345,12 @@ void tools::gnutools::Linker::ConstructJob(Compilation const InputInfoList &Inputs, const ArgList &Args, const char *LinkingOutput) const { - const toolchains::Linux &ToolChain = - static_cast(getToolChain()); + // FIXME: The Linker class constructor takes a ToolChain and not a + // Generic_ELF, so the static_cast might return a reference to a invalid + // instance (see PR45061). Ideally, the Linker constructor needs to take a + // Generic_ELF instead. + const toolchains::Generic_ELF &ToolChain = + static_cast(getToolChain()); const Driver &D = ToolChain.getDriver(); const llvm::Triple &Triple = getToolChain().getEffectiveTriple(); @@ -418,8 +421,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation if (isAndroid) CmdArgs.push_back("--warn-shared-textrel"); - for (const auto &Opt : ToolChain.ExtraOpts) - CmdArgs.push_back(Opt.c_str()); + ToolChain.addExtraOpts(CmdArgs); CmdArgs.push_back("--eh-frame-hdr"); Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.h ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.h Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Gnu.h Sat May 23 10:32:18 2020 (r361410) @@ -356,6 +356,12 @@ class LLVM_LIBRARY_VISIBILITY Generic_ELF : public Gen void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, Action::OffloadKind DeviceOffloadKind) const override; + + virtual std::string getDynamicLinker(const llvm::opt::ArgList &Args) const { + return {}; + } + + virtual void addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const {} }; } // end namespace toolchains Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.cpp Sat May 23 10:32:18 2020 (r361410) @@ -61,8 +61,7 @@ static StringRef getOSLibDir(const llvm::Triple &Tripl return Triple.isArch32Bit() ? "lib" : "lib64"; } -Hurd::Hurd(const Driver &D, const llvm::Triple &Triple, - const ArgList &Args) +Hurd::Hurd(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) : Generic_ELF(D, Triple, Args) { std::string SysRoot = computeSysRoot(); path_list &Paths = getFilePaths(); @@ -169,4 +168,9 @@ void Hurd::AddClangSystemIncludeArgs(const ArgList &Dr addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/include"); addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); +} + +void Hurd::addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const { + for (const auto &Opt : ExtraOpts) + CmdArgs.push_back(Opt.c_str()); } Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.h ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.h Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Hurd.h Sat May 23 10:32:18 2020 (r361410) @@ -27,9 +27,11 @@ class LLVM_LIBRARY_VISIBILITY Hurd : public Generic_EL AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override; - virtual std::string computeSysRoot() const; + std::string computeSysRoot() const; - virtual std::string getDynamicLinker(const llvm::opt::ArgList &Args) const; + std::string getDynamicLinker(const llvm::opt::ArgList &Args) const override; + + void addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const override; std::vector ExtraOpts; Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.cpp Sat May 23 10:32:18 2020 (r361410) @@ -986,3 +986,8 @@ void Linux::addProfileRTLibs(const llvm::opt::ArgList Twine("-u", llvm::getInstrProfRuntimeHookVarName()))); ToolChain::addProfileRTLibs(Args, CmdArgs); } + +void Linux::addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const { + for (const auto &Opt : ExtraOpts) + CmdArgs.push_back(Opt.c_str()); +} Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.h ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.h Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Linux.h Sat May 23 10:32:18 2020 (r361410) @@ -42,7 +42,9 @@ class LLVM_LIBRARY_VISIBILITY Linux : public Generic_E llvm::opt::ArgStringList &CmdArgs) const override; virtual std::string computeSysRoot() const; - virtual std::string getDynamicLinker(const llvm::opt::ArgList &Args) const; + std::string getDynamicLinker(const llvm::opt::ArgList &Args) const override; + + void addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const override; std::vector ExtraOpts; Modified: head/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Format/TokenAnnotator.cpp Sat May 23 10:32:18 2020 (r361410) @@ -2176,6 +2176,10 @@ static bool isFunctionDeclarationName(const FormatToke Next = Next->Next; continue; } + if (Next->is(TT_TemplateOpener) && Next->MatchingParen) { + Next = Next->MatchingParen; + continue; + } break; } @@ -2705,20 +2709,40 @@ bool TokenAnnotator::spaceRequiredBetween(const Annota tok::l_square)); if (Right.is(tok::star) && Left.is(tok::l_paren)) return false; - if (Right.isOneOf(tok::star, tok::amp, tok::ampamp) && - (Left.is(tok::identifier) || Left.isSimpleTypeSpecifier()) && - // Space between the type and the * in: - // operator void*() - // operator char*() - // operator /*comment*/ const char*() - // operator volatile /*comment*/ char*() - // operator Foo*() - // dependent on PointerAlignment style. - Left.Previous && - (Left.Previous->endsSequence(tok::kw_operator) || - Left.Previous->endsSequence(tok::kw_const, tok::kw_operator) || - Left.Previous->endsSequence(tok::kw_volatile, tok::kw_operator))) - return (Style.PointerAlignment != FormatStyle::PAS_Left); + if (Right.is(tok::star) && Left.is(tok::star)) + return false; + if (Right.isOneOf(tok::star, tok::amp, tok::ampamp)) { + const FormatToken *Previous = &Left; + while (Previous && !Previous->is(tok::kw_operator)) { + if (Previous->is(tok::identifier) || Previous->isSimpleTypeSpecifier()) { + Previous = Previous->getPreviousNonComment(); + continue; + } + if (Previous->is(TT_TemplateCloser) && Previous->MatchingParen) { + Previous = Previous->MatchingParen->getPreviousNonComment(); + continue; + } + if (Previous->is(tok::coloncolon)) { + Previous = Previous->getPreviousNonComment(); + continue; + } + break; + } + // Space between the type and the * in: + // operator void*() + // operator char*() + // operator /*comment*/ const char*() + // operator volatile /*comment*/ char*() + // operator Foo*() + // operator C*() + // operator std::Foo*() + // operator C::D*() + // dependent on PointerAlignment style. + if (Previous && (Previous->endsSequence(tok::kw_operator) || + Previous->endsSequence(tok::kw_const, tok::kw_operator) || + Previous->endsSequence(tok::kw_volatile, tok::kw_operator))) + return (Style.PointerAlignment != FormatStyle::PAS_Left); + } const auto SpaceRequiredForArrayInitializerLSquare = [](const FormatToken &LSquareTok, const FormatStyle &Style) { return Style.SpacesInContainerLiterals || Modified: head/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiate.cpp Sat May 23 10:32:18 2020 (r361410) @@ -2343,7 +2343,7 @@ ParmVarDecl *Sema::SubstParmVarDecl(ParmVarDecl *OldPa UnparsedDefaultArgInstantiations[OldParm].push_back(NewParm); } else if (Expr *Arg = OldParm->getDefaultArg()) { FunctionDecl *OwningFunc = cast(OldParm->getDeclContext()); - if (OwningFunc->isLexicallyWithinFunctionOrMethod()) { + if (OwningFunc->isInLocalScope()) { // Instantiate default arguments for methods of local classes (DR1484) // and non-defining declarations. Sema::ContextRAII SavedContext(*this, OwningFunc); Modified: head/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp Sat May 23 10:32:18 2020 (r361410) @@ -4367,7 +4367,7 @@ TemplateDeclInstantiator::InitFunctionInstantiation(Fu EPI.ExceptionSpec.Type != EST_None && EPI.ExceptionSpec.Type != EST_DynamicNone && EPI.ExceptionSpec.Type != EST_BasicNoexcept && - !Tmpl->isLexicallyWithinFunctionOrMethod()) { + !Tmpl->isInLocalScope()) { FunctionDecl *ExceptionSpecTemplate = Tmpl; if (EPI.ExceptionSpec.Type == EST_Uninstantiated) ExceptionSpecTemplate = EPI.ExceptionSpec.SourceTemplate; Modified: head/contrib/llvm-project/clang/lib/Sema/TreeTransform.h ============================================================================== --- head/contrib/llvm-project/clang/lib/Sema/TreeTransform.h Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/clang/lib/Sema/TreeTransform.h Sat May 23 10:32:18 2020 (r361410) @@ -4022,50 +4022,8 @@ template void TreeTransform::InventTemplateArgumentLoc( const TemplateArgument &Arg, TemplateArgumentLoc &Output) { - SourceLocation Loc = getDerived().getBaseLocation(); - switch (Arg.getKind()) { - case TemplateArgument::Null: - llvm_unreachable("null template argument in TreeTransform"); - break; - - case TemplateArgument::Type: - Output = TemplateArgumentLoc(Arg, - SemaRef.Context.getTrivialTypeSourceInfo(Arg.getAsType(), Loc)); - - break; - - case TemplateArgument::Template: - case TemplateArgument::TemplateExpansion: { - NestedNameSpecifierLocBuilder Builder; - TemplateName Template = Arg.getAsTemplateOrTemplatePattern(); - if (DependentTemplateName *DTN = Template.getAsDependentTemplateName()) - Builder.MakeTrivial(SemaRef.Context, DTN->getQualifier(), Loc); - else if (QualifiedTemplateName *QTN = Template.getAsQualifiedTemplateName()) - Builder.MakeTrivial(SemaRef.Context, QTN->getQualifier(), Loc); - - if (Arg.getKind() == TemplateArgument::Template) - Output = TemplateArgumentLoc(Arg, - Builder.getWithLocInContext(SemaRef.Context), - Loc); - else - Output = TemplateArgumentLoc(Arg, - Builder.getWithLocInContext(SemaRef.Context), - Loc, Loc); - - break; - } - - case TemplateArgument::Expression: - Output = TemplateArgumentLoc(Arg, Arg.getAsExpr()); - break; - - case TemplateArgument::Declaration: - case TemplateArgument::Integral: - case TemplateArgument::Pack: - case TemplateArgument::NullPtr: - Output = TemplateArgumentLoc(Arg, TemplateArgumentLocInfo()); - break; - } + Output = getSema().getTrivialTemplateArgumentLoc( + Arg, QualType(), getDerived().getBaseLocation()); } template @@ -4075,12 +4033,45 @@ bool TreeTransform::TransformTemplateArgument const TemplateArgument &Arg = Input.getArgument(); switch (Arg.getKind()) { case TemplateArgument::Null: - case TemplateArgument::Integral: case TemplateArgument::Pack: - case TemplateArgument::Declaration: - case TemplateArgument::NullPtr: llvm_unreachable("Unexpected TemplateArgument"); + case TemplateArgument::Integral: + case TemplateArgument::NullPtr: + case TemplateArgument::Declaration: { + // Transform a resolved template argument straight to a resolved template + // argument. We get here when substituting into an already-substituted + // template type argument during concept satisfaction checking. + QualType T = Arg.getNonTypeTemplateArgumentType(); + QualType NewT = getDerived().TransformType(T); + if (NewT.isNull()) + return true; + + ValueDecl *D = Arg.getKind() == TemplateArgument::Declaration + ? Arg.getAsDecl() + : nullptr; + ValueDecl *NewD = D ? cast_or_null(getDerived().TransformDecl( + getDerived().getBaseLocation(), D)) + : nullptr; + if (D && !NewD) + return true; + + if (NewT == T && D == NewD) + Output = Input; + else if (Arg.getKind() == TemplateArgument::Integral) + Output = TemplateArgumentLoc( + TemplateArgument(getSema().Context, Arg.getAsIntegral(), NewT), + TemplateArgumentLocInfo()); + else if (Arg.getKind() == TemplateArgument::NullPtr) + Output = TemplateArgumentLoc(TemplateArgument(NewT, /*IsNullPtr=*/true), + TemplateArgumentLocInfo()); + else + Output = TemplateArgumentLoc(TemplateArgument(NewD, NewT), + TemplateArgumentLocInfo()); + + return false; + } + case TemplateArgument::Type: { TypeSourceInfo *DI = Input.getTypeSourceInfo(); if (!DI) @@ -11836,19 +11827,6 @@ TreeTransform::TransformLambdaExpr(LambdaExpr NewTrailingRequiresClause.get()); LSI->CallOperator = NewCallOperator; - - for (unsigned I = 0, NumParams = NewCallOperator->getNumParams(); - I != NumParams; ++I) { - auto *P = NewCallOperator->getParamDecl(I); - if (P->hasUninstantiatedDefaultArg()) { - EnterExpressionEvaluationContext Eval( - getSema(), - Sema::ExpressionEvaluationContext::PotentiallyEvaluatedIfUsed, P); - ExprResult R = getDerived().TransformExpr( - E->getCallOperator()->getParamDecl(I)->getDefaultArg()); - P->setDefaultArg(R.get()); - } - } getDerived().transformAttrs(E->getCallOperator(), NewCallOperator); getDerived().transformedLocalDecl(E->getCallOperator(), {NewCallOperator}); Modified: head/contrib/llvm-project/compiler-rt/lib/profile/GCDAProfiling.c ============================================================================== --- head/contrib/llvm-project/compiler-rt/lib/profile/GCDAProfiling.c Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/compiler-rt/lib/profile/GCDAProfiling.c Sat May 23 10:32:18 2020 (r361410) @@ -32,8 +32,10 @@ #include #include "WindowsMMap.h" #else -#include #include +#include +#include +#include #endif #if defined(__FreeBSD__) && defined(__i386__) @@ -119,6 +121,11 @@ struct fn_list writeout_fn_list; */ struct fn_list flush_fn_list; +/* + * A list of reset functions, shared between all dynamic objects. + */ +struct fn_list reset_fn_list; + static void fn_list_insert(struct fn_list* list, fn_ptr fn) { struct fn_node* new_node = malloc(sizeof(struct fn_node)); new_node->fn = fn; @@ -634,7 +641,46 @@ void llvm_delete_flush_function_list(void) { } COMPILER_RT_VISIBILITY -void llvm_gcov_init(fn_ptr wfn, fn_ptr ffn) { +void llvm_register_reset_function(fn_ptr fn) { + fn_list_insert(&reset_fn_list, fn); +} + +COMPILER_RT_VISIBILITY +void llvm_delete_reset_function_list(void) { fn_list_remove(&reset_fn_list); } + +COMPILER_RT_VISIBILITY +void llvm_reset_counters(void) { + struct fn_node *curr = reset_fn_list.head; + + while (curr) { + if (curr->id == CURRENT_ID) { + curr->fn(); + } + curr = curr->next; + } +} + +#if !defined(_WIN32) +COMPILER_RT_VISIBILITY +pid_t __gcov_fork() { + pid_t parent_pid = getpid(); + pid_t pid = fork(); + + if (pid == 0) { + pid_t child_pid = getpid(); + if (child_pid != parent_pid) { + // The pid changed so we've a fork (one could have its own fork function) + // Just reset the counters for this child process + // threads. + llvm_reset_counters(); + } + } + return pid; +} +#endif + +COMPILER_RT_VISIBILITY +void llvm_gcov_init(fn_ptr wfn, fn_ptr ffn, fn_ptr rfn) { static int atexit_ran = 0; if (wfn) @@ -643,10 +689,14 @@ void llvm_gcov_init(fn_ptr wfn, fn_ptr ffn) { if (ffn) llvm_register_flush_function(ffn); + if (rfn) + llvm_register_reset_function(rfn); + if (atexit_ran == 0) { atexit_ran = 1; /* Make sure we write out the data and delete the data structures. */ + atexit(llvm_delete_reset_function_list); atexit(llvm_delete_flush_function_list); atexit(llvm_delete_writeout_function_list); atexit(llvm_writeout_files); Modified: head/contrib/llvm-project/lld/COFF/MarkLive.cpp ============================================================================== --- head/contrib/llvm-project/lld/COFF/MarkLive.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/lld/COFF/MarkLive.cpp Sat May 23 10:32:18 2020 (r361410) @@ -28,10 +28,12 @@ void markLive(ArrayRef chunks) { // as we push, so sections never appear twice in the list. SmallVector worklist; - // COMDAT section chunks are dead by default. Add non-COMDAT chunks. + // COMDAT section chunks are dead by default. Add non-COMDAT chunks. Do not + // traverse DWARF sections. They are live, but they should not keep other + // sections alive. for (Chunk *c : chunks) if (auto *sc = dyn_cast(c)) - if (sc->live) + if (sc->live && !sc->isDWARF()) worklist.push_back(sc); auto enqueue = [&](SectionChunk *c) { Modified: head/contrib/llvm-project/lld/ELF/Driver.cpp ============================================================================== --- head/contrib/llvm-project/lld/ELF/Driver.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/lld/ELF/Driver.cpp Sat May 23 10:32:18 2020 (r361410) @@ -1906,8 +1906,17 @@ template void LinkerDriver::link(opt::Inp // We do not want to emit debug sections if --strip-all // or -strip-debug are given. - return config->strip != StripPolicy::None && - (s->name.startswith(".debug") || s->name.startswith(".zdebug")); + if (config->strip == StripPolicy::None) + return false; + + if (isDebugSection(*s)) + return true; + if (auto *isec = dyn_cast(s)) + if (InputSectionBase *rel = isec->getRelocatedSection()) + if (isDebugSection(*rel)) + return true; + + return false; }); // Now that the number of partitions is fixed, save a pointer to the main Modified: head/contrib/llvm-project/lld/ELF/InputSection.cpp ============================================================================== --- head/contrib/llvm-project/lld/ELF/InputSection.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/lld/ELF/InputSection.cpp Sat May 23 10:32:18 2020 (r361410) @@ -441,8 +441,7 @@ void InputSection::copyRelocations(uint8_t *buf, Array // See the comment in maybeReportUndefined for PPC32 .got2 and PPC64 .toc auto *d = dyn_cast(&sym); if (!d) { - if (!sec->name.startswith(".debug") && - !sec->name.startswith(".zdebug") && sec->name != ".eh_frame" && + if (!isDebugSection(*sec) && sec->name != ".eh_frame" && sec->name != ".gcc_except_table" && sec->name != ".got2" && sec->name != ".toc") { uint32_t secIdx = cast(sym).discardedSecIdx; Modified: head/contrib/llvm-project/lld/ELF/InputSection.h ============================================================================== --- head/contrib/llvm-project/lld/ELF/InputSection.h Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/lld/ELF/InputSection.h Sat May 23 10:32:18 2020 (r361410) @@ -357,6 +357,10 @@ class InputSection : public InputSectionBase { (privat template void copyShtGroup(uint8_t *buf); }; +inline bool isDebugSection(const InputSectionBase &sec) { + return sec.name.startswith(".debug") || sec.name.startswith(".zdebug"); +} + // The list of all input sections. extern std::vector inputSections; Modified: head/contrib/llvm-project/lld/ELF/OutputSections.cpp ============================================================================== --- head/contrib/llvm-project/lld/ELF/OutputSections.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/lld/ELF/OutputSections.cpp Sat May 23 10:32:18 2020 (r361410) @@ -114,8 +114,7 @@ void OutputSection::commitSection(InputSection *isec) flags = isec->flags; } else { // Otherwise, check if new type or flags are compatible with existing ones. - unsigned mask = SHF_TLS | SHF_LINK_ORDER; - if ((flags & mask) != (isec->flags & mask)) + if ((flags ^ isec->flags) & SHF_TLS) error("incompatible section flags for " + name + "\n>>> " + toString(isec) + ": 0x" + utohexstr(isec->flags) + "\n>>> output section " + name + ": 0x" + utohexstr(flags)); @@ -367,8 +366,9 @@ void OutputSection::finalize() { // all InputSections in the OutputSection have the same dependency. if (auto *ex = dyn_cast(first)) link = ex->getLinkOrderDep()->getParent()->sectionIndex; - else if (auto *d = first->getLinkOrderDep()) - link = d->getParent()->sectionIndex; + else if (first->flags & SHF_LINK_ORDER) + if (auto *d = first->getLinkOrderDep()) + link = d->getParent()->sectionIndex; } if (type == SHT_GROUP) { Modified: head/contrib/llvm-project/lld/ELF/Writer.cpp ============================================================================== --- head/contrib/llvm-project/lld/ELF/Writer.cpp Sat May 23 10:21:02 2020 (r361409) +++ head/contrib/llvm-project/lld/ELF/Writer.cpp Sat May 23 10:32:18 2020 (r361410) @@ -1524,17 +1524,30 @@ template void Writer::resolveShfLin // but sort must consider them all at once. std::vector scriptSections; std::vector sections; + bool started = false, stopped = false; for (BaseCommand *base : sec->sectionCommands) { if (auto *isd = dyn_cast(base)) { for (InputSection *&isec : isd->sections) { - scriptSections.push_back(&isec); - sections.push_back(isec); + if (!(isec->flags & SHF_LINK_ORDER)) { + if (started) + stopped = true; + } else if (stopped) { + error(toString(isec) + ": SHF_LINK_ORDER sections in " + sec->name + + " are not contiguous"); + } else { + started = true; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat May 23 11: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 A496E2C89B9; Sat, 23 May 2020 11:55:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Thcf3b38z3bJl; Sat, 23 May 2020 11:55:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71E7DF788; Sat, 23 May 2020 11:55:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NBtEpq023492; Sat, 23 May 2020 11:55:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NBtDfV023489; Sat, 23 May 2020 11:55:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005231155.04NBtDfV023489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 23 May 2020 11: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: r361411 - in stable/12/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 361411 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, 23 May 2020 11:55:14 -0000 Author: kib Date: Sat May 23 11:55:13 2020 New Revision: 361411 URL: https://svnweb.freebsd.org/changeset/base/361411 Log: MFC r361276: mlx5_core: add "PMD type not enabled" port module event type. Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/mlx5/device.h stable/12/sys/dev/mlx5/mlx5_core/mlx5_eq.c stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/device.h ============================================================================== --- stable/12/sys/dev/mlx5/device.h Sat May 23 10:32:18 2020 (r361410) +++ stable/12/sys/dev/mlx5/device.h Sat May 23 11:55:13 2020 (r361411) @@ -551,6 +551,7 @@ enum { MLX5_MODULE_EVENT_ERROR_UNSUPPORTED_CABLE = 0x5, MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, + MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED = 0x8, MLX5_MODULE_EVENT_ERROR_NUM , }; Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_eq.c Sat May 23 10:32:18 2020 (r361410) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_eq.c Sat May 23 11:55:13 2020 (r361411) @@ -659,6 +659,8 @@ static const char *mlx5_port_module_event_error_type_t return "High Temperature"; case MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED: return "Bad or shorted cable/module"; + case MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED: + return "PMD type is not enabled"; default: return "Unknown error type"; } Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Sat May 23 10:32:18 2020 (r361410) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Sat May 23 11:55:13 2020 (r361411) @@ -1302,7 +1302,8 @@ m(+1, u64, no_eeprom, "no_eeprom", "No EEPROM/retry ti m(+1, u64, enforce_part_number, "enforce_part_number", "Module Enforce part number list") \ m(+1, u64, unknown_id, "unknown_id", "Module Unknown identifier") \ m(+1, u64, high_temp, "high_temp", "Module High Temperature") \ -m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") +m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") \ +m(+1, u64, pmd_type_not_enabled, "pmd_type_not_enabled", "PMD type is not enabled") static const char *mlx5_pme_err_desc[] = { MLX5_PORT_MODULE_ERROR_STATS(MLX5_STATS_DESC) From owner-svn-src-all@freebsd.org Sat May 23 11:56: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 4999F2C8C49; Sat, 23 May 2020 11:56:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49ThfM1D7zz3bk7; Sat, 23 May 2020 11:56:43 +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 2544DF3CB; Sat, 23 May 2020 11:56:43 +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 04NBuhJ6023610; Sat, 23 May 2020 11:56:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NBugB9023608; Sat, 23 May 2020 11:56:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005231156.04NBugB9023608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 23 May 2020 11:56:42 +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: r361412 - in stable/12/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 361412 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, 23 May 2020 11:56:43 -0000 Author: kib Date: Sat May 23 11:56:42 2020 New Revision: 361412 URL: https://svnweb.freebsd.org/changeset/base/361412 Log: MFC r361277: mlx5_core: add more port module event types to decode. Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/mlx5/device.h stable/12/sys/dev/mlx5/mlx5_core/mlx5_eq.c stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/device.h ============================================================================== --- stable/12/sys/dev/mlx5/device.h Sat May 23 11:55:13 2020 (r361411) +++ stable/12/sys/dev/mlx5/device.h Sat May 23 11:56:42 2020 (r361412) @@ -552,6 +552,12 @@ enum { MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED = 0x8, + MLX5_MODULE_EVENT_ERROR_LASTER_TEC_FAILURE = 0x9, + MLX5_MODULE_EVENT_ERROR_HIGH_CURRENT = 0xa, + MLX5_MODULE_EVENT_ERROR_HIGH_VOLTAGE = 0xb, + MLX5_MODULE_EVENT_ERROR_PCIE_SYS_POWER_SLOT_EXCEEDED = 0xc, + MLX5_MODULE_EVENT_ERROR_HIGH_POWER = 0xd, + MLX5_MODULE_EVENT_ERROR_MODULE_STATE_MACHINE_FAULT = 0xe, MLX5_MODULE_EVENT_ERROR_NUM , }; Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_eq.c Sat May 23 11:55:13 2020 (r361411) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_eq.c Sat May 23 11:56:42 2020 (r361412) @@ -661,6 +661,18 @@ static const char *mlx5_port_module_event_error_type_t return "Bad or shorted cable/module"; case MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED: return "PMD type is not enabled"; + case MLX5_MODULE_EVENT_ERROR_LASTER_TEC_FAILURE: + return "Laster_TEC_failure"; + case MLX5_MODULE_EVENT_ERROR_HIGH_CURRENT: + return "High_current"; + case MLX5_MODULE_EVENT_ERROR_HIGH_VOLTAGE: + return "High_voltage"; + case MLX5_MODULE_EVENT_ERROR_PCIE_SYS_POWER_SLOT_EXCEEDED: + return "pcie_system_power_slot_Exceeded"; + case MLX5_MODULE_EVENT_ERROR_HIGH_POWER: + return "High_power"; + case MLX5_MODULE_EVENT_ERROR_MODULE_STATE_MACHINE_FAULT: + return "Module_state_machine_fault"; default: return "Unknown error type"; } Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Sat May 23 11:55:13 2020 (r361411) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Sat May 23 11:56:42 2020 (r361412) @@ -1303,7 +1303,13 @@ m(+1, u64, enforce_part_number, "enforce_part_number", m(+1, u64, unknown_id, "unknown_id", "Module Unknown identifier") \ m(+1, u64, high_temp, "high_temp", "Module High Temperature") \ m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") \ -m(+1, u64, pmd_type_not_enabled, "pmd_type_not_enabled", "PMD type is not enabled") +m(+1, u64, pmd_type_not_enabled, "pmd_type_not_enabled", "PMD type is not enabled") \ +m(+1, u64, laster_tec_failure, "laster_tec_failure", "Laster TEC failure") \ +m(+1, u64, high_current, "high_current", "High current") \ +m(+1, u64, high_voltage, "high_voltage", "High voltage") \ +m(+1, u64, pcie_sys_power_slot_exceeded, "pcie_sys_power_slot_exceeded", "PCIe system power slot Exceeded") \ +m(+1, u64, high_power, "high_power", "High power") \ +m(+1, u64, module_state_machine_fault, "module_state_machine_fault", "Module State Machine fault") static const char *mlx5_pme_err_desc[] = { MLX5_PORT_MODULE_ERROR_STATS(MLX5_STATS_DESC) From owner-svn-src-all@freebsd.org Sat May 23 11:59: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 8C17B2C8E7F; Sat, 23 May 2020 11:59:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Thjj37lxz3c2S; Sat, 23 May 2020 11:59: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 4D447F804; Sat, 23 May 2020 11:59: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 04NBxb1W023811; Sat, 23 May 2020 11:59:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NBxa7X023808; Sat, 23 May 2020 11:59:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005231159.04NBxa7X023808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 23 May 2020 11:59:36 +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: r361413 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 361413 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, 23 May 2020 11:59:37 -0000 Author: kib Date: Sat May 23 11:59:36 2020 New Revision: 361413 URL: https://svnweb.freebsd.org/changeset/base/361413 Log: MFC r361276: mlx5_core: add "PMD type not enabled" port module event type. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/device.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/device.h ============================================================================== --- stable/11/sys/dev/mlx5/device.h Sat May 23 11:56:42 2020 (r361412) +++ stable/11/sys/dev/mlx5/device.h Sat May 23 11:59:36 2020 (r361413) @@ -551,6 +551,7 @@ enum { MLX5_MODULE_EVENT_ERROR_UNSUPPORTED_CABLE = 0x5, MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, + MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED = 0x8, MLX5_MODULE_EVENT_ERROR_NUM , }; Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Sat May 23 11:56:42 2020 (r361412) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Sat May 23 11:59:36 2020 (r361413) @@ -659,6 +659,8 @@ static const char *mlx5_port_module_event_error_type_t return "High Temperature"; case MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED: return "Bad or shorted cable/module"; + case MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED: + return "PMD type is not enabled"; default: return "Unknown error type"; } Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Sat May 23 11:56:42 2020 (r361412) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Sat May 23 11:59:36 2020 (r361413) @@ -1284,7 +1284,8 @@ m(+1, u64, no_eeprom, "no_eeprom", "No EEPROM/retry ti m(+1, u64, enforce_part_number, "enforce_part_number", "Module Enforce part number list") \ m(+1, u64, unknown_id, "unknown_id", "Module Unknown identifier") \ m(+1, u64, high_temp, "high_temp", "Module High Temperature") \ -m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") +m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") \ +m(+1, u64, pmd_type_not_enabled, "pmd_type_not_enabled", "PMD type is not enabled") static const char *mlx5_pme_err_desc[] = { MLX5_PORT_MODULE_ERROR_STATS(MLX5_STATS_DESC) From owner-svn-src-all@freebsd.org Sat May 23 12:00: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 856432C97DF; Sat, 23 May 2020 12:00: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 49Thl331YRz3cSx; Sat, 23 May 2020 12:00: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 62E5AF155; Sat, 23 May 2020 12:00: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 04NC0lXh024731; Sat, 23 May 2020 12:00:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NC0kWX024728; Sat, 23 May 2020 12:00:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005231200.04NC0kWX024728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 23 May 2020 12:00:46 +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: r361414 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 361414 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, 23 May 2020 12:00:47 -0000 Author: kib Date: Sat May 23 12:00:46 2020 New Revision: 361414 URL: https://svnweb.freebsd.org/changeset/base/361414 Log: MFC r361277: mlx5_core: add more port module event types to decode. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/device.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/device.h ============================================================================== --- stable/11/sys/dev/mlx5/device.h Sat May 23 11:59:36 2020 (r361413) +++ stable/11/sys/dev/mlx5/device.h Sat May 23 12:00:46 2020 (r361414) @@ -552,6 +552,12 @@ enum { MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED = 0x8, + MLX5_MODULE_EVENT_ERROR_LASTER_TEC_FAILURE = 0x9, + MLX5_MODULE_EVENT_ERROR_HIGH_CURRENT = 0xa, + MLX5_MODULE_EVENT_ERROR_HIGH_VOLTAGE = 0xb, + MLX5_MODULE_EVENT_ERROR_PCIE_SYS_POWER_SLOT_EXCEEDED = 0xc, + MLX5_MODULE_EVENT_ERROR_HIGH_POWER = 0xd, + MLX5_MODULE_EVENT_ERROR_MODULE_STATE_MACHINE_FAULT = 0xe, MLX5_MODULE_EVENT_ERROR_NUM , }; Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Sat May 23 11:59:36 2020 (r361413) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Sat May 23 12:00:46 2020 (r361414) @@ -661,6 +661,18 @@ static const char *mlx5_port_module_event_error_type_t return "Bad or shorted cable/module"; case MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED: return "PMD type is not enabled"; + case MLX5_MODULE_EVENT_ERROR_LASTER_TEC_FAILURE: + return "Laster_TEC_failure"; + case MLX5_MODULE_EVENT_ERROR_HIGH_CURRENT: + return "High_current"; + case MLX5_MODULE_EVENT_ERROR_HIGH_VOLTAGE: + return "High_voltage"; + case MLX5_MODULE_EVENT_ERROR_PCIE_SYS_POWER_SLOT_EXCEEDED: + return "pcie_system_power_slot_Exceeded"; + case MLX5_MODULE_EVENT_ERROR_HIGH_POWER: + return "High_power"; + case MLX5_MODULE_EVENT_ERROR_MODULE_STATE_MACHINE_FAULT: + return "Module_state_machine_fault"; default: return "Unknown error type"; } Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Sat May 23 11:59:36 2020 (r361413) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Sat May 23 12:00:46 2020 (r361414) @@ -1285,7 +1285,13 @@ m(+1, u64, enforce_part_number, "enforce_part_number", m(+1, u64, unknown_id, "unknown_id", "Module Unknown identifier") \ m(+1, u64, high_temp, "high_temp", "Module High Temperature") \ m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") \ -m(+1, u64, pmd_type_not_enabled, "pmd_type_not_enabled", "PMD type is not enabled") +m(+1, u64, pmd_type_not_enabled, "pmd_type_not_enabled", "PMD type is not enabled") \ +m(+1, u64, laster_tec_failure, "laster_tec_failure", "Laster TEC failure") \ +m(+1, u64, high_current, "high_current", "High current") \ +m(+1, u64, high_voltage, "high_voltage", "High voltage") \ +m(+1, u64, pcie_sys_power_slot_exceeded, "pcie_sys_power_slot_exceeded", "PCIe system power slot Exceeded") \ +m(+1, u64, high_power, "high_power", "High power") \ +m(+1, u64, module_state_machine_fault, "module_state_machine_fault", "Module State Machine fault") static const char *mlx5_pme_err_desc[] = { MLX5_PORT_MODULE_ERROR_STATS(MLX5_STATS_DESC) From owner-svn-src-all@freebsd.org Sat May 23 12:15: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 389FB2CA32E; Sat, 23 May 2020 12:15:48 +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 49Tj4N0nMXz3dwt; Sat, 23 May 2020 12:15:48 +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 11D2AFB8B; Sat, 23 May 2020 12:15:48 +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 04NCFltP035788; Sat, 23 May 2020 12:15:47 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NCFlRN035787; Sat, 23 May 2020 12:15:47 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005231215.04NCFlRN035787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 23 May 2020 12:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361415 - in head/sys/net: . route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys/net: . route X-SVN-Commit-Revision: 361415 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, 23 May 2020 12:15:48 -0000 Author: melifaro Date: Sat May 23 12:15:47 2020 New Revision: 361415 URL: https://svnweb.freebsd.org/changeset/base/361415 Log: Remove refcounting from rtentry. After making rtentry reclamation backed by epoch(9) in r361409, there is no reason in keeping reference counting code. Differential Revision: https://reviews.freebsd.org/D24867 Modified: head/sys/net/route.c head/sys/net/route/route_var.h Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat May 23 12:00:46 2020 (r361414) +++ head/sys/net/route.c Sat May 23 12:15:47 2020 (r361415) @@ -439,39 +439,8 @@ rtfree(struct rtentry *rt) RT_LOCK_ASSERT(rt); - /* - * The callers should use RTFREE_LOCKED() or RTFREE(), so - * we should come here exactly with the last reference. - */ - RT_REMREF(rt); - if (rt->rt_refcnt > 0) { - log(LOG_DEBUG, "%s: %p has %d refs\n", __func__, rt, rt->rt_refcnt); - goto done; - } - - /* - * If we are no longer "up" (and ref == 0) - * then we can free the resources associated - * with the route. - */ - if ((rt->rt_flags & RTF_UP) == 0) { - if (rt->rt_nodes->rn_flags & (RNF_ACTIVE | RNF_ROOT)) - panic("rtfree 2"); -#ifdef DIAGNOSTIC - if (rt->rt_refcnt < 0) { - printf("rtfree: %p not freed (neg refs)\n", rt); - goto done; - } -#endif - epoch_call(net_epoch_preempt, destroy_rtentry_epoch, - &rt->rt_epoch_ctx); - - /* - * FALLTHROUGH to RT_UNLOCK() so the reporting functions - * have consistent behaviour of operating on unlocked entry. - */ - } -done: + epoch_call(net_epoch_preempt, destroy_rtentry_epoch, + &rt->rt_epoch_ctx); RT_UNLOCK(rt); } @@ -958,7 +927,7 @@ rib_walk_del(u_int fibnum, int family, rt_filter_f_t * if (report) rt_routemsg(RTM_DELETE, rt, rt->rt_nhop->nh_ifp, 0, fibnum); - RTFREE_LOCKED(rt); + rtfree(rt); } } @@ -1114,7 +1083,6 @@ rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo rt = RNTORT(rn); RT_LOCK(rt); - RT_ADDREF(rt); rt->rt_flags &= ~RTF_UP; *perror = 0; @@ -1569,8 +1537,10 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in } RIB_WUNLOCK(rnh); - if (rt_old != NULL) - RT_UNLOCK(rt_old); + if (rt_old != NULL) { + rt_notifydelete(rt_old, info); + rtfree(rt_old); + } /* * If it still failed to go into the tree, @@ -1582,11 +1552,6 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in return (EEXIST); } - if (rt_old != NULL) { - rt_notifydelete(rt_old, info); - RTFREE(rt_old); - } - /* * If this protocol has something to add to this then * allow it to do that as well. @@ -1639,7 +1604,7 @@ del_route(struct rib_head *rnh, struct rt_addrinfo *in if (ret_nrt) *ret_nrt = rt; - RTFREE_LOCKED(rt); + rtfree(rt); return (0); } Modified: head/sys/net/route/route_var.h ============================================================================== --- head/sys/net/route/route_var.h Sat May 23 12:00:46 2020 (r361414) +++ head/sys/net/route/route_var.h Sat May 23 12:15:47 2020 (r361415) @@ -143,7 +143,6 @@ struct rtentry { }; int rt_flags; /* up/down?, host/net */ - int rt_refcnt; /* # held references */ u_long rt_weight; /* absolute weight */ u_long rt_expire; /* lifetime for route, e.g. redirect */ #define rt_endzero rt_mtx @@ -161,36 +160,6 @@ struct rtentry { #define RT_UNLOCK_COND(_rt) do { \ if (mtx_owned(&(_rt)->rt_mtx)) \ mtx_unlock(&(_rt)->rt_mtx); \ -} while (0) - -#define RT_ADDREF(_rt) do { \ - RT_LOCK_ASSERT(_rt); \ - KASSERT((_rt)->rt_refcnt >= 0, \ - ("negative refcnt %d", (_rt)->rt_refcnt)); \ - (_rt)->rt_refcnt++; \ -} while (0) - -#define RT_REMREF(_rt) do { \ - RT_LOCK_ASSERT(_rt); \ - KASSERT((_rt)->rt_refcnt > 0, \ - ("bogus refcnt %d", (_rt)->rt_refcnt)); \ - (_rt)->rt_refcnt--; \ -} while (0) - -#define RTFREE_LOCKED(_rt) do { \ - if ((_rt)->rt_refcnt <= 1) \ - rtfree(_rt); \ - else { \ - RT_REMREF(_rt); \ - RT_UNLOCK(_rt); \ - } \ - /* guard against invalid refs */ \ - _rt = 0; \ -} while (0) - -#define RTFREE(_rt) do { \ - RT_LOCK(_rt); \ - RTFREE_LOCKED(_rt); \ } while (0) /* From owner-svn-src-all@freebsd.org Sat May 23 15:46: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 22EF02CE5AB; Sat, 23 May 2020 15:46:10 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49Tnl473Y3z4C9G; Sat, 23 May 2020 15:46:08 +0000 (UTC) (envelope-from zeising+freebsd@daemonic.se) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 49Tnkv708nz3l8C; Sat, 23 May 2020 15:45:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=daemonic.se; h= content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:subject:subject:received :received; s=20151023; t=1590248608; bh=6+VK9Zyco4PUjsqvKCNg+fjf 2p9xBZnjTOpqlbOGnuw=; b=BJ3pFuuzNYrlc9b4lXGtLTFuM5Wq3wCvj+xRA5ou JOg2OXfcXewMxu6GO06VageS+jzKiWmgLFJ/hvIh34qjKROgsm95tM6Q7xdjYTNd c/V33JvuhjvDletg/8pAnLq7F7n2awrhjgmoVoES1Vy+10n4D3chh1Heglw/bQl4 j8s= 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 sSano388UHYT; Sat, 23 May 2020 15:43:28 +0000 (UTC) Received: from garnet.daemonic.se (unknown [IPv6:2001:470:dca9:201:f46a:54c6:232d:7370]) by mail.daemonic.se (Postfix) with ESMTPSA id 49Tnh01bG0z3mPM; Sat, 23 May 2020 15:43:28 +0000 (UTC) Subject: Re: svn commit: r361363 - in head/lib/libprocstat: . zfs To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005221120.04MBKOiH003190@repo.freebsd.org> From: Niclas Zeising Message-ID: <7c484cd1-8bf3-6fc5-cdff-e8955352c3fd@daemonic.se> Date: Sat, 23 May 2020 17:43:27 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202005221120.04MBKOiH003190@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49Tnl473Y3z4C9G X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=daemonic.se header.s=20151023 header.b=BJ3pFuuz; dmarc=pass (policy=none) header.from=daemonic.se; spf=pass (mx1.freebsd.org: domain of zeising@daemonic.se designates 2607:f740:d:20::25 as permitted sender) smtp.mailfrom=zeising@daemonic.se X-Spamd-Result: default: False [-4.09 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[daemonic.se:s=20151023]; NEURAL_HAM_MEDIUM(-1.02)[-1.021]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-0.98)[-0.983]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[daemonic.se:+]; DMARC_POLICY_ALLOW(-0.50)[daemonic.se,none]; NEURAL_HAM_SHORT(-1.08)[-1.083]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:36236, ipnet:2607:f740:d::/48, country:US]; TAGGED_FROM(0.00)[freebsd]; MID_RHS_MATCH_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: Sat, 23 May 2020 15:46:10 -0000 On 2020-05-22 13:20, Andriy Gapon wrote: > Author: avg > Date: Fri May 22 11:20:23 2020 > New Revision: 361363 > URL: https://svnweb.freebsd.org/changeset/base/361363 > > Log: > libprocstat: fix ZFS support > This might have broken a couple of ports. The build is still going, but at least three ports have failed to link, all with the same error: /usr/local/bin/ld: /usr/lib/libprocstat.so.1: undefined reference to `__start_set_pcpu' /usr/local/bin/ld: /usr/lib/libprocstat.so.1: undefined reference to `__stop_set_pcpu' c++: error: linker command failed with exit code 1 (use -v to see invocation) See for instance http://beefy18.nyi.freebsd.org/data/head-amd64-default/p536258_s361404/logs/errors/gnuradio-3.8.1.0_1.log and http://beefy18.nyi.freebsd.org/data/head-amd64-default/p536258_s361404/logs/octave-5.2.0_2.log Or, if you're on IPv4 only: http://www.ipv6proxy.net/go.php?u=http%3A%2F%2Fbeefy18.nyi.freebsd.org%2Fdata%2Fhead-amd64-default%2Fp536258_s361404%2Flogs%2Foctave-5.2.0_2.log&b=0&f=norefer Regards -- Niclas From owner-svn-src-all@freebsd.org Sat May 23 17:51: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 14D962D9726; Sat, 23 May 2020 17:51:07 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TrWG6t85z4NnR; Sat, 23 May 2020 17:51:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E74FE13BCB; Sat, 23 May 2020 17:51:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NHp6ST043059; Sat, 23 May 2020 17:51:06 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NHp6xY043056; Sat, 23 May 2020 17:51:06 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005231751.04NHp6xY043056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 23 May 2020 17:51:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361418 - in head/sys: conf libkern sys X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: conf libkern sys X-SVN-Commit-Revision: 361418 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, 23 May 2020 17:51:07 -0000 Author: manu Date: Sat May 23 17:51:06 2020 New Revision: 361418 URL: https://svnweb.freebsd.org/changeset/base/361418 Log: libkern: Add arc4random_uniform This variant get a random number up to the limit passed as the argument. This is simply a copy of the libc version. Sponsored-by: The FreeBSD Foundation Reviewed by: cem, hselasky (previous version) Differential Revision: https://reviews.freebsd.org/D24962 Added: head/sys/libkern/arc4random_uniform.c (contents, props changed) Modified: head/sys/conf/files head/sys/sys/libkern.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat May 23 16:42:27 2020 (r361417) +++ head/sys/conf/files Sat May 23 17:51:06 2020 (r361418) @@ -3952,6 +3952,7 @@ kgssapi/gsstest.c optional kgssapi_debug # the file should be moved to conf/files. from here. # libkern/arc4random.c standard +libkern/arc4random_uniform.c standard libkern/asprintf.c standard libkern/bcd.c standard libkern/bsearch.c standard Added: head/sys/libkern/arc4random_uniform.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/libkern/arc4random_uniform.c Sat May 23 17:51:06 2020 (r361418) @@ -0,0 +1,58 @@ +/* $OpenBSD: arc4random_uniform.c,v 1.3 2019/01/20 02:59:07 bcook Exp $ */ + +/* + * Copyright (c) 2008, Damien Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ + +#include +#include + +/* + * Calculate a uniformly distributed random number less than upper_bound + * avoiding "modulo bias". + * + * Uniformity is achieved by generating new random numbers until the one + * returned is outside the range [0, 2**32 % upper_bound). This + * guarantees the selected random number will be inside + * [2**32 % upper_bound, 2**32) which maps back to [0, upper_bound) + * after reduction modulo upper_bound. + */ +uint32_t +arc4random_uniform(uint32_t upper_bound) +{ + uint32_t r, min; + + if (upper_bound < 2) + return 0; + + /* 2**32 % x == (2**32 - x) % x */ + min = -upper_bound % upper_bound; + + /* + * This could theoretically loop forever but each retry has + * p > 0.5 (worst case, usually far better) of selecting a + * number inside the range we need, so it should rarely need + * to re-roll. + */ + for (;;) { + r = arc4random(); + if (r >= min) + break; + } + + return r % upper_bound; +} Modified: head/sys/sys/libkern.h ============================================================================== --- head/sys/sys/libkern.h Sat May 23 16:42:27 2020 (r361417) +++ head/sys/sys/libkern.h Sat May 23 17:51:06 2020 (r361418) @@ -127,6 +127,7 @@ extern int arc4rand_iniseed_state; struct malloc_type; uint32_t arc4random(void); void arc4random_buf(void *, size_t); +uint32_t arc4random_uniform(uint32_t); void arc4rand(void *, u_int, int); int timingsafe_bcmp(const void *, const void *, size_t); void *bsearch(const void *, const void *, size_t, From owner-svn-src-all@freebsd.org Sat May 23 17:52: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 644692D99F6; Sat, 23 May 2020 17:52:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TrXp25Kzz4Nps; Sat, 23 May 2020 17:52:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4309313A6D; Sat, 23 May 2020 17:52:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NHqQRI047118; Sat, 23 May 2020 17:52:26 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NHqQRC047117; Sat, 23 May 2020 17:52:26 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005231752.04NHqQRC047117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 23 May 2020 17:52:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361419 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361419 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, 23 May 2020 17:52:26 -0000 Author: manu Date: Sat May 23 17:52:25 2020 New Revision: 361419 URL: https://svnweb.freebsd.org/changeset/base/361419 Log: linuxkpi: Add prandom_u32_max This is just a wrapper around arc4random_uniform Needed by DRM v5.3 Sponsored-by: The FreeBSD Foundation Reviewed by: cem, hselasky Differential Revision: https://reviews.freebsd.org/D24961 Modified: head/sys/compat/linuxkpi/common/include/linux/random.h Modified: head/sys/compat/linuxkpi/common/include/linux/random.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/random.h Sat May 23 17:51:06 2020 (r361418) +++ head/sys/compat/linuxkpi/common/include/linux/random.h Sat May 23 17:52:25 2020 (r361419) @@ -62,4 +62,10 @@ get_random_long(void) return (val); } +static inline u32 +prandom_u32_max(u32 max) +{ + return (arc4random_uniform(max)); +} + #endif /* _LINUX_RANDOM_H_ */ From owner-svn-src-all@freebsd.org Sat May 23 18:03: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 997B22D99FE; Sat, 23 May 2020 18:03: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 49TrnN3dpFz4Pk0; Sat, 23 May 2020 18:03: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 7846513B52; Sat, 23 May 2020 18:03: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 04NI3KPr053350; Sat, 23 May 2020 18:03:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NI3JPv053348; Sat, 23 May 2020 18:03:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005231803.04NI3JPv053348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 23 May 2020 18:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r361420 - in releng/11.4/sys/dev/mlx5: . mlx5_core X-SVN-Group: releng X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in releng/11.4/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 361420 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, 23 May 2020 18:03:20 -0000 Author: kib Date: Sat May 23 18:03:19 2020 New Revision: 361420 URL: https://svnweb.freebsd.org/changeset/base/361420 Log: MFC r361276, r361276: mlx5_core: add new port module event types to decode. Sponsored by: Mellanox Technologies Approved by: re (delphij) Modified: releng/11.4/sys/dev/mlx5/device.h releng/11.4/sys/dev/mlx5/mlx5_core/mlx5_eq.c releng/11.4/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: releng/11.4/ (props changed) Modified: releng/11.4/sys/dev/mlx5/device.h ============================================================================== --- releng/11.4/sys/dev/mlx5/device.h Sat May 23 17:52:25 2020 (r361419) +++ releng/11.4/sys/dev/mlx5/device.h Sat May 23 18:03:19 2020 (r361420) @@ -551,6 +551,13 @@ enum { MLX5_MODULE_EVENT_ERROR_UNSUPPORTED_CABLE = 0x5, MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, + MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED = 0x8, + MLX5_MODULE_EVENT_ERROR_LASTER_TEC_FAILURE = 0x9, + MLX5_MODULE_EVENT_ERROR_HIGH_CURRENT = 0xa, + MLX5_MODULE_EVENT_ERROR_HIGH_VOLTAGE = 0xb, + MLX5_MODULE_EVENT_ERROR_PCIE_SYS_POWER_SLOT_EXCEEDED = 0xc, + MLX5_MODULE_EVENT_ERROR_HIGH_POWER = 0xd, + MLX5_MODULE_EVENT_ERROR_MODULE_STATE_MACHINE_FAULT = 0xe, MLX5_MODULE_EVENT_ERROR_NUM , }; Modified: releng/11.4/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- releng/11.4/sys/dev/mlx5/mlx5_core/mlx5_eq.c Sat May 23 17:52:25 2020 (r361419) +++ releng/11.4/sys/dev/mlx5/mlx5_core/mlx5_eq.c Sat May 23 18:03:19 2020 (r361420) @@ -659,6 +659,20 @@ static const char *mlx5_port_module_event_error_type_t return "High Temperature"; case MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED: return "Bad or shorted cable/module"; + case MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED: + return "PMD type is not enabled"; + case MLX5_MODULE_EVENT_ERROR_LASTER_TEC_FAILURE: + return "Laster_TEC_failure"; + case MLX5_MODULE_EVENT_ERROR_HIGH_CURRENT: + return "High_current"; + case MLX5_MODULE_EVENT_ERROR_HIGH_VOLTAGE: + return "High_voltage"; + case MLX5_MODULE_EVENT_ERROR_PCIE_SYS_POWER_SLOT_EXCEEDED: + return "pcie_system_power_slot_Exceeded"; + case MLX5_MODULE_EVENT_ERROR_HIGH_POWER: + return "High_power"; + case MLX5_MODULE_EVENT_ERROR_MODULE_STATE_MACHINE_FAULT: + return "Module_state_machine_fault"; default: return "Unknown error type"; } Modified: releng/11.4/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- releng/11.4/sys/dev/mlx5/mlx5_core/mlx5_main.c Sat May 23 17:52:25 2020 (r361419) +++ releng/11.4/sys/dev/mlx5/mlx5_core/mlx5_main.c Sat May 23 18:03:19 2020 (r361420) @@ -1284,7 +1284,14 @@ m(+1, u64, no_eeprom, "no_eeprom", "No EEPROM/retry ti m(+1, u64, enforce_part_number, "enforce_part_number", "Module Enforce part number list") \ m(+1, u64, unknown_id, "unknown_id", "Module Unknown identifier") \ m(+1, u64, high_temp, "high_temp", "Module High Temperature") \ -m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") +m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") \ +m(+1, u64, pmd_type_not_enabled, "pmd_type_not_enabled", "PMD type is not enabled") \ +m(+1, u64, laster_tec_failure, "laster_tec_failure", "Laster TEC failure") \ +m(+1, u64, high_current, "high_current", "High current") \ +m(+1, u64, high_voltage, "high_voltage", "High voltage") \ +m(+1, u64, pcie_sys_power_slot_exceeded, "pcie_sys_power_slot_exceeded", "PCIe system power slot Exceeded") \ +m(+1, u64, high_power, "high_power", "High power") \ +m(+1, u64, module_state_machine_fault, "module_state_machine_fault", "Module State Machine fault") static const char *mlx5_pme_err_desc[] = { MLX5_PORT_MODULE_ERROR_STATS(MLX5_STATS_DESC) From owner-svn-src-all@freebsd.org Sat May 23 18:11: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 8FF002D9D68; Sat, 23 May 2020 18:11:20 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 49Tryb2z9bz4QCD; Sat, 23 May 2020 18:11:19 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-wm1-f53.google.com with SMTP id h4so11705125wmb.4; Sat, 23 May 2020 11:11:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=sr97xTSHEUyz8InzmvE7vzCw8d71pmcfBYCZef3bzGw=; b=f2DpSQT8CExAAbUpaQPwYM1rl/MqGh/difwvdrRSSc8rov5lrNknnCxuMdwwuDnTnk mxz+IuzM84iz6Eggq/Ot3q9i5oIs2vroFctaKHfc/wvnaWDzFWi+5/55Jz9xlaW2lJgc VjZ0Wq/q0o/OaP5GgKDjJ33Ag4o/17IG5/I0wUJQyy7pudlHrUkP/csW+7BS2yZaEwLD RlSPRg1ytmX0HD5KNw3ZgVXVd6eeEKFvGb1weOdRW6lE/OeooqGfTagwOqJjbSREFWEa xrniaS4iiS5EAwnVIg98ncutfaXchJiQ731YCAOQyT+QEow5rjb7zmlwkrTWvFZpzdS3 yVgQ== X-Gm-Message-State: AOAM532koddkbcBLmqsO6JKiGGxppLyhZCfVDKdSo7HTCuXRVktij+Ph iEoh9sP+DSCk7mgg9xhoVaWxO02t X-Google-Smtp-Source: ABdhPJzceCUL6m/X65rzk9Yh/WzEqOv86IHzFSr6KMMebe8HqyCuJzNYtakAC/iDq0w9Bec1lCqugA== X-Received: by 2002:a05:600c:22d3:: with SMTP id 19mr19542248wmg.161.1590257477572; Sat, 23 May 2020 11:11:17 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id h137sm19081949wme.0.2020.05.23.11.11.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 23 May 2020 11:11:16 -0700 (PDT) Subject: Re: svn commit: r361363 - in head/lib/libprocstat: . zfs To: Niclas Zeising , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <202005221120.04MBKOiH003190@repo.freebsd.org> <7c484cd1-8bf3-6fc5-cdff-e8955352c3fd@daemonic.se> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <4a47c9af-e076-3400-0dc1-e547bee02671@FreeBSD.org> Date: Sat, 23 May 2020 21:11:15 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <7c484cd1-8bf3-6fc5-cdff-e8955352c3fd@daemonic.se> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 49Tryb2z9bz4QCD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.128.53 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-2.23 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_RCPT(0.00)[freebsd]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.95)[-0.954]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.30)[-0.297]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.53:from]; NEURAL_HAM_MEDIUM(-0.98)[-0.981]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.53:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[93.72.151.96:received] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 23 May 2020 18:11:20 -0000 On 23/05/2020 18:43, Niclas Zeising wrote: > On 2020-05-22 13:20, Andriy Gapon wrote: >> Author: avg >> Date: Fri May 22 11:20:23 2020 >> New Revision: 361363 >> URL: https://svnweb.freebsd.org/changeset/base/361363 >> >> Log: >>    libprocstat: fix ZFS support >>    > > > This might have broken a couple of ports. > The build is still going, but at least three ports have failed to link, all with > the same error: > > /usr/local/bin/ld: /usr/lib/libprocstat.so.1: undefined reference to > `__start_set_pcpu' > /usr/local/bin/ld: /usr/lib/libprocstat.so.1: undefined reference to > `__stop_set_pcpu' > c++: error: linker command failed with exit code 1 (use -v to see invocation) > > See for instance > http://beefy18.nyi.freebsd.org/data/head-amd64-default/p536258_s361404/logs/errors/gnuradio-3.8.1.0_1.log > > and > http://beefy18.nyi.freebsd.org/data/head-amd64-default/p536258_s361404/logs/octave-5.2.0_2.log > > > Or, if you're on IPv4 only: > http://www.ipv6proxy.net/go.php?u=http%3A%2F%2Fbeefy18.nyi.freebsd.org%2Fdata%2Fhead-amd64-default%2Fp536258_s361404%2Flogs%2Foctave-5.2.0_2.log&b=0&f=norefer I cannot understand why this happens. There are several tools in base that link with libprocstat and I have not seen buildworld failure reports including from our CI cluster. -- Andriy Gapon From owner-svn-src-all@freebsd.org Sat May 23 19: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 173492DB0BB; Sat, 23 May 2020 19:06:58 +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 49TtBp07Wqz4V2k; Sat, 23 May 2020 19:06:58 +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 F3A12146FC; Sat, 23 May 2020 19:06:57 +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 04NJ6v4x090853; Sat, 23 May 2020 19:06:57 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NJ6vBR090849; Sat, 23 May 2020 19:06:57 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005231906.04NJ6vBR090849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 23 May 2020 19:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361421 - in head/sys: net net/route netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys: net net/route netinet netinet6 X-SVN-Commit-Revision: 361421 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, 23 May 2020 19:06:58 -0000 Author: melifaro Date: Sat May 23 19:06:57 2020 New Revision: 361421 URL: https://svnweb.freebsd.org/changeset/base/361421 Log: Move _route() functions to route_ctl.c in preparation of multipath control plane changed described in D24141. Currently route.c contains core routing init/teardown functions, route table manipulation functions and various helper functions, resulting in >2KLOC file in total. This change moves most of the route table manipulation parts to a dedicated file, simplifying planned multipath changes and making route.c more manageable. Differential Revision: https://reviews.freebsd.org/D24870 Modified: head/sys/net/if_var.h head/sys/net/route.c head/sys/net/route/route_ctl.c head/sys/net/route/route_var.h head/sys/net/route/shared.h head/sys/netinet/in_fib.c head/sys/netinet6/in6_fib.c Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Sat May 23 18:03:19 2020 (r361420) +++ head/sys/net/if_var.h Sat May 23 19:06:57 2020 (r361421) @@ -686,8 +686,8 @@ int ifa_ifwithaddr_check(const struct sockaddr *); struct ifaddr *ifa_ifwithbroadaddr(const struct sockaddr *, int); struct ifaddr *ifa_ifwithdstaddr(const struct sockaddr *, int); struct ifaddr *ifa_ifwithnet(const struct sockaddr *, int, int); -struct ifaddr *ifa_ifwithroute(int, const struct sockaddr *, struct sockaddr *, - u_int); +struct ifaddr *ifa_ifwithroute(int, const struct sockaddr *, + const struct sockaddr *, u_int); struct ifaddr *ifaof_ifpforaddr(const struct sockaddr *, struct ifnet *); int ifa_preferred(struct ifaddr *, struct ifaddr *); Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat May 23 18:03:19 2020 (r361420) +++ head/sys/net/route.c Sat May 23 19:06:57 2020 (r361421) @@ -121,45 +121,17 @@ VNET_DEFINE(struct rib_head *, rt_tables); #define V_rt_tables VNET(rt_tables) -/* - * Convert a 'struct radix_node *' to a 'struct rtentry *'. - * The operation can be done safely (in this code) because a - * 'struct rtentry' starts with two 'struct radix_node''s, the first - * one representing leaf nodes in the routing tree, which is - * what the code in radix.c passes us as a 'struct radix_node'. - * - * But because there are a lot of assumptions in this conversion, - * do not cast explicitly, but always use the macro below. - */ -#define RNTORT(p) ((struct rtentry *)(p)) - -VNET_DEFINE_STATIC(uma_zone_t, rtzone); /* Routing table UMA zone. */ +VNET_DEFINE(uma_zone_t, rtzone); /* Routing table UMA zone. */ #define V_rtzone VNET(rtzone) EVENTHANDLER_LIST_DEFINE(rt_addrmsg); -static int rt_getifa_fib(struct rt_addrinfo *, u_int); -static void rt_setmetrics(const struct rt_addrinfo *, struct rtentry *); static int rt_ifdelroute(const struct rtentry *rt, const struct nhop_object *, void *arg); -static struct rtentry *rt_unlinkrte(struct rib_head *rnh, - struct rt_addrinfo *info, int *perror); -static void rt_notifydelete(struct rtentry *rt, struct rt_addrinfo *info); static void destroy_rtentry_epoch(epoch_context_t ctx); -#ifdef RADIX_MPATH -static struct radix_node *rt_mpath_unlink(struct rib_head *rnh, - struct rt_addrinfo *info, struct rtentry *rto, int *perror); -#endif static int rt_exportinfo(struct rtentry *rt, struct rt_addrinfo *info, int flags); -static int add_route(struct rib_head *rnh, struct rt_addrinfo *info, - struct rtentry **ret_nrt); -static int del_route(struct rib_head *rnh, struct rt_addrinfo *info, - struct rtentry **ret_nrt); -static int change_route(struct rib_head *, struct rt_addrinfo *, - struct rtentry **); - /* * handler for net.my_fibnum */ @@ -572,8 +544,8 @@ rtioctl_fib(u_long req, caddr_t data, u_int fibnum) } struct ifaddr * -ifa_ifwithroute(int flags, const struct sockaddr *dst, struct sockaddr *gateway, - u_int fibnum) +ifa_ifwithroute(int flags, const struct sockaddr *dst, + const struct sockaddr *gateway, u_int fibnum) { struct ifaddr *ifa; @@ -839,99 +811,7 @@ rt_foreach_fib_walk(int af, rt_setwarg_t *setwa_f, rt_ } } -struct rt_delinfo -{ - struct rt_addrinfo info; - struct rib_head *rnh; - struct rtentry *head; -}; - /* - * Conditionally unlinks @rn from radix tree based - * on info data passed in @arg. - */ -static int -rt_checkdelroute(struct radix_node *rn, void *arg) -{ - struct rt_delinfo *di; - struct rt_addrinfo *info; - struct rtentry *rt; - int error; - - di = (struct rt_delinfo *)arg; - rt = (struct rtentry *)rn; - info = &di->info; - error = 0; - - info->rti_info[RTAX_DST] = rt_key(rt); - info->rti_info[RTAX_NETMASK] = rt_mask(rt); - info->rti_info[RTAX_GATEWAY] = &rt->rt_nhop->gw_sa; - - rt = rt_unlinkrte(di->rnh, info, &error); - if (rt == NULL) { - /* Either not allowed or not matched. Skip entry */ - return (0); - } - - /* Entry was unlinked. Add to the list and return */ - rt->rt_chain = di->head; - di->head = rt; - - return (0); -} - -/* - * Iterates over a routing table specified by @fibnum and @family and - * deletes elements marked by @filter_f. - * @fibnum: rtable id - * @family: AF_ address family - * @filter_f: function returning non-zero value for items to delete - * @arg: data to pass to the @filter_f function - * @report: true if rtsock notification is needed. - */ -void -rib_walk_del(u_int fibnum, int family, rt_filter_f_t *filter_f, void *arg, bool report) -{ - struct rib_head *rnh; - struct rt_delinfo di; - struct rtentry *rt; - - rnh = rt_tables_get_rnh(fibnum, family); - if (rnh == NULL) - return; - - bzero(&di, sizeof(di)); - di.info.rti_filter = filter_f; - di.info.rti_filterdata = arg; - di.rnh = rnh; - - RIB_WLOCK(rnh); - rnh->rnh_walktree(&rnh->head, rt_checkdelroute, &di); - RIB_WUNLOCK(rnh); - - if (di.head == NULL) - return; - - /* We might have something to reclaim. */ - while (di.head != NULL) { - rt = di.head; - di.head = rt->rt_chain; - rt->rt_chain = NULL; - - /* TODO std rt -> rt_addrinfo export */ - di.info.rti_info[RTAX_DST] = rt_key(rt); - di.info.rti_info[RTAX_NETMASK] = rt_mask(rt); - - rt_notifydelete(rt, &di.info); - - if (report) - rt_routemsg(RTM_DELETE, rt, rt->rt_nhop->nh_ifp, 0, - fibnum); - rtfree(rt); - } -} - -/* * Iterates over all existing fibs in system and deletes each element * for which @filter_f function returns non-zero value. * If @family is not AF_UNSPEC, iterates over fibs in particular @@ -1018,104 +898,6 @@ rt_flushifroutes(struct ifnet *ifp) } /* - * Conditionally unlinks rtentry matching data inside @info from @rnh. - * Returns unlinked, locked and referenced @rtentry on success, - * Returns NULL and sets @perror to: - * ESRCH - if prefix was not found, - * EADDRINUSE - if trying to delete PINNED route without appropriate flag. - * ENOENT - if supplied filter function returned 0 (not matched). - */ -static struct rtentry * -rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo *info, int *perror) -{ - struct sockaddr *dst, *netmask; - struct rtentry *rt; - struct radix_node *rn; - - dst = info->rti_info[RTAX_DST]; - netmask = info->rti_info[RTAX_NETMASK]; - - rt = (struct rtentry *)rnh->rnh_lookup(dst, netmask, &rnh->head); - if (rt == NULL) { - *perror = ESRCH; - return (NULL); - } - - if ((info->rti_flags & RTF_PINNED) == 0) { - /* Check if target route can be deleted */ - if (rt->rt_flags & RTF_PINNED) { - *perror = EADDRINUSE; - return (NULL); - } - } - - if (info->rti_filter != NULL) { - if (info->rti_filter(rt, rt->rt_nhop, info->rti_filterdata)==0){ - /* Not matched */ - *perror = ENOENT; - return (NULL); - } - - /* - * Filter function requested rte deletion. - * Ease the caller work by filling in remaining info - * from that particular entry. - */ - info->rti_info[RTAX_GATEWAY] = &rt->rt_nhop->gw_sa; - } - - /* - * Remove the item from the tree and return it. - * Complain if it is not there and do no more processing. - */ - *perror = ESRCH; -#ifdef RADIX_MPATH - if (rt_mpath_capable(rnh)) - rn = rt_mpath_unlink(rnh, info, rt, perror); - else -#endif - rn = rnh->rnh_deladdr(dst, netmask, &rnh->head); - if (rn == NULL) - return (NULL); - - if (rn->rn_flags & (RNF_ACTIVE | RNF_ROOT)) - panic ("rtrequest delete"); - - rt = RNTORT(rn); - RT_LOCK(rt); - rt->rt_flags &= ~RTF_UP; - - *perror = 0; - - return (rt); -} - -static void -rt_notifydelete(struct rtentry *rt, struct rt_addrinfo *info) -{ - struct ifaddr *ifa; - - /* - * give the protocol a chance to keep things in sync. - */ - ifa = rt->rt_nhop->nh_ifa; - if (ifa != NULL && ifa->ifa_rtrequest != NULL) - ifa->ifa_rtrequest(RTM_DELETE, rt, rt->rt_nhop, info); -} - - -/* - * These (questionable) definitions of apparent local variables apply - * to the next two functions. XXXXXX!!! - */ -#define dst info->rti_info[RTAX_DST] -#define gateway info->rti_info[RTAX_GATEWAY] -#define netmask info->rti_info[RTAX_NETMASK] -#define ifaaddr info->rti_info[RTAX_IFA] -#define ifpaddr info->rti_info[RTAX_IFP] -#define flags info->rti_flags - -/* * Look up rt_addrinfo for a specific fib. Note that if rti_ifa is defined, * it will be referenced so the caller must free it. * @@ -1125,9 +907,16 @@ rt_notifydelete(struct rtentry *rt, struct rt_addrinfo int rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum) { + const struct sockaddr *dst, *gateway, *ifpaddr, *ifaaddr; struct epoch_tracker et; - int needref, error; + int needref, error, flags; + dst = info->rti_info[RTAX_DST]; + gateway = info->rti_info[RTAX_GATEWAY]; + ifpaddr = info->rti_info[RTAX_IFP]; + ifaaddr = info->rti_info[RTAX_IFA]; + flags = info->rti_flags; + /* * ifp may be specified by sockaddr_dl * when protocol address is ambiguous. @@ -1150,7 +939,7 @@ rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum) if (info->rti_ifa == NULL && ifaaddr != NULL) info->rti_ifa = ifa_ifwithaddr(ifaaddr); if (info->rti_ifa == NULL) { - struct sockaddr *sa; + const struct sockaddr *sa; /* * Most common use case for the userland-supplied routes. @@ -1282,7 +1071,7 @@ rt_print(char *buf, int buflen, struct rtentry *rt) * Returnes unlinked entry. In case of failure, returns NULL * and sets @perror to ESRCH. */ -static struct radix_node * +struct radix_node * rt_mpath_unlink(struct rib_head *rnh, struct rt_addrinfo *info, struct rtentry *rto, int *perror) { @@ -1335,7 +1124,9 @@ rt_mpath_unlink(struct rib_head *rnh, struct rt_addrin * use the normal delete code to remove * the first entry */ - rn = rnh->rnh_deladdr(dst, netmask, &rnh->head); + rn = rnh->rnh_deladdr(info->rti_info[RTAX_DST], + info->rti_info[RTAX_NETMASK], + &rnh->head); *perror = 0; return (rn); } @@ -1351,13 +1142,6 @@ rt_mpath_unlink(struct rib_head *rnh, struct rt_addrin } #endif -#undef dst -#undef gateway -#undef netmask -#undef ifaaddr -#undef ifpaddr -#undef flags - int rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt, u_int fibnum) @@ -1369,7 +1153,7 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, stru KASSERT((fibnum < rt_numfibs), ("rtrequest1_fib: bad fibnum")); KASSERT((info->rti_flags & RTF_RNH_LOCKED) == 0, ("rtrequest1_fib: locked")); NET_EPOCH_ASSERT(); - + dst = info->rti_info[RTAX_DST]; switch (dst->sa_family) { @@ -1420,341 +1204,7 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, stru return (error); } -static int -add_route(struct rib_head *rnh, struct rt_addrinfo *info, - struct rtentry **ret_nrt) -{ - struct sockaddr *dst, *ndst, *gateway, *netmask; - struct rtentry *rt, *rt_old; - struct nhop_object *nh; - struct radix_node *rn; - struct ifaddr *ifa; - int error, flags; - struct epoch_tracker et; - - dst = info->rti_info[RTAX_DST]; - gateway = info->rti_info[RTAX_GATEWAY]; - netmask = info->rti_info[RTAX_NETMASK]; - flags = info->rti_flags; - - if ((flags & RTF_GATEWAY) && !gateway) - return (EINVAL); - if (dst && gateway && (dst->sa_family != gateway->sa_family) && - (gateway->sa_family != AF_UNSPEC) && (gateway->sa_family != AF_LINK)) - return (EINVAL); - - if (dst->sa_len > sizeof(((struct rtentry *)NULL)->rt_dstb)) - return (EINVAL); - - if (info->rti_ifa == NULL) { - error = rt_getifa_fib(info, rnh->rib_fibnum); - if (error) - return (error); - } else { - ifa_ref(info->rti_ifa); - } - - NET_EPOCH_ENTER(et); - error = nhop_create_from_info(rnh, info, &nh); - NET_EPOCH_EXIT(et); - if (error != 0) { - ifa_free(info->rti_ifa); - return (error); - } - - rt = uma_zalloc(V_rtzone, M_NOWAIT); - if (rt == NULL) { - ifa_free(info->rti_ifa); - nhop_free(nh); - return (ENOBUFS); - } - rt->rt_flags = RTF_UP | flags; - rt->rt_nhop = nh; - - /* Fill in dst */ - memcpy(&rt->rt_dst, dst, dst->sa_len); - rt_key(rt) = &rt->rt_dst; - - /* - * point to the (possibly newly malloc'd) dest address. - */ - ndst = (struct sockaddr *)rt_key(rt); - - /* - * make sure it contains the value we want (masked if needed). - */ - if (netmask) { - rt_maskedcopy(dst, ndst, netmask); - } else - bcopy(dst, ndst, dst->sa_len); - - /* - * We use the ifa reference returned by rt_getifa_fib(). - * This moved from below so that rnh->rnh_addaddr() can - * examine the ifa and ifa->ifa_ifp if it so desires. - */ - ifa = info->rti_ifa; - rt->rt_weight = 1; - - rt_setmetrics(info, rt); - - RIB_WLOCK(rnh); - RT_LOCK(rt); -#ifdef RADIX_MPATH - /* do not permit exactly the same dst/mask/gw pair */ - if (rt_mpath_capable(rnh) && - rt_mpath_conflict(rnh, rt, netmask)) { - RIB_WUNLOCK(rnh); - - nhop_free(nh); - uma_zfree(V_rtzone, rt); - return (EEXIST); - } -#endif - - rn = rnh->rnh_addaddr(ndst, netmask, &rnh->head, rt->rt_nodes); - - if (rn != NULL && rt->rt_expire > 0) - tmproutes_update(rnh, rt); - - rt_old = NULL; - if (rn == NULL && (info->rti_flags & RTF_PINNED) != 0) { - - /* - * Force removal and re-try addition - * TODO: better multipath&pinned support - */ - struct sockaddr *info_dst = info->rti_info[RTAX_DST]; - info->rti_info[RTAX_DST] = ndst; - /* Do not delete existing PINNED(interface) routes */ - info->rti_flags &= ~RTF_PINNED; - rt_old = rt_unlinkrte(rnh, info, &error); - info->rti_flags |= RTF_PINNED; - info->rti_info[RTAX_DST] = info_dst; - if (rt_old != NULL) - rn = rnh->rnh_addaddr(ndst, netmask, &rnh->head, - rt->rt_nodes); - } - RIB_WUNLOCK(rnh); - - if (rt_old != NULL) { - rt_notifydelete(rt_old, info); - rtfree(rt_old); - } - - /* - * If it still failed to go into the tree, - * then un-make it (this should be a function) - */ - if (rn == NULL) { - nhop_free(nh); - uma_zfree(V_rtzone, rt); - return (EEXIST); - } - - /* - * If this protocol has something to add to this then - * allow it to do that as well. - */ - if (ifa->ifa_rtrequest) - ifa->ifa_rtrequest(RTM_ADD, rt, rt->rt_nhop, info); - - /* - * actually return a resultant rtentry - */ - if (ret_nrt) - *ret_nrt = rt; - rnh->rnh_gen++; /* Routing table updated */ - RT_UNLOCK(rt); - - return (0); -} - -static int -del_route(struct rib_head *rnh, struct rt_addrinfo *info, - struct rtentry **ret_nrt) -{ - struct sockaddr *dst, *netmask; - struct sockaddr_storage mdst; - struct rtentry *rt; - int error; - - dst = info->rti_info[RTAX_DST]; - netmask = info->rti_info[RTAX_NETMASK]; - - if (netmask) { - if (dst->sa_len > sizeof(mdst)) - return (EINVAL); - rt_maskedcopy(dst, (struct sockaddr *)&mdst, netmask); - dst = (struct sockaddr *)&mdst; - } - - RIB_WLOCK(rnh); - rt = rt_unlinkrte(rnh, info, &error); - RIB_WUNLOCK(rnh); - if (error != 0) - return (error); - - rt_notifydelete(rt, info); - - /* - * If the caller wants it, then it can have it, - * the entry will be deleted after the end of the current epoch. - */ - if (ret_nrt) - *ret_nrt = rt; - - rtfree(rt); - - return (0); -} - -static int -change_route_one(struct rib_head *rnh, struct rt_addrinfo *info, - struct rtentry **ret_nrt) -{ - RIB_RLOCK_TRACKER; - struct rtentry *rt = NULL; - int error = 0; - int free_ifa = 0; - struct nhop_object *nh, *nh_orig; - - RIB_RLOCK(rnh); - rt = (struct rtentry *)rnh->rnh_lookup(info->rti_info[RTAX_DST], - info->rti_info[RTAX_NETMASK], &rnh->head); - - if (rt == NULL) { - RIB_RUNLOCK(rnh); - return (ESRCH); - } - -#ifdef RADIX_MPATH - /* - * If we got multipath routes, - * we require users to specify a matching RTAX_GATEWAY. - */ - if (rt_mpath_capable(rnh)) { - rt = rt_mpath_matchgate(rt, info->rti_info[RTAX_GATEWAY]); - if (rt == NULL) { - RIB_RUNLOCK(rnh); - return (ESRCH); - } - } -#endif - nh_orig = rt->rt_nhop; - - RIB_RUNLOCK(rnh); - - rt = NULL; - nh = NULL; - - /* - * New gateway could require new ifaddr, ifp; - * flags may also be different; ifp may be specified - * by ll sockaddr when protocol address is ambiguous - */ - if (((nh_orig->nh_flags & NHF_GATEWAY) && - info->rti_info[RTAX_GATEWAY] != NULL) || - info->rti_info[RTAX_IFP] != NULL || - (info->rti_info[RTAX_IFA] != NULL && - !sa_equal(info->rti_info[RTAX_IFA], nh_orig->nh_ifa->ifa_addr))) { - error = rt_getifa_fib(info, rnh->rib_fibnum); - if (info->rti_ifa != NULL) - free_ifa = 1; - - if (error != 0) { - if (free_ifa) { - ifa_free(info->rti_ifa); - info->rti_ifa = NULL; - } - - return (error); - } - } - - error = nhop_create_from_nhop(rnh, nh_orig, info, &nh); - if (free_ifa) { - ifa_free(info->rti_ifa); - info->rti_ifa = NULL; - } - if (error != 0) - return (error); - - RIB_WLOCK(rnh); - - /* Lookup rtentry once again and check if nexthop is still the same */ - rt = (struct rtentry *)rnh->rnh_lookup(info->rti_info[RTAX_DST], - info->rti_info[RTAX_NETMASK], &rnh->head); - - if (rt == NULL) { - RIB_WUNLOCK(rnh); - nhop_free(nh); - return (ESRCH); - } - - if (rt->rt_nhop != nh_orig) { - RIB_WUNLOCK(rnh); - nhop_free(nh); - return (EAGAIN); - } - - /* Proceed with the update */ - RT_LOCK(rt); - - /* Provide notification to the protocols.*/ - if ((nh_orig->nh_ifa != nh->nh_ifa) && nh_orig->nh_ifa->ifa_rtrequest) - nh_orig->nh_ifa->ifa_rtrequest(RTM_DELETE, rt, nh_orig, info); - - rt->rt_nhop = nh; - rt_setmetrics(info, rt); - - if ((nh_orig->nh_ifa != nh->nh_ifa) && nh_orig->nh_ifa->ifa_rtrequest) - nh_orig->nh_ifa->ifa_rtrequest(RTM_DELETE, rt, nh_orig, info); - - if (ret_nrt != NULL) - *ret_nrt = rt; - - RT_UNLOCK(rt); - - /* Update generation id to reflect rtable change */ - rnh->rnh_gen++; - - RIB_WUNLOCK(rnh); - - nhop_free(nh_orig); - - return (0); -} - -static int -change_route(struct rib_head *rnh, struct rt_addrinfo *info, - struct rtentry **ret_nrt) -{ - int error; - - /* Check if updated gateway exists */ - if ((info->rti_flags & RTF_GATEWAY) && - (info->rti_info[RTAX_GATEWAY] == NULL)) - return (EINVAL); - - /* - * route change is done in multiple steps, with dropping and - * reacquiring lock. In the situations with multiple processes - * changes the same route in can lead to the case when route - * is changed between the steps. Address it by retrying the operation - * multiple times before failing. - */ - for (int i = 0; i < RIB_MAX_RETRIES; i++) { - error = change_route_one(rnh, info, ret_nrt); - if (error != EAGAIN) - break; - } - - return (error); -} - - -static void +void rt_setmetrics(const struct rt_addrinfo *info, struct rtentry *rt) { Modified: head/sys/net/route/route_ctl.c ============================================================================== --- head/sys/net/route/route_ctl.c Sat May 23 18:03:19 2020 (r361420) +++ head/sys/net/route/route_ctl.c Sat May 23 19:06:57 2020 (r361421) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" +#include "opt_mpath.h" #include #include @@ -53,6 +54,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef RADIX_MPATH +#include +#endif + #include @@ -61,5 +66,519 @@ __FBSDID("$FreeBSD$"); * * All functions assumes they are called in net epoch. */ + +static void rt_notifydelete(struct rtentry *rt, struct rt_addrinfo *info); + +int +add_route(struct rib_head *rnh, struct rt_addrinfo *info, + struct rtentry **ret_nrt) +{ + struct sockaddr *dst, *ndst, *gateway, *netmask; + struct rtentry *rt, *rt_old; + struct nhop_object *nh; + struct radix_node *rn; + struct ifaddr *ifa; + int error, flags; + struct epoch_tracker et; + + dst = info->rti_info[RTAX_DST]; + gateway = info->rti_info[RTAX_GATEWAY]; + netmask = info->rti_info[RTAX_NETMASK]; + flags = info->rti_flags; + + if ((flags & RTF_GATEWAY) && !gateway) + return (EINVAL); + if (dst && gateway && (dst->sa_family != gateway->sa_family) && + (gateway->sa_family != AF_UNSPEC) && (gateway->sa_family != AF_LINK)) + return (EINVAL); + + if (dst->sa_len > sizeof(((struct rtentry *)NULL)->rt_dstb)) + return (EINVAL); + + if (info->rti_ifa == NULL) { + error = rt_getifa_fib(info, rnh->rib_fibnum); + if (error) + return (error); + } else { + ifa_ref(info->rti_ifa); + } + + NET_EPOCH_ENTER(et); + error = nhop_create_from_info(rnh, info, &nh); + NET_EPOCH_EXIT(et); + if (error != 0) { + ifa_free(info->rti_ifa); + return (error); + } + + rt = uma_zalloc(V_rtzone, M_NOWAIT); + if (rt == NULL) { + ifa_free(info->rti_ifa); + nhop_free(nh); + return (ENOBUFS); + } + rt->rt_flags = RTF_UP | flags; + rt->rt_nhop = nh; + + /* Fill in dst */ + memcpy(&rt->rt_dst, dst, dst->sa_len); + rt_key(rt) = &rt->rt_dst; + + /* + * point to the (possibly newly malloc'd) dest address. + */ + ndst = (struct sockaddr *)rt_key(rt); + + /* + * make sure it contains the value we want (masked if needed). + */ + if (netmask) { + rt_maskedcopy(dst, ndst, netmask); + } else + bcopy(dst, ndst, dst->sa_len); + + /* + * We use the ifa reference returned by rt_getifa_fib(). + * This moved from below so that rnh->rnh_addaddr() can + * examine the ifa and ifa->ifa_ifp if it so desires. + */ + ifa = info->rti_ifa; + rt->rt_weight = 1; + + rt_setmetrics(info, rt); + + RIB_WLOCK(rnh); + RT_LOCK(rt); +#ifdef RADIX_MPATH + /* do not permit exactly the same dst/mask/gw pair */ + if (rt_mpath_capable(rnh) && + rt_mpath_conflict(rnh, rt, netmask)) { + RIB_WUNLOCK(rnh); + + nhop_free(nh); + uma_zfree(V_rtzone, rt); + return (EEXIST); + } +#endif + + rn = rnh->rnh_addaddr(ndst, netmask, &rnh->head, rt->rt_nodes); + + if (rn != NULL && rt->rt_expire > 0) + tmproutes_update(rnh, rt); + + rt_old = NULL; + if (rn == NULL && (info->rti_flags & RTF_PINNED) != 0) { + + /* + * Force removal and re-try addition + * TODO: better multipath&pinned support + */ + struct sockaddr *info_dst = info->rti_info[RTAX_DST]; + info->rti_info[RTAX_DST] = ndst; + /* Do not delete existing PINNED(interface) routes */ + info->rti_flags &= ~RTF_PINNED; + rt_old = rt_unlinkrte(rnh, info, &error); + info->rti_flags |= RTF_PINNED; + info->rti_info[RTAX_DST] = info_dst; + if (rt_old != NULL) + rn = rnh->rnh_addaddr(ndst, netmask, &rnh->head, + rt->rt_nodes); + } + RIB_WUNLOCK(rnh); + + if (rt_old != NULL) { + rt_notifydelete(rt_old, info); + rtfree(rt_old); + } + + /* + * If it still failed to go into the tree, + * then un-make it (this should be a function) + */ + if (rn == NULL) { + nhop_free(nh); + uma_zfree(V_rtzone, rt); + return (EEXIST); + } + + /* + * If this protocol has something to add to this then + * allow it to do that as well. + */ + if (ifa->ifa_rtrequest) + ifa->ifa_rtrequest(RTM_ADD, rt, rt->rt_nhop, info); + + /* + * actually return a resultant rtentry + */ + if (ret_nrt) + *ret_nrt = rt; + rnh->rnh_gen++; /* Routing table updated */ + RT_UNLOCK(rt); + + return (0); +} + + +/* + * Conditionally unlinks rtentry matching data inside @info from @rnh. + * Returns unlinked, locked and referenced @rtentry on success, + * Returns NULL and sets @perror to: + * ESRCH - if prefix was not found, + * EADDRINUSE - if trying to delete PINNED route without appropriate flag. + * ENOENT - if supplied filter function returned 0 (not matched). + */ +struct rtentry * +rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo *info, int *perror) +{ + struct sockaddr *dst, *netmask; + struct rtentry *rt; + struct radix_node *rn; + + dst = info->rti_info[RTAX_DST]; + netmask = info->rti_info[RTAX_NETMASK]; + + rt = (struct rtentry *)rnh->rnh_lookup(dst, netmask, &rnh->head); + if (rt == NULL) { + *perror = ESRCH; + return (NULL); + } + + if ((info->rti_flags & RTF_PINNED) == 0) { + /* Check if target route can be deleted */ + if (rt->rt_flags & RTF_PINNED) { + *perror = EADDRINUSE; + return (NULL); + } + } + + if (info->rti_filter != NULL) { + if (info->rti_filter(rt, rt->rt_nhop, info->rti_filterdata)==0){ + /* Not matched */ + *perror = ENOENT; + return (NULL); + } + + /* + * Filter function requested rte deletion. + * Ease the caller work by filling in remaining info + * from that particular entry. + */ + info->rti_info[RTAX_GATEWAY] = &rt->rt_nhop->gw_sa; + } + + /* + * Remove the item from the tree and return it. + * Complain if it is not there and do no more processing. + */ + *perror = ESRCH; +#ifdef RADIX_MPATH + if (rt_mpath_capable(rnh)) + rn = rt_mpath_unlink(rnh, info, rt, perror); + else +#endif + rn = rnh->rnh_deladdr(dst, netmask, &rnh->head); + if (rn == NULL) + return (NULL); + + if (rn->rn_flags & (RNF_ACTIVE | RNF_ROOT)) + panic ("rtrequest delete"); + + rt = RNTORT(rn); + RT_LOCK(rt); + rt->rt_flags &= ~RTF_UP; + + *perror = 0; + + return (rt); +} + +int +del_route(struct rib_head *rnh, struct rt_addrinfo *info, + struct rtentry **ret_nrt) +{ + struct sockaddr *dst, *netmask; + struct sockaddr_storage mdst; + struct rtentry *rt; + int error; + + dst = info->rti_info[RTAX_DST]; + netmask = info->rti_info[RTAX_NETMASK]; + + if (netmask) { + if (dst->sa_len > sizeof(mdst)) + return (EINVAL); + rt_maskedcopy(dst, (struct sockaddr *)&mdst, netmask); + dst = (struct sockaddr *)&mdst; + } + + RIB_WLOCK(rnh); + rt = rt_unlinkrte(rnh, info, &error); + RIB_WUNLOCK(rnh); + if (error != 0) + return (error); + + rt_notifydelete(rt, info); + + /* + * If the caller wants it, then it can have it, + * the entry will be deleted after the end of the current epoch. + */ + if (ret_nrt) + *ret_nrt = rt; + + rtfree(rt); + + return (0); +} + +static int +change_route_one(struct rib_head *rnh, struct rt_addrinfo *info, + struct rtentry **ret_nrt) +{ + RIB_RLOCK_TRACKER; + struct rtentry *rt = NULL; + int error = 0; + int free_ifa = 0; + struct nhop_object *nh, *nh_orig; + + RIB_RLOCK(rnh); + rt = (struct rtentry *)rnh->rnh_lookup(info->rti_info[RTAX_DST], + info->rti_info[RTAX_NETMASK], &rnh->head); + + if (rt == NULL) { + RIB_RUNLOCK(rnh); + return (ESRCH); + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat May 23 19:52: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 552312DC4B6; Sat, 23 May 2020 19:52:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TvC911Hfz4YkV; Sat, 23 May 2020 19:52:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DFBA15364; Sat, 23 May 2020 19:52:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NJqKkC022016; Sat, 23 May 2020 19:52:21 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NJqKHa022015; Sat, 23 May 2020 19:52:20 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005231952.04NJqKHa022015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 23 May 2020 19:52:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361422 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 361422 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, 23 May 2020 19:52:21 -0000 Author: manu Date: Sat May 23 19:52:20 2020 New Revision: 361422 URL: https://svnweb.freebsd.org/changeset/base/361422 Log: bbr: Use arc4random_uniform from libkern. This unbreak LINT build Reported by: jenkins, melifaro Modified: head/sys/netinet/tcp_stacks/bbr.c Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Sat May 23 19:06:57 2020 (r361421) +++ head/sys/netinet/tcp_stacks/bbr.c Sat May 23 19:52:20 2020 (r361422) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef TCP_HHOOK #include #endif @@ -3095,43 +3096,6 @@ bbr_lt_bw_samp_done(struct tcp_bbr *bbr, uint64_t bw, bbr->r_ctl.rc_lt_bw = bw; bbr_reset_lt_bw_interval(bbr, cts); bbr_log_type_ltbw(bbr, cts, 5, 0, (uint32_t)bw, 0, timin); -} - -/* - * RRS: Copied from user space! - * Calculate a uniformly distributed random number less than upper_bound - * avoiding "modulo bias". - * - * Uniformity is achieved by generating new random numbers until the one - * returned is outside the range [0, 2**32 % upper_bound). This - * guarantees the selected random number will be inside - * [2**32 % upper_bound, 2**32) which maps back to [0, upper_bound) - * after reduction modulo upper_bound. - */ -static uint32_t -arc4random_uniform(uint32_t upper_bound) -{ - uint32_t r, min; - - if (upper_bound < 2) - return 0; - - /* 2**32 % x == (2**32 - x) % x */ - min = -upper_bound % upper_bound; - - /* - * This could theoretically loop forever but each retry has - * p > 0.5 (worst case, usually far better) of selecting a - * number inside the range we need, so it should rarely need - * to re-roll. - */ - for (;;) { - r = arc4random(); - if (r >= min) - break; - } - - return r % upper_bound; } static void From owner-svn-src-all@freebsd.org Sat May 23 20: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 526E22DD3F5; Sat, 23 May 2020 20:37:36 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TwCN1k3Nz4d0F; Sat, 23 May 2020 20:37:36 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3182815BAA; Sat, 23 May 2020 20:37:36 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NKbZTI046660; Sat, 23 May 2020 20:37:35 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NKbXfb046649; Sat, 23 May 2020 20:37:33 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005232037.04NKbXfb046649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 23 May 2020 20:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r361423 - in vendor/zstd/dist: . contrib contrib/docker contrib/experimental_dict_builders/benchmarkDictBuilder contrib/experimental_dict_builders/fastCover contrib/experimental_dict_bu... X-SVN-Group: vendor X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in vendor/zstd/dist: . contrib contrib/docker contrib/experimental_dict_builders/benchmarkDictBuilder contrib/experimental_dict_builders/fastCover contrib/experimental_dict_builders/randomDictBuilder ... X-SVN-Commit-Revision: 361423 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, 23 May 2020 20:37:36 -0000 Author: cem Date: Sat May 23 20:37:33 2020 New Revision: 361423 URL: https://svnweb.freebsd.org/changeset/base/361423 Log: Import Zstd 1.4.5 Added: vendor/zstd/dist/lib/compress/zstd_compress_superblock.c (contents, props changed) vendor/zstd/dist/lib/compress/zstd_compress_superblock.h (contents, props changed) Deleted: vendor/zstd/dist/contrib/cleanTabs vendor/zstd/dist/contrib/docker/Dockerfile vendor/zstd/dist/contrib/docker/README.md vendor/zstd/dist/contrib/experimental_dict_builders/benchmarkDictBuilder/Makefile vendor/zstd/dist/contrib/experimental_dict_builders/benchmarkDictBuilder/README.md vendor/zstd/dist/contrib/experimental_dict_builders/benchmarkDictBuilder/benchmark.c vendor/zstd/dist/contrib/experimental_dict_builders/benchmarkDictBuilder/dictBuilder.h vendor/zstd/dist/contrib/experimental_dict_builders/benchmarkDictBuilder/test.sh vendor/zstd/dist/contrib/experimental_dict_builders/fastCover/Makefile vendor/zstd/dist/contrib/experimental_dict_builders/fastCover/README.md vendor/zstd/dist/contrib/experimental_dict_builders/fastCover/fastCover.c vendor/zstd/dist/contrib/experimental_dict_builders/fastCover/fastCover.h vendor/zstd/dist/contrib/experimental_dict_builders/fastCover/main.c vendor/zstd/dist/contrib/experimental_dict_builders/fastCover/test.sh vendor/zstd/dist/contrib/experimental_dict_builders/randomDictBuilder/Makefile vendor/zstd/dist/contrib/experimental_dict_builders/randomDictBuilder/README.md vendor/zstd/dist/contrib/experimental_dict_builders/randomDictBuilder/io.c vendor/zstd/dist/contrib/experimental_dict_builders/randomDictBuilder/io.h vendor/zstd/dist/contrib/experimental_dict_builders/randomDictBuilder/main.c vendor/zstd/dist/contrib/experimental_dict_builders/randomDictBuilder/random.c vendor/zstd/dist/contrib/experimental_dict_builders/randomDictBuilder/random.h vendor/zstd/dist/contrib/experimental_dict_builders/randomDictBuilder/test.sh vendor/zstd/dist/contrib/gen_html/Makefile vendor/zstd/dist/contrib/gen_html/README.md vendor/zstd/dist/contrib/gen_html/gen-zstd-manual.sh vendor/zstd/dist/contrib/gen_html/gen_html.cpp vendor/zstd/dist/contrib/largeNbDicts/Makefile vendor/zstd/dist/contrib/largeNbDicts/README.md vendor/zstd/dist/contrib/largeNbDicts/largeNbDicts.c vendor/zstd/dist/contrib/premake/premake4.lua vendor/zstd/dist/contrib/premake/zstd.lua vendor/zstd/dist/contrib/pzstd/BUCK vendor/zstd/dist/contrib/pzstd/ErrorHolder.h vendor/zstd/dist/contrib/pzstd/Logging.h vendor/zstd/dist/contrib/pzstd/Makefile vendor/zstd/dist/contrib/pzstd/Options.cpp vendor/zstd/dist/contrib/pzstd/Options.h vendor/zstd/dist/contrib/pzstd/Pzstd.cpp vendor/zstd/dist/contrib/pzstd/Pzstd.h vendor/zstd/dist/contrib/pzstd/README.md vendor/zstd/dist/contrib/pzstd/SkippableFrame.cpp vendor/zstd/dist/contrib/pzstd/SkippableFrame.h vendor/zstd/dist/contrib/pzstd/images/Cspeed.png vendor/zstd/dist/contrib/pzstd/images/Dspeed.png vendor/zstd/dist/contrib/pzstd/main.cpp vendor/zstd/dist/contrib/pzstd/test/BUCK vendor/zstd/dist/contrib/pzstd/test/OptionsTest.cpp vendor/zstd/dist/contrib/pzstd/test/PzstdTest.cpp vendor/zstd/dist/contrib/pzstd/test/RoundTrip.h vendor/zstd/dist/contrib/pzstd/test/RoundTripTest.cpp vendor/zstd/dist/contrib/pzstd/utils/BUCK vendor/zstd/dist/contrib/pzstd/utils/Buffer.h vendor/zstd/dist/contrib/pzstd/utils/FileSystem.h vendor/zstd/dist/contrib/pzstd/utils/Likely.h vendor/zstd/dist/contrib/pzstd/utils/Range.h vendor/zstd/dist/contrib/pzstd/utils/ResourcePool.h vendor/zstd/dist/contrib/pzstd/utils/ScopeGuard.h vendor/zstd/dist/contrib/pzstd/utils/ThreadPool.h vendor/zstd/dist/contrib/pzstd/utils/WorkQueue.h vendor/zstd/dist/contrib/pzstd/utils/test/BUCK vendor/zstd/dist/contrib/pzstd/utils/test/BufferTest.cpp vendor/zstd/dist/contrib/pzstd/utils/test/RangeTest.cpp vendor/zstd/dist/contrib/pzstd/utils/test/ResourcePoolTest.cpp vendor/zstd/dist/contrib/pzstd/utils/test/ScopeGuardTest.cpp vendor/zstd/dist/contrib/pzstd/utils/test/ThreadPoolTest.cpp vendor/zstd/dist/contrib/pzstd/utils/test/WorkQueueTest.cpp vendor/zstd/dist/contrib/seekable_format/examples/Makefile vendor/zstd/dist/contrib/seekable_format/examples/parallel_compression.c vendor/zstd/dist/contrib/seekable_format/examples/parallel_processing.c vendor/zstd/dist/contrib/seekable_format/examples/seekable_compression.c vendor/zstd/dist/contrib/seekable_format/examples/seekable_decompression.c vendor/zstd/dist/contrib/seekable_format/examples/seekable_decompression_mem.c vendor/zstd/dist/contrib/seekable_format/zstd_seekable.h vendor/zstd/dist/contrib/seekable_format/zstd_seekable_compression_format.md vendor/zstd/dist/contrib/seekable_format/zstdseek_compress.c vendor/zstd/dist/contrib/seekable_format/zstdseek_decompress.c vendor/zstd/dist/contrib/snap/snapcraft.yaml vendor/zstd/dist/tests/Makefile vendor/zstd/dist/tests/README.md vendor/zstd/dist/tests/bigdict.c vendor/zstd/dist/tests/checkTag.c vendor/zstd/dist/tests/datagencli.c vendor/zstd/dist/tests/decodecorpus.c vendor/zstd/dist/tests/fullbench.c vendor/zstd/dist/tests/fuzz/Makefile vendor/zstd/dist/tests/fuzz/README.md vendor/zstd/dist/tests/fuzz/block_decompress.c vendor/zstd/dist/tests/fuzz/block_round_trip.c vendor/zstd/dist/tests/fuzz/dictionary_decompress.c vendor/zstd/dist/tests/fuzz/dictionary_loader.c vendor/zstd/dist/tests/fuzz/dictionary_round_trip.c vendor/zstd/dist/tests/fuzz/fuzz.h vendor/zstd/dist/tests/fuzz/fuzz.py vendor/zstd/dist/tests/fuzz/fuzz_data_producer.c vendor/zstd/dist/tests/fuzz/fuzz_data_producer.h vendor/zstd/dist/tests/fuzz/fuzz_helpers.h vendor/zstd/dist/tests/fuzz/regression_driver.c vendor/zstd/dist/tests/fuzz/simple_compress.c vendor/zstd/dist/tests/fuzz/simple_decompress.c vendor/zstd/dist/tests/fuzz/simple_round_trip.c vendor/zstd/dist/tests/fuzz/stream_decompress.c vendor/zstd/dist/tests/fuzz/stream_round_trip.c vendor/zstd/dist/tests/fuzz/zstd_frame_info.c vendor/zstd/dist/tests/fuzz/zstd_helpers.c vendor/zstd/dist/tests/fuzz/zstd_helpers.h vendor/zstd/dist/tests/fuzzer.c vendor/zstd/dist/tests/golden-compression/huffman-compressed-larger vendor/zstd/dist/tests/golden-decompression/rle-first-block.zst vendor/zstd/dist/tests/gzip/Makefile vendor/zstd/dist/tests/gzip/gzip-env.sh vendor/zstd/dist/tests/gzip/helin-segv.sh vendor/zstd/dist/tests/gzip/help-version.sh vendor/zstd/dist/tests/gzip/hufts-segv.gz vendor/zstd/dist/tests/gzip/hufts.sh vendor/zstd/dist/tests/gzip/init.cfg vendor/zstd/dist/tests/gzip/init.sh vendor/zstd/dist/tests/gzip/keep.sh vendor/zstd/dist/tests/gzip/list.sh vendor/zstd/dist/tests/gzip/memcpy-abuse.sh vendor/zstd/dist/tests/gzip/mixed.sh vendor/zstd/dist/tests/gzip/null-suffix-clobber.sh vendor/zstd/dist/tests/gzip/stdin.sh vendor/zstd/dist/tests/gzip/test-driver.sh vendor/zstd/dist/tests/gzip/trailing-nul.sh vendor/zstd/dist/tests/gzip/unpack-invalid.sh vendor/zstd/dist/tests/gzip/z-suffix.sh vendor/zstd/dist/tests/gzip/zdiff.sh vendor/zstd/dist/tests/gzip/zgrep-context.sh vendor/zstd/dist/tests/gzip/zgrep-f.sh vendor/zstd/dist/tests/gzip/zgrep-signal.sh vendor/zstd/dist/tests/gzip/znew-k.sh vendor/zstd/dist/tests/invalidDictionaries.c vendor/zstd/dist/tests/legacy.c vendor/zstd/dist/tests/libzstd_partial_builds.sh vendor/zstd/dist/tests/longmatch.c vendor/zstd/dist/tests/paramgrill.c vendor/zstd/dist/tests/playTests.sh vendor/zstd/dist/tests/poolTests.c vendor/zstd/dist/tests/rateLimiter.py vendor/zstd/dist/tests/regression/Makefile vendor/zstd/dist/tests/regression/config.c vendor/zstd/dist/tests/regression/config.h vendor/zstd/dist/tests/regression/data.c vendor/zstd/dist/tests/regression/data.h vendor/zstd/dist/tests/regression/levels.h vendor/zstd/dist/tests/regression/method.c vendor/zstd/dist/tests/regression/method.h vendor/zstd/dist/tests/regression/result.c vendor/zstd/dist/tests/regression/result.h vendor/zstd/dist/tests/regression/results.csv vendor/zstd/dist/tests/regression/test.c vendor/zstd/dist/tests/roundTripCrash.c vendor/zstd/dist/tests/seqgen.c vendor/zstd/dist/tests/seqgen.h vendor/zstd/dist/tests/symbols.c vendor/zstd/dist/tests/test-zstd-speed.py vendor/zstd/dist/tests/test-zstd-versions.py vendor/zstd/dist/tests/zbufftest.c vendor/zstd/dist/tests/zstreamtest.c Modified: vendor/zstd/dist/CHANGELOG vendor/zstd/dist/CONTRIBUTING.md vendor/zstd/dist/Makefile vendor/zstd/dist/README.md vendor/zstd/dist/TESTING.md vendor/zstd/dist/appveyor.yml vendor/zstd/dist/doc/educational_decoder/Makefile vendor/zstd/dist/doc/educational_decoder/README.md vendor/zstd/dist/doc/educational_decoder/harness.c vendor/zstd/dist/doc/educational_decoder/zstd_decompress.c vendor/zstd/dist/doc/educational_decoder/zstd_decompress.h vendor/zstd/dist/doc/zstd_compression_format.md vendor/zstd/dist/doc/zstd_manual.html vendor/zstd/dist/examples/Makefile vendor/zstd/dist/examples/common.h vendor/zstd/dist/examples/dictionary_compression.c vendor/zstd/dist/examples/dictionary_decompression.c vendor/zstd/dist/examples/multiple_simple_compression.c vendor/zstd/dist/examples/multiple_streaming_compression.c vendor/zstd/dist/examples/simple_compression.c vendor/zstd/dist/examples/simple_decompression.c vendor/zstd/dist/examples/streaming_compression.c vendor/zstd/dist/examples/streaming_decompression.c vendor/zstd/dist/examples/streaming_memory_usage.c vendor/zstd/dist/lib/Makefile vendor/zstd/dist/lib/README.md vendor/zstd/dist/lib/common/bitstream.h vendor/zstd/dist/lib/common/compiler.h vendor/zstd/dist/lib/common/cpu.h vendor/zstd/dist/lib/common/debug.c vendor/zstd/dist/lib/common/debug.h vendor/zstd/dist/lib/common/entropy_common.c vendor/zstd/dist/lib/common/error_private.c vendor/zstd/dist/lib/common/error_private.h vendor/zstd/dist/lib/common/fse.h vendor/zstd/dist/lib/common/fse_decompress.c vendor/zstd/dist/lib/common/huf.h vendor/zstd/dist/lib/common/mem.h vendor/zstd/dist/lib/common/pool.c vendor/zstd/dist/lib/common/pool.h vendor/zstd/dist/lib/common/threading.c vendor/zstd/dist/lib/common/threading.h vendor/zstd/dist/lib/common/xxhash.c vendor/zstd/dist/lib/common/xxhash.h vendor/zstd/dist/lib/common/zstd_common.c vendor/zstd/dist/lib/common/zstd_errors.h vendor/zstd/dist/lib/common/zstd_internal.h vendor/zstd/dist/lib/compress/fse_compress.c vendor/zstd/dist/lib/compress/hist.c vendor/zstd/dist/lib/compress/hist.h vendor/zstd/dist/lib/compress/huf_compress.c vendor/zstd/dist/lib/compress/zstd_compress.c vendor/zstd/dist/lib/compress/zstd_compress_internal.h vendor/zstd/dist/lib/compress/zstd_compress_literals.c vendor/zstd/dist/lib/compress/zstd_compress_literals.h vendor/zstd/dist/lib/compress/zstd_compress_sequences.c vendor/zstd/dist/lib/compress/zstd_compress_sequences.h vendor/zstd/dist/lib/compress/zstd_cwksp.h vendor/zstd/dist/lib/compress/zstd_double_fast.c vendor/zstd/dist/lib/compress/zstd_double_fast.h vendor/zstd/dist/lib/compress/zstd_fast.c vendor/zstd/dist/lib/compress/zstd_fast.h vendor/zstd/dist/lib/compress/zstd_lazy.c vendor/zstd/dist/lib/compress/zstd_lazy.h vendor/zstd/dist/lib/compress/zstd_ldm.c vendor/zstd/dist/lib/compress/zstd_ldm.h vendor/zstd/dist/lib/compress/zstd_opt.c vendor/zstd/dist/lib/compress/zstd_opt.h vendor/zstd/dist/lib/compress/zstdmt_compress.c vendor/zstd/dist/lib/compress/zstdmt_compress.h vendor/zstd/dist/lib/decompress/huf_decompress.c vendor/zstd/dist/lib/decompress/zstd_ddict.c vendor/zstd/dist/lib/decompress/zstd_ddict.h vendor/zstd/dist/lib/decompress/zstd_decompress.c vendor/zstd/dist/lib/decompress/zstd_decompress_block.c vendor/zstd/dist/lib/decompress/zstd_decompress_block.h vendor/zstd/dist/lib/decompress/zstd_decompress_internal.h vendor/zstd/dist/lib/deprecated/zbuff.h vendor/zstd/dist/lib/deprecated/zbuff_common.c vendor/zstd/dist/lib/deprecated/zbuff_compress.c vendor/zstd/dist/lib/deprecated/zbuff_decompress.c vendor/zstd/dist/lib/dictBuilder/cover.c vendor/zstd/dist/lib/dictBuilder/cover.h vendor/zstd/dist/lib/dictBuilder/fastcover.c vendor/zstd/dist/lib/dictBuilder/zdict.c vendor/zstd/dist/lib/dictBuilder/zdict.h vendor/zstd/dist/lib/legacy/zstd_legacy.h vendor/zstd/dist/lib/legacy/zstd_v01.c vendor/zstd/dist/lib/legacy/zstd_v01.h vendor/zstd/dist/lib/legacy/zstd_v02.c vendor/zstd/dist/lib/legacy/zstd_v02.h vendor/zstd/dist/lib/legacy/zstd_v03.c vendor/zstd/dist/lib/legacy/zstd_v03.h vendor/zstd/dist/lib/legacy/zstd_v04.c vendor/zstd/dist/lib/legacy/zstd_v04.h vendor/zstd/dist/lib/legacy/zstd_v05.c vendor/zstd/dist/lib/legacy/zstd_v05.h vendor/zstd/dist/lib/legacy/zstd_v06.c vendor/zstd/dist/lib/legacy/zstd_v06.h vendor/zstd/dist/lib/legacy/zstd_v07.c vendor/zstd/dist/lib/legacy/zstd_v07.h vendor/zstd/dist/lib/libzstd.pc.in vendor/zstd/dist/lib/zstd.h vendor/zstd/dist/programs/Makefile vendor/zstd/dist/programs/README.md vendor/zstd/dist/programs/benchfn.c vendor/zstd/dist/programs/benchfn.h vendor/zstd/dist/programs/benchzstd.c vendor/zstd/dist/programs/benchzstd.h vendor/zstd/dist/programs/datagen.c vendor/zstd/dist/programs/datagen.h vendor/zstd/dist/programs/dibio.c vendor/zstd/dist/programs/dibio.h vendor/zstd/dist/programs/fileio.c vendor/zstd/dist/programs/fileio.h vendor/zstd/dist/programs/platform.h vendor/zstd/dist/programs/timefn.c vendor/zstd/dist/programs/timefn.h vendor/zstd/dist/programs/util.c vendor/zstd/dist/programs/util.h vendor/zstd/dist/programs/zstd.1 vendor/zstd/dist/programs/zstd.1.md vendor/zstd/dist/programs/zstdcli.c vendor/zstd/dist/programs/zstdgrep vendor/zstd/dist/programs/zstdgrep.1 vendor/zstd/dist/programs/zstdless.1 vendor/zstd/dist/zlibWrapper/Makefile vendor/zstd/dist/zlibWrapper/examples/zwrapbench.c vendor/zstd/dist/zlibWrapper/gzcompatibility.h vendor/zstd/dist/zlibWrapper/zstd_zlibwrapper.c vendor/zstd/dist/zlibWrapper/zstd_zlibwrapper.h Modified: vendor/zstd/dist/CHANGELOG ============================================================================== --- vendor/zstd/dist/CHANGELOG Sat May 23 19:52:20 2020 (r361422) +++ vendor/zstd/dist/CHANGELOG Sat May 23 20:37:33 2020 (r361423) @@ -1,3 +1,29 @@ +v1.4.5 +fix : Compression ratio regression on huge files (> 3 GB) using high levels (--ultra) and multithreading, by @terrelln +perf: Improved decompression speed: x64 : +10% (clang) / +5% (gcc); ARM : from +15% to +50%, depending on SoC, by @terrelln +perf: Automatically downsizes ZSTD_DCtx when too large for too long (#2069, by @bimbashreshta) +perf: Improved fast compression speed on aarch64 (#2040, ~+3%, by @caoyzh) +perf: Small level 1 compression speed gains (depending on compiler) +cli : New --patch-from command, create and apply patches from files, by @bimbashreshta +cli : New --filelist= : Provide a list of files to operate upon from a file +cli : -b -d command can now benchmark decompression on multiple files +cli : New --no-content-size command +cli : New --show-default-cparams information command +api : ZDICT_finalizeDictionary() is promoted to stable (#2111) +api : new experimental parameter ZSTD_d_stableOutBuffer (#2094) +build: Generate a single-file libzstd library (#2065, by @cwoffenden) +build: Relative includes no longer require -I compiler flags for zstd lib subdirs (#2103, by @felixhandte) +build: zstd now compiles cleanly under -pedantic (#2099) +build: zstd now compiles with make-4.3 +build: Support mingw cross-compilation from Linux, by @Ericson2314 +build: Meson multi-thread build fix on windows +build: Some misc icc fixes backed by new ci test on travis +misc: bitflip analyzer tool, by @felixhandte +misc: Extend largeNbDicts benchmark to compression +misc: Edit-distance match finder in contrib/ +doc : Improved beginner CONTRIBUTING.md docs +doc : New issue templates for zstd + v1.4.4 perf: Improved decompression speed, by > 10%, by @terrelln perf: Better compression speed when re-using a context, by @felixhandte @@ -14,7 +40,8 @@ cli: commands --stream-size=# and --size-hint=#, by @n cli: command --exclude-compressed, by @shashank0791 cli: faster `-t` test mode cli: improved some error messages, by @vangyzen -cli: rare deadlock condition within dictionary builder, by @terrelln +cli: fix command `-D dictionary` on Windows, reported by @artyompetrov +cli: fix rare deadlock condition within dictionary builder, by @terrelln build: single-file decoder with emscripten compilation script, by @cwoffenden build: fixed zlibWrapper compilation on Visual Studio, reported by @bluenlive build: fixed deprecation warning for certain gcc version, reported by @jasonma163 Modified: vendor/zstd/dist/CONTRIBUTING.md ============================================================================== --- vendor/zstd/dist/CONTRIBUTING.md Sat May 23 19:52:20 2020 (r361422) +++ vendor/zstd/dist/CONTRIBUTING.md Sat May 23 20:37:33 2020 (r361423) @@ -26,6 +26,356 @@ to do this once to work on any of Facebook's open sour Complete your CLA here: +## Workflow +Zstd uses a branch-based workflow for making changes to the codebase. Typically, zstd +will use a new branch per sizable topic. For smaller changes, it is okay to lump multiple +related changes into a branch. + +Our contribution process works in three main stages: +1. Local development + * Update: + * Checkout your fork of zstd if you have not already + ``` + git checkout https://github.com//zstd + cd zstd + ``` + * Update your local dev branch + ``` + git pull https://github.com/facebook/zstd dev + git push origin dev + ``` + * Topic and development: + * Make a new branch on your fork about the topic you're developing for + ``` + # branch names should be consise but sufficiently informative + git checkout -b + git push origin + ``` + * Make commits and push + ``` + # make some changes = + git add -u && git commit -m + git push origin + ``` + * Note: run local tests to ensure that your changes didn't break existing functionality + * Quick check + ``` + make shortest + ``` + * Longer check + ``` + make test + ``` +2. Code Review and CI tests + * Ensure CI tests pass: + * Before sharing anything to the community, make sure that all CI tests pass on your local fork. + See our section on setting up your CI environment for more information on how to do this. + * Ensure that static analysis passes on your development machine. See the Static Analysis section + below to see how to do this. + * Create a pull request: + * When you are ready to share you changes to the community, create a pull request from your branch + to facebook:dev. You can do this very easily by clicking 'Create Pull Request' on your fork's home + page. + * From there, select the branch where you made changes as your source branch and facebook:dev + as the destination. + * Examine the diff presented between the two branches to make sure there is nothing unexpected. + * Write a good pull request description: + * While there is no strict template that our contributors follow, we would like them to + sufficiently summarize and motivate the changes they are proposing. We recommend all pull requests, + at least indirectly, address the following points. + * Is this pull request important and why? + * Is it addressing an issue? If so, what issue? (provide links for convenience please) + * Is this a new feature? If so, why is it useful and/or necessary? + * Are there background references and documents that reviewers should be aware of to properly assess this change? + * Note: make sure to point out any design and architectural decisions that you made and the rationale behind them. + * Note: if you have been working with a specific user and would like them to review your work, make sure you mention them using (@) + * Submit the pull request and iterate with feedback. +3. Merge and Release + * Getting approval: + * You will have to iterate on your changes with feedback from other collaborators to reach a point + where your pull request can be safely merged. + * To avoid too many comments on style and convention, make sure that you have a + look at our style section below before creating a pull request. + * Eventually, someone from the zstd team will approve your pull request and not long after merge it into + the dev branch. + * Housekeeping: + * Most PRs are linked with one or more Github issues. If this is the case for your PR, make sure + the corresponding issue is mentioned. If your change 'fixes' or completely addresses the + issue at hand, then please indicate this by requesting that an issue be closed by commenting. + * Just because your changes have been merged does not mean the topic or larger issue is complete. Remember + that the change must make it to an official zstd release for it to be meaningful. We recommend + that contributers track the activity on their pull request and corresponding issue(s) page(s) until + their change makes it to the next release of zstd. Users will often discover bugs in your code or + suggest ways to refine and improve your initial changes even after the pull request is merged. + +## Static Analysis +Static analysis is a process for examining the correctness or validity of a program without actually +executing it. It usually helps us find many simple bugs. Zstd uses clang's `scan-build` tool for +static analysis. You can install it by following the instructions for your OS on https://clang-analyzer.llvm.org/scan-build. + +Once installed, you can ensure that our static analysis tests pass on your local development machine +by running: +``` +make staticAnalyze +``` + +In general, you can use `scan-build` to static analyze any build script. For example, to static analyze +just `contrib/largeNbDicts` and nothing else, you can run: + +``` +scan-build make -C contrib/largeNbDicts largeNbDicts +``` + +## Performance +Performance is extremely important for zstd and we only merge pull requests whose performance +landscape and corresponding trade-offs have been adequately analyzed, reproduced, and presented. +This high bar for performance means that every PR which has the potential to +impact performance takes a very long time for us to properly review. That being said, we +always welcome contributions to improve performance (or worsen performance for the trade-off of +something else). Please keep the following in mind before submitting a performance related PR: + +1. Zstd isn't as old as gzip but it has been around for time now and its evolution is +very well documented via past Github issues and pull requests. It may be the case that your +particular performance optimization has already been considered in the past. Please take some +time to search through old issues and pull requests using keywords specific to your +would-be PR. Of course, just because a topic has already been discussed (and perhaps rejected +on some grounds) in the past, doesn't mean it isn't worth bringing up again. But even in that case, +it will be helpful for you to have context from that topic's history before contributing. +2. The distinction between noise and actual performance gains can unfortunately be very subtle +especially when microbenchmarking extremely small wins or losses. The only remedy to getting +something subtle merged is extensive benchmarking. You will be doing us a great favor if you +take the time to run extensive, long-duration, and potentially cross-(os, platform, process, etc) +benchmarks on your end before submitting a PR. Of course, you will not be able to benchmark +your changes on every single processor and os out there (and neither will we) but do that best +you can:) We've adding some things to think about when benchmarking below in the Benchmarking +Performance section which might be helpful for you. +3. Optimizing performance for a certain OS, processor vendor, compiler, or network system is a perfectly +legitimate thing to do as long as it does not harm the overall performance health of Zstd. +This is a hard balance to strike but please keep in mind other aspects of Zstd when +submitting changes that are clang-specific, windows-specific, etc. + +## Benchmarking Performance +Performance microbenchmarking is a tricky subject but also essential for Zstd. We value empirical +testing over theoretical speculation. This guide it not perfect but for most scenarios, it +is a good place to start. + +### Stability +Unfortunately, the most important aspect in being able to benchmark reliably is to have a stable +benchmarking machine. A virtual machine, a machine with shared resources, or your laptop +will typically not be stable enough to obtain reliable benchmark results. If you can get your +hands on a desktop, this is usually a better scenario. + +Of course, benchmarking can be done on non-hyper-stable machines as well. You will just have to +do a little more work to ensure that you are in fact measuring the changes you've made not and +noise. Here are some things you can do to make your benchmarks more stable: + +1. The most simple thing you can do to drastically improve the stability of your benchmark is +to run it multiple times and then aggregate the results of those runs. As a general rule of +thumb, the smaller the change you are trying to measure, the more samples of benchmark runs +you will have to aggregate over to get reliable results. Here are some additional things to keep in +mind when running multiple trials: + * How you aggregate your samples are important. You might be tempted to use the mean of your + results. While this is certainly going to be a more stable number than a raw single sample + benchmark number, you might have more luck by taking the median. The mean is not robust to + outliers whereas the median is. Better still, you could simply take the fastest speed your + benchmark achieved on each run since that is likely the fastest your process will be + capable of running your code. In our experience, this (aggregating by just taking the sample + with the fastest running time) has been the most stable approach. + * The more samples you have, the more stable your benchmarks should be. You can verify + your improved stability by looking at the size of your confidence intervals as you + increase your sample count. These should get smaller and smaller. Eventually hopefully + smaller than the performance win you are expecting. + * Most processors will take some time to get `hot` when running anything. The observations + you collect during that time period will very different from the true performance number. Having + a very large number of sample will help alleviate this problem slightly but you can also + address is directly by simply not including the first `n` iterations of your benchmark in + your aggregations. You can determine `n` by simply looking at the results from each iteration + and then hand picking a good threshold after which the variance in results seems to stabilize. +2. You cannot really get reliable benchmarks if your host machine is simultaneously running +another cpu/memory-intensive application in the background. If you are running benchmarks on your +personal laptop for instance, you should close all applications (including your code editor and +browser) before running your benchmarks. You might also have invisible background applications +running. You can see what these are by looking at either Activity Monitor on Mac or Task Manager +on Windows. You will get more stable benchmark results of you end those processes as well. + * If you have multiple cores, you can even run your benchmark on a reserved core to prevent + pollution from other OS and user processes. There are a number of ways to do this depending + on your OS: + * On linux boxes, you have use https://github.com/lpechacek/cpuset. + * On Windows, you can "Set Processor Affinity" using https://www.thewindowsclub.com/processor-affinity-windows + * On Mac, you can try to use their dedicated affinity API https://developer.apple.com/library/archive/releasenotes/Performance/RN-AffinityAPI/#//apple_ref/doc/uid/TP40006635-CH1-DontLinkElementID_2 +3. To benchmark, you will likely end up writing a separate c/c++ program that will link libzstd. +Dynamically linking your library will introduce some added variation (not a large amount but +definitely some). Statically linking libzstd will be more stable. Static libraries should +be enabled by default when building zstd. +4. Use a profiler with a good high resolution timer. See the section below on profiling for +details on this. +5. Disable frequency scaling, turbo boost and address space randomization (this will vary by OS) +6. Try to avoid storage. On some systems you can use tmpfs. Putting the program, inputs and outputs on +tmpfs avoids touching a real storage system, which can have a pretty big variability. + +Also check our LLVM's guide on benchmarking here: https://llvm.org/docs/Benchmarking.html + +### Zstd benchmark +The fastest signal you can get regarding your performance changes is via the in-build zstd cli +bench option. You can run Zstd as you typically would for your scenario using some set of options +and then additionally also specify the `-b#` option. Doing this will run our benchmarking pipeline +for that options you have just provided. If you want to look at the internals of how this +benchmarking script works, you can check out programs/benchzstd.c + +For example: say you have made a change that you believe improves the speed of zstd level 1. The +very first thing you should use to asses whether you actually achieved any sort of improvement +is `zstd -b`. You might try to do something like this. Note: you can use the `-i` option to +specify a running time for your benchmark in seconds (default is 3 seconds). +Usually, the longer the running time, the more stable your results will be. + +``` +$ git checkout +$ make && cp zstd zstd-old +$ git checkout +$ make && cp zstd zstd-new +$ zstd-old -i5 -b1 + 1 : 8990 -> 3992 (2.252), 302.6 MB/s , 626.4 MB/s +$ zstd-new -i5 -b1 + 1 : 8990 -> 3992 (2.252), 302.8 MB/s , 628.4 MB/s +``` + +Unless your performance win is large enough to be visible despite the intrinsic noise +on your computer, benchzstd alone will likely not be enough to validate the impact of your +changes. For example, the results of the example above indicate that effectively nothing +changed but there could be a small <3% improvement that the noise on the host machine +obscured. So unless you see a large performance win (10-15% consistently) using just +this method of evaluation will not be sufficient. + +### Profiling +There are a number of great profilers out there. We're going to briefly mention how you can +profile your code using `instruments` on mac, `perf` on linux and `visual studio profiler` +on windows. + +Say you have an idea for a change that you think will provide some good performance gains +for level 1 compression on Zstd. Typically this means, you have identified a section of +code that you think can be made to run faster. + +The first thing you will want to do is make sure that the piece of code is actually taking up +a notable amount of time to run. It is usually not worth optimzing something which accounts for less than +0.0001% of the total running time. Luckily, there are tools to help with this. +Profilers will let you see how much time your code spends inside a particular function. +If your target code snippit is only part of a function, it might be worth trying to +isolate that snippit by moving it to its own function (this is usually not necessary but +might be). + +Most profilers (including the profilers dicusssed below) will generate a call graph of +functions for you. Your goal will be to find your function of interest in this call grapch +and then inspect the time spent inside of it. You might also want to to look at the +annotated assembly which most profilers will provide you with. + +#### Instruments +We will once again consider the scenario where you think you've identified a piece of code +whose performance can be improved upon. Follow these steps to profile your code using +Instruments. + +1. Open Instruments +2. Select `Time Profiler` from the list of standard templates +3. Close all other applications except for your instruments window and your terminal +4. Run your benchmarking script from your terminal window + * You will want a benchmark that runs for at least a few seconds (5 seconds will + usually be long enough). This way the profiler will have something to work with + and you will have ample time to attach your profiler to this process:) + * I will just use benchzstd as my bencharmking script for this example: +``` +$ zstd -b1 -i5 # this will run for 5 seconds +``` +5. Once you run your benchmarking script, switch back over to instruments and attach your +process to the time profiler. You can do this by: + * Clicking on the `All Processes` drop down in the top left of the toolbar. + * Selecting your process from the dropdown. In my case, it is just going to be labled + `zstd` + * Hitting the bright red record circle button on the top left of the toolbar +6. You profiler will now start collecting metrics from your bencharking script. Once +you think you have collected enough samples (usually this is the case after 3 seconds of +recording), stop your profiler. +7. Make sure that in toolbar of the bottom window, `profile` is selected. +8. You should be able to see your call graph. + * If you don't see the call graph or an incomplete call graph, make sure you have compiled + zstd and your benchmarking scripg using debug flags. On mac and linux, this just means + you will have to supply the `-g` flag alone with your build script. You might also + have to provide the `-fno-omit-frame-pointer` flag +9. Dig down the graph to find your function call and then inspect it by double clicking +the list item. You will be able to see the annotated source code and the assembly side by +side. + +#### Perf + +This wiki has a pretty detailed tutorial on getting started working with perf so we'll +leave you to check that out of you're getting started: + +https://perf.wiki.kernel.org/index.php/Tutorial + +Some general notes on perf: +* Use `perf stat -r # ` to quickly get some relevant timing and +counter statistics. Perf uses a high resolution timer and this is likely one +of the first things your team will run when assessing your PR. +* Perf has a long list of hardware counters that can be viewed with `perf --list`. +When measuring optimizations, something worth trying is to make sure the handware +counters you expect to be impacted by your change are in fact being so. For example, +if you expect the L1 cache misses to decrease with your change, you can look at the +counter `L1-dcache-load-misses` +* Perf hardware counters will not work on a virtual machine. + +#### Visual Studio + +TODO + + +## Setting up continuous integration (CI) on your fork +Zstd uses a number of different continuous integration (CI) tools to ensure that new changes +are well tested before they make it to an official release. Specifically, we use the platforms +travis-ci, circle-ci, and appveyor. + +Changes cannot be merged into the main dev branch unless they pass all of our CI tests. +The easiest way to run these CI tests on your own before submitting a PR to our dev branch +is to configure your personal fork of zstd with each of the CI platforms. Below, you'll find +instructions for doing this. + +### travis-ci +Follow these steps to link travis-ci with your github fork of zstd + +1. Make sure you are logged into your github account +2. Go to https://travis-ci.org/ +3. Click 'Sign in with Github' on the top right +4. Click 'Authorize travis-ci' +5. Click 'Activate all repositories using Github Apps' +6. Select 'Only select repositories' and select your fork of zstd from the drop down +7. Click 'Approve and Install' +8. Click 'Sign in with Github' again. This time, it will be for travis-pro (which will let you view your tests on the web dashboard) +9. Click 'Authorize travis-pro' +10. You should have travis set up on your fork now. + +### circle-ci +TODO + +### appveyor +Follow these steps to link circle-ci with your girhub fork of zstd + +1. Make sure you are logged into your github account +2. Go to https://www.appveyor.com/ +3. Click 'Sign in' on the top right +4. Select 'Github' on the left panel +5. Click 'Authorize appveyor' +6. You might be asked to select which repositories you want to give appveyor permission to. Select your fork of zstd if you're prompted +7. You should have appveyor set up on your fork now. + +### General notes on CI +CI tests run every time a pull request (PR) is created or updated. The exact tests +that get run will depend on the destination branch you specify. Some tests take +longer to run than others. Currently, our CI is set up to run a short +series of tests when creating a PR to the dev branch and a longer series of tests +when creating a PR to the master branch. You can look in the configuration files +of the respective CI platform for more information on what gets run when. + +Most people will just want to create a PR with the destination set to their local dev +branch of zstd. You can then find the status of the tests on the PR's page. You can also +re-run tests and cancel running tests from the PR page or from the respective CI's dashboard. + ## Issues We use GitHub issues to track public bugs. Please ensure your description is clear and has sufficient instructions to be able to reproduce the issue. @@ -34,7 +384,7 @@ Facebook has a [bounty program](https://www.facebook.c disclosure of security bugs. In those cases, please go through the process outlined on that page and do not file a public issue. -## Coding Style +## Coding Style * 4 spaces for indentation rather than tabs ## License Modified: vendor/zstd/dist/Makefile ============================================================================== --- vendor/zstd/dist/Makefile Sat May 23 19:52:20 2020 (r361422) +++ vendor/zstd/dist/Makefile Sat May 23 20:37:33 2020 (r361423) @@ -1,10 +1,11 @@ # ################################################################ -# Copyright (c) 2015-present, Yann Collet, Facebook, Inc. +# Copyright (c) 2015-2020, Yann Collet, Facebook, Inc. # All rights reserved. # # This source code is licensed under both the BSD-style license (found in the # LICENSE file in the root directory of this source tree) and the GPLv2 (found # in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. # ################################################################ PRGDIR = programs @@ -17,7 +18,16 @@ FUZZDIR = $(TESTDIR)/fuzz # Define nul output VOID = /dev/null -ifneq (,$(filter Windows%,$(OS))) +# When cross-compiling from linux to windows, you might +# need to specify this as "Windows." Fedora build fails +# without it. +# +# Note: mingw-w64 build from linux to windows does not +# fail on other tested distros (ubuntu, debian) even +# without manually specifying the TARGET_SYSTEM. +TARGET_SYSTEM ?= $(OS) + +ifneq (,$(filter Windows%,$(TARGET_SYSTEM))) EXT =.exe else EXT = @@ -35,7 +45,7 @@ allmost: allzstd zlibwrapper # skip zwrapper, can't build that on alternate architectures without the proper zlib installed .PHONY: allzstd -allzstd: lib +allzstd: lib-all $(MAKE) -C $(PRGDIR) all $(MAKE) -C $(TESTDIR) all @@ -45,7 +55,7 @@ all32: $(MAKE) -C $(TESTDIR) all32 .PHONY: lib lib-release libzstd.a -lib lib-release : +lib lib-release lib-all : @$(MAKE) -C $(ZSTDDIR) $@ .PHONY: zstd zstd-release @@ -80,6 +90,13 @@ shortest: .PHONY: check check: shortest +.PHONY: automated_benchmarking +automated_benchmarking: + $(MAKE) -C $(TESTDIR) $@ + +.PHONY: benchmarking +benchmarking: automated_benchmarking + ## examples: build all examples in `/examples` directory .PHONY: examples examples: lib @@ -101,7 +118,8 @@ contrib: lib $(MAKE) -C contrib/pzstd all $(MAKE) -C contrib/seekable_format/examples all $(MAKE) -C contrib/largeNbDicts all - cd contrib/single_file_decoder/ ; ./build_test.sh + cd contrib/single_file_libs/ ; ./build_decoder_test.sh + cd contrib/single_file_libs/ ; ./build_library_test.sh .PHONY: cleanTabs cleanTabs: @@ -337,7 +355,7 @@ endif ifneq (,$(filter MSYS%,$(shell uname))) HOST_OS = MSYS -CMAKE_PARAMS = -G"MSYS Makefiles" -DZSTD_MULTITHREAD_SUPPORT:BOOL=OFF -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON +CMAKE_PARAMS = -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug -DZSTD_MULTITHREAD_SUPPORT:BOOL=OFF -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON endif @@ -349,11 +367,15 @@ cmakebuild: cmake --version $(RM) -r $(BUILDIR)/cmake/build mkdir $(BUILDIR)/cmake/build - cd $(BUILDIR)/cmake/build ; cmake -DCMAKE_INSTALL_PREFIX:PATH=~/install_test_dir $(CMAKE_PARAMS) .. ; $(MAKE) install ; $(MAKE) uninstall + cd $(BUILDIR)/cmake/build; cmake -DCMAKE_INSTALL_PREFIX:PATH=~/install_test_dir $(CMAKE_PARAMS) .. + $(MAKE) -C $(BUILDIR)/cmake/build -j4; + $(MAKE) -C $(BUILDIR)/cmake/build install; + $(MAKE) -C $(BUILDIR)/cmake/build uninstall; + cd $(BUILDIR)/cmake/build; ctest -V -L Medium -c90build: clean +c89build: clean $(CC) -v - CFLAGS="-std=c90 -Werror" $(MAKE) allmost # will fail, due to missing support for `long long` + CFLAGS="-std=c89 -Werror" $(MAKE) allmost # will fail, due to missing support for `long long` gnu90build: clean $(CC) -v Modified: vendor/zstd/dist/README.md ============================================================================== --- vendor/zstd/dist/README.md Sat May 23 19:52:20 2020 (r361422) +++ vendor/zstd/dist/README.md Sat May 23 20:37:33 2020 (r361423) @@ -31,10 +31,10 @@ a list of known ports and bindings is provided on [Zst ## Benchmarks For reference, several fast compression algorithms were tested and compared -on a server running Arch Linux (`Linux version 5.0.5-arch1-1`), +on a server running Arch Linux (`Linux version 5.5.11-arch1-1`), with a Core i9-9900K CPU @ 5.0GHz, using [lzbench], an open-source in-memory benchmark by @inikep -compiled with [gcc] 8.2.1, +compiled with [gcc] 9.3.0, on the [Silesia compression corpus]. [lzbench]: https://github.com/inikep/lzbench @@ -43,18 +43,26 @@ on the [Silesia compression corpus]. | Compressor name | Ratio | Compression| Decompress.| | --------------- | ------| -----------| ---------- | -| **zstd 1.4.0 -1** | 2.884 | 530 MB/s | 1360 MB/s | -| zlib 1.2.11 -1 | 2.743 | 110 MB/s | 440 MB/s | -| brotli 1.0.7 -0 | 2.701 | 430 MB/s | 470 MB/s | -| quicklz 1.5.0 -1 | 2.238 | 600 MB/s | 800 MB/s | -| lzo1x 2.09 -1 | 2.106 | 680 MB/s | 950 MB/s | -| lz4 1.8.3 | 2.101 | 800 MB/s | 4220 MB/s | -| snappy 1.1.4 | 2.073 | 580 MB/s | 2020 MB/s | -| lzf 3.6 -1 | 2.077 | 440 MB/s | 930 MB/s | +| **zstd 1.4.5 -1** | 2.884 | 500 MB/s | 1660 MB/s | +| zlib 1.2.11 -1 | 2.743 | 90 MB/s | 400 MB/s | +| brotli 1.0.7 -0 | 2.703 | 400 MB/s | 450 MB/s | +| **zstd 1.4.5 --fast=1** | 2.434 | 570 MB/s | 2200 MB/s | +| **zstd 1.4.5 --fast=3** | 2.312 | 640 MB/s | 2300 MB/s | +| quicklz 1.5.0 -1 | 2.238 | 560 MB/s | 710 MB/s | +| **zstd 1.4.5 --fast=5** | 2.178 | 700 MB/s | 2420 MB/s | +| lzo1x 2.10 -1 | 2.106 | 690 MB/s | 820 MB/s | +| lz4 1.9.2 | 2.101 | 740 MB/s | 4530 MB/s | +| **zstd 1.4.5 --fast=7** | 2.096 | 750 MB/s | 2480 MB/s | +| lzf 3.6 -1 | 2.077 | 410 MB/s | 860 MB/s | +| snappy 1.1.8 | 2.073 | 560 MB/s | 1790 MB/s | [zlib]: http://www.zlib.net/ [LZ4]: http://www.lz4.org/ +The negative compression levels, specified with `--fast=#`, +offer faster compression and decompression speed in exchange for some loss in +compression ratio compared to level 1, as seen in the table above. + Zstd can also offer stronger compression ratios at the cost of compression speed. Speed vs Compression trade-off is configurable by small increments. Decompression speed is preserved and remains roughly the same at all settings, @@ -142,6 +150,18 @@ You can also take a look at [`.travis.yml`](.travis.ym example about how Meson is used to build this project. Note that default build type is **release**. + +### VCPKG +You can build and install zstd [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager: + + git clone https://github.com/Microsoft/vcpkg.git + cd vcpkg + ./bootstrap-vcpkg.sh + ./vcpkg integrate install + ./vcpkg install zstd + +The zstd port in vcpkg is kept up to date by Microsoft team members and community contributors. +If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. ### Visual Studio (Windows) Modified: vendor/zstd/dist/TESTING.md ============================================================================== --- vendor/zstd/dist/TESTING.md Sat May 23 19:52:20 2020 (r361422) +++ vendor/zstd/dist/TESTING.md Sat May 23 20:37:33 2020 (r361423) @@ -11,7 +11,7 @@ They consist of the following tests: - Compilation on all supported targets (x86, x86_64, ARM, AArch64, PowerPC, and PowerPC64) - Compilation on various versions of gcc, clang, and g++ - `tests/playTests.sh` on x86_64, without the tests on long data (CLI tests) -- Small tests (`tests/legacy.c`, `tests/longmatch.c`, `tests/symbols.c`) on x64_64 +- Small tests (`tests/legacy.c`, `tests/longmatch.c`) on x64_64 Medium Tests ------------ @@ -19,7 +19,7 @@ Medium tests run on every commit and pull request to ` They consist of the following tests: - The following tests run with UBsan and Asan on x86_64 and x86, as well as with Msan on x86_64 - - `tests/playTests.sh --test-long-data` + - `tests/playTests.sh --test-large-data` - Fuzzer tests: `tests/fuzzer.c`, `tests/zstreamtest.c`, and `tests/decodecorpus.c` - `tests/zstreamtest.c` under Tsan (streaming mode, including multithreaded mode) - Valgrind Test (`make -C tests valgrindTest`) (testing CLI and fuzzer under valgrind) Modified: vendor/zstd/dist/appveyor.yml ============================================================================== --- vendor/zstd/dist/appveyor.yml Sat May 23 19:52:20 2020 (r361422) +++ vendor/zstd/dist/appveyor.yml Sat May 23 20:37:33 2020 (r361423) @@ -14,7 +14,7 @@ - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x64" - SCRIPT: "make allzstd MOREFLAGS=-static && make -C tests test-symbols fullbench-lib" + SCRIPT: "make allzstd MOREFLAGS=-static && make -C tests fullbench-lib" ARTIFACT: "true" BUILD: "true" - COMPILER: "gcc" @@ -169,7 +169,8 @@ - SET "FUZZERTEST=-T30s" - if [%HOST%]==[visual] if [%CONFIGURATION%]==[Release] ( CD tests && - SET ZSTD=./zstd.exe && + SET ZSTD_BIN=./zstd.exe&& + SET DATAGEN_BIN=./datagen.exe&& sh -e playTests.sh --test-large-data && fullbench.exe -i1 && fullbench.exe -i1 -P0 && @@ -188,6 +189,9 @@ environment: matrix: - COMPILER: "gcc" + HOST: "cygwin" + PLATFORM: "x64" + - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x64" SCRIPT: "CPPFLAGS=-DDEBUGLEVEL=2 CFLAGS=-Werror make -j allzstd DEBUGLEVEL=2" @@ -220,6 +224,14 @@ install: - ECHO Installing %COMPILER% %PLATFORM% %CONFIGURATION% - SET PATH_ORIGINAL=%PATH% + - if [%HOST%]==[cygwin] ( + ECHO Installing Cygwin Packages && + C:\cygwin64\setup-x86_64.exe -qnNdO -R "C:\cygwin64" -g -P ^ + gcc-g++,^ + gcc,^ + cmake,^ + make + ) - if [%HOST%]==[mingw] ( SET "PATH_MINGW32=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin" && SET "PATH_MINGW64=C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin" && @@ -232,6 +244,17 @@ build_script: - ECHO Building %COMPILER% %PLATFORM% %CONFIGURATION% + - if [%HOST%]==[cygwin] ( + set CHERE_INVOKING=yes && + set CC=%COMPILER% && + C:\cygwin64\bin\bash --login -c " + set -e; + cd build/cmake; + CFLAGS='-Werror' cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Debug -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_FUZZER_FLAGS=-T30s -DZSTD_ZSTREAM_FLAGS=-T30s .; + make -j4; + ctest -V -L Medium; + " + ) - if [%HOST%]==[mingw] ( ( if [%PLATFORM%]==[x64] ( SET "PATH=%PATH_MINGW64%;%PATH_ORIGINAL%" Modified: vendor/zstd/dist/doc/educational_decoder/Makefile ============================================================================== --- vendor/zstd/dist/doc/educational_decoder/Makefile Sat May 23 19:52:20 2020 (r361422) +++ vendor/zstd/dist/doc/educational_decoder/Makefile Sat May 23 20:37:33 2020 (r361423) @@ -1,10 +1,11 @@ # ################################################################ -# Copyright (c) 2016-present, Yann Collet, Facebook, Inc. +# Copyright (c) 2016-2020, Yann Collet, Facebook, Inc. # All rights reserved. # # This source code is licensed under both the BSD-style license (found in the # LICENSE file in the root directory of this source tree) and the GPLv2 (found # in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. # ################################################################ ZSTD ?= zstd # note: requires zstd installation on local system @@ -36,7 +37,7 @@ harness: $(HARNESS_FILES) $(CC) $(FLAGS) $^ -o $@ clean: - @$(RM) harness + @$(RM) harness *.o @$(RM) -rf harness.dSYM # MacOS specific test: harness @@ -59,4 +60,3 @@ test: harness @./harness tmp.zst tmp dictionary @$(DIFF) -s tmp README.md @$(RM) tmp* dictionary - @$(MAKE) clean Modified: vendor/zstd/dist/doc/educational_decoder/README.md ============================================================================== --- vendor/zstd/dist/doc/educational_decoder/README.md Sat May 23 19:52:20 2020 (r361422) +++ vendor/zstd/dist/doc/educational_decoder/README.md Sat May 23 20:37:33 2020 (r361423) @@ -13,6 +13,13 @@ It also contains implementations of Huffman and FSE ta [Zstandard format specification]: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md [format specification]: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md +While the library's primary objective is code clarity, +it also happens to compile into a small object file. +The object file can be made even smaller by removing error messages, +using the macro directive `ZDEC_NO_MESSAGE` at compilation time. +This can be reduced even further by foregoing dictionary support, +by defining `ZDEC_NO_DICTIONARY`. + `harness.c` provides a simple test harness around the decoder: harness [dictionary] Modified: vendor/zstd/dist/doc/educational_decoder/harness.c ============================================================================== --- vendor/zstd/dist/doc/educational_decoder/harness.c Sat May 23 19:52:20 2020 (r361422) +++ vendor/zstd/dist/doc/educational_decoder/harness.c Sat May 23 20:37:33 2020 (r361423) @@ -1,10 +1,11 @@ /* - * Copyright (c) 2017-present, Facebook, Inc. + * Copyright (c) 2017-2020, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ #include @@ -21,108 +22,98 @@ typedef unsigned char u8; // Protect against allocating too much memory for output #define MAX_OUTPUT_SIZE ((size_t)1024 * 1024 * 1024) -static size_t read_file(const char *path, u8 **ptr) +// Error message then exit +#define ERR_OUT(...) { fprintf(stderr, __VA_ARGS__); exit(1); } + + +typedef struct { + u8* address; + size_t size; +} buffer_s; + +static void freeBuffer(buffer_s b) { free(b.address); } + +static buffer_s read_file(const char *path) { FILE* const f = fopen(path, "rb"); - if (!f) { - fprintf(stderr, "failed to open file %s \n", path); - exit(1); - } + if (!f) ERR_OUT("failed to open file %s \n", path); fseek(f, 0L, SEEK_END); size_t const size = (size_t)ftell(f); rewind(f); - *ptr = malloc(size); - if (!ptr) { - fprintf(stderr, "failed to allocate memory to hold %s \n", path); - exit(1); - } + void* const ptr = malloc(size); + if (!ptr) ERR_OUT("failed to allocate memory to hold %s \n", path); - size_t const read = fread(*ptr, 1, size, f); - if (read != size) { /* must read everything in one pass */ - fprintf(stderr, "error while reading file %s \n", path); - exit(1); - } + size_t const read = fread(ptr, 1, size, f); + if (read != size) ERR_OUT("error while reading file %s \n", path); fclose(f); - - return read; + buffer_s const b = { ptr, size }; + return b; } -static void write_file(const char *path, const u8 *ptr, size_t size) +static void write_file(const char* path, const u8* ptr, size_t size) { FILE* const f = fopen(path, "wb"); - if (!f) { - fprintf(stderr, "failed to open file %s \n", path); - exit(1); - } + if (!f) ERR_OUT("failed to open file %s \n", path); size_t written = 0; while (written < size) { written += fwrite(ptr+written, 1, size, f); - if (ferror(f)) { - fprintf(stderr, "error while writing file %s\n", path); - exit(1); - } } + if (ferror(f)) ERR_OUT("error while writing file %s\n", path); + } fclose(f); } int main(int argc, char **argv) { - if (argc < 3) { - fprintf(stderr, "usage: %s [dictionary] \n", - argv[0]); + if (argc < 3) + ERR_OUT("usage: %s [dictionary] \n", argv[0]); - return 1; - } + buffer_s const input = read_file(argv[1]); - u8* input; - size_t const input_size = read_file(argv[1], &input); - - u8* dict = NULL; - size_t dict_size = 0; + buffer_s dict = { NULL, 0 }; if (argc >= 4) { - dict_size = read_file(argv[3], &dict); + dict = read_file(argv[3]); } - size_t out_capacity = ZSTD_get_decompressed_size(input, input_size); + size_t out_capacity = ZSTD_get_decompressed_size(input.address, input.size); if (out_capacity == (size_t)-1) { - out_capacity = MAX_COMPRESSION_RATIO * input_size; + out_capacity = MAX_COMPRESSION_RATIO * input.size; fprintf(stderr, "WARNING: Compressed data does not contain " "decompressed size, going to assume the compression " "ratio is at most %d (decompressed size of at most " "%u) \n", MAX_COMPRESSION_RATIO, (unsigned)out_capacity); } - if (out_capacity > MAX_OUTPUT_SIZE) { - fprintf(stderr, - "Required output size too large for this implementation \n"); - return 1; - } + if (out_capacity > MAX_OUTPUT_SIZE) + ERR_OUT("Required output size too large for this implementation \n"); u8* const output = malloc(out_capacity); - if (!output) { - fprintf(stderr, "failed to allocate memory \n"); - return 1; - } + if (!output) ERR_OUT("failed to allocate memory \n"); dictionary_t* const parsed_dict = create_dictionary(); - if (dict) { - parse_dictionary(parsed_dict, dict, dict_size); + if (dict.size) { +#if defined (ZDEC_NO_DICTIONARY) + printf("dict.size = %zu \n", dict.size); + ERR_OUT("no dictionary support \n"); +#else + parse_dictionary(parsed_dict, dict.address, dict.size); +#endif } size_t const decompressed_size = ZSTD_decompress_with_dict(output, out_capacity, - input, input_size, + input.address, input.size, parsed_dict); free_dictionary(parsed_dict); write_file(argv[2], output, decompressed_size); - free(input); + freeBuffer(input); + freeBuffer(dict); free(output); - free(dict); return 0; } Modified: vendor/zstd/dist/doc/educational_decoder/zstd_decompress.c ============================================================================== --- vendor/zstd/dist/doc/educational_decoder/zstd_decompress.c Sat May 23 19:52:20 2020 (r361422) +++ vendor/zstd/dist/doc/educational_decoder/zstd_decompress.c Sat May 23 20:37:33 2020 (r361423) @@ -1,34 +1,52 @@ /* - * Copyright (c) 2017-present, Facebook, Inc. + * Copyright (c) 2017-2020, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ /// Zstandard educational decoder implementation /// See https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md -#include -#include -#include -#include +#include // uint8_t, etc. +#include // malloc, free, exit +#include // fprintf +#include // memset, memcpy #include "zstd_decompress.h" -/******* UTILITY MACROS AND TYPES *********************************************/ -// Max block size decompressed size is 128 KB and literal blocks can't be -// larger than their block -#define MAX_LITERALS_SIZE ((size_t)128 * 1024) +/******* IMPORTANT CONSTANTS *********************************************/ + +// Zstandard frame +// "Magic_Number +// 4 Bytes, little-endian format. Value : 0xFD2FB528" +#define ZSTD_MAGIC_NUMBER 0xFD2FB528U + +// The size of `Block_Content` is limited by `Block_Maximum_Size`, +#define ZSTD_BLOCK_SIZE_MAX ((size_t)128 * 1024) + +// literal blocks can't be larger than their block +#define MAX_LITERALS_SIZE ZSTD_BLOCK_SIZE_MAX + + +/******* UTILITY MACROS AND TYPES *********************************************/ #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) +#if defined(ZDEC_NO_MESSAGE) +#define MESSAGE(...) +#else +#define MESSAGE(...) fprintf(stderr, "" __VA_ARGS__) +#endif + /// This decoder calls exit(1) when it encounters an error, however a production /// library should propagate error codes #define ERROR(s) \ do { \ - fprintf(stderr, "Error: %s\n", s); \ + MESSAGE("Error: %s\n", s); \ exit(1); \ } while (0) #define INP_SIZE() \ @@ -39,12 +57,12 @@ #define BAD_ALLOC() ERROR("Memory allocation error") #define IMPOSSIBLE() ERROR("An impossibility has occurred") -typedef uint8_t u8; +typedef uint8_t u8; typedef uint16_t u16; typedef uint32_t u32; typedef uint64_t u64; -typedef int8_t i8; +typedef int8_t i8; typedef int16_t i16; typedef int32_t i32; typedef int64_t i64; @@ -176,10 +194,6 @@ static void HUF_init_dtable_usingweights(HUF_dtable *c /// Free the malloc'ed parts of a decoding table static void HUF_free_dtable(HUF_dtable *const dtable); - -/// Deep copy a decoding table, so that it can be used and free'd without -/// impacting the source table. -static void HUF_copy_dtable(HUF_dtable *const dst, const HUF_dtable *const src); /*** END HUFFMAN PRIMITIVES ***********/ /*** FSE PRIMITIVES *******************/ @@ -241,10 +255,6 @@ static void FSE_init_dtable_rle(FSE_dtable *const dtab /// Free the malloc'ed parts of a decoding table static void FSE_free_dtable(FSE_dtable *const dtable); - -/// Deep copy a decoding table, so that it can be used and free'd without -/// impacting the source table. -static void FSE_copy_dtable(FSE_dtable *const dst, const FSE_dtable *const src); /*** END FSE PRIMITIVES ***************/ /******* END IMPLEMENTATION PRIMITIVE PROTOTYPES ******************************/ @@ -373,7 +383,7 @@ static void execute_match_copy(frame_context_t *const size_t ZSTD_decompress(void *const dst, const size_t dst_len, const void *const src, const size_t src_len) { - dictionary_t* uninit_dict = create_dictionary(); + dictionary_t* const uninit_dict = create_dictionary(); size_t const decomp_size = ZSTD_decompress_with_dict(dst, dst_len, src, src_len, uninit_dict); free_dictionary(uninit_dict); @@ -417,12 +427,7 @@ static void decompress_data(frame_context_t *const ctx static void decode_frame(ostream_t *const out, istream_t *const in, const dictionary_t *const dict) { const u32 magic_number = (u32)IO_read_bits(in, 32); - // Zstandard frame - // - // "Magic_Number - // - // 4 Bytes, little-endian format. Value : 0xFD2FB528" - if (magic_number == 0xFD2FB528U) { + if (magic_number == ZSTD_MAGIC_NUMBER) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat May 23 20:38: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 59CB22DD632; Sat, 23 May 2020 20:38:31 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TwDR22K3z4d66; Sat, 23 May 2020 20:38:31 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 407DC15BAC; Sat, 23 May 2020 20:38:31 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NKcVcF046928; Sat, 23 May 2020 20:38:31 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NKcUtR046923; Sat, 23 May 2020 20:38:30 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005232038.04NKcUtR046923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 23 May 2020 20:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r361424 - in vendor/zstd/1.4.5: . contrib contrib/docker contrib/experimental_dict_builders/benchmarkDictBuilder contrib/experimental_dict_builders/fastCover contrib/experimental_dict_b... X-SVN-Group: vendor X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in vendor/zstd/1.4.5: . contrib contrib/docker contrib/experimental_dict_builders/benchmarkDictBuilder contrib/experimental_dict_builders/fastCover contrib/experimental_dict_builders/randomDictBuilder... X-SVN-Commit-Revision: 361424 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, 23 May 2020 20:38:31 -0000 Author: cem Date: Sat May 23 20:38:30 2020 New Revision: 361424 URL: https://svnweb.freebsd.org/changeset/base/361424 Log: Tag Zstd 1.4.5 Added: vendor/zstd/1.4.5/ - copied from r361422, vendor/zstd/dist/ vendor/zstd/1.4.5/lib/compress/zstd_compress_superblock.c - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstd_compress_superblock.c vendor/zstd/1.4.5/lib/compress/zstd_compress_superblock.h - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstd_compress_superblock.h Replaced: vendor/zstd/1.4.5/CHANGELOG - copied unchanged from r361423, vendor/zstd/dist/CHANGELOG vendor/zstd/1.4.5/CONTRIBUTING.md - copied unchanged from r361423, vendor/zstd/dist/CONTRIBUTING.md vendor/zstd/1.4.5/Makefile - copied unchanged from r361423, vendor/zstd/dist/Makefile vendor/zstd/1.4.5/README.md - copied unchanged from r361423, vendor/zstd/dist/README.md vendor/zstd/1.4.5/TESTING.md - copied unchanged from r361423, vendor/zstd/dist/TESTING.md vendor/zstd/1.4.5/appveyor.yml - copied unchanged from r361423, vendor/zstd/dist/appveyor.yml vendor/zstd/1.4.5/doc/educational_decoder/Makefile - copied unchanged from r361423, vendor/zstd/dist/doc/educational_decoder/Makefile vendor/zstd/1.4.5/doc/educational_decoder/README.md - copied unchanged from r361423, vendor/zstd/dist/doc/educational_decoder/README.md vendor/zstd/1.4.5/doc/educational_decoder/harness.c - copied unchanged from r361423, vendor/zstd/dist/doc/educational_decoder/harness.c vendor/zstd/1.4.5/doc/educational_decoder/zstd_decompress.c - copied unchanged from r361423, vendor/zstd/dist/doc/educational_decoder/zstd_decompress.c vendor/zstd/1.4.5/doc/educational_decoder/zstd_decompress.h - copied unchanged from r361423, vendor/zstd/dist/doc/educational_decoder/zstd_decompress.h vendor/zstd/1.4.5/doc/zstd_compression_format.md - copied unchanged from r361423, vendor/zstd/dist/doc/zstd_compression_format.md vendor/zstd/1.4.5/doc/zstd_manual.html - copied unchanged from r361423, vendor/zstd/dist/doc/zstd_manual.html vendor/zstd/1.4.5/examples/Makefile - copied unchanged from r361423, vendor/zstd/dist/examples/Makefile vendor/zstd/1.4.5/examples/common.h - copied unchanged from r361423, vendor/zstd/dist/examples/common.h vendor/zstd/1.4.5/examples/dictionary_compression.c - copied unchanged from r361423, vendor/zstd/dist/examples/dictionary_compression.c vendor/zstd/1.4.5/examples/dictionary_decompression.c - copied unchanged from r361423, vendor/zstd/dist/examples/dictionary_decompression.c vendor/zstd/1.4.5/examples/multiple_simple_compression.c - copied unchanged from r361423, vendor/zstd/dist/examples/multiple_simple_compression.c vendor/zstd/1.4.5/examples/multiple_streaming_compression.c - copied unchanged from r361423, vendor/zstd/dist/examples/multiple_streaming_compression.c vendor/zstd/1.4.5/examples/simple_compression.c - copied unchanged from r361423, vendor/zstd/dist/examples/simple_compression.c vendor/zstd/1.4.5/examples/simple_decompression.c - copied unchanged from r361423, vendor/zstd/dist/examples/simple_decompression.c vendor/zstd/1.4.5/examples/streaming_compression.c - copied unchanged from r361423, vendor/zstd/dist/examples/streaming_compression.c vendor/zstd/1.4.5/examples/streaming_decompression.c - copied unchanged from r361423, vendor/zstd/dist/examples/streaming_decompression.c vendor/zstd/1.4.5/examples/streaming_memory_usage.c - copied unchanged from r361423, vendor/zstd/dist/examples/streaming_memory_usage.c vendor/zstd/1.4.5/lib/Makefile - copied unchanged from r361423, vendor/zstd/dist/lib/Makefile vendor/zstd/1.4.5/lib/README.md - copied unchanged from r361423, vendor/zstd/dist/lib/README.md vendor/zstd/1.4.5/lib/common/bitstream.h - copied unchanged from r361423, vendor/zstd/dist/lib/common/bitstream.h vendor/zstd/1.4.5/lib/common/compiler.h - copied unchanged from r361423, vendor/zstd/dist/lib/common/compiler.h vendor/zstd/1.4.5/lib/common/cpu.h - copied unchanged from r361423, vendor/zstd/dist/lib/common/cpu.h vendor/zstd/1.4.5/lib/common/debug.c - copied unchanged from r361423, vendor/zstd/dist/lib/common/debug.c vendor/zstd/1.4.5/lib/common/debug.h - copied unchanged from r361423, vendor/zstd/dist/lib/common/debug.h vendor/zstd/1.4.5/lib/common/entropy_common.c - copied unchanged from r361423, vendor/zstd/dist/lib/common/entropy_common.c vendor/zstd/1.4.5/lib/common/error_private.c - copied unchanged from r361423, vendor/zstd/dist/lib/common/error_private.c vendor/zstd/1.4.5/lib/common/error_private.h - copied unchanged from r361423, vendor/zstd/dist/lib/common/error_private.h vendor/zstd/1.4.5/lib/common/fse.h - copied unchanged from r361423, vendor/zstd/dist/lib/common/fse.h vendor/zstd/1.4.5/lib/common/fse_decompress.c - copied unchanged from r361423, vendor/zstd/dist/lib/common/fse_decompress.c vendor/zstd/1.4.5/lib/common/huf.h - copied unchanged from r361423, vendor/zstd/dist/lib/common/huf.h vendor/zstd/1.4.5/lib/common/mem.h - copied unchanged from r361423, vendor/zstd/dist/lib/common/mem.h vendor/zstd/1.4.5/lib/common/pool.c - copied unchanged from r361423, vendor/zstd/dist/lib/common/pool.c vendor/zstd/1.4.5/lib/common/pool.h - copied unchanged from r361423, vendor/zstd/dist/lib/common/pool.h vendor/zstd/1.4.5/lib/common/threading.c - copied unchanged from r361423, vendor/zstd/dist/lib/common/threading.c vendor/zstd/1.4.5/lib/common/threading.h - copied unchanged from r361423, vendor/zstd/dist/lib/common/threading.h vendor/zstd/1.4.5/lib/common/xxhash.c - copied unchanged from r361423, vendor/zstd/dist/lib/common/xxhash.c vendor/zstd/1.4.5/lib/common/xxhash.h - copied unchanged from r361423, vendor/zstd/dist/lib/common/xxhash.h vendor/zstd/1.4.5/lib/common/zstd_common.c - copied unchanged from r361423, vendor/zstd/dist/lib/common/zstd_common.c vendor/zstd/1.4.5/lib/common/zstd_errors.h - copied unchanged from r361423, vendor/zstd/dist/lib/common/zstd_errors.h vendor/zstd/1.4.5/lib/common/zstd_internal.h - copied unchanged from r361423, vendor/zstd/dist/lib/common/zstd_internal.h vendor/zstd/1.4.5/lib/compress/fse_compress.c - copied unchanged from r361423, vendor/zstd/dist/lib/compress/fse_compress.c vendor/zstd/1.4.5/lib/compress/hist.c - copied unchanged from r361423, vendor/zstd/dist/lib/compress/hist.c vendor/zstd/1.4.5/lib/compress/hist.h - copied unchanged from r361423, vendor/zstd/dist/lib/compress/hist.h vendor/zstd/1.4.5/lib/compress/huf_compress.c - copied unchanged from r361423, vendor/zstd/dist/lib/compress/huf_compress.c vendor/zstd/1.4.5/lib/compress/zstd_compress.c - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstd_compress.c vendor/zstd/1.4.5/lib/compress/zstd_compress_internal.h - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstd_compress_internal.h vendor/zstd/1.4.5/lib/compress/zstd_compress_literals.c - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstd_compress_literals.c vendor/zstd/1.4.5/lib/compress/zstd_compress_literals.h - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstd_compress_literals.h vendor/zstd/1.4.5/lib/compress/zstd_compress_sequences.c - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstd_compress_sequences.c vendor/zstd/1.4.5/lib/compress/zstd_compress_sequences.h - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstd_compress_sequences.h vendor/zstd/1.4.5/lib/compress/zstd_cwksp.h - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstd_cwksp.h vendor/zstd/1.4.5/lib/compress/zstd_double_fast.c - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstd_double_fast.c vendor/zstd/1.4.5/lib/compress/zstd_double_fast.h - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstd_double_fast.h vendor/zstd/1.4.5/lib/compress/zstd_fast.c - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstd_fast.c vendor/zstd/1.4.5/lib/compress/zstd_fast.h - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstd_fast.h vendor/zstd/1.4.5/lib/compress/zstd_lazy.c - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstd_lazy.c vendor/zstd/1.4.5/lib/compress/zstd_lazy.h - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstd_lazy.h vendor/zstd/1.4.5/lib/compress/zstd_ldm.c - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstd_ldm.c vendor/zstd/1.4.5/lib/compress/zstd_ldm.h - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstd_ldm.h vendor/zstd/1.4.5/lib/compress/zstd_opt.c - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstd_opt.c vendor/zstd/1.4.5/lib/compress/zstd_opt.h - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstd_opt.h vendor/zstd/1.4.5/lib/compress/zstdmt_compress.c - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstdmt_compress.c vendor/zstd/1.4.5/lib/compress/zstdmt_compress.h - copied unchanged from r361423, vendor/zstd/dist/lib/compress/zstdmt_compress.h vendor/zstd/1.4.5/lib/decompress/huf_decompress.c - copied unchanged from r361423, vendor/zstd/dist/lib/decompress/huf_decompress.c vendor/zstd/1.4.5/lib/decompress/zstd_ddict.c - copied unchanged from r361423, vendor/zstd/dist/lib/decompress/zstd_ddict.c vendor/zstd/1.4.5/lib/decompress/zstd_ddict.h - copied unchanged from r361423, vendor/zstd/dist/lib/decompress/zstd_ddict.h vendor/zstd/1.4.5/lib/decompress/zstd_decompress.c - copied unchanged from r361423, vendor/zstd/dist/lib/decompress/zstd_decompress.c vendor/zstd/1.4.5/lib/decompress/zstd_decompress_block.c - copied unchanged from r361423, vendor/zstd/dist/lib/decompress/zstd_decompress_block.c vendor/zstd/1.4.5/lib/decompress/zstd_decompress_block.h - copied unchanged from r361423, vendor/zstd/dist/lib/decompress/zstd_decompress_block.h vendor/zstd/1.4.5/lib/decompress/zstd_decompress_internal.h - copied unchanged from r361423, vendor/zstd/dist/lib/decompress/zstd_decompress_internal.h vendor/zstd/1.4.5/lib/deprecated/zbuff.h - copied unchanged from r361423, vendor/zstd/dist/lib/deprecated/zbuff.h vendor/zstd/1.4.5/lib/deprecated/zbuff_common.c - copied unchanged from r361423, vendor/zstd/dist/lib/deprecated/zbuff_common.c vendor/zstd/1.4.5/lib/deprecated/zbuff_compress.c - copied unchanged from r361423, vendor/zstd/dist/lib/deprecated/zbuff_compress.c vendor/zstd/1.4.5/lib/deprecated/zbuff_decompress.c - copied unchanged from r361423, vendor/zstd/dist/lib/deprecated/zbuff_decompress.c vendor/zstd/1.4.5/lib/dictBuilder/cover.c - copied unchanged from r361423, vendor/zstd/dist/lib/dictBuilder/cover.c vendor/zstd/1.4.5/lib/dictBuilder/cover.h - copied unchanged from r361423, vendor/zstd/dist/lib/dictBuilder/cover.h vendor/zstd/1.4.5/lib/dictBuilder/fastcover.c - copied unchanged from r361423, vendor/zstd/dist/lib/dictBuilder/fastcover.c vendor/zstd/1.4.5/lib/dictBuilder/zdict.c - copied unchanged from r361423, vendor/zstd/dist/lib/dictBuilder/zdict.c vendor/zstd/1.4.5/lib/dictBuilder/zdict.h - copied unchanged from r361423, vendor/zstd/dist/lib/dictBuilder/zdict.h vendor/zstd/1.4.5/lib/legacy/zstd_legacy.h - copied unchanged from r361423, vendor/zstd/dist/lib/legacy/zstd_legacy.h vendor/zstd/1.4.5/lib/legacy/zstd_v01.c - copied unchanged from r361423, vendor/zstd/dist/lib/legacy/zstd_v01.c vendor/zstd/1.4.5/lib/legacy/zstd_v01.h - copied unchanged from r361423, vendor/zstd/dist/lib/legacy/zstd_v01.h vendor/zstd/1.4.5/lib/legacy/zstd_v02.c - copied unchanged from r361423, vendor/zstd/dist/lib/legacy/zstd_v02.c vendor/zstd/1.4.5/lib/legacy/zstd_v02.h - copied unchanged from r361423, vendor/zstd/dist/lib/legacy/zstd_v02.h vendor/zstd/1.4.5/lib/legacy/zstd_v03.c - copied unchanged from r361423, vendor/zstd/dist/lib/legacy/zstd_v03.c vendor/zstd/1.4.5/lib/legacy/zstd_v03.h - copied unchanged from r361423, vendor/zstd/dist/lib/legacy/zstd_v03.h vendor/zstd/1.4.5/lib/legacy/zstd_v04.c - copied unchanged from r361423, vendor/zstd/dist/lib/legacy/zstd_v04.c vendor/zstd/1.4.5/lib/legacy/zstd_v04.h - copied unchanged from r361423, vendor/zstd/dist/lib/legacy/zstd_v04.h vendor/zstd/1.4.5/lib/legacy/zstd_v05.c - copied unchanged from r361423, vendor/zstd/dist/lib/legacy/zstd_v05.c vendor/zstd/1.4.5/lib/legacy/zstd_v05.h - copied unchanged from r361423, vendor/zstd/dist/lib/legacy/zstd_v05.h vendor/zstd/1.4.5/lib/legacy/zstd_v06.c - copied unchanged from r361423, vendor/zstd/dist/lib/legacy/zstd_v06.c vendor/zstd/1.4.5/lib/legacy/zstd_v06.h - copied unchanged from r361423, vendor/zstd/dist/lib/legacy/zstd_v06.h vendor/zstd/1.4.5/lib/legacy/zstd_v07.c - copied unchanged from r361423, vendor/zstd/dist/lib/legacy/zstd_v07.c vendor/zstd/1.4.5/lib/legacy/zstd_v07.h - copied unchanged from r361423, vendor/zstd/dist/lib/legacy/zstd_v07.h vendor/zstd/1.4.5/lib/libzstd.pc.in - copied unchanged from r361423, vendor/zstd/dist/lib/libzstd.pc.in vendor/zstd/1.4.5/lib/zstd.h - copied unchanged from r361423, vendor/zstd/dist/lib/zstd.h vendor/zstd/1.4.5/programs/Makefile - copied unchanged from r361423, vendor/zstd/dist/programs/Makefile vendor/zstd/1.4.5/programs/README.md - copied unchanged from r361423, vendor/zstd/dist/programs/README.md vendor/zstd/1.4.5/programs/benchfn.c - copied unchanged from r361423, vendor/zstd/dist/programs/benchfn.c vendor/zstd/1.4.5/programs/benchfn.h - copied unchanged from r361423, vendor/zstd/dist/programs/benchfn.h vendor/zstd/1.4.5/programs/benchzstd.c - copied unchanged from r361423, vendor/zstd/dist/programs/benchzstd.c vendor/zstd/1.4.5/programs/benchzstd.h - copied unchanged from r361423, vendor/zstd/dist/programs/benchzstd.h vendor/zstd/1.4.5/programs/datagen.c - copied unchanged from r361423, vendor/zstd/dist/programs/datagen.c vendor/zstd/1.4.5/programs/datagen.h - copied unchanged from r361423, vendor/zstd/dist/programs/datagen.h vendor/zstd/1.4.5/programs/dibio.c - copied unchanged from r361423, vendor/zstd/dist/programs/dibio.c vendor/zstd/1.4.5/programs/dibio.h - copied unchanged from r361423, vendor/zstd/dist/programs/dibio.h vendor/zstd/1.4.5/programs/fileio.c - copied unchanged from r361423, vendor/zstd/dist/programs/fileio.c vendor/zstd/1.4.5/programs/fileio.h - copied unchanged from r361423, vendor/zstd/dist/programs/fileio.h vendor/zstd/1.4.5/programs/platform.h - copied unchanged from r361423, vendor/zstd/dist/programs/platform.h vendor/zstd/1.4.5/programs/timefn.c - copied unchanged from r361423, vendor/zstd/dist/programs/timefn.c vendor/zstd/1.4.5/programs/timefn.h - copied unchanged from r361423, vendor/zstd/dist/programs/timefn.h vendor/zstd/1.4.5/programs/util.c - copied unchanged from r361423, vendor/zstd/dist/programs/util.c vendor/zstd/1.4.5/programs/util.h - copied unchanged from r361423, vendor/zstd/dist/programs/util.h vendor/zstd/1.4.5/programs/zstd.1 - copied unchanged from r361423, vendor/zstd/dist/programs/zstd.1 vendor/zstd/1.4.5/programs/zstd.1.md - copied unchanged from r361423, vendor/zstd/dist/programs/zstd.1.md vendor/zstd/1.4.5/programs/zstdcli.c - copied unchanged from r361423, vendor/zstd/dist/programs/zstdcli.c vendor/zstd/1.4.5/programs/zstdgrep - copied unchanged from r361423, vendor/zstd/dist/programs/zstdgrep vendor/zstd/1.4.5/programs/zstdgrep.1 - copied unchanged from r361423, vendor/zstd/dist/programs/zstdgrep.1 vendor/zstd/1.4.5/programs/zstdless.1 - copied unchanged from r361423, vendor/zstd/dist/programs/zstdless.1 vendor/zstd/1.4.5/zlibWrapper/Makefile - copied unchanged from r361423, vendor/zstd/dist/zlibWrapper/Makefile vendor/zstd/1.4.5/zlibWrapper/examples/zwrapbench.c - copied unchanged from r361423, vendor/zstd/dist/zlibWrapper/examples/zwrapbench.c vendor/zstd/1.4.5/zlibWrapper/gzcompatibility.h - copied unchanged from r361423, vendor/zstd/dist/zlibWrapper/gzcompatibility.h vendor/zstd/1.4.5/zlibWrapper/zstd_zlibwrapper.c - copied unchanged from r361423, vendor/zstd/dist/zlibWrapper/zstd_zlibwrapper.c vendor/zstd/1.4.5/zlibWrapper/zstd_zlibwrapper.h - copied unchanged from r361423, vendor/zstd/dist/zlibWrapper/zstd_zlibwrapper.h Deleted: vendor/zstd/1.4.5/contrib/cleanTabs vendor/zstd/1.4.5/contrib/docker/Dockerfile vendor/zstd/1.4.5/contrib/docker/README.md vendor/zstd/1.4.5/contrib/experimental_dict_builders/benchmarkDictBuilder/Makefile vendor/zstd/1.4.5/contrib/experimental_dict_builders/benchmarkDictBuilder/README.md vendor/zstd/1.4.5/contrib/experimental_dict_builders/benchmarkDictBuilder/benchmark.c vendor/zstd/1.4.5/contrib/experimental_dict_builders/benchmarkDictBuilder/dictBuilder.h vendor/zstd/1.4.5/contrib/experimental_dict_builders/benchmarkDictBuilder/test.sh vendor/zstd/1.4.5/contrib/experimental_dict_builders/fastCover/Makefile vendor/zstd/1.4.5/contrib/experimental_dict_builders/fastCover/README.md vendor/zstd/1.4.5/contrib/experimental_dict_builders/fastCover/fastCover.c vendor/zstd/1.4.5/contrib/experimental_dict_builders/fastCover/fastCover.h vendor/zstd/1.4.5/contrib/experimental_dict_builders/fastCover/main.c vendor/zstd/1.4.5/contrib/experimental_dict_builders/fastCover/test.sh vendor/zstd/1.4.5/contrib/experimental_dict_builders/randomDictBuilder/Makefile vendor/zstd/1.4.5/contrib/experimental_dict_builders/randomDictBuilder/README.md vendor/zstd/1.4.5/contrib/experimental_dict_builders/randomDictBuilder/io.c vendor/zstd/1.4.5/contrib/experimental_dict_builders/randomDictBuilder/io.h vendor/zstd/1.4.5/contrib/experimental_dict_builders/randomDictBuilder/main.c vendor/zstd/1.4.5/contrib/experimental_dict_builders/randomDictBuilder/random.c vendor/zstd/1.4.5/contrib/experimental_dict_builders/randomDictBuilder/random.h vendor/zstd/1.4.5/contrib/experimental_dict_builders/randomDictBuilder/test.sh vendor/zstd/1.4.5/contrib/gen_html/Makefile vendor/zstd/1.4.5/contrib/gen_html/README.md vendor/zstd/1.4.5/contrib/gen_html/gen-zstd-manual.sh vendor/zstd/1.4.5/contrib/gen_html/gen_html.cpp vendor/zstd/1.4.5/contrib/largeNbDicts/Makefile vendor/zstd/1.4.5/contrib/largeNbDicts/README.md vendor/zstd/1.4.5/contrib/largeNbDicts/largeNbDicts.c vendor/zstd/1.4.5/contrib/premake/premake4.lua vendor/zstd/1.4.5/contrib/premake/zstd.lua vendor/zstd/1.4.5/contrib/pzstd/BUCK vendor/zstd/1.4.5/contrib/pzstd/ErrorHolder.h vendor/zstd/1.4.5/contrib/pzstd/Logging.h vendor/zstd/1.4.5/contrib/pzstd/Makefile vendor/zstd/1.4.5/contrib/pzstd/Options.cpp vendor/zstd/1.4.5/contrib/pzstd/Options.h vendor/zstd/1.4.5/contrib/pzstd/Pzstd.cpp vendor/zstd/1.4.5/contrib/pzstd/Pzstd.h vendor/zstd/1.4.5/contrib/pzstd/README.md vendor/zstd/1.4.5/contrib/pzstd/SkippableFrame.cpp vendor/zstd/1.4.5/contrib/pzstd/SkippableFrame.h vendor/zstd/1.4.5/contrib/pzstd/images/Cspeed.png vendor/zstd/1.4.5/contrib/pzstd/images/Dspeed.png vendor/zstd/1.4.5/contrib/pzstd/main.cpp vendor/zstd/1.4.5/contrib/pzstd/test/BUCK vendor/zstd/1.4.5/contrib/pzstd/test/OptionsTest.cpp vendor/zstd/1.4.5/contrib/pzstd/test/PzstdTest.cpp vendor/zstd/1.4.5/contrib/pzstd/test/RoundTrip.h vendor/zstd/1.4.5/contrib/pzstd/test/RoundTripTest.cpp vendor/zstd/1.4.5/contrib/pzstd/utils/BUCK vendor/zstd/1.4.5/contrib/pzstd/utils/Buffer.h vendor/zstd/1.4.5/contrib/pzstd/utils/FileSystem.h vendor/zstd/1.4.5/contrib/pzstd/utils/Likely.h vendor/zstd/1.4.5/contrib/pzstd/utils/Range.h vendor/zstd/1.4.5/contrib/pzstd/utils/ResourcePool.h vendor/zstd/1.4.5/contrib/pzstd/utils/ScopeGuard.h vendor/zstd/1.4.5/contrib/pzstd/utils/ThreadPool.h vendor/zstd/1.4.5/contrib/pzstd/utils/WorkQueue.h vendor/zstd/1.4.5/contrib/pzstd/utils/test/BUCK vendor/zstd/1.4.5/contrib/pzstd/utils/test/BufferTest.cpp vendor/zstd/1.4.5/contrib/pzstd/utils/test/RangeTest.cpp vendor/zstd/1.4.5/contrib/pzstd/utils/test/ResourcePoolTest.cpp vendor/zstd/1.4.5/contrib/pzstd/utils/test/ScopeGuardTest.cpp vendor/zstd/1.4.5/contrib/pzstd/utils/test/ThreadPoolTest.cpp vendor/zstd/1.4.5/contrib/pzstd/utils/test/WorkQueueTest.cpp vendor/zstd/1.4.5/contrib/seekable_format/examples/Makefile vendor/zstd/1.4.5/contrib/seekable_format/examples/parallel_compression.c vendor/zstd/1.4.5/contrib/seekable_format/examples/parallel_processing.c vendor/zstd/1.4.5/contrib/seekable_format/examples/seekable_compression.c vendor/zstd/1.4.5/contrib/seekable_format/examples/seekable_decompression.c vendor/zstd/1.4.5/contrib/seekable_format/examples/seekable_decompression_mem.c vendor/zstd/1.4.5/contrib/seekable_format/zstd_seekable.h vendor/zstd/1.4.5/contrib/seekable_format/zstd_seekable_compression_format.md vendor/zstd/1.4.5/contrib/seekable_format/zstdseek_compress.c vendor/zstd/1.4.5/contrib/seekable_format/zstdseek_decompress.c vendor/zstd/1.4.5/contrib/snap/snapcraft.yaml vendor/zstd/1.4.5/tests/Makefile vendor/zstd/1.4.5/tests/README.md vendor/zstd/1.4.5/tests/bigdict.c vendor/zstd/1.4.5/tests/checkTag.c vendor/zstd/1.4.5/tests/datagencli.c vendor/zstd/1.4.5/tests/decodecorpus.c vendor/zstd/1.4.5/tests/fullbench.c vendor/zstd/1.4.5/tests/fuzz/Makefile vendor/zstd/1.4.5/tests/fuzz/README.md vendor/zstd/1.4.5/tests/fuzz/block_decompress.c vendor/zstd/1.4.5/tests/fuzz/block_round_trip.c vendor/zstd/1.4.5/tests/fuzz/dictionary_decompress.c vendor/zstd/1.4.5/tests/fuzz/dictionary_loader.c vendor/zstd/1.4.5/tests/fuzz/dictionary_round_trip.c vendor/zstd/1.4.5/tests/fuzz/fuzz.h vendor/zstd/1.4.5/tests/fuzz/fuzz.py vendor/zstd/1.4.5/tests/fuzz/fuzz_data_producer.c vendor/zstd/1.4.5/tests/fuzz/fuzz_data_producer.h vendor/zstd/1.4.5/tests/fuzz/fuzz_helpers.h vendor/zstd/1.4.5/tests/fuzz/regression_driver.c vendor/zstd/1.4.5/tests/fuzz/simple_compress.c vendor/zstd/1.4.5/tests/fuzz/simple_decompress.c vendor/zstd/1.4.5/tests/fuzz/simple_round_trip.c vendor/zstd/1.4.5/tests/fuzz/stream_decompress.c vendor/zstd/1.4.5/tests/fuzz/stream_round_trip.c vendor/zstd/1.4.5/tests/fuzz/zstd_frame_info.c vendor/zstd/1.4.5/tests/fuzz/zstd_helpers.c vendor/zstd/1.4.5/tests/fuzz/zstd_helpers.h vendor/zstd/1.4.5/tests/fuzzer.c vendor/zstd/1.4.5/tests/golden-compression/huffman-compressed-larger vendor/zstd/1.4.5/tests/golden-decompression/rle-first-block.zst vendor/zstd/1.4.5/tests/gzip/Makefile vendor/zstd/1.4.5/tests/gzip/gzip-env.sh vendor/zstd/1.4.5/tests/gzip/helin-segv.sh vendor/zstd/1.4.5/tests/gzip/help-version.sh vendor/zstd/1.4.5/tests/gzip/hufts-segv.gz vendor/zstd/1.4.5/tests/gzip/hufts.sh vendor/zstd/1.4.5/tests/gzip/init.cfg vendor/zstd/1.4.5/tests/gzip/init.sh vendor/zstd/1.4.5/tests/gzip/keep.sh vendor/zstd/1.4.5/tests/gzip/list.sh vendor/zstd/1.4.5/tests/gzip/memcpy-abuse.sh vendor/zstd/1.4.5/tests/gzip/mixed.sh vendor/zstd/1.4.5/tests/gzip/null-suffix-clobber.sh vendor/zstd/1.4.5/tests/gzip/stdin.sh vendor/zstd/1.4.5/tests/gzip/test-driver.sh vendor/zstd/1.4.5/tests/gzip/trailing-nul.sh vendor/zstd/1.4.5/tests/gzip/unpack-invalid.sh vendor/zstd/1.4.5/tests/gzip/z-suffix.sh vendor/zstd/1.4.5/tests/gzip/zdiff.sh vendor/zstd/1.4.5/tests/gzip/zgrep-context.sh vendor/zstd/1.4.5/tests/gzip/zgrep-f.sh vendor/zstd/1.4.5/tests/gzip/zgrep-signal.sh vendor/zstd/1.4.5/tests/gzip/znew-k.sh vendor/zstd/1.4.5/tests/invalidDictionaries.c vendor/zstd/1.4.5/tests/legacy.c vendor/zstd/1.4.5/tests/libzstd_partial_builds.sh vendor/zstd/1.4.5/tests/longmatch.c vendor/zstd/1.4.5/tests/paramgrill.c vendor/zstd/1.4.5/tests/playTests.sh vendor/zstd/1.4.5/tests/poolTests.c vendor/zstd/1.4.5/tests/rateLimiter.py vendor/zstd/1.4.5/tests/regression/Makefile vendor/zstd/1.4.5/tests/regression/config.c vendor/zstd/1.4.5/tests/regression/config.h vendor/zstd/1.4.5/tests/regression/data.c vendor/zstd/1.4.5/tests/regression/data.h vendor/zstd/1.4.5/tests/regression/levels.h vendor/zstd/1.4.5/tests/regression/method.c vendor/zstd/1.4.5/tests/regression/method.h vendor/zstd/1.4.5/tests/regression/result.c vendor/zstd/1.4.5/tests/regression/result.h vendor/zstd/1.4.5/tests/regression/results.csv vendor/zstd/1.4.5/tests/regression/test.c vendor/zstd/1.4.5/tests/roundTripCrash.c vendor/zstd/1.4.5/tests/seqgen.c vendor/zstd/1.4.5/tests/seqgen.h vendor/zstd/1.4.5/tests/symbols.c vendor/zstd/1.4.5/tests/test-zstd-speed.py vendor/zstd/1.4.5/tests/test-zstd-versions.py vendor/zstd/1.4.5/tests/zbufftest.c vendor/zstd/1.4.5/tests/zstreamtest.c Copied: vendor/zstd/1.4.5/CHANGELOG (from r361423, vendor/zstd/dist/CHANGELOG) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/1.4.5/CHANGELOG Sat May 23 20:38:30 2020 (r361424, copy of r361423, vendor/zstd/dist/CHANGELOG) @@ -0,0 +1,555 @@ +v1.4.5 +fix : Compression ratio regression on huge files (> 3 GB) using high levels (--ultra) and multithreading, by @terrelln +perf: Improved decompression speed: x64 : +10% (clang) / +5% (gcc); ARM : from +15% to +50%, depending on SoC, by @terrelln +perf: Automatically downsizes ZSTD_DCtx when too large for too long (#2069, by @bimbashreshta) +perf: Improved fast compression speed on aarch64 (#2040, ~+3%, by @caoyzh) +perf: Small level 1 compression speed gains (depending on compiler) +cli : New --patch-from command, create and apply patches from files, by @bimbashreshta +cli : New --filelist= : Provide a list of files to operate upon from a file +cli : -b -d command can now benchmark decompression on multiple files +cli : New --no-content-size command +cli : New --show-default-cparams information command +api : ZDICT_finalizeDictionary() is promoted to stable (#2111) +api : new experimental parameter ZSTD_d_stableOutBuffer (#2094) +build: Generate a single-file libzstd library (#2065, by @cwoffenden) +build: Relative includes no longer require -I compiler flags for zstd lib subdirs (#2103, by @felixhandte) +build: zstd now compiles cleanly under -pedantic (#2099) +build: zstd now compiles with make-4.3 +build: Support mingw cross-compilation from Linux, by @Ericson2314 +build: Meson multi-thread build fix on windows +build: Some misc icc fixes backed by new ci test on travis +misc: bitflip analyzer tool, by @felixhandte +misc: Extend largeNbDicts benchmark to compression +misc: Edit-distance match finder in contrib/ +doc : Improved beginner CONTRIBUTING.md docs +doc : New issue templates for zstd + +v1.4.4 +perf: Improved decompression speed, by > 10%, by @terrelln +perf: Better compression speed when re-using a context, by @felixhandte +perf: Fix compression ratio when compressing large files with small dictionary, by @senhuang42 +perf: zstd reference encoder can generate RLE blocks, by @bimbashrestha +perf: minor generic speed optimization, by @davidbolvansky +api: new ability to extract sequences from the parser for analysis, by @bimbashrestha +api: fixed decoding of magic-less frames, by @terrelln +api: fixed ZSTD_initCStream_advanced() performance with fast modes, reported by @QrczakMK +cli: Named pipes support, by @bimbashrestha +cli: short tar's extension support, by @stokito +cli: command --output-dir-flat= , generates target files into requested directory, by @senhuang42 +cli: commands --stream-size=# and --size-hint=#, by @nmagerko +cli: command --exclude-compressed, by @shashank0791 +cli: faster `-t` test mode +cli: improved some error messages, by @vangyzen +cli: fix command `-D dictionary` on Windows, reported by @artyompetrov +cli: fix rare deadlock condition within dictionary builder, by @terrelln +build: single-file decoder with emscripten compilation script, by @cwoffenden +build: fixed zlibWrapper compilation on Visual Studio, reported by @bluenlive +build: fixed deprecation warning for certain gcc version, reported by @jasonma163 +build: fix compilation on old gcc versions, by @cemeyer +build: improved installation directories for cmake script, by Dmitri Shubin +pack: modified pkgconfig, for better integration into openwrt, requested by @neheb +misc: Improved documentation : ZSTD_CLEVEL, DYNAMIC_BMI2, ZSTD_CDict, function deprecation, zstd format +misc: fixed educational decoder : accept larger literals section, and removed UNALIGNED() macro + +v1.4.3 +bug: Fix Dictionary Compression Ratio Regression by @cyan4973 (#1709) +bug: Fix Buffer Overflow in legacy v0.3 decompression by @felixhandte (#1722) +build: Add support for IAR C/C++ Compiler for Arm by @joseph0918 (#1705) + +v1.4.2 +bug: Fix bug in zstd-0.5 decoder by @terrelln (#1696) +bug: Fix seekable decompression in-memory API by @iburinoc (#1695) +misc: Validate blocks are smaller than size limit by @vivekmg (#1685) +misc: Restructure source files by @ephiepark (#1679) + +v1.4.1 +bug: Fix data corruption in niche use cases by @terrelln (#1659) +bug: Fuzz legacy modes, fix uncovered bugs by @terrelln (#1593, #1594, #1595) +bug: Fix out of bounds read by @terrelln (#1590) +perf: Improve decode speed by ~7% @mgrice (#1668) +perf: Slightly improved compression ratio of level 3 and 4 (ZSTD_dfast) by @cyan4973 (#1681) +perf: Slightly faster compression speed when re-using a context by @cyan4973 (#1658) +perf: Improve compression ratio for small windowLog by @cyan4973 (#1624) +perf: Faster compression speed in high compression mode for repetitive data by @terrelln (#1635) +api: Add parameter to generate smaller dictionaries by @tyler-tran (#1656) +cli: Recognize symlinks when built in C99 mode by @felixhandte (#1640) +cli: Expose cpu load indicator for each file on -vv mode by @ephiepark (#1631) +cli: Restrict read permissions on destination files by @chungy (#1644) +cli: zstdgrep: handle -f flag by @felixhandte (#1618) +cli: zstdcat: follow symlinks by @vejnar (#1604) +doc: Remove extra size limit on compressed blocks by @felixhandte (#1689) +doc: Fix typo by @yk-tanigawa (#1633) +doc: Improve documentation on streaming buffer sizes by @cyan4973 (#1629) +build: CMake: support building with LZ4 @leeyoung624 (#1626) +build: CMake: install zstdless and zstdgrep by @leeyoung624 (#1647) +build: CMake: respect existing uninstall target by @j301scott (#1619) +build: Make: skip multithread tests when built without support by @michaelforney (#1620) +build: Make: Fix examples/ test target by @sjnam (#1603) +build: Meson: rename options out of deprecated namespace by @lzutao (#1665) +build: Meson: fix build by @lzutao (#1602) +build: Visual Studio: don't export symbols in static lib by @scharan (#1650) +build: Visual Studio: fix linking by @absotively (#1639) +build: Fix MinGW-W64 build by @myzhang1029 (#1600) +misc: Expand decodecorpus coverage by @ephiepark (#1664) + +v1.4.0 +perf: Improve level 1 compression speed in most scenarios by 6% by @gbtucker and @terrelln +api: Move the advanced API, including all functions in the staging section, to the stable section +api: Make ZSTD_e_flush and ZSTD_e_end block for maximum forward progress +api: Rename ZSTD_CCtxParam_getParameter to ZSTD_CCtxParams_getParameter +api: Rename ZSTD_CCtxParam_setParameter to ZSTD_CCtxParams_setParameter +api: Don't export ZSTDMT functions from the shared library by default +api: Require ZSTD_MULTITHREAD to be defined to use ZSTDMT +api: Add ZSTD_decompressBound() to provide an upper bound on decompressed size by @shakeelrao +api: Fix ZSTD_decompressDCtx() corner cases with a dictionary +api: Move ZSTD_getDictID_*() functions to the stable section +api: Add ZSTD_c_literalCompressionMode flag to enable or disable literal compression by @terrelln +api: Allow compression parameters to be set when a dictionary is used +api: Allow setting parameters before or after ZSTD_CCtx_loadDictionary() is called +api: Fix ZSTD_estimateCStreamSize_usingCCtxParams() +api: Setting ZSTD_d_maxWindowLog to 0 means use the default +cli: Ensure that a dictionary is not used to compress itself by @shakeelrao +cli: Add --[no-]compress-literals flag to enable or disable literal compression +doc: Update the examples to use the advanced API +doc: Explain how to transition from old streaming functions to the advanced API in the header +build: Improve the Windows release packages +build: Improve CMake build by @hjmjohnson +build: Build fixes for FreeBSD by @lwhsu +build: Remove redundant warnings by @thatsafunnyname +build: Fix tests on OpenBSD by @bket +build: Extend fuzzer build system to work with the new clang engine +build: CMake now creates the libzstd.so.1 symlink +build: Improve Menson build by @lzutao +misc: Fix symbolic link detection on FreeBSD +misc: Use physical core count for -T0 on FreeBSD by @cemeyer +misc: Fix zstd --list on truncated files by @kostmo +misc: Improve logging in debug mode by @felixhandte +misc: Add CirrusCI tests by @lwhsu +misc: Optimize dictionary memory usage in corner cases +misc: Improve the dictionary builder on small or homogeneous data +misc: Fix spelling across the repo by @jsoref + +v1.3.8 +perf: better decompression speed on large files (+7%) and cold dictionaries (+15%) +perf: slightly better compression ratio at high compression modes +api : finalized advanced API, last stage before "stable" status +api : new --rsyncable mode, by @terrelln +api : support decompression of empty frames into NULL (used to be an error) (#1385) +build: new set of macros to build a minimal size decoder, by @felixhandte +build: fix compilation on MIPS32, reported by @clbr (#1441) +build: fix compilation with multiple -arch flags, by @ryandesign +build: highly upgraded meson build, by @lzutao +build: improved buck support, by @obelisk +build: fix cmake script : can create debug build, by @pitrou +build: Makefile : grep works on both colored consoles and systems without color support +build: fixed zstd-pgo, by @bmwiedemann +cli : support ZSTD_CLEVEL environment variable, by @yijinfb (#1423) +cli : --no-progress flag, preserving final summary (#1371), by @terrelln +cli : ensure destination file is not source file (#1422) +cli : clearer error messages, especially when input file not present +doc : clarified zstd_compression_format.md, by @ulikunitz +misc: fixed zstdgrep, returns 1 on failure, by @lzutao +misc: NEWS renamed as CHANGELOG, in accordance with fboss + +v1.3.7 +perf: slightly better decompression speed on clang (depending on hardware target) +fix : performance of dictionary compression for small input < 4 KB at levels 9 and 10 +build: no longer build backtrace by default in release mode; restrict further automatic mode +build: control backtrace support through build macro BACKTRACE +misc: added man pages for zstdless and zstdgrep, by @samrussell + +v1.3.6 +perf: much faster dictionary builder, by @jenniferliu +perf: faster dictionary compression on small data when using multiple contexts, by @felixhandte +perf: faster dictionary decompression when using a very large number of dictionaries simultaneously +cli : fix : does no longer overwrite destination when source does not exist (#1082) +cli : new command --adapt, for automatic compression level adaptation +api : fix : block api can be streamed with > 4 GB, reported by @catid +api : reduced ZSTD_DDict size by 2 KB +api : minimum negative compression level is defined, and can be queried using ZSTD_minCLevel(). +build: support Haiku target, by @korli +build: Read Legacy format is limited to v0.5+ by default. Can be changed at compile time with macro ZSTD_LEGACY_SUPPORT. +doc : zstd_compression_format.md updated to match wording in IETF RFC 8478 +misc: tests/paramgrill, a parameter optimizer, by @GeorgeLu97 + +v1.3.5 +perf: much faster dictionary compression, by @felixhandte +perf: small quality improvement for dictionary generation, by @terrelln +perf: slightly improved high compression levels (notably level 19) +mem : automatic memory release for long duration contexts +cli : fix : overlapLog can be manually set +cli : fix : decoding invalid lz4 frames +api : fix : performance degradation for dictionary compression when using advanced API, by @terrelln +api : change : clarify ZSTD_CCtx_reset() vs ZSTD_CCtx_resetParameters(), by @terrelln +build: select custom libzstd scope through control macros, by @GeorgeLu97 +build: OpenBSD patch, by @bket +build: make and make all are compatible with -j +doc : clarify zstd_compression_format.md, updated for IETF RFC process +misc: pzstd compatible with reproducible compilation, by @lamby + +v1.3.4 +perf: faster speed (especially decoding speed) on recent cpus (haswell+) +perf: much better performance associating --long with multi-threading, by @terrelln +perf: better compression at levels 13-15 +cli : asynchronous compression by default, for faster experience (use --single-thread for former behavior) +cli : smoother status report in multi-threading mode +cli : added command --fast=#, for faster compression modes +cli : fix crash when not overwriting existing files, by Pádraig Brady (@pixelb) +api : `nbThreads` becomes `nbWorkers` : 1 triggers asynchronous mode +api : compression levels can be negative, for even more speed +api : ZSTD_getFrameProgression() : get precise progress status of ZSTDMT anytime +api : ZSTDMT can accept new compression parameters during compression +api : implemented all advanced dictionary decompression prototypes +build: improved meson recipe, by Shawn Landden (@shawnl) +build: VS2017 scripts, by @HaydnTrigg +misc: all /contrib projects fixed +misc: added /contrib/docker script by @gyscos + +v1.3.3 +perf: faster zstd_opt strategy (levels 16-19) +fix : bug #944 : multithreading with shared ditionary and large data, reported by @gsliepen +cli : fix : content size written in header by default +cli : fix : improved LZ4 format support, by @felixhandte +cli : new : hidden command `-S`, to benchmark multiple files while generating one result per file +api : fix : support large skippable frames, by @terrelln +api : fix : streaming interface was adding a useless 3-bytes null block to small frames +api : change : when setting `pledgedSrcSize`, use `ZSTD_CONTENTSIZE_UNKNOWN` macro value to mean "unknown" +build: fix : compilation under rhel6 and centos6, reported by @pixelb +build: added `check` target + +v1.3.2 +new : long range mode, using --long command, by Stella Lau (@stellamplau) +new : ability to generate and decode magicless frames (#591) +changed : maximum nb of threads reduced to 200, to avoid address space exhaustion in 32-bits mode +fix : multi-threading compression works with custom allocators +fix : ZSTD_sizeof_CStream() was over-evaluating memory usage +fix : a rare compression bug when compression generates very large distances and bunch of other conditions (only possible at --ultra -22) +fix : 32-bits build can now decode large offsets (levels 21+) +cli : added LZ4 frame support by default, by Felix Handte (@felixhandte) +cli : improved --list output +cli : new : can split input file for dictionary training, using command -B# +cli : new : clean operation artefact on Ctrl-C interruption +cli : fix : do not change /dev/null permissions when using command -t with root access, reported by @mike155 (#851) +cli : fix : write file size in header in multiple-files mode +api : added macro ZSTD_COMPRESSBOUND() for static allocation +api : experimental : new advanced decompression API +api : fix : sizeof_CCtx() used to over-estimate +build: fix : no-multithread variant compiles without pool.c dependency, reported by Mitchell Blank Jr (@mitchblank) (#819) +build: better compatibility with reproducible builds, by Bernhard M. Wiedemann (@bmwiedemann) (#818) +example : added streaming_memory_usage +license : changed /examples license to BSD + GPLv2 +license : fix a few header files to reflect new license (#825) + +v1.3.1 +New license : BSD + GPLv2 +perf: substantially decreased memory usage in Multi-threading mode, thanks to reports by Tino Reichardt (@mcmilk) +perf: Multi-threading supports up to 256 threads. Cap at 256 when more are requested (#760) +cli : improved and fixed --list command, by @ib (#772) +cli : command -vV to list supported formats, by @ib (#771) +build : fixed binary variants, reported by @svenha (#788) +build : fix Visual compilation for non x86/x64 targets, reported by Greg Slazinski (@GregSlazinski) (#718) +API exp : breaking change : ZSTD_getframeHeader() provides more information +API exp : breaking change : pinned down values of error codes +doc : fixed huffman example, by Ulrich Kunitz (@ulikunitz) +new : contrib/adaptive-compression, I/O driven compression strength, by Paul Cruz (@paulcruz74) +new : contrib/long_distance_matching, statistics by Stella Lau (@stellamplau) +updated : contrib/linux-kernel, by Nick Terrell (@terrelln) + +v1.3.0 +cli : new : `--list` command, by Paul Cruz +cli : changed : xz/lzma support enabled by default +cli : changed : `-t *` continue processing list after a decompression error +API : added : ZSTD_versionString() +API : promoted to stable status : ZSTD_getFrameContentSize(), by Sean Purcell +API exp : new advanced API : ZSTD_compress_generic(), ZSTD_CCtx_setParameter() +API exp : new : API for static or external allocation : ZSTD_initStatic?Ctx() +API exp : added : ZSTD_decompressBegin_usingDDict(), requested by Guy Riddle (#700) +API exp : clarified memory estimation / measurement functions. +API exp : changed : strongest strategy renamed ZSTD_btultra, fastest strategy ZSTD_fast set to 1 +tools : decodecorpus can generate random dictionary-compressed samples, by Paul Cruz +new : contrib/seekable_format, demo and API, by Sean Purcell +changed : contrib/linux-kernel, updated version and license, by Nick Terrell + +v1.2.0 +cli : changed : Multithreading enabled by default (use target zstd-nomt or HAVE_THREAD=0 to disable) +cli : new : command -T0 means "detect and use nb of cores", by Sean Purcell +cli : new : zstdmt symlink hardwired to `zstd -T0` +cli : new : command --threads=# (#671) +cli : changed : cover dictionary builder by default, for improved quality, by Nick Terrell +cli : new : commands --train-cover and --train-legacy, to select dictionary algorithm and parameters +cli : experimental targets `zstd4` and `xzstd4`, with support for lz4 format, by Sean Purcell +cli : fix : does not output compressed data on console +cli : fix : ignore symbolic links unless --force specified, +API : breaking change : ZSTD_createCDict_advanced(), only use compressionParameters as argument +API : added : prototypes ZSTD_*_usingCDict_advanced(), for direct control over frameParameters. +API : improved: ZSTDMT_compressCCtx() reduced memory usage +API : fix : ZSTDMT_compressCCtx() now provides srcSize in header (#634) +API : fix : src size stored in frame header is controlled at end of frame +API : fix : enforced consistent rules for pledgedSrcSize==0 (#641) +API : fix : error code "GENERIC" replaced by "dstSizeTooSmall" when appropriate +build: improved cmake script, by @Majlen +build: enabled Multi-threading support for *BSD, by Baptiste Daroussin +tools: updated Paramgrill. Command -O# provides best parameters for sample and speed target. +new : contrib/linux-kernel version, by Nick Terrell + +v1.1.4 +cli : new : can compress in *.gz format, using --format=gzip command, by Przemyslaw Skibinski +cli : new : advanced benchmark command --priority=rt +cli : fix : write on sparse-enabled file systems in 32-bits mode, by @ds77 +cli : fix : --rm remains silent when input is stdin +cli : experimental : xzstd, with support for xz/lzma decoding, by Przemyslaw Skibinski +speed : improved decompression speed in streaming mode for single shot scenarios (+5%) +memory: DDict (decompression dictionary) memory usage down from 150 KB to 20 KB +arch: 32-bits variant able to generate and decode very long matches (>32 MB), by Sean Purcell +API : new : ZSTD_findFrameCompressedSize(), ZSTD_getFrameContentSize(), ZSTD_findDecompressedSize() +API : changed : dropped support of legacy versions <= v0.3 (can be changed by modifying ZSTD_LEGACY_SUPPORT value) +build : new: meson build system in contrib/meson, by Dima Krasner +build : improved cmake script, by @Majlen +build : added -Wformat-security flag, as recommended by Padraig Brady +doc : new : educational decoder, by Sean Purcell + +v1.1.3 +cli : zstd can decompress .gz files (can be disabled with `make zstd-nogz` or `make HAVE_ZLIB=0`) +cli : new : experimental target `make zstdmt`, with multi-threading support +cli : new : improved dictionary builder "cover" (experimental), by Nick Terrell, based on prior work by Giuseppe Ottaviano. +cli : new : advanced commands for detailed parameters, by Przemyslaw Skibinski +cli : fix zstdless on Mac OS-X, by Andrew Janke +cli : fix #232 "compress non-files" +dictBuilder : improved dictionary generation quality, thanks to Nick Terrell +API : new : lib/compress/ZSTDMT_compress.h multithreading API (experimental) +API : new : ZSTD_create?Dict_byReference(), requested by Bartosz Taudul +API : new : ZDICT_finalizeDictionary() +API : fix : ZSTD_initCStream_usingCDict() properly writes dictID into frame header, by Gregory Szorc (#511) +API : fix : all symbols properly exposed in libzstd, by Nick Terrell +build : support for Solaris target, by Przemyslaw Skibinski +doc : clarified specification, by Sean Purcell + +v1.1.2 +API : streaming : decompression : changed : automatic implicit reset when chain-decoding new frames without init +API : experimental : added : dictID retrieval functions, and ZSTD_initCStream_srcSize() +API : zbuff : changed : prototypes now generate deprecation warnings +lib : improved : faster decompression speed at ultra compression settings and 32-bits mode +lib : changed : only public ZSTD_ symbols are now exposed +lib : changed : reduced usage of stack memory +lib : fixed : several corner case bugs, by Nick Terrell +cli : new : gzstd, experimental version able to decode .gz files, by Przemyslaw Skibinski +cli : new : preserve file attributes +cli : new : added zstdless and zstdgrep tools +cli : fixed : status displays total amount decoded, even for file consisting of multiple frames (like pzstd) +cli : fixed : zstdcat +zlib_wrapper : added support for gz* functions, by Przemyslaw Skibinski +install : better compatibility with FreeBSD, by Dimitry Andric +source tree : changed : zbuff source files moved to lib/deprecated + +v1.1.1 +New : command -M#, --memory=, --memlimit=, --memlimit-decompress= to limit allowed memory consumption +New : doc/zstd_manual.html, by Przemyslaw Skibinski +Improved : slightly better compression ratio at --ultra levels (>= 20) +Improved : better memory usage when using streaming compression API, thanks to @Rogier-5 report +Added : API : ZSTD_initCStream_usingCDict(), ZSTD_initDStream_usingDDict() (experimental section) +Added : example/multiple_streaming_compression.c +Changed : zstd_errors.h is now installed within /include (and replaces errors_public.h) +Updated man page +Fixed : zstd-small, zstd-compress and zstd-decompress compilation targets + +v1.1.0 +New : contrib/pzstd, parallel version of zstd, by Nick Terrell +added : NetBSD install target (#338) +Improved : speed for batches of small files +Improved : speed of zlib wrapper, by Przemyslaw Skibinski +Changed : libzstd on Windows supports legacy formats, by Christophe Chevalier +Fixed : CLI -d output to stdout by default when input is stdin (#322) +Fixed : CLI correctly detects console on Mac OS-X +Fixed : CLI supports recursive mode `-r` on Mac OS-X +Fixed : Legacy decoders use unified error codes, reported by benrg (#341), fixed by Przemyslaw Skibinski +Fixed : compatibility with OpenBSD, reported by Juan Francisco Cantero Hurtado (#319) +Fixed : compatibility with Hurd, by Przemyslaw Skibinski (#365) +Fixed : zstd-pgo, reported by octoploid (#329) + +v1.0.0 +Change Licensing, all project is now BSD, Copyright Facebook +Small decompression speed improvement +API : Streaming API supports legacy format +API : ZDICT_getDictID(), ZSTD_sizeof_{CCtx, DCtx, CStream, DStream}(), ZSTD_setDStreamParameter() +CLI supports legacy formats v0.4+ +Fixed : compression fails on certain huge files, reported by Jesse McGrew +Enhanced documentation, by Przemyslaw Skibinski + +v0.8.1 +New streaming API +Changed : --ultra now enables levels beyond 19 +Changed : -i# now selects benchmark time in second +Fixed : ZSTD_compress* can now compress > 4 GB in a single pass, reported by Nick Terrell +Fixed : speed regression on specific patterns (#272) +Fixed : support for Z_SYNC_FLUSH, by Dmitry Krot (#291) +Fixed : ICC compilation, by Przemyslaw Skibinski + +v0.8.0 +Improved : better speed on clang and gcc -O2, thanks to Eric Biggers +New : Build on FreeBSD and DragonFly, thanks to JrMarino +Changed : modified API : ZSTD_compressEnd() +Fixed : legacy mode with ZSTD_HEAPMODE=0, by Christopher Bergqvist +Fixed : premature end of frame when zero-sized raw block, reported by Eric Biggers +Fixed : large dictionaries (> 384 KB), reported by Ilona Papava +Fixed : checksum correctly checked in single-pass mode +Fixed : combined --test amd --rm, reported by Andreas M. Nilsson +Modified : minor compression level adaptations +Updated : compression format specification to v0.2.0 +changed : zstd.h moved to /lib directory + +v0.7.5 +Transition version, supporting decoding of v0.8.x + +v0.7.4 +Added : homebrew for Mac, by Daniel Cade +Added : more examples +Fixed : segfault when using small dictionaries, reported by Felix Handte +Modified : default compression level for CLI is now 3 +Updated : specification, to v0.1.1 + +v0.7.3 +New : compression format specification +New : `--` separator, stating that all following arguments are file names. Suggested by Chip Turner. +New : `ZSTD_getDecompressedSize()` +New : OpenBSD target, by Juan Francisco Cantero Hurtado +New : `examples` directory +fixed : dictBuilder using HC levels, reported by Bartosz Taudul +fixed : legacy support from ZSTD_decompress_usingDDict(), reported by Felix Handte +fixed : multi-blocks decoding with intermediate uncompressed blocks, reported by Greg Slazinski +modified : removed "mem.h" and "error_public.h" dependencies from "zstd.h" (experimental section) +modified : legacy functions no longer need magic number + +v0.7.2 +fixed : ZSTD_decompressBlock() using multiple consecutive blocks. Reported by Greg Slazinski. +fixed : potential segfault on very large files (many gigabytes). Reported by Chip Turner. +fixed : CLI displays system error message when destination file cannot be created (#231). Reported by Chip Turner. + +v0.7.1 +fixed : ZBUFF_compressEnd() called multiple times with too small `dst` buffer, reported by Christophe Chevalier +fixed : dictBuilder fails if first sample is too small, reported by Руслан Ковалёв +fixed : corruption issue, reported by cj +modified : checksum enabled by default in command line mode + +v0.7.0 +New : Support for directory compression, using `-r`, thanks to Przemyslaw Skibinski +New : Command `--rm`, to remove source file after successful de/compression +New : Visual build scripts, by Christophe Chevalier +New : Support for Sparse File-systems (do not use space for zero-filled sectors) +New : Frame checksum support +New : Support pass-through mode (when using `-df`) +API : more efficient Dictionary API : `ZSTD_compress_usingCDict()`, `ZSTD_decompress_usingDDict()` +API : create dictionary files from custom content, by Giuseppe Ottaviano +API : support for custom malloc/free functions +New : controllable Dictionary ID +New : Support for skippable frames + +v0.6.1 +New : zlib wrapper API, thanks to Przemyslaw Skibinski +New : Ability to compile compressor / decompressor separately +Changed : new lib directory structure +Fixed : Legacy codec v0.5 compatible with dictionary decompression +Fixed : Decoder corruption error (#173) +Fixed : null-string roundtrip (#176) +New : benchmark mode can select directory as input +Experimental : midipix support, VMS support + +v0.6.0 +Stronger high compression modes, thanks to Przemyslaw Skibinski +API : ZSTD_getFrameParams() provides size of decompressed content +New : highest compression modes require `--ultra` command to fully unleash their capacity +Fixed : zstd cli return error code > 0 and removes dst file artifact when decompression fails, thanks to Chip Turner + +v0.5.1 +New : Optimal parsing => Very high compression modes, thanks to Przemyslaw Skibinski +Changed : Dictionary builder integrated into libzstd and zstd cli +Changed (!) : zstd cli now uses "multiple input files" as default mode. See `zstd -h`. +Fix : high compression modes for big-endian platforms +New : zstd cli : `-t` | `--test` command + +v0.5.0 +New : dictionary builder utility +Changed : streaming & dictionary API +Improved : better compression of small data + +v0.4.7 +Improved : small compression speed improvement in HC mode +Changed : `zstd_decompress.c` has ZSTD_LEGACY_SUPPORT to 0 by default +fix : bt search bug + +v0.4.6 +fix : fast compression mode on Windows +New : cmake configuration file, thanks to Artyom Dymchenko +Improved : high compression mode on repetitive data +New : block-level API +New : ZSTD_duplicateCCtx() + +v0.4.5 +new : -m/--multiple : compress/decompress multiple files + +v0.4.4 +Fixed : high compression modes for Windows 32 bits +new : external dictionary API extended to buffered mode and accessible through command line +new : windows DLL project, thanks to Christophe Chevalier + +v0.4.3 : +new : external dictionary API +new : zstd-frugal + +v0.4.2 : +Generic minor improvements for small blocks +Fixed : big-endian compatibility, by Peter Harris (#85) + +v0.4.1 +Fixed : ZSTD_LEGACY_SUPPORT=0 build mode (reported by Luben) +removed `zstd.c` + +v0.4.0 +Command line utility compatible with high compression levels +Removed zstdhc => merged into zstd +Added : ZBUFF API (see zstd_buffered.h) +Rolling buffer support + +v0.3.6 +small blocks params + +v0.3.5 +minor generic compression improvements + +v0.3.4 +Faster fast cLevels + +v0.3.3 +Small compression ratio improvement + +v0.3.2 +Fixed Visual Studio + +v0.3.1 : +Small compression ratio improvement + +v0.3 +HC mode : compression levels 2-26 + +v0.2.2 +Fix : Visual Studio 2013 & 2015 release compilation, by Christophe Chevalier + +v0.2.1 +Fix : Read errors, advanced fuzzer tests, by Hanno Böck + +v0.2.0 +**Breaking format change** +Faster decompression speed +Can still decode v0.1 format + +v0.1.3 +fix uninitialization warning, reported by Evan Nemerson + +v0.1.2 +frame concatenation support + +v0.1.1 +fix compression bug +detects write-flush errors + +v0.1.0 +first release Copied: vendor/zstd/1.4.5/CONTRIBUTING.md (from r361423, vendor/zstd/dist/CONTRIBUTING.md) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/1.4.5/CONTRIBUTING.md Sat May 23 20:38:30 2020 (r361424, copy of r361423, vendor/zstd/dist/CONTRIBUTING.md) @@ -0,0 +1,392 @@ +# Contributing to Zstandard +We want to make contributing to this project as easy and transparent as +possible. + +## Our Development Process +New versions are being developed in the "dev" branch, +or in their own feature branch. +When they are deemed ready for a release, they are merged into "master". + +As a consequences, all contributions must stage first through "dev" +or their own feature branch. + +## Pull Requests +We actively welcome your pull requests. + +1. Fork the repo and create your branch from `dev`. +2. If you've added code that should be tested, add tests. +3. If you've changed APIs, update the documentation. +4. Ensure the test suite passes. +5. Make sure your code lints. +6. If you haven't already, complete the Contributor License Agreement ("CLA"). + +## Contributor License Agreement ("CLA") +In order to accept your pull request, we need you to submit a CLA. You only need +to do this once to work on any of Facebook's open source projects. + +Complete your CLA here: + +## Workflow +Zstd uses a branch-based workflow for making changes to the codebase. Typically, zstd +will use a new branch per sizable topic. For smaller changes, it is okay to lump multiple +related changes into a branch. + +Our contribution process works in three main stages: +1. Local development + * Update: + * Checkout your fork of zstd if you have not already + ``` + git checkout https://github.com//zstd + cd zstd + ``` + * Update your local dev branch + ``` + git pull https://github.com/facebook/zstd dev + git push origin dev + ``` + * Topic and development: + * Make a new branch on your fork about the topic you're developing for + ``` + # branch names should be consise but sufficiently informative + git checkout -b + git push origin + ``` + * Make commits and push + ``` + # make some changes = + git add -u && git commit -m + git push origin + ``` + * Note: run local tests to ensure that your changes didn't break existing functionality + * Quick check + ``` + make shortest + ``` + * Longer check + ``` + make test + ``` +2. Code Review and CI tests + * Ensure CI tests pass: + * Before sharing anything to the community, make sure that all CI tests pass on your local fork. + See our section on setting up your CI environment for more information on how to do this. + * Ensure that static analysis passes on your development machine. See the Static Analysis section + below to see how to do this. + * Create a pull request: + * When you are ready to share you changes to the community, create a pull request from your branch + to facebook:dev. You can do this very easily by clicking 'Create Pull Request' on your fork's home + page. + * From there, select the branch where you made changes as your source branch and facebook:dev + as the destination. + * Examine the diff presented between the two branches to make sure there is nothing unexpected. + * Write a good pull request description: + * While there is no strict template that our contributors follow, we would like them to + sufficiently summarize and motivate the changes they are proposing. We recommend all pull requests, + at least indirectly, address the following points. + * Is this pull request important and why? + * Is it addressing an issue? If so, what issue? (provide links for convenience please) + * Is this a new feature? If so, why is it useful and/or necessary? + * Are there background references and documents that reviewers should be aware of to properly assess this change? + * Note: make sure to point out any design and architectural decisions that you made and the rationale behind them. + * Note: if you have been working with a specific user and would like them to review your work, make sure you mention them using (@) + * Submit the pull request and iterate with feedback. +3. Merge and Release + * Getting approval: + * You will have to iterate on your changes with feedback from other collaborators to reach a point + where your pull request can be safely merged. + * To avoid too many comments on style and convention, make sure that you have a + look at our style section below before creating a pull request. + * Eventually, someone from the zstd team will approve your pull request and not long after merge it into + the dev branch. + * Housekeeping: + * Most PRs are linked with one or more Github issues. If this is the case for your PR, make sure + the corresponding issue is mentioned. If your change 'fixes' or completely addresses the + issue at hand, then please indicate this by requesting that an issue be closed by commenting. + * Just because your changes have been merged does not mean the topic or larger issue is complete. Remember + that the change must make it to an official zstd release for it to be meaningful. We recommend + that contributers track the activity on their pull request and corresponding issue(s) page(s) until + their change makes it to the next release of zstd. Users will often discover bugs in your code or + suggest ways to refine and improve your initial changes even after the pull request is merged. + +## Static Analysis +Static analysis is a process for examining the correctness or validity of a program without actually +executing it. It usually helps us find many simple bugs. Zstd uses clang's `scan-build` tool for +static analysis. You can install it by following the instructions for your OS on https://clang-analyzer.llvm.org/scan-build. + +Once installed, you can ensure that our static analysis tests pass on your local development machine +by running: +``` +make staticAnalyze +``` + +In general, you can use `scan-build` to static analyze any build script. For example, to static analyze +just `contrib/largeNbDicts` and nothing else, you can run: + +``` +scan-build make -C contrib/largeNbDicts largeNbDicts +``` + +## Performance +Performance is extremely important for zstd and we only merge pull requests whose performance +landscape and corresponding trade-offs have been adequately analyzed, reproduced, and presented. +This high bar for performance means that every PR which has the potential to +impact performance takes a very long time for us to properly review. That being said, we +always welcome contributions to improve performance (or worsen performance for the trade-off of +something else). Please keep the following in mind before submitting a performance related PR: + +1. Zstd isn't as old as gzip but it has been around for time now and its evolution is +very well documented via past Github issues and pull requests. It may be the case that your +particular performance optimization has already been considered in the past. Please take some +time to search through old issues and pull requests using keywords specific to your +would-be PR. Of course, just because a topic has already been discussed (and perhaps rejected +on some grounds) in the past, doesn't mean it isn't worth bringing up again. But even in that case, +it will be helpful for you to have context from that topic's history before contributing. +2. The distinction between noise and actual performance gains can unfortunately be very subtle +especially when microbenchmarking extremely small wins or losses. The only remedy to getting +something subtle merged is extensive benchmarking. You will be doing us a great favor if you +take the time to run extensive, long-duration, and potentially cross-(os, platform, process, etc) +benchmarks on your end before submitting a PR. Of course, you will not be able to benchmark +your changes on every single processor and os out there (and neither will we) but do that best +you can:) We've adding some things to think about when benchmarking below in the Benchmarking +Performance section which might be helpful for you. +3. Optimizing performance for a certain OS, processor vendor, compiler, or network system is a perfectly +legitimate thing to do as long as it does not harm the overall performance health of Zstd. +This is a hard balance to strike but please keep in mind other aspects of Zstd when +submitting changes that are clang-specific, windows-specific, etc. + +## Benchmarking Performance +Performance microbenchmarking is a tricky subject but also essential for Zstd. We value empirical +testing over theoretical speculation. This guide it not perfect but for most scenarios, it +is a good place to start. + +### Stability +Unfortunately, the most important aspect in being able to benchmark reliably is to have a stable +benchmarking machine. A virtual machine, a machine with shared resources, or your laptop +will typically not be stable enough to obtain reliable benchmark results. If you can get your +hands on a desktop, this is usually a better scenario. + +Of course, benchmarking can be done on non-hyper-stable machines as well. You will just have to +do a little more work to ensure that you are in fact measuring the changes you've made not and +noise. Here are some things you can do to make your benchmarks more stable: + +1. The most simple thing you can do to drastically improve the stability of your benchmark is +to run it multiple times and then aggregate the results of those runs. As a general rule of +thumb, the smaller the change you are trying to measure, the more samples of benchmark runs +you will have to aggregate over to get reliable results. Here are some additional things to keep in +mind when running multiple trials: + * How you aggregate your samples are important. You might be tempted to use the mean of your + results. While this is certainly going to be a more stable number than a raw single sample + benchmark number, you might have more luck by taking the median. The mean is not robust to + outliers whereas the median is. Better still, you could simply take the fastest speed your + benchmark achieved on each run since that is likely the fastest your process will be + capable of running your code. In our experience, this (aggregating by just taking the sample + with the fastest running time) has been the most stable approach. + * The more samples you have, the more stable your benchmarks should be. You can verify + your improved stability by looking at the size of your confidence intervals as you + increase your sample count. These should get smaller and smaller. Eventually hopefully + smaller than the performance win you are expecting. + * Most processors will take some time to get `hot` when running anything. The observations + you collect during that time period will very different from the true performance number. Having + a very large number of sample will help alleviate this problem slightly but you can also + address is directly by simply not including the first `n` iterations of your benchmark in + your aggregations. You can determine `n` by simply looking at the results from each iteration + and then hand picking a good threshold after which the variance in results seems to stabilize. +2. You cannot really get reliable benchmarks if your host machine is simultaneously running +another cpu/memory-intensive application in the background. If you are running benchmarks on your +personal laptop for instance, you should close all applications (including your code editor and +browser) before running your benchmarks. You might also have invisible background applications +running. You can see what these are by looking at either Activity Monitor on Mac or Task Manager +on Windows. You will get more stable benchmark results of you end those processes as well. + * If you have multiple cores, you can even run your benchmark on a reserved core to prevent + pollution from other OS and user processes. There are a number of ways to do this depending + on your OS: + * On linux boxes, you have use https://github.com/lpechacek/cpuset. + * On Windows, you can "Set Processor Affinity" using https://www.thewindowsclub.com/processor-affinity-windows + * On Mac, you can try to use their dedicated affinity API https://developer.apple.com/library/archive/releasenotes/Performance/RN-AffinityAPI/#//apple_ref/doc/uid/TP40006635-CH1-DontLinkElementID_2 +3. To benchmark, you will likely end up writing a separate c/c++ program that will link libzstd. +Dynamically linking your library will introduce some added variation (not a large amount but +definitely some). Statically linking libzstd will be more stable. Static libraries should +be enabled by default when building zstd. +4. Use a profiler with a good high resolution timer. See the section below on profiling for +details on this. +5. Disable frequency scaling, turbo boost and address space randomization (this will vary by OS) +6. Try to avoid storage. On some systems you can use tmpfs. Putting the program, inputs and outputs on +tmpfs avoids touching a real storage system, which can have a pretty big variability. + +Also check our LLVM's guide on benchmarking here: https://llvm.org/docs/Benchmarking.html + +### Zstd benchmark +The fastest signal you can get regarding your performance changes is via the in-build zstd cli +bench option. You can run Zstd as you typically would for your scenario using some set of options +and then additionally also specify the `-b#` option. Doing this will run our benchmarking pipeline +for that options you have just provided. If you want to look at the internals of how this +benchmarking script works, you can check out programs/benchzstd.c + +For example: say you have made a change that you believe improves the speed of zstd level 1. The +very first thing you should use to asses whether you actually achieved any sort of improvement +is `zstd -b`. You might try to do something like this. Note: you can use the `-i` option to +specify a running time for your benchmark in seconds (default is 3 seconds). +Usually, the longer the running time, the more stable your results will be. + +``` +$ git checkout +$ make && cp zstd zstd-old +$ git checkout +$ make && cp zstd zstd-new +$ zstd-old -i5 -b1 + 1 : 8990 -> 3992 (2.252), 302.6 MB/s , 626.4 MB/s +$ zstd-new -i5 -b1 + 1 : 8990 -> 3992 (2.252), 302.8 MB/s , 628.4 MB/s +``` + +Unless your performance win is large enough to be visible despite the intrinsic noise +on your computer, benchzstd alone will likely not be enough to validate the impact of your +changes. For example, the results of the example above indicate that effectively nothing +changed but there could be a small <3% improvement that the noise on the host machine +obscured. So unless you see a large performance win (10-15% consistently) using just +this method of evaluation will not be sufficient. + +### Profiling +There are a number of great profilers out there. We're going to briefly mention how you can +profile your code using `instruments` on mac, `perf` on linux and `visual studio profiler` +on windows. + +Say you have an idea for a change that you think will provide some good performance gains +for level 1 compression on Zstd. Typically this means, you have identified a section of +code that you think can be made to run faster. + +The first thing you will want to do is make sure that the piece of code is actually taking up +a notable amount of time to run. It is usually not worth optimzing something which accounts for less than +0.0001% of the total running time. Luckily, there are tools to help with this. +Profilers will let you see how much time your code spends inside a particular function. +If your target code snippit is only part of a function, it might be worth trying to +isolate that snippit by moving it to its own function (this is usually not necessary but +might be). + +Most profilers (including the profilers dicusssed below) will generate a call graph of +functions for you. Your goal will be to find your function of interest in this call grapch +and then inspect the time spent inside of it. You might also want to to look at the +annotated assembly which most profilers will provide you with. + +#### Instruments +We will once again consider the scenario where you think you've identified a piece of code +whose performance can be improved upon. Follow these steps to profile your code using +Instruments. + +1. Open Instruments +2. Select `Time Profiler` from the list of standard templates +3. Close all other applications except for your instruments window and your terminal +4. Run your benchmarking script from your terminal window + * You will want a benchmark that runs for at least a few seconds (5 seconds will + usually be long enough). This way the profiler will have something to work with + and you will have ample time to attach your profiler to this process:) + * I will just use benchzstd as my bencharmking script for this example: +``` +$ zstd -b1 -i5 # this will run for 5 seconds +``` +5. Once you run your benchmarking script, switch back over to instruments and attach your +process to the time profiler. You can do this by: + * Clicking on the `All Processes` drop down in the top left of the toolbar. + * Selecting your process from the dropdown. In my case, it is just going to be labled + `zstd` + * Hitting the bright red record circle button on the top left of the toolbar +6. You profiler will now start collecting metrics from your bencharking script. Once +you think you have collected enough samples (usually this is the case after 3 seconds of +recording), stop your profiler. +7. Make sure that in toolbar of the bottom window, `profile` is selected. +8. You should be able to see your call graph. + * If you don't see the call graph or an incomplete call graph, make sure you have compiled + zstd and your benchmarking scripg using debug flags. On mac and linux, this just means + you will have to supply the `-g` flag alone with your build script. You might also + have to provide the `-fno-omit-frame-pointer` flag +9. Dig down the graph to find your function call and then inspect it by double clicking +the list item. You will be able to see the annotated source code and the assembly side by +side. + +#### Perf + +This wiki has a pretty detailed tutorial on getting started working with perf so we'll +leave you to check that out of you're getting started: + +https://perf.wiki.kernel.org/index.php/Tutorial + +Some general notes on perf: +* Use `perf stat -r # ` to quickly get some relevant timing and +counter statistics. Perf uses a high resolution timer and this is likely one +of the first things your team will run when assessing your PR. +* Perf has a long list of hardware counters that can be viewed with `perf --list`. +When measuring optimizations, something worth trying is to make sure the handware +counters you expect to be impacted by your change are in fact being so. For example, +if you expect the L1 cache misses to decrease with your change, you can look at the +counter `L1-dcache-load-misses` +* Perf hardware counters will not work on a virtual machine. + +#### Visual Studio + +TODO + + +## Setting up continuous integration (CI) on your fork +Zstd uses a number of different continuous integration (CI) tools to ensure that new changes +are well tested before they make it to an official release. Specifically, we use the platforms +travis-ci, circle-ci, and appveyor. + +Changes cannot be merged into the main dev branch unless they pass all of our CI tests. +The easiest way to run these CI tests on your own before submitting a PR to our dev branch +is to configure your personal fork of zstd with each of the CI platforms. Below, you'll find +instructions for doing this. + +### travis-ci +Follow these steps to link travis-ci with your github fork of zstd + +1. Make sure you are logged into your github account +2. Go to https://travis-ci.org/ +3. Click 'Sign in with Github' on the top right +4. Click 'Authorize travis-ci' +5. Click 'Activate all repositories using Github Apps' +6. Select 'Only select repositories' and select your fork of zstd from the drop down +7. Click 'Approve and Install' +8. Click 'Sign in with Github' again. This time, it will be for travis-pro (which will let you view your tests on the web dashboard) +9. Click 'Authorize travis-pro' +10. You should have travis set up on your fork now. + +### circle-ci +TODO + +### appveyor +Follow these steps to link circle-ci with your girhub fork of zstd + +1. Make sure you are logged into your github account +2. Go to https://www.appveyor.com/ +3. Click 'Sign in' on the top right +4. Select 'Github' on the left panel +5. Click 'Authorize appveyor' +6. You might be asked to select which repositories you want to give appveyor permission to. Select your fork of zstd if you're prompted +7. You should have appveyor set up on your fork now. + +### General notes on CI +CI tests run every time a pull request (PR) is created or updated. The exact tests +that get run will depend on the destination branch you specify. Some tests take +longer to run than others. Currently, our CI is set up to run a short +series of tests when creating a PR to the dev branch and a longer series of tests +when creating a PR to the master branch. You can look in the configuration files +of the respective CI platform for more information on what gets run when. + +Most people will just want to create a PR with the destination set to their local dev +branch of zstd. You can then find the status of the tests on the PR's page. You can also +re-run tests and cancel running tests from the PR page or from the respective CI's dashboard. + +## Issues +We use GitHub issues to track public bugs. Please ensure your description is +clear and has sufficient instructions to be able to reproduce the issue. + +Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe +disclosure of security bugs. In those cases, please go through the process +outlined on that page and do not file a public issue. + +## Coding Style +* 4 spaces for indentation rather than tabs + +## License +By contributing to Zstandard, you agree that your contributions will be licensed +under both the [LICENSE](LICENSE) file and the [COPYING](COPYING) file in the root directory of this source tree. Copied: vendor/zstd/1.4.5/Makefile (from r361423, vendor/zstd/dist/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/1.4.5/Makefile Sat May 23 20:38:30 2020 (r361424, copy of r361423, vendor/zstd/dist/Makefile) @@ -0,0 +1,414 @@ +# ################################################################ +# Copyright (c) 2015-2020, Yann Collet, Facebook, Inc. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. +# ################################################################ + +PRGDIR = programs +ZSTDDIR = lib +BUILDIR = build +ZWRAPDIR = zlibWrapper +TESTDIR = tests +FUZZDIR = $(TESTDIR)/fuzz + +# Define nul output +VOID = /dev/null + +# When cross-compiling from linux to windows, you might +# need to specify this as "Windows." Fedora build fails +# without it. +# +# Note: mingw-w64 build from linux to windows does not +# fail on other tested distros (ubuntu, debian) even +# without manually specifying the TARGET_SYSTEM. +TARGET_SYSTEM ?= $(OS) + +ifneq (,$(filter Windows%,$(TARGET_SYSTEM))) +EXT =.exe +else +EXT = +endif + +## default: Build lib-release and zstd-release +.PHONY: default +default: lib-release zstd-release + +.PHONY: all +all: allmost examples manual contrib + +.PHONY: allmost +allmost: allzstd zlibwrapper *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat May 23 20:39: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 2D2ED2DD993; Sat, 23 May 2020 20:39:37 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TwFj0Jpcz4dCq; Sat, 23 May 2020 20:39:37 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0555915BAD; Sat, 23 May 2020 20:39:37 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NKdasb047170; Sat, 23 May 2020 20:39:36 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NKdaNi047169; Sat, 23 May 2020 20:39:36 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005232039.04NKdaNi047169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 23 May 2020 20:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361425 - head/sys/contrib/zstd X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/contrib/zstd X-SVN-Commit-Revision: 361425 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, 23 May 2020 20:39:37 -0000 Author: cem Date: Sat May 23 20:39:36 2020 New Revision: 361425 URL: https://svnweb.freebsd.org/changeset/base/361425 Log: contrib/zstd: Revise Xlist for 1.4.5 import Modified: head/sys/contrib/zstd/FREEBSD-Xlist Modified: head/sys/contrib/zstd/FREEBSD-Xlist ============================================================================== --- head/sys/contrib/zstd/FREEBSD-Xlist Sat May 23 20:38:30 2020 (r361424) +++ head/sys/contrib/zstd/FREEBSD-Xlist Sat May 23 20:39:36 2020 (r361425) @@ -2,11 +2,11 @@ $FreeBSD$ .circleci .cirrus.yml +.github .gitignore .travis.yml build -contrib/linux-kernel -contrib/single_file_decoder -contrib/VS2005 +contrib lib/dll programs/windres +tests From owner-svn-src-all@freebsd.org Sat May 23 21:23: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 91D4B2DE7A0; Sat, 23 May 2020 21:23:49 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TxDj2Bwdz3SqL; Sat, 23 May 2020 21:23:49 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45F7F165CD; Sat, 23 May 2020 21:23:49 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NLNnuA078960; Sat, 23 May 2020 21:23:49 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NLNkG4078947; Sat, 23 May 2020 21:23:46 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005232123.04NLNkG4078947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 23 May 2020 21:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361426 - in head: lib/libzstd sys/conf sys/contrib/zstd sys/contrib/zstd/contrib sys/contrib/zstd/contrib/docker sys/contrib/zstd/contrib/experimental_dict_builders/benchmarkDictBuilde... X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: lib/libzstd sys/conf sys/contrib/zstd sys/contrib/zstd/contrib sys/contrib/zstd/contrib/docker sys/contrib/zstd/contrib/experimental_dict_builders/benchmarkDictBuilder sys/contrib/zstd/contri... X-SVN-Commit-Revision: 361426 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, 23 May 2020 21:23:49 -0000 Author: cem Date: Sat May 23 21:23:46 2020 New Revision: 361426 URL: https://svnweb.freebsd.org/changeset/base/361426 Log: Update to Zstandard 1.4.5 As usual, the full release notes are found on Github: https://github.com/facebook/zstd/releases/tag/v1.4.5 Notable changes include: * Improved decompress performance on amd64 and arm (5-10% and 15-50%, respectively). * '--patch-from' zstd(1) CLI option, which provides something like a very fast version of bspatch(1) with slightly worse compression. See release notes. In this update, I dropped the 3-year old -O0 workaround for an LLVM ARM bug; the bug was fixed in LLVM SVN in 2017, but we didn't remove this workaround from our tree until now. MFC after: I won't, but feel free Relnotes: yes Added: head/sys/contrib/zstd/lib/compress/zstd_compress_superblock.c - copied unchanged from r361425, vendor/zstd/dist/lib/compress/zstd_compress_superblock.c head/sys/contrib/zstd/lib/compress/zstd_compress_superblock.h - copied unchanged from r361425, vendor/zstd/dist/lib/compress/zstd_compress_superblock.h Deleted: head/sys/contrib/zstd/contrib/cleanTabs head/sys/contrib/zstd/contrib/docker/Dockerfile head/sys/contrib/zstd/contrib/docker/README.md head/sys/contrib/zstd/contrib/experimental_dict_builders/benchmarkDictBuilder/Makefile head/sys/contrib/zstd/contrib/experimental_dict_builders/benchmarkDictBuilder/README.md head/sys/contrib/zstd/contrib/experimental_dict_builders/benchmarkDictBuilder/benchmark.c head/sys/contrib/zstd/contrib/experimental_dict_builders/benchmarkDictBuilder/dictBuilder.h head/sys/contrib/zstd/contrib/experimental_dict_builders/benchmarkDictBuilder/test.sh head/sys/contrib/zstd/contrib/experimental_dict_builders/fastCover/Makefile head/sys/contrib/zstd/contrib/experimental_dict_builders/fastCover/README.md head/sys/contrib/zstd/contrib/experimental_dict_builders/fastCover/fastCover.c head/sys/contrib/zstd/contrib/experimental_dict_builders/fastCover/fastCover.h head/sys/contrib/zstd/contrib/experimental_dict_builders/fastCover/main.c head/sys/contrib/zstd/contrib/experimental_dict_builders/fastCover/test.sh head/sys/contrib/zstd/contrib/experimental_dict_builders/randomDictBuilder/Makefile head/sys/contrib/zstd/contrib/experimental_dict_builders/randomDictBuilder/README.md head/sys/contrib/zstd/contrib/experimental_dict_builders/randomDictBuilder/io.c head/sys/contrib/zstd/contrib/experimental_dict_builders/randomDictBuilder/io.h head/sys/contrib/zstd/contrib/experimental_dict_builders/randomDictBuilder/main.c head/sys/contrib/zstd/contrib/experimental_dict_builders/randomDictBuilder/random.c head/sys/contrib/zstd/contrib/experimental_dict_builders/randomDictBuilder/random.h head/sys/contrib/zstd/contrib/experimental_dict_builders/randomDictBuilder/test.sh head/sys/contrib/zstd/contrib/gen_html/Makefile head/sys/contrib/zstd/contrib/gen_html/README.md head/sys/contrib/zstd/contrib/gen_html/gen-zstd-manual.sh head/sys/contrib/zstd/contrib/gen_html/gen_html.cpp head/sys/contrib/zstd/contrib/largeNbDicts/Makefile head/sys/contrib/zstd/contrib/largeNbDicts/README.md head/sys/contrib/zstd/contrib/largeNbDicts/largeNbDicts.c head/sys/contrib/zstd/contrib/premake/premake4.lua head/sys/contrib/zstd/contrib/premake/zstd.lua head/sys/contrib/zstd/contrib/pzstd/BUCK head/sys/contrib/zstd/contrib/pzstd/ErrorHolder.h head/sys/contrib/zstd/contrib/pzstd/Logging.h head/sys/contrib/zstd/contrib/pzstd/Makefile head/sys/contrib/zstd/contrib/pzstd/Options.cpp head/sys/contrib/zstd/contrib/pzstd/Options.h head/sys/contrib/zstd/contrib/pzstd/Pzstd.cpp head/sys/contrib/zstd/contrib/pzstd/Pzstd.h head/sys/contrib/zstd/contrib/pzstd/README.md head/sys/contrib/zstd/contrib/pzstd/SkippableFrame.cpp head/sys/contrib/zstd/contrib/pzstd/SkippableFrame.h head/sys/contrib/zstd/contrib/pzstd/images/Cspeed.png head/sys/contrib/zstd/contrib/pzstd/images/Dspeed.png head/sys/contrib/zstd/contrib/pzstd/main.cpp head/sys/contrib/zstd/contrib/pzstd/test/BUCK head/sys/contrib/zstd/contrib/pzstd/test/OptionsTest.cpp head/sys/contrib/zstd/contrib/pzstd/test/PzstdTest.cpp head/sys/contrib/zstd/contrib/pzstd/test/RoundTrip.h head/sys/contrib/zstd/contrib/pzstd/test/RoundTripTest.cpp head/sys/contrib/zstd/contrib/pzstd/utils/BUCK head/sys/contrib/zstd/contrib/pzstd/utils/Buffer.h head/sys/contrib/zstd/contrib/pzstd/utils/FileSystem.h head/sys/contrib/zstd/contrib/pzstd/utils/Likely.h head/sys/contrib/zstd/contrib/pzstd/utils/Range.h head/sys/contrib/zstd/contrib/pzstd/utils/ResourcePool.h head/sys/contrib/zstd/contrib/pzstd/utils/ScopeGuard.h head/sys/contrib/zstd/contrib/pzstd/utils/ThreadPool.h head/sys/contrib/zstd/contrib/pzstd/utils/WorkQueue.h head/sys/contrib/zstd/contrib/pzstd/utils/test/BUCK head/sys/contrib/zstd/contrib/pzstd/utils/test/BufferTest.cpp head/sys/contrib/zstd/contrib/pzstd/utils/test/RangeTest.cpp head/sys/contrib/zstd/contrib/pzstd/utils/test/ResourcePoolTest.cpp head/sys/contrib/zstd/contrib/pzstd/utils/test/ScopeGuardTest.cpp head/sys/contrib/zstd/contrib/pzstd/utils/test/ThreadPoolTest.cpp head/sys/contrib/zstd/contrib/pzstd/utils/test/WorkQueueTest.cpp head/sys/contrib/zstd/contrib/seekable_format/examples/Makefile head/sys/contrib/zstd/contrib/seekable_format/examples/parallel_compression.c head/sys/contrib/zstd/contrib/seekable_format/examples/parallel_processing.c head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_compression.c head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_decompression.c head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_decompression_mem.c head/sys/contrib/zstd/contrib/seekable_format/zstd_seekable.h head/sys/contrib/zstd/contrib/seekable_format/zstd_seekable_compression_format.md head/sys/contrib/zstd/contrib/seekable_format/zstdseek_compress.c head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c head/sys/contrib/zstd/contrib/snap/snapcraft.yaml head/sys/contrib/zstd/tests/Makefile head/sys/contrib/zstd/tests/README.md head/sys/contrib/zstd/tests/bigdict.c head/sys/contrib/zstd/tests/checkTag.c head/sys/contrib/zstd/tests/datagencli.c head/sys/contrib/zstd/tests/decodecorpus.c head/sys/contrib/zstd/tests/fullbench.c head/sys/contrib/zstd/tests/fuzz/Makefile head/sys/contrib/zstd/tests/fuzz/README.md head/sys/contrib/zstd/tests/fuzz/block_decompress.c head/sys/contrib/zstd/tests/fuzz/block_round_trip.c head/sys/contrib/zstd/tests/fuzz/dictionary_decompress.c head/sys/contrib/zstd/tests/fuzz/dictionary_loader.c head/sys/contrib/zstd/tests/fuzz/dictionary_round_trip.c head/sys/contrib/zstd/tests/fuzz/fuzz.h head/sys/contrib/zstd/tests/fuzz/fuzz.py head/sys/contrib/zstd/tests/fuzz/fuzz_data_producer.c head/sys/contrib/zstd/tests/fuzz/fuzz_data_producer.h head/sys/contrib/zstd/tests/fuzz/fuzz_helpers.h head/sys/contrib/zstd/tests/fuzz/regression_driver.c head/sys/contrib/zstd/tests/fuzz/simple_compress.c head/sys/contrib/zstd/tests/fuzz/simple_decompress.c head/sys/contrib/zstd/tests/fuzz/simple_round_trip.c head/sys/contrib/zstd/tests/fuzz/stream_decompress.c head/sys/contrib/zstd/tests/fuzz/stream_round_trip.c head/sys/contrib/zstd/tests/fuzz/zstd_frame_info.c head/sys/contrib/zstd/tests/fuzz/zstd_helpers.c head/sys/contrib/zstd/tests/fuzz/zstd_helpers.h head/sys/contrib/zstd/tests/fuzzer.c head/sys/contrib/zstd/tests/golden-compression/huffman-compressed-larger head/sys/contrib/zstd/tests/golden-decompression/rle-first-block.zst head/sys/contrib/zstd/tests/gzip/Makefile head/sys/contrib/zstd/tests/gzip/gzip-env.sh head/sys/contrib/zstd/tests/gzip/helin-segv.sh head/sys/contrib/zstd/tests/gzip/help-version.sh head/sys/contrib/zstd/tests/gzip/hufts-segv.gz head/sys/contrib/zstd/tests/gzip/hufts.sh head/sys/contrib/zstd/tests/gzip/init.cfg head/sys/contrib/zstd/tests/gzip/init.sh head/sys/contrib/zstd/tests/gzip/keep.sh head/sys/contrib/zstd/tests/gzip/list.sh head/sys/contrib/zstd/tests/gzip/memcpy-abuse.sh head/sys/contrib/zstd/tests/gzip/mixed.sh head/sys/contrib/zstd/tests/gzip/null-suffix-clobber.sh head/sys/contrib/zstd/tests/gzip/stdin.sh head/sys/contrib/zstd/tests/gzip/test-driver.sh head/sys/contrib/zstd/tests/gzip/trailing-nul.sh head/sys/contrib/zstd/tests/gzip/unpack-invalid.sh head/sys/contrib/zstd/tests/gzip/z-suffix.sh head/sys/contrib/zstd/tests/gzip/zdiff.sh head/sys/contrib/zstd/tests/gzip/zgrep-context.sh head/sys/contrib/zstd/tests/gzip/zgrep-f.sh head/sys/contrib/zstd/tests/gzip/zgrep-signal.sh head/sys/contrib/zstd/tests/gzip/znew-k.sh head/sys/contrib/zstd/tests/invalidDictionaries.c head/sys/contrib/zstd/tests/legacy.c head/sys/contrib/zstd/tests/libzstd_partial_builds.sh head/sys/contrib/zstd/tests/longmatch.c head/sys/contrib/zstd/tests/paramgrill.c head/sys/contrib/zstd/tests/playTests.sh head/sys/contrib/zstd/tests/poolTests.c head/sys/contrib/zstd/tests/rateLimiter.py head/sys/contrib/zstd/tests/regression/Makefile head/sys/contrib/zstd/tests/regression/config.c head/sys/contrib/zstd/tests/regression/config.h head/sys/contrib/zstd/tests/regression/data.c head/sys/contrib/zstd/tests/regression/data.h head/sys/contrib/zstd/tests/regression/levels.h head/sys/contrib/zstd/tests/regression/method.c head/sys/contrib/zstd/tests/regression/method.h head/sys/contrib/zstd/tests/regression/result.c head/sys/contrib/zstd/tests/regression/result.h head/sys/contrib/zstd/tests/regression/results.csv head/sys/contrib/zstd/tests/regression/test.c head/sys/contrib/zstd/tests/roundTripCrash.c head/sys/contrib/zstd/tests/seqgen.c head/sys/contrib/zstd/tests/seqgen.h head/sys/contrib/zstd/tests/symbols.c head/sys/contrib/zstd/tests/test-zstd-speed.py head/sys/contrib/zstd/tests/test-zstd-versions.py head/sys/contrib/zstd/tests/zbufftest.c head/sys/contrib/zstd/tests/zstreamtest.c Modified: head/lib/libzstd/Makefile head/sys/conf/files head/sys/contrib/zstd/CHANGELOG head/sys/contrib/zstd/CONTRIBUTING.md head/sys/contrib/zstd/Makefile head/sys/contrib/zstd/README.md head/sys/contrib/zstd/TESTING.md head/sys/contrib/zstd/appveyor.yml head/sys/contrib/zstd/doc/educational_decoder/Makefile head/sys/contrib/zstd/doc/educational_decoder/README.md head/sys/contrib/zstd/doc/educational_decoder/harness.c head/sys/contrib/zstd/doc/educational_decoder/zstd_decompress.c head/sys/contrib/zstd/doc/educational_decoder/zstd_decompress.h head/sys/contrib/zstd/doc/zstd_compression_format.md head/sys/contrib/zstd/doc/zstd_manual.html head/sys/contrib/zstd/examples/Makefile head/sys/contrib/zstd/examples/common.h head/sys/contrib/zstd/examples/dictionary_compression.c head/sys/contrib/zstd/examples/dictionary_decompression.c head/sys/contrib/zstd/examples/multiple_simple_compression.c head/sys/contrib/zstd/examples/multiple_streaming_compression.c head/sys/contrib/zstd/examples/simple_compression.c head/sys/contrib/zstd/examples/simple_decompression.c head/sys/contrib/zstd/examples/streaming_compression.c head/sys/contrib/zstd/examples/streaming_decompression.c head/sys/contrib/zstd/examples/streaming_memory_usage.c head/sys/contrib/zstd/lib/Makefile head/sys/contrib/zstd/lib/README.md head/sys/contrib/zstd/lib/common/bitstream.h head/sys/contrib/zstd/lib/common/compiler.h head/sys/contrib/zstd/lib/common/cpu.h head/sys/contrib/zstd/lib/common/debug.c head/sys/contrib/zstd/lib/common/debug.h head/sys/contrib/zstd/lib/common/entropy_common.c head/sys/contrib/zstd/lib/common/error_private.c head/sys/contrib/zstd/lib/common/error_private.h head/sys/contrib/zstd/lib/common/fse.h head/sys/contrib/zstd/lib/common/fse_decompress.c head/sys/contrib/zstd/lib/common/huf.h head/sys/contrib/zstd/lib/common/mem.h head/sys/contrib/zstd/lib/common/pool.c head/sys/contrib/zstd/lib/common/pool.h head/sys/contrib/zstd/lib/common/threading.c head/sys/contrib/zstd/lib/common/threading.h head/sys/contrib/zstd/lib/common/xxhash.c head/sys/contrib/zstd/lib/common/xxhash.h head/sys/contrib/zstd/lib/common/zstd_common.c head/sys/contrib/zstd/lib/common/zstd_errors.h head/sys/contrib/zstd/lib/common/zstd_internal.h head/sys/contrib/zstd/lib/compress/fse_compress.c head/sys/contrib/zstd/lib/compress/hist.c head/sys/contrib/zstd/lib/compress/hist.h head/sys/contrib/zstd/lib/compress/huf_compress.c head/sys/contrib/zstd/lib/compress/zstd_compress.c head/sys/contrib/zstd/lib/compress/zstd_compress_internal.h head/sys/contrib/zstd/lib/compress/zstd_compress_literals.c head/sys/contrib/zstd/lib/compress/zstd_compress_literals.h head/sys/contrib/zstd/lib/compress/zstd_compress_sequences.c head/sys/contrib/zstd/lib/compress/zstd_compress_sequences.h head/sys/contrib/zstd/lib/compress/zstd_cwksp.h head/sys/contrib/zstd/lib/compress/zstd_double_fast.c head/sys/contrib/zstd/lib/compress/zstd_double_fast.h head/sys/contrib/zstd/lib/compress/zstd_fast.c head/sys/contrib/zstd/lib/compress/zstd_fast.h head/sys/contrib/zstd/lib/compress/zstd_lazy.c head/sys/contrib/zstd/lib/compress/zstd_lazy.h head/sys/contrib/zstd/lib/compress/zstd_ldm.c head/sys/contrib/zstd/lib/compress/zstd_ldm.h head/sys/contrib/zstd/lib/compress/zstd_opt.c head/sys/contrib/zstd/lib/compress/zstd_opt.h head/sys/contrib/zstd/lib/compress/zstdmt_compress.c head/sys/contrib/zstd/lib/compress/zstdmt_compress.h head/sys/contrib/zstd/lib/decompress/huf_decompress.c head/sys/contrib/zstd/lib/decompress/zstd_ddict.c head/sys/contrib/zstd/lib/decompress/zstd_ddict.h head/sys/contrib/zstd/lib/decompress/zstd_decompress.c head/sys/contrib/zstd/lib/decompress/zstd_decompress_block.c head/sys/contrib/zstd/lib/decompress/zstd_decompress_block.h head/sys/contrib/zstd/lib/decompress/zstd_decompress_internal.h head/sys/contrib/zstd/lib/deprecated/zbuff.h head/sys/contrib/zstd/lib/deprecated/zbuff_common.c head/sys/contrib/zstd/lib/deprecated/zbuff_compress.c head/sys/contrib/zstd/lib/deprecated/zbuff_decompress.c head/sys/contrib/zstd/lib/dictBuilder/cover.c head/sys/contrib/zstd/lib/dictBuilder/cover.h head/sys/contrib/zstd/lib/dictBuilder/fastcover.c head/sys/contrib/zstd/lib/dictBuilder/zdict.c head/sys/contrib/zstd/lib/dictBuilder/zdict.h head/sys/contrib/zstd/lib/legacy/zstd_legacy.h head/sys/contrib/zstd/lib/legacy/zstd_v01.c head/sys/contrib/zstd/lib/legacy/zstd_v01.h head/sys/contrib/zstd/lib/legacy/zstd_v02.c head/sys/contrib/zstd/lib/legacy/zstd_v02.h head/sys/contrib/zstd/lib/legacy/zstd_v03.c head/sys/contrib/zstd/lib/legacy/zstd_v03.h head/sys/contrib/zstd/lib/legacy/zstd_v04.c head/sys/contrib/zstd/lib/legacy/zstd_v04.h head/sys/contrib/zstd/lib/legacy/zstd_v05.c head/sys/contrib/zstd/lib/legacy/zstd_v05.h head/sys/contrib/zstd/lib/legacy/zstd_v06.c head/sys/contrib/zstd/lib/legacy/zstd_v06.h head/sys/contrib/zstd/lib/legacy/zstd_v07.c head/sys/contrib/zstd/lib/legacy/zstd_v07.h head/sys/contrib/zstd/lib/libzstd.pc.in head/sys/contrib/zstd/lib/zstd.h head/sys/contrib/zstd/programs/Makefile head/sys/contrib/zstd/programs/README.md head/sys/contrib/zstd/programs/benchfn.c head/sys/contrib/zstd/programs/benchfn.h head/sys/contrib/zstd/programs/benchzstd.c head/sys/contrib/zstd/programs/benchzstd.h head/sys/contrib/zstd/programs/datagen.c head/sys/contrib/zstd/programs/datagen.h head/sys/contrib/zstd/programs/dibio.c head/sys/contrib/zstd/programs/dibio.h head/sys/contrib/zstd/programs/fileio.c head/sys/contrib/zstd/programs/fileio.h head/sys/contrib/zstd/programs/platform.h head/sys/contrib/zstd/programs/timefn.c head/sys/contrib/zstd/programs/timefn.h head/sys/contrib/zstd/programs/util.c head/sys/contrib/zstd/programs/util.h head/sys/contrib/zstd/programs/zstd.1 head/sys/contrib/zstd/programs/zstd.1.md head/sys/contrib/zstd/programs/zstdcli.c head/sys/contrib/zstd/programs/zstdgrep head/sys/contrib/zstd/programs/zstdgrep.1 head/sys/contrib/zstd/programs/zstdless.1 head/sys/contrib/zstd/zlibWrapper/Makefile head/sys/contrib/zstd/zlibWrapper/examples/zwrapbench.c head/sys/contrib/zstd/zlibWrapper/gzcompatibility.h head/sys/contrib/zstd/zlibWrapper/zstd_zlibwrapper.c head/sys/contrib/zstd/zlibWrapper/zstd_zlibwrapper.h Directory Properties: head/sys/contrib/zstd/ (props changed) Modified: head/lib/libzstd/Makefile ============================================================================== --- head/lib/libzstd/Makefile Sat May 23 20:39:36 2020 (r361425) +++ head/lib/libzstd/Makefile Sat May 23 21:23:46 2020 (r361426) @@ -13,6 +13,7 @@ SRCS= entropy_common.c \ zstd_compress.c \ zstd_compress_literals.c \ zstd_compress_sequences.c \ + zstd_compress_superblock.c \ zstdmt_compress.c \ huf_decompress.c \ zstd_ddict.c \ @@ -54,13 +55,6 @@ ZSTDDIR= ${SRCTOP}/sys/contrib/zstd # turning off vectorization, which is why there were both." .if ${COMPILER_TYPE} == "gcc" CFLAGS.zstd_decompress_block.c+= -fno-tree-vectorize -.endif - -# Work around for LLVM bug 35023, https://bugs.llvm.org/show_bug.cgi?id=35023 -# Fixed in https://reviews.llvm.org/rL349935 ; not sure if we have that version -# in our LLVM or not yet. -.if ${MACHINE_ARCH:Marm*} != "" -CFLAGS.zstd_compress.c+= -O0 .endif # Work around lack of __bswap[sd]i2() intrinsics on riscv. Probably should be Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat May 23 20:39:36 2020 (r361425) +++ head/sys/conf/files Sat May 23 21:23:46 2020 (r361426) @@ -659,6 +659,7 @@ contrib/zstd/lib/common/xxhash.c optional zstdio comp contrib/zstd/lib/compress/zstd_compress.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/zstd_compress_literals.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/zstd_compress_sequences.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_compress_superblock.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/fse_compress.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/hist.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/huf_compress.c optional zstdio compile-with ${ZSTD_C} Modified: head/sys/contrib/zstd/CHANGELOG ============================================================================== --- head/sys/contrib/zstd/CHANGELOG Sat May 23 20:39:36 2020 (r361425) +++ head/sys/contrib/zstd/CHANGELOG Sat May 23 21:23:46 2020 (r361426) @@ -1,3 +1,29 @@ +v1.4.5 +fix : Compression ratio regression on huge files (> 3 GB) using high levels (--ultra) and multithreading, by @terrelln +perf: Improved decompression speed: x64 : +10% (clang) / +5% (gcc); ARM : from +15% to +50%, depending on SoC, by @terrelln +perf: Automatically downsizes ZSTD_DCtx when too large for too long (#2069, by @bimbashreshta) +perf: Improved fast compression speed on aarch64 (#2040, ~+3%, by @caoyzh) +perf: Small level 1 compression speed gains (depending on compiler) +cli : New --patch-from command, create and apply patches from files, by @bimbashreshta +cli : New --filelist= : Provide a list of files to operate upon from a file +cli : -b -d command can now benchmark decompression on multiple files +cli : New --no-content-size command +cli : New --show-default-cparams information command +api : ZDICT_finalizeDictionary() is promoted to stable (#2111) +api : new experimental parameter ZSTD_d_stableOutBuffer (#2094) +build: Generate a single-file libzstd library (#2065, by @cwoffenden) +build: Relative includes no longer require -I compiler flags for zstd lib subdirs (#2103, by @felixhandte) +build: zstd now compiles cleanly under -pedantic (#2099) +build: zstd now compiles with make-4.3 +build: Support mingw cross-compilation from Linux, by @Ericson2314 +build: Meson multi-thread build fix on windows +build: Some misc icc fixes backed by new ci test on travis +misc: bitflip analyzer tool, by @felixhandte +misc: Extend largeNbDicts benchmark to compression +misc: Edit-distance match finder in contrib/ +doc : Improved beginner CONTRIBUTING.md docs +doc : New issue templates for zstd + v1.4.4 perf: Improved decompression speed, by > 10%, by @terrelln perf: Better compression speed when re-using a context, by @felixhandte @@ -14,7 +40,8 @@ cli: commands --stream-size=# and --size-hint=#, by @n cli: command --exclude-compressed, by @shashank0791 cli: faster `-t` test mode cli: improved some error messages, by @vangyzen -cli: rare deadlock condition within dictionary builder, by @terrelln +cli: fix command `-D dictionary` on Windows, reported by @artyompetrov +cli: fix rare deadlock condition within dictionary builder, by @terrelln build: single-file decoder with emscripten compilation script, by @cwoffenden build: fixed zlibWrapper compilation on Visual Studio, reported by @bluenlive build: fixed deprecation warning for certain gcc version, reported by @jasonma163 Modified: head/sys/contrib/zstd/CONTRIBUTING.md ============================================================================== --- head/sys/contrib/zstd/CONTRIBUTING.md Sat May 23 20:39:36 2020 (r361425) +++ head/sys/contrib/zstd/CONTRIBUTING.md Sat May 23 21:23:46 2020 (r361426) @@ -26,6 +26,356 @@ to do this once to work on any of Facebook's open sour Complete your CLA here: +## Workflow +Zstd uses a branch-based workflow for making changes to the codebase. Typically, zstd +will use a new branch per sizable topic. For smaller changes, it is okay to lump multiple +related changes into a branch. + +Our contribution process works in three main stages: +1. Local development + * Update: + * Checkout your fork of zstd if you have not already + ``` + git checkout https://github.com//zstd + cd zstd + ``` + * Update your local dev branch + ``` + git pull https://github.com/facebook/zstd dev + git push origin dev + ``` + * Topic and development: + * Make a new branch on your fork about the topic you're developing for + ``` + # branch names should be consise but sufficiently informative + git checkout -b + git push origin + ``` + * Make commits and push + ``` + # make some changes = + git add -u && git commit -m + git push origin + ``` + * Note: run local tests to ensure that your changes didn't break existing functionality + * Quick check + ``` + make shortest + ``` + * Longer check + ``` + make test + ``` +2. Code Review and CI tests + * Ensure CI tests pass: + * Before sharing anything to the community, make sure that all CI tests pass on your local fork. + See our section on setting up your CI environment for more information on how to do this. + * Ensure that static analysis passes on your development machine. See the Static Analysis section + below to see how to do this. + * Create a pull request: + * When you are ready to share you changes to the community, create a pull request from your branch + to facebook:dev. You can do this very easily by clicking 'Create Pull Request' on your fork's home + page. + * From there, select the branch where you made changes as your source branch and facebook:dev + as the destination. + * Examine the diff presented between the two branches to make sure there is nothing unexpected. + * Write a good pull request description: + * While there is no strict template that our contributors follow, we would like them to + sufficiently summarize and motivate the changes they are proposing. We recommend all pull requests, + at least indirectly, address the following points. + * Is this pull request important and why? + * Is it addressing an issue? If so, what issue? (provide links for convenience please) + * Is this a new feature? If so, why is it useful and/or necessary? + * Are there background references and documents that reviewers should be aware of to properly assess this change? + * Note: make sure to point out any design and architectural decisions that you made and the rationale behind them. + * Note: if you have been working with a specific user and would like them to review your work, make sure you mention them using (@) + * Submit the pull request and iterate with feedback. +3. Merge and Release + * Getting approval: + * You will have to iterate on your changes with feedback from other collaborators to reach a point + where your pull request can be safely merged. + * To avoid too many comments on style and convention, make sure that you have a + look at our style section below before creating a pull request. + * Eventually, someone from the zstd team will approve your pull request and not long after merge it into + the dev branch. + * Housekeeping: + * Most PRs are linked with one or more Github issues. If this is the case for your PR, make sure + the corresponding issue is mentioned. If your change 'fixes' or completely addresses the + issue at hand, then please indicate this by requesting that an issue be closed by commenting. + * Just because your changes have been merged does not mean the topic or larger issue is complete. Remember + that the change must make it to an official zstd release for it to be meaningful. We recommend + that contributers track the activity on their pull request and corresponding issue(s) page(s) until + their change makes it to the next release of zstd. Users will often discover bugs in your code or + suggest ways to refine and improve your initial changes even after the pull request is merged. + +## Static Analysis +Static analysis is a process for examining the correctness or validity of a program without actually +executing it. It usually helps us find many simple bugs. Zstd uses clang's `scan-build` tool for +static analysis. You can install it by following the instructions for your OS on https://clang-analyzer.llvm.org/scan-build. + +Once installed, you can ensure that our static analysis tests pass on your local development machine +by running: +``` +make staticAnalyze +``` + +In general, you can use `scan-build` to static analyze any build script. For example, to static analyze +just `contrib/largeNbDicts` and nothing else, you can run: + +``` +scan-build make -C contrib/largeNbDicts largeNbDicts +``` + +## Performance +Performance is extremely important for zstd and we only merge pull requests whose performance +landscape and corresponding trade-offs have been adequately analyzed, reproduced, and presented. +This high bar for performance means that every PR which has the potential to +impact performance takes a very long time for us to properly review. That being said, we +always welcome contributions to improve performance (or worsen performance for the trade-off of +something else). Please keep the following in mind before submitting a performance related PR: + +1. Zstd isn't as old as gzip but it has been around for time now and its evolution is +very well documented via past Github issues and pull requests. It may be the case that your +particular performance optimization has already been considered in the past. Please take some +time to search through old issues and pull requests using keywords specific to your +would-be PR. Of course, just because a topic has already been discussed (and perhaps rejected +on some grounds) in the past, doesn't mean it isn't worth bringing up again. But even in that case, +it will be helpful for you to have context from that topic's history before contributing. +2. The distinction between noise and actual performance gains can unfortunately be very subtle +especially when microbenchmarking extremely small wins or losses. The only remedy to getting +something subtle merged is extensive benchmarking. You will be doing us a great favor if you +take the time to run extensive, long-duration, and potentially cross-(os, platform, process, etc) +benchmarks on your end before submitting a PR. Of course, you will not be able to benchmark +your changes on every single processor and os out there (and neither will we) but do that best +you can:) We've adding some things to think about when benchmarking below in the Benchmarking +Performance section which might be helpful for you. +3. Optimizing performance for a certain OS, processor vendor, compiler, or network system is a perfectly +legitimate thing to do as long as it does not harm the overall performance health of Zstd. +This is a hard balance to strike but please keep in mind other aspects of Zstd when +submitting changes that are clang-specific, windows-specific, etc. + +## Benchmarking Performance +Performance microbenchmarking is a tricky subject but also essential for Zstd. We value empirical +testing over theoretical speculation. This guide it not perfect but for most scenarios, it +is a good place to start. + +### Stability +Unfortunately, the most important aspect in being able to benchmark reliably is to have a stable +benchmarking machine. A virtual machine, a machine with shared resources, or your laptop +will typically not be stable enough to obtain reliable benchmark results. If you can get your +hands on a desktop, this is usually a better scenario. + +Of course, benchmarking can be done on non-hyper-stable machines as well. You will just have to +do a little more work to ensure that you are in fact measuring the changes you've made not and +noise. Here are some things you can do to make your benchmarks more stable: + +1. The most simple thing you can do to drastically improve the stability of your benchmark is +to run it multiple times and then aggregate the results of those runs. As a general rule of +thumb, the smaller the change you are trying to measure, the more samples of benchmark runs +you will have to aggregate over to get reliable results. Here are some additional things to keep in +mind when running multiple trials: + * How you aggregate your samples are important. You might be tempted to use the mean of your + results. While this is certainly going to be a more stable number than a raw single sample + benchmark number, you might have more luck by taking the median. The mean is not robust to + outliers whereas the median is. Better still, you could simply take the fastest speed your + benchmark achieved on each run since that is likely the fastest your process will be + capable of running your code. In our experience, this (aggregating by just taking the sample + with the fastest running time) has been the most stable approach. + * The more samples you have, the more stable your benchmarks should be. You can verify + your improved stability by looking at the size of your confidence intervals as you + increase your sample count. These should get smaller and smaller. Eventually hopefully + smaller than the performance win you are expecting. + * Most processors will take some time to get `hot` when running anything. The observations + you collect during that time period will very different from the true performance number. Having + a very large number of sample will help alleviate this problem slightly but you can also + address is directly by simply not including the first `n` iterations of your benchmark in + your aggregations. You can determine `n` by simply looking at the results from each iteration + and then hand picking a good threshold after which the variance in results seems to stabilize. +2. You cannot really get reliable benchmarks if your host machine is simultaneously running +another cpu/memory-intensive application in the background. If you are running benchmarks on your +personal laptop for instance, you should close all applications (including your code editor and +browser) before running your benchmarks. You might also have invisible background applications +running. You can see what these are by looking at either Activity Monitor on Mac or Task Manager +on Windows. You will get more stable benchmark results of you end those processes as well. + * If you have multiple cores, you can even run your benchmark on a reserved core to prevent + pollution from other OS and user processes. There are a number of ways to do this depending + on your OS: + * On linux boxes, you have use https://github.com/lpechacek/cpuset. + * On Windows, you can "Set Processor Affinity" using https://www.thewindowsclub.com/processor-affinity-windows + * On Mac, you can try to use their dedicated affinity API https://developer.apple.com/library/archive/releasenotes/Performance/RN-AffinityAPI/#//apple_ref/doc/uid/TP40006635-CH1-DontLinkElementID_2 +3. To benchmark, you will likely end up writing a separate c/c++ program that will link libzstd. +Dynamically linking your library will introduce some added variation (not a large amount but +definitely some). Statically linking libzstd will be more stable. Static libraries should +be enabled by default when building zstd. +4. Use a profiler with a good high resolution timer. See the section below on profiling for +details on this. +5. Disable frequency scaling, turbo boost and address space randomization (this will vary by OS) +6. Try to avoid storage. On some systems you can use tmpfs. Putting the program, inputs and outputs on +tmpfs avoids touching a real storage system, which can have a pretty big variability. + +Also check our LLVM's guide on benchmarking here: https://llvm.org/docs/Benchmarking.html + +### Zstd benchmark +The fastest signal you can get regarding your performance changes is via the in-build zstd cli +bench option. You can run Zstd as you typically would for your scenario using some set of options +and then additionally also specify the `-b#` option. Doing this will run our benchmarking pipeline +for that options you have just provided. If you want to look at the internals of how this +benchmarking script works, you can check out programs/benchzstd.c + +For example: say you have made a change that you believe improves the speed of zstd level 1. The +very first thing you should use to asses whether you actually achieved any sort of improvement +is `zstd -b`. You might try to do something like this. Note: you can use the `-i` option to +specify a running time for your benchmark in seconds (default is 3 seconds). +Usually, the longer the running time, the more stable your results will be. + +``` +$ git checkout +$ make && cp zstd zstd-old +$ git checkout +$ make && cp zstd zstd-new +$ zstd-old -i5 -b1 + 1 : 8990 -> 3992 (2.252), 302.6 MB/s , 626.4 MB/s +$ zstd-new -i5 -b1 + 1 : 8990 -> 3992 (2.252), 302.8 MB/s , 628.4 MB/s +``` + +Unless your performance win is large enough to be visible despite the intrinsic noise +on your computer, benchzstd alone will likely not be enough to validate the impact of your +changes. For example, the results of the example above indicate that effectively nothing +changed but there could be a small <3% improvement that the noise on the host machine +obscured. So unless you see a large performance win (10-15% consistently) using just +this method of evaluation will not be sufficient. + +### Profiling +There are a number of great profilers out there. We're going to briefly mention how you can +profile your code using `instruments` on mac, `perf` on linux and `visual studio profiler` +on windows. + +Say you have an idea for a change that you think will provide some good performance gains +for level 1 compression on Zstd. Typically this means, you have identified a section of +code that you think can be made to run faster. + +The first thing you will want to do is make sure that the piece of code is actually taking up +a notable amount of time to run. It is usually not worth optimzing something which accounts for less than +0.0001% of the total running time. Luckily, there are tools to help with this. +Profilers will let you see how much time your code spends inside a particular function. +If your target code snippit is only part of a function, it might be worth trying to +isolate that snippit by moving it to its own function (this is usually not necessary but +might be). + +Most profilers (including the profilers dicusssed below) will generate a call graph of +functions for you. Your goal will be to find your function of interest in this call grapch +and then inspect the time spent inside of it. You might also want to to look at the +annotated assembly which most profilers will provide you with. + +#### Instruments +We will once again consider the scenario where you think you've identified a piece of code +whose performance can be improved upon. Follow these steps to profile your code using +Instruments. + +1. Open Instruments +2. Select `Time Profiler` from the list of standard templates +3. Close all other applications except for your instruments window and your terminal +4. Run your benchmarking script from your terminal window + * You will want a benchmark that runs for at least a few seconds (5 seconds will + usually be long enough). This way the profiler will have something to work with + and you will have ample time to attach your profiler to this process:) + * I will just use benchzstd as my bencharmking script for this example: +``` +$ zstd -b1 -i5 # this will run for 5 seconds +``` +5. Once you run your benchmarking script, switch back over to instruments and attach your +process to the time profiler. You can do this by: + * Clicking on the `All Processes` drop down in the top left of the toolbar. + * Selecting your process from the dropdown. In my case, it is just going to be labled + `zstd` + * Hitting the bright red record circle button on the top left of the toolbar +6. You profiler will now start collecting metrics from your bencharking script. Once +you think you have collected enough samples (usually this is the case after 3 seconds of +recording), stop your profiler. +7. Make sure that in toolbar of the bottom window, `profile` is selected. +8. You should be able to see your call graph. + * If you don't see the call graph or an incomplete call graph, make sure you have compiled + zstd and your benchmarking scripg using debug flags. On mac and linux, this just means + you will have to supply the `-g` flag alone with your build script. You might also + have to provide the `-fno-omit-frame-pointer` flag +9. Dig down the graph to find your function call and then inspect it by double clicking +the list item. You will be able to see the annotated source code and the assembly side by +side. + +#### Perf + +This wiki has a pretty detailed tutorial on getting started working with perf so we'll +leave you to check that out of you're getting started: + +https://perf.wiki.kernel.org/index.php/Tutorial + +Some general notes on perf: +* Use `perf stat -r # ` to quickly get some relevant timing and +counter statistics. Perf uses a high resolution timer and this is likely one +of the first things your team will run when assessing your PR. +* Perf has a long list of hardware counters that can be viewed with `perf --list`. +When measuring optimizations, something worth trying is to make sure the handware +counters you expect to be impacted by your change are in fact being so. For example, +if you expect the L1 cache misses to decrease with your change, you can look at the +counter `L1-dcache-load-misses` +* Perf hardware counters will not work on a virtual machine. + +#### Visual Studio + +TODO + + +## Setting up continuous integration (CI) on your fork +Zstd uses a number of different continuous integration (CI) tools to ensure that new changes +are well tested before they make it to an official release. Specifically, we use the platforms +travis-ci, circle-ci, and appveyor. + +Changes cannot be merged into the main dev branch unless they pass all of our CI tests. +The easiest way to run these CI tests on your own before submitting a PR to our dev branch +is to configure your personal fork of zstd with each of the CI platforms. Below, you'll find +instructions for doing this. + +### travis-ci +Follow these steps to link travis-ci with your github fork of zstd + +1. Make sure you are logged into your github account +2. Go to https://travis-ci.org/ +3. Click 'Sign in with Github' on the top right +4. Click 'Authorize travis-ci' +5. Click 'Activate all repositories using Github Apps' +6. Select 'Only select repositories' and select your fork of zstd from the drop down +7. Click 'Approve and Install' +8. Click 'Sign in with Github' again. This time, it will be for travis-pro (which will let you view your tests on the web dashboard) +9. Click 'Authorize travis-pro' +10. You should have travis set up on your fork now. + +### circle-ci +TODO + +### appveyor +Follow these steps to link circle-ci with your girhub fork of zstd + +1. Make sure you are logged into your github account +2. Go to https://www.appveyor.com/ +3. Click 'Sign in' on the top right +4. Select 'Github' on the left panel +5. Click 'Authorize appveyor' +6. You might be asked to select which repositories you want to give appveyor permission to. Select your fork of zstd if you're prompted +7. You should have appveyor set up on your fork now. + +### General notes on CI +CI tests run every time a pull request (PR) is created or updated. The exact tests +that get run will depend on the destination branch you specify. Some tests take +longer to run than others. Currently, our CI is set up to run a short +series of tests when creating a PR to the dev branch and a longer series of tests +when creating a PR to the master branch. You can look in the configuration files +of the respective CI platform for more information on what gets run when. + +Most people will just want to create a PR with the destination set to their local dev +branch of zstd. You can then find the status of the tests on the PR's page. You can also +re-run tests and cancel running tests from the PR page or from the respective CI's dashboard. + ## Issues We use GitHub issues to track public bugs. Please ensure your description is clear and has sufficient instructions to be able to reproduce the issue. @@ -34,7 +384,7 @@ Facebook has a [bounty program](https://www.facebook.c disclosure of security bugs. In those cases, please go through the process outlined on that page and do not file a public issue. -## Coding Style +## Coding Style * 4 spaces for indentation rather than tabs ## License Modified: head/sys/contrib/zstd/Makefile ============================================================================== --- head/sys/contrib/zstd/Makefile Sat May 23 20:39:36 2020 (r361425) +++ head/sys/contrib/zstd/Makefile Sat May 23 21:23:46 2020 (r361426) @@ -1,10 +1,11 @@ # ################################################################ -# Copyright (c) 2015-present, Yann Collet, Facebook, Inc. +# Copyright (c) 2015-2020, Yann Collet, Facebook, Inc. # All rights reserved. # # This source code is licensed under both the BSD-style license (found in the # LICENSE file in the root directory of this source tree) and the GPLv2 (found # in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. # ################################################################ PRGDIR = programs @@ -17,7 +18,16 @@ FUZZDIR = $(TESTDIR)/fuzz # Define nul output VOID = /dev/null -ifneq (,$(filter Windows%,$(OS))) +# When cross-compiling from linux to windows, you might +# need to specify this as "Windows." Fedora build fails +# without it. +# +# Note: mingw-w64 build from linux to windows does not +# fail on other tested distros (ubuntu, debian) even +# without manually specifying the TARGET_SYSTEM. +TARGET_SYSTEM ?= $(OS) + +ifneq (,$(filter Windows%,$(TARGET_SYSTEM))) EXT =.exe else EXT = @@ -35,7 +45,7 @@ allmost: allzstd zlibwrapper # skip zwrapper, can't build that on alternate architectures without the proper zlib installed .PHONY: allzstd -allzstd: lib +allzstd: lib-all $(MAKE) -C $(PRGDIR) all $(MAKE) -C $(TESTDIR) all @@ -45,7 +55,7 @@ all32: $(MAKE) -C $(TESTDIR) all32 .PHONY: lib lib-release libzstd.a -lib lib-release : +lib lib-release lib-all : @$(MAKE) -C $(ZSTDDIR) $@ .PHONY: zstd zstd-release @@ -80,6 +90,13 @@ shortest: .PHONY: check check: shortest +.PHONY: automated_benchmarking +automated_benchmarking: + $(MAKE) -C $(TESTDIR) $@ + +.PHONY: benchmarking +benchmarking: automated_benchmarking + ## examples: build all examples in `/examples` directory .PHONY: examples examples: lib @@ -101,7 +118,8 @@ contrib: lib $(MAKE) -C contrib/pzstd all $(MAKE) -C contrib/seekable_format/examples all $(MAKE) -C contrib/largeNbDicts all - cd contrib/single_file_decoder/ ; ./build_test.sh + cd contrib/single_file_libs/ ; ./build_decoder_test.sh + cd contrib/single_file_libs/ ; ./build_library_test.sh .PHONY: cleanTabs cleanTabs: @@ -337,7 +355,7 @@ endif ifneq (,$(filter MSYS%,$(shell uname))) HOST_OS = MSYS -CMAKE_PARAMS = -G"MSYS Makefiles" -DZSTD_MULTITHREAD_SUPPORT:BOOL=OFF -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON +CMAKE_PARAMS = -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug -DZSTD_MULTITHREAD_SUPPORT:BOOL=OFF -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON endif @@ -349,11 +367,15 @@ cmakebuild: cmake --version $(RM) -r $(BUILDIR)/cmake/build mkdir $(BUILDIR)/cmake/build - cd $(BUILDIR)/cmake/build ; cmake -DCMAKE_INSTALL_PREFIX:PATH=~/install_test_dir $(CMAKE_PARAMS) .. ; $(MAKE) install ; $(MAKE) uninstall + cd $(BUILDIR)/cmake/build; cmake -DCMAKE_INSTALL_PREFIX:PATH=~/install_test_dir $(CMAKE_PARAMS) .. + $(MAKE) -C $(BUILDIR)/cmake/build -j4; + $(MAKE) -C $(BUILDIR)/cmake/build install; + $(MAKE) -C $(BUILDIR)/cmake/build uninstall; + cd $(BUILDIR)/cmake/build; ctest -V -L Medium -c90build: clean +c89build: clean $(CC) -v - CFLAGS="-std=c90 -Werror" $(MAKE) allmost # will fail, due to missing support for `long long` + CFLAGS="-std=c89 -Werror" $(MAKE) allmost # will fail, due to missing support for `long long` gnu90build: clean $(CC) -v Modified: head/sys/contrib/zstd/README.md ============================================================================== --- head/sys/contrib/zstd/README.md Sat May 23 20:39:36 2020 (r361425) +++ head/sys/contrib/zstd/README.md Sat May 23 21:23:46 2020 (r361426) @@ -31,10 +31,10 @@ a list of known ports and bindings is provided on [Zst ## Benchmarks For reference, several fast compression algorithms were tested and compared -on a server running Arch Linux (`Linux version 5.0.5-arch1-1`), +on a server running Arch Linux (`Linux version 5.5.11-arch1-1`), with a Core i9-9900K CPU @ 5.0GHz, using [lzbench], an open-source in-memory benchmark by @inikep -compiled with [gcc] 8.2.1, +compiled with [gcc] 9.3.0, on the [Silesia compression corpus]. [lzbench]: https://github.com/inikep/lzbench @@ -43,18 +43,26 @@ on the [Silesia compression corpus]. | Compressor name | Ratio | Compression| Decompress.| | --------------- | ------| -----------| ---------- | -| **zstd 1.4.0 -1** | 2.884 | 530 MB/s | 1360 MB/s | -| zlib 1.2.11 -1 | 2.743 | 110 MB/s | 440 MB/s | -| brotli 1.0.7 -0 | 2.701 | 430 MB/s | 470 MB/s | -| quicklz 1.5.0 -1 | 2.238 | 600 MB/s | 800 MB/s | -| lzo1x 2.09 -1 | 2.106 | 680 MB/s | 950 MB/s | -| lz4 1.8.3 | 2.101 | 800 MB/s | 4220 MB/s | -| snappy 1.1.4 | 2.073 | 580 MB/s | 2020 MB/s | -| lzf 3.6 -1 | 2.077 | 440 MB/s | 930 MB/s | +| **zstd 1.4.5 -1** | 2.884 | 500 MB/s | 1660 MB/s | +| zlib 1.2.11 -1 | 2.743 | 90 MB/s | 400 MB/s | +| brotli 1.0.7 -0 | 2.703 | 400 MB/s | 450 MB/s | +| **zstd 1.4.5 --fast=1** | 2.434 | 570 MB/s | 2200 MB/s | +| **zstd 1.4.5 --fast=3** | 2.312 | 640 MB/s | 2300 MB/s | +| quicklz 1.5.0 -1 | 2.238 | 560 MB/s | 710 MB/s | +| **zstd 1.4.5 --fast=5** | 2.178 | 700 MB/s | 2420 MB/s | +| lzo1x 2.10 -1 | 2.106 | 690 MB/s | 820 MB/s | +| lz4 1.9.2 | 2.101 | 740 MB/s | 4530 MB/s | +| **zstd 1.4.5 --fast=7** | 2.096 | 750 MB/s | 2480 MB/s | +| lzf 3.6 -1 | 2.077 | 410 MB/s | 860 MB/s | +| snappy 1.1.8 | 2.073 | 560 MB/s | 1790 MB/s | [zlib]: http://www.zlib.net/ [LZ4]: http://www.lz4.org/ +The negative compression levels, specified with `--fast=#`, +offer faster compression and decompression speed in exchange for some loss in +compression ratio compared to level 1, as seen in the table above. + Zstd can also offer stronger compression ratios at the cost of compression speed. Speed vs Compression trade-off is configurable by small increments. Decompression speed is preserved and remains roughly the same at all settings, @@ -142,6 +150,18 @@ You can also take a look at [`.travis.yml`](.travis.ym example about how Meson is used to build this project. Note that default build type is **release**. + +### VCPKG +You can build and install zstd [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager: + + git clone https://github.com/Microsoft/vcpkg.git + cd vcpkg + ./bootstrap-vcpkg.sh + ./vcpkg integrate install + ./vcpkg install zstd + +The zstd port in vcpkg is kept up to date by Microsoft team members and community contributors. +If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. ### Visual Studio (Windows) Modified: head/sys/contrib/zstd/TESTING.md ============================================================================== --- head/sys/contrib/zstd/TESTING.md Sat May 23 20:39:36 2020 (r361425) +++ head/sys/contrib/zstd/TESTING.md Sat May 23 21:23:46 2020 (r361426) @@ -11,7 +11,7 @@ They consist of the following tests: - Compilation on all supported targets (x86, x86_64, ARM, AArch64, PowerPC, and PowerPC64) - Compilation on various versions of gcc, clang, and g++ - `tests/playTests.sh` on x86_64, without the tests on long data (CLI tests) -- Small tests (`tests/legacy.c`, `tests/longmatch.c`, `tests/symbols.c`) on x64_64 +- Small tests (`tests/legacy.c`, `tests/longmatch.c`) on x64_64 Medium Tests ------------ @@ -19,7 +19,7 @@ Medium tests run on every commit and pull request to ` They consist of the following tests: - The following tests run with UBsan and Asan on x86_64 and x86, as well as with Msan on x86_64 - - `tests/playTests.sh --test-long-data` + - `tests/playTests.sh --test-large-data` - Fuzzer tests: `tests/fuzzer.c`, `tests/zstreamtest.c`, and `tests/decodecorpus.c` - `tests/zstreamtest.c` under Tsan (streaming mode, including multithreaded mode) - Valgrind Test (`make -C tests valgrindTest`) (testing CLI and fuzzer under valgrind) Modified: head/sys/contrib/zstd/appveyor.yml ============================================================================== --- head/sys/contrib/zstd/appveyor.yml Sat May 23 20:39:36 2020 (r361425) +++ head/sys/contrib/zstd/appveyor.yml Sat May 23 21:23:46 2020 (r361426) @@ -14,7 +14,7 @@ - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x64" - SCRIPT: "make allzstd MOREFLAGS=-static && make -C tests test-symbols fullbench-lib" + SCRIPT: "make allzstd MOREFLAGS=-static && make -C tests fullbench-lib" ARTIFACT: "true" BUILD: "true" - COMPILER: "gcc" @@ -169,7 +169,8 @@ - SET "FUZZERTEST=-T30s" - if [%HOST%]==[visual] if [%CONFIGURATION%]==[Release] ( CD tests && - SET ZSTD=./zstd.exe && + SET ZSTD_BIN=./zstd.exe&& + SET DATAGEN_BIN=./datagen.exe&& sh -e playTests.sh --test-large-data && fullbench.exe -i1 && fullbench.exe -i1 -P0 && @@ -188,6 +189,9 @@ environment: matrix: - COMPILER: "gcc" + HOST: "cygwin" + PLATFORM: "x64" + - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x64" SCRIPT: "CPPFLAGS=-DDEBUGLEVEL=2 CFLAGS=-Werror make -j allzstd DEBUGLEVEL=2" @@ -220,6 +224,14 @@ install: - ECHO Installing %COMPILER% %PLATFORM% %CONFIGURATION% - SET PATH_ORIGINAL=%PATH% + - if [%HOST%]==[cygwin] ( + ECHO Installing Cygwin Packages && + C:\cygwin64\setup-x86_64.exe -qnNdO -R "C:\cygwin64" -g -P ^ + gcc-g++,^ + gcc,^ + cmake,^ + make + ) - if [%HOST%]==[mingw] ( SET "PATH_MINGW32=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin" && SET "PATH_MINGW64=C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin" && @@ -232,6 +244,17 @@ build_script: - ECHO Building %COMPILER% %PLATFORM% %CONFIGURATION% + - if [%HOST%]==[cygwin] ( + set CHERE_INVOKING=yes && + set CC=%COMPILER% && + C:\cygwin64\bin\bash --login -c " + set -e; + cd build/cmake; + CFLAGS='-Werror' cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Debug -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_FUZZER_FLAGS=-T30s -DZSTD_ZSTREAM_FLAGS=-T30s .; + make -j4; + ctest -V -L Medium; + " + ) - if [%HOST%]==[mingw] ( ( if [%PLATFORM%]==[x64] ( SET "PATH=%PATH_MINGW64%;%PATH_ORIGINAL%" Modified: head/sys/contrib/zstd/doc/educational_decoder/Makefile ============================================================================== --- head/sys/contrib/zstd/doc/educational_decoder/Makefile Sat May 23 20:39:36 2020 (r361425) +++ head/sys/contrib/zstd/doc/educational_decoder/Makefile Sat May 23 21:23:46 2020 (r361426) @@ -1,10 +1,11 @@ # ################################################################ -# Copyright (c) 2016-present, Yann Collet, Facebook, Inc. +# Copyright (c) 2016-2020, Yann Collet, Facebook, Inc. # All rights reserved. # # This source code is licensed under both the BSD-style license (found in the # LICENSE file in the root directory of this source tree) and the GPLv2 (found # in the COPYING file in the root directory of this source tree). +# You may select, at your option, one of the above-listed licenses. # ################################################################ ZSTD ?= zstd # note: requires zstd installation on local system @@ -36,7 +37,7 @@ harness: $(HARNESS_FILES) $(CC) $(FLAGS) $^ -o $@ clean: - @$(RM) harness + @$(RM) harness *.o @$(RM) -rf harness.dSYM # MacOS specific test: harness @@ -59,4 +60,3 @@ test: harness @./harness tmp.zst tmp dictionary @$(DIFF) -s tmp README.md @$(RM) tmp* dictionary - @$(MAKE) clean Modified: head/sys/contrib/zstd/doc/educational_decoder/README.md ============================================================================== --- head/sys/contrib/zstd/doc/educational_decoder/README.md Sat May 23 20:39:36 2020 (r361425) +++ head/sys/contrib/zstd/doc/educational_decoder/README.md Sat May 23 21:23:46 2020 (r361426) @@ -13,6 +13,13 @@ It also contains implementations of Huffman and FSE ta [Zstandard format specification]: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md [format specification]: https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md +While the library's primary objective is code clarity, +it also happens to compile into a small object file. +The object file can be made even smaller by removing error messages, +using the macro directive `ZDEC_NO_MESSAGE` at compilation time. +This can be reduced even further by foregoing dictionary support, +by defining `ZDEC_NO_DICTIONARY`. + `harness.c` provides a simple test harness around the decoder: harness [dictionary] Modified: head/sys/contrib/zstd/doc/educational_decoder/harness.c ============================================================================== --- head/sys/contrib/zstd/doc/educational_decoder/harness.c Sat May 23 20:39:36 2020 (r361425) +++ head/sys/contrib/zstd/doc/educational_decoder/harness.c Sat May 23 21:23:46 2020 (r361426) @@ -1,10 +1,11 @@ /* - * Copyright (c) 2017-present, Facebook, Inc. + * Copyright (c) 2017-2020, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ #include @@ -21,108 +22,98 @@ typedef unsigned char u8; // Protect against allocating too much memory for output #define MAX_OUTPUT_SIZE ((size_t)1024 * 1024 * 1024) -static size_t read_file(const char *path, u8 **ptr) +// Error message then exit +#define ERR_OUT(...) { fprintf(stderr, __VA_ARGS__); exit(1); } + + +typedef struct { + u8* address; + size_t size; +} buffer_s; + +static void freeBuffer(buffer_s b) { free(b.address); } + +static buffer_s read_file(const char *path) { FILE* const f = fopen(path, "rb"); - if (!f) { - fprintf(stderr, "failed to open file %s \n", path); - exit(1); - } + if (!f) ERR_OUT("failed to open file %s \n", path); fseek(f, 0L, SEEK_END); size_t const size = (size_t)ftell(f); rewind(f); - *ptr = malloc(size); - if (!ptr) { - fprintf(stderr, "failed to allocate memory to hold %s \n", path); - exit(1); - } + void* const ptr = malloc(size); + if (!ptr) ERR_OUT("failed to allocate memory to hold %s \n", path); - size_t const read = fread(*ptr, 1, size, f); - if (read != size) { /* must read everything in one pass */ - fprintf(stderr, "error while reading file %s \n", path); - exit(1); - } + size_t const read = fread(ptr, 1, size, f); + if (read != size) ERR_OUT("error while reading file %s \n", path); fclose(f); - - return read; + buffer_s const b = { ptr, size }; + return b; } -static void write_file(const char *path, const u8 *ptr, size_t size) +static void write_file(const char* path, const u8* ptr, size_t size) { FILE* const f = fopen(path, "wb"); - if (!f) { - fprintf(stderr, "failed to open file %s \n", path); - exit(1); - } + if (!f) ERR_OUT("failed to open file %s \n", path); size_t written = 0; while (written < size) { written += fwrite(ptr+written, 1, size, f); - if (ferror(f)) { - fprintf(stderr, "error while writing file %s\n", path); - exit(1); - } } + if (ferror(f)) ERR_OUT("error while writing file %s\n", path); + } fclose(f); } int main(int argc, char **argv) { - if (argc < 3) { - fprintf(stderr, "usage: %s [dictionary] \n", - argv[0]); + if (argc < 3) + ERR_OUT("usage: %s [dictionary] \n", argv[0]); - return 1; - } + buffer_s const input = read_file(argv[1]); - u8* input; - size_t const input_size = read_file(argv[1], &input); - - u8* dict = NULL; - size_t dict_size = 0; + buffer_s dict = { NULL, 0 }; if (argc >= 4) { - dict_size = read_file(argv[3], &dict); + dict = read_file(argv[3]); } - size_t out_capacity = ZSTD_get_decompressed_size(input, input_size); + size_t out_capacity = ZSTD_get_decompressed_size(input.address, input.size); if (out_capacity == (size_t)-1) { - out_capacity = MAX_COMPRESSION_RATIO * input_size; + out_capacity = MAX_COMPRESSION_RATIO * input.size; fprintf(stderr, "WARNING: Compressed data does not contain " "decompressed size, going to assume the compression " "ratio is at most %d (decompressed size of at most " "%u) \n", MAX_COMPRESSION_RATIO, (unsigned)out_capacity); } - if (out_capacity > MAX_OUTPUT_SIZE) { - fprintf(stderr, - "Required output size too large for this implementation \n"); - return 1; - } + if (out_capacity > MAX_OUTPUT_SIZE) + ERR_OUT("Required output size too large for this implementation \n"); u8* const output = malloc(out_capacity); - if (!output) { - fprintf(stderr, "failed to allocate memory \n"); - return 1; - } + if (!output) ERR_OUT("failed to allocate memory \n"); dictionary_t* const parsed_dict = create_dictionary(); - if (dict) { - parse_dictionary(parsed_dict, dict, dict_size); + if (dict.size) { +#if defined (ZDEC_NO_DICTIONARY) + printf("dict.size = %zu \n", dict.size); + ERR_OUT("no dictionary support \n"); +#else + parse_dictionary(parsed_dict, dict.address, dict.size); +#endif } size_t const decompressed_size = ZSTD_decompress_with_dict(output, out_capacity, - input, input_size, + input.address, input.size, parsed_dict); free_dictionary(parsed_dict); write_file(argv[2], output, decompressed_size); - free(input); + freeBuffer(input); + freeBuffer(dict); free(output); - free(dict); return 0; } Modified: head/sys/contrib/zstd/doc/educational_decoder/zstd_decompress.c ============================================================================== --- head/sys/contrib/zstd/doc/educational_decoder/zstd_decompress.c Sat May 23 20:39:36 2020 (r361425) +++ head/sys/contrib/zstd/doc/educational_decoder/zstd_decompress.c Sat May 23 21:23:46 2020 (r361426) @@ -1,34 +1,52 @@ /* - * Copyright (c) 2017-present, Facebook, Inc. + * Copyright (c) 2017-2020, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. */ /// Zstandard educational decoder implementation /// See https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md -#include -#include -#include -#include +#include // uint8_t, etc. +#include // malloc, free, exit +#include // fprintf +#include // memset, memcpy #include "zstd_decompress.h" -/******* UTILITY MACROS AND TYPES *********************************************/ -// Max block size decompressed size is 128 KB and literal blocks can't be -// larger than their block -#define MAX_LITERALS_SIZE ((size_t)128 * 1024) +/******* IMPORTANT CONSTANTS *********************************************/ + +// Zstandard frame +// "Magic_Number +// 4 Bytes, little-endian format. Value : 0xFD2FB528" +#define ZSTD_MAGIC_NUMBER 0xFD2FB528U + +// The size of `Block_Content` is limited by `Block_Maximum_Size`, +#define ZSTD_BLOCK_SIZE_MAX ((size_t)128 * 1024) + +// literal blocks can't be larger than their block +#define MAX_LITERALS_SIZE ZSTD_BLOCK_SIZE_MAX + + +/******* UTILITY MACROS AND TYPES *********************************************/ #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) +#if defined(ZDEC_NO_MESSAGE) +#define MESSAGE(...) +#else +#define MESSAGE(...) fprintf(stderr, "" __VA_ARGS__) +#endif + /// This decoder calls exit(1) when it encounters an error, however a production /// library should propagate error codes #define ERROR(s) \ do { \ - fprintf(stderr, "Error: %s\n", s); \ + MESSAGE("Error: %s\n", s); \ exit(1); \ } while (0) #define INP_SIZE() \ @@ -39,12 +57,12 @@ #define BAD_ALLOC() ERROR("Memory allocation error") #define IMPOSSIBLE() ERROR("An impossibility has occurred") -typedef uint8_t u8; +typedef uint8_t u8; typedef uint16_t u16; typedef uint32_t u32; typedef uint64_t u64; -typedef int8_t i8; +typedef int8_t i8; typedef int16_t i16; typedef int32_t i32; typedef int64_t i64; @@ -176,10 +194,6 @@ static void HUF_init_dtable_usingweights(HUF_dtable *c /// Free the malloc'ed parts of a decoding table static void HUF_free_dtable(HUF_dtable *const dtable); - -/// Deep copy a decoding table, so that it can be used and free'd without -/// impacting the source table. -static void HUF_copy_dtable(HUF_dtable *const dst, const HUF_dtable *const src); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat May 23 23:10: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 55A082F0261; Sat, 23 May 2020 23:10:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TzbJ0vb7z3Zsg; Sat, 23 May 2020 23:10:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19B5E1763A; Sat, 23 May 2020 23:10:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NNA3XJ040505; Sat, 23 May 2020 23:10:03 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NNA3fb040504; Sat, 23 May 2020 23:10:03 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005232310.04NNA3fb040504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 23 May 2020 23:10:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361427 - head/sys/contrib/zstd/lib/common X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/contrib/zstd/lib/common X-SVN-Commit-Revision: 361427 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, 23 May 2020 23:10:04 -0000 Author: cem Date: Sat May 23 23:10:03 2020 New Revision: 361427 URL: https://svnweb.freebsd.org/changeset/base/361427 Log: Unbreak ARM64 kernel build after r361426 X-MFC-With: r361426 Modified: head/sys/contrib/zstd/lib/common/zstd_internal.h Modified: head/sys/contrib/zstd/lib/common/zstd_internal.h ============================================================================== --- head/sys/contrib/zstd/lib/common/zstd_internal.h Sat May 23 21:23:46 2020 (r361426) +++ head/sys/contrib/zstd/lib/common/zstd_internal.h Sat May 23 23:10:03 2020 (r361427) @@ -19,7 +19,7 @@ /*-************************************* * Dependencies ***************************************/ -#ifdef __aarch64__ +#if defined(__aarch64__) && !defined(_KERNEL) #include #endif #include "compiler.h" @@ -228,7 +228,7 @@ static const U32 OF_defaultNormLog = OF_DEFAULTNORMLOG * Shared functions to include for inlining *********************************************/ static void ZSTD_copy8(void* dst, const void* src) { -#ifdef __aarch64__ +#if defined(__aarch64__) && !defined(_KERNEL) vst1_u8((uint8_t*)dst, vld1_u8((const uint8_t*)src)); #else memcpy(dst, src, 8); @@ -237,7 +237,7 @@ static void ZSTD_copy8(void* dst, const void* src) { #define COPY8(d,s) { ZSTD_copy8(d,s); d+=8; s+=8; } static void ZSTD_copy16(void* dst, const void* src) { -#ifdef __aarch64__ +#if defined(__aarch64__) && !defined(_KERNEL) vst1q_u8((uint8_t*)dst, vld1q_u8((const uint8_t*)src)); #else memcpy(dst, src, 16);