From owner-svn-src-stable-12@freebsd.org Sun May 17 01:46:00 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Sun May 17 01:48:13 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Sun May 17 01:50:05 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Sun May 17 01:51:26 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Sun May 17 01:55:08 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Sun May 17 02:21:54 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Sun May 17 02:35:51 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Sun May 17 02:36:43 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Sun May 17 09:34:30 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Sun May 17 11:09:39 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 00:32:43 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 08:40:41 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 08:44:17 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 08:46:18 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 08:52:07 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 08:55:50 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 08:57:22 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 08:58:41 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 09:00:46 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 09:03:14 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 09:05:30 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 09:07:15 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 09:09:03 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 09:10:21 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 09:11:42 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 09:13:04 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 09:14:25 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 09:15:45 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 09:17:05 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 09:21:46 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 09:22:48 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 09:24:06 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 09:25:24 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 09:26:43 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 09:35:43 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 09:37:03 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 09:44:27 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 09:46:00 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Mon May 18 14:37:11 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Tue May 19 01:39:38 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Tue May 19 01:40:46 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Tue May 19 01:43:04 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Tue May 19 03:24:46 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Tue May 19 07:48:00 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Tue May 19 13:52:35 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Tue May 19 14:31:48 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Tue May 19 22:17:32 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Wed May 20 17:33:12 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Wed May 20 21:41:37 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Wed May 20 22:19:43 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Wed May 20 23:27:02 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 01:24:01 -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-stable-12@freebsd.org Thu May 21 01:53:04 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Thu May 21 01:55:10 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Thu May 21 02:04:12 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Thu May 21 02:08:35 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Thu May 21 11:12:28 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 11:12:29 -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-stable-12@freebsd.org Thu May 21 15:18:59 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Thu May 21 15:28:37 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Thu May 21 15:29:04 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Thu May 21 19:41:25 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Thu May 21 19:46:12 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Thu May 21 22:45:14 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Thu May 21 22:47:43 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Thu May 21 23:31:59 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Thu May 21 23:34:16 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 01:30:17 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 02:06:57 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 08:59:13 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 11:41:09 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 11:53:08 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 11:55:54 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 11:57:49 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 11:59:50 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 12:01:29 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 12:03:18 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 12:05:01 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 12:06:54 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 12:08:32 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 12:10:17 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 12:20:50 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 12:26:00 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 13:13:35 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 13:14:22 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 13:27:03 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 15:42:46 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 15:57:46 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 16:51:01 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 18:44:16 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 19:09:44 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 22:12:08 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 22:13:56 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Fri May 22 22:17:45 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Sat May 23 03:32:09 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Sat May 23 11:55:14 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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-stable-12@freebsd.org Sat May 23 11:56:43 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org 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-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree 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)