From owner-dev-commits-src-branches@freebsd.org Mon Jul 19 06:16:40 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3646D677BE5; Mon, 19 Jul 2021 06:16:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GSs7D0jMpz4bPd; Mon, 19 Jul 2021 06:16:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F09BE123B9; Mon, 19 Jul 2021 06:16:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16J6GdCq028923; Mon, 19 Jul 2021 06:16:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16J6Gdo5028922; Mon, 19 Jul 2021 06:16:39 GMT (envelope-from git) Date: Mon, 19 Jul 2021 06:16:39 GMT Message-Id: <202107190616.16J6Gdo5028922@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 2800c163f083 - stable/13 - nfsd: Fix some issues found by mandoc MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2800c163f0832eb5d696221fae53d6b4da7c2822 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 06:16:40 -0000 The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=2800c163f0832eb5d696221fae53d6b4da7c2822 commit 2800c163f0832eb5d696221fae53d6b4da7c2822 Author: Gordon Bergling AuthorDate: 2021-07-12 04:31:54 +0000 Commit: Gordon Bergling CommitDate: 2021-07-19 06:16:01 +0000 nfsd: Fix some issues found by mandoc - consider using OS macro: Fx Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D31145 (cherry picked from commit 4c87085d3521dd25009f597161734e085cd47570) --- usr.sbin/nfsd/nfsv4.4 | 4 +++- usr.sbin/nfsd/pnfs.4 | 51 ++++++++++++++++++++++++++++++++++------------ usr.sbin/nfsd/pnfsserver.4 | 41 ++++++++++++++++++++++++++++--------- 3 files changed, 72 insertions(+), 24 deletions(-) diff --git a/usr.sbin/nfsd/nfsv4.4 b/usr.sbin/nfsd/nfsv4.4 index de40194cd1dd..8460ed174ea6 100644 --- a/usr.sbin/nfsd/nfsv4.4 +++ b/usr.sbin/nfsd/nfsv4.4 @@ -143,7 +143,9 @@ by default. However, this can normally be overridden by a command line option or configuration file for the daemon used to do the name<->number mapping. -Under FreeBSD, the mapping daemon is called +Under +.Fx , +the mapping daemon is called .Xr nfsuserd 8 and has a command line option that overrides the domain component of the machine's hostname. diff --git a/usr.sbin/nfsd/pnfs.4 b/usr.sbin/nfsd/pnfs.4 index c48357591f85..94fe02536ba1 100644 --- a/usr.sbin/nfsd/pnfs.4 +++ b/usr.sbin/nfsd/pnfs.4 @@ -54,10 +54,14 @@ the DS. The first is DeviceInfo, which is static information defining the DS server. The critical piece of information in DeviceInfo for the layout types -supported by FreeBSD is the IP address that is used to perform RPCs on the DS. +supported by +.Fx +is the IP address that is used to perform RPCs on the DS. It also indicates which version of NFS the DS supports, I/O size and other layout specific information. -In the DeviceInfo, there is a DeviceID which, for the FreeBSD server +In the DeviceInfo, there is a DeviceID which, for the +.Fx +server is unique to the DS configuration and changes whenever the .Xr nfsd @@ -66,35 +70,51 @@ daemon is restarted or the server is rebooted. The second is the layout, which is per file and references the DeviceInfo to use via the DeviceID. It is for a byte range of a file and is either Read or Read/Write. -For the FreeBSD server, a layout covers all bytes of a file. +For the +.Fx +server, a layout covers all bytes of a file. A layout may be recalled by the MDS using a LayoutRecall callback. When a client returns a layout via the LayoutReturn operation it can indicate that error(s) were encountered while doing I/O on the DS, at least for certain layout types such as the Flexible File Layout. .Pp -The FreeBSD client and server supports two layout types. +The +.Fx +client and server supports two layout types. .Pp The File Layout is described in RFC5661 and uses the NFSv4.1 or NFSv4.2 protocol to perform I/O on the DS. It does not support client aware DS mirroring and, as such, -the FreeBSD server only provides File Layout support for non-mirrored +the +.Fx +server only provides File Layout support for non-mirrored configurations. .Pp The Flexible File Layout allows the use of the NFSv3, NFSv4.0, NFSv4.1 or NFSv4.2 protocol to perform I/O on the DS and does support client aware mirroring. -As such, the FreeBSD server uses Flexible File Layout layouts for the +As such, the +.Fx +server uses Flexible File Layout layouts for the mirrored DS configurations. -The FreeBSD server supports the +The +.Fx +server supports the .Dq tightly coupled variant and all DSs allow use of the NFSv4.2 or NFSv4.1 protocol for I/O operations. Clients that support the Flexible File Layout will do writes and commits to all DS mirrors in the mirror set. .Pp -A FreeBSD pNFS service consists of a single MDS server plus one or more -DS servers, all of which are FreeBSD systems. -For a non-mirrored configuration, the FreeBSD server will issue File Layout +A +.Fx +pNFS service consists of a single MDS server plus one or more +DS servers, all of which are +.Fx +systems. +For a non-mirrored configuration, the +.Fx +server will issue File Layout layouts by default. However that default can be set to the Flexible File Layout by setting the .Xr sysctl 1 @@ -105,7 +125,8 @@ Mirrored server configurations will only issue Flexible File Layouts. .Tn pNFS clients mount the MDS as they would a single NFS server. .Pp -A FreeBSD +A +.Fx .Tn pNFS client must be running the .Xr nfscbd 8 @@ -165,7 +186,9 @@ as a mirror while the pNFS service continues to function. .Pp See .Xr pnfsserver 4 -for information on how to set up a FreeBSD pNFS service. +for information on how to set up a +.Fx +pNFS service. .Sh SEE ALSO .Xr nfsv4 4 , .Xr pnfsserver 4 , @@ -187,7 +210,9 @@ For Linux 4.17-rc2 kernels, I have not seen client crashes during testing, but it only supports the .Dq loosely coupled variant. -To make it work correctly when mounting the FreeBSD server, you must +To make it work correctly when mounting the +.Fx +server, you must set the sysctl .Dq vfs.nfsd.flexlinuxhack to one so that it works around diff --git a/usr.sbin/nfsd/pnfsserver.4 b/usr.sbin/nfsd/pnfsserver.4 index 22c2ecdb8696..f3cf2fa6acf9 100644 --- a/usr.sbin/nfsd/pnfsserver.4 +++ b/usr.sbin/nfsd/pnfsserver.4 @@ -30,14 +30,22 @@ .Nm pNFSserver .Nd NFS Version 4.1 and 4.2 Parallel NFS Protocol Server .Sh DESCRIPTION -A set of FreeBSD servers may be configured to provide a +A set of +.Fx +servers may be configured to provide a .Xr pnfs 4 service. -One FreeBSD system needs to be configured as a MetaData Server (MDS) and -at least one additional FreeBSD system needs to be configured as one or +One +.Fx +system needs to be configured as a MetaData Server (MDS) and +at least one additional +.Fx +system needs to be configured as one or more Data Servers (DS)s. .Pp -These FreeBSD systems are configured to be NFSv4.1 and NFSv4.2 +These +.Fx +systems are configured to be NFSv4.1 and NFSv4.2 servers, see .Xr nfsd 8 and @@ -85,7 +93,9 @@ not require the export option and this directory should be exported to them with the same options as used by the MDS to export file system(s) to the clients. .Pp -It is possible to have multiple DSs on the same FreeBSD system, but each +It is possible to have multiple DSs on the same +.Fx +system, but each of these DSs must have a separate top level exported directory used for storage of data files and each of these DSs must be mountable via a separate IP address. @@ -94,10 +104,15 @@ interface via .Xr ifconfig 8 to create these different IP addresses. Multiple DSs on the same server may be useful when data for different file systems -on the MDS are being stored on different file system volumes on the FreeBSD +on the MDS are being stored on different file system volumes on the +.Fx DS system. .Sh MDS server configuration -The MDS must be a separate FreeBSD system from the FreeBSD DS system(s) and +The MDS must be a separate +.Fx +system from the +.Fx +DS system(s) and NFS clients. It is configured as a NFSv4.1 and NFSv4.2 server with file system(s) exported to clients. @@ -189,7 +204,9 @@ nfs_server_flags="-u -t -n 128 -p nfsv4-data0:/data0#/export1,nfsv4-data1:/data1 This can be used by system administrators to control where data files are stored and might be useful for control of storage use. For this case, it may be convenient to co-locate more than one of the DSs -on the same FreeBSD server, using separate file systems on the DS system +on the same +.Fx +server, using separate file systems on the DS system for storage of the respective DS's data files. If mirroring is desired for this case, the .Dq -m @@ -211,7 +228,9 @@ For a service that will store a large number of files this sysctl should be set much larger, to avoid the number of entries in a subdirectory from getting too large. .Sh Client mounts -Once operational, NFSv4.1 or NFSv4.2 FreeBSD client mounts +Once operational, NFSv4.1 or NFSv4.2 +.Fx +client mounts done with the .Dq pnfs option should do I/O directly on the DSs. @@ -421,5 +440,7 @@ Since the MDS cannot be mirrored, it is a single point of failure just as a non .Tn pNFS server is. -For non-mirrored configurations, all FreeBSD systems used in the service +For non-mirrored configurations, all +.Fx +systems used in the service are single points of failure. From owner-dev-commits-src-branches@freebsd.org Mon Jul 19 06:17:15 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2B7F6507A5; Mon, 19 Jul 2021 06:17:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GSs7v5BGmz4bmK; Mon, 19 Jul 2021 06:17:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A0F812419; Mon, 19 Jul 2021 06:17:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16J6HF6p029074; Mon, 19 Jul 2021 06:17:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16J6HFC0029073; Mon, 19 Jul 2021 06:17:15 GMT (envelope-from git) Date: Mon, 19 Jul 2021 06:17:15 GMT Message-Id: <202107190617.16J6HFC0029073@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 0054c0afb770 - stable/13 - libcasper(3): Correct some warnings found by mandoc MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0054c0afb7708c4b48e5e00f591aeb3c23970b45 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 06:17:15 -0000 The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=0054c0afb7708c4b48e5e00f591aeb3c23970b45 commit 0054c0afb7708c4b48e5e00f591aeb3c23970b45 Author: Gordon Bergling AuthorDate: 2021-07-12 04:16:55 +0000 Commit: Gordon Bergling CommitDate: 2021-07-19 06:16:57 +0000 libcasper(3): Correct some warnings found by mandoc - inserting missing end of block: Sh breaks Bl - moving content out of list: Pp - missing comma before name: Nm cap_* - comma in function argument: cap_* - skipping paragraph macro: Pp after Sh - sections out of conventional order: Sh AUTHORS Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D31144 (cherry picked from commit 3251ad29f4295ad73668a46727c5bbf7bbac0cf7) --- lib/libcasper/libcasper/libcasper.3 | 3 ++- lib/libcasper/services/cap_dns/cap_dns.3 | 1 + lib/libcasper/services/cap_fileargs/cap_fileargs.3 | 5 +++-- lib/libcasper/services/cap_net/cap_net.3 | 5 ++--- lib/libcasper/services/cap_syslog/cap_syslog.3 | 10 +++++----- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/libcasper/libcasper/libcasper.3 b/lib/libcasper/libcasper/libcasper.3 index 149dd49eb1c9..bf678457abeb 100644 --- a/lib/libcasper/libcasper/libcasper.3 +++ b/lib/libcasper/libcasper/libcasper.3 @@ -200,8 +200,8 @@ obtained via the function. The function returns capability that provides access to opened service. Casper supports the following services in the base system: -.Bl -tag -width "system.random" -compact -offset indent .Pp +.Bl -tag -width "system.random" -compact -offset indent .It system.dns provides DNS libc compatible API .It system.grp @@ -222,6 +222,7 @@ compatible API provides .Xr syslog 3 compatible API +.El .Sh RETURN VALUES The .Fn cap_clone , diff --git a/lib/libcasper/services/cap_dns/cap_dns.3 b/lib/libcasper/services/cap_dns/cap_dns.3 index 104e37f53d86..faa994dc2a6f 100644 --- a/lib/libcasper/services/cap_dns/cap_dns.3 +++ b/lib/libcasper/services/cap_dns/cap_dns.3 @@ -158,6 +158,7 @@ The limits service to one of the address families (e.g. .Dv AF_INET , AF_INET6 , etc.). +.El .Sh EXAMPLES The following example first opens a capability to casper and then uses this capability to create the diff --git a/lib/libcasper/services/cap_fileargs/cap_fileargs.3 b/lib/libcasper/services/cap_fileargs/cap_fileargs.3 index acf51e4ed62b..a02f58d4b4fa 100644 --- a/lib/libcasper/services/cap_fileargs/cap_fileargs.3 +++ b/lib/libcasper/services/cap_fileargs/cap_fileargs.3 @@ -222,6 +222,7 @@ argument contains a list of the capability rights which file should be limited t Any number of .Dv NV_TYPE_NULL where the name of the element is name of the file which can be opened. +.El .Sh EXAMPLES The following example first parse some options and then create the .Nm system.fileargs @@ -279,6 +280,8 @@ The .Nm cap_fileargs service first appeared in .Fx 10.3 . +.Sh AUTHORS +.An Mariusz Zaborski Aq Mt oshogbo@FreeBSD.org .Sh BUGS The .Lb cap_fileargs @@ -287,5 +290,3 @@ included in is considered experimental, and should not be deployed in production environments without careful consideration of the risks associated with the use of experimental operating system features. -.Sh AUTHORS -.An Mariusz Zaborski Aq Mt oshogbo@FreeBSD.org diff --git a/lib/libcasper/services/cap_net/cap_net.3 b/lib/libcasper/services/cap_net/cap_net.3 index cd0b4450fdaf..e74f7dd70d67 100644 --- a/lib/libcasper/services/cap_net/cap_net.3 +++ b/lib/libcasper/services/cap_net/cap_net.3 @@ -83,10 +83,9 @@ .Ft "cap_net_limit_t *" .Fn cap_net_limit_bind "cap_net_limit_t *limit" "const struct sockaddr *sa" "socklen_t salen" .Sh DESCRIPTION -.Pp The functions -.Fn cap_bind, -.Fn cap_connect, +.Fn cap_bind , +.Fn cap_connect , .Fn cap_gethostbyname , .Fn cap_gethostbyname2 , .Fn cap_gethostbyaddr diff --git a/lib/libcasper/services/cap_syslog/cap_syslog.3 b/lib/libcasper/services/cap_syslog/cap_syslog.3 index 33ca6527204e..71c3e790fd97 100644 --- a/lib/libcasper/services/cap_syslog/cap_syslog.3 +++ b/lib/libcasper/services/cap_syslog/cap_syslog.3 @@ -28,10 +28,10 @@ .Dt CAP_SYSLOG 3 .Os .Sh NAME -.Nm cap_syslog -.Nm cap_vsyslog -.Nm cap_openlog -.Nm cap_closelog +.Nm cap_syslog , +.Nm cap_vsyslog , +.Nm cap_openlog , +.Nm cap_closelog , .Nm cap_setlogmask .Nd "library for syslog in capability mode" .Sh LIBRARY @@ -98,7 +98,7 @@ cap_syslog(capsyslog, LOG_NOTICE, "System logs from capability mode."); .Xr closelog 3 , .Xr err 3 , .Xr openlog 3 , -.Xr setlogmask 3 +.Xr setlogmask 3 , .Xr syslog 3 , .Xr vsyslog 3 , .Xr capsicum 4 , From owner-dev-commits-src-branches@freebsd.org Mon Jul 19 06:17:50 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ADBF565065B; Mon, 19 Jul 2021 06:17:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GSs8Z4CKDz4bnP; Mon, 19 Jul 2021 06:17:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77000125F4; Mon, 19 Jul 2021 06:17:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16J6Ho0o029225; Mon, 19 Jul 2021 06:17:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16J6Ho3r029224; Mon, 19 Jul 2021 06:17:50 GMT (envelope-from git) Date: Mon, 19 Jul 2021 06:17:50 GMT Message-Id: <202107190617.16J6Ho3r029224@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: af3367398454 - stable/13 - pmc(3): mandoc clean ups MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: af3367398454c335d1abaa5a1979ee7c0f5dc8a3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 06:17:50 -0000 The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=af3367398454c335d1abaa5a1979ee7c0f5dc8a3 commit af3367398454c335d1abaa5a1979ee7c0f5dc8a3 Author: Gordon Bergling AuthorDate: 2021-07-12 04:28:03 +0000 Commit: Gordon Bergling CommitDate: 2021-07-19 06:17:31 +0000 pmc(3): mandoc clean ups - new sentence, new line - tab in filled text - unusual Xr order - skipping paragraph macro: Pp before Ss Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D31143 (cherry picked from commit 0b1293252543802b809b5f13f554e5d6391d3445) --- lib/libpmc/pmc.corei7.3 | 488 +++++++++++++++++++++------------------ lib/libpmc/pmc.corei7uc.3 | 377 ++++++++++++++++-------------- lib/libpmc/pmc.haswell.3 | 132 +++++------ lib/libpmc/pmc.haswelluc.3 | 17 +- lib/libpmc/pmc.haswellxeon.3 | 138 +++++------ lib/libpmc/pmc.iaf.3 | 1 - lib/libpmc/pmc.ivybridge.3 | 88 +++---- lib/libpmc/pmc.ivybridgexeon.3 | 103 +++++---- lib/libpmc/pmc.sandybridge.3 | 25 +- lib/libpmc/pmc.sandybridgexeon.3 | 120 +++++----- lib/libpmc/pmc.westmere.3 | 4 +- lib/libpmc/pmc.westmereuc.3 | 441 ++++++++++++++++++----------------- 12 files changed, 1024 insertions(+), 910 deletions(-) diff --git a/lib/libpmc/pmc.corei7.3 b/lib/libpmc/pmc.corei7.3 index ec310548d08e..e9e2a6e61784 100644 --- a/lib/libpmc/pmc.corei7.3 +++ b/lib/libpmc/pmc.corei7.3 @@ -93,17 +93,17 @@ Configure the Off-core Response bits. .It Li DMND_DATA_RD Counts the number of demand and DCU prefetch data reads of full and partial cachelines as well as demand data page table entry -cacheline reads. Does not count L2 data read prefetches or -instruction fetches. +cacheline reads. +Does not count L2 data read prefetches or instruction fetches. .It Li DMND_RFO Counts the number of demand and DCU prefetch reads for ownership -(RFO) requests generated by a write to data cacheline. Does not -count L2 RFO. +(RFO) requests generated by a write to data cacheline. +Does not count L2 RFO. .It Li DMND_IFETCH Counts the number of demand and DCU prefetch instruction cacheline -reads. Does not count L2 code read prefetches. -WB -Counts the number of writeback (modified to exclusive) transactions. +reads. +Does not count L2 code read prefetches. +WB Counts the number of writeback (modified to exclusive) transactions. .It Li PF_DATA_RD Counts the number of data cacheline reads generated by L2 prefetchers. .It Li PF_RFO @@ -176,11 +176,11 @@ Core i7 and Xeon 5500 programmable PMCs support the following events: Counts the number of store buffer drains. .It Li STORE_BLOCKS.AT_RET .Pq Event 06H , Umask 04H -Counts number of loads delayed with at-Retirement block code. The following -loads need to be executed at retirement and wait for all senior stores on -the same thread to be drained: load splitting across 4K boundary (page -split), load accessing uncacheable (UC or USWC) memory, load lock, and load -with page table in UC or USWC memory region. +Counts number of loads delayed with at-Retirement block code. +The following loads need to be executed at retirement and wait for all +senior stores on the same thread to be drained: load splitting across +4K boundary (page split), load accessing uncacheable +(UC or USWC) memory, load lock, and load with page table in UC or USWC memory region. .It Li STORE_BLOCKS.L1D_BLOCK .Pq Event 06H , Umask 08H Cacheable loads delayed with L1D block code @@ -220,9 +220,10 @@ ld_lat facility. In conjunction with ld_lat facility .It Li MEM_STORE_RETIRED.DTLB_MISS .Pq Event 0CH , Umask 01H -The event counts the number of retired stores that missed the DTLB. The DTLB -miss is not counted if the store operation causes a fault. Does not counter -prefetches. Counts both primary and secondary misses to the TLB +The event counts the number of retired stores that missed the DTLB. +The DTLB miss is not counted if the store operation causes a fault. +Does not counter prefetches. +Counts both primary and secondary misses to the TLB .It Li UOPS_ISSUED.ANY .Pq Event 0EH , Umask 01H Counts the number of Uops issued by the Register Allocation Table to the @@ -250,18 +251,20 @@ hit modified data in a sibling core residing on the same socket. .It Li MEM_UNCORE_RETIRED.REMOTE_CACHE_LOCAL_HOME_HIT .Pq Event 0FH , Umask 08H Counts number of memory load instructions retired where the memory reference -missed the L1, L2 and L3 caches and HIT in a remote socket's cache. Only -counts locally homed lines. +missed the L1, L2 and L3 caches and HIT in a remote socket's cache. +Only counts locally homed lines. .It Li MEM_UNCORE_RETIRED.REMOTE_DRAM .Pq Event 0FH , Umask 10H Counts number of memory load instructions retired where the memory reference -missed the L1, L2 and L3 caches and was remotely homed. This includes both -DRAM access and HITM in a remote socket's cache for remotely homed lines. +missed the L1, L2 and L3 caches and was remotely homed. +This includes both DRAM access and HITM in a remote socket's cache +for remotely homed lines. .It Li MEM_UNCORE_RETIRED.LOCAL_DRAM .Pq Event 0FH , Umask 20H Counts number of memory load instructions retired where the memory reference missed the L1, L2 and L3 caches and required a local socket memory -reference. This includes locally homed cachelines that were in a modified +reference. +This includes locally homed cachelines that were in a modified state in another socket. .It Li MEM_UNCORE_RETIRED.UNCACHEABLE .Pq Event 0FH , Umask 80H @@ -270,10 +273,10 @@ missed the L1, L2 and L3 caches and to perform I/O. Available only for CPUID signature 06_2EH .It Li FP_COMP_OPS_EXE.X87 .Pq Event 10H , Umask 01H -Counts the number of FP Computational Uops Executed. The number of FADD, -FSUB, FCOM, FMULs, integer MULsand IMULs, FDIVs, FPREMs, FSQRTS, integer -DIVs, and IDIVs. This event does not distinguish an FADD used in the middle -of a transcendental flow from a separate FADD instruction. +Counts the number of FP Computational Uops Executed. +The number of FADD, FSUB, FCOM, FMULs, integer MULsand IMULs, FDIVs, FPREMs, FSQRTS, integer +DIVs, and IDIVs. +This event does not distinguish an FADD used in the middle of a transcendental flow from a separate FADD instruction. .It Li FP_COMP_OPS_EXE.MMX .Pq Event 10H , Umask 02H Counts number of MMX Uops executed. @@ -322,8 +325,8 @@ Counts number of loads dispatched from the Reservation Station that bypass the Memory Order Buffer. .It Li LOAD_DISPATCH.RS_DELAYED .Pq Event 13H , Umask 02H -Counts the number of delayed RS dispatches at the stage latch. If an RS -dispatch can not bypass to LB, it has another chance to dispatch from the +Counts the number of delayed RS dispatches at the stage latch. +If an RS dispatch can not bypass to LB, it has another chance to dispatch from the one-cycle delayed staging latch before it is written into the LB. .It Li LOAD_DISPATCH.MOB .Pq Event 13H , Umask 04H @@ -335,14 +338,15 @@ Counts all loads dispatched from the Reservation Station. .It Li ARITH.CYCLES_DIV_BUSY .Pq Event 14H , Umask 01H Counts the number of cycles the divider is busy executing divide or square -root operations. The divide can be integer, X87 or Streaming SIMD Extensions -(SSE). The square root operation can be either X87 or SSE. +root operations. +The divide can be integer, X87 or Streaming SIMD Extensions (SSE). +The square root operation can be either X87 or SSE. Set 'edge =1, invert=1, cmask=1' to count the number of divides. Count may be incorrect When SMT is on. .It Li ARITH.MUL .Pq Event 14H , Umask 02H -Counts the number of multiply operations executed. This includes integer as -well as floating point multiply operations but excludes DPPS mul and MPSAD. +Counts the number of multiply operations executed. +This includes integer as well as floating point multiply operations but excludes DPPS mul and MPSAD. Count may be incorrect When SMT is on .It Li INST_QUEUE_WRITES .Pq Event 17H , Umask 01H @@ -350,65 +354,68 @@ Counts the number of instructions written into the instruction queue every cycle. .It Li INST_DECODED.DEC0 .Pq Event 18H , Umask 01H -Counts number of instructions that require decoder 0 to be decoded. Usually, -this means that the instruction maps to more than 1 uop +Counts number of instructions that require decoder 0 to be decoded. +Usually, this means that the instruction maps to more than 1 uop .It Li TWO_UOP_INSTS_DECODED .Pq Event 19H , Umask 01H An instruction that generates two uops was decoded .It Li INST_QUEUE_WRITE_CYCLES .Pq Event 1EH , Umask 01H This event counts the number of cycles during which instructions are written -to the instruction queue. Dividing this counter by the number of -instructions written to the instruction queue (INST_QUEUE_WRITES) yields the -average number of instructions decoded each cycle. If this number is less -than four and the pipe stalls, this indicates that the decoder is failing to +to the instruction queue. +Dividing this counter by the number of instructions written to the +instruction queue (INST_QUEUE_WRITES) yields the average number of +instructions decoded each cycle. +If this number is less than four and the pipe stalls, this indicates that the decoder is failing to decode enough instructions per cycle to sustain the 4-wide pipeline. If SSE* instructions that are 6 bytes or longer arrive one after another, -then front end throughput may limit execution speed. In such case, +then front end throughput may limit execution speed. +In such case, .It Li LSD_OVERFLOW .Pq Event 20H , Umask 01H Counts number of loops that cant stream from the instruction queue. .It Li L2_RQSTS.LD_HIT .Pq Event 24H , Umask 01H -Counts number of loads that hit the L2 cache. L2 loads include both L1D -demand misses as well as L1D prefetches. L2 loads can be rejected for -various reasons. Only non rejected loads are counted. +Counts number of loads that hit the L2 cache. +L2 loads include both L1D demand misses as well as L1D prefetches. +L2 loads can be rejected for various reasons. +Only non rejected loads are counted. .It Li L2_RQSTS.LD_MISS .Pq Event 24H , Umask 02H -Counts the number of loads that miss the L2 cache. L2 loads include both L1D -demand misses as well as L1D prefetches. +Counts the number of loads that miss the L2 cache. +L2 loads include both L1D demand misses as well as L1D prefetches. .It Li L2_RQSTS.LOADS .Pq Event 24H , Umask 03H -Counts all L2 load requests. L2 loads include both L1D demand misses as well -as L1D prefetches. +Counts all L2 load requests. +L2 loads include both L1D demand misses as well as L1D prefetches. .It Li L2_RQSTS.RFO_HIT .Pq Event 24H , Umask 04H -Counts the number of store RFO requests that hit the L2 cache. L2 RFO -requests include both L1D demand RFO misses as well as L1D RFO prefetches. +Counts the number of store RFO requests that hit the L2 cache. +L2 RFO requests include both L1D demand RFO misses as well as L1D RFO prefetches. Count includes WC memory requests, where the data is not fetched but the permission to write the line is required. .It Li L2_RQSTS.RFO_MISS .Pq Event 24H , Umask 08H -Counts the number of store RFO requests that miss the L2 cache. L2 RFO -requests include both L1D demand RFO misses as well as L1D RFO prefetches. +Counts the number of store RFO requests that miss the L2 cache. +L2 RFO requests include both L1D demand RFO misses as well as L1D RFO prefetches. .It Li L2_RQSTS.RFOS .Pq Event 24H , Umask 0CH -Counts all L2 store RFO requests. L2 RFO requests include both L1D demand -RFO misses as well as L1D RFO prefetches. +Counts all L2 store RFO requests. +L2 RFO requests include both L1D demand RFO misses as well as L1D RFO prefetches. .It Li L2_RQSTS.IFETCH_HIT .Pq Event 24H , Umask 10H -Counts number of instruction fetches that hit the L2 cache. L2 instruction -fetches include both L1I demand misses as well as L1I instruction +Counts number of instruction fetches that hit the L2 cache. +L2 instruction fetches include both L1I demand misses as well as L1I instruction prefetches. .It Li L2_RQSTS.IFETCH_MISS .Pq Event 24H , Umask 20H -Counts number of instruction fetches that miss the L2 cache. L2 instruction -fetches include both L1I demand misses as well as L1I instruction +Counts number of instruction fetches that miss the L2 cache. +L2 instruction fetches include both L1I demand misses as well as L1I instruction prefetches. .It Li L2_RQSTS.IFETCHES .Pq Event 24H , Umask 30H -Counts all instruction fetches. L2 instruction fetches include both L1I -demand misses as well as L1I instruction prefetches. +Counts all instruction fetches. +L2 instruction fetches include both L1I demand misses as well as L1I instruction prefetches. .It Li L2_RQSTS.PREFETCH_HIT .Pq Event 24H , Umask 40H Counts L2 prefetch hits for both code and data. @@ -427,27 +434,27 @@ Counts all L2 requests for both code and data. .It Li L2_DATA_RQSTS.DEMAND.I_STATE .Pq Event 26H , Umask 01H Counts number of L2 data demand loads where the cache line to be loaded is -in the I (invalid) state, i.e. a cache miss. L2 demand loads are both L1D -demand misses and L1D prefetches. +in the I (invalid) state, i.e. a cache miss. +L2 demand loads are both L1D demand misses and L1D prefetches. .It Li L2_DATA_RQSTS.DEMAND.S_STATE .Pq Event 26H , Umask 02H Counts number of L2 data demand loads where the cache line to be loaded is -in the S (shared) state. L2 demand loads are both L1D demand misses and L1D -prefetches. +in the S (shared) state. +L2 demand loads are both L1D demand misses and L1D prefetches. .It Li L2_DATA_RQSTS.DEMAND.E_STATE .Pq Event 26H , Umask 04H Counts number of L2 data demand loads where the cache line to be loaded is -in the E (exclusive) state. L2 demand loads are both L1D demand misses and -L1D prefetches. +in the E (exclusive) state. +L2 demand loads are both L1D demand misses and L1D prefetches. .It Li L2_DATA_RQSTS.DEMAND.M_STATE .Pq Event 26H , Umask 08H Counts number of L2 data demand loads where the cache line to be loaded is -in the M (modified) state. L2 demand loads are both L1D demand misses and -L1D prefetches. +in the M (modified) state. +L2 demand loads are both L1D demand misses and L1D prefetches. .It Li L2_DATA_RQSTS.DEMAND.MESI .Pq Event 26H , Umask 0FH -Counts all L2 data demand requests. L2 demand loads are both L1D demand -misses and L1D prefetches. +Counts all L2 data demand requests. +L2 demand loads are both L1D demand misses and L1D prefetches. .It Li L2_DATA_RQSTS.PREFETCH.I_STATE .Pq Event 26H , Umask 10H Counts number of L2 prefetch data loads where the cache line to be loaded is @@ -455,8 +462,9 @@ in the I (invalid) state, i.e. a cache miss. .It Li L2_DATA_RQSTS.PREFETCH.S_STATE .Pq Event 26H , Umask 20H Counts number of L2 prefetch data loads where the cache line to be loaded is -in the S (shared) state. A prefetch RFO will miss on an S state line, while -a prefetch read will hit on an S state line. +in the S (shared) state. +A prefetch RFO will miss on an S state line, while a prefetch read will +hit on an S state line. .It Li L2_DATA_RQSTS.PREFETCH.E_STATE .Pq Event 26H , Umask 40H Counts number of L2 prefetch data loads where the cache line to be loaded is @@ -474,29 +482,31 @@ Counts all L2 data requests. .It Li L2_WRITE.RFO.I_STATE .Pq Event 27H , Umask 01H Counts number of L2 demand store RFO requests where the cache line to be -loaded is in the I (invalid) state, i.e, a cache miss. The L1D prefetcher -does not issue a RFO prefetch. +loaded is in the I (invalid) state, i.e, a cache miss. +The L1D prefetcher does not issue a RFO prefetch. This is a demand RFO request .It Li L2_WRITE.RFO.S_STATE .Pq Event 27H , Umask 02H Counts number of L2 store RFO requests where the cache line to be loaded is -in the S (shared) state. The L1D prefetcher does not issue a RFO prefetch,. +in the S (shared) state. +The L1D prefetcher does not issue a RFO prefetch. This is a demand RFO request .It Li L2_WRITE.RFO.M_STATE .Pq Event 27H , Umask 08H Counts number of L2 store RFO requests where the cache line to be loaded is -in the M (modified) state. The L1D prefetcher does not issue a RFO prefetch. +in the M (modified) state. +The L1D prefetcher does not issue a RFO prefetch. This is a demand RFO request .It Li L2_WRITE.RFO.HIT .Pq Event 27H , Umask 0EH Counts number of L2 store RFO requests where the cache line to be loaded is -in either the S, E or M states. The L1D prefetcher does not issue a RFO -prefetch. +in either the S, E or M states. +The L1D prefetcher does not issue a RFO prefetch. This is a demand RFO request .It Li L2_WRITE.RFO.MESI .Pq Event 27H , Umask 0FH -Counts all L2 store RFO requests.The L1D prefetcher does not issue a RFO -prefetch. +Counts all L2 store RFO requests. +The L1D prefetcher does not issue a RFO prefetch. This is a demand RFO request .It Li L2_WRITE.LOCK.I_STATE .Pq Event 27H , Umask 10H @@ -543,25 +553,26 @@ Counts all L1 writebacks to the L2. .It Li L3_LAT_CACHE.REFERENCE .Pq Event 2EH , Umask 4FH This event counts requests originating from the core that reference a cache -line in the last level cache. The event count includes speculative traffic -but excludes cache line fills due to a L2 hardware-prefetch. Because cache -hierarchy, cache sizes and other implementation-specific characteristics; -value comparison to estimate performance differences is not recommended. +line in the last level cache. +The event count includes speculative traffic but excludes cache line fills +due to a L2 hardware-prefetch. +Because cache hierarchy, cache sizes and other implementation-specific +characteristics; value comparison to estimate performance differences is not recommended. see Table A-1 .It Li L3_LAT_CACHE.MISS .Pq Event 2EH , Umask 41H This event counts each cache miss condition for references to the last level -cache. The event count may include speculative traffic but excludes cache -line fills due to L2 hardware-prefetches. Because cache hierarchy, cache -sizes and other implementation-specific characteristics; value comparison to -estimate performance differences is not recommended. +cache. +The event count may include speculative traffic but excludes cache +line fills due to L2 hardware-prefetches. +Because cache hierarchy, cache sizes and other implementation-specific +characteristics; value comparison to estimate performance differences is not recommended. see Table A-1 .It Li CPU_CLK_UNHALTED.THREAD_P .Pq Event 3CH , Umask 00H Counts the number of thread cycles while the thread is not in a halt state. -The thread enters the halt state when it is running the HLT instruction. The -core frequency may change from time to time due to power or thermal -throttling. +The thread enters the halt state when it is running the HLT instruction. +The core frequency may change from time to time due to power or thermal throttling. see Table A-1 .It Li CPU_CLK_UNHALTED.REF_P .Pq Event 3CH , Umask 01H @@ -609,10 +620,10 @@ Counter 0, 1 only .It Li L1D_CACHE_LOCK.HIT .Pq Event 42H , Umask 01H Counts retired load locks that hit in the L1 data cache or hit in an already -allocated fill buffer. The lock portion of the load lock transaction must -hit in the L1D. -The initial load will pull the lock into the L1 data cache. Counter 0, 1 -only +allocated fill buffer. +The lock portion of the load lock transaction must hit in the L1D. +The initial load will pull the lock into the L1 data cache. +Counter 0, 1 only .It Li L1D_CACHE_LOCK.S_STATE .Pq Event 42H , Umask 02H Counts L1 data cache retired load locks that hit the target cache line in @@ -631,10 +642,10 @@ Counter 0, 1 only .It Li L1D_ALL_REF.ANY .Pq Event 43H , Umask 01H Counts all references (uncached, speculated and retired) to the L1 data -cache, including all loads and stores with any memory types. The event -counts memory accesses only when they are actually performed. For example, a -load blocked by unknown store address and later performed is only counted -once. +cache, including all loads and stores with any memory types. +The event counts memory accesses only when they are actually performed. +For example, a load blocked by unknown store address and later performed +is only counted once. The event does not include non- memory accesses, such as I/O accesses. Counter 0, 1 only .It Li L1D_ALL_REF.CACHEABLE @@ -650,8 +661,8 @@ Counts the number of misses in the STLB which causes a page walk. Counts number of misses in the STLB which resulted in a completed page walk. .It Li DTLB_MISSES.STLB_HIT .Pq Event 49H , Umask 10H -Counts the number of DTLB first level misses that hit in the second level -TLB. This event is only relevant if the core contains multiple DTLB levels. +Counts the number of DTLB first level misses that hit in the second level TLB. +This event is only relevant if the core contains multiple DTLB levels. .It Li DTLB_MISSES.PDE_MISS .Pq Event 49H , Umask 20H Number of DTLB misses caused by low part of address, includes references to 2M pages because 2M pages do not use the PDE. @@ -669,17 +680,18 @@ Counts number of hardware prefetch requests dispatched out of the prefetch FIFO. .It Li L1D_PREFETCH.MISS .Pq Event 4EH , Umask 02H -Counts number of hardware prefetch requests that miss the L1D. There are two -prefetchers in the L1D. A streamer, which predicts lines sequentially after -this one should be fetched, and the IP prefetcher that remembers access -patterns for the current instruction. The streamer prefetcher stops on an -L1D hit, while the IP prefetcher does not. +Counts number of hardware prefetch requests that miss the L1D. +There are two prefetchers in the L1D. +A streamer, which predicts lines sequentially after this one should be fetched, +and the IP prefetcher that remembers access patterns for the current instruction. +The streamer prefetcher stops on an L1D hit, while the IP prefetcher does not. .It Li L1D_PREFETCH.TRIGGERS .Pq Event 4EH , Umask 04H Counts number of prefetch requests triggered by the Finite State Machine and -pushed into the prefetch FIFO. Some of the prefetch requests are dropped due -to overwrites or competition between the IP index prefetcher and streamer -prefetcher. The prefetch FIFO contains 4 entries. +pushed into the prefetch FIFO. +Some of the prefetch requests are dropped due to overwrites or competition between +the IP index prefetcher and streamer prefetcher. +The prefetch FIFO contains 4 entries. .It Li L1D.REPL .Pq Event 51H , Umask 01H Counts the number of lines brought into the L1 data cache. @@ -708,12 +720,13 @@ Counts the number of cacheable load lock speculated or retired instructions accepted into the fill buffer. .It Li CACHE_LOCK_CYCLES.L1D_L2 .Pq Event 63H , Umask 01H -Cycle count during which the L1D and L2 are locked. A lock is asserted when -there is a locked memory access, due to uncacheable memory, a locked +Cycle count during which the L1D and L2 are locked. +A lock is asserted when there is a locked memory access, due to uncacheable memory, a locked operation that spans two cache lines, or a page walk from an uncacheable page table. -Counter 0, 1 only. L1D and L2 locks have a very high performance penalty and -it is highly recommended to avoid such accesses. +Counter 0, 1 only. +L1D and L2 locks have a very high performance penalty and it is highly recommended to +avoid such accesses. .It Li CACHE_LOCK_CYCLES.L1D .Pq Event 63H , Umask 02H Counts the number of cycles that cacheline in the L1 data cache unit is @@ -727,10 +740,11 @@ Counts the number of completed I/O transactions. Counts all instruction fetches that hit the L1 instruction cache. .It Li L1I.MISSES .Pq Event 80H , Umask 02H -Counts all instruction fetches that miss the L1I cache. This includes -instruction cache misses, streaming buffer misses, victim cache misses and -uncacheable fetches. An instruction fetch miss is counted only once and not -once for every cycle it is outstanding. +Counts all instruction fetches that miss the L1I cache. +This includes instruction cache misses, streaming buffer misses, victim cache misses and +uncacheable fetches. +An instruction fetch miss is counted only once and not once for every cycle +it is outstanding. .It Li L1I.READS .Pq Event 80H , Umask 03H Counts all instruction fetches, including uncacheable fetches that bypass @@ -803,10 +817,10 @@ Counts all near call branches executed, but not necessarily retired. Counts taken near branches executed, but not necessarily retired. .It Li BR_INST_EXEC.ANY .Pq Event 88H , Umask 7FH -Counts all near executed branches (not necessarily retired). This includes -only instructions and not micro-op branches. Frequent branching is not -necessarily a major performance issue. However frequent branch -mispredictions may be a problem. +Counts all near executed branches (not necessarily retired). +This includes only instructions and not micro-op branches. +Frequent branching is not necessarily a major performance issue. +However frequent branch mispredictions may be a problem. .It Li BR_MISP_EXEC.COND .Pq Event 89H , Umask 01H Counts the number of mispredicted conditional near branch instructions @@ -847,10 +861,10 @@ Counts the number of mispredicted near branch instructions that were executed, but not necessarily retired. .It Li RESOURCE_STALLS.ANY .Pq Event A2H , Umask 01H -Counts the number of Allocator resource related stalls. Includes register -renaming buffer entries, memory buffer entries. In addition to resource -related stalls, this event counts some other events. Includes stalls arising -during branch misprediction recovery, such as if retirement of the +Counts the number of Allocator resource related stalls. +Includes register renaming buffer entries, memory buffer entries. +In addition to resource related stalls, this event counts some other events. +Includes stalls arising during branch misprediction recovery, such as if retirement of the mispredicted branch is delayed and stalls arising while store buffer is draining from synchronizing operations. Does not include stalls due to SuperQ (off core) queue full, too many cache @@ -861,8 +875,8 @@ Counts the cycles of stall due to lack of load buffer for load operation. .It Li RESOURCE_STALLS.RS_FULL .Pq Event A2H , Umask 04H This event counts the number of cycles when the number of instructions in -the pipeline waiting for execution reaches the limit the processor can -handle. A high count of this event indicates that there are long latency +the pipeline waiting for execution reaches the limit the processor can handle. +A high count of this event indicates that there are long latency operations in the pipe (possibly load and store operations that miss the L2 cache, or instructions dependent upon instructions further down the pipeline that have yet to retire. @@ -872,8 +886,8 @@ start execution. .Pq Event A2H , Umask 08H This event counts the number of cycles that a resource related stall will occur due to the number of store instructions reaching the limit of the -pipeline, (i.e. all store buffers are used). The stall ends when a store -instruction commits its data to the cache or memory. +pipeline, (i.e. all store buffers are used). +The stall ends when a store instruction commits its data to the cache or memory. .It Li RESOURCE_STALLS.ROB_FULL .Pq Event A2H , Umask 10H Counts the cycles of stall due to re- order buffer full. @@ -884,7 +898,8 @@ floating-point unit (FPU) control word. .It Li RESOURCE_STALLS.MXCSR .Pq Event A2H , Umask 40H Stalls due to the MXCSR register rename occurring to close to a previous -MXCSR rename. The MXCSR provides control and status for the MMX registers. +MXCSR rename. +The MXCSR provides control and status for the MMX registers. .It Li RESOURCE_STALLS.OTHER .Pq Event A2H , Umask 80H Counts the number of cycles while execution was stalled due to other @@ -895,14 +910,15 @@ Counts the number of instructions decoded that are macro-fused but not necessarily executed or retired. .It Li BACLEAR_FORCE_IQ .Pq Event A7H , Umask 01H -Counts number of times a BACLEAR was forced by the Instruction Queue. The IQ -is also responsible for providing conditional branch prediction direction +Counts number of times a BACLEAR was forced by the Instruction Queue. +The IQ is also responsible for providing conditional branch prediction direction based on a static scheme and dynamic data provided by the L2 Branch -Prediction Unit. If the conditional branch target is not found in the Target -Array and the IQ predicts that the branch is taken, then the IQ will force -the Branch Address Calculator to issue a BACLEAR. Each BACLEAR asserted by -the BAC generates approximately an 8 cycle bubble in the instruction fetch -pipeline. +Prediction Unit. +If the conditional branch target is not found in the Target Array and the IQ +predicts that the branch is taken, then the IQ will force +the Branch Address Calculator to issue a BACLEAR. +Each BACLEAR asserted by the BAC generates approximately an 8 cycle bubble +in the instruction fetch pipeline. .It Li LSD.UOPS .Pq Event A8H , Umask 01H Counts the number of micro-ops delivered by loop stream detector @@ -915,30 +931,32 @@ Counts the number of ITLB flushes Counts number of L1D writebacks to the uncore. .It Li UOPS_EXECUTED.PORT0 .Pq Event B1H , Umask 01H -Counts number of Uops executed that were issued on port 0. Port 0 handles -integer arithmetic, SIMD and FP add Uops. +Counts number of Uops executed that were issued on port 0. +Port 0 handles integer arithmetic, SIMD and FP add Uops. .It Li UOPS_EXECUTED.PORT1 .Pq Event B1H , Umask 02H -Counts number of Uops executed that were issued on port 1. Port 1 handles -integer arithmetic, SIMD, integer shift, FP multiply and FP divide Uops. +Counts number of Uops executed that were issued on port 1. +Port 1 handles integer arithmetic, SIMD, integer shift, FP multiply and FP divide Uops. .It Li UOPS_EXECUTED.PORT2_CORE .Pq Event B1H , Umask 04H -Counts number of Uops executed that were issued on port 2. Port 2 handles -the load Uops. This is a core count only and can not be collected per -thread. +Counts number of Uops executed that were issued on port 2. +Port 2 handles the load Uops. +This is a core count only and can not be collected per thread. .It Li UOPS_EXECUTED.PORT3_CORE .Pq Event B1H , Umask 08H -Counts number of Uops executed that were issued on port 3. Port 3 handles -store Uops. This is a core count only and can not be collected per thread. +Counts number of Uops executed that were issued on port 3. +Port 3 handles store Uops. +This is a core count only and can not be collected per thread. .It Li UOPS_EXECUTED.PORT4_CORE .Pq Event B1H , Umask 10H -Counts number of Uops executed that where issued on port 4. Port 4 handles -the value to be stored for the store Uops issued on port 3. This is a core -count only and can not be collected per thread. +Counts number of Uops executed that where issued on port 4. +Port 4 handles the value to be stored for the store Uops issued on port 3. +This is a core count only and can not be collected per thread. .It Li UOPS_EXECUTED.CORE_ACTIVE_CYCLES_NO_PORT5 .Pq Event B1H , Umask 1FH Counts cycles when the Uops executed were issued from any ports except port -5. Use Cmask=1 for active cycles; Cmask=0 for weighted cycles; Use CMask=1, +5. +Use Cmask=1 for active cycles; Cmask=0 for weighted cycles; Use CMask=1, Invert=1 to count P0-4 stalled cycles Use Cmask=1, Edge=1, Invert=1 to count P0-4 stalls. .It Li UOPS_EXECUTED.PORT5 @@ -946,8 +964,8 @@ P0-4 stalls. Counts number of Uops executed that where issued on port 5. .It Li UOPS_EXECUTED.CORE_ACTIVE_CYCLES .Pq Event B1H , Umask 3FH -Counts cycles when the Uops are executing. Use Cmask=1 for active cycles; -Cmask=0 for weighted cycles; Use CMask=1, Invert=1 to count P0-4 stalled +Counts cycles when the Uops are executing. +Use Cmask=1 for active cycles; Cmask=0 for weighted cycles; Use CMask=1, Invert=1 to count P0-4 stalled cycles Use Cmask=1, Edge=1, Invert=1 to count P0-4 stalls. .It Li UOPS_EXECUTED.PORT015 .Pq Event B1H , Umask 40H @@ -986,7 +1004,8 @@ Requires programming MSR 01A7H See Table A-1 Notes: INST_RETIRED.ANY is counted by a designated fixed counter. INST_RETIRED.ANY_P is counted by a programmable counter and is an -architectural performance event. Event is supported if CPUID.A.EBX[1] = 0. +architectural performance event. +Event is supported if CPUID.A.EBX[1] = 0. Counting: Faulting executions of GETSEC/VM entry/VM Exit/MWait will not count as retired instructions. .It Li INST_RETIRED.X87 @@ -1001,10 +1020,10 @@ instructions. .It Li UOPS_RETIRED.ANY .Pq Event C2H , Umask 01H Counts the number of micro-ops retired, (macro-fused=1, micro- fused=2, -others=1; maximum count of 8 per cycle). Most instructions are composed of -one or two micro-ops. Some instructions are decoded into longer sequences -such as repeat instructions, floating point transcendental instructions, and -assists. +others=1; maximum count of 8 per cycle). +Most instructions are composed of one or two micro-ops. +Some instructions are decoded into longer sequences such as repeat instructions, +floating point transcendental instructions, and assists. Use cmask=1 and invert to count active cycles or stalled cycles .It Li UOPS_RETIRED.RETIRE_SLOTS .Pq Event C2H , Umask 02H @@ -1022,7 +1041,8 @@ Counts the number of machine clears due to memory order conflicts. .Pq Event C3H , Umask 04H Counts the number of times that a program writes to a code section. Self-modifying code causes a sever penalty in all Intel 64 and IA-32 -processors. The modified cache line is written back to the L2 and L3caches. +processors. +The modified cache line is written back to the L2 and L3caches. .It Li BR_INST_RETIRED.ALL_BRANCHES .Pq Event C4H , Umask 00H See Table A-1 @@ -1072,24 +1092,25 @@ Counts number of retired loads that hit their own, unshared lines in the L3 cache. .It Li MEM_LOAD_RETIRED.OTHER_CORE_L2_HIT_HITM .Pq Event CBH , Umask 08H -Counts number of retired loads that hit in a sibling core's L2 (on die -core). Since the L3 is inclusive of all cores on the package, this is an L3 -hit. This counts both clean or modified hits. +Counts number of retired loads that hit in a sibling core's L2 (on die core). +Since the L3 is inclusive of all cores on the package, this is an L3 hit. +This counts both clean or modified hits. .It Li MEM_LOAD_RETIRED.L3_MISS .Pq Event CBH , Umask 10H -Counts number of retired loads that miss the L3 cache. The load was -satisfied by a remote socket, local memory or an IOH. +Counts number of retired loads that miss the L3 cache. +The load was satisfied by a remote socket, local memory or an IOH. .It Li MEM_LOAD_RETIRED.HIT_LFB .Pq Event CBH , Umask 40H Counts number of retired loads that miss the L1D and the address is located -in an allocated line fill buffer and will soon be committed to cache. This -is counting secondary L1D misses. +in an allocated line fill buffer and will soon be committed to cache. +This is counting secondary L1D misses. .It Li MEM_LOAD_RETIRED.DTLB_MISS .Pq Event CBH , Umask 80H -Counts the number of retired loads that missed the DTLB. The DTLB miss is -not counted if the load operation causes a fault. This event counts loads -from cacheable memory only. The event does not count loads by software -prefetches. Counts both primary and secondary misses to the TLB. +Counts the number of retired loads that missed the DTLB. +The DTLB miss is not counted if the load operation causes a fault. +This event counts loads from cacheable memory only. +The event does not count loads by software prefetches. +Counts both primary and secondary misses to the TLB. .It Li FP_MMX_TRANS.TO_FP .Pq Event CCH , Umask 01H Counts the first floating-point instruction following any MMX instruction. @@ -1097,29 +1118,30 @@ You can use this event to estimate the penalties for the transitions between floating-point and MMX technology states. .It Li FP_MMX_TRANS.TO_MMX .Pq Event CCH , Umask 02H -Counts the first MMX instruction following a floating-point instruction. You -can use this event to estimate the penalties for the transitions between +Counts the first MMX instruction following a floating-point instruction. +You can use this event to estimate the penalties for the transitions between floating-point and MMX technology states. .It Li FP_MMX_TRANS.ANY .Pq Event CCH , Umask 03H Counts all transitions from floating point to MMX instructions and from MMX -instructions to floating point instructions. You can use this event to -estimate the penalties for the transitions between floating-point and MMX -technology states. +instructions to floating point instructions. +You can use this event to estimate the penalties for the transitions between +floating-point and MMX technology states. .It Li MACRO_INSTS.DECODED .Pq Event D0H , Umask 01H Counts the number of instructions decoded, (but not necessarily executed or retired). .It Li UOPS_DECODED.MS .Pq Event D1H , Umask 02H -Counts the number of Uops decoded by the Microcode Sequencer, MS. The MS -delivers uops when the instruction is more than 4 uops long or a microcode +Counts the number of Uops decoded by the Microcode Sequencer, MS. +The MS delivers uops when the instruction is more than 4 uops long or a microcode assist is occurring. .It Li UOPS_DECODED.ESP_FOLDING .Pq Event D1H , Umask 04H Counts number of stack pointer (ESP) instructions decoded: push , pop , call -, ret, etc. ESP instructions do not generate a Uop to increment or decrement -ESP. Instead, they update an ESP_Offset register that keeps track of the +, ret, etc. +ESP instructions do not generate a Uop to increment or decrement ESP. +Instead, they update an ESP_Offset register that keeps track of the delta to the current value of the ESP register. .It Li UOPS_DECODED.ESP_SYNC .Pq Event D1H , Umask 08H @@ -1129,8 +1151,8 @@ value of the ESP register. .It Li RAT_STALLS.FLAGS .Pq Event D2H , Umask 01H Counts the number of cycles during which execution stalled due to several -reasons, one of which is a partial flag register stall. A partial register -stall may occur when two conditions are met: 1) an instruction modifies +reasons, one of which is a partial flag register stall. +A partial register stall may occur when two conditions are met: 1) an instruction modifies some, but not all, of the flags in the flag register and 2) the next instruction, which depends on flags, depends on flags that were not modified by this instruction. @@ -1142,30 +1164,33 @@ was partially written by previous instruction. .It Li RAT_STALLS.ROB_READ_PORT .Pq Event D2H , Umask 04H Counts the number of cycles when ROB read port stalls occurred, which did -not allow new micro-ops to enter the out-of-order pipeline. Note that, at -this stage in the pipeline, additional stalls may occur at the same cycle -and prevent the stalled micro-ops from entering the pipe. In such a case, -micro-ops retry entering the execution pipe in the next cycle and the -ROB-read port stall is counted again. +not allow new micro-ops to enter the out-of-order pipeline. +Note that, at this stage in the pipeline, additional stalls may occur at +the same cycle and prevent the stalled micro-ops from entering the pipe. +In such a case, micro-ops retry entering the execution pipe in the next +cycle and the ROB-read port stall is counted again. .It Li RAT_STALLS.SCOREBOARD .Pq Event D2H , Umask 08H Counts the cycles where we stall due to microarchitecturally required -serialization. Microcode scoreboarding stalls. +serialization. +Microcode scoreboarding stalls. .It Li RAT_STALLS.ANY .Pq Event D2H , Umask 0FH Counts all Register Allocation Table stall cycles due to: Cycles when ROB read port stalls occurred, which did not allow new micro-ops to enter the -execution pipe. Cycles when partial register stalls occurred Cycles when -flag stalls occurred Cycles floating-point unit (FPU) status word stalls -occurred. To count each of these conditions separately use the events: +execution pipe. +Cycles when partial register stalls occurred Cycles when flag stalls occurred +Cycles floating-point unit (FPU) status word stalls occurred. +To count each of these conditions separately use the events: RAT_STALLS.ROB_READ_PORT, RAT_STALLS.PARTIAL, RAT_STALLS.FLAGS, and RAT_STALLS.FPSW. .It Li SEG_RENAME_STALLS .Pq Event D4H , Umask 01H Counts the number of stall cycles due to the lack of renaming resources for -the ES, DS, FS, and GS segment registers. If a segment is renamed but not -retired and a second update to the same segment occurs, a stall occurs in -the front-end of the pipeline until the renamed segment retires. +the ES, DS, FS, and GS segment registers. +If a segment is renamed but not retired and a second update to the same +segment occurs, a stall occurs in the front-end of the pipeline until the +renamed segment retires. .It Li ES_REG_RENAMES .Pq Event D5H , Umask 01H Counts the number of times the ES segment register is renamed. @@ -1183,17 +1208,19 @@ or return branch. .Pq Event E6H , Umask 01H Counts the number of times the front end is resteered, mainly when the Branch Prediction Unit cannot provide a correct prediction and this is -corrected by the Branch Address Calculator at the front end. This can occur -if the code has many branches such that they cannot be consumed by the BPU. +corrected by the Branch Address Calculator at the front end. +This can occur if the code has many branches such that they cannot be +consumed by the BPU. Each BACLEAR asserted by the BAC generates approximately an 8 cycle bubble -in the instruction fetch pipeline. The effect on total execution time -depends on the surrounding code. +in the instruction fetch pipeline. +The effect on total execution time depends on the surrounding code. .It Li BACLEAR.BAD_TARGET .Pq Event E6H , Umask 02H Counts number of Branch Address Calculator clears (BACLEAR) asserted due to conditional branch instructions in which there was a target hit but the -direction was wrong. Each BACLEAR asserted by the BAC generates -approximately an 8 cycle bubble in the instruction fetch pipeline. +direction was wrong. +Each BACLEAR asserted by the BAC generates approximately an 8 cycle bubble in +the instruction fetch pipeline. .It Li BPU_CLEARS.EARLY .Pq Event E8H , Umask 01H Counts early (normal) Branch Prediction Unit clears: BPU predicted a taken @@ -1201,8 +1228,8 @@ branch after incorrectly assuming that it was not taken. The BPU clear leads to 2 cycle bubble in the Front End. .It Li BPU_CLEARS.LATE .Pq Event E8H , Umask 02H -Counts late Branch Prediction Unit clears due to Most Recently Used -conflicts. The PBU clear leads to a 3 cycle bubble in the Front End. +Counts late Branch Prediction Unit clears due to Most Recently Used conflicts. +The PBU clear leads to a 3 cycle bubble in the Front End. .It Li L2_TRANSACTIONS.LOAD .Pq Event F0H , Umask 01H Counts L2 load operations due to HW prefetch or demand loads. @@ -1259,12 +1286,13 @@ Counts all L2 cache lines evicted for any reason. Counts the number of SQ lock splits across a cache line. .It Li SQ_FULL_STALL_CYCLES .Pq Event F6H , Umask 01H -Counts cycles the Super Queue is full. Neither of the threads on this core -will be able to access the uncore. +Counts cycles the Super Queue is full. +Neither of the threads on this core will be able to access the uncore. .It Li FP_ASSIST.ALL .Pq Event F7H , Umask 01H Counts the number of floating point operations executed that required -micro-code assist intervention. Assists are required in the following cases: +micro-code assist intervention. +Assists are required in the following cases: SSE instructions, (Denormal input when the DAZ flag is off or Underflow result when the FTZ flag is off): x87 instructions, (NaN or denormal are loaded to a register or used as input from memory, Division by 0 or @@ -1361,8 +1389,8 @@ Number of cycles interrupts are pending and masked .It Li HW_INT.CYCLES_PENDING_AND_MASKED .Pq Event 04H , Umask 04H Counts number of L2 store RFO requests where the cache line to be loaded is -in the E (exclusive) state. The L1D prefetcher does not issue a RFO -prefetch. +in the E (exclusive) state. +The L1D prefetcher does not issue a RFO prefetch. This is a demand RFO request .It Li HW_INT.CYCLES_PENDING_AND_MASKED .Pq Event 27H , Umask 04H @@ -1403,34 +1431,34 @@ Counts number of SSE non temporal stores Counts store fence cycles .It Li EPT.EPDE_MISS .Pq Event 4FH , Umask 02H -Counts Extended Page Directory Entry misses. The Extended Page Directory -cache is used by Virtual Machine operating systems while the guest operating -systems use the standard TLB caches. +Counts Extended Page Directory Entry misses. +The Extended Page Directory cache is used by Virtual Machine operating +systems while the guest operating systems use the standard TLB caches. .It Li EPT.EPDPE_HIT .Pq Event 4FH , Umask 04H Counts Extended Page Directory Pointer Entry hits. .It Li EPT.EPDPE_MISS .Pq Event 4FH , Umask 08H -Counts Extended Page Directory Pointer Entry misses. T +Counts Extended Page Directory Pointer Entry misses. .It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND.READ_DATA .Pq Event 60H , Umask 01H -Counts weighted cycles of offcore demand data read requests. Does not -include L2 prefetch requests. +Counts weighted cycles of offcore demand data read requests. +Does not include L2 prefetch requests. counter 0 .It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND.READ_CODE .Pq Event 60H , Umask 02H -Counts weighted cycles of offcore demand code read requests. Does not -include L2 prefetch requests. +Counts weighted cycles of offcore demand code read requests. +Does not include L2 prefetch requests. counter 0 .It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND.RFO .Pq Event 60H , Umask 04H -Counts weighted cycles of offcore demand RFO requests. Does not include L2 -prefetch requests. +Counts weighted cycles of offcore demand RFO requests. +Does not include L2 prefetch requests. counter 0 .It Li OFFCORE_REQUESTS_OUTSTANDING.ANY.READ .Pq Event 60H , Umask 08H -Counts weighted cycles of offcore read requests of any kind. Include L2 -prefetch requests. +Counts weighted cycles of offcore read requests of any kind. +Include L2 prefetch requests. counter 0 .It Li IFU_IVC.FULL .Pq Event 81H , Umask 01H @@ -1463,22 +1491,24 @@ translation was missed. Counts number of completed large page walks due to misses in the STLB. .It Li ITLB_MISSES.LARGE_WALK_COMPLETED .Pq Event 01H , Umask 80H -Counts number of offcore demand data read requests. Does not count L2 -prefetch requests. +Counts number of offcore demand data read requests. +Does not count L2 prefetch requests. .It Li OFFCORE_REQUESTS.DEMAND.READ_CODE .Pq Event B0H , Umask 02H -Counts number of offcore demand code read requests. Does not count L2 -prefetch requests. +Counts number of offcore demand code read requests. +Does not count L2 prefetch requests. .It Li OFFCORE_REQUESTS.DEMAND.RFO .Pq Event B0H , Umask 04H -Counts number of offcore demand RFO requests. Does not count L2 prefetch -requests. +Counts number of offcore demand RFO requests. +Does not count L2 prefetch requests. .It Li OFFCORE_REQUESTS.ANY.READ .Pq Event B0H , Umask 08H -Counts number of offcore read requests. Includes L2 prefetch requests. +Counts number of offcore read requests. +Includes L2 prefetch requests. .It Li OFFCORE_REQUESTS.ANY.RFO .Pq Event B0H , Umask 10H -Counts number of offcore RFO requests. Includes L2 prefetch requests. +Counts number of offcore RFO requests. +Includes L2 prefetch requests. .It Li OFFCORE_REQUESTS.UNCACHED_MEM .Pq Event B0H , Umask 20H Counts number of offcore uncached memory requests. @@ -1487,23 +1517,23 @@ Counts number of offcore uncached memory requests. Counts all offcore requests. .It Li SNOOPQ_REQUESTS_OUTSTANDING.DATA .Pq Event B3H , Umask 01H -Counts weighted cycles of snoopq requests for data. Counter 0 only -Use cmask=1 to count cycles not empty. +Counts weighted cycles of snoopq requests for data. +Counter 0 only Use cmask=1 to count cycles not empty. .It Li SNOOPQ_REQUESTS_OUTSTANDING.INVALIDATE .Pq Event B3H , Umask 02H -Counts weighted cycles of snoopq invalidate requests. Counter 0 only -Use cmask=1 to count cycles not empty. +Counts weighted cycles of snoopq invalidate requests. +Counter 0 only Use cmask=1 to count cycles not empty. .It Li SNOOPQ_REQUESTS_OUTSTANDING.CODE .Pq Event B3H , Umask 04H -Counts weighted cycles of snoopq requests for code. Counter 0 only -Use cmask=1 to count cycles not empty. +Counts weighted cycles of snoopq requests for code. +Counter 0 only Use cmask=1 to count cycles not empty. .It Li SNOOPQ_REQUESTS_OUTSTANDING.CODE .Pq Event BAH , Umask 04H Counts number of TPR reads .It Li PIC_ACCESSES.TPR_WRITES .Pq Event BAH , Umask 02H -Counts number of TPR writes -one or two micro-ops. Some instructions are decoded into longer sequences +Counts number of TPR writes one or two micro-ops. +Some instructions are decoded into longer sequences .It Li MACHINE_CLEARS.FUSION_ASSIST .Pq Event C3H , Umask 10H Counts the number of macro-fusion assists diff --git a/lib/libpmc/pmc.corei7uc.3 b/lib/libpmc/pmc.corei7uc.3 index 3bcda1c7b499..1f49222ceda6 100644 --- a/lib/libpmc/pmc.corei7uc.3 +++ b/lib/libpmc/pmc.corei7uc.3 @@ -115,8 +115,8 @@ Uncore cycles Global Queue read tracker is full. Uncore cycles Global Queue write tracker is full. *** 2808 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Mon Jul 19 06:19:46 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B648650A85; Mon, 19 Jul 2021 06:19:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GSsBp3Mn1z4c9F; Mon, 19 Jul 2021 06:19:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B60A12616; Mon, 19 Jul 2021 06:19:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16J6Jkla029463; Mon, 19 Jul 2021 06:19:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16J6Jk5w029462; Mon, 19 Jul 2021 06:19:46 GMT (envelope-from git) Date: Mon, 19 Jul 2021 06:19:46 GMT Message-Id: <202107190619.16J6Jk5w029462@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: b5d786b26894 - stable/12 - pmc(3): mandoc clean ups MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: b5d786b26894a8dd59c1978f65f66e7ca6cd2cc5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 06:19:46 -0000 The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b5d786b26894a8dd59c1978f65f66e7ca6cd2cc5 commit b5d786b26894a8dd59c1978f65f66e7ca6cd2cc5 Author: Gordon Bergling AuthorDate: 2021-07-12 04:28:03 +0000 Commit: Gordon Bergling CommitDate: 2021-07-19 06:19:27 +0000 pmc(3): mandoc clean ups - new sentence, new line - tab in filled text - unusual Xr order - skipping paragraph macro: Pp before Ss Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D31143 (cherry picked from commit 0b1293252543802b809b5f13f554e5d6391d3445) --- lib/libpmc/pmc.corei7.3 | 488 +++++++++++++++++++++------------------ lib/libpmc/pmc.corei7uc.3 | 377 ++++++++++++++++-------------- lib/libpmc/pmc.haswell.3 | 132 +++++------ lib/libpmc/pmc.haswelluc.3 | 17 +- lib/libpmc/pmc.haswellxeon.3 | 138 +++++------ lib/libpmc/pmc.iaf.3 | 1 - lib/libpmc/pmc.ivybridge.3 | 88 +++---- lib/libpmc/pmc.ivybridgexeon.3 | 103 +++++---- lib/libpmc/pmc.sandybridge.3 | 25 +- lib/libpmc/pmc.sandybridgexeon.3 | 120 +++++----- lib/libpmc/pmc.westmere.3 | 4 +- lib/libpmc/pmc.westmereuc.3 | 441 ++++++++++++++++++----------------- 12 files changed, 1024 insertions(+), 910 deletions(-) diff --git a/lib/libpmc/pmc.corei7.3 b/lib/libpmc/pmc.corei7.3 index ec310548d08e..e9e2a6e61784 100644 --- a/lib/libpmc/pmc.corei7.3 +++ b/lib/libpmc/pmc.corei7.3 @@ -93,17 +93,17 @@ Configure the Off-core Response bits. .It Li DMND_DATA_RD Counts the number of demand and DCU prefetch data reads of full and partial cachelines as well as demand data page table entry -cacheline reads. Does not count L2 data read prefetches or -instruction fetches. +cacheline reads. +Does not count L2 data read prefetches or instruction fetches. .It Li DMND_RFO Counts the number of demand and DCU prefetch reads for ownership -(RFO) requests generated by a write to data cacheline. Does not -count L2 RFO. +(RFO) requests generated by a write to data cacheline. +Does not count L2 RFO. .It Li DMND_IFETCH Counts the number of demand and DCU prefetch instruction cacheline -reads. Does not count L2 code read prefetches. -WB -Counts the number of writeback (modified to exclusive) transactions. +reads. +Does not count L2 code read prefetches. +WB Counts the number of writeback (modified to exclusive) transactions. .It Li PF_DATA_RD Counts the number of data cacheline reads generated by L2 prefetchers. .It Li PF_RFO @@ -176,11 +176,11 @@ Core i7 and Xeon 5500 programmable PMCs support the following events: Counts the number of store buffer drains. .It Li STORE_BLOCKS.AT_RET .Pq Event 06H , Umask 04H -Counts number of loads delayed with at-Retirement block code. The following -loads need to be executed at retirement and wait for all senior stores on -the same thread to be drained: load splitting across 4K boundary (page -split), load accessing uncacheable (UC or USWC) memory, load lock, and load -with page table in UC or USWC memory region. +Counts number of loads delayed with at-Retirement block code. +The following loads need to be executed at retirement and wait for all +senior stores on the same thread to be drained: load splitting across +4K boundary (page split), load accessing uncacheable +(UC or USWC) memory, load lock, and load with page table in UC or USWC memory region. .It Li STORE_BLOCKS.L1D_BLOCK .Pq Event 06H , Umask 08H Cacheable loads delayed with L1D block code @@ -220,9 +220,10 @@ ld_lat facility. In conjunction with ld_lat facility .It Li MEM_STORE_RETIRED.DTLB_MISS .Pq Event 0CH , Umask 01H -The event counts the number of retired stores that missed the DTLB. The DTLB -miss is not counted if the store operation causes a fault. Does not counter -prefetches. Counts both primary and secondary misses to the TLB +The event counts the number of retired stores that missed the DTLB. +The DTLB miss is not counted if the store operation causes a fault. +Does not counter prefetches. +Counts both primary and secondary misses to the TLB .It Li UOPS_ISSUED.ANY .Pq Event 0EH , Umask 01H Counts the number of Uops issued by the Register Allocation Table to the @@ -250,18 +251,20 @@ hit modified data in a sibling core residing on the same socket. .It Li MEM_UNCORE_RETIRED.REMOTE_CACHE_LOCAL_HOME_HIT .Pq Event 0FH , Umask 08H Counts number of memory load instructions retired where the memory reference -missed the L1, L2 and L3 caches and HIT in a remote socket's cache. Only -counts locally homed lines. +missed the L1, L2 and L3 caches and HIT in a remote socket's cache. +Only counts locally homed lines. .It Li MEM_UNCORE_RETIRED.REMOTE_DRAM .Pq Event 0FH , Umask 10H Counts number of memory load instructions retired where the memory reference -missed the L1, L2 and L3 caches and was remotely homed. This includes both -DRAM access and HITM in a remote socket's cache for remotely homed lines. +missed the L1, L2 and L3 caches and was remotely homed. +This includes both DRAM access and HITM in a remote socket's cache +for remotely homed lines. .It Li MEM_UNCORE_RETIRED.LOCAL_DRAM .Pq Event 0FH , Umask 20H Counts number of memory load instructions retired where the memory reference missed the L1, L2 and L3 caches and required a local socket memory -reference. This includes locally homed cachelines that were in a modified +reference. +This includes locally homed cachelines that were in a modified state in another socket. .It Li MEM_UNCORE_RETIRED.UNCACHEABLE .Pq Event 0FH , Umask 80H @@ -270,10 +273,10 @@ missed the L1, L2 and L3 caches and to perform I/O. Available only for CPUID signature 06_2EH .It Li FP_COMP_OPS_EXE.X87 .Pq Event 10H , Umask 01H -Counts the number of FP Computational Uops Executed. The number of FADD, -FSUB, FCOM, FMULs, integer MULsand IMULs, FDIVs, FPREMs, FSQRTS, integer -DIVs, and IDIVs. This event does not distinguish an FADD used in the middle -of a transcendental flow from a separate FADD instruction. +Counts the number of FP Computational Uops Executed. +The number of FADD, FSUB, FCOM, FMULs, integer MULsand IMULs, FDIVs, FPREMs, FSQRTS, integer +DIVs, and IDIVs. +This event does not distinguish an FADD used in the middle of a transcendental flow from a separate FADD instruction. .It Li FP_COMP_OPS_EXE.MMX .Pq Event 10H , Umask 02H Counts number of MMX Uops executed. @@ -322,8 +325,8 @@ Counts number of loads dispatched from the Reservation Station that bypass the Memory Order Buffer. .It Li LOAD_DISPATCH.RS_DELAYED .Pq Event 13H , Umask 02H -Counts the number of delayed RS dispatches at the stage latch. If an RS -dispatch can not bypass to LB, it has another chance to dispatch from the +Counts the number of delayed RS dispatches at the stage latch. +If an RS dispatch can not bypass to LB, it has another chance to dispatch from the one-cycle delayed staging latch before it is written into the LB. .It Li LOAD_DISPATCH.MOB .Pq Event 13H , Umask 04H @@ -335,14 +338,15 @@ Counts all loads dispatched from the Reservation Station. .It Li ARITH.CYCLES_DIV_BUSY .Pq Event 14H , Umask 01H Counts the number of cycles the divider is busy executing divide or square -root operations. The divide can be integer, X87 or Streaming SIMD Extensions -(SSE). The square root operation can be either X87 or SSE. +root operations. +The divide can be integer, X87 or Streaming SIMD Extensions (SSE). +The square root operation can be either X87 or SSE. Set 'edge =1, invert=1, cmask=1' to count the number of divides. Count may be incorrect When SMT is on. .It Li ARITH.MUL .Pq Event 14H , Umask 02H -Counts the number of multiply operations executed. This includes integer as -well as floating point multiply operations but excludes DPPS mul and MPSAD. +Counts the number of multiply operations executed. +This includes integer as well as floating point multiply operations but excludes DPPS mul and MPSAD. Count may be incorrect When SMT is on .It Li INST_QUEUE_WRITES .Pq Event 17H , Umask 01H @@ -350,65 +354,68 @@ Counts the number of instructions written into the instruction queue every cycle. .It Li INST_DECODED.DEC0 .Pq Event 18H , Umask 01H -Counts number of instructions that require decoder 0 to be decoded. Usually, -this means that the instruction maps to more than 1 uop +Counts number of instructions that require decoder 0 to be decoded. +Usually, this means that the instruction maps to more than 1 uop .It Li TWO_UOP_INSTS_DECODED .Pq Event 19H , Umask 01H An instruction that generates two uops was decoded .It Li INST_QUEUE_WRITE_CYCLES .Pq Event 1EH , Umask 01H This event counts the number of cycles during which instructions are written -to the instruction queue. Dividing this counter by the number of -instructions written to the instruction queue (INST_QUEUE_WRITES) yields the -average number of instructions decoded each cycle. If this number is less -than four and the pipe stalls, this indicates that the decoder is failing to +to the instruction queue. +Dividing this counter by the number of instructions written to the +instruction queue (INST_QUEUE_WRITES) yields the average number of +instructions decoded each cycle. +If this number is less than four and the pipe stalls, this indicates that the decoder is failing to decode enough instructions per cycle to sustain the 4-wide pipeline. If SSE* instructions that are 6 bytes or longer arrive one after another, -then front end throughput may limit execution speed. In such case, +then front end throughput may limit execution speed. +In such case, .It Li LSD_OVERFLOW .Pq Event 20H , Umask 01H Counts number of loops that cant stream from the instruction queue. .It Li L2_RQSTS.LD_HIT .Pq Event 24H , Umask 01H -Counts number of loads that hit the L2 cache. L2 loads include both L1D -demand misses as well as L1D prefetches. L2 loads can be rejected for -various reasons. Only non rejected loads are counted. +Counts number of loads that hit the L2 cache. +L2 loads include both L1D demand misses as well as L1D prefetches. +L2 loads can be rejected for various reasons. +Only non rejected loads are counted. .It Li L2_RQSTS.LD_MISS .Pq Event 24H , Umask 02H -Counts the number of loads that miss the L2 cache. L2 loads include both L1D -demand misses as well as L1D prefetches. +Counts the number of loads that miss the L2 cache. +L2 loads include both L1D demand misses as well as L1D prefetches. .It Li L2_RQSTS.LOADS .Pq Event 24H , Umask 03H -Counts all L2 load requests. L2 loads include both L1D demand misses as well -as L1D prefetches. +Counts all L2 load requests. +L2 loads include both L1D demand misses as well as L1D prefetches. .It Li L2_RQSTS.RFO_HIT .Pq Event 24H , Umask 04H -Counts the number of store RFO requests that hit the L2 cache. L2 RFO -requests include both L1D demand RFO misses as well as L1D RFO prefetches. +Counts the number of store RFO requests that hit the L2 cache. +L2 RFO requests include both L1D demand RFO misses as well as L1D RFO prefetches. Count includes WC memory requests, where the data is not fetched but the permission to write the line is required. .It Li L2_RQSTS.RFO_MISS .Pq Event 24H , Umask 08H -Counts the number of store RFO requests that miss the L2 cache. L2 RFO -requests include both L1D demand RFO misses as well as L1D RFO prefetches. +Counts the number of store RFO requests that miss the L2 cache. +L2 RFO requests include both L1D demand RFO misses as well as L1D RFO prefetches. .It Li L2_RQSTS.RFOS .Pq Event 24H , Umask 0CH -Counts all L2 store RFO requests. L2 RFO requests include both L1D demand -RFO misses as well as L1D RFO prefetches. +Counts all L2 store RFO requests. +L2 RFO requests include both L1D demand RFO misses as well as L1D RFO prefetches. .It Li L2_RQSTS.IFETCH_HIT .Pq Event 24H , Umask 10H -Counts number of instruction fetches that hit the L2 cache. L2 instruction -fetches include both L1I demand misses as well as L1I instruction +Counts number of instruction fetches that hit the L2 cache. +L2 instruction fetches include both L1I demand misses as well as L1I instruction prefetches. .It Li L2_RQSTS.IFETCH_MISS .Pq Event 24H , Umask 20H -Counts number of instruction fetches that miss the L2 cache. L2 instruction -fetches include both L1I demand misses as well as L1I instruction +Counts number of instruction fetches that miss the L2 cache. +L2 instruction fetches include both L1I demand misses as well as L1I instruction prefetches. .It Li L2_RQSTS.IFETCHES .Pq Event 24H , Umask 30H -Counts all instruction fetches. L2 instruction fetches include both L1I -demand misses as well as L1I instruction prefetches. +Counts all instruction fetches. +L2 instruction fetches include both L1I demand misses as well as L1I instruction prefetches. .It Li L2_RQSTS.PREFETCH_HIT .Pq Event 24H , Umask 40H Counts L2 prefetch hits for both code and data. @@ -427,27 +434,27 @@ Counts all L2 requests for both code and data. .It Li L2_DATA_RQSTS.DEMAND.I_STATE .Pq Event 26H , Umask 01H Counts number of L2 data demand loads where the cache line to be loaded is -in the I (invalid) state, i.e. a cache miss. L2 demand loads are both L1D -demand misses and L1D prefetches. +in the I (invalid) state, i.e. a cache miss. +L2 demand loads are both L1D demand misses and L1D prefetches. .It Li L2_DATA_RQSTS.DEMAND.S_STATE .Pq Event 26H , Umask 02H Counts number of L2 data demand loads where the cache line to be loaded is -in the S (shared) state. L2 demand loads are both L1D demand misses and L1D -prefetches. +in the S (shared) state. +L2 demand loads are both L1D demand misses and L1D prefetches. .It Li L2_DATA_RQSTS.DEMAND.E_STATE .Pq Event 26H , Umask 04H Counts number of L2 data demand loads where the cache line to be loaded is -in the E (exclusive) state. L2 demand loads are both L1D demand misses and -L1D prefetches. +in the E (exclusive) state. +L2 demand loads are both L1D demand misses and L1D prefetches. .It Li L2_DATA_RQSTS.DEMAND.M_STATE .Pq Event 26H , Umask 08H Counts number of L2 data demand loads where the cache line to be loaded is -in the M (modified) state. L2 demand loads are both L1D demand misses and -L1D prefetches. +in the M (modified) state. +L2 demand loads are both L1D demand misses and L1D prefetches. .It Li L2_DATA_RQSTS.DEMAND.MESI .Pq Event 26H , Umask 0FH -Counts all L2 data demand requests. L2 demand loads are both L1D demand -misses and L1D prefetches. +Counts all L2 data demand requests. +L2 demand loads are both L1D demand misses and L1D prefetches. .It Li L2_DATA_RQSTS.PREFETCH.I_STATE .Pq Event 26H , Umask 10H Counts number of L2 prefetch data loads where the cache line to be loaded is @@ -455,8 +462,9 @@ in the I (invalid) state, i.e. a cache miss. .It Li L2_DATA_RQSTS.PREFETCH.S_STATE .Pq Event 26H , Umask 20H Counts number of L2 prefetch data loads where the cache line to be loaded is -in the S (shared) state. A prefetch RFO will miss on an S state line, while -a prefetch read will hit on an S state line. +in the S (shared) state. +A prefetch RFO will miss on an S state line, while a prefetch read will +hit on an S state line. .It Li L2_DATA_RQSTS.PREFETCH.E_STATE .Pq Event 26H , Umask 40H Counts number of L2 prefetch data loads where the cache line to be loaded is @@ -474,29 +482,31 @@ Counts all L2 data requests. .It Li L2_WRITE.RFO.I_STATE .Pq Event 27H , Umask 01H Counts number of L2 demand store RFO requests where the cache line to be -loaded is in the I (invalid) state, i.e, a cache miss. The L1D prefetcher -does not issue a RFO prefetch. +loaded is in the I (invalid) state, i.e, a cache miss. +The L1D prefetcher does not issue a RFO prefetch. This is a demand RFO request .It Li L2_WRITE.RFO.S_STATE .Pq Event 27H , Umask 02H Counts number of L2 store RFO requests where the cache line to be loaded is -in the S (shared) state. The L1D prefetcher does not issue a RFO prefetch,. +in the S (shared) state. +The L1D prefetcher does not issue a RFO prefetch. This is a demand RFO request .It Li L2_WRITE.RFO.M_STATE .Pq Event 27H , Umask 08H Counts number of L2 store RFO requests where the cache line to be loaded is -in the M (modified) state. The L1D prefetcher does not issue a RFO prefetch. +in the M (modified) state. +The L1D prefetcher does not issue a RFO prefetch. This is a demand RFO request .It Li L2_WRITE.RFO.HIT .Pq Event 27H , Umask 0EH Counts number of L2 store RFO requests where the cache line to be loaded is -in either the S, E or M states. The L1D prefetcher does not issue a RFO -prefetch. +in either the S, E or M states. +The L1D prefetcher does not issue a RFO prefetch. This is a demand RFO request .It Li L2_WRITE.RFO.MESI .Pq Event 27H , Umask 0FH -Counts all L2 store RFO requests.The L1D prefetcher does not issue a RFO -prefetch. +Counts all L2 store RFO requests. +The L1D prefetcher does not issue a RFO prefetch. This is a demand RFO request .It Li L2_WRITE.LOCK.I_STATE .Pq Event 27H , Umask 10H @@ -543,25 +553,26 @@ Counts all L1 writebacks to the L2. .It Li L3_LAT_CACHE.REFERENCE .Pq Event 2EH , Umask 4FH This event counts requests originating from the core that reference a cache -line in the last level cache. The event count includes speculative traffic -but excludes cache line fills due to a L2 hardware-prefetch. Because cache -hierarchy, cache sizes and other implementation-specific characteristics; -value comparison to estimate performance differences is not recommended. +line in the last level cache. +The event count includes speculative traffic but excludes cache line fills +due to a L2 hardware-prefetch. +Because cache hierarchy, cache sizes and other implementation-specific +characteristics; value comparison to estimate performance differences is not recommended. see Table A-1 .It Li L3_LAT_CACHE.MISS .Pq Event 2EH , Umask 41H This event counts each cache miss condition for references to the last level -cache. The event count may include speculative traffic but excludes cache -line fills due to L2 hardware-prefetches. Because cache hierarchy, cache -sizes and other implementation-specific characteristics; value comparison to -estimate performance differences is not recommended. +cache. +The event count may include speculative traffic but excludes cache +line fills due to L2 hardware-prefetches. +Because cache hierarchy, cache sizes and other implementation-specific +characteristics; value comparison to estimate performance differences is not recommended. see Table A-1 .It Li CPU_CLK_UNHALTED.THREAD_P .Pq Event 3CH , Umask 00H Counts the number of thread cycles while the thread is not in a halt state. -The thread enters the halt state when it is running the HLT instruction. The -core frequency may change from time to time due to power or thermal -throttling. +The thread enters the halt state when it is running the HLT instruction. +The core frequency may change from time to time due to power or thermal throttling. see Table A-1 .It Li CPU_CLK_UNHALTED.REF_P .Pq Event 3CH , Umask 01H @@ -609,10 +620,10 @@ Counter 0, 1 only .It Li L1D_CACHE_LOCK.HIT .Pq Event 42H , Umask 01H Counts retired load locks that hit in the L1 data cache or hit in an already -allocated fill buffer. The lock portion of the load lock transaction must -hit in the L1D. -The initial load will pull the lock into the L1 data cache. Counter 0, 1 -only +allocated fill buffer. +The lock portion of the load lock transaction must hit in the L1D. +The initial load will pull the lock into the L1 data cache. +Counter 0, 1 only .It Li L1D_CACHE_LOCK.S_STATE .Pq Event 42H , Umask 02H Counts L1 data cache retired load locks that hit the target cache line in @@ -631,10 +642,10 @@ Counter 0, 1 only .It Li L1D_ALL_REF.ANY .Pq Event 43H , Umask 01H Counts all references (uncached, speculated and retired) to the L1 data -cache, including all loads and stores with any memory types. The event -counts memory accesses only when they are actually performed. For example, a -load blocked by unknown store address and later performed is only counted -once. +cache, including all loads and stores with any memory types. +The event counts memory accesses only when they are actually performed. +For example, a load blocked by unknown store address and later performed +is only counted once. The event does not include non- memory accesses, such as I/O accesses. Counter 0, 1 only .It Li L1D_ALL_REF.CACHEABLE @@ -650,8 +661,8 @@ Counts the number of misses in the STLB which causes a page walk. Counts number of misses in the STLB which resulted in a completed page walk. .It Li DTLB_MISSES.STLB_HIT .Pq Event 49H , Umask 10H -Counts the number of DTLB first level misses that hit in the second level -TLB. This event is only relevant if the core contains multiple DTLB levels. +Counts the number of DTLB first level misses that hit in the second level TLB. +This event is only relevant if the core contains multiple DTLB levels. .It Li DTLB_MISSES.PDE_MISS .Pq Event 49H , Umask 20H Number of DTLB misses caused by low part of address, includes references to 2M pages because 2M pages do not use the PDE. @@ -669,17 +680,18 @@ Counts number of hardware prefetch requests dispatched out of the prefetch FIFO. .It Li L1D_PREFETCH.MISS .Pq Event 4EH , Umask 02H -Counts number of hardware prefetch requests that miss the L1D. There are two -prefetchers in the L1D. A streamer, which predicts lines sequentially after -this one should be fetched, and the IP prefetcher that remembers access -patterns for the current instruction. The streamer prefetcher stops on an -L1D hit, while the IP prefetcher does not. +Counts number of hardware prefetch requests that miss the L1D. +There are two prefetchers in the L1D. +A streamer, which predicts lines sequentially after this one should be fetched, +and the IP prefetcher that remembers access patterns for the current instruction. +The streamer prefetcher stops on an L1D hit, while the IP prefetcher does not. .It Li L1D_PREFETCH.TRIGGERS .Pq Event 4EH , Umask 04H Counts number of prefetch requests triggered by the Finite State Machine and -pushed into the prefetch FIFO. Some of the prefetch requests are dropped due -to overwrites or competition between the IP index prefetcher and streamer -prefetcher. The prefetch FIFO contains 4 entries. +pushed into the prefetch FIFO. +Some of the prefetch requests are dropped due to overwrites or competition between +the IP index prefetcher and streamer prefetcher. +The prefetch FIFO contains 4 entries. .It Li L1D.REPL .Pq Event 51H , Umask 01H Counts the number of lines brought into the L1 data cache. @@ -708,12 +720,13 @@ Counts the number of cacheable load lock speculated or retired instructions accepted into the fill buffer. .It Li CACHE_LOCK_CYCLES.L1D_L2 .Pq Event 63H , Umask 01H -Cycle count during which the L1D and L2 are locked. A lock is asserted when -there is a locked memory access, due to uncacheable memory, a locked +Cycle count during which the L1D and L2 are locked. +A lock is asserted when there is a locked memory access, due to uncacheable memory, a locked operation that spans two cache lines, or a page walk from an uncacheable page table. -Counter 0, 1 only. L1D and L2 locks have a very high performance penalty and -it is highly recommended to avoid such accesses. +Counter 0, 1 only. +L1D and L2 locks have a very high performance penalty and it is highly recommended to +avoid such accesses. .It Li CACHE_LOCK_CYCLES.L1D .Pq Event 63H , Umask 02H Counts the number of cycles that cacheline in the L1 data cache unit is @@ -727,10 +740,11 @@ Counts the number of completed I/O transactions. Counts all instruction fetches that hit the L1 instruction cache. .It Li L1I.MISSES .Pq Event 80H , Umask 02H -Counts all instruction fetches that miss the L1I cache. This includes -instruction cache misses, streaming buffer misses, victim cache misses and -uncacheable fetches. An instruction fetch miss is counted only once and not -once for every cycle it is outstanding. +Counts all instruction fetches that miss the L1I cache. +This includes instruction cache misses, streaming buffer misses, victim cache misses and +uncacheable fetches. +An instruction fetch miss is counted only once and not once for every cycle +it is outstanding. .It Li L1I.READS .Pq Event 80H , Umask 03H Counts all instruction fetches, including uncacheable fetches that bypass @@ -803,10 +817,10 @@ Counts all near call branches executed, but not necessarily retired. Counts taken near branches executed, but not necessarily retired. .It Li BR_INST_EXEC.ANY .Pq Event 88H , Umask 7FH -Counts all near executed branches (not necessarily retired). This includes -only instructions and not micro-op branches. Frequent branching is not -necessarily a major performance issue. However frequent branch -mispredictions may be a problem. +Counts all near executed branches (not necessarily retired). +This includes only instructions and not micro-op branches. +Frequent branching is not necessarily a major performance issue. +However frequent branch mispredictions may be a problem. .It Li BR_MISP_EXEC.COND .Pq Event 89H , Umask 01H Counts the number of mispredicted conditional near branch instructions @@ -847,10 +861,10 @@ Counts the number of mispredicted near branch instructions that were executed, but not necessarily retired. .It Li RESOURCE_STALLS.ANY .Pq Event A2H , Umask 01H -Counts the number of Allocator resource related stalls. Includes register -renaming buffer entries, memory buffer entries. In addition to resource -related stalls, this event counts some other events. Includes stalls arising -during branch misprediction recovery, such as if retirement of the +Counts the number of Allocator resource related stalls. +Includes register renaming buffer entries, memory buffer entries. +In addition to resource related stalls, this event counts some other events. +Includes stalls arising during branch misprediction recovery, such as if retirement of the mispredicted branch is delayed and stalls arising while store buffer is draining from synchronizing operations. Does not include stalls due to SuperQ (off core) queue full, too many cache @@ -861,8 +875,8 @@ Counts the cycles of stall due to lack of load buffer for load operation. .It Li RESOURCE_STALLS.RS_FULL .Pq Event A2H , Umask 04H This event counts the number of cycles when the number of instructions in -the pipeline waiting for execution reaches the limit the processor can -handle. A high count of this event indicates that there are long latency +the pipeline waiting for execution reaches the limit the processor can handle. +A high count of this event indicates that there are long latency operations in the pipe (possibly load and store operations that miss the L2 cache, or instructions dependent upon instructions further down the pipeline that have yet to retire. @@ -872,8 +886,8 @@ start execution. .Pq Event A2H , Umask 08H This event counts the number of cycles that a resource related stall will occur due to the number of store instructions reaching the limit of the -pipeline, (i.e. all store buffers are used). The stall ends when a store -instruction commits its data to the cache or memory. +pipeline, (i.e. all store buffers are used). +The stall ends when a store instruction commits its data to the cache or memory. .It Li RESOURCE_STALLS.ROB_FULL .Pq Event A2H , Umask 10H Counts the cycles of stall due to re- order buffer full. @@ -884,7 +898,8 @@ floating-point unit (FPU) control word. .It Li RESOURCE_STALLS.MXCSR .Pq Event A2H , Umask 40H Stalls due to the MXCSR register rename occurring to close to a previous -MXCSR rename. The MXCSR provides control and status for the MMX registers. +MXCSR rename. +The MXCSR provides control and status for the MMX registers. .It Li RESOURCE_STALLS.OTHER .Pq Event A2H , Umask 80H Counts the number of cycles while execution was stalled due to other @@ -895,14 +910,15 @@ Counts the number of instructions decoded that are macro-fused but not necessarily executed or retired. .It Li BACLEAR_FORCE_IQ .Pq Event A7H , Umask 01H -Counts number of times a BACLEAR was forced by the Instruction Queue. The IQ -is also responsible for providing conditional branch prediction direction +Counts number of times a BACLEAR was forced by the Instruction Queue. +The IQ is also responsible for providing conditional branch prediction direction based on a static scheme and dynamic data provided by the L2 Branch -Prediction Unit. If the conditional branch target is not found in the Target -Array and the IQ predicts that the branch is taken, then the IQ will force -the Branch Address Calculator to issue a BACLEAR. Each BACLEAR asserted by -the BAC generates approximately an 8 cycle bubble in the instruction fetch -pipeline. +Prediction Unit. +If the conditional branch target is not found in the Target Array and the IQ +predicts that the branch is taken, then the IQ will force +the Branch Address Calculator to issue a BACLEAR. +Each BACLEAR asserted by the BAC generates approximately an 8 cycle bubble +in the instruction fetch pipeline. .It Li LSD.UOPS .Pq Event A8H , Umask 01H Counts the number of micro-ops delivered by loop stream detector @@ -915,30 +931,32 @@ Counts the number of ITLB flushes Counts number of L1D writebacks to the uncore. .It Li UOPS_EXECUTED.PORT0 .Pq Event B1H , Umask 01H -Counts number of Uops executed that were issued on port 0. Port 0 handles -integer arithmetic, SIMD and FP add Uops. +Counts number of Uops executed that were issued on port 0. +Port 0 handles integer arithmetic, SIMD and FP add Uops. .It Li UOPS_EXECUTED.PORT1 .Pq Event B1H , Umask 02H -Counts number of Uops executed that were issued on port 1. Port 1 handles -integer arithmetic, SIMD, integer shift, FP multiply and FP divide Uops. +Counts number of Uops executed that were issued on port 1. +Port 1 handles integer arithmetic, SIMD, integer shift, FP multiply and FP divide Uops. .It Li UOPS_EXECUTED.PORT2_CORE .Pq Event B1H , Umask 04H -Counts number of Uops executed that were issued on port 2. Port 2 handles -the load Uops. This is a core count only and can not be collected per -thread. +Counts number of Uops executed that were issued on port 2. +Port 2 handles the load Uops. +This is a core count only and can not be collected per thread. .It Li UOPS_EXECUTED.PORT3_CORE .Pq Event B1H , Umask 08H -Counts number of Uops executed that were issued on port 3. Port 3 handles -store Uops. This is a core count only and can not be collected per thread. +Counts number of Uops executed that were issued on port 3. +Port 3 handles store Uops. +This is a core count only and can not be collected per thread. .It Li UOPS_EXECUTED.PORT4_CORE .Pq Event B1H , Umask 10H -Counts number of Uops executed that where issued on port 4. Port 4 handles -the value to be stored for the store Uops issued on port 3. This is a core -count only and can not be collected per thread. +Counts number of Uops executed that where issued on port 4. +Port 4 handles the value to be stored for the store Uops issued on port 3. +This is a core count only and can not be collected per thread. .It Li UOPS_EXECUTED.CORE_ACTIVE_CYCLES_NO_PORT5 .Pq Event B1H , Umask 1FH Counts cycles when the Uops executed were issued from any ports except port -5. Use Cmask=1 for active cycles; Cmask=0 for weighted cycles; Use CMask=1, +5. +Use Cmask=1 for active cycles; Cmask=0 for weighted cycles; Use CMask=1, Invert=1 to count P0-4 stalled cycles Use Cmask=1, Edge=1, Invert=1 to count P0-4 stalls. .It Li UOPS_EXECUTED.PORT5 @@ -946,8 +964,8 @@ P0-4 stalls. Counts number of Uops executed that where issued on port 5. .It Li UOPS_EXECUTED.CORE_ACTIVE_CYCLES .Pq Event B1H , Umask 3FH -Counts cycles when the Uops are executing. Use Cmask=1 for active cycles; -Cmask=0 for weighted cycles; Use CMask=1, Invert=1 to count P0-4 stalled +Counts cycles when the Uops are executing. +Use Cmask=1 for active cycles; Cmask=0 for weighted cycles; Use CMask=1, Invert=1 to count P0-4 stalled cycles Use Cmask=1, Edge=1, Invert=1 to count P0-4 stalls. .It Li UOPS_EXECUTED.PORT015 .Pq Event B1H , Umask 40H @@ -986,7 +1004,8 @@ Requires programming MSR 01A7H See Table A-1 Notes: INST_RETIRED.ANY is counted by a designated fixed counter. INST_RETIRED.ANY_P is counted by a programmable counter and is an -architectural performance event. Event is supported if CPUID.A.EBX[1] = 0. +architectural performance event. +Event is supported if CPUID.A.EBX[1] = 0. Counting: Faulting executions of GETSEC/VM entry/VM Exit/MWait will not count as retired instructions. .It Li INST_RETIRED.X87 @@ -1001,10 +1020,10 @@ instructions. .It Li UOPS_RETIRED.ANY .Pq Event C2H , Umask 01H Counts the number of micro-ops retired, (macro-fused=1, micro- fused=2, -others=1; maximum count of 8 per cycle). Most instructions are composed of -one or two micro-ops. Some instructions are decoded into longer sequences -such as repeat instructions, floating point transcendental instructions, and -assists. +others=1; maximum count of 8 per cycle). +Most instructions are composed of one or two micro-ops. +Some instructions are decoded into longer sequences such as repeat instructions, +floating point transcendental instructions, and assists. Use cmask=1 and invert to count active cycles or stalled cycles .It Li UOPS_RETIRED.RETIRE_SLOTS .Pq Event C2H , Umask 02H @@ -1022,7 +1041,8 @@ Counts the number of machine clears due to memory order conflicts. .Pq Event C3H , Umask 04H Counts the number of times that a program writes to a code section. Self-modifying code causes a sever penalty in all Intel 64 and IA-32 -processors. The modified cache line is written back to the L2 and L3caches. +processors. +The modified cache line is written back to the L2 and L3caches. .It Li BR_INST_RETIRED.ALL_BRANCHES .Pq Event C4H , Umask 00H See Table A-1 @@ -1072,24 +1092,25 @@ Counts number of retired loads that hit their own, unshared lines in the L3 cache. .It Li MEM_LOAD_RETIRED.OTHER_CORE_L2_HIT_HITM .Pq Event CBH , Umask 08H -Counts number of retired loads that hit in a sibling core's L2 (on die -core). Since the L3 is inclusive of all cores on the package, this is an L3 -hit. This counts both clean or modified hits. +Counts number of retired loads that hit in a sibling core's L2 (on die core). +Since the L3 is inclusive of all cores on the package, this is an L3 hit. +This counts both clean or modified hits. .It Li MEM_LOAD_RETIRED.L3_MISS .Pq Event CBH , Umask 10H -Counts number of retired loads that miss the L3 cache. The load was -satisfied by a remote socket, local memory or an IOH. +Counts number of retired loads that miss the L3 cache. +The load was satisfied by a remote socket, local memory or an IOH. .It Li MEM_LOAD_RETIRED.HIT_LFB .Pq Event CBH , Umask 40H Counts number of retired loads that miss the L1D and the address is located -in an allocated line fill buffer and will soon be committed to cache. This -is counting secondary L1D misses. +in an allocated line fill buffer and will soon be committed to cache. +This is counting secondary L1D misses. .It Li MEM_LOAD_RETIRED.DTLB_MISS .Pq Event CBH , Umask 80H -Counts the number of retired loads that missed the DTLB. The DTLB miss is -not counted if the load operation causes a fault. This event counts loads -from cacheable memory only. The event does not count loads by software -prefetches. Counts both primary and secondary misses to the TLB. +Counts the number of retired loads that missed the DTLB. +The DTLB miss is not counted if the load operation causes a fault. +This event counts loads from cacheable memory only. +The event does not count loads by software prefetches. +Counts both primary and secondary misses to the TLB. .It Li FP_MMX_TRANS.TO_FP .Pq Event CCH , Umask 01H Counts the first floating-point instruction following any MMX instruction. @@ -1097,29 +1118,30 @@ You can use this event to estimate the penalties for the transitions between floating-point and MMX technology states. .It Li FP_MMX_TRANS.TO_MMX .Pq Event CCH , Umask 02H -Counts the first MMX instruction following a floating-point instruction. You -can use this event to estimate the penalties for the transitions between +Counts the first MMX instruction following a floating-point instruction. +You can use this event to estimate the penalties for the transitions between floating-point and MMX technology states. .It Li FP_MMX_TRANS.ANY .Pq Event CCH , Umask 03H Counts all transitions from floating point to MMX instructions and from MMX -instructions to floating point instructions. You can use this event to -estimate the penalties for the transitions between floating-point and MMX -technology states. +instructions to floating point instructions. +You can use this event to estimate the penalties for the transitions between +floating-point and MMX technology states. .It Li MACRO_INSTS.DECODED .Pq Event D0H , Umask 01H Counts the number of instructions decoded, (but not necessarily executed or retired). .It Li UOPS_DECODED.MS .Pq Event D1H , Umask 02H -Counts the number of Uops decoded by the Microcode Sequencer, MS. The MS -delivers uops when the instruction is more than 4 uops long or a microcode +Counts the number of Uops decoded by the Microcode Sequencer, MS. +The MS delivers uops when the instruction is more than 4 uops long or a microcode assist is occurring. .It Li UOPS_DECODED.ESP_FOLDING .Pq Event D1H , Umask 04H Counts number of stack pointer (ESP) instructions decoded: push , pop , call -, ret, etc. ESP instructions do not generate a Uop to increment or decrement -ESP. Instead, they update an ESP_Offset register that keeps track of the +, ret, etc. +ESP instructions do not generate a Uop to increment or decrement ESP. +Instead, they update an ESP_Offset register that keeps track of the delta to the current value of the ESP register. .It Li UOPS_DECODED.ESP_SYNC .Pq Event D1H , Umask 08H @@ -1129,8 +1151,8 @@ value of the ESP register. .It Li RAT_STALLS.FLAGS .Pq Event D2H , Umask 01H Counts the number of cycles during which execution stalled due to several -reasons, one of which is a partial flag register stall. A partial register -stall may occur when two conditions are met: 1) an instruction modifies +reasons, one of which is a partial flag register stall. +A partial register stall may occur when two conditions are met: 1) an instruction modifies some, but not all, of the flags in the flag register and 2) the next instruction, which depends on flags, depends on flags that were not modified by this instruction. @@ -1142,30 +1164,33 @@ was partially written by previous instruction. .It Li RAT_STALLS.ROB_READ_PORT .Pq Event D2H , Umask 04H Counts the number of cycles when ROB read port stalls occurred, which did -not allow new micro-ops to enter the out-of-order pipeline. Note that, at -this stage in the pipeline, additional stalls may occur at the same cycle -and prevent the stalled micro-ops from entering the pipe. In such a case, -micro-ops retry entering the execution pipe in the next cycle and the -ROB-read port stall is counted again. +not allow new micro-ops to enter the out-of-order pipeline. +Note that, at this stage in the pipeline, additional stalls may occur at +the same cycle and prevent the stalled micro-ops from entering the pipe. +In such a case, micro-ops retry entering the execution pipe in the next +cycle and the ROB-read port stall is counted again. .It Li RAT_STALLS.SCOREBOARD .Pq Event D2H , Umask 08H Counts the cycles where we stall due to microarchitecturally required -serialization. Microcode scoreboarding stalls. +serialization. +Microcode scoreboarding stalls. .It Li RAT_STALLS.ANY .Pq Event D2H , Umask 0FH Counts all Register Allocation Table stall cycles due to: Cycles when ROB read port stalls occurred, which did not allow new micro-ops to enter the -execution pipe. Cycles when partial register stalls occurred Cycles when -flag stalls occurred Cycles floating-point unit (FPU) status word stalls -occurred. To count each of these conditions separately use the events: +execution pipe. +Cycles when partial register stalls occurred Cycles when flag stalls occurred +Cycles floating-point unit (FPU) status word stalls occurred. +To count each of these conditions separately use the events: RAT_STALLS.ROB_READ_PORT, RAT_STALLS.PARTIAL, RAT_STALLS.FLAGS, and RAT_STALLS.FPSW. .It Li SEG_RENAME_STALLS .Pq Event D4H , Umask 01H Counts the number of stall cycles due to the lack of renaming resources for -the ES, DS, FS, and GS segment registers. If a segment is renamed but not -retired and a second update to the same segment occurs, a stall occurs in -the front-end of the pipeline until the renamed segment retires. +the ES, DS, FS, and GS segment registers. +If a segment is renamed but not retired and a second update to the same +segment occurs, a stall occurs in the front-end of the pipeline until the +renamed segment retires. .It Li ES_REG_RENAMES .Pq Event D5H , Umask 01H Counts the number of times the ES segment register is renamed. @@ -1183,17 +1208,19 @@ or return branch. .Pq Event E6H , Umask 01H Counts the number of times the front end is resteered, mainly when the Branch Prediction Unit cannot provide a correct prediction and this is -corrected by the Branch Address Calculator at the front end. This can occur -if the code has many branches such that they cannot be consumed by the BPU. +corrected by the Branch Address Calculator at the front end. +This can occur if the code has many branches such that they cannot be +consumed by the BPU. Each BACLEAR asserted by the BAC generates approximately an 8 cycle bubble -in the instruction fetch pipeline. The effect on total execution time -depends on the surrounding code. +in the instruction fetch pipeline. +The effect on total execution time depends on the surrounding code. .It Li BACLEAR.BAD_TARGET .Pq Event E6H , Umask 02H Counts number of Branch Address Calculator clears (BACLEAR) asserted due to conditional branch instructions in which there was a target hit but the -direction was wrong. Each BACLEAR asserted by the BAC generates -approximately an 8 cycle bubble in the instruction fetch pipeline. +direction was wrong. +Each BACLEAR asserted by the BAC generates approximately an 8 cycle bubble in +the instruction fetch pipeline. .It Li BPU_CLEARS.EARLY .Pq Event E8H , Umask 01H Counts early (normal) Branch Prediction Unit clears: BPU predicted a taken @@ -1201,8 +1228,8 @@ branch after incorrectly assuming that it was not taken. The BPU clear leads to 2 cycle bubble in the Front End. .It Li BPU_CLEARS.LATE .Pq Event E8H , Umask 02H -Counts late Branch Prediction Unit clears due to Most Recently Used -conflicts. The PBU clear leads to a 3 cycle bubble in the Front End. +Counts late Branch Prediction Unit clears due to Most Recently Used conflicts. +The PBU clear leads to a 3 cycle bubble in the Front End. .It Li L2_TRANSACTIONS.LOAD .Pq Event F0H , Umask 01H Counts L2 load operations due to HW prefetch or demand loads. @@ -1259,12 +1286,13 @@ Counts all L2 cache lines evicted for any reason. Counts the number of SQ lock splits across a cache line. .It Li SQ_FULL_STALL_CYCLES .Pq Event F6H , Umask 01H -Counts cycles the Super Queue is full. Neither of the threads on this core -will be able to access the uncore. +Counts cycles the Super Queue is full. +Neither of the threads on this core will be able to access the uncore. .It Li FP_ASSIST.ALL .Pq Event F7H , Umask 01H Counts the number of floating point operations executed that required -micro-code assist intervention. Assists are required in the following cases: +micro-code assist intervention. +Assists are required in the following cases: SSE instructions, (Denormal input when the DAZ flag is off or Underflow result when the FTZ flag is off): x87 instructions, (NaN or denormal are loaded to a register or used as input from memory, Division by 0 or @@ -1361,8 +1389,8 @@ Number of cycles interrupts are pending and masked .It Li HW_INT.CYCLES_PENDING_AND_MASKED .Pq Event 04H , Umask 04H Counts number of L2 store RFO requests where the cache line to be loaded is -in the E (exclusive) state. The L1D prefetcher does not issue a RFO -prefetch. +in the E (exclusive) state. +The L1D prefetcher does not issue a RFO prefetch. This is a demand RFO request .It Li HW_INT.CYCLES_PENDING_AND_MASKED .Pq Event 27H , Umask 04H @@ -1403,34 +1431,34 @@ Counts number of SSE non temporal stores Counts store fence cycles .It Li EPT.EPDE_MISS .Pq Event 4FH , Umask 02H -Counts Extended Page Directory Entry misses. The Extended Page Directory -cache is used by Virtual Machine operating systems while the guest operating -systems use the standard TLB caches. +Counts Extended Page Directory Entry misses. +The Extended Page Directory cache is used by Virtual Machine operating +systems while the guest operating systems use the standard TLB caches. .It Li EPT.EPDPE_HIT .Pq Event 4FH , Umask 04H Counts Extended Page Directory Pointer Entry hits. .It Li EPT.EPDPE_MISS .Pq Event 4FH , Umask 08H -Counts Extended Page Directory Pointer Entry misses. T +Counts Extended Page Directory Pointer Entry misses. .It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND.READ_DATA .Pq Event 60H , Umask 01H -Counts weighted cycles of offcore demand data read requests. Does not -include L2 prefetch requests. +Counts weighted cycles of offcore demand data read requests. +Does not include L2 prefetch requests. counter 0 .It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND.READ_CODE .Pq Event 60H , Umask 02H -Counts weighted cycles of offcore demand code read requests. Does not -include L2 prefetch requests. +Counts weighted cycles of offcore demand code read requests. +Does not include L2 prefetch requests. counter 0 .It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND.RFO .Pq Event 60H , Umask 04H -Counts weighted cycles of offcore demand RFO requests. Does not include L2 -prefetch requests. +Counts weighted cycles of offcore demand RFO requests. +Does not include L2 prefetch requests. counter 0 .It Li OFFCORE_REQUESTS_OUTSTANDING.ANY.READ .Pq Event 60H , Umask 08H -Counts weighted cycles of offcore read requests of any kind. Include L2 -prefetch requests. +Counts weighted cycles of offcore read requests of any kind. +Include L2 prefetch requests. counter 0 .It Li IFU_IVC.FULL .Pq Event 81H , Umask 01H @@ -1463,22 +1491,24 @@ translation was missed. Counts number of completed large page walks due to misses in the STLB. .It Li ITLB_MISSES.LARGE_WALK_COMPLETED .Pq Event 01H , Umask 80H -Counts number of offcore demand data read requests. Does not count L2 -prefetch requests. +Counts number of offcore demand data read requests. +Does not count L2 prefetch requests. .It Li OFFCORE_REQUESTS.DEMAND.READ_CODE .Pq Event B0H , Umask 02H -Counts number of offcore demand code read requests. Does not count L2 -prefetch requests. +Counts number of offcore demand code read requests. +Does not count L2 prefetch requests. .It Li OFFCORE_REQUESTS.DEMAND.RFO .Pq Event B0H , Umask 04H -Counts number of offcore demand RFO requests. Does not count L2 prefetch -requests. +Counts number of offcore demand RFO requests. +Does not count L2 prefetch requests. .It Li OFFCORE_REQUESTS.ANY.READ .Pq Event B0H , Umask 08H -Counts number of offcore read requests. Includes L2 prefetch requests. +Counts number of offcore read requests. +Includes L2 prefetch requests. .It Li OFFCORE_REQUESTS.ANY.RFO .Pq Event B0H , Umask 10H -Counts number of offcore RFO requests. Includes L2 prefetch requests. +Counts number of offcore RFO requests. +Includes L2 prefetch requests. .It Li OFFCORE_REQUESTS.UNCACHED_MEM .Pq Event B0H , Umask 20H Counts number of offcore uncached memory requests. @@ -1487,23 +1517,23 @@ Counts number of offcore uncached memory requests. Counts all offcore requests. .It Li SNOOPQ_REQUESTS_OUTSTANDING.DATA .Pq Event B3H , Umask 01H -Counts weighted cycles of snoopq requests for data. Counter 0 only -Use cmask=1 to count cycles not empty. +Counts weighted cycles of snoopq requests for data. +Counter 0 only Use cmask=1 to count cycles not empty. .It Li SNOOPQ_REQUESTS_OUTSTANDING.INVALIDATE .Pq Event B3H , Umask 02H -Counts weighted cycles of snoopq invalidate requests. Counter 0 only -Use cmask=1 to count cycles not empty. +Counts weighted cycles of snoopq invalidate requests. +Counter 0 only Use cmask=1 to count cycles not empty. .It Li SNOOPQ_REQUESTS_OUTSTANDING.CODE .Pq Event B3H , Umask 04H -Counts weighted cycles of snoopq requests for code. Counter 0 only -Use cmask=1 to count cycles not empty. +Counts weighted cycles of snoopq requests for code. +Counter 0 only Use cmask=1 to count cycles not empty. .It Li SNOOPQ_REQUESTS_OUTSTANDING.CODE .Pq Event BAH , Umask 04H Counts number of TPR reads .It Li PIC_ACCESSES.TPR_WRITES .Pq Event BAH , Umask 02H -Counts number of TPR writes -one or two micro-ops. Some instructions are decoded into longer sequences +Counts number of TPR writes one or two micro-ops. +Some instructions are decoded into longer sequences .It Li MACHINE_CLEARS.FUSION_ASSIST .Pq Event C3H , Umask 10H Counts the number of macro-fusion assists diff --git a/lib/libpmc/pmc.corei7uc.3 b/lib/libpmc/pmc.corei7uc.3 index 3bcda1c7b499..1f49222ceda6 100644 --- a/lib/libpmc/pmc.corei7uc.3 +++ b/lib/libpmc/pmc.corei7uc.3 @@ -115,8 +115,8 @@ Uncore cycles Global Queue read tracker is full. Uncore cycles Global Queue write tracker is full. *** 2808 LINES SKIPPED *** From owner-dev-commits-src-branches@freebsd.org Mon Jul 19 06:46:13 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA0CA650BC5; Mon, 19 Jul 2021 06:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GSsnK4yhBz4gm5; Mon, 19 Jul 2021 06:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91EAB12C21; Mon, 19 Jul 2021 06:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16J6kDYi069052; Mon, 19 Jul 2021 06:46:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16J6kDMZ069051; Mon, 19 Jul 2021 06:46:13 GMT (envelope-from git) Date: Mon, 19 Jul 2021 06:46:13 GMT Message-Id: <202107190646.16J6kDMZ069051@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: c5fa78d35d71 - stable/13 - rtwn: make sure to not write in upper bits of txdseq MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c5fa78d35d718a0a8aa5cd0226a5abbe56f755d0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 06:46:13 -0000 The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=c5fa78d35d718a0a8aa5cd0226a5abbe56f755d0 commit c5fa78d35d718a0a8aa5cd0226a5abbe56f755d0 Author: Andriy Gapon AuthorDate: 2021-06-21 08:05:04 +0000 Commit: Andriy Gapon CommitDate: 2021-07-19 06:45:41 +0000 rtwn: make sure to not write in upper bits of txdseq ni_txseqs is kept as 16-bit counter, but we need to trim the upper four bits as they may have special meanings for the firmware / hardware. For instance, bit 15 enables hardware / firmware generation of sequence numbers that overrides sequence numbers programmed by the driver. Reviewed by: adrian (cherry picked from commit 7544c1d20d8b7127ed3511edeb94e01d328daebb) --- sys/dev/rtwn/rtl8192c/r92c_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/rtwn/rtl8192c/r92c_tx.c b/sys/dev/rtwn/rtl8192c/r92c_tx.c index ab2d05635358..b01731ba29ed 100644 --- a/sys/dev/rtwn/rtl8192c/r92c_tx.c +++ b/sys/dev/rtwn/rtl8192c/r92c_tx.c @@ -335,7 +335,7 @@ r92c_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni, uint16_t seqno; if (m->m_flags & M_AMPDU_MPDU) { - seqno = ni->ni_txseqs[tid]; + seqno = ni->ni_txseqs[tid] % IEEE80211_SEQ_RANGE; ni->ni_txseqs[tid]++; } else seqno = M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE; From owner-dev-commits-src-branches@freebsd.org Mon Jul 19 06:50:12 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD810650DD7; Mon, 19 Jul 2021 06:50:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GSssw5XX7z4hPD; Mon, 19 Jul 2021 06:50:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A298E12C23; Mon, 19 Jul 2021 06:50:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16J6oCCS073456; Mon, 19 Jul 2021 06:50:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16J6oCsP073452; Mon, 19 Jul 2021 06:50:12 GMT (envelope-from git) Date: Mon, 19 Jul 2021 06:50:12 GMT Message-Id: <202107190650.16J6oCsP073452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 038279d2a86f - stable/12 - rtwn: make sure to not write in upper bits of txdseq MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 038279d2a86f904b51f1b65d1ef283c09884b04f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 06:50:12 -0000 The branch stable/12 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=038279d2a86f904b51f1b65d1ef283c09884b04f commit 038279d2a86f904b51f1b65d1ef283c09884b04f Author: Andriy Gapon AuthorDate: 2021-06-21 08:05:04 +0000 Commit: Andriy Gapon CommitDate: 2021-07-19 06:49:53 +0000 rtwn: make sure to not write in upper bits of txdseq ni_txseqs is kept as 16-bit counter, but we need to trim the upper four bits as they may have special meanings for the firmware / hardware. For instance, bit 15 enables hardware / firmware generation of sequence numbers that overrides sequence numbers programmed by the driver. Reviewed by: adrian (cherry picked from commit 7544c1d20d8b7127ed3511edeb94e01d328daebb) --- sys/dev/rtwn/rtl8192c/r92c_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/rtwn/rtl8192c/r92c_tx.c b/sys/dev/rtwn/rtl8192c/r92c_tx.c index ab2d05635358..b01731ba29ed 100644 --- a/sys/dev/rtwn/rtl8192c/r92c_tx.c +++ b/sys/dev/rtwn/rtl8192c/r92c_tx.c @@ -335,7 +335,7 @@ r92c_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni, uint16_t seqno; if (m->m_flags & M_AMPDU_MPDU) { - seqno = ni->ni_txseqs[tid]; + seqno = ni->ni_txseqs[tid] % IEEE80211_SEQ_RANGE; ni->ni_txseqs[tid]++; } else seqno = M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE; From owner-dev-commits-src-branches@freebsd.org Mon Jul 19 09:57:35 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8137654025; Mon, 19 Jul 2021 09:57:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GSy275s0cz3q0l; Mon, 19 Jul 2021 09:57:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD53D1530D; Mon, 19 Jul 2021 09:57:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16J9vZif023884; Mon, 19 Jul 2021 09:57:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16J9vZVp023883; Mon, 19 Jul 2021 09:57:35 GMT (envelope-from git) Date: Mon, 19 Jul 2021 09:57:35 GMT Message-Id: <202107190957.16J9vZVp023883@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: a54e547950f7 - stable/13 - arm: replace byte-by-byte memcmp with an already existing asm variant MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a54e547950f7fd146fefa166aea9bbbbe2c01e7c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 09:57:36 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a54e547950f7fd146fefa166aea9bbbbe2c01e7c commit a54e547950f7fd146fefa166aea9bbbbe2c01e7c Author: Mateusz Guzik AuthorDate: 2021-07-19 09:54:18 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-19 09:54:18 +0000 arm: replace byte-by-byte memcmp with an already existing asm variant So happens bcmp as found in support.S is in fact renamed memcmp, add memcmp back as a symbol. This is a direct commit to keep the old symbol around, see 9ef5b65085ed2acd ("arm: bcmp -> memcmp") in main for reference. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/arm/arm/support.S | 2 ++ sys/conf/files.arm | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/arm/arm/support.S b/sys/arm/arm/support.S index a3ee3c3b93ba..83b295feafce 100644 --- a/sys/arm/arm/support.S +++ b/sys/arm/arm/support.S @@ -241,6 +241,7 @@ EEND(memset) END(bzero) ENTRY(bcmp) +EENTRY(memcmp) mov ip, r0 cmp r2, #0x06 beq .Lmemcmp_6bytes @@ -348,6 +349,7 @@ ENTRY(bcmp) RETne /* Return if mismatch on #4 */ sub r0, r3, r2 /* r0 = b1#5 - b2#5 */ RET +EEND(memcmp) END(bcmp) ENTRY(bcopy) diff --git a/sys/conf/files.arm b/sys/conf/files.arm index a3b0d166f020..44402b5aa433 100644 --- a/sys/conf/files.arm +++ b/sys/conf/files.arm @@ -123,7 +123,6 @@ libkern/fls.c optional !armv7 !armv6 libkern/flsl.c optional !armv7 !armv6 libkern/flsll.c optional !armv7 !armv6 libkern/lshrdi3.c standard -libkern/memcmp.c standard libkern/moddi3.c standard libkern/qdivrem.c standard libkern/strlen.c standard From owner-dev-commits-src-branches@freebsd.org Mon Jul 19 09:58:31 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0B1A6540C8; Mon, 19 Jul 2021 09:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GSy3C51lZz3q47; Mon, 19 Jul 2021 09:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90EE215424; Mon, 19 Jul 2021 09:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16J9wVtZ024056; Mon, 19 Jul 2021 09:58:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16J9wVex024055; Mon, 19 Jul 2021 09:58:31 GMT (envelope-from git) Date: Mon, 19 Jul 2021 09:58:31 GMT Message-Id: <202107190958.16J9wVex024055@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 5b97b0d41940 - stable/12 - arm: replace byte-by-byte memcmp with an already existing asm variant MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5b97b0d41940c886fe6e0b9883b9c3cd706828fa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 09:58:31 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=5b97b0d41940c886fe6e0b9883b9c3cd706828fa commit 5b97b0d41940c886fe6e0b9883b9c3cd706828fa Author: Mateusz Guzik AuthorDate: 2021-07-19 09:58:15 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-19 09:58:15 +0000 arm: replace byte-by-byte memcmp with an already existing asm variant So happens bcmp as found in support.S is in fact renamed memcmp, add memcmp back as a symbol. This is a direct commit to keep the old symbol around, see 9ef5b65085ed2acd ("arm: bcmp -> memcmp") in main for reference. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/arm/arm/support.S | 2 ++ sys/conf/files.arm | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/arm/arm/support.S b/sys/arm/arm/support.S index 8f1191f03098..0bcd7b65e924 100644 --- a/sys/arm/arm/support.S +++ b/sys/arm/arm/support.S @@ -282,6 +282,7 @@ EEND(memset) END(bzero) ENTRY(bcmp) +EENTRY(memcmp) mov ip, r0 cmp r2, #0x06 beq .Lmemcmp_6bytes @@ -389,6 +390,7 @@ ENTRY(bcmp) RETne /* Return if mismatch on #4 */ sub r0, r3, r2 /* r0 = b1#5 - b2#5 */ RET +EEND(memcmp) END(bcmp) ENTRY(bcopy) diff --git a/sys/conf/files.arm b/sys/conf/files.arm index 88a3b5efe90d..468bc471458b 100644 --- a/sys/conf/files.arm +++ b/sys/conf/files.arm @@ -147,7 +147,6 @@ libkern/fls.c standard libkern/flsl.c standard libkern/flsll.c standard libkern/lshrdi3.c standard -libkern/memcmp.c standard libkern/moddi3.c standard libkern/qdivrem.c standard libkern/ucmpdi2.c standard From owner-dev-commits-src-branches@freebsd.org Mon Jul 19 18:17:39 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7108F65C117; Mon, 19 Jul 2021 18:17:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GT9772gC8z4p8r; Mon, 19 Jul 2021 18:17:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42DC81B8DA; Mon, 19 Jul 2021 18:17:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16JIHd1F096147; Mon, 19 Jul 2021 18:17:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16JIHdZx096146; Mon, 19 Jul 2021 18:17:39 GMT (envelope-from git) Date: Mon, 19 Jul 2021 18:17:39 GMT Message-Id: <202107191817.16JIHdZx096146@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Wing Subject: git: fb2feceac34c - stable/13 - fsck_ffs: fix background fsck in preen mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fb2feceac34cc9c3fb47ba4a7b0ca31637f8fdf0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2021 18:17:39 -0000 The branch stable/13 has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=fb2feceac34cc9c3fb47ba4a7b0ca31637f8fdf0 commit fb2feceac34cc9c3fb47ba4a7b0ca31637f8fdf0 Author: Robert Wing AuthorDate: 2021-07-11 20:47:27 +0000 Commit: Robert Wing CommitDate: 2021-07-19 18:06:53 +0000 fsck_ffs: fix background fsck in preen mode Background checks are only allowed for mounted filesystems - don't try to open the device for writing when performing a background check. While here, remove a debugging printf that's commented out. PR: 256746 Fixes: 5cc52631b3b88dfc36d8049dc8bece8573c5f9af Reviewed by: mckusick Differential Revision: https://reviews.freebsd.org/D30880 (cherry picked from commit 0c5a59252c8e7b80b98521ebc23a415a05ff9594) --- sbin/fsck_ffs/main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c index 67aff2dde73c..2c6c93dce5dc 100644 --- a/sbin/fsck_ffs/main.c +++ b/sbin/fsck_ffs/main.c @@ -295,15 +295,14 @@ checkfilesys(char *filesys) */ if ((fsreadfd = open(filesys, O_RDONLY)) < 0 || readsb(0) == 0) exit(3); /* Cannot read superblock */ - if (nflag || (fswritefd = open(filesys, O_WRONLY)) < 0) { + if (bkgrdflag == 0 && + (nflag || (fswritefd = open(filesys, O_WRONLY)) < 0)) { fswritefd = -1; if (preen) pfatal("NO WRITE ACCESS"); printf(" (NO WRITE)"); } if ((sblock.fs_flags & FS_GJOURNAL) != 0) { - //printf("GJournaled file system detected on %s.\n", - // filesys); if (sblock.fs_clean == 1) { pwarn("FILE SYSTEM CLEAN; SKIPPING CHECKS\n"); exit(0); @@ -317,10 +316,10 @@ checkfilesys(char *filesys) } else { pfatal( "UNEXPECTED INCONSISTENCY, CANNOT RUN FAST FSCK\n"); - close(fsreadfd); - close(fswritefd); } } + close(fsreadfd); + close(fswritefd); } /* * If we are to do a background check: From owner-dev-commits-src-branches@freebsd.org Tue Jul 20 14:50:31 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 245AF66D4FC; Tue, 20 Jul 2021 14:50:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GThTg0Qb2z4f64; Tue, 20 Jul 2021 14:50:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E965F4AD9; Tue, 20 Jul 2021 14:50:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16KEoUfu042662; Tue, 20 Jul 2021 14:50:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KEoULV042661; Tue, 20 Jul 2021 14:50:30 GMT (envelope-from git) Date: Tue, 20 Jul 2021 14:50:30 GMT Message-Id: <202107201450.16KEoULV042661@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: ff8f8cd982b0 - stable/12 - tcpdump: decode packets on pfsync interfaces MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ff8f8cd982b092022a67e22c1cc04d53704521f1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 14:50:31 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ff8f8cd982b092022a67e22c1cc04d53704521f1 commit ff8f8cd982b092022a67e22c1cc04d53704521f1 Author: Luiz Otavio O Souza AuthorDate: 2021-07-12 17:15:15 +0000 Commit: Kristof Provost CommitDate: 2021-07-20 06:48:18 +0000 tcpdump: decode packets on pfsync interfaces Reviewed by: kp, scottl Obtained from: pfsense MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31153 (cherry picked from commit 3f240bdf3652ea823af34b0f399e2c8be5a6320a) --- contrib/tcpdump/netdissect.h | 1 + contrib/tcpdump/print-pfsync.c | 15 +++++++-------- contrib/tcpdump/print.c | 3 +++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/contrib/tcpdump/netdissect.h b/contrib/tcpdump/netdissect.h index 20b5ef63668c..8612e11c3c7e 100644 --- a/contrib/tcpdump/netdissect.h +++ b/contrib/tcpdump/netdissect.h @@ -571,6 +571,7 @@ extern int ospf_print_grace_lsa(netdissect_options *, const uint8_t *, u_int); extern int ospf_print_te_lsa(netdissect_options *, const uint8_t *, u_int); extern void otv_print(netdissect_options *, const u_char *, u_int); extern void pfsync_ip_print(netdissect_options *, const u_char *, u_int); +extern u_int pfsync_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *); extern void pgm_print(netdissect_options *, const u_char *, u_int, const u_char *); extern void pim_print(netdissect_options *, const u_char *, u_int, const u_char *); extern void pimv1_print(netdissect_options *, const u_char *, u_int); diff --git a/contrib/tcpdump/print-pfsync.c b/contrib/tcpdump/print-pfsync.c index 62913337e527..dc1cd039f5b0 100644 --- a/contrib/tcpdump/print-pfsync.c +++ b/contrib/tcpdump/print-pfsync.c @@ -57,30 +57,29 @@ static void print_src_dst(netdissect_options *, const struct pfsync_state_peer *, uint8_t); static void print_state(netdissect_options *, struct pfsync_state *); -#ifdef notyet -void -pfsync_if_print(u_char *user, const struct pcap_pkthdr *h, +u_int +pfsync_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, register const u_char *p) { u_int caplen = h->caplen; - ts_print(&h->ts); + ts_print(ndo, &h->ts); if (caplen < PFSYNC_HDRLEN) { ND_PRINT((ndo, "[|pfsync]")); goto out; } - pfsync_print((struct pfsync_header *)p, + pfsync_print(ndo, (struct pfsync_header *)p, p + sizeof(struct pfsync_header), caplen - sizeof(struct pfsync_header)); out: - if (xflag) { - default_print((const u_char *)p, caplen); + if (ndo->ndo_xflag) { + hex_print(ndo, "\n\t", p, caplen); } safeputchar(ndo, '\n'); + return (caplen); } -#endif /* notyet */ void pfsync_ip_print(netdissect_options *ndo , const u_char *bp, u_int len) diff --git a/contrib/tcpdump/print.c b/contrib/tcpdump/print.c index c76f34411778..e5436f4d738f 100644 --- a/contrib/tcpdump/print.c +++ b/contrib/tcpdump/print.c @@ -121,6 +121,9 @@ static const struct printer printers[] = { #endif #if defined(DLT_PFLOG) && defined(HAVE_NET_IF_PFLOG_H) { pflog_if_print, DLT_PFLOG }, +#endif +#if defined(DLT_PFSYNC) && defined(HAVE_NET_PFVAR_H) + { pfsync_if_print, DLT_PFSYNC}, #endif { token_if_print, DLT_IEEE802 }, { fddi_if_print, DLT_FDDI }, From owner-dev-commits-src-branches@freebsd.org Tue Jul 20 14:50:32 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65BDE66D917; Tue, 20 Jul 2021 14:50:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GThTh1cVnz4dty; Tue, 20 Jul 2021 14:50:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 162A04939; Tue, 20 Jul 2021 14:50:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16KEoV7D042686; Tue, 20 Jul 2021 14:50:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KEoVmf042685; Tue, 20 Jul 2021 14:50:31 GMT (envelope-from git) Date: Tue, 20 Jul 2021 14:50:31 GMT Message-Id: <202107201450.16KEoVmf042685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: c7fa58420aa2 - stable/12 - Fix local-unbound setup for some IPv6 deployments. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c7fa58420aa2b9e0d172717f7affe3fa2d11d15a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 14:50:32 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c7fa58420aa2b9e0d172717f7affe3fa2d11d15a commit c7fa58420aa2b9e0d172717f7affe3fa2d11d15a Author: Dag-Erling Smørgrav AuthorDate: 2021-03-10 14:01:38 +0000 Commit: Kristof Provost CommitDate: 2021-07-20 13:15:21 +0000 Fix local-unbound setup for some IPv6 deployments. PR: 250984 MFC after: 1 week --- usr.sbin/unbound/setup/local-unbound-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/unbound/setup/local-unbound-setup.sh b/usr.sbin/unbound/setup/local-unbound-setup.sh index 0e75112dd99b..0a3b80b18e60 100755 --- a/usr.sbin/unbound/setup/local-unbound-setup.sh +++ b/usr.sbin/unbound/setup/local-unbound-setup.sh @@ -66,7 +66,7 @@ bkext=$(date "+%Y%m%d.%H%M%S") RE_octet="([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])" RE_ipv4="(${RE_octet}(\\.${RE_octet}){3})" RE_word="([0-9A-Fa-f]{1,4})" -RE_ipv6="((${RE_word}:){1,}(:|(:${RE_word})*)|::1)" +RE_ipv6="((${RE_word}:){1,}(:|${RE_word}?(:${RE_word})*)|::1)" RE_port="([1-9][0-9]{0,3}|[1-5][0-9]{4,4}|6([0-4][0-9]{3}|5([0-4][0-9]{2}|5([0-2][0-9]|3[0-5]))))" RE_dnsname="([0-9A-Za-z-]{1,}(\\.[0-9A-Za-z-]{1,})*\\.?)" RE_forward_addr="((${RE_ipv4}|${RE_ipv6})(@${RE_port})?)" From owner-dev-commits-src-branches@freebsd.org Tue Jul 20 14:51:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B0B966D8E8; Tue, 20 Jul 2021 14:51:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GThVl0NbXz4f8c; Tue, 20 Jul 2021 14:51:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E13C544D0; Tue, 20 Jul 2021 14:51:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16KEpQdY046199; Tue, 20 Jul 2021 14:51:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KEpQOu046198; Tue, 20 Jul 2021 14:51:26 GMT (envelope-from git) Date: Tue, 20 Jul 2021 14:51:26 GMT Message-Id: <202107201451.16KEpQOu046198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 0daba7847e2e - stable/13 - tcpdump: decode packets on pfsync interfaces MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0daba7847e2eb63147642f3f492b4846767208e4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 14:51:27 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0daba7847e2eb63147642f3f492b4846767208e4 commit 0daba7847e2eb63147642f3f492b4846767208e4 Author: Luiz Otavio O Souza AuthorDate: 2021-07-12 17:15:15 +0000 Commit: Kristof Provost CommitDate: 2021-07-20 06:48:02 +0000 tcpdump: decode packets on pfsync interfaces Reviewed by: kp, scottl Obtained from: pfsense MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31153 (cherry picked from commit 3f240bdf3652ea823af34b0f399e2c8be5a6320a) --- contrib/tcpdump/netdissect.h | 1 + contrib/tcpdump/print-pfsync.c | 15 +++++++-------- contrib/tcpdump/print.c | 3 +++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/contrib/tcpdump/netdissect.h b/contrib/tcpdump/netdissect.h index 20b5ef63668c..8612e11c3c7e 100644 --- a/contrib/tcpdump/netdissect.h +++ b/contrib/tcpdump/netdissect.h @@ -571,6 +571,7 @@ extern int ospf_print_grace_lsa(netdissect_options *, const uint8_t *, u_int); extern int ospf_print_te_lsa(netdissect_options *, const uint8_t *, u_int); extern void otv_print(netdissect_options *, const u_char *, u_int); extern void pfsync_ip_print(netdissect_options *, const u_char *, u_int); +extern u_int pfsync_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *); extern void pgm_print(netdissect_options *, const u_char *, u_int, const u_char *); extern void pim_print(netdissect_options *, const u_char *, u_int, const u_char *); extern void pimv1_print(netdissect_options *, const u_char *, u_int); diff --git a/contrib/tcpdump/print-pfsync.c b/contrib/tcpdump/print-pfsync.c index 62913337e527..dc1cd039f5b0 100644 --- a/contrib/tcpdump/print-pfsync.c +++ b/contrib/tcpdump/print-pfsync.c @@ -57,30 +57,29 @@ static void print_src_dst(netdissect_options *, const struct pfsync_state_peer *, uint8_t); static void print_state(netdissect_options *, struct pfsync_state *); -#ifdef notyet -void -pfsync_if_print(u_char *user, const struct pcap_pkthdr *h, +u_int +pfsync_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, register const u_char *p) { u_int caplen = h->caplen; - ts_print(&h->ts); + ts_print(ndo, &h->ts); if (caplen < PFSYNC_HDRLEN) { ND_PRINT((ndo, "[|pfsync]")); goto out; } - pfsync_print((struct pfsync_header *)p, + pfsync_print(ndo, (struct pfsync_header *)p, p + sizeof(struct pfsync_header), caplen - sizeof(struct pfsync_header)); out: - if (xflag) { - default_print((const u_char *)p, caplen); + if (ndo->ndo_xflag) { + hex_print(ndo, "\n\t", p, caplen); } safeputchar(ndo, '\n'); + return (caplen); } -#endif /* notyet */ void pfsync_ip_print(netdissect_options *ndo , const u_char *bp, u_int len) diff --git a/contrib/tcpdump/print.c b/contrib/tcpdump/print.c index c76f34411778..e5436f4d738f 100644 --- a/contrib/tcpdump/print.c +++ b/contrib/tcpdump/print.c @@ -121,6 +121,9 @@ static const struct printer printers[] = { #endif #if defined(DLT_PFLOG) && defined(HAVE_NET_IF_PFLOG_H) { pflog_if_print, DLT_PFLOG }, +#endif +#if defined(DLT_PFSYNC) && defined(HAVE_NET_PFVAR_H) + { pfsync_if_print, DLT_PFSYNC}, #endif { token_if_print, DLT_IEEE802 }, { fddi_if_print, DLT_FDDI }, From owner-dev-commits-src-branches@freebsd.org Tue Jul 20 23:46:19 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 851D6655C8A; Tue, 20 Jul 2021 23:46:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTwMv342sz3PPT; Tue, 20 Jul 2021 23:46:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5133D13ED7; Tue, 20 Jul 2021 23:46:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16KNkJSU054533; Tue, 20 Jul 2021 23:46:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KNkJ5i054532; Tue, 20 Jul 2021 23:46:19 GMT (envelope-from git) Date: Tue, 20 Jul 2021 23:46:19 GMT Message-Id: <202107202346.16KNkJ5i054532@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 10235ad0567f - stable/13 - LinuxKPI: Allow kmem_cache_free() to be called from critical sections MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 10235ad0567f7e1faf8949551731410d5f0aad15 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 23:46:19 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=10235ad0567f7e1faf8949551731410d5f0aad15 commit 10235ad0567f7e1faf8949551731410d5f0aad15 Author: Vladimir Kondratyev AuthorDate: 2021-07-05 00:18:14 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-07-20 22:43:52 +0000 LinuxKPI: Allow kmem_cache_free() to be called from critical sections as it is required by i915kms driver from Linux kernel v 5.5. This is done with asynchronous freeing of requested memory areas from taskqueue thread. As memory to be freed is reused to store linked list entry, backing UMA zone item size is rounded up to pointer size. While here, make struct linux_kmem_cache private to LKPI to reduce amount of BSD headers included by linux/slab.h and switch RCU code to usage of LKPI's linux_irq_work_tq taskqueue to avoid injection of current into system-wide taskqueue_fast thread context. Submitted by: nc (initial version for drm-kmod) Reviewed by: manu, nc Differential revision: https://reviews.freebsd.org/D30760 (cherry picked from commit a2b83b59db365255461a50ff8fa5e5e4e92e4d51) --- sys/compat/linuxkpi/common/include/linux/slab.h | 46 +++------------ sys/compat/linuxkpi/common/src/linux_rcu.c | 50 ++++++----------- sys/compat/linuxkpi/common/src/linux_slab.c | 75 ++++++++++++++++++++++++- 3 files changed, 99 insertions(+), 72 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/slab.h b/sys/compat/linuxkpi/common/include/linux/slab.h index 8d5eb3e85e96..ecd39d711eb4 100644 --- a/sys/compat/linuxkpi/common/include/linux/slab.h +++ b/sys/compat/linuxkpi/common/include/linux/slab.h @@ -31,12 +31,9 @@ #ifndef _LINUX_SLAB_H_ #define _LINUX_SLAB_H_ -#include -#include +#include #include #include -#include -#include #include #include @@ -65,8 +62,9 @@ MALLOC_DECLARE(M_KMALLOC); */ #define kmem_cache linux_kmem_cache #define kmem_cache_create(...) linux_kmem_cache_create(__VA_ARGS__) -#define kmem_cache_alloc(...) linux_kmem_cache_alloc(__VA_ARGS__) -#define kmem_cache_free(...) linux_kmem_cache_free(__VA_ARGS__) +#define kmem_cache_alloc(...) lkpi_kmem_cache_alloc(__VA_ARGS__) +#define kmem_cache_zalloc(...) lkpi_kmem_cache_zalloc(__VA_ARGS__) +#define kmem_cache_free(...) lkpi_kmem_cache_free(__VA_ARGS__) #define kmem_cache_destroy(...) linux_kmem_cache_destroy(__VA_ARGS__) #define KMEM_CACHE(__struct, flags) \ @@ -75,12 +73,7 @@ MALLOC_DECLARE(M_KMALLOC); typedef void linux_kmem_ctor_t (void *); -struct linux_kmem_cache { - uma_zone_t cache_zone; - linux_kmem_ctor_t *cache_ctor; - unsigned cache_flags; - unsigned cache_size; -}; +struct linux_kmem_cache; #define SLAB_HWCACHE_ALIGN (1 << 0) #define SLAB_TYPESAFE_BY_RCU (1 << 1) @@ -212,32 +205,9 @@ ksize(const void *ptr) extern struct linux_kmem_cache *linux_kmem_cache_create(const char *name, size_t size, size_t align, unsigned flags, linux_kmem_ctor_t *ctor); - -static inline void * -linux_kmem_cache_alloc(struct linux_kmem_cache *c, gfp_t flags) -{ - return (uma_zalloc_arg(c->cache_zone, c, - linux_check_m_flags(flags))); -} - -static inline void * -kmem_cache_zalloc(struct linux_kmem_cache *c, gfp_t flags) -{ - return (uma_zalloc_arg(c->cache_zone, c, - linux_check_m_flags(flags | M_ZERO))); -} - -extern void linux_kmem_cache_free_rcu(struct linux_kmem_cache *, void *); - -static inline void -linux_kmem_cache_free(struct linux_kmem_cache *c, void *m) -{ - if (unlikely(c->cache_flags & SLAB_TYPESAFE_BY_RCU)) - linux_kmem_cache_free_rcu(c, m); - else - uma_zfree(c->cache_zone, m); -} - +extern void *lkpi_kmem_cache_alloc(struct linux_kmem_cache *, gfp_t); +extern void *lkpi_kmem_cache_zalloc(struct linux_kmem_cache *, gfp_t); +extern void lkpi_kmem_cache_free(struct linux_kmem_cache *, void *); extern void linux_kmem_cache_destroy(struct linux_kmem_cache *); void linux_kfree_async(void *); diff --git a/sys/compat/linuxkpi/common/src/linux_rcu.c b/sys/compat/linuxkpi/common/src/linux_rcu.c index 404c5cec4ae4..a39949cf5013 100644 --- a/sys/compat/linuxkpi/common/src/linux_rcu.c +++ b/sys/compat/linuxkpi/common/src/linux_rcu.c @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include /* * By defining CONFIG_NO_RCU_SKIP LinuxKPI RCU locks and asserts will @@ -60,13 +62,15 @@ __FBSDID("$FreeBSD$"); #endif struct callback_head { - STAILQ_ENTRY(callback_head) entry; + union { + STAILQ_ENTRY(callback_head) entry; + struct llist_node node; + }; rcu_callback_t func; }; struct linux_epoch_head { - STAILQ_HEAD(, callback_head) cb_head; - struct mtx lock; + struct llist_head cb_head; struct task task; } __aligned(CACHE_LINE_SIZE); @@ -120,9 +124,8 @@ linux_rcu_runtime_init(void *arg __unused) head = &linux_epoch_head[j]; - mtx_init(&head->lock, "LRCU-HEAD", NULL, MTX_DEF); TASK_INIT(&head->task, 0, linux_rcu_cleaner_func, head); - STAILQ_INIT(&head->cb_head); + init_llist_head(&head->cb_head); CPU_FOREACH(i) { struct linux_epoch_record *record; @@ -139,37 +142,22 @@ linux_rcu_runtime_init(void *arg __unused) } SYSINIT(linux_rcu_runtime, SI_SUB_CPU, SI_ORDER_ANY, linux_rcu_runtime_init, NULL); -static void -linux_rcu_runtime_uninit(void *arg __unused) -{ - struct linux_epoch_head *head; - int j; - - for (j = 0; j != RCU_TYPE_MAX; j++) { - head = &linux_epoch_head[j]; - - mtx_destroy(&head->lock); - } -} -SYSUNINIT(linux_rcu_runtime, SI_SUB_LOCK, SI_ORDER_SECOND, linux_rcu_runtime_uninit, NULL); - static void linux_rcu_cleaner_func(void *context, int pending __unused) { - struct linux_epoch_head *head; + struct linux_epoch_head *head = context; struct callback_head *rcu; STAILQ_HEAD(, callback_head) tmp_head; + struct llist_node *node, *next; uintptr_t offset; - linux_set_current(curthread); - - head = context; - /* move current callbacks into own queue */ - mtx_lock(&head->lock); STAILQ_INIT(&tmp_head); - STAILQ_CONCAT(&tmp_head, &head->cb_head); - mtx_unlock(&head->lock); + llist_for_each_safe(node, next, llist_del_all(&head->cb_head)) { + rcu = container_of(node, struct callback_head, node); + /* re-reverse list to restore chronological order */ + STAILQ_INSERT_HEAD(&tmp_head, rcu, entry); + } /* synchronize */ linux_synchronize_rcu(head - linux_epoch_head); @@ -384,7 +372,7 @@ linux_rcu_barrier(unsigned type) head = &linux_epoch_head[type]; /* wait for callbacks to complete */ - taskqueue_drain(taskqueue_fast, &head->task); + taskqueue_drain(linux_irq_work_tq, &head->task); } void @@ -398,11 +386,9 @@ linux_call_rcu(unsigned type, struct rcu_head *context, rcu_callback_t func) rcu = (struct callback_head *)context; head = &linux_epoch_head[type]; - mtx_lock(&head->lock); rcu->func = func; - STAILQ_INSERT_TAIL(&head->cb_head, rcu, entry); - taskqueue_enqueue(taskqueue_fast, &head->task); - mtx_unlock(&head->lock); + llist_add(&rcu->node, &head->cb_head); + taskqueue_enqueue(linux_irq_work_tq, &head->task); } int diff --git a/sys/compat/linuxkpi/common/src/linux_slab.c b/sys/compat/linuxkpi/common/src/linux_slab.c index 3304c34b1dee..5dbd87b66d1a 100644 --- a/sys/compat/linuxkpi/common/src/linux_slab.c +++ b/sys/compat/linuxkpi/common/src/linux_slab.c @@ -35,12 +35,22 @@ __FBSDID("$FreeBSD$"); #include #include +#include struct linux_kmem_rcu { struct rcu_head rcu_head; struct linux_kmem_cache *cache; }; +struct linux_kmem_cache { + uma_zone_t cache_zone; + linux_kmem_ctor_t *cache_ctor; + unsigned cache_flags; + unsigned cache_size; + struct llist_head cache_items; + struct task cache_task; +}; + #define LINUX_KMEM_TO_RCU(c, m) \ ((struct linux_kmem_rcu *)((char *)(m) + \ (c)->cache_size - sizeof(struct linux_kmem_rcu))) @@ -51,6 +61,22 @@ struct linux_kmem_rcu { static LLIST_HEAD(linux_kfree_async_list); +static void lkpi_kmem_cache_free_async_fn(void *, int); + +void * +lkpi_kmem_cache_alloc(struct linux_kmem_cache *c, gfp_t flags) +{ + return (uma_zalloc_arg(c->cache_zone, c, + linux_check_m_flags(flags))); +} + +void * +lkpi_kmem_cache_zalloc(struct linux_kmem_cache *c, gfp_t flags) +{ + return (uma_zalloc_arg(c->cache_zone, c, + linux_check_m_flags(flags | M_ZERO))); +} + static int linux_kmem_ctor(void *mem, int size, void *arg, int flags) { @@ -102,6 +128,9 @@ linux_kmem_cache_create(const char *name, size_t size, size_t align, linux_kmem_ctor, NULL, NULL, NULL, align, UMA_ZONE_ZINIT); } else { + /* make room for async task list items */ + size = MAX(size, sizeof(struct llist_node)); + /* create cache_zone */ c->cache_zone = uma_zcreate(name, size, ctor ? linux_kmem_ctor : NULL, NULL, @@ -111,17 +140,56 @@ linux_kmem_cache_create(const char *name, size_t size, size_t align, c->cache_flags = flags; c->cache_ctor = ctor; c->cache_size = size; + init_llist_head(&c->cache_items); + TASK_INIT(&c->cache_task, 0, lkpi_kmem_cache_free_async_fn, c); return (c); } -void -linux_kmem_cache_free_rcu(struct linux_kmem_cache *c, void *m) +static inline void +lkpi_kmem_cache_free_rcu(struct linux_kmem_cache *c, void *m) { struct linux_kmem_rcu *rcu = LINUX_KMEM_TO_RCU(c, m); call_rcu(&rcu->rcu_head, linux_kmem_cache_free_rcu_callback); } +static inline void +lkpi_kmem_cache_free_sync(struct linux_kmem_cache *c, void *m) +{ + uma_zfree(c->cache_zone, m); +} + +static void +lkpi_kmem_cache_free_async_fn(void *context, int pending) +{ + struct linux_kmem_cache *c = context; + struct llist_node *freed, *next; + + llist_for_each_safe(freed, next, llist_del_all(&c->cache_items)) + lkpi_kmem_cache_free_sync(c, freed); +} + +static inline void +lkpi_kmem_cache_free_async(struct linux_kmem_cache *c, void *m) +{ + if (m == NULL) + return; + + llist_add(m, &c->cache_items); + taskqueue_enqueue(linux_irq_work_tq, &c->cache_task); +} + +void +lkpi_kmem_cache_free(struct linux_kmem_cache *c, void *m) +{ + if (unlikely(c->cache_flags & SLAB_TYPESAFE_BY_RCU)) + lkpi_kmem_cache_free_rcu(c, m); + else if (unlikely(curthread->td_critnest != 0)) + lkpi_kmem_cache_free_async(c, m); + else + lkpi_kmem_cache_free_sync(c, m); +} + void linux_kmem_cache_destroy(struct linux_kmem_cache *c) { @@ -130,6 +198,9 @@ linux_kmem_cache_destroy(struct linux_kmem_cache *c) rcu_barrier(); } + if (!llist_empty(&c->cache_items)) + taskqueue_enqueue(linux_irq_work_tq, &c->cache_task); + taskqueue_drain(linux_irq_work_tq, &c->cache_task); uma_zdestroy(c->cache_zone); free(c, M_KMALLOC); } From owner-dev-commits-src-branches@freebsd.org Tue Jul 20 23:46:20 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE69E655C91; Tue, 20 Jul 2021 23:46:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTwMw452nz3PPX; Tue, 20 Jul 2021 23:46:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7384F13C3E; Tue, 20 Jul 2021 23:46:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16KNkK3A054559; Tue, 20 Jul 2021 23:46:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KNkKLs054558; Tue, 20 Jul 2021 23:46:20 GMT (envelope-from git) Date: Tue, 20 Jul 2021 23:46:20 GMT Message-Id: <202107202346.16KNkKLs054558@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 62791884174e - stable/13 - LinuxKPI: Add #defines required by drm-kmod v5.5 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 62791884174ee9a6c9b37a15b901f1a7d47be33a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 23:46:20 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=62791884174ee9a6c9b37a15b901f1a7d47be33a commit 62791884174ee9a6c9b37a15b901f1a7d47be33a Author: Vladimir Kondratyev AuthorDate: 2021-07-05 00:18:47 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-07-20 22:43:52 +0000 LinuxKPI: Add #defines required by drm-kmod v5.5 Reviewed by: hselasky, manu Differential revision: https://reviews.freebsd.org/D30767 (cherry picked from commit 78a02d8b332cd46e26e1a8088cd0ba5220cd1f18) --- sys/compat/linuxkpi/common/include/linux/pci.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 85278356dfea..4784799d82b5 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -130,6 +130,14 @@ struct pci_device_id { #define PCI_EXP_LNKCAP2_SLS_5_0GB 0x04 /* Supported Link Speed 5.0GT/s */ #define PCI_EXP_LNKCAP2_SLS_8_0GB 0x08 /* Supported Link Speed 8.0GT/s */ #define PCI_EXP_LNKCAP2_SLS_16_0GB 0x10 /* Supported Link Speed 16.0GT/s */ +#define PCI_EXP_LNKCTL2_TLS 0x000f +#define PCI_EXP_LNKCTL2_TLS_2_5GT 0x0001 /* Supported Speed 2.5GT/s */ +#define PCI_EXP_LNKCTL2_TLS_5_0GT 0x0002 /* Supported Speed 5GT/s */ +#define PCI_EXP_LNKCTL2_TLS_8_0GT 0x0003 /* Supported Speed 8GT/s */ +#define PCI_EXP_LNKCTL2_TLS_16_0GT 0x0004 /* Supported Speed 16GT/s */ +#define PCI_EXP_LNKCTL2_TLS_32_0GT 0x0005 /* Supported Speed 32GT/s */ +#define PCI_EXP_LNKCTL2_ENTER_COMP 0x0010 /* Enter Compliance */ +#define PCI_EXP_LNKCTL2_TX_MARGIN 0x0380 /* Transmit Margin */ #define PCI_EXP_LNKCTL_HAWD PCIEM_LINK_CTL_HAWD #define PCI_EXP_LNKCAP_CLKPM 0x00040000 From owner-dev-commits-src-branches@freebsd.org Tue Jul 20 23:46:22 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A28DF655AAF; Tue, 20 Jul 2021 23:46:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTwMx6c7Vz3PRM; Tue, 20 Jul 2021 23:46:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAC1B13E34; Tue, 20 Jul 2021 23:46:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16KNkLxZ054583; Tue, 20 Jul 2021 23:46:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KNkLBt054582; Tue, 20 Jul 2021 23:46:21 GMT (envelope-from git) Date: Tue, 20 Jul 2021 23:46:21 GMT Message-Id: <202107202346.16KNkLBt054582@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 71d815861f1c - stable/13 - LinuxKPI: Change flags parameter type of atomic_dec_and_lock_irqsave MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 71d815861f1cd0281443a216998c23000fb4b301 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 23:46:22 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=71d815861f1cd0281443a216998c23000fb4b301 commit 71d815861f1cd0281443a216998c23000fb4b301 Author: Vladimir Kondratyev AuthorDate: 2021-07-05 00:19:01 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-07-20 22:43:52 +0000 LinuxKPI: Change flags parameter type of atomic_dec_and_lock_irqsave On Linux atomic_dec_and_lock_irqsave is a wrapper macro which provides a reference to third parameter rather than parameter value itself to implementation routine called _atomic_dec_and_lock_irqsave [1]. While here, implement a fast path. [1] https://github.com/torvalds/linux/blob/master/include/linux/spinlock.h#L476 Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D30781 (cherry picked from commit c77ec79b57aa92b428b940ed550a4a14ed44da48) --- sys/compat/linuxkpi/common/include/linux/spinlock.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h b/sys/compat/linuxkpi/common/include/linux/spinlock.h index 458d8d9f8da9..56eaecfb4cd6 100644 --- a/sys/compat/linuxkpi/common/include/linux/spinlock.h +++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h @@ -168,15 +168,20 @@ spin_lock_destroy(spinlock_t *lock) mtx_assert(&(_l)->m, MA_OWNED); \ } while (0) +#define atomic_dec_and_lock_irqsave(cnt, lock, flags) \ + _atomic_dec_and_lock_irqsave(cnt, lock, &(flags)) static inline int -atomic_dec_and_lock_irqsave(atomic_t *cnt, spinlock_t *lock, - unsigned long flags) +_atomic_dec_and_lock_irqsave(atomic_t *cnt, spinlock_t *lock, + unsigned long *flags) { - spin_lock_irqsave(lock, flags); + if (atomic_add_unless(cnt, -1, 1)) + return (0); + + spin_lock_irqsave(lock, *flags); if (atomic_dec_and_test(cnt)) - return 1; - spin_unlock_irqrestore(lock, flags); - return 0; + return (1); + spin_unlock_irqrestore(lock, *flags); + return (0); } #endif /* _LINUX_SPINLOCK_H_ */ From owner-dev-commits-src-branches@freebsd.org Tue Jul 20 23:46:24 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F2C8655748; Tue, 20 Jul 2021 23:46:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTwN00TNPz3PHV; Tue, 20 Jul 2021 23:46:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCF0D13C3F; Tue, 20 Jul 2021 23:46:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16KNkNai054631; Tue, 20 Jul 2021 23:46:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KNkNYA054630; Tue, 20 Jul 2021 23:46:23 GMT (envelope-from git) Date: Tue, 20 Jul 2021 23:46:23 GMT Message-Id: <202107202346.16KNkNYA054630@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 6ba3ceaeb510 - stable/13 - LinuxKPI: Do not wait for a grace period in rcu_barrier() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6ba3ceaeb51052ae9a39a597d81c49691ecdc78f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 23:46:24 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=6ba3ceaeb51052ae9a39a597d81c49691ecdc78f commit 6ba3ceaeb51052ae9a39a597d81c49691ecdc78f Author: Vladimir Kondratyev AuthorDate: 2021-07-05 00:19:50 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-07-20 22:43:52 +0000 LinuxKPI: Do not wait for a grace period in rcu_barrier() Linux docs explicitly state that this is not required [1]: "Important note: The rcu_barrier() function is not, repeat, not, obligated to wait for a grace period. It is instead only required to wait for RCU callbacks that have already been posted. Therefore, if there are no RCU callbacks posted anywhere in the system, rcu_barrier() is within its rights to return immediately. Even if there are callbacks posted, rcu_barrier() does not necessarily need to wait for a grace period." [1] https://www.kernel.org/doc/Documentation/RCU/Design/Requirements/Requirements.html Reviewed by: emaste, hselasky, manu Differential revision: https://reviews.freebsd.org/D30809 (cherry picked from commit 1ab61a193241f832e63f97ca37880b010469cb38) --- sys/compat/linuxkpi/common/src/linux_rcu.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_rcu.c b/sys/compat/linuxkpi/common/src/linux_rcu.c index a39949cf5013..2179faa2c05e 100644 --- a/sys/compat/linuxkpi/common/src/linux_rcu.c +++ b/sys/compat/linuxkpi/common/src/linux_rcu.c @@ -367,8 +367,12 @@ linux_rcu_barrier(unsigned type) MPASS(type < RCU_TYPE_MAX); - linux_synchronize_rcu(type); - + /* + * This function is not obligated to wait for a grace period. + * It only waits for RCU callbacks that have already been posted. + * If there are no RCU callbacks posted, rcu_barrier() can return + * immediately. + */ head = &linux_epoch_head[type]; /* wait for callbacks to complete */ From owner-dev-commits-src-branches@freebsd.org Tue Jul 20 23:46:23 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2763A655365; Tue, 20 Jul 2021 23:46:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTwMy6dTYz3PMn; Tue, 20 Jul 2021 23:46:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C368C13ED8; Tue, 20 Jul 2021 23:46:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16KNkMZK054607; Tue, 20 Jul 2021 23:46:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KNkMAG054606; Tue, 20 Jul 2021 23:46:22 GMT (envelope-from git) Date: Tue, 20 Jul 2021 23:46:22 GMT Message-Id: <202107202346.16KNkMAG054606@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: ddebb8c0f780 - stable/13 - LinuxKPI: Add compiler barriers to list_for_each_entry_lockless macro MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ddebb8c0f780626d1dbd24725bbf9bc16bf4b819 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 23:46:23 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=ddebb8c0f780626d1dbd24725bbf9bc16bf4b819 commit ddebb8c0f780626d1dbd24725bbf9bc16bf4b819 Author: Vladimir Kondratyev AuthorDate: 2021-07-05 00:19:35 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-07-20 22:43:52 +0000 LinuxKPI: Add compiler barriers to list_for_each_entry_lockless macro so this list-traversal primitive may safely run concurrently with the _rcu list-mutation primitives such as list_add_rcu() as long as the traversal is guarded by rcu_read_lock(). Do it by reusing the "list_for_each_entry_rcu" macro which does the same. On Linux it implements some additional lockdep stuff which we skip. Also move the macro to linux/rculist.h where it resides on Linux. Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D30795 (cherry picked from commit c0862b2b1fa91636d308a1a41d8dc370691d656e) --- sys/compat/linuxkpi/common/include/linux/list.h | 2 -- sys/compat/linuxkpi/common/include/linux/rculist.h | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/list.h b/sys/compat/linuxkpi/common/include/linux/list.h index 93db449a4473..37b5b751d21b 100644 --- a/sys/compat/linuxkpi/common/include/linux/list.h +++ b/sys/compat/linuxkpi/common/include/linux/list.h @@ -202,8 +202,6 @@ list_del_init(struct list_head *entry) for (p = list_entry((h)->next, typeof(*p), field); &(p)->field != (h); \ p = list_entry((p)->field.next, typeof(*p), field)) -#define list_for_each_entry_lockless(...) list_for_each_entry(__VA_ARGS__) - #define list_for_each_entry_safe(p, n, h, field) \ for (p = list_entry((h)->next, typeof(*p), field), \ n = list_entry((p)->field.next, typeof(*p), field); &(p)->field != (h);\ diff --git a/sys/compat/linuxkpi/common/include/linux/rculist.h b/sys/compat/linuxkpi/common/include/linux/rculist.h index bff2f7e13184..6c21a6943f98 100644 --- a/sys/compat/linuxkpi/common/include/linux/rculist.h +++ b/sys/compat/linuxkpi/common/include/linux/rculist.h @@ -44,6 +44,9 @@ &(pos)->member != (head); \ pos = list_entry_rcu((pos)->member.next, typeof(*(pos)), member)) +#define list_for_each_entry_lockless(pos, head, member) \ + list_for_each_entry_rcu(pos, head, member) + static inline void linux_list_add_rcu(struct list_head *new, struct list_head *prev, struct list_head *next) From owner-dev-commits-src-branches@freebsd.org Tue Jul 20 23:46:28 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F38D1655A40; Tue, 20 Jul 2021 23:46:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTwN35TDjz3PXJ; Tue, 20 Jul 2021 23:46:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FCCB13E36; Tue, 20 Jul 2021 23:46:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16KNkRnf054709; Tue, 20 Jul 2021 23:46:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KNkRSZ054708; Tue, 20 Jul 2021 23:46:27 GMT (envelope-from git) Date: Tue, 20 Jul 2021 23:46:27 GMT Message-Id: <202107202346.16KNkRSZ054708@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 22310af02da3 - stable/13 - LinuxKPI: Implement strscpy MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 22310af02da3c40eae4a11b20019bcead508a0c9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 23:46:28 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=22310af02da3c40eae4a11b20019bcead508a0c9 commit 22310af02da3c40eae4a11b20019bcead508a0c9 Author: Vladimir Kondratyev AuthorDate: 2021-07-05 00:20:42 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-07-20 22:43:52 +0000 LinuxKPI: Implement strscpy strscpy copies the src string, or as much of it as fits, into the dst buffer. The dst buffer is always NUL terminated, unless it's zero-sized. strscpy returns the number of characters copied (not including the trailing NUL) or -E2BIG if len is 0 or src was truncated. Currently drm-kmod replaces strscpy with strncpy that is not quite correct as strncpy does not NUL-terminate truncated strings and returns different values on exit. Reviewed by: hselasky, imp, manu Differential revision: https://reviews.freebsd.org/D31005 (cherry picked from commit 019391bf852771070cb739900f9e20ae6c41c746) --- sys/compat/linuxkpi/common/include/linux/string.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/string.h b/sys/compat/linuxkpi/common/include/linux/string.h index 39201e203162..659a48d93596 100644 --- a/sys/compat/linuxkpi/common/include/linux/string.h +++ b/sys/compat/linuxkpi/common/include/linux/string.h @@ -167,4 +167,20 @@ str_has_prefix(const char *str, const char *prefix) return (strncmp(str, prefix, len) == 0 ? len : 0); } +static inline ssize_t +strscpy(char* dst, const char* src, size_t len) +{ + size_t i; + + if (len <= INT_MAX) { + for (i = 0; i < len; i++) + if ('\0' == (dst[i] = src[i])) + return ((ssize_t)i); + if (i != 0) + dst[--i] = '\0'; + } + + return (-E2BIG); +} + #endif /* _LINUX_STRING_H_ */ From owner-dev-commits-src-branches@freebsd.org Tue Jul 20 23:46:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BEDD3655D00; Tue, 20 Jul 2021 23:46:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTwN25pFqz3PBf; Tue, 20 Jul 2021 23:46:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2AB8F13E35; Tue, 20 Jul 2021 23:46:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16KNkQ4R054685; Tue, 20 Jul 2021 23:46:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KNkQkS054684; Tue, 20 Jul 2021 23:46:26 GMT (envelope-from git) Date: Tue, 20 Jul 2021 23:46:26 GMT Message-Id: <202107202346.16KNkQkS054684@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 80b8638e1212 - stable/13 - LinuxKPI: Use macro for implementation of some dma_map_* functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 80b8638e121247145a99531d3619dfcb142401ef Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 23:46:28 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=80b8638e121247145a99531d3619dfcb142401ef commit 80b8638e121247145a99531d3619dfcb142401ef Author: Vladimir Kondratyev AuthorDate: 2021-07-05 00:20:23 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-07-20 22:43:52 +0000 LinuxKPI: Use macro for implementation of some dma_map_* functions This allows to remove unimplemented attrs parameter which type differs between Linux kernel versions and to compile both drm-kmod and ofed callers unmodified. Also convert it to 'unsigned long' type to match modern Linuxes. Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D30932 (cherry picked from commit 98a6984a9e10c5c1677643eb4d9a758e3af131da) --- .../linuxkpi/common/include/linux/dma-mapping.h | 59 ++++++++-------------- sys/compat/linuxkpi/common/src/linux_pci.c | 5 +- 2 files changed, 24 insertions(+), 40 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h index d074b563cd41..5b5bc9e90815 100644 --- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h +++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h @@ -63,13 +63,13 @@ struct dma_map_ops { void *vaddr, dma_addr_t dma_handle); dma_addr_t (*map_page)(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir, - struct dma_attrs *attrs); + unsigned long attrs); void (*unmap_page)(struct device *dev, dma_addr_t dma_handle, - size_t size, enum dma_data_direction dir, struct dma_attrs *attrs); + size_t size, enum dma_data_direction dir, unsigned long attrs); int (*map_sg)(struct device *dev, struct scatterlist *sg, - int nents, enum dma_data_direction dir, struct dma_attrs *attrs); + int nents, enum dma_data_direction dir, unsigned long attrs); void (*unmap_sg)(struct device *dev, struct scatterlist *sg, int nents, - enum dma_data_direction dir, struct dma_attrs *attrs); + enum dma_data_direction dir, unsigned long attrs); void (*sync_single_for_cpu)(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction dir); void (*sync_single_for_device)(struct device *dev, @@ -97,9 +97,11 @@ void *linux_dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len); void linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t size); int linux_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, - int nents, enum dma_data_direction dir, struct dma_attrs *attrs); + int nents, enum dma_data_direction dir __unused, + unsigned long attrs __unused); void linux_dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sg, - int nents, enum dma_data_direction dir, struct dma_attrs *attrs); + int nents __unused, enum dma_data_direction dir __unused, + unsigned long attrs __unused); static inline int dma_supported(struct device *dev, u64 mask) @@ -164,21 +166,11 @@ dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, kmem_free((vm_offset_t)cpu_addr, size); } -static inline dma_addr_t -dma_map_single_attrs(struct device *dev, void *ptr, size_t size, - enum dma_data_direction dir, struct dma_attrs *attrs) -{ +#define dma_map_single_attrs(dev, ptr, size, dir, attrs) \ + linux_dma_map_phys(dev, vtophys(ptr), size) - return (linux_dma_map_phys(dev, vtophys(ptr), size)); -} - -static inline void -dma_unmap_single_attrs(struct device *dev, dma_addr_t dma_addr, size_t size, - enum dma_data_direction dir, struct dma_attrs *attrs) -{ - - linux_dma_unmap(dev, dma_addr, size); -} +#define dma_unmap_single_attrs(dev, dma_addr, size, dir, attrs) \ + linux_dma_unmap(dev, dma_addr, size) static inline dma_addr_t dma_map_page_attrs(struct device *dev, struct page *page, size_t offset, @@ -188,21 +180,12 @@ dma_map_page_attrs(struct device *dev, struct page *page, size_t offset, return (linux_dma_map_phys(dev, VM_PAGE_TO_PHYS(page) + offset, size)); } -static inline int -dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents, - enum dma_data_direction dir, struct dma_attrs *attrs) -{ - - return (linux_dma_map_sg_attrs(dev, sgl, nents, dir, attrs)); -} +/* linux_dma_(un)map_sg_attrs does not support attrs yet */ +#define dma_map_sg_attrs(dev, sgl, nents, dir, attrs) \ + linux_dma_map_sg_attrs(dev, sgl, nents, dir, 0) -static inline void -dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sg, int nents, - enum dma_data_direction dir, struct dma_attrs *attrs) -{ - - linux_dma_unmap_sg_attrs(dev, sg, nents, dir, attrs); -} +#define dma_unmap_sg_attrs(dev, sg, nents, dir, attrs) \ + linux_dma_unmap_sg_attrs(dev, sg, nents, dir, 0) static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, @@ -276,10 +259,10 @@ static inline unsigned int dma_set_max_seg_size(struct device *dev, return (0); } -#define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a, s, r, NULL) -#define dma_unmap_single(d, a, s, r) dma_unmap_single_attrs(d, a, s, r, NULL) -#define dma_map_sg(d, s, n, r) dma_map_sg_attrs(d, s, n, r, NULL) -#define dma_unmap_sg(d, s, n, r) dma_unmap_sg_attrs(d, s, n, r, NULL) +#define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a, s, r, 0) +#define dma_unmap_single(d, a, s, r) dma_unmap_single_attrs(d, a, s, r, 0) +#define dma_map_sg(d, s, n, r) dma_map_sg_attrs(d, s, n, r, 0) +#define dma_unmap_sg(d, s, n, r) dma_unmap_sg_attrs(d, s, n, r, 0) #define DEFINE_DMA_UNMAP_ADDR(name) dma_addr_t name #define DEFINE_DMA_UNMAP_LEN(name) __u32 name diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index c35d259a45be..ae45df9c6514 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -881,7 +881,7 @@ linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len) int linux_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents, - enum dma_data_direction dir, struct dma_attrs *attrs) + enum dma_data_direction dir __unused, unsigned long attrs __unused) { struct linux_dma_priv *priv; struct scatterlist *sg; @@ -921,7 +921,8 @@ linux_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents, void linux_dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sgl, - int nents, enum dma_data_direction dir, struct dma_attrs *attrs) + int nents __unused, enum dma_data_direction dir __unused, + unsigned long attrs __unused) { struct linux_dma_priv *priv; From owner-dev-commits-src-branches@freebsd.org Tue Jul 20 23:46:29 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 36033655B38; Tue, 20 Jul 2021 23:46:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTwN44wnMz3PXM; Tue, 20 Jul 2021 23:46:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DD8813C40; Tue, 20 Jul 2021 23:46:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16KNkSVU054733; Tue, 20 Jul 2021 23:46:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KNkSV1054732; Tue, 20 Jul 2021 23:46:28 GMT (envelope-from git) Date: Tue, 20 Jul 2021 23:46:28 GMT Message-Id: <202107202346.16KNkSV1054732@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 801a4bcab69f - stable/13 - LinuxKPI: Implement sequence counters and sequential locks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 801a4bcab69f15a40a86c330aa12986f43287967 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 23:46:29 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=801a4bcab69f15a40a86c330aa12986f43287967 commit 801a4bcab69f15a40a86c330aa12986f43287967 Author: Vladimir Kondratyev AuthorDate: 2021-07-05 00:20:55 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-07-20 22:43:52 +0000 LinuxKPI: Implement sequence counters and sequential locks as a thin wrapper around native version found in sys/seqc.h. This replaces out-of-base GPLv2-licensed code used by drm-kmod. Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D31006 (cherry picked from commit 8b33cb8303d3d7ff12e34327a872ef9fdb29eab9) --- sys/compat/linuxkpi/common/include/linux/seqlock.h | 137 +++++++++++++++++++++ 1 file changed, 137 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/seqlock.h b/sys/compat/linuxkpi/common/include/linux/seqlock.h new file mode 100644 index 000000000000..b7ae6e32ae69 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/seqlock.h @@ -0,0 +1,137 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Vladimir Kondratyev + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _LINUX_SEQLOCK_H__ +#define _LINUX_SEQLOCK_H__ + +#include +#include +#include +#include + +struct lock_class_key; + +struct seqcount { + seqc_t seqc; +}; +typedef struct seqcount seqcount_t; + +struct seqlock { + struct mtx seql_lock; + struct seqcount seql_count; +}; +typedef struct seqlock seqlock_t; + +static inline void +__seqcount_init(struct seqcount *seqcount, const char *name __unused, + struct lock_class_key *key __unused) +{ + seqcount->seqc = 0; +} +#define seqcount_init(seqcount) __seqcount_init(seqcount, NULL, NULL) + +static inline void +write_seqcount_begin(struct seqcount *seqcount) +{ + seqc_sleepable_write_begin(&seqcount->seqc); +} + +static inline void +write_seqcount_end(struct seqcount *seqcount) +{ + seqc_sleepable_write_end(&seqcount->seqc); +} + +/* + * XXX: Are predicts from inline functions still not honored by clang? + */ +#define __read_seqcount_retry(seqcount, gen) \ + (!seqc_consistent_nomb(&(seqcount)->seqc, gen)) +#define read_seqcount_retry(seqcount, gen) \ + (!seqc_consistent(&(seqcount)->seqc, gen)) + +static inline unsigned +read_seqcount_begin(const struct seqcount *seqcount) +{ + return (seqc_read(&seqcount->seqc)); +} + +static inline unsigned +raw_read_seqcount(const struct seqcount *seqcount) +{ + return (seqc_read_any(&seqcount->seqc)); +} + +static inline void +seqlock_init(struct seqlock *seqlock) +{ + /* + * Don't enroll to witness(4) to avoid orphaned references after struct + * seqlock has been freed. There is no seqlock destructor exists so we + * can't expect automatic mtx_destroy() execution before free(). + */ + mtx_init(&seqlock->seql_lock, "seqlock", NULL, MTX_DEF|MTX_NOWITNESS); + seqcount_init(&seqlock->seql_count); +} + +static inline void +write_seqlock(struct seqlock *seqlock) +{ + mtx_lock(&seqlock->seql_lock); + write_seqcount_begin(&seqlock->seql_count); +} + +static inline void +write_sequnlock(struct seqlock *seqlock) +{ + write_seqcount_end(&seqlock->seql_count); + mtx_unlock(&seqlock->seql_lock); +} + +#define write_seqlock_irqsave(seqlock, flags) do { \ + (flags) = 0; \ + write_seqlock(seqlock); \ +} while (0) + +static inline void +write_sequnlock_irqrestore(struct seqlock *seqlock, + unsigned long flags __unused) +{ + write_sequnlock(seqlock); +} + +static inline unsigned +read_seqbegin(const struct seqlock *seqlock) +{ + return (read_seqcount_begin(&seqlock->seql_count)); +} + +#define read_seqretry(seqlock, gen) \ + read_seqcount_retry(&(seqlock)->seql_count, gen) + +#endif /* _LINUX_SEQLOCK_H__ */ From owner-dev-commits-src-branches@freebsd.org Tue Jul 20 23:46:26 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 517AA6559C6; Tue, 20 Jul 2021 23:46:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTwN143q3z3PRS; Tue, 20 Jul 2021 23:46:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1162713476; Tue, 20 Jul 2021 23:46:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16KNkOdV054657; Tue, 20 Jul 2021 23:46:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16KNkOxr054656; Tue, 20 Jul 2021 23:46:24 GMT (envelope-from git) Date: Tue, 20 Jul 2021 23:46:24 GMT Message-Id: <202107202346.16KNkOxr054656@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 907f9800646e - stable/13 - LinuxKPI: Implement irq_work_sync() routine. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 907f9800646eaef149a38a93ce0e28ed87a4f7f2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 23:46:26 -0000 The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=907f9800646eaef149a38a93ce0e28ed87a4f7f2 commit 907f9800646eaef149a38a93ce0e28ed87a4f7f2 Author: Vladimir Kondratyev AuthorDate: 2021-07-05 00:20:06 +0000 Commit: Vladimir Kondratyev CommitDate: 2021-07-20 22:43:52 +0000 LinuxKPI: Implement irq_work_sync() routine. irq_work_sync() performs draining of irq_work task. Required by drm-kmod. Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D30818 (cherry picked from commit 864b11007ab3de9f65f28b730507225396c38b9e) --- sys/compat/linuxkpi/common/include/linux/irq_work.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/irq_work.h b/sys/compat/linuxkpi/common/include/linux/irq_work.h index eb1798a4e450..1b376b829818 100644 --- a/sys/compat/linuxkpi/common/include/linux/irq_work.h +++ b/sys/compat/linuxkpi/common/include/linux/irq_work.h @@ -64,4 +64,10 @@ irq_work_queue(struct irq_work *irqw) taskqueue_enqueue(linux_irq_work_tq, &irqw->irq_task); } +static inline void +irq_work_sync(struct irq_work *irqw) +{ + taskqueue_drain(linux_irq_work_tq, &irqw->irq_task); +} + #endif /* __LINUX_IRQ_WORK_H__ */ From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 01:54:40 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D9984658287; Wed, 21 Jul 2021 01:54:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTzD05sG5z4Thc; Wed, 21 Jul 2021 01:54:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B149B15C8C; Wed, 21 Jul 2021 01:54:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16L1seO9028356; Wed, 21 Jul 2021 01:54:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L1seww028355; Wed, 21 Jul 2021 01:54:40 GMT (envelope-from git) Date: Wed, 21 Jul 2021 01:54:40 GMT Message-Id: <202107210154.16L1seww028355@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 0b1b2d68829e - stable/13 - Filter out LBA formats with LBA Data Size of 0. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0b1b2d68829eea3ad47af984ddf06a839b39ff42 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 01:54:40 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=0b1b2d68829eea3ad47af984ddf06a839b39ff42 commit 0b1b2d68829eea3ad47af984ddf06a839b39ff42 Author: Alexander Motin AuthorDate: 2021-07-14 18:01:22 +0000 Commit: Alexander Motin CommitDate: 2021-07-21 01:54:38 +0000 Filter out LBA formats with LBA Data Size of 0. According to the spec: "If the value reported is 0h, then LBA format is not supported / used or is not currently available". MFC after: 1 week (cherry picked from commit d379886a4170fa3d95a5354612a5e2c15b104841) --- sbin/nvmecontrol/identify.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/nvmecontrol/identify.c b/sbin/nvmecontrol/identify.c index 86b7369883fb..6cd7ad0fdc2d 100644 --- a/sbin/nvmecontrol/identify.c +++ b/sbin/nvmecontrol/identify.c @@ -175,6 +175,8 @@ print_namespace(struct nvme_namespace_data *nsdata) lbaf = nsdata->lbaf[i]; lbads = (lbaf >> NVME_NS_DATA_LBAF_LBADS_SHIFT) & NVME_NS_DATA_LBAF_LBADS_MASK; + if (lbads == 0) + continue; ms = (lbaf >> NVME_NS_DATA_LBAF_MS_SHIFT) & NVME_NS_DATA_LBAF_MS_MASK; rp = (lbaf >> NVME_NS_DATA_LBAF_RP_SHIFT) & From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 01:55:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1A64658218; Wed, 21 Jul 2021 01:55:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTzDZ4SX9z4TqG; Wed, 21 Jul 2021 01:55:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81AEF15BBC; Wed, 21 Jul 2021 01:55:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16L1tAjH028522; Wed, 21 Jul 2021 01:55:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L1tAsT028521; Wed, 21 Jul 2021 01:55:10 GMT (envelope-from git) Date: Wed, 21 Jul 2021 01:55:10 GMT Message-Id: <202107210155.16L1tAsT028521@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: e6afa8ef5610 - stable/12 - Filter out LBA formats with LBA Data Size of 0. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e6afa8ef56108f8f88c00cefd68e0363b32b7369 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 01:55:10 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=e6afa8ef56108f8f88c00cefd68e0363b32b7369 commit e6afa8ef56108f8f88c00cefd68e0363b32b7369 Author: Alexander Motin AuthorDate: 2021-07-14 18:01:22 +0000 Commit: Alexander Motin CommitDate: 2021-07-21 01:55:08 +0000 Filter out LBA formats with LBA Data Size of 0. According to the spec: "If the value reported is 0h, then LBA format is not supported / used or is not currently available". MFC after: 1 week (cherry picked from commit d379886a4170fa3d95a5354612a5e2c15b104841) --- sbin/nvmecontrol/identify.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/nvmecontrol/identify.c b/sbin/nvmecontrol/identify.c index 86b7369883fb..6cd7ad0fdc2d 100644 --- a/sbin/nvmecontrol/identify.c +++ b/sbin/nvmecontrol/identify.c @@ -175,6 +175,8 @@ print_namespace(struct nvme_namespace_data *nsdata) lbaf = nsdata->lbaf[i]; lbads = (lbaf >> NVME_NS_DATA_LBAF_LBADS_SHIFT) & NVME_NS_DATA_LBAF_LBADS_MASK; + if (lbads == 0) + continue; ms = (lbaf >> NVME_NS_DATA_LBAF_MS_SHIFT) & NVME_NS_DATA_LBAF_MS_MASK; rp = (lbaf >> NVME_NS_DATA_LBAF_RP_SHIFT) & From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 01:56:38 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE6586581AF; Wed, 21 Jul 2021 01:56:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTzGG5p8zz4V5G; Wed, 21 Jul 2021 01:56:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF19D15D00; Wed, 21 Jul 2021 01:56:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16L1ucBZ028735; Wed, 21 Jul 2021 01:56:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L1ucMi028734; Wed, 21 Jul 2021 01:56:38 GMT (envelope-from git) Date: Wed, 21 Jul 2021 01:56:38 GMT Message-Id: <202107210156.16L1ucMi028734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: d92453e8b020 - stable/13 - For ns identify/delete allow nsid of 0xffffffff. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d92453e8b0203e7f560a9ffb72572e7310f1f9eb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 01:56:39 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=d92453e8b0203e7f560a9ffb72572e7310f1f9eb commit d92453e8b0203e7f560a9ffb72572e7310f1f9eb Author: Alexander Motin AuthorDate: 2021-07-14 18:56:34 +0000 Commit: Alexander Motin CommitDate: 2021-07-21 01:56:36 +0000 For ns identify/delete allow nsid of 0xffffffff. The first should report common parameters, the second should delete all namespaces. MFC after: 1 week (cherry picked from commit dbf1dce8d6d2d0eedac5402c1f137a80805179ca) --- sbin/nvmecontrol/ns.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sbin/nvmecontrol/ns.c b/sbin/nvmecontrol/ns.c index dd20e4e47967..1da0cf01a69f 100644 --- a/sbin/nvmecontrol/ns.c +++ b/sbin/nvmecontrol/ns.c @@ -198,7 +198,7 @@ static struct delete_options { uint32_t nsid; const char *dev; } delete_opt = { - .nsid = NONE, + .nsid = NONE - 1, .dev = NULL, }; @@ -331,7 +331,7 @@ static struct identify_options { .hex = false, .verbose = false, .dev = NULL, - .nsid = NONE, + .nsid = NONE - 1, }; static const struct opts identify_opts[] = { @@ -639,12 +639,12 @@ nsdelete(const struct cmd *f, int argc, char *argv[]) if (nsid != 0) { close(fd); open_dev(path, &fd, 1, 1); - } else if (delete_opt.nsid == NONE) { + } else if (delete_opt.nsid == NONE - 1) { close(fd); fprintf(stderr, "No NSID specified"); arg_help(argc, argv, f); } - if (delete_opt.nsid != NONE) + if (delete_opt.nsid != NONE - 1) nsid = delete_opt.nsid; free(path); if (read_controller_data(fd, &cd)) @@ -912,12 +912,12 @@ nsidentify(const struct cmd *f, int argc, char *argv[]) if (nsid != 0) { close(fd); open_dev(path, &fd, 1, 1); - } else if (identify_opt.nsid == NONE) { + } else if (identify_opt.nsid == NONE - 1) { close(fd); fprintf(stderr, "No NSID specified"); arg_help(argc, argv, f); } - if (identify_opt.nsid != NONE) + if (identify_opt.nsid != NONE - 1) nsid = identify_opt.nsid; if (read_controller_data(fd, &cd)) errx(EX_IOERR, "Identify request failed"); From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 01:56:40 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0DEE96582A7; Wed, 21 Jul 2021 01:56:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTzGH6lcsz4V5K; Wed, 21 Jul 2021 01:56:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE3D015B46; Wed, 21 Jul 2021 01:56:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16L1udDB028759; Wed, 21 Jul 2021 01:56:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L1udXV028758; Wed, 21 Jul 2021 01:56:39 GMT (envelope-from git) Date: Wed, 21 Jul 2021 01:56:39 GMT Message-Id: <202107210156.16L1udXV028758@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 7de125a406f2 - stable/13 - Partially revert previous commit. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7de125a406f271d63f5ffaac905f4f82a1480d03 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 01:56:40 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=7de125a406f271d63f5ffaac905f4f82a1480d03 commit 7de125a406f271d63f5ffaac905f4f82a1480d03 Author: Alexander Motin AuthorDate: 2021-07-14 19:46:22 +0000 Commit: Alexander Motin CommitDate: 2021-07-21 01:56:36 +0000 Partially revert previous commit. ns identify does not allow nsid of 0xffffffff. Only general identify allows it. MFC after: 1 week (cherry picked from commit d1a0eab9fbc426ed8cbbddcd90720180c44ce36b) --- sbin/nvmecontrol/ns.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/nvmecontrol/ns.c b/sbin/nvmecontrol/ns.c index 1da0cf01a69f..5ec6a305b8b9 100644 --- a/sbin/nvmecontrol/ns.c +++ b/sbin/nvmecontrol/ns.c @@ -331,7 +331,7 @@ static struct identify_options { .hex = false, .verbose = false, .dev = NULL, - .nsid = NONE - 1, + .nsid = NONE, }; static const struct opts identify_opts[] = { @@ -912,12 +912,12 @@ nsidentify(const struct cmd *f, int argc, char *argv[]) if (nsid != 0) { close(fd); open_dev(path, &fd, 1, 1); - } else if (identify_opt.nsid == NONE - 1) { + } else if (identify_opt.nsid == NONE) { close(fd); fprintf(stderr, "No NSID specified"); arg_help(argc, argv, f); } - if (identify_opt.nsid != NONE - 1) + if (identify_opt.nsid != NONE) nsid = identify_opt.nsid; if (read_controller_data(fd, &cd)) errx(EX_IOERR, "Identify request failed"); From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 01:57:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9526665833A; Wed, 21 Jul 2021 01:57:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTzGs3sGxz4V39; Wed, 21 Jul 2021 01:57:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C2B515B47; Wed, 21 Jul 2021 01:57:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16L1v9iq028913; Wed, 21 Jul 2021 01:57:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L1v9Li028912; Wed, 21 Jul 2021 01:57:09 GMT (envelope-from git) Date: Wed, 21 Jul 2021 01:57:09 GMT Message-Id: <202107210157.16L1v9Li028912@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: f65faff5da28 - stable/12 - For ns identify/delete allow nsid of 0xffffffff. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f65faff5da28865efb2a90e8fbdae5864e630800 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 01:57:09 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=f65faff5da28865efb2a90e8fbdae5864e630800 commit f65faff5da28865efb2a90e8fbdae5864e630800 Author: Alexander Motin AuthorDate: 2021-07-14 18:56:34 +0000 Commit: Alexander Motin CommitDate: 2021-07-21 01:57:05 +0000 For ns identify/delete allow nsid of 0xffffffff. The first should report common parameters, the second should delete all namespaces. MFC after: 1 week (cherry picked from commit dbf1dce8d6d2d0eedac5402c1f137a80805179ca) --- sbin/nvmecontrol/ns.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sbin/nvmecontrol/ns.c b/sbin/nvmecontrol/ns.c index dd20e4e47967..1da0cf01a69f 100644 --- a/sbin/nvmecontrol/ns.c +++ b/sbin/nvmecontrol/ns.c @@ -198,7 +198,7 @@ static struct delete_options { uint32_t nsid; const char *dev; } delete_opt = { - .nsid = NONE, + .nsid = NONE - 1, .dev = NULL, }; @@ -331,7 +331,7 @@ static struct identify_options { .hex = false, .verbose = false, .dev = NULL, - .nsid = NONE, + .nsid = NONE - 1, }; static const struct opts identify_opts[] = { @@ -639,12 +639,12 @@ nsdelete(const struct cmd *f, int argc, char *argv[]) if (nsid != 0) { close(fd); open_dev(path, &fd, 1, 1); - } else if (delete_opt.nsid == NONE) { + } else if (delete_opt.nsid == NONE - 1) { close(fd); fprintf(stderr, "No NSID specified"); arg_help(argc, argv, f); } - if (delete_opt.nsid != NONE) + if (delete_opt.nsid != NONE - 1) nsid = delete_opt.nsid; free(path); if (read_controller_data(fd, &cd)) @@ -912,12 +912,12 @@ nsidentify(const struct cmd *f, int argc, char *argv[]) if (nsid != 0) { close(fd); open_dev(path, &fd, 1, 1); - } else if (identify_opt.nsid == NONE) { + } else if (identify_opt.nsid == NONE - 1) { close(fd); fprintf(stderr, "No NSID specified"); arg_help(argc, argv, f); } - if (identify_opt.nsid != NONE) + if (identify_opt.nsid != NONE - 1) nsid = identify_opt.nsid; if (read_controller_data(fd, &cd)) errx(EX_IOERR, "Identify request failed"); From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 01:57:11 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 291AB65849B; Wed, 21 Jul 2021 01:57:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GTzGt5hyKz4V8F; Wed, 21 Jul 2021 01:57:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F89615C0E; Wed, 21 Jul 2021 01:57:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16L1vAkt028943; Wed, 21 Jul 2021 01:57:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16L1vAEK028942; Wed, 21 Jul 2021 01:57:10 GMT (envelope-from git) Date: Wed, 21 Jul 2021 01:57:10 GMT Message-Id: <202107210157.16L1vAEK028942@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 7a733b91aea1 - stable/12 - Partially revert previous commit. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7a733b91aea1cfda109c255e7c052f9d56d14bc9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 01:57:11 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=7a733b91aea1cfda109c255e7c052f9d56d14bc9 commit 7a733b91aea1cfda109c255e7c052f9d56d14bc9 Author: Alexander Motin AuthorDate: 2021-07-14 19:46:22 +0000 Commit: Alexander Motin CommitDate: 2021-07-21 01:57:07 +0000 Partially revert previous commit. ns identify does not allow nsid of 0xffffffff. Only general identify allows it. MFC after: 1 week (cherry picked from commit d1a0eab9fbc426ed8cbbddcd90720180c44ce36b) --- sbin/nvmecontrol/ns.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/nvmecontrol/ns.c b/sbin/nvmecontrol/ns.c index 1da0cf01a69f..5ec6a305b8b9 100644 --- a/sbin/nvmecontrol/ns.c +++ b/sbin/nvmecontrol/ns.c @@ -331,7 +331,7 @@ static struct identify_options { .hex = false, .verbose = false, .dev = NULL, - .nsid = NONE - 1, + .nsid = NONE, }; static const struct opts identify_opts[] = { @@ -912,12 +912,12 @@ nsidentify(const struct cmd *f, int argc, char *argv[]) if (nsid != 0) { close(fd); open_dev(path, &fd, 1, 1); - } else if (identify_opt.nsid == NONE - 1) { + } else if (identify_opt.nsid == NONE) { close(fd); fprintf(stderr, "No NSID specified"); arg_help(argc, argv, f); } - if (identify_opt.nsid != NONE - 1) + if (identify_opt.nsid != NONE) nsid = identify_opt.nsid; if (read_controller_data(fd, &cd)) errx(EX_IOERR, "Identify request failed"); From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 12:09:49 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A266662B5E; Wed, 21 Jul 2021 12:09:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVDsn13r0z3tbp; Wed, 21 Jul 2021 12:09:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BED51DE7F; Wed, 21 Jul 2021 12:09:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LC9mK8044476; Wed, 21 Jul 2021 12:09:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LC9mrg044475; Wed, 21 Jul 2021 12:09:48 GMT (envelope-from git) Date: Wed, 21 Jul 2021 12:09:48 GMT Message-Id: <202107211209.16LC9mrg044475@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 156670f0e7cf - stable/12 - arm: add atomic_store_rel_64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 156670f0e7cf9c59181d153fd6596675245e27ca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 12:09:49 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=156670f0e7cf9c59181d153fd6596675245e27ca commit 156670f0e7cf9c59181d153fd6596675245e27ca Author: Mateusz Guzik AuthorDate: 2021-07-21 12:05:38 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-21 12:05:38 +0000 arm: add atomic_store_rel_64 This unbreaks building linux compat in tinderbox. This is a direct commit. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/arm/include/atomic-v4.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/arm/include/atomic-v4.h b/sys/arm/include/atomic-v4.h index f30abca99b02..a0083e00deaa 100644 --- a/sys/arm/include/atomic-v4.h +++ b/sys/arm/include/atomic-v4.h @@ -550,6 +550,7 @@ atomic_swap_32(volatile u_int32_t *p, u_int32_t v) #define atomic_subtract_acq_32 atomic_subtract_32 #define atomic_store_rel_32 atomic_store_32 #define atomic_store_rel_long atomic_store_long +#define atomic_store_rel_64 atomic_store_64 #define atomic_load_acq_32 atomic_load_32 #define atomic_load_acq_long atomic_load_long #define atomic_add_acq_long atomic_add_long From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 12:09:50 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E829662C38; Wed, 21 Jul 2021 12:09:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVDsp2Nc1z3tbx; Wed, 21 Jul 2021 12:09:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 336861DC9E; Wed, 21 Jul 2021 12:09:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LC9o2b044500; Wed, 21 Jul 2021 12:09:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LC9oYu044499; Wed, 21 Jul 2021 12:09:50 GMT (envelope-from git) Date: Wed, 21 Jul 2021 12:09:50 GMT Message-Id: <202107211209.16LC9oYu044499@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 4bce44bdac3e - stable/12 - arm: hide pc_mpidr behind #if __ARM_ARCH >= 6 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4bce44bdac3e821630032ef13e80562c7919a66a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 12:09:50 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=4bce44bdac3e821630032ef13e80562c7919a66a commit 4bce44bdac3e821630032ef13e80562c7919a66a Author: Mateusz Guzik AuthorDate: 2021-07-21 12:06:34 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-21 12:06:34 +0000 arm: hide pc_mpidr behind #if __ARM_ARCH >= 6 This is a direct commit. Unbreaks the build of: DB-78XXX DB-88F5XXX DB-88F6XXX RT1310 LINT-V5 TS7800 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/arm/arm/machdep.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c index a1354f303b3a..7aa19ceb3275 100644 --- a/sys/arm/arm/machdep.c +++ b/sys/arm/arm/machdep.c @@ -378,7 +378,9 @@ void cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size) { +#if __ARM_ARCH >= 6 pcpu->pc_mpidr = 0xffffffff; +#endif } void @@ -765,7 +767,9 @@ pcpu0_init(void) set_curthread(&thread0); #endif pcpu_init(pcpup, 0, sizeof(struct pcpu)); +#if __ARM_ARCH >= 6 pcpup->pc_mpidr = cp15_mpidr_get() & 0xFFFFFF; +#endif PCPU_SET(curthread, &thread0); } From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 12:09:51 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ACF4766231B; Wed, 21 Jul 2021 12:09:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVDsq3Nt9z3tXy; Wed, 21 Jul 2021 12:09:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5835F1DC62; Wed, 21 Jul 2021 12:09:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LC9pTe044526; Wed, 21 Jul 2021 12:09:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LC9piA044523; Wed, 21 Jul 2021 12:09:51 GMT (envelope-from git) Date: Wed, 21 Jul 2021 12:09:51 GMT Message-Id: <202107211209.16LC9piA044523@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: ab057b02b7c0 - stable/12 - arm: add device syscon to TEGRA124 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ab057b02b7c0bdbbcbd2c8520e766161fda5afc9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 12:09:52 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=ab057b02b7c0bdbbcbd2c8520e766161fda5afc9 commit ab057b02b7c0bdbbcbd2c8520e766161fda5afc9 Author: Mateusz Guzik AuthorDate: 2021-07-21 12:08:32 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-21 12:08:32 +0000 arm: add device syscon to TEGRA124 Unbreaks the build. This is a direct commit. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/arm/conf/TEGRA124 | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/arm/conf/TEGRA124 b/sys/arm/conf/TEGRA124 index a830519d909e..667ce01ac8bb 100644 --- a/sys/arm/conf/TEGRA124 +++ b/sys/arm/conf/TEGRA124 @@ -40,6 +40,7 @@ device clk device phy device hwreset device regulator +device syscon # Pseudo devices. device loop # Network loopback From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 13:24:15 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB006663F51; Wed, 21 Jul 2021 13:24:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVGWg5s0vz4bS2; Wed, 21 Jul 2021 13:24:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B21681EF27; Wed, 21 Jul 2021 13:24:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LDOF5e051463; Wed, 21 Jul 2021 13:24:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LDOFMN051462; Wed, 21 Jul 2021 13:24:15 GMT (envelope-from git) Date: Wed, 21 Jul 2021 13:24:15 GMT Message-Id: <202107211324.16LDOFMN051462@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: fd14e033e2b1 - stable/12 - Add 'gpio' since mmc now requires gpio_if.h. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fd14e033e2b1bfcf4e0752193a1dd4aa0f678862 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 13:24:16 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=fd14e033e2b1bfcf4e0752193a1dd4aa0f678862 commit fd14e033e2b1bfcf4e0752193a1dd4aa0f678862 Author: John Baldwin AuthorDate: 2020-04-16 20:45:54 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-21 13:23:55 +0000 Add 'gpio' since mmc now requires gpio_if.h. (cherry picked from commit fdbb2410cb08214939b0b1570cc375f231abf63e) --- sys/mips/conf/std.XLP | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/mips/conf/std.XLP b/sys/mips/conf/std.XLP index 5330c19b3657..e21527a0ebdb 100644 --- a/sys/mips/conf/std.XLP +++ b/sys/mips/conf/std.XLP @@ -114,6 +114,7 @@ device cfi device cfid # MMC/SD +device gpio device mmc # MMC/SD bus device mmcsd # MMC/SD memory card device sdhci # Generic PCI SD Host Controller From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 13:24:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2CAA1663AF9; Wed, 21 Jul 2021 13:24:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVGWh6xCQz4bYQ; Wed, 21 Jul 2021 13:24:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D478C1EA46; Wed, 21 Jul 2021 13:24:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LDOG4O051496; Wed, 21 Jul 2021 13:24:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LDOGpU051495; Wed, 21 Jul 2021 13:24:16 GMT (envelope-from git) Date: Wed, 21 Jul 2021 13:24:16 GMT Message-Id: <202107211324.16LDOGpU051495@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 2b0a97f0c75f - stable/12 - mips: Implement basic pmap_kenter_device, pmap_kremove_device MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2b0a97f0c75fc7a2af81150be892ac345a5b24a3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 13:24:17 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2b0a97f0c75fc7a2af81150be892ac345a5b24a3 commit 2b0a97f0c75fc7a2af81150be892ac345a5b24a3 Author: Conrad Meyer AuthorDate: 2019-05-16 19:10:48 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-21 13:24:09 +0000 mips: Implement basic pmap_kenter_device, pmap_kremove_device Unbreak mips.BERI_DE4_SDROOT build, which uses device xdma. Device xdma depends on the pmap_kenter_device APIs. Reported by: tinderbox (local) Sponsored by: Dell EMC Isilon (cherry picked from commit fa3ac573a2f712393cebd195bf7331cff3d1b8fe) --- sys/mips/include/pmap.h | 2 ++ sys/mips/mips/pmap.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/sys/mips/include/pmap.h b/sys/mips/include/pmap.h index ba31de835d23..edc9089a6fbc 100644 --- a/sys/mips/include/pmap.h +++ b/sys/mips/include/pmap.h @@ -177,7 +177,9 @@ void pmap_unmapdev(vm_offset_t, vm_size_t); vm_offset_t pmap_steal_memory(vm_size_t size); void pmap_kenter(vm_offset_t va, vm_paddr_t pa); void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, vm_memattr_t attr); +void pmap_kenter_device(vm_offset_t, vm_size_t, vm_paddr_t); void pmap_kremove(vm_offset_t va); +void pmap_kremove_device(vm_offset_t, vm_size_t); void *pmap_kenter_temporary(vm_paddr_t pa, int i); void pmap_kenter_temporary_free(vm_paddr_t pa); void pmap_flush_pvcache(vm_page_t m); diff --git a/sys/mips/mips/pmap.c b/sys/mips/mips/pmap.c index 3b55f43c6b80..f41bae28a9ea 100644 --- a/sys/mips/mips/pmap.c +++ b/sys/mips/mips/pmap.c @@ -854,6 +854,44 @@ pmap_kenter(vm_offset_t va, vm_paddr_t pa) pmap_kenter_attr(va, pa, VM_MEMATTR_DEFAULT); } +void +pmap_kenter_device(vm_offset_t va, vm_size_t size, vm_paddr_t pa) +{ + + KASSERT((size & PAGE_MASK) == 0, + ("%s: device mapping not page-sized", __func__)); + + for (; size > 0; size -= PAGE_SIZE) { + /* + * XXXCEM: this is somewhat inefficient on SMP systems in that + * every single page is individually TLB-invalidated via + * rendezvous (pmap_update_page()), instead of invalidating the + * entire range via a single rendezvous. + */ + pmap_kenter_attr(va, pa, VM_MEMATTR_UNCACHEABLE); + va += PAGE_SIZE; + pa += PAGE_SIZE; + } +} + +void +pmap_kremove_device(vm_offset_t va, vm_size_t size) +{ + + KASSERT((size & PAGE_MASK) == 0, + ("%s: device mapping not page-sized", __func__)); + + /* + * XXXCEM: Similar to pmap_kenter_device, this is inefficient on SMP, + * in that pages are invalidated individually instead of a single range + * rendezvous. + */ + for (; size > 0; size -= PAGE_SIZE) { + pmap_kremove(va); + va += PAGE_SIZE; + } +} + /* * remove a page from the kernel pagetables */ From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 15:06:46 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8C5E665600; Wed, 21 Jul 2021 15:06:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVJny4R76z4tm2; Wed, 21 Jul 2021 15:06:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C9681FBE5; Wed, 21 Jul 2021 15:06:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LF6kGT085928; Wed, 21 Jul 2021 15:06:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LF6kW4085927; Wed, 21 Jul 2021 15:06:46 GMT (envelope-from git) Date: Wed, 21 Jul 2021 15:06:46 GMT Message-Id: <202107211506.16LF6kW4085927@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ka Ho Ng Subject: git: fc661f1903b4 - stable/13 - vmm: Fix AMD-vi using wrong rid range MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fc661f1903b43e484d47fa63edabdf0dab778473 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 15:06:46 -0000 The branch stable/13 has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=fc661f1903b43e484d47fa63edabdf0dab778473 commit fc661f1903b43e484d47fa63edabdf0dab778473 Author: Ka Ho Ng AuthorDate: 2021-07-13 17:53:10 +0000 Commit: Ka Ho Ng CommitDate: 2021-07-21 15:06:35 +0000 vmm: Fix AMD-vi using wrong rid range The ACPI parsing code around rid range was wrong on assuming there is only one pair of start/end device id range. Besides, ivhd_dev_parse() never work as supposed. The start/end rid info was always zero. Restructure the code to build dynamic-sized tables for each IOMMU softc holding device entries. The device entries are enumerated to find a suitable IOMMU unit. Operations on devices not governed (e.g. the IOMMU unit itself) are no-op from now on. There are also a minor fix on wrong %b formatting string usage. Tested on my EPYC 7282. Sponsored by: The FreeBSD Foundation Reviewed by: grehan Differential Revision: https://reviews.freebsd.org/D30827 (cherry picked from commit b5c74dfd6434b7f4dcc59dbd61b508acc5ec3ecf) --- sys/amd64/vmm/amd/amdvi_hw.c | 52 ++++++++++++++------------------ sys/amd64/vmm/amd/amdvi_priv.h | 13 ++++---- sys/amd64/vmm/amd/ivrs_drv.c | 68 +++++++++++++++++++++++++----------------- 3 files changed, 70 insertions(+), 63 deletions(-) diff --git a/sys/amd64/vmm/amd/amdvi_hw.c b/sys/amd64/vmm/amd/amdvi_hw.c index 3581b43ea4de..e488c5fd5f6a 100644 --- a/sys/amd64/vmm/amd/amdvi_hw.c +++ b/sys/amd64/vmm/amd/amdvi_hw.c @@ -809,11 +809,11 @@ amdvi_print_dev_cap(struct amdvi_softc *softc) cfg = softc->dev_cfg; for (i = 0; i < softc->dev_cfg_cnt; i++) { - device_printf(softc->dev, "device [0x%x - 0x%x]" + device_printf(softc->dev, "device [0x%x - 0x%x] " "config:%b%s\n", cfg->start_id, cfg->end_id, cfg->data, "\020\001INIT\002ExtInt\003NMI" - "\007LINT0\008LINT1", + "\007LINT0\010LINT1", cfg->enable_ats ? "ATS enabled" : ""); cfg++; } @@ -874,10 +874,6 @@ amdvi_add_sysctl(struct amdvi_softc *softc) &softc->total_cmd, "Command submitted count"); SYSCTL_ADD_U16(ctx, child, OID_AUTO, "pci_rid", CTLFLAG_RD, &softc->pci_rid, 0, "IOMMU RID"); - SYSCTL_ADD_U16(ctx, child, OID_AUTO, "start_dev_rid", CTLFLAG_RD, - &softc->start_dev_rid, 0, "Start of device under this IOMMU"); - SYSCTL_ADD_U16(ctx, child, OID_AUTO, "end_dev_rid", CTLFLAG_RD, - &softc->end_dev_rid, 0, "End of device under this IOMMU"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "command_head", CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, softc, 0, amdvi_handle_sysctl, "IU", "Command head"); @@ -1204,22 +1200,17 @@ static struct amdvi_softc * amdvi_find_iommu(uint16_t devid) { struct amdvi_softc *softc; - int i; + int i, j; for (i = 0; i < ivhd_count; i++) { softc = device_get_softc(ivhd_devs[i]); - if ((devid >= softc->start_dev_rid) && - (devid <= softc->end_dev_rid)) - return (softc); + for (j = 0; j < softc->dev_cfg_cnt; j++) + if ((devid >= softc->dev_cfg[j].start_id) && + (devid <= softc->dev_cfg[j].end_id)) + return (softc); } - /* - * XXX: BIOS bug, device not in IVRS table, assume its from first IOMMU. - */ - printf("BIOS bug device(%d.%d.%d) doesn't have IVHD entry.\n", - RID2PCI_STR(devid)); - - return (device_get_softc(ivhd_devs[0])); + return (NULL); } /* @@ -1228,14 +1219,12 @@ amdvi_find_iommu(uint16_t devid) * be set concurrently, e.g. read and write bits. */ static void -amdvi_set_dte(struct amdvi_domain *domain, uint16_t devid, bool enable) +amdvi_set_dte(struct amdvi_domain *domain, struct amdvi_softc *softc, + uint16_t devid, bool enable) { - struct amdvi_softc *softc; struct amdvi_dte* temp; KASSERT(domain, ("domain is NULL for pci_rid:0x%x\n", devid)); - - softc = amdvi_find_iommu(devid); KASSERT(softc, ("softc is NULL for pci_rid:0x%x\n", devid)); temp = &amdvi_dte[devid]; @@ -1269,11 +1258,8 @@ amdvi_set_dte(struct amdvi_domain *domain, uint16_t devid, bool enable) } static void -amdvi_inv_device(uint16_t devid) +amdvi_inv_device(struct amdvi_softc *softc, uint16_t devid) { - struct amdvi_softc *softc; - - softc = amdvi_find_iommu(devid); KASSERT(softc, ("softc is NULL")); amdvi_cmd_inv_dte(softc, devid); @@ -1288,6 +1274,7 @@ static void amdvi_add_device(void *arg, uint16_t devid) { struct amdvi_domain *domain; + struct amdvi_softc *softc; domain = (struct amdvi_domain *)arg; KASSERT(domain != NULL, ("domain is NULL")); @@ -1295,22 +1282,29 @@ amdvi_add_device(void *arg, uint16_t devid) printf("Assigning device(%d.%d.%d) to domain:%d\n", RID2PCI_STR(devid), domain->id); #endif - amdvi_set_dte(domain, devid, true); - amdvi_inv_device(devid); + softc = amdvi_find_iommu(devid); + if (softc == NULL) + return; + amdvi_set_dte(domain, softc, devid, true); + amdvi_inv_device(softc, devid); } static void amdvi_remove_device(void *arg, uint16_t devid) { struct amdvi_domain *domain; + struct amdvi_softc *softc; domain = (struct amdvi_domain *)arg; #ifdef AMDVI_DEBUG_CMD printf("Remove device(0x%x) from domain:%d\n", devid, domain->id); #endif - amdvi_set_dte(domain, devid, false); - amdvi_inv_device(devid); + softc = amdvi_find_iommu(devid); + if (softc == NULL) + return; + amdvi_set_dte(domain, softc, devid, false); + amdvi_inv_device(softc, devid); } static void diff --git a/sys/amd64/vmm/amd/amdvi_priv.h b/sys/amd64/vmm/amd/amdvi_priv.h index 0eae7ca6ca4c..6960ef24d683 100644 --- a/sys/amd64/vmm/amd/amdvi_priv.h +++ b/sys/amd64/vmm/amd/amdvi_priv.h @@ -2,7 +2,10 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2016 Anish Gupta (anish@freebsd.org) - * All rights reserved. + * Copyright (c) 2021 The FreeBSD Foundation + * + * Portions of this software were developed by Ka Ho Ng + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -392,13 +395,11 @@ struct amdvi_softc { uint8_t pci_cap; /* PCI capability. */ uint16_t pci_seg; /* IOMMU PCI domain/segment. */ uint16_t pci_rid; /* PCI BDF of IOMMU */ - /* Device range under this IOMMU. */ - uint16_t start_dev_rid; /* First device under this IOMMU. */ - uint16_t end_dev_rid; /* Last device under this IOMMU. */ - /* BIOS provided device configuration for end points. */ - struct ivhd_dev_cfg dev_cfg[10]; + /* ACPI device configuration for end points. */ + struct ivhd_dev_cfg *dev_cfg; int dev_cfg_cnt; + int dev_cfg_cap; /* Software statistics. */ uint64_t event_intr_cnt; /* Total event INTR count. */ diff --git a/sys/amd64/vmm/amd/ivrs_drv.c b/sys/amd64/vmm/amd/ivrs_drv.c index cdc66f3ecce0..430d18a059a2 100644 --- a/sys/amd64/vmm/amd/ivrs_drv.c +++ b/sys/amd64/vmm/amd/ivrs_drv.c @@ -182,9 +182,17 @@ ivhd_dev_add_entry(struct amdvi_softc *softc, uint32_t start_id, { struct ivhd_dev_cfg *dev_cfg; - /* If device doesn't have special data, don't add it. */ - if (!cfg) - return; + KASSERT(softc->dev_cfg_cap <= softc->dev_cfg_cnt, + ("Impossible case: number of dev_cfg exceeding capacity")); + if (softc->dev_cfg_cap == softc->dev_cfg_cnt) { + if (softc->dev_cfg_cap == 0) + softc->dev_cfg_cap = 1; + else + softc->dev_cfg_cap <<= 2; + softc->dev_cfg = realloc(softc->dev_cfg, + sizeof(*softc->dev_cfg) * softc->dev_cfg_cap, M_DEVBUF, + M_WAITOK); + } dev_cfg = &softc->dev_cfg[softc->dev_cfg_cnt++]; dev_cfg->start_id = start_id; @@ -201,14 +209,11 @@ ivhd_dev_parse(ACPI_IVRS_HARDWARE1 *ivhd, struct amdvi_softc *softc) { ACPI_IVRS_DE_HEADER *de; uint8_t *p, *end; - int range_start_id = 0, range_end_id = 0; + int range_start_id = -1, range_end_id = -1, i; uint32_t *extended; uint8_t all_data = 0, range_data = 0; bool range_enable_ats = false, enable_ats; - softc->start_dev_rid = ~0; - softc->end_dev_rid = 0; - switch (ivhd->Header.Type) { case IVRS_TYPE_HARDWARE_LEGACY: p = (uint8_t *)ivhd + sizeof(ACPI_IVRS_HARDWARE1); @@ -229,11 +234,11 @@ ivhd_dev_parse(ACPI_IVRS_HARDWARE1 *ivhd, struct amdvi_softc *softc) while (p < end) { de = (ACPI_IVRS_DE_HEADER *)p; - softc->start_dev_rid = MIN(softc->start_dev_rid, de->Id); - softc->end_dev_rid = MAX(softc->end_dev_rid, de->Id); switch (de->Type) { case ACPI_IVRS_TYPE_ALL: all_data = de->DataSetting; + for (i = 0; i < softc->dev_cfg_cnt; i++) + softc->dev_cfg[i].data |= all_data; break; case ACPI_IVRS_TYPE_SELECT: @@ -253,6 +258,11 @@ ivhd_dev_parse(ACPI_IVRS_HARDWARE1 *ivhd, struct amdvi_softc *softc) case ACPI_IVRS_TYPE_START: case ACPI_IVRS_TYPE_ALIAS_START: case ACPI_IVRS_TYPE_EXT_START: + if (range_start_id != -1) { + device_printf(softc->dev, + "Unexpected start-of-range device entry\n"); + return (EINVAL); + } range_start_id = de->Id; range_data = de->DataSetting; if (de->Type == ACPI_IVRS_TYPE_EXT_START) { @@ -264,10 +274,20 @@ ivhd_dev_parse(ACPI_IVRS_HARDWARE1 *ivhd, struct amdvi_softc *softc) break; case ACPI_IVRS_TYPE_END: + if (range_start_id == -1) { + device_printf(softc->dev, + "Unexpected end-of-range device entry\n"); + return (EINVAL); + } range_end_id = de->Id; + if (range_end_id < range_start_id) { + device_printf(softc->dev, + "Device entry range going backward\n"); + return (EINVAL); + } ivhd_dev_add_entry(softc, range_start_id, range_end_id, - range_data | all_data, range_enable_ats); - range_start_id = range_end_id = 0; + range_data | all_data, range_enable_ats); + range_start_id = range_end_id = -1; range_data = 0; all_data = 0; break; @@ -285,12 +305,6 @@ ivhd_dev_parse(ACPI_IVRS_HARDWARE1 *ivhd, struct amdvi_softc *softc) "Unknown dev entry:0x%x\n", de->Type); } - if (softc->dev_cfg_cnt > - (sizeof(softc->dev_cfg) / sizeof(softc->dev_cfg[0]))) { - device_printf(softc->dev, - "WARN Too many device entries.\n"); - return (EINVAL); - } if (de->Type < 0x40) p += sizeof(ACPI_IVRS_DEVICE4); else if (de->Type < 0x80) @@ -302,10 +316,6 @@ ivhd_dev_parse(ACPI_IVRS_HARDWARE1 *ivhd, struct amdvi_softc *softc) } } - KASSERT((softc->end_dev_rid >= softc->start_dev_rid), - ("Device end[0x%x] < start[0x%x.\n", - softc->end_dev_rid, softc->start_dev_rid)); - return (0); } @@ -614,9 +624,6 @@ ivhd_print_cap(struct amdvi_softc *softc, ACPI_IVRS_HARDWARE1 * ivhd) max_ptp_level, amdvi_ptp_level); } - device_printf(softc->dev, "device range: 0x%x - 0x%x\n", - softc->start_dev_rid, softc->end_dev_rid); - return (0); } @@ -674,21 +681,25 @@ ivhd_attach(device_t dev) if (status != 0) { device_printf(dev, "endpoint device parsing error=%d\n", status); + goto fail; } status = ivhd_print_cap(softc, ivhd); - if (status != 0) { - return (status); - } + if (status != 0) + goto fail; status = amdvi_setup_hw(softc); if (status != 0) { device_printf(dev, "couldn't be initialised, error=%d\n", status); - return (status); + goto fail; } return (0); + +fail: + free(softc->dev_cfg, M_DEVBUF); + return (status); } static int @@ -699,6 +710,7 @@ ivhd_detach(device_t dev) softc = device_get_softc(dev); amdvi_teardown_hw(softc); + free(softc->dev_cfg, M_DEVBUF); /* * XXX: delete the device. From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:09:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0941B665CF4; Wed, 21 Jul 2021 16:09:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLB46fXVz3Kv8; Wed, 21 Jul 2021 16:09:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAAC3206EC; Wed, 21 Jul 2021 16:09:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LG9GUM067450; Wed, 21 Jul 2021 16:09:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LG9G78067449; Wed, 21 Jul 2021 16:09:16 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:09:16 GMT Message-Id: <202107211609.16LG9G78067449@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 7d34f038f625 - stable/13 - arm64, riscv: remove reference to fsu_intr_fault MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7d34f038f62590471e79aef007922d4d26e85eeb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:09:17 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=7d34f038f62590471e79aef007922d4d26e85eeb commit 7d34f038f62590471e79aef007922d4d26e85eeb Author: Mitchell Horne AuthorDate: 2021-05-25 15:22:49 +0000 Commit: Mitchell Horne CommitDate: 2021-07-21 15:50:13 +0000 arm64, riscv: remove reference to fsu_intr_fault This variable no longer exists. MFC after: 3 days (cherry picked from commit 6f4bb8ecc2ba2383c9c160eeb826724a2644f810) --- sys/arm64/arm64/trap.c | 2 -- sys/riscv/riscv/trap.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index d793e34a6894..cdb7ae8fadae 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -71,8 +71,6 @@ __FBSDID("$FreeBSD$"); #include #endif -extern register_t fsu_intr_fault; - /* Called from exception.S */ void do_el1h_sync(struct thread *, struct trapframe *); void do_el0_sync(struct thread *, struct trapframe *); diff --git a/sys/riscv/riscv/trap.c b/sys/riscv/riscv/trap.c index 88c6adf5623b..69b43f598efd 100644 --- a/sys/riscv/riscv/trap.c +++ b/sys/riscv/riscv/trap.c @@ -73,8 +73,6 @@ __FBSDID("$FreeBSD$"); int (*dtrace_invop_jump_addr)(struct trapframe *); -extern register_t fsu_intr_fault; - /* Called from exception.S */ void do_trap_supervisor(struct trapframe *); void do_trap_user(struct trapframe *); From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:09:18 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4602B6661D2; Wed, 21 Jul 2021 16:09:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLB60bZdz3Krh; Wed, 21 Jul 2021 16:09:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC79620FF6; Wed, 21 Jul 2021 16:09:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LG9HdJ067474; Wed, 21 Jul 2021 16:09:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LG9HCF067473; Wed, 21 Jul 2021 16:09:17 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:09:17 GMT Message-Id: <202107211609.16LG9HCF067473@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: ad0c23cdcd12 - stable/13 - ttys: diff reduction MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ad0c23cdcd122f2fb1598cfad7d61aabe062bffa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:09:18 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=ad0c23cdcd122f2fb1598cfad7d61aabe062bffa commit ad0c23cdcd122f2fb1598cfad7d61aabe062bffa Author: Warner Losh AuthorDate: 2021-05-04 19:49:27 +0000 Commit: Mitchell Horne CommitDate: 2021-07-21 16:04:43 +0000 ttys: diff reduction Back in the day, we used to have a number of entries that were either 'on' or 'off' directly, rather than conditionally on 'onifexists' etc. Back then, we tried to line up the 'secure' columns by using the construct 'on secure' or 'off secure' (one space or two). Now that these have all moved to a conditional construct, remove the second space on the ttys that still have it. This reduces diffs between the different ttys and is no functional change. i386 and amd64 did this a long time ago, and those are the only ones that affected external users (who used to sed 's/on /off /' the entires as part of the automation). MFC After: 3 days Sponsored by: Netflix (cherry picked from commit 36be84b96699310e0020e194f81fe8e4a6c3f787) --- sbin/init/ttys.aarch64 | 8 ++++---- sbin/init/ttys.arm | 8 ++++---- sbin/init/ttys.riscv | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sbin/init/ttys.aarch64 b/sbin/init/ttys.aarch64 index 7412f97fee0b..8a2376e799a1 100644 --- a/sbin/init/ttys.aarch64 +++ b/sbin/init/ttys.aarch64 @@ -41,9 +41,9 @@ ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure #ttyv8 "/usr/local/bin/xdm -nodaemon" xterm onifexists secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. -ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure # Dumb console dcons "/usr/libexec/getty std.9600" vt100 off secure diff --git a/sbin/init/ttys.arm b/sbin/init/ttys.arm index 8bbb4883fbd6..b0722e4522dd 100644 --- a/sbin/init/ttys.arm +++ b/sbin/init/ttys.arm @@ -41,9 +41,9 @@ ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure #ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. -ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure # Dumb console dcons "/usr/libexec/getty std.9600" vt100 off secure diff --git a/sbin/init/ttys.riscv b/sbin/init/ttys.riscv index f2c91229bed2..4e49b7a83bd8 100644 --- a/sbin/init/ttys.riscv +++ b/sbin/init/ttys.riscv @@ -41,11 +41,11 @@ ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure #ttyv8 "/usr/local/bin/xdm -nodaemon" xterm onifexists secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. -ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure # Dumb console dcons "/usr/libexec/getty std.9600" vt100 off secure # RISC-V HTIF console -rcons "/usr/libexec/getty std.9600" vt100 onifconsole secure +rcons "/usr/libexec/getty std.9600" vt100 onifconsole secure From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:09:19 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A6D4665CF9; Wed, 21 Jul 2021 16:09:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLB71J5fz3Kpl; Wed, 21 Jul 2021 16:09:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11D5E20AD0; Wed, 21 Jul 2021 16:09:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LG9JDu067498; Wed, 21 Jul 2021 16:09:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LG9JUJ067497; Wed, 21 Jul 2021 16:09:19 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:09:19 GMT Message-Id: <202107211609.16LG9JUJ067497@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: ddefb003ee20 - stable/13 - etc/ttys: merge ttys file down to single file MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ddefb003ee208fce2a3a64ed16fcb7c3c94952b8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:09:19 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=ddefb003ee208fce2a3a64ed16fcb7c3c94952b8 commit ddefb003ee208fce2a3a64ed16fcb7c3c94952b8 Author: Elliott Mitchell AuthorDate: 2021-05-13 06:58:00 +0000 Commit: Mitchell Horne CommitDate: 2021-07-21 16:05:01 +0000 etc/ttys: merge ttys file down to single file The tty lists were already pretty similar and there hadn't been any real need for them to remain distinct for some time. As such, merge to a single file. The RISC-V console is preserved. For systems where it doesn't exist, its presence in /etc/ttys is harmless. The uncommented version of the ttyv8/XDM line from ttys.amd64 was the one chosen. Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30256 (cherry picked from commit c76616f496ee7e6b0a4ed9444fad56418f137a5a) --- sbin/init/Makefile | 10 +-------- sbin/init/{ttys.riscv => ttys} | 2 +- sbin/init/ttys.aarch64 | 49 ------------------------------------------ sbin/init/ttys.amd64 | 49 ------------------------------------------ sbin/init/ttys.arm | 49 ------------------------------------------ sbin/init/ttys.i386 | 49 ------------------------------------------ sbin/init/ttys.mips | 36 ------------------------------- sbin/init/ttys.powerpc | 49 ------------------------------------------ 8 files changed, 2 insertions(+), 291 deletions(-) diff --git a/sbin/init/Makefile b/sbin/init/Makefile index 3c242617fe7a..3a914dc7acef 100644 --- a/sbin/init/Makefile +++ b/sbin/init/Makefile @@ -12,15 +12,7 @@ CFLAGS+=-DDEBUGSHELL -DSECURE -DLOGIN_CAP -DCOMPAT_SYSV_INIT LIBADD= util crypt CONFTTYSNAME= ttys -.if exists(${.CURDIR}/ttys.${MACHINE}) -CONFTTYS+= ttys.${MACHINE} -.elif exists(${.CURDIR}/ttys.${MACHINE_ARCH}) -CONFTTYS+= ttys.${MACHINE_ARCH} -.elif exists(${.CURDIR}/ttys.${MACHINE_CPUARCH}) -CONFTTYS+= ttys.${MACHINE_CPUARCH} -.else -.error MACHINE.ttys missing -.endif +CONFTTYS+= ttys # Needed for getmntopts.c MOUNT= ${SRCTOP}/sbin/mount diff --git a/sbin/init/ttys.riscv b/sbin/init/ttys similarity index 97% rename from sbin/init/ttys.riscv rename to sbin/init/ttys index 4e49b7a83bd8..4a5ee50dba59 100644 --- a/sbin/init/ttys.riscv +++ b/sbin/init/ttys @@ -38,7 +38,7 @@ ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure -#ttyv8 "/usr/local/bin/xdm -nodaemon" xterm onifexists secure +ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure diff --git a/sbin/init/ttys.aarch64 b/sbin/init/ttys.aarch64 deleted file mode 100644 index 8a2376e799a1..000000000000 --- a/sbin/init/ttys.aarch64 +++ /dev/null @@ -1,49 +0,0 @@ -# -# $FreeBSD$ -# @(#)ttys 5.1 (Berkeley) 4/17/89 -# -# This file specifies various information about terminals on the system. -# It is used by several different programs. Common entries for the -# various columns include: -# -# name The name of the terminal device. -# -# getty The program to start running on the terminal. Typically a -# getty program, as the name implies. Other common entries -# include none, when no getty is needed, and xdm, to start the -# X Window System. -# -# type The initial terminal type for this port. For hardwired -# terminal lines, this will contain the type of terminal used. -# For virtual consoles, the correct type is typically xterm. -# Other common values include dialup for incoming modem ports, and -# unknown when the terminal type cannot be predetermined. -# -# status Must be on or off. If on, init will run the getty program on -# the specified port. If the word "secure" appears, this tty -# allows root login. -# -# name getty type status comments -# -# If console is marked "insecure", then init will ask for the root password -# when going to single-user mode. -console none unknown off secure -# -ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure -# Virtual terminals -ttyv1 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv2 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv3 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure -#ttyv8 "/usr/local/bin/xdm -nodaemon" xterm onifexists secure -# Serial terminals -# The 'dialup' keyword identifies dialin lines to login, fingerd etc. -ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure -# Dumb console -dcons "/usr/libexec/getty std.9600" vt100 off secure diff --git a/sbin/init/ttys.amd64 b/sbin/init/ttys.amd64 deleted file mode 100644 index b8392780ac9a..000000000000 --- a/sbin/init/ttys.amd64 +++ /dev/null @@ -1,49 +0,0 @@ -# -# $FreeBSD$ -# @(#)ttys 5.1 (Berkeley) 4/17/89 -# -# This file specifies various information about terminals on the system. -# It is used by several different programs. Common entries for the -# various columns include: -# -# name The name of the terminal device. -# -# getty The program to start running on the terminal. Typically a -# getty program, as the name implies. Other common entries -# include none, when no getty is needed, and xdm, to start the -# X Window System. -# -# type The initial terminal type for this port. For hardwired -# terminal lines, this will contain the type of terminal used. -# For virtual consoles, the correct type is typically xterm. -# Other common values include dialup for incoming modem ports, and -# unknown when the terminal type cannot be predetermined. -# -# status Must be on or off. If on, init will run the getty program on -# the specified port. If the word "secure" appears, this tty -# allows root login. -# -# name getty type status comments -# -# If console is marked "insecure", then init will ask for the root password -# when going to single-user mode. -console none unknown off secure -# -ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure -# Virtual terminals -ttyv1 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv2 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv3 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure -# Serial terminals -# The 'dialup' keyword identifies dialin lines to login, fingerd etc. -ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure -# Dumb console -dcons "/usr/libexec/getty std.9600" vt100 off secure diff --git a/sbin/init/ttys.arm b/sbin/init/ttys.arm deleted file mode 100644 index b0722e4522dd..000000000000 --- a/sbin/init/ttys.arm +++ /dev/null @@ -1,49 +0,0 @@ -# -# $FreeBSD$ -# @(#)ttys 5.1 (Berkeley) 4/17/89 -# -# This file specifies various information about terminals on the system. -# It is used by several different programs. Common entries for the -# various columns include: -# -# name The name of the terminal device. -# -# getty The program to start running on the terminal. Typically a -# getty program, as the name implies. Other common entries -# include none, when no getty is needed, and xdm, to start the -# X Window System. -# -# type The initial terminal type for this port. For hardwired -# terminal lines, this will contain the type of terminal used. -# For virtual consoles, the correct type is typically xterm. -# Other common values include dialup for incoming modem ports, and -# unknown when the terminal type cannot be predetermined. -# -# status Must be on or off. If on, init will run the getty program on -# the specified port. If the word "secure" appears, this tty -# allows root login. -# -# name getty type status comments -# -# If console is marked "insecure", then init will ask for the root password -# when going to single-user mode. -console none unknown off secure -# -ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure -# Virtual terminals -ttyv1 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv2 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv3 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure -#ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure -# Serial terminals -# The 'dialup' keyword identifies dialin lines to login, fingerd etc. -ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure -# Dumb console -dcons "/usr/libexec/getty std.9600" vt100 off secure diff --git a/sbin/init/ttys.i386 b/sbin/init/ttys.i386 deleted file mode 100644 index b8392780ac9a..000000000000 --- a/sbin/init/ttys.i386 +++ /dev/null @@ -1,49 +0,0 @@ -# -# $FreeBSD$ -# @(#)ttys 5.1 (Berkeley) 4/17/89 -# -# This file specifies various information about terminals on the system. -# It is used by several different programs. Common entries for the -# various columns include: -# -# name The name of the terminal device. -# -# getty The program to start running on the terminal. Typically a -# getty program, as the name implies. Other common entries -# include none, when no getty is needed, and xdm, to start the -# X Window System. -# -# type The initial terminal type for this port. For hardwired -# terminal lines, this will contain the type of terminal used. -# For virtual consoles, the correct type is typically xterm. -# Other common values include dialup for incoming modem ports, and -# unknown when the terminal type cannot be predetermined. -# -# status Must be on or off. If on, init will run the getty program on -# the specified port. If the word "secure" appears, this tty -# allows root login. -# -# name getty type status comments -# -# If console is marked "insecure", then init will ask for the root password -# when going to single-user mode. -console none unknown off secure -# -ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure -# Virtual terminals -ttyv1 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv2 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv3 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure -# Serial terminals -# The 'dialup' keyword identifies dialin lines to login, fingerd etc. -ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure -# Dumb console -dcons "/usr/libexec/getty std.9600" vt100 off secure diff --git a/sbin/init/ttys.mips b/sbin/init/ttys.mips deleted file mode 100644 index 21bb9325f3bf..000000000000 --- a/sbin/init/ttys.mips +++ /dev/null @@ -1,36 +0,0 @@ -# -# $FreeBSD$ -# @(#)ttys 5.1 (Berkeley) 4/17/89 -# -# This file specifies various information about terminals on the system. -# It is used by several different programs. Common entries for the -# various columns include: -# -# name The name of the terminal device. -# -# getty The program to start running on the terminal. Typically a -# getty program, as the name implies. Other common entries -# include none, when no getty is needed, and xdm, to start the -# X Window System. -# -# type The initial terminal type for this port. For hardwired -# terminal lines, this will contain the type of terminal used. -# For virtual consoles, the correct type is typically xterm. -# Other common values include dialup for incoming modem ports, and -# unknown when the terminal type cannot be predetermined. -# -# status Must be on or off. If on, init will run the getty program on -# the specified port. If the word "secure" appears, this tty -# allows root login. -# -# name getty type status comments -# -# If console is marked "insecure", then init will ask for the root password -# when going to single-user mode. -console none unknown off secure -# Serial terminals -# The 'dialup' keyword identifies dialin lines to login, fingerd etc. -ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure diff --git a/sbin/init/ttys.powerpc b/sbin/init/ttys.powerpc deleted file mode 100644 index b0722e4522dd..000000000000 --- a/sbin/init/ttys.powerpc +++ /dev/null @@ -1,49 +0,0 @@ -# -# $FreeBSD$ -# @(#)ttys 5.1 (Berkeley) 4/17/89 -# -# This file specifies various information about terminals on the system. -# It is used by several different programs. Common entries for the -# various columns include: -# -# name The name of the terminal device. -# -# getty The program to start running on the terminal. Typically a -# getty program, as the name implies. Other common entries -# include none, when no getty is needed, and xdm, to start the -# X Window System. -# -# type The initial terminal type for this port. For hardwired -# terminal lines, this will contain the type of terminal used. -# For virtual consoles, the correct type is typically xterm. -# Other common values include dialup for incoming modem ports, and -# unknown when the terminal type cannot be predetermined. -# -# status Must be on or off. If on, init will run the getty program on -# the specified port. If the word "secure" appears, this tty -# allows root login. -# -# name getty type status comments -# -# If console is marked "insecure", then init will ask for the root password -# when going to single-user mode. -console none unknown off secure -# -ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure -# Virtual terminals -ttyv1 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv2 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv3 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure -ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure -#ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure -# Serial terminals -# The 'dialup' keyword identifies dialin lines to login, fingerd etc. -ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure -ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure -# Dumb console -dcons "/usr/libexec/getty std.9600" vt100 off secure From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:09:20 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6FA83666209; Wed, 21 Jul 2021 16:09:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLB82Jzcz3L0p; Wed, 21 Jul 2021 16:09:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35F7520FF7; Wed, 21 Jul 2021 16:09:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LG9KY8067522; Wed, 21 Jul 2021 16:09:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LG9KKd067521; Wed, 21 Jul 2021 16:09:20 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:09:20 GMT Message-Id: <202107211609.16LG9KKd067521@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 7ca3061f84e3 - stable/13 - etc/ttys: add xen console MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7ca3061f84e3d6ac4368d83251bf455df93d61a3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:09:20 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=7ca3061f84e3d6ac4368d83251bf455df93d61a3 commit 7ca3061f84e3d6ac4368d83251bf455df93d61a3 Author: Julien Grall AuthorDate: 2015-10-29 14:22:35 +0000 Commit: Mitchell Horne CommitDate: 2021-07-21 16:07:34 +0000 etc/ttys: add xen console Xen VMs get a simulated serial device meant for use as a console. Often an xterm or other advanced terminal is used, so use xterm as the type. Depending on configuration, FreeBSD on Xen for amd64 may instead use an emulated serial port, but the virtual console may also be available. Submitted by: Elliott Mitchell Reviewed by: imp (slightly earlier version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D29873 (cherry picked from commit 2b2c460d7bb856a069047583a55a60976cd375a4) --- sbin/init/ttys | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/init/ttys b/sbin/init/ttys index 4a5ee50dba59..a2f5b8975ecd 100644 --- a/sbin/init/ttys +++ b/sbin/init/ttys @@ -47,5 +47,7 @@ ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure # Dumb console dcons "/usr/libexec/getty std.9600" vt100 off secure +# Xen Virtual console +xc0 "/usr/libexec/getty Pc" xterm onifconsole secure # RISC-V HTIF console rcons "/usr/libexec/getty std.9600" vt100 onifconsole secure From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:14:03 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7FE42666414; Wed, 21 Jul 2021 16:14:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLHb3Bhmz3LtX; Wed, 21 Jul 2021 16:14:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 559FE20A78; Wed, 21 Jul 2021 16:14:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGE37a080355; Wed, 21 Jul 2021 16:14:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGE3C8080354; Wed, 21 Jul 2021 16:14:03 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:14:03 GMT Message-Id: <202107211614.16LGE3C8080354@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: c8b24162a4eb - stable/13 - Fix potential NULL pointer dereference of device physical path MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c8b24162a4eb20484d4add7710a33ef6387111f7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:14:03 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c8b24162a4eb20484d4add7710a33ef6387111f7 commit c8b24162a4eb20484d4add7710a33ef6387111f7 Author: Young Xiao <92siuyang@gmail.com> AuthorDate: 2019-05-21 07:36:29 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:13:10 +0000 Fix potential NULL pointer dereference of device physical path In ata_dev_advinfo() and nvme_dev_advinfo(), if the physical path is being stored and there is a malloc failure (malloc(9) is called with M_NOWAIT), we could wind up in a situation where the device's physpath_len is set to the length the user provided, but the physpath itself is NULL. If another context then comes in to fetch the physical path value, we would wind up trying to memcpy a NULL pointer into the caller's buffer. So, set the physpath_len to 0 when we free the physpath on entry into the store case for the physical path. Reset the length to a non-zero value only after we've successfully malloced a buffer to hold it. This code mirrors scsi_xpt.c does already as well. Signed-off-by: Young Xiao <92siuyang@gmail.com> Reviewed by: imp PR: 238014 (cherry picked from commit 431ddd94360a9e86c91294eaa2c7b859911984b7) --- sys/cam/ata/ata_xpt.c | 7 +++++-- sys/cam/nvme/nvme_xpt.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c index 559e9a234b87..a3be7470354f 100644 --- a/sys/cam/ata/ata_xpt.c +++ b/sys/cam/ata/ata_xpt.c @@ -1756,9 +1756,11 @@ ata_dev_advinfo(union ccb *start_ccb) break; case CDAI_TYPE_PHYS_PATH: if (cdai->flags & CDAI_FLAG_STORE) { - if (device->physpath != NULL) + if (device->physpath != NULL) { free(device->physpath, M_CAMXPT); - device->physpath_len = cdai->bufsiz; + device->physpath = NULL; + device->physpath_len = 0; + } /* Clear existing buffer if zero length */ if (cdai->bufsiz == 0) break; @@ -1767,6 +1769,7 @@ ata_dev_advinfo(union ccb *start_ccb) start_ccb->ccb_h.status = CAM_REQ_ABORTED; return; } + device->physpath_len = cdai->bufsiz; memcpy(device->physpath, cdai->buf, cdai->bufsiz); } else { cdai->provsiz = device->physpath_len; diff --git a/sys/cam/nvme/nvme_xpt.c b/sys/cam/nvme/nvme_xpt.c index 126b284936bb..800d6aeb291e 100644 --- a/sys/cam/nvme/nvme_xpt.c +++ b/sys/cam/nvme/nvme_xpt.c @@ -682,9 +682,11 @@ nvme_dev_advinfo(union ccb *start_ccb) break; case CDAI_TYPE_PHYS_PATH: if (cdai->flags & CDAI_FLAG_STORE) { - if (device->physpath != NULL) + if (device->physpath != NULL) { free(device->physpath, M_CAMXPT); - device->physpath_len = cdai->bufsiz; + device->physpath = NULL; + device->physpath_len = 0; + } /* Clear existing buffer if zero length */ if (cdai->bufsiz == 0) break; @@ -693,6 +695,7 @@ nvme_dev_advinfo(union ccb *start_ccb) start_ccb->ccb_h.status = CAM_REQ_ABORTED; return; } + device->physpath_len = cdai->bufsiz; memcpy(device->physpath, cdai->buf, cdai->bufsiz); } else { cdai->provsiz = device->physpath_len; From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:14:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 43BC5666702; Wed, 21 Jul 2021 16:14:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLHc5ZMwz3Lyl; Wed, 21 Jul 2021 16:14:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89E5A21127; Wed, 21 Jul 2021 16:14:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGE4rm080379; Wed, 21 Jul 2021 16:14:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGE4S4080378; Wed, 21 Jul 2021 16:14:04 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:14:04 GMT Message-Id: <202107211614.16LGE4S4080378@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: f5736727df5a - stable/13 - cam_iosched: use tunable flag and make a bool really a bool MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f5736727df5ae6a55ceb0c76cb8f4e0990eb7197 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:14:05 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f5736727df5ae6a55ceb0c76cb8f4e0990eb7197 commit f5736727df5ae6a55ceb0c76cb8f4e0990eb7197 Author: Warner Losh AuthorDate: 2021-07-13 06:00:33 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:13:10 +0000 cam_iosched: use tunable flag and make a bool really a bool kern.cam.do_dynamic_iosched is really a bool, so change its type to bool. While I'm here, also use the CTLFLAG_TUN flag instead of a separate tunable line for it and kern.cam.iosched_alpha_bits. MFC After: 1 week Sponsored by: Netflix (cherry picked from commit a065ccb2804fae834a7c66e29b726ea3dbbceace) --- sys/cam/cam_iosched.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/cam/cam_iosched.c b/sys/cam/cam_iosched.c index ba1bc4843163..218b52687f42 100644 --- a/sys/cam/cam_iosched.c +++ b/sys/cam/cam_iosched.c @@ -70,9 +70,8 @@ static MALLOC_DEFINE(M_CAMSCHED, "CAM I/O Scheduler", #ifdef CAM_IOSCHED_DYNAMIC -static int do_dynamic_iosched = 1; -TUNABLE_INT("kern.cam.do_dynamic_iosched", &do_dynamic_iosched); -SYSCTL_INT(_kern_cam, OID_AUTO, do_dynamic_iosched, CTLFLAG_RD, +static bool do_dynamic_iosched = 1; +SYSCTL_BOOL(_kern_cam, OID_AUTO, do_dynamic_iosched, CTLFLAG_RD | CTLFLAG_TUN, &do_dynamic_iosched, 1, "Enable Dynamic I/O scheduler optimizations."); @@ -97,8 +96,7 @@ SYSCTL_INT(_kern_cam, OID_AUTO, do_dynamic_iosched, CTLFLAG_RD, * Note: See computation of EMA and EMVAR for acceptable ranges of alpha. */ static int alpha_bits = 9; -TUNABLE_INT("kern.cam.iosched_alpha_bits", &alpha_bits); -SYSCTL_INT(_kern_cam, OID_AUTO, iosched_alpha_bits, CTLFLAG_RW, +SYSCTL_INT(_kern_cam, OID_AUTO, iosched_alpha_bits, CTLFLAG_RW | CTLFLAG_TUN, &alpha_bits, 1, "Bits in EMA's alpha."); From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:14:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5FFC566649B; Wed, 21 Jul 2021 16:14:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLHg18H0z3Lyr; Wed, 21 Jul 2021 16:14:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4986211BC; Wed, 21 Jul 2021 16:14:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGE6GJ080429; Wed, 21 Jul 2021 16:14:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGE6Qm080428; Wed, 21 Jul 2021 16:14:06 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:14:06 GMT Message-Id: <202107211614.16LGE6Qm080428@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 48d6f8f13a30 - stable/13 - Remove incorrect __restricted labels from strcspn MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 48d6f8f13a30c8642377dcad6e61a496b36cc186 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:14:07 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=48d6f8f13a30c8642377dcad6e61a496b36cc186 commit 48d6f8f13a30c8642377dcad6e61a496b36cc186 Author: Alfonso Gregory AuthorDate: 2021-07-14 21:48:35 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:13:10 +0000 Remove incorrect __restricted labels from strcspn strcspn should never have had the __restrict keywords. While both of these strings are const, it may have unindended side effects. While this is the kernel, the POSIX definition also omits restrict. Reviewed by: imp@ Pull Request: https://github.com/freebsd/freebsd-src/pull/497 (cherry picked from commit 56d33e86b74b197a36f42255824b56715c96a596) --- sys/libkern/strcspn.c | 2 +- sys/sys/libkern.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/libkern/strcspn.c b/sys/libkern/strcspn.c index fce6d4b8b071..62bfcf78eeb7 100644 --- a/sys/libkern/strcspn.c +++ b/sys/libkern/strcspn.c @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #define BIT(c) ((u_long)1 << ((u_char)(c) % LONG_BIT)) size_t -strcspn(const char * __restrict s, const char * __restrict charset) +strcspn(const char *s, const char *charset) { /* * NB: idx and bit are temporaries whose use causes gcc 3.4.2 to diff --git a/sys/sys/libkern.h b/sys/sys/libkern.h index 0c3489d4c206..8517c0dab1f6 100644 --- a/sys/sys/libkern.h +++ b/sys/sys/libkern.h @@ -174,8 +174,8 @@ char *strchr(const char *, int); char *strchrnul(const char *, int); int strcmp(const char *, const char *); char *strcpy(char * __restrict, const char * __restrict); -size_t strcspn(const char * __restrict, const char * __restrict) __pure; char *strdup_flags(const char *__restrict, struct malloc_type *, int); +size_t strcspn(const char *, const char *) __pure; char *strdup(const char *__restrict, struct malloc_type *); char *strncat(char *, const char *, size_t); char *strndup(const char *__restrict, size_t, struct malloc_type *); From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:14:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C14BD666704; Wed, 21 Jul 2021 16:14:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLHd4qXzz3LrN; Wed, 21 Jul 2021 16:14:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8793F21387; Wed, 21 Jul 2021 16:14:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGE5Qu080403; Wed, 21 Jul 2021 16:14:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGE5uE080402; Wed, 21 Jul 2021 16:14:05 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:14:05 GMT Message-Id: <202107211614.16LGE5uE080402@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: b0b483b64be8 - stable/13 - Fix pmbr issues > 2TB MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b0b483b64be8533c8113500850ae8de2d127a98d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:14:05 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b0b483b64be8533c8113500850ae8de2d127a98d commit b0b483b64be8533c8113500850ae8de2d127a98d Author: Emrion AuthorDate: 2021-07-13 20:37:59 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:13:10 +0000 Fix pmbr issues > 2TB These issues have low impact because they require precise circumstances to trigger one of them. The disk must be > 2 TiB in size and either: - The primary GPT header is dammaged. - The freebsd-boot partiton is located farther than the first 2 TiB of the disc and one of its sectors takes place at a lba value that makes the higher 32 bits of this very value change. Errors and corrections folow: - decl and incl don't affect CF, so replace with subl/addl $1 - repe uses %cx, so move size to it with movw - moving a 64-bit value with %cx of 2 (should be 4) so addresses > 2TB will work. PR: 233180 Reviewed by: imp@ (applied patch using description in bug) Differential Revision: https://reviews.freebsd.org/D31100 (cherry picked from commit 0ca9f1d4a3b772036309fb1c14262ec77c674c5d) --- stand/i386/pmbr/pmbr.S | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/stand/i386/pmbr/pmbr.S b/stand/i386/pmbr/pmbr.S index 1a758812edd3..c394835757af 100644 --- a/stand/i386/pmbr/pmbr.S +++ b/stand/i386/pmbr/pmbr.S @@ -114,8 +114,9 @@ main.2b: cmpb $1,%dh # Reading primary? main.3: movb $0,%dh # %dh := 0 (reading backup) movw $DPBUF+DPBUF_SEC,%si # %si = last sector + 1 movw $lba,%di # %di = $lba -main.3a: decl (%si) # 0x0(%si) = last sec (0-31) - movw $2,%cx +main.3a: subl $1, (%si) # 0x0(%si) = last sec (0-31) + sbbl $0, 4(%si) + movw $4,%cx rep movsw # $lastsec--, copy it to $lba jmp main.2a # Read the next sector @@ -128,7 +129,7 @@ load_part: movw $GPT_ADDR+GPT_PART_LBA,%si call read scan: movw %bx,%si # Compare partition UUID movw $boot_uuid,%di # with FreeBSD boot UUID - movb $0x10,%cl + movw $0x10,%cx repe cmpsb jnz next_part # Didn't match, next partition # @@ -150,7 +151,7 @@ load_boot: push %si # Save %si jnz next_boot mov %bx,%es # Reset %es to zero jmp LOAD # Jump to boot code -next_boot: incl (%si) # Next LBA +next_boot: addl $1,(%si) # Next LBA adcl $0,4(%si) mov %es,%ax # Adjust segment for next addw $SECSIZE/16,%ax # sector @@ -171,7 +172,7 @@ next_part: decl GPT_ADDR+GPT_NPART # Was this the last partition? addw %ax,%bx # Next partition cmpw $PART_ADDR+0x200,%bx # Still in sector? jb scan - incl GPT_ADDR+GPT_PART_LBA # Next sector + addl $1, GPT_ADDR+GPT_PART_LBA # Next sector adcl $0,GPT_ADDR+GPT_PART_LBA+4 jmp load_part # From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:14:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C22DD666719; Wed, 21 Jul 2021 16:14:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLHj1hCLz3Lwq; Wed, 21 Jul 2021 16:14:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8F8B20AED; Wed, 21 Jul 2021 16:14:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGE82G080484; Wed, 21 Jul 2021 16:14:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGE8qB080483; Wed, 21 Jul 2021 16:14:08 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:14:08 GMT Message-Id: <202107211614.16LGE8qB080483@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 50b2e5d608d2 - stable/13 - nanobsd: Use gpart and create code image before full disk image MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 50b2e5d608d2d8876af2a8d4e5c4e60867f9ad96 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:14:09 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=50b2e5d608d2d8876af2a8d4e5c4e60867f9ad96 commit 50b2e5d608d2d8876af2a8d4e5c4e60867f9ad96 Author: Arrigo Marchiori AuthorDate: 2021-07-15 22:06:51 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:13:11 +0000 nanobsd: Use gpart and create code image before full disk image The attached patch brings two main changes to the nanobsd script: 1- gpart is used instead of fdisk; 2- the code image is created first, and then used to ``assemble'' the full disk image. The patch was first proposed on the freebsd-embedded list: http://lists.freebsd.org/pipermail/freebsd-embedded/2012-June/001580.html and is currently under discussion: http://lists.freebsd.org/pipermail/freebsd-embedded/2014-January/002216.html Another effect is that the -f option ("suppress code slice extraction") now imples the -i option ("suppress disk image build"). imp@ applied Patch by hand to new legacy.sh, plus tweaked for NANO_LOG vs NANO_OBJ confusion in original. PR: 186030 Reviewed by: imp@ Differential Revision: https://reviews.freebsd.org/D31102 (cherry picked from commit 587c054bea0f652fdbd86baf5807f21c904ac2ad) --- tools/tools/nanobsd/defaults.sh | 4 +- tools/tools/nanobsd/legacy.sh | 132 ++++++++++++++++++++++++++-------------- tools/tools/nanobsd/nanobsd.sh | 17 ++++-- 3 files changed, 103 insertions(+), 50 deletions(-) diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index 1ebc88fecac3..7bc74c42170e 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -161,6 +161,8 @@ NANO_SLICE_ROOT=s1 NANO_SLICE_ALTROOT=s2 NANO_SLICE_CFG=s3 NANO_SLICE_DATA=s4 +NANO_PARTITION_ROOT=a +NANO_PARTITION_ALTROOT=a NANO_ROOT=s1a NANO_ALTROOT=s2a @@ -853,7 +855,7 @@ usage ( ) { echo "Usage: $0 [-bfhiKknqvwX] [-c config_file]" echo " -b suppress builds (both kernel and world)" echo " -c specify config file" - echo " -f suppress code slice extraction" + echo " -f suppress code slice extraction (implies -i)" echo " -h print this help summary page" echo " -i suppress disk image build" echo " -K suppress installkernel" diff --git a/tools/tools/nanobsd/legacy.sh b/tools/tools/nanobsd/legacy.sh index b59a9e795b66..0a966c8c127e 100644 --- a/tools/tools/nanobsd/legacy.sh +++ b/tools/tools/nanobsd/legacy.sh @@ -35,30 +35,18 @@ # Functions and variable definitions used by the legacy nanobsd # image building system. -create_diskimage ( ) ( - pprint 2 "build diskimage" - pprint 3 "log: ${NANO_LOG}/_.di" - - ( +calculate_partitioning ( ) ( echo $NANO_MEDIASIZE $NANO_IMAGES \ $NANO_SECTS $NANO_HEADS \ $NANO_CODESIZE $NANO_CONFSIZE $NANO_DATASIZE | awk ' { - printf "# %s\n", $0 - # size of cylinder in sectors cs = $3 * $4 # number of full cylinders on media cyl = int ($1 / cs) - # output fdisk geometry spec, truncate cyls to 1023 - if (cyl <= 1023) - print "g c" cyl " h" $4 " s" $3 - else - print "g c" 1023 " h" $4 " s" $3 - if ($7 > 0) { # size of data partition in full cylinders dsl = int (($7 + cs - 1) / cs) @@ -69,44 +57,100 @@ create_diskimage ( ) ( # size of config partition in full cylinders csl = int (($6 + cs - 1) / cs) + # size of image partition(s) in full cylinders if ($5 == 0) { - # size of image partition(s) in full cylinders isl = int ((cyl - dsl - csl) / $2) } else { isl = int (($5 + cs - 1) / cs) } # First image partition start at second track - print "p 1 165 " $3, isl * cs - $3 + print $3, isl * cs - $3 c = isl * cs; # Second image partition (if any) also starts offset one # track to keep them identical. if ($2 > 1) { - print "p 2 165 " $3 + c, isl * cs - $3 + print $3 + c, isl * cs - $3 c += isl * cs; } # Config partition starts at cylinder boundary. - print "p 3 165 " c, csl * cs + print c, csl * cs c += csl * cs # Data partition (if any) starts at cylinder boundary. if ($7 > 0) { - print "p 4 165 " c, dsl * cs + print c, dsl * cs } else if ($7 < 0 && $1 > c) { - print "p 4 165 " c, $1 - c + print c, $1 - c } else if ($1 < c) { print "Disk space overcommitted by", \ c - $1, "sectors" > "/dev/stderr" exit 2 } - # Force slice 1 to be marked active. This is necessary - # for booting the image from a USB device to work. - print "a 1" } - ' > ${NANO_LOG}/_.fdisk + ' > ${NANO_LOG}/_.partitioning +) + +create_code_slice ( ) ( + pprint 2 "build code slice" + pprint 3 "log: ${NANO_OBJ}/_.cs" + + ( + IMG=${NANO_DISKIMGDIR}/_.disk.image + MNT=${NANO_OBJ}/_.mnt + mkdir -p ${MNT} + CODE_SIZE=`head -n 1 ${NANO_LOG}/_.partitioning | awk '{ print $2 }'` + + if [ "${NANO_MD_BACKING}" = "swap" ] ; then + MD=`mdconfig -a -t swap -s ${CODE_SIZE} -x ${NANO_SECTS} \ + -y ${NANO_HEADS}` + else + echo "Creating md backing file..." + rm -f ${IMG} + dd if=/dev/zero of=${IMG} seek=${CODE_SIZE} count=0 + MD=`mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} \ + -y ${NANO_HEADS}` + fi + + trap "echo 'Running exit trap code' ; df -i ${MNT} ; umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT + + bsdlabel -w ${MD} + if [ -f ${NANO_WORLDDIR}/boot/boot ]; then + echo "Making bootable partition" + gpart bootcode -b ${NANO_WORLDDIR}/boot/boot ${MD} + else + echo "Partition will not be bootable" + fi + bsdlabel ${MD} + + # Create first image + populate_slice /dev/${MD}${NANO_PARTITION_ROOT} ${NANO_WORLDDIR} ${MNT} "${NANO_ROOT}" + mount /dev/${MD}a ${MNT} + echo "Generating mtree..." + ( cd ${MNT} && mtree -c ) > ${NANO_OBJ}/_.mtree + ( cd ${MNT} && du -k ) > ${NANO_OBJ}/_.du + nano_umount ${MNT} + + if [ "${NANO_MD_BACKING}" = "swap" ] ; then + echo "Writing out _.disk.image..." + dd conv=sparse if=/dev/${MD} of=${NANO_DISKIMGDIR}/_.disk.image bs=64k + fi + mdconfig -d -u $MD + + trap - 1 2 15 EXIT + + ) > ${NANO_OBJ}/_.cs 2>&1 +) + + +create_diskimage ( ) ( + pprint 2 "build diskimage" + pprint 3 "log: ${NANO_OBJ}/_.di" + + ( IMG=${NANO_DISKIMGDIR}/${NANO_IMGNAME} MNT=${NANO_OBJ}/_.mnt @@ -123,29 +167,34 @@ create_diskimage ( ) ( -y ${NANO_HEADS}` fi + awk ' + BEGIN { + # Create MBR partition table + print "gpart create -s mbr $1" + } + { + # Make partition + print "gpart add -t freebsd -b ", $1, " -s ", $2, " $1" + } + END { + # Force slice 1 to be marked active. This is necessary + # for booting the image from a USB device to work. + print "gpart set -a active -i 1 $1" + } + ' ${NANO_LOG}/_.partitioning > ${NANO_OBJ}/_.gpart + trap "echo 'Running exit trap code' ; df -i ${MNT} ; nano_umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT - fdisk -i -f ${NANO_LOG}/_.fdisk ${MD} - fdisk ${MD} + sh ${NANO_OBJ}/_.gpart ${MD} + gpart show ${MD} # XXX: params # XXX: pick up cached boot* files, they may not be in image anymore. if [ -f ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ]; then - boot0cfg -B -b ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ${NANO_BOOT0CFG} ${MD} - fi - if [ -f ${NANO_WORLDDIR}/boot/boot ]; then - bsdlabel -w -B -b ${NANO_WORLDDIR}/boot/boot ${MD}${NANO_SLICE_ROOT} - else - bsdlabel -w ${MD}${NANO_SLICE_ROOT} + gpart bootcode -b ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ${NANO_BOOTFLAGS} ${MD} fi - bsdlabel ${MD}${NANO_SLICE_ROOT} - # Create first image - populate_slice /dev/${MD}${NANO_ROOT} ${NANO_WORLDDIR} ${MNT} "${NANO_ROOT}" - mount /dev/${MD}${NANO_ROOT} ${MNT} - echo "Generating mtree..." - ( cd "${MNT}" && mtree -c ) > ${NANO_LOG}/_.mtree - ( cd "${MNT}" && du -k ) > ${NANO_LOG}/_.du - nano_umount "${MNT}" + echo "Writing code image..." + dd conv=sparse if=${NANO_DISKIMGDIR}/_.disk.image of=/dev/${MD}${NANO_SLICE_ROOT} bs=64k if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then # Duplicate to second image (if present) @@ -190,11 +239,6 @@ create_diskimage ( ) ( dd conv=sparse if=/dev/${MD} of=${IMG} bs=64k fi - if ${do_copyout_partition} ; then - echo "Writing out ${NANO_IMG1NAME}..." - dd conv=sparse if=/dev/${MD}${NANO_SLICE_ROOT} \ - of=${NANO_DISKIMGDIR}/${NANO_IMG1NAME} bs=64k - fi mdconfig -d -u $MD trap - 1 2 15 EXIT diff --git a/tools/tools/nanobsd/nanobsd.sh b/tools/tools/nanobsd/nanobsd.sh index 89d0bed60b7a..c5c680025fc7 100755 --- a/tools/tools/nanobsd/nanobsd.sh +++ b/tools/tools/nanobsd/nanobsd.sh @@ -40,9 +40,9 @@ do_clean=true do_kernel=true do_installkernel=true do_world=true +do_code=true do_installworld=true do_image=true -do_copyout_partition=true do_native_xtools=false do_prep_image=true @@ -94,7 +94,8 @@ do shift ;; -f) - do_copyout_partition=false + do_code=false + do_image=false shift ;; -h) @@ -215,10 +216,16 @@ if $do_prep_image ; then else pprint 2 "Skipping image prep (as instructed)" fi -if $do_image ; then - create_diskimage +if $do_code ; then + calculate_partitioning + create_code_slice + if $do_image ; then + create_diskimage + else + pprint 2 "Skipping image build (as instructed)" + fi else - pprint 2 "Skipping image build (as instructed)" + pprint 2 "Skipping code and image build (as instructed)" fi last_orders From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:14:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D8BB06664A1; Wed, 21 Jul 2021 16:14:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLHk3mdnz3LvB; Wed, 21 Jul 2021 16:14:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1640220A79; Wed, 21 Jul 2021 16:14:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGEA71080508; Wed, 21 Jul 2021 16:14:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGE958080507; Wed, 21 Jul 2021 16:14:09 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:14:09 GMT Message-Id: <202107211614.16LGE958080507@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 54ff80e07f3a - stable/13 - nanobsd: default to -j $hw.ncpu MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 54ff80e07f3a313b810fb5ea79857f93ec80fcab Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:14:11 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=54ff80e07f3a313b810fb5ea79857f93ec80fcab commit 54ff80e07f3a313b810fb5ea79857f93ec80fcab Author: Warner Losh AuthorDate: 2021-07-15 22:07:51 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:13:11 +0000 nanobsd: default to -j $hw.ncpu For paralllel builds, default to using all the CPUs on the system. The old default of -j 3 was too few. Sponsored by: Netflix (cherry picked from commit 7e3a794be3752d21fe760cfb2a38665532c4b6b4) --- tools/tools/nanobsd/defaults.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index 7bc74c42170e..77c0e216ec80 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -67,7 +67,8 @@ NANO_PKG_META_BASE=/var/db # Make & parallel Make NANO_MAKE="make" -NANO_PMAKE="make -j 3" +NANO_NCPU=$(sysctl -n hw.ncpu) +NANO_PMAKE="make -j $NANO_NCPU" # The default name for any image we create. NANO_IMGNAME="_.disk.full" @@ -920,6 +921,7 @@ set_defaults_and_export ( ) { export_var NANO_MAKE_CONF_INSTALL export_var NANO_MEDIASIZE export_var NANO_NAME + export_var NANO_NCPU export_var NANO_NEWFS export_var NANO_OBJ export_var NANO_PMAKE From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:14:12 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 400146666AA; Wed, 21 Jul 2021 16:14:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLHl2fpSz3Lch; Wed, 21 Jul 2021 16:14:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C46021388; Wed, 21 Jul 2021 16:14:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGEBj0080532; Wed, 21 Jul 2021 16:14:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGEBku080531; Wed, 21 Jul 2021 16:14:11 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:14:11 GMT Message-Id: <202107211614.16LGEBku080531@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: b78807daaae2 - stable/13 - pcengines: Fix kernel config MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b78807daaae223bdb2ce45227fa71cc5dacaa0db Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:14:12 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b78807daaae223bdb2ce45227fa71cc5dacaa0db commit b78807daaae223bdb2ce45227fa71cc5dacaa0db Author: Warner Losh AuthorDate: 2021-07-15 22:11:11 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:13:11 +0000 pcengines: Fix kernel config Update the old ALIX config to remove devices, add iflib and remove trailing white space. Sponsored by: Netflix (cherry picked from commit e44c62068170987e37ed2d8dea6a035fdc691fc2) --- tools/tools/nanobsd/pcengines/ALIX_DSK | 127 +++++++++++++++--------------- tools/tools/nanobsd/pcengines/common.conf | 3 +- 2 files changed, 65 insertions(+), 65 deletions(-) diff --git a/tools/tools/nanobsd/pcengines/ALIX_DSK b/tools/tools/nanobsd/pcengines/ALIX_DSK index e11f7de4f2f4..f82bbfbd85d8 100644 --- a/tools/tools/nanobsd/pcengines/ALIX_DSK +++ b/tools/tools/nanobsd/pcengines/ALIX_DSK @@ -4,83 +4,84 @@ cpu I586_CPU ident ALIX_DSK -makeoptions DEBUG=-g +makeoptions DEBUG=-g options CPU_GEODE -options SCHED_ULE -options PREEMPTION -options INET -options INET6 -options FFS -options SOFTUPDATES -options UFS_ACL -options UFS_DIRHASH +options SCHED_ULE +options PREEMPTION +options INET +options INET6 +options FFS +options SOFTUPDATES +options UFS_ACL +options UFS_DIRHASH options NFSCL # Network Filesystem Client -options NFSLOCKD -options MSDOSFS -options CD9660 -options PROCFS -options PSEUDOFS -options GEOM_PART_GPT -options GEOM_LABEL -options COMPAT_43TTY +options NFSLOCKD +options MSDOSFS +options CD9660 +options PROCFS +options PSEUDOFS +options GEOM_PART_GPT +options GEOM_LABEL +options COMPAT_43TTY options COMPAT_FREEBSD4 # Compatible with FreeBSD4 options COMPAT_FREEBSD5 # Compatible with FreeBSD5 options COMPAT_FREEBSD6 # Compatible with FreeBSD6 options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 -options SCSI_DELAY=5000 -options SYSVSHM -options SYSVMSG -options SYSVSEM -options P1003_1B_SEMAPHORES +options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 +options SCSI_DELAY=5000 +options SYSVSHM +options SYSVMSG +options SYSVSEM +options P1003_1B_SEMAPHORES options _KPOSIX_PRIORITY_SCHEDULING -options PRINTF_BUFR_SIZE=128 -device apic +options PRINTF_BUFR_SIZE=128 +device apic device cpufreq device acpi device pci device fdc device ata -options ATA_STATIC_ID -device scbus -device da -device sa -device cd -device pass -device uart -device em -device miibus -device vr -device wlan -options IEEE80211_DEBUG -options IEEE80211_SUPPORT_MESH -device wlan_wep -device wlan_ccmp -device wlan_tkip -device wlan_amrr -device an -device ath -device ath_hal -device ath_rate_sample -device wi -device loop -device ether -device tun -device pty -device md -device gif -device firmware -device bpf -device uhci -device ohci -device ehci -device usb -device ulpt -device umass -device u3g -device ubsa -device uftdi +options ATA_STATIC_ID +device scbus +device da +device sa +device cd +device pass +device uart +device iflib +device em +device miibus +device vr +device wlan +options IEEE80211_DEBUG +options IEEE80211_SUPPORT_MESH +device wlan_wep +device wlan_ccmp +device wlan_tkip +device wlan_amrr +device ath +device ath_hal +device ath_rate_sample +device loop +device ether +device tuntap +device pty +device md +device gif +device firmware +device bpf +device uhci +device ohci +device ehci +device usb +device ulpt +device umass +device u3g +device ubsa +device uftdi options INCLUDE_CONFIG_FILE diff --git a/tools/tools/nanobsd/pcengines/common.conf b/tools/tools/nanobsd/pcengines/common.conf index 8cd870b2dd7d..632ace1841cc 100644 --- a/tools/tools/nanobsd/pcengines/common.conf +++ b/tools/tools/nanobsd/pcengines/common.conf @@ -4,13 +4,12 @@ NANO_SRC=$(pwd) NANO_SRC=${NANO_SRC%/tools/tools/nanobsd/pcengines} -NANO_OBJ=${NANO_SRC}/../${NANO_NAME}/obj +NANO_OBJ=${NANO_SRC}/../nanobsd-builds/${NANO_NAME}/obj NANO_TOOLS=$(pwd) NANO_PACKAGE_DIR=$(pwd)/Pkg #NANO_RAM_TMPVARSIZE=20480 #NANO_RAM_TMPVARSIZE=30720 NANO_RAM_TMPVARSIZE=40960 -NANO_PMAKE="make -j 8" NANO_MD_BACKING="swap" From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:14:16 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD13F6664BA; Wed, 21 Jul 2021 16:14:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLHr0JZbz3Ls7; Wed, 21 Jul 2021 16:14:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4D70211BD; Wed, 21 Jul 2021 16:14:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGEFpb080636; Wed, 21 Jul 2021 16:14:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGEFPC080635; Wed, 21 Jul 2021 16:14:15 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:14:15 GMT Message-Id: <202107211614.16LGEFPC080635@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 6af8350df682 - stable/13 - cam: Mark the qos data is valid in xpd_done_direct() too. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6af8350df68206be18bc1ebee5e461ca20fb523e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:14:17 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6af8350df68206be18bc1ebee5e461ca20fb523e commit 6af8350df68206be18bc1ebee5e461ca20fb523e Author: Warner Losh AuthorDate: 2021-07-17 22:10:46 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:13:12 +0000 cam: Mark the qos data is valid in xpd_done_direct() too. Sponsored by: Netflix (cherry picked from commit abea0c6b0ddc969d1f3b9cab1fd90df00de1f2e4) --- sys/cam/cam_xpt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 9cfee80a6049..ba01e741c5a7 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -4648,6 +4648,7 @@ xpt_done_direct(union ccb *done_ccb) /* Store the time the ccb was in the sim */ done_ccb->ccb_h.qos.periph_data = cam_iosched_delta_t(done_ccb->ccb_h.qos.periph_data); + done_ccb->ccb_h.status |= CAM_QOS_VALID; xpt_done_process(&done_ccb->ccb_h); } From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:14:13 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B723C666720; Wed, 21 Jul 2021 16:14:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLHm5WV3z3Lrt; Wed, 21 Jul 2021 16:14:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48E5B20AEE; Wed, 21 Jul 2021 16:14:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGECWg080556; Wed, 21 Jul 2021 16:14:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGECv6080555; Wed, 21 Jul 2021 16:14:12 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:14:12 GMT Message-Id: <202107211614.16LGECv6080555@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 1f5bcd0b4716 - stable/13 - nanobsd: Bump rescue size to 8GB MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1f5bcd0b4716c0fbf0ba6ba558129aa28699f8a9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:14:14 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1f5bcd0b4716c0fbf0ba6ba558129aa28699f8a9 commit 1f5bcd0b4716c0fbf0ba6ba558129aa28699f8a9 Author: Warner Losh AuthorDate: 2021-07-15 22:11:15 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:13:11 +0000 nanobsd: Bump rescue size to 8GB Bump the rescue size from 1.2GB to just shy of 8GB as things have grown somewhat. Also make it possible to build rescue somewhere other than /usr/src. Sponsored by: Netflix (cherry picked from commit 998abf5a1274609f9b74b3301dc0dabe659bd36b) --- tools/tools/nanobsd/rescue/common | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/tools/nanobsd/rescue/common b/tools/tools/nanobsd/rescue/common index d2a8a6de9e91..d14ad8b5af2b 100644 --- a/tools/tools/nanobsd/rescue/common +++ b/tools/tools/nanobsd/rescue/common @@ -1,15 +1,17 @@ # # $FreeBSD$ # +NANO_SRC=$(pwd) +NANO_SRC=${NANO_SRC%/tools/tools/nanobsd/rescue} +NANO_OBJ=${NANO_SRC}/../nanobsd-builds/${NANO_NAME}/obj NANO_TOOLS=`pwd` NANO_PACKAGE_DIR=`pwd`/Pkg NANO_RAM_TMPVARSIZE=40960 NANO_PMAKE="make -j 8" NANO_LABEL="rescue" NANO_RAM_TMPVARSIZE=40960 -#NANO_MEDIASIZE="8027712" -#NANO_MEDIASIZE="2097152" -NANO_MEDIASIZE="3932160" +#NANO_MEDIASIZE="3932160" +NANO_MEDIASIZE="16384000" NANO_SECTS="63" NANO_HEADS="16" NANO_IMAGES="2" @@ -19,7 +21,7 @@ NANO_DRIVE=da0 #NANO_MODULES= NANO_BOOTLOADER="boot/boot0" NANO_BOOT2CFG="" -NANO_MD_BACKING=swap +NANO_MD_BACKING=file # Options to put in make.conf during buildworld only CONF_BUILD=' From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:14:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E3FD66637E; Wed, 21 Jul 2021 16:14:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLHh0ppkz3M4q; Wed, 21 Jul 2021 16:14:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CBBD721357; Wed, 21 Jul 2021 16:14:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGE7jh080457; Wed, 21 Jul 2021 16:14:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGE7Cu080456; Wed, 21 Jul 2021 16:14:07 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:14:07 GMT Message-Id: <202107211614.16LGE7Cu080456@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 5ad4296780de - stable/13 - loader: make sure CPUTYPE is ignored when building MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5ad4296780ded135e8cd48a3877b52c4a7f4cb1d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:14:08 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5ad4296780ded135e8cd48a3877b52c4a7f4cb1d commit 5ad4296780ded135e8cd48a3877b52c4a7f4cb1d Author: Warner Losh AuthorDate: 2021-07-15 03:06:08 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:13:10 +0000 loader: make sure CPUTYPE is ignored when building CPUTYPE?=native causes -march=native to be added to the command line. When the host machine is haswell, this causes some versions of clang to generate code that can't execute in the efi boot loader environment. Set _CPUCFLAGS= to undo what's done bsd.cpu.mk. bsd.cpu.mk is included too early to control with NO_CPU_CFLAGS here. The only other option is to put that in all the Makefiles, and this is less tedious and error prone. PR: 194641 Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31187 MFC After: 1 week (cherry picked from commit 7a0c0ff7ee25ff1efa3dbedcb20d2c80178639cc) --- stand/defs.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stand/defs.mk b/stand/defs.mk index 54b7a7250c48..d50c89879613 100644 --- a/stand/defs.mk +++ b/stand/defs.mk @@ -15,6 +15,14 @@ MAN= NO_PIC= INTERNALLIB= .endif +# Should be NO_CPU_FLAGS, but bsd.cpu.mk is included too early in bsd.init.mk +# via the early include of bsd.opts.mk. Moving Makefile.inc include earlier in +# that file causes weirdness, so this is the next best thing. We need to do this +# because the loader needs very specific flags to work right, and things like +# CPUTYPE?=native prevent that, and introduce an endless game of whack-a-mole +# to disable more and more features. Boot loader performance is never improved +# enough to make that hassle worth chasing. +_CPUCFLAGS= .include .include From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:14:16 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 051FC666808; Wed, 21 Jul 2021 16:14:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLHq1FlDz3LxD; Wed, 21 Jul 2021 16:14:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9744F21235; Wed, 21 Jul 2021 16:14:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGEE4O080612; Wed, 21 Jul 2021 16:14:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGEEan080611; Wed, 21 Jul 2021 16:14:14 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:14:14 GMT Message-Id: <202107211614.16LGEEan080611@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 5b194853b9a2 - stable/13 - devd: remove pccard entries MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5b194853b9a292dea0d3939bad8c7de777185909 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:14:16 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5b194853b9a292dea0d3939bad8c7de777185909 commit 5b194853b9a292dea0d3939bad8c7de777185909 Author: Warner Losh AuthorDate: 2021-07-15 22:17:33 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:13:12 +0000 devd: remove pccard entries The pccard entries are now obsolete, remove them. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31184 (cherry picked from commit a53541355645080cb6d94466f5363db0941da4fa) --- sbin/devd/devd.conf | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/sbin/devd/devd.conf b/sbin/devd/devd.conf index 9d23b77fe96a..d88f1fde743c 100644 --- a/sbin/devd/devd.conf +++ b/sbin/devd/devd.conf @@ -179,23 +179,8 @@ nomatch 10 { bus $bus"; }; -# Some PC-CARDs don't offer numerical manufacturer/product IDs, just +# Some Cardbus cards don't offer numerical manufacturer/product IDs, just # show the CIS info there. -nomatch 20 { - match "bus" "pccard[0-9]+"; - match "manufacturer" "0xffffffff"; - match "product" "0xffffffff"; - action "logger Unknown PCCARD device: CISproduct $cisproduct \ - CIS-vendor $cisvendor bus $bus"; -}; - -nomatch 10 { - match "bus" "pccard[0-9]+"; - action "logger Unknown PCCARD device: manufacturer $manufacturer \ - product $product CISproduct $cisproduct CIS-vendor \ - $cisvendor bus $bus"; -}; - nomatch 10 { match "bus" "cardbus[0-9]+"; action "logger Unknown Cardbus device: device $device class $class \ @@ -234,26 +219,6 @@ notify 10 { /* EXAMPLES TO END OF FILE -# An example of something that a vendor might install if you were to -# add their device. This might reside in /usr/local/etc/devd/deqna.conf. -# A deqna is, in this hypothetical example, a pccard ethernet-like device. -# Students of history may know other devices by this name, and will get -# the in-jokes in this entry. -nomatch 10 { - match "bus" "pccard[0-9]+"; - match "manufacturer" "0x1234"; - match "product" "0x2323"; - action "kldload -n if_deqna"; -}; -attach 10 { - device-name "deqna[0-9]+"; - action "/etc/pccard_ether $device-name start"; -}; -detach 10 { - device-name "deqna[0-9]+"; - action "/etc/pccard_ether $device-name stop"; -}; - # Examples of notify hooks. A notify is a generic way for a kernel # subsystem to send event notification to userland. From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:14:14 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F2196666535; Wed, 21 Jul 2021 16:14:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLHn5BFzz3Lx7; Wed, 21 Jul 2021 16:14:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A54A21234; Wed, 21 Jul 2021 16:14:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGED0k080582; Wed, 21 Jul 2021 16:14:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGEDps080581; Wed, 21 Jul 2021 16:14:13 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:14:13 GMT Message-Id: <202107211614.16LGEDps080581@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: aebc14fcf542 - stable/13 - nvme: Enable interrupts after qpair fully constructed MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: aebc14fcf542acecbb8801cdeaaf55383ea17129 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:14:14 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=aebc14fcf542acecbb8801cdeaaf55383ea17129 commit aebc14fcf542acecbb8801cdeaaf55383ea17129 Author: Warner Losh AuthorDate: 2021-07-15 22:17:23 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:13:11 +0000 nvme: Enable interrupts after qpair fully constructed To guard against the ill effects of a spurious interrupt during construction (or one that was bogusly pending), enable interrupts after the qpair is completely constructed. Otherwise, we can die with null pointer dereferences in nvme_qpair_process_completions. This has been observed in at least one pre-release NVMe drive where the MSIX interrupt fired while the queue was being created, before we'd started the NVMe controller card. The alternative of only turning on the interrupts after the rest was tried, but was insufficient to work around this bug and made the code more complicated w/o benefit. Reviewed by: mav, chuck Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31182 (cherry picked from commit fc9a0840231770bc7e7dcfe4616babdc6d4389a6) --- sys/dev/nvme/nvme_qpair.c | 49 ++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index 12770f38d42e..4402d1000e67 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -675,30 +675,6 @@ nvme_qpair_construct(struct nvme_qpair *qpair, qpair->num_trackers = num_trackers; qpair->ctrlr = ctrlr; - if (ctrlr->msix_enabled) { - /* - * MSI-X vector resource IDs start at 1, so we add one to - * the queue's vector to get the corresponding rid to use. - */ - qpair->rid = qpair->vector + 1; - - qpair->res = bus_alloc_resource_any(ctrlr->dev, SYS_RES_IRQ, - &qpair->rid, RF_ACTIVE); - if (bus_setup_intr(ctrlr->dev, qpair->res, - INTR_TYPE_MISC | INTR_MPSAFE, NULL, - nvme_qpair_msix_handler, qpair, &qpair->tag) != 0) { - nvme_printf(ctrlr, "unable to setup intx handler\n"); - goto out; - } - if (qpair->id == 0) { - bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag, - "admin"); - } else { - bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag, - "io%d", qpair->id - 1); - } - } - mtx_init(&qpair->lock, "nvme qpair lock", NULL, MTX_DEF); /* Note: NVMe PRP format is restricted to 4-byte alignment. */ @@ -818,6 +794,31 @@ nvme_qpair_construct(struct nvme_qpair *qpair, qpair->act_tr = malloc_domainset(sizeof(struct nvme_tracker *) * qpair->num_entries, M_NVME, DOMAINSET_PREF(qpair->domain), M_ZERO | M_WAITOK); + + if (ctrlr->msix_enabled) { + /* + * MSI-X vector resource IDs start at 1, so we add one to + * the queue's vector to get the corresponding rid to use. + */ + qpair->rid = qpair->vector + 1; + + qpair->res = bus_alloc_resource_any(ctrlr->dev, SYS_RES_IRQ, + &qpair->rid, RF_ACTIVE); + if (bus_setup_intr(ctrlr->dev, qpair->res, + INTR_TYPE_MISC | INTR_MPSAFE, NULL, + nvme_qpair_msix_handler, qpair, &qpair->tag) != 0) { + nvme_printf(ctrlr, "unable to setup intx handler\n"); + goto out; + } + if (qpair->id == 0) { + bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag, + "admin"); + } else { + bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag, + "io%d", qpair->id - 1); + } + } + return (0); out: From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:18:48 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8AFE8666D89; Wed, 21 Jul 2021 16:18:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLP43YgNz3MsQ; Wed, 21 Jul 2021 16:18:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6117B2112F; Wed, 21 Jul 2021 16:18:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGImhS081327; Wed, 21 Jul 2021 16:18:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGImNZ081326; Wed, 21 Jul 2021 16:18:48 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:18:48 GMT Message-Id: <202107211618.16LGImNZ081326@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 47872383e140 - stable/12 - loader: support.4th resets the read buffer incorrectly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 47872383e140fb705222399ad6f7a898286b1bc2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:18:48 -0000 The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=47872383e140fb705222399ad6f7a898286b1bc2 commit 47872383e140fb705222399ad6f7a898286b1bc2 Author: John Hood AuthorDate: 2021-07-11 14:44:12 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:16:31 +0000 loader: support.4th resets the read buffer incorrectly Large nextboot.conf files (over 80 bytes) are not read correctly by the Forth loader, causing file parsing to abort, and nextboot configuration fails to apply. Simple repro: nextboot -e foo=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx shutdown -r now That will cause the bug to cause a parse failure but shouldn't otherwise affect the boot. Depending on your loader configuration, you may also have to set beastie_disable and/or reduce the number of modules loaded to see the error on a small console screen. 12.0 or CURRENT users will also have to explicitly use the Forth loader instead of the Lua loader. The error will look something like: Warning: syntax error on file /boot/loader.conf.local foo="xxxxxxxxxxxxxxnextboot_enable="YES" ^ /boot/support.4th has crude file I/O buffering, which uses a buffer 'read_buffer', defined to be 80 bytes by the 'read_buffer_size' constant. The loader first tastes nextboot.conf, reading and parsing the first line in it for nextboot_enable="YES". If this is true, then it reopens the file and parses it like other loader .conf files. Unfortunately, the file I/O buffering code does not fully reset the buffer state in the reset_line_reading word. If the last file was read to the end, that doesn't matter; the file buffer is treated as empty anyway. But in the nextboot.conf case, the loader will not read to the end of file if it is over 80 bytes, and the file buffer may be reused when reading the next file. When the file is reread, the corrupt text may cause file parsing to abort on bad syntax (if the corrupt line has <>2 quotes in it), the wrong variable to be set, no variable to be set at all, or (if the splice happens to land at a line ending) something approximating normal operation. The bug is very old, dating back to at least 2000 if not before, and is still present in 12.0 and CURRENT r345863 (though it is now hidden by the Lua loader by default). Suggested one-line attached. This does change the behavior of the reset_line_reading word, which is exported in the line-reading dictionary (though the export is not documented in loader man pages). But repo history shows it was probably exported for the PNP support code, which was never included in the loader build, and was removed 5 months ago. One thing that puzzles me: how has this bug gone unnoticed/unfixed for nearly 2 decades? I find it hard to believe that nobody's tried to do something interesting with nextboot, like load a kernel and filesystem, which is what I'm doing. PR: 239315 Reviewed by: imp (cherry picked from commit 9c1c02093b90ae49745a174eb26ea85dd1990eec) --- stand/forth/support.4th | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/forth/support.4th b/stand/forth/support.4th index 64c71e12ec26..ed5e6a6da9ee 100644 --- a/stand/forth/support.4th +++ b/stand/forth/support.4th @@ -410,7 +410,7 @@ variable fd get-current ( -- wid ) previous definitions >search ( wid -- ) : reset_line_reading - 0 to read_buffer_ptr + 0 read_buffer .len ! ; : read_line From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:18:49 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCA66666D8A; Wed, 21 Jul 2021 16:18:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLP54zzxz3Mhd; Wed, 21 Jul 2021 16:18:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 861622123C; Wed, 21 Jul 2021 16:18:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGInmi081353; Wed, 21 Jul 2021 16:18:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGIngP081352; Wed, 21 Jul 2021 16:18:49 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:18:49 GMT Message-Id: <202107211618.16LGIngP081352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 2f5778abbe18 - stable/12 - Fix potential NULL pointer dereference of device physical path MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2f5778abbe180dcb44eaf17db1fb915204249615 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:18:50 -0000 The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2f5778abbe180dcb44eaf17db1fb915204249615 commit 2f5778abbe180dcb44eaf17db1fb915204249615 Author: Young Xiao <92siuyang@gmail.com> AuthorDate: 2019-05-21 07:36:29 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:16:31 +0000 Fix potential NULL pointer dereference of device physical path In ata_dev_advinfo() and nvme_dev_advinfo(), if the physical path is being stored and there is a malloc failure (malloc(9) is called with M_NOWAIT), we could wind up in a situation where the device's physpath_len is set to the length the user provided, but the physpath itself is NULL. If another context then comes in to fetch the physical path value, we would wind up trying to memcpy a NULL pointer into the caller's buffer. So, set the physpath_len to 0 when we free the physpath on entry into the store case for the physical path. Reset the length to a non-zero value only after we've successfully malloced a buffer to hold it. This code mirrors scsi_xpt.c does already as well. Signed-off-by: Young Xiao <92siuyang@gmail.com> Reviewed by: imp PR: 238014 (cherry picked from commit 431ddd94360a9e86c91294eaa2c7b859911984b7) --- sys/cam/ata/ata_xpt.c | 7 +++++-- sys/cam/nvme/nvme_xpt.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c index 5b789559468f..34a70a951a39 100644 --- a/sys/cam/ata/ata_xpt.c +++ b/sys/cam/ata/ata_xpt.c @@ -1757,9 +1757,11 @@ ata_dev_advinfo(union ccb *start_ccb) break; case CDAI_TYPE_PHYS_PATH: if (cdai->flags & CDAI_FLAG_STORE) { - if (device->physpath != NULL) + if (device->physpath != NULL) { free(device->physpath, M_CAMXPT); - device->physpath_len = cdai->bufsiz; + device->physpath = NULL; + device->physpath_len = 0; + } /* Clear existing buffer if zero length */ if (cdai->bufsiz == 0) break; @@ -1768,6 +1770,7 @@ ata_dev_advinfo(union ccb *start_ccb) start_ccb->ccb_h.status = CAM_REQ_ABORTED; return; } + device->physpath_len = cdai->bufsiz; memcpy(device->physpath, cdai->buf, cdai->bufsiz); } else { cdai->provsiz = device->physpath_len; diff --git a/sys/cam/nvme/nvme_xpt.c b/sys/cam/nvme/nvme_xpt.c index 68097a5e4e74..f3cf66f1ca19 100644 --- a/sys/cam/nvme/nvme_xpt.c +++ b/sys/cam/nvme/nvme_xpt.c @@ -683,9 +683,11 @@ nvme_dev_advinfo(union ccb *start_ccb) break; case CDAI_TYPE_PHYS_PATH: if (cdai->flags & CDAI_FLAG_STORE) { - if (device->physpath != NULL) + if (device->physpath != NULL) { free(device->physpath, M_CAMXPT); - device->physpath_len = cdai->bufsiz; + device->physpath = NULL; + device->physpath_len = 0; + } /* Clear existing buffer if zero length */ if (cdai->bufsiz == 0) break; @@ -694,6 +696,7 @@ nvme_dev_advinfo(union ccb *start_ccb) start_ccb->ccb_h.status = CAM_REQ_ABORTED; return; } + device->physpath_len = cdai->bufsiz; memcpy(device->physpath, cdai->buf, cdai->bufsiz); } else { cdai->provsiz = device->physpath_len; From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:18:52 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 451FB666D91; Wed, 21 Jul 2021 16:18:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLP80Bj8z3MnH; Wed, 21 Jul 2021 16:18:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C57A42138D; Wed, 21 Jul 2021 16:18:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGIp3o081403; Wed, 21 Jul 2021 16:18:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGIpjb081402; Wed, 21 Jul 2021 16:18:51 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:18:51 GMT Message-Id: <202107211618.16LGIpjb081402@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 3cd395b3b9d2 - stable/12 - Fix pmbr issues > 2TB MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 3cd395b3b9d2ab70d589d27203904238f138442f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:18:52 -0000 The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3cd395b3b9d2ab70d589d27203904238f138442f commit 3cd395b3b9d2ab70d589d27203904238f138442f Author: Emrion AuthorDate: 2021-07-13 20:37:59 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:16:31 +0000 Fix pmbr issues > 2TB These issues have low impact because they require precise circumstances to trigger one of them. The disk must be > 2 TiB in size and either: - The primary GPT header is dammaged. - The freebsd-boot partiton is located farther than the first 2 TiB of the disc and one of its sectors takes place at a lba value that makes the higher 32 bits of this very value change. Errors and corrections folow: - decl and incl don't affect CF, so replace with subl/addl $1 - repe uses %cx, so move size to it with movw - moving a 64-bit value with %cx of 2 (should be 4) so addresses > 2TB will work. PR: 233180 Reviewed by: imp@ (applied patch using description in bug) Differential Revision: https://reviews.freebsd.org/D31100 (cherry picked from commit 0ca9f1d4a3b772036309fb1c14262ec77c674c5d) --- stand/i386/pmbr/pmbr.s | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/stand/i386/pmbr/pmbr.s b/stand/i386/pmbr/pmbr.s index 1a758812edd3..c394835757af 100644 --- a/stand/i386/pmbr/pmbr.s +++ b/stand/i386/pmbr/pmbr.s @@ -114,8 +114,9 @@ main.2b: cmpb $1,%dh # Reading primary? main.3: movb $0,%dh # %dh := 0 (reading backup) movw $DPBUF+DPBUF_SEC,%si # %si = last sector + 1 movw $lba,%di # %di = $lba -main.3a: decl (%si) # 0x0(%si) = last sec (0-31) - movw $2,%cx +main.3a: subl $1, (%si) # 0x0(%si) = last sec (0-31) + sbbl $0, 4(%si) + movw $4,%cx rep movsw # $lastsec--, copy it to $lba jmp main.2a # Read the next sector @@ -128,7 +129,7 @@ load_part: movw $GPT_ADDR+GPT_PART_LBA,%si call read scan: movw %bx,%si # Compare partition UUID movw $boot_uuid,%di # with FreeBSD boot UUID - movb $0x10,%cl + movw $0x10,%cx repe cmpsb jnz next_part # Didn't match, next partition # @@ -150,7 +151,7 @@ load_boot: push %si # Save %si jnz next_boot mov %bx,%es # Reset %es to zero jmp LOAD # Jump to boot code -next_boot: incl (%si) # Next LBA +next_boot: addl $1,(%si) # Next LBA adcl $0,4(%si) mov %es,%ax # Adjust segment for next addw $SECSIZE/16,%ax # sector @@ -171,7 +172,7 @@ next_part: decl GPT_ADDR+GPT_NPART # Was this the last partition? addw %ax,%bx # Next partition cmpw $PART_ADDR+0x200,%bx # Still in sector? jb scan - incl GPT_ADDR+GPT_PART_LBA # Next sector + addl $1, GPT_ADDR+GPT_PART_LBA # Next sector adcl $0,GPT_ADDR+GPT_PART_LBA+4 jmp load_part # From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:18:51 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D183666C2E; Wed, 21 Jul 2021 16:18:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLP65nD6z3MnC; Wed, 21 Jul 2021 16:18:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 967E7211C3; Wed, 21 Jul 2021 16:18:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGIoCG081377; Wed, 21 Jul 2021 16:18:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGIo7Z081376; Wed, 21 Jul 2021 16:18:50 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:18:50 GMT Message-Id: <202107211618.16LGIo7Z081376@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 82e3f2709ce2 - stable/12 - cam_iosched: use tunable flag and make a bool really a bool MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 82e3f2709ce2c38c4ed6d386c97550eb700af6e7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:18:52 -0000 The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=82e3f2709ce2c38c4ed6d386c97550eb700af6e7 commit 82e3f2709ce2c38c4ed6d386c97550eb700af6e7 Author: Warner Losh AuthorDate: 2021-07-13 06:00:33 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:16:31 +0000 cam_iosched: use tunable flag and make a bool really a bool kern.cam.do_dynamic_iosched is really a bool, so change its type to bool. While I'm here, also use the CTLFLAG_TUN flag instead of a separate tunable line for it and kern.cam.iosched_alpha_bits. MFC After: 1 week Sponsored by: Netflix (cherry picked from commit a065ccb2804fae834a7c66e29b726ea3dbbceace) --- sys/cam/cam_iosched.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/cam/cam_iosched.c b/sys/cam/cam_iosched.c index 6e1f6d52d0eb..0b4d89468804 100644 --- a/sys/cam/cam_iosched.c +++ b/sys/cam/cam_iosched.c @@ -70,9 +70,8 @@ static MALLOC_DEFINE(M_CAMSCHED, "CAM I/O Scheduler", #ifdef CAM_IOSCHED_DYNAMIC -static int do_dynamic_iosched = 1; -TUNABLE_INT("kern.cam.do_dynamic_iosched", &do_dynamic_iosched); -SYSCTL_INT(_kern_cam, OID_AUTO, do_dynamic_iosched, CTLFLAG_RD, +static bool do_dynamic_iosched = 1; +SYSCTL_BOOL(_kern_cam, OID_AUTO, do_dynamic_iosched, CTLFLAG_RD | CTLFLAG_TUN, &do_dynamic_iosched, 1, "Enable Dynamic I/O scheduler optimizations."); @@ -97,8 +96,7 @@ SYSCTL_INT(_kern_cam, OID_AUTO, do_dynamic_iosched, CTLFLAG_RD, * Note: See computation of EMA and EMVAR for acceptable ranges of alpha. */ static int alpha_bits = 9; -TUNABLE_INT("kern.cam.iosched_alpha_bits", &alpha_bits); -SYSCTL_INT(_kern_cam, OID_AUTO, iosched_alpha_bits, CTLFLAG_RW, +SYSCTL_INT(_kern_cam, OID_AUTO, iosched_alpha_bits, CTLFLAG_RW | CTLFLAG_TUN, &alpha_bits, 1, "Bits in EMA's alpha."); From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:18:53 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F262666CAB; Wed, 21 Jul 2021 16:18:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLP90TlJz3MnL; Wed, 21 Jul 2021 16:18:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC4932123D; Wed, 21 Jul 2021 16:18:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGIqtU081429; Wed, 21 Jul 2021 16:18:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGIqYJ081428; Wed, 21 Jul 2021 16:18:52 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:18:52 GMT Message-Id: <202107211618.16LGIqYJ081428@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 18b511454f77 - stable/12 - Remove incorrect __restricted labels from strcspn MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 18b511454f779305f828b71ad5df69d1c1a3b3ba Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:18:54 -0000 The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=18b511454f779305f828b71ad5df69d1c1a3b3ba commit 18b511454f779305f828b71ad5df69d1c1a3b3ba Author: Alfonso Gregory AuthorDate: 2021-07-14 21:48:35 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:16:32 +0000 Remove incorrect __restricted labels from strcspn strcspn should never have had the __restrict keywords. While both of these strings are const, it may have unindended side effects. While this is the kernel, the POSIX definition also omits restrict. Reviewed by: imp@ Pull Request: https://github.com/freebsd/freebsd-src/pull/497 (cherry picked from commit 56d33e86b74b197a36f42255824b56715c96a596) --- sys/libkern/strcspn.c | 2 +- sys/sys/libkern.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/libkern/strcspn.c b/sys/libkern/strcspn.c index fce6d4b8b071..62bfcf78eeb7 100644 --- a/sys/libkern/strcspn.c +++ b/sys/libkern/strcspn.c @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #define BIT(c) ((u_long)1 << ((u_char)(c) % LONG_BIT)) size_t -strcspn(const char * __restrict s, const char * __restrict charset) +strcspn(const char *s, const char *charset) { /* * NB: idx and bit are temporaries whose use causes gcc 3.4.2 to diff --git a/sys/sys/libkern.h b/sys/sys/libkern.h index 0c4e1381be1a..b8855cba6d95 100644 --- a/sys/sys/libkern.h +++ b/sys/sys/libkern.h @@ -173,8 +173,8 @@ char *strcat(char * __restrict, const char * __restrict); char *strchr(const char *, int); int strcmp(const char *, const char *); char *strcpy(char * __restrict, const char * __restrict); -size_t strcspn(const char * __restrict, const char * __restrict) __pure; char *strdup_flags(const char *__restrict, struct malloc_type *, int); +size_t strcspn(const char *, const char *) __pure; char *strdup(const char *__restrict, struct malloc_type *); char *strncat(char *, const char *, size_t); char *strndup(const char *__restrict, size_t, struct malloc_type *); From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:18:54 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 92E53666B72; Wed, 21 Jul 2021 16:18:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLPB25vdz3Mhq; Wed, 21 Jul 2021 16:18:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A5B121402; Wed, 21 Jul 2021 16:18:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGIrwv081458; Wed, 21 Jul 2021 16:18:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGIrDe081457; Wed, 21 Jul 2021 16:18:53 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:18:53 GMT Message-Id: <202107211618.16LGIrDe081457@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: ee6908d78275 - stable/12 - loader: make sure CPUTYPE is ignored when building MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ee6908d78275449011f8fb1b6d73bde75c02f705 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:18:55 -0000 The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ee6908d78275449011f8fb1b6d73bde75c02f705 commit ee6908d78275449011f8fb1b6d73bde75c02f705 Author: Warner Losh AuthorDate: 2021-07-15 03:06:08 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:16:32 +0000 loader: make sure CPUTYPE is ignored when building CPUTYPE?=native causes -march=native to be added to the command line. When the host machine is haswell, this causes some versions of clang to generate code that can't execute in the efi boot loader environment. Set _CPUCFLAGS= to undo what's done bsd.cpu.mk. bsd.cpu.mk is included too early to control with NO_CPU_CFLAGS here. The only other option is to put that in all the Makefiles, and this is less tedious and error prone. PR: 194641 Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31187 MFC After: 1 week (cherry picked from commit 7a0c0ff7ee25ff1efa3dbedcb20d2c80178639cc) --- stand/defs.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stand/defs.mk b/stand/defs.mk index 514a6c9b98dc..3f440d9017f8 100644 --- a/stand/defs.mk +++ b/stand/defs.mk @@ -15,6 +15,14 @@ MAN= NO_PIC= INTERNALLIB= .endif +# Should be NO_CPU_FLAGS, but bsd.cpu.mk is included too early in bsd.init.mk +# via the early include of bsd.opts.mk. Moving Makefile.inc include earlier in +# that file causes weirdness, so this is the next best thing. We need to do this +# because the loader needs very specific flags to work right, and things like +# CPUTYPE?=native prevent that, and introduce an endless game of whack-a-mole +# to disable more and more features. Boot loader performance is never improved +# enough to make that hassle worth chasing. +_CPUCFLAGS= .include From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:18:56 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 634C2666D16; Wed, 21 Jul 2021 16:18:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLPC5kS3z3MfJ; Wed, 21 Jul 2021 16:18:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F832211C4; Wed, 21 Jul 2021 16:18:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGItU9081484; Wed, 21 Jul 2021 16:18:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGIt7g081483; Wed, 21 Jul 2021 16:18:55 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:18:55 GMT Message-Id: <202107211618.16LGIt7g081483@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: e1b5efda31c3 - stable/12 - nanobsd: Use gpart and create code image before full disk image MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e1b5efda31c36df69af31e822c4967fba8ad2b50 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:18:56 -0000 The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e1b5efda31c36df69af31e822c4967fba8ad2b50 commit e1b5efda31c36df69af31e822c4967fba8ad2b50 Author: Arrigo Marchiori AuthorDate: 2021-07-15 22:06:51 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:16:32 +0000 nanobsd: Use gpart and create code image before full disk image The attached patch brings two main changes to the nanobsd script: 1- gpart is used instead of fdisk; 2- the code image is created first, and then used to ``assemble'' the full disk image. The patch was first proposed on the freebsd-embedded list: http://lists.freebsd.org/pipermail/freebsd-embedded/2012-June/001580.html and is currently under discussion: http://lists.freebsd.org/pipermail/freebsd-embedded/2014-January/002216.html Another effect is that the -f option ("suppress code slice extraction") now imples the -i option ("suppress disk image build"). imp@ applied Patch by hand to new legacy.sh, plus tweaked for NANO_LOG vs NANO_OBJ confusion in original. PR: 186030 Reviewed by: imp@ Differential Revision: https://reviews.freebsd.org/D31102 (cherry picked from commit 587c054bea0f652fdbd86baf5807f21c904ac2ad) --- tools/tools/nanobsd/defaults.sh | 4 +- tools/tools/nanobsd/legacy.sh | 132 ++++++++++++++++++++++++++-------------- tools/tools/nanobsd/nanobsd.sh | 17 ++++-- 3 files changed, 103 insertions(+), 50 deletions(-) diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index 86acab65f67d..365a8e9df714 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -161,6 +161,8 @@ NANO_SLICE_ROOT=s1 NANO_SLICE_ALTROOT=s2 NANO_SLICE_CFG=s3 NANO_SLICE_DATA=s4 +NANO_PARTITION_ROOT=a +NANO_PARTITION_ALTROOT=a NANO_ROOT=s1a NANO_ALTROOT=s2a @@ -856,7 +858,7 @@ usage ( ) { echo "Usage: $0 [-bfhiKknqvwX] [-c config_file]" echo " -b suppress builds (both kernel and world)" echo " -c specify config file" - echo " -f suppress code slice extraction" + echo " -f suppress code slice extraction (implies -i)" echo " -h print this help summary page" echo " -i suppress disk image build" echo " -K suppress installkernel" diff --git a/tools/tools/nanobsd/legacy.sh b/tools/tools/nanobsd/legacy.sh index 0832179ba227..4ead17973316 100644 --- a/tools/tools/nanobsd/legacy.sh +++ b/tools/tools/nanobsd/legacy.sh @@ -35,30 +35,18 @@ # Functions and variable definitions used by the legacy nanobsd # image building system. -create_diskimage ( ) ( - pprint 2 "build diskimage" - pprint 3 "log: ${NANO_LOG}/_.di" - - ( +calculate_partitioning ( ) ( echo $NANO_MEDIASIZE $NANO_IMAGES \ $NANO_SECTS $NANO_HEADS \ $NANO_CODESIZE $NANO_CONFSIZE $NANO_DATASIZE | awk ' { - printf "# %s\n", $0 - # size of cylinder in sectors cs = $3 * $4 # number of full cylinders on media cyl = int ($1 / cs) - # output fdisk geometry spec, truncate cyls to 1023 - if (cyl <= 1023) - print "g c" cyl " h" $4 " s" $3 - else - print "g c" 1023 " h" $4 " s" $3 - if ($7 > 0) { # size of data partition in full cylinders dsl = int (($7 + cs - 1) / cs) @@ -69,44 +57,100 @@ create_diskimage ( ) ( # size of config partition in full cylinders csl = int (($6 + cs - 1) / cs) + # size of image partition(s) in full cylinders if ($5 == 0) { - # size of image partition(s) in full cylinders isl = int ((cyl - dsl - csl) / $2) } else { isl = int (($5 + cs - 1) / cs) } # First image partition start at second track - print "p 1 165 " $3, isl * cs - $3 + print $3, isl * cs - $3 c = isl * cs; # Second image partition (if any) also starts offset one # track to keep them identical. if ($2 > 1) { - print "p 2 165 " $3 + c, isl * cs - $3 + print $3 + c, isl * cs - $3 c += isl * cs; } # Config partition starts at cylinder boundary. - print "p 3 165 " c, csl * cs + print c, csl * cs c += csl * cs # Data partition (if any) starts at cylinder boundary. if ($7 > 0) { - print "p 4 165 " c, dsl * cs + print c, dsl * cs } else if ($7 < 0 && $1 > c) { - print "p 4 165 " c, $1 - c + print c, $1 - c } else if ($1 < c) { print "Disk space overcommitted by", \ c - $1, "sectors" > "/dev/stderr" exit 2 } - # Force slice 1 to be marked active. This is necessary - # for booting the image from a USB device to work. - print "a 1" } - ' > ${NANO_LOG}/_.fdisk + ' > ${NANO_LOG}/_.partitioning +) + +create_code_slice ( ) ( + pprint 2 "build code slice" + pprint 3 "log: ${NANO_OBJ}/_.cs" + + ( + IMG=${NANO_DISKIMGDIR}/_.disk.image + MNT=${NANO_OBJ}/_.mnt + mkdir -p ${MNT} + CODE_SIZE=`head -n 1 ${NANO_LOG}/_.partitioning | awk '{ print $2 }'` + + if [ "${NANO_MD_BACKING}" = "swap" ] ; then + MD=`mdconfig -a -t swap -s ${CODE_SIZE} -x ${NANO_SECTS} \ + -y ${NANO_HEADS}` + else + echo "Creating md backing file..." + rm -f ${IMG} + dd if=/dev/zero of=${IMG} seek=${CODE_SIZE} count=0 + MD=`mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} \ + -y ${NANO_HEADS}` + fi + + trap "echo 'Running exit trap code' ; df -i ${MNT} ; umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT + + bsdlabel -w ${MD} + if [ -f ${NANO_WORLDDIR}/boot/boot ]; then + echo "Making bootable partition" + gpart bootcode -b ${NANO_WORLDDIR}/boot/boot ${MD} + else + echo "Partition will not be bootable" + fi + bsdlabel ${MD} + + # Create first image + populate_slice /dev/${MD}${NANO_PARTITION_ROOT} ${NANO_WORLDDIR} ${MNT} "${NANO_ROOT}" + mount /dev/${MD}a ${MNT} + echo "Generating mtree..." + ( cd ${MNT} && mtree -c ) > ${NANO_OBJ}/_.mtree + ( cd ${MNT} && du -k ) > ${NANO_OBJ}/_.du + nano_umount ${MNT} + + if [ "${NANO_MD_BACKING}" = "swap" ] ; then + echo "Writing out _.disk.image..." + dd conv=sparse if=/dev/${MD} of=${NANO_DISKIMGDIR}/_.disk.image bs=64k + fi + mdconfig -d -u $MD + + trap - 1 2 15 EXIT + + ) > ${NANO_OBJ}/_.cs 2>&1 +) + + +create_diskimage ( ) ( + pprint 2 "build diskimage" + pprint 3 "log: ${NANO_OBJ}/_.di" + + ( IMG=${NANO_DISKIMGDIR}/${NANO_IMGNAME} MNT=${NANO_OBJ}/_.mnt @@ -123,29 +167,34 @@ create_diskimage ( ) ( -y ${NANO_HEADS}` fi + awk ' + BEGIN { + # Create MBR partition table + print "gpart create -s mbr $1" + } + { + # Make partition + print "gpart add -t freebsd -b ", $1, " -s ", $2, " $1" + } + END { + # Force slice 1 to be marked active. This is necessary + # for booting the image from a USB device to work. + print "gpart set -a active -i 1 $1" + } + ' ${NANO_LOG}/_.partitioning > ${NANO_OBJ}/_.gpart + trap "echo 'Running exit trap code' ; df -i ${MNT} ; nano_umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT - fdisk -i -f ${NANO_LOG}/_.fdisk ${MD} - fdisk ${MD} + sh ${NANO_OBJ}/_.gpart ${MD} + gpart show ${MD} # XXX: params # XXX: pick up cached boot* files, they may not be in image anymore. if [ -f ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ]; then - boot0cfg -B -b ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ${NANO_BOOT0CFG} ${MD} - fi - if [ -f ${NANO_WORLDDIR}/boot/boot ]; then - bsdlabel -w -B -b ${NANO_WORLDDIR}/boot/boot ${MD}${NANO_SLICE_ROOT} - else - bsdlabel -w ${MD}${NANO_SLICE_ROOT} + gpart bootcode -b ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ${NANO_BOOTFLAGS} ${MD} fi - bsdlabel ${MD}${NANO_SLICE_ROOT} - # Create first image - populate_slice /dev/${MD}${NANO_ROOT} ${NANO_WORLDDIR} ${MNT} "${NANO_ROOT}" - mount /dev/${MD}${NANO_ROOT} ${MNT} - echo "Generating mtree..." - ( cd "${MNT}" && mtree -c ) > ${NANO_LOG}/_.mtree - ( cd "${MNT}" && du -k ) > ${NANO_LOG}/_.du - nano_umount "${MNT}" + echo "Writing code image..." + dd conv=sparse if=${NANO_DISKIMGDIR}/_.disk.image of=/dev/${MD}${NANO_SLICE_ROOT} bs=64k if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then # Duplicate to second image (if present) @@ -190,11 +239,6 @@ create_diskimage ( ) ( dd conv=sparse if=/dev/${MD} of=${IMG} bs=64k fi - if ${do_copyout_partition} ; then - echo "Writing out ${NANO_IMG1NAME}..." - dd conv=sparse if=/dev/${MD}${NANO_SLICE_ROOT} \ - of=${NANO_DISKIMGDIR}/${NANO_IMG1NAME} bs=64k - fi mdconfig -d -u $MD trap - 1 2 15 EXIT diff --git a/tools/tools/nanobsd/nanobsd.sh b/tools/tools/nanobsd/nanobsd.sh index 89d0bed60b7a..c5c680025fc7 100755 --- a/tools/tools/nanobsd/nanobsd.sh +++ b/tools/tools/nanobsd/nanobsd.sh @@ -40,9 +40,9 @@ do_clean=true do_kernel=true do_installkernel=true do_world=true +do_code=true do_installworld=true do_image=true -do_copyout_partition=true do_native_xtools=false do_prep_image=true @@ -94,7 +94,8 @@ do shift ;; -f) - do_copyout_partition=false + do_code=false + do_image=false shift ;; -h) @@ -215,10 +216,16 @@ if $do_prep_image ; then else pprint 2 "Skipping image prep (as instructed)" fi -if $do_image ; then - create_diskimage +if $do_code ; then + calculate_partitioning + create_code_slice + if $do_image ; then + create_diskimage + else + pprint 2 "Skipping image build (as instructed)" + fi else - pprint 2 "Skipping image build (as instructed)" + pprint 2 "Skipping code and image build (as instructed)" fi last_orders From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:18:57 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EFBBB6669F9; Wed, 21 Jul 2021 16:18:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLPD3frYz3Mt5; Wed, 21 Jul 2021 16:18:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FF42211C5; Wed, 21 Jul 2021 16:18:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGIui8081508; Wed, 21 Jul 2021 16:18:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGIuQl081507; Wed, 21 Jul 2021 16:18:56 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:18:56 GMT Message-Id: <202107211618.16LGIuQl081507@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 30823c92a1ca - stable/12 - nanobsd: default to -j $hw.ncpu MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 30823c92a1cafb83613ed285764528a38e601afa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:18:57 -0000 The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=30823c92a1cafb83613ed285764528a38e601afa commit 30823c92a1cafb83613ed285764528a38e601afa Author: Warner Losh AuthorDate: 2021-07-15 22:07:51 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:16:32 +0000 nanobsd: default to -j $hw.ncpu For paralllel builds, default to using all the CPUs on the system. The old default of -j 3 was too few. Sponsored by: Netflix (cherry picked from commit 7e3a794be3752d21fe760cfb2a38665532c4b6b4) --- tools/tools/nanobsd/defaults.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index 365a8e9df714..cc75e3527bca 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -67,7 +67,8 @@ NANO_PKG_META_BASE=/var/db # Make & parallel Make NANO_MAKE="make" -NANO_PMAKE="make -j 3" +NANO_NCPU=$(sysctl -n hw.ncpu) +NANO_PMAKE="make -j $NANO_NCPU" # The default name for any image we create. NANO_IMGNAME="_.disk.full" @@ -923,6 +924,7 @@ set_defaults_and_export ( ) { export_var NANO_MAKE_CONF_INSTALL export_var NANO_MEDIASIZE export_var NANO_NAME + export_var NANO_NCPU export_var NANO_NEWFS export_var NANO_OBJ export_var NANO_PMAKE From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:18:58 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 373DD666D1C; Wed, 21 Jul 2021 16:18:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLPF4ZWSz3MfR; Wed, 21 Jul 2021 16:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 730E6211C6; Wed, 21 Jul 2021 16:18:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGIvIS081532; Wed, 21 Jul 2021 16:18:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGIvR4081531; Wed, 21 Jul 2021 16:18:57 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:18:57 GMT Message-Id: <202107211618.16LGIvR4081531@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 7a64f67f1c6a - stable/12 - nanobsd: Bump rescue size to 8GB MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7a64f67f1c6aff43ac5025f436967234cd9336a6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:18:58 -0000 The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7a64f67f1c6aff43ac5025f436967234cd9336a6 commit 7a64f67f1c6aff43ac5025f436967234cd9336a6 Author: Warner Losh AuthorDate: 2021-07-15 22:11:15 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:16:32 +0000 nanobsd: Bump rescue size to 8GB Bump the rescue size from 1.2GB to just shy of 8GB as things have grown somewhat. Also make it possible to build rescue somewhere other than /usr/src. Sponsored by: Netflix (cherry picked from commit 998abf5a1274609f9b74b3301dc0dabe659bd36b) --- tools/tools/nanobsd/rescue/common | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/tools/nanobsd/rescue/common b/tools/tools/nanobsd/rescue/common index d2a8a6de9e91..d14ad8b5af2b 100644 --- a/tools/tools/nanobsd/rescue/common +++ b/tools/tools/nanobsd/rescue/common @@ -1,15 +1,17 @@ # # $FreeBSD$ # +NANO_SRC=$(pwd) +NANO_SRC=${NANO_SRC%/tools/tools/nanobsd/rescue} +NANO_OBJ=${NANO_SRC}/../nanobsd-builds/${NANO_NAME}/obj NANO_TOOLS=`pwd` NANO_PACKAGE_DIR=`pwd`/Pkg NANO_RAM_TMPVARSIZE=40960 NANO_PMAKE="make -j 8" NANO_LABEL="rescue" NANO_RAM_TMPVARSIZE=40960 -#NANO_MEDIASIZE="8027712" -#NANO_MEDIASIZE="2097152" -NANO_MEDIASIZE="3932160" +#NANO_MEDIASIZE="3932160" +NANO_MEDIASIZE="16384000" NANO_SECTS="63" NANO_HEADS="16" NANO_IMAGES="2" @@ -19,7 +21,7 @@ NANO_DRIVE=da0 #NANO_MODULES= NANO_BOOTLOADER="boot/boot0" NANO_BOOT2CFG="" -NANO_MD_BACKING=swap +NANO_MD_BACKING=file # Options to put in make.conf during buildworld only CONF_BUILD=' From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:18:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9AC8F666F03; Wed, 21 Jul 2021 16:18:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLPH25lQz3Mnc; Wed, 21 Jul 2021 16:18:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E9B5211C7; Wed, 21 Jul 2021 16:18:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGIwdg081558; Wed, 21 Jul 2021 16:18:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGIwQp081557; Wed, 21 Jul 2021 16:18:58 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:18:58 GMT Message-Id: <202107211618.16LGIwQp081557@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 7028ae849a54 - stable/12 - boot: fix OBJS to not include BTX's crt0.o MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7028ae849a54552f399a3d221e906a467fee09f3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:19:00 -0000 The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7028ae849a54552f399a3d221e906a467fee09f3 commit 7028ae849a54552f399a3d221e906a467fee09f3 Author: Warner Losh AuthorDate: 2021-05-06 19:05:09 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:16:33 +0000 boot: fix OBJS to not include BTX's crt0.o According to comments in the Makefile, to make pxeboot work we need to have crt0.o first. This is needed because the simplified loader in pxeboot assumes that the startup code is at offset 0 in this binary. In normal booting, the start address can be obtained from headers of the binary, but since pxeboot encodes this as a pure binary, it has no way of knowing where that is and assumes 0. Added comments to that effect in the Makefile. We've done this by adding it to OBJS before all the other .o's are added. However, there's a problem. This also adds it to the CLEANFILES variable, which causes it to be removed from multiple places. The dependencies may also cause it to be re-built at a time that's after boot2 is built. This causes installs to fail because at install time boot2 is considered to be out of date and the programs to rebuild it are no longer in the path. Cope with this problem by just adding it to LDFLAGS instead. Glanced at by: kevans ("I thought that went in ages ago") Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D28876 (cherry picked from commit e713d3a013882893fceb84dd14569052271497a9) --- stand/i386/loader/Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/stand/i386/loader/Makefile b/stand/i386/loader/Makefile index b74ef9007d97..8fbea355d726 100644 --- a/stand/i386/loader/Makefile +++ b/stand/i386/loader/Makefile @@ -75,8 +75,18 @@ LINKS+= ${BINDIR}/${LOADER} ${BINDIR}/loader FILES+= ${LOADER} FILESMODE_${LOADER}= ${BINMODE} -b -# XXX crt0.o needs to be first for pxeboot(8) to work -OBJS= ${BTXCRT} +# Note: crt0.o needs to be first for pxeboot(8) to work. It assumes that the +# startup code is located at the start of the loader and will jump +# there. Although btx is more flexible than this, the emulated boot2 environment +# that pxeloader provides has none of that flexibility because it lacks access +# to the a.out/elf headers and assumes an entry point of 0. +# +# We must add it to the LDFLAGS instead of the OBJS becauce the former won't try +# to clean it. When it is in OBJS, this cleaning can lead to races where +# btxcrt.o is rebuilt, but boot2 isn't, leading to errors at installation time. +# LDFLAGS does not have this baggage and will be included first in the list of +# files. +LDFLAGS+= ${BTXCRT} DPADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBI386} ${LIBSA32} LDADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBI386} ${LIBSA32} From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:19:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE0A5666EB1; Wed, 21 Jul 2021 16:19:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLPK2WyTz3MrJ; Wed, 21 Jul 2021 16:19:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F34D921130; Wed, 21 Jul 2021 16:19:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGJ0vl081612; Wed, 21 Jul 2021 16:19:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGJ0tf081611; Wed, 21 Jul 2021 16:19:00 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:19:00 GMT Message-Id: <202107211619.16LGJ0tf081611@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: d0822dee1dfb - stable/12 - devd: remove pccard entries MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: d0822dee1dfbe2fd1ceee64d6f7932a3be7d3ae7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:19:02 -0000 The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d0822dee1dfbe2fd1ceee64d6f7932a3be7d3ae7 commit d0822dee1dfbe2fd1ceee64d6f7932a3be7d3ae7 Author: Warner Losh AuthorDate: 2021-07-15 22:17:33 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:16:33 +0000 devd: remove pccard entries The pccard entries are now obsolete, remove them. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31184 (cherry picked from commit a53541355645080cb6d94466f5363db0941da4fa) --- sbin/devd/devd.conf | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/sbin/devd/devd.conf b/sbin/devd/devd.conf index 99acaf6f30bc..430bf868a677 100644 --- a/sbin/devd/devd.conf +++ b/sbin/devd/devd.conf @@ -191,23 +191,8 @@ nomatch 10 { bus $bus"; }; -# Some PC-CARDs don't offer numerical manufacturer/product IDs, just +# Some Cardbus cards don't offer numerical manufacturer/product IDs, just # show the CIS info there. -nomatch 20 { - match "bus" "pccard[0-9]+"; - match "manufacturer" "0xffffffff"; - match "product" "0xffffffff"; - action "logger Unknown PCCARD device: CISproduct $cisproduct \ - CIS-vendor $cisvendor bus $bus"; -}; - -nomatch 10 { - match "bus" "pccard[0-9]+"; - action "logger Unknown PCCARD device: manufacturer $manufacturer \ - product $product CISproduct $cisproduct CIS-vendor \ - $cisvendor bus $bus"; -}; - nomatch 10 { match "bus" "cardbus[0-9]+"; action "logger Unknown Cardbus device: device $device class $class \ @@ -246,26 +231,6 @@ notify 10 { /* EXAMPLES TO END OF FILE -# An example of something that a vendor might install if you were to -# add their device. This might reside in /usr/local/etc/devd/deqna.conf. -# A deqna is, in this hypothetical example, a pccard ethernet-like device. -# Students of history may know other devices by this name, and will get -# the in-jokes in this entry. -nomatch 10 { - match "bus" "pccard[0-9]+"; - match "manufacturer" "0x1234"; - match "product" "0x2323"; - action "kldload -n if_deqna"; -}; -attach 10 { - device-name "deqna[0-9]+"; - action "/etc/pccard_ether $device-name start"; -}; -detach 10 { - device-name "deqna[0-9]+"; - action "/etc/pccard_ether $device-name stop"; -}; - # Examples of notify hooks. A notify is a generic way for a kernel # subsystem to send event notification to userland. From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 16:19:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D966666D22; Wed, 21 Jul 2021 16:19:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVLPH6zkQz3Mnj; Wed, 21 Jul 2021 16:18:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE9102123E; Wed, 21 Jul 2021 16:18:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LGIxEV081588; Wed, 21 Jul 2021 16:18:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LGIxIe081587; Wed, 21 Jul 2021 16:18:59 GMT (envelope-from git) Date: Wed, 21 Jul 2021 16:18:59 GMT Message-Id: <202107211618.16LGIxIe081587@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: c23e2b282bcb - stable/12 - nvme: Enable interrupts after qpair fully constructed MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c23e2b282bcb89bb4bf46b380ba8db11b914b436 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 16:19:03 -0000 The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c23e2b282bcb89bb4bf46b380ba8db11b914b436 commit c23e2b282bcb89bb4bf46b380ba8db11b914b436 Author: Warner Losh AuthorDate: 2021-07-15 22:17:23 +0000 Commit: Warner Losh CommitDate: 2021-07-21 16:16:33 +0000 nvme: Enable interrupts after qpair fully constructed To guard against the ill effects of a spurious interrupt during construction (or one that was bogusly pending), enable interrupts after the qpair is completely constructed. Otherwise, we can die with null pointer dereferences in nvme_qpair_process_completions. This has been observed in at least one pre-release NVMe drive where the MSIX interrupt fired while the queue was being created, before we'd started the NVMe controller card. The alternative of only turning on the interrupts after the rest was tried, but was insufficient to work around this bug and made the code more complicated w/o benefit. Reviewed by: mav, chuck Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31182 (cherry picked from commit fc9a0840231770bc7e7dcfe4616babdc6d4389a6) --- sys/dev/nvme/nvme_qpair.c | 50 +++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index 0fe80c645f1c..9be4fc67b923 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -661,31 +661,6 @@ nvme_qpair_construct(struct nvme_qpair *qpair, qpair->num_trackers = num_trackers; qpair->ctrlr = ctrlr; - if (ctrlr->msix_enabled) { - - /* - * MSI-X vector resource IDs start at 1, so we add one to - * the queue's vector to get the corresponding rid to use. - */ - qpair->rid = qpair->vector + 1; - - qpair->res = bus_alloc_resource_any(ctrlr->dev, SYS_RES_IRQ, - &qpair->rid, RF_ACTIVE); - if (bus_setup_intr(ctrlr->dev, qpair->res, - INTR_TYPE_MISC | INTR_MPSAFE, NULL, - nvme_qpair_msix_handler, qpair, &qpair->tag) != 0) { - nvme_printf(ctrlr, "unable to setup intx handler\n"); - goto out; - } - if (qpair->id == 0) { - bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag, - "admin"); - } else { - bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag, - "io%d", qpair->id - 1); - } - } - mtx_init(&qpair->lock, "nvme qpair lock", NULL, MTX_DEF); /* Note: NVMe PRP format is restricted to 4-byte alignment. */ @@ -806,6 +781,31 @@ nvme_qpair_construct(struct nvme_qpair *qpair, qpair->act_tr = malloc_domainset(sizeof(struct nvme_tracker *) * qpair->num_entries, M_NVME, DOMAINSET_PREF(qpair->domain), M_ZERO | M_WAITOK); + + if (ctrlr->msix_enabled) { + /* + * MSI-X vector resource IDs start at 1, so we add one to + * the queue's vector to get the corresponding rid to use. + */ + qpair->rid = qpair->vector + 1; + + qpair->res = bus_alloc_resource_any(ctrlr->dev, SYS_RES_IRQ, + &qpair->rid, RF_ACTIVE); + if (bus_setup_intr(ctrlr->dev, qpair->res, + INTR_TYPE_MISC | INTR_MPSAFE, NULL, + nvme_qpair_msix_handler, qpair, &qpair->tag) != 0) { + nvme_printf(ctrlr, "unable to setup intx handler\n"); + goto out; + } + if (qpair->id == 0) { + bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag, + "admin"); + } else { + bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag, + "io%d", qpair->id - 1); + } + } + return (0); out: From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 17:00:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 045A466754D; Wed, 21 Jul 2021 17:00:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVMJm6PT9z3kMH; Wed, 21 Jul 2021 17:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3A0721C3F; Wed, 21 Jul 2021 17:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LH08uI039121; Wed, 21 Jul 2021 17:00:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LH08Ld039118; Wed, 21 Jul 2021 17:00:08 GMT (envelope-from git) Date: Wed, 21 Jul 2021 17:00:08 GMT Message-Id: <202107211700.16LH08Ld039118@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: bc28e9596c59 - stable/13 - Add __diagused MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bc28e9596c59b58fbbdbd9f97e42a0e0fbedb855 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 17:00:09 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=bc28e9596c59b58fbbdbd9f97e42a0e0fbedb855 commit bc28e9596c59b58fbbdbd9f97e42a0e0fbedb855 Author: Mateusz Guzik AuthorDate: 2021-07-15 14:01:02 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-21 16:59:58 +0000 Add __diagused This can be used for variables which are only used with either INVARIANTS or WITNESS. Without any annotation they run into dead store warnings from cc --analyze and always annotating with __unused may hide bad vars when it should not. Reviewed by: kib, markj Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31185 (cherry picked from commit b9296725cf99696b48926270a553044522d6e344) --- sys/sys/systm.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/sys/systm.h b/sys/sys/systm.h index d13379b0a12f..36d48fbf080d 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -625,6 +625,13 @@ void _gone_in_dev(device_t dev, int major, const char *msg); #endif #define gone_in(major, msg) __gone_ok(major, msg) _gone_in(major, msg) #define gone_in_dev(dev, major, msg) __gone_ok(major, msg) _gone_in_dev(dev, major, msg) + +#if defined(INVARIANTS) || defined(WITNESS) +#define __diagused +#else +#define __diagused __unused +#endif + #endif /* _KERNEL */ __NULLABILITY_PRAGMA_POP From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 22:31:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6422766E2FA; Wed, 21 Jul 2021 22:31:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVVfh2HCpz3kHy; Wed, 21 Jul 2021 22:31:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3665D261DB; Wed, 21 Jul 2021 22:31:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LMV8hG089883; Wed, 21 Jul 2021 22:31:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LMV8qN089882; Wed, 21 Jul 2021 22:31:08 GMT (envelope-from git) Date: Wed, 21 Jul 2021 22:31:08 GMT Message-Id: <202107212231.16LMV8qN089882@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 855fb8944c59 - stable/13 - Add sv_onexec_old() sysent hook for exec event MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 855fb8944c5977abdd37ec2e1440e4332f5a6c4b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 22:31:08 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=855fb8944c5977abdd37ec2e1440e4332f5a6c4b commit 855fb8944c5977abdd37ec2e1440e4332f5a6c4b Author: Konstantin Belousov AuthorDate: 2021-07-01 18:04:06 +0000 Commit: Konstantin Belousov CommitDate: 2021-07-21 22:11:51 +0000 Add sv_onexec_old() sysent hook for exec event (cherry picked from commit 71ab344524a14f00f21c4c5638906d7b965d2b64) --- sys/kern/kern_exec.c | 2 ++ sys/sys/sysent.h | 1 + 2 files changed, 3 insertions(+) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 01ec7de5d3c1..de1294ff6954 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1057,6 +1057,8 @@ exec_new_vmspace(struct image_params *imgp, struct sysentvec *sv) sigfastblock_clear(td); umtx_exec(p); + if (p->p_sysent->sv_onexec_old != NULL) + p->p_sysent->sv_onexec_old(td); itimers_exec(p); if (sv->sv_onexec != NULL) sv->sv_onexec(p, imgp); diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index 8b0903f7dcc0..ff37806efd96 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -145,6 +145,7 @@ struct sysentvec { u_long *sv_hwcap2; /* Value passed in AT_HWCAP2. */ const char *(*sv_machine_arch)(struct proc *); vm_offset_t sv_fxrng_gen_base; + void (*sv_onexec_old)(struct thread *td); void (*sv_onexec)(struct proc *, struct image_params *); void (*sv_onexit)(struct proc *); void (*sv_ontdexit)(struct thread *td); From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 22:31:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B916E66E385; Wed, 21 Jul 2021 22:31:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVVfk45d2z3kCj; Wed, 21 Jul 2021 22:31:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73E6B261DE; Wed, 21 Jul 2021 22:31:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LMVAJ3089938; Wed, 21 Jul 2021 22:31:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LMVA21089937; Wed, 21 Jul 2021 22:31:10 GMT (envelope-from git) Date: Wed, 21 Jul 2021 22:31:10 GMT Message-Id: <202107212231.16LMVA21089937@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 39f259b1d5a8 - stable/13 - Do not call FreeBSD-ABI specific code for all ABIs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 39f259b1d5a8df8ed821153b48877bf4beb5a4eb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 22:31:10 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=39f259b1d5a8df8ed821153b48877bf4beb5a4eb commit 39f259b1d5a8df8ed821153b48877bf4beb5a4eb Author: Konstantin Belousov AuthorDate: 2021-07-01 18:00:29 +0000 Commit: Konstantin Belousov CommitDate: 2021-07-21 22:11:52 +0000 Do not call FreeBSD-ABI specific code for all ABIs (cherry picked from commit 28a66fc3da3460850520389971e1194f5327f560) --- sys/amd64/amd64/elf_machdep.c | 4 ++++ sys/arm/arm/elf_machdep.c | 2 ++ sys/arm64/arm64/elf32_machdep.c | 2 ++ sys/arm64/arm64/elf_machdep.c | 2 ++ sys/compat/ia32/ia32_sysvec.c | 2 ++ sys/i386/i386/elf_machdep.c | 2 ++ sys/kern/imgact_aout.c | 4 ++++ sys/kern/kern_exec.c | 9 +++++++-- sys/kern/kern_exit.c | 8 +++++++- sys/mips/mips/elf_machdep.c | 2 ++ sys/powerpc/powerpc/elf32_machdep.c | 2 ++ sys/powerpc/powerpc/elf64_machdep.c | 4 ++++ sys/riscv/riscv/elf_machdep.c | 2 ++ sys/sys/sysent.h | 3 +++ 14 files changed, 45 insertions(+), 3 deletions(-) diff --git a/sys/amd64/amd64/elf_machdep.c b/sys/amd64/amd64/elf_machdep.c index a3fb1184bb05..445efa883fd2 100644 --- a/sys/amd64/amd64/elf_machdep.c +++ b/sys/amd64/amd64/elf_machdep.c @@ -82,6 +82,8 @@ struct sysentvec elf64_freebsd_sysvec_la48 = { .sv_thread_detach = NULL, .sv_trap = NULL, .sv_stackgap = elf64_stackgap, + .sv_onexec_old = exec_onexec_old, + .sv_onexit = exit_onexit, }; struct sysentvec elf64_freebsd_sysvec_la57 = { @@ -117,6 +119,8 @@ struct sysentvec elf64_freebsd_sysvec_la57 = { .sv_thread_detach = NULL, .sv_trap = NULL, .sv_stackgap = elf64_stackgap, + .sv_onexec_old = exec_onexec_old, + .sv_onexit = exit_onexit, }; static void diff --git a/sys/arm/arm/elf_machdep.c b/sys/arm/arm/elf_machdep.c index d32dbb5baf90..6eaea9b92f2f 100644 --- a/sys/arm/arm/elf_machdep.c +++ b/sys/arm/arm/elf_machdep.c @@ -97,6 +97,8 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_trap = NULL, .sv_hwcap = &elf_hwcap, .sv_hwcap2 = &elf_hwcap2, + .sv_onexec_old = exec_onexec_old, + .sv_onexit = exit_onexit, }; INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); diff --git a/sys/arm64/arm64/elf32_machdep.c b/sys/arm64/arm64/elf32_machdep.c index 6c98f7c839ca..48d6dc189e3a 100644 --- a/sys/arm64/arm64/elf32_machdep.c +++ b/sys/arm64/arm64/elf32_machdep.c @@ -109,6 +109,8 @@ static struct sysentvec elf32_freebsd_sysvec = { .sv_schedtail = NULL, .sv_thread_detach = NULL, .sv_trap = NULL, + .sv_onexec_old = exec_onexec_old, + .sv_onexit = exit_onexit, }; INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); diff --git a/sys/arm64/arm64/elf_machdep.c b/sys/arm64/arm64/elf_machdep.c index cd12d40c37df..102097b2dbb5 100644 --- a/sys/arm64/arm64/elf_machdep.c +++ b/sys/arm64/arm64/elf_machdep.c @@ -92,6 +92,8 @@ static struct sysentvec elf64_freebsd_sysvec = { .sv_trap = NULL, .sv_hwcap = &elf_hwcap, .sv_hwcap2 = &elf_hwcap2, + .sv_onexec_old = exec_onexec_old, + .sv_onexit = exit_onexit, }; INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec); diff --git a/sys/compat/ia32/ia32_sysvec.c b/sys/compat/ia32/ia32_sysvec.c index f5a2c1200fc6..3973811ab62b 100644 --- a/sys/compat/ia32/ia32_sysvec.c +++ b/sys/compat/ia32/ia32_sysvec.c @@ -128,6 +128,8 @@ struct sysentvec ia32_freebsd_sysvec = { .sv_thread_detach = NULL, .sv_trap = NULL, .sv_stackgap = elf32_stackgap, + .sv_onexec_old = exec_onexec_old, + .sv_onexit = exit_onexit, }; INIT_SYSENTVEC(elf_ia32_sysvec, &ia32_freebsd_sysvec); diff --git a/sys/i386/i386/elf_machdep.c b/sys/i386/i386/elf_machdep.c index 0d870748967e..ef808e65fd9a 100644 --- a/sys/i386/i386/elf_machdep.c +++ b/sys/i386/i386/elf_machdep.c @@ -83,6 +83,8 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_schedtail = NULL, .sv_thread_detach = NULL, .sv_trap = NULL, + .sv_onexec_old = exec_onexec_old, + .sv_onexit = exit_onexit, }; INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c index 3255ef169f70..9e7455e14e1d 100644 --- a/sys/kern/imgact_aout.c +++ b/sys/kern/imgact_aout.c @@ -101,6 +101,8 @@ struct sysentvec aout_sysvec = { .sv_schedtail = NULL, .sv_thread_detach = NULL, .sv_trap = NULL, + .sv_onexec_old = exec_onexec_old, + .sv_onexit = exit_onexit, }; #elif defined(__amd64__) @@ -137,6 +139,8 @@ struct sysentvec aout_sysvec = { .sv_set_syscall_retval = ia32_set_syscall_retval, .sv_fetch_syscall_args = ia32_fetch_syscall_args, .sv_syscallnames = freebsd32_syscallnames, + .sv_onexec_old = exec_onexec_old, + .sv_onexit = exit_onexit, }; #else #error "Port me" diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index de1294ff6954..491e5332c834 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1033,6 +1033,13 @@ exec_unmap_first_page(struct image_params *imgp) } } +void +exec_onexec_old(struct thread *td) +{ + sigfastblock_clear(td); + umtx_exec(td->td_proc); +} + /* * Destroy old address space, and allocate a new stack. * The new stack is only sgrowsiz large because it is grown @@ -1055,8 +1062,6 @@ exec_new_vmspace(struct image_params *imgp, struct sysentvec *sv) imgp->vmspace_destroyed = 1; imgp->sysent = sv; - sigfastblock_clear(td); - umtx_exec(p); if (p->p_sysent->sv_onexec_old != NULL) p->p_sysent->sv_onexec_old(td); itimers_exec(p); diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 515c2d4e6397..bfd25366b49c 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -195,6 +195,13 @@ proc_clear_orphan(struct proc *p) p->p_treeflag &= ~P_TREE_ORPHANED; } +void +exit_onexit(struct proc *p) +{ + MPASS(p->p_numthreads == 1); + umtx_thread_exit(FIRST_THREAD_IN_PROC(p)); +} + /* * exit -- death of process. */ @@ -370,7 +377,6 @@ exit1(struct thread *td, int rval, int signo) PROC_UNLOCK(p); - umtx_thread_exit(td); if (p->p_sysent->sv_onexit != NULL) p->p_sysent->sv_onexit(p); seltdfini(td); diff --git a/sys/mips/mips/elf_machdep.c b/sys/mips/mips/elf_machdep.c index 9e27e5e7f2a4..8ac07a5b0ac6 100644 --- a/sys/mips/mips/elf_machdep.c +++ b/sys/mips/mips/elf_machdep.c @@ -89,6 +89,8 @@ static struct sysentvec elf_freebsd_sysvec = { .sv_schedtail = NULL, .sv_thread_detach = NULL, .sv_trap = NULL, + .sv_onexec_old = exec_onexec_old, + .sv_onexit = exit_onexit, }; static __ElfN(Brandinfo) freebsd_brand_info = { diff --git a/sys/powerpc/powerpc/elf32_machdep.c b/sys/powerpc/powerpc/elf32_machdep.c index 04150f02bb9c..e98b4c3f08c2 100644 --- a/sys/powerpc/powerpc/elf32_machdep.c +++ b/sys/powerpc/powerpc/elf32_machdep.c @@ -131,6 +131,8 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_trap = NULL, .sv_hwcap = &cpu_features, .sv_hwcap2 = &cpu_features2, + .sv_onexec_old = exec_onexec_old, + .sv_onexit = exit_onexit, }; INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); diff --git a/sys/powerpc/powerpc/elf64_machdep.c b/sys/powerpc/powerpc/elf64_machdep.c index 1bca857d9ca5..37765381745e 100644 --- a/sys/powerpc/powerpc/elf64_machdep.c +++ b/sys/powerpc/powerpc/elf64_machdep.c @@ -93,6 +93,8 @@ struct sysentvec elf64_freebsd_sysvec_v1 = { .sv_trap = NULL, .sv_hwcap = &cpu_features, .sv_hwcap2 = &cpu_features2, + .sv_onexec_old = exec_onexec_old, + .sv_onexit = exit_onexit, }; struct sysentvec elf64_freebsd_sysvec_v2 = { @@ -129,6 +131,8 @@ struct sysentvec elf64_freebsd_sysvec_v2 = { .sv_trap = NULL, .sv_hwcap = &cpu_features, .sv_hwcap2 = &cpu_features2, + .sv_onexec_old = exec_onexec_old, + .sv_onexit = exit_onexit, }; static boolean_t ppc64_elfv1_header_match(struct image_params *params, diff --git a/sys/riscv/riscv/elf_machdep.c b/sys/riscv/riscv/elf_machdep.c index 06d117128ef7..cf479ec6d154 100644 --- a/sys/riscv/riscv/elf_machdep.c +++ b/sys/riscv/riscv/elf_machdep.c @@ -96,6 +96,8 @@ struct sysentvec elf64_freebsd_sysvec = { .sv_trap = NULL, .sv_hwcap = &elf_hwcap, .sv_machine_arch = riscv_machine_arch, + .sv_onexec_old = exec_onexec_old, + .sv_onexit = exit_onexit, }; INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec); diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index ff37806efd96..a6b4b9fe9378 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -317,6 +317,9 @@ void exec_sysvec_init(void *param); void exec_sysvec_init_secondary(struct sysentvec *sv, struct sysentvec *sv2); void exec_inittk(void); +void exit_onexit(struct proc *p); +void exec_onexec_old(struct thread *td); + #define INIT_SYSENTVEC(name, sv) \ SYSINIT(name, SI_SUB_EXEC, SI_ORDER_ANY, \ (sysinit_cfunc_t)exec_sysvec_init, sv); From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 22:31:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B330966E302; Wed, 21 Jul 2021 22:31:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVVfj3d9wz3kNQ; Wed, 21 Jul 2021 22:31:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42685261DC; Wed, 21 Jul 2021 22:31:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LMV9BX089907; Wed, 21 Jul 2021 22:31:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LMV9hq089906; Wed, 21 Jul 2021 22:31:09 GMT (envelope-from git) Date: Wed, 21 Jul 2021 22:31:09 GMT Message-Id: <202107212231.16LMV9hq089906@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: cdb79e2e08c2 - stable/13 - Move sv_onexit() sysentvec hook slightly later MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cdb79e2e08c226149473393fc7d59af574152823 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 22:31:10 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cdb79e2e08c226149473393fc7d59af574152823 commit cdb79e2e08c226149473393fc7d59af574152823 Author: Konstantin Belousov AuthorDate: 2021-07-01 18:06:42 +0000 Commit: Konstantin Belousov CommitDate: 2021-07-21 22:11:52 +0000 Move sv_onexit() sysentvec hook slightly later (cherry picked from commit 55976ce11a10765dee6c71b7ed6eac016bd560ef) --- sys/kern/kern_exit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index fcd8b39a8ee2..515c2d4e6397 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -340,9 +340,6 @@ exit1(struct thread *td, int rval, int signo) itimers_exit(p); - if (p->p_sysent->sv_onexit != NULL) - p->p_sysent->sv_onexit(p); - /* * Check if any loadable modules need anything done at process exit. * E.g. SYSV IPC stuff. @@ -374,6 +371,8 @@ exit1(struct thread *td, int rval, int signo) PROC_UNLOCK(p); umtx_thread_exit(td); + if (p->p_sysent->sv_onexit != NULL) + p->p_sysent->sv_onexit(p); seltdfini(td); /* From owner-dev-commits-src-branches@freebsd.org Wed Jul 21 22:31:12 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B5C8F66E2FB; Wed, 21 Jul 2021 22:31:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVVfl64nVz3kLJ; Wed, 21 Jul 2021 22:31:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D86F261DF; Wed, 21 Jul 2021 22:31:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16LMVB4q089962; Wed, 21 Jul 2021 22:31:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16LMVBMD089961; Wed, 21 Jul 2021 22:31:11 GMT (envelope-from git) Date: Wed, 21 Jul 2021 22:31:11 GMT Message-Id: <202107212231.16LMVBMD089961@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: df674da44ef9 - stable/13 - cloudabi and linux ABIs: do not call umtx_thread_cleanup() from thr_exit syscall MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: df674da44ef9e565afb1edb36fd730a34b4aaf9f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2021 22:31:13 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=df674da44ef9e565afb1edb36fd730a34b4aaf9f commit df674da44ef9e565afb1edb36fd730a34b4aaf9f Author: Konstantin Belousov AuthorDate: 2021-07-01 22:30:59 +0000 Commit: Konstantin Belousov CommitDate: 2021-07-21 22:11:52 +0000 cloudabi and linux ABIs: do not call umtx_thread_cleanup() from thr_exit syscall (cherry picked from commit 747a6b7ace3dd9401289bde8c4e7fc91b8dc18dc) --- sys/compat/cloudabi/cloudabi_thread.c | 3 --- sys/compat/linux/linux_fork.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/sys/compat/cloudabi/cloudabi_thread.c b/sys/compat/cloudabi/cloudabi_thread.c index e70549b6e332..f920b8b41ee8 100644 --- a/sys/compat/cloudabi/cloudabi_thread.c +++ b/sys/compat/cloudabi/cloudabi_thread.c @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include @@ -45,8 +44,6 @@ cloudabi_sys_thread_exit(struct thread *td, .scope = uap->scope, }; - umtx_thread_exit(td); - /* Wake up joining thread. */ cloudabi_sys_lock_unlock(td, &cloudabi_sys_lock_unlock_args); diff --git a/sys/compat/linux/linux_fork.c b/sys/compat/linux/linux_fork.c index ed4adcf8a175..8230d5b4108b 100644 --- a/sys/compat/linux/linux_fork.c +++ b/sys/compat/linux/linux_fork.c @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -376,8 +375,6 @@ linux_exit(struct thread *td, struct linux_exit_args *args) LINUX_CTR2(exit, "thread(%d) (%d)", em->em_tid, args->rval); - umtx_thread_exit(td); - linux_thread_detach(td); /* From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 09:14:04 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 543EA656DA3; Thu, 22 Jul 2021 09:14:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVmwX1kgBz3L48; Thu, 22 Jul 2021 09:14:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22019736B; Thu, 22 Jul 2021 09:14:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16M9E4Av048150; Thu, 22 Jul 2021 09:14:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16M9E4PB048149; Thu, 22 Jul 2021 09:14:04 GMT (envelope-from git) Date: Thu, 22 Jul 2021 09:14:04 GMT Message-Id: <202107220914.16M9E4PB048149@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 9b1219b24a5a - stable/13 - tcp: fix RACK and BBR when using VIMAGE enabled kernel MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9b1219b24a5adaca44833287ac2727e3523e3b62 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 09:14:04 -0000 The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=9b1219b24a5adaca44833287ac2727e3523e3b62 commit 9b1219b24a5adaca44833287ac2727e3523e3b62 Author: Michael Tuexen AuthorDate: 2021-07-19 22:29:18 +0000 Commit: Michael Tuexen CommitDate: 2021-07-22 09:13:31 +0000 tcp: fix RACK and BBR when using VIMAGE enabled kernel Fix a bug in VNET handling, which occurs when using specific NICs. PR: 257195 Reviewed by: rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D31212 (cherry picked from commit a730d82378d3cdf5356775ec0c23ad2ca40c5edb) --- sys/netinet/tcp_stacks/rack_bbr_common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack_bbr_common.c b/sys/netinet/tcp_stacks/rack_bbr_common.c index d9f48f733e93..6fe11d9d2e52 100644 --- a/sys/netinet/tcp_stacks/rack_bbr_common.c +++ b/sys/netinet/tcp_stacks/rack_bbr_common.c @@ -510,16 +510,18 @@ skip_vnet: m_freem(m); m = m_save; } - if (no_vn == 0) + if (no_vn == 0) { CURVNET_RESTORE(); + } INP_UNLOCK_ASSERT(inp); return(retval); } skipped_pkt: m = m_save; } - if (no_vn == 0) + if (no_vn == 0) { CURVNET_RESTORE(); + } return(retval); } From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 10:33:26 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80EE365767D; Thu, 22 Jul 2021 10:33:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVph62rm4z3pls; Thu, 22 Jul 2021 10:33:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 499DA10452; Thu, 22 Jul 2021 10:33:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MAXQ2J055683; Thu, 22 Jul 2021 10:33:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MAXQVW055682; Thu, 22 Jul 2021 10:33:26 GMT (envelope-from git) Date: Thu, 22 Jul 2021 10:33:26 GMT Message-Id: <202107221033.16MAXQVW055682@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 17658c8a6d90 - stable/13 - Create namespace for the symbols added during 14-CURRENT cycle. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 17658c8a6d90d4baf1d2c8f79258c534c549b7a5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 10:33:26 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=17658c8a6d90d4baf1d2c8f79258c534c549b7a5 commit 17658c8a6d90d4baf1d2c8f79258c534c549b7a5 Author: Konstantin Belousov AuthorDate: 2021-07-14 15:41:05 +0000 Commit: Konstantin Belousov CommitDate: 2021-07-22 10:33:10 +0000 Create namespace for the symbols added during 14-CURRENT cycle. (cherry picked from commit 8c3ea3f4c4f343e5ecf653e2a50e1fb178cd0b02) --- lib/libc/Versions.def | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/libc/Versions.def b/lib/libc/Versions.def index fce33f53a475..fea6693cee8a 100644 --- a/lib/libc/Versions.def +++ b/lib/libc/Versions.def @@ -35,6 +35,9 @@ FBSD_1.5 { FBSD_1.6 { } FBSD_1.5; +FBSD_1.7 { +} FBSD_1.6; + # This is our private namespace. Any global interfaces that are # strictly for use only by other FreeBSD applications and libraries # are listed here. We use a separate namespace so we can write @@ -42,4 +45,4 @@ FBSD_1.6 { # # Please do NOT increment the version of this namespace. FBSDprivate_1.0 { -} FBSD_1.6; +} FBSD_1.7; From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 10:33:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC216657B5D; Thu, 22 Jul 2021 10:33:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVph74Jj6z3pT9; Thu, 22 Jul 2021 10:33:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7701C10453; Thu, 22 Jul 2021 10:33:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MAXRmm055714; Thu, 22 Jul 2021 10:33:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MAXRbD055713; Thu, 22 Jul 2021 10:33:27 GMT (envelope-from git) Date: Thu, 22 Jul 2021 10:33:27 GMT Message-Id: <202107221033.16MAXRbD055713@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: dba677d13b26 - stable/13 - libc: add mempcpy(3) and wmempcpy(3) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dba677d13b26ad5422133b2ab76486b74d63ade4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 10:33:28 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=dba677d13b26ad5422133b2ab76486b74d63ade4 commit dba677d13b26ad5422133b2ab76486b74d63ade4 Author: Konstantin Belousov AuthorDate: 2021-07-14 15:41:36 +0000 Commit: Konstantin Belousov CommitDate: 2021-07-22 10:33:10 +0000 libc: add mempcpy(3) and wmempcpy(3) (cherry picked from commit ee37f64cf875255338f917a9da76c643cf59786c) --- include/string.h | 3 +++ include/wchar.h | 3 +++ lib/libc/string/Makefile.inc | 6 ++++-- lib/libc/string/Symbol.map | 5 +++++ lib/libc/string/memcpy.3 | 19 +++++++++++++++---- lib/libc/string/mempcpy.c | 41 +++++++++++++++++++++++++++++++++++++++++ lib/libc/string/wmemchr.3 | 10 +++++++--- lib/libc/string/wmempcpy.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 120 insertions(+), 9 deletions(-) diff --git a/include/string.h b/include/string.h index 774cf5fe9756..afa90c3f2536 100644 --- a/include/string.h +++ b/include/string.h @@ -66,6 +66,9 @@ void *memcpy(void * __restrict, const void * __restrict, size_t); void *memmem(const void *, size_t, const void *, size_t) __pure; #endif void *memmove(void *, const void *, size_t); +#if __BSD_VISIBLE +void *mempcpy(void * __restrict, const void * __restrict, size_t); +#endif void *memset(void *, int, size_t); #if __POSIX_VISIBLE >= 200809 char *stpcpy(char * __restrict, const char * __restrict); diff --git a/include/wchar.h b/include/wchar.h index 1c9d232d47e3..78f2f010048f 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -172,6 +172,9 @@ wchar_t *wmemchr(const wchar_t *, wchar_t, size_t) __pure; int wmemcmp(const wchar_t *, const wchar_t *, size_t) __pure; wchar_t *wmemcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t); wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t); +#if __BSD_VISIBLE +wchar_t *wmempcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t); +#endif wchar_t *wmemset(wchar_t *, wchar_t, size_t); int wprintf(const wchar_t * __restrict, ...); int wscanf(const wchar_t * __restrict, ...); diff --git a/lib/libc/string/Makefile.inc b/lib/libc/string/Makefile.inc index 6e6a3f42f723..6945155812af 100644 --- a/lib/libc/string/Makefile.inc +++ b/lib/libc/string/Makefile.inc @@ -10,7 +10,7 @@ CFLAGS+= -I${LIBC_SRCTOP}/locale MISRCS+=bcmp.c bcopy.c bzero.c explicit_bzero.c \ ffs.c ffsl.c ffsll.c fls.c flsl.c flsll.c \ memccpy.c memchr.c memrchr.c memcmp.c \ - memcpy.c memmem.c memmove.c memset.c memset_s.c \ + memcpy.c memmem.c memmove.c mempcpy.c memset.c memset_s.c \ stpcpy.c stpncpy.c strcasecmp.c \ strcat.c strcasestr.c strchr.c strchrnul.c strcmp.c strcoll.c strcpy.c\ strcspn.c strdup.c strerror.c strlcat.c strlcpy.c strlen.c strmode.c \ @@ -25,7 +25,7 @@ MISRCS+=bcmp.c bcopy.c bzero.c explicit_bzero.c \ wcsncpy.c wcsnlen.c wcspbrk.c \ wcsrchr.c wcsspn.c wcsstr.c wcstok.c wcswidth.c wcsxfrm.c wmemchr.c \ wmemcmp.c \ - wmemcpy.c wmemmove.c wmemset.c + wmemcpy.c wmemmove.c wmempcpy.c wmemset.c SYM_MAPS+= ${LIBC_SRCTOP}/string/Symbol.map @@ -50,6 +50,7 @@ MLINKS+=ffs.3 ffsl.3 \ ffs.3 flsll.3 MLINKS+=index.3 rindex.3 MLINKS+=memchr.3 memrchr.3 +MLINKS+=memcpy.3 mempcpy.3 MLINKS+=memset.3 memset_s.3 MLINKS+=strcasecmp.3 strncasecmp.3 \ strcasecmp.3 strcasecmp_l.3 \ @@ -101,4 +102,5 @@ MLINKS+=wmemchr.3 wcpcpy.3 \ wmemchr.3 wmemcmp.3 \ wmemchr.3 wmemcpy.3 \ wmemchr.3 wmemmove.3 \ + wmemchr.3 wmempcpy.3 \ wmemchr.3 wmemset.3 diff --git a/lib/libc/string/Symbol.map b/lib/libc/string/Symbol.map index 450b745c7e0a..ec45d7fd7ddb 100644 --- a/lib/libc/string/Symbol.map +++ b/lib/libc/string/Symbol.map @@ -114,6 +114,11 @@ FBSD_1.6 { strerror_l; }; +FBSD_1.7 { + mempcpy; + wmempcpy; +}; + FBSDprivate_1.0 { __strtok_r; }; diff --git a/lib/libc/string/memcpy.3 b/lib/libc/string/memcpy.3 index febc0fa34dd9..c65e4145264a 100644 --- a/lib/libc/string/memcpy.3 +++ b/lib/libc/string/memcpy.3 @@ -32,7 +32,7 @@ .\" @(#)memcpy.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd July 14, 2021 .Dt MEMCPY 3 .Os .Sh NAME @@ -44,11 +44,15 @@ .In string.h .Ft void * .Fn memcpy "void *dst" "const void *src" "size_t len" +.Ft void * +.Fn mempcpy "void *dst" "const void *src" "size_t len" .Sh DESCRIPTION The .Fn memcpy -function -copies +and +.Fn mempcpy +functions +copy .Fa len bytes from string .Fa src @@ -65,12 +69,17 @@ The function returns the original value of .Fa dst . +.Pp +The +.Fn mempcpy +function returns a pointer to the byte after the last written byte. .Sh SEE ALSO .Xr bcopy 3 , .Xr memccpy 3 , .Xr memmove 3 , .Xr strcpy 3 , .Xr wmemcpy 3 +.Xr wmempcpy 3 .Sh STANDARDS The .Fn memcpy @@ -80,7 +89,9 @@ conforms to .Sh BUGS In this implementation .Fn memcpy -is implemented using +and +.Fn mempcpy +are implemented using .Xr bcopy 3 , and therefore the strings may overlap. On other systems, copying overlapping strings may produce surprises. diff --git a/lib/libc/string/mempcpy.c b/lib/libc/string/mempcpy.c new file mode 100644 index 000000000000..12c0d791e9d3 --- /dev/null +++ b/lib/libc/string/mempcpy.c @@ -0,0 +1,41 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +void * +mempcpy(void *__restrict dst, const void *__restrict src, size_t len) +{ + return ((char *)memcpy(dst, src, len) + len); +} diff --git a/lib/libc/string/wmemchr.3 b/lib/libc/string/wmemchr.3 index 37ba05031ca9..8a926eef456a 100644 --- a/lib/libc/string/wmemchr.3 +++ b/lib/libc/string/wmemchr.3 @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 4, 2009 +.Dd July 14, 2021 .Dt WMEMCHR 3 .Os .Sh NAME @@ -43,6 +43,7 @@ .Nm wmemcmp , .Nm wmemcpy , .Nm wmemmove , +.Nm wmempcpy , .Nm wmemset , .Nm wcpcpy , .Nm wcpncpy , @@ -79,6 +80,8 @@ .Ft wchar_t * .Fn wmemmove "wchar_t *s1" "const wchar_t *s2" "size_t n" .Ft wchar_t * +.Fn wmempcpy "wchar_t * restrict s1" "const wchar_t * restrict s2" "size_t n" +.Ft wchar_t * .Fn wmemset "wchar_t *s" "wchar_t c" "size_t n" .Ft wchar_t * .Fn wcpcpy "wchar_t *s1" "wchar_t *s2" @@ -168,7 +171,8 @@ and which conform to .St -p1003.1-2008 ; and -.Fn wcslcat -and +.Fn wcslcat , .Fn wcslcpy , +and +.Fn wmempcpy , which are extensions. diff --git a/lib/libc/string/wmempcpy.c b/lib/libc/string/wmempcpy.c new file mode 100644 index 000000000000..208d62a26849 --- /dev/null +++ b/lib/libc/string/wmempcpy.c @@ -0,0 +1,42 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +wchar_t * +wmempcpy(wchar_t *__restrict dst, const wchar_t *__restrict src, size_t len) +{ + return (wmemcpy(dst, src, len) + len); +} From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 16:40:38 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EEAB565FE7C; Thu, 22 Jul 2021 16:40:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVyqp6TgTz3v56; Thu, 22 Jul 2021 16:40:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C69D915594; Thu, 22 Jul 2021 16:40:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MGecwV045206; Thu, 22 Jul 2021 16:40:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MGecvj045205; Thu, 22 Jul 2021 16:40:38 GMT (envelope-from git) Date: Thu, 22 Jul 2021 16:40:38 GMT Message-Id: <202107221640.16MGecvj045205@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 5c11eddf9578 - stable/13 - share/man/man9/pwmbus.9 fix types in arguments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5c11eddf9578a09daa3e0146a8e3441f7d179f23 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 16:40:39 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=5c11eddf9578a09daa3e0146a8e3441f7d179f23 commit 5c11eddf9578a09daa3e0146a8e3441f7d179f23 Author: Oskar Holmund AuthorDate: 2021-03-11 08:53:26 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 16:39:56 +0000 share/man/man9/pwmbus.9 fix types in arguments Fix the types of period and duty in share/man/man9/pwmbus.9 to match the one in sys/dev/pmw/pwmbus.c. Reviewed By: rpokala Differential Revision: https://reviews.freebsd.org/D29139 MFC after: 3 days (cherry picked from commit 7d4a5de84d5e54242edc06573522616869e0b37a) --- share/man/man9/pwmbus.9 | 30 +++++++++++++++--------------- sys/dev/pwm/pwmbus_if.m | 14 +++++++------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/share/man/man9/pwmbus.9 b/share/man/man9/pwmbus.9 index a233d035dba9..858a27b9afe3 100644 --- a/share/man/man9/pwmbus.9 +++ b/share/man/man9/pwmbus.9 @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 21, 2019 +.Dd March 9, 2021 .Dt PWMBUS 9 .Os .Sh NAME @@ -40,19 +40,19 @@ .Cd "device pwm" .In "pwmbus_if.h" .Ft int -.Fn PWMBUS_CHANNEL_CONFIG "device_t bus" "int channel" "uint64_t period" "uint64_t duty" +.Fn PWMBUS_CHANNEL_CONFIG "device_t bus" "u_int channel" "u_int period" "u_int duty" .Ft int -.Fn PWMBUS_CHANNEL_COUNT "device_t bus" "int channel" "int *nchannel" +.Fn PWMBUS_CHANNEL_COUNT "device_t bus" "u_int *nchannel" .Ft int -.Fn PWMBUS_CHANNEL_ENABLE "device_t bus" "int channel" "bool enable" +.Fn PWMBUS_CHANNEL_ENABLE "device_t bus" "u_int channel" "bool enable" .Ft int -.Fn PWMBUS_CHANNEL_GET_CONFIG "device_t bus" "int channel" "uint64_t *period" "uint64_t *duty" +.Fn PWMBUS_CHANNEL_GET_CONFIG "device_t bus" "u_int channel" "u_int *period" "u_int *duty" .Ft int -.Fn PWMBUS_CHANNEL_GET_FLAGS "device_t bus" "int channel" "uint32_t *flags" +.Fn PWMBUS_CHANNEL_GET_FLAGS "device_t bus" "u_int channel" "uint32_t *flags" .Ft int -.Fn PWMBUS_CHANNEL_IS_ENABLED "device_t bus" "int channel" "bool *enabled" +.Fn PWMBUS_CHANNEL_IS_ENABLED "device_t bus" "u_int channel" "bool *enabled" .Ft int -.Fn PWMBUS_CHANNEL_SET_FLAGS "device_t bus" "int channel" "uint32_t flags" +.Fn PWMBUS_CHANNEL_SET_FLAGS "device_t bus" "u_int channel" "uint32_t flags" .Sh DESCRIPTION The PWMBUS (Pulse-Width Modulation) interface allows a device driver to register to a global bus so other devices in the kernel can use them in a @@ -76,7 +76,7 @@ Consult the documentation for the underlying PWM hardware device driver for details on channels that share resources. .Sh INTERFACE .Bl -tag -width indent -.It Fn PWMBUS_CHANNEL_CONFIG "device_t bus" "int channel" "uint64_t period" "uint64_t duty" +.It Fn PWMBUS_CHANNEL_CONFIG "device_t bus" "u_int channel" "u_int period" "u_int duty" Configure the period and duty (in nanoseconds) in the PWM controller on the bus for the specified channel. Returns 0 on success or @@ -85,19 +85,19 @@ if the values are not supported by the controller or .Er EBUSY if the PWMBUS controller is in use and does not support changing the value on the fly. -.It Fn PWMBUS_CHANNEL_COUNT "device_t bus" "int *nchannel" +.It Fn PWMBUS_CHANNEL_COUNT "device_t bus" "u_int *nchannel" Get the number of channels supported by the controller. -.It Fn PWMBUS_CHANNEL_ENABLE "device_t bus" "int channel" "bool enable" +.It Fn PWMBUS_CHANNEL_ENABLE "device_t bus" "u_int channel" "bool enable" Enable the PWM channel. -.It Fn PWMBUS_CHANNEL_GET_CONFIG "device_t bus" "int channel" "uint64_t *period" "uint64_t *duty" +.It Fn PWMBUS_CHANNEL_GET_CONFIG "device_t bus" "u_int channel" "u_int *period" "u_int *duty" Get the current configuration of the period and duty for the specified channel. -.It Fn PWMBUS_CHANNEL_GET_FLAGS "device_t bus" "int channel" "uint32_t *flags" +.It Fn PWMBUS_CHANNEL_GET_FLAGS "device_t bus" "u_int channel" "uint32_t *flags" Get the current flags for the channel. If the driver or controller does not support this, a default method returns a flags value of zero. -.It Fn PWMBUS_CHANNEL_IS_ENABLED "device_t bus" "int channel" "bool *enable" +.It Fn PWMBUS_CHANNEL_IS_ENABLED "device_t bus" "u_int channel" "bool *enable" Test whether the PWM channel is enabled. -.It Fn PWMBUS_CHANNEL_SET_FLAGS "device_t bus" "int channel" "uint32_t flags" +.It Fn PWMBUS_CHANNEL_SET_FLAGS "device_t bus" "u_int channel" "uint32_t flags" Set the flags of the channel (such as inverted polarity). If the driver or controller does not support this a do-nothing default method is used. diff --git a/sys/dev/pwm/pwmbus_if.m b/sys/dev/pwm/pwmbus_if.m index 4e7b49bf405c..f81e92907847 100644 --- a/sys/dev/pwm/pwmbus_if.m +++ b/sys/dev/pwm/pwmbus_if.m @@ -33,14 +33,14 @@ INTERFACE pwmbus; CODE { static int - pwm_default_set_flags(device_t dev, u_int channel, uint32_t flags) + pwm_default_set_flags(device_t bus, u_int channel, uint32_t flags) { return (EOPNOTSUPP); } static int - pwm_default_get_flags(device_t dev, u_int channel, uint32_t *flags) + pwm_default_get_flags(device_t bus, u_int channel, uint32_t *flags) { *flags = 0; @@ -55,8 +55,8 @@ CODE { METHOD int channel_config { device_t bus; u_int channel; - unsigned int period; - unsigned int duty; + u_int period; + u_int duty; }; # @@ -66,8 +66,8 @@ METHOD int channel_config { METHOD int channel_get_config { device_t bus; u_int channel; - unsigned int *period; - unsigned int *duty; + u_int *period; + u_int *duty; }; # @@ -83,7 +83,7 @@ METHOD int channel_set_flags { # Get the flags # METHOD int channel_get_flags { - device_t dev; + device_t bus; u_int channel; uint32_t *flags; } DEFAULT pwm_default_get_flags; From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 16:40:40 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A5476603A3; Thu, 22 Jul 2021 16:40:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVyqr1C6Vz3v2w; Thu, 22 Jul 2021 16:40:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 018DF14ED8; Thu, 22 Jul 2021 16:40:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MGedHI045230; Thu, 22 Jul 2021 16:40:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MGed8r045229; Thu, 22 Jul 2021 16:40:39 GMT (envelope-from git) Date: Thu, 22 Jul 2021 16:40:39 GMT Message-Id: <202107221640.16MGed8r045229@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 120e7f7399fc - stable/13 - usr.sbin/pwm/pwm add support for flags MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 120e7f7399fc47648049fa80e28f249cff5ce18f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 16:40:40 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=120e7f7399fc47648049fa80e28f249cff5ce18f commit 120e7f7399fc47648049fa80e28f249cff5ce18f Author: Oskar Holmund AuthorDate: 2021-03-11 08:55:23 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 16:39:57 +0000 usr.sbin/pwm/pwm add support for flags The pwm utility cant set the only flag defined (PWM_POLARITY_INVERTED) so this patch add the option -I (capital letter i) to send it to the drivers. None of existing PWM driver have implemented support for flags. But soon:ish I will put up an review of a pwm driver using TI OMAP DMTimer. Differential Revision: https://reviews.freebsd.org/D29137 MFC after: 2 weeks (cherry picked from commit 17b14d8f7733d39397ae5fc104547e358f5f7ddf) --- sys/dev/pwm/pwmc.c | 19 ++++++++++++++++--- usr.sbin/pwm/pwm.8 | 3 +++ usr.sbin/pwm/pwm.c | 19 +++++++++++++++---- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/sys/dev/pwm/pwmc.c b/sys/dev/pwm/pwmc.c index c49d1e894488..b2f12add3e2b 100644 --- a/sys/dev/pwm/pwmc.c +++ b/sys/dev/pwm/pwmc.c @@ -80,9 +80,16 @@ pwm_ioctl(struct cdev *dev, u_long cmd, caddr_t data, bcopy(data, &state, sizeof(state)); rv = PWMBUS_CHANNEL_CONFIG(bus, sc->chan, state.period, state.duty); - if (rv == 0) - rv = PWMBUS_CHANNEL_ENABLE(bus, sc->chan, - state.enable); + if (rv != 0) + return (rv); + + rv = PWMBUS_CHANNEL_SET_FLAGS(bus, + sc->chan, state.flags); + if (rv != 0 && rv != EOPNOTSUPP) + return (rv); + + rv = PWMBUS_CHANNEL_ENABLE(bus, sc->chan, + state.enable); break; case PWMGETSTATE: bcopy(data, &state, sizeof(state)); @@ -90,6 +97,12 @@ pwm_ioctl(struct cdev *dev, u_long cmd, caddr_t data, &state.period, &state.duty); if (rv != 0) return (rv); + + rv = PWMBUS_CHANNEL_GET_FLAGS(bus, sc->chan, + &state.flags); + if (rv != 0) + return (rv); + rv = PWMBUS_CHANNEL_IS_ENABLED(bus, sc->chan, &state.enable); if (rv != 0) diff --git a/usr.sbin/pwm/pwm.8 b/usr.sbin/pwm/pwm.8 index 37c1aa8fec49..94be5af7f703 100644 --- a/usr.sbin/pwm/pwm.8 +++ b/usr.sbin/pwm/pwm.8 @@ -35,6 +35,7 @@ .Nm .Op Fl f Ar device .Op Fl D | Fl E +.Op Fl I .Op Fl p Ar period .Op Fl d Ar duty .Sh DESCRIPTION @@ -82,6 +83,8 @@ during which the signal is asserted. Enable the PWM channel. .It Fl p Ar period Configure the period (in nanoseconds) of the PWM channel. +.It Fl I +Invert PWM signal polarity .El .Sh EXAMPLES .Bl -bullet diff --git a/usr.sbin/pwm/pwm.c b/usr.sbin/pwm/pwm.c index a69fe16fea22..441181917afd 100644 --- a/usr.sbin/pwm/pwm.c +++ b/usr.sbin/pwm/pwm.c @@ -48,6 +48,7 @@ #define PWM_SHOW_CONFIG 0x0004 #define PWM_PERIOD 0x0008 #define PWM_DUTY 0x0010 +#define PWM_INVERTED 0x0020 static char device_name[PATH_MAX] = "/dev/pwm/pwmc0.0"; @@ -66,7 +67,7 @@ usage(void) { fprintf(stderr, "Usage:\n"); fprintf(stderr, "\tpwm [-f dev] -C\n"); - fprintf(stderr, "\tpwm [-f dev] [-D | -E] [-p period] [-d duty[%%]]\n"); + fprintf(stderr, "\tpwm [-f dev] [-D | -E] [-I] [-p period] [-d duty[%%]]\n"); exit(1); } @@ -87,7 +88,7 @@ main(int argc, char *argv[]) fd = -1; period = duty = -1; - while ((ch = getopt(argc, argv, "f:EDCp:d:")) != -1) { + while ((ch = getopt(argc, argv, "f:EDCIp:d:")) != -1) { switch (ch) { case 'E': if (action & (PWM_DISABLE | PWM_SHOW_CONFIG)) @@ -104,6 +105,11 @@ main(int argc, char *argv[]) usage(); action = PWM_SHOW_CONFIG; break; + case 'I': + if (action & PWM_SHOW_CONFIG) + usage(); + action |= PWM_INVERTED; + break; case 'p': if (action & PWM_SHOW_CONFIG) usage(); @@ -172,10 +178,11 @@ main(int argc, char *argv[]) } if (action == PWM_SHOW_CONFIG) { - printf("period: %u\nduty: %u\nenabled:%d\n", + printf("period: %u\nduty: %u\nenabled:%d\ninverted:%d\n", state.period, state.duty, - state.enable); + state.enable, + state.flags & PWM_POLARITY_INVERTED); } else { if (action & PWM_ENABLE) state.enable = true; @@ -183,6 +190,10 @@ main(int argc, char *argv[]) state.enable = false; if (action & PWM_PERIOD) state.period = period; + if (action & PWM_INVERTED) + state.flags |= PWM_POLARITY_INVERTED; + else + state.flags &= ~PWM_POLARITY_INVERTED; if (action & PWM_DUTY) { if (*percent != '\0') state.duty = (uint64_t)state.period * duty / 100; From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 16:46:26 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA7616603DC; Thu, 22 Jul 2021 16:46:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVyyV4mdNz3vyj; Thu, 22 Jul 2021 16:46:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88E24154DE; Thu, 22 Jul 2021 16:46:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MGkQEa049741; Thu, 22 Jul 2021 16:46:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MGkQB7049740; Thu, 22 Jul 2021 16:46:26 GMT (envelope-from git) Date: Thu, 22 Jul 2021 16:46:26 GMT Message-Id: <202107221646.16MGkQB7049740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: f62791255998 - stable/13 - mmccam: Add mmc_sim, a generic sim for mmc driver to use MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f62791255998572e224827dd5ef092444dd7e564 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 16:46:26 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=f62791255998572e224827dd5ef092444dd7e564 commit f62791255998572e224827dd5ef092444dd7e564 Author: Emmanuel Vadot AuthorDate: 2021-04-21 11:52:29 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 16:42:09 +0000 mmccam: Add mmc_sim, a generic sim for mmc driver to use This adds a generic sim that abstract a lot of what needs to be implemented in a driver for mmccam support. A new interface with three methods is added : - mmc_sim_get_tran_settings: Use to get what the controller supports in term of capabilities, freq etc ... - mmc_sim_set_tran_settings: Use to change the speed/freq/etc of the sdcard host controller - mmc_sim_cam_request: Used for MMCIO requests Differential Revision: https://reviews.freebsd.org/D27485 Reviewed by: kibab (cherry picked from commit 47bde7925b41887cb639e651289bc96ccb5b1c24) --- sys/cam/mmc/mmc_sim.c | 194 +++++++++++++++++++++++++++++++++++++++++++++++ sys/cam/mmc/mmc_sim.h | 43 +++++++++++ sys/cam/mmc/mmc_sim_if.m | 54 +++++++++++++ sys/conf/files | 2 + 4 files changed, 293 insertions(+) diff --git a/sys/cam/mmc/mmc_sim.c b/sys/cam/mmc/mmc_sim.c new file mode 100644 index 000000000000..03269a0b3d4d --- /dev/null +++ b/sys/cam/mmc/mmc_sim.c @@ -0,0 +1,194 @@ +/*- + * Copyright (c) 2020 Emmanuel Vadot + * + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "mmc_sim_if.h" + +static void +mmc_cam_default_poll(struct cam_sim *sim) +{ + + return; +} + +static void +mmc_cam_sim_default_action(struct cam_sim *sim, union ccb *ccb) +{ + struct mmc_sim *mmc_sim; + struct ccb_trans_settings_mmc mmc; + int rv; + + mmc_sim = cam_sim_softc(sim); + + if (mmc_sim == NULL) { + ccb->ccb_h.status = CAM_SEL_TIMEOUT; + xpt_done(ccb); + return; + } + + mtx_assert(&mmc_sim->mtx, MA_OWNED); + + switch (ccb->ccb_h.func_code) { + case XPT_PATH_INQ: + rv = MMC_SIM_GET_TRAN_SETTINGS(mmc_sim->dev, &mmc); + if (rv != 0) { + ccb->ccb_h.status = CAM_REQ_INVALID; + } else { + mmc_path_inq(&ccb->cpi, "Deglitch Networks", + sim, mmc.host_max_data); + } + break; + case XPT_GET_TRAN_SETTINGS: + { + struct ccb_trans_settings *cts = &ccb->cts; + + rv = MMC_SIM_GET_TRAN_SETTINGS(mmc_sim->dev, &cts->proto_specific.mmc); + if (rv != 0) + ccb->ccb_h.status = CAM_REQ_INVALID; + else { + cts->protocol = PROTO_MMCSD; + cts->protocol_version = 1; + cts->transport = XPORT_MMCSD; + cts->transport_version = 1; + cts->xport_specific.valid = 0; + ccb->ccb_h.status = CAM_REQ_CMP; + } + break; + } + case XPT_SET_TRAN_SETTINGS: + { + struct ccb_trans_settings *cts = &ccb->cts; + + rv = MMC_SIM_SET_TRAN_SETTINGS(mmc_sim->dev, &cts->proto_specific.mmc); + if (rv != 0) + ccb->ccb_h.status = CAM_REQ_INVALID; + else + ccb->ccb_h.status = CAM_REQ_CMP; + break; + } + case XPT_RESET_BUS: + ccb->ccb_h.status = CAM_REQ_CMP; + break; + case XPT_MMC_IO: + { + rv = MMC_SIM_CAM_REQUEST(mmc_sim->dev, ccb); + if (rv != 0) + ccb->ccb_h.status = CAM_REQ_INPROG; + else + ccb->ccb_h.status = CAM_REQ_INVALID; + return; + /* NOTREACHED */ + break; + } + default: + ccb->ccb_h.status = CAM_REQ_INVALID; + break; + } + xpt_done(ccb); + return; +} + +int +mmc_cam_sim_alloc(device_t dev, const char *name, struct mmc_sim *mmc_sim) +{ + char sim_name[64], mtx_name[64]; + + mmc_sim->dev = dev; + + if ((mmc_sim->devq = cam_simq_alloc(1)) == NULL) { + goto fail; + } + + snprintf(sim_name, sizeof(sim_name), "%s_sim", name); + snprintf(mtx_name, sizeof(mtx_name), "%s_mtx", name); + + mtx_init(&mmc_sim->mtx, sim_name, NULL, MTX_DEF); + mmc_sim->sim = cam_sim_alloc_dev(mmc_cam_sim_default_action, + mmc_cam_default_poll, + name, mmc_sim, dev, + &mmc_sim->mtx, 1, 1, mmc_sim->devq); + + if (mmc_sim->sim == NULL) { + cam_simq_free(mmc_sim->devq); + device_printf(dev, "cannot allocate CAM SIM\n"); + goto fail; + } + + mtx_lock(&mmc_sim->mtx); + if (xpt_bus_register(mmc_sim->sim, dev, 0) != 0) { + device_printf(dev, "cannot register SCSI pass-through bus\n"); + cam_sim_free(mmc_sim->sim, FALSE); + cam_simq_free(mmc_sim->devq); + mtx_unlock(&mmc_sim->mtx); + goto fail; + } + + mtx_unlock(&mmc_sim->mtx); + + return (0); + +fail: + mmc_cam_sim_free(mmc_sim); + return (1); +} + +void +mmc_cam_sim_free(struct mmc_sim *mmc_sim) +{ + + if (mmc_sim->sim != NULL) { + mtx_lock(&mmc_sim->mtx); + xpt_bus_deregister(cam_sim_path(mmc_sim->sim)); + cam_sim_free(mmc_sim->sim, FALSE); + mtx_unlock(&mmc_sim->mtx); + } + + if (mmc_sim->devq != NULL) + cam_simq_free(mmc_sim->devq); +} + +void +mmc_cam_sim_discover(struct mmc_sim *mmc_sim) +{ + + mmccam_start_discovery(mmc_sim->sim); +} diff --git a/sys/cam/mmc/mmc_sim.h b/sys/cam/mmc/mmc_sim.h new file mode 100644 index 000000000000..629144656e51 --- /dev/null +++ b/sys/cam/mmc/mmc_sim.h @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2020 Emmanuel Vadot + * + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __MMC_SIM_H__ +#define __MMC_SIM_H__ + +struct mmc_sim { + struct mmc_cam_sim_softc *sc; + struct mtx mtx; + struct cam_devq *devq; + struct cam_sim *sim; + device_t dev; +}; + +int mmc_cam_sim_alloc(device_t dev, const char *name, struct mmc_sim *mmc_sim); +void mmc_cam_sim_free(struct mmc_sim *sim); +void mmc_cam_sim_discover(struct mmc_sim *mmc_sim); + +#endif /* __MMC_SIM_H__ */ diff --git a/sys/cam/mmc/mmc_sim_if.m b/sys/cam/mmc/mmc_sim_if.m new file mode 100644 index 000000000000..f1b88fc05ef5 --- /dev/null +++ b/sys/cam/mmc/mmc_sim_if.m @@ -0,0 +1,54 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 Emmanuel Vadot +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +#include +#include + +#include +#include +#include +#include +#include +#include + +INTERFACE mmc_sim; + +METHOD int get_tran_settings { + device_t dev; + struct ccb_trans_settings_mmc *cts; +}; + +METHOD int set_tran_settings { + device_t dev; + struct ccb_trans_settings_mmc *cts; +}; + +METHOD int cam_request { + device_t dev; + union ccb *ccb; +}; diff --git a/sys/conf/files b/sys/conf/files index 0f5944c93c9c..6b4786d05e3f 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -121,6 +121,8 @@ cam/ctl/ctl_error.c optional ctl cam/ctl/ctl_util.c optional ctl cam/ctl/scsi_ctl.c optional ctl cam/mmc/mmc_xpt.c optional scbus mmccam +cam/mmc/mmc_sim.c optional scbus mmccam +cam/mmc/mmc_sim_if.m optional scbus mmccam cam/mmc/mmc_da.c optional scbus mmccam da cam/scsi/scsi_da.c optional da cam/scsi/scsi_pass.c optional pass From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 16:46:28 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13BDB660524; Thu, 22 Jul 2021 16:46:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVyyW6pYbz3vtf; Thu, 22 Jul 2021 16:46:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C52A3152C0; Thu, 22 Jul 2021 16:46:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MGkRg1049772; Thu, 22 Jul 2021 16:46:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MGkRT6049771; Thu, 22 Jul 2021 16:46:27 GMT (envelope-from git) Date: Thu, 22 Jul 2021 16:46:27 GMT Message-Id: <202107221646.16MGkRT6049771@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: d5c0a7d9ccd1 - stable/13 - allwinner: aw_mmc: Convert driver to use the mmc_sim interface MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d5c0a7d9ccd1faa68fe9c4a2746333a988ed88f2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 16:46:28 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=d5c0a7d9ccd1faa68fe9c4a2746333a988ed88f2 commit d5c0a7d9ccd1faa68fe9c4a2746333a988ed88f2 Author: Emmanuel Vadot AuthorDate: 2021-04-21 11:54:25 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 16:42:10 +0000 allwinner: aw_mmc: Convert driver to use the mmc_sim interface A lot more generic cam related things are done in mmc_sim so this simplify the driver a lot. Differential Revision: https://reviews.freebsd.org/D27486 Reviewed by: imp (cherry picked from commit 2671bdb540c582e2d44681e4495916629d033e97) --- sys/arm/allwinner/aw_mmc.c | 183 ++++++++++----------------------------------- 1 file changed, 40 insertions(+), 143 deletions(-) diff --git a/sys/arm/allwinner/aw_mmc.c b/sys/arm/allwinner/aw_mmc.c index 1c28a882bf46..f63b41f9b73c 100644 --- a/sys/arm/allwinner/aw_mmc.c +++ b/sys/arm/allwinner/aw_mmc.c @@ -66,6 +66,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +#include "mmc_sim_if.h" #endif #define AW_MMC_MEMRES 0 @@ -128,9 +131,7 @@ struct aw_mmc_softc { struct mmc_fdt_helper mmc_helper; #ifdef MMCCAM union ccb * ccb; - struct cam_devq * devq; - struct cam_sim * sim; - struct mtx sim_mtx; + struct mmc_sim mmc_sim; #else struct mmc_request * aw_req; #endif @@ -173,15 +174,11 @@ static void aw_mmc_helper_cd_handler(device_t, bool); static void aw_mmc_print_error(uint32_t); static int aw_mmc_update_ios(device_t, device_t); static int aw_mmc_request(device_t, device_t, struct mmc_request *); + +#ifndef MMCCAM static int aw_mmc_get_ro(device_t, device_t); static int aw_mmc_acquire_host(device_t, device_t); static int aw_mmc_release_host(device_t, device_t); -#ifdef MMCCAM -static void aw_mmc_cam_action(struct cam_sim *, union ccb *); -static void aw_mmc_cam_poll(struct cam_sim *); -static int aw_mmc_cam_settran_settings(struct aw_mmc_softc *, union ccb *); -static int aw_mmc_cam_request(struct aw_mmc_softc *, union ccb *); -static void aw_mmc_cam_handle_mmcio(struct cam_sim *, union ccb *); #endif #define AW_MMC_LOCK(_sc) mtx_lock(&(_sc)->aw_mtx) @@ -203,109 +200,33 @@ SYSCTL_INT(_hw_aw_mmc, OID_AUTO, debug, CTLFLAG_RWTUN, &aw_mmc_debug, 0, #define AW_MMC_DEBUG_CMD 0x8 #ifdef MMCCAM -static void -aw_mmc_cam_handle_mmcio(struct cam_sim *sim, union ccb *ccb) -{ - struct aw_mmc_softc *sc; - - sc = cam_sim_softc(sim); - - aw_mmc_cam_request(sc, ccb); -} - -static void -aw_mmc_cam_action(struct cam_sim *sim, union ccb *ccb) +static int +aw_mmc_get_tran_settings(device_t dev, struct ccb_trans_settings_mmc *cts) { struct aw_mmc_softc *sc; - sc = cam_sim_softc(sim); - if (sc == NULL) { - ccb->ccb_h.status = CAM_SEL_TIMEOUT; - xpt_done(ccb); - return; - } - - mtx_assert(&sc->sim_mtx, MA_OWNED); - - switch (ccb->ccb_h.func_code) { - case XPT_PATH_INQ: - mmc_path_inq(&ccb->cpi, "Deglitch Networks", sim, - (sc->aw_mmc_conf->dma_xferlen * AW_MMC_DMA_SEGS) / - MMC_SECTOR_SIZE); - break; - - case XPT_GET_TRAN_SETTINGS: - { - struct ccb_trans_settings *cts = &ccb->cts; + sc = device_get_softc(dev); - if (__predict_false(aw_mmc_debug & AW_MMC_DEBUG_IOS)) - device_printf(sc->aw_dev, "Got XPT_GET_TRAN_SETTINGS\n"); - - cts->protocol = PROTO_MMCSD; - cts->protocol_version = 1; - cts->transport = XPORT_MMCSD; - cts->transport_version = 1; - cts->xport_specific.valid = 0; - cts->proto_specific.mmc.host_ocr = sc->aw_host.host_ocr; - cts->proto_specific.mmc.host_f_min = sc->aw_host.f_min; - cts->proto_specific.mmc.host_f_max = sc->aw_host.f_max; - cts->proto_specific.mmc.host_caps = sc->aw_host.caps; - cts->proto_specific.mmc.host_max_data = (sc->aw_mmc_conf->dma_xferlen * - AW_MMC_DMA_SEGS) / MMC_SECTOR_SIZE; - memcpy(&cts->proto_specific.mmc.ios, &sc->aw_host.ios, sizeof(struct mmc_ios)); - ccb->ccb_h.status = CAM_REQ_CMP; - break; - } - case XPT_SET_TRAN_SETTINGS: - { - if (__predict_false(aw_mmc_debug & AW_MMC_DEBUG_IOS)) - device_printf(sc->aw_dev, "Got XPT_SET_TRAN_SETTINGS\n"); - aw_mmc_cam_settran_settings(sc, ccb); - ccb->ccb_h.status = CAM_REQ_CMP; - break; - } - case XPT_RESET_BUS: - if (__predict_false(aw_mmc_debug & AW_MMC_DEBUG_IOS)) - device_printf(sc->aw_dev, "Got XPT_RESET_BUS, ACK it...\n"); - ccb->ccb_h.status = CAM_REQ_CMP; - break; - case XPT_MMC_IO: - /* - * Here is the HW-dependent part of - * sending the command to the underlying h/w - * At some point in the future an interrupt comes. - * Then the request will be marked as completed. - */ - ccb->ccb_h.status = CAM_REQ_INPROG; - - aw_mmc_cam_handle_mmcio(sim, ccb); - return; - /* NOTREACHED */ - break; - default: - ccb->ccb_h.status = CAM_REQ_INVALID; - break; - } - xpt_done(ccb); - return; -} + cts->host_ocr = sc->aw_host.host_ocr; + cts->host_f_min = sc->aw_host.f_min; + cts->host_f_max = sc->aw_host.f_max; + cts->host_caps = sc->aw_host.caps; + cts->host_max_data = (sc->aw_mmc_conf->dma_xferlen * + AW_MMC_DMA_SEGS) / MMC_SECTOR_SIZE; + memcpy(&cts->ios, &sc->aw_host.ios, sizeof(struct mmc_ios)); -static void -aw_mmc_cam_poll(struct cam_sim *sim) -{ - return; + return (0); } static int -aw_mmc_cam_settran_settings(struct aw_mmc_softc *sc, union ccb *ccb) +aw_mmc_set_tran_settings(device_t dev, struct ccb_trans_settings_mmc *cts) { + struct aw_mmc_softc *sc; struct mmc_ios *ios; struct mmc_ios *new_ios; - struct ccb_trans_settings_mmc *cts; + sc = device_get_softc(dev); ios = &sc->aw_host.ios; - - cts = &ccb->cts.proto_specific.mmc; new_ios = &cts->ios; /* Update only requested fields */ @@ -349,10 +270,12 @@ aw_mmc_cam_settran_settings(struct aw_mmc_softc *sc, union ccb *ccb) } static int -aw_mmc_cam_request(struct aw_mmc_softc *sc, union ccb *ccb) +aw_mmc_cam_request(device_t dev, union ccb *ccb) { + struct aw_mmc_softc *sc; struct ccb_mmcio *mmcio; + sc = device_get_softc(dev); mmcio = &ccb->mmcio; AW_MMC_LOCK(sc); @@ -388,7 +311,7 @@ aw_mmc_helper_cd_handler(device_t dev, bool present) sc = device_get_softc(dev); #ifdef MMCCAM - mmccam_start_discovery(sc->sim); + mmc_cam_sim_discover(&sc->mmc_sim); #else AW_MMC_LOCK(sc); if (present) { @@ -528,31 +451,11 @@ aw_mmc_attach(device_t dev) #ifdef MMCCAM sc->ccb = NULL; - if ((sc->devq = cam_simq_alloc(1)) == NULL) { - goto fail; - } - - mtx_init(&sc->sim_mtx, "awmmcsim", NULL, MTX_DEF); - sc->sim = cam_sim_alloc_dev(aw_mmc_cam_action, aw_mmc_cam_poll, - "aw_mmc_sim", sc, dev, - &sc->sim_mtx, 1, 1, sc->devq); - - if (sc->sim == NULL) { - cam_simq_free(sc->devq); - device_printf(dev, "cannot allocate CAM SIM\n"); - goto fail; - } - mtx_lock(&sc->sim_mtx); - if (xpt_bus_register(sc->sim, sc->aw_dev, 0) != 0) { - device_printf(dev, "cannot register SCSI pass-through bus\n"); - cam_sim_free(sc->sim, FALSE); - cam_simq_free(sc->devq); - mtx_unlock(&sc->sim_mtx); + if (mmc_cam_sim_alloc(dev, "aw_mmc", &sc->mmc_sim) != 0) { + device_printf(dev, "cannot alloc cam sim\n"); goto fail; } - - mtx_unlock(&sc->sim_mtx); #endif /* MMCCAM */ return (0); @@ -563,17 +466,6 @@ fail: bus_teardown_intr(dev, sc->aw_res[AW_MMC_IRQRES], sc->aw_intrhand); bus_release_resources(dev, aw_mmc_res_spec, sc->aw_res); -#ifdef MMCCAM - if (sc->sim != NULL) { - mtx_lock(&sc->sim_mtx); - xpt_bus_deregister(cam_sim_path(sc->sim)); - cam_sim_free(sc->sim, FALSE); - mtx_unlock(&sc->sim_mtx); - } - - if (sc->devq != NULL) - cam_simq_free(sc->devq); -#endif return (ENXIO); } @@ -608,15 +500,7 @@ aw_mmc_detach(device_t dev) bus_release_resources(dev, aw_mmc_res_spec, sc->aw_res); #ifdef MMCCAM - if (sc->sim != NULL) { - mtx_lock(&sc->sim_mtx); - xpt_bus_deregister(cam_sim_path(sc->sim)); - cam_sim_free(sc->sim, FALSE); - mtx_unlock(&sc->sim_mtx); - } - - if (sc->devq != NULL) - cam_simq_free(sc->devq); + mmc_cam_sim_free(&sc->mmc_sim); #endif return (0); @@ -1357,6 +1241,7 @@ aw_mmc_update_clock(struct aw_mmc_softc *sc, uint32_t clkon) return (0); } +#ifndef MMCCAM static int aw_mmc_switch_vccq(device_t bus, device_t child) { @@ -1390,6 +1275,7 @@ aw_mmc_switch_vccq(device_t bus, device_t child) return (0); } +#endif static int aw_mmc_update_ios(device_t bus, device_t child) @@ -1510,6 +1396,7 @@ aw_mmc_update_ios(device_t bus, device_t child) return (0); } +#ifndef MMCCAM static int aw_mmc_get_ro(device_t bus, device_t child) { @@ -1554,6 +1441,7 @@ aw_mmc_release_host(device_t bus, device_t child) return (0); } +#endif static device_method_t aw_mmc_methods[] = { /* Device interface */ @@ -1566,6 +1454,7 @@ static device_method_t aw_mmc_methods[] = { DEVMETHOD(bus_write_ivar, aw_mmc_write_ivar), DEVMETHOD(bus_add_child, bus_generic_add_child), +#ifndef MMCCAM /* MMC bridge interface */ DEVMETHOD(mmcbr_update_ios, aw_mmc_update_ios), DEVMETHOD(mmcbr_request, aw_mmc_request), @@ -1573,6 +1462,14 @@ static device_method_t aw_mmc_methods[] = { DEVMETHOD(mmcbr_switch_vccq, aw_mmc_switch_vccq), DEVMETHOD(mmcbr_acquire_host, aw_mmc_acquire_host), DEVMETHOD(mmcbr_release_host, aw_mmc_release_host), +#endif + +#ifdef MMCCAM + /* MMCCAM interface */ + DEVMETHOD(mmc_sim_get_tran_settings, aw_mmc_get_tran_settings), + DEVMETHOD(mmc_sim_set_tran_settings, aw_mmc_set_tran_settings), + DEVMETHOD(mmc_sim_cam_request, aw_mmc_cam_request), +#endif DEVMETHOD_END }; From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 16:46:29 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 542006603E2; Thu, 22 Jul 2021 16:46:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVyyY1Cz1z3vpB; Thu, 22 Jul 2021 16:46:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7FC2154DF; Thu, 22 Jul 2021 16:46:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MGkSsE049796; Thu, 22 Jul 2021 16:46:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MGkSa2049795; Thu, 22 Jul 2021 16:46:28 GMT (envelope-from git) Date: Thu, 22 Jul 2021 16:46:28 GMT Message-Id: <202107221646.16MGkSa2049795@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 821c689006aa - stable/13 - mmc: dwmmc: Convert driver to use the mmc_sim interface MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 821c689006aa9fa540da63b406ea723227805b1c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 16:46:29 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=821c689006aa9fa540da63b406ea723227805b1c commit 821c689006aa9fa540da63b406ea723227805b1c Author: Emmanuel Vadot AuthorDate: 2021-04-21 11:56:27 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 16:42:11 +0000 mmc: dwmmc: Convert driver to use the mmc_sim interface A lot more generic cam related things are done in mmc_sim so this simplify the driver a lot. Differential Revision: https://reviews.freebsd.org/D27487 Reviewed by: kibab (cherry picked from commit f1cc48e5da505004259343392ee4a27b8338fca4) --- sys/dev/mmc/host/dwmmc.c | 187 +++++++++---------------------------------- sys/dev/mmc/host/dwmmc_var.h | 6 +- 2 files changed, 42 insertions(+), 151 deletions(-) diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c index b31bb0d4e68b..ed24cbba923f 100644 --- a/sys/dev/mmc/host/dwmmc.c +++ b/sys/dev/mmc/host/dwmmc.c @@ -76,6 +76,8 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include "mmc_sim_if.h" #endif #include "mmcbr_if.h" @@ -151,14 +153,6 @@ static int dma_stop(struct dwmmc_softc *); static void pio_read(struct dwmmc_softc *, struct mmc_command *); static void pio_write(struct dwmmc_softc *, struct mmc_command *); static void dwmmc_handle_card_present(struct dwmmc_softc *sc, bool is_present); -#ifdef MMCCAM -static int dwmmc_switch_vccq(device_t, device_t); -static void dwmmc_cam_action(struct cam_sim *, union ccb *); -static void dwmmc_cam_poll(struct cam_sim *); -static int dwmmc_cam_settran_settings(struct dwmmc_softc *, union ccb *); -static int dwmmc_cam_request(struct dwmmc_softc *, union ccb *); -static void dwmmc_cam_handle_mmcio(struct cam_sim *, union ccb *); -#endif static struct resource_spec dwmmc_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, @@ -476,7 +470,7 @@ dwmmc_card_task(void *arg, int pending __unused) struct dwmmc_softc *sc = arg; #ifdef MMCCAM - mmccam_start_discovery(sc->sim); + mmc_cam_sim_discover(&sc->mmc_sim); #else DWMMC_LOCK(sc); @@ -770,32 +764,11 @@ dwmmc_attach(device_t dev) #ifdef MMCCAM sc->ccb = NULL; - if ((sc->devq = cam_simq_alloc(1)) == NULL) { - goto fail; + if (mmc_cam_sim_alloc(dev, "dw_mmc", &sc->mmc_sim) != 0) { + device_printf(dev, "cannot alloc cam sim\n"); + dwmmc_detach(dev); + return (ENXIO); } - - mtx_init(&sc->sim_mtx, "dwmmcsim", NULL, MTX_DEF); - sc->sim = cam_sim_alloc_dev(dwmmc_cam_action, dwmmc_cam_poll, - "dw_mmc_sim", sc, dev, - &sc->sim_mtx, 1, 1, sc->devq); - - if (sc->sim == NULL) { - cam_simq_free(sc->devq); - device_printf(dev, "cannot allocate CAM SIM\n"); - goto fail; - } - - mtx_lock(&sc->sim_mtx); - if (xpt_bus_register(sc->sim, sc->dev, 0) != 0) { - device_printf(sc->dev, "cannot register SCSI pass-through bus\n"); - cam_sim_free(sc->sim, FALSE); - cam_simq_free(sc->devq); - mtx_unlock(&sc->sim_mtx); - goto fail; - } - -fail: - mtx_unlock(&sc->sim_mtx); #endif /* * Schedule a card detection as we won't get an interrupt @@ -843,6 +816,10 @@ dwmmc_detach(device_t dev) device_printf(sc->dev, "Cannot disable vqmmc regulator\n"); #endif +#ifdef MMCCAM + mmc_cam_sim_free(&sc->mmc_sim); +#endif + return (0); } @@ -1281,6 +1258,7 @@ dwmmc_request(device_t brdev, device_t reqdev, struct mmc_request *req) return (0); } +#ifndef MMCCAM static int dwmmc_get_ro(device_t brdev, device_t reqdev) { @@ -1318,6 +1296,7 @@ dwmmc_release_host(device_t brdev, device_t reqdev) DWMMC_UNLOCK(sc); return (0); } +#endif /* !MMCCAM */ static int dwmmc_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) @@ -1444,133 +1423,34 @@ dwmmc_switch_vccq(device_t dev, device_t child) return EINVAL; } -static void -dwmmc_cam_handle_mmcio(struct cam_sim *sim, union ccb *ccb) -{ - struct dwmmc_softc *sc; - - sc = cam_sim_softc(sim); - - dwmmc_cam_request(sc, ccb); -} - -static void -dwmmc_cam_action(struct cam_sim *sim, union ccb *ccb) +static int +dwmmc_get_tran_settings(device_t dev, struct ccb_trans_settings_mmc *cts) { struct dwmmc_softc *sc; - sc = cam_sim_softc(sim); - if (sc == NULL) { - ccb->ccb_h.status = CAM_SEL_TIMEOUT; - xpt_done(ccb); - return; - } - - mtx_assert(&sc->sim_mtx, MA_OWNED); - - switch (ccb->ccb_h.func_code) { - case XPT_PATH_INQ: - /* XXX: correctly calculate maxio here */ - mmc_path_inq(&ccb->cpi, "Deglitch Networks", sim, MMC_SECTOR_SIZE); - break; - - case XPT_GET_TRAN_SETTINGS: - { - struct ccb_trans_settings *cts = &ccb->cts; - - cts->protocol = PROTO_MMCSD; - cts->protocol_version = 1; - cts->transport = XPORT_MMCSD; - cts->transport_version = 1; - cts->xport_specific.valid = 0; - cts->proto_specific.mmc.host_ocr = sc->host.host_ocr; - cts->proto_specific.mmc.host_f_min = sc->host.f_min; - cts->proto_specific.mmc.host_f_max = sc->host.f_max; - cts->proto_specific.mmc.host_caps = sc->host.caps; - /* XXX: correctly calculate host_max_data */ - cts->proto_specific.mmc.host_max_data = 1; - memcpy(&cts->proto_specific.mmc.ios, &sc->host.ios, sizeof(struct mmc_ios)); - ccb->ccb_h.status = CAM_REQ_CMP; - break; - } - case XPT_SET_TRAN_SETTINGS: - { - dwmmc_cam_settran_settings(sc, ccb); - ccb->ccb_h.status = CAM_REQ_CMP; - break; - } - case XPT_RESET_BUS: { - struct ccb_trans_settings_mmc *cts; - - cts = &ccb->cts.proto_specific.mmc; - cts->ios_valid = MMC_PM; - cts->ios.power_mode = power_off; - /* Power off the MMC bus */ - if (dwmmc_cam_settran_settings(sc, ccb) != 0) { - device_printf(sc->dev,"cannot power down the MMC bus\n"); - ccb->ccb_h.status = CAM_REQ_CMP_ERR; - break; - } - - /* Soft Reset controller and run initialization again */ - if (dwmmc_ctrl_reset(sc, (SDMMC_CTRL_RESET | - SDMMC_CTRL_FIFO_RESET | - SDMMC_CTRL_DMA_RESET)) != 0) { - device_printf(sc->dev, "cannot reset the controller\n"); - ccb->ccb_h.status = CAM_REQ_CMP_ERR; - break; - } + sc = device_get_softc(dev); - cts->ios_valid = MMC_PM; - cts->ios.power_mode = power_on; - /* Power off the MMC bus */ - if (dwmmc_cam_settran_settings(sc, ccb) != 0) { - device_printf(sc->dev, "cannot power on the MMC bus\n"); - ccb->ccb_h.status = CAM_REQ_CMP_ERR; - break; - } + cts->host_ocr = sc->host.host_ocr; + cts->host_f_min = sc->host.f_min; + cts->host_f_max = sc->host.f_max; + cts->host_caps = sc->host.caps; + cts->host_max_data = (IDMAC_MAX_SIZE * IDMAC_DESC_SEGS) / MMC_SECTOR_SIZE; + memcpy(&cts->ios, &sc->host.ios, sizeof(struct mmc_ios)); - ccb->ccb_h.status = CAM_REQ_CMP; - break; - } - case XPT_MMC_IO: - /* - * Here is the HW-dependent part of - * sending the command to the underlying h/w - * At some point in the future an interrupt comes. - * Then the request will be marked as completed. - */ - ccb->ccb_h.status = CAM_REQ_INPROG; - - dwmmc_cam_handle_mmcio(sim, ccb); - return; - /* NOTREACHED */ - break; - default: - ccb->ccb_h.status = CAM_REQ_INVALID; - break; - } - xpt_done(ccb); - return; -} - -static void -dwmmc_cam_poll(struct cam_sim *sim) -{ - return; + return (0); } static int -dwmmc_cam_settran_settings(struct dwmmc_softc *sc, union ccb *ccb) +dwmmc_set_tran_settings(device_t dev, struct ccb_trans_settings_mmc *cts) { + struct dwmmc_softc *sc; struct mmc_ios *ios; struct mmc_ios *new_ios; - struct ccb_trans_settings_mmc *cts; int res; + sc = device_get_softc(dev); ios = &sc->host.ios; - cts = &ccb->cts.proto_specific.mmc; new_ios = &cts->ios; /* Update only requested fields */ @@ -1621,10 +1501,12 @@ dwmmc_cam_settran_settings(struct dwmmc_softc *sc, union ccb *ccb) } static int -dwmmc_cam_request(struct dwmmc_softc *sc, union ccb *ccb) +dwmmc_cam_request(device_t dev, union ccb *ccb) { + struct dwmmc_softc *sc; struct ccb_mmcio *mmcio; + sc = device_get_softc(dev); mmcio = &ccb->mmcio; DWMMC_LOCK(sc); @@ -1652,19 +1534,28 @@ dwmmc_cam_request(struct dwmmc_softc *sc, union ccb *ccb) return (0); } -#endif +#endif /* MMCCAM */ static device_method_t dwmmc_methods[] = { /* Bus interface */ DEVMETHOD(bus_read_ivar, dwmmc_read_ivar), DEVMETHOD(bus_write_ivar, dwmmc_write_ivar), +#ifndef MMCCAM /* mmcbr_if */ DEVMETHOD(mmcbr_update_ios, dwmmc_update_ios), DEVMETHOD(mmcbr_request, dwmmc_request), DEVMETHOD(mmcbr_get_ro, dwmmc_get_ro), DEVMETHOD(mmcbr_acquire_host, dwmmc_acquire_host), DEVMETHOD(mmcbr_release_host, dwmmc_release_host), +#endif + +#ifdef MMCCAM + /* MMCCAM interface */ + DEVMETHOD(mmc_sim_get_tran_settings, dwmmc_get_tran_settings), + DEVMETHOD(mmc_sim_set_tran_settings, dwmmc_set_tran_settings), + DEVMETHOD(mmc_sim_cam_request, dwmmc_cam_request), +#endif DEVMETHOD_END }; diff --git a/sys/dev/mmc/host/dwmmc_var.h b/sys/dev/mmc/host/dwmmc_var.h index 6c7aae79640d..ef7c91fa628e 100644 --- a/sys/dev/mmc/host/dwmmc_var.h +++ b/sys/dev/mmc/host/dwmmc_var.h @@ -41,6 +41,8 @@ #include "opt_mmccam.h" +#include + enum { HWTYPE_NONE, HWTYPE_ALTERA, @@ -58,9 +60,7 @@ struct dwmmc_softc { struct mtx sc_mtx; #ifdef MMCCAM union ccb * ccb; - struct cam_devq * devq; - struct cam_sim * sim; - struct mtx sim_mtx; + struct mmc_sim mmc_sim; #else struct mmc_request *req; #endif From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 16:47:25 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1906A660451; Thu, 22 Jul 2021 16:47:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVyzd0GK4z3vlt; Thu, 22 Jul 2021 16:47:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3FD8150F2; Thu, 22 Jul 2021 16:47:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MGlOPA049974; Thu, 22 Jul 2021 16:47:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MGlOF0049973; Thu, 22 Jul 2021 16:47:24 GMT (envelope-from git) Date: Thu, 22 Jul 2021 16:47:24 GMT Message-Id: <202107221647.16MGlOF0049973@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: f6deb48c118d - stable/13 - dwmmc: Add \n to a debug printf MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f6deb48c118d453e4808afb429ae133760237146 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 16:47:25 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=f6deb48c118d453e4808afb429ae133760237146 commit f6deb48c118d453e4808afb429ae133760237146 Author: Emmanuel Vadot AuthorDate: 2021-04-22 19:41:56 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 16:47:07 +0000 dwmmc: Add \n to a debug printf (cherry picked from commit 7cbdf8a05db7da9c78e8ac74542febc646d24abd) --- sys/dev/mmc/host/dwmmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c index ed24cbba923f..1ffbf4aec41c 100644 --- a/sys/dev/mmc/host/dwmmc.c +++ b/sys/dev/mmc/host/dwmmc.c @@ -857,7 +857,7 @@ dwmmc_setup_bus(struct dwmmc_softc *sc, int freq) tout = 1000; do { if (tout-- < 0) { - device_printf(sc->dev, "Failed to update clk"); + device_printf(sc->dev, "Failed to update clk\n"); return (1); } } while (READ4(sc, SDMMC_CMD) & SDMMC_CMD_START); From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 16:47:52 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 645296607B0; Thu, 22 Jul 2021 16:47:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVz082Fg5z3wBn; Thu, 22 Jul 2021 16:47:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31121150F3; Thu, 22 Jul 2021 16:47:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MGlqMn050123; Thu, 22 Jul 2021 16:47:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MGlqG0050122; Thu, 22 Jul 2021 16:47:52 GMT (envelope-from git) Date: Thu, 22 Jul 2021 16:47:52 GMT Message-Id: <202107221647.16MGlqG0050122@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: a93a636b9847 - stable/13 - mmcprobe_done: Style(9) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a93a636b98477646d229173f966749e73e6c4645 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 16:47:52 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=a93a636b98477646d229173f966749e73e6c4645 commit a93a636b98477646d229173f966749e73e6c4645 Author: Emmanuel Vadot AuthorDate: 2021-04-23 12:50:04 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 16:47:38 +0000 mmcprobe_done: Style(9) (cherry picked from commit e017c1c92c990a78ac99987a008c9eb3d5620941) --- sys/cam/mmc/mmc_xpt.c | 332 +++++++++++++++++++++++++------------------------- 1 file changed, 166 insertions(+), 166 deletions(-) diff --git a/sys/cam/mmc/mmc_xpt.c b/sys/cam/mmc/mmc_xpt.c index 22468fcea35a..0590c6ccb224 100644 --- a/sys/cam/mmc/mmc_xpt.c +++ b/sys/cam/mmc/mmc_xpt.c @@ -855,101 +855,101 @@ mmcprobe_done(struct cam_periph *periph, union ccb *done_ccb) PROBE_SET_ACTION(softc, PROBE_SDIO_RESET); break; } - case PROBE_SDIO_RESET: - { + case PROBE_SDIO_RESET: + { mmcio = &done_ccb->mmcio; err = mmcio->cmd.error; - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("SDIO_RESET: error %d, CCCR CTL register: %08x\n", - err, mmcio->cmd.resp[0])); - PROBE_SET_ACTION(softc, PROBE_SDIO_INIT); - break; - } - case PROBE_SDIO_INIT: - { + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("SDIO_RESET: error %d, CCCR CTL register: %08x\n", + err, mmcio->cmd.resp[0])); + PROBE_SET_ACTION(softc, PROBE_SDIO_INIT); + break; + } + case PROBE_SDIO_INIT: + { mmcio = &done_ccb->mmcio; err = mmcio->cmd.error; - struct mmc_params *mmcp = &path->device->mmc_ident_data; - - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("SDIO_INIT: error %d, %08x %08x %08x %08x\n", - err, mmcio->cmd.resp[0], - mmcio->cmd.resp[1], - mmcio->cmd.resp[2], - mmcio->cmd.resp[3])); - - /* - * Error here means that this card is not SDIO, - * so proceed with memory init as if nothing has happened - */ + struct mmc_params *mmcp = &path->device->mmc_ident_data; + + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("SDIO_INIT: error %d, %08x %08x %08x %08x\n", + err, mmcio->cmd.resp[0], + mmcio->cmd.resp[1], + mmcio->cmd.resp[2], + mmcio->cmd.resp[3])); + + /* + * Error here means that this card is not SDIO, + * so proceed with memory init as if nothing has happened + */ if (err != MMC_ERR_NONE) { - PROBE_SET_ACTION(softc, PROBE_SEND_APP_OP_COND); - break; + PROBE_SET_ACTION(softc, PROBE_SEND_APP_OP_COND); + break; } - mmcp->card_features |= CARD_FEATURE_SDIO; - uint32_t ioifcond = mmcio->cmd.resp[0]; - uint32_t io_ocr = ioifcond & R4_IO_OCR_MASK; - - mmcp->sdio_func_count = R4_IO_NUM_FUNCTIONS(ioifcond); - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("SDIO card: %d functions\n", mmcp->sdio_func_count)); - if (io_ocr == 0) { - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("SDIO OCR invalid, retrying\n")); - break; /* Retry */ - } - - if (io_ocr != 0 && mmcp->io_ocr == 0) { - mmcp->io_ocr = io_ocr; - break; /* Retry, this time with non-0 OCR */ - } - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("SDIO OCR: %08x\n", mmcp->io_ocr)); - - if (ioifcond & R4_IO_MEM_PRESENT) { - /* Combo card -- proceed to memory initialization */ - PROBE_SET_ACTION(softc, PROBE_SEND_APP_OP_COND); - } else { - /* No memory portion -- get RCA and select card */ - PROBE_SET_ACTION(softc, PROBE_SEND_RELATIVE_ADDR); - } - break; - } - case PROBE_MMC_INIT: - { + mmcp->card_features |= CARD_FEATURE_SDIO; + uint32_t ioifcond = mmcio->cmd.resp[0]; + uint32_t io_ocr = ioifcond & R4_IO_OCR_MASK; + + mmcp->sdio_func_count = R4_IO_NUM_FUNCTIONS(ioifcond); + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("SDIO card: %d functions\n", mmcp->sdio_func_count)); + if (io_ocr == 0) { + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("SDIO OCR invalid, retrying\n")); + break; /* Retry */ + } + + if (io_ocr != 0 && mmcp->io_ocr == 0) { + mmcp->io_ocr = io_ocr; + break; /* Retry, this time with non-0 OCR */ + } + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("SDIO OCR: %08x\n", mmcp->io_ocr)); + + if (ioifcond & R4_IO_MEM_PRESENT) { + /* Combo card -- proceed to memory initialization */ + PROBE_SET_ACTION(softc, PROBE_SEND_APP_OP_COND); + } else { + /* No memory portion -- get RCA and select card */ + PROBE_SET_ACTION(softc, PROBE_SEND_RELATIVE_ADDR); + } + break; + } + case PROBE_MMC_INIT: + { mmcio = &done_ccb->mmcio; err = mmcio->cmd.error; - struct mmc_params *mmcp = &path->device->mmc_ident_data; + struct mmc_params *mmcp = &path->device->mmc_ident_data; if (err != MMC_ERR_NONE) { CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("MMC_INIT: error %d, resp %08x\n", err, mmcio->cmd.resp[0])); PROBE_SET_ACTION(softc, PROBE_INVALID); - break; - } - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("MMC card, OCR %08x\n", mmcio->cmd.resp[0])); - - if (mmcp->card_ocr == 0) { - /* We haven't sent the OCR to the card yet -- do it */ - mmcp->card_ocr = mmcio->cmd.resp[0]; - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("-> sending OCR to card\n")); - break; - } - - if (!(mmcio->cmd.resp[0] & MMC_OCR_CARD_BUSY)) { - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("Card is still powering up\n")); - break; - } - - mmcp->card_features |= CARD_FEATURE_MMC | CARD_FEATURE_MEMORY; - PROBE_SET_ACTION(softc, PROBE_GET_CID); - break; - } + break; + } + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("MMC card, OCR %08x\n", mmcio->cmd.resp[0])); + + if (mmcp->card_ocr == 0) { + /* We haven't sent the OCR to the card yet -- do it */ + mmcp->card_ocr = mmcio->cmd.resp[0]; + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("-> sending OCR to card\n")); + break; + } + + if (!(mmcio->cmd.resp[0] & MMC_OCR_CARD_BUSY)) { + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("Card is still powering up\n")); + break; + } + + mmcp->card_features |= CARD_FEATURE_MMC | CARD_FEATURE_MEMORY; + PROBE_SET_ACTION(softc, PROBE_GET_CID); + break; + } case PROBE_SEND_APP_OP_COND: { mmcio = &done_ccb->mmcio; @@ -960,41 +960,41 @@ mmcprobe_done(struct cam_periph *periph, union ccb *done_ccb) ("APP_OP_COND: error %d, resp %08x\n", err, mmcio->cmd.resp[0])); PROBE_SET_ACTION(softc, PROBE_MMC_INIT); - break; - } - - if (!(softc->flags & PROBE_FLAG_ACMD_SENT)) { - /* Don't change the state */ - softc->flags |= PROBE_FLAG_ACMD_SENT; - break; - } - - softc->flags &= ~PROBE_FLAG_ACMD_SENT; - if ((mmcio->cmd.resp[0] & MMC_OCR_CARD_BUSY) || - (mmcio->cmd.arg & MMC_OCR_VOLTAGE) == 0) { - struct mmc_params *mmcp = &path->device->mmc_ident_data; - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("Card OCR: %08x\n", mmcio->cmd.resp[0])); - if (mmcp->card_ocr == 0) { - mmcp->card_ocr = mmcio->cmd.resp[0]; - /* Now when we know OCR that we want -- send it to card */ - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("-> sending OCR to card\n")); - } else { - /* We already know the OCR and despite of that we - * are processing the answer to ACMD41 -> move on - */ - PROBE_SET_ACTION(softc, PROBE_GET_CID); - } - /* Getting an answer to ACMD41 means the card has memory */ - mmcp->card_features |= CARD_FEATURE_MEMORY; - - /* Standard capacity vs High Capacity memory card */ - if (mmcio->cmd.resp[0] & MMC_OCR_CCS) { - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("Card is SDHC\n")); - mmcp->card_features |= CARD_FEATURE_SDHC; - } + break; + } + + if (!(softc->flags & PROBE_FLAG_ACMD_SENT)) { + /* Don't change the state */ + softc->flags |= PROBE_FLAG_ACMD_SENT; + break; + } + + softc->flags &= ~PROBE_FLAG_ACMD_SENT; + if ((mmcio->cmd.resp[0] & MMC_OCR_CARD_BUSY) || + (mmcio->cmd.arg & MMC_OCR_VOLTAGE) == 0) { + struct mmc_params *mmcp = &path->device->mmc_ident_data; + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("Card OCR: %08x\n", mmcio->cmd.resp[0])); + if (mmcp->card_ocr == 0) { + mmcp->card_ocr = mmcio->cmd.resp[0]; + /* Now when we know OCR that we want -- send it to card */ + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("-> sending OCR to card\n")); + } else { + /* We already know the OCR and despite of that we + * are processing the answer to ACMD41 -> move on + */ + PROBE_SET_ACTION(softc, PROBE_GET_CID); + } + /* Getting an answer to ACMD41 means the card has memory */ + mmcp->card_features |= CARD_FEATURE_MEMORY; + + /* Standard capacity vs High Capacity memory card */ + if (mmcio->cmd.resp[0] & MMC_OCR_CCS) { + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("Card is SDHC\n")); + mmcp->card_features |= CARD_FEATURE_SDHC; + } /* Whether the card supports 1.8V signaling */ if (mmcio->cmd.resp[0] & MMC_OCR_S18A) { @@ -1021,10 +1021,10 @@ mmcprobe_done(struct cam_periph *periph, union ccb *done_ccb) PROBE_SET_ACTION(softc, PROBE_SEND_APP_OP_COND); } - break; + break; } - case PROBE_GET_CID: /* XXX move to mmc_da */ - { + case PROBE_GET_CID: /* XXX move to mmc_da */ + { mmcio = &done_ccb->mmcio; err = mmcio->cmd.error; @@ -1032,45 +1032,45 @@ mmcprobe_done(struct cam_periph *periph, union ccb *done_ccb) CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("PROBE_GET_CID: error %d\n", err)); PROBE_SET_ACTION(softc, PROBE_INVALID); - break; - } - - struct mmc_params *mmcp = &path->device->mmc_ident_data; - memcpy(mmcp->card_cid, mmcio->cmd.resp, 4 * sizeof(uint32_t)); - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("CID %08x%08x%08x%08x\n", - mmcp->card_cid[0], - mmcp->card_cid[1], - mmcp->card_cid[2], - mmcp->card_cid[3])); + break; + } + + struct mmc_params *mmcp = &path->device->mmc_ident_data; + memcpy(mmcp->card_cid, mmcio->cmd.resp, 4 * sizeof(uint32_t)); + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("CID %08x%08x%08x%08x\n", + mmcp->card_cid[0], + mmcp->card_cid[1], + mmcp->card_cid[2], + mmcp->card_cid[3])); if (mmcp->card_features & CARD_FEATURE_MMC) PROBE_SET_ACTION(softc, PROBE_MMC_SET_RELATIVE_ADDR); else PROBE_SET_ACTION(softc, PROBE_SEND_RELATIVE_ADDR); - break; - } - case PROBE_SEND_RELATIVE_ADDR: { + break; + } + case PROBE_SEND_RELATIVE_ADDR: { mmcio = &done_ccb->mmcio; err = mmcio->cmd.error; - struct mmc_params *mmcp = &path->device->mmc_ident_data; - uint16_t rca = mmcio->cmd.resp[0] >> 16; - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("Card published RCA: %u\n", rca)); - path->device->mmc_ident_data.card_rca = rca; + struct mmc_params *mmcp = &path->device->mmc_ident_data; + uint16_t rca = mmcio->cmd.resp[0] >> 16; + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("Card published RCA: %u\n", rca)); + path->device->mmc_ident_data.card_rca = rca; if (err != MMC_ERR_NONE) { CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("PROBE_SEND_RELATIVE_ADDR: error %d\n", err)); PROBE_SET_ACTION(softc, PROBE_INVALID); - break; - } - - /* If memory is present, get CSD, otherwise select card */ - if (mmcp->card_features & CARD_FEATURE_MEMORY) - PROBE_SET_ACTION(softc, PROBE_GET_CSD); - else - PROBE_SET_ACTION(softc, PROBE_SELECT_CARD); + break; + } + + /* If memory is present, get CSD, otherwise select card */ + if (mmcp->card_features & CARD_FEATURE_MEMORY) + PROBE_SET_ACTION(softc, PROBE_GET_CSD); + else + PROBE_SET_ACTION(softc, PROBE_SELECT_CARD); break; - } + } case PROBE_MMC_SET_RELATIVE_ADDR: mmcio = &done_ccb->mmcio; err = mmcio->cmd.error; @@ -1083,7 +1083,7 @@ mmcprobe_done(struct cam_periph *periph, union ccb *done_ccb) path->device->mmc_ident_data.card_rca = MMC_PROPOSED_RCA; PROBE_SET_ACTION(softc, PROBE_GET_CSD); break; - case PROBE_GET_CSD: { + case PROBE_GET_CSD: { mmcio = &done_ccb->mmcio; err = mmcio->cmd.error; @@ -1091,33 +1091,33 @@ mmcprobe_done(struct cam_periph *periph, union ccb *done_ccb) CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("PROBE_GET_CSD: error %d\n", err)); PROBE_SET_ACTION(softc, PROBE_INVALID); - break; - } - - struct mmc_params *mmcp = &path->device->mmc_ident_data; - memcpy(mmcp->card_csd, mmcio->cmd.resp, 4 * sizeof(uint32_t)); - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("CSD %08x%08x%08x%08x\n", - mmcp->card_csd[0], - mmcp->card_csd[1], - mmcp->card_csd[2], - mmcp->card_csd[3])); - PROBE_SET_ACTION(softc, PROBE_SELECT_CARD); - break; - } - case PROBE_SELECT_CARD: { + break; + } + + struct mmc_params *mmcp = &path->device->mmc_ident_data; + memcpy(mmcp->card_csd, mmcio->cmd.resp, 4 * sizeof(uint32_t)); + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("CSD %08x%08x%08x%08x\n", + mmcp->card_csd[0], + mmcp->card_csd[1], + mmcp->card_csd[2], + mmcp->card_csd[3])); + PROBE_SET_ACTION(softc, PROBE_SELECT_CARD); + break; + } + case PROBE_SELECT_CARD: { mmcio = &done_ccb->mmcio; err = mmcio->cmd.error; if (err != MMC_ERR_NONE) { CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("PROBE_SEND_RELATIVE_ADDR: error %d\n", err)); PROBE_SET_ACTION(softc, PROBE_INVALID); - break; - } + break; + } PROBE_SET_ACTION(softc, PROBE_DONE); - break; - } + break; + } default: CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("mmcprobe_done: invalid action state 0x%x\n", softc->action)); From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 16:47:53 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7AF6C660757; Thu, 22 Jul 2021 16:47:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVz092mZYz3vxX; Thu, 22 Jul 2021 16:47:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 448FC152C1; Thu, 22 Jul 2021 16:47:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MGlr8V050147; Thu, 22 Jul 2021 16:47:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MGlrlN050146; Thu, 22 Jul 2021 16:47:53 GMT (envelope-from git) Date: Thu, 22 Jul 2021 16:47:53 GMT Message-Id: <202107221647.16MGlrlN050146@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: ca11706e5346 - stable/13 - mmccam: probe*: Style(9) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ca11706e534626b6c374575c4fd4d3fb0d77a9f2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 16:47:53 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=ca11706e534626b6c374575c4fd4d3fb0d77a9f2 commit ca11706e534626b6c374575c4fd4d3fb0d77a9f2 Author: Emmanuel Vadot AuthorDate: 2021-04-23 12:51:13 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 16:47:39 +0000 mmccam: probe*: Style(9) (cherry picked from commit 80020d7888349168627de066b174450712930ee4) --- sys/cam/mmc/mmc_xpt.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sys/cam/mmc/mmc_xpt.c b/sys/cam/mmc/mmc_xpt.c index 0590c6ccb224..aa552ecb3280 100644 --- a/sys/cam/mmc/mmc_xpt.c +++ b/sys/cam/mmc/mmc_xpt.c @@ -90,14 +90,14 @@ static void mmc_proto_debug_out(union ccb *ccb); typedef enum { PROBE_RESET, PROBE_IDENTIFY, - PROBE_SDIO_RESET, + PROBE_SDIO_RESET, PROBE_SEND_IF_COND, - PROBE_SDIO_INIT, - PROBE_MMC_INIT, + PROBE_SDIO_INIT, + PROBE_MMC_INIT, PROBE_SEND_APP_OP_COND, - PROBE_GET_CID, - PROBE_GET_CSD, - PROBE_SEND_RELATIVE_ADDR, + PROBE_GET_CID, + PROBE_GET_CSD, + PROBE_SEND_RELATIVE_ADDR, PROBE_MMC_SET_RELATIVE_ADDR, PROBE_SELECT_CARD, PROBE_DONE, @@ -107,16 +107,16 @@ typedef enum { static char *probe_action_text[] = { "PROBE_RESET", "PROBE_IDENTIFY", - "PROBE_SDIO_RESET", + "PROBE_SDIO_RESET", "PROBE_SEND_IF_COND", - "PROBE_SDIO_INIT", - "PROBE_MMC_INIT", + "PROBE_SDIO_INIT", + "PROBE_MMC_INIT", "PROBE_SEND_APP_OP_COND", - "PROBE_GET_CID", - "PROBE_GET_CSD", - "PROBE_SEND_RELATIVE_ADDR", + "PROBE_GET_CID", + "PROBE_GET_CSD", + "PROBE_SEND_RELATIVE_ADDR", "PROBE_MMC_SET_RELATIVE_ADDR", - "PROBE_SELECT_CARD", + "PROBE_SELECT_CARD", "PROBE_DONE", "PROBE_INVALID" }; From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 16:51:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 926C7660F5F; Thu, 22 Jul 2021 16:51:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVz3y3fkXz4RRG; Thu, 22 Jul 2021 16:51:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6719A157D0; Thu, 22 Jul 2021 16:51:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MGpAvM062652; Thu, 22 Jul 2021 16:51:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MGpAp3062651; Thu, 22 Jul 2021 16:51:10 GMT (envelope-from git) Date: Thu, 22 Jul 2021 16:51:10 GMT Message-Id: <202107221651.16MGpAp3062651@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: bb2e1d6c69d8 - stable/13 - dwc: Use mii_fdt function MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bb2e1d6c69d85d19eca76f61dace9fa57b941a25 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 16:51:10 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=bb2e1d6c69d85d19eca76f61dace9fa57b941a25 commit bb2e1d6c69d85d19eca76f61dace9fa57b941a25 Author: Emmanuel Vadot AuthorDate: 2021-04-11 19:34:57 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 16:48:11 +0000 dwc: Use mii_fdt function Use the helper function to get phy mode and configure dwc accordingly. Reviewed by: ian (cherry picked from commit f77d8d10115b0863cc3dfd6e1746c02847d6569d) --- sys/dev/dwc/if_dwc.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c index 776d0d0dc392..429e250f48e8 100644 --- a/sys/dev/dwc/if_dwc.c +++ b/sys/dev/dwc/if_dwc.c @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef EXT_RESOURCES #include @@ -1559,7 +1560,6 @@ dwc_attach(device_t dev) struct ifnet *ifp; int error, i; uint32_t reg; - char *phy_mode; phandle_t node; uint32_t txpbl, rxpbl, pbl; bool nopblx8 = false; @@ -1574,12 +1574,19 @@ dwc_attach(device_t dev) sc->mactype = IF_DWC_MAC_TYPE(dev); node = ofw_bus_get_node(dev); - if (OF_getprop_alloc(node, "phy-mode", (void **)&phy_mode)) { - if (strcmp(phy_mode, "rgmii") == 0) + switch (mii_fdt_get_contype(node)) { + case MII_CONTYPE_RGMII: + case MII_CONTYPE_RGMII_ID: + case MII_CONTYPE_RGMII_RXID: + case MII_CONTYPE_RGMII_TXID: sc->phy_mode = PHY_MODE_RGMII; - if (strcmp(phy_mode, "rmii") == 0) + break; + case MII_CONTYPE_RMII: sc->phy_mode = PHY_MODE_RMII; - OF_prop_free(phy_mode); + break; + default: + device_printf(dev, "Unsupported MII type\n"); + return (ENXIO); } if (OF_getencprop(node, "snps,pbl", &pbl, sizeof(uint32_t)) <= 0) From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:07:22 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C22F166164E; Thu, 22 Jul 2021 17:07:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzQf59nFz4TCZ; Thu, 22 Jul 2021 17:07:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99FA215C06; Thu, 22 Jul 2021 17:07:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MH7MTK078131; Thu, 22 Jul 2021 17:07:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MH7MCI078130; Thu, 22 Jul 2021 17:07:22 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:07:22 GMT Message-Id: <202107221707.16MH7MCI078130@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: f13f43e2ba56 - stable/13 - modules: Add sdhci_fdt module MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f13f43e2ba562cef259ac81e9359325acc0020c5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:07:22 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=f13f43e2ba562cef259ac81e9359325acc0020c5 commit f13f43e2ba562cef259ac81e9359325acc0020c5 Author: Emmanuel Vadot AuthorDate: 2021-04-28 13:57:39 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 16:51:32 +0000 modules: Add sdhci_fdt module This is a module for sdhci on fdt system (cherry picked from commit 9e08f82058cb5e3c04cdfe90fc7a0d109c7f2659) --- sys/modules/Makefile | 2 ++ sys/modules/sdhci_fdt/Makefile | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/sys/modules/Makefile b/sys/modules/Makefile index ec5dd9a047c2..911aebe88269 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -333,6 +333,7 @@ SUBDIR= \ ${_sctp} \ sdhci \ ${_sdhci_acpi} \ + ${_sdhci_fdt} \ sdhci_pci \ sdio \ sem \ @@ -492,6 +493,7 @@ SUBDIR+= iscsi_initiator .if !empty(OPT_FDT) SUBDIR+= fdt +_sdhci_fdt= sdhci_fdt .endif # Linuxulator diff --git a/sys/modules/sdhci_fdt/Makefile b/sys/modules/sdhci_fdt/Makefile new file mode 100644 index 000000000000..cc8c8b44f2e6 --- /dev/null +++ b/sys/modules/sdhci_fdt/Makefile @@ -0,0 +1,8 @@ +# + +.PATH: ${SRCTOP}/sys/dev/sdhci + +KMOD= sdhci_fdt +SRCS= sdhci_fdt.c sdhci_fdt_gpio.c sdhci_if.h device_if.h bus_if.h mmcbr_if.h opt_mmccam.h opt_cam.h + +.include From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:07:23 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E24E8661862; Thu, 22 Jul 2021 17:07:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzQg66GZz4TCd; Thu, 22 Jul 2021 17:07:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9E7115B1D; Thu, 22 Jul 2021 17:07:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MH7NFG078155; Thu, 22 Jul 2021 17:07:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MH7Ncq078154; Thu, 22 Jul 2021 17:07:23 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:07:23 GMT Message-Id: <202107221707.16MH7Ncq078154@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 4292390bd62f - stable/13 - modules: Only build sdhci_fdt for arm and arm64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4292390bd62fe8286ed92b09ab7c1ae04323c36b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:07:24 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=4292390bd62fe8286ed92b09ab7c1ae04323c36b commit 4292390bd62fe8286ed92b09ab7c1ae04323c36b Author: Emmanuel Vadot AuthorDate: 2021-05-13 18:23:59 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 16:51:33 +0000 modules: Only build sdhci_fdt for arm and arm64 Other FDT platform (like powerpc64* or riscv64) don't have gpio built by default so just compile the module for those two arches. Fixes: 9e08f82058cb ("modules: Add sdhci_fdt module") (cherry picked from commit 0b426a1c2cef14ded10ded6ec737d5c116182996) --- sys/modules/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 911aebe88269..f01354e5e315 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -493,7 +493,6 @@ SUBDIR+= iscsi_initiator .if !empty(OPT_FDT) SUBDIR+= fdt -_sdhci_fdt= sdhci_fdt .endif # Linuxulator @@ -620,6 +619,10 @@ _em= em _rockchip= rockchip .endif +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" +_sdhci_fdt= sdhci_fdt +.endif + .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" _agp= agp _an= an From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:16:58 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5B6F661CAA; Thu, 22 Jul 2021 17:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzdk4xFXz4VlZ; Thu, 22 Jul 2021 17:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9063015C29; Thu, 22 Jul 2021 17:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHGwwU091287; Thu, 22 Jul 2021 17:16:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHGwb5091286; Thu, 22 Jul 2021 17:16:58 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:16:58 GMT Message-Id: <202107221716.16MHGwb5091286@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 41607b5ed446 - stable/13 - mmccam: Add two new XPT for MMC and use them in mmc_sim and sdhci MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 41607b5ed446415c225dd7a9c307dca1fe0fd96e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:16:58 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=41607b5ed446415c225dd7a9c307dca1fe0fd96e commit 41607b5ed446415c225dd7a9c307dca1fe0fd96e Author: Emmanuel Vadot AuthorDate: 2021-04-29 15:48:49 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:09:38 +0000 mmccam: Add two new XPT for MMC and use them in mmc_sim and sdhci For the discovery phase of SD/eMMC we need to do some transaction in a async way. The classic CAM XPT_{GET,SET}_TRAN_SETTING cannot be used in a async way. This also allow us to split the discovery phase into a more complete state machine and we don't mtx_sleep with a random number to wait for completion of the tasks. For mmc_sim we now do the SET_TRAN_SETTING in a taskqueue so we can call the needed function for regulators/clocks without the cam lock(s). This part is still needed to be done for sdhci. We also now save the host OCR in the discovery phase as it wasn't done before and only worked because the same ccb was reused. Reviewed by: imp, kibab, bz Differential Revision: https://reviews.freebsd.org/D30038 (cherry picked from commit af2253f61c43a7608cdf6995701c1dc361320064) --- sys/cam/cam_ccb.h | 3 ++ sys/cam/cam_xpt.c | 2 + sys/cam/mmc/mmc_sim.c | 45 ++++++++++++++++++++- sys/cam/mmc/mmc_sim.h | 4 ++ sys/cam/mmc/mmc_xpt.c | 109 ++++++++++++++++++++++++++++++++++++++------------ sys/dev/sdhci/sdhci.c | 2 + 6 files changed, 137 insertions(+), 28 deletions(-) diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h index 221b24a7c187..b853e3165ba3 100644 --- a/sys/cam/cam_ccb.h +++ b/sys/cam/cam_ccb.h @@ -247,6 +247,9 @@ typedef enum { XPT_REPROBE_LUN = 0x38 | XPT_FC_QUEUED | XPT_FC_USER_CCB, /* Query device capacity and notify GEOM */ + XPT_MMC_SET_TRAN_SETTINGS = 0x40 | XPT_FC_DEV_QUEUED, + XPT_MMC_GET_TRAN_SETTINGS = 0x41 | XPT_FC_DEV_QUEUED, + /* Vendor Unique codes: 0x80->0x8F */ XPT_VUNIQUE = 0x80 } xpt_opcode; diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index ba01e741c5a7..e3b43e70dc61 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -2689,6 +2689,8 @@ xpt_action_default(union ccb *start_ccb) case XPT_NVME_IO: case XPT_NVME_ADMIN: case XPT_MMC_IO: + case XPT_MMC_GET_TRAN_SETTINGS: + case XPT_MMC_SET_TRAN_SETTINGS: case XPT_RESET_DEV: case XPT_ENG_EXEC: case XPT_SMP_IO: diff --git a/sys/cam/mmc/mmc_sim.c b/sys/cam/mmc/mmc_sim.c index 03269a0b3d4d..1500e3f6f1cd 100644 --- a/sys/cam/mmc/mmc_sim.c +++ b/sys/cam/mmc/mmc_sim.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020 Emmanuel Vadot + * Copyright (c) 2020-2021 Emmanuel Vadot * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -50,6 +50,30 @@ mmc_cam_default_poll(struct cam_sim *sim) return; } +static void +mmc_sim_task(void *arg, int pending) +{ + struct mmc_sim *mmc_sim; + struct ccb_trans_settings *cts; + int rv; + + mmc_sim = arg; + + if (mmc_sim->ccb == NULL) + return; + + cts = &mmc_sim->ccb->cts; + rv = MMC_SIM_SET_TRAN_SETTINGS(mmc_sim->dev, &cts->proto_specific.mmc); + if (rv != 0) + mmc_sim->ccb->ccb_h.status = CAM_REQ_INVALID; + else + mmc_sim->ccb->ccb_h.status = CAM_REQ_CMP; + + xpt_done(mmc_sim->ccb); + mmc_sim->ccb = NULL; +} + + static void mmc_cam_sim_default_action(struct cam_sim *sim, union ccb *ccb) { @@ -67,6 +91,12 @@ mmc_cam_sim_default_action(struct cam_sim *sim, union ccb *ccb) mtx_assert(&mmc_sim->mtx, MA_OWNED); + if (mmc_sim->ccb != NULL) { + ccb->ccb_h.status = CAM_BUSY; + xpt_done(ccb); + return; + } + switch (ccb->ccb_h.func_code) { case XPT_PATH_INQ: rv = MMC_SIM_GET_TRAN_SETTINGS(mmc_sim->dev, &mmc); @@ -78,6 +108,7 @@ mmc_cam_sim_default_action(struct cam_sim *sim, union ccb *ccb) } break; case XPT_GET_TRAN_SETTINGS: + case XPT_MMC_GET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts; @@ -105,6 +136,15 @@ mmc_cam_sim_default_action(struct cam_sim *sim, union ccb *ccb) ccb->ccb_h.status = CAM_REQ_CMP; break; } + case XPT_MMC_SET_TRAN_SETTINGS: + { + ccb->ccb_h.status = CAM_SIM_QUEUED; + mmc_sim->ccb = ccb; + taskqueue_enqueue(taskqueue_thread, &mmc_sim->sim_task); + return; + /* NOTREACHED */ + break; + } case XPT_RESET_BUS: ccb->ccb_h.status = CAM_REQ_CMP; break; @@ -112,7 +152,7 @@ mmc_cam_sim_default_action(struct cam_sim *sim, union ccb *ccb) { rv = MMC_SIM_CAM_REQUEST(mmc_sim->dev, ccb); if (rv != 0) - ccb->ccb_h.status = CAM_REQ_INPROG; + ccb->ccb_h.status = CAM_SIM_QUEUED; else ccb->ccb_h.status = CAM_REQ_INVALID; return; @@ -163,6 +203,7 @@ mmc_cam_sim_alloc(device_t dev, const char *name, struct mmc_sim *mmc_sim) } mtx_unlock(&mmc_sim->mtx); + TASK_INIT(&mmc_sim->sim_task, 0, mmc_sim_task, mmc_sim); return (0); diff --git a/sys/cam/mmc/mmc_sim.h b/sys/cam/mmc/mmc_sim.h index 629144656e51..2b1159a9758e 100644 --- a/sys/cam/mmc/mmc_sim.h +++ b/sys/cam/mmc/mmc_sim.h @@ -28,12 +28,16 @@ #ifndef __MMC_SIM_H__ #define __MMC_SIM_H__ +#include + struct mmc_sim { struct mmc_cam_sim_softc *sc; struct mtx mtx; struct cam_devq *devq; struct cam_sim *sim; device_t dev; + struct task sim_task; + union ccb *ccb; }; int mmc_cam_sim_alloc(device_t dev, const char *name, struct mmc_sim *mmc_sim); diff --git a/sys/cam/mmc/mmc_xpt.c b/sys/cam/mmc/mmc_xpt.c index aa552ecb3280..f050f9a5ccb6 100644 --- a/sys/cam/mmc/mmc_xpt.c +++ b/sys/cam/mmc/mmc_xpt.c @@ -90,6 +90,12 @@ static void mmc_proto_debug_out(union ccb *ccb); typedef enum { PROBE_RESET, PROBE_IDENTIFY, + PROBE_POWER_OFF, + PROBE_GET_HOST_OCR, + PROBE_RESET_BUS, + PROBE_SET_ID_FREQ, + PROBE_SET_CS, + PROBE_GO_IDLE_STATE, PROBE_SDIO_RESET, PROBE_SEND_IF_COND, PROBE_SDIO_INIT, @@ -107,6 +113,12 @@ typedef enum { static char *probe_action_text[] = { "PROBE_RESET", "PROBE_IDENTIFY", + "PROBE_POWER_OFF", + "PROBE_GET_HOST_OCR", + "PROBE_RESET_BUS", + "PROBE_SET_ID_FREQ", + "PROBE_SET_CS", + "PROBE_GO_IDLE_STATE", "PROBE_SDIO_RESET", "PROBE_SEND_IF_COND", "PROBE_SDIO_INIT", @@ -165,6 +177,7 @@ typedef struct { probe_action action; int restart; union ccb saved_ccb; + uint32_t host_ocr; uint32_t flags; #define PROBE_FLAG_ACMD_SENT 0x1 /* CMD55 is sent, card expects ACMD */ #define PROBE_FLAG_HOST_CAN_DO_18V 0x2 /* Host can do 1.8V signaling */ @@ -583,7 +596,6 @@ mmcprobe_start(struct cam_periph *periph, union ccb *start_ccb) mmcprobe_softc *softc; struct cam_path *path; struct ccb_mmcio *mmcio; - struct mtx *p_mtx = cam_periph_mtx(periph); struct ccb_trans_settings_mmc *cts; CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("mmcprobe_start\n")); @@ -611,25 +623,29 @@ mmcprobe_start(struct cam_periph *periph, union ccb *start_ccb) case PROBE_IDENTIFY: xpt_path_inq(&start_ccb->cpi, periph->path); CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("Start with PROBE_IDENTIFY\n")); - init_standard_ccb(start_ccb, XPT_GET_TRAN_SETTINGS); - xpt_action(start_ccb); - if (cts->ios.power_mode != power_off) { - init_standard_ccb(start_ccb, XPT_SET_TRAN_SETTINGS); - cts->ios.power_mode = power_off; - cts->ios_valid = MMC_PM; - xpt_action(start_ccb); - mtx_sleep(periph, p_mtx, 0, "mmcios", 100); - } - /* mmc_power_up */ - /* Get the host OCR */ - init_standard_ccb(start_ccb, XPT_GET_TRAN_SETTINGS); - xpt_action(start_ccb); + init_standard_ccb(start_ccb, XPT_MMC_GET_TRAN_SETTINGS); + break; + + case PROBE_POWER_OFF: + CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("power off the card\n")); + init_standard_ccb(start_ccb, XPT_MMC_SET_TRAN_SETTINGS); + cts->ios.power_mode = power_off; + cts->ios_valid = MMC_PM; + break; + + case PROBE_GET_HOST_OCR: + CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("get the host ocr\n")); + init_standard_ccb(start_ccb, XPT_MMC_GET_TRAN_SETTINGS); + break; + case PROBE_RESET_BUS: + { uint32_t host_caps = cts->host_caps; if (host_caps & MMC_CAP_SIGNALING_180) softc->flags |= PROBE_FLAG_HOST_CAN_DO_18V; - uint32_t hv = mmc_highest_voltage(cts->host_ocr); - init_standard_ccb(start_ccb, XPT_SET_TRAN_SETTINGS); + uint32_t hv = mmc_highest_voltage(softc->host_ocr); + CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("reseting the bus\n")); + init_standard_ccb(start_ccb, XPT_MMC_SET_TRAN_SETTINGS); cts->ios.vdd = hv; cts->ios.bus_mode = opendrain; cts->ios.chip_select = cs_dontcare; @@ -638,25 +654,26 @@ mmcprobe_start(struct cam_periph *periph, union ccb *start_ccb) cts->ios.clock = 0; cts->ios_valid = MMC_VDD | MMC_PM | MMC_BM | MMC_CS | MMC_BW | MMC_CLK; - xpt_action(start_ccb); - mtx_sleep(periph, p_mtx, 0, "mmcios", 100); + break; + } - init_standard_ccb(start_ccb, XPT_SET_TRAN_SETTINGS); + case PROBE_SET_ID_FREQ: + CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("setting the ID freq\n")); + init_standard_ccb(start_ccb, XPT_MMC_SET_TRAN_SETTINGS); cts->ios.power_mode = power_on; cts->ios.clock = CARD_ID_FREQUENCY; cts->ios.timing = bus_timing_normal; cts->ios_valid = MMC_PM | MMC_CLK | MMC_BT; - xpt_action(start_ccb); - mtx_sleep(periph, p_mtx, 0, "mmcios", 100); - /* End for mmc_power_on */ + break; + case PROBE_SET_CS: /* Begin mmc_idle_cards() */ - init_standard_ccb(start_ccb, XPT_SET_TRAN_SETTINGS); + init_standard_ccb(start_ccb, XPT_MMC_SET_TRAN_SETTINGS); cts->ios.chip_select = cs_high; cts->ios_valid = MMC_CS; - xpt_action(start_ccb); - mtx_sleep(periph, p_mtx, 0, "mmcios", 1); + break; + case PROBE_GO_IDLE_STATE: CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("Send first XPT_MMC_IO\n")); init_standard_ccb(start_ccb, XPT_MMC_IO); mmcio->cmd.opcode = MMC_GO_IDLE_STATE; /* CMD 0 */ @@ -667,6 +684,7 @@ mmcprobe_start(struct cam_periph *periph, union ccb *start_ccb) /* XXX Reset I/O portion as well */ break; + case PROBE_SDIO_RESET: CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("Start with PROBE_SDIO_RESET\n")); @@ -804,7 +822,7 @@ mmcprobe_done(struct cam_periph *periph, union ccb *done_ccb) struct ccb_mmcio *mmcio; u_int32_t priority; - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("mmcprobe_done\n")); + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("mmcprobe_done\n")); softc = (mmcprobe_softc *)periph->softc; path = done_ccb->ccb_h.path; priority = done_ccb->ccb_h.pinfo.priority; @@ -815,6 +833,45 @@ mmcprobe_done(struct cam_periph *periph, union ccb *done_ccb) case PROBE_IDENTIFY: { CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("done with PROBE_RESET\n")); + PROBE_SET_ACTION(softc, PROBE_POWER_OFF); + break; + } + case PROBE_POWER_OFF: + { + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("done with PROBE_POWER_OFF\n")); + PROBE_SET_ACTION(softc, PROBE_GET_HOST_OCR); + break; + } + case PROBE_GET_HOST_OCR: + { + struct ccb_trans_settings_mmc *cts; + cts = &done_ccb->cts.proto_specific.mmc; + softc->host_ocr = cts->host_ocr; + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("done with PROBE_GET_HOST_OCR (Got OCR=%x\n", softc->host_ocr)); + PROBE_SET_ACTION(softc, PROBE_RESET_BUS); + break; + } + case PROBE_RESET_BUS: + { + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("done with PROBE_RESET_BUS\n")); + PROBE_SET_ACTION(softc, PROBE_SET_ID_FREQ); + break; + } + case PROBE_SET_ID_FREQ: + { + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("done with PROBE_SET_ID_FREQ\n")); + PROBE_SET_ACTION(softc, PROBE_SET_CS); + break; + } + case PROBE_SET_CS: + { + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("done with PROBE_SET_CS\n")); + PROBE_SET_ACTION(softc, PROBE_GO_IDLE_STATE); + break; + } + case PROBE_GO_IDLE_STATE: + { + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("done with PROBE_GO_IDLE_STATE\n")); mmcio = &done_ccb->mmcio; err = mmcio->cmd.error; diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c index 91474cabd2d3..0441320d4b35 100644 --- a/sys/dev/sdhci/sdhci.c +++ b/sys/dev/sdhci/sdhci.c @@ -2537,6 +2537,7 @@ sdhci_cam_action(struct cam_sim *sim, union ccb *ccb) mmc_path_inq(&ccb->cpi, "Deglitch Networks", sim, maxphys); break; + case XPT_MMC_GET_TRAN_SETTINGS: case XPT_GET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts; @@ -2571,6 +2572,7 @@ sdhci_cam_action(struct cam_sim *sim, union ccb *ccb) ccb->ccb_h.status = CAM_REQ_CMP; break; } + case XPT_MMC_SET_TRAN_SETTINGS: case XPT_SET_TRAN_SETTINGS: if (sdhci_debug > 1) slot_printf(slot, "Got XPT_SET_TRAN_SETTINGS\n"); From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:16:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E67136619E9; Thu, 22 Jul 2021 17:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzdl5stqz4Vjs; Thu, 22 Jul 2021 17:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2D3115D26; Thu, 22 Jul 2021 17:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHGxRf091311; Thu, 22 Jul 2021 17:16:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHGxq2091310; Thu, 22 Jul 2021 17:16:59 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:16:59 GMT Message-Id: <202107221716.16MHGxq2091310@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: d35cbeb4b1e6 - stable/13 - mmc: Add mmc-pwrseq driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d35cbeb4b1e6fc33f2b7b5c327b42cbfb910e52d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:17:00 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=d35cbeb4b1e6fc33f2b7b5c327b42cbfb910e52d commit d35cbeb4b1e6fc33f2b7b5c327b42cbfb910e52d Author: Emmanuel Vadot AuthorDate: 2021-05-16 12:48:56 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:09:38 +0000 mmc: Add mmc-pwrseq driver This driver is used to power up sdio card or eMMC. It handle the reset-gpio, clocks and needed delays for powerup/powerdown. Sponsored by: Diablotin Systems Differential Revision: https://reviews.freebsd.org/D30288 (cherry picked from commit 5b2a81f58dc722ca76065536f07ba47efd98dc63) --- sys/conf/files | 2 + sys/dev/mmc/mmc_pwrseq.c | 194 ++++++++++++++++++++++++++++++++++++++++++++ sys/dev/mmc/mmc_pwrseq_if.m | 38 +++++++++ 3 files changed, 234 insertions(+) diff --git a/sys/conf/files b/sys/conf/files index 6b4786d05e3f..f437760a5e73 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -2474,6 +2474,8 @@ dev/mmc/mmcbr_if.m standard dev/mmc/mmcbus_if.m standard dev/mmc/mmcsd.c optional mmcsd !mmccam dev/mmc/mmc_fdt_helpers.c optional mmc fdt | mmccam fdt +dev/mmc/mmc_pwrseq.c optional mmc fdt | mmccam fdt +dev/mmc/mmc_pwrseq_if.m optional mmc fdt | mmccam fdt dev/mmcnull/mmcnull.c optional mmcnull dev/mn/if_mn.c optional mn pci dev/mpr/mpr.c optional mpr diff --git a/sys/dev/mmc/mmc_pwrseq.c b/sys/dev/mmc/mmc_pwrseq.c new file mode 100644 index 000000000000..d4ccf814fe53 --- /dev/null +++ b/sys/dev/mmc/mmc_pwrseq.c @@ -0,0 +1,194 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright 2021 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include "mmc_pwrseq_if.h" + +enum pwrseq_type { + PWRSEQ_SIMPLE = 1, + PWRSEQ_EMMC, +}; + +static struct ofw_compat_data compat_data[] = { + { "mmc-pwrseq-simple", PWRSEQ_SIMPLE }, + { "mmc-pwrseq-emmc", PWRSEQ_EMMC }, + { NULL, 0 } +}; + +struct mmc_pwrseq_softc { + enum pwrseq_type type; + clk_t ext_clock; + struct gpiobus_pin *reset_gpio; + + uint32_t post_power_on_delay_ms; + uint32_t power_off_delay_us; +}; + +static int +mmc_pwrseq_probe(device_t dev) +{ + enum pwrseq_type type; + + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) + return (ENXIO); + + type = (enum pwrseq_type)ofw_bus_search_compatible(dev, compat_data)->ocd_data; + switch (type) { + case PWRSEQ_SIMPLE: + device_set_desc(dev, "MMC Simple Power sequence"); + break; + case PWRSEQ_EMMC: + device_set_desc(dev, "MMC eMMC Power sequence"); + break; + } + return (BUS_PROBE_DEFAULT); +} + +static int +mmc_pwrseq_attach(device_t dev) +{ + struct mmc_pwrseq_softc *sc; + phandle_t node; + int rv; + + sc = device_get_softc(dev); + sc->type = (enum pwrseq_type)ofw_bus_search_compatible(dev, compat_data)->ocd_data; + node = ofw_bus_get_node(dev); + + if (sc->type == PWRSEQ_SIMPLE) { + if (OF_hasprop(node, "clocks")) { + rv = clk_get_by_ofw_name(dev, 0, "ext_clock", &sc->ext_clock); + if (rv != 0) { + device_printf(dev, + "Node have a clocks property but no clocks named \"ext_clock\"\n"); + return (ENXIO); + } + } + OF_getencprop(node, "post-power-on-delay-ms", &sc->post_power_on_delay_ms, sizeof(uint32_t)); + OF_getencprop(node, "power-off-delay-us", &sc->power_off_delay_us, sizeof(uint32_t)); + } + + if (OF_hasprop(node, "reset-gpios")) { + if (gpio_pin_get_by_ofw_property(dev, node, "reset-gpios", + &sc->reset_gpio) != 0) { + device_printf(dev, "Cannot get the reset-gpios\n"); + return (ENXIO); + } + gpio_pin_setflags(sc->reset_gpio, GPIO_PIN_OUTPUT); + gpio_pin_set_active(sc->reset_gpio, true); + } + + OF_device_register_xref(OF_xref_from_node(node), dev); + return (0); +} + +static int +mmc_pwrseq_detach(device_t dev) +{ + + return (EBUSY); +} + +static int +mmv_pwrseq_set_power(device_t dev, bool power_on) +{ + struct mmc_pwrseq_softc *sc; + int rv; + + sc = device_get_softc(dev); + + if (power_on) { + if (sc->ext_clock) { + rv = clk_enable(sc->ext_clock); + if (rv != 0) + return (rv); + } + + if (sc->reset_gpio) { + rv = gpio_pin_set_active(sc->reset_gpio, false); + if (rv != 0) + return (rv); + } + + if (sc->post_power_on_delay_ms) + DELAY(sc->post_power_on_delay_ms * 1000); + } else { + if (sc->reset_gpio) { + rv = gpio_pin_set_active(sc->reset_gpio, true); + if (rv != 0) + return (rv); + } + + if (sc->ext_clock) { + rv = clk_stop(sc->ext_clock); + if (rv != 0) + return (rv); + } + if (sc->power_off_delay_us) + DELAY(sc->power_off_delay_us); + } + + return (0); +} + +static device_method_t mmc_pwrseq_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, mmc_pwrseq_probe), + DEVMETHOD(device_attach, mmc_pwrseq_attach), + DEVMETHOD(device_detach, mmc_pwrseq_detach), + + DEVMETHOD(mmc_pwrseq_set_power, mmv_pwrseq_set_power), + DEVMETHOD_END +}; + +static driver_t mmc_pwrseq_driver = { + "mmc_pwrseq", + mmc_pwrseq_methods, + sizeof(struct mmc_pwrseq_softc), +}; + +static devclass_t mmc_pwrseq_devclass; + +EARLY_DRIVER_MODULE(mmc_pwrseq, simplebus, mmc_pwrseq_driver, mmc_pwrseq_devclass, 0, 0, + BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_FIRST); +MODULE_VERSION(mmc_pwrseq, 1); +SIMPLEBUS_PNP_INFO(compat_data); diff --git a/sys/dev/mmc/mmc_pwrseq_if.m b/sys/dev/mmc/mmc_pwrseq_if.m new file mode 100644 index 000000000000..e94b44052c20 --- /dev/null +++ b/sys/dev/mmc/mmc_pwrseq_if.m @@ -0,0 +1,38 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Emmanuel Vadot +# +# 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$ +# + +INTERFACE mmc_pwrseq; + +# +# Power up/down the card +# +METHOD int set_power { + device_t bus; + bool power_on; +}; From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:17:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 171A1661BAE; Thu, 22 Jul 2021 17:17:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzdm74hCz4Vqw; Thu, 22 Jul 2021 17:17:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5CB515D27; Thu, 22 Jul 2021 17:17:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHH06m091335; Thu, 22 Jul 2021 17:17:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHH0qd091334; Thu, 22 Jul 2021 17:17:00 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:17:00 GMT Message-Id: <202107221717.16MHH0qd091334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: ac90d8077136 - stable/13 - mmc_fdt_helpers: Parse the optional pwrseq element. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ac90d8077136a3bb573824ebad0332e6e1a2f187 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:17:01 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=ac90d8077136a3bb573824ebad0332e6e1a2f187 commit ac90d8077136a3bb573824ebad0332e6e1a2f187 Author: Emmanuel Vadot AuthorDate: 2021-05-16 12:50:10 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:09:39 +0000 mmc_fdt_helpers: Parse the optional pwrseq element. If a sd/emmc node have a pwrseq property parse it and get the corresponding driver. This can later be used to powerup/powerdown the SDIO card or eMMC. Sponsored by: Diablotin Systems Differential Revision: https://reviews.freebsd.org/D30289 (cherry picked from commit b0387990a784050ef3a14ea49cb513b5eb737844) --- sys/dev/mmc/mmc_fdt_helpers.c | 8 ++++++++ sys/dev/mmc/mmc_fdt_helpers.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/sys/dev/mmc/mmc_fdt_helpers.c b/sys/dev/mmc/mmc_fdt_helpers.c index 7dff3851883b..e544f3c4ac08 100644 --- a/sys/dev/mmc/mmc_fdt_helpers.c +++ b/sys/dev/mmc/mmc_fdt_helpers.c @@ -100,6 +100,7 @@ mmc_fdt_parse(device_t dev, phandle_t node, struct mmc_fdt_helper *helper, struct mmc_host *host) { uint32_t bus_width; + phandle_t pwrseq_xref; if (node <= 0) node = ofw_bus_get_node(dev); @@ -181,6 +182,13 @@ mmc_fdt_parse(device_t dev, phandle_t node, struct mmc_fdt_helper *helper, host->caps |= MMC_CAP_SIGNALING_330; #endif + if (OF_hasprop(node, "mmc-pwrseq")) { + if (OF_getencprop(node, "mmc-pwrseq", &pwrseq_xref, sizeof(pwrseq_xref)) == -1) { + device_printf(dev, "Cannot get the pwrseq_xref property\n"); + return (ENXIO); + } + helper->mmc_pwrseq = OF_device_from_xref(pwrseq_xref); + } return (0); } diff --git a/sys/dev/mmc/mmc_fdt_helpers.h b/sys/dev/mmc/mmc_fdt_helpers.h index 73ec324d6b9f..c6e2175690ee 100644 --- a/sys/dev/mmc/mmc_fdt_helpers.h +++ b/sys/dev/mmc/mmc_fdt_helpers.h @@ -63,6 +63,8 @@ struct mmc_fdt_helper { regulator_t vmmc_supply; regulator_t vqmmc_supply; #endif + + device_t mmc_pwrseq; }; typedef void (*mmc_fdt_cd_handler)(device_t dev, bool present); From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:17:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D6A7661C32; Thu, 22 Jul 2021 17:17:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzdp2FDmz4Vfm; Thu, 22 Jul 2021 17:17:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04C591566D; Thu, 22 Jul 2021 17:17:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHH1FF091359; Thu, 22 Jul 2021 17:17:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHH1Ya091358; Thu, 22 Jul 2021 17:17:01 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:17:01 GMT Message-Id: <202107221717.16MHH1Ya091358@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: ee2a2639749f - stable/13 - arm64: allwinner: axp81x: Add support for regnode_status MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ee2a2639749fd42de2b4bf19d4784948a6d1fca5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:17:02 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=ee2a2639749fd42de2b4bf19d4784948a6d1fca5 commit ee2a2639749fd42de2b4bf19d4784948a6d1fca5 Author: Emmanuel Vadot AuthorDate: 2021-05-16 14:14:47 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:09:40 +0000 arm64: allwinner: axp81x: Add support for regnode_status This method is used to know if a regulator is enabled or not. Sponsored by: Diablotin Systems Differential Revision: https://reviews.freebsd.org/D30290 (cherry picked from commit 182717da888023a8d0d1a66d579b5a5429b8681d) --- sys/arm/allwinner/axp81x.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sys/arm/allwinner/axp81x.c b/sys/arm/allwinner/axp81x.c index 85971a7773c4..df083ec49e32 100644 --- a/sys/arm/allwinner/axp81x.c +++ b/sys/arm/allwinner/axp81x.c @@ -850,6 +850,22 @@ axp8xx_regnode_voltage_to_reg(struct axp8xx_reg_sc *sc, int min_uvolt, return (0); } +static int +axp8xx_regnode_status(struct regnode *regnode, int *status) +{ + struct axp8xx_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + *status = 0; + axp8xx_read(sc->base_dev, sc->def->enable_reg, &val, 1); + if (val & sc->def->enable_mask) + *status = REGULATOR_STATUS_ENABLED; + + return (0); +} + static int axp8xx_regnode_set_voltage(struct regnode *regnode, int min_uvolt, int max_uvolt, int *udelay) @@ -899,6 +915,7 @@ static regnode_method_t axp8xx_regnode_methods[] = { /* Regulator interface */ REGNODEMETHOD(regnode_init, axp8xx_regnode_init), REGNODEMETHOD(regnode_enable, axp8xx_regnode_enable), + REGNODEMETHOD(regnode_status, axp8xx_regnode_status), REGNODEMETHOD(regnode_set_voltage, axp8xx_regnode_set_voltage), REGNODEMETHOD(regnode_get_voltage, axp8xx_regnode_get_voltage), REGNODEMETHOD(regnode_check_voltage, regnode_method_check_voltage), From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:17:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E740A661B3A; Thu, 22 Jul 2021 17:17:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzds5135z4Vg0; Thu, 22 Jul 2021 17:17:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E81D15C2A; Thu, 22 Jul 2021 17:17:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHH5Zm091438; Thu, 22 Jul 2021 17:17:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHH5tt091437; Thu, 22 Jul 2021 17:17:05 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:17:05 GMT Message-Id: <202107221717.16MHH5tt091437@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 1e372b049426 - stable/13 - extres: regulator: Fix regulator_status for already enable regulators MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1e372b0494264bb0b449b88c94f103566c00f80a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:17:06 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=1e372b0494264bb0b449b88c94f103566c00f80a commit 1e372b0494264bb0b449b88c94f103566c00f80a Author: Emmanuel Vadot AuthorDate: 2021-05-16 14:21:43 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:09:43 +0000 extres: regulator: Fix regulator_status for already enable regulators If a regulator hasn't been enable by a driver but is enabled in hardware (most likely enabled by U-Boot), regulator_status will returns that it is enabled and so any call to regulator_disable will panic as it wasn't enabled by one of our drivers. Sponsored by: Diablotin Systems Differential Revision: https://reviews.freebsd.org/D30293 (cherry picked from commit f52072b06da761c05dcb636dd1a02dea7214174a) --- sys/dev/extres/regulator/regulator.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/extres/regulator/regulator.c b/sys/dev/extres/regulator/regulator.c index 63b7d116f416..eab79e9dfbc3 100644 --- a/sys/dev/extres/regulator/regulator.c +++ b/sys/dev/extres/regulator/regulator.c @@ -985,6 +985,10 @@ regulator_status(regulator_t reg, int *status) KASSERT(regnode->ref_cnt > 0, ("Attempt to access unreferenced regulator: %s\n", regnode->name)); + if (reg->enable_cnt == 0) { + *status = 0; + return (0); + } REG_TOPO_SLOCK(); rv = regnode_status(regnode, status); REG_TOPO_UNLOCK(); From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:17:03 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C212E661B38; Thu, 22 Jul 2021 17:17:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzdq3wQgz4VnR; Thu, 22 Jul 2021 17:17:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 228F815B5C; Thu, 22 Jul 2021 17:17:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHH3sQ091389; Thu, 22 Jul 2021 17:17:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHH3cU091388; Thu, 22 Jul 2021 17:17:03 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:17:03 GMT Message-Id: <202107221717.16MHH3cU091388@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 19ccda09deb7 - stable/13 - mmc_fdt_helper: Add mmc_fdt_set_power MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 19ccda09deb783cefcc06346ac7e1d34ebb8f8ec Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:17:04 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=19ccda09deb783cefcc06346ac7e1d34ebb8f8ec commit 19ccda09deb783cefcc06346ac7e1d34ebb8f8ec Author: Emmanuel Vadot AuthorDate: 2021-05-16 14:18:46 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:09:41 +0000 mmc_fdt_helper: Add mmc_fdt_set_power This helper can be used to enable/disable the regulator and starting the power sequence of sd/sdio/eMMC cards. Sponsored by: Diablotin Systems Differential Revision: https://reviews.freebsd.org/D30291 (cherry picked from commit 03d4e8bb6592fefab7b17f1d163adba4e35a12c2) --- sys/dev/mmc/mmc_fdt_helpers.c | 42 ++++++++++++++++++++++++++++++++++++++++++ sys/dev/mmc/mmc_fdt_helpers.h | 1 + 2 files changed, 43 insertions(+) diff --git a/sys/dev/mmc/mmc_fdt_helpers.c b/sys/dev/mmc/mmc_fdt_helpers.c index e544f3c4ac08..4e8a1730d240 100644 --- a/sys/dev/mmc/mmc_fdt_helpers.c +++ b/sys/dev/mmc/mmc_fdt_helpers.c @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#include "mmc_pwrseq_if.h" + static inline void mmc_fdt_parse_sd_speed(phandle_t node, struct mmc_host *host) { @@ -423,3 +425,43 @@ mmc_fdt_gpio_get_readonly(struct mmc_fdt_helper *helper) return (pinstate ^ (helper->props & MMC_PROP_WP_INVERTED)); } + +void +mmc_fdt_set_power(struct mmc_fdt_helper *helper, enum mmc_power_mode power_mode) +{ + int reg_status; + int rv; + + switch (power_mode) { + case power_on: + break; + case power_off: + if (helper->vmmc_supply) { + rv = regulator_status(helper->vmmc_supply, ®_status); + if (rv == 0 && reg_status == REGULATOR_STATUS_ENABLED) + regulator_disable(helper->vmmc_supply); + } + if (helper->vqmmc_supply) { + rv = regulator_status(helper->vqmmc_supply, ®_status); + if (rv == 0 && reg_status == REGULATOR_STATUS_ENABLED) + regulator_disable(helper->vqmmc_supply); + } + if (helper->mmc_pwrseq) + MMC_PWRSEQ_SET_POWER(helper->mmc_pwrseq, false); + break; + case power_up: + if (helper->vmmc_supply) { + rv = regulator_status(helper->vmmc_supply, ®_status); + if (rv == 0 && reg_status != REGULATOR_STATUS_ENABLED) + regulator_enable(helper->vmmc_supply); + } + if (helper->vqmmc_supply) { + rv = regulator_status(helper->vqmmc_supply, ®_status); + if (rv == 0 && reg_status != REGULATOR_STATUS_ENABLED) + regulator_enable(helper->vqmmc_supply); + } + if (helper->mmc_pwrseq) + MMC_PWRSEQ_SET_POWER(helper->mmc_pwrseq, true); + break; + } +} diff --git a/sys/dev/mmc/mmc_fdt_helpers.h b/sys/dev/mmc/mmc_fdt_helpers.h index c6e2175690ee..e6d6f3fbfd84 100644 --- a/sys/dev/mmc/mmc_fdt_helpers.h +++ b/sys/dev/mmc/mmc_fdt_helpers.h @@ -74,5 +74,6 @@ int mmc_fdt_gpio_setup(device_t dev, phandle_t node, struct mmc_fdt_helper *help void mmc_fdt_gpio_teardown(struct mmc_fdt_helper *helper); bool mmc_fdt_gpio_get_present(struct mmc_fdt_helper *helper); bool mmc_fdt_gpio_get_readonly(struct mmc_fdt_helper *helper); +void mmc_fdt_set_power(struct mmc_fdt_helper *helper, enum mmc_power_mode power_mode); #endif From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:17:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C6C6661BC7; Thu, 22 Jul 2021 17:17:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzdt5fx3z4W0Q; Thu, 22 Jul 2021 17:17:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 780A815E8E; Thu, 22 Jul 2021 17:17:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHH6sb091462; Thu, 22 Jul 2021 17:17:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHH6BO091461; Thu, 22 Jul 2021 17:17:06 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:17:06 GMT Message-Id: <202107221717.16MHH6BO091461@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: e05134d0562c - stable/13 - arm: allwinner: aw_mmc: Check regulators status before enabling/disabling them MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e05134d0562cbcbac09e7ad7dafa093668e432f0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:17:07 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=e05134d0562cbcbac09e7ad7dafa093668e432f0 commit e05134d0562cbcbac09e7ad7dafa093668e432f0 Author: Emmanuel Vadot AuthorDate: 2021-05-16 14:24:31 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:09:44 +0000 arm: allwinner: aw_mmc: Check regulators status before enabling/disabling them Sponsored by: Diablotin Systems Differential Revision: https://reviews.freebsd.org/D30294 (cherry picked from commit 115e71a4571459e69001b5017ec19532e9d60e1b) --- sys/arm/allwinner/aw_mmc.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/sys/arm/allwinner/aw_mmc.c b/sys/arm/allwinner/aw_mmc.c index f63b41f9b73c..0b3f19aea55f 100644 --- a/sys/arm/allwinner/aw_mmc.c +++ b/sys/arm/allwinner/aw_mmc.c @@ -1285,6 +1285,8 @@ aw_mmc_update_ios(device_t bus, device_t child) struct mmc_ios *ios; unsigned int clock; uint32_t reg, div = 1; + int reg_status; + int rv; sc = device_get_softc(bus); @@ -1310,10 +1312,16 @@ aw_mmc_update_ios(device_t bus, device_t child) if (__predict_false(aw_mmc_debug & AW_MMC_DEBUG_CARD)) device_printf(sc->aw_dev, "Powering down sd/mmc\n"); - if (sc->mmc_helper.vmmc_supply) - regulator_disable(sc->mmc_helper.vmmc_supply); - if (sc->mmc_helper.vqmmc_supply) - regulator_disable(sc->mmc_helper.vqmmc_supply); + if (sc->mmc_helper.vmmc_supply) { + rv = regulator_status(sc->mmc_helper.vmmc_supply, ®_status); + if (rv == 0 && reg_status == REGULATOR_STATUS_ENABLED) + regulator_disable(sc->mmc_helper.vmmc_supply); + } + if (sc->mmc_helper.vqmmc_supply) { + rv = regulator_status(sc->mmc_helper.vqmmc_supply, ®_status); + if (rv == 0 && reg_status == REGULATOR_STATUS_ENABLED) + regulator_disable(sc->mmc_helper.vqmmc_supply); + } aw_mmc_reset(sc); break; @@ -1321,10 +1329,16 @@ aw_mmc_update_ios(device_t bus, device_t child) if (__predict_false(aw_mmc_debug & AW_MMC_DEBUG_CARD)) device_printf(sc->aw_dev, "Powering up sd/mmc\n"); - if (sc->mmc_helper.vmmc_supply) - regulator_enable(sc->mmc_helper.vmmc_supply); - if (sc->mmc_helper.vqmmc_supply) - regulator_enable(sc->mmc_helper.vqmmc_supply); + if (sc->mmc_helper.vmmc_supply) { + rv = regulator_status(sc->mmc_helper.vmmc_supply, ®_status); + if (rv == 0 && reg_status != REGULATOR_STATUS_ENABLED) + regulator_enable(sc->mmc_helper.vmmc_supply); + } + if (sc->mmc_helper.vqmmc_supply) { + rv = regulator_status(sc->mmc_helper.vqmmc_supply, ®_status); + if (rv == 0 && reg_status != REGULATOR_STATUS_ENABLED) + regulator_enable(sc->mmc_helper.vqmmc_supply); + } aw_mmc_init(sc); break; }; From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:17:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D4EA0661AD9; Thu, 22 Jul 2021 17:17:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzdr56Rhz4Vr7; Thu, 22 Jul 2021 17:17:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4723115E45; Thu, 22 Jul 2021 17:17:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHH47E091414; Thu, 22 Jul 2021 17:17:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHH4hM091413; Thu, 22 Jul 2021 17:17:04 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:17:04 GMT Message-Id: <202107221717.16MHH4hM091413@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: ea9bd18bac51 - stable/13 - mmc: dwmmc: Call mmc_fdt_set_power MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ea9bd18bac51dee06c19c70a0252f7aa46f1506b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:17:06 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=ea9bd18bac51dee06c19c70a0252f7aa46f1506b commit ea9bd18bac51dee06c19c70a0252f7aa46f1506b Author: Emmanuel Vadot AuthorDate: 2021-05-16 14:20:42 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:09:42 +0000 mmc: dwmmc: Call mmc_fdt_set_power This allow us to powerup/down the card and enabling/disabling the regulators if any. Sponsored by: Diablotin Systems Differential Revision: https://reviews.freebsd.org/D30292 (cherry picked from commit ce41765c21ac56a37c60a0e8cd227ee3396740cc) --- sys/dev/mmc/host/dwmmc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c index 1ffbf4aec41c..7a5994680c53 100644 --- a/sys/dev/mmc/host/dwmmc.c +++ b/sys/dev/mmc/host/dwmmc.c @@ -891,6 +891,8 @@ dwmmc_update_ios(device_t brdev, device_t reqdev) dprintf("Setting up clk %u bus_width %d, timming: %d\n", ios->clock, ios->bus_width, ios->timing); + mmc_fdt_set_power(&sc->mmc_helper, ios->power_mode); + if (ios->bus_width == bus_width_8) WRITE4(sc, SDMMC_CTYPE, SDMMC_CTYPE_8BIT); else if (ios->bus_width == bus_width_4) From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:17:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46F8F661BD5; Thu, 22 Jul 2021 17:17:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzdw6hggz4W0b; Thu, 22 Jul 2021 17:17:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6F4715D29; Thu, 22 Jul 2021 17:17:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHH8jI091510; Thu, 22 Jul 2021 17:17:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHH8ei091509; Thu, 22 Jul 2021 17:17:08 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:17:08 GMT Message-Id: <202107221717.16MHH8ei091509@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 3ef7edce2067 - stable/13 - arm: RPI-B: Add ext_resources driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3ef7edce2067eccbe53b21a1275c505490366a1f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:17:09 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=3ef7edce2067eccbe53b21a1275c505490366a1f commit 3ef7edce2067eccbe53b21a1275c505490366a1f Author: Emmanuel Vadot AuthorDate: 2021-05-24 10:53:00 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:09:46 +0000 arm: RPI-B: Add ext_resources driver mmc_fdt_helpers needs clock and regulators. Add all the ext_resources driver to RPI-B conf file to fix the build Reported by: mjg (cherry picked from commit 996afd401c6c69d5abaa1aac111ca3cdd0c90a90) --- sys/arm/conf/RPI-B | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/arm/conf/RPI-B b/sys/arm/conf/RPI-B index 36eaff0c0f28..648f9a048b19 100644 --- a/sys/arm/conf/RPI-B +++ b/sys/arm/conf/RPI-B @@ -36,6 +36,15 @@ options PLATFORM #options ROOTDEVNAME=\"ufs:mmcsd0s2\" +# EXT_RESOURCES pseudo devices +options EXT_RESOURCES +device clk +device phy +device hwreset +device nvmem +device regulator +device syscon + device bpf device loop device ether From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:17:11 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CFD8F661F04; Thu, 22 Jul 2021 17:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzdz3THZz4Vnl; Thu, 22 Jul 2021 17:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21F6E15C8D; Thu, 22 Jul 2021 17:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHHA2F091564; Thu, 22 Jul 2021 17:17:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHHAwO091563; Thu, 22 Jul 2021 17:17:10 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:17:10 GMT Message-Id: <202107221717.16MHHAwO091563@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 8c4e42f5befd - stable/13 - arm: allwinner: Add mmc_pwrseq support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8c4e42f5befdaaab0de84ff2493e65f1263365e7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:17:12 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=8c4e42f5befdaaab0de84ff2493e65f1263365e7 commit 8c4e42f5befdaaab0de84ff2493e65f1263365e7 Author: Emmanuel Vadot AuthorDate: 2021-05-26 11:13:33 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:09:47 +0000 arm: allwinner: Add mmc_pwrseq support If a pwrseq is found, set power accordingly. Sponsored by: Diablotin Systems (cherry picked from commit 6bc8fe8a9f711923253115d2a23b81370ef3e33a) --- sys/arm/allwinner/aw_mmc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/arm/allwinner/aw_mmc.c b/sys/arm/allwinner/aw_mmc.c index 0b3f19aea55f..9f215399e62b 100644 --- a/sys/arm/allwinner/aw_mmc.c +++ b/sys/arm/allwinner/aw_mmc.c @@ -71,6 +71,8 @@ __FBSDID("$FreeBSD$"); #include "mmc_sim_if.h" #endif +#include "mmc_pwrseq_if.h" + #define AW_MMC_MEMRES 0 #define AW_MMC_IRQRES 1 #define AW_MMC_RESSZ 2 @@ -1323,6 +1325,9 @@ aw_mmc_update_ios(device_t bus, device_t child) regulator_disable(sc->mmc_helper.vqmmc_supply); } + if (sc->mmc_helper.mmc_pwrseq) + MMC_PWRSEQ_SET_POWER(sc->mmc_helper.mmc_pwrseq, false); + aw_mmc_reset(sc); break; case power_up: @@ -1339,6 +1344,9 @@ aw_mmc_update_ios(device_t bus, device_t child) if (rv == 0 && reg_status != REGULATOR_STATUS_ENABLED) regulator_enable(sc->mmc_helper.vqmmc_supply); } + + if (sc->mmc_helper.mmc_pwrseq) + MMC_PWRSEQ_SET_POWER(sc->mmc_helper.mmc_pwrseq, true); aw_mmc_init(sc); break; }; From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:17:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3716661CCB; Thu, 22 Jul 2021 17:17:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzdy1crJz4VmB; Thu, 22 Jul 2021 17:17:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E55B115E46; Thu, 22 Jul 2021 17:17:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHH9r8091540; Thu, 22 Jul 2021 17:17:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHH9G8091539; Thu, 22 Jul 2021 17:17:09 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:17:09 GMT Message-Id: <202107221717.16MHH9G8091539@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 770dcb677ff0 - stable/13 - arm: SOCFPGA: Add ext_resources driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 770dcb677ff0c0bcaa6deec02797c17d7830315e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:17:11 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=770dcb677ff0c0bcaa6deec02797c17d7830315e commit 770dcb677ff0c0bcaa6deec02797c17d7830315e Author: Emmanuel Vadot AuthorDate: 2021-05-31 17:08:08 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:09:46 +0000 arm: SOCFPGA: Add ext_resources driver mmc_fdt_helpers needs clock and regulators. Add all the ext_resources driver to SOCFPGA conf file to fix the build Reported by: mjg (cherry picked from commit 2d926ed71eb15efc4b8ac828adfb221056c853fd) --- sys/arm/conf/SOCFPGA | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/arm/conf/SOCFPGA b/sys/arm/conf/SOCFPGA index 3d7511565307..8fffd811a57e 100644 --- a/sys/arm/conf/SOCFPGA +++ b/sys/arm/conf/SOCFPGA @@ -38,6 +38,15 @@ options SOC_ALTERA_CYCLONE5 #options BOOTP_NFSV3 #options BOOTP_WIRED_TO=ue0 +# EXT_RESOURCES pseudo devices +options EXT_RESOURCES +device clk +device phy +device hwreset +device nvmem +device regulator +device syscon + # Interrupt controller device gic From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:17:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E7756619FD; Thu, 22 Jul 2021 17:17:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzdx02KQz4W0c; Thu, 22 Jul 2021 17:17:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4FBA15D28; Thu, 22 Jul 2021 17:17:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHH7iu091486; Thu, 22 Jul 2021 17:17:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHH7eN091485; Thu, 22 Jul 2021 17:17:07 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:17:07 GMT Message-Id: <202107221717.16MHH7eN091485@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: c5393bd3ff19 - stable/13 - mmc: Only build mmc_fdt_helper and mmc_pwrseq for arch that uses ext_resources MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c5393bd3ff19e219482e5acb5e66e91a498ae5aa Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:17:09 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=c5393bd3ff19e219482e5acb5e66e91a498ae5aa commit c5393bd3ff19e219482e5acb5e66e91a498ae5aa Author: Emmanuel Vadot AuthorDate: 2021-05-21 17:35:20 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:09:45 +0000 mmc: Only build mmc_fdt_helper and mmc_pwrseq for arch that uses ext_resources This is now a needed requirement and fixes powerpc* build (cherry picked from commit 80e645dcdb8df280cbbe978f96c49689170eca68) --- sys/conf/files | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index f437760a5e73..3b8b761fde3a 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -2473,9 +2473,9 @@ dev/mmc/mmc.c optional mmc !mmccam dev/mmc/mmcbr_if.m standard dev/mmc/mmcbus_if.m standard dev/mmc/mmcsd.c optional mmcsd !mmccam -dev/mmc/mmc_fdt_helpers.c optional mmc fdt | mmccam fdt -dev/mmc/mmc_pwrseq.c optional mmc fdt | mmccam fdt -dev/mmc/mmc_pwrseq_if.m optional mmc fdt | mmccam fdt +dev/mmc/mmc_fdt_helpers.c optional ext_resources mmc fdt | ext_resources mmccam fdt +dev/mmc/mmc_pwrseq.c optional ext_resources mmc fdt | ext_resources mmccam fdt +dev/mmc/mmc_pwrseq_if.m optional ext_resources mmc fdt | ext_resources mmccam fdt dev/mmcnull/mmcnull.c optional mmcnull dev/mn/if_mn.c optional mn pci dev/mpr/mpr.c optional mpr From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:17:48 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D8AA66204E; Thu, 22 Jul 2021 17:17:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzfh18Cjz4WQx; Thu, 22 Jul 2021 17:17:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A31B15C2C; Thu, 22 Jul 2021 17:17:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHHlIR091769; Thu, 22 Jul 2021 17:17:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHHlq5091768; Thu, 22 Jul 2021 17:17:47 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:17:47 GMT Message-Id: <202107221717.16MHHlq5091768@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 07df8f4f9cba - stable/13 - arm64: rockchip: gpio: Give friendlier name to gpio MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 07df8f4f9cbaef43334423d9712740ea2073bb3b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:17:48 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=07df8f4f9cbaef43334423d9712740ea2073bb3b commit 07df8f4f9cbaef43334423d9712740ea2073bb3b Author: Emmanuel Vadot AuthorDate: 2021-05-16 12:47:16 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:17:39 +0000 arm64: rockchip: gpio: Give friendlier name to gpio By default name the gpio P This make it easier to find the gpio when reading schematics or DTS. Sponsored by: Diablotin Systems Differential Revision: https://reviews.freebsd.org/D30287 (cherry picked from commit bc1bb80564eef66cef1a7b9791af87ae019aa71d) --- sys/arm64/rockchip/rk_gpio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/arm64/rockchip/rk_gpio.c b/sys/arm64/rockchip/rk_gpio.c index aa44a6bc9e09..d3623b2302ec 100644 --- a/sys/arm64/rockchip/rk_gpio.c +++ b/sys/arm64/rockchip/rk_gpio.c @@ -209,14 +209,17 @@ static int rk_gpio_pin_getname(device_t dev, uint32_t pin, char *name) { struct rk_gpio_softc *sc; + uint32_t bank; sc = device_get_softc(dev); if (pin >= 32) return (EINVAL); + bank = pin / 8; + pin = pin - (bank * 8); RK_GPIO_LOCK(sc); - snprintf(name, GPIOMAXNAME, "gpio%d", pin); + snprintf(name, GPIOMAXNAME, "P%c%d", bank + 'A', pin); RK_GPIO_UNLOCK(sc); return (0); From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:19:03 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41EA566249D; Thu, 22 Jul 2021 17:19:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzh70vCrz4WYR; Thu, 22 Jul 2021 17:19:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 063CC15B62; Thu, 22 Jul 2021 17:19:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHJ2ra091967; Thu, 22 Jul 2021 17:19:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHJ2D1091966; Thu, 22 Jul 2021 17:19:02 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:19:02 GMT Message-Id: <202107221719.16MHJ2D1091966@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: a402f803956e - stable/13 - an: Deprecate the driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a402f803956e52f2df2645d503450ac5a9a3eb5f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:19:03 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=a402f803956e52f2df2645d503450ac5a9a3eb5f commit a402f803956e52f2df2645d503450ac5a9a3eb5f Author: Emmanuel Vadot AuthorDate: 2021-06-07 16:45:58 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:18:56 +0000 an: Deprecate the driver Last an(4) devices have been End Of Life and End Of Sale in 2007. Time to remove this driver. Differential Revision: https://reviews.freebsd.org/D30678 Reviewed by: imp (earlier version), adrian (earlier version) MFC after: 3 days Sponsored by: Diablotin Systems (cherry picked from commit ab30bb8270fa99503a0f204543a9ac3e3c7fa04d) --- share/man/man4/an.4 | 5 +++++ sys/dev/an/if_an.c | 1 + 2 files changed, 6 insertions(+) diff --git a/share/man/man4/an.4 b/share/man/man4/an.4 index aaa761a36b4d..1d624c0ae108 100644 --- a/share/man/man4/an.4 +++ b/share/man/man4/an.4 @@ -130,6 +130,11 @@ The .Nm device driver first appeared in .Fx 4.0 . +.Pp +The +.Nm +device driver was removed in +.Fx 14.0 . .Sh AUTHORS The .Nm diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c index 205514bf0765..3a4db28f3eac 100644 --- a/sys/dev/an/if_an.c +++ b/sys/dev/an/if_an.c @@ -661,6 +661,7 @@ an_attach(struct an_softc *sc, int flags) int i, nrate, mword; u_int8_t r; + gone_in(14, "EOL/EOS in 2007"); ifp = sc->an_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { device_printf(sc->an_dev, "can not if_alloc()\n"); From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:19:58 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53C696622C7; Thu, 22 Jul 2021 17:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzjB1pZjz4Wpp; Thu, 22 Jul 2021 17:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2734915D2F; Thu, 22 Jul 2021 17:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHJwiG092164; Thu, 22 Jul 2021 17:19:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHJwhJ092163; Thu, 22 Jul 2021 17:19:58 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:19:58 GMT Message-Id: <202107221719.16MHJwhJ092163@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: f5ca54f31268 - stable/13 - mmc_cam_sim_default_action: do not touch the ccb after dispatching it MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f5ca54f31268534b8b2032aa888e5b6870062dae Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:19:58 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=f5ca54f31268534b8b2032aa888e5b6870062dae commit f5ca54f31268534b8b2032aa888e5b6870062dae Author: Andriy Gapon AuthorDate: 2021-07-09 14:53:17 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:19:38 +0000 mmc_cam_sim_default_action: do not touch the ccb after dispatching it If MMC_SIM_CAM_REQUEST() is successful the ccb could be running or being completed as the method returns. Modifying the ccb status could override whatever status was already set by a MMC driver. I am not sure what was the purpose of setting the status to CAM_REQ_INVALID in the success path. I assume that it was to catch a possibility that the ccb could be completed without its status explicitly set. So, I am keeping the code, it's just moved to before the MMC_SIM_CAM_REQUEST call. Without this change I was getting random and phantom EIO errors on Rock64 running off an SD card (dwmmc driver) plus occasional panics like: Memory modified after free 0xffffa00003985800(2040) val=6 @ 0xffffa00003985854 panic: Most recently used by CAM CCB MFC after: 1 week (cherry picked from commit 66c183f43f0c05ed9238ed9c1859c0c9df7b66dd) --- sys/cam/mmc/mmc_sim.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/cam/mmc/mmc_sim.c b/sys/cam/mmc/mmc_sim.c index 1500e3f6f1cd..6fe38f26d339 100644 --- a/sys/cam/mmc/mmc_sim.c +++ b/sys/cam/mmc/mmc_sim.c @@ -150,11 +150,10 @@ mmc_cam_sim_default_action(struct cam_sim *sim, union ccb *ccb) break; case XPT_MMC_IO: { + ccb->ccb_h.status = CAM_REQ_INVALID; rv = MMC_SIM_CAM_REQUEST(mmc_sim->dev, ccb); if (rv != 0) ccb->ccb_h.status = CAM_SIM_QUEUED; - else - ccb->ccb_h.status = CAM_REQ_INVALID; return; /* NOTREACHED */ break; From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:22:12 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 17A91662688; Thu, 22 Jul 2021 17:22:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzlm04ZMz4XBq; Thu, 22 Jul 2021 17:22:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDB6616083; Thu, 22 Jul 2021 17:22:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHMB4c004022; Thu, 22 Jul 2021 17:22:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHMBwE004021; Thu, 22 Jul 2021 17:22:11 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:22:11 GMT Message-Id: <202107221722.16MHMBwE004021@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: f7e159e926d0 - stable/13 - arm: Add no-cftconvert for sdma-imx6 files MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f7e159e926d0f6c7edde19fa3472fd91a9ab4eb0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:22:12 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=f7e159e926d0f6c7edde19fa3472fd91a9ab4eb0 commit f7e159e926d0f6c7edde19fa3472fd91a9ab4eb0 Author: Emmanuel Vadot AuthorDate: 2021-04-14 13:43:37 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:20:47 +0000 arm: Add no-cftconvert for sdma-imx6 files Fixes a warning when building kernel: ctfconvert: file.c: Couldn't read ehdr: Invalid argument MFC after: 3 days (cherry picked from commit 0c80ad2dc6896c1fd1294cb1af59ab1f8fc95206) --- sys/arm/freescale/imx/files.imx6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm/freescale/imx/files.imx6 b/sys/arm/freescale/imx/files.imx6 index 0b71e1e6bf6a..926c2b25f4b9 100644 --- a/sys/arm/freescale/imx/files.imx6 +++ b/sys/arm/freescale/imx/files.imx6 @@ -50,12 +50,12 @@ arm/freescale/imx/imx6_usbphy.c optional ehci # SDMA firmware. sdma-imx6q.c optional fslsdma \ compile-with "${AWK} -f $S/tools/fw_stub.awk sdma-imx6q.bin:sdma-imx6q -msdma -c${.TARGET}" \ - no-implicit-rule before-depend local \ + no-ctfconvert no-implicit-rule before-depend local \ clean "sdma-imx6q.c" sdma-imx6q.fwo optional fslsdma \ dependency "sdma-imx6q.bin" \ compile-with "${LD} -m ${LD_EMULATION} -b binary -d -warn-common -r -d -o ${.TARGET} sdma-imx6q.bin" \ - no-implicit-rule \ + no-ctfconvert no-implicit-rule \ clean "sdma-imx6q.fwo" sdma-imx6q.bin optional fslsdma \ dependency "$S/contrib/dev/imx/sdma-imx6q.bin.uu" \ From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:23:32 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EDA9662884; Thu, 22 Jul 2021 17:23:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVznJ0l58z4XjH; Thu, 22 Jul 2021 17:23:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0188415D73; Thu, 22 Jul 2021 17:23:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHNVqw004947; Thu, 22 Jul 2021 17:23:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHNVTB004946; Thu, 22 Jul 2021 17:23:31 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:23:31 GMT Message-Id: <202107221723.16MHNVTB004946@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 1fbd603533ce - stable/13 - arm64: allwinner: clk: Test with the current parent freq first MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1fbd603533cebc65076aca39e76c4c8aab972fe3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:23:32 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=1fbd603533cebc65076aca39e76c4c8aab972fe3 commit 1fbd603533cebc65076aca39e76c4c8aab972fe3 Author: Emmanuel Vadot AuthorDate: 2021-05-31 12:06:20 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:23:06 +0000 arm64: allwinner: clk: Test with the current parent freq first Even if the clock is flagged with AW_CLK_SET_PARENT the current parent freq might be enough to get a correct divisor. So test first if we can get the expected freq before changing the parent freq. (cherry picked from commit ac1d7397bf33acf8955fc0871ff124550bf50d1f) --- sys/arm/allwinner/clkng/aw_clk_m.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/arm/allwinner/clkng/aw_clk_m.c b/sys/arm/allwinner/clkng/aw_clk_m.c index 4f8189d48299..9f2dea6722bc 100644 --- a/sys/arm/allwinner/clkng/aw_clk_m.c +++ b/sys/arm/allwinner/clkng/aw_clk_m.c @@ -175,7 +175,9 @@ aw_clk_m_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout, best = cur = 0; - if ((sc->flags & AW_CLK_SET_PARENT) != 0) { + best = aw_clk_m_find_best(sc, fparent, fout, + &best_m); + if ((best != *fout) && ((sc->flags & AW_CLK_SET_PARENT) != 0)) { p_clk = clknode_get_parent(clk); if (p_clk == NULL) { printf("%s: Cannot get parent for clock %s\n", @@ -187,9 +189,6 @@ aw_clk_m_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout, clknode_get_freq(p_clk, &fparent); best = aw_clk_m_find_best(sc, fparent, fout, &best_m); - } else { - best = aw_clk_m_find_best(sc, fparent, fout, - &best_m); } if ((flags & CLK_SET_DRYRUN) != 0) { From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:23:33 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D4D966246F; Thu, 22 Jul 2021 17:23:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVznK2NRBz4XgH; Thu, 22 Jul 2021 17:23:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D57815C9C; Thu, 22 Jul 2021 17:23:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHNX74004971; Thu, 22 Jul 2021 17:23:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHNXhN004970; Thu, 22 Jul 2021 17:23:33 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:23:33 GMT Message-Id: <202107221723.16MHNXhN004970@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 6a633b65cc17 - stable/13 - arm: allwinner: Add clock driver for Display Engine to the build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6a633b65cc17ad1b49f5672479ceb575fb5bd9d9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:23:33 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=6a633b65cc17ad1b49f5672479ceb575fb5bd9d9 commit 6a633b65cc17ad1b49f5672479ceb575fb5bd9d9 Author: Emmanuel Vadot AuthorDate: 2021-06-02 08:17:16 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:23:07 +0000 arm: allwinner: Add clock driver for Display Engine to the build This is needed for drm (cherry picked from commit 25593adbc125b88096de1b5669e1a9e40b7421a1) --- sys/arm/allwinner/files.allwinner | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/arm/allwinner/files.allwinner b/sys/arm/allwinner/files.allwinner index 6148c9787c06..55519fc78026 100644 --- a/sys/arm/allwinner/files.allwinner +++ b/sys/arm/allwinner/files.allwinner @@ -45,3 +45,4 @@ arm/allwinner/clkng/aw_clk_nm.c standard arm/allwinner/clkng/aw_clk_np.c standard arm/allwinner/clkng/aw_clk_nmm.c standard arm/allwinner/clkng/aw_clk_prediv_mux.c standard +arm/allwinner/clkng/ccu_de2.c standard From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:24:54 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 432606628AE; Thu, 22 Jul 2021 17:24:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzpt1Txwz4XRh; Thu, 22 Jul 2021 17:24:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B2C615FD9; Thu, 22 Jul 2021 17:24:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHOseA005185; Thu, 22 Jul 2021 17:24:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHOs07005184; Thu, 22 Jul 2021 17:24:54 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:24:54 GMT Message-Id: <202107221724.16MHOs07005184@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 1476f211a5b4 - stable/13 - mmccam: Style(9) more mmc_da.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1476f211a5b40900d701c67b756cadc124a0bce2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:24:54 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=1476f211a5b40900d701c67b756cadc124a0bce2 commit 1476f211a5b40900d701c67b756cadc124a0bce2 Author: Emmanuel Vadot AuthorDate: 2021-06-17 15:54:56 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:24:34 +0000 mmccam: Style(9) more mmc_da.c No functional changes. Sponsored by: Diablotin Systems (cherry picked from commit 20d601682efe4332dc317a77afada70fa367f89a) --- sys/cam/mmc/mmc_da.c | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/sys/cam/mmc/mmc_da.c b/sys/cam/mmc/mmc_da.c index 127d1cb48602..fdaea7b1a768 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -446,12 +446,12 @@ mmc_format_card_id_string(struct sdda_softc *sc, struct mmc_params *mmcp) snprintf(sc->card_sn_string, sizeof(sc->card_sn_string), "%08X", sc->cid.psn); snprintf(sc->card_id_string, sizeof(sc->card_id_string), - "%s%s %s %d.%d SN %08X MFG %02d/%04d by %d %s", - mmcp->card_features & CARD_FEATURE_MMC ? "MMC" : "SD", - mmcp->card_features & CARD_FEATURE_SDHC ? "HC" : "", - sc->cid.pnm, sc->cid.prv >> 4, sc->cid.prv & 0x0f, - sc->cid.psn, sc->cid.mdt_month, sc->cid.mdt_year, - sc->cid.mid, oidstr); + "%s%s %s %d.%d SN %08X MFG %02d/%04d by %d %s", + mmcp->card_features & CARD_FEATURE_MMC ? "MMC" : "SD", + mmcp->card_features & CARD_FEATURE_SDHC ? "HC" : "", + sc->cid.pnm, sc->cid.prv >> 4, sc->cid.prv & 0x0f, + sc->cid.psn, sc->cid.mdt_month, sc->cid.mdt_year, + sc->cid.mid, oidstr); } static int @@ -603,7 +603,7 @@ sddadiskgonecb(struct disk *dp) part = (struct sdda_part *)dp->d_drv1; periph = part->sc->periph; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("sddadiskgonecb\n")); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("sddadiskgonecb\n")); cam_periph_release(periph); } @@ -616,7 +616,7 @@ sddaoninvalidate(struct cam_periph *periph) softc = (struct sdda_softc *)periph->softc; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("sddaoninvalidate\n")); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("sddaoninvalidate\n")); /* * De-register any async callbacks. @@ -628,15 +628,14 @@ sddaoninvalidate(struct cam_periph *periph) * XXX Handle any transactions queued to the card * with XPT_ABORT_CCB. */ - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("bioq_flush start\n")); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("bioq_flush start\n")); for (int i = 0; i < MMC_PART_MAX; i++) { if ((part = softc->part[i]) != NULL) { bioq_flush(&part->bio_queue, NULL, ENXIO); disk_gone(part->disk); } } - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("bioq_flush end\n")); - + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("bioq_flush end\n")); } static void @@ -675,7 +674,7 @@ sddaasync(void *callback_arg, u_int32_t code, switch (code) { case AC_FOUND_DEVICE: { - CAM_DEBUG(path, CAM_DEBUG_TRACE, ("=> AC_FOUND_DEVICE\n")); + CAM_DEBUG(path, CAM_DEBUG_TRACE, ("=> AC_FOUND_DEVICE\n")); struct ccb_getdev *cgd; cam_status status; @@ -686,10 +685,10 @@ sddaasync(void *callback_arg, u_int32_t code, if (cgd->protocol != PROTO_MMCSD) break; - if (!(path->device->mmc_ident_data.card_features & CARD_FEATURE_MEMORY)) { - CAM_DEBUG(path, CAM_DEBUG_TRACE, ("No memory on the card!\n")); - break; - } + if (!(path->device->mmc_ident_data.card_features & CARD_FEATURE_MEMORY)) { + CAM_DEBUG(path, CAM_DEBUG_TRACE, ("No memory on the card!\n")); + break; + } /* * Allocate a peripheral instance for @@ -773,7 +772,7 @@ sddaregister(struct cam_periph *periph, void *arg) struct ccb_getdev *cgd; union ccb *request_ccb; /* CCB representing the probe request */ - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("sddaregister\n")); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("sddaregister\n")); cgd = (struct ccb_getdev *)arg; if (cgd == NULL) { printf("sddaregister: no getdev CCB, can't register device\n"); @@ -1257,7 +1256,6 @@ sdda_start_init(void *context, union ccb *start_ccb) } struct sdda_softc *softc = (struct sdda_softc *)periph->softc; - //struct ccb_mmcio *mmcio = &start_ccb->mmcio; struct mmc_params *mmcp = &periph->path->device->mmc_ident_data; struct cam_ed *device = periph->path->device; @@ -1587,7 +1585,6 @@ sdda_add_part(struct cam_periph *periph, u_int type, const char *name, part->disk->d_close = sddaclose; part->disk->d_strategy = sddastrategy; part->disk->d_getattr = sddagetattr; -// sc->disk->d_dump = sddadump; part->disk->d_gone = sddadiskgonecb; part->disk->d_name = part->name; part->disk->d_drv1 = part; @@ -1947,7 +1944,6 @@ sddadone(struct cam_periph *periph, union ccb *done_ccb) path = done_ccb->ccb_h.path; CAM_DEBUG(path, CAM_DEBUG_TRACE, ("sddadone\n")); -// cam_periph_lock(periph); if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { CAM_DEBUG(path, CAM_DEBUG_TRACE, ("Error!!!\n")); if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:24:55 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3208662918; Thu, 22 Jul 2021 17:24:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzpv3QVkz4Xs0; Thu, 22 Jul 2021 17:24:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4621715EA7; Thu, 22 Jul 2021 17:24:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHOtoK005215; Thu, 22 Jul 2021 17:24:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHOtf5005214; Thu, 22 Jul 2021 17:24:55 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:24:55 GMT Message-Id: <202107221724.16MHOtf5005214@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 65d1d34e975b - stable/13 - mmccam: Read the common members of CSD v1.0 and v2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 65d1d34e975b1efd30e1102beca06ae4303abcf9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:24:55 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=65d1d34e975b1efd30e1102beca06ae4303abcf9 commit 65d1d34e975b1efd30e1102beca06ae4303abcf9 Author: Emmanuel Vadot AuthorDate: 2021-06-17 16:11:04 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:24:35 +0000 mmccam: Read the common members of CSD v1.0 and v2.0 And only get the differents ones based on the version. No functional changes intented. Sponsored by: Diablotin Systems (cherry picked from commit 6506efea63f5a52d62ceea4bc18b8faf8a037ff3) --- sys/cam/mmc/mmc_da.c | 63 +++++++++++++++++++--------------------------------- 1 file changed, 23 insertions(+), 40 deletions(-) diff --git a/sys/cam/mmc/mmc_da.c b/sys/cam/mmc/mmc_da.c index fdaea7b1a768..62066311aa93 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -284,20 +284,30 @@ mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *csd) memset(csd, 0, sizeof(*csd)); csd->csd_structure = v = mmc_get_bits(raw_csd, 128, 126, 2); + + /* Common members between 1.0 and 2.0 */ + m = mmc_get_bits(raw_csd, 128, 115, 4); + e = mmc_get_bits(raw_csd, 128, 112, 3); + csd->tacc = (exp[e] * mant[m] + 9) / 10; + csd->nsac = mmc_get_bits(raw_csd, 128, 104, 8) * 100; + m = mmc_get_bits(raw_csd, 128, 99, 4); + e = mmc_get_bits(raw_csd, 128, 96, 3); + csd->tran_speed = exp[e] * 10000 * mant[m]; + csd->ccc = mmc_get_bits(raw_csd, 128, 84, 12); + csd->read_bl_len = 1 << mmc_get_bits(raw_csd, 128, 80, 4); + csd->read_bl_partial = mmc_get_bits(raw_csd, 128, 79, 1); + csd->write_blk_misalign = mmc_get_bits(raw_csd, 128, 78, 1); + csd->read_blk_misalign = mmc_get_bits(raw_csd, 128, 77, 1); + csd->dsr_imp = mmc_get_bits(raw_csd, 128, 76, 1); + csd->erase_blk_en = mmc_get_bits(raw_csd, 128, 46, 1); + csd->erase_sector = mmc_get_bits(raw_csd, 128, 39, 7) + 1; + csd->wp_grp_size = mmc_get_bits(raw_csd, 128, 32, 7); + csd->wp_grp_enable = mmc_get_bits(raw_csd, 128, 31, 1); + csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 128, 26, 3); + csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 128, 22, 4); + csd->write_bl_partial = mmc_get_bits(raw_csd, 128, 21, 1); + if (v == 0) { - m = mmc_get_bits(raw_csd, 128, 115, 4); - e = mmc_get_bits(raw_csd, 128, 112, 3); - csd->tacc = (exp[e] * mant[m] + 9) / 10; - csd->nsac = mmc_get_bits(raw_csd, 128, 104, 8) * 100; - m = mmc_get_bits(raw_csd, 128, 99, 4); - e = mmc_get_bits(raw_csd, 128, 96, 3); - csd->tran_speed = exp[e] * 10000 * mant[m]; - csd->ccc = mmc_get_bits(raw_csd, 128, 84, 12); - csd->read_bl_len = 1 << mmc_get_bits(raw_csd, 128, 80, 4); - csd->read_bl_partial = mmc_get_bits(raw_csd, 128, 79, 1); - csd->write_blk_misalign = mmc_get_bits(raw_csd, 128, 78, 1); - csd->read_blk_misalign = mmc_get_bits(raw_csd, 128, 77, 1); - csd->dsr_imp = mmc_get_bits(raw_csd, 128, 76, 1); csd->vdd_r_curr_min = cur_min[mmc_get_bits(raw_csd, 128, 59, 3)]; csd->vdd_r_curr_max = cur_max[mmc_get_bits(raw_csd, 128, 56, 3)]; csd->vdd_w_curr_min = cur_min[mmc_get_bits(raw_csd, 128, 53, 3)]; @@ -305,36 +315,9 @@ mmc_decode_csd_sd(uint32_t *raw_csd, struct mmc_csd *csd) m = mmc_get_bits(raw_csd, 128, 62, 12); e = mmc_get_bits(raw_csd, 128, 47, 3); csd->capacity = ((1 + m) << (e + 2)) * csd->read_bl_len; - csd->erase_blk_en = mmc_get_bits(raw_csd, 128, 46, 1); - csd->erase_sector = mmc_get_bits(raw_csd, 128, 39, 7) + 1; - csd->wp_grp_size = mmc_get_bits(raw_csd, 128, 32, 7); - csd->wp_grp_enable = mmc_get_bits(raw_csd, 128, 31, 1); - csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 128, 26, 3); - csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 128, 22, 4); - csd->write_bl_partial = mmc_get_bits(raw_csd, 128, 21, 1); } else if (v == 1) { - m = mmc_get_bits(raw_csd, 128, 115, 4); - e = mmc_get_bits(raw_csd, 128, 112, 3); - csd->tacc = (exp[e] * mant[m] + 9) / 10; - csd->nsac = mmc_get_bits(raw_csd, 128, 104, 8) * 100; - m = mmc_get_bits(raw_csd, 128, 99, 4); - e = mmc_get_bits(raw_csd, 128, 96, 3); - csd->tran_speed = exp[e] * 10000 * mant[m]; - csd->ccc = mmc_get_bits(raw_csd, 128, 84, 12); - csd->read_bl_len = 1 << mmc_get_bits(raw_csd, 128, 80, 4); - csd->read_bl_partial = mmc_get_bits(raw_csd, 128, 79, 1); - csd->write_blk_misalign = mmc_get_bits(raw_csd, 128, 78, 1); - csd->read_blk_misalign = mmc_get_bits(raw_csd, 128, 77, 1); - csd->dsr_imp = mmc_get_bits(raw_csd, 128, 76, 1); csd->capacity = ((uint64_t)mmc_get_bits(raw_csd, 128, 48, 22) + 1) * 512 * 1024; - csd->erase_blk_en = mmc_get_bits(raw_csd, 128, 46, 1); - csd->erase_sector = mmc_get_bits(raw_csd, 128, 39, 7) + 1; - csd->wp_grp_size = mmc_get_bits(raw_csd, 128, 32, 7); - csd->wp_grp_enable = mmc_get_bits(raw_csd, 128, 31, 1); - csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 128, 26, 3); - csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 128, 22, 4); - csd->write_bl_partial = mmc_get_bits(raw_csd, 128, 21, 1); } else panic("unknown SD CSD version"); } From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:26:11 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E19BC662870; Thu, 22 Jul 2021 17:26:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzrM620Zz4Xwj; Thu, 22 Jul 2021 17:26:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B64CC16085; Thu, 22 Jul 2021 17:26:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHQBou005551; Thu, 22 Jul 2021 17:26:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHQB1t005550; Thu, 22 Jul 2021 17:26:11 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:26:11 GMT Message-Id: <202107221726.16MHQB1t005550@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: a5a6fd462c6c - stable/13 - dwmmc: Add bus_generic_add_child in the methods MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a5a6fd462c6cda8cd2e0a4015d67b1237c66c1b2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:26:12 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=a5a6fd462c6cda8cd2e0a4015d67b1237c66c1b2 commit a5a6fd462c6cda8cd2e0a4015d67b1237c66c1b2 Author: Emmanuel Vadot AuthorDate: 2021-05-16 15:07:50 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:25:54 +0000 dwmmc: Add bus_generic_add_child in the methods Otherwise sdiob cannot add it's children. Sponsored by: Diablotin Systems Differential Revision: https://reviews.freebsd.org/D30295 (cherry picked from commit c99d887ca8c420297d2db335ce56075eb12443aa) --- sys/dev/mmc/host/dwmmc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/mmc/host/dwmmc.c b/sys/dev/mmc/host/dwmmc.c index 7a5994680c53..22cbf647cfa0 100644 --- a/sys/dev/mmc/host/dwmmc.c +++ b/sys/dev/mmc/host/dwmmc.c @@ -1557,6 +1557,8 @@ static device_method_t dwmmc_methods[] = { DEVMETHOD(mmc_sim_get_tran_settings, dwmmc_get_tran_settings), DEVMETHOD(mmc_sim_set_tran_settings, dwmmc_set_tran_settings), DEVMETHOD(mmc_sim_cam_request, dwmmc_cam_request), + + DEVMETHOD(bus_add_child, bus_generic_add_child), #endif DEVMETHOD_END From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:27:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D9E6D662A33; Thu, 22 Jul 2021 17:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzsK5fkDz4Y9N; Thu, 22 Jul 2021 17:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A952816036; Thu, 22 Jul 2021 17:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHR1CO005714; Thu, 22 Jul 2021 17:27:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHR1W0005713; Thu, 22 Jul 2021 17:27:01 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:27:01 GMT Message-Id: <202107221727.16MHR1W0005713@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: e1891351cf10 - stable/13 - mmc_sim: Make XPT_MMC_GET_TRAN_SETTINGS fully async MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e1891351cf10232871f95569156400d376fe8422 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:27:01 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=e1891351cf10232871f95569156400d376fe8422 commit e1891351cf10232871f95569156400d376fe8422 Author: Emmanuel Vadot AuthorDate: 2021-06-17 18:09:52 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:26:47 +0000 mmc_sim: Make XPT_MMC_GET_TRAN_SETTINGS fully async Sponsored by: Diablotin Systems (cherry picked from commit 3386347f65cdcd7c36feec216af05f188f82cf2c) --- sys/cam/mmc/mmc_sim.c | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/sys/cam/mmc/mmc_sim.c b/sys/cam/mmc/mmc_sim.c index 6fe38f26d339..022a1569cc59 100644 --- a/sys/cam/mmc/mmc_sim.c +++ b/sys/cam/mmc/mmc_sim.c @@ -63,11 +63,25 @@ mmc_sim_task(void *arg, int pending) return; cts = &mmc_sim->ccb->cts; - rv = MMC_SIM_SET_TRAN_SETTINGS(mmc_sim->dev, &cts->proto_specific.mmc); - if (rv != 0) - mmc_sim->ccb->ccb_h.status = CAM_REQ_INVALID; - else - mmc_sim->ccb->ccb_h.status = CAM_REQ_CMP; + switch (mmc_sim->ccb->ccb_h.func_code) { + case XPT_MMC_GET_TRAN_SETTINGS: + rv = MMC_SIM_GET_TRAN_SETTINGS(mmc_sim->dev, &cts->proto_specific.mmc); + if (rv != 0) + mmc_sim->ccb->ccb_h.status = CAM_REQ_INVALID; + else + mmc_sim->ccb->ccb_h.status = CAM_REQ_CMP; + break; + case XPT_MMC_SET_TRAN_SETTINGS: + rv = MMC_SIM_SET_TRAN_SETTINGS(mmc_sim->dev, &cts->proto_specific.mmc); + if (rv != 0) + mmc_sim->ccb->ccb_h.status = CAM_REQ_INVALID; + else + mmc_sim->ccb->ccb_h.status = CAM_REQ_CMP; + break; + default: + panic("Unsupported ccb func %x\n", mmc_sim->ccb->ccb_h.func_code); + break; + } xpt_done(mmc_sim->ccb); mmc_sim->ccb = NULL; @@ -108,7 +122,6 @@ mmc_cam_sim_default_action(struct cam_sim *sim, union ccb *ccb) } break; case XPT_GET_TRAN_SETTINGS: - case XPT_MMC_GET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts; @@ -125,6 +138,15 @@ mmc_cam_sim_default_action(struct cam_sim *sim, union ccb *ccb) } break; } + case XPT_MMC_GET_TRAN_SETTINGS: + { + ccb->ccb_h.status = CAM_SIM_QUEUED; + mmc_sim->ccb = ccb; + taskqueue_enqueue(taskqueue_thread, &mmc_sim->sim_task); + return; + /* NOTREACHED */ + break; + } case XPT_SET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts; From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:27:30 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 325716629D8; Thu, 22 Jul 2021 17:27:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzst0zkKz4Y6x; Thu, 22 Jul 2021 17:27:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05EB516087; Thu, 22 Jul 2021 17:27:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHRTdM005859; Thu, 22 Jul 2021 17:27:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHRTI1005858; Thu, 22 Jul 2021 17:27:29 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:27:29 GMT Message-Id: <202107221727.16MHRTI1005858@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: c62869cdb75e - stable/13 - sdhci_fdt: Add gpio_if.h to the source MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c62869cdb75e6d2e0c651dcf3f4cd131ecc37574 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:27:30 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=c62869cdb75e6d2e0c651dcf3f4cd131ecc37574 commit c62869cdb75e6d2e0c651dcf3f4cd131ecc37574 Author: Emmanuel Vadot AuthorDate: 2021-06-21 19:55:03 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:27:17 +0000 sdhci_fdt: Add gpio_if.h to the source Otherwise if we compile a kernel without gpio support this file isn't compiled. Also it's needed so it's good to list all deps. PR: 256756 (cherry picked from commit bf7b542e0216e6bd3bcd5ff46e376643d41f4f9f) --- sys/modules/sdhci_fdt/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/modules/sdhci_fdt/Makefile b/sys/modules/sdhci_fdt/Makefile index cc8c8b44f2e6..12b4af37f6e5 100644 --- a/sys/modules/sdhci_fdt/Makefile +++ b/sys/modules/sdhci_fdt/Makefile @@ -3,6 +3,6 @@ .PATH: ${SRCTOP}/sys/dev/sdhci KMOD= sdhci_fdt -SRCS= sdhci_fdt.c sdhci_fdt_gpio.c sdhci_if.h device_if.h bus_if.h mmcbr_if.h opt_mmccam.h opt_cam.h +SRCS= sdhci_fdt.c sdhci_fdt_gpio.c sdhci_if.h device_if.h bus_if.h mmcbr_if.h opt_mmccam.h opt_cam.h gpio_if.h .include From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:29:35 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 16C80662A5C; Thu, 22 Jul 2021 17:29:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzwH0C1Jz4YHb; Thu, 22 Jul 2021 17:29:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D95EC1603A; Thu, 22 Jul 2021 17:29:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHTYfi006117; Thu, 22 Jul 2021 17:29:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHTYYK006116; Thu, 22 Jul 2021 17:29:34 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:29:34 GMT Message-Id: <202107221729.16MHTYYK006116@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 4187041f7063 - stable/13 - arm64: rockchip: Add some DTSO to disable sd/mmc MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4187041f70639c701b8f324088fa64564928e32d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:29:35 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=4187041f70639c701b8f324088fa64564928e32d commit 4187041f70639c701b8f324088fa64564928e32d Author: Emmanuel Vadot AuthorDate: 2021-04-21 13:25:29 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:29:20 +0000 arm64: rockchip: Add some DTSO to disable sd/mmc This helps during developement to reduce the number of mmc controller. (cherry picked from commit eb094080855e1e8c28a70dbebab3e6ecbf8c1255) --- sys/dts/arm64/overlays/rk3399-mmc0-disable.dtso | 10 ++++++++++ sys/dts/arm64/overlays/rk3399-mmc1-disable.dtso | 10 ++++++++++ sys/dts/arm64/overlays/rk3399-sdhci-disable.dtso | 10 ++++++++++ sys/modules/dtb/rockchip/Makefile | 5 ++++- 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/sys/dts/arm64/overlays/rk3399-mmc0-disable.dtso b/sys/dts/arm64/overlays/rk3399-mmc0-disable.dtso new file mode 100644 index 000000000000..a638ed65c717 --- /dev/null +++ b/sys/dts/arm64/overlays/rk3399-mmc0-disable.dtso @@ -0,0 +1,10 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "rockchip,rk3399"; +}; + +&{/mmc@fe310000} { + status = "disabled"; +}; diff --git a/sys/dts/arm64/overlays/rk3399-mmc1-disable.dtso b/sys/dts/arm64/overlays/rk3399-mmc1-disable.dtso new file mode 100644 index 000000000000..333be61da216 --- /dev/null +++ b/sys/dts/arm64/overlays/rk3399-mmc1-disable.dtso @@ -0,0 +1,10 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "rockchip,rk3399"; +}; + +&{/mmc@fe320000} { + status = "disabled"; +}; diff --git a/sys/dts/arm64/overlays/rk3399-sdhci-disable.dtso b/sys/dts/arm64/overlays/rk3399-sdhci-disable.dtso new file mode 100644 index 000000000000..b386cc12e62a --- /dev/null +++ b/sys/dts/arm64/overlays/rk3399-sdhci-disable.dtso @@ -0,0 +1,10 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "rockchip,rk3399"; +}; + +&{/sdhci@fe330000} { + status = "disabled"; +}; diff --git a/sys/modules/dtb/rockchip/Makefile b/sys/modules/dtb/rockchip/Makefile index 12f59e4ee973..20df656bd148 100644 --- a/sys/modules/dtb/rockchip/Makefile +++ b/sys/modules/dtb/rockchip/Makefile @@ -15,7 +15,10 @@ DTS= \ rockchip/rk3399-firefly.dts \ rockchip/rk3399-rockpro64.dts -DTSO= rk3328-dwc3.dtso +DTSO= rk3328-dwc3.dtso \ + rk3399-mmc0-disable.dtso \ + rk3399-mmc1-disable.dtso \ + rk3399-sdhci-disable.dtso .endif .include From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:29:36 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C10166296D; Thu, 22 Jul 2021 17:29:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzwJ1PJVz4YPh; Thu, 22 Jul 2021 17:29:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 094D315EAA; Thu, 22 Jul 2021 17:29:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHTZeU006142; Thu, 22 Jul 2021 17:29:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHTZbV006141; Thu, 22 Jul 2021 17:29:35 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:29:35 GMT Message-Id: <202107221729.16MHTZbV006141@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 4e6f174686f6 - stable/13 - arm: allwinner: dtb: Add overlays to disable SD/MMC node MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4e6f174686f621fc2c4f17536f26457cca852a2e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:29:36 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=4e6f174686f621fc2c4f17536f26457cca852a2e commit 4e6f174686f621fc2c4f17536f26457cca852a2e Author: Emmanuel Vadot AuthorDate: 2021-05-26 10:58:50 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:29:21 +0000 arm: allwinner: dtb: Add overlays to disable SD/MMC node Useful for dev Sponsored by: Diablotin Systems (cherry picked from commit bc805293d8dac3a984edc45a5acf3906af791c13) --- sys/dts/arm/overlays/sun8i-h3-mmc0-disable.dtso | 10 ++++++++++ sys/dts/arm/overlays/sun8i-h3-mmc1-disable.dtso | 10 ++++++++++ sys/dts/arm/overlays/sun8i-h3-mmc2-disable.dtso | 10 ++++++++++ sys/modules/dtb/allwinner/Makefile | 5 ++++- 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/sys/dts/arm/overlays/sun8i-h3-mmc0-disable.dtso b/sys/dts/arm/overlays/sun8i-h3-mmc0-disable.dtso new file mode 100644 index 000000000000..137c66081efd --- /dev/null +++ b/sys/dts/arm/overlays/sun8i-h3-mmc0-disable.dtso @@ -0,0 +1,10 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "allwinner,sun8i-h3"; +}; + +&{/soc/mmc@1c0f000} { + status = "disabled"; +}; diff --git a/sys/dts/arm/overlays/sun8i-h3-mmc1-disable.dtso b/sys/dts/arm/overlays/sun8i-h3-mmc1-disable.dtso new file mode 100644 index 000000000000..36854b4b0c39 --- /dev/null +++ b/sys/dts/arm/overlays/sun8i-h3-mmc1-disable.dtso @@ -0,0 +1,10 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "allwinner,sun8i-h3"; +}; + +&{/soc/mmc@1c10000} { + status = "disabled"; +}; diff --git a/sys/dts/arm/overlays/sun8i-h3-mmc2-disable.dtso b/sys/dts/arm/overlays/sun8i-h3-mmc2-disable.dtso new file mode 100644 index 000000000000..ad0fc625a4a2 --- /dev/null +++ b/sys/dts/arm/overlays/sun8i-h3-mmc2-disable.dtso @@ -0,0 +1,10 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "allwinner,sun8i-h3"; +}; + +&{/soc/mmc@1c11000} { + status = "disabled"; +}; diff --git a/sys/modules/dtb/allwinner/Makefile b/sys/modules/dtb/allwinner/Makefile index 184cadb63fb9..fe3dccc7fd91 100644 --- a/sys/modules/dtb/allwinner/Makefile +++ b/sys/modules/dtb/allwinner/Makefile @@ -25,7 +25,10 @@ DTS= \ sun8i-h3-orangepi-plus2e.dts DTSO= sun8i-a83t-sid.dtso \ - sun8i-h3-i2c0.dtso + sun8i-h3-i2c0.dtso \ + sun8i-h3-mmc0-disable.dtso \ + sun8i-h3-mmc1-disable.dtso \ + sun8i-h3-mmc2-disable.dtso LINKS= \ ${DTBDIR}/sun4i-a10-cubieboard.dtb ${DTBDIR}/cubieboard.dtb \ From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:30:48 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DBCC662BFB; Thu, 22 Jul 2021 17:30:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzxh0PJYz4Yl7; Thu, 22 Jul 2021 17:30:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8FBF16041; Thu, 22 Jul 2021 17:30:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHUlwQ014656; Thu, 22 Jul 2021 17:30:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHUl3h014655; Thu, 22 Jul 2021 17:30:47 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:30:47 GMT Message-Id: <202107221730.16MHUl3h014655@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 2b07bfa11096 - stable/13 - arm64: allwinner: Add r_intc driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2b07bfa110962c10d3011316f6cd94f26ae0ddab Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:30:48 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=2b07bfa110962c10d3011316f6cd94f26ae0ddab commit 2b07bfa110962c10d3011316f6cd94f26ae0ddab Author: Emmanuel Vadot AuthorDate: 2021-07-01 16:41:05 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:30:21 +0000 arm64: allwinner: Add r_intc driver The r intc interrupt controller seems to do a lot of things : - It can handle the NMI interrupt - It have local interrupts for some device that also can be muxed with GIC - It can serve as an forwarder for the GIC It's mostly used for deepsleep/wakeup if I understood correctly and we do not support this on arm64. For now just forward everything to the GIC so interrupts works again for device which now have this interrupts controller set since dts v5.12 Sponsored by: Diablotin Systems (cherry picked from commit 993e8236c30a03980a563c63d1e6eae6b6dfbf59) --- sys/arm/allwinner/aw_r_intc.c | 299 ++++++++++++++++++++++++++++++++++++++++++ sys/arm64/conf/GENERIC | 1 + sys/conf/files.arm64 | 1 + 3 files changed, 301 insertions(+) diff --git a/sys/arm/allwinner/aw_r_intc.c b/sys/arm/allwinner/aw_r_intc.c new file mode 100644 index 000000000000..6d9369e12dca --- /dev/null +++ b/sys/arm/allwinner/aw_r_intc.c @@ -0,0 +1,299 @@ +/*- + * Copyright (c) 2021 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "pic_if.h" + +struct aw_r_intc_gicp_softc { + device_t dev; + device_t parent; + struct resource *res; + + struct intr_map_data_fdt *parent_map_data; +}; + +static struct ofw_compat_data compat_data[] = { + {"allwinner,sun6i-a31-r-intc", 1}, + {NULL, 0} +}; + +static int +aw_r_intc_gicp_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Allwinner R INTC"); + return (BUS_PROBE_DEFAULT); +} + +static int +aw_r_intc_gicp_attach(device_t dev) +{ + struct aw_r_intc_gicp_softc *sc; + phandle_t node, xref, intr_parent; + + sc = device_get_softc(dev); + sc->dev = dev; + node = ofw_bus_get_node(dev); + + /* Look for our parent */ + if ((intr_parent = ofw_bus_find_iparent(node)) == 0) { + device_printf(dev, + "Cannot find our parent interrupt controller\n"); + return (ENXIO); + } + if ((sc->parent = OF_device_from_xref(intr_parent)) == NULL) { + device_printf(dev, + "cannot find parent interrupt controller device\n"); + return (ENXIO); + } + + /* Register ourself as a interrupt controller */ + xref = OF_xref_from_node(node); + if (intr_pic_register(dev, xref) == NULL) { + device_printf(dev, "Cannot register GICP\n"); + return (ENXIO); + } + + /* Allocate GIC compatible mapping */ + sc->parent_map_data = (struct intr_map_data_fdt *)intr_alloc_map_data( + INTR_MAP_DATA_FDT, sizeof(struct intr_map_data_fdt) + + + 3 * sizeof(phandle_t), M_WAITOK | M_ZERO); + + /* Register ourself to device can find us */ + OF_device_register_xref(xref, dev); + + return (0); +} + +static int +aw_r_intc_gicp_detach(device_t dev) +{ + + return (EBUSY); +} + +static struct intr_map_data * +aw_r_intc_gicp_convert_map_data(struct aw_r_intc_gicp_softc *sc, + struct intr_map_data *data) +{ + struct intr_map_data_fdt *daf; + + daf = (struct intr_map_data_fdt *)data; + + /* We only support GIC forward for now */ + if (daf->ncells != 3) + return (NULL); + + /* Check if this is a GIC_SPI type */ + if (daf->cells[0] != 0) + return (NULL); + + sc->parent_map_data->ncells = 3; + sc->parent_map_data->cells[0] = 0; + sc->parent_map_data->cells[1] = daf->cells[1]; + sc->parent_map_data->cells[2] = daf->cells[2]; + + return ((struct intr_map_data *)sc->parent_map_data); +} + +static int +aw_r_intc_gicp_activate_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + struct aw_r_intc_gicp_softc *sc; + + sc = device_get_softc(dev); + data = aw_r_intc_gicp_convert_map_data(sc, data); + if (data == NULL) + return (EINVAL); + + return (PIC_ACTIVATE_INTR(sc->parent, isrc, res, data)); +} + +static void +aw_r_intc_gicp_enable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct aw_r_intc_gicp_softc *sc; + + sc = device_get_softc(dev); + + PIC_ENABLE_INTR(sc->parent, isrc); +} + +static void +aw_r_intc_gicp_disable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct aw_r_intc_gicp_softc *sc; + + sc = device_get_softc(dev); + + PIC_DISABLE_INTR(sc->parent, isrc); +} + +static int +aw_r_intc_gicp_map_intr(device_t dev, struct intr_map_data *data, + struct intr_irqsrc **isrcp) +{ + struct aw_r_intc_gicp_softc *sc; + int ret; + + sc = device_get_softc(dev); + + if (data->type != INTR_MAP_DATA_FDT) + return (ENOTSUP); + + data = aw_r_intc_gicp_convert_map_data(sc, data); + if (data == NULL) + return (EINVAL); + + ret = PIC_MAP_INTR(sc->parent, data, isrcp); + (*isrcp)->isrc_dev = sc->dev; + return(ret); +} + +static int +aw_r_intc_gicp_deactivate_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + struct aw_r_intc_gicp_softc *sc; + + sc = device_get_softc(dev); + + data = aw_r_intc_gicp_convert_map_data(sc, data); + if (data == NULL) + return (EINVAL); + + return (PIC_DEACTIVATE_INTR(sc->parent, isrc, res, data)); +} + +static int +aw_r_intc_gicp_setup_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + struct aw_r_intc_gicp_softc *sc; + + sc = device_get_softc(dev); + data = aw_r_intc_gicp_convert_map_data(sc, data); + if (data == NULL) + return (EINVAL); + + return (PIC_SETUP_INTR(sc->parent, isrc, res, data)); +} + +static int +aw_r_intc_gicp_teardown_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + struct aw_r_intc_gicp_softc *sc; + + sc = device_get_softc(dev); + data = aw_r_intc_gicp_convert_map_data(sc, data); + if (data == NULL) + return (EINVAL); + + return (PIC_TEARDOWN_INTR(sc->parent, isrc, res, data)); +} + +static void +aw_r_intc_gicp_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct aw_r_intc_gicp_softc *sc; + + sc = device_get_softc(dev); + + PIC_PRE_ITHREAD(sc->parent, isrc); +} + +static void +aw_r_intc_gicp_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct aw_r_intc_gicp_softc *sc; + + sc = device_get_softc(dev); + + PIC_POST_ITHREAD(sc->parent, isrc); +} + +static void +aw_r_intc_gicp_post_filter(device_t dev, struct intr_irqsrc *isrc) +{ + struct aw_r_intc_gicp_softc *sc; + + sc = device_get_softc(dev); + + PIC_POST_FILTER(sc->parent, isrc); +} + +static device_method_t aw_r_intc_gicp_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, aw_r_intc_gicp_probe), + DEVMETHOD(device_attach, aw_r_intc_gicp_attach), + DEVMETHOD(device_detach, aw_r_intc_gicp_detach), + + /* Interrupt controller interface */ + DEVMETHOD(pic_activate_intr, aw_r_intc_gicp_activate_intr), + DEVMETHOD(pic_disable_intr, aw_r_intc_gicp_disable_intr), + DEVMETHOD(pic_enable_intr, aw_r_intc_gicp_enable_intr), + DEVMETHOD(pic_map_intr, aw_r_intc_gicp_map_intr), + DEVMETHOD(pic_deactivate_intr, aw_r_intc_gicp_deactivate_intr), + DEVMETHOD(pic_setup_intr, aw_r_intc_gicp_setup_intr), + DEVMETHOD(pic_teardown_intr, aw_r_intc_gicp_teardown_intr), + DEVMETHOD(pic_post_filter, aw_r_intc_gicp_post_filter), + DEVMETHOD(pic_post_ithread, aw_r_intc_gicp_post_ithread), + DEVMETHOD(pic_pre_ithread, aw_r_intc_gicp_pre_ithread), + + DEVMETHOD_END +}; + +static devclass_t aw_r_intc_gicp_devclass; + +static driver_t aw_r_intc_gicp_driver = { + "aw_r_intc_gicp", + aw_r_intc_gicp_methods, + sizeof(struct aw_r_intc_gicp_softc), +}; + +EARLY_DRIVER_MODULE(aw_r_intc_gicp, simplebus, aw_r_intc_gicp_driver, + aw_r_intc_gicp_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); diff --git a/sys/arm64/conf/GENERIC b/sys/arm64/conf/GENERIC index 7f0b6b84ad41..3ce13a49bec7 100644 --- a/sys/arm64/conf/GENERIC +++ b/sys/arm64/conf/GENERIC @@ -199,6 +199,7 @@ device aw_ccu # Allwinner clock controller # Interrupt controllers device aw_nmi # Allwinner NMI support +device aw_r_intc # Allwinner RINTC support device mv_cp110_icu # Marvell CP110 ICU device mv_ap806_gicp # Marvell AP806 GICP device mv_ap806_sei # Marvell AP806 SEI diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 8ecba5177125..ae5bc94fa13e 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -301,6 +301,7 @@ arm/allwinner/aw_mmc.c optional mmc aw_mmc fdt | mmccam aw_mmc fdt arm/allwinner/aw_nmi.c optional aw_nmi fdt \ compile-with "${NORMAL_C} -I$S/contrib/device-tree/include" arm/allwinner/aw_pwm.c optional aw_pwm fdt +arm/allwinner/aw_r_intc.c optional aw_r_intc fdt arm/allwinner/aw_rsb.c optional aw_rsb fdt arm/allwinner/aw_rtc.c optional aw_rtc fdt arm/allwinner/aw_sid.c optional aw_sid nvmem fdt From owner-dev-commits-src-branches@freebsd.org Thu Jul 22 17:30:49 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7664B662BFE; Thu, 22 Jul 2021 17:30:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVzxj1L39z4YYx; Thu, 22 Jul 2021 17:30:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1785116103; Thu, 22 Jul 2021 17:30:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16MHUn81014682; Thu, 22 Jul 2021 17:30:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16MHUmJN014681; Thu, 22 Jul 2021 17:30:48 GMT (envelope-from git) Date: Thu, 22 Jul 2021 17:30:48 GMT Message-Id: <202107221730.16MHUmJN014681@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: b71d5848cd6f - stable/13 - armv7: allwinner: Add aw_r_intc driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b71d5848cd6f338b7fd34b2ea9e5bed078bb1a22 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 17:30:49 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=b71d5848cd6f338b7fd34b2ea9e5bed078bb1a22 commit b71d5848cd6f338b7fd34b2ea9e5bed078bb1a22 Author: Emmanuel Vadot AuthorDate: 2021-07-05 09:38:23 +0000 Commit: Emmanuel Vadot CommitDate: 2021-07-22 17:30:22 +0000 armv7: allwinner: Add aw_r_intc driver This is also needed after the 5.13 dts update. Sponsored by: Diablotin Systems Reported by: Mark Millard (cherry picked from commit 48687f733fdbbe4b7085aa88a70194c39b44bd9b) --- sys/arm/allwinner/files.allwinner | 1 + sys/arm/conf/GENERIC | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/arm/allwinner/files.allwinner b/sys/arm/allwinner/files.allwinner index 55519fc78026..57e27a962ec0 100644 --- a/sys/arm/allwinner/files.allwinner +++ b/sys/arm/allwinner/files.allwinner @@ -11,6 +11,7 @@ arm/allwinner/aw_machdep.c standard arm/allwinner/aw_mmc.c optional mmc | mmccam arm/allwinner/aw_mp.c optional smp arm/allwinner/aw_nmi.c standard +arm/allwinner/aw_r_intc.c optional aw_r_intc arm/allwinner/aw_rsb.c optional rsb | p2wi arm/allwinner/aw_rtc.c optional aw_rtc arm/allwinner/aw_syscon.c optional ext_resources syscon diff --git a/sys/arm/conf/GENERIC b/sys/arm/conf/GENERIC index baef32a7a99d..bc191d86dd59 100644 --- a/sys/arm/conf/GENERIC +++ b/sys/arm/conf/GENERIC @@ -83,6 +83,7 @@ device cpufreq # Interrupt controller device gic +device aw_r_intc # PMU support (for CCNT). device pmu From owner-dev-commits-src-branches@freebsd.org Fri Jul 23 01:32:32 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A3EB66981E; Fri, 23 Jul 2021 01:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GWBdX2Svsz4v5H; Fri, 23 Jul 2021 01:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D2991C538; Fri, 23 Jul 2021 01:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16N1WWgn060461; Fri, 23 Jul 2021 01:32:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16N1WWDq060460; Fri, 23 Jul 2021 01:32:32 GMT (envelope-from git) Date: Fri, 23 Jul 2021 01:32:32 GMT Message-Id: <202107230132.16N1WWDq060460@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 06887e068647 - stable/13 - zfs: update zfs_gitrev.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 06887e06864706ee0b550df9815427805b1a5261 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 01:32:32 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=06887e06864706ee0b550df9815427805b1a5261 commit 06887e06864706ee0b550df9815427805b1a5261 Author: Martin Matuska AuthorDate: 2021-07-23 01:29:33 +0000 Commit: Martin Matuska CommitDate: 2021-07-23 01:29:33 +0000 zfs: update zfs_gitrev.h From now on, every merge from vendor/openzfs/zfs-2.1-release should come with an updated zfs_config.h and zfs_gitrev.h (direct commit) --- sys/modules/zfs/zfs_gitrev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/modules/zfs/zfs_gitrev.h b/sys/modules/zfs/zfs_gitrev.h index 6709f54ffa7b..6fd7c8f8fd18 100644 --- a/sys/modules/zfs/zfs_gitrev.h +++ b/sys/modules/zfs/zfs_gitrev.h @@ -2,4 +2,4 @@ * $FreeBSD$ */ -#define ZFS_META_GITREV "zfs-0.7.0-3175-g184df27ee" +#define ZFS_META_GITREV "zfs-2.1.0-0-g4f92fe0f5" From owner-dev-commits-src-branches@freebsd.org Fri Jul 23 11:30:35 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4DAA2670B27; Fri, 23 Jul 2021 11:30:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GWRvb1mrBz4RbQ; Fri, 23 Jul 2021 11:30:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22661242B4; Fri, 23 Jul 2021 11:30:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16NBUZlV057560; Fri, 23 Jul 2021 11:30:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NBUZX9057559; Fri, 23 Jul 2021 11:30:35 GMT (envelope-from git) Date: Fri, 23 Jul 2021 11:30:35 GMT Message-Id: <202107231130.16NBUZX9057559@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Leandro Lupori Subject: git: 572e3575dba5 - stable/13 - aacraid: reduce max I/O size to avoid DMA issues MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: luporl X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 572e3575dba591f372633a38d76ce7904d1a1b2e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 11:30:35 -0000 The branch stable/13 has been updated by luporl: URL: https://cgit.FreeBSD.org/src/commit/?id=572e3575dba591f372633a38d76ce7904d1a1b2e commit 572e3575dba591f372633a38d76ce7904d1a1b2e Author: Leandro Lupori AuthorDate: 2021-06-21 18:04:43 +0000 Commit: Leandro Lupori CommitDate: 2021-07-23 11:28:58 +0000 aacraid: reduce max I/O size to avoid DMA issues Reserve one page for the DMA subsystem, that may need it when the I/O buffer is not page aligned. Without this change, writes with the maximum allowed size failed, if: - physical memory was fragmented, making it necessary to use one DMA segment for each page - the buffer to be written was not page aligned, causing the DMA subsystem to need one extra segment In the scenario above, the DMA subsystem would run out of segments, resulting in a write with no SG segments, that would fail. Reviewed by: imp Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D30798 (cherry picked from commit 9c2c6353193b53deb337777c2a06a2648b364f8b) --- sys/dev/aacraid/aacraid.c | 4 ++-- sys/dev/aacraid/aacraid_cam.c | 2 +- sys/dev/aacraid/aacraid_var.h | 8 ++++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/sys/dev/aacraid/aacraid.c b/sys/dev/aacraid/aacraid.c index 65c585269b78..51a633e70515 100644 --- a/sys/dev/aacraid/aacraid.c +++ b/sys/dev/aacraid/aacraid.c @@ -579,7 +579,7 @@ aac_alloc(struct aac_softc *sc) BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - sc->aac_max_sectors << 9, /* maxsize */ + AAC_MAXIO_SIZE(sc), /* maxsize */ sc->aac_sg_tablesize, /* nsegments */ BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ @@ -1807,7 +1807,7 @@ aac_init(struct aac_softc *sc) } ip->MaxIoCommands = sc->aac_max_fibs; - ip->MaxIoSize = sc->aac_max_sectors << 9; + ip->MaxIoSize = AAC_MAXIO_SIZE(sc); ip->MaxFibSize = sc->aac_max_fib_size; aac_adapter_init_tole(ip); diff --git a/sys/dev/aacraid/aacraid_cam.c b/sys/dev/aacraid/aacraid_cam.c index 48da7e8d757f..9c73248472bd 100644 --- a/sys/dev/aacraid/aacraid_cam.c +++ b/sys/dev/aacraid/aacraid_cam.c @@ -1011,7 +1011,7 @@ aac_cam_action(struct cam_sim *sim, union ccb *ccb) cpi->max_lun = 7; /* Per the controller spec */ cpi->initiator_id = camsc->inf->InitiatorBusId; cpi->bus_id = camsc->inf->BusNumber; - cpi->maxio = sc->aac_max_sectors << 9; + cpi->maxio = AAC_MAXIO_SIZE(sc); /* * Resetting via the passthrough or parallel bus scan diff --git a/sys/dev/aacraid/aacraid_var.h b/sys/dev/aacraid/aacraid_var.h index 4fed21b1356b..bbafdafb8840 100644 --- a/sys/dev/aacraid/aacraid_var.h +++ b/sys/dev/aacraid/aacraid_var.h @@ -470,6 +470,14 @@ struct aac_softc u_int32_t FwDebugBufferSize; /* FW Debug Buffer size */ }; +/* + * Max. I/O size in bytes. + * Reserve one page for the DMA subsystem, that may need it when the + * I/O buffer is not page aligned. + */ +#define AAC_MAXIO_SIZE(sc) MIN(((sc)->aac_max_sectors << 9) - PAGE_SIZE, \ + maxphys) + /* * Event callback mechanism for the driver */ From owner-dev-commits-src-branches@freebsd.org Fri Jul 23 11:52:39 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66D136710D4; Fri, 23 Jul 2021 11:52:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GWSP322Dzz4V8G; Fri, 23 Jul 2021 11:52:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 049AA245EB; Fri, 23 Jul 2021 11:52:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16NBqcWB087804; Fri, 23 Jul 2021 11:52:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NBqcJx087803; Fri, 23 Jul 2021 11:52:38 GMT (envelope-from git) Date: Fri, 23 Jul 2021 11:52:38 GMT Message-Id: <202107231152.16NBqcJx087803@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: bbb5bd61b794 - stable/12 - nfssvc: Zero the buffer copied out when NFSSVC_DUMPMNTOPTS is set MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: bbb5bd61b7948543178626de0e53523d3b968d92 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 11:52:39 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bbb5bd61b7948543178626de0e53523d3b968d92 commit bbb5bd61b7948543178626de0e53523d3b968d92 Author: Mark Johnston AuthorDate: 2021-07-16 02:39:27 +0000 Commit: Mark Johnston CommitDate: 2021-07-23 11:50:35 +0000 nfssvc: Zero the buffer copied out when NFSSVC_DUMPMNTOPTS is set Reported by: KMSAN Sponsored by: The FreeBSD Foundation (cherry picked from commit 7a9bc8a82ec20f9208643f1615ea4ca1d0e5d933) --- sys/fs/nfsclient/nfs_clport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c index 97cde6421da2..cf6a070786d4 100644 --- a/sys/fs/nfsclient/nfs_clport.c +++ b/sys/fs/nfsclient/nfs_clport.c @@ -1301,7 +1301,8 @@ nfssvc_nfscl(struct thread *td, struct nfssvc_args *uap) error = EINVAL; } if (error == 0) { - buf = malloc(dumpmntopts.ndmnt_blen, M_TEMP, M_WAITOK); + buf = malloc(dumpmntopts.ndmnt_blen, M_TEMP, M_WAITOK | + M_ZERO); nfscl_retopts(VFSTONFS(nd.ni_vp->v_mount), buf, dumpmntopts.ndmnt_blen); vput(nd.ni_vp); From owner-dev-commits-src-branches@freebsd.org Fri Jul 23 11:56:41 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA9FC6711DF; Fri, 23 Jul 2021 11:56:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GWSTj5S0qz4VZW; Fri, 23 Jul 2021 11:56:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CC14249BD; Fri, 23 Jul 2021 11:56:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16NBufb1088220; Fri, 23 Jul 2021 11:56:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NBufx7088219; Fri, 23 Jul 2021 11:56:41 GMT (envelope-from git) Date: Fri, 23 Jul 2021 11:56:41 GMT Message-Id: <202107231156.16NBufx7088219@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 51095d36de44 - stable/13 - nfssvc: Zero the buffer copied out when NFSSVC_DUMPMNTOPTS is set MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 51095d36de449526a80da6ca859185a0107a497f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 11:56:42 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=51095d36de449526a80da6ca859185a0107a497f commit 51095d36de449526a80da6ca859185a0107a497f Author: Mark Johnston AuthorDate: 2021-07-16 02:39:27 +0000 Commit: Mark Johnston CommitDate: 2021-07-23 11:49:31 +0000 nfssvc: Zero the buffer copied out when NFSSVC_DUMPMNTOPTS is set Reported by: KMSAN Sponsored by: The FreeBSD Foundation (cherry picked from commit 7a9bc8a82ec20f9208643f1615ea4ca1d0e5d933) --- sys/fs/nfsclient/nfs_clport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c index 264d99626394..6364cce6626c 100644 --- a/sys/fs/nfsclient/nfs_clport.c +++ b/sys/fs/nfsclient/nfs_clport.c @@ -1312,7 +1312,8 @@ nfssvc_nfscl(struct thread *td, struct nfssvc_args *uap) error = EINVAL; } if (error == 0) { - buf = malloc(dumpmntopts.ndmnt_blen, M_TEMP, M_WAITOK); + buf = malloc(dumpmntopts.ndmnt_blen, M_TEMP, M_WAITOK | + M_ZERO); nfscl_retopts(VFSTONFS(nd.ni_vp->v_mount), buf, dumpmntopts.ndmnt_blen); vput(nd.ni_vp); From owner-dev-commits-src-branches@freebsd.org Fri Jul 23 11:56:43 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 013D4670E65; Fri, 23 Jul 2021 11:56:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GWSTk63zSz4Vxc; Fri, 23 Jul 2021 11:56:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3F7324A0C; Fri, 23 Jul 2021 11:56:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16NBugGa088244; Fri, 23 Jul 2021 11:56:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NBugSP088243; Fri, 23 Jul 2021 11:56:42 GMT (envelope-from git) Date: Fri, 23 Jul 2021 11:56:42 GMT Message-Id: <202107231156.16NBugSP088243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 268b034fbc3b - stable/13 - Add some missing osd.9 MLINKs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 268b034fbc3bee13733530e71107f097c809ff24 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 11:56:43 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=268b034fbc3bee13733530e71107f097c809ff24 commit 268b034fbc3bee13733530e71107f097c809ff24 Author: Mark Johnston AuthorDate: 2021-07-16 16:13:51 +0000 Commit: Mark Johnston CommitDate: 2021-07-23 11:49:39 +0000 Add some missing osd.9 MLINKs Sponsored by: The FreeBSD Foundation (cherry picked from commit 5d40fb677a9ec95a508f510f6238f4ec3ef65e01) --- share/man/man9/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 8bf3b7c22f74..0c874e77cf0a 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1673,9 +1673,12 @@ MLINKS+=osd.9 osd_call.9 \ osd.9 osd_del.9 \ osd.9 osd_deregister.9 \ osd.9 osd_exit.9 \ + osd.9 osd_free_reserved.9 \ osd.9 osd_get.9 \ osd.9 osd_register.9 \ - osd.9 osd_set.9 + osd.9 osd_reserve.9 \ + osd.9 osd_set.9 \ + osd.9 osd_set_reserved.9 MLINKS+=panic.9 vpanic.9 MLINKS+=PCBGROUP.9 in_pcbgroup_byhash.9 \ PCBGROUP.9 in_pcbgroup_byinpcb.9 \ From owner-dev-commits-src-branches@freebsd.org Fri Jul 23 11:56:44 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11752671211; Fri, 23 Jul 2021 11:56:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GWSTl6pvZz4VZY; Fri, 23 Jul 2021 11:56:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD340245F1; Fri, 23 Jul 2021 11:56:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16NBuhAu088268; Fri, 23 Jul 2021 11:56:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16NBuhGb088267; Fri, 23 Jul 2021 11:56:43 GMT (envelope-from git) Date: Fri, 23 Jul 2021 11:56:43 GMT Message-Id: <202107231156.16NBuhGb088267@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1ea187f8a1bf - stable/13 - callout: Make cc_cpu local to kern_timeout.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1ea187f8a1bf16a0798c3bad39bf063667e1f4d0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 11:56:44 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1ea187f8a1bf16a0798c3bad39bf063667e1f4d0 commit 1ea187f8a1bf16a0798c3bad39bf063667e1f4d0 Author: Mark Johnston AuthorDate: 2021-07-16 02:40:23 +0000 Commit: Mark Johnston CommitDate: 2021-07-23 11:49:49 +0000 callout: Make cc_cpu local to kern_timeout.c No functional change intended. Sponsored by: The FreeBSD Foundation (cherry picked from commit c1aff72cfa30fa27efe867a4feb667f1963e8cf7) --- sys/kern/kern_timeout.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index cc1521adf151..d9cf2784f642 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -190,14 +190,14 @@ struct callout_cpu { #define cc_migration_time(cc, dir) cc->cc_exec_entity[dir].ce_migration_time #define cc_migration_prec(cc, dir) cc->cc_exec_entity[dir].ce_migration_prec -struct callout_cpu cc_cpu[MAXCPU]; +static struct callout_cpu cc_cpu[MAXCPU]; #define CPUBLOCK MAXCPU #define CC_CPU(cpu) (&cc_cpu[(cpu)]) #define CC_SELF() CC_CPU(PCPU_GET(cpuid)) #else -struct callout_cpu cc_cpu; -#define CC_CPU(cpu) &cc_cpu -#define CC_SELF() &cc_cpu +static struct callout_cpu cc_cpu; +#define CC_CPU(cpu) (&cc_cpu) +#define CC_SELF() (&cc_cpu) #endif #define CC_LOCK(cc) mtx_lock_spin(&(cc)->cc_lock) #define CC_UNLOCK(cc) mtx_unlock_spin(&(cc)->cc_lock) From owner-dev-commits-src-branches@freebsd.org Sat Jul 24 20:02:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D4817666667; Sat, 24 Jul 2021 20:02:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GXHCP5f7Tz3N0j; Sat, 24 Jul 2021 20:02:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAA6A16AB0; Sat, 24 Jul 2021 20:02:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16OK298W062560; Sat, 24 Jul 2021 20:02:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16OK290N062559; Sat, 24 Jul 2021 20:02:09 GMT (envelope-from git) Date: Sat, 24 Jul 2021 20:02:09 GMT Message-Id: <202107242002.16OK290N062559@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 33222b6f8af8 - stable/12 - pf: Remove unused arguments from pf_send_tcp() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 33222b6f8af85d8357450d3fb80d4d5e80668bf2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 20:02:09 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=33222b6f8af85d8357450d3fb80d4d5e80668bf2 commit 33222b6f8af85d8357450d3fb80d4d5e80668bf2 Author: Kristof Provost AuthorDate: 2021-05-19 18:33:28 +0000 Commit: Kristof Provost CommitDate: 2021-07-24 09:10:48 +0000 pf: Remove unused arguments from pf_send_tcp() struct mbuf *replyto is not actually used (and only rarely provided). The same applies to struct ifnet *ifp. No functional change. Reviewed by: mjg MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31136 (cherry picked from commit 295f2d939d960e2bdf5c1499da3eb41618be05e6) --- sys/netpfil/pf/pf.c | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 6cabec0fdeaa..8e2fbcbda4c4 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -244,12 +244,11 @@ static void pf_change_icmp(struct pf_addr *, u_int16_t *, struct pf_addr *, struct pf_addr *, u_int16_t, u_int16_t *, u_int16_t *, u_int16_t *, u_int16_t *, u_int8_t, sa_family_t); -static void pf_send_tcp(struct mbuf *, - const struct pf_krule *, sa_family_t, +static void pf_send_tcp(const struct pf_krule *, sa_family_t, const struct pf_addr *, const struct pf_addr *, u_int16_t, u_int16_t, u_int32_t, u_int32_t, u_int8_t, u_int16_t, u_int16_t, u_int8_t, int, - u_int16_t, struct ifnet *); + u_int16_t); static void pf_send_icmp(struct mbuf *, u_int8_t, u_int8_t, sa_family_t, struct pf_krule *); static void pf_detach_state(struct pf_kstate *); @@ -1721,13 +1720,13 @@ pf_unlink_state(struct pf_kstate *s, u_int flags) if (s->src.state == PF_TCPS_PROXY_DST) { /* XXX wire key the right one? */ - pf_send_tcp(NULL, s->rule.ptr, s->key[PF_SK_WIRE]->af, + pf_send_tcp(s->rule.ptr, s->key[PF_SK_WIRE]->af, &s->key[PF_SK_WIRE]->addr[1], &s->key[PF_SK_WIRE]->addr[0], s->key[PF_SK_WIRE]->port[1], s->key[PF_SK_WIRE]->port[0], s->src.seqhi, s->src.seqlo + 1, - TH_RST|TH_ACK, 0, 0, 0, 1, s->tag, NULL); + TH_RST|TH_ACK, 0, 0, 0, 1, s->tag); } LIST_REMOVE(s, entry); @@ -2460,11 +2459,11 @@ pf_modulate_sack(struct mbuf *m, int off, struct pf_pdesc *pd, } static void -pf_send_tcp(struct mbuf *replyto, const struct pf_krule *r, sa_family_t af, +pf_send_tcp(const struct pf_krule *r, sa_family_t af, const struct pf_addr *saddr, const struct pf_addr *daddr, u_int16_t sport, u_int16_t dport, u_int32_t seq, u_int32_t ack, u_int8_t flags, u_int16_t win, u_int16_t mss, u_int8_t ttl, int tag, - u_int16_t rtag, struct ifnet *ifp) + u_int16_t rtag) { struct pf_send_entry *pfse; struct mbuf *m; @@ -2678,10 +2677,10 @@ pf_return(struct pf_krule *r, struct pf_krule *nr, struct pf_pdesc *pd, ack++; if (th->th_flags & TH_FIN) ack++; - pf_send_tcp(m, r, af, pd->dst, + pf_send_tcp(r, af, pd->dst, pd->src, th->th_dport, th->th_sport, ntohl(th->th_ack), ack, TH_RST|TH_ACK, 0, 0, - r->return_ttl, 1, 0, kif->pfik_ifp); + r->return_ttl, 1, 0); } } else if (pd->proto != IPPROTO_ICMP && af == AF_INET && r->return_icmp) @@ -3916,9 +3915,9 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, mss = pf_calc_mss(pd->src, pd->af, rtid, mss); mss = pf_calc_mss(pd->dst, pd->af, rtid, mss); s->src.mss = mss; - pf_send_tcp(NULL, r, pd->af, pd->dst, pd->src, th->th_dport, + pf_send_tcp(r, pd->af, pd->dst, pd->src, th->th_dport, th->th_sport, s->src.seqhi, ntohl(th->th_seq) + 1, - TH_SYN|TH_ACK, 0, s->src.mss, 0, 1, 0, NULL); + TH_SYN|TH_ACK, 0, s->src.mss, 0, 1, 0); REASON_SET(&reason, PFRES_SYNPROXY); return (PF_SYNPROXY_DROP); } @@ -4350,12 +4349,11 @@ pf_tcp_track_full(struct pf_state_peer *src, struct pf_state_peer *dst, (*state)->src.state == TCPS_SYN_SENT) { /* Send RST for state mismatches during handshake */ if (!(th->th_flags & TH_RST)) - pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, + pf_send_tcp((*state)->rule.ptr, pd->af, pd->dst, pd->src, th->th_dport, th->th_sport, ntohl(th->th_ack), 0, TH_RST, 0, 0, - (*state)->rule.ptr->return_ttl, 1, 0, - kif->pfik_ifp); + (*state)->rule.ptr->return_ttl, 1, 0); src->seqlo = 0; src->seqhi = 1; src->max_win = 1; @@ -4505,10 +4503,10 @@ pf_test_state_tcp(struct pf_kstate **state, int direction, struct pfi_kkif *kif, REASON_SET(reason, PFRES_SYNPROXY); return (PF_DROP); } - pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, pd->dst, + pf_send_tcp((*state)->rule.ptr, pd->af, pd->dst, pd->src, th->th_dport, th->th_sport, (*state)->src.seqhi, ntohl(th->th_seq) + 1, - TH_SYN|TH_ACK, 0, (*state)->src.mss, 0, 1, 0, NULL); + TH_SYN|TH_ACK, 0, (*state)->src.mss, 0, 1, 0); REASON_SET(reason, PFRES_SYNPROXY); return (PF_SYNPROXY_DROP); } else if ((th->th_flags & (TH_ACK|TH_RST|TH_FIN)) != TH_ACK || @@ -4534,11 +4532,11 @@ pf_test_state_tcp(struct pf_kstate **state, int direction, struct pfi_kkif *kif, (*state)->src.max_win = MAX(ntohs(th->th_win), 1); if ((*state)->dst.seqhi == 1) (*state)->dst.seqhi = htonl(arc4random()); - pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, + pf_send_tcp((*state)->rule.ptr, pd->af, &sk->addr[pd->sidx], &sk->addr[pd->didx], sk->port[pd->sidx], sk->port[pd->didx], (*state)->dst.seqhi, 0, TH_SYN, 0, - (*state)->src.mss, 0, 0, (*state)->tag, NULL); + (*state)->src.mss, 0, 0, (*state)->tag); REASON_SET(reason, PFRES_SYNPROXY); return (PF_SYNPROXY_DROP); } else if (((th->th_flags & (TH_SYN|TH_ACK)) != @@ -4549,16 +4547,16 @@ pf_test_state_tcp(struct pf_kstate **state, int direction, struct pfi_kkif *kif, } else { (*state)->dst.max_win = MAX(ntohs(th->th_win), 1); (*state)->dst.seqlo = ntohl(th->th_seq); - pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, pd->dst, + pf_send_tcp((*state)->rule.ptr, pd->af, pd->dst, pd->src, th->th_dport, th->th_sport, ntohl(th->th_ack), ntohl(th->th_seq) + 1, TH_ACK, (*state)->src.max_win, 0, 0, 0, - (*state)->tag, NULL); - pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, + (*state)->tag); + pf_send_tcp((*state)->rule.ptr, pd->af, &sk->addr[pd->sidx], &sk->addr[pd->didx], sk->port[pd->sidx], sk->port[pd->didx], (*state)->src.seqhi + 1, (*state)->src.seqlo + 1, - TH_ACK, (*state)->dst.max_win, 0, 0, 1, 0, NULL); + TH_ACK, (*state)->dst.max_win, 0, 0, 1, 0); (*state)->src.seqdiff = (*state)->dst.seqhi - (*state)->src.seqlo; (*state)->dst.seqdiff = (*state)->src.seqhi - From owner-dev-commits-src-branches@freebsd.org Sat Jul 24 20:02:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3371665EE6; Sat, 24 Jul 2021 20:02:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GXHCQ4xvxz3NG8; Sat, 24 Jul 2021 20:02:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D8CD16B68; Sat, 24 Jul 2021 20:02:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16OK2AKA062639; Sat, 24 Jul 2021 20:02:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16OK2AXk062638; Sat, 24 Jul 2021 20:02:10 GMT (envelope-from git) Date: Sat, 24 Jul 2021 20:02:10 GMT Message-Id: <202107242002.16OK2AXk062638@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 823c2bd77b6e - stable/13 - pf: Remove unused arguments from pf_send_tcp() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 823c2bd77b6e09183c81faee0d3a368c257b1bd1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2021 20:02:10 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=823c2bd77b6e09183c81faee0d3a368c257b1bd1 commit 823c2bd77b6e09183c81faee0d3a368c257b1bd1 Author: Kristof Provost AuthorDate: 2021-05-19 18:33:28 +0000 Commit: Kristof Provost CommitDate: 2021-07-24 09:09:57 +0000 pf: Remove unused arguments from pf_send_tcp() struct mbuf *replyto is not actually used (and only rarely provided). The same applies to struct ifnet *ifp. No functional change. Reviewed by: mjg MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31136 (cherry picked from commit 295f2d939d960e2bdf5c1499da3eb41618be05e6) --- sys/netpfil/pf/pf.c | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index ce836eb492f2..cd55547c3469 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -243,12 +243,11 @@ static void pf_change_icmp(struct pf_addr *, u_int16_t *, struct pf_addr *, struct pf_addr *, u_int16_t, u_int16_t *, u_int16_t *, u_int16_t *, u_int16_t *, u_int8_t, sa_family_t); -static void pf_send_tcp(struct mbuf *, - const struct pf_krule *, sa_family_t, +static void pf_send_tcp(const struct pf_krule *, sa_family_t, const struct pf_addr *, const struct pf_addr *, u_int16_t, u_int16_t, u_int32_t, u_int32_t, u_int8_t, u_int16_t, u_int16_t, u_int8_t, int, - u_int16_t, struct ifnet *); + u_int16_t); static void pf_send_icmp(struct mbuf *, u_int8_t, u_int8_t, sa_family_t, struct pf_krule *); static void pf_detach_state(struct pf_kstate *); @@ -1723,13 +1722,13 @@ pf_unlink_state(struct pf_kstate *s, u_int flags) if (s->src.state == PF_TCPS_PROXY_DST) { /* XXX wire key the right one? */ - pf_send_tcp(NULL, s->rule.ptr, s->key[PF_SK_WIRE]->af, + pf_send_tcp(s->rule.ptr, s->key[PF_SK_WIRE]->af, &s->key[PF_SK_WIRE]->addr[1], &s->key[PF_SK_WIRE]->addr[0], s->key[PF_SK_WIRE]->port[1], s->key[PF_SK_WIRE]->port[0], s->src.seqhi, s->src.seqlo + 1, - TH_RST|TH_ACK, 0, 0, 0, 1, s->tag, NULL); + TH_RST|TH_ACK, 0, 0, 0, 1, s->tag); } LIST_REMOVE(s, entry); @@ -2459,11 +2458,11 @@ pf_modulate_sack(struct mbuf *m, int off, struct pf_pdesc *pd, } static void -pf_send_tcp(struct mbuf *replyto, const struct pf_krule *r, sa_family_t af, +pf_send_tcp(const struct pf_krule *r, sa_family_t af, const struct pf_addr *saddr, const struct pf_addr *daddr, u_int16_t sport, u_int16_t dport, u_int32_t seq, u_int32_t ack, u_int8_t flags, u_int16_t win, u_int16_t mss, u_int8_t ttl, int tag, - u_int16_t rtag, struct ifnet *ifp) + u_int16_t rtag) { struct pf_send_entry *pfse; struct mbuf *m; @@ -2677,10 +2676,10 @@ pf_return(struct pf_krule *r, struct pf_krule *nr, struct pf_pdesc *pd, ack++; if (th->th_flags & TH_FIN) ack++; - pf_send_tcp(m, r, af, pd->dst, + pf_send_tcp(r, af, pd->dst, pd->src, th->th_dport, th->th_sport, ntohl(th->th_ack), ack, TH_RST|TH_ACK, 0, 0, - r->return_ttl, 1, 0, kif->pfik_ifp); + r->return_ttl, 1, 0); } } else if (pd->proto != IPPROTO_ICMP && af == AF_INET && r->return_icmp) @@ -3915,9 +3914,9 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, mss = pf_calc_mss(pd->src, pd->af, rtid, mss); mss = pf_calc_mss(pd->dst, pd->af, rtid, mss); s->src.mss = mss; - pf_send_tcp(NULL, r, pd->af, pd->dst, pd->src, th->th_dport, + pf_send_tcp(r, pd->af, pd->dst, pd->src, th->th_dport, th->th_sport, s->src.seqhi, ntohl(th->th_seq) + 1, - TH_SYN|TH_ACK, 0, s->src.mss, 0, 1, 0, NULL); + TH_SYN|TH_ACK, 0, s->src.mss, 0, 1, 0); REASON_SET(&reason, PFRES_SYNPROXY); return (PF_SYNPROXY_DROP); } @@ -4346,12 +4345,11 @@ pf_tcp_track_full(struct pf_state_peer *src, struct pf_state_peer *dst, (*state)->src.state == TCPS_SYN_SENT) { /* Send RST for state mismatches during handshake */ if (!(th->th_flags & TH_RST)) - pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, + pf_send_tcp((*state)->rule.ptr, pd->af, pd->dst, pd->src, th->th_dport, th->th_sport, ntohl(th->th_ack), 0, TH_RST, 0, 0, - (*state)->rule.ptr->return_ttl, 1, 0, - kif->pfik_ifp); + (*state)->rule.ptr->return_ttl, 1, 0); src->seqlo = 0; src->seqhi = 1; src->max_win = 1; @@ -4501,10 +4499,10 @@ pf_test_state_tcp(struct pf_kstate **state, int direction, struct pfi_kkif *kif, REASON_SET(reason, PFRES_SYNPROXY); return (PF_DROP); } - pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, pd->dst, + pf_send_tcp((*state)->rule.ptr, pd->af, pd->dst, pd->src, th->th_dport, th->th_sport, (*state)->src.seqhi, ntohl(th->th_seq) + 1, - TH_SYN|TH_ACK, 0, (*state)->src.mss, 0, 1, 0, NULL); + TH_SYN|TH_ACK, 0, (*state)->src.mss, 0, 1, 0); REASON_SET(reason, PFRES_SYNPROXY); return (PF_SYNPROXY_DROP); } else if ((th->th_flags & (TH_ACK|TH_RST|TH_FIN)) != TH_ACK || @@ -4530,11 +4528,11 @@ pf_test_state_tcp(struct pf_kstate **state, int direction, struct pfi_kkif *kif, (*state)->src.max_win = MAX(ntohs(th->th_win), 1); if ((*state)->dst.seqhi == 1) (*state)->dst.seqhi = htonl(arc4random()); - pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, + pf_send_tcp((*state)->rule.ptr, pd->af, &sk->addr[pd->sidx], &sk->addr[pd->didx], sk->port[pd->sidx], sk->port[pd->didx], (*state)->dst.seqhi, 0, TH_SYN, 0, - (*state)->src.mss, 0, 0, (*state)->tag, NULL); + (*state)->src.mss, 0, 0, (*state)->tag); REASON_SET(reason, PFRES_SYNPROXY); return (PF_SYNPROXY_DROP); } else if (((th->th_flags & (TH_SYN|TH_ACK)) != @@ -4545,16 +4543,16 @@ pf_test_state_tcp(struct pf_kstate **state, int direction, struct pfi_kkif *kif, } else { (*state)->dst.max_win = MAX(ntohs(th->th_win), 1); (*state)->dst.seqlo = ntohl(th->th_seq); - pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, pd->dst, + pf_send_tcp((*state)->rule.ptr, pd->af, pd->dst, pd->src, th->th_dport, th->th_sport, ntohl(th->th_ack), ntohl(th->th_seq) + 1, TH_ACK, (*state)->src.max_win, 0, 0, 0, - (*state)->tag, NULL); - pf_send_tcp(NULL, (*state)->rule.ptr, pd->af, + (*state)->tag); + pf_send_tcp((*state)->rule.ptr, pd->af, &sk->addr[pd->sidx], &sk->addr[pd->didx], sk->port[pd->sidx], sk->port[pd->didx], (*state)->src.seqhi + 1, (*state)->src.seqlo + 1, - TH_ACK, (*state)->dst.max_win, 0, 0, 1, 0, NULL); + TH_ACK, (*state)->dst.max_win, 0, 0, 1, 0); (*state)->src.seqdiff = (*state)->dst.seqhi - (*state)->src.seqlo; (*state)->dst.seqdiff = (*state)->src.seqhi - From owner-dev-commits-src-branches@freebsd.org Sun Jul 25 07:03:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A476A654195; Sun, 25 Jul 2021 07:03:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GXYsw4JFmz3HNT; Sun, 25 Jul 2021 07:03:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BF3E1F69B; Sun, 25 Jul 2021 07:03:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16P730c9050332; Sun, 25 Jul 2021 07:03:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P730Mo050331; Sun, 25 Jul 2021 07:03:00 GMT (envelope-from git) Date: Sun, 25 Jul 2021 07:03:00 GMT Message-Id: <202107250703.16P730Mo050331@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 225b93b1700e - stable/13 - cache: add cache_enter_time_flags MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 225b93b1700e687b6a5fdad88053e639c8f81ee2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 07:03:00 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=225b93b1700e687b6a5fdad88053e639c8f81ee2 commit 225b93b1700e687b6a5fdad88053e639c8f81ee2 Author: Mateusz Guzik AuthorDate: 2021-07-08 07:56:27 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-25 06:59:56 +0000 cache: add cache_enter_time_flags (cherry picked from commit 844aa31c6d8785e7256a84d8ee7e8ae2362f9367) --- sys/kern/vfs_cache.c | 24 ++++++++++++++++++++++++ sys/sys/vnode.h | 6 ++++++ 2 files changed, 30 insertions(+) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 5b978511db17..09f926d0cd31 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -2582,6 +2582,30 @@ out_unlock_free: return; } +/* + * A variant of the above accepting flags. + * + * - VFS_CACHE_DROPOLD -- if a conflicting entry is found, drop it. + * + * TODO: this routine is a hack. It blindly removes the old entry, even if it + * happens to match and it is doing it in an inefficient manner. It was added + * to accomodate NFS which runs into a case where the target for a given name + * may change from under it. Note this does nothing to solve the following + * race: 2 callers of cache_enter_time_flags pass a different target vnode for + * the same [dvp, cnp]. It may be argued that code doing this is broken. + */ +void +cache_enter_time_flags(struct vnode *dvp, struct vnode *vp, struct componentname *cnp, + struct timespec *tsp, struct timespec *dtsp, int flags) +{ + + MPASS((flags & ~(VFS_CACHE_DROPOLD)) == 0); + + if (flags & VFS_CACHE_DROPOLD) + cache_remove_cnp(dvp, cnp); + cache_enter_time(dvp, vp, cnp, tsp, dtsp); +} + static u_int cache_roundup_2(u_int val) { diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index f492b3389d0e..8b14aac36df0 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -638,6 +638,12 @@ int bnoreuselist(struct bufv *bufv, struct bufobj *bo, daddr_t startn, daddr_t endn); /* cache_* may belong in namei.h. */ void cache_changesize(u_long newhashsize); + +#define VFS_CACHE_DROPOLD 0x1 + +void cache_enter_time_flags(struct vnode *dvp, struct vnode *vp, + struct componentname *cnp, struct timespec *tsp, + struct timespec *dtsp, int flags); #define cache_enter(dvp, vp, cnp) \ cache_enter_time(dvp, vp, cnp, NULL, NULL) void cache_enter_time(struct vnode *dvp, struct vnode *vp, From owner-dev-commits-src-branches@freebsd.org Sun Jul 25 07:03:03 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4394E653E39; Sun, 25 Jul 2021 07:03:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GXYsz0pQ3z3HZg; Sun, 25 Jul 2021 07:03:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD1BA1F652; Sun, 25 Jul 2021 07:03:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16P732J3050386; Sun, 25 Jul 2021 07:03:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P732PB050385; Sun, 25 Jul 2021 07:03:02 GMT (envelope-from git) Date: Sun, 25 Jul 2021 07:03:02 GMT Message-Id: <202107250703.16P732PB050385@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 289a9ba5e652 - stable/13 - arm: dedup counter(9) address calculation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 289a9ba5e652b87c3fc08c0c6a0bbfc8ba6a8867 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 07:03:03 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=289a9ba5e652b87c3fc08c0c6a0bbfc8ba6a8867 commit 289a9ba5e652b87c3fc08c0c6a0bbfc8ba6a8867 Author: Mateusz Guzik AuthorDate: 2021-07-19 10:46:01 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-25 07:00:14 +0000 arm: dedup counter(9) address calculation Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 78e3a168616dbe3a2c96efe568c960a1344f42e9) --- sys/arm/include/counter.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/arm/include/counter.h b/sys/arm/include/counter.h index e3fb03abd352..203a1ebda64e 100644 --- a/sys/arm/include/counter.h +++ b/sys/arm/include/counter.h @@ -45,8 +45,7 @@ static inline uint64_t counter_u64_read_one(uint64_t *p, int cpu) { - return (atomic_load_64((uint64_t *)((char *)p + UMA_PCPU_ALLOC_SIZE * - cpu))); + return (atomic_load_64((uint64_t *)zpcpu_get_cpu(p, cpu))); } static inline uint64_t @@ -66,8 +65,7 @@ static void counter_u64_zero_one_cpu(void *arg) { - atomic_store_64((uint64_t *)((char *)arg + UMA_PCPU_ALLOC_SIZE * - PCPU_GET(cpuid)), 0); + atomic_store_64((uint64_t *)zpcpu_get(arg), 0); } static inline void From owner-dev-commits-src-branches@freebsd.org Sun Jul 25 07:03:04 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D5B2654199; Sun, 25 Jul 2021 07:03:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GXYt00gzvz3HKn; Sun, 25 Jul 2021 07:03:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC0471F7BF; Sun, 25 Jul 2021 07:03:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16P733IZ050411; Sun, 25 Jul 2021 07:03:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P733L5050410; Sun, 25 Jul 2021 07:03:03 GMT (envelope-from git) Date: Sun, 25 Jul 2021 07:03:03 GMT Message-Id: <202107250703.16P733L5050410@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 48e3bab3533a - stable/13 - pf: add a branch prediction to expire state check in pf_find_state MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 48e3bab3533ae54b45be15a737500a593157054c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 07:03:04 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=48e3bab3533ae54b45be15a737500a593157054c commit 48e3bab3533ae54b45be15a737500a593157054c Author: Mateusz Guzik AuthorDate: 2021-07-19 12:50:08 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-25 07:00:22 +0000 pf: add a branch prediction to expire state check in pf_find_state Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 144ec0713daa532342a298fd888a1656ae24a62d) --- sys/netpfil/pf/pf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index cd55547c3469..7b4c99c9a799 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1380,7 +1380,7 @@ pf_find_state(struct pfi_kkif *kif, struct pf_state_key_cmp *key, u_int dir) if (s->kif == V_pfi_all || s->kif == kif) { PF_STATE_LOCK(s); PF_HASHROW_UNLOCK(kh); - if (s->timeout >= PFTM_MAX) { + if (__predict_false(s->timeout >= PFTM_MAX)) { /* * State is either being processed by * pf_unlink_state() in an other thread, or From owner-dev-commits-src-branches@freebsd.org Sun Jul 25 07:03:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8A41653B7F; Sun, 25 Jul 2021 07:03:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GXYsx61mcz3HPb; Sun, 25 Jul 2021 07:03:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A798C1F4B9; Sun, 25 Jul 2021 07:03:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16P731ri050356; Sun, 25 Jul 2021 07:03:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P731kG050355; Sun, 25 Jul 2021 07:03:01 GMT (envelope-from git) Date: Sun, 25 Jul 2021 07:03:01 GMT Message-Id: <202107250703.16P731kG050355@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: f89065625ce5 - stable/13 - hwpmc: mostly clean up cc --analyze MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f89065625ce588c1819c1ed41da25780a15284ad Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 07:03:02 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=f89065625ce588c1819c1ed41da25780a15284ad commit f89065625ce588c1819c1ed41da25780a15284ad Author: Mateusz Guzik AuthorDate: 2021-07-15 14:01:11 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-25 07:00:05 +0000 hwpmc: mostly clean up cc --analyze Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit aee6e7dc0cabc670f3a9eabac579a030b363a417) --- sys/dev/hwpmc/hwpmc_amd.c | 2 +- sys/dev/hwpmc/hwpmc_core.c | 5 +---- sys/dev/hwpmc/hwpmc_logging.c | 4 +--- sys/dev/hwpmc/hwpmc_mod.c | 7 +++---- sys/dev/hwpmc/hwpmc_soft.c | 8 +++----- sys/dev/hwpmc/hwpmc_tsc.c | 4 ++-- sys/dev/hwpmc/hwpmc_uncore.c | 4 +--- 7 files changed, 12 insertions(+), 22 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_amd.c b/sys/dev/hwpmc/hwpmc_amd.c index d54cf52f1082..a95615926bc3 100644 --- a/sys/dev/hwpmc/hwpmc_amd.c +++ b/sys/dev/hwpmc/hwpmc_amd.c @@ -669,7 +669,7 @@ amd_release_pmc(int cpu, int ri, struct pmc *pmc) #ifdef HWPMC_DEBUG const struct amd_descr *pd; #endif - struct pmc_hw *phw; + struct pmc_hw *phw __diagused; (void) pmc; diff --git a/sys/dev/hwpmc/hwpmc_core.c b/sys/dev/hwpmc/hwpmc_core.c index f49aeb2fcfd9..b0773227fac7 100644 --- a/sys/dev/hwpmc/hwpmc_core.c +++ b/sys/dev/hwpmc/hwpmc_core.c @@ -741,7 +741,6 @@ static int iap_allocate_pmc(int cpu, int ri, struct pmc *pm, const struct pmc_op_pmcallocate *a) { - enum pmc_event map; uint8_t ev; uint32_t caps; const struct pmc_md_iap_op_pmcallocate *iap; @@ -755,7 +754,6 @@ iap_allocate_pmc(int cpu, int ri, struct pmc *pm, caps = a->pm_caps; if ((IAP_PMC_CAPS & caps) != caps) return (EPERM); - map = 0; /* XXX: silent GCC warning */ iap = &a->pm_md.pm_iap; ev = IAP_EVSEL_GET(iap->pm_iap_config); @@ -961,7 +959,7 @@ iap_start_pmc(int cpu, int ri) static int iap_stop_pmc(int cpu, int ri) { - struct pmc *pm; + struct pmc *pm __diagused; struct core_cpu *cc; uint64_t msr; @@ -985,7 +983,6 @@ iap_stop_pmc(int cpu, int ri) if (core_cputype == PMC_CPU_INTEL_CORE) return (0); - msr = 0; do { cc->pc_resync = 0; cc->pc_globalctrl &= ~(1ULL << ri); diff --git a/sys/dev/hwpmc/hwpmc_logging.c b/sys/dev/hwpmc/hwpmc_logging.c index e76aa9b710eb..c13b87f4165f 100644 --- a/sys/dev/hwpmc/hwpmc_logging.c +++ b/sys/dev/hwpmc/hwpmc_logging.c @@ -550,7 +550,7 @@ pmclog_release(struct pmc_owner *po) static uint32_t * pmclog_reserve(struct pmc_owner *po, int length) { - uintptr_t newptr, oldptr; + uintptr_t newptr, oldptr __diagused; struct pmclog_buffer *plb, **pplb; PMCDBG2(LOG,ALL,1, "po=%p len=%d", po, length); @@ -693,7 +693,6 @@ pmclog_configure_log(struct pmc_mdep *md, struct pmc_owner *po, int logfd) { struct proc *p; struct timespec ts; - uint64_t tsc; int error; sx_assert(&pmc_sx, SA_XLOCKED); @@ -722,7 +721,6 @@ pmclog_configure_log(struct pmc_mdep *md, struct pmc_owner *po, int logfd) p->p_flag |= P_HWPMC; PROC_UNLOCK(p); nanotime(&ts); - tsc = pmc_rdtsc(); /* create a log initialization entry */ PMCLOG_RESERVE_WITH_ERROR(po, INITIALIZE, sizeof(struct pmclog_initialize)); diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c index 6f7753dd11c1..8d5d0183d3ad 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -1351,7 +1351,7 @@ pmc_process_csw_in(struct thread *td) struct pmc *pm; struct proc *p; struct pmc_cpu *pc; - struct pmc_hw *phw; + struct pmc_hw *phw __diagused; pmc_value_t newvalue; struct pmc_process *pp; struct pmc_thread *pt; @@ -2769,7 +2769,7 @@ static void pmc_release_pmc_descriptor(struct pmc *pm) { enum pmc_mode mode; - struct pmc_hw *phw; + struct pmc_hw *phw __diagused; u_int adjri, ri, cpu; struct pmc_owner *po; struct pmc_binding pb; @@ -4336,7 +4336,6 @@ pmc_syscall_handler(struct thread *td, void *syscall_args) if ((error = copyin(arg, &prw, sizeof(prw))) != 0) break; - ri = 0; PMCDBG2(PMC,OPS,1, "rw id=%d flags=0x%x", prw.pm_pmcid, prw.pm_flags); @@ -4920,7 +4919,7 @@ pmc_process_samples(int cpu, ring_type_t ring) struct pmc_sample *ps; struct pmc_classdep *pcd; struct pmc_samplebuffer *psb; - uint64_t delta; + uint64_t delta __diagused; KASSERT(PCPU_GET(cpuid) == cpu, ("[pmc,%d] not on the correct CPU pcpu=%d cpu=%d", __LINE__, diff --git a/sys/dev/hwpmc/hwpmc_soft.c b/sys/dev/hwpmc/hwpmc_soft.c index 77a8c7b3abbb..cf2401e9159e 100644 --- a/sys/dev/hwpmc/hwpmc_soft.c +++ b/sys/dev/hwpmc/hwpmc_soft.c @@ -264,7 +264,7 @@ soft_pcpu_init(struct pmc_mdep *md, int cpu) static int soft_read_pmc(int cpu, int ri, pmc_value_t *v) { - struct pmc *pm; + struct pmc *pm __diagused; const struct pmc_hw *phw; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -288,8 +288,7 @@ soft_read_pmc(int cpu, int ri, pmc_value_t *v) static int soft_write_pmc(int cpu, int ri, pmc_value_t v) { - struct pmc *pm; - const struct soft_descr *pd; + struct pmc *pm __diagused; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[soft,%d] illegal cpu value %d", __LINE__, cpu)); @@ -297,7 +296,6 @@ soft_write_pmc(int cpu, int ri, pmc_value_t v) ("[soft,%d] illegal row-index %d", __LINE__, ri)); pm = soft_pcpu[cpu]->soft_hw[ri].phw_pmc; - pd = &soft_pmcdesc[ri]; KASSERT(pm, ("[soft,%d] cpu %d ri %d pmc not configured", __LINE__, cpu, ri)); @@ -312,7 +310,7 @@ soft_write_pmc(int cpu, int ri, pmc_value_t v) static int soft_release_pmc(int cpu, int ri, struct pmc *pmc) { - struct pmc_hw *phw; + struct pmc_hw *phw __diagused; enum pmc_event ev; struct pmc_soft *ps; diff --git a/sys/dev/hwpmc/hwpmc_tsc.c b/sys/dev/hwpmc/hwpmc_tsc.c index ef11e6991aed..6cd098a8113b 100644 --- a/sys/dev/hwpmc/hwpmc_tsc.c +++ b/sys/dev/hwpmc/hwpmc_tsc.c @@ -237,7 +237,7 @@ static int tsc_read_pmc(int cpu, int ri, pmc_value_t *v) { struct pmc *pm; - enum pmc_mode mode; + enum pmc_mode mode __diagused; const struct pmc_hw *phw; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -265,7 +265,7 @@ tsc_read_pmc(int cpu, int ri, pmc_value_t *v) static int tsc_release_pmc(int cpu, int ri, struct pmc *pmc) { - struct pmc_hw *phw; + struct pmc_hw *phw __diagused; (void) pmc; diff --git a/sys/dev/hwpmc/hwpmc_uncore.c b/sys/dev/hwpmc/hwpmc_uncore.c index 594367c3542a..2c638833dcd9 100644 --- a/sys/dev/hwpmc/hwpmc_uncore.c +++ b/sys/dev/hwpmc/hwpmc_uncore.c @@ -189,7 +189,6 @@ static int ucf_allocate_pmc(int cpu, int ri, struct pmc *pm, const struct pmc_op_pmcallocate *a) { - enum pmc_event ev; uint32_t caps, flags; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -206,7 +205,6 @@ ucf_allocate_pmc(int cpu, int ri, struct pmc *pm, (caps & UCF_PMC_CAPS) != caps) return (EINVAL); - ev = pm->pm_event; flags = UCF_EN; pm->pm_md.pm_ucf.pm_ucf_ctrl = (flags << (ri * 4)); @@ -718,7 +716,7 @@ ucp_start_pmc(int cpu, int ri) static int ucp_stop_pmc(int cpu, int ri) { - struct pmc *pm; + struct pmc *pm __diagused; struct uncore_cpu *cc; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), From owner-dev-commits-src-branches@freebsd.org Sun Jul 25 07:03:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECFB7653C5F; Sun, 25 Jul 2021 07:03:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GXYt24XsPz3HKv; Sun, 25 Jul 2021 07:03:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2FFBC1F4BB; Sun, 25 Jul 2021 07:03:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16P7363w050459; Sun, 25 Jul 2021 07:03:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P736EE050458; Sun, 25 Jul 2021 07:03:06 GMT (envelope-from git) Date: Sun, 25 Jul 2021 07:03:06 GMT Message-Id: <202107250703.16P736EE050458@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 440c90da04c8 - stable/13 - pf: shrink struct pf_kstate MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 440c90da04c8a338d9ff96c30989cb5619206e48 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 07:03:07 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=440c90da04c8a338d9ff96c30989cb5619206e48 commit 440c90da04c8a338d9ff96c30989cb5619206e48 Author: Mateusz Guzik AuthorDate: 2021-07-19 12:35:31 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-25 07:00:32 +0000 pf: shrink struct pf_kstate Makes room for a pointer. Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 9009d36afd1e0107e1e5b6988f49436087b3d474) --- sys/net/pfvar.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index f1d085bba664..609709fbd6c5 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -589,6 +589,10 @@ struct pf_kstate { * end of the area */ + u_int8_t state_flags; + u_int8_t timeout; + u_int8_t sync_state; /* PFSYNC_S_x */ + u_int8_t sync_updates; /* XXX */ u_int refs; TAILQ_ENTRY(pf_kstate) sync_list; TAILQ_ENTRY(pf_kstate) key_list[2]; @@ -612,13 +616,6 @@ struct pf_kstate { u_int32_t pfsync_time; u_int16_t tag; u_int8_t log; - u_int8_t state_flags; - u_int8_t timeout; - u_int8_t sync_state; /* PFSYNC_S_x */ - - /* XXX */ - u_int8_t sync_updates; - u_int8_t _tail[3]; }; /* From owner-dev-commits-src-branches@freebsd.org Sun Jul 25 07:03:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9FCDC653FD6; Sun, 25 Jul 2021 07:03:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GXYt12R5sz3HGh; Sun, 25 Jul 2021 07:03:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1751E1F4BA; Sun, 25 Jul 2021 07:03:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16P7345l050435; Sun, 25 Jul 2021 07:03:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P734Yk050434; Sun, 25 Jul 2021 07:03:04 GMT (envelope-from git) Date: Sun, 25 Jul 2021 07:03:04 GMT Message-Id: <202107250703.16P734Yk050434@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 3dc78db31e78 - stable/13 - pf: add a comment to pf_kstate concerning compat with pf_state_cmp MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3dc78db31e78a1132dd106daa822561b1c9c0358 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 07:03:06 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=3dc78db31e78a1132dd106daa822561b1c9c0358 commit 3dc78db31e78a1132dd106daa822561b1c9c0358 Author: Mateusz Guzik AuthorDate: 2021-07-19 12:17:33 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-25 07:00:27 +0000 pf: add a comment to pf_kstate concerning compat with pf_state_cmp Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit f9aa757d8d1e1bfc7951f462e92f00639256cad6) --- sys/net/pfvar.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index b6a2045473ec..f1d085bba664 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -578,10 +578,16 @@ _Static_assert(sizeof(struct pf_state_export) == 384, "size incorrect"); #ifdef _KERNEL struct pf_kstate { + /* + * Area shared with pf_state_cmp + */ u_int64_t id; u_int32_t creatorid; u_int8_t direction; u_int8_t pad[3]; + /* + * end of the area + */ u_int refs; TAILQ_ENTRY(pf_kstate) sync_list; From owner-dev-commits-src-branches@freebsd.org Sun Jul 25 07:03:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A9F7653C60; Sun, 25 Jul 2021 07:03:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GXYt36jw9z3HVx; Sun, 25 Jul 2021 07:03:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51CBC1F531; Sun, 25 Jul 2021 07:03:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16P737I1050483; Sun, 25 Jul 2021 07:03:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P737a9050482; Sun, 25 Jul 2021 07:03:07 GMT (envelope-from git) Date: Sun, 25 Jul 2021 07:03:07 GMT Message-Id: <202107250703.16P737a9050482@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 6ee77aab15a5 - stable/13 - pf: embed a pointer to the lock in struct pf_kstate MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6ee77aab15a5351898e1ccafc2575fe602ce1af8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 07:03:08 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=6ee77aab15a5351898e1ccafc2575fe602ce1af8 commit 6ee77aab15a5351898e1ccafc2575fe602ce1af8 Author: Mateusz Guzik AuthorDate: 2021-07-19 12:40:25 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-25 07:00:37 +0000 pf: embed a pointer to the lock in struct pf_kstate This shaves calculation which in particular helps on arm. Note using the & hack instead would still be more work. Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 907257d6967dd23506e69042c55bb1edc983c0ba) --- sys/net/pfvar.h | 23 +++++++++++++++++------ sys/netpfil/pf/pf.c | 3 +++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 609709fbd6c5..73f3168aa31f 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -96,22 +96,32 @@ struct pfi_dynaddr { #define PF_HASHROW_LOCK(h) mtx_lock(&(h)->lock) #define PF_HASHROW_UNLOCK(h) mtx_unlock(&(h)->lock) +#ifdef INVARIANTS #define PF_STATE_LOCK(s) \ do { \ - struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH(s)]; \ - PF_HASHROW_LOCK(_ih); \ + struct pf_kstate *_s = (s); \ + struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH(_s)]; \ + MPASS(_s->lock == &_ih->lock); \ + mtx_lock(_s->lock); \ } while (0) - #define PF_STATE_UNLOCK(s) \ do { \ - struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH((s))]; \ - PF_HASHROW_UNLOCK(_ih); \ + struct pf_kstate *_s = (s); \ + struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH(_s)]; \ + MPASS(_s->lock == &_ih->lock); \ + mtx_unlock(_s->lock); \ } while (0) +#else +#define PF_STATE_LOCK(s) mtx_lock(s->lock) +#define PF_STATE_UNLOCK(s) mtx_unlock(s->lock) +#endif #ifdef INVARIANTS #define PF_STATE_LOCK_ASSERT(s) \ do { \ - struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH(s)]; \ + struct pf_kstate *_s = (s); \ + struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH(_s)]; \ + MPASS(_s->lock == &_ih->lock); \ PF_HASHROW_ASSERT(_ih); \ } while (0) #else /* !INVARIANTS */ @@ -594,6 +604,7 @@ struct pf_kstate { u_int8_t sync_state; /* PFSYNC_S_x */ u_int8_t sync_updates; /* XXX */ u_int refs; + struct mtx *lock; TAILQ_ENTRY(pf_kstate) sync_list; TAILQ_ENTRY(pf_kstate) key_list[2]; LIST_ENTRY(pf_kstate) entry; diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 7b4c99c9a799..c47a0098550d 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1058,6 +1058,9 @@ pf_state_key_attach(struct pf_state_key *skw, struct pf_state_key *sks, kh = khw; idx = PF_SK_WIRE; + MPASS(s->lock == NULL); + s->lock = &V_pf_idhash[PF_IDHASH(s)].lock; + keyattach: LIST_FOREACH(cur, &kh->keys, entry) if (bcmp(cur, sk, sizeof(struct pf_state_key_cmp)) == 0) From owner-dev-commits-src-branches@freebsd.org Sun Jul 25 07:03:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E6A0653FD8; Sun, 25 Jul 2021 07:03:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GXYt506STz3HH1; Sun, 25 Jul 2021 07:03:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73B271EDE6; Sun, 25 Jul 2021 07:03:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16P7386N050509; Sun, 25 Jul 2021 07:03:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P738E4050508; Sun, 25 Jul 2021 07:03:08 GMT (envelope-from git) Date: Sun, 25 Jul 2021 07:03:08 GMT Message-Id: <202107250703.16P738E4050508@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: ede6e97b828d - stable/13 - df: remove the unused fstype var MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ede6e97b828dec1bb9aee4e69c2f8b4e437ebef7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 07:03:09 -0000 The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=ede6e97b828dec1bb9aee4e69c2f8b4e437ebef7 commit ede6e97b828dec1bb9aee4e69c2f8b4e437ebef7 Author: Mateusz Guzik AuthorDate: 2021-07-20 17:00:50 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-25 07:00:42 +0000 df: remove the unused fstype var Found with cc --analyze Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 570b31f61009fb60591cf5fcc26f0f5c12ff5752) --- bin/df/df.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/bin/df/df.c b/bin/df/df.c index a0d43fca5789..5a96eb9d58c4 100644 --- a/bin/df/df.c +++ b/bin/df/df.c @@ -114,13 +114,11 @@ main(int argc, char *argv[]) struct statfs statfsbuf, totalbuf; struct maxwidths maxwidths; struct statfs *mntbuf; - const char *fstype; char *mntpt; const char **vfslist; int i, mntsize; int ch, rv; - fstype = "ufs"; (void)setlocale(LC_ALL, ""); memset(&maxwidths, 0, sizeof(maxwidths)); memset(&totalbuf, 0, sizeof(totalbuf)); @@ -194,7 +192,6 @@ main(int argc, char *argv[]) xo_errx(1, "-l and -t are mutually exclusive."); if (vfslist != NULL) xo_errx(1, "only one -t option may be specified"); - fstype = optarg; vfslist = makevfslist(optarg); break; case 'T': From owner-dev-commits-src-branches@freebsd.org Sun Jul 25 08:18:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C360A6559C2; Sun, 25 Jul 2021 08:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GXbXf4x32z3ljk; Sun, 25 Jul 2021 08:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 921FF1FDF5; Sun, 25 Jul 2021 08:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16P8IAuR043694; Sun, 25 Jul 2021 08:18:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P8IAHO043693; Sun, 25 Jul 2021 08:18:10 GMT (envelope-from git) Date: Sun, 25 Jul 2021 08:18:10 GMT Message-Id: <202107250818.16P8IAHO043693@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: f0d034474236 - stable/12 - Add __diagused MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f0d0344742365c8fd548a2be6a31f0a9fe9b54a8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 08:18:10 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=f0d0344742365c8fd548a2be6a31f0a9fe9b54a8 commit f0d0344742365c8fd548a2be6a31f0a9fe9b54a8 Author: Mateusz Guzik AuthorDate: 2021-07-15 14:01:02 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-25 07:05:24 +0000 Add __diagused This can be used for variables which are only used with either INVARIANTS or WITNESS. Without any annotation they run into dead store warnings from cc --analyze and always annotating with __unused may hide bad vars when it should not. Reviewed by: kib, markj Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31185 (cherry picked from commit b9296725cf99696b48926270a553044522d6e344) --- sys/sys/systm.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 37dd13654971..0c1d392fd740 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -583,6 +583,15 @@ void _gone_in_dev(struct device *dev, int major, const char *msg); gone_in_dev((dev), 13, \ "see https://github.com/freebsd/fcp/blob/master/fcp-0101.md") +#ifdef _KERNEL +#if defined(INVARIANTS) || defined(WITNESS) +#define __diagused +#else +#define __diagused __unused +#endif + +#endif /* _KERNEL */ + __NULLABILITY_PRAGMA_POP #endif /* !_SYS_SYSTM_H_ */ From owner-dev-commits-src-branches@freebsd.org Sun Jul 25 08:18:12 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F30A655E33; Sun, 25 Jul 2021 08:18:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GXbXh07yLz3lv5; Sun, 25 Jul 2021 08:18:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7764202CF; Sun, 25 Jul 2021 08:18:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16P8IBBT043724; Sun, 25 Jul 2021 08:18:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P8IB9e043723; Sun, 25 Jul 2021 08:18:11 GMT (envelope-from git) Date: Sun, 25 Jul 2021 08:18:11 GMT Message-Id: <202107250818.16P8IB9e043723@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 579ef00e59cb - stable/12 - arm: dedup counter(9) address calculation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 579ef00e59cb81e622960ff2590933af221e0628 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 08:18:12 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=579ef00e59cb81e622960ff2590933af221e0628 commit 579ef00e59cb81e622960ff2590933af221e0628 Author: Mateusz Guzik AuthorDate: 2021-07-19 10:46:01 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-25 07:06:20 +0000 arm: dedup counter(9) address calculation Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 78e3a168616dbe3a2c96efe568c960a1344f42e9) --- sys/arm/include/counter.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/arm/include/counter.h b/sys/arm/include/counter.h index e3fb03abd352..203a1ebda64e 100644 --- a/sys/arm/include/counter.h +++ b/sys/arm/include/counter.h @@ -45,8 +45,7 @@ static inline uint64_t counter_u64_read_one(uint64_t *p, int cpu) { - return (atomic_load_64((uint64_t *)((char *)p + UMA_PCPU_ALLOC_SIZE * - cpu))); + return (atomic_load_64((uint64_t *)zpcpu_get_cpu(p, cpu))); } static inline uint64_t @@ -66,8 +65,7 @@ static void counter_u64_zero_one_cpu(void *arg) { - atomic_store_64((uint64_t *)((char *)arg + UMA_PCPU_ALLOC_SIZE * - PCPU_GET(cpuid)), 0); + atomic_store_64((uint64_t *)zpcpu_get(arg), 0); } static inline void From owner-dev-commits-src-branches@freebsd.org Sun Jul 25 08:18:13 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C1D66559CD; Sun, 25 Jul 2021 08:18:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GXbXj04Vkz3lxF; Sun, 25 Jul 2021 08:18:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D830920338; Sun, 25 Jul 2021 08:18:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16P8ICbG043749; Sun, 25 Jul 2021 08:18:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P8ICjM043748; Sun, 25 Jul 2021 08:18:12 GMT (envelope-from git) Date: Sun, 25 Jul 2021 08:18:12 GMT Message-Id: <202107250818.16P8ICjM043748@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 5351d31bfcbb - stable/12 - pf: add a branch prediction to expire state check in pf_find_state MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5351d31bfcbbd27ac0d505215871e69a46f74b17 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 08:18:13 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=5351d31bfcbbd27ac0d505215871e69a46f74b17 commit 5351d31bfcbbd27ac0d505215871e69a46f74b17 Author: Mateusz Guzik AuthorDate: 2021-07-19 12:50:08 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-25 07:06:27 +0000 pf: add a branch prediction to expire state check in pf_find_state Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 144ec0713daa532342a298fd888a1656ae24a62d) --- sys/netpfil/pf/pf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 8e2fbcbda4c4..bbdd76c0dd07 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1380,7 +1380,7 @@ pf_find_state(struct pfi_kkif *kif, struct pf_state_key_cmp *key, u_int dir) if (s->kif == V_pfi_all || s->kif == kif) { PF_STATE_LOCK(s); PF_HASHROW_UNLOCK(kh); - if (s->timeout >= PFTM_MAX) { + if (__predict_false(s->timeout >= PFTM_MAX)) { /* * State is either being processed by * pf_unlink_state() in an other thread, or From owner-dev-commits-src-branches@freebsd.org Sun Jul 25 08:18:14 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 740316559D1; Sun, 25 Jul 2021 08:18:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GXbXk1G11z3ljx; Sun, 25 Jul 2021 08:18:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06B48202D0; Sun, 25 Jul 2021 08:18:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16P8IDqq043773; Sun, 25 Jul 2021 08:18:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P8IDdA043772; Sun, 25 Jul 2021 08:18:13 GMT (envelope-from git) Date: Sun, 25 Jul 2021 08:18:13 GMT Message-Id: <202107250818.16P8IDdA043772@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: f188c39c41a9 - stable/12 - pf: add a comment to pf_kstate concerning compat with pf_state_cmp MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f188c39c41a9fe9d546cd1cef058078fb402b8c7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 08:18:14 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=f188c39c41a9fe9d546cd1cef058078fb402b8c7 commit f188c39c41a9fe9d546cd1cef058078fb402b8c7 Author: Mateusz Guzik AuthorDate: 2021-07-19 12:17:33 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-25 07:06:32 +0000 pf: add a comment to pf_kstate concerning compat with pf_state_cmp Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit f9aa757d8d1e1bfc7951f462e92f00639256cad6) --- sys/net/pfvar.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index dc9647f86c0b..ba6645131ef9 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -578,10 +578,16 @@ _Static_assert(sizeof(struct pf_state_export) == 384, "size incorrect"); #ifdef _KERNEL struct pf_kstate { + /* + * Area shared with pf_state_cmp + */ u_int64_t id; u_int32_t creatorid; u_int8_t direction; u_int8_t pad[3]; + /* + * end of the area + */ u_int refs; TAILQ_ENTRY(pf_kstate) sync_list; From owner-dev-commits-src-branches@freebsd.org Sun Jul 25 08:18:16 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51EDF655C6D; Sun, 25 Jul 2021 08:18:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GXbXl1xmYz3lvJ; Sun, 25 Jul 2021 08:18:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 298E02069A; Sun, 25 Jul 2021 08:18:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16P8IFqA043797; Sun, 25 Jul 2021 08:18:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P8IFab043796; Sun, 25 Jul 2021 08:18:15 GMT (envelope-from git) Date: Sun, 25 Jul 2021 08:18:15 GMT Message-Id: <202107250818.16P8IFab043796@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 5d95878e584d - stable/12 - pf: shrink struct pf_kstate MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5d95878e584d4024fc74882d9ee0af2020b40852 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 08:18:16 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=5d95878e584d4024fc74882d9ee0af2020b40852 commit 5d95878e584d4024fc74882d9ee0af2020b40852 Author: Mateusz Guzik AuthorDate: 2021-07-19 12:35:31 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-25 07:06:37 +0000 pf: shrink struct pf_kstate Makes room for a pointer. Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 9009d36afd1e0107e1e5b6988f49436087b3d474) --- sys/net/pfvar.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index ba6645131ef9..ceae0b104651 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -589,6 +589,10 @@ struct pf_kstate { * end of the area */ + u_int8_t state_flags; + u_int8_t timeout; + u_int8_t sync_state; /* PFSYNC_S_x */ + u_int8_t sync_updates; /* XXX */ u_int refs; TAILQ_ENTRY(pf_kstate) sync_list; TAILQ_ENTRY(pf_kstate) key_list[2]; @@ -612,13 +616,6 @@ struct pf_kstate { u_int32_t pfsync_time; u_int16_t tag; u_int8_t log; - u_int8_t state_flags; - u_int8_t timeout; - u_int8_t sync_state; /* PFSYNC_S_x */ - - /* XXX */ - u_int8_t sync_updates; - u_int8_t _tail[3]; }; /* From owner-dev-commits-src-branches@freebsd.org Sun Jul 25 08:18:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D02D655CBB; Sun, 25 Jul 2021 08:18:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GXbXm3tpVz3lpd; Sun, 25 Jul 2021 08:18:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 403B920339; Sun, 25 Jul 2021 08:18:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16P8IGHH043821; Sun, 25 Jul 2021 08:18:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16P8IGfg043820; Sun, 25 Jul 2021 08:18:16 GMT (envelope-from git) Date: Sun, 25 Jul 2021 08:18:16 GMT Message-Id: <202107250818.16P8IGfg043820@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 0f97f2a1857a - stable/12 - pf: embed a pointer to the lock in struct pf_kstate MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0f97f2a1857a96563792f0d873b11a16ff9f818c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 08:18:17 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=0f97f2a1857a96563792f0d873b11a16ff9f818c commit 0f97f2a1857a96563792f0d873b11a16ff9f818c Author: Mateusz Guzik AuthorDate: 2021-07-19 12:40:25 +0000 Commit: Mateusz Guzik CommitDate: 2021-07-25 07:06:43 +0000 pf: embed a pointer to the lock in struct pf_kstate This shaves calculation which in particular helps on arm. Note using the & hack instead would still be more work. Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 907257d6967dd23506e69042c55bb1edc983c0ba) --- sys/net/pfvar.h | 23 +++++++++++++++++------ sys/netpfil/pf/pf.c | 3 +++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index ceae0b104651..dceebe1caf77 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -96,22 +96,32 @@ struct pfi_dynaddr { #define PF_HASHROW_LOCK(h) mtx_lock(&(h)->lock) #define PF_HASHROW_UNLOCK(h) mtx_unlock(&(h)->lock) +#ifdef INVARIANTS #define PF_STATE_LOCK(s) \ do { \ - struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH(s)]; \ - PF_HASHROW_LOCK(_ih); \ + struct pf_kstate *_s = (s); \ + struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH(_s)]; \ + MPASS(_s->lock == &_ih->lock); \ + mtx_lock(_s->lock); \ } while (0) - #define PF_STATE_UNLOCK(s) \ do { \ - struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH((s))]; \ - PF_HASHROW_UNLOCK(_ih); \ + struct pf_kstate *_s = (s); \ + struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH(_s)]; \ + MPASS(_s->lock == &_ih->lock); \ + mtx_unlock(_s->lock); \ } while (0) +#else +#define PF_STATE_LOCK(s) mtx_lock(s->lock) +#define PF_STATE_UNLOCK(s) mtx_unlock(s->lock) +#endif #ifdef INVARIANTS #define PF_STATE_LOCK_ASSERT(s) \ do { \ - struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH(s)]; \ + struct pf_kstate *_s = (s); \ + struct pf_idhash *_ih = &V_pf_idhash[PF_IDHASH(_s)]; \ + MPASS(_s->lock == &_ih->lock); \ PF_HASHROW_ASSERT(_ih); \ } while (0) #else /* !INVARIANTS */ @@ -594,6 +604,7 @@ struct pf_kstate { u_int8_t sync_state; /* PFSYNC_S_x */ u_int8_t sync_updates; /* XXX */ u_int refs; + struct mtx *lock; TAILQ_ENTRY(pf_kstate) sync_list; TAILQ_ENTRY(pf_kstate) key_list[2]; LIST_ENTRY(pf_kstate) entry; diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index bbdd76c0dd07..b313decc3806 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1058,6 +1058,9 @@ pf_state_key_attach(struct pf_state_key *skw, struct pf_state_key *sks, kh = khw; idx = PF_SK_WIRE; + MPASS(s->lock == NULL); + s->lock = &V_pf_idhash[PF_IDHASH(s)].lock; + keyattach: LIST_FOREACH(cur, &kh->keys, entry) if (bcmp(cur, sk, sizeof(struct pf_state_key_cmp)) == 0) From owner-dev-commits-src-branches@freebsd.org Sun Jul 25 21:48:48 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0DB476600E9; Sun, 25 Jul 2021 21:48:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GXxWz6lfgz3scp; Sun, 25 Jul 2021 21:48:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C71D23298; Sun, 25 Jul 2021 21:48:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 16PLmliM020931; Sun, 25 Jul 2021 21:48:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 16PLmlW2020930; Sun, 25 Jul 2021 21:48:47 GMT (envelope-from git) Date: Sun, 25 Jul 2021 21:48:47 GMT Message-Id: <202107252148.16PLmlW2020930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 8e24b25b67bb - stable/13 - nfscl: Avoid KASSERT() panic in cache_enter_time() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8e24b25b67bb664168e3daf41d7b2262f5b136d5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2021 21:48:48 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=8e24b25b67bb664168e3daf41d7b2262f5b136d5 commit 8e24b25b67bb664168e3daf41d7b2262f5b136d5 Author: Rick Macklem AuthorDate: 2021-07-14 20:33:37 +0000 Commit: Rick Macklem CommitDate: 2021-07-25 21:45:05 +0000 nfscl: Avoid KASSERT() panic in cache_enter_time() Commit 844aa31c6d87 added cache_enter_time_flags(), specifically so that the NFS client could specify that cache enter replace any stale entry for the same name. Doing so avoids a KASSERT() panic() in cache_enter_time(), as reported by the PR. This patch uses cache_enter_time_flags() for Readdirplus, to avoid the panic(), since it is impossible for the NFS client to know if another client (or a local process on the NFS server) has replaced a file with another file of the same name. This patch only affects NFS mounts that use the "rdirplus" mount option. There may be other places in the NFS client where this needs to be done, but no panic() has been observed during testing. PR: 257043 (cherry picked from commit 7f5508fe78d17af968fe67e00ffa7c975aa2c67d) --- sys/fs/nfsclient/nfs_clrpcops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index d74b2dedaa23..8979a4d08243 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -3762,11 +3762,11 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, ndp->ni_dvp != ndp->ni_vp && (newvp->v_type != VDIR || dctime.tv_sec != 0)) { - cache_enter_time(ndp->ni_dvp, + cache_enter_time_flags(ndp->ni_dvp, ndp->ni_vp, cnp, &nfsva.na_ctime, newvp->v_type != VDIR ? NULL : - &dctime); + &dctime, VFS_CACHE_DROPOLD); } if (unlocknewvp) vput(newvp);