From nobody Mon Nov 4 00:55:55 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhY1R5yncz5bmfy; Mon, 04 Nov 2024 00:55: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhY1R5PWRz4L9C; Mon, 4 Nov 2024 00:55:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730681755; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OldzB6vvBl9Q4rohK4r17+dtD6ERFNSPd8C4Gva5OFk=; b=Sj14DKT/NNRhZ9nGJll5TBj/Lwpzp1Xa6N4KemxAtFxXHEXcu2zjYRkDdJq2t9x74T0AJR vnEfmy/Ud4Puciw/+E2hsIkS1fb73uCJSa0WBirqHpkHGQkvYa3tPjNTrmByv9Kupe7TQs gz2TLyLZJ+TCf+4Ly/HVkhiK8kfeTb5SMOuqok7F8IMK2Nf+vQA9bmNi2FM3jkpcym+MaB FhCHjRgcSb9Aem22pfw4e/7tKaBB3hpXkh7xus5nNHba2LXl5Q71FqZKRjV/8uMurVpn2D bDhT1DsS2OAwMjmQqbZN7eNB7UUOWFugpymmwJ5AWP0KAHC38WVvBVGU0J2MqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730681755; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OldzB6vvBl9Q4rohK4r17+dtD6ERFNSPd8C4Gva5OFk=; b=T55UGk0JN/8BhT87qzRX3Nb8Y/gvUzjwmv0RsiFMMkRCdpp5sw+0KO19jjA4WiJ3eBY6uW Syp+5RXxWVU522BYSTVQOTan2hPzk8/02uDu4EqxnwNfth4cfDiYgNl65LSCim2Tt34kiq be71BpUjD3DDSCkmVlfZM2x2pupPQjKx6u/CXEQJkoBstqepLcuB4eQLhbBs+SSujdWrth ByG1zR6TbS8JEp0bZTMUHRrJU7iZBHk/EFOxzVHOYxHNRp7nSMOJcCHEw6zYea/wChAusE CbCerpMXZpYCcsp9wPAhzU34MbJUoB0pOoJnfpckLJH+3U1rVNpHVj9+ZOtB7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730681755; a=rsa-sha256; cv=none; b=XukJ/ko8TdVAky8sXQbolVzoBqisP9MdVUu9weSNbg1383mTm/6UlotRKDc6wOu6cI7jcT pbR4RPFnHPn2ZlV3MghCFLecoYtFCxCxeSd+7PpWGiqhYNnmuiwEeIqhYqxDhOu+GALb0O 1MCYe6NjqCkerwRe6omw58xbWUuQtLImUM2o8PTjrW4GBOp9QAwfBdnO1LEFjrImH4dvsb n+jWYhoUzlblrqwnmCwYmDbLkGQzshUEcdQxGgAarY+Kiv7YKOSIPxpWCmlTWITA/tyFQv gsI9hCiT/Rrg8OCzY7nrlOJp9BqAyaGr2jne+8JW1VcCouqTHNjmkjYmIgJh3Q== 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 4XhY1R4rccz1Bhm; Mon, 4 Nov 2024 00:55:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A40ttRM001957; Mon, 4 Nov 2024 00:55:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A40ttWD001954; Mon, 4 Nov 2024 00:55:55 GMT (envelope-from git) Date: Mon, 4 Nov 2024 00:55:55 GMT Message-Id: <202411040055.4A40ttWD001954@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 2ce493e1693b - main - Cleanup commit. Use PROGRAM instead of PROGGRAM. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 2ce493e1693b55a330079ac5fce8beb66e26ddeb Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2ce493e1693b55a330079ac5fce8beb66e26ddeb commit 2ce493e1693b55a330079ac5fce8beb66e26ddeb Author: Artem Hevorhian AuthorDate: 2024-11-02 09:40:22 +0000 Commit: Warner Losh CommitDate: 2024-11-04 00:55:56 +0000 Cleanup commit. Use PROGRAM instead of PROGGRAM. Reviewed by: imp, emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1508 --- sys/kern/genassym.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/genassym.sh b/sys/kern/genassym.sh index e17c1642ecc7..8b3d7aa1a2e1 100644 --- a/sys/kern/genassym.sh +++ b/sys/kern/genassym.sh @@ -45,7 +45,7 @@ work() # -#MAIN PROGGRAM +# MAIN PROGRAM # use_outfile="no" while getopts "o:" option From nobody Mon Nov 4 03:23:48 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhcJ74sbPz5c1pS; Mon, 04 Nov 2024 03:23:51 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhcJ729dyz4WyD; Mon, 4 Nov 2024 03:23:51 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTPS id 7ZH8taxeuAHbZ7nh0t4mhw; Mon, 04 Nov 2024 03:23:50 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id 7ngzt50MV2M9q7nh0tj0w8; Mon, 04 Nov 2024 03:23:50 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=ce5xrWDM c=1 sm=1 tr=0 ts=67283e46 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=VlfZXiiP6vEA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=sBeMAxy3m3l4eF98PuwA:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id D5EE71FE; Sun, 03 Nov 2024 19:23:48 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id BF6D01A5; Sun, 03 Nov 2024 19:23:48 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Olivier Certner cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 5169d4307eb9 - main - nfs: Fallback to GID_NOGROUP on no groups In-reply-to: <2094473.mIT35NG9lc@ravel> References: <202411031547.4A3Fl0Lh079122@gitrepo.freebsd.org> <20241103171056.E8299280@slippy.cwsent.com> <2094473.mIT35NG9lc@ravel> Comments: In-reply-to Olivier Certner message dated "Sun, 03 Nov 2024 19:16:27 +0100." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 03 Nov 2024 19:23:48 -0800 Message-Id: <20241104032348.BF6D01A5@slippy.cwsent.com> X-CMAE-Envelope: MS4xfHSho2DaKys4lNRwYPqcFZZq/G3LQbmwF8pJ3OWxRnLA5B68VUVcgadA62BtLIlDwBvKKT14aQy0XXCvvCFTBSdlNdM+Sumzp2dXY7sVyG+lIV+K7q0p KnHLRmZg9J83u+GY5siCX6MrfeIQSVQFQXPqf59eF1W5+BBp4QjtX6sTUeVUviBOL+sDxRNJIHVVPuIxJXKa7Pq1UedqlyBp9beJE7rDQpx95iQqy9SbLBwi F70ZZm2829AR5weX1Vpe/lc2B04BHoITxo2ZZ6MfPHKPujeTMXcvOL9GX/o9hJUHHhMX1aAMgWKGjc/RlrGjgxxsLKRh8DZnQQs9IAL9p3o= X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4XhcJ729dyz4WyD X-Spamd-Bar: ---- In message <2094473.mIT35NG9lc@ravel>, Olivier Certner writes: > > This is a multi-part message in MIME format. > > --nextPart17542189.7ycxSsYEdt > Content-Transfer-Encoding: 7Bit > Content-Type: text/plain; charset="UTF-8" > > > I'm getting a different panic this time. > > Sigh... I see why, and it seems straightforward to fix. Could you please tr > y the attached patch? It is also available at: https://people.freebsd.org/~o > lce/0001-cred-crsetgroups-Throw-away-old-groups-before-crexte.patch . > > Hopefully, this was the last problem to solve. All patches in the series, ex > cept the "nfs, rpc: *" one, have been tested and actually used on my machines > for weeks. I however don't use NFS on a daily basis, and it is now pretty c > lear that I have a big problem in my NFS testing setup, or messed up the rela > ted tests (am still not sure). > > If you can't test this patch or if you still have a problem after this one, t > hen I'll just revert the series pending my re-testing in a correctly setup NF > S environment. > > Sorry to have dragged you in this debugging session, and thanks for your effo > rts and feedback. > > -- > Olivier Certner This certainly fixed the panic. Thank you. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Mon Nov 4 03:57:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xhd2z3Jsfz5c48D; Mon, 04 Nov 2024 03:57:31 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xhd2y6GMJz4Z3M; Mon, 4 Nov 2024 03:57:30 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTPS id 7g8wte1E1MArN7oDatZAsf; Mon, 04 Nov 2024 03:57:30 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id 7oDYt56SN2M9q7oDZtj2nX; Mon, 04 Nov 2024 03:57:30 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=ce5xrWDM c=1 sm=1 tr=0 ts=6728462a a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=VlfZXiiP6vEA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=gE3rUWh60-tMV4sXS5QA:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 6C217260; Sun, 03 Nov 2024 19:57:26 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 753B614; Sun, 03 Nov 2024 19:57:26 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ed Maste cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a5f7047f2865 - main - gvinum: Postpone removal to FreeBSD 15 In-reply-to: <202411032128.4A3LSpEd015424@gitrepo.freebsd.org> References: <202411032128.4A3LSpEd015424@gitrepo.freebsd.org> Comments: In-reply-to Ed Maste message dated "Sun, 03 Nov 2024 21:28:51 +0000." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 03 Nov 2024 19:57:26 -0800 Message-Id: <20241104035726.753B614@slippy.cwsent.com> X-CMAE-Envelope: MS4xfO8m9hFbiKoi55tZDWgQag8r2PDKFg4TCfHdodloEGbRx69RU8FZ766SEtreQwr44HIdBSFuTV1vddKpf1u/OkaMpeBMQX63XWulHiqlpLgQ3issFzo5 HEbaTRlmdKl0Z1+B05nzihXMlZsS9ISqv0aN/vmDZQGnYtHEn93eMz4Phxy/Dodg4RFlRfdbqwKzoiTPL4nuixpzjvMcTraGJ7iiP0r7Az+kpKACgScpNsH4 hnqyEvzH53fZgUOhexQoSb/L+EJIf/FaWhzpuzVTgYJckW9gnuf7e9+Rbv2A+zRbqCdtg0YNylaVGFBPXCVw3DGXQahu7B4cgNx+Mt/X7Lw= X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4Xhd2y6GMJz4Z3M X-Spamd-Bar: ---- In message <202411032128.4A3LSpEd015424@gitrepo.freebsd.org>, Ed Maste writes: > The branch main has been updated by emaste: > > URL: https://cgit.FreeBSD.org/src/commit/?id=a5f7047f28654aa297c57a9d24f6d140 > 8641b975 > > commit a5f7047f28654aa297c57a9d24f6d1408641b975 > Author: Ed Maste > AuthorDate: 2022-12-12 16:57:12 +0000 > Commit: Ed Maste > CommitDate: 2024-11-03 21:28:16 +0000 > > gvinum: Postpone removal to FreeBSD 15 > > It was not removed for FreeBSD 14. Yeah, the fact that vinum and gvinum implemented a Veritas Volume Manager (VxVM) like capability for FreeBSD, it's not the most straightforward concept to understand. Back in my Solaris days Sun offered courses on VxVM. And later removed it for this very reason (plus licensing). I get why people didn't use it. It was somewhat complex, and so was gvinum. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Mon Nov 4 13:39:14 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhsyC0QYkz5c5Vm; Mon, 04 Nov 2024 13:39: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhsyB72RDz4PMq; Mon, 4 Nov 2024 13:39:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730727555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9b2vPs06meaxRHgzjhLitU0svvXGOu7mb8rYLQo1ekQ=; b=iRBxHnQGITlWqMZWs7miVfA9TRytWleqlXvMa9d/8EwbFb1ybH2zoeyI6Ihh/9UUV2CBdP uloR/VO7gANbRAoQbN1lZLtLqYbi91lHduZCfgY3uqS5WpOhaGyNL5ftzOZVIDzuLuwvVk SHh7nILSBHh9L5bnKbakpDwaNLcHKJml3zF8Viv+z6pwxuTUzV/9tJAapfLDRwhzvI/WN+ dGBi//WrGG3opKxHM886/cfljNaH8STNbwDEaDHejsTpfofeTb86fsx4kIDPyKUCI4K+Tq 6DLmGMjuitaIMeeSAZURr9e3IdSUgcCoA4OfWj7+K2AGCJSL+BcG0F/NLl+d8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730727555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9b2vPs06meaxRHgzjhLitU0svvXGOu7mb8rYLQo1ekQ=; b=LlfcZc+xsYxmlq6t1JLaMeh6h5w7Sea8Bp4JwvhwT8xq69ljSBUOjIHbOkZ7BIfqp97Kuc dNqeLdvA0TwfA/ebc2lzdVzd5Va91pIDMD72KnM59pSy82HtuArYvxKYaj880ihtU09Gtr 7XKFKKfwuR7+/drSEPF7LWY1cWTfVenZQfKq9aq6bXR+S/DBQJSHbRL4oI7caX8SNONENA 87A0gkdhvGbvjLZuJwrVk/vJZmW4zfY5dqyS6YU4Z4OPiZxl71RH52oytqXmXtLlQCfO+h egtUlZ5SmdUKIqxmvrj3dvKCkyw7z4z+g0cdlLrFlIDHI1J16hWGbt63NLOVNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730727555; a=rsa-sha256; cv=none; b=s/i/CGpQTDM8Uu6ez/nwBJoZFxaW0asqForTY0PCI2mXnGXw+gu9VmF5VXCuq2jE6481tB ELLTZktMtwdwnXt8sbtE+w3f6XzSQ867mlj/khe5msWSvuFKZMbUO5VV4Hkg9QZzpqC/1I hKEfQf2AmtLPs3x6/fK/gvqZFPxr3V92YyNXKY7ZmKoiA8ocM+qugO1CVBRhyzmSsbA+zD rPHg8pVfRkQx79gMTfWfhNgsNWucupRm2lW7Qosgbzu4KfVEyFSB2q1FvrS91T4yP9YUw/ 9Rh2pqxSZkPWXiubqKypqgvhJm8OKSA8HH/ACalsHshlcLbot8sXqOn5y+nYhQ== 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 4XhsyB6Mngzb9f; Mon, 4 Nov 2024 13:39:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A4DdEgh010903; Mon, 4 Nov 2024 13:39:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4DdEGW010900; Mon, 4 Nov 2024 13:39:14 GMT (envelope-from git) Date: Mon, 4 Nov 2024 13:39:14 GMT Message-Id: <202411041339.4A4DdEGW010900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 169a10853a50 - main - cred: crsetgroups(): Throw away old groups before crextend() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 169a10853a50f9bbb037492e6f2737cce10f6b99 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=169a10853a50f9bbb037492e6f2737cce10f6b99 commit 169a10853a50f9bbb037492e6f2737cce10f6b99 Author: Olivier Certner AuthorDate: 2024-11-03 18:04:02 +0000 Commit: Olivier Certner CommitDate: 2024-11-04 13:38:08 +0000 cred: crsetgroups(): Throw away old groups before crextend() Now that crextend() asserts that groups are not set (rightfully so, since it may change the backing storage without copying the content of the old one), have crsetgroups() throw away the old groups before calling it, as it installs an entirely new set anyway. This allows to reuse unshared credentials by resetting their groups set, as NFS exports actually do. Reported by: cy Tested by: cy Fixes: ea26c0e79752 ("cred: crextend(): Harden, simplify") Pointy hat to: olce While here, as I forgot these credits in commit 77d652b4b472 ("nfs: Fallback to GID_NOGROUP on no groups"): Tested by: cy, David Wolfskill (panics caused by mountd(8)) Tested by: kib (MINIMAL/custom kernel compile breakup) --- sys/kern/kern_prot.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index b522edbf4e69..d29833f944ab 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -2217,16 +2217,14 @@ void crcopy(struct ucred *dest, struct ucred *src) { + /* + * Ideally, 'cr_ngroups' should be moved out of 'struct ucred''s bcopied + * area, but this would break the ABI, so is deferred until there is + * a compelling need to change it. + */ bcopy(&src->cr_startcopy, &dest->cr_startcopy, (unsigned)((caddr_t)&src->cr_endcopy - (caddr_t)&src->cr_startcopy)); - /* - * Avoids an assertion in crsetgroups() -> crextend(). Ideally, - * 'cr_ngroups' should be moved out of 'struct ucred''s bcopied area, - * but this would break the ABI, so is deferred until there is a real - * need to change the ABI. - */ - dest->cr_ngroups = 0; dest->cr_flags = src->cr_flags; crsetgroups(dest, src->cr_ngroups, src->cr_groups); uihold(dest->cr_uidinfo); @@ -2475,6 +2473,13 @@ crsetgroups(struct ucred *cr, int ngrp, const gid_t *groups) if (ngrp > ngroups_max + 1) ngrp = ngroups_max + 1; + /* + * crextend() asserts that groups are not set, as it may allocate a new + * backing storage without copying the content of the old one. Since we + * are going to install a completely new set anyway, signal that we + * consider the old ones thrown away. + */ + cr->cr_ngroups = 0; crextend(cr, ngrp); crsetgroups_internal(cr, ngrp, groups); groups_normalize(&cr->cr_ngroups, cr->cr_groups); From nobody Mon Nov 4 13:50:02 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhtBn6Jmzz5c6Jp; Mon, 04 Nov 2024 13:50:09 +0000 (UTC) (envelope-from olce@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhtBn5dVcz4PrB; Mon, 4 Nov 2024 13:50:09 +0000 (UTC) (envelope-from olce@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730728209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5qxwp+7y3XHL14O/U+2C3oCzhM4OL1wL8DzxDhTi/GQ=; b=QkHK/xMoxiKRwhu7vJfhTpQP/J/dHoW3fZtKajNiO0q24e4dtHrQi1iNgOQdIh/xlCYbVU OToPq7HWFNAzSJrabXqcEMzI2RIewwrulze5JgQK1nIsbN84kvheD08tIttTjpPkuKm71o qMs1jgSmgRCym+T4E+QJGp0PYNhRKDEetVkT0xiUQQ/RsKSC3VkA2T8kXpzOjh+ce2JMI/ p/n9ujPEPdxenUWHaRjIKkSMr9n1FxLjbgqXc0EqXElLSg73LPNstLvvO3Ngu885cHzXop ZzgCUGs92CinVWj2H8WNpOwoyqlwesD9iSLjOplP2Q0rSwqszMSca1AthrjIXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730728209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5qxwp+7y3XHL14O/U+2C3oCzhM4OL1wL8DzxDhTi/GQ=; b=qHrCKmVbSvLhYLuu84r9H0HjEodVjGQUpPGbAejTWY+Lw+PEGOH7OajRpC6//LT7866RUQ ZOCRuYoPfrHAt6gD+qcCoFu899KuQCjeQY9IhUm0BH0MlP2heW6weBHUOR5BB7WDPzZ4dC /XQvzkCCgpWn9LnySgtj9+jOTKD66Xz/fZWyYS/WsOBYicYMMXpxUkpKky5bU63wAmzi6R kf4tV6E3PsQyueeh5dYn/Q6XVaROwUUpvU9Py2vbWNzUr1GZr4IweftV2BpJi8lPqhIfI7 jahFsIv9h2PLXC/qkNgGdKbNDGAwf3v0w1bk34dzpyTByKdr0pGsk2XgzCHrhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730728209; a=rsa-sha256; cv=none; b=C6AbUonQceoKOkLkhw5qZvcU3/y/M7J/5250ZRpFYON56OFpwx+ZLty/uEc4pcY2XhX6Ng 0yK4JBwWIAfmqhTsBcUr765Ci0mfrEnSCkYrztYO3Qtm6XiWB+nUiF+55/ZIDZGf8ED31k HoU9nPd5dekUNqmLqkKDgGg5vFTm1gW/3bWJesAGPSQ0hyEdz1FS/y+XobqwmqIgN0r5o4 MVRSqagEkJ6nHVrCuX6eGlTBQLZLweXl8xT0ckNizsg9hPwBxm81jHMjEScW6BKn0SM/vd aeJkjOzCXUAFAyCvxGm7NxhNJRqlqc6B1atZBRTqk/Xx77Fg5yDagtfJvgA1IA== Received: from ravel.localnet (aclermont-ferrand-653-1-222-123.w90-14.abo.wanadoo.fr [90.14.66.123]) (using TLSv1.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) (Authenticated sender: olce/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XhtBn1c5TzcNF; Mon, 4 Nov 2024 13:50:09 +0000 (UTC) (envelope-from olce@freebsd.org) From: Olivier Certner To: Cy Schubert Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 5169d4307eb9 - main - nfs: Fallback to GID_NOGROUP on no groups Date: Mon, 04 Nov 2024 14:50:02 +0100 Message-ID: <2989864.slGk94SIus@ravel> In-Reply-To: <20241104032348.BF6D01A5@slippy.cwsent.com> References: <202411031547.4A3Fl0Lh079122@gitrepo.freebsd.org> <2094473.mIT35NG9lc@ravel> <20241104032348.BF6D01A5@slippy.cwsent.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3041317.hHqAuc6tWs"; micalg="pgp-sha384"; protocol="application/pgp-signature" --nextPart3041317.hHqAuc6tWs Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8"; protected-headers="v1" From: Olivier Certner To: Cy Schubert Date: Mon, 04 Nov 2024 14:50:02 +0100 Message-ID: <2989864.slGk94SIus@ravel> In-Reply-To: <20241104032348.BF6D01A5@slippy.cwsent.com> MIME-Version: 1.0 > This certainly fixed the panic. Thank you. Well, thank *you* for your patience and support. I'm not completely sure how I messed up the NFS tests, but it seems I was not testing the right code. The good news is that I've redone my testing NFS setup correctly this time and actually was able to reproduce the problems you and David reported with original series of changes (except your 'yppasswd' scenario, as I have not set up NIS). And I confirm that they are gone with the amending commits with a number of different configuration variations (I've just committed the last one, whose functional changes are identical to the one I had posted and you tested; it just has slightly amended commit message and comments). Hopefully, this is the end of it, but I'll watch in case of reports saying otherwise. Sorry again for the breakages and disturbance. -- Olivier Certner --nextPart3041317.hHqAuc6tWs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCQAdFiEEmNCxHjkosai0LYIujKEwQJceJicFAmco0QoACgkQjKEwQJce JidmUA//TZDUX9xryo/8jngsc7SonZVXE5n19Z75eXBvAGy9C5wgS0sL5CcmV9es tDUwZSkzsEvJ5a5EuB5h/ReYQK21F2taqIOBLTb7fRbuPf3AY0bKwqqhm4jXXOin hRV9K4kD/V6GM6c4695L+hAue9ja6GLVMG3ZRtCeIjxMktB0ZbfUO/VqJOA3FwfV lcONDayL7pGMf/ipa5s5M5jANmVh/OTAf+hfktOcFEyLKbWFXdVZKkWkkUiE07d0 EoTJetAlXuyM1vbxGuMEbmMHequ+IQJwkkzg5MhFC/eYxQJGi0ur5904mczdYOkp qf7Qw+rG/AjkFWJBzOKeOyGZ6Tch/K1FVDhZtDCD2WzzlChRE2cSL+X2CqdEpW3w yjOEIf5x9H4KZZpJ5gtFUfQNT2TgofvxHKWhUi8WqBpcoUfZ65Afl83M914WXqjn 6JbBvPDvXOwnSS+KebE3mkaqY97Mz9iYPRfYxYByLlPITfNceGaC8auE2zjmyeZL Mu3c7MZT6SKUZ4jMLJF+kRhvr8RV4JspPiH3VkKjjQaWEekngYuXvEqdpggufhCW l6emRGpGFFblhzVRU9OaXVU0w+xwlZVJO6/8RECoIrxbicmYeNC+PVWnP3waw7CS 8c99xPVfTu1uqxmEWoz58DfCJcTVGqjy2ky9pD9CSE4stIXKbs0= =OAJt -----END PGP SIGNATURE----- --nextPart3041317.hHqAuc6tWs-- From nobody Mon Nov 4 13:58:03 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhtMw1HFnz5c6dB; Mon, 04 Nov 2024 13:58: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhtMw0jvxz4Rb3; Mon, 4 Nov 2024 13:58:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730728684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=55RdRNQCWT9dyRsj0c+hR9PiZGQMIThPVz5JZ6Gu2lY=; b=gVPsOx5yQ0WTHaUDJhmGhh/AuKommdxB9MeDeTXIsVhGDRAUebrVOHqyrpyGnaUVcx5pM4 f8yIAwI7MJ0ZNVi1jHfRRO2aCj23mRmA30mv3rSq15K/CyltT+Nm4WKHbzDs1LqKVCK8aq 58G04LbAzqdEvO57nvLaV52UKATjPgwuc6aWIWWdGNSikAGJ00VQ0sqg7EzYEw5ZBtTVSh 9UDwb8Mq8eAS08Gp1tGlN9nLkqqV/muAjxgnDhfHn739SaXh4K+O5s3A23pF4D0QWCefQi MXf3OrZxqkKzBcEhN0WFRnQq3ciY4bVvaSlvdc2U8d82drS0f7haucR7ZFJPig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730728684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=55RdRNQCWT9dyRsj0c+hR9PiZGQMIThPVz5JZ6Gu2lY=; b=wDHyFvVhOA2HjGnNFeLLgY4v+ooS5wF5V3/FuS4JtK+MWS21S5T+UxNY+2OxtAs7oF50sX QrVSVshVr/dvKVhHuMZSuNwaaskPDfEk9hD2uB4qBwoT54xaCPf1FrekQz3/e2b59fhc+w pYqBcwMuJ/JhIXI4D1JzLdyxjAzPZEg8KTT3lkh20gVeDQYfpyEmhj4IMOS9yGUxupAgeU GA9WN4A86258YWHFs9Exg5FBad4n3p7F+bAIqE4D1MBiqT/G8shuj3dDwZshRA2bhgg8jg FHRO2tDwOk7Bh89DVquqS08eqF0MGk1s4IRwquwoNGPePB2OfyZVX7hBLuS0WQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730728684; a=rsa-sha256; cv=none; b=yimhLY8qt9ren9OARj376DmYqmd4O1Kx3K+wpYUH3mURjcrd/xaKg4bbsNl3ltl9U4cVyr Gru5RENQ3HIQDaHcLkYdyD3ziUfv/Cudah9DLI4ssVV38nrvRdFGD+Z8EUATe8pGrYTduZ Gi8JIy14IVy1Q48jUWXZXrA3+T9AmNZqvCQ0G2orlrBumbwGFfDp9uaImjRx66BUlFM4Gu JSzGOw3ePVX0iKIIPDawKxoxZx6FHFCi9wUmj8TDIy72nwnnWYKkB/uWXH5lUCBaHtnD2t DyReE89SPfTBzjsIrVVCUtqRnD6YZCv1zkfFKeOPOlyTgHZ8DnRRB/nsIA5Aww== 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 4XhtMv72nzzbGH; Mon, 4 Nov 2024 13:58:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A4Dw354047875; Mon, 4 Nov 2024 13:58:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4Dw32K047872; Mon, 4 Nov 2024 13:58:03 GMT (envelope-from git) Date: Mon, 4 Nov 2024 13:58:03 GMT Message-Id: <202411041358.4A4Dw32K047872@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 914752d0f7f8 - main - praudit: correct test case List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 914752d0f7f874ab4fc8393aee28c22df87324f2 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=914752d0f7f874ab4fc8393aee28c22df87324f2 commit 914752d0f7f874ab4fc8393aee28c22df87324f2 Author: Ed Maste AuthorDate: 2024-11-04 13:42:00 +0000 Commit: Ed Maste CommitDate: 2024-11-04 13:57:13 +0000 praudit: correct test case The -n flag specifies that user and group IDs should remain numeric, not be mapped to names. The golden output for praudit -n, however, contained user and group names. Reported by: markj Reviewed by: markj Fixes: ba10bfe509dc ("libbsm: honour AU_OFLAG_NORESOLVE") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47434 --- usr.sbin/praudit/tests/input/numeric_form | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/praudit/tests/input/numeric_form b/usr.sbin/praudit/tests/input/numeric_form index 09f089450ac3..144be694f2e4 100644 --- a/usr.sbin/praudit/tests/input/numeric_form +++ b/usr.sbin/praudit/tests/input/numeric_form @@ -2,6 +2,6 @@ header,113,11,socket(2),0,Mon Jun 11 10:18:45 2018, + 380 msec argument,1,0x1c,domain argument,2,0x2,type argument,3,0x0,protocol -subject,root,root,wheel,root,wheel,7053,4724,37636,10.0.2.2 +subject,0,0,0,0,0,7053,4724,37636,10.0.2.2 return,success,3 trailer,113 From nobody Mon Nov 4 14:02:44 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhtTP1Nk2z5c7Jj; Mon, 04 Nov 2024 14:02:49 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhtTN5gR3z4RxP; Mon, 4 Nov 2024 14:02:48 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTPS id 7x6ItedCFMArN7xfKtZbLk; Mon, 04 Nov 2024 14:02:46 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id 7xfJtS8dKKHV87xfJtW6OY; Mon, 04 Nov 2024 14:02:46 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=XeEqz555 c=1 sm=1 tr=0 ts=6728d406 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=VlfZXiiP6vEA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=PxZaom5FXS5mHa0N_XkA:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id A090F2FA; Mon, 04 Nov 2024 06:02:44 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 9699D6F; Mon, 04 Nov 2024 06:02:44 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Olivier Certner cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 5169d4307eb9 - main - nfs: Fallback to GID_NOGROUP on no groups In-reply-to: <2989864.slGk94SIus@ravel> References: <202411031547.4A3Fl0Lh079122@gitrepo.freebsd.org> <2094473.mIT35NG9lc@ravel> <20241104032348.BF6D01A5@slippy.cwsent.com> <2989864.slGk94SIus@ravel> Comments: In-reply-to Olivier Certner message dated "Mon, 04 Nov 2024 14:50:02 +0100." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 04 Nov 2024 06:02:44 -0800 Message-Id: <20241104140244.9699D6F@slippy.cwsent.com> X-CMAE-Envelope: MS4xfFlnPUyEpntLLh1Q2BaTcC/fIEVVyJvLjjY/I8nVJXCNAKVLzEwd5U0mrlzKwVrXQX91FQmr1YNiW6qWYayEZp2QoDNQ81KD8rZ4d+R2m23DoeWRZ4nS A7l7zMrWNLaOEtFW5n+9cOz309ndvnJRNoDfVxkYqXfSXNiKA5chSw6m6JYhph0eBsyUzoOzqdnSGX16hpqXzB8wf3MgM5bQ/+kBnXQXc0tD9O3HV+epxgNc q/o9CJWMU3R4agzS30O+cjYKQpPu2695gIM0kgjKTHUaswvnbIlvSAlTevfefvAXya4EnwVhtsq2p8AgpnfDZYOX8pqlDQ0hxu7c5WznG1g= X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4XhtTN5gR3z4RxP X-Spamd-Bar: ---- In message <2989864.slGk94SIus@ravel>, Olivier Certner writes: > > > This certainly fixed the panic. Thank you. No need to thank me. My setup here makes it easy to capture console outputs. > > Well, thank *you* for your patience and support. Again, you're welcome. > > I'm not completely sure how I messed up the NFS tests, but it seems I was not > testing the right code. The good news is that I've redone my testing NFS se > tup correctly this time and actually was able to reproduce the problems you a > nd David reported with original series of changes (except your 'yppasswd' sce > nario, as I have not set up NIS). And I confirm that they are gone with the > amending commits with a number of different configuration variations (I've ju > st committed the last one, whose functional changes are identical to the one > I had posted and you tested; it just has slightly amended commit message and > comments). The first panic happened when mountd was started on the NFS server. The second panic happened when one of the clients mounted an NFS share served by the NFS server. I share my /usr/obj and didn't catch that until the next installworld/installkernel on that machine (my firewall here at home). > > Hopefully, this is the end of it, but I'll watch in case of reports saying ot > herwise. It looks this is the end of it. Thanks for all your help fixing it. I was pretty much AFK during the weekend working around the yard. No time for computers. > > Sorry again for the breakages and disturbance. NP > > -- > Olivier Certner -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Mon Nov 4 14:46:31 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhvRr2tPDz5c9W0; Mon, 04 Nov 2024 14:46: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhvRr0wZ3z4Wlw; Mon, 4 Nov 2024 14:46:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730731592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wAdF9pEq75lPCLbAQjdEt23LDT3JPjHrUKjUiom9sJo=; b=MV0t3hPWIcWcGiiH9fpVCUPGwaF8U8Pkz1ORYnaZCa0cSTnwNYKLBpNQc+WiJdejNhG7xv 5lPnDP0MjGyDNg2zwQh4DwAvYSID11FDsloqPS2Sqju72rSa1PCTsgDNhnVETXfj6aK1Zz j6uL4p1DUC5mANuHZ3fvECMF4zckZ06vBLyibCim8T8qSO7yp1mBMbbS3BE48qkLK6vngE rlgObIGI7cqqnWTAY1SYh8pfh5/8O+FCitGw9HkMPAlqBtREh+Gba3lkmaTLcbxN5WnrIP 3UNV/nfGrAtfM3Kn5gTOdqoCMVGKoDPQ0KhXzPd8CABH8Tu50hAYZjjXMIKyzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730731592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wAdF9pEq75lPCLbAQjdEt23LDT3JPjHrUKjUiom9sJo=; b=mVXJnI2JNnaYX9CZ9YgkFAsDNtEtwQhNfITNLc3WmCzbMvB8oLhEJ0z0TyGhtDhCZNXr/w 5vkqO7fYZExGgYnge5JloFyqeajqfVnA17r7jI4FfEDYg4KewqjbBPX8unLs19xU7leWDH p21mv4zipSHsqOlKT9OM+tZLx0/+IcU/2pGkvDcE7Q9pSX9Y7w9Cweah5MK4tzw+cwsrem U6oz5y/2XrwTvW7AprtanNqCB2tEh0lWK7F8P6d/HwDJrJo22+cQGIqE8EeS+JTthAEcjq 2MEHqf5MgsoRb9ZW8wntMCQEvTx9y7BYULD451s4oTbEMF0X35ib7t0h8AbkuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730731592; a=rsa-sha256; cv=none; b=NsEhF4eTtPSL3N/AFkLAGxZISx7rLwYzVycY0calHaRjaZcoCBKjH+oxukEeOUi5WODTKP WZK6i9BrlzEZkfwI89hJglsQEIspCS73bpeYyK1VJPvMUVGllCRRfBGl/CR7T7BoJnJW1u 2HbBdDS3bH4MxChQUJ1XQcrIEWSQrpxO2U2EQFvsgPscmFYgKLk3M+7byEbZM2xGIp6HLk 1T3xtZlDP+UJOmqR3/uFdgamXwXXuMowx+GhGiBb5+OF/JpHWVtPJB10wbDvllOUKGyU29 rpCLrlawOEkJ2GeqjSKSeZhOXfl5vEZM2AVZTG07Hsn0NIxL8Uaii2JLHSolBQ== 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 4XhvRq6LfPzdCh; Mon, 4 Nov 2024 14:46:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A4EkVfC040425; Mon, 4 Nov 2024 14:46:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4EkVxI040422; Mon, 4 Nov 2024 14:46:31 GMT (envelope-from git) Date: Mon, 4 Nov 2024 14:46:31 GMT Message-Id: <202411041446.4A4EkVxI040422@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: f95acbd89d59 - main - vmm: Rename the amdiommu driver to amdviiommu List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: f95acbd89d594b5932197679d94d2ba23c1d0331 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f95acbd89d594b5932197679d94d2ba23c1d0331 commit f95acbd89d594b5932197679d94d2ba23c1d0331 Author: Mark Johnston AuthorDate: 2024-11-04 14:44:19 +0000 Commit: Mark Johnston CommitDate: 2024-11-04 14:45:57 +0000 vmm: Rename the amdiommu driver to amdviiommu To avoid a conflict with the new amdiommu driver imported recently. Fixes: 0f5116d7efe3 ("AMD IOMMU driver") Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D47415 --- sys/amd64/vmm/amd/{amdiommu.c => amdviiommu.c} | 38 +++++++++++++------------- sys/modules/vmm/Makefile | 2 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sys/amd64/vmm/amd/amdiommu.c b/sys/amd64/vmm/amd/amdviiommu.c similarity index 85% rename from sys/amd64/vmm/amd/amdiommu.c rename to sys/amd64/vmm/amd/amdviiommu.c index 69432498a5c2..5f5822a667b5 100644 --- a/sys/amd64/vmm/amd/amdiommu.c +++ b/sys/amd64/vmm/amd/amdviiommu.c @@ -40,36 +40,36 @@ #include "amdvi_priv.h" #include "ivhd_if.h" -struct amdiommu_softc { +struct amdviiommu_softc { struct resource *event_res; /* Event interrupt resource. */ void *event_tag; /* Event interrupt tag. */ int event_rid; }; -static int amdiommu_probe(device_t); -static int amdiommu_attach(device_t); -static int amdiommu_detach(device_t); +static int amdviiommu_probe(device_t); +static int amdviiommu_attach(device_t); +static int amdviiommu_detach(device_t); static int ivhd_setup_intr(device_t, driver_intr_t, void *, const char *); static int ivhd_teardown_intr(device_t); -static device_method_t amdiommu_methods[] = { +static device_method_t amdviiommu_methods[] = { /* device interface */ - DEVMETHOD(device_probe, amdiommu_probe), - DEVMETHOD(device_attach, amdiommu_attach), - DEVMETHOD(device_detach, amdiommu_detach), + DEVMETHOD(device_probe, amdviiommu_probe), + DEVMETHOD(device_attach, amdviiommu_attach), + DEVMETHOD(device_detach, amdviiommu_detach), DEVMETHOD(ivhd_setup_intr, ivhd_setup_intr), DEVMETHOD(ivhd_teardown_intr, ivhd_teardown_intr), DEVMETHOD_END }; -static driver_t amdiommu_driver = { - "amdiommu", - amdiommu_methods, - sizeof(struct amdiommu_softc), +static driver_t amdviiommu_driver = { + "amdviiommu", + amdviiommu_methods, + sizeof(struct amdviiommu_softc), }; static int -amdiommu_probe(device_t dev) +amdviiommu_probe(device_t dev) { int error; int capoff; @@ -99,7 +99,7 @@ amdiommu_probe(device_t dev) } static int -amdiommu_attach(device_t dev) +amdviiommu_attach(device_t dev) { device_set_desc(dev, "AMD-Vi/IOMMU PCI function"); @@ -107,7 +107,7 @@ amdiommu_attach(device_t dev) } static int -amdiommu_detach(device_t dev) +amdviiommu_detach(device_t dev) { return (0); @@ -117,7 +117,7 @@ static int ivhd_setup_intr(device_t dev, driver_intr_t handler, void *arg, const char *desc) { - struct amdiommu_softc *sc; + struct amdviiommu_softc *sc; int error, msicnt; sc = device_get_softc(dev); @@ -158,7 +158,7 @@ fail: static int ivhd_teardown_intr(device_t dev) { - struct amdiommu_softc *sc; + struct amdviiommu_softc *sc; sc = device_get_softc(dev); @@ -176,5 +176,5 @@ ivhd_teardown_intr(device_t dev) } /* This driver has to be loaded before ivhd */ -DRIVER_MODULE(amdiommu, pci, amdiommu_driver, 0, 0); -MODULE_DEPEND(amdiommu, pci, 1, 1, 1); +DRIVER_MODULE(amdviiommu, pci, amdviiommu_driver, 0, 0); +MODULE_DEPEND(amdviiommu, pci, 1, 1, 1); diff --git a/sys/modules/vmm/Makefile b/sys/modules/vmm/Makefile index 47504a053c34..15454b345934 100644 --- a/sys/modules/vmm/Makefile +++ b/sys/modules/vmm/Makefile @@ -107,7 +107,7 @@ SRCS+= ept.c \ # amd-specific files .PATH: ${SRCTOP}/sys/amd64/vmm/amd SRCS+= vmcb.c \ - amdiommu.c \ + amdviiommu.c \ ivhd_if.c \ ivhd_if.h \ svm.c \ From nobody Mon Nov 4 14:56:33 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhvgP4hDWz5c9jv; Mon, 04 Nov 2024 14:56: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhvgP468jz4YLh; Mon, 4 Nov 2024 14:56:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730732193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7hnViQkUEXHuDu0Au1ayuRAkCcRVmqb5AQWMUzMdr8Q=; b=U6CA9sRnT2vOjhrAfxGuu67F51U0Z8mezYtIPhLrb8sHjntA12+tIbTo04FY1YYmP5wqBs xTvdBcYYDkNtsQ9pNQvqmZuGUZ6nMJgJG6j75q8RM+6reclQAPiQZKcNDIvGC1QTfgHleQ guaL3K+86bLV6Uj1Pn4TtdvTVBa8aNlT/eizcIVc9ewRuyQRKFsUJPfyCS5OUd+gm14tUZ a+y4IRF4LICYuEDgEkjNejI0wmv02ZA/nRUw5q2RHlWTssbN1nRzh2QZzy1X1eqy7Qcz1O eM3xIaaj4hjFLl0cpQ3SFze+bm8aJVXxr3+loRpjxNbJRtbTJcm9EOq30mPIKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730732193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7hnViQkUEXHuDu0Au1ayuRAkCcRVmqb5AQWMUzMdr8Q=; b=HplrE9KxpAVoFz0cH75VpDFCfXmWmhNMDOk98Ds+XOXUqrutSQXDtwserBdMyJXGLjS0Up 9TyZ49/jqF/N+qqgfW0GQg9bzPWHAII/ZXAZA+pPBAE04SB0DAqW/OqeE8hI6z62I0z/5F 3WnQeW8EuMoubPIaXB19v1TJrfOJ/z8uRMVS9SRW2ecnDBR9oMnnZ4uclZHkUaz7qnCtId 8d+hD3DD8EJgKoqOfjoc5LGmOpaG60cIfzLgGNOk9duMEkMY9s9RvDAHR3XFyEottpS0x/ apwmh1A/t9BEi+VO3rOJFDThp11m3lrxp+6D2moJPIPKLcZ1fO05rdp8Gxmukg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730732193; a=rsa-sha256; cv=none; b=maEDCCzMaK/yKtfq+R44vGrhxWb7ABZQZPve9SSy9sLHs1ULJmjZEuKn3uKsXJvytpSQC2 TAMKRXQ9gLeMxAWaZzYVXOUDpwkwkfac0RgZp02YvdTjNdTQm4bYp3wDvXnUHyyG42ygd2 Hd+2x3eFWGbEPjJlJ7+o3B1GRpB/maL5hhSM8F358HZN590QVABgz5zbtJF4BmnRWKZlfT +nK4V5E+OMSFBw5DwCy4q+gefLDJ4oPXjCXO/4N/bThyDMTW3OGb/Hr6d6PnrOCqx0LD5K CmAdKPN70KozSF6SK/IsJzcRPzv0sIPGbGnpzoa/GDvFchScwqxqczTUj4DhTA== 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 4XhvgP3cp1zdQC; Mon, 4 Nov 2024 14:56:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A4EuX6I059672; Mon, 4 Nov 2024 14:56:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4EuXKm059669; Mon, 4 Nov 2024 14:56:33 GMT (envelope-from git) Date: Mon, 4 Nov 2024 14:56:33 GMT Message-Id: <202411041456.4A4EuXKm059669@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 349d1366edd2 - main - socket: Export the FIB number of sockets List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 349d1366edd23af0059e1798f436089e861d934f Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=349d1366edd23af0059e1798f436089e861d934f commit 349d1366edd23af0059e1798f436089e861d934f Author: Mark Johnston AuthorDate: 2024-11-04 14:39:48 +0000 Commit: Mark Johnston CommitDate: 2024-11-04 14:56:19 +0000 socket: Export the FIB number of sockets Reviewed by: zlei MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D47315 --- sys/kern/uipc_socket.c | 1 + sys/sys/socketvar.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index a139a9d1f301..d8878505d511 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -5033,6 +5033,7 @@ sotoxsocket(struct socket *so, struct xsocket *xso) xso->so_uid = so->so_cred->cr_uid; xso->so_pgid = so->so_sigio ? so->so_sigio->sio_pgid : 0; SOCK_LOCK(so); + xso->so_fibnum = so->so_fibnum; if (SOLISTENING(so)) { xso->so_qlen = so->sol_qlen; xso->so_incqlen = so->sol_incqlen; diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 40464f555816..fda8d23f5649 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -615,7 +615,8 @@ struct xsocket { uint32_t so_qlimit; pid_t so_pgid; uid_t so_uid; - int32_t so_spare32[8]; + int32_t so_fibnum; + int32_t so_spare32[7]; int16_t so_type; int16_t so_options; int16_t so_linger; From nobody Mon Nov 4 14:56:34 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhvgQ5qWdz5c9jx; Mon, 04 Nov 2024 14:56:34 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhvgQ5CK0z4YCV; Mon, 4 Nov 2024 14:56:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730732194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tdKhLexhWltEnK4kJV/yUNoh5FFEfnlyVRzGm6fJ118=; b=uJ9u9ifPXpzxxZK0mhhN+9iRXnNsD3FTUhb0oiVYlk+TTmcMY3C/DC+0HrgEs6XWDHSJoO AuHsqwnmoBETk+XTuP5iLwdTw/T6E+7b2OCzdd65MGCgFYR5bci0qpOXg3uL2TtZBr/DFf cld+EJqVPSy8rmfktDV5/zSAirsP0vsiR58RWKbmtgiLohI/VWKKTHpvwplyLifpBoF8yB xs8qvHE1UDkDnZCJbqXvjWMt1BAPqk8W0xdtgPeGtKZR0YkhX5VeIfSLBtBvP+ab0VBpcB pmTK+chVH7G3w1JuuxPPg8nG9gfSndlv/1XpgnMx+RNgn5lgleaDbJvI4f/5Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730732194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tdKhLexhWltEnK4kJV/yUNoh5FFEfnlyVRzGm6fJ118=; b=TWOETtnORNwgwWYyp9U31UxDIdd0bh1hWNhjya4SuyTC1I2tPLD0+88SfBJ3Wfld63asHg un/Vh+mcFucHcRduBde53BBxEXTecP7UkPNSQUfdovx987h340t5SWGbYIXYCdcDsJ4YNI X4sN+6Z5JYh53X8IxHWPc3r8OxMI7W9N+1rZCsNr0kjuI77I77ipKx0AeSaTFapmEfTZHT fU8ItAm58ewIzXkSjgtl47nqVifp/yRDwwxtkqg24u07K/Zq3zOjvZwA/ILkY6uOfcF2nf ugaxXWzXSb74SGEq8LiKQ/JaBSgmi2kAU6GZHKsKJABA2lRBO8YbPu5AHPbOrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730732194; a=rsa-sha256; cv=none; b=kRl1p56j1OIZ2owqUAyqQ7zFNzJMjBQsCZ706PFV8NvEyvw9k+eiSc0sgVAkgBLNdwSlaO 0/MqR6yUOCQGGG6M3ReGufnHnKrH3OSHSsp18tZarUoNIxZ2IUdBaC3f6HltWrfHxfCWcp CA3HRUKfIqN2Pa6++AhNhULZKjEPyst2oH6oCSXpYgLRUODm7vT5DvYT3WC9ys3P/vZGb/ 27k5fFWbB/ektxWCLuQLcwCOjvRc0/FUDQMG3aWPBa2US+VrR9H797aXls5IS3j0HsaHpL xiJXdbQSDChZmdGAC40JRkXNi5+4tmSne0m1myAGTiPyovlbtAadiTFWr1HuvQ== 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 4XhvgQ4fNkzdbN; Mon, 4 Nov 2024 14:56:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A4EuYdS059744; Mon, 4 Nov 2024 14:56:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4EuYv3059741; Mon, 4 Nov 2024 14:56:34 GMT (envelope-from git) Date: Mon, 4 Nov 2024 14:56:34 GMT Message-Id: <202411041456.4A4EuYv3059741@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: a471d2b401c9 - main - sockstat: Add a -f option to show FIB numbers of sockets List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: a471d2b401c9b2d3a95d9139c9a6b123f686a8e9 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a471d2b401c9b2d3a95d9139c9a6b123f686a8e9 commit a471d2b401c9b2d3a95d9139c9a6b123f686a8e9 Author: Mark Johnston AuthorDate: 2024-11-04 14:40:30 +0000 Commit: Mark Johnston CommitDate: 2024-11-04 14:56:19 +0000 sockstat: Add a -f option to show FIB numbers of sockets Reviewed by: zlei MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D47316 --- usr.bin/sockstat/sockstat.1 | 7 +++++-- usr.bin/sockstat/sockstat.c | 22 ++++++++++++++++++---- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/usr.bin/sockstat/sockstat.1 b/usr.bin/sockstat/sockstat.1 index d7174b48f8d5..ca486a088b13 100644 --- a/usr.bin/sockstat/sockstat.1 +++ b/usr.bin/sockstat/sockstat.1 @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd July 9, 2024 +.Dd October 15, 2024 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd list open sockets .Sh SYNOPSIS .Nm -.Op Fl 46CcIiLlnqSsUuvw +.Op Fl 46CcfIiLlnqSsUuvw .Op Fl j Ar jail .Op Fl p Ar ports .Op Fl P Ar protocols @@ -59,6 +59,8 @@ Display the congestion control module, if applicable. This is currently only implemented for TCP. .It Fl c Show connected sockets. +.It Fl f +Show the FIB number of each socket. .It Fl I Show the local address of the socket to which the current socket is spliced, if any. @@ -228,6 +230,7 @@ $ sockstat -6 -P tcp .Xr fstat 1 , .Xr netstat 1 , .Xr procstat 1 , +.Xr setfib 1 , .Xr inet 4 , .Xr inet6 4 , .Xr protocols 5 diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c index d2581d9f042e..b18c56ca6f88 100644 --- a/usr.bin/sockstat/sockstat.c +++ b/usr.bin/sockstat/sockstat.c @@ -82,6 +82,7 @@ static int opt_4; /* Show IPv4 sockets */ static int opt_6; /* Show IPv6 sockets */ static int opt_C; /* Show congestion control */ static int opt_c; /* Show connected sockets */ +static int opt_f; /* Show FIB numbers */ static int opt_I; /* Show spliced socket addresses */ static int opt_i; /* Show inp_gencnt */ static int opt_j; /* Show specified jail */ @@ -140,6 +141,7 @@ struct sock { int family; int proto; int state; + int fibnum; const char *protoname; char stack[TCP_FUNCTION_NAME_LEN_MAX]; char cc[TCP_CA_NAME_MAX]; @@ -771,6 +773,7 @@ gather_inet(int proto) sock->splice_socket = so->so_splice_so; sock->proto = proto; sock->inp_gencnt = xip->inp_gencnt; + sock->fibnum = so->so_fibnum; if (xip->inp_vflag & INP_IPV4) { sock->family = AF_INET; sockaddr(&laddr->address, sock->family, @@ -1204,6 +1207,12 @@ displaysock(struct sock *s, int pos) default: abort(); } + if (opt_f) { + while (pos < offset) + pos += xprintf(" "); + pos += xprintf("%d", s->fibnum); + offset += 7; + } if (opt_I) { if (s->splice_socket != 0) { struct sock *sp; @@ -1329,6 +1338,9 @@ display(void) "USER", "COMMAND", "PID", "FD", "PROTO", opt_w ? 45 : 21, "LOCAL ADDRESS", opt_w ? 45 : 21, "FOREIGN ADDRESS"); + if (opt_f) + /* RT_MAXFIBS is 65535. */ + printf(" %-6s", "FIB"); if (opt_I) printf(" %-*s", opt_w ? 45 : 21, "SPLICE ADDRESS"); if (opt_i) @@ -1453,9 +1465,8 @@ jail_getvnet(int jid) static void usage(void) { - fprintf(stderr, - "usage: sockstat [-46CcIiLlnqSsUuvw] [-j jid] [-p ports] [-P protocols]\n"); - exit(1); + errx(1, + "usage: sockstat [-46CcfIiLlnqSsUuvw] [-j jid] [-p ports] [-P protocols]"); } int @@ -1469,7 +1480,7 @@ main(int argc, char *argv[]) int o, i; opt_j = -1; - while ((o = getopt(argc, argv, "46CcIij:Llnp:P:qSsUuvw")) != -1) + while ((o = getopt(argc, argv, "46CcfIij:Llnp:P:qSsUuvw")) != -1) switch (o) { case '4': opt_4 = 1; @@ -1483,6 +1494,9 @@ main(int argc, char *argv[]) case 'c': opt_c = 1; break; + case 'f': + opt_f = 1; + break; case 'I': opt_I = 1; break; From nobody Mon Nov 4 15:01:54 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhvnZ6K30z5cBL8; Mon, 04 Nov 2024 15:01: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhvnZ5tSMz4ZVS; Mon, 4 Nov 2024 15:01:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730732514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hdjE5/WoVwNYjUCGbG3uUlHw6V/vMEl/CYuVqNK6FB8=; b=FOeHaVk9i0V/j1Fr/6m4qN/tNU9ZuyD5iaGbzPtweRemw0ZRXIPLfpW7mBE1UiCjNric9P gifht+FNg5D88SwDOfh9ll2259KummclxNtmleBfVOTTYIKUqMzdT9e2DWgT3lM50M44qH 9KpWzEWpmR19KPHKSy64k05452qt7B5siuoVkynyy1Ymh30m58BTQJnXhp+OWEBhCp4kuK qwZJ+r9szH42Vmf/n9/pETaJjH653o2/wds3G+Qagf677cKES4wxs8RCLGHzPqoYnRTAWW 4c0m3IMawH0CyTUFop0k60SYj5nUxk6e7yjokH3d+fXKQ2YvpRrYLp2/51cWjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730732514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hdjE5/WoVwNYjUCGbG3uUlHw6V/vMEl/CYuVqNK6FB8=; b=irwxwzqLDjGQcfqaef2xwo6ofPLAEtdRqCvw1qBxhU+drXvhha76n1ZznqoO3wVBSSje1y AEFbf5JWubRERCFNAZe90STQY3caMIQOVMJaGFwPnsh4pVPRYDb/R9lssDGbNdoEpltor2 PkJC3TsgvK5q1aaGBnstqxBulT49m/zaCyLgbsw3eVU9Pjt26X6B5js8MR/ZOtNmIYw6ZB nrbX+uYNsPDj1w0B1W1DVPgb2y8lHHaWfB16srJUzMNQwLFam1PCNe0Szdh1H3ypHsRPfK pEN47d3FwrDULEJH3sxw2odBvfHRAXIVhtyHJgdimZyA6FOBpFp2MCj6jrf61Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730732514; a=rsa-sha256; cv=none; b=cVHKSfjiItX+GZs9pldyMUfoDiHz8smXH+9naaNVJldoEDqO8LNBO6nd8sHMPLALoggXL/ TUjrJx+dEO1EEjjBxMJjvQlHNkv3UQ+i/uQW64kvErgsG5QF1XrGXw5UAifyHaky6RAoKY zW1RMmxq/IrXY5WuEWEIEFP+9PRG65B+uhsyazZWRKlfSniFZ+GB7nNzDlYmRF6393GSoX e+Ps60t32DqKUEDJJEiNfNUaYu8GGs/j3UsVOf6iuArCLegTDtcwImVpveLvAd+Kg2FQcS 0iB+wbmwvGZmC0yGS6T3OeHIyEC4peVYrryUvtDOGWRWczBCDXcJBuYr6rCRMg== 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 4XhvnZ53p8zdDj; Mon, 4 Nov 2024 15:01:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A4F1sdo078290; Mon, 4 Nov 2024 15:01:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4F1swx078287; Mon, 4 Nov 2024 15:01:54 GMT (envelope-from git) Date: Mon, 4 Nov 2024 15:01:54 GMT Message-Id: <202411041501.4A4F1swx078287@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 6e5650896fe4 - main - ice(4): properly use kernel option RSS List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 6e5650896fe47398e49e3d81af60cc60dbb09e6e Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=6e5650896fe47398e49e3d81af60cc60dbb09e6e commit 6e5650896fe47398e49e3d81af60cc60dbb09e6e Author: Brian Poole AuthorDate: 2024-10-11 19:57:52 +0000 Commit: Mitchell Horne CommitDate: 2024-11-04 15:01:37 +0000 ice(4): properly use kernel option RSS Header ice_rss.h uses the kernel RSS interface if option RSS is defined. However when ice_rss.h is included by ice_lib.h there is no prior inclusion of ice_opts.h to set RSS causing ifdef RSS to always fail. Add ice_opts.h to the top of ice_lib.h (like ice_iflib.h) so RSS can be defined when ice_rss.h is parsed. With that in place, compilation fails due to a missing defintion of ICE_DEFAULT_RSS_HASH_CONFIG. It is defined in ice_rss.h only when RSS is not defined. Since this define is not part of the kernel RSS interface but ice-specific, it should always be defined. Move its definition outside of ifdef RSS. PR: 255309 Reviewed by: mhorne, erj (earlier version) MFC after: 3 days Pull Request: https://github.com/freebsd/freebsd-src/pull/1460 --- sys/dev/ice/ice_lib.h | 3 +++ sys/dev/ice/ice_rss.h | 16 ++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/sys/dev/ice/ice_lib.h b/sys/dev/ice/ice_lib.h index 466cb8701b79..b6b23ec82161 100644 --- a/sys/dev/ice/ice_lib.h +++ b/sys/dev/ice/ice_lib.h @@ -40,6 +40,9 @@ #ifndef _ICE_LIB_H_ #define _ICE_LIB_H_ +/* include kernel options first */ +#include "ice_opts.h" + #include #include #include diff --git a/sys/dev/ice/ice_rss.h b/sys/dev/ice/ice_rss.h index ede1fad5abe7..df485f4b1f5a 100644 --- a/sys/dev/ice/ice_rss.h +++ b/sys/dev/ice/ice_rss.h @@ -68,14 +68,6 @@ CTASSERT(ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE >= RSS_KEYSIZE); #define RSS_HASHTYPE_RSS_UDP_IPV6 (1 << 9) /* IPv6 UDP 4-tuple */ #define RSS_HASHTYPE_RSS_UDP_IPV6_EX (1 << 10) /* IPv6 UDP 4-tuple + ext hdrs */ -#define ICE_DEFAULT_RSS_HASH_CONFIG \ - ((u_int)(RSS_HASHTYPE_RSS_IPV4 | \ - RSS_HASHTYPE_RSS_TCP_IPV4 | \ - RSS_HASHTYPE_RSS_UDP_IPV4 | \ - RSS_HASHTYPE_RSS_IPV6 | \ - RSS_HASHTYPE_RSS_TCP_IPV6 | \ - RSS_HASHTYPE_RSS_UDP_IPV6)) - #define rss_getkey(key) ice_get_default_rss_key(key) #define rss_getnumbuckets() (mp_ncpus) #define rss_get_indirection_to_bucket(index) (index) @@ -113,4 +105,12 @@ rss_hash2bucket(uint32_t hash_val, uint32_t hash_type, uint32_t *bucket_id) #endif /* !RSS */ +#define ICE_DEFAULT_RSS_HASH_CONFIG \ + ((u_int)(RSS_HASHTYPE_RSS_IPV4 | \ + RSS_HASHTYPE_RSS_TCP_IPV4 | \ + RSS_HASHTYPE_RSS_UDP_IPV4 | \ + RSS_HASHTYPE_RSS_IPV6 | \ + RSS_HASHTYPE_RSS_TCP_IPV6 | \ + RSS_HASHTYPE_RSS_UDP_IPV6)) + #endif /* _ICE_COMMON_COMPAT_H_ */ From nobody Mon Nov 4 15:19:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xhw9p1mpzz5cCbf; Mon, 04 Nov 2024 15:19: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xhw9p1JCBz4dYR; Mon, 4 Nov 2024 15:19:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730733566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/1AxSPINhTfRAYONU6+u9OzkgNfJEWqpyary1e6/lPs=; b=vbELzQRagYl7jegwBq/jUU3W9PVZ2IukKt2t8MSLAYR5DvCOS0Lx/u9lyVD1KtzTx1Hbxg BBf9oKCf+lHUOX2E+AUPT2qBayR+183KiJmai3PMX8kSB/MOa58aCpqzHTjyhWOnq9t4Az 6kkgQwXQyqmhRwmnVIhTw7aUh4TDCQTi8nZmRraJ+xLmrjEXmqwqGRO1dLv0WhK6Z66kAg F/MnessEod9eNPC5/zpHJl9YdYBHL+efx6wm32UKBs6cd6mvmngWUp5kpVmaz3q7L7pgmb cVLIoDktkR9yBF1kTuvGzPjEN2oSO51gttkBofdY6mV0lhBHj/xvxvrwoUsjUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730733566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/1AxSPINhTfRAYONU6+u9OzkgNfJEWqpyary1e6/lPs=; b=uB+a3VtyfGbFuuK9AMwR9UPnqykKLMEmDCv+SirKQx+Vll8oWPhhz9PYfhw8L+ifD4CdzE erjFKnODVbEoAaT9Tf/fxU9c7TidPbNCV282fenQm2ZlHrBB1GF1gwHDowx2ok6bVko17O 80nRRzFOTlXwQeMfKvxl2QNyWhY2RsW6B5Dj08WtcQdPKtKWC9KX+91329C6BXEaVMFxwu g5XlY53T2dBkyGoWDxkBJXyB8KpksNVP8RZRgdSUeMJWVMcXwb5oObKFJtcC+tV3Q2ZVwt gqx8/sasL5PO+xR8TZ4+IMadynER0x/9OHsQJuAWCImYAXB6ZOf6tuGO+k8GcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730733566; a=rsa-sha256; cv=none; b=Qy8JPxHcReerJo268spP2Acazq56T7PVQxFc1M48FhSksIXR+0o5npkhJq3fFoD6rNOkRB rgh0jjAsiMWjaHXD3p/2RYdFz4RlqT6pL+piWd0dke+9veCBADIS2IbLEL2xnOOFyspE2n gWjZ1/OTMwd3eCBCDXTp1Fr6CLnvnj33aHKkGIHgj5a/ADGx8iSlGw3icweq11kyrXdj+s YMbqlWyjQqlyWQ+rUAvlF8uSISznpN3+2FxHeBTxf4Sy1GbPqjufZRs10l+PG0eRcrCpwl IZ4qPE92YllTw55n2AkVHIqVg76AepRUbsCfOmQzYdSCcP4GiWDNdBEUuYEyFg== 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 4Xhw9p0vRnzdxN; Mon, 4 Nov 2024 15:19:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A4FJQM7098587; Mon, 4 Nov 2024 15:19:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4FJQKW098584; Mon, 4 Nov 2024 15:19:26 GMT (envelope-from git) Date: Mon, 4 Nov 2024 15:19:26 GMT Message-Id: <202411041519.4A4FJQKW098584@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 9ca328626400 - main - pf: fix build on kernels without "options INET" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 9ca3286264006d196eeb4a284ca837ca84207a3d Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9ca3286264006d196eeb4a284ca837ca84207a3d commit 9ca3286264006d196eeb4a284ca837ca84207a3d Author: Lexi Winter AuthorDate: 2024-11-03 16:05:05 +0000 Commit: Kristof Provost CommitDate: 2024-11-04 14:17:19 +0000 pf: fix build on kernels without "options INET" - IN_LOOPBACK() cannot be used without INET, because it references a VNET symbol vnet_entry_in_loopback_mask. - ip_fillid() is not available without INET. since this codepath is only entered in the AF_INET case, guard it with #ifnet INET. Fixes: 27f54be50bbad ("pf: merge pf_test() and pf_test6()") Fixes: 4f9e688708f1b ("pf: merge pf_scrub_ip() and pf_scrub_ip6()") Reviewed by: kp --- sys/netpfil/pf/pf.c | 2 ++ sys/netpfil/pf/pf_norm.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 17614e1a9995..90ec2b1ed033 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -576,8 +576,10 @@ static bool pf_is_loopback(sa_family_t af, struct pf_addr *addr) { switch (af) { +#ifdef INET case AF_INET: return IN_LOOPBACK(ntohl(addr->v4.s_addr)); +#endif case AF_INET6: return IN6_IS_ADDR_LOOPBACK(&addr->v6); default: diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 860580812e3b..8779d599900e 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -2224,6 +2224,7 @@ pf_scrub(struct pf_pdesc *pd) } /* random-id, but not for fragments */ +#ifdef INET if (pd->af == AF_INET && pd->act.flags & PFSTATE_RANDOMID && !(h->ip_off & ~htons(IP_DF))) { uint16_t ip_id = h->ip_id; @@ -2231,5 +2232,6 @@ pf_scrub(struct pf_pdesc *pd) ip_fillid(h); h->ip_sum = pf_cksum_fixup(h->ip_sum, ip_id, h->ip_id, 0); } +#endif } #endif From nobody Mon Nov 4 15:26:19 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhwKl2NkGz5cCZ4; Mon, 04 Nov 2024 15:26: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhwKl1v23z4fRd; Mon, 4 Nov 2024 15:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730733979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zcMbbvdxF7iY/iE7r2OJ5xxpHt8GC9MzcXgPptGgGYY=; b=r5vJyTHhjsxzKOmKlFisnsg3Lo8hAot7efKAsMs6//2+l+873kJXwQ7IT0ptI1Qe0dPNsL drTBTN0bpf5OJNlBKQO/+nPptbM6/Qssa7dIMLRXrxrxxdpa1uS9Myw2xkOnOde1wE9Aix FUS4nZRRPFxtkEphhssSv9p5GtFZY+2UYA3vZEG5VIKq7533cLCEgPW9qcuZa4T/TZ12Rr tUUiFtMwkPkWtxy7PXoU4V1MpUJOz6NYCFSlBV0rEfMN04P/g0E5M2+7Bed6smrAT/yKwq wM1feVj7ZE7wtxIObff/3EAmqUqJFh5IqFTrGXdImuuuwZSMmW/R91n5lzYgnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730733979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zcMbbvdxF7iY/iE7r2OJ5xxpHt8GC9MzcXgPptGgGYY=; b=ZQ+O+aOMGysmhijh37chce0xorCmycHK4VgRfKlQQlf6nkpY+2vTVMJ+8H3ws/zgPmdxl+ OnXNko4gX7NsHNPiHcJakUg/rd435vJzGv1v1mcXFivuuc6vzy1gHDMWRKtYLPh3JS17Os X0Fduy6W9Ng/at9AZ/q3Y+gGd6FD1De4hGXyaDjc6Aveov+P5fFANm3oqVJwJ94BjXHOFs SCDmapYJ4MhhnteRh/h3Sf8o7a+Ed2HwO//hr4KRBKbtEs9aggjoZsAXr1sCs/wnySNeDk 2yay54fYlM2qSVlQG3NqkeUZIvzRAYh2YQL/min/SxCau5J6geajswg2Mq1byQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730733979; a=rsa-sha256; cv=none; b=nfVBFryo69iqCdycC5QVXoSxTllpTeVevgywyxhwja9THhB0BmoOu/QclCEvsaqv1VD7Sp t6hLobGIgzyDNSp2JVIGLDFV11eabUXM85teHVhF5jc1xS2qWYKA0gD3oer19bBxS6uEJ0 kWRCA9J4wPNhv+PQ8NtZkS4EqLUljawkoQGHv4UKr0diUY+19fHDSj4/Gy2/LerUKY4G2T lEb23stPL92r98cvLrF9C4G2HciKWXTlVsHZ1xncAPGb8bcHGC+HVMeFFEilViXyAmwfxx Es1EvCLYczH3SX9LCL09aAkoTpNqiOY/nkJDiKW6X3MofgRJvX0BE8NDiW17Tg== 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 4XhwKl1Tn9zdqF; Mon, 4 Nov 2024 15:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A4FQJoZ016056; Mon, 4 Nov 2024 15:26:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4FQJJ0016053; Mon, 4 Nov 2024 15:26:19 GMT (envelope-from git) Date: Mon, 4 Nov 2024 15:26:19 GMT Message-Id: <202411041526.4A4FQJJ0016053@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: c7c3ef894902 - main - manuals: Remove trailing spaces List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: c7c3ef8949021696029fb73a513678578a9f8a46 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=c7c3ef8949021696029fb73a513678578a9f8a46 commit c7c3ef8949021696029fb73a513678578a9f8a46 Author: Graham Percival AuthorDate: 2024-11-02 03:24:19 +0000 Commit: Mitchell Horne CommitDate: 2024-11-04 15:26:14 +0000 manuals: Remove trailing spaces This does not change the rendered ascii at all. Signed-off-by: Graham Percival Reviewed by: mhorne, Alexander Ziaee MFC after: 3 days Sponsored by: Tarsnap Backup Inc. Pull Request: https://github.com/freebsd/freebsd-src/pull/1473 --- lib/libbe/libbe.3 | 2 +- lib/libc/net/inet.3 | 2 +- sbin/mount/mntopts.3 | 2 +- sbin/nvmecontrol/nvmecontrol.8 | 2 +- secure/lib/libcrypto/man/man3/OSSL_DECODER_CTX.3 | 4 ++-- secure/lib/libcrypto/man/man3/SSL_set_retry_verify.3 | 2 +- secure/lib/libcrypto/man/man3/X509_LOOKUP.3 | 2 +- secure/usr.bin/openssl/man/openssl-speed.1 | 2 +- share/man/man3/bitstring.3 | 2 +- share/man/man3/pthread_condattr.3 | 2 +- share/man/man4/u3g.4 | 2 +- share/man/man8/debug.sh.8 | 2 +- share/man/man9/bitset.9 | 2 +- share/man/man9/mod_cc.9 | 2 +- stand/man/loader.efi.8 | 2 +- usr.sbin/i2c/i2c.8 | 2 +- usr.sbin/jail/jail.8 | 2 +- usr.sbin/newsyslog/newsyslog.conf.5 | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/libbe/libbe.3 b/lib/libbe/libbe.3 index eb0e9a34bb5e..4d9439206b7b 100644 --- a/lib/libbe/libbe.3 +++ b/lib/libbe/libbe.3 @@ -585,5 +585,5 @@ as mentor. .Sh AUTHORS Kyle Kneitinger, mentored as above. .Pp -Post-GSoC changes were written by +Post-GSoC changes were written by .An Kyle Evans (kevans) Aq Mt kevans@freebsd.org . diff --git a/lib/libc/net/inet.3 b/lib/libc/net/inet.3 index 7b1a5fcc8ede..9b822fd6805a 100644 --- a/lib/libc/net/inet.3 +++ b/lib/libc/net/inet.3 @@ -175,7 +175,7 @@ All network numbers and local address parts are returned as machine byte order integer values. .Sh INTERNET ADDRESSES (IP VERSION 4) The -.Fn inet_aton +.Fn inet_aton and .Fn inet_addr functions accept IPv4 diff --git a/sbin/mount/mntopts.3 b/sbin/mount/mntopts.3 index 2480be2bdc9e..74fca612479f 100644 --- a/sbin/mount/mntopts.3 +++ b/sbin/mount/mntopts.3 @@ -204,7 +204,7 @@ If no mount is found, NULL is returned. .Pp The .Fn chkdoreload -function takes a pointer to a +function takes a pointer to a .Vt "struct statfs" . If the filesystem associated with the mount point is mounted read-only, .Fn chkdoreload diff --git a/sbin/nvmecontrol/nvmecontrol.8 b/sbin/nvmecontrol/nvmecontrol.8 index 76c79778021d..e21079b17ed6 100644 --- a/sbin/nvmecontrol/nvmecontrol.8 +++ b/sbin/nvmecontrol/nvmecontrol.8 @@ -822,7 +822,7 @@ for the .Cm connect command. .Ss telemetry-log -Extract the telemetry log associated with +Extract the telemetry log associated with .Ar device-id , using the specified parameters: .Bl -tag -width 6n diff --git a/secure/lib/libcrypto/man/man3/OSSL_DECODER_CTX.3 b/secure/lib/libcrypto/man/man3/OSSL_DECODER_CTX.3 index ba3a05e6902c..f5b730f40096 100644 --- a/secure/lib/libcrypto/man/man3/OSSL_DECODER_CTX.3 +++ b/secure/lib/libcrypto/man/man3/OSSL_DECODER_CTX.3 @@ -182,8 +182,8 @@ OSSL_DECODER_INSTANCE_get_input_structure \& int OSSL_DECODER_CTX_set_input_structure(OSSL_DECODER_CTX *ctx, \& const char *input_structure); \& int OSSL_DECODER_CTX_add_decoder(OSSL_DECODER_CTX *ctx, OSSL_DECODER *decoder); -\& int OSSL_DECODER_CTX_add_extra(OSSL_DECODER_CTX *ctx, -\& OSSL_LIB_CTX *libctx, +\& int OSSL_DECODER_CTX_add_extra(OSSL_DECODER_CTX *ctx, +\& OSSL_LIB_CTX *libctx, \& const char *propq); \& int OSSL_DECODER_CTX_get_num_decoders(OSSL_DECODER_CTX *ctx); \& diff --git a/secure/lib/libcrypto/man/man3/SSL_set_retry_verify.3 b/secure/lib/libcrypto/man/man3/SSL_set_retry_verify.3 index fcc1c53cb096..489a4ff5423e 100644 --- a/secure/lib/libcrypto/man/man3/SSL_set_retry_verify.3 +++ b/secure/lib/libcrypto/man/man3/SSL_set_retry_verify.3 @@ -172,7 +172,7 @@ with the \fBX509_STORE_CTX\fR to call the \fBSSL_set_retry_verify()\fR function: \& \& /* this should not happen but check anyway */ \& if (idx < 0 -\& || (ssl = X509_STORE_CTX_get_ex_data(ctx, idx)) == NULL) +\& || (ssl = X509_STORE_CTX_get_ex_data(ctx, idx)) == NULL) \& return 0; \& \& if (/* we need to retry verification callback */) diff --git a/secure/lib/libcrypto/man/man3/X509_LOOKUP.3 b/secure/lib/libcrypto/man/man3/X509_LOOKUP.3 index 0cde28cae042..ce29dfe232c4 100644 --- a/secure/lib/libcrypto/man/man3/X509_LOOKUP.3 +++ b/secure/lib/libcrypto/man/man3/X509_LOOKUP.3 @@ -321,7 +321,7 @@ or \s-1NULL\s0 on error. 0 on error. .PP \&\fBX509_LOOKUP_ctrl()\fR returns \-1 if the \fBX509_LOOKUP\fR doesn't have an -associated \fBX509_LOOKUP_METHOD\fR, or 1 if the +associated \fBX509_LOOKUP_METHOD\fR, or 1 if the doesn't have a control function. Otherwise, it returns what the control function in the \&\fBX509_LOOKUP_METHOD\fR returns, which is usually 1 on success and 0 in diff --git a/secure/usr.bin/openssl/man/openssl-speed.1 b/secure/usr.bin/openssl/man/openssl-speed.1 index c6b04dd01ccd..371ef75579b5 100644 --- a/secure/usr.bin/openssl/man/openssl-speed.1 +++ b/secure/usr.bin/openssl/man/openssl-speed.1 @@ -221,7 +221,7 @@ Run benchmarks for \fInum\fR seconds. .IP "\fB\-bytes\fR \fInum\fR" 4 .IX Item "-bytes num" Run benchmarks on \fInum\fR\-byte buffers. Affects ciphers, digests and the \s-1CSPRNG.\s0 -The limit on the size of the buffer is \s-1INT_MAX\s0 \- 64 bytes, which for a 32\-bit +The limit on the size of the buffer is \s-1INT_MAX\s0 \- 64 bytes, which for a 32\-bit int would be 2147483583 bytes. .IP "\fB\-mr\fR" 4 .IX Item "-mr" diff --git a/share/man/man3/bitstring.3 b/share/man/man3/bitstring.3 index bfc0eb5ca139..07558bd41ec3 100644 --- a/share/man/man3/bitstring.3 +++ b/share/man/man3/bitstring.3 @@ -369,7 +369,7 @@ bits in the array of bits referenced by .Fa name , at or after the zero-based bit index -.Fa start +.Fa start in which all bits have the value .Fa match . If no sequence of contiguous such bits of the specified diff --git a/share/man/man3/pthread_condattr.3 b/share/man/man3/pthread_condattr.3 index f3b1d3639827..96d30263d7f2 100644 --- a/share/man/man3/pthread_condattr.3 +++ b/share/man/man3/pthread_condattr.3 @@ -52,7 +52,7 @@ .Ft int .Fo pthread_condattr_getpshared .Fa "pthread_condattr_t * restrict attr" "int * restrict pshared" -.Fc +.Fc .Ft int .Fn pthread_condattr_setpshared "pthread_condattr_t *attr" "int pshared" .Sh DESCRIPTION diff --git a/share/man/man4/u3g.4 b/share/man/man4/u3g.4 index 234b5a4b3277..4035c8d3a8df 100644 --- a/share/man/man4/u3g.4 +++ b/share/man/man4/u3g.4 @@ -16,7 +16,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd February 4, 2023 +.Dd February 4, 2023 .Dt U3G 4 .Os .Sh NAME diff --git a/share/man/man8/debug.sh.8 b/share/man/man8/debug.sh.8 index 77a1e06cc56a..bf0fdbd6bcf5 100644 --- a/share/man/man8/debug.sh.8 +++ b/share/man/man8/debug.sh.8 @@ -101,7 +101,7 @@ are ignored, they just allow for symmetry with calls to The optional .Ar rc value will be returned rather than the default of 0. -Thus if +Thus if .Fn DebugOff is the last operation in a function, .Ar rc diff --git a/share/man/man9/bitset.9 b/share/man/man9/bitset.9 index a4e360a678d7..b77cfec63e26 100644 --- a/share/man/man9/bitset.9 +++ b/share/man/man9/bitset.9 @@ -193,7 +193,7 @@ These macros are meant to be used in the kernel and are visible if or .In sys/bitset.h are included in a program. -Userland programs must define +Userland programs must define .Dv _WANT_FREEBSD_BITSET before including these files to make the macros visible. .Pp diff --git a/share/man/man9/mod_cc.9 b/share/man/man9/mod_cc.9 index 86d9c7b5312c..09580aa943a9 100644 --- a/share/man/man9/mod_cc.9 +++ b/share/man/man9/mod_cc.9 @@ -370,7 +370,7 @@ LRO system. So for example if LRO pushed three in-order acknowledgements into one acknowledgement the variable would be set to three. .Pp -The +The .Va labc variable is used in conjunction with the CCF_USE_LOCAL_ABC flag to override what labc variable the congestion controller will use diff --git a/stand/man/loader.efi.8 b/stand/man/loader.efi.8 index 736b07d2922d..1417d994478c 100644 --- a/stand/man/loader.efi.8 +++ b/stand/man/loader.efi.8 @@ -360,7 +360,7 @@ installations, setups and situations. In this section, paths that are all lower case are Unix paths. Paths that are all upper case are relative to the ESP mount point, though they may appear as lower case on your system because the -FAT filesystem of the ESP is case insensitive. +FAT filesystem of the ESP is case insensitive. .Pp Locate the ESP, which has its own partition type of .Dq efi : diff --git a/usr.sbin/i2c/i2c.8 b/usr.sbin/i2c/i2c.8 index 3415b614f87d..b5ce8aaea1a4 100644 --- a/usr.sbin/i2c/i2c.8 +++ b/usr.sbin/i2c/i2c.8 @@ -168,7 +168,7 @@ Scan the default bus (/dev/iic0) for devices: .Pp i2c -s .It -Scan the default bus (/dev/iic0) for devices and skip addresses +Scan the default bus (/dev/iic0) for devices and skip addresses 0x45 to 0x47 (inclusive) and 0x56. .Pp i2c -s -n 0x56,45-47 diff --git a/usr.sbin/jail/jail.8 b/usr.sbin/jail/jail.8 index 0dcab757ef24..67f325d15a93 100644 --- a/usr.sbin/jail/jail.8 +++ b/usr.sbin/jail/jail.8 @@ -951,7 +951,7 @@ A list of ZFS datasets to be attached to the jail. This requires .Va allow.mount.zfs to be set. -See +See .Xr zfs-jail 8 for information on how to configure a ZFS dataset to be operated from within a jail. diff --git a/usr.sbin/newsyslog/newsyslog.conf.5 b/usr.sbin/newsyslog/newsyslog.conf.5 index 9f229bc04402..a8ab132edaa8 100644 --- a/usr.sbin/newsyslog/newsyslog.conf.5 +++ b/usr.sbin/newsyslog/newsyslog.conf.5 @@ -305,7 +305,7 @@ flag is mostly useful in conjunction with .Cm B flag to prevent .Xr newsyslog 8 -from inserting an informational +from inserting an informational .Tn ASCII message into the new file. .It Cm G From nobody Mon Nov 4 17:03:07 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhyTR3fT9z5cJKw; Mon, 04 Nov 2024 17:03: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhyTR2ZtCz401b; Mon, 4 Nov 2024 17:03:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730739787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MgJfghUFP0kUBFTVG1WdtnWSmSiDToqUWywwEJLZn04=; b=g44P6MYEDNRPYt1PtM5oJkl4rVXXlbYwZsqRhEqmZe+vA8ixhGA0UAmO/QBhtYL8V4gtLD 9HWutYV0b892wTsTOBnDw8Qpg+fkq1ljairpW9rJJZtljlbQ+TQs/2fpTo3ynyCjWWpr/9 rcPy4k72ufpBzIxdJ/rRKQD+N8LTzVlxHrd5izft+I3dRlRC5CojgxqZWYFFvszxaRZgOk k75RPx8PZ6yzdDm5AZJEOQS8TTi86y18pUNvEZO7/u8ygSPEEPdmPdGmnNKn873pzYuxtK DX8YRNRFeeJsKljRwuwzBOqzt05zXuMfZwOvXGvt6YRg4AhKiXvJus+aHvV7mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730739787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MgJfghUFP0kUBFTVG1WdtnWSmSiDToqUWywwEJLZn04=; b=C7be73W0X1K0o6XaOdc3diwUClXLDASeCt2Lvq0A5NwMkGUhrxg4CUKZ5Ld6LRlT+/yKNG ELcgfZMwGXiA8ctdSK1DXH2okXF+WV9fwzs15651v9O1fyylSyGpM3j59bCijPkOOxQMAx Sl3erjqIU9rvTZIaV6q8B9GcANMgB0Au/PGAePCzyw6dV4fmvhA6p9b4RdAXiCDFc7ds/H 4fFubKowODhzT52sHImdm2BMzsASrWgeO6OxRN+rXAvOpZMYe0rJ8biLaOaNPMjT/wIImq d0FOPCHDoj7v9X2LUG7U4uOn3byzlr0PMSyUcpug2KJvWFet0+x+TkJhfRlFpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730739787; a=rsa-sha256; cv=none; b=uQ4KsVObWq19O2zwYTHWZa4bO1OEizIXJMipkF6ns18Vd5IodWdY4tguW043CFs+NTZFOb oXtnynpkdSoUdSfFY9jiZre5fOFAyQO1BATy5MNGEdO0ghTeRFJpuevR0PFitxInzm+9Se 3aEZJzY83Tvw3GgAyU5kesrYIQ3bAEK3ZKMYG4Obb2slMX8pkO9Q0K1a18lZx6LRWykb2l 0cDeoyVnTCKLQGH2jRHE57lmV3LUrDzaa5Qfw6sm6O163OL/s23fUQ51I3K3B5GiYjgzhi hRQuAbQS8sviLrp2jWrQ1PQ60L/ukvb1oU5RoGeC/agEOL7pS4FO0jRvoRsWqg== 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 4XhyTR2BVhzhhv; Mon, 4 Nov 2024 17:03:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A4H37BQ003335; Mon, 4 Nov 2024 17:03:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4H37xY003332; Mon, 4 Nov 2024 17:03:07 GMT (envelope-from git) Date: Mon, 4 Nov 2024 17:03:07 GMT Message-Id: <202411041703.4A4H37xY003332@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 7e98eae74037 - main - c(7): Utilise proper macros to pass mandoc's linter List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e98eae74037aa7987ca30ea8b7b11bec7d9cc0c Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=7e98eae74037aa7987ca30ea8b7b11bec7d9cc0c commit 7e98eae74037aa7987ca30ea8b7b11bec7d9cc0c Author: Faraz Vahedi AuthorDate: 2024-11-03 09:01:23 +0000 Commit: Brooks Davis CommitDate: 2024-11-04 16:40:35 +0000 c(7): Utilise proper macros to pass mandoc's linter Reviewed by: Graham Percival Pull Request: https://github.com/freebsd/freebsd-src/pull/1507 Signed-off-by: Faraz Vahedi --- share/man/man7/c.7 | 68 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 20 deletions(-) diff --git a/share/man/man7/c.7 b/share/man/man7/c.7 index 97869fe0f8f2..7c180797d296 100644 --- a/share/man/man7/c.7 +++ b/share/man/man7/c.7 @@ -112,9 +112,12 @@ development of the language did not stop. .Pp The ISO C standard was later extended with an amendment as ISO/IEC 9899/AMD1 in 1995. -This contained, for example, the wide-character support in and -, and also restricted character set support via diagraphs and -. +This contained, for example, the wide-character support in +.In wchar.h +and +.In wctype.h , +and also restricted character set support via diagraphs and +.In iso646.h . This amendment is usually referred to as C95. Two technical corrigenda were also published: Technical Corrigendum 1 as ISO/IEC 9899/COR1 in 1994 and Technical Corrigendum 2 as ISO/IEC 9899/COR2 @@ -130,18 +133,23 @@ The improvements include (but are not limited to) the following: .Bl -bullet -offset indent .It digraphs, trigraphs, and alternative spellings for the operators that -use non-ISO646 characters in +use non-ISO646 characters in +.In iso646.h .It -extended multibyte and wide character library support in and - +extended multibyte and wide character library support in +.In wchar.h +and +.In wctype.h .It variable length arrays .It flexible array members .It -complex (and imaginary) number arithmetic support in +complex (and imaginary) number arithmetic support in +.In complex.h .It -type-generic math macros in +type-generic math macros in +.In tgmath.h .It the long long int type and library functions .It @@ -157,15 +165,24 @@ BCPL style single-line comments .It allow mixed declarations and code .It -the vscanf family of functions in and +the +.Fn vscanf +family of functions in +.In stdio.h +and +.In wchar.h .It allow trailing comma in enum declaration .It inline functions .It -the snprintf family of functions in +the +.Fn snprintf +family of functions in +.In stdio.h .It -boolean type and macros in +boolean type and macros in +.In stdbool.h .It empty macro arguments .It @@ -173,7 +190,8 @@ _Pragma preprocessing operator .It __func__ predefined identifier .It -va_copy macro in +va_copy macro in +.In stdarg.h .It additional strftime conversion specifiers .El @@ -185,24 +203,34 @@ and ISO/IEC 9899:1999/COR3:2007. The improvements include (but are not limited to) the following: .Bl -bullet -offset indent .It -support for multiple threads of execution and atomic operations in -and +support for multiple threads of execution and atomic operations in +.In threads.h +and +.In stdatomic.h .It -additional floating-point characteristic macros in +additional floating-point characteristic macros in +.In float.h .It -querying and specifying alignment of objects in and +querying and specifying alignment of objects in +.In stdalign.h +and +.In stdlib.h .It -Unicode character types and functions in +Unicode character types and functions in +.In uchar.h .It type-generic expressions .It -static assertions in +static assertions in +.In assert.h .It anonymous structures and unions .It -remove the gets function from +remove the gets function from +.In stdio.h .It -add the aligned_alloc, at_quick_exit, and quick_exit functions in +add the aligned_alloc, at_quick_exit, and quick_exit functions in +.In stdlib.h .El .Pp C11 was later superseded by ISO/IEC 9899:2018, also known as C17 which was From nobody Mon Nov 4 17:03:08 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhyTS5M0Zz5cKN7; Mon, 04 Nov 2024 17: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhyTS3lXGz400Q; Mon, 4 Nov 2024 17:03:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730739788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rV0eUhE0VHo3K1TxMeR1XsOxEM1VvzAkQXhsVh9EwrU=; b=LjIN2hwMJHOrZqKyp9PCiC+/IdCzoCxHFkKqc2riJk55WBYXkCx6ZhYBzvzYgd1OYuPy3P b+B0ZKapBbTTSISj1HNTcaastk6aN072OaItrAIlTc5zD+qNvATeZsSk/UxKt5AmQZgV/q DmG52MqiAOlgVCZTr03SfD6cx7VvCtXgcPUbXGOiR/Q073EZxcxOdhOXQIDKpGEsrjBxd3 ksN/dmw6aekl22bbzRPHkwlI+obZiAH9zmfGYszS1RfENXU2PGhV4nmUg2hrIHTc3nM2uw +EKw3JAihSVCSeRfk47LRvqgW1sP3OAAOL4ReiIXM1gBRhku8J08TwUCkL4ynQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730739788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rV0eUhE0VHo3K1TxMeR1XsOxEM1VvzAkQXhsVh9EwrU=; b=mB9lUu+eZjpUgfkEcGKL29p5tBIyeXz2Iz2Plqk6DXDCAcq9YIDgCmIivSHQS7P4TrVrYo gnRoPsETLvpJpZjvXKsBSVLMH9lCYepcL+Y08fpp8K9U2no1z1+ZbfhOwj9pgyqwKYuWvb EN7tACnZeWeOu0YPi8kWuRQ57e7Ihf5I1/r3saQc1ETIm/plpcSfIW1iTKUe6hSjOUHLXx riH/vshGHMWNXSLYDiofYAOYsQ2NWHu7XFX9EV0BrtHmSeH2ue7qoaBLIibvPK9f60rT9K lIfXe3eIpRwIuUqcvBL6dXIAcF5WOubTDlrAK72jCmvhBVwAEmYIYi5LGdj+og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730739788; a=rsa-sha256; cv=none; b=PLS5uRmQ7mBUCpah43P40nkAScRkL53AlC8OxQYpH/WZi7qz3S0E/p08GDHSck7n4Q1q7Q WDwIm+YskUV6m9hAVqAn0QFIyWtTIIKNuG/weMtLu9yyOroGmY7aqXhC7tKmVbbz73zz6F 49xag9Ip379ahL4oX4+PsQgjQ1wK9YjpSemEc0TMy9LtN6yvYPMiFLzH4QRxWFT2EizwLY ZRhQffrJQ12WWMhnpQk10QsPEZ+b93Bd8TqUC6PFLuq1rx/CtJnEi4fRwr9rMvCF2Vbpyz OpsSIZcQak3oQ2N+YRvmmXLrGgSBt0yi1UYSH7xTqAKFo8uvNBqZAE9vSy4WXg== 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 4XhyTS3JnwzhsS; Mon, 4 Nov 2024 17:03:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A4H38Bx003377; Mon, 4 Nov 2024 17:03:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4H38s2003374; Mon, 4 Nov 2024 17:03:08 GMT (envelope-from git) Date: Mon, 4 Nov 2024 17:03:08 GMT Message-Id: <202411041703.4A4H38s2003374@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 930654318ece - main - c(7): Add C23 standard update List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 930654318ecee172e4fc1ce57f21b4fb7b12603e Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=930654318ecee172e4fc1ce57f21b4fb7b12603e commit 930654318ecee172e4fc1ce57f21b4fb7b12603e Author: Faraz Vahedi AuthorDate: 2024-11-01 21:38:36 +0000 Commit: Brooks Davis CommitDate: 2024-11-04 16:40:52 +0000 c(7): Add C23 standard update Reviewed by: emaste, Graham Percival Pull Request: https://github.com/freebsd/freebsd-src/pull/1507 Signed-off-by: Faraz Vahedi --- ObsoleteFiles.inc | 3 + share/man/man7/Makefile | 3 +- share/man/man7/c.7 | 169 ++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 160 insertions(+), 15 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index d9a8467443da..142a389a8e7a 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20241104: remove the outdated c2x.7 symlink in favor of c23.7 +OLD_FILES+=usr/share/man/man7/c2x.7.gz + # 20241023: new clang import which bumps version from 18 to 19 OLD_FILES+=usr/lib/clang/18/include/__clang_cuda_builtin_vars.h OLD_FILES+=usr/lib/clang/18/include/__clang_cuda_cmath.h diff --git a/share/man/man7/Makefile b/share/man/man7/Makefile index 67cca438a46d..2c4f158280f7 100644 --- a/share/man/man7/Makefile +++ b/share/man/man7/Makefile @@ -42,7 +42,8 @@ MLINKS+= c.7 c95.7 MLINKS+= c.7 c99.7 MLINKS+= c.7 c11.7 MLINKS+= c.7 c17.7 -MLINKS+= c.7 c2x.7 +MLINKS+= c.7 c23.7 +MLINKS+= c.7 c2y.7 .if ${MK_INET} != "no" MAN+= networking.7 diff --git a/share/man/man7/c.7 b/share/man/man7/c.7 index 7c180797d296..c95bab1c1f19 100644 --- a/share/man/man7/c.7 +++ b/share/man/man7/c.7 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 20, 2021 +.Dd November 4, 2024 .Dt C 7 .Os .Sh NAME @@ -34,7 +34,8 @@ .Nm c99 , .Nm c11 , .Nm c17 , -.Nm c2x +.Nm c23 , +.Nm c2y .Nd The C programming language .Sh DESCRIPTION C is a general purpose programming language, which has a strong connection @@ -239,17 +240,154 @@ It incorporates the Technical Corrigendum 1 (ISO/IEC 9899:2011/COR1:2012) which was published in 2012. It addressed defects and deficiencies in C11 without introducing new features, only corrections and clarifications. -Since there were no major changes in C17, the current standard for -Programming Language C, is still considered C11 \(em ISO/IEC 9899:2011, published -2011-12-08. .Pp -The next standard, the fifth, is currently referred to as C2x and is scheduled -to be adopted by the end of 2021, with a publication date of 2022. -When published, it will cancel and replace the fourth edition, ISO/IEC -9899:2018. +C23, formally ISO/IEC 9899:2024, is the current standard with significant +updates that supersede C17 (ISO/IEC 9899:2018). +The standardization effort began in 2016, informally as C2x, with the first +WG14 meeting in 2019, and was officially published on October 31, 2024. +C23 was originally anticipated for an earlier release, but the timeline was +extended due to COVID-19 pandemic. +With C23, the value of __STDC_VERSION__ has been updated from 201710L to +202311L. +Key changes include (but are not limited to) the following: +.Bl -bullet -offset indent +.It +Add null pointer type nullptr_t and the nullptr keyword +.It +Add constexpr keyword as a storage-class specifier for objects +.It +Redefine the usage of the auto keyword to support type inference while also +retaining its previous functionality as a storage-class specifier when used +with a type +.It +Add %b binary conversion specifier to the +.Fn printf +and +.Fn scanf +function families +.It +Add binary conversion support (0b and 0B) to the +.Fn strtol +and +.Fn wcstol +function families +.It +Add the #embed directive for binary resource inclusion and __has_embed to +check resource availability with preprocessor directives +.It +Add the #warning directive for diagnostics +.It +Add the #elifdef and #elifndef directives +.It +Add the u8 prefix for character literals to represent UTF-8 encoding, +compatible with C++17 +.It +Add the char8_t type for UTF-8 encoded data and update the types of u8 +character constants and string literals to char8_t +.It +Add functions +.Fn mbrtoc8 +and +.Fn c8rtomb +to convert between narrow multibyte +characters and UTF-8 encoding +.It +Define all char16_t strings and literals as UTF-16 encoded and char32_t +strings and literals as UTF-32 encoded unless specified otherwise +.It +Allow storage-class specifiers within compound literals +.It +Support the latest IEEE 754 standard, ISO/IEC 60559:2020, with binary and +(optional) decimal floating-point arithmetic +.It +Add single-argument _Static_assert for compatibility with C++17 +.It +Add _Decimal32, _Decimal64, _Decimal128 keywords for (optional) decimal +floating-point arithmetic +.It +Add digit separator ' (the single quote character) for literals +.It +Enable specification of the underlying type of an enum +.It +Standardize the +.Fn typeof +operator +.It +Add +.Fn memset_explicit +in +.In string.h +to securely erase sensitive data +regardless of optimizations +.It +Add +.Fn memccpy +in +.In string.h +for efficient string concatenation +.It +Add +.Fn memalignment +in +.In stdlib.h +to determine pointer alignment +.It +Add +.Fn strdup +and +.Fn strndup +in +.In string.h +to allocate string copies +.It +Introduce bit utility functions, macros, and types in the new header +.In stdbit.h +.It +Add +.Fn timegm +in +.In time.h +for converting time structures to calendar time +values +.It +Add __has_include for header availability checking via preprocessor +directives +.It +Add __has_c_attribute to check attribute availability via preprocessor +directives +.It +Add _BitInt(N) and unsigned _BitInt(N) for bit-precise integers, and +BITINT_MAXWIDTH for maximum bit width +.It +Elevate true and false to proper keywords (previously macros from +.In stdbool.h ) +.It +Add keywords alignas, alignof, bool, static_assert, thread_local; previously +defined keywords remain available as alternative spellings +.It +Enable zero initialization with {} (including initialization of VLAs) +.It +Introduce C++11 style attributes using [[]], with adding [[deprecated]], +[[fallthrough]], [[maybe_unused]], [[nodiscard]], and [[noreturn]] +.It +Deprecate _Noreturn, noreturn, header +.In stdnoreturn.h +features introduced +in C11 +.It +Remove trigraph support +.It +Remove K&R function definitions and declarations +.It +Remove non-two's-complement representations for signed integers +.El .Pp -Some useful features have been provided as extensions by some compilers, but -they cannot be considered as standard features. +The next version of the C Standard, informally named C2y, is anticipated +to release within the next six years, targeting 2030 at the latest. +A charter for C2y is still being drafted and discussed, with several +papers under debate from the January 2024 meeting in Strasbourg, France +indicating that this new version may address long-standing requests and +deficiencies noted by the C community, while preserving its core strengths. .Pp ISO/IEC JTC1/SC22/WG14 committee is responsible for the ISO/IEC 9899, C Standard. @@ -377,6 +515,11 @@ C Standard. .%A ISO/IEC .%T 9899:2018 (aka C17) .Re +.Pp +.Rs +.%A ISO/IEC +.%T 9899:2024 (aka C23) +.Re .Sh HISTORY This manual page first appeared in .Fx 9.0 . @@ -384,8 +527,6 @@ This manual page first appeared in .An -nosplit This manual page was originally written by .An Gabor Kovesdan Aq Mt gabor@FreeBSD.org . -It was updated for -.Fx 14.0 -by +It was updated by .An Faraz Vahedi Aq Mt kfv@kfv.io with information about more recent C standards. From nobody Mon Nov 4 17:07:16 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhyZJ4Zygz5cKPQ; Mon, 04 Nov 2024 17:07:20 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhyZJ43xRz41GQ; Mon, 4 Nov 2024 17:07:20 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730740040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=97JRLfXhj0ixSQDDUotlWuxz9FbR6thlmqZig9TaOMM=; b=b5NspluD+Ec1q4G+ZtFFgWXcQnefxYB5puXbNMmSwywnJ+4LqKtgsemBq3sRiMgyLOO6IO rF/rkgpmewH054qqrUmtrsn0i/d8NIQXEi9XlL+Ftu8rNZX8/6AU/mKGxeDC3I43Ulj2Ff Jn2F+UyomEsXT+dSsAdZytAdCsWDCglAF/KIrVuxSSiFBbrNqoHAlxUhOdNZ1MrhnlWnrG S6WtTozK8iB++lwbcJTmLIE5Kvjv6a122zc7RNjvYxN3fnrTY35L+3S2pNDdAkHMrDjPeY 5sP63/ZpZ2FgAAtpdUxD3CVYrC2eUyiS8MY0A5fln7Pdpim2TsEI86zLC+Gczg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730740040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=97JRLfXhj0ixSQDDUotlWuxz9FbR6thlmqZig9TaOMM=; b=A8JT5oi1lOJYSD0Iekb2mZwCAcNrRT0MNX+MN8OgO1m3JnJvzURQUF06yWyENgbm9AwqvI dfWGhkuO4Bt5K2Cbpl2NZuy9Gg04oi1VScjJTqITC2kOsqE6vyKwEi+b7KNdlOwZ53rS80 4aeo5UqvaDd7ffcOiOZGRSdWmQT/fyL0ROG1ZHRMTjl4A25AGoW99UOA9xi7vDKCb7Jjb0 1tCbyArZrSlAx+fbLLeln1p/YESLpE+1mIgLPdCoZi8DYjQvA7Td2Kg2OZNBW5W6vRTE+Z m+z9Wvqf87nBnk9RSITKqD4NzuMqheTJWJ0LOA7xXSEXkhACGNPgD4UKwnJHzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730740040; a=rsa-sha256; cv=none; b=TpESc1/9qtZTgSknmHrpiKfbuBqK4cNkWtGIw//7rCb7O7jbGNvFth3nRlbpm7P4R4tLCY EuMz3ky/LwmePh68bGm8fzev90yKC4fRe697SA8dowAe6TYSvylRT/hjFjo6S2cMAw6woj dQZvjQVhPXT3c/zSy5XynpIXh2J9j4ko4O0hYbbu4kTUyfZRZnYUmn/K8rPMtoO3NpDFaE r3iAruDLXMJqR+Vfk7PdF5NKy+ux9v3HdiNT5wDtGiI+aEeCTPk1Hzqm/9+S0DwvkQqUdH kIpNWQQGgmdABnet3QhzMOqTafe0RbjErDEiuBqCYXai36HH6fMaS8wWqOcpdg== Received: from [10.216.0.111] (unknown [188.243.165.67]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: fluffy) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XhyZH5sXxzgmP; Mon, 4 Nov 2024 17:07:19 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Message-ID: <7eccc976-540e-4f2d-89b5-ae1f989cd419@FreeBSD.org> Date: Mon, 4 Nov 2024 20:07:16 +0300 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 5deeebd8c6ca - main - Merge llvm-project release/19.x llvmorg-19.1.2-0-g7ba7d8e2f7b6 To: Dimitry Andric Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202410231832.49NIWcTJ078019@gitrepo.freebsd.org> <40b4bd4a-5065-4cec-a59d-42cb456992b2@FreeBSD.org> <6D12AFD9-AFD8-4EA6-B215-B5F8986CB109@FreeBSD.org> Content-Language: ru, en-GB, en-US From: Dima Panov Autocrypt: addr=fluffy@FreeBSD.org; keydata= xsFNBEp+xiUBEAD01RkOYcyzU/Fnam2FI7PPwYqW00SwVmfUHihvVniiaMwzaYzchb+mzSha NsqRgjIN/i59OBpnS25OXMLEpQP7jDJnY2xKyJN2H4qn1HPHkF9cYuqvqkm+r5459g+2ZoGY 9Sr1PA0XSzXJMSQ1nRK3cFfqlN/L2//P36U5VuOWXGZUTwr/n2B/N0HAsYsqDOdjofLg7x9z 8p8elqwJbT/O4ltg8JBVAnof+FzqefYW4CzqkHRjq/9ORiGYh14ST9ECsCaVpfdDUTor0wgp JqzCN1HsQcHqgdMmOqigWIgN7Eg4MRQU3LDCISrNJ/45zvcKUXR0RHOjnSuflYba74q58XhZ 4eCTqHeMHjA8st4IWRzy9l0V4RunnZxjOTb806jyIhdxcb2m8o5tXwsqjf0TQ7vYowDHrQ6g XlhPg4Jvvwf+BwlB2p+w7Cs/Y9QA0YHnIOIVZAwU1wv66YSI9IDL2AbnY2gQGx+dkHiC3S5L G8HcPrMcjayyThKKIi5KQsWa3snFeK5ky+cRpVEOPQfUXFOas++91v90Xe9j+lsmRofsyvuy gzoaZE2fud0kCsOgYEg+kiLPlQicNAx5IToOs8BrVFLcxmbPKuVBfbLdWsYLjXGzbXEmzV9f NDZ1r1uNmVema8YYCiNjUDZhxIfKt8nbp6cx8UgVLGRVDEfXeQARAQABzTdEaW1hIFBhbm92 IChGcmVlQlNELk9SRyBDb21taXR0ZXIpIDxmbHVmZnlARnJlZUJTRC5PUkc+wsF2BBMBAgAg BQJKfsYlAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQ+4ugndU5jyk6dhAArHclTYjw VRjDnoRfO3Zfj9Ssab9Vrbo7DNFWeAqPE3OTCmiq9Q0fzRHzmhVyedYMm9qNA3i0J1De3KTn LanXOrBIqsmmZpSqmrp/xXdZngDLW5H6hpE0f2PeAPwxrb9uBQax8WMR7Z4STSHAP4GRjve3 0wNNS0MlawGllcs9VKRxG5PsDA8k3ACTSjdpQ76RWldORN4LA8M40yHRX377SGMzO+XsCeOw ad65GKyLrx+6Gnd3PMOjVCJCrqd04Jgqg9G0xKNImchwIZ5ulx9jAt+ixfNbY6hwslleqimr 2t5+MMqo6dRrvJ+BsR8NHt9vGi2Jy4+4smg05fR18fck0Sk4vCYyVvtvnOk3qZf0F8zJu06G cjWWC2ZbDPbmksWXFIMxoJbyVxK55xOqcFs0t12sR6gbVJb8Nb88WrQub3MgePyMF6R3Tkfa OqkjvQur1xC2AXESTxtJw1FkdGSb3UopNKgvSPHSLFW8B0LbyDxdYRTRWPGGEUhFP6tdXi5R vb1210ks2EQAqF4Cm3iRIhYgtZvQqQgMSiO9fVyeJ0U6dYGDtg2Boi+NtXKRdmtL7pRSnI3n fAbVJ05Hhd7PBnJeob6R08nHRo9DdAG7o8ToM+egUAuEsEvoRV+v4f6k3mShdxE7gG/anwVy eh3n6LGwg9KHDr1X2FODsLLxgUjOwU0ESn7GJQEQAMBTMHQgb0vcPMAiRvb357ihlh/YYA22 FXj4p3XTrDlBlRL0QCRq1I8XDeQmL3mG3s3NBtDXSefnNM06jZ3XCAfHIDBdxJJvQZZCXfvL p/JK7nnEuqoeqT6/oKs1MeZVdUnvh1nZhphs+Z6dl01GIE8YDpzT1JMD2f3G9PHChGi3Ddzq m3VdXt/87khYJkPbaf6EN5+vDthKgMjba8jwbQ+7IUPqkfnNFIZS6irZ2LYb79BLNI5JSl9l ReSfEX2d8ByQlLzuf0TS4voy3nWGeCyj6BIOMiRSxg+hZmJLYxhNkyK4GQVCt/rLT7dIfBQM syBbX0Qw2NOcfba9VgdPZBgdrawwB4/xF9SA3NB0J0lUjhjpH9iG8NxlpleEg8OSUApyFZEJ q2A/flns4kKzNH7AGYDOFORytDzA3qkgCJrZ7nzQSsdtZ2qbyAoze0tl+YrShJhOcmQBtFem omhWVeJ8T/Bw1KH8M1ihrENBTSzYzLvN18YjNP6P0Dh/7Zda5yYI8fNqd84K3Uq5xBiI0S6+ qxViw84z2tJj8TxiNqFAk7Tbeo2Ximtq7uQ9UnFRSK3jw96yi19KU9rQQZs0xUjN5gn/tF5l BZWKjwuZCkcOiI0EWHAR+ATAEsFNXcuoC9CAGK5HFW4nI4WtE3pv1KYvivlGtF1wzf0Qrhye RrmxABEBAAHCwV8EGAECAAkFAkp+xiUCGwwACgkQ+4ugndU5jymgKg//RvnI7zEDKv6nQUqK RyLawPTrCKCtQ2vSoWyTNgRB6byNS1w5wNSAMnqaESx2bdhauaxe167VEJYqgQy241yFslpC 6v/xlH25Ppos+Jg6AKaQG/JABHO6Co4tHtBbNmM+14HESxAodA4NJuEU19iIPjRhUKC8F8R9 xBmW1uLpPiljU9Km0P3EIKjAdtdZNeMLhwsbSHBwJROFrxFGiTzWNREWZoZpQxgSbHYhwYbx HEbJi1cybl9IQvSGHrysctZsxD04Jxh6ogaziiT8aV6ear6BNh008yRf61FvrinfG3USLR3i JO8aHap4QGCPjZ3cyT+DEq8/zVfDdeidTeNEhSgRKk856RcA+yAE79KYdKkvmDUiC8poAJ7F GEYHMB+g/1+LczCr2g9GYkiB/53boYfU9esYYlarxCgedCrwXv6T48FZ3xxoH3XJ2KV8K6M8 CUb04jj3kEeCwq+R6Bk2ZXrnMzyQmmn223X+Zp89B/gchH32JY8y3j7BICcoZmgMu62XNMgW I/hRgfi3JlVCne6XPj3/w00JYG7vo+eTJOflqYr3WRTPYh7DxzYtshZswHmmkZtwizUQUZzF 9dX2CM8nY7cKucEmtcnUpjGwXMOufa/DmCTlk8ggRZ0ukCUZOlIA4ILxp95sS2oqyucARv+p wMWvrqJ/LfbZexSsIjI= Organization: FreeBSD.org In-Reply-To: <6D12AFD9-AFD8-4EA6-B215-B5F8986CB109@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------0T5b9J4QYq1zt0c0l4ZBwcyi" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------0T5b9J4QYq1zt0c0l4ZBwcyi Content-Type: multipart/mixed; boundary="------------vbJztS6IXPnmgHK0zQ1sukvX"; protected-headers="v1" From: Dima Panov To: Dimitry Andric Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Message-ID: <7eccc976-540e-4f2d-89b5-ae1f989cd419@FreeBSD.org> Subject: Re: git: 5deeebd8c6ca - main - Merge llvm-project release/19.x llvmorg-19.1.2-0-g7ba7d8e2f7b6 References: <202410231832.49NIWcTJ078019@gitrepo.freebsd.org> <40b4bd4a-5065-4cec-a59d-42cb456992b2@FreeBSD.org> <6D12AFD9-AFD8-4EA6-B215-B5F8986CB109@FreeBSD.org> In-Reply-To: <6D12AFD9-AFD8-4EA6-B215-B5F8986CB109@FreeBSD.org> --------------vbJztS6IXPnmgHK0zQ1sukvX Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 SGVsbG8hDQoNCk9uIDAyLjExLjIwMjQgMTg6NTMsIERpbWl0cnkgQW5kcmljIHdyb3RlOg0K PiBPbiAxIE5vdiAyMDI0LCBhdCAyMzoxNywgRGltYSBQYW5vdiA8Zmx1ZmZ5QGZyZWVic2Qu b3JnPiB3cm90ZToNCj4+DQo+PiBIZWxsbyENCj4+DQo+PiBPbiAyMy4xMC4yMDI0IDIxOjMy LCBEaW1pdHJ5IEFuZHJpYyB3cm90ZToNCj4+PiBUaGUgYnJhbmNoIG1haW4gaGFzIGJlZW4g dXBkYXRlZCBieSBkaW06DQo+Pj4gVVJMOiBodHRwczovL2NnaXQuRnJlZUJTRC5vcmcvc3Jj L2NvbW1pdC8/aWQ9NWRlZWViZDhjNmNhOTkxMjY5ZTcyOTAyYTdhNjJjYWRhNTc5NDdmNg0K Pj4+IGNvbW1pdCA1ZGVlZWJkOGM2Y2E5OTEyNjllNzI5MDJhN2E2MmNhZGE1Nzk0N2Y2DQo+ Pj4gTWVyZ2U6IDZlNTE2Yzg3YjZkNyBlNmI3MzI3OTI4MTMNCj4+PiBBdXRob3I6ICAgICBE aW1pdHJ5IEFuZHJpYyA8ZGltQEZyZWVCU0Qub3JnPg0KPj4+IEF1dGhvckRhdGU6IDIwMjQt MTAtMjEgMTI6NTk6MjYgKzAwMDANCj4+PiBDb21taXQ6ICAgICBEaW1pdHJ5IEFuZHJpYyA8 ZGltQEZyZWVCU0Qub3JnPg0KPj4+IENvbW1pdERhdGU6IDIwMjQtMTAtMjMgMTg6Mjc6Mzgg KzAwMDANCj4+PiAgICAgIE1lcmdlIGxsdm0tcHJvamVjdCByZWxlYXNlLzE5LnggbGx2bW9y Zy0xOS4xLjItMC1nN2JhN2Q4ZTJmN2I2DQo+Pj4gICAgICAgICAgIFRoaXMgdXBkYXRlcyBs bHZtLCBjbGFuZywgY29tcGlsZXItcnQsIGxpYmMrKywgbGlidW53aW5kLCBsbGQsIGxsZGIg YW5kDQo+Pj4gICAgICBvcGVubXAgdG8gbGx2bS1wcm9qZWN0IHJlbGVhc2UvMTkueCBsbHZt b3JnLTE5LjEuMi0wLWc3YmE3ZDhlMmY3YjYsDQo+Pj4gICAgICBhLmsuYS4gMTkuMS4yIHJl bGVhc2UuDQo+Pj4gICAgICAgICAgIFBSOiAgICAgICAgICAgICAyODA1NjINCj4+PiAgICAg IE1GQyBhZnRlcjogICAgICAxIG1vbnRoDQo+Pg0KPj4NCj4+IEFmdGVyIHRoaXMgdXBkYXRl IGFueSBsYW5nL2djYyogZmFpbHMgdG8gYnVpbGQgb24gYWFyY2g2NCBtYWNoaW5lIDooDQo+ Pg0KPj4gbWtkaXIgYWFyY2g2NC1wb3J0YmxkLWZyZWVic2QxNS4wL2xpYmdvbXANCj4+IENo ZWNraW5nIG11bHRpbGliIGNvbmZpZ3VyYXRpb24gZm9yIGxpYmdvbXAuLi4NCj4+IENvbmZp Z3VyaW5nIHN0YWdlIDEgaW4gYWFyY2g2NC1wb3J0YmxkLWZyZWVic2QxNS4wL2xpYmdvbXAN Cj4+IGNvbmZpZ3VyZTogY3JlYXRpbmcgY2FjaGUgLi9jb25maWcuY2FjaGUNCj4+IGNoZWNr aW5nIGZvciAtLWVuYWJsZS12ZXJzaW9uLXNwZWNpZmljLXJ1bnRpbWUtbGlicy4uLiBubw0K Pj4gY2hlY2tpbmcgZm9yIC0tZW5hYmxlLWdlbmVyYXRlZC1maWxlcy1pbi1zcmNkaXIuLi4g bm8NCj4+IGNoZWNraW5nIGJ1aWxkIHN5c3RlbSB0eXBlLi4uIGFhcmNoNjQtcG9ydGJsZC1m cmVlYnNkMTUuMA0KPj4gY2hlY2tpbmcgaG9zdCBzeXN0ZW0gdHlwZS4uLiBhYXJjaDY0LXBv cnRibGQtZnJlZWJzZDE1LjANCj4+IGNoZWNraW5nIHRhcmdldCBzeXN0ZW0gdHlwZS4uLiBh YXJjaDY0LXBvcnRibGQtZnJlZWJzZDE1LjANCj4+IGNoZWNraW5nIGZvciBhIEJTRC1jb21w YXRpYmxlIGluc3RhbGwuLi4gL3Vzci9iaW4vaW5zdGFsbCAtYw0KPj4gY2hlY2tpbmcgd2hl dGhlciBidWlsZCBlbnZpcm9ubWVudCBpcyBzYW5lLi4uIHllcw0KPj4gY2hlY2tpbmcgZm9y IGEgdGhyZWFkLXNhZmUgbWtkaXIgLXAuLi4gL3dya2RpcnMvdXNyL3BvcnRzL2xhbmcvZ2Nj MTMvd29yay9nY2MtMTMuMy4wL2xpYmdvbXAvLi4vaW5zdGFsbC1zaCAtYyAtZA0KPj4gY2hl Y2tpbmcgZm9yIGdhd2suLi4gL3Vzci9iaW4vYXdrDQo+PiBjaGVja2luZyB3aGV0aGVyIGdt YWtlIHNldHMgJChNQUtFKS4uLiB5ZXMNCj4+IGNoZWNraW5nIHdoZXRoZXIgZ21ha2Ugc3Vw cG9ydHMgbmVzdGVkIHZhcmlhYmxlcy4uLiB5ZXMNCj4+IGxkLWVsZi5zby4xOiAvd3JrZGly cy91c3IvcG9ydHMvbGFuZy9nY2MxMy93b3JrLy5idWlsZC8uL2djYy9saWJnY2Nfcy5zby4x OiB2ZXJzaW9uIEdDQ18zLjMgcmVxdWlyZWQgYnkgL3dya2RpcnMvdXNyL3BvcnRzL2xhbmcv Z2NjMTMvd29yay8uYnVpbGQvLi9nY2MveGdjYyBub3QgZGVmaW5lZA0KPj4gY2hlY2tpbmcg Zm9yIGFhcmNoNjQtcG9ydGJsZC1mcmVlYnNkMTUuMC1nY2MuLi4gL3dya2RpcnMvdXNyL3Bv cnRzL2xhbmcvZ2NjMTMvd29yay8uYnVpbGQvLi9nY2MveGdjYyAtQi93cmtkaXJzL3Vzci9w b3J0cy9sYW5nL2djYzEzL3dvcmsvLmJ1aWxkLy4vZ2NjLyAtQi91c3IvbG9jYWwvYWFyY2g2 NC1wb3J0YmxkLWZyZWVic2QxNS4wL2Jpbi8gLUIvdXNyL2xvY2FsL2FhcmNoDQo+PiBjaGVj a2luZyB3aGV0aGVyIHRoZSBDIGNvbXBpbGVyIHdvcmtzLi4uIG5vDQo+PiBjb25maWd1cmU6 IGVycm9yOiBpbiBgL3dya2RpcnMvdXNyL3BvcnRzL2xhbmcvZ2NjMTMvd29yay8uYnVpbGQv YWFyY2g2NC1wb3J0YmxkLWZyZWVic2QxNS4wL2xpYmdvbXAnOg0KPj4gY29uZmlndXJlOiBl cnJvcjogQyBjb21waWxlciBjYW5ub3QgY3JlYXRlIGV4ZWN1dGFibGVzDQo+PiBTZWUgYGNv bmZpZy5sb2cnIGZvciBtb3JlIGRldGFpbHMNCj4+IGdtYWtlWzJdOiAqKiogW01ha2VmaWxl OjIyNTA1OiBjb25maWd1cmUtc3RhZ2UxLXRhcmdldC1saWJnb21wXSBFcnJvciA3Nw0KPj4g Z21ha2VbMl06IExlYXZpbmcgZGlyZWN0b3J5ICcvd3JrZGlycy91c3IvcG9ydHMvbGFuZy9n Y2MxMy93b3JrLy5idWlsZCcNCj4+IGdtYWtlWzFdOiAqKiogW01ha2VmaWxlOjI0ODYzOiBz dGFnZTEtYnViYmxlXSBFcnJvciAyDQo+PiBnbWFrZVsxXTogTGVhdmluZyBkaXJlY3Rvcnkg Jy93cmtkaXJzL3Vzci9wb3J0cy9sYW5nL2djYzEzL3dvcmsvLmJ1aWxkJw0KPj4gZ21ha2U6 ICoqKiBbTWFrZWZpbGU6MjUyMTE6IGJvb3RzdHJhcC1sZWFuXSBFcnJvciAyDQo+PiA9PT0+ IENvbXBpbGF0aW9uIGZhaWxlZCB1bmV4cGVjdGVkbHkuDQo+IA0KPiBJIGNhbm5vdCByZXBy b2R1Y2UgdGhpcy4gSSBoYXZlIGluc3RhbGxlZCBhIGZyZXNoIHNuYXBzaG90IChGcmVlQlNE LTE1LjAtQ1VSUkVOVC1hcm02NC1hYXJjaDY0LTIwMjQxMDMxLTUyMTJiOTUwMDExNi0yNzMz MzUpLCBpbnN0YWxsZWQgdGhlIHByZXJlcXVpc2l0ZXMsIHRoZW4gZGlkIGEgZnVsbCBidWls ZCBvZiB0aGUgZGVmYXVsdCBnY2MsIHdoaWNoIGlzIGN1cnJlbnRseSBsYW5nL2djYzEzLiBB bGwgb3B0aW9ucyBkZWZhdWx0ZWQuDQo+IA0KPiBEbyB5b3UgaGF2ZSBhbnkgbm9uLWRlZmF1 bHQgb3B0aW9ucyBzZWxlY3QgZm9yIHRoZXNlIHBvcnRzPw0KPiANCg0KSW5kZWVkLCByb290 IG9mIGV2aWwgd2FzIGhpZGRlbiBpbiBkZXZlbC9iaW51dGlscyB3aXRoIFJFTFJPIG9wdGlv biBlbmFibGVkLg0KQWZ0ZXIgZGlzYWJsaW5nIFJFTFJPIG9wdGlvbiBpbiBiaW51dGlscyBh bGwgbGFuZy9nY2MqIGJ1aWxkIGFyZSBmaW5lIGFnYWluLg0KDQpBbnl3YXkgaXQgaXMgYSBi aWcgYmFkIHJlZ3Jlc3Npb24gaGVyZS4NCkkgaGF2ZSBSRUxSTyBlbmFibGVkIGluIGJpbnV0 aWxzIHBvcnQgZm90IGxvbmcgdGltZSBhbmQgaGFkIG5vIGlzc3VlcyB3aXRoIGdjYyBidWls ZHMgYmVmb3JlIHRoaXMgbGx2bTE5IGltcG9ydC4NCg0KDQoNCi0tIA0KU2luY2VyZWx5LA0K RGltYSAoZmx1ZmZ5QEZyZWVCU0Qub3JnLCBodHRwczovL3QubWUvRmx1ZmZ5QlNELCBAZmx1 ZmZ5Om1hdHJpeC1kZXYuZnJlZWJzZC5vcmcpDQooZGVza3RvcCwga2RlLCB4MTEsIG9mZmlj ZSwgcG9ydHMtc2VjdGVhbSlARnJlZUJTRCB0ZWFtDQoNCg== --------------vbJztS6IXPnmgHK0zQ1sukvX-- --------------0T5b9J4QYq1zt0c0l4ZBwcyi Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEELTAsy5mEEwxvh7r8+4ugndU5jykFAmco/0UFAwAAAAAACgkQ+4ugndU5jymy 2BAAqJyuyGNg5vqZ8QNPkNdf9Tff1b1UpP6kxdQW+gu7OAbVbZPWFzU4l3MNcUPnyf4pcRDfqPsd sclmbyQp7GlRJV3zViYKOw3NitRv4d9GkIllxLpQLWJBgFaAnC0RdOX/MrsjWB6HQ5CaCm6/inLl v7YpqYms9Sutkwa+bH9MP7tqiHrSwj6CoNyToxbQTkP+th0wb4deOMQColvfpkaSWCsZl6orVIaa EujPeduZtshhVg6dRAiiNduimJ+nTVdm+1req+3J9ZgzdV2N5VchcRKks0dRX0twxz4/AYI20yQC vK+t98DUbHAHGKeL3mheJEXsqm2OQZF0+QZQjmxEa2Le8bhPRyfxwCahiemreSoLomO4XUFXy9m8 h804asu54Oojfyap17JX6/gHFUaV4OKIeYbMApXFodydwC83+aXFZtutT3wQ36YiI+3gXDjR5o0T z27lWrtZCMkTLjLc3pGvPh9uCVEtqs84TI6ImGPDDiAyk3MGCITTg3TKx4z4LTuYLla/HRB7TPlP GOiVPLIvwahjbWNksBMM8KD34n8FVhJgHa6ZrWCBBbnUSP5HiAHpg2mJovJ5FlcI/LmTuYLmZH5A Keihg/kSjOubuFSLWkTNpR3gLBeM6Z66mtsgrIrXFOtaM047UVMCIn60CW0PZFpQGqjqw+7jy+M4 LBs= =VR6Y -----END PGP SIGNATURE----- --------------0T5b9J4QYq1zt0c0l4ZBwcyi-- From nobody Mon Nov 4 19:24:58 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj1d70tknz5cSQd; Mon, 04 Nov 2024 19:24: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj1d709Fwz4GqS; Mon, 4 Nov 2024 19:24:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730748299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9fta5UhJEUyPP0G+U3OPHIrDgr1QBLnYnVXqyCHOZkI=; b=FLnlqsPAjef7a0hpxoQwk00MPsF8hrzac984wznUwgCj8FjaD1axOA1lLQw5aUhS6cUrSb 0vkS+9GGHnZXi2mJFoV8MrzC4scYrThW1ZW5WM9llF+beaDkqPrQCEW9J2g5hyscm/B9kx eLlvXAV/SCehEc9urrtw7FNYBDd0mR2jbBt5OZWX3zOigyKrFXqwQQ+LMjTomxxDLc4Du4 g4B33esoDRF6yHxXPqBhm4TP/GaO+NkMJ6k9hK43hZmpSoFHYo+vRP/h7cY40MDgu5f6Ta zayqurAzb7VXO7cg4xTuXRa0hpJycG2kbbUiftxtRnAwD7Zaz3npXBHZn/gY+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730748299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9fta5UhJEUyPP0G+U3OPHIrDgr1QBLnYnVXqyCHOZkI=; b=qW0ulcwyeOl2fhmP5lZ1vBGEIYjxO3S3nIblguyLISnieWAgKaqvCtVd8YACJ9sBL/ikqo Gi8PdtQINkuOMoJYWCvWMCPJpRvIF3JhXnAjJ40OthOuh+Ds3qIzkQTklrI0Q5b3P+1Vzd +3vOElQMBOaEK5Cj3YRV4pSPEAD36TZ8SDi2oBvH3+BtkZ0lyrqKpdggD7P4jXbTA7Z6Py J1cnLaMzDhe/w5zqEcekkouoSq3OrF5VWGwTaZ9+rEP3PBvZbz7t2+ksbI/cNxLKuVbRyh IA6fVRTUPx+KHu7n9JNWF+AwrgX4yu+8PIwUA9F09Vbh4eoFDmFl3ITvZQUNyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730748299; a=rsa-sha256; cv=none; b=Mecvprj4Zc9H1pmOFOud8DkypItDXa4jlMIAkJ0OtKbtLYW06yHr72NgK6lfVAYZwF11N8 4M0gzlPQCExiZtZRGepuqFFts4P2b0tj6HmYedM2SFHKcngVZZ9Dmh5WLufTGR7GaqUq4w z76ouWsExlr+pZSip4T4uSmCSSeq/5FFg0sA8x+T6H1dXGUxtWAU8C5Ay7QS0Dx2Nsd+yi kn8whcTSE0ArRvXTfHRRFh/XEePoPYCDgHWuv6ghyZjRrOzLKUc4kdRZL9Bn2rC4O8KaE1 fivX7Ae7oK8r1vqpogGwaJ4jPuMxFl7kKFOMXPS++/Zxrtjf4kyKFe2ItPirQg== 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 4Xj1d66v04zmL4; Mon, 4 Nov 2024 19:24:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A4JOwQY063694; Mon, 4 Nov 2024 19:24:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4JOwXj063691; Mon, 4 Nov 2024 19:24:58 GMT (envelope-from git) Date: Mon, 4 Nov 2024 19:24:58 GMT Message-Id: <202411041924.4A4JOwXj063691@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: a905c589be67 - main - pctrie: breakup pctrie_root_store List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a905c589be67db98bbb9c99932511be70e5027fb Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=a905c589be67db98bbb9c99932511be70e5027fb commit a905c589be67db98bbb9c99932511be70e5027fb Author: Doug Moore AuthorDate: 2024-11-04 19:23:40 +0000 Commit: Doug Moore CommitDate: 2024-11-04 19:23:40 +0000 pctrie: breakup pctrie_root_store Break up pctrie_root_store into the part that casts the root to a smr_pctnode_t *, and the rest. The rest is just pctrie_node_store, and the casting part can be used in a few more places. This is strictly a code-cleanup change, with no functional change expected. Reviewed by: bnovkov Differential Revision: https://reviews.freebsd.org/D47347 --- sys/kern/subr_pctrie.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c index e4865c602ce4..a078f0587f37 100644 --- a/sys/kern/subr_pctrie.c +++ b/sys/kern/subr_pctrie.c @@ -168,22 +168,21 @@ pctrie_node_store(smr_pctnode_t *p, void *v, enum pctrie_access access) } /* - * Get the root node for a tree. + * Get the root address, cast to proper type for load/store. */ -static __inline struct pctrie_node * -pctrie_root_load(struct pctrie *ptree, smr_t smr, enum pctrie_access access) +static __inline smr_pctnode_t * +pctrie_root(struct pctrie *ptree) { - return (pctrie_node_load((smr_pctnode_t *)&ptree->pt_root, smr, access)); + return ((smr_pctnode_t *)&ptree->pt_root); } /* - * Set the root node for a tree. + * Get the root node for a tree. */ -static __inline void -pctrie_root_store(struct pctrie *ptree, struct pctrie_node *node, - enum pctrie_access access) +static __inline struct pctrie_node * +pctrie_root_load(struct pctrie *ptree, smr_t smr, enum pctrie_access access) { - pctrie_node_store((smr_pctnode_t *)&ptree->pt_root, node, access); + return (pctrie_node_load(pctrie_root(ptree), smr, access)); } /* @@ -304,7 +303,7 @@ pctrie_insert_lookup_compound(struct pctrie *ptree, uint64_t *val, if (pctrie_isleaf(node)) { if (node == PCTRIE_NULL) { if (parent == NULL) - pctrie_root_store(ptree, + pctrie_node_store(pctrie_root(ptree), pctrie_toleaf(val), PCTRIE_LOCKED); else pctrie_addnode(parent, index, @@ -354,8 +353,7 @@ pctrie_insert_lookup_compound(struct pctrie *ptree, uint64_t *val, * children 'node' and 'val'. Return the place that points to 'node' * now, and will point to to the new branching node later. */ - return ((parent != NULL) ? &parent->pn_child[slot]: - (smr_pctnode_t *)&ptree->pt_root); + return ((parent == NULL) ? pctrie_root(ptree): &parent->pn_child[slot]); } /* @@ -608,7 +606,7 @@ pctrie_iter_insert_lookup(struct pctrie_iter *it, uint64_t *val) node = _pctrie_iter_lookup_node(it, *val, NULL, PCTRIE_LOCKED); if (node == PCTRIE_NULL) { if (it->top == 0) - pctrie_root_store(it->ptree, + pctrie_node_store(pctrie_root(it->ptree), pctrie_toleaf(val), PCTRIE_LOCKED); else pctrie_addnode(it->path[it->top - 1], it->index, @@ -625,7 +623,7 @@ pctrie_iter_insert_lookup(struct pctrie_iter *it, uint64_t *val) * now, and will point to to the new branching node later. */ if (it->top == 0) - return ((smr_pctnode_t *)&it->ptree->pt_root); + return (pctrie_root(it->ptree)); node = it->path[it->top - 1]; return (&node->pn_child[pctrie_slot(node, it->index)]); } @@ -1037,7 +1035,8 @@ pctrie_remove(struct pctrie *ptree, uint64_t index, struct pctrie_node *parent, int slot; if (node == NULL) { - pctrie_root_store(ptree, PCTRIE_NULL, PCTRIE_LOCKED); + pctrie_node_store(pctrie_root(ptree), + PCTRIE_NULL, PCTRIE_LOCKED); return; } slot = pctrie_slot(node, index); @@ -1054,7 +1053,7 @@ pctrie_remove(struct pctrie *ptree, uint64_t index, struct pctrie_node *parent, KASSERT(child != PCTRIE_NULL, ("%s: bad popmap slot %d in node %p", __func__, slot, node)); if (parent == NULL) - pctrie_root_store(ptree, child, PCTRIE_LOCKED); + pctrie_node_store(pctrie_root(ptree), child, PCTRIE_LOCKED); else { slot = pctrie_slot(parent, index); KASSERT(node == @@ -1218,7 +1217,7 @@ pctrie_reclaim_begin_compound(struct pctrie_node **pnode, struct pctrie_node *node; node = pctrie_root_load(ptree, NULL, PCTRIE_UNSERIALIZED); - pctrie_root_store(ptree, PCTRIE_NULL, PCTRIE_UNSERIALIZED); + pctrie_node_store(pctrie_root(ptree), PCTRIE_NULL, PCTRIE_UNSERIALIZED); if (pctrie_isleaf(node)) { if (callback != NULL && node != PCTRIE_NULL) callback(pctrie_toptr(node, keyoff), arg); @@ -1275,7 +1274,7 @@ pctrie_replace(struct pctrie *ptree, uint64_t *newval) if (pctrie_isleaf(node)) { if ((m = pctrie_toval(node)) != NULL && *m == index) { if (parent == NULL) - pctrie_root_store(ptree, + pctrie_node_store(pctrie_root(ptree), leaf, PCTRIE_LOCKED); else pctrie_node_store( From nobody Mon Nov 4 19:38:52 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj1x83JtVz5cShl; Mon, 04 Nov 2024 19:38: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj1x82nR9z4H6n; Mon, 4 Nov 2024 19:38:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730749132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XbKwwjEkNR6b3a1UeBTeUhLvtzGAVTpsDdlKUW6qow8=; b=V74MT9LZmNgwH6cGimjUFSTDcaJcHTnP/plUVAkAUv4VwcLIxZyugQZyB+Ha4W5J/7uj63 jzRx9VG93h/FZk3gVfTzqbQDbHfM2eL+don4ECd6JHQmnC3N0dER6ufZggs/LoAvc0LCFf st/5i9XTVD4XJM7VvyD21Rdzcu45bbp0W+pGNshW7rxG5FpVONFpyYWu3oGVZO69uYdbpe V5WtjZj/NG5X0xPpggaCY5F2CIEmqlQMzO0ZJ0RUUAacWBETXBTYeEbk88b8JqqEml9HMx Sft/U/3aOMdEBpvI4oAdyDloO276s2Ub8lAV4vI9/f13mR3Uyv/4Mksy+TPy1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730749132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XbKwwjEkNR6b3a1UeBTeUhLvtzGAVTpsDdlKUW6qow8=; b=EwvViX9Xc1RW4F/T6niijDBmvjT4XSdfj+y8mhO+ZtrclmbjQNcbunMoQaoDf3iHds7i+2 fuerM5VYkujZyXpJQJ2SXhZKp3gXMeHicFmTC9X3fFY4hbH6J5jLa/XmSsK5WnMaTAewjm vp0ccTj7pKSCNThF2RAcTrgc49J1ZXHIH+iM0BuSKp70bh2ysuOI1O7i4L7H9jDUuBcAuW ZY7Tdc5YyDWchixVkpvXHfMKmppyR4+3jSAwUS9W3nmzkDXPGJV5Ex/9XupwB277k97M37 tZ0KwlLMzrZQmWwhaAl/KVWbQdtKRV84sHWNJySjcqrS/jyLXp2dw4NTvMJfsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730749132; a=rsa-sha256; cv=none; b=WUh28UD5UHQ5u2FOF8lzMPoMGNz5L1hNgP1Olh1pIw41WoxSUhzGmn4bBIfxymHVcccW3K esUE8HRcFQhI+enfGxGvJ8c8EMJeQT9NM2NA8TOFMN9Gnx1Rzd0fXpP5tNGR7JGHGytbLR o9qm2+OLKFD/dSJmAhLKjxNJe8AGiZyIiu50HZWgpwKb2TMy/el1YysTUZT3g1NYeN7KVV ImqBl0RZ8M49ma5skdUyv84ptjlNHdnSy2wC7GUWYi9qcfa7w+f3+Koqj7b9Rxct2qBxDT GxutUMZ8rVu7Gi4La80qbwNnOfi9W9wJpBOng3MVUU+2UwauzfGF9v4O55E8dg== 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 4Xj1x82GPTzmNy; Mon, 4 Nov 2024 19:38:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A4Jcq3T082973; Mon, 4 Nov 2024 19:38:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4JcqhN082970; Mon, 4 Nov 2024 19:38:52 GMT (envelope-from git) Date: Mon, 4 Nov 2024 19:38:52 GMT Message-Id: <202411041938.4A4JcqhN082970@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: ff84f8b536ce - main - iommu: Clean up a lingering function prototype List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: ff84f8b536ceaa9a16b4dca94a1856300be0216b Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ff84f8b536ceaa9a16b4dca94a1856300be0216b commit ff84f8b536ceaa9a16b4dca94a1856300be0216b Author: Mark Johnston AuthorDate: 2024-11-04 19:38:22 +0000 Commit: Mark Johnston CommitDate: 2024-11-04 19:38:22 +0000 iommu: Clean up a lingering function prototype Reported by: clang Fixes: d97838b7c2a6 ("iommu: eliminate iommu_free_ctx()") --- sys/x86/iommu/intel_ctx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/x86/iommu/intel_ctx.c b/sys/x86/iommu/intel_ctx.c index 2bc5f8a9d361..b4ea1e82696b 100644 --- a/sys/x86/iommu/intel_ctx.c +++ b/sys/x86/iommu/intel_ctx.c @@ -76,7 +76,6 @@ static void dmar_unref_domain_locked(struct dmar_unit *dmar, static void dmar_domain_destroy(struct dmar_domain *domain); static void dmar_free_ctx_locked(struct dmar_unit *dmar, struct dmar_ctx *ctx); -static void dmar_free_ctx(struct dmar_ctx *ctx); static void dmar_ensure_ctx_page(struct dmar_unit *dmar, int bus) From nobody Mon Nov 4 19:38:53 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj1x94Tbkz5cRch; Mon, 04 Nov 2024 19:38: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj1x93T7Sz4HVN; Mon, 4 Nov 2024 19:38:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730749133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q9AJa/NKLW28EXAadi8ojuSKeeELewQJRB+/1repe/Q=; b=XDdv4M92X2zIh+wdcrn7wUILJeA1K8JOwEzs4DhfcfSul5qpw1iNkEaKA6b/WKnD3N3GeO iFHX7/xmKTIqwn5KRpjH08v7Qj9SIFVGTp1upCXhWKK7VKzakCUp46MdAqMZoDEiP+SyVK FxSm7XdrhMild9MMUuR5B0d9shvZO/tx2M2x2q0aTI2TNbDi5VHCa49vFkcyr8zgocDhYd feMe+2z63ioJ5TT46QCA7n3X59PoSBmCuBpnneKaz/Zce9btcc1dC+13ABUtfCj470fbQw 7UHssdDmrKVlADzEjGBmyt0iTr6sLvZaCHlJMTxE3EiXH4ZPnHeF6h+X2swsvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730749133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q9AJa/NKLW28EXAadi8ojuSKeeELewQJRB+/1repe/Q=; b=MNu4mEBSI95TFH3IuKIcpuSOIBsIxbU2+YALJAvwNCr7+5Ks84OOwAGfrNIHBScyLqFZDx F91Zp8s99t+dvTdDod6l2UpclUKFFWT0XLNC9oIN9HKWrykXrWzqNz5J9jI73lbi1ddjqA DdrFvZoVdTBIMN5Bqg7RDjVNiE25pHqIgAQRLT9at2UEe0vrRqysqMZRSDcf3rG9te4b6T LUUMvH6jw2RzHx/4lMBNWM1QklGf0KmevaoL8myrWGCujnwR8dt3Fw03ZxsMlIj0ZotdRd BPaRhkNA+eTga/OAB1QF/HPVbwPXX+PbVYPZCnhd9zPqjXbrzlMXOPnGXtwkNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730749133; a=rsa-sha256; cv=none; b=RuzhUYBPdzXotf1WLHjKimky+hmLhoFGgnvXYQncyFkTX8qGwyn0X5LwH8v3PbyL498uIa hoofQq5D6QC794BLuxhBUJguKEPvLvH/L8jGDJRCDO6nyznyl84YTj22hFFq9LWMLPysh0 8bJCFVfAy8obvo2YCxjmm2ZTm8FC0pkkXcJNysKvKtat9/9DlQ6QkaEWomJKOLtg2CPFiy WT1jbNT/LneGXW/VXoQ1P+WRjuRfGYaz7DbZwlKGPXAmgs+KKpLoriyUadGbhv8UbQp/1I zgWzzdh//zDMkStRfOqFGtazj3CtBta4HS9yM0hvGzTZZ/U3VAaOT3RVYdsycw== 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 4Xj1x934Qxzmbs; Mon, 4 Nov 2024 19:38:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A4JcrSW083040; Mon, 4 Nov 2024 19:38:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4JcrWp083037; Mon, 4 Nov 2024 19:38:53 GMT (envelope-from git) Date: Mon, 4 Nov 2024 19:38:53 GMT Message-Id: <202411041938.4A4JcrWp083037@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: c477d8974374 - main - file: The f_ops table pointer can be a pointer to const List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: c477d8974374402a16a42f5d62fbda19070a12a3 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c477d8974374402a16a42f5d62fbda19070a12a3 commit c477d8974374402a16a42f5d62fbda19070a12a3 Author: Mark Johnston AuthorDate: 2024-11-04 19:38:33 +0000 Commit: Mark Johnston CommitDate: 2024-11-04 19:38:33 +0000 file: The f_ops table pointer can be a pointer to const No functional change intended. MFC after: 2 weeks --- sys/sys/file.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/file.h b/sys/sys/file.h index 6d1b8b8e1df4..820ad1015573 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -186,7 +186,7 @@ struct file { volatile u_int f_flag; /* see fcntl.h */ volatile u_int f_count; /* reference count */ void *f_data; /* file descriptor specific data */ - struct fileops *f_ops; /* File operations */ + const struct fileops *f_ops; /* File operations */ struct vnode *f_vnode; /* NULL or applicable vnode */ struct ucred *f_cred; /* associated credentials. */ short f_type; /* descriptor type */ From nobody Mon Nov 4 19:59:21 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj2Nn739Vz5cTs1; Mon, 04 Nov 2024 19:59:21 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj2Nn6SFKz4Kwm; Mon, 4 Nov 2024 19:59:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730750361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DFD1eQwrCtnTj1a7wSb5b7sX72d+jQX8MO8Dbz+8HEI=; b=Pl/uBK4rWmgR48HOK8wNkAtK9YBojj6cqxCTe8OY/Stbs8x2wMi7cu4J/z+WnVUhkzGbNY ZjnANvxndgt4J0sWF2apb8nIV5X++YGgKlfQTtIHEVcFxHxnaeP93AOZXsboQvhblCzZrl I/SRQ6zoaMdzxS3gvNDwNCpwy0VK17n3Siv8EE1/28XpLgWAzirgWfgpGMKomtyheTC8cF Nh0s0pyOaFwGNZQqCYOSlUsF+TJT6xVCDqSRRiPzUe//GXZY/jnF4B/Y+KMXjtbvC7/Y3Q K4M3JAZYe7A+Slg45LaSHKoBtZ0w3IlMpS/iPY1pZNC5lyEc/RELG/7pmz/R5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730750361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DFD1eQwrCtnTj1a7wSb5b7sX72d+jQX8MO8Dbz+8HEI=; b=jEDsqmP6GTh34uvuGLOGgqmKGoXw2ziiJI2bFZusZ1nJQpvewGe9cDDWZvLzGmz5RYrFzE diBlKJFJaJQFDoJOp2zzFF6RWowWnw9zldoc77t68+0ipY3i2uEgM8KyAxXmtoyUSiOTN2 TRsQ4gi4CWGGxcAC0qDjA/Axdwd4J93vTjNNwfTZpPA9JCp7cAvruORNoc+wURtKktS78f bs1N7FnhGdxQQmYzT0uXna/ZU61XmSI5urbJZEzpDWeWfzT8wLrYUSwRNEXcax8KgvatLL XfilazSQiL9fpwSIlIdLML0nJeC+jRWQqJyy4015E/eC4++spXBMAL/B+da1yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730750361; a=rsa-sha256; cv=none; b=XUzY4orScXMRYMsA3p802jw8ownlo1xJHXoOeEZ6WGOnF6rSEnDtF+UvysHi44oIRb7UL+ lAGeLBYY1E2r+IYbbEXhYJ86/CIKZWMIl67BZ9lJNFzT+yNeT53WYsB2ZTfRtqALC0F3Pw Jck2q/l1+wCV2iYCuelVe7re9KdQaYnhBWhxHUKEpCwO78oaVCpDmCAG2nZQ/oqZp+0xJq qNxMu/tMg4UAtig2DZlq7b8/c0EfgUjRkwORuqs78lDAc9uUgUN+Nn0l4vv9+1N+azoEua kQCyuVJH7s7jGiaUxWrRCr1ECBd8+stKk8NyfNCp1Nj2gje6wMVROvUA1ER2rQ== 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 4Xj2Nn5yT1zmSF; Mon, 4 Nov 2024 19:59:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A4JxL9r019758; Mon, 4 Nov 2024 19:59:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4JxL30019755; Mon, 4 Nov 2024 19:59:21 GMT (envelope-from git) Date: Mon, 4 Nov 2024 19:59:21 GMT Message-Id: <202411041959.4A4JxL30019755@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 0187bc8a472e - main - sound: Include snd_cmi only for i386 and amd64 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0187bc8a472ef21ddb901f797d46075fc0d5eb14 Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=0187bc8a472ef21ddb901f797d46075fc0d5eb14 commit 0187bc8a472ef21ddb901f797d46075fc0d5eb14 Author: Jose Luis Duran AuthorDate: 2024-11-04 19:57:25 +0000 Commit: Jose Luis Duran CommitDate: 2024-11-04 19:57:25 +0000 sound: Include snd_cmi only for i386 and amd64 When running FreeBSD on an arm64/aarch64 QEMU virtual machine, using the Intel HD Audio Controller (ich6) (intel-hda), for example, and by following the procedure in the handbook ("Setting Up the Sound Card"): kldload snd_driver The following error is shown: KLD snd_driver.ko: depends on snd_cmi - not available or version mismatch This is because the CMedia sound driver (snd_cmi) is only built for i386 and amd64. Add the same guards to the snd_driver metadriver. Reviewed by: christos, emaste Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47399 --- sys/dev/sound/driver.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/sound/driver.c b/sys/dev/sound/driver.c index 6bfe6c51fa3e..13218f419a28 100644 --- a/sys/dev/sound/driver.c +++ b/sys/dev/sound/driver.c @@ -57,7 +57,9 @@ MODULE_VERSION(snd_driver, 1); MODULE_DEPEND(snd_driver, snd_als4000, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_atiixp, 1, 1, 1); +#if defined(__i386__) || defined(__amd64__) MODULE_DEPEND(snd_driver, snd_cmi, 1, 1, 1); +#endif MODULE_DEPEND(snd_driver, snd_cs4281, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_csa, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_csapcm, 1, 1, 1); From nobody Mon Nov 4 20:04:37 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj2Vs61v4z5cV2V; Mon, 04 Nov 2024 20:04:37 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj2Vs5Tm1z4M25; Mon, 4 Nov 2024 20:04:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730750677; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GceIGR5Oilc2iu2lezBC/krbXSH2/Z+wHZ0i8k4m5JI=; b=bwXxRn+yyEp9YZFNWtn1c7UC3tXJyy09SNwY80OKR/WgrdnB8h11DL7rRbP+9SdDLoKxyB jKJ09TOfqj0h5mruB7j2oLpn5LXanFpwRng944Ugdtc77YP5LwlDhFnJWK+yP6dyHRriRi Pz1sHkAA/9WoFNsg0P7ywu/e7Cij7pTEKm14NF2qZMIzvOQD6WFgUrrQ2jws+imFqAIRUl 5soNAx2incofER5UrAwpVImLOyZuvI7THeF7zHXC/+8YH1qjdPw3ZgXevjIVa/VTrmkdoY A39UxkE0qKVjypXzVeNi+6mBZfd2FAG22WeOPv/Yc8FqLAmw18l34zW4wAUIfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730750677; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GceIGR5Oilc2iu2lezBC/krbXSH2/Z+wHZ0i8k4m5JI=; b=C9ZLJTSVwcyiEBDeI4DmT50i9oOa1wsyKMFh0XwAztz146Cj/pwE2mbRJq9j6XOH09xixs zspPzZv/Ibd4ei5y/2CTWgKWlCYk+WoaYKCMwu9q8uu0UIF9l/g0AIozp3Z8Qgcz89tZQy RgqxTBcAa0vb6nIoloN7PRGYl98GanQ0crMiqqPskmYLJibaIa3QdfAYZvG0aYbqKPq9qy TLIe3T8LEU+hNUj4Y3bXKOf/9pEFBf28IfvkbzmXtWVCmtaRcLOkDcjMN3KnsvvY2wyPnC Fc9CVYlFwt7PSy3j7sf1x0nn/67IJA++ADP7ZTc/ecaqosC4xE1Pa8QpJDwTdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730750677; a=rsa-sha256; cv=none; b=nOF3EMtwU+9r1Tc2urf0u5/8FQj0kOKFeBxcWd59nC5Vl5myt8u85Nw9SOUrwVC6fXCsrZ nwsqsBwAtel7Aul/afOGp/JCerTD6+NGD3Vq9EE8Wy06z9SXO1OBY7QTjTAloeesl/7Rvp zSiEHFal1g2DJCYWtpUcD/Ge9Pl0U/eettWFZxUc2nALYCNO3e+UAoue/k48SIN94Te+Hl gHeOPswgj5dX77w+9gc1xbz8s2HXnTUstvK3QeXlgw1FFnhg8x58gkk3corHTa/YIwzlQB sNMFmCBOg3MQW5rLEMmPyuFd7aKjiE7gpk10PDp/yS1vMp4jrpELCs8fz+E3wQ== 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 4Xj2Vs552yzmQD; Mon, 4 Nov 2024 20:04:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A4K4bax038279; Mon, 4 Nov 2024 20:04:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4K4bbV038276; Mon, 4 Nov 2024 20:04:37 GMT (envelope-from git) Date: Mon, 4 Nov 2024 20:04:37 GMT Message-Id: <202411042004.4A4K4bbV038276@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 8934526be184 - main - rc: Update ipfilter example rules location List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8934526be1843ba033e1423f6ecd8b3b3f2a9c23 Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=8934526be1843ba033e1423f6ecd8b3b3f2a9c23 commit 8934526be1843ba033e1423f6ecd8b3b3f2a9c23 Author: Jose Luis Duran AuthorDate: 2024-11-04 20:02:01 +0000 Commit: Jose Luis Duran CommitDate: 2024-11-04 20:02:01 +0000 rc: Update ipfilter example rules location It was originally /usr/src/contrib/ipfilter/rules and moved to /usr/src/share/examples/ipfilter/rules in 41edb306f056. Point to users to /usr/src/share/examples/ipfilter instead, as the base directory also contains example rules. Reviewed by: emaste Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47392 --- libexec/rc/rc.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index a21c587dcc07..6689a2ab85dd 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -212,7 +212,7 @@ natd_flags="" # Additional flags for natd. ipfilter_enable="NO" # Set to YES to enable ipfilter functionality ipfilter_program="/sbin/ipf" # where the ipfilter program lives ipfilter_rules="/etc/ipf.rules" # rules definition file for ipfilter, see - # /usr/src/contrib/ipfilter/rules for examples + # /usr/src/share/examples/ipfilter for examples ipfilter_flags="" # additional flags for ipfilter ipfilter_optionlist="" # optionlist for ipf(8) -T ippool_enable="NO" # Set to YES to enable ip filter pools From nobody Mon Nov 4 20:31:05 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj35P73Ltz5cWWb; Mon, 04 Nov 2024 20:31: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj35P6WvNz4Npx; Mon, 4 Nov 2024 20:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730752265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IAvwRpXJUtjyUtzx37tUGf68NBIq5pHWl8WJJ2hmPJY=; b=nHumxyMKQ5R8hPQ4LtukZ/5FkjTqueLjD1AQMomKrFo2bBjk5jbDOxRw5QrZ6p8ZaPnfJG FFzSoSiWEjNm8IgfVCI1A1piEPhzraQcNksCMDqL8qAKS/yJNAnoRXIn71pRWEbl0mNp2P eGZ9BeSIh0B3YkZm4o7C+kcYjgPESSckY2qDJl7oGv5bmsvoAKAWFWIke+DdymeQowB1lr 0Ib/YTYxrWhO1Y+fGlziw0CsLNI9TyArVCOtS9aL9+A9x8WD9pFL0g1oa/akcdX1s9TH+a GsrSCTz0wAhIgdrvqC11IkTW1OuxX5i1MXBD3szQOyG+m0pCK/2C9Ku6tT4nQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730752265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IAvwRpXJUtjyUtzx37tUGf68NBIq5pHWl8WJJ2hmPJY=; b=K06hjR1vnTFewTFQ9zIv1pJReP/BejappHDBgar+GzfzbPBr4RsdJf8yc3gatTPcG4JjTb mg2gTBGGFKzIH/EHPnBpHSqP6Oob+eHo4Qoe+C1SIDRHctNsiMs+PyhnJXgJqAfR3UUfwE 6MsJbFI/Qmtzbx//cFqFGDeW7OCDuWQA5PqnafE4jnd3idVyU6hLCEtrz3nFhSw0MqCjxh RV9cfDtZPdgR+Ex1vljoDoPYth+1T958fTrVEixWyKzHyly7c8OMLuXAeFWxsGGvOCTXmC TAMNrxv4COT32JQjYF2P0zlCHTxXzhZNHWddJt+OqOCZaFy376js/swESyRnKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730752265; a=rsa-sha256; cv=none; b=SyoEyjQEsG9fenHz/zb5hTuctlTU2ezXD51pRm3J+1IhksVdpAGebc22dxlOJvaAFtVlr9 3h8yyOXoz0Vk3YK+ddXKf5+u7x/82xXtkkDSidJikafjKVoDrEsF5LzyzjRw69bwm82Xh5 WY7B0rekcmbNk1Hl92wpmyeZa/xCk7o1VR6HHYn0jUgWMi1w9B/oXxwXjAyf07guRxFRw6 nc65NrE6tm7z+4A7PtEAhOxDN34jDzR14MBfAEVisIrepVp1YsLgX+GfY9QGwCW11J6Ky1 BglPUfvBNkNlppP5+njI1cJVYxlqnRzbUUIb+wTe4WfxThxH7f1e4HFNMNeqMw== 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 4Xj35P5zXsznq5; Mon, 4 Nov 2024 20:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A4KV5oY087709; Mon, 4 Nov 2024 20:31:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4KV5Gv087706; Mon, 4 Nov 2024 20:31:05 GMT (envelope-from git) Date: Mon, 4 Nov 2024 20:31:05 GMT Message-Id: <202411042031.4A4KV5Gv087706@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: a4e7810f7137 - main - debug.sh check for :debug_add: List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a4e7810f71376ee43c47b6b092d11e582c80fe9d Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a4e7810f71376ee43c47b6b092d11e582c80fe9d commit a4e7810f71376ee43c47b6b092d11e582c80fe9d Author: Simon J. Gerraty AuthorDate: 2024-11-04 20:30:01 +0000 Commit: Simon J. Gerraty CommitDate: 2024-11-04 20:30:01 +0000 debug.sh check for :debug_add: When we match a tag and turn tracing, see if we have any $DEBUG_ON:debug_add:tag in DEBUG_SH and if so add the new tag. This allows for more focused debugging during boot. Reviewed by: stevek --- libexec/rc/debug.sh | 84 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 73 insertions(+), 11 deletions(-) diff --git a/libexec/rc/debug.sh b/libexec/rc/debug.sh index b098f0b359b5..db9ed8c94b6c 100755 --- a/libexec/rc/debug.sh +++ b/libexec/rc/debug.sh @@ -31,6 +31,11 @@ # If the '-o' flag is given, tracing is turned off unless there # was a matched "tag", useful for functions too noisy to tace. # +# Further; when we set "DEBUG_ON" if we find +# "$DEBUG_ON:debug_add:tag" in "DEBUG_SH" we will +# add the new "tag" to "DEBUG_SH" so it only has effect after that +# point. +# # DebugOff turns tracing on if any "tag" matches "DEBUG_OFF" or # off if any "tag" matches "DEBUG_ON". This allows nested # functions to not interfere with each other. @@ -78,7 +83,7 @@ # Simon J. Gerraty # RCSid: -# $Id: debug.sh,v 1.41 2024/10/22 17:57:22 sjg Exp $ +# $Id: debug.sh,v 1.42 2024/10/30 18:23:19 sjg Exp $ # # @(#) Copyright (c) 1994-2024 Simon J. Gerraty # @@ -97,30 +102,82 @@ _DEBUG_SH=: Myname=${Myname:-`basename $0 .sh`} -# We want to use local if we can -# if isposix-shell.sh has been sourced isPOSIX_SHELL will be set -# as will local -case "$local" in -local|:) ;; -*) +DEBUGGING= +DEBUG_DO=: +DEBUG_SKIP= +export DEBUGGING DEBUG_DO DEBUG_SKIP + +case "$isPOSIX_SHELL,$local" in +:,:|:,local|false,:) ;; # sane +*) # this is the bulk of isposix-shell.sh if (echo ${PATH%:*}) > /dev/null 2>&1; then + # true should be a builtin, : certainly is + isPOSIX_SHELL=: + # you need to eval $local var local=local + : KSH_VERSION=$KSH_VERSION + case "$KSH_VERSION" in + Version*) local=: ;; # broken + esac else + isPOSIX_SHELL=false local=: + false() { + return 1 + } fi ;; esac -DEBUGGING= -DEBUG_DO=: -DEBUG_SKIP= -export DEBUGGING DEBUG_DO DEBUG_SKIP +is_posix_shell() { + $isPOSIX_SHELL + return +} + + +## +# _debugAdd match +# +# Called from _debugOn when $match also appears in $DEBUG_SH with +# a suffix of :debug_add:tag we will add tag to DEBUG_SH +# +_debugAdd() { + eval $local tag + + for tag in `IFS=,; echo $DEBUG_SH` + do + : tag=$tag + case "$tag" in + $1:debug_add:*) + if is_posix_shell; then + tag=${tag#$1:debug_add:} + else + tag=`expr $tag : '.*:debug_add:\(.*\)'` + fi + case ",$DEBUG_SH," in + *,$tag,*) ;; + *) set -x + : _debugAdd $1 + DEBUG_SH=$DEBUG_SH,$tag + set +x + ;; + esac + ;; + esac + done + export DEBUG_SH +} + ## # _debugOn match first # # Actually turn on tracing, set $DEBUG_ON=$match # +# Check if $DEBUG_SH contains $match:debug_add:* and call _debugAdd +# to add the suffix to DEBUG_SH. This useful when we only want +# to trace some script when run under specific circumstances. +# # If we have included hooks.sh $_HOOKS_SH will be set # and if $first (the first arg to DebugOn) is suitable as a variable # name we will run ${first}_debugOn_hooks. @@ -133,6 +190,11 @@ _debugOn() { DEBUG_DO= DEBUG_SKIP=: DEBUG_X=-x + # do this firt to reduce noise + case ",$DEBUG_SH," in + *,$1:debug_add:*) _debugAdd $1;; + *,$2:debug_add:*) _debugAdd $2;; + esac set -x DEBUG_ON=$1 case "$_HOOKS_SH,$2" in From nobody Mon Nov 4 20:41:57 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj3Kx1VzFz5cWwj; Mon, 04 Nov 2024 20:41:57 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj3Kx0vY1z4Q5K; Mon, 4 Nov 2024 20:41:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730752917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+miEW736rUkPApxB9sfxJN7+tKx8E9kpY7VwREFfOfg=; b=Nkf1dUycgU/kGV8ImFpk0Be4YBxhRsmp8F3J1kUUYaFJcPNeUWgyGBMKcXjKGcGvt7ZQ1k rL6WgH4l8CRL8KFNIsxrjji/Z123RysVe8oRKcR8hHxwsvQUJ9hm73l4NmTcCEoVZDtZiK +O/TnVHj2FDYsMJJ7FWq6pYU4lGVuWWpMtCNNFxlgU5WnTbJMc6U1lLDaW0Ph+jjcOuF+n LL7bGRGP/SCZGZq6oV6jma/X3tZuXmf7wUNB64mf9KXnzgP69MxqLXWt/PphsNmCjfq3Vc pHzECxedidjUBA4DwORAvVyx0rla07olVC/dmtDDPpMmk3NjPx2rEpE1uyQFag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730752917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+miEW736rUkPApxB9sfxJN7+tKx8E9kpY7VwREFfOfg=; b=VsZdsNMvhgraXY25NQhh2CYPZJiUw60T8cxH0vpYRuNpXS7/CDBfCz8WqoAU32GmpnlKPo sgT92PAvWXYRBpBO7zFXoHjAfTAkvbstgJV/R/0GozIy86LOzrpLZwk5893vD51iyVGXcF zpuus51ovoPnEg6ilbiQhb7ogN+zeIHP+NiwHPW6xNfjwDKZCnSlJFFqn0Wl60NTTOiAxV FX1LV/OS5xneJo1orqjrKEq/hJs97usLBOXkExXLl7oEOzMJFLIeCY40RcbsB/dHPxiThq PGcHb9FKXlHqADksHWvoxCMUxv9odzAQYlQNcwBApI+q46Z/MiF0a33CRqiM0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730752917; a=rsa-sha256; cv=none; b=fXk+scDvMXw0+FUGPKdpAxUOos5L/e84l/xAQDGqOOJ30oSnE5ywO8+ZZsbmYal2ZkJhaw rV+pxD3unu4t4v0Mws1H2HTJIMgM9RuBlqXMFMT0OElMXgzWrKvD4VkJz/k6sNqLgUbPlu 9rMw8X4kXRn2p5OkUFtcSJnNG0sqYct2p7sgYNxx/fqcHj0i+uEIVwHeH+xT0keINvXxYb /DW6eofQ3i4MTFJG5ksclipbecb41FgmM5LuDumSouSHMgOvVejOLWsKtFdSsPn0fIJlXY LONJSYPiFoKvwfQfZ18BIDgb6F5fYunHaHQ/Q5dVTh9VX3h4crCvOLxQOjzm8A== 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 4Xj3Kx0VkSznc6; Mon, 4 Nov 2024 20:41:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A4KfviX010358; Mon, 4 Nov 2024 20:41:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4Kfvg7010355; Mon, 4 Nov 2024 20:41:57 GMT (envelope-from git) Date: Mon, 4 Nov 2024 20:41:57 GMT Message-Id: <202411042041.4A4Kfvg7010355@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 4026b17bac6b - main - vt.4: align tables + 80 character line limit List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4026b17bac6b343acc8d3163282749384eb35e26 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4026b17bac6b343acc8d3163282749384eb35e26 commit 4026b17bac6b343acc8d3163282749384eb35e26 Author: Alexander Ziaee AuthorDate: 2024-11-04 04:48:20 +0000 Commit: Ed Maste CommitDate: 2024-11-04 20:41:26 +0000 vt.4: align tables + 80 character line limit Reviewed by: emaste MFC after: 3 days Pull request: https://github.com/freebsd/freebsd-src/pull/1514 --- share/man/man4/vt.4 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/share/man/man4/vt.4 b/share/man/man4/vt.4 index 6f223d67eb09..4c115b68a80d 100644 --- a/share/man/man4/vt.4 +++ b/share/man/man4/vt.4 @@ -312,7 +312,7 @@ or changed at runtime with Enable the terminal bell. .El .Sh FILES -.Bl -tag -width /usr/share/vt/keymaps/* -compact +.Bl -tag -width "/usr/share/vt/keymaps/*.kbd" -compact .It Pa /dev/console .It Pa /dev/consolectl .It Pa /dev/ttyv* @@ -325,13 +325,12 @@ console fonts keyboard layouts .El .Sh DEVCTL MESSAGES -.Bl -column "System" "Subsystem" "1234567" -compact +.Bl -column "System" "Subsystem" "Type" "Description" .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li VT Ta BELL Ta RING Ta Notification that the console bell has rung. .El -.Pp -.Bl -column "Variable" "Meaning" -compact +.Bl -column "duration_ms" "Meaning" .Sy "Variable" Ta Sy "Meaning" .It Li duration_ms Ta Length of time the bell was requested to ring in milliseconds. .It Li enabled Ta true or false indicating whether or not the bell was administratively enabled when rung. @@ -357,7 +356,8 @@ To set a 1024x768 mode on all output connectors, put the following line in .Pp .Dl kern.vt.fb.default_mode="1024x768" .Pp -To set a 800x600 only on a laptop builtin screen, use the following line instead: +To set a 800x600 only on a laptop builtin screen, +use the following line instead: .Pp .Dl kern.vt.fb.modes.LVDS-1="800x600" .Pp From nobody Mon Nov 4 21:08:50 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj3y86ZvNz5cYHY; Mon, 04 Nov 2024 21:09:52 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [IPv6:2a01:4f8:13b:240c::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail.bsd4all.net", Issuer "E6" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj3y84QCzz4V8r; Mon, 4 Nov 2024 21:09:52 +0000 (UTC) (envelope-from herbert@gojira.at) Authentication-Results: mx1.freebsd.org; none Date: Mon, 04 Nov 2024 22:08:50 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail202005; t=1730754584; bh=iI4/Tvjutfo9O8GZXRlS6eOoLbswB5FcFLwyZJTBPWg=; h=Date:Message-ID:From:To:Cc:Subject:MIME-Version:Content-Type; b=IqpSI+CvLWz8lkxCkggmySLZ5pJgJ6GqRlhRPmP03wxq9qpL+GyV23xpz3Ej5AxSg FUchDXTokFlkO7YMF9Tq0Cmfk4LDg32raUlQRzsh4LPtOdvn11vQFAhWzVAsRcN6wY pX4oB7QR7K0DNyhUiyNHeldLEff39VWlypjAeNAE9l3VBkrmpFuvpjiiWm3e+3X7JK R4yht1q2d3szSWuQ09TMaPepJ0TEv80GkanOj93BtkTWANt0q7Ta+7xNXg1OAdgF2v KO5KfaZN8xt1mrYp+usC4GkW+cp1xuO/RQ5q53Qq5i7XNuWHcPOcmanjeKpagpAE39 2y0kGWh5oXXQw== Message-ID: <875xp2puzh.wl-herbert@gojira.at> From: "Herbert J. Skuhra" To: Dima Panov Cc: Dimitry Andric , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 5deeebd8c6ca - main - Merge llvm-project release/19.x llvmorg-19.1.2-0-g7ba7d8e2f7b6 In-Reply-To: <7eccc976-540e-4f2d-89b5-ae1f989cd419@FreeBSD.org> References: <202410231832.49NIWcTJ078019@gitrepo.freebsd.org> <40b4bd4a-5065-4cec-a59d-42cb456992b2@FreeBSD.org> <6D12AFD9-AFD8-4EA6-B215-B5F8986CB109@FreeBSD.org> <7eccc976-540e-4f2d-89b5-ae1f989cd419@FreeBSD.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/31.0 Mule/6.0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/32, country:DE] X-Rspamd-Queue-Id: 4Xj3y84QCzz4V8r X-Spamd-Bar: ---- On Mon, 04 Nov 2024 18:07:16 +0100, Dima Panov wrote: > > Indeed, root of evil was hidden in devel/binutils with RELRO option enabled. > After disabling RELRO option in binutils all lang/gcc* build are fine again. > > Anyway it is a big bad regression here. > I have RELRO enabled in binutils port fot long time and had no issues with gcc builds before this llvm19 import. Have you tried to rebuild devel/binutils without disabling RELRO? I have enabled RELRO and rebuilt devel/binutils and I could build lang/gcc14 on arm64. I haven't tried the other gcc ports. From nobody Tue Nov 5 01:29:07 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj9jJ2KYDz5cpYm; Tue, 05 Nov 2024 01:29: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj9jH71Ppz4rsN; Tue, 5 Nov 2024 01:29:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WXeSAjbXxHyv7o8jR2ZmcQZwcTGNCPozKLWcavhLbkQ=; b=fVda0uqxL9GQNRPemERhzlYbX1vPXvAWabb7KUBXcCP/bbUUVxhbQ5e+y3AbgWTGyDvok9 SoYkJ6X01ap4AHS72wGTy9hpDvjmGyVSjdmmrnKYFXiCOsdkJWma7CfpuOwqSOPM+1zKLD mTk+tXsoqCeVc28cSHwO56JfhiMJfzABvj8Pu1hytNxG+Nek6tVTtYp270mkuBhF4Xz3ok znVLtCJcIJppCtP5YmCYrskXAoM9QRIyzB/uOgjH921kF1pelE1gIXfkKSleZ2/MzB+wib GjvDSikyVvbr5wpQNEn7qPjNhvNjit9w2OwRkSymcZQVboXmlTgRxnoap9yMwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WXeSAjbXxHyv7o8jR2ZmcQZwcTGNCPozKLWcavhLbkQ=; b=UQ01ajgCrXFbtSeKqRLQOvCEAqzPP/WpNdvCg43bGVKAmpZxtXEWI0q1J3FRRTguJzgPPv HelvYroPULnVcNRuy85wSxgp8J7uQmluS2T5HCZWcfFNPh9qAotviwintUiwcC9KGPNfH9 cxZjTLxq4LK8HRiCA+a3DPlO9ioNKKQCgh23+SmWKJYGzwIxtqVxYEFxEavOyma7w0IbuK HAILOPZo5J8xnsQQ6uV13odSab5aPb8ioEm+Ulq84+AfsF/iUD1VDGnQPtiOqzDnplDK/C tpiVccCeur6v+Fx+7USWWi7r0ukeOENVGMlodAEtnhEBy/mAzVhLfmTl+EuxLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730770148; a=rsa-sha256; cv=none; b=YgoNHXKdNuBr+ANaluOO+HGVR+0m7oyYt3hg7czkNj15N2ljZmZJqnuWW71MvZUhKK52c1 Q6jfbBYQejG4ZyLfxyfy0A/0y6Yy+wzG3Zq2VdqQFQUjlAqwqMytvuX3mJCCZRszF+X/n6 u8QMWSJoy4X7fuYzk9P6HdsHXmLRuBjWA3blzVY4clX8g0LNaGFoNf8ZHJEk8ZcRqbOFrz bCI5+dlbvSscl7O961mlR41ayZKkO1aurDMUV14CBePmEqcCp5fD7bIKyNJ9xytfaNgTx2 iaoKKl9AsL/N01g4F7PUa6ej4kj3jZ8/uuE5ihBZ9eBkg0W6n4p8yYQ0cHeT5A== 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 4Xj9jH4yQmzxJg; Tue, 5 Nov 2024 01:29:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A51T7ib031928; Tue, 5 Nov 2024 01:29:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A51T7r3031925; Tue, 5 Nov 2024 01:29:07 GMT (envelope-from git) Date: Tue, 5 Nov 2024 01:29:07 GMT Message-Id: <202411050129.4A51T7r3031925@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 8922c5b8211e - main - nvmf: Fix an off by one error when scanning active namespace IDs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8922c5b8211e5b2f64b10791b51d08d5b7945f56 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8922c5b8211e5b2f64b10791b51d08d5b7945f56 commit 8922c5b8211e5b2f64b10791b51d08d5b7945f56 Author: John Baldwin AuthorDate: 2024-11-05 01:27:14 +0000 Commit: John Baldwin CommitDate: 2024-11-05 01:27:14 +0000 nvmf: Fix an off by one error when scanning active namespace IDs The active namespace list query fetches namespaces greater than the passed in namespace ID, not greater than or equal to the passed in namespace ID. Thus, a multi-page request should start with the last namespace ID from the previous page, not that ID plus 1. While here, make use of NVME_GLOBAL_NAMESPACE_TAG instead of a magic number to handle the edge case that the last namespace ID in a page is the largest valid namespace ID. Reviewed by: chuck Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D47393 --- sys/dev/nvmf/host/nvmf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/nvmf/host/nvmf.c b/sys/dev/nvmf/host/nvmf.c index 2c438db2eb23..804e7528c931 100644 --- a/sys/dev/nvmf/host/nvmf.c +++ b/sys/dev/nvmf/host/nvmf.c @@ -376,10 +376,10 @@ nvmf_scan_active_nslist(struct nvmf_softc *sc, struct nvme_ns_list *nslist, MPASS(nsid == nslist->ns[nitems(nslist->ns) - 1] && nsid != 0); - if (nsid >= 0xfffffffd) + if (nsid >= NVME_GLOBAL_NAMESPACE_TAG - 1) *nsidp = 0; else - *nsidp = nsid + 1; + *nsidp = nsid; return (true); } From nobody Tue Nov 5 01:29:08 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj9jK1qnCz5cplM; Tue, 05 Nov 2024 01:29: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj9jK0lzKz4rmD; Tue, 5 Nov 2024 01:29:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S5sVZKmxdH8eT9UfH9hDeOTEKw1XkE8XmkKTXtNnerw=; b=nargsosMFbxkT/Tiiq1aVXPnSusSA+E6HIllyH0k6gRzIsb8bVCppNaczh8HPUOowi6CmS 851dGisecBzb+n+HXC87qZdmk3dDkD90nLMFQ1naIehlQEEf5FFuabR4964ykIy01U2IBQ PKJxY/TkuouoW0K7jWs4yvJancm5x3yE4Bz5lPjR5YJtIVlR9Zf75kwBQoK3r8jChE5Vq5 ZXIbUnnzDL3r4JdoF1nJ/YVxmWvRtrL/5kiCiocWjiiVXEggiHY74VBprnD5YIMcktyVDA xezMWmDI7hMVFtT56WxwQdl4juqkwpU0MLXrjKzdAtLfq57A0AKBnvRsbjrBNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S5sVZKmxdH8eT9UfH9hDeOTEKw1XkE8XmkKTXtNnerw=; b=mnBGnwY8cX5Xqq0FU54rG4eIbNTlME1DXehNUSejlZWV7PzeKj58erQH07Xl2h0V/9veom q1kilUiYwPfCRv3SnDY+z3qVdpGTC5waWHyTVioh+45lXxeSO0jS36/ENNUWgOrXVakzoh 1SLsO2A7QXaQeMXRE8SWhUtVf3v8BNCbC5x56WiXRs4108KI5miYZxYNCeCuemgOTIDpDz 9j6YLGP5gkTkW9rC3cFrxqN79s1JY2oo4qjTzvPd5mzc7gOJ89ybYKMrA4gSkAi3F2P2EB m2fQfpRqPhh6WgbqV8Fah1IeVEMPR/hR5l7dMvTYR41aorvr1CT1pbyR0d86iA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730770149; a=rsa-sha256; cv=none; b=uHZB/Jds/t4ULNWtIUdbM0EG/PsUf0dpkAkH5kpwTLGwoRDEGooEhBY4NxBA0wyb3mVp9y F2DjnOZZtXxIQLbwIQ75bENAPC9cZKX+OjU1xa8ibFxB4LMm3ExSQoianx0OC7MtOhxZEv g7f8/F942RAPKgcPKWXrpiyPHbjkdmEBUYE+VfjuZ1OiXHGW3fVvCqR9dLNmCOiZOHvhdz FvN7RnxGRj2BtENqoZB8W77nrU71QfYWDiGvTqZTCXfJKlUxq5Bm6QtBTMQnVuIsMw0dIh B748aY3ilbBiPaDbz2W97GFNm1RHGM1DQ9GbsZUsC8FFGoTtwf7ENtNV+tTcUA== 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 4Xj9jJ62WNzxP6; Tue, 5 Nov 2024 01:29:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A51T8Xd032005; Tue, 5 Nov 2024 01:29:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A51T8Pt032002; Tue, 5 Nov 2024 01:29:08 GMT (envelope-from git) Date: Tue, 5 Nov 2024 01:29:08 GMT Message-Id: <202411050129.4A51T8Pt032002@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 326e20fc1252 - main - nvmecontrol: Refactor devlist implementation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 326e20fc1252577f96df0e53360507180cc9d153 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=326e20fc1252577f96df0e53360507180cc9d153 commit 326e20fc1252577f96df0e53360507180cc9d153 Author: John Baldwin AuthorDate: 2024-11-05 01:28:26 +0000 Commit: John Baldwin CommitDate: 2024-11-05 01:28:26 +0000 nvmecontrol: Refactor devlist implementation Split out helper functions for scan_namespace and scan_controller. While here, replace sprintf() calls with snprintf() and avoid leaking the contoller fd if read_controller_data() fails. Reviewed by: chuck, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D47354 --- sbin/nvmecontrol/devlist.c | 99 +++++++++++++++++++++++++++------------------- 1 file changed, 59 insertions(+), 40 deletions(-) diff --git a/sbin/nvmecontrol/devlist.c b/sbin/nvmecontrol/devlist.c index 2b34899d3aea..b2816339bc80 100644 --- a/sbin/nvmecontrol/devlist.c +++ b/sbin/nvmecontrol/devlist.c @@ -89,16 +89,68 @@ ns_get_sector_size(struct nvme_namespace_data *nsdata) } static void -devlist(const struct cmd *f, int argc, char *argv[]) +scan_namespace(int fd, int ctrlr, uint32_t nsid) +{ + struct nvme_namespace_data nsdata; + char name[64]; + uint8_t buf[7]; + uint64_t size; + + if (read_namespace_data(fd, nsid, &nsdata) != 0) + return; + if (nsdata.nsze == 0) + return; + snprintf(name, sizeof(name), "%s%d%s%d", NVME_CTRLR_PREFIX, ctrlr, + NVME_NS_PREFIX, nsid); + size = nsdata.nsze * (uint64_t)ns_get_sector_size(&nsdata); + if (opt.human) { + humanize_number(buf, sizeof(buf), size, "B", + HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); + printf(" %10s (%s)\n", name, buf); + } else { + printf(" %10s (%juMB)\n", name, (uintmax_t)size / 1024 / 1024); + } +} + +static bool +scan_controller(int ctrlr) { struct nvme_controller_data cdata; - struct nvme_namespace_data nsdata; char name[64]; uint8_t mn[64]; - uint8_t buf[7]; uint32_t i; - uint64_t size; - int ctrlr, fd, found, ret; + int fd, ret; + + snprintf(name, sizeof(name), "%s%d", NVME_CTRLR_PREFIX, ctrlr); + + ret = open_dev(name, &fd, 0, 0); + + if (ret == EACCES) { + warnx("could not open "_PATH_DEV"%s\n", name); + return (false); + } else if (ret != 0) + return (false); + + if (read_controller_data(fd, &cdata) != 0) { + close(fd); + return (true); + } + + nvme_strvis(mn, cdata.mn, sizeof(mn), NVME_MODEL_NUMBER_LENGTH); + printf("%6s: %s\n", name, mn); + + for (i = 0; i < cdata.nn; i++) { + scan_namespace(fd, ctrlr, i + 1); + } + + close(fd); + return (true); +} + +static void +devlist(const struct cmd *f, int argc, char *argv[]) +{ + int ctrlr, found; if (arg_parse(argc, argv, f)) return; @@ -108,41 +160,8 @@ devlist(const struct cmd *f, int argc, char *argv[]) while (ctrlr < NVME_MAX_UNIT) { ctrlr++; - sprintf(name, "%s%d", NVME_CTRLR_PREFIX, ctrlr); - - ret = open_dev(name, &fd, 0, 0); - - if (ret == EACCES) { - warnx("could not open "_PATH_DEV"%s\n", name); - continue; - } else if (ret != 0) - continue; - - found++; - if (read_controller_data(fd, &cdata)) - continue; - nvme_strvis(mn, cdata.mn, sizeof(mn), NVME_MODEL_NUMBER_LENGTH); - printf("%6s: %s\n", name, mn); - - for (i = 0; i < cdata.nn; i++) { - if (read_namespace_data(fd, i + 1, &nsdata)) - continue; - if (nsdata.nsze == 0) - continue; - sprintf(name, "%s%d%s%d", NVME_CTRLR_PREFIX, ctrlr, - NVME_NS_PREFIX, i + 1); - size = nsdata.nsze * (uint64_t)ns_get_sector_size(&nsdata); - if (opt.human) { - humanize_number(buf, sizeof(buf), size, "B", - HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); - printf(" %10s (%s)\n", name, buf); - - } else { - printf(" %10s (%juMB)\n", name, (uintmax_t)size / 1024 / 1024); - } - } - - close(fd); + if (scan_controller(ctrlr)) + found++; } if (found == 0) { From nobody Tue Nov 5 01:29:09 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj9jL1MxDz5cpsq; Tue, 05 Nov 2024 01:29: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj9jL0grHz4rkJ; Tue, 5 Nov 2024 01:29:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770150; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=merL+sDpTQar0uMic2Ox9ArV/Q2iKgSCApjfIzgD/Kg=; b=nOh4JDTAMSNECW7wzygAWATfLJkaQe2WyYN6QPLP5XCmFyMY3pfWr6DAag92lmR0INS1K9 xZho6XtPxQifgHgoU1vBPEieVh/oySn1GK9n7TCmzInVNAqcsE+D5CVKa4K1OJb79nFElD t82hgb5zoxt1Hw24fDE7whHYoL29P4MEwP1FCa3R4B16O0CA3T3VJlRzbwakbtp28/2zh1 u3Yv/Hrq75PL80hJrq5r34jJHdsv9gYe2Ch2+cumFKl6SbAJh/h6wzfDSGMDepF1b4uFVY eRN2rT/fHC9AX4mvf/snaMCoJblKf6usbTPugJmAAMB/kW7OrTHLZjTtlCKm6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770150; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=merL+sDpTQar0uMic2Ox9ArV/Q2iKgSCApjfIzgD/Kg=; b=X91Y21JfbD9j0y86cdhQWBNRGR6Xj4OUZNtfkG8fv5e8v35RLKTVFbkly1qykE/+lwx+BU FiNgxOm6w4zpBZgEw7hsmw0VN41aye7tHR6i/gHfCjh9YNsqpwmK1PtZmYAXP9069SkX5g 7GuRIZfd1dBqxlIaZhA0zZrWyzSY6i2zEnqD/kWPoIdnMA0PuvDVDJ8MD/xoDJvUkRh+11 TVO6M6AsVZS1VK8pePA9lEQvUnxA1MclisP6Ps3GxY5rKAF+4JsskmpjXw5y5CkJ8ZcW// CYrF9kRPiRexQJy5Y8xUlvcFj5zMQAb9uXsUka/f0fGVBFT1mDRQMKbRGDCQEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730770150; a=rsa-sha256; cv=none; b=n7f52bdTR32IaD3GfSfziJtbe8F4MGo6j+Js2gqW+CkeqOJ+3hpFGU7D7M7W/TL4U/X6oX 5rBRViy4pB7AF/Yx9trY/2D66T5dY6RJOMvDT3LxPJ1Zkx9PlieFLsoYtSiV8OJXXdfe0F o4ogfaCKgwI5fuNevnMYz8EyqFPTUBGdiJ7CJPq7UcnoX1yHkm6ADKL8DOqU9moFHeVKxj LkYuGe0gDPmh7ApuM7If4MDQWCyfrqxo+jVvunUehWV/8NTq164h73/XDUWnCryDRtOQKF kpXb3NLTBbQDnslCTRLvtkUhYsJUHyh3ICWSwicR7ssLuOGrZkqgtmiSqZw0rw== 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 4Xj9jK6gcKzwwN; Tue, 5 Nov 2024 01:29:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A51T9Ib032058; Tue, 5 Nov 2024 01:29:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A51T9uk032055; Tue, 5 Nov 2024 01:29:09 GMT (envelope-from git) Date: Tue, 5 Nov 2024 01:29:09 GMT Message-Id: <202411050129.4A51T9uk032055@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 9e1db51d4b5f - main - nvmecontrol: Use active nslist to enumerate namespaces List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9e1db51d4b5fce8a1ea7271018970760e396500c Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9e1db51d4b5fce8a1ea7271018970760e396500c commit 9e1db51d4b5fce8a1ea7271018970760e396500c Author: John Baldwin AuthorDate: 2024-11-05 01:28:40 +0000 Commit: John Baldwin CommitDate: 2024-11-05 01:28:40 +0000 nvmecontrol: Use active nslist to enumerate namespaces Rather than probing all namespace IDs up to cdata.nn for the devlist command, fetch the active namespace list and iterate over that. This can be much quicker on Fabrics controllers which often advertise a large cdata.nn value to support adding additional namespaces at runtime. Reviewed by: chuck Reported by: Neven Z Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D47355 --- sbin/nvmecontrol/devlist.c | 19 ++++++++++++++++--- sbin/nvmecontrol/nvmecontrol.c | 24 ++++++++++++++++++++++++ sbin/nvmecontrol/nvmecontrol.h | 1 + 3 files changed, 41 insertions(+), 3 deletions(-) diff --git a/sbin/nvmecontrol/devlist.c b/sbin/nvmecontrol/devlist.c index b2816339bc80..d2386e7ea800 100644 --- a/sbin/nvmecontrol/devlist.c +++ b/sbin/nvmecontrol/devlist.c @@ -116,9 +116,10 @@ static bool scan_controller(int ctrlr) { struct nvme_controller_data cdata; + struct nvme_ns_list nslist; char name[64]; uint8_t mn[64]; - uint32_t i; + uint32_t nsid; int fd, ret; snprintf(name, sizeof(name), "%s%d", NVME_CTRLR_PREFIX, ctrlr); @@ -139,8 +140,20 @@ scan_controller(int ctrlr) nvme_strvis(mn, cdata.mn, sizeof(mn), NVME_MODEL_NUMBER_LENGTH); printf("%6s: %s\n", name, mn); - for (i = 0; i < cdata.nn; i++) { - scan_namespace(fd, ctrlr, i + 1); + nsid = 0; + for (;;) { + if (read_active_namespaces(fd, nsid, &nslist) != 0) + break; + for (u_int i = 0; i < nitems(nslist.ns); i++) { + nsid = nslist.ns[i]; + if (nsid == 0) { + break; + } + + scan_namespace(fd, ctrlr, nsid); + } + if (nsid == 0 || nsid >= NVME_GLOBAL_NAMESPACE_TAG - 1) + break; } close(fd); diff --git a/sbin/nvmecontrol/nvmecontrol.c b/sbin/nvmecontrol/nvmecontrol.c index 8ad9703de9f6..b38fb8038fc3 100644 --- a/sbin/nvmecontrol/nvmecontrol.c +++ b/sbin/nvmecontrol/nvmecontrol.c @@ -142,6 +142,30 @@ read_namespace_data(int fd, uint32_t nsid, struct nvme_namespace_data *nsdata) return (0); } +int +read_active_namespaces(int fd, uint32_t nsid, struct nvme_ns_list *nslist) +{ + struct nvme_pt_command pt; + + memset(&pt, 0, sizeof(pt)); + pt.cmd.opc = NVME_OPC_IDENTIFY; + pt.cmd.nsid = htole32(nsid); + pt.cmd.cdw10 = htole32(2); + pt.buf = nslist; + pt.len = sizeof(*nslist); + pt.is_read = 1; + + if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) + return (errno); + + /* Convert data to host endian */ + nvme_ns_list_swapbytes(nslist); + + if (nvme_completion_is_error(&pt.cpl)) + return (EIO); + return (0); +} + int open_dev(const char *str, int *fd, int write, int exit_on_error) { diff --git a/sbin/nvmecontrol/nvmecontrol.h b/sbin/nvmecontrol/nvmecontrol.h index 394a88608692..968e9c20160e 100644 --- a/sbin/nvmecontrol/nvmecontrol.h +++ b/sbin/nvmecontrol/nvmecontrol.h @@ -81,6 +81,7 @@ int open_dev(const char *str, int *fd, int write, int exit_on_error); void get_nsid(int fd, char **ctrlr_str, uint32_t *nsid); int read_controller_data(int fd, struct nvme_controller_data *cdata); int read_namespace_data(int fd, uint32_t nsid, struct nvme_namespace_data *nsdata); +int read_active_namespaces(int fd, uint32_t nsid, struct nvme_ns_list *nslist); void print_hex(void *data, uint32_t length); void print_namespace(struct nvme_namespace_data *nsdata); void read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp, From nobody Tue Nov 5 01:33:42 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj9pZ6c9rz5cqDf; Tue, 05 Nov 2024 01:33:42 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj9pZ5mnMz4sxh; Tue, 5 Nov 2024 01:33:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LDCmomfpZf8C5u42WwKjtqTLJkR7nPOgiwOTZaH9Iaw=; b=MrgMeU9mUhJrhOtdEKV0IsU9XV3TfFTgAVXxYWRffzfq8NbN4oXsvI+z4uJOehmQV0PEb5 184INVvXia9L761ffa1hAEAyx5XwGlx4keglupj6mr6aRhbx3a8NmC8To0+mgq9p/44kLz 0CriqpfSHWrC7JvI0rlP2Xa2qz33RLwjKwZqH9XHxRMSVTkcMQKE+/99nUee6Lp3C//QWF xwsN6TSB9Z5yLIi9Y4GwtwWQKWErFDfqrC8Cx9hdsyrw9yIzb1VKeu/d8Nn1qb41x/s3/7 n3ob8GIlMajx8nwH4RV2ZJDrzRREfbBjTWNsLSDXvgdcx2XpAto31AYhvB5J1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LDCmomfpZf8C5u42WwKjtqTLJkR7nPOgiwOTZaH9Iaw=; b=lST2Sbd35hDYDk4Yzs7FO8sT9KtniI0njrIBVbv5okLHci+HPrc69h5SwFRcHHnCZNqkzC 3+wgbXb8Xj+S0FLgFopwGQISTJ3mVLGcX9cRlaoxmpozIX2EtzB6z+JV+Vv0BBLvIkxORD oyF1Yr9VjUOaunDRjgKzA9bZMcSh68HVNES82WTel0oJpM9PGy0wssljU2c+2vW1WoyOiX cGKF40KOta7E44+I7OaPIYlbwYVPIwqKKcT8fG5dKzhmkuUxRqkviwR/QNdxUv4Cn6/gkN RfbzAbWQpTYxlQJha9jUhfLHaYoxeoCKWKWu7scnFkr3faMziDjEQ8PapP6DXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730770422; a=rsa-sha256; cv=none; b=gt3u/BPax+R5TCA7X9pblORWgI7RFXwNN1QYBHCMV5T1qonMkiNd4VOW4074pDqFYKam8V +mlSdHuNmcdbRs70h6tljZo5ZSsQHR4iXZ9mfZb9J0IgVVgzx0f8atAsJM7sRGXWNju7JN vHMfqOEng3VmpBSHkM91DpzOSZ0/R+R8sfQsKz81iuclkd3vgjtandNF6387HJDEuOgvne sPYjBYzsbhJD6GXnxpf2d5pgp9T9cfrrx4L30Iws22C8MM7JIVoxrCUNHTcvViDuopLxwK RJiOrNXy9M57ADWcMt9v1POYfsm4S2IAWBRBwAOnmcLi96iqHv+2zVzFJorTeQ== 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 4Xj9pZ5Mj2zx70; Tue, 5 Nov 2024 01:33:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A51Xgl2049070; Tue, 5 Nov 2024 01:33:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A51XgO4049067; Tue, 5 Nov 2024 01:33:42 GMT (envelope-from git) Date: Tue, 5 Nov 2024 01:33:42 GMT Message-Id: <202411050133.4A51XgO4049067@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: d62d10eb1229 - main - Use bus_generic_detach directly instead of a wrapper List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d62d10eb1229c9aa0b3cf1b18872df59c18155db Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d62d10eb1229c9aa0b3cf1b18872df59c18155db commit d62d10eb1229c9aa0b3cf1b18872df59c18155db Author: John Baldwin AuthorDate: 2024-11-05 01:30:13 +0000 Commit: John Baldwin CommitDate: 2024-11-05 01:30:13 +0000 Use bus_generic_detach directly instead of a wrapper Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47386 --- sys/dev/acpica/acpi_container.c | 10 +--------- sys/dev/adb/adb_bus.c | 8 +------- sys/dev/mdio/mdio.c | 10 +--------- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/sys/dev/acpica/acpi_container.c b/sys/dev/acpica/acpi_container.c index 0f23f6b25fe1..81a1ee8ce25c 100644 --- a/sys/dev/acpica/acpi_container.c +++ b/sys/dev/acpica/acpi_container.c @@ -38,7 +38,6 @@ ACPI_MODULE_NAME("CONTAINER") static int acpi_syscont_probe(device_t); static int acpi_syscont_attach(device_t); -static int acpi_syscont_detach(device_t); static int acpi_syscont_alloc_msi(device_t, device_t, int count, int maxcount, int *irqs); static int acpi_syscont_release_msi(device_t bus, device_t dev, @@ -54,7 +53,7 @@ static device_method_t acpi_syscont_methods[] = { /* Device interface */ DEVMETHOD(device_probe, acpi_syscont_probe), DEVMETHOD(device_attach, acpi_syscont_attach), - DEVMETHOD(device_detach, acpi_syscont_detach), + DEVMETHOD(device_detach, bus_generic_detach), /* Bus interface */ DEVMETHOD(bus_add_child, bus_generic_add_child), @@ -108,13 +107,6 @@ acpi_syscont_attach(device_t dev) return (bus_generic_attach(dev)); } -static int -acpi_syscont_detach(device_t dev) -{ - - return (bus_generic_detach(dev)); -} - static int acpi_syscont_alloc_msi(device_t bus, device_t dev, int count, int maxcount, int *irqs) diff --git a/sys/dev/adb/adb_bus.c b/sys/dev/adb/adb_bus.c index 8c805254a2e6..9e0d1f2a1ce5 100644 --- a/sys/dev/adb/adb_bus.c +++ b/sys/dev/adb/adb_bus.c @@ -42,7 +42,6 @@ static int adb_bus_probe(device_t dev); static int adb_bus_attach(device_t dev); -static int adb_bus_detach(device_t dev); static void adb_bus_enumerate(void *xdev); static void adb_probe_nomatch(device_t dev, device_t child); static int adb_print_child(device_t dev, device_t child); @@ -57,7 +56,7 @@ static device_method_t adb_bus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, adb_bus_probe), DEVMETHOD(device_attach, adb_bus_attach), - DEVMETHOD(device_detach, adb_bus_detach), + DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, bus_generic_resume), @@ -188,11 +187,6 @@ adb_bus_enumerate(void *xdev) config_intrhook_disestablish(&sc->enum_hook); } -static int adb_bus_detach(device_t dev) -{ - return (bus_generic_detach(dev)); -} - static void adb_probe_nomatch(device_t dev, device_t child) { diff --git a/sys/dev/mdio/mdio.c b/sys/dev/mdio/mdio.c index c34493254e0f..64d3b23c2372 100644 --- a/sys/dev/mdio/mdio.c +++ b/sys/dev/mdio/mdio.c @@ -59,14 +59,6 @@ mdio_attach(device_t dev) return (bus_generic_attach(dev)); } -static int -mdio_detach(device_t dev) -{ - - bus_generic_detach(dev); - return (0); -} - static int mdio_readreg(device_t dev, int phy, int reg) { @@ -108,7 +100,7 @@ static device_method_t mdio_methods[] = { DEVMETHOD(device_identify, mdio_identify), DEVMETHOD(device_probe, mdio_probe), DEVMETHOD(device_attach, mdio_attach), - DEVMETHOD(device_detach, mdio_detach), + DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), /* bus interface */ From nobody Tue Nov 5 01:33:43 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj9pc0VZPz5cq3D; Tue, 05 Nov 2024 01:33: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj9pb6DWQz4tN0; Tue, 5 Nov 2024 01:33:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KYTqBjEio8cnucYU4fGPn5XVZx1rHon4UOzkAH6bB+s=; b=Mh9LQ7ZZpiiHgkjvNDkyyzRrSTrDZqBYND0X8ITx7tNfasbBreOenNi73VK9cEBAOeKX7N d/v3BTdFpPvZL47IBEoz8WpgRUiL0qxJWpkUdZWmzEA+tVNzls1NCAIa0MOtZapTjvT0E1 foGhnH+IELzrOAwoai9+/v4PiLoGXWqohfa1azF/6Un1V4Ml0b9HVCI4F3MNfIkc7f7sqa sUIpznMkt2FfFEIeYONQp/ey0B5m3iejIjxYbTf3UHig9hvIdLjqn0Y5imynmDlBsLUk8M BGySvzAt3F1+yCH/62j51eWZ1yrjEVlb60EhOiuxm5wabO35dOvAGf71Ue1YeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KYTqBjEio8cnucYU4fGPn5XVZx1rHon4UOzkAH6bB+s=; b=qEsAP6wmab6b8e7Cf/HWBvR+/pdEvALiUOaHKlTjTkxTwoxE6tWoY/gIRD0TgAirtmE2sr 6hPldrT25jqRXWiqD9/Ked1kt8O6PfWJb8AOHAj2kdV9nkxiBq/bhTjvpeedbZj68t1ktM 0s0wlwp6PSr8Vou2QmxywBOPJSZtPnetZlL3gIUnENYRmlZf6QKKOODhsbLw1nnnmblBS3 uD/U/0EU/6Ek/VgJI5bzt+29pSSJlbC6dZSPRK2AXyo//yCiPzYyZBTc+mLZXmaJx0H1xz 9QN5+gEn+d4EvP6Trx9YWo7/y5BnERTa/LtU+FAd4HYLVDaXb6SmvEhl7FFtkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730770423; a=rsa-sha256; cv=none; b=ei1nruNC7njorlqaF+dshiLorL9qR/VzkN0lHql52cMXR56qHU3LhsChvXe0BlYU6/SM2p Rgy/uC88qJcllnACTPxFMAq28xovoDRKpz/EC1YXnZo7VWEoVD0pnOjvea9h3lwSufZz1O mZjC2dCdorisxndpoJ2umxE0KOnxyX9ZZJlV/uIeJ2G2wKu2Bo5ZErT9KrPphOYHqryfeD Ce4Qy+JrtgyOWFVY66Ss+Db6WkBahALcvtz2GD1BB7qNyIPSfcoD+veNU3GnMu9vbtEraY bC3Fl8N4ucjKbc/koGUlI9oI/pOar+8/acwleDtKf7Y8r2VsrBv7LNlF5ZB+2A== 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 4Xj9pb5qXfzxZw; Tue, 5 Nov 2024 01:33:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A51XhK3049127; Tue, 5 Nov 2024 01:33:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A51XhaP049124; Tue, 5 Nov 2024 01:33:43 GMT (envelope-from git) Date: Tue, 5 Nov 2024 01:33:43 GMT Message-Id: <202411050133.4A51XhaP049124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: d412c07617eb - main - Check for errors when detaching children first, not last List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d412c07617eb35435668b024bc2cecda05f57f1f Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d412c07617eb35435668b024bc2cecda05f57f1f commit d412c07617eb35435668b024bc2cecda05f57f1f Author: John Baldwin AuthorDate: 2024-11-05 01:30:33 +0000 Commit: John Baldwin CommitDate: 2024-11-05 01:30:33 +0000 Check for errors when detaching children first, not last These detach routines in these drivers all ended with 'return (bus_generic_detach())' meaning that if any child device failed to detach, the parent driver was left in a mostly destroyed state, but still marked attached. Instead, bus drivers should detach child drivers first and return errors before destroying driver state in the parent. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47387 --- sys/arm/nvidia/as3722.c | 7 ++++++- sys/arm/nvidia/drm2/tegra_dc.c | 7 ++++++- sys/arm/nvidia/drm2/tegra_hdmi.c | 8 +++++++- sys/arm/nvidia/drm2/tegra_host1x.c | 7 ++++++- sys/arm/nvidia/tegra_abpmisc.c | 7 ++++++- sys/arm/nvidia/tegra_efuse.c | 7 ++++++- sys/arm/nvidia/tegra_i2c.c | 7 ++++++- sys/arm/nvidia/tegra_mc.c | 7 ++++++- sys/arm/nvidia/tegra_rtc.c | 7 ++++++- sys/arm/ti/ti_adc.c | 7 ++++++- sys/arm64/nvidia/tegra210/max77620.c | 7 ++++++- sys/arm64/nvidia/tegra210/max77620_rtc.c | 7 ++++++- sys/dev/dwwdt/dwwdt.c | 7 ++++++- sys/dev/ena/ena.c | 6 +++++- sys/dev/fdt/simplebus.c | 7 ++++++- sys/dev/gve/gve_main.c | 7 ++++++- sys/dev/iicbus/pmic/act8846.c | 7 ++++++- sys/dev/mana/gdma_main.c | 7 ++++++- sys/powerpc/mpc85xx/pci_mpc85xx.c | 7 ++++++- sys/powerpc/powermac/cuda.c | 7 ++++++- sys/powerpc/powermac/pmu.c | 7 ++++++- 21 files changed, 126 insertions(+), 21 deletions(-) diff --git a/sys/arm/nvidia/as3722.c b/sys/arm/nvidia/as3722.c index ca5f7372aed1..ed5f47363b01 100644 --- a/sys/arm/nvidia/as3722.c +++ b/sys/arm/nvidia/as3722.c @@ -343,6 +343,11 @@ static int as3722_detach(device_t dev) { struct as3722_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); if (sc->irq_h != NULL) @@ -351,7 +356,7 @@ as3722_detach(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static phandle_t diff --git a/sys/arm/nvidia/drm2/tegra_dc.c b/sys/arm/nvidia/drm2/tegra_dc.c index f4168f161f5e..a8a0e3f4abf8 100644 --- a/sys/arm/nvidia/drm2/tegra_dc.c +++ b/sys/arm/nvidia/drm2/tegra_dc.c @@ -1393,6 +1393,11 @@ static int dc_detach(device_t dev) { struct dc_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); @@ -1412,7 +1417,7 @@ dc_detach(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static device_method_t tegra_dc_methods[] = { diff --git a/sys/arm/nvidia/drm2/tegra_hdmi.c b/sys/arm/nvidia/drm2/tegra_hdmi.c index e5ce30ac2eb3..067df21c889c 100644 --- a/sys/arm/nvidia/drm2/tegra_hdmi.c +++ b/sys/arm/nvidia/drm2/tegra_hdmi.c @@ -1272,6 +1272,12 @@ static int hdmi_detach(device_t dev) { struct hdmi_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); + sc = device_get_softc(dev); TEGRA_DRM_DEREGISTER_CLIENT(device_get_parent(sc->dev), sc->dev); @@ -1294,7 +1300,7 @@ hdmi_detach(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); if (sc->mem_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); - return (bus_generic_detach(dev)); + return (0); } static device_method_t tegra_hdmi_methods[] = { diff --git a/sys/arm/nvidia/drm2/tegra_host1x.c b/sys/arm/nvidia/drm2/tegra_host1x.c index e04a50e4c003..ee43efba5ba7 100644 --- a/sys/arm/nvidia/drm2/tegra_host1x.c +++ b/sys/arm/nvidia/drm2/tegra_host1x.c @@ -586,6 +586,11 @@ static int host1x_detach(device_t dev) { struct host1x_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); @@ -608,7 +613,7 @@ host1x_detach(device_t dev) if (sc->mem_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static device_method_t host1x_methods[] = { diff --git a/sys/arm/nvidia/tegra_abpmisc.c b/sys/arm/nvidia/tegra_abpmisc.c index 88f9ecde3f31..1f54a918f63b 100644 --- a/sys/arm/nvidia/tegra_abpmisc.c +++ b/sys/arm/nvidia/tegra_abpmisc.c @@ -166,13 +166,18 @@ static int tegra_abpmisc_detach(device_t dev) { struct tegra_abpmisc_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); if (sc->abp_misc_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->abp_misc_res); if (sc->strap_opt_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 1, sc->strap_opt_res); - return (bus_generic_detach(dev)); + return (0); } static device_method_t tegra_abpmisc_methods[] = { diff --git a/sys/arm/nvidia/tegra_efuse.c b/sys/arm/nvidia/tegra_efuse.c index 35d9380a18a5..dc637e6d0bec 100644 --- a/sys/arm/nvidia/tegra_efuse.c +++ b/sys/arm/nvidia/tegra_efuse.c @@ -499,6 +499,11 @@ static int tegra_efuse_detach(device_t dev) { struct tegra_efuse_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); dev_sc = NULL; @@ -509,7 +514,7 @@ tegra_efuse_detach(device_t dev) if (sc->mem_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); - return (bus_generic_detach(dev)); + return (0); } static device_method_t tegra_efuse_methods[] = { diff --git a/sys/arm/nvidia/tegra_i2c.c b/sys/arm/nvidia/tegra_i2c.c index 0fe1aa7ba48e..b01f1a1fdce4 100644 --- a/sys/arm/nvidia/tegra_i2c.c +++ b/sys/arm/nvidia/tegra_i2c.c @@ -740,6 +740,11 @@ static int tegra_i2c_detach(device_t dev) { struct tegra_i2c_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); tegra_i2c_hw_init(sc); @@ -753,7 +758,7 @@ tegra_i2c_detach(device_t dev) LOCK_DESTROY(sc); if (sc->iicbus) device_delete_child(dev, sc->iicbus); - return (bus_generic_detach(dev)); + return (0); } static phandle_t diff --git a/sys/arm/nvidia/tegra_mc.c b/sys/arm/nvidia/tegra_mc.c index 020c9617b453..0f05c32117e9 100644 --- a/sys/arm/nvidia/tegra_mc.c +++ b/sys/arm/nvidia/tegra_mc.c @@ -280,6 +280,11 @@ static int tegra_mc_detach(device_t dev) { struct tegra_mc_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); if (sc->irq_h != NULL) @@ -290,7 +295,7 @@ tegra_mc_detach(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static device_method_t tegra_mc_methods[] = { diff --git a/sys/arm/nvidia/tegra_rtc.c b/sys/arm/nvidia/tegra_rtc.c index 07bf51628665..09bd42bc64e3 100644 --- a/sys/arm/nvidia/tegra_rtc.c +++ b/sys/arm/nvidia/tegra_rtc.c @@ -266,6 +266,11 @@ static int tegra_rtc_detach(device_t dev) { struct tegra_rtc_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); if (sc->irq_h != NULL) @@ -276,7 +281,7 @@ tegra_rtc_detach(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static device_method_t tegra_rtc_methods[] = { diff --git a/sys/arm/ti/ti_adc.c b/sys/arm/ti/ti_adc.c index 5a3a337afff5..d13dd87001de 100644 --- a/sys/arm/ti/ti_adc.c +++ b/sys/arm/ti/ti_adc.c @@ -915,6 +915,11 @@ static int ti_adc_detach(device_t dev) { struct ti_adc_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); @@ -938,7 +943,7 @@ ti_adc_detach(device_t dev) if (sc->sc_mem_res) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); - return (bus_generic_detach(dev)); + return (0); } static device_method_t ti_adc_methods[] = { diff --git a/sys/arm64/nvidia/tegra210/max77620.c b/sys/arm64/nvidia/tegra210/max77620.c index b33d73e71f90..a7d938cb8123 100644 --- a/sys/arm64/nvidia/tegra210/max77620.c +++ b/sys/arm64/nvidia/tegra210/max77620.c @@ -450,6 +450,11 @@ static int max77620_detach(device_t dev) { struct max77620_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); if (sc->irq_h != NULL) @@ -458,7 +463,7 @@ max77620_detach(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static phandle_t diff --git a/sys/arm64/nvidia/tegra210/max77620_rtc.c b/sys/arm64/nvidia/tegra210/max77620_rtc.c index 29808af27819..dca90549443c 100644 --- a/sys/arm64/nvidia/tegra210/max77620_rtc.c +++ b/sys/arm64/nvidia/tegra210/max77620_rtc.c @@ -366,11 +366,16 @@ static int max77620_rtc_detach(device_t dev) { struct max77620_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } /* diff --git a/sys/dev/dwwdt/dwwdt.c b/sys/dev/dwwdt/dwwdt.c index 89f94fff9bad..c433317a8d87 100644 --- a/sys/dev/dwwdt/dwwdt.c +++ b/sys/dev/dwwdt/dwwdt.c @@ -309,6 +309,7 @@ static int dwwdt_detach(device_t dev) { struct dwwdt_softc *sc = device_get_softc(dev); + int error; if (dwwdt_started(sc)) { /* @@ -318,6 +319,10 @@ dwwdt_detach(device_t dev) return (EBUSY); } + error = bus_generic_detach(dev); + if (error != 0) + return (error); + EVENTHANDLER_DEREGISTER(watchdog_list, sc->sc_evtag); sc->sc_evtag = NULL; @@ -337,7 +342,7 @@ dwwdt_detach(device_t dev) sc->sc_mem_res); } - return (bus_generic_detach(dev)); + return (0); } static int diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index e9d4530e9085..f0b6cec1bb61 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -4030,6 +4030,10 @@ ena_detach(device_t pdev) return (EBUSY); } + rc = bus_generic_detach(pdev); + if (rc != 0) + return (rc); + ether_ifdetach(adapter->ifp); ifmedia_removeall(&adapter->media); @@ -4096,7 +4100,7 @@ ena_detach(device_t pdev) free(ena_dev, M_DEVBUF); - return (bus_generic_detach(pdev)); + return (0); } /****************************************************************************** diff --git a/sys/dev/fdt/simplebus.c b/sys/dev/fdt/simplebus.c index 37db238f2108..0f41d3433d75 100644 --- a/sys/dev/fdt/simplebus.c +++ b/sys/dev/fdt/simplebus.c @@ -189,12 +189,17 @@ int simplebus_detach(device_t dev) { struct simplebus_softc *sc; + int rv; + + rv = bus_generic_detach(dev); + if (rv != 0) + return (rv); sc = device_get_softc(dev); if (sc->ranges != NULL) free(sc->ranges, M_DEVBUF); - return (bus_generic_detach(dev)); + return (0); } void diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c index f8a37b9f37a9..15d57ed0f2ac 100644 --- a/sys/dev/gve/gve_main.c +++ b/sys/dev/gve/gve_main.c @@ -820,6 +820,11 @@ gve_detach(device_t dev) { struct gve_priv *priv = device_get_softc(dev); if_t ifp = priv->ifp; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); ether_ifdetach(ifp); @@ -836,7 +841,7 @@ gve_detach(device_t dev) taskqueue_free(priv->service_tq); if_free(ifp); - return (bus_generic_detach(dev)); + return (0); } static device_method_t gve_methods[] = { diff --git a/sys/dev/iicbus/pmic/act8846.c b/sys/dev/iicbus/pmic/act8846.c index 5e166247f79b..e55fc70986a8 100644 --- a/sys/dev/iicbus/pmic/act8846.c +++ b/sys/dev/iicbus/pmic/act8846.c @@ -226,11 +226,16 @@ static int act8846_detach(device_t dev) { struct act8846_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); LOCK_DESTROY(sc); - return (bus_generic_detach(dev)); + return (0); } static device_method_t act8846_methods[] = { diff --git a/sys/dev/mana/gdma_main.c b/sys/dev/mana/gdma_main.c index 59ac6911c784..b339badad925 100644 --- a/sys/dev/mana/gdma_main.c +++ b/sys/dev/mana/gdma_main.c @@ -1879,6 +1879,11 @@ static int mana_gd_detach(device_t dev) { struct gdma_context *gc = device_get_softc(dev); + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); mana_remove(&gc->mana); @@ -1890,7 +1895,7 @@ mana_gd_detach(device_t dev) pci_disable_busmaster(dev); - return (bus_generic_detach(dev)); + return (0); } diff --git a/sys/powerpc/mpc85xx/pci_mpc85xx.c b/sys/powerpc/mpc85xx/pci_mpc85xx.c index f4080ce3b75c..8e349df03a51 100644 --- a/sys/powerpc/mpc85xx/pci_mpc85xx.c +++ b/sys/powerpc/mpc85xx/pci_mpc85xx.c @@ -673,12 +673,17 @@ static int fsl_pcib_detach(device_t dev) { struct fsl_pcib_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); mtx_destroy(&sc->sc_cfg_mtx); - return (bus_generic_detach(dev)); + return (0); } static int diff --git a/sys/powerpc/powermac/cuda.c b/sys/powerpc/powermac/cuda.c index 4d120747e0f0..367eb7a059c2 100644 --- a/sys/powerpc/powermac/cuda.c +++ b/sys/powerpc/powermac/cuda.c @@ -259,6 +259,11 @@ cuda_attach(device_t dev) static int cuda_detach(device_t dev) { struct cuda_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); @@ -267,7 +272,7 @@ static int cuda_detach(device_t dev) { bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_memrid, sc->sc_memr); mtx_destroy(&sc->sc_mutex); - return (bus_generic_detach(dev)); + return (0); } static uint8_t diff --git a/sys/powerpc/powermac/pmu.c b/sys/powerpc/powermac/pmu.c index 2d38545a7046..e0358c6f9887 100644 --- a/sys/powerpc/powermac/pmu.c +++ b/sys/powerpc/powermac/pmu.c @@ -524,6 +524,11 @@ static int pmu_detach(device_t dev) { struct pmu_softc *sc; + int error; + + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); @@ -535,7 +540,7 @@ pmu_detach(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_memrid, sc->sc_memr); mtx_destroy(&sc->sc_mutex); - return (bus_generic_detach(dev)); + return (0); } static uint8_t From nobody Tue Nov 5 01:33:44 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj9pd44XWz5cq1Y; Tue, 05 Nov 2024 01:33:45 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj9pd0VRnz4tHq; Tue, 5 Nov 2024 01:33:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TsHsV9oBxDBHQYFSwNpIrJUUuwJ1rIP3Cj7BliJJYR0=; b=RnDLn2baBN+UB6Bf8ZK8W4sToGrKawxDI2XRL9YwdRVhWk9QDyzrsZym5DGnnvSEDl7UjT AGI2mFJXj1BLK3J/pROqd9FVSO3O3hxdiKxJwvzm/uc/NrwOhd1eOivkuJVRmy6zHSKUlA LCirzTzUMkkjknJ28GhPBTK2zBP4KJFT62xTpnCyVStXq4b2cz1IPKsXsYdKR/sDav/mTn AwYlv64JYmkkZrXEd2Q6vRRKsrmSr878LQeHPNTQtE6l/bgmuXtGwVcsqXBFkEgs12RQZF r6m169oAHp6p9KD6ePWGJLW6jcSjtiIz6wi2osjAUoyXn3DWpRv69x1/DjYY0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TsHsV9oBxDBHQYFSwNpIrJUUuwJ1rIP3Cj7BliJJYR0=; b=sEdai2Hh7RtFRnSUoZiFmohPqqfQc8+AbfENwFBSi8rAFZkZVa7ppcWi6w+SeX5Nub4qs3 gotpHNvdigUlaFbLdetGkfguY8RdlpkFR7i/UBr5GY5GceBYOlcSE4wy0VYipkrZORsRQf wPL363/3H4GbDtJGYnlr1UMd+ZwEshNCRjP9x0KlQMRSghqVb2wPk4EEiHFA92rGQ9xP7w 9nDBzTZg4hd3LuXC46SI/RoQBBmtTavEu8dkc8TI2VNsZIAm86JaFI2NRbRUEicWuNsTEV teByIlhd3/aBUxuDpFw+w4UqTIurQNQNPmVABmNfFpc0YuyxT3HHep2Pl2MvHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730770425; a=rsa-sha256; cv=none; b=s9TD+VJtb3Kx9sueWhGnjw8Ef+UVF0dDlEcPVdVw5A4wn/7iGbCc6ysyhJSsjf4pmP1lNr r6kTVe6sRACoQbPZyjMJhUswGYwgsQEJy7HNJyqCoidjsm7u2VBkFwS5Cgw03n2GApejQZ WTHIq6dSPWdfWrTQwQod0OoPGKc9tQ8wa7HHcFYmCzHuuCVK4+oQIL+bzuCVID9EfNNP+j SqF8lnHewicR2JpOdasYwwEpJWGBNXGvLDIWQ7mGdnSy/8LAz2CtBf8O0HbE8reXWaYHLF NJxbiHOdAxu32I8WqJT8bE6vLQhYlB1Y9s4Cm4nN/35mPyWOKRDeABZic8bpeQ== 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 4Xj9pc6rxJzwM3; Tue, 5 Nov 2024 01:33:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A51XiDW049184; Tue, 5 Nov 2024 01:33:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A51Xio5049181; Tue, 5 Nov 2024 01:33:44 GMT (envelope-from git) Date: Tue, 5 Nov 2024 01:33:44 GMT Message-Id: <202411050133.4A51Xio5049181@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 24d5a8e6eec2 - main - dpaa2_mc: Check for error the first time bus_generic_detach is called List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 24d5a8e6eec2b9eed9591971f223d79b8d7044c9 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=24d5a8e6eec2b9eed9591971f223d79b8d7044c9 commit 24d5a8e6eec2b9eed9591971f223d79b8d7044c9 Author: John Baldwin AuthorDate: 2024-11-05 01:30:53 +0000 Commit: John Baldwin CommitDate: 2024-11-05 01:30:53 +0000 dpaa2_mc: Check for error the first time bus_generic_detach is called This removes the need for the second call. Reviewed by: dsl Differential Revision: https://reviews.freebsd.org/D47388 --- sys/dev/dpaa2/dpaa2_mc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/dev/dpaa2/dpaa2_mc.c b/sys/dev/dpaa2/dpaa2_mc.c index da8f8a077d6b..c7553e8a514a 100644 --- a/sys/dev/dpaa2/dpaa2_mc.c +++ b/sys/dev/dpaa2/dpaa2_mc.c @@ -281,7 +281,9 @@ dpaa2_mc_detach(device_t dev) struct dpaa2_devinfo *dinfo = NULL; int error; - bus_generic_detach(dev); + error = bus_generic_detach(dev); + if (error != 0) + return (error); sc = device_get_softc(dev); if (sc->rcdev) @@ -292,10 +294,6 @@ dpaa2_mc_detach(device_t dev) if (dinfo) free(dinfo, M_DPAA2_MC); - error = bus_generic_detach(dev); - if (error != 0) - return (error); - return (device_delete_children(dev)); } From nobody Tue Nov 5 01:33:45 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj9pf2QSdz5cqRN; Tue, 05 Nov 2024 01:33: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj9pf0Ww1z4tLG; Tue, 5 Nov 2024 01:33:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KGI3G7YsDxTymlgnA50ELe9wzCPa8pVwOKPwwRmQQwM=; b=IuNr5BmJ83eoeVsfXJ8tkvu3JWeZPUNRjhPXexMQtb0PW4jKTAhEDQWJLyxoEiQZ8uudx7 yAfIvvvVk8yh+pwQOW//z6jsD4hQqeCgYnpEk6B6QBcfbE9Jnjcn3UHYI8YBkyIrVg81Br UyMtZ7+84X4fjvT30lG1Elzmis3noGi5KRyYJ7udwtC+3qfpp7+hKynCOL77B0EzDEi7v0 WIYEMvIUP4zkHNRmKM/ClYizhyNeucqOF6RkL0HKqI2ciwPa3+f4lSRECP3v8k+JlC+52K 5j6/KtZ/SZd8+F6nS0Zn/Hf0sz8CC/e/NNnLZM9OL/AIs1XjJ+DqhdhJ9STMTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KGI3G7YsDxTymlgnA50ELe9wzCPa8pVwOKPwwRmQQwM=; b=IIo0msa2afDBczSOZSgiy4Zye/iJVkgQzJBvAnHEy1dvAfuI+h4ENexHK7QZ9IvUbWjOzG Xnxiit8zYqLsS9lEj+voNvg28CZIrz+pkXX1CJ9vLmN540C5Q4jNvxMY7ncYtJvJuN5P5g FQAssagoiWL4HrVI35dz6hw+knP/MyuWfpMeAKgz2uAGph3AEWz7AZ4ZupPKMF/pCNWMu8 sb/fKIfozCJR/iomyJu1DuImgZEqFwPGLSq5RtznjacadYMKqFfKHJ+eaIlNb0vOOEz1s7 L32fYa0IXSmn24uoEg7aOtIDy7qSdNpd/ax5I4Aa5bey+7oiCN/kIKBz/a0CKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730770426; a=rsa-sha256; cv=none; b=uyVYHwIp6MSf0wdWoCqrAlaS/ZM4pgZSsOkVcXFpDCPKglQArksk7+fQzeZeuRQD3a+9O6 onGJC6XvKU4vxokF30WBS6fS/t8J58AX6nDeS/U5Y8uIM0wG0/leJwWKSITDP1Kt50qzTv D8ZBa5AGqFgps5Yxx5vKbVlIULlSOm2eTIeLLJanGVTxe1QRB59j5oc8SsPFlDl/XKDM4A sbeP3i5mr0lwsuY8lBg/xumeSCWmSB2i3JwLov55nMg7Y1y3I15G5zOKelFpouGAw0+1Ki lZGd+vTkE8RSZs9ySfq6nu9Trn89MjWe+u0+X0YS0QETYc7w4hQp5KoLgftetw== 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 4Xj9pf07n5zx5Z; Tue, 5 Nov 2024 01:33:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A51XjM6049230; Tue, 5 Nov 2024 01:33:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A51Xjia049227; Tue, 5 Nov 2024 01:33:45 GMT (envelope-from git) Date: Tue, 5 Nov 2024 01:33:45 GMT Message-Id: <202411050133.4A51Xjia049227@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 7ebc7d1ab76b - main - Remove bogus detach routines List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7ebc7d1ab76b9d06be9400d6c9fc74fcc43603a1 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7ebc7d1ab76b9d06be9400d6c9fc74fcc43603a1 commit 7ebc7d1ab76b9d06be9400d6c9fc74fcc43603a1 Author: John Baldwin AuthorDate: 2024-11-05 01:31:16 +0000 Commit: John Baldwin CommitDate: 2024-11-05 01:31:16 +0000 Remove bogus detach routines These drivers are not bus drivers, and would need proper detach routines that tore down state stored in the softc. Better to just fail detach outright instead of an incorrect success. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47389 --- sys/dev/gpio/gpiomdio.c | 1 - sys/dev/sff/sfp_fdt.c | 1 - 2 files changed, 2 deletions(-) diff --git a/sys/dev/gpio/gpiomdio.c b/sys/dev/gpio/gpiomdio.c index deb9a25bd290..dc43b2783bc5 100644 --- a/sys/dev/gpio/gpiomdio.c +++ b/sys/dev/gpio/gpiomdio.c @@ -213,7 +213,6 @@ static device_method_t gpiomdio_methods[] = { /* Device interface */ DEVMETHOD(device_probe, gpiomdio_probe), DEVMETHOD(device_attach, gpiomdio_attach), - DEVMETHOD(device_detach, bus_generic_detach), /* MDIO interface */ DEVMETHOD(miibus_readreg, gpiomdio_readreg), diff --git a/sys/dev/sff/sfp_fdt.c b/sys/dev/sff/sfp_fdt.c index 7430282ede70..e566d8ced78c 100644 --- a/sys/dev/sff/sfp_fdt.c +++ b/sys/dev/sff/sfp_fdt.c @@ -138,7 +138,6 @@ static device_method_t sfp_fdt_methods[] = { /* Device interface */ DEVMETHOD(device_probe, sfp_fdt_probe), DEVMETHOD(device_attach, sfp_fdt_attach), - DEVMETHOD(device_detach, bus_generic_detach), /* SFF */ DEVMETHOD(sff_get_i2c_bus, sfp_fdt_get_i2c_bus), From nobody Tue Nov 5 01:33:47 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj9pg4zLMz5cqHN; Tue, 05 Nov 2024 01:33:47 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj9pg2BB3z4tJP; Tue, 5 Nov 2024 01:33:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a3yaYcKs5GTHVMrEUXRUhb7ADtKyJ99S0BEM2so85oo=; b=BMr3+GPYHvIqEgkrZt5HM54Azczh//LnbxnvRj7sREFzOSTJUgTrMBOWjDYJuh8pPTx1AI 6tnUF/xzJbBePlUrbsV50BwLJAzc0p5PzNeY5/Zexwye1fs7GZzJs6wjdAY8MlBFMYMiD2 CM21ZWo+MvRtO8vrRJwBb2HIjMUZIHk7fT/EbPD5O2XZcgcaYkjN8elrGSRXED72g9aagf ArVeAqU/tM0wkI/aWPY6A95bfrBqAYK3sxtwpFEml5TmFwb2OG5ExhGnc5vgqXDlPIRBOO XpFWpk7O+lrPymMdN2rqbIxXnkpg77EIeFLcx+Y9PU9OxbMnvLDYcKmsYfcrnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a3yaYcKs5GTHVMrEUXRUhb7ADtKyJ99S0BEM2so85oo=; b=pHWu6CZCJVs7hHtJ8MM5Mv6ljSyyQfUIy6fN+uG2okpwQ7BjW+zOKpE9L2jrU3ObBFaqWS NSNphmfvlvrSk7EPuw5JgMFWIecY6pkQVmMH1DO3NcdsvVF9UTRg/N1xgQ/zH5ED7VRkXi RGR3oK3sOsF3g9USnv9JZac/blhL7bkN5k9ycdlkSFIe3bsIyri5TrZhy6LysKjBW6swzp mKXxhjKYhTSy4c+N3buaDtGKL9WR381nlpVFCVqQj2toNKzaX4BLUkIbSCOU0lCo14YOkf pP6RQi1sgEpwtLJv1hEY9/KJP83FXO43Fce0fYca/4zqbEuyd52WLer3fJGj0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730770427; a=rsa-sha256; cv=none; b=JJGQDv0HmErNvIPhDrWoOXkKulIdMUTartLMk41vZ/92kgtZR3hdI7RniXNTxUDZMzu6yW O68ZsbEfcG9wP67dp9bmLcbqMJ+5U7n+RTroceWj4YdLclGogvtGsoYwLqVRdTbrxFYFSh ve+PfR4hRTnB/Dz+lrFGrmjVRLiWAKW0MJjMBdTTkmfGZ0S9ukcO4F92ykPaSqbIa0Hszu AofT4zFied9gR8JzTPLtf1qB61ObW8PuBLPO9X2wxaJ70wiPiD/pjz13+xno9egKXLp6at XbOZuY62GASi+HBDd/J6HA8/Ks1J2KBYD1XqDsAHDjclhPCrO7uzdZkYAdlFxQ== 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 4Xj9pg14cMzxYk; Tue, 5 Nov 2024 01:33:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A51XlCe049282; Tue, 5 Nov 2024 01:33:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A51XlG1049279; Tue, 5 Nov 2024 01:33:47 GMT (envelope-from git) Date: Tue, 5 Nov 2024 01:33:47 GMT Message-Id: <202411050133.4A51XlG1049279@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 8b54d874c70d - main - hifn/safe: Remove dummy calls to bus_generic_detach List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b54d874c70d9fb3ed2e059f65c91b3e0eaadbd7 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8b54d874c70d9fb3ed2e059f65c91b3e0eaadbd7 commit 8b54d874c70d9fb3ed2e059f65c91b3e0eaadbd7 Author: John Baldwin AuthorDate: 2024-11-05 01:31:30 +0000 Commit: John Baldwin CommitDate: 2024-11-05 01:31:30 +0000 hifn/safe: Remove dummy calls to bus_generic_detach These drivers do not add child devices, so there's no need to try to detach children. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47390 --- sys/dev/hifn/hifn7751.c | 2 -- sys/dev/safe/safe.c | 1 - 2 files changed, 3 deletions(-) diff --git a/sys/dev/hifn/hifn7751.c b/sys/dev/hifn/hifn7751.c index 23cf019b93a6..2e7545779b09 100644 --- a/sys/dev/hifn/hifn7751.c +++ b/sys/dev/hifn/hifn7751.c @@ -637,8 +637,6 @@ hifn_detach(device_t dev) crypto_unregister_all(sc->sc_cid); - bus_generic_detach(dev); /*XXX should be no children, right? */ - bus_teardown_intr(dev, sc->sc_irq, sc->sc_intrhand); /* XXX don't store rid */ bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq); diff --git a/sys/dev/safe/safe.c b/sys/dev/safe/safe.c index da2afbd38fad..c512f3fc62c0 100644 --- a/sys/dev/safe/safe.c +++ b/sys/dev/safe/safe.c @@ -464,7 +464,6 @@ safe_detach(device_t dev) mtx_destroy(&sc->sc_ringmtx); safe_dma_free(sc, &sc->sc_ringalloc); - bus_generic_detach(dev); bus_teardown_intr(dev, sc->sc_irq, sc->sc_ih); bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq); From nobody Tue Nov 5 01:40:50 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj9yq3D8Vz5cqcG; Tue, 05 Nov 2024 01:40: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj9yq1FZ6z3wfC; Tue, 5 Nov 2024 01:40:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uup+6Z8gu1lyBEm/81xl9v1/12AemxtsP1Kn9bNaaFU=; b=NxBx9va8YzUqh0dnkqY3WyT0EQDUsUK7zdZCwlMpV0oykWs1Y2nnGsCENvlPEjJc/6P3gF dZ1QZJlFm5TBeYowV1ct3xeYsVfwPml0jvWcCRaFO0VqpOz8t9NUWxR0teluuw6DNIpWxw JevpLxfOr2RBp13wx2/y9MosX3azVMvV8XOKmBHYPDi4wRfJpt/YeoO+Ctb2NP8DxY/dre MQZVJ8G6KdpeVrtr4ChxT4yZ0p1ZP4u2GkSQAIBk7BbWm0jcMrjfHUeCgDkLtiMV0henzB UHQRuuyIlVdJavQcFDAX5FIW59jAFyGBryB8+KWWQ7ehURGINEQr0L6Kdedsig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uup+6Z8gu1lyBEm/81xl9v1/12AemxtsP1Kn9bNaaFU=; b=YP6U6QIeTMUFs854qYYGGWi5HvrxQLd8kyBL6pJl2arN8y73+x8egYAQNhB+8Tipc4mtlL cgk3UU3wg8moAvkBOm0DjTwDFfroaLyBgjzymzpVbXLg5LBM5bwTsYEG6P83lX5a2M4g3X c9wNwSN83OfJ5DPWVeaP0r9mX/Ag6rfakqDvRKSqgRHP/KhBDnmHf7GmdamhswFHVawgzw j+0TRbKy4mVXcJGCDMwLx72vV70QcaoorVfv4sKXfixihAn6yCt6fOC107mfgdsWgJ1drd 6/toSNFD5zhOrRgA86PvQxl5/DSoOmx7l7+hUVgKpHU6KwC/7bhzc63J3/hZTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730770851; a=rsa-sha256; cv=none; b=rhJxtoIA/Jxc41JXvBz7gbnCWVO/JAoOJ3uMOaihmsLWAHVOKwAd2az+nPamCSROkt7ARO w6Nm3SnoAsDJFiOKaT75ubAY8Iva55aU+x/z8Ld4OFxwek0Fc9xwPTWYKoa9CxSoMTdQBQ 9M6TwOEWPytzxuGis+yycnYZ5mBLwpkTAxy4fWdlhjgeHTC5v3NFXYJYS0wKOtXvWwc2FE o12kYEITL5kknC2y7ybZ+KVuPA1gD0HIte0nHyQtssantmGVWZb/5fCJm9HvFH/2cRZDDT yCm+ozZQiQpyOJwEOWzrxk0Lr5VbGus+6VICsQiuQXSXHyrbod/uVQG/XfTdhw== 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 4Xj9yp74VdzxKb; Tue, 5 Nov 2024 01:40:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A51eofB062655; Tue, 5 Nov 2024 01:40:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A51eoLC062652; Tue, 5 Nov 2024 01:40:50 GMT (envelope-from git) Date: Tue, 5 Nov 2024 01:40:50 GMT Message-Id: <202411050140.4A51eoLC062652@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: a97f683fe3c4 - main - vmm: Add a device file interface for creating and destroying VMs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: a97f683fe3c425b425cf8cc466319f54ea957c20 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a97f683fe3c425b425cf8cc466319f54ea957c20 commit a97f683fe3c425b425cf8cc466319f54ea957c20 Author: Mark Johnston AuthorDate: 2024-11-05 01:36:06 +0000 Commit: Mark Johnston CommitDate: 2024-11-05 01:40:41 +0000 vmm: Add a device file interface for creating and destroying VMs This supersedes the sysctl interface, which has the limitations of being root-only and not supporting automatic resource destruction, i.e., we cannot easily destroy VMs automatically when bhyve terminates. For now, two ioctls are implemented VMMCTL_VM_CREATE and VMMCTL_VM_DESTROY. Eventually I would like to support tying a VM's lifetime to that of the descriptor, so that it is automatically destroyed when the descriptor is closed. However, this will require some work in bhyve: when the guest wants to reboot, bhyve exits with a status that indicates that it is to be restarted. This is incompatible with the idea of tying a VM's lifetime to that of a descriptor, since we want to avoid creating and destroying a VM across each reboot (as this involves freeing all of the guest memory, among other things). One possible design would be to decompose bhyve into two processes, a parent which handles reboots, and a child which runs in capability mode and handles guest execution. In any case, this gets us closer to addressing the shortcomings mentioned above. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D47028 --- sys/amd64/vmm/vmm.c | 4 ++- sys/arm64/vmm/vmm.c | 4 ++- sys/dev/vmm/vmm_dev.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++- sys/dev/vmm/vmm_dev.h | 15 +++++++++- 4 files changed, 99 insertions(+), 4 deletions(-) diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index 07d3f74b8365..77e0adda86f5 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -465,7 +465,9 @@ vmm_handler(module_t mod, int what, void *arg) switch (what) { case MOD_LOAD: if (vmm_is_hw_supported()) { - vmmdev_init(); + error = vmmdev_init(); + if (error != 0) + break; error = vmm_init(); if (error == 0) vmm_initialized = 1; diff --git a/sys/arm64/vmm/vmm.c b/sys/arm64/vmm/vmm.c index 4127fad5cd59..2f4f3a2b59ea 100644 --- a/sys/arm64/vmm/vmm.c +++ b/sys/arm64/vmm/vmm.c @@ -362,7 +362,9 @@ vmm_handler(module_t mod, int what, void *arg) switch (what) { case MOD_LOAD: /* TODO: if (vmm_is_hw_supported()) { */ - vmmdev_init(); + error = vmmdev_init(); + if (error != 0) + break; error = vmm_init(); if (error == 0) vmm_initialized = true; diff --git a/sys/dev/vmm/vmm_dev.c b/sys/dev/vmm/vmm_dev.c index a43d642b3925..4bea4360a51c 100644 --- a/sys/dev/vmm/vmm_dev.c +++ b/sys/dev/vmm/vmm_dev.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -917,11 +918,88 @@ SYSCTL_PROC(_hw_vmm, OID_AUTO, create, NULL, 0, sysctl_vmm_create, "A", NULL); -void +static int +vmmctl_open(struct cdev *cdev, int flags, int fmt, struct thread *td) +{ + int error; + + error = vmm_priv_check(td->td_ucred); + if (error != 0) + return (error); + + if ((flags & FWRITE) == 0) + return (EPERM); + + return (0); +} + +static int +vmmctl_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, + struct thread *td) +{ + int error; + + switch (cmd) { + case VMMCTL_VM_CREATE: { + struct vmmctl_vm_create *vmc; + + vmc = (struct vmmctl_vm_create *)data; + vmc->name[VM_MAX_NAMELEN] = '\0'; + for (size_t i = 0; i < nitems(vmc->reserved); i++) { + if (vmc->reserved[i] != 0) { + error = EINVAL; + return (error); + } + } + + error = vmmdev_create(vmc->name, td->td_ucred); + break; + } + case VMMCTL_VM_DESTROY: { + struct vmmctl_vm_destroy *vmd; + + vmd = (struct vmmctl_vm_destroy *)data; + vmd->name[VM_MAX_NAMELEN] = '\0'; + for (size_t i = 0; i < nitems(vmd->reserved); i++) { + if (vmd->reserved[i] != 0) { + error = EINVAL; + return (error); + } + } + + error = vmmdev_lookup_and_destroy(vmd->name, td->td_ucred); + break; + } + default: + error = ENOTTY; + break; + } + + return (error); +} + +static struct cdevsw vmmctlsw = { + .d_name = "vmmctl", + .d_version = D_VERSION, + .d_open = vmmctl_open, + .d_ioctl = vmmctl_ioctl, +}; + +int vmmdev_init(void) { + struct cdev *cdev; + int error; + + error = make_dev_p(MAKEDEV_CHECKNAME, &cdev, &vmmctlsw, NULL, + UID_ROOT, GID_WHEEL, 0600, "vmmctl"); + if (error) + return (error); + pr_allow_flag = prison_add_allow(NULL, "vmm", NULL, "Allow use of vmm in a jail."); + + return (0); } int diff --git a/sys/dev/vmm/vmm_dev.h b/sys/dev/vmm/vmm_dev.h index a2dc4d11f359..410066c49cf2 100644 --- a/sys/dev/vmm/vmm_dev.h +++ b/sys/dev/vmm/vmm_dev.h @@ -18,7 +18,7 @@ struct thread; struct vm; struct vcpu; -void vmmdev_init(void); +int vmmdev_init(void); int vmmdev_cleanup(void); int vmmdev_machdep_ioctl(struct vm *vm, struct vcpu *vcpu, u_long cmd, caddr_t data, int fflag, struct thread *td); @@ -54,4 +54,17 @@ extern const size_t vmmdev_machdep_ioctl_count; #endif /* _KERNEL */ +struct vmmctl_vm_create { + char name[VM_MAX_NAMELEN + 1]; + int reserved[16]; +}; + +struct vmmctl_vm_destroy { + char name[VM_MAX_NAMELEN + 1]; + int reserved[16]; +}; + +#define VMMCTL_VM_CREATE _IOWR('V', 0, struct vmmctl_vm_create) +#define VMMCTL_VM_DESTROY _IOWR('V', 1, struct vmmctl_vm_destroy) + #endif /* _DEV_VMM_DEV_H_ */ From nobody Tue Nov 5 01:40:52 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj9yr53F8z5cqWl; Tue, 05 Nov 2024 01:40: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj9yr1qSyz4vn6; Tue, 5 Nov 2024 01:40:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dS2MrQCL5QPw47Wf9Suk5pD3zfC1Eq5+PmdGouckjKg=; b=VTqum0T2DHOV6o9LrfHbuU562M4wQcLxDKJV8eaOjXxykX6TijxgDlO99AGCRwfToHn5oW FB7I0k/CWlBAy3RLaBCJH4xpeQMSR/39giLviJJJJ+dXX7JnLXvb5zzEVBHLRsgJSyTH+A M+UzmsdURE22TBZ6lTm9QzVpfpN1JKU83cPFQr/xA8MuVt0E9kRWhc2lXi0EkUoDq5kuAI F7YJHw5G31Z1zRwvYaYQduznt7rJiu7H2nQ/yu5+ls3dN0HKB1ytLFa1Y/Y5buRDl3JCmf T7nKjPUqKjMi8Ko94WdcfLJp1RuquQgvlMAgm9lKqg8qvND7YZy6BTvNhuoWqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dS2MrQCL5QPw47Wf9Suk5pD3zfC1Eq5+PmdGouckjKg=; b=nNw/g+aVesWfMe3onUq4MhkpZEE+voQnzSVVLIN4qviqSWt4XaQ5TqX+SijZWLLgsDbe3F 5N+k5RklvR/thJrQ8oOX1wVByvmayPjmSfOtHObJ+U9XW2MPe2QTkUIpZrZk0w1NXjLuhU BRuHiu16iRRNEQDfZeWZgq3KnUZJ7rjC7fgsQ7DCa8CBgvVaoQwcNkwr1MANCKpveXEjsq UHCgQ/3DQ7yemW6JMaVSnRoF6wSnRfA5uKfKauqj6Cx5z92qlAR+vJRmh+9nGKdjCN4GDJ lNXkd8naobBW/I4IEXAElO4FLHS8bzkT94atwBOqdXmtt3YV6SPwPckmqyhAZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730770852; a=rsa-sha256; cv=none; b=KQ3D938BGk8plL0llVAieLz2frbjWT5hFuiMv9canczbthf4oJhH1WqIuUrNTlXhs89P0k udaq5Wi0Asx+pTiyeTz/4jKd5LRLbhsEGu0aWu9tqxnibNYEx3OwCdJb7qoEtaj72rR0Mb LQL5JPCVKFWAkBIa+6yDjRxsvzmJG/XCGuuXT7ZnQcIRDsASDtdUwU4SQVcBO1RF3grNwm uZ3zoGfTbjMnTOfajYUx9EF3p0OLcXUOo5aEY0MObcLwa2be93eaKZ6R1KbqgqG4fVAGvD 0Ei1DEOvbkla0u9xtCjOWQHAFYti7JZD0vev3oQpBwEGCHxmYXdlqVgGdqwDjw== 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 4Xj9yr0xVYzxKd; Tue, 5 Nov 2024 01:40:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A51eqRZ062694; Tue, 5 Nov 2024 01:40:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A51eqFS062691; Tue, 5 Nov 2024 01:40:52 GMT (envelope-from git) Date: Tue, 5 Nov 2024 01:40:52 GMT Message-Id: <202411050140.4A51eqFS062691@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: ebd48f1e52d7 - main - include: Install dev/vmm headers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: ebd48f1e52d79ef5d34415d9368c564f3e9bbc08 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ebd48f1e52d79ef5d34415d9368c564f3e9bbc08 commit ebd48f1e52d79ef5d34415d9368c564f3e9bbc08 Author: Mark Johnston AuthorDate: 2024-11-05 01:36:25 +0000 Commit: Mark Johnston CommitDate: 2024-11-05 01:40:41 +0000 include: Install dev/vmm headers In preparation for their use in libvmmapi. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D47029 --- etc/mtree/BSD.include.dist | 2 ++ include/Makefile | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist index 2b32bcc5f39c..ad1b8a5f7413 100644 --- a/etc/mtree/BSD.include.dist +++ b/etc/mtree/BSD.include.dist @@ -187,6 +187,8 @@ .. vkbd .. + vmm + .. wg .. wi diff --git a/include/Makefile b/include/Makefile index 32774419f162..e0391cac87bb 100644 --- a/include/Makefile +++ b/include/Makefile @@ -52,7 +52,7 @@ LSUBDIRS= dev/acpica dev/agp dev/ciss dev/filemon dev/firewire \ dev/hwpmc dev/hyperv \ dev/ic dev/iicbus dev/io dev/mfi dev/mmc \ dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/pwm \ - dev/smbus dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/wg \ + dev/smbus dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/vmm dev/wg \ fs/devfs fs/fdescfs fs/msdosfs fs/nfs fs/nullfs \ fs/procfs fs/smbfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ From nobody Tue Nov 5 01:40:53 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj9ys3Sgrz5cqV7; Tue, 05 Nov 2024 01:40: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj9ys2sLLz4vdv; Tue, 5 Nov 2024 01:40:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770853; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OOuI5vj/axtKT2MhzWqNdqcV2VbhBj2FNAaunpJ1nHU=; b=fY9ma3FzYw0/pY4vZ1e2Nz5zo/4KaWM/+fcS/3hy+MoPKlXZTYNx0MCUet4rxrzR1gy09q 1AzRiLZadIYgyBuwqS47PC1yuhC1WwBXxYxbkPfPrg3ZFZmvuzso//jkQczOBS88N5aet+ swwK+zdt7ObmsD4PTcqPuifgB5U1zqQ5BUX4OftHobGfR33SrnEXUrct9nL4c1zKTD6Ahx 1FXNf3M4xkZzTnQmG6P+26Sz5mlJl0VTjxKWz3mVCxJPdr2d0x7JSVvcyejnH0kFBTZZvq grgrZU+e8lDLwdVpSSSdy6ZNA2d8Tte2CltK9vlBQFl2W1jLWFEEVO6fSoleEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770853; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OOuI5vj/axtKT2MhzWqNdqcV2VbhBj2FNAaunpJ1nHU=; b=JvW6N6lQfn9A2JQb+h7c7v2lNjv6JupLmBze+ul4/70mp3X51kMNGt+A8k+j32RTz/ZeB8 9dzNILH8KGq3x0UJIwyCGiH32udJO+Ojum6GJeKDp0nL7A4v8/feVjqkmhjlyft8Oafwzq y2S7MG4XOPqUDnSH6DGUKPOyyz395btSHCYES7xAy8LfBMbrdNC2IJyaJTwW41XmNueFJo JWrwg3qirck+803ptVYhKjPHNcupzg2J03gxBE1RiiHHzX8TMLj0dzPoQ/zkJ5zewIKi2c DoNLeKIVQ2RNjbRQrrFDfE+XA1YgYDUgBZQj+DchZE152RNSEL/GGZDo2jPvlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730770853; a=rsa-sha256; cv=none; b=iBW4gQkz+Lw5P2U+RSzEWw1CTC+k4d6bDu/E6Hrne41vP2m91RjyNkUcmUvSJnS4IXXElG p2eb1/bOxZS00JM27mXh5MPOFqmJcH32HGDCIbAU5wEg/Afxf5sMBmu76oMg8AWiODbKmG b3o7oAog7LmWTGPKxNJvL/UnGQEzqANZf/OjUtr6dtUa2Uq0ib4jkx6qEZ+zUBDHBaScMC MVf+RZ2QI9P33b5DDStqQ+OIZQ9+mYtCDdPPtc3Ov7CVXxVTd3cWhVaARfPbgAlcryaFBR lZu4IpO2OOo9LXgB6lQu+o9QKMU+GHGf6CsjnTb9SMK7qWCMwEkcADB8pyG1Hg== 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 4Xj9ys1zmxzxnV; Tue, 5 Nov 2024 01:40:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A51er9r062757; Tue, 5 Nov 2024 01:40:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A51erMd062754; Tue, 5 Nov 2024 01:40:53 GMT (envelope-from git) Date: Tue, 5 Nov 2024 01:40:53 GMT Message-Id: <202411050140.4A51erMd062754@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 99127fd10362 - main - libvmmapi: Use the vmmctl device file to create and destroy VMs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 99127fd103624de593c7d1d885387e7d3667d73d Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=99127fd103624de593c7d1d885387e7d3667d73d commit 99127fd103624de593c7d1d885387e7d3667d73d Author: Mark Johnston AuthorDate: 2024-11-05 01:36:33 +0000 Commit: Mark Johnston CommitDate: 2024-11-05 01:40:41 +0000 libvmmapi: Use the vmmctl device file to create and destroy VMs This deprecates the vm_create() and vm_open() interfaces and introduces vm_openf(), which takes flags controlling its behaviour. In particular, it will optionally create a VM first, and it can optionally reinitialize an existing VM. This enables some simplification of existing consumers. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D47030 --- lib/libvmmapi/internal.h | 3 +- lib/libvmmapi/vmmapi.c | 104 +++++++++++++++++++++++++++++++++++------------ lib/libvmmapi/vmmapi.h | 3 ++ 3 files changed, 83 insertions(+), 27 deletions(-) diff --git a/lib/libvmmapi/internal.h b/lib/libvmmapi/internal.h index 42be9ec59770..aa7b1d8e6a93 100644 --- a/lib/libvmmapi/internal.h +++ b/lib/libvmmapi/internal.h @@ -16,7 +16,8 @@ enum { }; struct vmctx { - int fd; + int fd; /* device file descriptor */ + int ctlfd; /* vmm control descriptor */ struct { vm_paddr_t base; vm_size_t size; diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c index 0cf051567110..5042a1f3914e 100644 --- a/lib/libvmmapi/vmmapi.c +++ b/lib/libvmmapi/vmmapi.c @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -50,11 +51,12 @@ #include #include -#include #ifdef WITH_VMMAPI_SNAPSHOT #include #endif +#include + #include "vmmapi.h" #include "internal.h" @@ -78,58 +80,104 @@ #define PROT_RW (PROT_READ | PROT_WRITE) #define PROT_ALL (PROT_READ | PROT_WRITE | PROT_EXEC) -#define CREATE(x) sysctlbyname("hw.vmm.create", NULL, NULL, (x), strlen((x))) -#define DESTROY(x) sysctlbyname("hw.vmm.destroy", NULL, NULL, (x), strlen((x))) - static int vm_device_open(const char *name) { - int fd, len; - char *vmfile; + char devpath[PATH_MAX]; - len = strlen("/dev/vmm/") + strlen(name) + 1; - vmfile = malloc(len); - assert(vmfile != NULL); - snprintf(vmfile, len, "/dev/vmm/%s", name); + assert(strlen(name) <= VM_MAX_NAMELEN); + (void)snprintf(devpath, sizeof(devpath), "/dev/vmm/%s", name); + return (open(devpath, O_RDWR)); +} - /* Open the device file */ - fd = open(vmfile, O_RDWR, 0); +static int +vm_ctl_create(const char *name, int ctlfd) +{ + struct vmmctl_vm_create vmc; - free(vmfile); - return (fd); + memset(&vmc, 0, sizeof(vmc)); + if (strlcpy(vmc.name, name, sizeof(vmc.name)) >= sizeof(vmc.name)) { + errno = ENAMETOOLONG; + return (-1); + } + return (ioctl(ctlfd, VMMCTL_VM_CREATE, &vmc)); } int vm_create(const char *name) { + int error, fd; + /* Try to load vmm(4) module before creating a guest. */ - if (modfind("vmm") < 0) - kldload("vmm"); - return (CREATE(name)); + if (modfind("vmm") < 0) { + error = kldload("vmm"); + if (error != 0) + return (-1); + } + + fd = open("/dev/vmmctl", O_RDWR, 0); + if (fd < 0) + return (fd); + error = vm_ctl_create(name, fd); + if (error != 0) { + error = errno; + (void)close(fd); + errno = error; + return (-1); + } + (void)close(fd); + return (0); } struct vmctx * vm_open(const char *name) +{ + return (vm_openf(name, 0)); +} + +struct vmctx * +vm_openf(const char *name, int flags) { struct vmctx *vm; int saved_errno; + bool created; + + created = false; vm = malloc(sizeof(struct vmctx) + strlen(name) + 1); assert(vm != NULL); - vm->fd = -1; + vm->fd = vm->ctlfd = -1; vm->memflags = 0; vm->name = (char *)(vm + 1); strcpy(vm->name, name); memset(vm->memsegs, 0, sizeof(vm->memsegs)); - if ((vm->fd = vm_device_open(vm->name)) < 0) + if ((vm->ctlfd = open("/dev/vmmctl", O_RDWR, 0)) < 0) + goto err; + + vm->fd = vm_device_open(vm->name); + if (vm->fd < 0 && errno == ENOENT) { + if (flags & VMMAPI_OPEN_CREATE) { + if (vm_ctl_create(vm->name, vm->ctlfd) != 0) + goto err; + vm->fd = vm_device_open(vm->name); + created = true; + } + } + if (vm->fd < 0) + goto err; + + if (!created && (flags & VMMAPI_OPEN_REINIT) != 0 && vm_reinit(vm) != 0) goto err; return (vm); err: saved_errno = errno; - free(vm); + if (created) + vm_destroy(vm); + else + vm_close(vm); errno = saved_errno; return (NULL); } @@ -139,20 +187,24 @@ vm_close(struct vmctx *vm) { assert(vm != NULL); - close(vm->fd); + if (vm->fd >= 0) + (void)close(vm->fd); + if (vm->ctlfd >= 0) + (void)close(vm->ctlfd); free(vm); } void vm_destroy(struct vmctx *vm) { - assert(vm != NULL); + struct vmmctl_vm_destroy vmd; - if (vm->fd >= 0) - close(vm->fd); - DESTROY(vm->name); + memset(&vmd, 0, sizeof(vmd)); + (void)strlcpy(vmd.name, vm->name, sizeof(vmd.name)); + if (ioctl(vm->ctlfd, VMMCTL_VM_DESTROY, &vmd) != 0) + warn("ioctl(VMMCTL_VM_DESTROY)"); - free(vm); + vm_close(vm); } struct vcpu * diff --git a/lib/libvmmapi/vmmapi.h b/lib/libvmmapi/vmmapi.h index 0ea1d5824271..440064ad13cb 100644 --- a/lib/libvmmapi/vmmapi.h +++ b/lib/libvmmapi/vmmapi.h @@ -117,6 +117,9 @@ int vm_munmap_memseg(struct vmctx *ctx, vm_paddr_t gpa, size_t len); int vm_create(const char *name); struct vmctx *vm_open(const char *name); +#define VMMAPI_OPEN_CREATE 0x01 /* create if the VM does not exist */ +#define VMMAPI_OPEN_REINIT 0x02 /* reinitialize the VM if it exists */ +struct vmctx *vm_openf(const char *name, int flags); void vm_close(struct vmctx *ctx); void vm_destroy(struct vmctx *ctx); int vm_limit_rights(struct vmctx *ctx); From nobody Tue Nov 5 01:40:54 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj9yt720Rz5cq8l; Tue, 05 Nov 2024 01:40: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj9yt4Q40z3wfS; Tue, 5 Nov 2024 01:40:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wBFVm4T2yn3d1D4afyLm9EQ++RKcf+a9yg2uJJwyKZs=; b=a2PjF1o3HldhbUoe0VfQgixX1PicPs5Mo8Gb8IbMsdd6gt7e/XjOowhJP5qbDbB9ItLwvL A6M45M0ssO3Phh0hd4Up0+ZqFGa7bO2fbXlfrSOdPtRA1OIUbPsmuk1Un94GhvyoPSO0lh ucQBFMM9mJhwEeKHwcyL8x2nU5oLaBACZo7mulWiheX2DIh/IAypIo/V58O1TXjuwxGY09 dGRBopYhum77m2eo0qpJZfNxjqTjTBO4i3quxdpJ4aA5L8NWaLwrTB3eLVMej+Nb7v86yE wa29yT45c/TsAX6U+aE+au4fiQvqLFj0+7oyRkSAyRm5gg8Ez7NK43wnKnkYvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wBFVm4T2yn3d1D4afyLm9EQ++RKcf+a9yg2uJJwyKZs=; b=GpULTDXG6JFI/6Fg9OHaGyZViL539So2FxrmChzLEiVBTYycu096dms7Jid9Co3y5fBWpD 7ikqI5tR7degG9eHe0+TzIKDqHSn1D1Y0dGMTaEI3ceSU1MNwXAx/OUFxHohgTF+GjZnO/ w5xWdizTItCPfR82bOtAgJ1rmoHJAL6SDXEfeqLIPXGXcfLzIaDvqn4zZVv7xeUHaYFHjH UnVzyqWXjlUV9i9Ln3jhDA7Hd7JS/CTrOTYmU3HmYCLK8WXymAmxhksQcHDRiv0L9OB6jn C4y2wmk0GnnA6P7cepJqjvr6/DY+X24lmGtwuBcvFGeWVXDQIFZ2zQ9Je2pVJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730770854; a=rsa-sha256; cv=none; b=lB31gLfrCwVwV6Hpz1n8nMD3ecTKVKreXTGkBLsy7Ip+2FTRwwxOhwQ4QVZry4hyCCukRV Awh/J3ceduBVXO2TvYb+tV6RwtgkT4xALbBXQoKkGU3GSer2kOaiXd0YKRM+w6gdi7+mwY p/O1FBwSvwV/Lxmu+UmjEOk35puWN20/Jcr4iBKeHQ8GaQdee+J2AxI81wDXEuJP8zYoAM wC+hsdHw48XQduGW7FZWQh8u4zg3vu/V52neYSlaAinoRWrWtYgbKeTG6la3IN7vrqE1Tx 8cszas3oiGPnvYaf9DBZtVdzembdgf6vkZJqz2pn/ghQ03r+nyquGnHEUvJmcA== 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 4Xj9yt2hXfzxnW; Tue, 5 Nov 2024 01:40:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A51es7v062799; Tue, 5 Nov 2024 01:40:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A51es92062796; Tue, 5 Nov 2024 01:40:54 GMT (envelope-from git) Date: Tue, 5 Nov 2024 01:40:54 GMT Message-Id: <202411050140.4A51es92062796@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: c2b34d060705 - main - bhyvectl: Convert to use vm_openf() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: c2b34d060705879d78bbce7e62f9fb35fb13bc55 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c2b34d060705879d78bbce7e62f9fb35fb13bc55 commit c2b34d060705879d78bbce7e62f9fb35fb13bc55 Author: Mark Johnston AuthorDate: 2024-11-05 01:36:52 +0000 Commit: Mark Johnston CommitDate: 2024-11-05 01:40:41 +0000 bhyvectl: Convert to use vm_openf() Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D47031 --- usr.sbin/bhyvectl/bhyvectl.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c index 5e23860d711c..41055678ac30 100644 --- a/usr.sbin/bhyvectl/bhyvectl.c +++ b/usr.sbin/bhyvectl/bhyvectl.c @@ -388,22 +388,17 @@ main(int argc, char *argv[]) if (vmname == NULL) usage(opts); - error = 0; - - if (!error && create) - error = vm_create(vmname); - if (!error) { - ctx = vm_open(vmname); - if (ctx == NULL) { - fprintf(stderr, - "vm_open: %s could not be opened: %s\n", - vmname, strerror(errno)); - exit(1); - } - vcpu = vm_vcpu_open(ctx, vcpuid); + ctx = vm_openf(vmname, create ? VMMAPI_OPEN_CREATE : 0); + if (ctx == NULL) { + fprintf(stderr, + "vm_open: %s could not be opened: %s\n", + vmname, strerror(errno)); + exit(1); } + vcpu = vm_vcpu_open(ctx, vcpuid); + error = 0; if (!error && memsize) error = vm_setup_memory(ctx, memsize, VM_MMAP_ALL); From nobody Tue Nov 5 01:40:55 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xj9yw0ZzXz5cq6l; Tue, 05 Nov 2024 01:40: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xj9yv4yCpz3wj1; Tue, 5 Nov 2024 01:40:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xeqHLaRaBzGq88AdvNDAOe0QMqSWmoXAtxObNcN3qfo=; b=tzl4dwg26WTsubaq9//QBpedAEbUvkTM71FfZwmcHcJLwwNxlGjMY+msTFHysBFiUg0TBp sNtAHDtjuTAzd455kMK+2cXmaXhmlcxxLR3dWbLu22Ys44myaC1c03HSvzaaPN/0oQlqUO zRdwo7JA5NcxTPVeYIx1BSnjG1N4/a1W5A1cj/XaF7wkXlqJniBWgzo27V2tL3hkUQZdpW e6rUCvGCDR6QFv4ndDUvt17Pp4AIxmttvcxotUWI6t4UmtiD9e6QAZ2uera5sGTc0VwmDC i300eLYb3i+LqY4yDky1DcT8+leJSH/VUkg1OlwRako4Z/0rgJoIWDkrU+3Jeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730770855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xeqHLaRaBzGq88AdvNDAOe0QMqSWmoXAtxObNcN3qfo=; b=btV5AW6RJKdOfe75tzzKml3Yf7/Ro9+nRW8JDpEQrfah3VgOOMW3nmoPcUAvGrqeScc4P7 wIMmd4oxFWoXCHuyHb6o7CDwFnC5pl0vGIrkbmg28YNBWs9927R08LWs9nhJPiUpg+hqQJ bTaze0ORQyL+PfuLgO1hPwKrJY0o6R2+nBfb4I0TGOg+n/LnfuPD+mcpNP5NShf1lgrF2Z Su0UmUe2tzFqqEklPSIa5E7oY1DgLsfqcs+CTgR/zDSdlppNkxkLx9mzpcsBGoMK1PGK+X n8tMuw5jdsLg9jlnKouq7D7GGgpsVYTQdqd/fiLSiZ49ILuxXtmXOgWpMqerXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730770855; a=rsa-sha256; cv=none; b=ZauqiNfpxgHtpcbz6CM+XJBlAVLdf+wySOaV8cHSu/Q6DOTvQ12wpXe6uRgJawKNotgG27 7repW9JDUSh0m7YLh+AmpxTzCaEpy/nObW9fBiEIVRnEydpsPqHqpC2BkzgRDAHqbrAPbZ 577rCAsYQmqy847966ol85+saZhjnv/ju/cS2eV0Fq5h+fozIQVF/E6qsUlFVAudYd+Nil MwtVkvbPZJoRrzTbeD2XGx2v9+P2W8rQcFsl3vw0Va1pph7SA71076i6j1xzlZFV6wQZv1 6ZP5CqWFrXQMDE6pXeKedEs+vnZfEjm2ZmD8DUWK4ZeC4E4k+jaEC4ELDHn52Q== 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 4Xj9yv3zg7zxdZ; Tue, 5 Nov 2024 01:40:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A51etX7062851; Tue, 5 Nov 2024 01:40:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A51etNc062848; Tue, 5 Nov 2024 01:40:55 GMT (envelope-from git) Date: Tue, 5 Nov 2024 01:40:55 GMT Message-Id: <202411050140.4A51etNc062848@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 5ef0cd25c4c9 - main - bhyve: Convert to using vm_openf() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 5ef0cd25c4c90e44b556e0420005e128b8fcc6e0 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5ef0cd25c4c90e44b556e0420005e128b8fcc6e0 commit 5ef0cd25c4c90e44b556e0420005e128b8fcc6e0 Author: Mark Johnston AuthorDate: 2024-11-05 01:37:16 +0000 Commit: Mark Johnston CommitDate: 2024-11-05 01:40:41 +0000 bhyve: Convert to using vm_openf() Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D47032 --- usr.sbin/bhyve/bhyverun.c | 51 ++++++++++++----------------------------------- 1 file changed, 13 insertions(+), 38 deletions(-) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index 41655a188bf9..be9cd1611700 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -521,41 +521,23 @@ do_open(const char *vmname) { struct vmctx *ctx; int error; - bool reinit, romboot; - - reinit = false; + bool romboot; romboot = bootrom_boot(); - error = vm_create(vmname); - if (error) { - if (errno == EEXIST) { - if (romboot) { - reinit = true; - } else { - /* - * The virtual machine has been setup by the - * userspace bootloader. - */ - } - } else { - perror("vm_create"); - exit(4); - } - } else { - if (!romboot) { - /* - * If the virtual machine was just created then a - * bootrom must be configured to boot it. - */ - fprintf(stderr, "virtual machine cannot be booted\n"); - exit(4); - } - } - ctx = vm_open(vmname); + /* + * If we don't have a boot ROM, the guest context must have been + * initialized by bhyveload(8) or equivalent. + */ + ctx = vm_openf(vmname, romboot ? VMMAPI_OPEN_REINIT : 0); if (ctx == NULL) { - perror("vm_open"); - exit(4); + if (errno != ENOENT) + err(4, "vm_openf"); + if (!romboot) + errx(4, "no bootrom was configured"); + ctx = vm_openf(vmname, VMMAPI_OPEN_CREATE); + if (ctx == NULL) + err(4, "vm_openf"); } #ifndef WITHOUT_CAPSICUM @@ -563,13 +545,6 @@ do_open(const char *vmname) err(EX_OSERR, "vm_limit_rights"); #endif - if (reinit) { - error = vm_reinit(ctx); - if (error) { - perror("vm_reinit"); - exit(4); - } - } error = vm_set_topology(ctx, cpu_sockets, cpu_cores, cpu_threads, 0); if (error) errx(EX_OSERR, "vm_set_topology"); From nobody Tue Nov 5 02:07:10 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjBYC10zFz5crg3; Tue, 05 Nov 2024 02:07: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjBYC0DQzz42BQ; Tue, 5 Nov 2024 02:07:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730772431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Ls/L8y3tF6DWJzrFvDZOh7BtdqKxAkyUzpFBSe/8Rc=; b=gmDz/dar3bPIGczWmzml9VJcVbvh8HzktKLwhDR8ZYrqfQZYTYP5zGoccJzG+ATr9qs+EP N/7e1C1h7j9OtYnYmLav+ZNnflnne5ZUb0oEH/Xjxq+TlSnBfKSDbnQplZh/865EMbmDy2 /HML21kjG+B7Pjw6NNVlr8Z4pQgSuTbv1O1gUedoC0DxOHfF0bjS3PqkPcrrQFmcD7LFDZ djEbrRsuG0Xj4sgPHcNVZix+MzHrg67yHv+nHVyIL/V7/Gqu7o2XEvdr8gPBhQL5Py/Ywh XJuVRgJS+CTWAKmp7rtw9kmIAKmTTwpcw4fqIoy1H3qB1K9ckzOM5VPEOtfoOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730772431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Ls/L8y3tF6DWJzrFvDZOh7BtdqKxAkyUzpFBSe/8Rc=; b=RVSMTyK5xNhlkAoHz4n/7TfoBni/AFm/Xo9l4FzC+1i9BUknb3d5IORUNCcNjVPCmZ4jA5 5i0aCDNR+xptwKvrXso12gdL3wIre55zysMWTNsuEx9sWpPJie7BYBtr5ShmsMrJDu1Bvb p0W0ooshY6cUOzu3P5pMVLYDtuVKE2yHY1DOs9vxw3FPjhe1T9Tp2t03BcSZLULeWvb8rj DTsX5FgQhBsQWKt6vRyB9Xcr2qAxUTUUqCSvMPHmx4SqnOScBdl5f1STxfJWmCUvyp3NEg AB/Ob7wYF2Gu5FhHWonmOH541xGSbn5C4jZXTHb46wPPUoiM87l6HZHei8MDZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730772431; a=rsa-sha256; cv=none; b=WwXCjAH5NXyQQshSHayv30FkmGlzcHbc5Fs5Zgq7qXk9gUumxFuxTdeADtiPVzlco9JFM6 DveDbT599UB0MsMIvezGrM6K/DTkiQQkepIAHG7lhrmje88nWqZTRygE8d7E91jWTiWzdC 0ByeNSd1LnfYBhquIei9KKrWg6JGOtYrXDNBmn8f3vtomw7RHWD+2viKLdbtVfHgz0SAjL 6RaJazqhsINLeI7y7pT2vBdS8GbDONgV5m1BRf2QvPTgs4qeukXByJJoZZVq/mjKCKtrNL 8YG2MGHRFriboVc7PrbilYKwfSvVHbZmQlXwP/qweI0J4Bruj1mah4Zv3qf1EQ== 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 4XjBYB6xRLzxvJ; Tue, 5 Nov 2024 02:07:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A527AkV006529; Tue, 5 Nov 2024 02:07:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A527Aib006526; Tue, 5 Nov 2024 02:07:10 GMT (envelope-from git) Date: Tue, 5 Nov 2024 02:07:10 GMT Message-Id: <202411050207.4A527Aib006526@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: b032be711c74 - main - Make the CTL tests more resilient List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b032be711c740d2f25b27c92069537edcfac221c Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=b032be711c740d2f25b27c92069537edcfac221c commit b032be711c740d2f25b27c92069537edcfac221c Author: Alan Somers AuthorDate: 2024-11-05 00:26:01 +0000 Commit: Alan Somers CommitDate: 2024-11-05 02:06:53 +0000 Make the CTL tests more resilient Fix the find_device function to work regardless of whether "camcontrol devlist" lists the da device first and the pass device second or vice versa. On FreeBSD 14 and 15 it apparently always lists da first. But on 13 it can do it in either order. MFC after: 2 weeks MFC with: fe1755fa Sponsored by: ConnectWise Reviewed by: emaste, markj, #cam Differential Revision: https://reviews.freebsd.org/D47446 --- tests/sys/cam/ctl/ctl.subr | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/sys/cam/ctl/ctl.subr b/tests/sys/cam/ctl/ctl.subr index 18991e0fa144..868b1c809571 100644 --- a/tests/sys/cam/ctl/ctl.subr +++ b/tests/sys/cam/ctl/ctl.subr @@ -47,7 +47,14 @@ find_device() { ctladm port -o on -p 0 >/dev/null HEXLUN=`printf %x $LUN` while true; do - dev=`camcontrol devlist | awk -v lun=$HEXLUN '/FREEBSD CTL/ && $9==lun {split($10, fields, /[,]/); print fields[1];}' | sed 's:[()]::'` + dev=`camcontrol devlist | awk -v lun=$HEXLUN ' + /FREEBSD CTL.*,pass/ && $9==lun { + split($10, fields, /[,]/); print fields[1]; + } + /FREEBSD CTL.*\(pass/ && $9==lun { + split($10, fields, /[,]/); print fields[2]; + } + ' | sed 's:[()]::'` if [ -z "$dev" -o ! -c /dev/$dev ]; then retries=$(( $retries - 1 )) if [ $retries -eq 0 ]; then From nobody Tue Nov 5 02:11:55 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjBfg5kL5z5cryK; Tue, 05 Nov 2024 02:11: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjBfg5HH7z42dP; Tue, 5 Nov 2024 02:11:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730772715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VFYP8oGo0GhfP2Y/l7Q4EmNujPWnA7b1UYLfMbq05MU=; b=MJYPHr6bH5NflvLfTzFv8IYAsuyWrD13309xhONfXccQznPgULvCcdoLmKn/sNVT5o9hB2 3x63PAW1AgiqE5H2peXmFshTqcGTRZRzU+hjvSiQD+iHXQjPmUfzQ+DDFWHJaSj09PbXYs GBjbebrvckvvpunCuXCsXsGnMFv0VDUK4sv5yoL9akwoXcqwyt6R99a2O2rql9ub9eIGgA g5klcSdbv5drGqc2Gn8snHBMUoJ6K/3c/VY/YEvxt/J1geaNLbuVVMDEoGRGHBBOucX1aG puwWgpUgXENB3k/pmhjZXgcGSzkuPEikxlnaOqBJ1QL9U3TkD+k/atXU6LHSew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730772715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VFYP8oGo0GhfP2Y/l7Q4EmNujPWnA7b1UYLfMbq05MU=; b=bIrQtPIHqqih4mjdqK46zCMS7c7I3X1BZtrfwjP9U8vDNnN21C/o7LQNRCBvFHLj/nht3b /l3Kdob8g1khOzOTb/EhaZveLlNrmUV0rHGanIplRUry/dlH22At2RiA+NaNY23tEYd6Ou wKwTK92GVKuWGM0WF8ECW9vAzGtHPetvUXi3wyEE8Tnc6m+YyoYiJRTRyKLOSig+LcsaEM viSf5IKTVFK2FR+3AIpWxoNdE74VFKNhg8mtgRd03pd8+5HXVlmFuPn0dVjXDZ4CAIw1qt bZc83RrHrGoEWfS/U8htzaBDI2MOZyN08UkqBxs6oRdMqIiJkXw4htDIpukrcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730772715; a=rsa-sha256; cv=none; b=PgFJ6c7qc+tjt9B9zrOpD817wEWjSXmXaQx4I1tEb7aoQAUBJE5VsZylusGSZAdh6Y01Pr NzpO33k4k7FdHMZhMEZl5pk/v/hjLRZ7r7BNHtDrPbmriY9US03k5gk8WI4bxCeuMt4UPW FT+DwptqmfQLdCV1Ak44fJHxwJVsjzxPeK96gAejQUlx4oowvSimORMl/aMwMLm5iEBIfz /Xhx3rL20vMuvNwAf2A4RhJyZBeBBa4GiKZlQxZ6e5nyACcKZZCvWXuIU5vteZjgnOKSPD WjCvH7DrU1h8BlnFyokbPiPoFIe5P1WyZpBpAXKTrG/ZNRfFF2Ni5xFErDyR6Q== 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 4XjBfg4vBRzyTn; Tue, 5 Nov 2024 02:11:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A52BtZM019290; Tue, 5 Nov 2024 02:11:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A52BtpM019287; Tue, 5 Nov 2024 02:11:55 GMT (envelope-from git) Date: Tue, 5 Nov 2024 02:11:55 GMT Message-Id: <202411050211.4A52BtpM019287@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: aa90b92ac289 - main - git-arc: Fix find_author() for external users List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa90b92ac289b2a7eec882caf870e56dbed16a5c Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=aa90b92ac289b2a7eec882caf870e56dbed16a5c commit aa90b92ac289b2a7eec882caf870e56dbed16a5c Author: Jose Luis Duran AuthorDate: 2024-11-05 01:32:25 +0000 Commit: Jose Luis Duran CommitDate: 2024-11-05 02:10:15 +0000 git-arc: Fix find_author() for external users When an external user submits a review in Phabricator, the find_author() subroutine may receive the author_name and author_addr as "null" from the JSON API with git-arc patch. This "null" string gets tested for length by "[ -n", and returning that is greater than zero, in other words, the shell does not understand that "null" means nothing in this case. Fix it by adding a guard, that sets an empty string when the content is "null". While here, standardize the indentation style for find_author() Reviewed by: emaste, markj Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D46789 --- tools/tools/git/git-arc.sh | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh index cca70f61a4cd..f3cae28e3009 100644 --- a/tools/tools/git/git-arc.sh +++ b/tools/tools/git/git-arc.sh @@ -493,16 +493,16 @@ find_author() case "${addr}" in *.*) ;; # external user *) - echo "${name} <${addr}@FreeBSD.org>" - return - ;; + echo "${name} <${addr}@FreeBSD.org>" + return + ;; esac # Choice 2: author_addr and author_name were set in the bundle, so use # that. We may need to filter some known bogus ones, should they crop up. if [ -n "$author_name" -a -n "$author_addr" ]; then - echo "${author_name} <${author_addr}>" - return + echo "${author_name} <${author_addr}>" + return fi # Choice 3: We can find this user in the FreeBSD repo. They've submited @@ -510,8 +510,8 @@ find_author() # similar to their phab username. email=$(git log -1 --author "$(echo ${addr} | tr _ .)" --pretty="%aN <%aE>") if [ -n "${email}" ]; then - echo "${email}" - return + echo "${email}" + return fi # Choice 4: We know this user. They've committed before, and they happened @@ -519,11 +519,11 @@ find_author() # might not be a good idea, since names can be somewhat common (there # are two Andrew Turners that have contributed to FreeBSD, for example). if ! (echo "${name}" | grep -w "[Uu]ser" -q); then - email=$(git log -1 --author "${name}" --pretty="%aN <%aE>") - if [ -n "$email" ]; then - echo "$email" - return - fi + email=$(git log -1 --author "${name}" --pretty="%aN <%aE>") + if [ -n "$email" ]; then + echo "$email" + return + fi fi # Choice 5: Wing it as best we can. In this scenario, we replace the last _ @@ -534,8 +534,8 @@ find_author() a=$(printf "%s <%s>\n" "${name}" $(echo "$addr" | sed -e 's/\(.*\)_/\1@/')) echo "Making best guess: Truning ${addr} to ${a}" if ! prompt; then - echo "ABORT" - return + echo "ABORT" + return fi echo "${a}" } @@ -572,6 +572,16 @@ patch_commit() jq -r '.response | flatten | .[]' > "$diff_data" author_addr=$(jq -r ".authorEmail?" "$diff_data" | sort -u) author_name=$(jq -r ".authorName?" "$diff_data" | sort -u) + + # JSON will return "null" when a field is not populated. + # Turn this string into an empty one. + if [ "$author_addr" = "null" ]; then + author_addr="" + fi + if [ "$author_name" = "null" ]; then + author_name="" + fi + author=$(find_author "$user_addr" "$user_name" "$author_addr" "$author_name") rm "$diff_data" From nobody Tue Nov 5 02:11:56 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjBfj0rL7z5crwY; Tue, 05 Nov 2024 02:11:57 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjBfh6KMSz42qc; Tue, 5 Nov 2024 02:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730772716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pMqqipZEaqu4DjP4lVUzAJIKKsKKBdRxyasVQud7QAw=; b=oy7dKZ2rTQ/8tE60ypv/cn4F8DlCXjeHIc9j8q23VrUuC3u+7qUT6DmyzfqWd8oYHv3eZH 5tEeCG5BSrxLXwsxoIqGiqXeDm3VLJ4G+m6Scq35TAYy1WyhfZND1HAXGJTxC7vHAkMvr4 ioN+Gf0CHo1A5bFw8VvhlY6IAkLNjD9LDMMaXTgk0Mfi88HdtTk/h3wxZ2UnebYs+aDwmi B3c3ieJHrI8GIK3z4caCAKnDdmrGVyE1m4yBYCLlFjANUmdsrGbEpD8If/gIBhzYsdUNb9 l6H4J/3QSpnTHjc0zCkZvqMK4w0yOb33Zx+FsWt3lqd9oR9GVLQt9z4W2MuceQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730772716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pMqqipZEaqu4DjP4lVUzAJIKKsKKBdRxyasVQud7QAw=; b=l4M3JyVhSnDAkYbG2iJXZo98S4D0elvq5MlzcLdMmU7ztCq363DaC3RK87ZkxQ0YzTOB+j Zzd3ICzLletRKKhh3UKY+HkG9ZqG87o9eA7tgTcP1PMN6QGi75cjnxLYKcaHgqjmDp8Eqy G9RdMmeSu/otK+s7zrh6ZsXaY6L8wODtqQv2gIfOayOb5n/y/V8NDgIhiKhKpJAamOuSwR fxKIDBDCZ9OuGJ8jBobG5DLXkhOMHC7vVdkwLlSPtzqVSY7zOJwcJdN1wheeUds9NXe1TP ORNO5x1OI8ModSbcNWuQP59aGUGT/TyzxZ+lQ1fItrkGXoViOjceiBBc42s9GA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730772716; a=rsa-sha256; cv=none; b=O+RVEIEk+VEQ7kPfN9qZF6IfSNxxAh0UQ0xAt3MiUTXgZY8mnsKgiZjE1VD3hthh4K6shE BJNzSvTu1wlJSUB5dfFjB7C++TQYnE5YDQZHLzGqd4E71vHSR4cE0FjGb+7HTicqhEDhEG 0NxWPnsoPkYxdpfHgnnphSeXNmwYtHeNSY2YaKyzjEpVDML4qRYxhoODMY0aQhn5XEut9Y cAfljWsfooDF1uWYvJFusE487iPQIfuVLjy7XXPzTcBBfMpM9GlLMirMGGxL4ZmnBdM9lH WqVBNwheILE+rHaElZQtKYGrOI/q7Leca2Wwyn6hOv7XK1FXPHbE+zQRtshmlA== 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 4XjBfh5wj3zy8b; Tue, 5 Nov 2024 02:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A52BuNL019904; Tue, 5 Nov 2024 02:11:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A52BuYr019901; Tue, 5 Nov 2024 02:11:56 GMT (envelope-from git) Date: Tue, 5 Nov 2024 02:11:56 GMT Message-Id: <202411050211.4A52BuYr019901@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 019981e00f23 - main - git-arc: Fix typo s/Truning/Turning/ List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 019981e00f23b0458067cbd91007f9f03b3b0b7e Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=019981e00f23b0458067cbd91007f9f03b3b0b7e commit 019981e00f23b0458067cbd91007f9f03b3b0b7e Author: Jose Luis Duran AuthorDate: 2024-11-05 01:13:20 +0000 Commit: Jose Luis Duran CommitDate: 2024-11-05 02:10:16 +0000 git-arc: Fix typo s/Truning/Turning/ While here standardize white space. No functional change. Approved by: emaste (mentor) --- tools/tools/git/git-arc.sh | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh index f3cae28e3009..0df4ac4cd5fc 100644 --- a/tools/tools/git/git-arc.sh +++ b/tools/tools/git/git-arc.sh @@ -101,10 +101,10 @@ Config Variables: Defaults to false. arc.list [bool] -- Always use "list mode" (-l) with create and update. - In this mode, the list of git revisions to use + In this mode, the list of git revisions to use is listed with a single prompt before creating or updating reviews. The diffs for individual commits - are not shown. + are not shown. arc.verbose [bool] -- Verbose output. Equivalent to the -v flag. @@ -205,7 +205,7 @@ diff2status() arc_call_conduit -- phid.lookup > "$tmp" status=$(jq -r "select(.response != []) | .response.${diff}.status" < "$tmp") summary=$(jq -r "select(.response != []) | - .response.${diff}.fullName" < "$tmp") + .response.${diff}.fullName" < "$tmp") printf "%-14s %s\n" "${status}" "${summary}" } @@ -305,7 +305,7 @@ create_one_review() "type": "parents.add", "value": ["'"${parentphid}"'"] } - ]}' | + ]}' | arc_call_conduit -- differential.revision.edit >&3 fi rm -f "$msg" @@ -321,15 +321,15 @@ diff2reviewers() reviewid=$(diff2phid "$diff") userids=$( \ echo '{ - "constraints": {"phids": ["'"$reviewid"'"]}, - "attachments": {"reviewers": true} - }' | + "constraints": {"phids": ["'"$reviewid"'"]}, + "attachments": {"reviewers": true} + }' | arc_call_conduit -- differential.revision.search | jq '.response.data[0].attachments.reviewers.reviewers[] | select(.status == "accepted").reviewerPHID') if [ -n "$userids" ]; then echo '{ - "constraints": {"phids": ['"$(printf "%s" "$userids" | tr '[:space:]' ',')"']} - }' | + "constraints": {"phids": ['"$(printf "%s" "$userids" | tr '[:space:]' ',')"']} + }' | arc_call_conduit -- user.search | jq -r '.response.data[].fields.username' fi @@ -427,7 +427,7 @@ gitarc__create() for commit in ${commits}; do if create_one_review "$commit" "$reviewers" "$subscribers" "$prev" \ - "$doprompt"; then + "$doprompt"; then prev=$(commit2diff "$commit") else prev="" @@ -448,8 +448,8 @@ gitarc__list() diff=$(log2diff "$commit") if [ -n "$diff" ]; then - diff2status "$diff" - continue + diff2status "$diff" + continue fi # This does not use commit2diff as it needs to handle errors @@ -457,7 +457,7 @@ gitarc__list() title=$(git show -s --format=%s "$commit") diff=$(echo "$openrevs" | \ awk -F'D[1-9][0-9]*: ' \ - '{if ($2 == "'"$(echo $title | sed 's/"/\\"/g')"'") print $0}') + '{if ($2 == "'"$(echo $title | sed 's/"/\\"/g')"'") print $0}') if [ -z "$diff" ]; then echo "No Review : $title" elif [ "$(echo "$diff" | wc -l)" -ne 1 ]; then @@ -491,7 +491,7 @@ find_author() # freebsd.org (which isn't surprising for ports committers getting src # commits reviewed). case "${addr}" in - *.*) ;; # external user + *.*) ;; # external user *) echo "${name} <${addr}@FreeBSD.org>" return @@ -532,7 +532,7 @@ find_author() # don't know if the prior _ are _ or + or any number of other characters. # Since there's issues here, prompt a=$(printf "%s <%s>\n" "${name}" $(echo "$addr" | sed -e 's/\(.*\)_/\1@/')) - echo "Making best guess: Truning ${addr} to ${a}" + echo "Making best guess: Turning ${addr} to ${a}" if ! prompt; then echo "ABORT" return @@ -587,8 +587,8 @@ patch_commit() # If we had to guess, and the user didn't want to guess, abort if [ "${author}" = "ABORT" ]; then - warn "Not committing due to uncertainty over author name" - exit 1 + warn "Not committing due to uncertainty over author name" + exit 1 fi tmp=$(mktemp) @@ -620,7 +620,7 @@ gitarc__patch() while getopts c o; do case "$o" in c) - require_clean_work_tree "patch -c" + require_clean_work_tree "patch -c" commit=true ;; *) @@ -634,9 +634,9 @@ gitarc__patch() arc patch --skip-dependencies --nocommit --nobranch --force "$rev" echo "Applying ${rev}..." [ $? -eq 0 ] || break - if ${commit}; then - patch_commit $rev - fi + if ${commit}; then + patch_commit $rev + fi done } From nobody Tue Nov 5 02:11:57 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjBfk3NzYz5cryN; Tue, 05 Nov 2024 02:11: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjBfk0bMrz42pH; Tue, 5 Nov 2024 02:11:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730772718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HUG/hJTPUQ6jdMVvEz4wkDdGgim+Pm0ZUsaGHxnmlfg=; b=oT3DYnQVqOc80qVfhuyUhvs8REbHT+/lRs4ndgIsPI4iM2WF+LuaBdblVXWKHitUxDKKnk gr5y3291d+sphNMfmMAsK0jAazVfxdJ/cR4IQFhh1hhfmQu1s0lmZB4s6tUL9nWWHVCPC4 w42psNVHX4I79FseNjNbcBx6vOKkoeocq9g6M0ojgOePnSdTgwzifuKp/nmIDWEIaLUJku 7vjumzlAUvZ8LUr6iRSsp7XwHCF/4OYdd1AdI3EyzJUBJRwJdtun5dPm6jh2c0ixdysIYy 4FppK3tmofylxmAoD8deWrRDL1LnrL5qGjExnpN4SmoDfhjpA0u180FzZZ2pwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730772718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HUG/hJTPUQ6jdMVvEz4wkDdGgim+Pm0ZUsaGHxnmlfg=; b=vZiGOMgDV03wO0EXUxom7zKwr2m0hZQQmZPtn+pUi8SaQo/hdudOTfnL6Y3YJO0QCLpC2h HKOtvH0+mxde/LEO8BjnQZUlaamhZ97permdFD4mO09ST0A0CBSX0lCSCnF6wOL4beHXUr dFmDtegdNqdSfufAxPSoUkK4RC/KM0mujOXActEIRSSpbH/83YPyV5VRL2R7NrsvChG4OM h/iJ9V/7jV2gK3XnXzwru9lOLzSovR66yQdYaE2eTUakoCIseq8RNTP/7dsizBWTbULYPs MKe28u0/2gIllf+LiJolN96JGyNFvBLhbSgvi5D59Vs5TyTpXcaEfHjvKktTig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730772718; a=rsa-sha256; cv=none; b=C2NzhgqidoVtMK19GttMorZMt4eklMTrYWIpGxWXL24ufumb94nKM/adIjlOIATWSRJjpB hBriqgfW9ez91vd35qbVEFAwL7GmomcAhgYo3GSY7Vgw0qhhMmE9YcPRjmgLEsK9J9la/z sP7jPyFsPN2baF87PUpvKn4ZcxWH1RARpIM+YRsKoeHoqbQtcRlrW8nE8AzXQOoZLM7as9 OpIUbMlBTKQLd2iQC6TwLFucOuOWYj1Z4gABYMO28b5FvEI6N0pbvCJa1DPK4WdX32LNkv pkMGQ9FhkJgZ/QghZU7MdLLvOCa0q7lxZL8g+uy9MdNgDMD9DOPW+O0ZmE1GYQ== 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 4XjBfj6yL7zyfq; Tue, 5 Nov 2024 02:11:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A52BvDQ019949; Tue, 5 Nov 2024 02:11:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A52Bv4n019946; Tue, 5 Nov 2024 02:11:57 GMT (envelope-from git) Date: Tue, 5 Nov 2024 02:11:57 GMT Message-Id: <202411050211.4A52Bv4n019946@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 2377c19a8c37 - main - git-arc: Trap on every mktemp List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2377c19a8c37c3494d065c2a9e8b155147c1feb4 Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=2377c19a8c37c3494d065c2a9e8b155147c1feb4 commit 2377c19a8c37c3494d065c2a9e8b155147c1feb4 Author: Jose Luis Duran AuthorDate: 2024-11-05 01:47:52 +0000 Commit: Jose Luis Duran CommitDate: 2024-11-05 02:10:16 +0000 git-arc: Trap on every mktemp Trap: - EXIT (0) - HUP (1) - INT (2) - QUIT (3) - TRAP (5) - USR1 (10) - TERM (15) every time mktemp is called to reduce the chances of leaving stray files or directories with possible sensitive data inside. We avoid using a template with mktemp, as some operating systems may use unpredictable base paths by default (macOS). Suggested by: des Reviewed by: emaste, 0mp, des (earlier), markj Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D47289 --- tools/tools/git/git-arc.sh | 48 +++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh index 0df4ac4cd5fc..64d1ee2bd63f 100644 --- a/tools/tools/git/git-arc.sh +++ b/tools/tools/git/git-arc.sh @@ -43,6 +43,14 @@ err() exit 1 } +cleanup() +{ + rc=$? + rm -fr "$GITARC_TMPDIR" + trap - EXIT + exit $rc +} + err_usage() { cat >&2 <<__EOF__ @@ -147,6 +155,12 @@ __EOF__ exit 1 } +# Use xmktemp instead of mktemp when creating temporary files. +xmktemp() +{ + mktemp "${GITARC_TMPDIR:?}/tmp.XXXXXXXXXX" || exit 1 +} + # # Fetch the value of a boolean config variable ($1) and return true # (0) if the variable is true. The default value to use if the @@ -200,7 +214,7 @@ diff2status() err "invalid diff ID $diff" fi - tmp=$(mktemp) + tmp=$(xmktemp) echo '{"names":["'"$diff"'"]}' | arc_call_conduit -- phid.lookup > "$tmp" status=$(jq -r "select(.response != []) | .response.${diff}.status" < "$tmp") @@ -279,7 +293,7 @@ create_one_review() return 1 fi - msg=$(mktemp) + msg=$(xmktemp) git show -s --format='%B' "$commit" > "$msg" printf "\nTest Plan:\n" >> "$msg" printf "\nReviewers:\n" >> "$msg" @@ -308,7 +322,6 @@ create_one_review() ]}' | arc_call_conduit -- differential.revision.edit >&3 fi - rm -f "$msg" return 0 } @@ -542,31 +555,30 @@ find_author() patch_commit() { - local diff reviewid review_data authorid user_data user_addr user_name author - local tmp author_addr author_name + local diff reviewid review_data authorid user_data user_addr user_name + local diff_data author_addr author_name author tmp diff=$1 reviewid=$(diff2phid "$diff") # Get the author phid for this patch - review_data=$(mktemp) + review_data=$(xmktemp) echo '{"constraints": {"phids": ["'"$reviewid"'"]}}' | \ arc_call_conduit -- differential.revision.search > "$review_data" authorid=$(jq -r '.response.data[].fields.authorPHID' "$review_data") # Get metadata about the user that submitted this patch - user_data=$(mktemp) + user_data=$(xmktemp) echo '{"constraints": {"phids": ["'"$authorid"'"]}}' | \ arc_call_conduit -- user.search | \ jq -r '.response.data[].fields' > "$user_data" user_addr=$(jq -r '.username' "$user_data") user_name=$(jq -r '.realName' "$user_data") - rm "$user_data" # Dig the data out of querydiffs api endpoint, although it's deprecated, # since it's one of the few places we can get email addresses. It's unclear # if we can expect multiple difference ones of these. Some records don't # have this data, so we remove all the 'null's. We sort the results and # remove duplicates 'just to be sure' since we've not seen multiple # records that match. - diff_data=$(mktemp) + diff_data=$(xmktemp) echo '{"revisionIDs": [ '"${diff#D}"' ]}' | \ arc_call_conduit -- differential.querydiffs | jq -r '.response | flatten | .[]' > "$diff_data" @@ -583,7 +595,6 @@ patch_commit() fi author=$(find_author "$user_addr" "$user_name" "$author_addr" "$author_name") - rm "$diff_data" # If we had to guess, and the user didn't want to guess, abort if [ "${author}" = "ABORT" ]; then @@ -591,12 +602,11 @@ patch_commit() exit 1 fi - tmp=$(mktemp) - jq -r '.response.data[].fields.title' "$review_data" > $tmp - echo >> $tmp - jq -r '.response.data[].fields.summary' "$review_data" >> $tmp - echo >> $tmp - rm "$review_data" + tmp=$(xmktemp) + jq -r '.response.data[].fields.title' "$review_data" > "$tmp" + echo >> "$tmp" + jq -r '.response.data[].fields.summary' "$review_data" >> "$tmp" + echo >> "$tmp" # XXX this leaves an extra newline in some cases. reviewers=$(diff2reviewers "$diff" | sed '/^$/d' | paste -sd ',' - | sed 's/,/, /g') if [ -n "$reviewers" ]; then @@ -605,7 +615,6 @@ patch_commit() # XXX TODO refactor with gitarc__stage maybe? printf "Differential Revision:\thttps://reviews.freebsd.org/%s\n" "${diff}" >> "$tmp" git commit --author "${author}" --file "$tmp" - rm "$tmp" } gitarc__patch() @@ -665,7 +674,7 @@ gitarc__stage() git checkout -q -b "${branch}" main fi - tmp=$(mktemp) + tmp=$(xmktemp) for commit in $commits; do git show -s --format=%B "$commit" > "$tmp" title=$(git show -s --format=%s "$commit") @@ -826,4 +835,7 @@ if get_bool_config arc.browse false; then BROWSE=--browse fi +GITARC_TMPDIR=$(mktemp -d) || exit 1 +trap cleanup EXIT HUP INT QUIT TRAP USR1 TERM + gitarc__"${verb}" "$@" From nobody Tue Nov 5 02:11:58 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjBfl2Ldkz5cs8b; Tue, 05 Nov 2024 02:11: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjBfl0n0Cz42bT; Tue, 5 Nov 2024 02:11:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730772719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mdWY2w+Bw81323PcAZa2C9h3UgWIA1DWDtAtQG8CMtY=; b=ZV4S4x5uiwWHFVYl1vNBskL2+QLX+C0vSizCsS5nd0H0sqUe/0HzJAvQs5YfU6ipLWeRuz 0Rb6Uf14aIsDLAEb+mQ8L7EU2JttIF6rJWqZQaU8CAnEjLFMW9Udr9y7hcQ9XqbBWjAS1r 5ub+TS81CbEnOahwLnrR7ikPNZk8JbOHj2YjhvMpPtSybQ/sEaDKeICunnqxZZlPhHjtD5 mBCmSFsJQVTTqoJDR09bt4ICwcLyLekaUh5GcM/oU4dk18w+FvwVVM7e8lhlSvmeHYfDt/ CTMvxCuyc43lrPMXdyJTTwmr81t72CMMlDgTod67yuACBWVkU7l8aZRnIqxssA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730772719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mdWY2w+Bw81323PcAZa2C9h3UgWIA1DWDtAtQG8CMtY=; b=rHBpLwlMYpaPGpzP1sHnpnArZk8eDhvhx8Ymr5srdGQOooK07pqZHXzjPb2V0NWCy+pmkd OQm1lMlGFIiWnyr+04UmAzQXqBltZhWcz432M9NKtxFcHZ9e6JDk5CzsmiQxUGqP5A4Bd4 GHANpp3FJ3R8UIOrhsAFsoR3HRT3vsQNJOu282Awp9UaiXS94w/yT2N/9QjNE0N1nLDIuQ v4UdvKd2lmUdjM8PS3jXL04660eoaFyWgdlsGw8lROlN0libxdD5uXPPUtLC82+voydAJm yyhTK26O87ZcxCzIn+FCMUIvxnD9d77pqWNJB+WlpilrjuM/aGjT9iJvURl3Wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730772719; a=rsa-sha256; cv=none; b=QRuiO33IIWqhKbyvCd+YFUeWzIwZQpeffWVQT54F9RCldLomKQvz8qY+n4hzfFGAOP9uBQ V/2Cc/hjTg4qDAgs1vyVRa3IsuUE+8rHqAzN2skB6X/GTGe2WPvhHXKrTBrMzoqtkflFxg 4OsFC31DSC0Wk9t9wy48dLUsA99FIVz5QjlXLDkDBIbco6rI6Y/pPvKCir8l53MWoHixOd nfGi88prEzuKj0CpoqFYeuQyt9U8tp8ebzsOM4WXpw9xxYCECI66XjQwkXzXg0TfHottfw LCdlv+NidxGk2dsINYCmoVFlhOWjT+4KdBPcfXN1F8vvF0mG0vWi7C2wQzXzSA== 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 4XjBfl0MQkzxgl; Tue, 5 Nov 2024 02:11:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A52BwIR020000; Tue, 5 Nov 2024 02:11:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A52Bwbo019997; Tue, 5 Nov 2024 02:11:58 GMT (envelope-from git) Date: Tue, 5 Nov 2024 02:11:58 GMT Message-Id: <202411050211.4A52Bwbo019997@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 9e84289f2c7e - main - git-arc: Prefer echo over printf List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9e84289f2c7e6b632047a75b653fcd587287a8b9 Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=9e84289f2c7e6b632047a75b653fcd587287a8b9 commit 9e84289f2c7e6b632047a75b653fcd587287a8b9 Author: Jose Luis Duran AuthorDate: 2024-11-05 01:13:22 +0000 Commit: Jose Luis Duran CommitDate: 2024-11-05 02:10:16 +0000 git-arc: Prefer echo over printf Prefer echo over printf. Prevent the newline character from being translated by using 'blank' instead of 'space' in the re_format. This change was reviewed in: https://reviews.freebsd.org/D47289 Committed separately for clarity. Suggested by: des Approved by: emaste (mentor) --- tools/tools/git/git-arc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh index 64d1ee2bd63f..050ec4ec1f2c 100644 --- a/tools/tools/git/git-arc.sh +++ b/tools/tools/git/git-arc.sh @@ -341,7 +341,7 @@ diff2reviewers() jq '.response.data[0].attachments.reviewers.reviewers[] | select(.status == "accepted").reviewerPHID') if [ -n "$userids" ]; then echo '{ - "constraints": {"phids": ['"$(printf "%s" "$userids" | tr '[:space:]' ',')"']} + "constraints": {"phids": ['"$(echo "$userids" | tr '[:blank:]' ',')"']} }' | arc_call_conduit -- user.search | jq -r '.response.data[].fields.username' From nobody Tue Nov 5 02:50:35 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjCWH55TBz5ctlc; Tue, 05 Nov 2024 02:50: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjCWH4Yg7z465D; Tue, 5 Nov 2024 02:50:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730775035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yyr26AzLHT0+ch2EgFtNJrEauotj4QT7566YOlu0Shw=; b=RAnO7DSp0OrCqToHwe50U38l3jnyh+I8pM8X/1tmHkQoLJY+ilfSkI1+bJj653BnrH5cDK RDneKOdYT7w1xGLoS70aaNdeBR2qQyF2ldbEytMwlGNK1REBxvDpbL/ATHqynjl+Py5Bx+ lVIfkSghRm5E0+OibTzZLG0m+154+J6akYOCFZM4BWpYzIGX+fkNAodcAFzyX4eJlES0HR CsRh1jhcXPa70w7xMmqh1oVaE/HApnvYt21SOI0kQu/R8gyjBUJl1wuTGUotKct0w2yjEO e+VH3gonHCwIAEOu2IAZYReLang9pTMI8CLYK8D6djtF1zpqYa8NyBwqkfHSWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730775035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yyr26AzLHT0+ch2EgFtNJrEauotj4QT7566YOlu0Shw=; b=iiQck/RCxl/El6FIkfKM3QTtE+41JcRvkWih9av2toLcY4KdndyrQXTu1/TA+vMI/GRYDQ PXrCiY3ldHky0FJQM+/csJetDCHE+U+VoG6useU0lnVUUV5BAlpKKjy0gHJ/rEGxLuaL7T dzVnHgtxzhdPvszettX1LclqlEI1wajAkOEx5e/lcZhq5ZgEUAYgbfSUtjGLqBZ84xjTGn zVB9MH0D9u5T70LGSHn0sOZMbeHzkreow39mV8f4wbuzycGyIeOs26kvyxpOxmL+TovXJf OKdO+iAnTNcQjgF7P3s1W1KG+Whfuf/6CDgI6sc15SPVDD7qxmj5+b2Le+2PBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730775035; a=rsa-sha256; cv=none; b=L5VsGeYQylzeFdycW7EVCduPOMh+8ZJCu/QM8gFw97PapW6/26r13UulXwkuuATH3gUooK 99dOAKsly7OnP/jCFDaXdLj6JXX8Ru0WNeU89VIBULC+rmJQJm6Vi5jAnFAKrPeuS6YHds 7QeQ6EtZscRYJ+84zEuaBk3mh7Oar3NNynRs5VEWYlLqC7udNf/ifLIIlgRsYgzcdhqevk hUQLAeSqRtRDvIhLe3kYxet9kIo8odh7b94iPVC9QPLMIdTZ/qj7FbyWNeE2Ey9MJe6bTW 6M7lqM5UjFxW7r1zLFh2aQCIrJ3DFQJRUcb68ik8HCI4Lt5BKSHcVLLW9MW8Eg== 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 4XjCWH48wPz10SZ; Tue, 5 Nov 2024 02:50:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A52oZ6x089111; Tue, 5 Nov 2024 02:50:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A52oZcR089108; Tue, 5 Nov 2024 02:50:35 GMT (envelope-from git) Date: Tue, 5 Nov 2024 02:50:35 GMT Message-Id: <202411050250.4A52oZcR089108@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 2e29bf7a2ae6 - main - ping: tests: Cleanup IPOption()s List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2e29bf7a2ae66acb6e65ffc1c923cfb373af67bd Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=2e29bf7a2ae66acb6e65ffc1c923cfb373af67bd commit 2e29bf7a2ae66acb6e65ffc1c923cfb373af67bd Author: Jose Luis Duran AuthorDate: 2024-11-05 02:46:45 +0000 Commit: Jose Luis Duran CommitDate: 2024-11-05 02:46:45 +0000 ping: tests: Cleanup IPOption()s Scapy now only accepts known options with IPOption(), so our unknown option must be passed raw. While here, prefer the named options for EOL and NOP. Reviewed by: emaste, kp Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D47160 --- sbin/ping/tests/test_ping.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py index 8ec0f3dc74dc..90df07d0e5b9 100644 --- a/sbin/ping/tests/test_ping.py +++ b/sbin/ping/tests/test_ping.py @@ -85,11 +85,11 @@ def generate_ip_options(opts): ] routers_zero = [0, 0, 0, 0, 0, 0, 0, 0, 0] if opts == "EOL": - options = sc.IPOption(b"\x00") + options = sc.IPOption_EOL() elif opts == "NOP": - options = sc.IPOption(b"\x01") + options = sc.IPOption_NOP() elif opts == "NOP-40": - options = sc.IPOption(b"\x01" * 40) + options = sc.IPOption_NOP() * 40 elif opts == "RR": ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) options = sc.IPOption_RR(pointer=40, routers=routers) @@ -116,7 +116,7 @@ def generate_ip_options(opts): options = b"\x9f" elif opts == "unk-40": ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) - options = sc.IPOption(b"\x9f" * 40) + options = b"\x9f" * 40 else: options = "" return options From nobody Tue Nov 5 02:50:36 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjCWJ6T8Tz5ctlf; Tue, 05 Nov 2024 02:50: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjCWJ5rz8z467Y; Tue, 5 Nov 2024 02:50:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730775036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2mhNnaJJTEV1xi59FIJrVacvJENkdH8DJ7bpDmhByqw=; b=nF+75kMHzb/k7vLYHhE3AHh5kVclx/F+RTTZxb717AiMbQhFiGfDgrresb/OJK/sfA1+DY 6LcIFelU1vVLNsH6YZtqJo2aNdHz9ADm4DBlVskDWxVgoFlQ9S4VpRXh3nmG+gCokyaH/3 2BfN8OxgqKw6NfM2LSJ822UwgyT9agcJSeYol9q/fyuwl3+uKROtNceOTu7uh/W1qKkdxv LLAOoJUIxp3dX5CaDtOjsvaXZWryq8HocvGJJCQg9s7TMMac7cONTbzWUjq/XWPHkYx/Fc SghELSHXCdzTSqilnytZDaNtD/httYWnRz333YraYShOcTc3ZRdIUt/22L209g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730775036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2mhNnaJJTEV1xi59FIJrVacvJENkdH8DJ7bpDmhByqw=; b=rk6b205EL9zAIOvZ4cI1XwznjZLvCbNwVOk2a9au3po4Yt8FooS2G1OJdBT2aYcsortBUk 7E+4hK5GwN6Q94GwjVoqiZ/8rPwCSRTWhlqXyfi2IfOwSomfXd6/L94DM3iQ7EpNmTE8wA cZhVZdhueKN25jmXnZlR25plvxT6+WIL3xn+V8LRN/dbbUW9JDVFNXulWzyqWBAGPd43EN JOn7D0EUDCcon0YnrH5egD0dO7KbdYhjcUKoMvWAh7k6q2kkdJj+aQmgNjARmrbSHYDJPE GwFlPzZjGT6sfetRJQL9/PPSyTfAOSriCjVp6ExLNht1vzqgxV0osZyDNzbo6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730775036; a=rsa-sha256; cv=none; b=rJaFq+zHtKxkT5dz+66a32f+j6XQ+A04R7Uj1OzEerxR3DV0ocYqQlD+sDdZbbljwFHHY5 OEHb4ExerZL/g2Ce4BZwgSZINj7WnHUvui/mjWhC5TfHaFolIGGB3W1un9WtlKfwBzgnmc /gLbSe13y3Qh8aXAPjlF5CsHL4H5c/jzwqEGqYomQDoKvjoNjiZVoGC59oqvK1LbyuV2CU SYJNzGi7ktzgtZ319m1o8jaR3W5z/ybElsB4gcS8RGi+aUtUr23A3Z1MCXQDlO93WNqaim n3ZJyFAAnCVLy7uGjMxNMxYyeEUrmuxI6ww7npSjqjH6uvFl/mH+uw39kabgrQ== 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 4XjCWJ5SFMz10DL; Tue, 5 Nov 2024 02:50:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A52oasG089177; Tue, 5 Nov 2024 02:50:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A52oaLU089174; Tue, 5 Nov 2024 02:50:36 GMT (envelope-from git) Date: Tue, 5 Nov 2024 02:50:36 GMT Message-Id: <202411050250.4A52oaLU089174@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 4859030ef193 - main - ping: tests: Align with Scapy defaults List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4859030ef193688153f490915794ae9ab77f012b Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=4859030ef193688153f490915794ae9ab77f012b commit 4859030ef193688153f490915794ae9ab77f012b Author: Jose Luis Duran AuthorDate: 2024-11-05 02:48:34 +0000 Commit: Jose Luis Duran CommitDate: 2024-11-05 02:48:34 +0000 ping: tests: Align with Scapy defaults Align some of pinger() defaults with Scapy to facilitate debugging when printing packets. No functional change intended. Reviewed by: emaste, kp Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D47159 --- sbin/ping/tests/test_ping.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py index 90df07d0e5b9..cf2e46a146c8 100644 --- a/sbin/ping/tests/test_ping.py +++ b/sbin/ping/tests/test_ping.py @@ -63,14 +63,14 @@ def build_response_packet(echo, ip, icmp, oip_ihl, special): if icmp.type in icmp_id_seq_types: pkt = ip / icmp / load else: - ip.options = "" + del ip.options pkt = ip / icmp / oip / oicmp / load return pkt def generate_ip_options(opts): if not opts: - return "" + return [] routers = [ "192.0.2.10", @@ -118,7 +118,7 @@ def generate_ip_options(opts): ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) options = b"\x9f" * 40 else: - options = "" + options = [] return options @@ -134,7 +134,7 @@ def pinger( icmp_code: sc.scapy.fields.MultiEnumField, # IP arguments ihl: Optional[sc.scapy.fields.BitField] = None, - flags: Optional[sc.scapy.fields.FlagsField] = None, + flags: Optional[sc.scapy.fields.FlagsField] = 0, opts: Optional[str] = None, oip_ihl: Optional[sc.scapy.fields.BitField] = None, special: Optional[str] = None, @@ -169,7 +169,7 @@ def pinger( :keyword ihl: Internet Header Length, defaults to None :type ihl: class:`scapy.fields.BitField`, optional - :keyword flags: IP flags - one of `DF`, `MF` or `evil`, defaults to None + :keyword flags: IP flags - one of `DF`, `MF` or `evil`, defaults to 0 :type flags: class:`scapy.fields.FlagsField`, optional :keyword opts: Include IP options - one of `EOL`, `NOP`, `NOP-40`, `unk`, `unk-40`, `RR`, `RR-same`, `RR-trunc`, `LSRR`, `LSRR-trunc`, `SSRR` or From nobody Tue Nov 5 03:20:43 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjDB32Rhtz5cvqh; Tue, 05 Nov 2024 03:20: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjDB31xhYz48WS; Tue, 5 Nov 2024 03:20:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730776843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y92KKazwHeeFNvd2AMgTynFfCGeVtbHuTb1GRlrk7B4=; b=qwBsTNt20SEgNeg18AydGr4mZsjgvM2cFXeWpchPfPGnq0QuG06lW5lPNDIjsA2Q+K2mJi x4cE6KtDh39dygncIDeN+eRuF7L8Es/HVWc/sdAs1sWgMNy6b793Gj2TkJIKcT7bXlkKd0 A6W1P2uDoqETOjwacJZnuRXpM8cCt7l+IFUrQPc2hHRUOU0A9FcV3UEKnyOZjQMLI1p55v xpf5F5lLHiDZsJqwS2kXGkCYr6giuRq01xgTkLR3A5/o/PqjZaToAJYAXflmAYZn+GrxFz 3P7the2SeKDMd11S80gqNEWV3VKfYHA8/9ArPY1i88W43jDPrYIAdl1z2I9g6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730776843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y92KKazwHeeFNvd2AMgTynFfCGeVtbHuTb1GRlrk7B4=; b=wk+UcyjSCw1FuaYIVPdWjiN6tG+CGOhTr1IczSjV9hdgtLNE49B7QXG2aoYTxvKU4WwKmU jLsamfffLG4pBj9VFdDhMflsiCef0TfNtymwkPDQefLlgFB3QZHC44ijUyFnWEOALY0HJo wzOR+uwYxBn6vjyVZYi0pXKulsUnBFSx9O2LOTmAwxM5jjfFs8slSrBe5mZNfy2FWeYgVU okljKHyhfs5vbbKTDzYvLZKLJkQCTC77af7gGD4Y+Tw1RzZtk/H/bY2dUVL5b3OFETlZED YCZBvwCsV7saFMH/uudiTxUO+LRB3Eywn9fOmO7TaZpdiYVy2w7mnyV0N74JwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730776843; a=rsa-sha256; cv=none; b=EneMLDrSf0YELWcPnct7lCB2XaNEmfjNFqlLUeR86TY7gb4V/pGVzSCVg1uc7YFcbWeN0U Edc23iE3LUkpdxgdbzKgpRH+dTaAo65xpi6VB6znjk35eKlhLqrhJdppkTnNOV38e8dsCT /YwfxdptrqAEJhFGuGX84+NwO6OCstxX9OkXeTnViVPt1HwLRQge2abSZxYVNSLxVEZF/l nodhHntQii21t8lnZ2uc6XdGgwVOO+n+sAL81vgSCMaRNyoVikvi9PQRVa5uhnye9Dm0Fg IE+CVz/FJ3Ru+vZfHo1zO9lQ0cViPWyIpiVNJ+nrGxeU9KoLeNnJ7zBsWyWowQ== 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 4XjDB31Y3kz10wp; Tue, 5 Nov 2024 03:20:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A53KhDX048014; Tue, 5 Nov 2024 03:20:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A53Khi5048011; Tue, 5 Nov 2024 03:20:43 GMT (envelope-from git) Date: Tue, 5 Nov 2024 03:20:43 GMT Message-Id: <202411050320.4A53Khi5048011@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 8b13cb9d654c - main - ping tests: Silence deprecation warnings List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b13cb9d654c985534d24a09ec5dab02cc4dea6e Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=8b13cb9d654c985534d24a09ec5dab02cc4dea6e commit 8b13cb9d654c985534d24a09ec5dab02cc4dea6e Author: Jose Luis Duran AuthorDate: 2024-11-05 03:04:53 +0000 Commit: Jose Luis Duran CommitDate: 2024-11-05 03:07:03 +0000 ping tests: Silence deprecation warnings Declare some regex patterns as a raw string by prepending `r`. Reviewed by: markj Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D42174 --- sbin/ping/tests/test_ping.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py index cf2e46a146c8..93b42d7d53bd 100644 --- a/sbin/ping/tests/test_ping.py +++ b/sbin/ping/tests/test_ping.py @@ -270,15 +270,15 @@ def pinger( def redact(output): """Redact some elements of ping's output""" pattern_replacements = [ - ("localhost \([0-9]{1,3}(\.[0-9]{1,3}){3}\)", "localhost"), - ("from [0-9]{1,3}(\.[0-9]{1,3}){3}", "from"), + (r"localhost \([0-9]{1,3}(\.[0-9]{1,3}){3}\)", "localhost"), + (r"from [0-9]{1,3}(\.[0-9]{1,3}){3}", "from"), ("hlim=[0-9]*", "hlim="), ("ttl=[0-9]*", "ttl="), ("time=[0-9.-]*", "time="), ("cp: .*", "cp: xx xx xx xx xx xx xx xx"), ("dp: .*", "dp: xx xx xx xx xx xx xx xx"), - ("\(-[0-9\.]+[0-9]+ ms\)", "(- ms)"), - ("[0-9\.]+/[0-9.]+", "/"), + (r"\(-[0-9\.]+[0-9]+ ms\)", "(- ms)"), + (r"[0-9\.]+/[0-9.]+", "/"), ] for pattern, repl in pattern_replacements: output = re.sub(pattern, repl, output) From nobody Tue Nov 5 03:20:44 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjDB45P3Gz5cwDs; Tue, 05 Nov 2024 03:20: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjDB43Z1Dz487d; Tue, 5 Nov 2024 03:20:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730776844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=htWL6vTcBpMLIikay8Bm8SrbnBQsMm5zFcYLFDdoR3Y=; b=QqE/C5pKhF6GFHK1DDcuGFag0uHG6Epj3cexOzqKvBZNp4lJpolqJdCHxLT6F+h6xfrT+1 weHWt1jwJAc8YxDoJo6dkoY/BRA94Qjr+IbXAEjFfMSETYKKe0206eWnbfUwodqB9a5Aps WAVo5suY5v8N9rBdAVjBIx93dnY4hZtqJC6qdvsEVIoubhFMmegCC8SQqCcjP1P/1NoXhB DmCeQQ5sYpYwL2DX2dX4t7koFsc/EPzEJ6gLVe9uhxBWjqzpaGESZ9BisRxEW3PqUJWkct OnbgEkENiN3/rMSQ+eEM85pmkyeSOpOXko+uMRV+rhPQ4+sq3de6GmSkGjbXqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730776844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=htWL6vTcBpMLIikay8Bm8SrbnBQsMm5zFcYLFDdoR3Y=; b=gNMBQEUuXRUGV/TmL/PTYsMcUQKOu9oxvbcpADb65MZ/8qLJt0shcQKxmLzDnd27RjJi1m pF/CeWU+AJmgXma6u0KWm1+310QL+jtnKXFqapcwSxxEmS90FM+48yQoVKctlO5Z/wR1wf 3ZFZlPkQSWru0RFHfble2UG8LyeHxJTPsKyWUgQiEXW8wDXlp9rEgTVDMmTjgITEQ6O8Kb DTNrQg2ONiuVbt7FG1n66KRF2BOUewWTUyuh1ON+gfIBblDeVjWNHPqNXW4Eye7GDJ7MBM tLjlKK/2A8THSIprTk7As7SayjNbH2wbRScO3yNHfLhLXOQlspM5dEDOWLnFMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730776844; a=rsa-sha256; cv=none; b=Tbcj9oBCXWcRFmlXopEQCVVe/fMo7PMlrZEA7rxhEK98pxVUF48CnkthZD7uer/nPOfKMF 2cyt7Ec6/EFB9IY1RGQa6UcYmGibaBxTkrH3+pniucrNzegHAlKWGfazBrNYBPx2lBoMkq 5RIKc6Gs7ZtAHYccaFgvPDVnIhJU6Ctri9p1gI4eedGzNiVuhV1HqsEriNw70QUYcQkxyt BfAubH6y+5Cx1oZanYBcZtvWSwDqCXw7HZrfCLKTo/1sHJMl0fk3a08ZoC1FU5kxys4gVq iZO7/fM1Z79+UhFMwmjxYbpNp3/pspBwJkw+gj+C8iVZoHQnDwa7oMdXqG7NNg== 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 4XjDB42LY7z1093; Tue, 5 Nov 2024 03:20:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A53KiIn048080; Tue, 5 Nov 2024 03:20:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A53Kiah048077; Tue, 5 Nov 2024 03:20:44 GMT (envelope-from git) Date: Tue, 5 Nov 2024 03:20:44 GMT Message-Id: <202411050320.4A53Kiah048077@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 5797a03fe8a7 - main - ping tests: Run tests unprivileged inside a vnet List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5797a03fe8a7c3355a727aaaea803ee1f42d106b Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=5797a03fe8a7c3355a727aaaea803ee1f42d106b commit 5797a03fe8a7c3355a727aaaea803ee1f42d106b Author: Jose Luis Duran AuthorDate: 2024-11-05 03:00:38 +0000 Commit: Jose Luis Duran CommitDate: 2024-11-05 03:07:32 +0000 ping tests: Run tests unprivileged inside a vnet In order to create vnet jails, atf_python needs root privileges. However, once the vnet is created, its privileges inside the vnet can be demoted, as these tests should not require root in order to pass. Reviewed by: markj Approved by: emaste (mentor) Fixes: 4efaf43c6fa7 ("ping: Require root user for pytests") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42175 --- sbin/ping/tests/test_ping.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py index 93b42d7d53bd..3f9a3aecf924 100644 --- a/sbin/ping/tests/test_ping.py +++ b/sbin/ping/tests/test_ping.py @@ -724,6 +724,7 @@ PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 @pytest.mark.parametrize("expected", testdata) @pytest.mark.require_user("root") + @pytest.mark.require_user("unprivileged") def test_ping(self, expected): """Test ping""" ping = subprocess.run( @@ -753,6 +754,7 @@ PING(56=40+8+8 bytes) 2001:db8::1 --> 2001:db8::2 @pytest.mark.parametrize("expected", ping46_testdata) @pytest.mark.require_user("root") + @pytest.mark.require_user("unprivileged") def test_ping_46(self, expected): """Test ping -4/ping -6""" for version in [4, 6]: From nobody Tue Nov 5 04:23:59 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjFb33M0bz5d0gF; Tue, 05 Nov 2024 04:23: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjFb32vQLz4Jcn; Tue, 5 Nov 2024 04:23:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730780639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/pX1melMoE6X5DAdTeehotHF2nrBDd8Opzo1WWov36U=; b=MnzFdW5vMg7qj7j6ZLl0lMhRlzp+PyThI+9M0CkjLoIGXFdLsL64MxtSfUCQDU+76EYywv aeZS4C18s7tO3PDZvfhRJGRkJu1DmcXsSlJ5WV/1nmdO8rGU+2EKFDRenPdjJg7KiJKJzA oeSJyZ4Fxl8VaESAe5cFVU1JTJVJQxEoM2khy/r5SsUrbFdtHnRHNiV0SgIhmM0SQcv11O OAOMrFfcmdStNS4ui7305TfXAMzt2PI/fwhqe/OB80F0G3LBesSFyajuozUWNRx46llpbl zR+OmHiAUgmrIZ6rqjv5hyX4oFDLeZpMGmLpFfXJHM8FETqYRLcIwr317kkxGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730780639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/pX1melMoE6X5DAdTeehotHF2nrBDd8Opzo1WWov36U=; b=Lg4tQaoNfwWCapRSV4+nmavtw4UsHJ/a7SZ6WUYbNas9sBTojmPCVnvOt70KR39yOAFtEb 1w1+XWma5Y9MevTp5V6t16VcZCMeL1+mI8XEUGTrf08ATccks1uGSx6eD9P3xvkeVmxli3 nEOyWRor1AU/nzbEkzxgmintHcO156fxZBc9iINJdKF/aY+RPwFCES/tWArj7McexCQ/0s EILE+WYGyUspetmXwPdnRrVxmSTwDooHwM1/Yl9qP+9nbeHpUzHc5Nfegc+fQnrFrKcein SHjU/gFILUbffH0lRCFXMIGDTweWblorrbCiu7SJ7aOdWYsvoE/AH/ngc3wh3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730780639; a=rsa-sha256; cv=none; b=KcXXBkvzCr1DfcmQGvSMzdW7rhIJYf79GVWrxvFuVCbuwrsLovWI/KeoXuA2CwfQli+pP/ JBYXBXy0eyY6qPej6QNCrBPQRU3Sr5+xJK3wW8FY4W/VlI+1fX9kMPNnYlVURhgzTmGu1w vIch654ZHSdCcIfgZUCwynx1eGMwtDgzr0JHYQQ58Nk46w8xgIHp2ehaIAjw5wDL09YaH9 yZF9VlNRitkrHGCMGwfmpsYn+Wu5JS+3nM6U+Ix9Fu89BnoiFGkSu8GxTFizUbKg9iJ3VP 1VZb3yjVCex8FUJzsz/RBi6c5fm0tyvh+7c88RW5qQzrLLnADNn/mFo9ni+jVw== 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 4XjFb32Qwqz12hP; Tue, 5 Nov 2024 04:23:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A54NxVs066793; Tue, 5 Nov 2024 04:23:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A54Nxuv066790; Tue, 5 Nov 2024 04:23:59 GMT (envelope-from git) Date: Tue, 5 Nov 2024 04:23:59 GMT Message-Id: <202411050423.4A54Nxuv066790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 5af09f50d761 - main - include: Add required guards for dev/vmm headers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 5af09f50d761b6fbe66cc94b1ae854846dbe7e22 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5af09f50d761b6fbe66cc94b1ae854846dbe7e22 commit 5af09f50d761b6fbe66cc94b1ae854846dbe7e22 Author: Mark Johnston AuthorDate: 2024-11-05 03:12:39 +0000 Commit: Mark Johnston CommitDate: 2024-11-05 04:23:49 +0000 include: Add required guards for dev/vmm headers Reported by: Jenkins Fixes: ebd48f1e52d7 ("include: Install dev/vmm headers") --- include/Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/Makefile b/include/Makefile index e0391cac87bb..16d641b42a90 100644 --- a/include/Makefile +++ b/include/Makefile @@ -52,7 +52,7 @@ LSUBDIRS= dev/acpica dev/agp dev/ciss dev/filemon dev/firewire \ dev/hwpmc dev/hyperv \ dev/ic dev/iicbus dev/io dev/mfi dev/mmc \ dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/pwm \ - dev/smbus dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/vmm dev/wg \ + dev/smbus dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/wg \ fs/devfs fs/fdescfs fs/msdosfs fs/nfs fs/nullfs \ fs/procfs fs/smbfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ @@ -310,6 +310,13 @@ INCS+= iconv.h LSUBDIRS+= dev/usb .endif +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" || \ + ${MACHINE_CPUARCH} == "riscv" +.if ${MK_BHYVE} != "no" +LSUBDIRS+= dev/vmm +.endif +.endif + .if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} != "powerpcspe" _dev_powermac_nvram= dev/powermac_nvram .endif From nobody Tue Nov 5 04:24:00 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjFb44xcdz5d0nF; Tue, 05 Nov 2024 04:24: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjFb43XDBz4JXX; Tue, 5 Nov 2024 04:24:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730780640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OMmcPWYGBJnHDj3CpFC17cuiWdEnjn0s08mabeIXSik=; b=BUo4v0ZdWR3R4ypEPXdzv91+oPB5D7KXMxO8qGt8do8yM2trnM7O+pxz1FYkYHow7pBT1n qteGTo6P0x0Ck1nHLx1AUicneCLHnR43UZtYUXRxcr6o6zoaTPiufBA+AgtfRCd0usTO3o qisO6fhYS83q/Hw7YHwbJLE00v8OtA9iqSR28ldZ+212iYCL1eikVRsNkqgNKopE8rrSN9 0rFsk1z4gBy9z4lQCrD9UpQF7EXyLTbVdfi3jhTqbCKQ8d75qyDpDhzqU+lnP3uQFvL6dK VVLOs5Y1bPh8sJs4K8btHR9wSbERaylyePq6qE/5Ymo9V2vkBcxAmwVIFPuHuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730780640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OMmcPWYGBJnHDj3CpFC17cuiWdEnjn0s08mabeIXSik=; b=HKkBD7sJjqdp/AU6sDVOT1CGVXMo/3KlY31hFebfGzOkjOpvKbHSBXOo68FXJc5+NKAgHi ds3pvYL2HHHJpAy1naY03kgs1/Fx9xWG/1Xkpxj/vgoI4XPbX9FLX1VBZtDsyHBjSdohQi ml0kxiyY0w5oyb7SNtxmfLZ1O9dMVicGo66jkEeGYaiATNFguwjvmcg4ZZWQhH5RBzGhUE eUO6pSzp3ghMAC9y1HkE1x49oCzrkGP062WDFUdLHzP3oGqtOXmTJypoxcKc1am6pO1Tcx RynQkd9FQC1b9niVHLDa/7P3HGOJQrcmC+NK28up3eoW4XglkmvXUbkDuZZ2Mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730780640; a=rsa-sha256; cv=none; b=u3v5omXW3LUnYjc/xJQvQjsXWTDzbwSwUOXGug8Q3Cxi2jNfNmBo30DNr8SHr4pHAEavH+ zJidH+VSuT7SIh2ZlMy76SeHQM7H9aacqzbaMse9+/igWSNGNRedv0XF+BRmLzn5Hl6hli TZx8Gy3QCQPRt0Yo77LWq2mLVGZ0/jlOCYorOImA8XH7FsodtQy2APm6z9B5ytg7YW0FIX lACUqvvPEyyj7mGBQBvTWIrEoM8qwPv/YdNfqJS3WCzs/NbaRSqP0+Jqh4mltneWncrHAI HinSICsBWgzTyBey/KtLjWoSECwU9EBrLo7NfX/c1anHhzE8Fy/NKdEPlJP9Ag== 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 4XjFb437Q7z129Q; Tue, 5 Nov 2024 04:24:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A54O0jQ066847; Tue, 5 Nov 2024 04:24:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A54O0Of066844; Tue, 5 Nov 2024 04:24:00 GMT (envelope-from git) Date: Tue, 5 Nov 2024 04:24:00 GMT Message-Id: <202411050424.4A54O0Of066844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 043999b1ae49 - main - riscv/vmm: Fix the build after a97f683fe3c4 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 043999b1ae49635be530badeb6c5d50002e622f4 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=043999b1ae49635be530badeb6c5d50002e622f4 commit 043999b1ae49635be530badeb6c5d50002e622f4 Author: Mark Johnston AuthorDate: 2024-11-05 03:13:47 +0000 Commit: Mark Johnston CommitDate: 2024-11-05 04:23:49 +0000 riscv/vmm: Fix the build after a97f683fe3c4 - Make machine/vmm_dev.h self-contained. - Check for errors from vmmdev_init(). - Make VM_MAX_NAMELEN visible to userspace. Reported by: Jenkins Fixes: a97f683fe3c4 ("vmm: Add a device file interface for creating and destroying VMs") --- sys/riscv/include/vmm.h | 3 +-- sys/riscv/include/vmm_dev.h | 2 ++ sys/riscv/vmm/vmm.c | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/riscv/include/vmm.h b/sys/riscv/include/vmm.h index e148cd95b522..1093e1cd0096 100644 --- a/sys/riscv/include/vmm.h +++ b/sys/riscv/include/vmm.h @@ -102,12 +102,11 @@ enum vm_reg_name { #define VM_INTINFO_HWEXCEPTION (3 << 8) #define VM_INTINFO_SWINTR (4 << 8) +#define VM_MAX_NAMELEN 32 #define VM_MAX_SUFFIXLEN 15 #ifdef _KERNEL -#define VM_MAX_NAMELEN 32 - struct vm; struct vm_exception; struct vm_exit; diff --git a/sys/riscv/include/vmm_dev.h b/sys/riscv/include/vmm_dev.h index a21528a8dc68..856ff0778b95 100644 --- a/sys/riscv/include/vmm_dev.h +++ b/sys/riscv/include/vmm_dev.h @@ -34,6 +34,8 @@ #ifndef _VMM_DEV_H_ #define _VMM_DEV_H_ +#include + struct vm_memmap { vm_paddr_t gpa; int segid; /* memory segment */ diff --git a/sys/riscv/vmm/vmm.c b/sys/riscv/vmm/vmm.c index 52e881dd220c..1c0290ace570 100644 --- a/sys/riscv/vmm/vmm.c +++ b/sys/riscv/vmm/vmm.c @@ -255,7 +255,9 @@ vmm_handler(module_t mod, int what, void *arg) switch (what) { case MOD_LOAD: /* TODO: check if has_hyp here? */ - vmmdev_init(); + error = vmmdev_init(); + if (error != 0) + break; error = vmm_init(); if (error == 0) vmm_initialized = true; From nobody Tue Nov 5 04:24:01 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjFb56Yklz5d02n; Tue, 05 Nov 2024 04:24: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjFb54tP2z4Jsv; Tue, 5 Nov 2024 04:24:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730780641; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DIilAXrN5q4yiPPHIPk2qnRa4dsI3yz/TCUDq/P2UbY=; b=h8Vo1exzjB2Tmien8Mw4AoSx2Ees2mhQcJMJwIE7oe7oHoc99Qx10xJiN735dxe8GKF7IN w6twk4jNsEF/H+CkUp3hx7uLG5dPlnbwXP0bBuMpIcb89k+6HmUJN6/nhXOh7uk2foX6RE b1eILUNYd3728xQoV/+iLgidr0pJf1luOx3Q3eooCu3OgQhOVA9qeia5uHzWLleVlIrU1d MWRuqxuk9nRfstdU1QxkPcwxQ98CgOFbbQS6dJcJeTdhZCxnkohy2GnXkIKXqiKNi+S627 KauHV4P/ursTTu100g4LmsU6vKzoKJVhtG0MZEyMk0WYEF3FiwATWGCtA5ECGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730780641; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DIilAXrN5q4yiPPHIPk2qnRa4dsI3yz/TCUDq/P2UbY=; b=QC1aqeJDDim4wYIZW9F+yul3YuC9ZhHXK27UFepRQJbIXwtS5DarOsmLzMkQqLWOqN3wMF xOfB39Xw4qiUVa40l6eVLcrcnImi76KnJRBhpPzdv0iFfukt4XU+jY1NLKcFg+ODu02t2i SH5bCinLWTQanMQ4uf+RyBHkKKniSRH3OvyyabMyTsQv01uI/b7HzzMX+k95MsgFydSre8 wTjG2rZcJAByriAPazTH0eMwCWUG7JVasUK3dCGXsZUiqDJh7X8ZwoeazFNmut4QAbGDD1 R/JolkqqQeflFDOMgRYLvWxBA/1UM9JyTnieig8ipTjOCkML8qPR9dyuSiZ2TQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730780641; a=rsa-sha256; cv=none; b=DoXP/v7nvbv2ev2io+1xqKukrWK5AAzOrfkcmuphwLPIJyuTQ+4+kV2q7wcaSWg6pccPfw 37PSeCKZ3qaSPCSCuqeOX7v9VyIosrK3y/lQeOAE0VxjsjPcVSYcgwCL3Eu8vjioDkNjwk XPRUaRxxnYi3Hti7eP7UGD+/2LekdPcoh0T5yX/GR/9Mob5Yfnbpnvc0UgKQoBSR9Crxhq OJ748IYBuRnVDgofKQxuMsjxLftmFSviQ0xFmxfapP4hoLOxZ/YvqXMT9FuGSrrMVHDFmD 8zL0VrkItKrZzNxs0mwfpA00gVO3iVOUw/1zjEua0ZwpWmM17JZxV5kFVUdcwA== 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 4XjFb54QqNz12sv; Tue, 5 Nov 2024 04:24:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A54O1uh066899; Tue, 5 Nov 2024 04:24:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A54O1uV066896; Tue, 5 Nov 2024 04:24:01 GMT (envelope-from git) Date: Tue, 5 Nov 2024 04:24:01 GMT Message-Id: <202411050424.4A54O1uV066896@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 55c854cf0c6a - main - refcount: Avoid redefining KASSERT for userspace List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 55c854cf0c6aacb60ed88c02522377b1b3fa134d Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=55c854cf0c6aacb60ed88c02522377b1b3fa134d commit 55c854cf0c6aacb60ed88c02522377b1b3fa134d Author: Mark Johnston AuthorDate: 2024-11-05 03:40:02 +0000 Commit: Mark Johnston CommitDate: 2024-11-05 04:23:49 +0000 refcount: Avoid redefining KASSERT for userspace Just bring in systm.h unconditionally. Otherwise this definition of KASSERT conflicts with the one from kassert.h, specifically when including other headers which unconditionally include systm.h or kassert.h. A number of other kernel headers depend on this pollution, but ideally we'd only need kassert.h here. Reported by: Jenkins MFC after: 1 week --- sys/sys/refcount.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/sys/refcount.h b/sys/sys/refcount.h index 212e8e516271..44588fe3c812 100644 --- a/sys/sys/refcount.h +++ b/sys/sys/refcount.h @@ -30,11 +30,9 @@ #include -#if defined(_KERNEL) || defined(_STANDALONE) #include -#else +#if !defined(_KERNEL) && !defined(_STANDALONE) #include -#define KASSERT(exp, msg) /* */ #endif #define REFCOUNT_SATURATED(val) (((val) & (1U << 31)) != 0) From nobody Tue Nov 5 10:06:11 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjP9v53NNz5btRP; Tue, 05 Nov 2024 10:06: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjP9v4XWfz4hW0; Tue, 5 Nov 2024 10:06:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730801171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UmunW0u6JTtDDZOw9s1n8ICjuXhF5KupuSvD4OKqU9c=; b=Orqv2URx7YD2h/eUQcQUQJ9JRV9WvxH/DwuO4DBbCBD6dT1VpOI/tV3rGpjs28QOn0Ofa7 Zbjuq5WJeVnNjTyNrijhDjlrmrPdBvQxruve41cmV94/LtxQIzkUOVBa+xpSmreSxyCj7H bfNxZ7mHxwC3D9WYt7FGtnA6QlriRYyH/CW3wDeaHUZ23rEc3r1zc2cF+htB6xG/1QI1EK 9Loo/2DsOXuOfbmn9VpUJtptwk0QRbzncXjXuyK80NQXqTqVEWzyQ04FkqnK0MvZ4CH8mI uSY0+KWXDac+KKTyBWafLRTp2+TMBY/HyiZoWjwWgjlGnYDyzrx1fMbHQs2paA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730801171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UmunW0u6JTtDDZOw9s1n8ICjuXhF5KupuSvD4OKqU9c=; b=PGlGasLtJJCPd79i3M5qdGX8qM5t2K0k7puZVqROMTxQD5VZyWc3CQARIXRXhtqTT85DZ3 Nh+0oO/OcO13z6YM9Cr0Egt57iTF8VqeOfSdrcDV2rDll38mq27ROFx84JYGbLh5vwJPCu 0Z+j+qFSODEytkNvoqCD29ZeVYwKRMXqy2JwnvNebZf7UAu6kiZ9t+MwxNAGctXJ3WxCEZ 3P7UCXJm5Pq0r0GyTDEi9fobRBhAP6i61qihXby9mBq/7FJ+p39711NENW2EOopC4EyyvU t+EQMl7iMtzxcMOi4DSTGtHeGEGUcxljQ+HHWsBRJpuX6HanDmrl3zI+Mz9Bag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730801171; a=rsa-sha256; cv=none; b=kNfCz+iRnXPzwOpFJioqIll6leqphN67KmUK1QO0i/3HwEzHVgM4bb8zTN7cItoV7nvyGV sL5YXOJ5aXe+55Il6coUDUx3/wxGGFZsvFdSHZLR8YFoE1DBhy2dGosMoNaPXA7GuCh94X W2/bdQ6SiBnP/JvqC0/CMf/2Q762cRqwvTElL+6NSdEq3dxmhXcYcwimgEzfvGYdr0Tt8O LaNHAZsyO0bYbSET3P3UEh/9iZkTT2K3SRMLDMaPR1esjXLsLb5/WGSAmfBs0XLKDFrWVU Nir0vyBoZNB82ruC8cogLBdEVwUKzzJ0IxaVr4vwPiT4nBy6N7zpT6kftrfW8w== 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 4XjP9v41KKz1CCt; Tue, 5 Nov 2024 10:06:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A5A6Bj4099166; Tue, 5 Nov 2024 10:06:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A5A6Bta099163; Tue, 5 Nov 2024 10:06:11 GMT (envelope-from git) Date: Tue, 5 Nov 2024 10:06:11 GMT Message-Id: <202411051006.4A5A6Bta099163@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 625835c8b5e8 - main - tcp: fix the initial CWND when a SYN retransmission happened List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 625835c8b5e897e54a1a023788a3a9c3b16631c9 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=625835c8b5e897e54a1a023788a3a9c3b16631c9 commit 625835c8b5e897e54a1a023788a3a9c3b16631c9 Author: Michael Tuexen AuthorDate: 2024-11-05 08:52:42 +0000 Commit: Michael Tuexen CommitDate: 2024-11-05 08:52:42 +0000 tcp: fix the initial CWND when a SYN retransmission happened According to RFC 3390 the CWND should be set to one MSS if the SYN or SYN-ACK has been retransmitted. This is handled in the code by setting CWND to 1 and cc_conn_init() translates this to MSS. Unfortunately, cc_cong_signal() was overwriting the special value of 1 in case of a lost SYN, and therefore the initial CWND was not as it was supposed to be. Fix this by not overwriting the special value of 1. Reviewed by: cc, rscheff MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D47439 --- sys/netinet/tcp_timer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index c5c65dda5b1a..4d8dafaec31d 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -810,7 +810,9 @@ tcp_timer_rexmt(struct tcpcb *tp) */ tp->t_rtttime = 0; - cc_cong_signal(tp, NULL, CC_RTO); + /* Do not overwrite the snd_cwnd on SYN retransmissions. */ + if (tp->t_state != TCPS_SYN_SENT) + cc_cong_signal(tp, NULL, CC_RTO); NET_EPOCH_ENTER(et); rv = tcp_output_locked(tp); NET_EPOCH_EXIT(et); From nobody Tue Nov 5 18:24:42 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjcF62Dhlz5cQDY; Tue, 05 Nov 2024 18:24:42 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjcF61lLWz4HPk; Tue, 5 Nov 2024 18:24:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730831082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YJ0HxJLxcx5OZL/n1//1N09hq8qHa92d5oloxmr6utw=; b=r0isAkCUMfbwXK0Tcgd8J1X4m09BFQGeaHAdlQxl/a/4E3QufJbDNirrPvEYy9R/DR4gos MJhoIeAzB97U6NXnatyQKefKqO4xjJ/7qdqdsJgVBJry154rml4LHeXuJO7ZRVD+vjjVws CWCzAgKzL/TrvFr4aFGH+w0LgQSAWruIinxOgsV9E71K5eGiEgx+XD9nTqnjIbIyzIlBdO dJfXXvYfcFFEnD9Ig9DobI5SyF8+K/c+0PRtTDgokBviZ4R1ZB+tCNyWoC5hFrHdEQv1Pg orswIVx0DRj32uQvsTZFZAG3GjWlTdcGvTZSYpONB3JlakYpD3oZhi4NIQkKIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730831082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YJ0HxJLxcx5OZL/n1//1N09hq8qHa92d5oloxmr6utw=; b=ws57MTPWHUl7C4pNbwFoaOf67ZGhr8EfqNNCh/7mJnfQd2+66pFGSEyxYuh5v3kGsEjs9+ KU8aDIPV1VqwTcdwz6PmFP2iG35YNbSDdf94hvoyzlg7eApGmR3TeGDOU241aCbPCbt0i9 D/LSHLqcCe9etoMu6aUIOR2Jz2UuA1M+J7b0Gn9auipHpSHvjmYOwKR5UKZ/z50+rtQydI ypbKpMwI3m+0BvPjuKTFO2ckpynDMOjiQTY73Vbrc3LNZoXiV+p9CGDkkpN62szd14lbZ0 Wi6spAzE0ztut2BHpA7X4iXB/+a0gG9eU/ZEnZxVqhZ2puHNlUjStoQgcplPDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730831082; a=rsa-sha256; cv=none; b=jIn9jF5RWIimagKYK8fUgkTSWSEmP0D5+oEuisRLVpfj2pIAm1ZUPxDQ5xbBjsTwQ+iJ/h jQtIKx7HETXpvqhS4vXk6jVfrqjfhvBcwNiOctedbw9dJMLQDnSTWJmQ7mG+kts4+wr691 eJ7My6UniKFETYfnGB7yVhUn9Bxo50UgZ56EULXHgkONXwkadZ/3BQJj3GlqKALecvjwT8 Mi3tki5g4I5w1Skb1+0IYSH6WFnCQMsP6jC5iyOuFGzjgkpr/eP4hZ/FejanFEqhZSp94C jpLKJv7QQC15JFFKdKqMx9NwxHiqNg8S2JzMn3qxN9853kzmo/sknZrpK+qjWA== 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 4XjcF61LYVzSsG; Tue, 5 Nov 2024 18:24:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A5IOgfg024411; Tue, 5 Nov 2024 18:24:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A5IOgbB024408; Tue, 5 Nov 2024 18:24:42 GMT (envelope-from git) Date: Tue, 5 Nov 2024 18:24:42 GMT Message-Id: <202411051824.4A5IOgbB024408@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d14c38ceb8aa - main - sys: Avoid relying on pollution from refcount.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: d14c38ceb8aa10bd94913d0456ec0f726693379b Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d14c38ceb8aa10bd94913d0456ec0f726693379b commit d14c38ceb8aa10bd94913d0456ec0f726693379b Author: Mark Johnston AuthorDate: 2024-11-05 14:31:50 +0000 Commit: Mark Johnston CommitDate: 2024-11-05 18:22:20 +0000 sys: Avoid relying on pollution from refcount.h Fix up headers which previously assumed that refcount.h includes systm.h, and make them more self-contained. Then, replace the systm.h include in refcount with kassert.h. Reviewed by: imp, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47450 --- sys/powerpc/include/counter.h | 2 ++ sys/sys/_lock.h | 4 ++-- sys/sys/_mutex.h | 6 ++++-- sys/sys/_rmlock.h | 10 ++++++++-- sys/sys/_rwlock.h | 6 ++++-- sys/sys/_sx.h | 5 ++++- sys/sys/file.h | 7 +++++-- sys/sys/ktls.h | 3 +++ sys/sys/refcount.h | 7 ++++--- sys/sys/sglist.h | 1 + tools/build/test-includes/badfiles.inc | 1 - 11 files changed, 37 insertions(+), 15 deletions(-) diff --git a/sys/powerpc/include/counter.h b/sys/powerpc/include/counter.h index 68e292cde7f6..90e6400ad562 100644 --- a/sys/powerpc/include/counter.h +++ b/sys/powerpc/include/counter.h @@ -100,6 +100,8 @@ counter_u64_add(counter_u64_t c, int64_t inc) #else /* !64bit */ +#include + #define counter_enter() critical_enter() #define counter_exit() critical_exit() diff --git a/sys/sys/_lock.h b/sys/sys/_lock.h index ef167b9ab5ec..7057463fbde2 100644 --- a/sys/sys/_lock.h +++ b/sys/sys/_lock.h @@ -33,8 +33,8 @@ struct lock_object { const char *lo_name; /* Individual lock name. */ - u_int lo_flags; - u_int lo_data; /* General class specific data. */ + unsigned int lo_flags; + unsigned int lo_data; /* General class specific data. */ struct witness *lo_witness; /* Data for witness. */ }; diff --git a/sys/sys/_mutex.h b/sys/sys/_mutex.h index 0fcd5a2c2809..7241f9f1d31c 100644 --- a/sys/sys/_mutex.h +++ b/sys/sys/_mutex.h @@ -31,6 +31,8 @@ #ifndef _SYS__MUTEX_H_ #define _SYS__MUTEX_H_ +#include +#include #include /* @@ -44,7 +46,7 @@ */ struct mtx { struct lock_object lock_object; /* Common lock properties. */ - volatile uintptr_t mtx_lock; /* Owner and flags. */ + volatile __uintptr_t mtx_lock; /* Owner and flags. */ }; /* @@ -58,7 +60,7 @@ struct mtx { */ struct mtx_padalign { struct lock_object lock_object; /* Common lock properties. */ - volatile uintptr_t mtx_lock; /* Owner and flags. */ + volatile __uintptr_t mtx_lock; /* Owner and flags. */ } __aligned(CACHE_LINE_SIZE); #endif /* !_SYS__MUTEX_H_ */ diff --git a/sys/sys/_rmlock.h b/sys/sys/_rmlock.h index 38375b623a65..9c8893efe19c 100644 --- a/sys/sys/_rmlock.h +++ b/sys/sys/_rmlock.h @@ -32,6 +32,14 @@ #ifndef _SYS__RMLOCK_H_ #define _SYS__RMLOCK_H_ +#include +#include +#include +#include +#include + +struct thread; + /* * Mostly reader/occasional writer lock. */ @@ -66,8 +74,6 @@ struct rm_priotracker { LIST_ENTRY(rm_priotracker) rmp_qentry; }; -#include - struct rmslock_pcpu; struct rmslock { diff --git a/sys/sys/_rwlock.h b/sys/sys/_rwlock.h index d360cfe2a4e9..8c15771cb172 100644 --- a/sys/sys/_rwlock.h +++ b/sys/sys/_rwlock.h @@ -28,6 +28,8 @@ #ifndef _SYS__RWLOCK_H_ #define _SYS__RWLOCK_H_ +#include +#include #include /* @@ -41,7 +43,7 @@ */ struct rwlock { struct lock_object lock_object; - volatile uintptr_t rw_lock; + volatile __uintptr_t rw_lock; }; /* @@ -55,7 +57,7 @@ struct rwlock { */ struct rwlock_padalign { struct lock_object lock_object; - volatile uintptr_t rw_lock; + volatile __uintptr_t rw_lock; } __aligned(CACHE_LINE_SIZE); #endif /* !_SYS__RWLOCK_H_ */ diff --git a/sys/sys/_sx.h b/sys/sys/_sx.h index f70462c9a008..c6fd485620c6 100644 --- a/sys/sys/_sx.h +++ b/sys/sys/_sx.h @@ -31,12 +31,15 @@ #ifndef _SYS__SX_H_ #define _SYS__SX_H_ +#include +#include + /* * Shared/exclusive lock main structure definition. */ struct sx { struct lock_object lock_object; - volatile uintptr_t sx_lock; + volatile __uintptr_t sx_lock; }; #endif /* !_SYS__SX_H_ */ diff --git a/sys/sys/file.h b/sys/sys/file.h index 820ad1015573..a2dc02e523d8 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -37,13 +37,16 @@ #include #include #else -#include -#include +#include #include #include +#include +#include +#include #include struct filedesc; +struct proc; struct stat; struct thread; struct uio; diff --git a/sys/sys/ktls.h b/sys/sys/ktls.h index 9b3433f4b1fd..0e52d643fe3b 100644 --- a/sys/sys/ktls.h +++ b/sys/sys/ktls.h @@ -28,8 +28,11 @@ #define _SYS_KTLS_H_ #ifdef _KERNEL +#include #include #include + +#include #endif struct tls_record_layer { diff --git a/sys/sys/refcount.h b/sys/sys/refcount.h index 44588fe3c812..ae0ec44fd7a6 100644 --- a/sys/sys/refcount.h +++ b/sys/sys/refcount.h @@ -28,13 +28,14 @@ #ifndef __SYS_REFCOUNT_H__ #define __SYS_REFCOUNT_H__ -#include - -#include +#include +#include #if !defined(_KERNEL) && !defined(_STANDALONE) #include #endif +#include + #define REFCOUNT_SATURATED(val) (((val) & (1U << 31)) != 0) #define REFCOUNT_SATURATION_VALUE (3U << 30) diff --git a/sys/sys/sglist.h b/sys/sys/sglist.h index 96f3c1cd5ffb..3bbada573772 100644 --- a/sys/sys/sglist.h +++ b/sys/sys/sglist.h @@ -55,6 +55,7 @@ struct sglist { struct bio; struct mbuf; +struct thread; struct uio; static __inline void diff --git a/tools/build/test-includes/badfiles.inc b/tools/build/test-includes/badfiles.inc index eb0cd05cb39f..1d648819cd8c 100644 --- a/tools/build/test-includes/badfiles.inc +++ b/tools/build/test-includes/badfiles.inc @@ -100,7 +100,6 @@ BADHDRS= \ sys/prng.h \ sys/qmath.h \ sys/racct.h \ - sys/refcount.h \ sys/resourcevar.h \ sys/rman.h \ sys/rmlock.h \ From nobody Tue Nov 5 18:24:43 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjcF73wg7z5cQGk; Tue, 05 Nov 2024 18:24: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjcF72FCJz4HK3; Tue, 5 Nov 2024 18:24:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730831083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z5PlcrGb6KybPdTaOwSyqBbX0fUKkWbUt/VhYNdaBOo=; b=CxZoBIGTYXB5OvwoQA6d7wee9psL/9sAwIABqllnIRRhkE+nE9ApLDFmphNlZYY6L4qP0W Msn3tK28qGV2UILI5WhOyf/tMGe31tMZfIWcXRB8BwwC2InO8Qg6tKb4ahSSrIAkLqMSSX fvPs7a9bvY4T6i3lJ2jb9U0sXhASH9cQ9YV5L1Y1+UlBv/btgL/jvbkWvYjQ6l9F5IQk7o NyFE6x5ePKm12LnyDJ7PuwJJ+JiWQx+t7uHBtYMUP1r7Ao9uJp5RqTx9y1I3oYhjXurRtv 7Oa/4yh4Yg4HBLcxw110RegsyDcbkra77l9uwlMLOFooPbGR1Vzbo1ckjpi42Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730831083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z5PlcrGb6KybPdTaOwSyqBbX0fUKkWbUt/VhYNdaBOo=; b=SWzuxO4LwpT4mtk1KpJOu321pcLsOUkms3Tl5ZWN4Mj8ntw/xE0lFhWGVcRnabhKV6sL16 x6B7IUk96EgHbcK1lMBaErzpyJQGn+41Sy1GkERAmlt51qXyNhfHmSAcXsq3IlvYiDn4hq yfDilV1nVwilmtQOmiLWjX5VUgsu4JS00zpcjO2Utfp0X/Q2jRtHiL/Sh41I5bT/GfUzbg QM2WH56q+s33+NZJvTaMCPXx9zWfCEPoye7bAeCIFMcCsLievgmV8g6Q36faCFRT0lJypd +WwsYVg/4i4aUnbgMDQKqzP/8qYjs4nVzfOSP+jMiPInaB/avSZM5B22YyxPgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730831083; a=rsa-sha256; cv=none; b=qpNHzeeSIhr440nz28w+cKkEv5B82rNr+K0stLoeMLNXKyzoHzRYjf4cigwaBO4nfTQX7T UgLxGCMN6zD4r+sEPOU5oKac7I7z164ptNC0EybPAesSHsCMU1TOIqeqgQO7PX7Hkb+QsE vOMNJOJ0ELe2knBXG3P2zAIHW22dqRjA3cwHdEzSTeIIZDbyidSpAEdHZopgIwGlf0sDLM oI//t/5Sw03VgnkhD/J5bBk44wyh5ERf2TslwZ92DIn51x6ds9PVE+/lZwbytnmJQo84Xi rEKkIy2UMCmE7eYP4ZSP8uNopNptjjjzCautr8DHQn9qgmvo0b3ufbY7SeOZuw== 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 4XjcF71rWvzSf3; Tue, 5 Nov 2024 18:24:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A5IOhtb024471; Tue, 5 Nov 2024 18:24:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A5IOhoq024468; Tue, 5 Nov 2024 18:24:43 GMT (envelope-from git) Date: Tue, 5 Nov 2024 18:24:43 GMT Message-Id: <202411051824.4A5IOhoq024468@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 88dd0550920c - main - syslogd: Fix handling of unix socket modes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 88dd0550920c3dd378b2b761bda52339b5d860ec Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=88dd0550920c3dd378b2b761bda52339b5d860ec commit 88dd0550920c3dd378b2b761bda52339b5d860ec Author: Mark Johnston AuthorDate: 2024-11-05 17:48:37 +0000 Commit: Mark Johnston CommitDate: 2024-11-05 18:24:03 +0000 syslogd: Fix handling of unix socket modes When bind() is called, the process umask is applied, so one has to either clear the umask before binding or call chmod() to add permissions after the fact. Do the former here to ensure that the socket always has the correct mode. Reported by: Lexi Winter Fixes: 2b8c3a05e0a6 ("syslogd: Set unix socket modes atomically") --- usr.sbin/syslogd/syslogd.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 98ddb5d9158f..8fcf3f06cf95 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -3721,12 +3721,24 @@ socksetup(struct addrinfo *ai, const char *name, mode_t mode) if (ai->ai_family == AF_LOCAL) unlink(name); if (ai->ai_family == AF_LOCAL || NoBind == 0 || name != NULL) { + mode_t mask; + int error; + if (ai->ai_family == AF_LOCAL && fchmod(s, mode) < 0) { dprintf("fchmod %s: %s\n", name, strerror(errno)); close(s); return (NULL); } - if (bind(s, ai->ai_addr, ai->ai_addrlen) < 0) { + + /* + * For AF_LOCAL sockets, the process umask is applied to the + * mode set above, so temporarily clear it to ensure that the + * socket always has the correct permissions. + */ + mask = umask(0); + error = bind(s, ai->ai_addr, ai->ai_addrlen); + (void)umask(mask); + if (error < 0) { logerror("bind"); close(s); return (NULL); From nobody Tue Nov 5 21:39:46 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjhZB5WXNz5bdTP; Tue, 05 Nov 2024 21:39: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjhZB4zqxz4dbW; Tue, 5 Nov 2024 21:39:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730842786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uRXxdeo02SRl5Wl4uDB9jIlnZSNgXe7LBNNWaqfv/dw=; b=o1fMy7ttD7TYt18CTEMRMzlYezHaa0CZXj5PjxDc9WcMa95SWB5mqi/OyTEWjweFQXGBY2 7Fz7O5usTL3eimK/95JWKtZxAuIIVPTKcXfiLdq5wmjmIud68joUt13lYp8GkpyDp9Mc7x q/9gv/c3GoDabsm2arH5ocMQiGKPAPeBF5oOC38s/Zu41GVabND1PNiRH8M6RR2Bu35evx FcibRsXjrfXNQZS3+K19h0XBvSY1q8M+8hPFlMC0a0UwPeJ4SncJ8Vo/doBY53WIZVOmWj wh2ZGLaOo9J0zhaSYnt2NsOK7U9KAcbEQy2SELT5IvgZZsiL3pekbxYB0xETgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730842786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uRXxdeo02SRl5Wl4uDB9jIlnZSNgXe7LBNNWaqfv/dw=; b=xDjTe1ld5Zi74KLCdUcqq9doma2sWFxYcMtQt+gDM1iFkAzMuCAETeOMLhHw9Ec2hhXq8F 0k9hvVXJni7xeZTzJ61Ls437SKGKoFayXOCkgiXrz/lV5ngf5NEIkBpPra7vD7SMPw73Qy BFYkxzdBeEWbJNmVUojbKY+JqRHDox5YTYIGhaR+UjcwxuAA+e30OHlI5WE2/enXqypkcG X0JaZH86jXZDm4itOmUnVvxHejP3QEEXpII3WTQ7Ig+SJKuGdngK6xljHQFNACq6amRNFX gsaf99ezdPx1YJqG6niAsqNlZHKL2BaJ1XQ/D6I9u5dW8hB3t6Ak87vXGlMEig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730842786; a=rsa-sha256; cv=none; b=Tw8h1LpFhcmh/D/aChVXKEq/e7fpeI3iM7xRRHecrfp0XQyjx9Uck3JlyVcbs/pK9pkIQL 9OLjlkNDHXDhrxl63SG2IjD6DO+B5cAuMezyPZ/QwXe8orfu5viebi4HTQctI56wJzaRHj Lq+JdgVUw7V2sSioAUAuWCMpmCUAU4gF9LzfUEwr52Rr9DNSkNh2tKxb26ttyW8HquEfFs oepdlpKNR7bsmtsuI/Agr+wl0+GrPj/IkMB3/9JRob6+9xE2t4CPHqhfA/jQPdYm94b4CA hdtac1OpgukmVNAPfZKc5XaZiT3GEsi2ZKLoug2Yl+9/siXQwOLL52EqH/bnpw== 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 4XjhZB4Zk6zZbR; Tue, 5 Nov 2024 21:39:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A5Ldkdc078624; Tue, 5 Nov 2024 21:39:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A5Ldkj3078621; Tue, 5 Nov 2024 21:39:46 GMT (envelope-from git) Date: Tue, 5 Nov 2024 21:39:46 GMT Message-Id: <202411052139.4A5Ldkj3078621@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: cdfd0600dc88 - main - release: Include -dbg files in dvd image List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cdfd0600dc8882f0a0d0e6d9a1cdcf926edba6d6 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=cdfd0600dc8882f0a0d0e6d9a1cdcf926edba6d6 commit cdfd0600dc8882f0a0d0e6d9a1cdcf926edba6d6 Author: Colin Percival AuthorDate: 2024-11-05 21:35:17 +0000 Commit: Colin Percival CommitDate: 2024-11-05 21:39:38 +0000 release: Include -dbg files in dvd image In 2016, commit 8834318685bc reworked the code for excluding -dbg files from install media, and in the process accidentally broke it for dvd images ('grep -v' should have been 'grep -vE'). FreeBSD Update builds later began to depend on this, and in any case since DVD images are intended as "include everything" images there's no point excluding those; so remove the (broken) filtering from DVD image builds. Sponsored by: Amazon MFC after: 2 days --- release/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/Makefile b/release/Makefile index 6f59647ff5db..9f19b150ae65 100644 --- a/release/Makefile +++ b/release/Makefile @@ -241,12 +241,12 @@ dvd: packagesystem -DDB_FROM_SRC ) # Copy distfiles mkdir -p ${.TARGET}/usr/freebsd-dist - for dist in MANIFEST $$(ls *.txz | grep -v -- '(${base ${_ALL_libcompats}:L:ts|})-dbg'); \ + for dist in MANIFEST $$(ls *.txz); \ do cp $${dist} ${.TARGET}/usr/freebsd-dist; \ done .if defined(NO_ROOT) echo "./usr/freebsd-dist type=dir uname=root gname=wheel mode=0755" >> ${.TARGET}/METALOG - for dist in MANIFEST $$(ls *.txz | grep -vE -- '(${base ${_ALL_libcompats}:L:ts|})-dbg'); \ + for dist in MANIFEST $$(ls *.txz); \ do echo "./usr/freebsd-dist/$${dist} type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG; \ done .endif From nobody Wed Nov 6 00:10:17 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjlwH69QTz5bpL8; Wed, 06 Nov 2024 00:10:39 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjlwH4243z4pf7; Wed, 6 Nov 2024 00:10:39 +0000 (UTC) (envelope-from tijl@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730851839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5B1LnKwCWhi74BexD0Gvf0EhXSVltz83aR4hzlyaVHs=; b=I1OmksH203pQCwNF65ftkZcEidglW29ciE3USvL/cPY4PgUVcp+w/Bz8Lgf/DpFwSKwVfu yPKYf1u1BpwolONxsXXz7odsW9/j42TG43cQTPtjXbZhSRmtv9tKa5ASvTPRuNifll3ecb W+IYOtiVYxpr177jpJ7At4BJGaIU4BLCJYQuwgAmYASEtAvji4rB2nNajAFC7xmoITtY4X GLcpCbpsKZ964pSuEEb2QKKrWDwRhGVxgp/wmzRhOcDGOXFCIQqycs34J+e+wAw/ZJ4zhE vs1FBPupoDtfEdmoABFnonB8ipR23P/iW+004a4+6OnT+um7SKnRp9Nz1Vh2mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730851839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5B1LnKwCWhi74BexD0Gvf0EhXSVltz83aR4hzlyaVHs=; b=D5VptaZQRKbtm69kxwltug7Uthox9xvDC54DRV2kjoZMsQ3TrtcsyXWCNDV0GYHcAmN9hA SjIS4kZa3M8pjJnPNSy3pZSU3SufmvCoAUsD/85t8tNUdrdL6q7vcW6y4qcjX9esz9C0oG 0Y3S579MM2EKK5uwAXyyEY4cxqFbEVdZDdJ0gJCnERJKeiadRQPXvnCoQllrh99pe46Atl qzReJMPb3BtDRkWX3TRzEWqce9mlDKlo6ug6YVo3xnXVyTKboZaUrtO/rZ4GwjyKXFjxI7 5D6Ud9iRtjIQdftKBx+AlwcM6qlU/sWy81OwRvnvF4z9Qsz8lF+tlbJe94NPdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730851839; a=rsa-sha256; cv=none; b=W9ZnfRuP8Xa36nFv/iRAPP2JAqsB8z43UTZkhvttnBGZMyveU1d20yXGooCTYcf1pA8D6N SWuklz5aarrgokC7h5Y0+3u0OdeGfMUWqHapg4kUGz7KuUOc7o7ZU+DHOKIxERRkqimcMp iO5OR/l3mlYMvPIqBse2w4/0OLEff+Fe0iDsNtTk3QMIWXyH1NvgSH2I9gopiiS0S6WKSY trvAAM+1nHdOxgnfiF/3Q2GZkVfTt+ftUko3LjRaHL2LdczMdXv6QLZtiSrXVXc2eXTHrG t9wO+fogb4TLAbgtRd9lf1jnKjpQqUDN8ArTdvDJeADScbqEYSBgUC56jVsbrw== Received: from hal.tijl.coosemans.org (unknown [IPv6:2a02:a03f:994d:4700:4176:b282:c7bb:9a7c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: tijl) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XjlwG6BjXzLhs; Wed, 6 Nov 2024 00:10:38 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Date: Wed, 6 Nov 2024 01:10:17 +0100 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Mateusz Piotrowski <0mp@FreeBSD.org> Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: d2e7bb630b83 - main - rc.d/sendmail: Return non-zero if the daemon fails to start or is not running Message-ID: <20241106011017.68146ea9@hal.tijl.coosemans.org> In-Reply-To: <202410211921.49LJLj5t024751@gitrepo.freebsd.org> References: <202410211921.49LJLj5t024751@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 21 Oct 2024 19:21:45 GMT Mateusz Piotrowski wrote: > The branch main has been updated by 0mp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=d2e7bb630b83848a774d8213014a9e0747775019 > > commit d2e7bb630b83848a774d8213014a9e0747775019 > Author: Mateusz Piotrowski <0mp@FreeBSD.org> > AuthorDate: 2024-10-21 10:10:52 +0000 > Commit: Mateusz Piotrowski <0mp@FreeBSD.org> > CommitDate: 2024-10-21 19:20:36 +0000 > > rc.d/sendmail: Return non-zero if the daemon fails to start or is not running > > If you have a mail server that is running sendmail daemon > (sendmail_enable=YES) and sendmail queue runner (sendmail_msp_queue=YES) > and the sendmail daemon dies, /etc/rc.d/sendmail status does see the > daemon is not running but returns 0 as the exit code. This prevents > other programs (like puppet) from restarting sendmail to fix the issue. > > Make sure that the exit code is propagated towards the end of the script > if any of the sendmail services fail. > > This patch does not call exit directly but instead just sets the exit > status code by calling exit in a subshell. This way we do not exit the > current shell in case the service script is sourced (e.g., when > rc_fast_and_loose is active). > > PR: 223132 > MFC after: 2 weeks > Reported by: pirzyk > Discussed with: jilles, eugen > Reviewed by: christos, gshapiro (previous version), markj > Approved by: christos (mentor), markj (mentor) > Differential Revision: https://reviews.freebsd.org/D46862 > Co-authored-by: Jim Pirzyk > --- > libexec/rc/rc.d/sendmail | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/libexec/rc/rc.d/sendmail b/libexec/rc/rc.d/sendmail > index af84c6d6b548..5a780e5b15a1 100755 > --- a/libexec/rc/rc.d/sendmail > +++ b/libexec/rc/rc.d/sendmail > @@ -206,6 +206,7 @@ sendmail_precmd() > } > > run_rc_command "$1" > +_ret=$? > > required_files= > > @@ -214,6 +215,7 @@ if checkyesno sendmail_submit_enable; then > rcvar="sendmail_submit_enable" > _rc_restart_done=false > run_rc_command "$1" > + _ret=$(( _ret > $? ? _ret : $? )) > fi > > if checkyesno sendmail_outbound_enable; then > @@ -221,6 +223,7 @@ if checkyesno sendmail_outbound_enable; then > rcvar="sendmail_outbound_enable" > _rc_restart_done=false > run_rc_command "$1" > + _ret=$(( _ret > $? ? _ret : $? )) > fi > > name="sendmail_msp_queue" > @@ -229,3 +232,6 @@ pidfile="${sendmail_msp_queue_pidfile:-/var/spool/clientmqueue/sm-client.pid}" > required_files="/etc/mail/submit.cf" > _rc_restart_done=false > run_rc_command "$1" > +_ret=$(( _ret > $? ? _ret : $? )) > + > +(exit "$_ret") Running "make stop" in /etc/mail now produces an error with the following config in /etc/rc.conf: sendmail_enable="NO" sendmail_msp_queue_enable="YES" sendmail_outbound_enable="YES" sendmail_submit_enable="YES" From nobody Wed Nov 6 00:23:47 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjmCR6GjNz5bqLs; Wed, 06 Nov 2024 00:23:47 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjmCR5jX3z4r74; Wed, 6 Nov 2024 00:23:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730852627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=87LLwNuDCOXWl02YmQKNfv0UcqFhC0Em5oxad5CKGGQ=; b=abNLKAJXxtT9FFuEo9fjQ7MgL84k3mia2iRlZteTMTyEnCVPjzsJDDKYqpJQLMX/Xf2xKs X0TTI6zZ8H+xW2scS2YqPuf+O0Z6dnnSufL+BaCL60GOMvvo1Zlm8bZVrdHvsln6Sb4+1y 1fFF4sO+87WfH0bDaHQnxWOiL4BZJCRo/6TNyRZjlVGlQQB1NVjY7eZz4zNGgFXgNSZvQz RMP0z9K7Ku18t9sbzG38cQe+NqMuPFB7tdwuuSJfnneC5Ut/6VyZSD4LtCNJYusVg0Mt9+ njuj5zJ9yxGcxQSswYkgzX/XEFJ16fqfBi5aQwd8QPFTNQ5vjT3Hmf+CMnT8jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730852627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=87LLwNuDCOXWl02YmQKNfv0UcqFhC0Em5oxad5CKGGQ=; b=kvmJGhmx4LH7+Kltf+JsX0Nwq3i18dn/zPVIAEr2u994o0lO7eH2wVPfwN4u2v0cePEX/1 64hN8v5a2k1w7+jycHIj48F+WF4Tq4Uavbz4HzLgK85k2tRqKMlSnBJGfhwgRyX97uM+LW Wc+9lmFjkncIZVMh0c9G9YGosh6pxLOM2ea+PVS/KeY8dxw4BfOcJOr15djndtNMXqgVbR 8Th3uuXLZdry269P9l3bKYAgqBiGUHO22uctgtPlnHXnWwvbd+qSH9oSarY3xCCygwN+Zw i3PZjOqXDZLWNRAILxT2o752SOH6LpVH6IqcZ2eIJf3hJeK34K8tvJy7anGKBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730852627; a=rsa-sha256; cv=none; b=mfPztCNArMc2MLqC9u2u1kg40XQHTo5hVqfRm2fLEZt3EhSN6UoTDiTn9ewsSgFj68/Eoy 5fgstG9umi/rBUgUOo3K1XbrLRy8yURzoejUCXgt86WthNtY3bRVkm0erMCksHVlbGBD8J KhBVquOJ02PtvrH6GBghuVPcxXumRBbr/nJnYsLxuYXUHsKtp9biNZb8/YnAcsjsgZudHX nsHm6hwjUNFZqiFcTCjtsZ3gDUhqT05Rz+Br5G4Jk9tELAnSrRMK+0ctYwHr0HDZqk9RF/ dX29VnKkw+o8H4wwipQ0hi3fJpetSkFvCCi2DAn6HHUUp1oGF5Win3A8N1xd0w== 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 4XjmCR50kmzfjZ; Wed, 6 Nov 2024 00:23:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A60Nlri090963; Wed, 6 Nov 2024 00:23:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A60Nlij090960; Wed, 6 Nov 2024 00:23:47 GMT (envelope-from git) Date: Wed, 6 Nov 2024 00:23:47 GMT Message-Id: <202411060023.4A60Nlij090960@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: f0c07fe3d000 - main - device_pager: rename the un_pager.devp.dev field to handle List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: f0c07fe3d0007a4499f81583a99598cd0a74d45b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f0c07fe3d0007a4499f81583a99598cd0a74d45b commit f0c07fe3d0007a4499f81583a99598cd0a74d45b Author: Konstantin Belousov AuthorDate: 2024-11-04 22:10:06 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-06 00:10:59 +0000 device_pager: rename the un_pager.devp.dev field to handle because it is not neccessary struct cdev *. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47443 --- sys/kern/kern_proc.c | 2 +- sys/vm/device_pager.c | 20 ++++++++++---------- sys/vm/vm_object.c | 2 +- sys/vm/vm_object.h | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index f3ecaf4e2547..0d5b9a93d704 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -2719,7 +2719,7 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) kve->kve_shadow_count = obj->shadow_count; if (obj->type == OBJT_DEVICE || obj->type == OBJT_MGTDEVICE) { - cdev = obj->un_pager.devp.dev; + cdev = obj->un_pager.devp.handle; if (cdev != NULL) { csw = dev_refthread(cdev, &ref); if (csw != NULL) { diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c index a5be05efc6d9..a5fffbf629bd 100644 --- a/sys/vm/device_pager.c +++ b/sys/vm/device_pager.c @@ -118,8 +118,8 @@ cdev_pager_lookup(void *handle) again: mtx_lock(&dev_pager_mtx); object = vm_pager_object_lookup(&dev_pager_object_list, handle); - if (object != NULL && object->un_pager.devp.dev == NULL) { - msleep(&object->un_pager.devp.dev, &dev_pager_mtx, + if (object != NULL && object->un_pager.devp.handle == NULL) { + msleep(&object->un_pager.devp.handle, &dev_pager_mtx, PVM | PDROP, "cdplkp", 0); vm_object_deallocate(object); goto again; @@ -183,8 +183,8 @@ again: object1->type = OBJT_DEAD; vm_object_deallocate(object1); object1 = NULL; - if (object->un_pager.devp.dev == NULL) { - msleep(&object->un_pager.devp.dev, + if (object->un_pager.devp.handle == NULL) { + msleep(&object->un_pager.devp.handle, &dev_pager_mtx, PVM | PDROP, "cdplkp", 0); vm_object_deallocate(object); goto again; @@ -218,7 +218,7 @@ again: mtx_lock(&dev_pager_mtx); TAILQ_REMOVE(&dev_pager_object_list, object, pager_object_list); - wakeup(&object->un_pager.devp.dev); + wakeup(&object->un_pager.devp.handle); mtx_unlock(&dev_pager_mtx); object->type = OBJT_DEAD; vm_object_deallocate(object); @@ -228,14 +228,14 @@ again: mtx_lock(&dev_pager_mtx); object->flags |= OBJ_COLORED; object->pg_color = color; - object->un_pager.devp.dev = handle; - wakeup(&object->un_pager.devp.dev); + object->un_pager.devp.handle = handle; + wakeup(&object->un_pager.devp.handle); } } MPASS(object1 == NULL); } else { - if (object->un_pager.devp.dev == NULL) { - msleep(&object->un_pager.devp.dev, + if (object->un_pager.devp.handle == NULL) { + msleep(&object->un_pager.devp.handle, &dev_pager_mtx, PVM | PDROP, "cdplkp", 0); vm_object_deallocate(object); goto again; @@ -301,7 +301,7 @@ dev_pager_dealloc(vm_object_t object) vm_page_t m; VM_OBJECT_WUNLOCK(object); - object->un_pager.devp.ops->cdev_pg_dtor(object->un_pager.devp.dev); + object->un_pager.devp.ops->cdev_pg_dtor(object->un_pager.devp.handle); mtx_lock(&dev_pager_mtx); TAILQ_REMOVE(&dev_pager_object_list, object, pager_object_list); diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 996f7557ea9b..6d29ddf71f19 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -2516,7 +2516,7 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only) kvo->kvo_swapped = sp > UINT32_MAX ? UINT32_MAX : sp; } if (obj->type == OBJT_DEVICE || obj->type == OBJT_MGTDEVICE) { - cdev = obj->un_pager.devp.dev; + cdev = obj->un_pager.devp.handle; if (cdev != NULL) { csw = dev_refthread(cdev, &ref); if (csw != NULL) { diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h index c7f0dd0943ba..596f67b46e6f 100644 --- a/sys/vm/vm_object.h +++ b/sys/vm/vm_object.h @@ -137,7 +137,7 @@ struct vm_object { struct { TAILQ_HEAD(, vm_page) devp_pglist; const struct cdev_pager_ops *ops; - struct cdev *dev; + void *handle; } devp; /* From nobody Wed Nov 6 00:23:48 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjmCS6RZzz5bqLv; Wed, 06 Nov 2024 00:23: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjmCS5ljzz4qj0; Wed, 6 Nov 2024 00:23:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730852628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KL+nuAv1/CoBiyqvJPhCcs5V7tnzjSPrtSVcPyUfFu4=; b=Vvwc/p1DR7CLNsYtRKilp305bKeqlWH3bW4UEqPtzzx0naiMRG9w/50Bi/1WHYhFXk7WLy tesD+1R9kXivlxBQSQYlWkEMdcSZBRMH2ZWSgaANhBaZNUCoBcgE1vkDxDEi+wOgkJpRlb Uz+cO/lCdkWJi/m89kXnw6LGHp0/4xScKhdF94sjVy0MuJqt+oX6ZQ61P+vGe7lJkY6NR+ cyzU6D/poh4QNtSc9IShAhxg9gzk7JroWQu47qILZKgwqcc3teDcitmzVgNEZSiwkLjnCB jxyfgv8nbDhd0PKDmaXojIFAjiwCz/aqoxsGhGEWiPNRejajM5kf7y1riPy91g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730852628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KL+nuAv1/CoBiyqvJPhCcs5V7tnzjSPrtSVcPyUfFu4=; b=buS8FBoDOR8coHpLE/1w99lJrRsEzq+mTxv+FDEW+TNDLYew8qYTf4iQW/W7GHTT0X+BwQ kQ309JqpaV1sI7JacbI0BJuaCVho5tBJq0uN2Mtu8sXgHPi3xaidPEC/kukcniJm5Esg6E gP9PLqQOYJP/O8+TPRnGBArfwjefacvbZg6rDB4LKZjP13ickDJtLKvBxcC+y4FJU+K8eC DAgtMLQ3gvDtg4t2lW8NOdFG//dbX7uxACpLX87SzUGX2mgdCRDmbuqErv+GNyfTXG807N 27PfiGZ9ST0EJPVbfY6c75+0Wc+OztChYwdud5D32eB6jQqTIGpFcismAOdacA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730852628; a=rsa-sha256; cv=none; b=xq9kGP1Sxr2NIgQR6PGeT0VtN0JqpJkUNaVxm//O7M0qpL7WYrWn5dPMEJasrggZVPtmcL vcquI3hg68Z9oYzZO0q/ombDWYrf6IW3Rz2rnq/YxmnMBNjIvRlNk2PdtkXzZ2L+m9y2bP fJrvo8Qsv9DRvCuVdMRScMut9TWX65m5A/gSGAJWspgSenrzPx+r4yb2j8jWuPIMoBU/9n CYbrw+9LVs7gHeNOBVaSkDZVsNCDIbUCVDyto2agCFtktr2t9l/zaRZ21HhAafQogRLSnK pUpqvf3gOEFZZimDIIdTI0dHZ3uIvbuHmOm5UGEI5aowCbfa/dxNcHlIX51hCA== 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 4XjmCS5LNgzfjb; Wed, 6 Nov 2024 00:23:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A60Nmx2091017; Wed, 6 Nov 2024 00:23:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A60Nmpq091014; Wed, 6 Nov 2024 00:23:48 GMT (envelope-from git) Date: Wed, 6 Nov 2024 00:23:48 GMT Message-Id: <202411060023.4A60Nmpq091014@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 580340dbdaaf - main - vm_object: do not assume that un_pager.devp.dev is cdev List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 580340dbdaaf372867e9ed3dd257430982753e5e Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=580340dbdaaf372867e9ed3dd257430982753e5e commit 580340dbdaaf372867e9ed3dd257430982753e5e Author: Konstantin Belousov AuthorDate: 2024-11-04 21:54:30 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-06 00:11:00 +0000 vm_object: do not assume that un_pager.devp.dev is cdev It is subtype-specific handle. Mark OBJT_DEVICE that do fill cdev into the handle, with a new object flag OBJ_CDEVH. PR: 282533 Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47443 --- sys/kern/kern_proc.c | 5 +++-- sys/vm/vm_mmap.c | 3 +++ sys/vm/vm_object.c | 3 ++- sys/vm/vm_object.h | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 0d5b9a93d704..4cd13234a10b 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -2717,8 +2717,9 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) kve->kve_ref_count = obj->ref_count; kve->kve_shadow_count = obj->shadow_count; - if (obj->type == OBJT_DEVICE || - obj->type == OBJT_MGTDEVICE) { + if ((obj->type == OBJT_DEVICE || + obj->type == OBJT_MGTDEVICE) && + (obj->flags & OBJ_CDEVH) != 0) { cdev = obj->un_pager.devp.handle; if (cdev != NULL) { csw = dev_refthread(cdev, &ref); diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 4f709b1b74e1..028175b88b4f 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -1407,6 +1407,9 @@ vm_mmap_cdev(struct thread *td, vm_size_t objsize, vm_prot_t prot, td->td_ucred); if (obj == NULL) return (EINVAL); + VM_OBJECT_WLOCK(obj); + vm_object_set_flag(obj, OBJ_CDEVH); + VM_OBJECT_WUNLOCK(obj); *objp = obj; *flagsp = flags; return (0); diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 6d29ddf71f19..e6324647e29e 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -2515,7 +2515,8 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only) sp = swap_pager_swapped_pages(obj); kvo->kvo_swapped = sp > UINT32_MAX ? UINT32_MAX : sp; } - if (obj->type == OBJT_DEVICE || obj->type == OBJT_MGTDEVICE) { + if ((obj->type == OBJT_DEVICE || obj->type == OBJT_MGTDEVICE) && + (obj->flags & OBJ_CDEVH) != 0) { cdev = obj->un_pager.devp.handle; if (cdev != NULL) { csw = dev_refthread(cdev, &ref); diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h index 596f67b46e6f..fc39041d02d6 100644 --- a/sys/vm/vm_object.h +++ b/sys/vm/vm_object.h @@ -204,6 +204,7 @@ struct vm_object { #define OBJ_PAGERPRIV2 0x00008000 /* Pager private */ #define OBJ_SYSVSHM 0x00010000 /* SysV SHM */ #define OBJ_POSIXSHM 0x00020000 /* Posix SHM */ +#define OBJ_CDEVH 0x00040000 /* OBJT_DEVICE handle is cdev */ /* * Helpers to perform conversion between vm_object page indexes and offsets. From nobody Wed Nov 6 11:24:33 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xk2t64mpkz5cSsC; Wed, 06 Nov 2024 11:24:46 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xk2t62cMWz4lcT; Wed, 6 Nov 2024 11:24:46 +0000 (UTC) (envelope-from mpp302@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a9a68480164so987653766b.3; Wed, 06 Nov 2024 03:24:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730892285; x=1731497085; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T7jmymE19MIWch6cp7ABDERGmmE+/Hn9/eRsYV/wQm8=; b=UxYVf0TdmXzI8tN6rH0gqeSmQ0rnxPI1IrEMdBzEYeGHGtsCuyERibt6ZoBtZZEgpN H5eMbs02iZlT2mS9Q3Y24c3n+88YXJTG6w6mCpoZHOdeYP+60sJ5/JomY3VVVjJcm4yn ZGAsYuT5RcZgzGLY9423DvclfvssMJ5OCT5jDDCdOMsofQKrpUwfsvozTVJG1p8SsQVB RJWAqrDTCl2oeR0VP1fJ6hhpdtfctgSKblmJyOvqd60eg1A/82jgwXmi3GP1c1LM5QYI AHjby+I5Soe7pDeyxZa0g6Ab9UzCaU43bUBqkWc9S/yI/Ouxbl/GC4v7le0GBSQAN8Of Se/Q== X-Forwarded-Encrypted: i=1; AJvYcCVC0JJs8j8BK9pw2IKBKlYEta2djWOWeqJ2qC5VCN8j3gHihc4wjnrfWk3SBPW+0kFPjnr1OJyV7DsUfaciua2cV7cCTnw=@freebsd.org, AJvYcCVNUenNLhNLHCByBzy4WBGpk5WWUXpw9nJ9VUy2whvK96gNBgo2RsoSkoGk5LN6OwFgPuYIJhh/I7aECognFZqpmu/v@freebsd.org X-Gm-Message-State: AOJu0YyTKdSj7aGv9XbdAU7EFbX+lLT+h1H3UF7ykoLfzHYbq0r9p7NH 0VGL0VlgQ7INmOuJQK3Pioce1FyetLjwUpAlTs+g4TxnSplNUVmwrDEE4WBjINI= X-Google-Smtp-Source: AGHT+IGVCk68folIDTP9ATuHD1Ya841eKCVRXscYhDa61LnrXD5p8hBOJwPWQrtxNEBU3UynZCxpng== X-Received: by 2002:a17:907:6eac:b0:a9a:7f91:8c76 with SMTP id a640c23a62f3a-a9de5a3e0ebmr4211021566b.0.1730892284520; Wed, 06 Nov 2024 03:24:44 -0800 (PST) Received: from smtpclient.apple (ip5f5af7ea.dynamic.kabel-deutschland.de. [95.90.247.234]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9eb17cec86sm265652166b.119.2024.11.06.03.24.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Nov 2024 03:24:44 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: git: d2e7bb630b83 - main - rc.d/sendmail: Return non-zero if the daemon fails to start or is not running From: Mateusz Piotrowski <0mp@FreeBSD.org> In-Reply-To: <20241106011017.68146ea9@hal.tijl.coosemans.org> Date: Wed, 6 Nov 2024 12:24:33 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <50BB2388-07A4-467E-83B0-8ACBA3A44508@FreeBSD.org> References: <202410211921.49LJLj5t024751@gitrepo.freebsd.org> <20241106011017.68146ea9@hal.tijl.coosemans.org> To: =?utf-8?Q?T=C4=B3l_Coosemans?= X-Mailer: Apple Mail (2.3776.700.51) X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4Xk2t62cMWz4lcT X-Spamd-Bar: ---- On 6. Nov 2024, at 01:10, T=C4=B3l Coosemans wrote: >=20 > On Mon, 21 Oct 2024 19:21:45 GMT Mateusz Piotrowski wrote: >> The branch main has been updated by 0mp: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dd2e7bb630b83848a774d8213014a9e07= 47775019 >>=20 >> rc.d/sendmail: Return non-zero if the daemon fails to start or is = not running >=20 > Running "make stop" in /etc/mail now produces an error with the > following config in /etc/rc.conf: >=20 > sendmail_enable=3D"NO" > sendmail_msp_queue_enable=3D"YES" > sendmail_outbound_enable=3D"YES" > sendmail_submit_enable=3D"YES" Thanks for the report. I opened a bug report: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D282585= From nobody Wed Nov 6 13:32:34 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xk5jZ2Bpkz5cbxL; Wed, 06 Nov 2024 13:32:34 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xk5jZ1Rv2z46QD; Wed, 6 Nov 2024 13:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730899954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7VBTGYM2SzteOSOJte4hP2BnnPRBwSE/WVZaeQcVAVI=; b=NJm1FQSNy8bnSaEn8ptQ+JocSyJxwY9sUFvTGbTLiP62OubB8vZSa4xbikMjgX8f3jBNf6 42ZHPgnfxp83VT4hZjDlehqP33q7KA+EysXI1eNhOSpQx0Xjoeu2Y+5raQsXA/6q0yhGX5 VrJvK6ZFexd0O4m4IwP8C6Fw76CYQCCcgnQAnRp+txYNFudLLRCOAxIYwogTE+Bwr931SS w+YPZPiLEglI45Db921c2kiwDB9T1PTGwuPtioUdvhxWtiUvBwH9zF0gartTcBbPifVCtZ zgRyyuZjbeNsGZ3KS7zJ3CoExUm6NTB4eQ/Sym7f4c9PDB06ukdnXfCiUicU8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730899954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7VBTGYM2SzteOSOJte4hP2BnnPRBwSE/WVZaeQcVAVI=; b=b3QtqqBdICQb5TpZUy0ZIW/+3GQQnFhkO/vremib/+OzrcNGvSXyhH4lTjYPIf9DUso46c ForIlr6ZhKgiyW1X9rnhy3h9numm272GvL2WKdc8YkiIMbt/G3jSt9TYvXqzqu1RVVowpM wSAlPjG87o646dywgYtUNDmLdUmdk58KuSyRTC4oGbrkYlcgrF/gV3/rfPogrgTe7gc0xh gcX9wr5oWOzFvA/vk9SM1hIgiLMC/jNQUnDIk/t4p0xIJ0/jNrCrVMZqr0epkyytMT7ig1 B15YLgCFf4Hk2rqBEA6ejwTjUFcekHSb5zIQkLlntyJFtv8ofu7VShYQ46c+Mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730899954; a=rsa-sha256; cv=none; b=b9cuqLp/Ds8E0NhNRwXwB7E8cQ3UXMg1nb64qChnqP1RZMhJY/0DytURidom8ABBfLQ8iz gsvP6Kg1yVAMYS7vw6hyzMxiYlWsWrBThw++UjwjTy3Vfn9WAuil7nCom4DSXB6h9TGxm5 AJSXCMf5Wd55K5uLTQObb4WOKzEHlrf8qRJ6RNN8kps+UU91c7r+SvoMM3zXLuNSEovM02 4oMxv8ustf9OaS/XhT8Q/oA2XvhIvtr2wYkC9Nhpta3UG3ZEwBwj/32aOnvpWkd4KHKayE KUFk3G5VuNH6nK4O51ljN9x13QAXzkK5zBVEUEBmLud8HYghJZH7Fv26SqBF/Q== 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 4Xk5jZ13Jbz1388; Wed, 6 Nov 2024 13:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A6DWY13053482; Wed, 6 Nov 2024 13:32:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A6DWYGE053479; Wed, 6 Nov 2024 13:32:34 GMT (envelope-from git) Date: Wed, 6 Nov 2024 13:32:34 GMT Message-Id: <202411061332.4A6DWYGE053479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 3f6a34cafe57 - main - pf: fix cmd id for PFNL_CMD_GET_ADDR List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 3f6a34cafe5707108a91b5f591888ea1379afb6b Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3f6a34cafe5707108a91b5f591888ea1379afb6b commit 3f6a34cafe5707108a91b5f591888ea1379afb6b Author: Kristof Provost AuthorDate: 2024-10-18 14:20:13 +0000 Commit: Kristof Provost CommitDate: 2024-11-06 11:02:31 +0000 pf: fix cmd id for PFNL_CMD_GET_ADDR Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_nl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 1da9bead394b..7a54ee78c684 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -1613,7 +1613,7 @@ pf_handle_get_addr(struct nlmsghdr *hdr, struct nl_pstate *npt) return (ENOMEM); ghdr_new = nlmsg_reserve_object(nw, struct genlmsghdr); - ghdr_new->cmd = PFNL_CMD_GET_ADDRS; + ghdr_new->cmd = PFNL_CMD_GET_ADDR; ghdr_new->version = 0; ghdr_new->reserved = 0; From nobody Wed Nov 6 13:40:20 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xk5tY4B0Kz5cby6; Wed, 06 Nov 2024 13:40:21 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xk5tY2Cm7z46dV; Wed, 6 Nov 2024 13:40:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730900421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vqVkcLPeuhIpxVKyAzkisQrAa9P0N6RW9uxQFKQn0RU=; b=wVDXAsr5+OzVb0IwGJYH/rjEla8sE5GVfvUKApG86xjtVEoPGqzeE/DH7xTv0oVWQQhTuq rCGu8VkSsZcvNR5+fR9Fqp3gFAPXExP9gw9oySFL8QS5CGyQINAK16LiPxBtKM27VGBjJ0 rPHoR/qbypiT8wWV/l9+9dOUETAGqQiGiYcE7pTO0H8mqKLXMDAwLGbXZZn1eWSrnkMVNP d9316hr0DvWWLxZpg39WjudPLQyEIT4sRWpWpagXoPV1S0XHTs7zVeSTQ8F8+0K5qQ+lke pyTCLeMmSwRG5Bhwa5bggW+1pfYmO3OxVYml2xEXFDKlxLuN+kU8ILXh1E+vqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730900421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vqVkcLPeuhIpxVKyAzkisQrAa9P0N6RW9uxQFKQn0RU=; b=apTZYdeJ1Oi7dbL6BEtaZZCsurRBgq0jqv0GnrpKCI5MBM3x956qk6b+RLOFs6YDCotOvq db0e7PPU7tH73UM08xA0cSi/7MW89gp+x2mNIVbXiVv/FA2U7e3fIenDJWCTE0jHtLdyAa ZerL6U6/ounbPVNwOxPrEQ9g/yfKUIBFqsmjeNv+evSREqp6AiGJEgpYUx6iB5Xh3r+uht i9lDtb0l7uHGCv7d5QRuIBbTZukxWZOoQrG5or4R/jkI51a5Z/JTnkt6IUpZU6zKvChfr+ p/1XPzWxQdiQFM86ajkOrrHOLAt4+RV69N3RkqueZNz9wI8N+pMFjuUcHGzrSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730900421; a=rsa-sha256; cv=none; b=xyEGkvjPwrfwifPqE5l5zkM46tcsIePCbolITESA6jafGKOxqGRnrj3USNB6c0N8okdl/g xtQr8fK3JFUXCKYUY2FBPg/i7xxcaRdMcZcZq/6NuQOCKh/wi9PMBWt17EZYByeo+PtUBD fIpo1Ay2i6wUDINgcZo1bea+SthZnYP+sYe4+wNcjAyB298XwgjhJwrn6J1eCHMOOIrEAI qW2L1W/wG0Xl8dRZkiwUaKxO5wX4dvN4BKlWBjkz4VOS6O0ahM3l2GU1+1q74uDwf6Rtit aa4hETNwWuvGhakGO1cqQCmfI0T6SBipPGjoMcfVsQHpMKqOeh7uQeLHH7avqw== 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 4Xk5tY0FVyz133g; Wed, 6 Nov 2024 13:40:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A6DeKmu064402; Wed, 6 Nov 2024 13:40:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A6DeKBt064399; Wed, 6 Nov 2024 13:40:20 GMT (envelope-from git) Date: Wed, 6 Nov 2024 13:40:20 GMT Message-Id: <202411061340.4A6DeKBt064399@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 4d692868a673 - main - compile_et: reduce the dependency chain for bootstrap tools. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4d692868a6730ebf72a1d1a619af89af6fc8d763 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=4d692868a6730ebf72a1d1a619af89af6fc8d763 commit 4d692868a6730ebf72a1d1a619af89af6fc8d763 Author: Baptiste Daroussin AuthorDate: 2024-11-06 11:16:09 +0000 Commit: Baptiste Daroussin CommitDate: 2024-11-06 13:39:57 +0000 compile_et: reduce the dependency chain for bootstrap tools. Fix the build on macOS The bootstrap tools are statically linked, so our build system will provide the full dependency chain which pulls in libcrypt. since recently libcrypt.a is a linker script not supported by macOS ar(1), given that compile_et does not use at all the function from libroken which brings the dependency on libcrypt, bypass LIBADD dependency chain by using the old LDADD/DPADD mechanism, like it is done for other kerberos related bootstrap tools. --- usr.bin/compile_et/Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/usr.bin/compile_et/Makefile b/usr.bin/compile_et/Makefile index 6305bfe3ddfd..621ba3dd101d 100644 --- a/usr.bin/compile_et/Makefile +++ b/usr.bin/compile_et/Makefile @@ -4,7 +4,18 @@ PACKAGE= kerberos PROG= compile_et SRCS= compile_et.c parse.y lex.l -LIBADD= roken vers +.if defined(BOOTSTRAPPING) +# compiler_et does not need the full libroken but just a bunch of the file +# in there, the buildsystem we have will trigger the full dependency chain +# when linking statically including libcrypt, which is a ldscript, not +# supported by macOS ar(1). +LIBROKEN_A= ${.OBJDIR:H:H}/kerberos5/lib/libroken/libroken.a +LDADD= ${LIBROKEN_A} +DPADD= ${LIBROKEN_A} +.else +LIBADD= roken +.endif +LIBADD+= vers CFLAGS+=-I. -I${SRCTOP}/contrib/com_err WARNS?= 0 From nobody Wed Nov 6 14:46:51 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xk7MH45kgz5cgJf; Wed, 06 Nov 2024 14:46: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xk7MH28nXz4ChM; Wed, 6 Nov 2024 14:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730904411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0SWGC7Uiwygu2lYs5K0VvO+HS/hHbwaiAofJTCbhPJ8=; b=cMin7Qxctk0IFkmMv+l25dWoOuy5NXyOvxcQKZ4quVr1V2lkpPY6aHe6EDcx78AzGrJ9ws 5Eo9ek2cFfMNrsxIP9Yd84FwHit6fCD1DyAkPsiVVprwsd0pIajQv+stiX/yXqXDvUkmZF kJDu4ZqWYKU22/4rJPHHEdMy2aqkXaQD2ZgTQnwy39+YSgknakCj7nXPoD3/1wA4gTlszx VQZaJoGRjrJSTvAE301sE7nvfMyg+cM69ryJBJnHvCR2CIif5zAgs4gYm1f45YA8U+08y+ 2LIX9Ks5knJvVY3ExoDtpNR3Mq06uIfxL5Gr6zmmDQZ8rQ7UTUofHD4NGSLBhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730904411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0SWGC7Uiwygu2lYs5K0VvO+HS/hHbwaiAofJTCbhPJ8=; b=BMEnpp++GV7lzSdQRHFHvIfxX9H1ASTF+PxEL3XRkiWvOkTNvkfZjzrCG6nLNyCbjWsa+u 7qEAoLfrrrI/0GX3h5f900r/628rXJ6tyW33IyOwgCY5kU8CsWcVP0OAF4QA+tbG8dOR0b h5nOFcIFRH+ZAEZ9aLeEJelIDOjbhYXm9e5RP+es+DQqsD/WCnqmeJZDHRYfumn/OZ1lz0 LQUvYsvtdp+WUE+uwvpkrtjRcM5B2MPcywQsK2/qhF+NEOXtoErevJ7MoH18Qtw2ePsUwE AfnB6YJagGX5/HyEdtUEC86PGQRA/GV/875P0Zb+f672QwikcPmge4CieMS9eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730904411; a=rsa-sha256; cv=none; b=h9UvhrTKQjjrF/8ZUfxg1wxZv+ARiDQN4oCQk7g5akbGsaI0xxzhNW8LiJ6ngTEpzXC2Gk mvsy/QFUPIQIcc7WviIOAcHWKH3EnYT/RTwWh4z0ucj4pwzoB0j+A08ipzHsf7HP4wyxmu aTMWQk2y32/d+/yxeBngzDq4I1/xBttGmoktRHEgpqfgcT4/r4XMWl067gjX/b2JW5VUeZ qv0vE94/P9+1GdY3UOMfI0DjkKbZT+nY47BzskIJjvv3Iam0K4Hjhhcz+ppFFRgs8/+hL/ XFFKPDLMLjGJw5xd+0RU8Ud25uDVJS26VH0R71+xFOgX7v/XCOZSVPEMhYj77w== 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 4Xk7MH1c5lz15NL; Wed, 6 Nov 2024 14:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A6Ekp1v083343; Wed, 6 Nov 2024 14:46:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A6Ekprl083340; Wed, 6 Nov 2024 14:46:51 GMT (envelope-from git) Date: Wed, 6 Nov 2024 14:46:51 GMT Message-Id: <202411061446.4A6Ekprl083340@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Roger Pau =?utf-8?Q?Monn=C3=A9?= Subject: git: 6ac22dc3d823 - main - x86/xen: Use intended values in HVM_CALLBACK_VECTOR List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6ac22dc3d82395b88f1d8a404aa9985306f06656 Auto-Submitted: auto-generated The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=6ac22dc3d82395b88f1d8a404aa9985306f06656 commit 6ac22dc3d82395b88f1d8a404aa9985306f06656 Author: Alan Robinson AuthorDate: 2024-10-25 07:27:39 +0000 Commit: Roger Pau Monné CommitDate: 2024-11-06 14:46:05 +0000 x86/xen: Use intended values in HVM_CALLBACK_VECTOR Replace the HVM_CB_GSI_GSI SHIFT and MASK with the existing but currently unused HVM_CB_VECTOR_VECTOR_SHIFT and MASK. The binary values are identical. Reviewed by: Elliott Mitchell Reviewed by: royger Pull request: https://github.com/freebsd/freebsd-src/pull/1490 --- sys/xen/hvm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/xen/hvm.h b/sys/xen/hvm.h index 3ff3ee3c51e6..cc414b7b471d 100644 --- a/sys/xen/hvm.h +++ b/sys/xen/hvm.h @@ -87,7 +87,7 @@ enum { }; #define HVM_CALLBACK_VECTOR(vector) \ (((uint64_t)HVM_CB_TYPE_VECTOR << HVM_CB_TYPE_SHIFT) \ - | (((vector) & HVM_CB_GSI_GSI_MASK) << HVM_CB_GSI_GSI_SHIFT)) + | (((vector) & HVM_CB_VECTOR_VECTOR_MASK) << HVM_CB_VECTOR_VECTOR_SHIFT)) enum xen_hvm_init_type { XEN_HVM_INIT_EARLY, From nobody Wed Nov 6 15:17:41 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xk82t1jf2z5ch6y; Wed, 06 Nov 2024 15:17:42 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xk82t1N8Cz4G8r; Wed, 6 Nov 2024 15:17:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730906262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gqu9fxwcdVXLaGAcs7qqJI48FLVJYuYHk+P73mk7Igs=; b=dFf5U7EITjNOEAGWHY0O10fZKMotVkzHZwz9KE3lQsw8RHCbBTspisGW4eFTql5jZRLq5A t6Zq+olWumhmTjedYU5sIyEJNYabKXxebSSLhhNMBJJwcVDbw8RrZrTV4s7KOwmzK5vn8h i2VTnVHn7ir0rKNJ9h7BUSvDIw1TkAMRI5bip711a3HPw4ryWpkWlftsnoahcn36gkX5hh 0kIqJaBNtoy1fd9M0JQ8TfYA1fW+NUSKhvrF4RZ5GMlYu7N5gtrwvzDuTt/S3yqPFE+bgA oD+GTuYvkU9Qq+05l40E6qph73LwV3yHxmZXjHYdG7PrfpRYdwq8LTgwXPC1lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730906262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gqu9fxwcdVXLaGAcs7qqJI48FLVJYuYHk+P73mk7Igs=; b=ttATP90uz3kV357deVK9FI0B2tnjXJ2k/bG9jYXzMkk+/8O4ETWhz3L6+wf6EnqM/XsceG 3NSqyJW0dgU4WiY7CZiLrgvIrD3nyHQCe+KLg6Eo8MLhEAr0UMsTBrmrf+XaGCO0RtX0Jm DIARRr5ivTzw2LK0opNe1oDppD7mhOXBcVSAxxma6YKsnsHx0WhWMiaRZWrzqeEoIjtaV2 PGubb9W3ifK7Muv6Od2b640vZdxoVtEk/mLBULiI+ybRMerxBqN07mfKv6bFLa7bjlHYkU +CZOMw7JD7VumJOjr/U2Qbof7vi1Cuyl4OjcqEhaG8uk6pDfHNyHNjmu00yJJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730906262; a=rsa-sha256; cv=none; b=sa7GJZyd80tAaLF+qfj9JxHzMcoY2p8DYo2h4RVrdRdJ7BYOITkJDcVIVsX4P/P933hEGz 10U9v788+Uc1K1PopeZ8joCejlsSd3YasvofYXIbSM/skugXvMONoBvZSAcbHH2TjhCs74 cb5c196bTt5ORDEwODGf8rukOhKd1WD/IvIN1LS3cQktGN53jV/CKSM+ZlY+EvRmoy3dcM lYbhHa/mITot6p9qQhXDX5VXDHkiQdO0BLm/Rb/PHp43VyojuvqI+nJzyQFT7yRaY/ddfv Yae9Nu66zGI8wLsVoab3qd2wVNXNy0Nfci8Zj7ftiQLDnP3C2LhQNXRvlFhzpQ== 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 4Xk82t0q6qz15M0; Wed, 6 Nov 2024 15:17:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A6FHgFI043135; Wed, 6 Nov 2024 15:17:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A6FHfYx043132; Wed, 6 Nov 2024 15:17:41 GMT (envelope-from git) Date: Wed, 6 Nov 2024 15:17:41 GMT Message-Id: <202411061517.4A6FHfYx043132@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d438b4ef0cfc - main - gve: Add DQO RDA support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: d438b4ef0cfc6986b93d0754f49ebf3ead50f269 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d438b4ef0cfc6986b93d0754f49ebf3ead50f269 commit d438b4ef0cfc6986b93d0754f49ebf3ead50f269 Author: Shailend Chand AuthorDate: 2024-11-05 19:38:29 +0000 Commit: Mark Johnston CommitDate: 2024-11-06 15:06:41 +0000 gve: Add DQO RDA support DQO is the descriptor format for our next generation virtual NIC. It is necessary to make full use of the hardware bandwidth on many newer GCP VM shapes. One major change with DQO from its predecessor GQI is that it uses dual descriptor rings for both TX and RX queues. The TX path uses a descriptor ring to send descriptors to HW, and receives packet completion events on a TX completion ring. The RX path posts buffers to HW using an RX descriptor ring and receives incoming packets on an RX completion ring. In GQI-QPL, the hardware could not access arbitrary regions of guest memory, which is why there was a pre-negotitated bounce buffer (QPL: Queue Page List). DQO-RDA has no such limitation. "RDA" is in contrast to QPL and stands for "Raw DMA Addressing" which just means that HW does not need a fixed bounce buffer and can DMA arbitrary regions of guest memory. A subsequent patch will introduce the DQO-QPL datapath that uses the same descriptor format as in this patch, but will have a fixed bounce buffer. Signed-off-by: Shailend Chand Reviewed-by: markj MFC-after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46690 --- share/man/man4/gve.4 | 53 +++- sys/conf/files | 2 + sys/dev/gve/gve.h | 213 +++++++++++-- sys/dev/gve/gve_adminq.c | 123 +++++++- sys/dev/gve/gve_adminq.h | 55 +++- sys/dev/gve/gve_dqo.h | 306 ++++++++++++++++++ sys/dev/gve/gve_main.c | 67 +++- sys/dev/gve/gve_plat.h | 3 + sys/dev/gve/gve_rx.c | 110 +++++-- sys/dev/gve/gve_rx_dqo.c | 633 +++++++++++++++++++++++++++++++++++++ sys/dev/gve/gve_sysctl.c | 60 +++- sys/dev/gve/gve_tx.c | 139 ++++++--- sys/dev/gve/gve_tx_dqo.c | 793 +++++++++++++++++++++++++++++++++++++++++++++++ sys/dev/gve/gve_utils.c | 46 ++- sys/modules/gve/Makefile | 12 +- 15 files changed, 2471 insertions(+), 144 deletions(-) diff --git a/share/man/man4/gve.4 b/share/man/man4/gve.4 index a674d6b64803..d42e4ae293a7 100644 --- a/share/man/man4/gve.4 +++ b/share/man/man4/gve.4 @@ -1,6 +1,6 @@ .\" SPDX-License-Identifier: BSD-3-Clause .\" -.\" Copyright (c) 2023 Google LLC +.\" Copyright (c) 2023-2024 Google LLC .\" .\" Redistribution and use in source and binary forms, with or without modification, .\" are permitted provided that the following conditions are met: @@ -26,7 +26,7 @@ .\" 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. -.Dd April 26, 2023 +.Dd October 14, 2024 .Dt GVE 4 .Os .Sh NAME @@ -192,16 +192,61 @@ These two messages correspond to the NIC alerting the driver to link state chang .Pp Apart from these messages, the driver exposes per-queue packet and error counters as sysctl nodes. Global (across queues) counters can be read using -.Xr netstat 8 . +.Xr netstat 1 . +.Sh SYSCTL VARIABLES +.Nm +exposes the following +.Xr sysctl 8 +variables: +.Bl -tag -width indent +.It Va hw.gve.driver_version +The driver version. +This is read-only. +.It Va hw.gve.queue_format +The queue format in use. +This is read-only. +.It Va hw.gve.disable_hw_lro +Setting this boot-time tunable to 1 disables Large Receive Offload (LRO) in the NIC. +The default value is 0, which means hardware LRO is enabled by default. +The software LRO stack in the kernel is always used. +This sysctl variable needs to be set before loading the driver, using +.Xr loader.conf 5 . +.El .Sh LIMITATIONS .Nm does not support the transmission of VLAN-tagged packets. All VLAN-tagged traffic is dropped. +.Sh QUEUE FORMATS +.Nm +features different datapath modes called queue formats: +.Pp +.Bl -bullet -compact +.It +GQI_QPL: "QPL" stands for "Queue Page List" and refers to the fact that +hardware expects a fixed bounce buffer and cannot access arbitrary memory. +GQI is the older descriptor format. +The G in "GQI" refers to an older generation of hardware, and the "QI" +stands for "Queue In-order" referring to the fact that the NIC sends +Tx and Rx completions in the same order as the one in which the corresponding +descriptors were posted by the driver. +.It +DQO_RDA: DQO is the descriptor format required to take full advantage of +next generation VM shapes. +"RDA" stands for "Raw DMA Addressing" and refers to the fact that hardware +can work with DMA-ed packets and does not expect them to be copied into or +out of a fixed bounce buffer. +The D in "DQO" refers to a newer generation of hardware, and the "QO" +stands for "Queue Out-of-order" referring to the fact that the NIC might +send Tx and Rx completions in an order different from the one in which +the corresponding descriptors were posted by the driver. +.El .Sh SUPPORT Please email gvnic-drivers@google.com with the specifics of the issue encountered. .Sh SEE ALSO +.Xr netstat 1 , +.Xr loader.conf 5 , .Xr ifconfig 8 , -.Xr netstat 8 +.Xr sysctl 8 .Sh HISTORY The .Nm diff --git a/sys/conf/files b/sys/conf/files index d04e75be3793..7bf2cffe8b09 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1732,8 +1732,10 @@ dev/gve/gve_adminq.c optional gve dev/gve/gve_main.c optional gve dev/gve/gve_qpl.c optional gve dev/gve/gve_rx.c optional gve +dev/gve/gve_rx_dqo.c optional gve dev/gve/gve_sysctl.c optional gve dev/gve/gve_tx.c optional gve +dev/gve/gve_tx_dqo.c optional gve dev/gve/gve_utils.c optional gve dev/goldfish/goldfish_rtc.c optional goldfish_rtc fdt dev/gpio/acpi_gpiobus.c optional acpi gpio diff --git a/sys/dev/gve/gve.h b/sys/dev/gve/gve.h index c446199dff2d..98f1139c6bc2 100644 --- a/sys/dev/gve/gve.h +++ b/sys/dev/gve/gve.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-3-Clause * - * Copyright (c) 2023 Google LLC + * Copyright (c) 2023-2024 Google LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -53,6 +53,9 @@ /* Each RX bounce buffer page can fit two packet buffers. */ #define GVE_DEFAULT_RX_BUFFER_OFFSET (PAGE_SIZE / 2) +/* PTYPEs are always 10 bits. */ +#define GVE_NUM_PTYPES 1024 + /* * Number of descriptors per queue page list. * Page count AKA QPL size can be derived by dividing the number of elements in @@ -224,30 +227,61 @@ struct gve_rxq_stats { counter_u64_t rx_frag_copy_cnt; counter_u64_t rx_dropped_pkt_desc_err; counter_u64_t rx_dropped_pkt_mbuf_alloc_fail; + counter_u64_t rx_mbuf_dmamap_err; + counter_u64_t rx_mbuf_mclget_null; }; #define NUM_RX_STATS (sizeof(struct gve_rxq_stats) / sizeof(counter_u64_t)) +struct gve_rx_buf_dqo { + struct mbuf *mbuf; + bus_dmamap_t dmamap; + uint64_t addr; + bool mapped; + SLIST_ENTRY(gve_rx_buf_dqo) slist_entry; +}; + /* power-of-2 sized receive ring */ struct gve_rx_ring { struct gve_ring_com com; struct gve_dma_handle desc_ring_mem; - struct gve_dma_handle data_ring_mem; - - /* accessed in the receive hot path */ - struct { - struct gve_rx_desc *desc_ring; - union gve_rx_data_slot *data_ring; - struct gve_rx_slot_page_info *page_info; - - struct gve_rx_ctx ctx; - struct lro_ctrl lro; - uint8_t seq_no; /* helps traverse the descriptor ring */ - uint32_t cnt; /* free-running total number of completed packets */ - uint32_t fill_cnt; /* free-running total number of descs and buffs posted */ - uint32_t mask; /* masks the cnt and fill_cnt to the size of the ring */ - struct gve_rxq_stats stats; - } __aligned(CACHE_LINE_SIZE); + uint32_t cnt; /* free-running total number of completed packets */ + uint32_t fill_cnt; /* free-running total number of descs and buffs posted */ + + union { + /* GQI-only fields */ + struct { + struct gve_dma_handle data_ring_mem; + + /* accessed in the GQ receive hot path */ + struct gve_rx_desc *desc_ring; + union gve_rx_data_slot *data_ring; + struct gve_rx_slot_page_info *page_info; + uint32_t mask; /* masks the cnt and fill_cnt to the size of the ring */ + uint8_t seq_no; /* helps traverse the descriptor ring */ + }; + + /* DQO-only fields */ + struct { + struct gve_dma_handle compl_ring_mem; + + struct gve_rx_compl_desc_dqo *compl_ring; + struct gve_rx_desc_dqo *desc_ring; + struct gve_rx_buf_dqo *bufs; /* Parking place for posted buffers */ + bus_dma_tag_t buf_dmatag; /* To dmamap posted mbufs with */ + + uint32_t buf_cnt; /* Size of the bufs array */ + uint32_t mask; /* One less than the sizes of the desc and compl rings */ + uint32_t head; /* The index at which to post the next buffer at */ + uint32_t tail; /* The index at which to receive the next compl at */ + uint8_t cur_gen_bit; /* Gets flipped on every cycle of the compl ring */ + SLIST_HEAD(, gve_rx_buf_dqo) free_bufs; + } dqo; + }; + + struct lro_ctrl lro; + struct gve_rx_ctx ctx; + struct gve_rxq_stats stats; } __aligned(CACHE_LINE_SIZE); @@ -277,11 +311,26 @@ struct gve_txq_stats { counter_u64_t tx_dropped_pkt; counter_u64_t tx_dropped_pkt_nospace_device; counter_u64_t tx_dropped_pkt_nospace_bufring; + counter_u64_t tx_delayed_pkt_nospace_descring; + counter_u64_t tx_delayed_pkt_nospace_compring; + counter_u64_t tx_delayed_pkt_tsoerr; counter_u64_t tx_dropped_pkt_vlan; + counter_u64_t tx_mbuf_collapse; + counter_u64_t tx_mbuf_defrag; + counter_u64_t tx_mbuf_defrag_err; + counter_u64_t tx_mbuf_dmamap_enomem_err; + counter_u64_t tx_mbuf_dmamap_err; }; #define NUM_TX_STATS (sizeof(struct gve_txq_stats) / sizeof(counter_u64_t)) +struct gve_tx_pending_pkt_dqo { + struct mbuf *mbuf; + bus_dmamap_t dmamap; + uint8_t state; /* the gve_packet_state enum */ + int next; /* To chain the free_pending_pkts lists */ +}; + /* power-of-2 sized transmit ring */ struct gve_tx_ring { struct gve_ring_com com; @@ -290,22 +339,95 @@ struct gve_tx_ring { struct task xmit_task; struct taskqueue *xmit_tq; - /* accessed in the transmit hot path */ - struct { - union gve_tx_desc *desc_ring; - struct gve_tx_buffer_state *info; - struct buf_ring *br; + /* Accessed when writing descriptors */ + struct buf_ring *br; + struct mtx ring_mtx; + + uint32_t req; /* free-running total number of packets written to the nic */ + uint32_t done; /* free-running total number of completed packets */ + + union { + /* GQI specific stuff */ + struct { + union gve_tx_desc *desc_ring; + struct gve_tx_buffer_state *info; + + struct gve_tx_fifo fifo; + + uint32_t mask; /* masks the req and done to the size of the ring */ + }; + + /* DQO specific stuff */ + struct { + struct gve_dma_handle compl_ring_mem; + + /* Accessed when writing descriptors */ + struct { + union gve_tx_desc_dqo *desc_ring; + uint32_t desc_mask; /* masks head and tail to the size of desc_ring */ + uint32_t desc_head; /* last desc read by NIC, cached value of hw_tx_head */ + uint32_t desc_tail; /* last desc written by driver */ + uint32_t last_re_idx; /* desc which last had "report event" set */ + + /* + * The head index of a singly linked list containing pending packet objects + * to park mbufs till the NIC sends completions. Once this list is depleted, + * the "_prd" suffixed producer list, grown by the completion taskqueue, + * is stolen. + */ + int32_t free_pending_pkts_csm; + + bus_dma_tag_t buf_dmatag; /* DMA params for mapping Tx mbufs */ + } __aligned(CACHE_LINE_SIZE); + + /* Accessed when processing completions */ + struct { + struct gve_tx_compl_desc_dqo *compl_ring; + uint32_t compl_mask; /* masks head to the size of compl_ring */ + uint32_t compl_head; /* last completion read by driver */ + uint8_t cur_gen_bit; /* NIC flips a bit on every pass */ + uint32_t hw_tx_head; /* last desc read by NIC */ + + /* + * The completion taskqueue moves pending-packet objects to this + * list after freeing the mbuf. The "_prd" denotes that this is + * a producer list. The trasnmit taskqueue steals this list once + * its consumer list, with the "_csm" suffix, is depleted. + */ + int32_t free_pending_pkts_prd; + } __aligned(CACHE_LINE_SIZE); + + /* Accessed by both the completion and xmit loops */ + struct { + /* completion tags index into this array */ + struct gve_tx_pending_pkt_dqo *pending_pkts; + uint16_t num_pending_pkts; + } __aligned(CACHE_LINE_SIZE); + } dqo; + }; + struct gve_txq_stats stats; +} __aligned(CACHE_LINE_SIZE); - struct gve_tx_fifo fifo; - struct mtx ring_mtx; +enum gve_packet_state { + /* + * Packet does not yet have a dmamap created. + * This should always be zero since state is not explicitly initialized. + */ + GVE_PACKET_STATE_UNALLOCATED, + /* Packet has a dmamap and is in free list, available to be allocated. */ + GVE_PACKET_STATE_FREE, + /* Packet is expecting a regular data completion */ + GVE_PACKET_STATE_PENDING_DATA_COMPL, +}; - uint32_t req; /* free-running total number of packets written to the nic */ - uint32_t done; /* free-running total number of completed packets */ - uint32_t mask; /* masks the req and done to the size of the ring */ - struct gve_txq_stats stats; - } __aligned(CACHE_LINE_SIZE); +struct gve_ptype { + uint8_t l3_type; /* `gve_l3_type` in gve_adminq.h */ + uint8_t l4_type; /* `gve_l4_type` in gve_adminq.h */ +}; -} __aligned(CACHE_LINE_SIZE); +struct gve_ptype_lut { + struct gve_ptype ptypes[GVE_NUM_PTYPES]; +}; struct gve_priv { if_t ifp; @@ -348,6 +470,8 @@ struct gve_priv { struct gve_tx_ring *tx; struct gve_rx_ring *rx; + struct gve_ptype_lut *ptype_lut_dqo; + /* * Admin queue - see gve_adminq.h * Since AQ cmds do not run in steady state, 32 bit counters suffice @@ -370,6 +494,7 @@ struct gve_priv { uint32_t adminq_dcfg_device_resources_cnt; uint32_t adminq_set_driver_parameter_cnt; uint32_t adminq_verify_driver_compatibility_cnt; + uint32_t adminq_get_ptype_map_cnt; uint32_t interface_up_cnt; uint32_t interface_down_cnt; @@ -400,6 +525,12 @@ gve_clear_state_flag(struct gve_priv *priv, int pos) BIT_CLR_ATOMIC(GVE_NUM_STATE_FLAGS, pos, &priv->state_flags); } +static inline bool +gve_is_gqi(struct gve_priv *priv) +{ + return (priv->queue_format == GVE_GQI_QPL_FORMAT); +} + /* Defined in gve_main.c */ void gve_schedule_reset(struct gve_priv *priv); @@ -407,6 +538,7 @@ void gve_schedule_reset(struct gve_priv *priv); uint32_t gve_reg_bar_read_4(struct gve_priv *priv, bus_size_t offset); void gve_reg_bar_write_4(struct gve_priv *priv, bus_size_t offset, uint32_t val); void gve_db_bar_write_4(struct gve_priv *priv, bus_size_t offset, uint32_t val); +void gve_db_bar_dqo_write_4(struct gve_priv *priv, bus_size_t offset, uint32_t val); /* QPL (Queue Page List) functions defined in gve_qpl.c */ int gve_alloc_qpls(struct gve_priv *priv); @@ -425,6 +557,14 @@ void gve_qflush(if_t ifp); void gve_xmit_tq(void *arg, int pending); void gve_tx_cleanup_tq(void *arg, int pending); +/* TX functions defined in gve_tx_dqo.c */ +int gve_tx_alloc_ring_dqo(struct gve_priv *priv, int i); +void gve_tx_free_ring_dqo(struct gve_priv *priv, int i); +void gve_clear_tx_ring_dqo(struct gve_priv *priv, int i); +int gve_tx_intr_dqo(void *arg); +int gve_xmit_dqo(struct gve_tx_ring *tx, struct mbuf **mbuf_ptr); +void gve_tx_cleanup_tq_dqo(void *arg, int pending); + /* RX functions defined in gve_rx.c */ int gve_alloc_rx_rings(struct gve_priv *priv); void gve_free_rx_rings(struct gve_priv *priv); @@ -433,6 +573,14 @@ int gve_destroy_rx_rings(struct gve_priv *priv); int gve_rx_intr(void *arg); void gve_rx_cleanup_tq(void *arg, int pending); +/* RX functions defined in gve_rx_dqo.c */ +int gve_rx_alloc_ring_dqo(struct gve_priv *priv, int i); +void gve_rx_free_ring_dqo(struct gve_priv *priv, int i); +void gve_rx_prefill_buffers_dqo(struct gve_rx_ring *rx); +void gve_clear_rx_ring_dqo(struct gve_priv *priv, int i); +int gve_rx_intr_dqo(void *arg); +void gve_rx_cleanup_tq_dqo(void *arg, int pending); + /* DMA functions defined in gve_utils.c */ int gve_dma_alloc_coherent(struct gve_priv *priv, int size, int align, struct gve_dma_handle *dma); @@ -447,7 +595,10 @@ int gve_alloc_irqs(struct gve_priv *priv); void gve_unmask_all_queue_irqs(struct gve_priv *priv); void gve_mask_all_queue_irqs(struct gve_priv *priv); -/* Systcl functions defined in gve_sysctl.c*/ +/* Systcl functions defined in gve_sysctl.c */ +extern bool gve_disable_hw_lro; +extern char gve_queue_format[8]; +extern char gve_version[8]; void gve_setup_sysctl(struct gve_priv *priv); void gve_accum_stats(struct gve_priv *priv, uint64_t *rpackets, uint64_t *rbytes, uint64_t *rx_dropped_pkt, uint64_t *tpackets, diff --git a/sys/dev/gve/gve_adminq.c b/sys/dev/gve/gve_adminq.c index 3c332607ebd4..7865b979888b 100644 --- a/sys/dev/gve/gve_adminq.c +++ b/sys/dev/gve/gve_adminq.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-3-Clause * - * Copyright (c) 2023 Google LLC + * Copyright (c) 2023-2024 Google LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -57,6 +57,7 @@ void gve_parse_device_option(struct gve_priv *priv, struct gve_device_descriptor *device_descriptor, struct gve_device_option *option, struct gve_device_option_gqi_qpl **dev_op_gqi_qpl, + struct gve_device_option_dqo_rda **dev_op_dqo_rda, struct gve_device_option_jumbo_frames **dev_op_jumbo_frames) { uint32_t req_feat_mask = be32toh(option->required_features_mask); @@ -85,6 +86,23 @@ void gve_parse_device_option(struct gve_priv *priv, *dev_op_gqi_qpl = (void *)(option + 1); break; + case GVE_DEV_OPT_ID_DQO_RDA: + if (option_length < sizeof(**dev_op_dqo_rda) || + req_feat_mask != GVE_DEV_OPT_REQ_FEAT_MASK_DQO_RDA) { + device_printf(priv->dev, GVE_DEVICE_OPTION_ERROR_FMT, + "DQO RDA", (int)sizeof(**dev_op_dqo_rda), + GVE_DEV_OPT_REQ_FEAT_MASK_DQO_RDA, + option_length, req_feat_mask); + break; + } + + if (option_length > sizeof(**dev_op_dqo_rda)) { + device_printf(priv->dev, GVE_DEVICE_OPTION_TOO_BIG_FMT, + "DQO RDA"); + } + *dev_op_dqo_rda = (void *)(option + 1); + break; + case GVE_DEV_OPT_ID_JUMBO_FRAMES: if (option_length < sizeof(**dev_op_jumbo_frames) || req_feat_mask != GVE_DEV_OPT_REQ_FEAT_MASK_JUMBO_FRAMES) { @@ -117,6 +135,7 @@ static int gve_process_device_options(struct gve_priv *priv, struct gve_device_descriptor *descriptor, struct gve_device_option_gqi_qpl **dev_op_gqi_qpl, + struct gve_device_option_dqo_rda **dev_op_dqo_rda, struct gve_device_option_jumbo_frames **dev_op_jumbo_frames) { char *desc_end = (char *)descriptor + be16toh(descriptor->total_length); @@ -130,12 +149,12 @@ gve_process_device_options(struct gve_priv *priv, if ((char *)(dev_opt + 1) > desc_end || (char *)(dev_opt + 1) + be16toh(dev_opt->option_length) > desc_end) { device_printf(priv->dev, - "options exceed device_descriptor's total length.\n"); + "options exceed device descriptor's total length.\n"); return (EINVAL); } gve_parse_device_option(priv, descriptor, dev_opt, - dev_op_gqi_qpl, dev_op_jumbo_frames); + dev_op_gqi_qpl, dev_op_dqo_rda, dev_op_jumbo_frames); dev_opt = (void *)((char *)(dev_opt + 1) + be16toh(dev_opt->option_length)); } @@ -221,16 +240,35 @@ gve_adminq_create_rx_queue(struct gve_priv *priv, uint32_t queue_index) cmd.opcode = htobe32(GVE_ADMINQ_CREATE_RX_QUEUE); cmd.create_rx_queue = (struct gve_adminq_create_rx_queue) { .queue_id = htobe32(queue_index), - .index = htobe32(queue_index), .ntfy_id = htobe32(rx->com.ntfy_id), .queue_resources_addr = htobe64(qres_dma->bus_addr), - .rx_desc_ring_addr = htobe64(rx->desc_ring_mem.bus_addr), - .rx_data_ring_addr = htobe64(rx->data_ring_mem.bus_addr), - .queue_page_list_id = htobe32((rx->com.qpl)->id), .rx_ring_size = htobe16(priv->rx_desc_cnt), .packet_buffer_size = htobe16(GVE_DEFAULT_RX_BUFFER_SIZE), }; + if (gve_is_gqi(priv)) { + cmd.create_rx_queue.rx_desc_ring_addr = + htobe64(rx->desc_ring_mem.bus_addr); + cmd.create_rx_queue.rx_data_ring_addr = + htobe64(rx->data_ring_mem.bus_addr); + cmd.create_rx_queue.index = + htobe32(queue_index); + cmd.create_rx_queue.queue_page_list_id = + htobe32((rx->com.qpl)->id); + } else { + cmd.create_rx_queue.queue_page_list_id = + htobe32(GVE_RAW_ADDRESSING_QPL_ID); + cmd.create_rx_queue.rx_desc_ring_addr = + htobe64(rx->dqo.compl_ring_mem.bus_addr); + cmd.create_rx_queue.rx_data_ring_addr = + htobe64(rx->desc_ring_mem.bus_addr); + cmd.create_rx_queue.rx_buff_ring_size = + htobe16(priv->rx_desc_cnt); + cmd.create_rx_queue.enable_rsc = + !!((if_getcapenable(priv->ifp) & IFCAP_LRO) && + !gve_disable_hw_lro); + } + return (gve_adminq_execute_cmd(priv, &cmd)); } @@ -272,11 +310,21 @@ gve_adminq_create_tx_queue(struct gve_priv *priv, uint32_t queue_index) .queue_id = htobe32(queue_index), .queue_resources_addr = htobe64(qres_dma->bus_addr), .tx_ring_addr = htobe64(tx->desc_ring_mem.bus_addr), - .queue_page_list_id = htobe32((tx->com.qpl)->id), .ntfy_id = htobe32(tx->com.ntfy_id), .tx_ring_size = htobe16(priv->tx_desc_cnt), }; + if (gve_is_gqi(priv)) { + cmd.create_tx_queue.queue_page_list_id = + htobe32((tx->com.qpl)->id); + } else { + cmd.create_tx_queue.queue_page_list_id = + htobe32(GVE_RAW_ADDRESSING_QPL_ID); + cmd.create_tx_queue.tx_comp_ring_addr = + htobe64(tx->dqo.compl_ring_mem.bus_addr); + cmd.create_tx_queue.tx_comp_ring_size = + htobe16(priv->tx_desc_cnt); + } return (gve_adminq_execute_cmd(priv, &cmd)); } @@ -338,6 +386,7 @@ gve_adminq_describe_device(struct gve_priv *priv) struct gve_device_descriptor *desc; struct gve_dma_handle desc_mem; struct gve_device_option_gqi_qpl *dev_op_gqi_qpl = NULL; + struct gve_device_option_dqo_rda *dev_op_dqo_rda = NULL; struct gve_device_option_jumbo_frames *dev_op_jumbo_frames = NULL; uint32_t supported_features_mask = 0; int rc; @@ -366,12 +415,24 @@ gve_adminq_describe_device(struct gve_priv *priv) bus_dmamap_sync(desc_mem.tag, desc_mem.map, BUS_DMASYNC_POSTREAD); - rc = gve_process_device_options(priv, desc, &dev_op_gqi_qpl, + rc = gve_process_device_options(priv, desc, + &dev_op_gqi_qpl, &dev_op_dqo_rda, &dev_op_jumbo_frames); if (rc != 0) goto free_device_descriptor; - if (dev_op_gqi_qpl != NULL) { + if (dev_op_dqo_rda != NULL) { + snprintf(gve_queue_format, sizeof(gve_queue_format), + "%s", "DQO RDA"); + priv->queue_format = GVE_DQO_RDA_FORMAT; + supported_features_mask = be32toh( + dev_op_dqo_rda->supported_features_mask); + if (bootverbose) + device_printf(priv->dev, + "Driver is running with DQO RDA queue format.\n"); + } else if (dev_op_gqi_qpl != NULL) { + snprintf(gve_queue_format, sizeof(gve_queue_format), + "%s", "GQI QPL"); priv->queue_format = GVE_GQI_QPL_FORMAT; supported_features_mask = be32toh( dev_op_gqi_qpl->supported_features_mask); @@ -380,7 +441,7 @@ gve_adminq_describe_device(struct gve_priv *priv) "Driver is running with GQI QPL queue format.\n"); } else { device_printf(priv->dev, "No compatible queue formats\n"); - rc = (EINVAL); + rc = EINVAL; goto free_device_descriptor; } @@ -506,6 +567,41 @@ gve_adminq_verify_driver_compatibility(struct gve_priv *priv, return (gve_adminq_execute_cmd(priv, &aq_cmd)); } +int +gve_adminq_get_ptype_map_dqo(struct gve_priv *priv, + struct gve_ptype_lut *ptype_lut_dqo) +{ + struct gve_adminq_command aq_cmd = (struct gve_adminq_command){}; + struct gve_ptype_map *ptype_map; + struct gve_dma_handle dma; + int err = 0; + int i; + + err = gve_dma_alloc_coherent(priv, sizeof(*ptype_map), PAGE_SIZE, &dma); + if (err) + return (err); + ptype_map = dma.cpu_addr; + + aq_cmd.opcode = htobe32(GVE_ADMINQ_GET_PTYPE_MAP); + aq_cmd.get_ptype_map = (struct gve_adminq_get_ptype_map) { + .ptype_map_len = htobe64(sizeof(*ptype_map)), + .ptype_map_addr = htobe64(dma.bus_addr), + }; + + err = gve_adminq_execute_cmd(priv, &aq_cmd); + if (err) + goto err; + + /* Populate ptype_lut_dqo. */ + for (i = 0; i < GVE_NUM_PTYPES; i++) { + ptype_lut_dqo->ptypes[i].l3_type = ptype_map->ptypes[i].l3_type; + ptype_lut_dqo->ptypes[i].l4_type = ptype_map->ptypes[i].l4_type; + } +err: + gve_dma_free_coherent(&dma); + return (err); +} + int gve_adminq_alloc(struct gve_priv *priv) { @@ -543,6 +639,7 @@ gve_adminq_alloc(struct gve_priv *priv) priv->adminq_destroy_rx_queue_cnt = 0; priv->adminq_dcfg_device_resources_cnt = 0; priv->adminq_set_driver_parameter_cnt = 0; + priv->adminq_get_ptype_map_cnt = 0; gve_reg_bar_write_4(priv, GVE_REG_ADMINQ_ADDR, priv->adminq_bus_addr / ADMINQ_SIZE); @@ -772,6 +869,10 @@ gve_adminq_issue_cmd(struct gve_priv *priv, struct gve_adminq_command *cmd_orig) priv->adminq_verify_driver_compatibility_cnt++; break; + case GVE_ADMINQ_GET_PTYPE_MAP: + priv->adminq_get_ptype_map_cnt++; + break; + default: device_printf(priv->dev, "Unknown AQ command opcode %d\n", opcode); } diff --git a/sys/dev/gve/gve_adminq.h b/sys/dev/gve/gve_adminq.h index 5923e5f353d1..b5d512331d42 100644 --- a/sys/dev/gve/gve_adminq.h +++ b/sys/dev/gve/gve_adminq.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-3-Clause * - * Copyright (c) 2023 Google LLC + * Copyright (c) 2023-2024 Google LLC * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -137,9 +137,11 @@ _Static_assert(sizeof(struct gve_device_option_gqi_qpl) == 4, struct gve_device_option_dqo_rda { __be32 supported_features_mask; + __be16 tx_comp_ring_entries; + __be16 rx_buff_ring_entries; }; -_Static_assert(sizeof(struct gve_device_option_dqo_rda) == 4, +_Static_assert(sizeof(struct gve_device_option_dqo_rda) == 8, "gve: bad admin queue struct length"); struct gve_device_option_modify_ring { @@ -196,7 +198,6 @@ enum gve_driver_capability { gve_driver_capability_gqi_rda = 1, gve_driver_capability_dqo_qpl = 2, /* reserved for future use */ gve_driver_capability_dqo_rda = 3, - gve_driver_capability_alt_miss_compl = 4, }; #define GVE_CAP1(a) BIT((int) a) @@ -209,7 +210,9 @@ enum gve_driver_capability { * Only a few bits (as shown in `gve_driver_compatibility`) are currently * defined. The rest are reserved for future use. */ -#define GVE_DRIVER_CAPABILITY_FLAGS1 (GVE_CAP1(gve_driver_capability_gqi_qpl)) +#define GVE_DRIVER_CAPABILITY_FLAGS1 \ + (GVE_CAP1(gve_driver_capability_gqi_qpl) | \ + GVE_CAP1(gve_driver_capability_dqo_rda)) #define GVE_DRIVER_CAPABILITY_FLAGS2 0x0 #define GVE_DRIVER_CAPABILITY_FLAGS3 0x0 #define GVE_DRIVER_CAPABILITY_FLAGS4 0x0 @@ -282,6 +285,8 @@ struct gve_adminq_create_tx_queue { _Static_assert(sizeof(struct gve_adminq_create_tx_queue) == 48, "gve: bad admin queue struct length"); +#define GVE_RAW_ADDRESSING_QPL_ID 0xFFFFFFFF + struct gve_adminq_create_rx_queue { __be32 queue_id; __be32 index; @@ -352,6 +357,23 @@ struct stats { _Static_assert(sizeof(struct stats) == 16, "gve: bad admin queue struct length"); +/* These are control path types for PTYPE which are the same as the data path + * types. + */ +struct gve_ptype_entry { + uint8_t l3_type; + uint8_t l4_type; +}; + +struct gve_ptype_map { + struct gve_ptype_entry ptypes[1 << 10]; /* PTYPES are always 10 bits. */ +}; + +struct gve_adminq_get_ptype_map { + __be64 ptype_map_len; + __be64 ptype_map_addr; +}; + struct gve_adminq_command { __be32 opcode; __be32 status; @@ -368,6 +390,7 @@ struct gve_adminq_command { struct gve_adminq_set_driver_parameter set_driver_param; struct gve_adminq_verify_driver_compatibility verify_driver_compatibility; + struct gve_adminq_get_ptype_map get_ptype_map; uint8_t reserved[56]; }; }; @@ -375,6 +398,24 @@ struct gve_adminq_command { _Static_assert(sizeof(struct gve_adminq_command) == 64, "gve: bad admin queue struct length"); +enum gve_l3_type { + /* Must be zero so zero initialized LUT is unknown. */ + GVE_L3_TYPE_UNKNOWN = 0, + GVE_L3_TYPE_OTHER, + GVE_L3_TYPE_IPV4, + GVE_L3_TYPE_IPV6, +}; + +enum gve_l4_type { + /* Must be zero so zero initialized LUT is unknown. */ + GVE_L4_TYPE_UNKNOWN = 0, + GVE_L4_TYPE_OTHER, + GVE_L4_TYPE_TCP, + GVE_L4_TYPE_UDP, + GVE_L4_TYPE_ICMP, + GVE_L4_TYPE_SCTP, +}; + int gve_adminq_create_rx_queues(struct gve_priv *priv, uint32_t num_queues); int gve_adminq_create_tx_queues(struct gve_priv *priv, uint32_t num_queues); int gve_adminq_destroy_tx_queues(struct gve_priv *priv, uint32_t num_queues); @@ -387,8 +428,10 @@ int gve_adminq_configure_device_resources(struct gve_priv *priv); int gve_adminq_deconfigure_device_resources(struct gve_priv *priv); void gve_release_adminq(struct gve_priv *priv); int gve_adminq_register_page_list(struct gve_priv *priv, - struct gve_queue_page_list *qpl); + struct gve_queue_page_list *qpl); int gve_adminq_unregister_page_list(struct gve_priv *priv, uint32_t page_list_id); int gve_adminq_verify_driver_compatibility(struct gve_priv *priv, - uint64_t driver_info_len, vm_paddr_t driver_info_addr); + uint64_t driver_info_len, vm_paddr_t driver_info_addr); +int gve_adminq_get_ptype_map_dqo(struct gve_priv *priv, + struct gve_ptype_lut *ptype_lut); #endif /* _GVE_AQ_H_ */ diff --git a/sys/dev/gve/gve_dqo.h b/sys/dev/gve/gve_dqo.h new file mode 100644 index 000000000000..5f3f36d2245f --- /dev/null +++ b/sys/dev/gve/gve_dqo.h @@ -0,0 +1,306 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors + * may be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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. + */ + +/* GVE DQO Descriptor formats */ + +#ifndef _GVE_DESC_DQO_H_ +#define _GVE_DESC_DQO_H_ + +#include "gve_plat.h" + +#define GVE_ITR_ENABLE_BIT_DQO BIT(0) +#define GVE_ITR_NO_UPDATE_DQO (3 << 3) +#define GVE_ITR_INTERVAL_DQO_SHIFT 5 +#define GVE_ITR_INTERVAL_DQO_MASK ((1 << 12) - 1) +#define GVE_TX_IRQ_RATELIMIT_US_DQO 50 +#define GVE_RX_IRQ_RATELIMIT_US_DQO 20 + +#define GVE_TX_MAX_HDR_SIZE_DQO 255 +#define GVE_TX_MIN_TSO_MSS_DQO 88 + +/* + * Ringing the doorbell too often can hurt performance. + * + * HW requires this value to be at least 8. + */ +#define GVE_RX_BUF_THRESH_DQO 32 + +/* + * Start dropping RX fragments if at least these many + * buffers cannot be posted to the NIC. + */ +#define GVE_RX_DQO_MIN_PENDING_BUFS 32 + +/* Basic TX descriptor (DTYPE 0x0C) */ +struct gve_tx_pkt_desc_dqo { + __le64 buf_addr; + + /* Must be GVE_TX_PKT_DESC_DTYPE_DQO (0xc) */ + uint8_t dtype:5; + + /* Denotes the last descriptor of a packet. */ + uint8_t end_of_packet:1; + uint8_t checksum_offload_enable:1; + + /* If set, will generate a descriptor completion for this descriptor. */ + uint8_t report_event:1; + uint8_t reserved0; + __le16 reserved1; + + /* The TX completion for this packet will contain this tag. */ + __le16 compl_tag; + uint16_t buf_size:14; + uint16_t reserved2:2; +} __packed; +_Static_assert(sizeof(struct gve_tx_pkt_desc_dqo) == 16, + "gve: bad dqo desc struct length"); + +#define GVE_TX_PKT_DESC_DTYPE_DQO 0xc + +/* + * Maximum number of data descriptors allowed per packet, or per-TSO segment. + */ +#define GVE_TX_MAX_DATA_DESCS_DQO 10 +#define GVE_TX_MAX_BUF_SIZE_DQO ((16 * 1024) - 1) +#define GVE_TSO_MAXSIZE_DQO IP_MAXPACKET + +_Static_assert(GVE_TX_MAX_BUF_SIZE_DQO * GVE_TX_MAX_DATA_DESCS_DQO >= + GVE_TSO_MAXSIZE_DQO, + "gve: bad tso parameters"); + +/* + * "report_event" on TX packet descriptors may only be reported on the last + * descriptor of a TX packet, and they must be spaced apart with at least this + * value. + */ +#define GVE_TX_MIN_RE_INTERVAL 32 + +struct gve_tx_context_cmd_dtype { + uint8_t dtype:5; + uint8_t tso:1; + uint8_t reserved1:2; + uint8_t reserved2; +}; + +_Static_assert(sizeof(struct gve_tx_context_cmd_dtype) == 2, + "gve: bad dqo desc struct length"); + +/* + * TX Native TSO Context DTYPE (0x05) + * + * "flex" fields allow the driver to send additional packet context to HW. + */ +struct gve_tx_tso_context_desc_dqo { + /* The L4 payload bytes that should be segmented. */ + uint32_t tso_total_len:24; + uint32_t flex10:8; + + /* Max segment size in TSO excluding headers. */ + uint16_t mss:14; + uint16_t reserved:2; + + uint8_t header_len; /* Header length to use for TSO offload */ + uint8_t flex11; + struct gve_tx_context_cmd_dtype cmd_dtype; + uint8_t flex0; + uint8_t flex5; + uint8_t flex6; + uint8_t flex7; + uint8_t flex8; + uint8_t flex9; +} __packed; +_Static_assert(sizeof(struct gve_tx_tso_context_desc_dqo) == 16, + "gve: bad dqo desc struct length"); + +#define GVE_TX_TSO_CTX_DESC_DTYPE_DQO 0x5 + +/* General context descriptor for sending metadata. */ *** 2431 LINES SKIPPED *** From nobody Wed Nov 6 15:17:43 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xk82v20HJz5chX7; Wed, 06 Nov 2024 15:17: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xk82v1XMdz4GHk; Wed, 6 Nov 2024 15:17:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730906263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vJ14m3e+HhbwlgZszMX9m7VcXIpdK4BG3Mp+SRX28LE=; b=hHwKSJRMQQi4/JPxNRi+5kAi0yQ6rgbUaGByRmQulp1X64X+mB/H/OcyaLAJTmrXUXaWSz zDfduZHdwCKUmmnUNxDqEDgE2GS6Dm9YpJO27r2qDWKdcQJisJDj5dpbZyk3fhM7lDpHQm D2AJbt6GsHYua/VYrGPZMOQ3j/jmk7OWwj0sak7NNmwLtMfDGSThgWUNfiT5LdQl/Cfkn0 sH3tRTzRXq9zyPtJ4sTP83eUPRUBcXe16WnRPRK3+WmZtmHDE4OPXZk6fUPe0ZMARnixLQ m2BOY6Z32y31l72blnqCM0QXi/EEF9Lx4fC1OmD8xlj3pJs6yko6gqasJyEX+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730906263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vJ14m3e+HhbwlgZszMX9m7VcXIpdK4BG3Mp+SRX28LE=; b=NVFMla84d/N8rxe3RowDHiwqM8UClQpmzoWrQaKT8pNqDbS8eaNzT57+YNRbupN+YN50K5 KDjV24InOthT8ceIUGFTbxl21ukhLWgEWTCVXD+vZTTtgVeBkpOG6Fm6I9dQyW7sfLqaL9 +GdoGHb0ZHunOLbc1Dmdym6ixpiAGZXsmY4+BMX1JZO3S1+snmWPNDfIiKUmU2pt870SoR I8SKtdeoWlqsVgl4Ieros519z3cdAESQDxHFxpsW86bONHq/2gCFCu98MPHu40dWNzzfNW SiM32CxDLcMJmGKQSawDUB3YuO/7WWjJJbr8gBiD9ATXhxP6noL/kJk09XiNtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730906263; a=rsa-sha256; cv=none; b=sL7z5yph8NE9KxmNrezr7NjPXatCpEKQomv072CR5eAr3TyubY/y6nOGrGIr82jTCeYwrN tS+5TybCUSmXCC/dkCmLPzeJd2PPMzhbTVy1E+GRC49LYXepbMoCCIKqI/qiVb/G085eDc h8O4EIXWG+E1jg5rSCdIqrF3KpjBw5T0sq+O9/vXO6WMkvn0pADSpq2KcgOVR3x5lL8V35 vAUYDGiMoGVtPevhnfK5al8nMeQuZb8lnmGW1IRefB5WZdT8iKrYdCh+oQuq+7TDQvDHKI klHpM1rqEK6iU25synuZq3oyLF1rlBczCS4qLi5IyjrIzcU4CIg+qeEn1mlfyQ== 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 4Xk82v18Jzz15M1; Wed, 6 Nov 2024 15:17:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A6FHhmb043183; Wed, 6 Nov 2024 15:17:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A6FHhnE043180; Wed, 6 Nov 2024 15:17:43 GMT (envelope-from git) Date: Wed, 6 Nov 2024 15:17:43 GMT Message-Id: <202411061517.4A6FHhnE043180@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 2348ac893d10 - main - gve: Add DQO QPL support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 2348ac893d10f06d2d84e1e4bd5ca9f1c5da92d8 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2348ac893d10f06d2d84e1e4bd5ca9f1c5da92d8 commit 2348ac893d10f06d2d84e1e4bd5ca9f1c5da92d8 Author: Shailend Chand AuthorDate: 2024-11-05 19:38:30 +0000 Commit: Mark Johnston CommitDate: 2024-11-06 15:06:41 +0000 gve: Add DQO QPL support DQO is the descriptor format for our next generation virtual NIC. It is necessary to make full use of the hardware bandwidth on many newer GCP VM shapes. This patch extends the previously introduced DQO descriptor format with a "QPL" mode. QPL stands for Queue Page List and refers to the fact that the hardware cannot access arbitrary regions of the host memory and instead expects a fixed bounce buffer comprising of a list of pages. The QPL aspects are similar to the already existing GQI queue queue format: in that the mbufs being input in the Rx path have external storage in the form of vm pages attached to them; and in the Tx path we always copy the mbuf payload into QPL pages. Signed-off-by: Shailend Chand Reviewed-by: markj MFC-after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46691 --- share/man/man4/gve.4 | 2 + sys/dev/gve/gve.h | 101 ++++++++++- sys/dev/gve/gve_adminq.c | 38 +++- sys/dev/gve/gve_adminq.h | 14 +- sys/dev/gve/gve_dqo.h | 17 +- sys/dev/gve/gve_main.c | 20 ++- sys/dev/gve/gve_qpl.c | 32 +++- sys/dev/gve/gve_rx.c | 18 -- sys/dev/gve/gve_rx_dqo.c | 449 +++++++++++++++++++++++++++++++++++++++++++---- sys/dev/gve/gve_sysctl.c | 8 + sys/dev/gve/gve_tx.c | 5 +- sys/dev/gve/gve_tx_dqo.c | 425 ++++++++++++++++++++++++++++++++++++-------- 12 files changed, 983 insertions(+), 146 deletions(-) diff --git a/share/man/man4/gve.4 b/share/man/man4/gve.4 index d42e4ae293a7..5f58a4c1a503 100644 --- a/share/man/man4/gve.4 +++ b/share/man/man4/gve.4 @@ -239,6 +239,8 @@ The D in "DQO" refers to a newer generation of hardware, and the "QO" stands for "Queue Out-of-order" referring to the fact that the NIC might send Tx and Rx completions in an order different from the one in which the corresponding descriptors were posted by the driver. +.It +DQO_QPL: The next generation descriptor format in the "QPL" mode. .El .Sh SUPPORT Please email gvnic-drivers@google.com with the specifics of the issue encountered. diff --git a/sys/dev/gve/gve.h b/sys/dev/gve/gve.h index 98f1139c6bc2..43082d64ba95 100644 --- a/sys/dev/gve/gve.h +++ b/sys/dev/gve/gve.h @@ -105,6 +105,7 @@ enum gve_queue_format { GVE_GQI_RDA_FORMAT = 0x1, GVE_GQI_QPL_FORMAT = 0x2, GVE_DQO_RDA_FORMAT = 0x3, + GVE_DQO_QPL_FORMAT = 0x4, }; enum gve_state_flags_bit { @@ -226,6 +227,7 @@ struct gve_rxq_stats { counter_u64_t rx_frag_flip_cnt; counter_u64_t rx_frag_copy_cnt; counter_u64_t rx_dropped_pkt_desc_err; + counter_u64_t rx_dropped_pkt_buf_post_fail; counter_u64_t rx_dropped_pkt_mbuf_alloc_fail; counter_u64_t rx_mbuf_dmamap_err; counter_u64_t rx_mbuf_mclget_null; @@ -233,11 +235,34 @@ struct gve_rxq_stats { #define NUM_RX_STATS (sizeof(struct gve_rxq_stats) / sizeof(counter_u64_t)) +union gve_rx_qpl_buf_id_dqo { + struct { + uint16_t buf_id:11; /* Index into rx->dqo.bufs */ + uint8_t frag_num:5; /* Which frag in the QPL page */ + }; + uint16_t all; +} __packed; +_Static_assert(sizeof(union gve_rx_qpl_buf_id_dqo) == 2, + "gve: bad dqo qpl rx buf id length"); + struct gve_rx_buf_dqo { - struct mbuf *mbuf; - bus_dmamap_t dmamap; - uint64_t addr; - bool mapped; + union { + /* RDA */ + struct { + struct mbuf *mbuf; + bus_dmamap_t dmamap; + uint64_t addr; + bool mapped; + }; + /* QPL */ + struct { + uint8_t num_nic_frags; /* number of pending completions */ + uint8_t next_idx; /* index of the next frag to post */ + /* for chaining rx->dqo.used_bufs */ + STAILQ_ENTRY(gve_rx_buf_dqo) stailq_entry; + }; + }; + /* for chaining rx->dqo.free_bufs */ SLIST_ENTRY(gve_rx_buf_dqo) slist_entry; }; @@ -276,6 +301,13 @@ struct gve_rx_ring { uint32_t tail; /* The index at which to receive the next compl at */ uint8_t cur_gen_bit; /* Gets flipped on every cycle of the compl ring */ SLIST_HEAD(, gve_rx_buf_dqo) free_bufs; + + /* + * Only used in QPL mode. Pages refered to by if_input-ed mbufs + * stay parked here till their wire count comes back to 1. + * Pages are moved here after there aren't any pending completions. + */ + STAILQ_HEAD(, gve_rx_buf_dqo) used_bufs; } dqo; }; @@ -313,6 +345,7 @@ struct gve_txq_stats { counter_u64_t tx_dropped_pkt_nospace_bufring; counter_u64_t tx_delayed_pkt_nospace_descring; counter_u64_t tx_delayed_pkt_nospace_compring; + counter_u64_t tx_delayed_pkt_nospace_qpl_bufs; counter_u64_t tx_delayed_pkt_tsoerr; counter_u64_t tx_dropped_pkt_vlan; counter_u64_t tx_mbuf_collapse; @@ -326,7 +359,19 @@ struct gve_txq_stats { struct gve_tx_pending_pkt_dqo { struct mbuf *mbuf; - bus_dmamap_t dmamap; + union { + /* RDA */ + bus_dmamap_t dmamap; + /* QPL */ + struct { + /* + * A linked list of entries from qpl_bufs that served + * as the bounce buffer for this packet. + */ + int32_t qpl_buf_head; + uint32_t num_qpl_bufs; + }; + }; uint8_t state; /* the gve_packet_state enum */ int next; /* To chain the free_pending_pkts lists */ }; @@ -377,7 +422,20 @@ struct gve_tx_ring { */ int32_t free_pending_pkts_csm; - bus_dma_tag_t buf_dmatag; /* DMA params for mapping Tx mbufs */ + /* + * The head index of a singly linked list representing QPL page fragments + * to copy mbuf payload into for the NIC to see. Once this list is depleted, + * the "_prd" suffixed producer list, grown by the completion taskqueue, + * is stolen. + * + * Only used in QPL mode. int32_t because atomic_swap_16 doesn't exist. + */ + int32_t free_qpl_bufs_csm; + uint32_t qpl_bufs_consumed; /* Allows quickly checking for buf availability */ + uint32_t qpl_bufs_produced_cached; /* Cached value of qpl_bufs_produced */ + + /* DMA params for mapping Tx mbufs. Only used in RDA mode. */ + bus_dma_tag_t buf_dmatag; } __aligned(CACHE_LINE_SIZE); /* Accessed when processing completions */ @@ -395,6 +453,18 @@ struct gve_tx_ring { * its consumer list, with the "_csm" suffix, is depleted. */ int32_t free_pending_pkts_prd; + + /* + * The completion taskqueue moves the QPL pages corresponding to a + * completed packet into this list. It is only used in QPL mode. + * The "_prd" denotes that this is a producer list. The trasnmit + * taskqueue steals this list once its consumer list, with the "_csm" + * suffix, is depleted. + * + * Only used in QPL mode. int32_t because atomic_swap_16 doesn't exist. + */ + int32_t free_qpl_bufs_prd; + uint32_t qpl_bufs_produced; } __aligned(CACHE_LINE_SIZE); /* Accessed by both the completion and xmit loops */ @@ -402,6 +472,16 @@ struct gve_tx_ring { /* completion tags index into this array */ struct gve_tx_pending_pkt_dqo *pending_pkts; uint16_t num_pending_pkts; + + /* + * Represents QPL page fragments. An index into this array + * always represents the same QPL page fragment. The value + * is also an index into this array and servers as a means + * to chain buffers into linked lists whose heads are + * either free_qpl_bufs_prd or free_qpl_bufs_csm or + * qpl_bufs_head. + */ + int32_t *qpl_bufs; } __aligned(CACHE_LINE_SIZE); } dqo; }; @@ -531,6 +611,13 @@ gve_is_gqi(struct gve_priv *priv) return (priv->queue_format == GVE_GQI_QPL_FORMAT); } +static inline bool +gve_is_qpl(struct gve_priv *priv) +{ + return (priv->queue_format == GVE_GQI_QPL_FORMAT || + priv->queue_format == GVE_DQO_QPL_FORMAT); +} + /* Defined in gve_main.c */ void gve_schedule_reset(struct gve_priv *priv); @@ -545,6 +632,7 @@ int gve_alloc_qpls(struct gve_priv *priv); void gve_free_qpls(struct gve_priv *priv); int gve_register_qpls(struct gve_priv *priv); int gve_unregister_qpls(struct gve_priv *priv); +void gve_mextadd_free(struct mbuf *mbuf); /* TX functions defined in gve_tx.c */ int gve_alloc_tx_rings(struct gve_priv *priv); @@ -563,6 +651,7 @@ void gve_tx_free_ring_dqo(struct gve_priv *priv, int i); void gve_clear_tx_ring_dqo(struct gve_priv *priv, int i); int gve_tx_intr_dqo(void *arg); int gve_xmit_dqo(struct gve_tx_ring *tx, struct mbuf **mbuf_ptr); +int gve_xmit_dqo_qpl(struct gve_tx_ring *tx, struct mbuf *mbuf); void gve_tx_cleanup_tq_dqo(void *arg, int pending); /* RX functions defined in gve_rx.c */ diff --git a/sys/dev/gve/gve_adminq.c b/sys/dev/gve/gve_adminq.c index 7865b979888b..dd03f817f45a 100644 --- a/sys/dev/gve/gve_adminq.c +++ b/sys/dev/gve/gve_adminq.c @@ -58,6 +58,7 @@ void gve_parse_device_option(struct gve_priv *priv, struct gve_device_option *option, struct gve_device_option_gqi_qpl **dev_op_gqi_qpl, struct gve_device_option_dqo_rda **dev_op_dqo_rda, + struct gve_device_option_dqo_qpl **dev_op_dqo_qpl, struct gve_device_option_jumbo_frames **dev_op_jumbo_frames) { uint32_t req_feat_mask = be32toh(option->required_features_mask); @@ -103,6 +104,23 @@ void gve_parse_device_option(struct gve_priv *priv, *dev_op_dqo_rda = (void *)(option + 1); break; + case GVE_DEV_OPT_ID_DQO_QPL: + if (option_length < sizeof(**dev_op_dqo_qpl) || + req_feat_mask != GVE_DEV_OPT_REQ_FEAT_MASK_DQO_QPL) { + device_printf(priv->dev, GVE_DEVICE_OPTION_ERROR_FMT, + "DQO QPL", (int)sizeof(**dev_op_dqo_qpl), + GVE_DEV_OPT_REQ_FEAT_MASK_DQO_QPL, + option_length, req_feat_mask); + break; + } + + if (option_length > sizeof(**dev_op_dqo_qpl)) { + device_printf(priv->dev, GVE_DEVICE_OPTION_TOO_BIG_FMT, + "DQO QPL"); + } + *dev_op_dqo_qpl = (void *)(option + 1); + break; + case GVE_DEV_OPT_ID_JUMBO_FRAMES: if (option_length < sizeof(**dev_op_jumbo_frames) || req_feat_mask != GVE_DEV_OPT_REQ_FEAT_MASK_JUMBO_FRAMES) { @@ -136,6 +154,7 @@ gve_process_device_options(struct gve_priv *priv, struct gve_device_descriptor *descriptor, struct gve_device_option_gqi_qpl **dev_op_gqi_qpl, struct gve_device_option_dqo_rda **dev_op_dqo_rda, + struct gve_device_option_dqo_qpl **dev_op_dqo_qpl, struct gve_device_option_jumbo_frames **dev_op_jumbo_frames) { char *desc_end = (char *)descriptor + be16toh(descriptor->total_length); @@ -154,7 +173,10 @@ gve_process_device_options(struct gve_priv *priv, } gve_parse_device_option(priv, descriptor, dev_opt, - dev_op_gqi_qpl, dev_op_dqo_rda, dev_op_jumbo_frames); + dev_op_gqi_qpl, + dev_op_dqo_rda, + dev_op_dqo_qpl, + dev_op_jumbo_frames); dev_opt = (void *)((char *)(dev_opt + 1) + be16toh(dev_opt->option_length)); } @@ -387,6 +409,7 @@ gve_adminq_describe_device(struct gve_priv *priv) struct gve_dma_handle desc_mem; struct gve_device_option_gqi_qpl *dev_op_gqi_qpl = NULL; struct gve_device_option_dqo_rda *dev_op_dqo_rda = NULL; + struct gve_device_option_dqo_qpl *dev_op_dqo_qpl = NULL; struct gve_device_option_jumbo_frames *dev_op_jumbo_frames = NULL; uint32_t supported_features_mask = 0; int rc; @@ -416,7 +439,9 @@ gve_adminq_describe_device(struct gve_priv *priv) bus_dmamap_sync(desc_mem.tag, desc_mem.map, BUS_DMASYNC_POSTREAD); rc = gve_process_device_options(priv, desc, - &dev_op_gqi_qpl, &dev_op_dqo_rda, + &dev_op_gqi_qpl, + &dev_op_dqo_rda, + &dev_op_dqo_qpl, &dev_op_jumbo_frames); if (rc != 0) goto free_device_descriptor; @@ -430,6 +455,15 @@ gve_adminq_describe_device(struct gve_priv *priv) if (bootverbose) device_printf(priv->dev, "Driver is running with DQO RDA queue format.\n"); + } else if (dev_op_dqo_qpl != NULL) { + snprintf(gve_queue_format, sizeof(gve_queue_format), + "%s", "DQO QPL"); + priv->queue_format = GVE_DQO_QPL_FORMAT; + supported_features_mask = be32toh( + dev_op_dqo_qpl->supported_features_mask); + if (bootverbose) + device_printf(priv->dev, + "Driver is running with DQO QPL queue format.\n"); } else if (dev_op_gqi_qpl != NULL) { snprintf(gve_queue_format, sizeof(gve_queue_format), "%s", "GQI QPL"); diff --git a/sys/dev/gve/gve_adminq.h b/sys/dev/gve/gve_adminq.h index b5d512331d42..37a7cb3ecbb8 100644 --- a/sys/dev/gve/gve_adminq.h +++ b/sys/dev/gve/gve_adminq.h @@ -144,6 +144,15 @@ struct gve_device_option_dqo_rda { _Static_assert(sizeof(struct gve_device_option_dqo_rda) == 8, "gve: bad admin queue struct length"); +struct gve_device_option_dqo_qpl { + __be32 supported_features_mask; + __be16 tx_comp_ring_entries; + __be16 rx_buff_ring_entries; +}; + +_Static_assert(sizeof(struct gve_device_option_dqo_qpl) == 8, + "gve: bad admin queue struct length"); + struct gve_device_option_modify_ring { __be32 supported_features_mask; __be16 max_rx_ring_size; @@ -168,6 +177,7 @@ enum gve_dev_opt_id { GVE_DEV_OPT_ID_GQI_QPL = 0x3, GVE_DEV_OPT_ID_DQO_RDA = 0x4, GVE_DEV_OPT_ID_MODIFY_RING = 0x6, + GVE_DEV_OPT_ID_DQO_QPL = 0x7, GVE_DEV_OPT_ID_JUMBO_FRAMES = 0x8, }; @@ -182,6 +192,7 @@ enum gve_dev_opt_req_feat_mask { GVE_DEV_OPT_REQ_FEAT_MASK_GQI_RDA = 0x0, GVE_DEV_OPT_REQ_FEAT_MASK_GQI_QPL = 0x0, GVE_DEV_OPT_REQ_FEAT_MASK_DQO_RDA = 0x0, + GVE_DEV_OPT_REQ_FEAT_MASK_DQO_QPL = 0x0, GVE_DEV_OPT_REQ_FEAT_MASK_MODIFY_RING = 0x0, GVE_DEV_OPT_REQ_FEAT_MASK_JUMBO_FRAMES = 0x0, }; @@ -196,7 +207,7 @@ enum gve_sup_feature_mask { enum gve_driver_capability { gve_driver_capability_gqi_qpl = 0, gve_driver_capability_gqi_rda = 1, - gve_driver_capability_dqo_qpl = 2, /* reserved for future use */ + gve_driver_capability_dqo_qpl = 2, gve_driver_capability_dqo_rda = 3, }; @@ -212,6 +223,7 @@ enum gve_driver_capability { */ #define GVE_DRIVER_CAPABILITY_FLAGS1 \ (GVE_CAP1(gve_driver_capability_gqi_qpl) | \ + GVE_CAP1(gve_driver_capability_dqo_qpl) | \ GVE_CAP1(gve_driver_capability_dqo_rda)) #define GVE_DRIVER_CAPABILITY_FLAGS2 0x0 #define GVE_DRIVER_CAPABILITY_FLAGS3 0x0 diff --git a/sys/dev/gve/gve_dqo.h b/sys/dev/gve/gve_dqo.h index 5f3f36d2245f..214138303a77 100644 --- a/sys/dev/gve/gve_dqo.h +++ b/sys/dev/gve/gve_dqo.h @@ -57,7 +57,22 @@ * Start dropping RX fragments if at least these many * buffers cannot be posted to the NIC. */ -#define GVE_RX_DQO_MIN_PENDING_BUFS 32 +#define GVE_RX_DQO_MIN_PENDING_BUFS 128 + +#define GVE_DQ_NUM_FRAGS_IN_PAGE (PAGE_SIZE / GVE_DEFAULT_RX_BUFFER_SIZE) + +/* + * gve_rx_qpl_buf_id_dqo's 11 bit wide buf_id field limits the total + * number of pages per QPL to 2048. + */ +#define GVE_RX_NUM_QPL_PAGES_DQO 2048 + +/* 2K TX buffers for DQO-QPL */ +#define GVE_TX_BUF_SHIFT_DQO 11 +#define GVE_TX_BUF_SIZE_DQO BIT(GVE_TX_BUF_SHIFT_DQO) +#define GVE_TX_BUFS_PER_PAGE_DQO (PAGE_SIZE >> GVE_TX_BUF_SHIFT_DQO) + +#define GVE_TX_NUM_QPL_PAGES_DQO 512 /* Basic TX descriptor (DTYPE 0x0C) */ struct gve_tx_pkt_desc_dqo { diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c index 760e91a47472..b627c3f2b4ca 100644 --- a/sys/dev/gve/gve_main.c +++ b/sys/dev/gve/gve_main.c @@ -32,9 +32,9 @@ #include "gve_adminq.h" #include "gve_dqo.h" -#define GVE_DRIVER_VERSION "GVE-FBSD-1.2.0\n" +#define GVE_DRIVER_VERSION "GVE-FBSD-1.3.0\n" #define GVE_VERSION_MAJOR 1 -#define GVE_VERSION_MINOR 2 +#define GVE_VERSION_MINOR 3 #define GVE_VERSION_SUB 0 #define GVE_DEFAULT_RX_COPYBREAK 256 @@ -125,7 +125,7 @@ gve_up(struct gve_priv *priv) if (if_getcapenable(ifp) & IFCAP_TSO6) if_sethwassistbits(ifp, CSUM_IP6_TSO, 0); - if (gve_is_gqi(priv)) { + if (gve_is_qpl(priv)) { err = gve_register_qpls(priv); if (err != 0) goto reset; @@ -177,7 +177,7 @@ gve_down(struct gve_priv *priv) if (gve_destroy_tx_rings(priv) != 0) goto reset; - if (gve_is_gqi(priv)) { + if (gve_is_qpl(priv)) { if (gve_unregister_qpls(priv) != 0) goto reset; } @@ -375,13 +375,15 @@ gve_setup_ifnet(device_t dev, struct gve_priv *priv) /* * Set TSO limits, must match the arguments to bus_dma_tag_create - * when creating tx->dqo.buf_dmatag + * when creating tx->dqo.buf_dmatag. Only applies to the RDA mode + * because in QPL we copy the entire pakcet into the bounce buffer + * and thus it does not matter how fragmented the mbuf is. */ - if (!gve_is_gqi(priv)) { - if_sethwtsomax(ifp, GVE_TSO_MAXSIZE_DQO); + if (!gve_is_gqi(priv) && !gve_is_qpl(priv)) { if_sethwtsomaxsegcount(ifp, GVE_TX_MAX_DATA_DESCS_DQO); if_sethwtsomaxsegsize(ifp, GVE_TX_MAX_BUF_SIZE_DQO); } + if_sethwtsomax(ifp, GVE_TSO_MAXSIZE_DQO); #if __FreeBSD_version >= 1400086 if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); @@ -465,7 +467,7 @@ gve_free_rings(struct gve_priv *priv) gve_free_irqs(priv); gve_free_tx_rings(priv); gve_free_rx_rings(priv); - if (gve_is_gqi(priv)) + if (gve_is_qpl(priv)) gve_free_qpls(priv); } @@ -474,7 +476,7 @@ gve_alloc_rings(struct gve_priv *priv) { int err; - if (gve_is_gqi(priv)) { + if (gve_is_qpl(priv)) { err = gve_alloc_qpls(priv); if (err != 0) goto abort; diff --git a/sys/dev/gve/gve_qpl.c b/sys/dev/gve/gve_qpl.c index 9a946a2a2f2d..1fcc2b5365c9 100644 --- a/sys/dev/gve/gve_qpl.c +++ b/sys/dev/gve/gve_qpl.c @@ -32,13 +32,14 @@ #include "gve.h" #include "gve_adminq.h" +#include "gve_dqo.h" static MALLOC_DEFINE(M_GVE_QPL, "gve qpl", "gve qpl allocations"); static uint32_t gve_num_tx_qpls(struct gve_priv *priv) { - if (priv->queue_format != GVE_GQI_QPL_FORMAT) + if (!gve_is_qpl(priv)) return (0); return (priv->tx_cfg.max_queues); @@ -47,7 +48,7 @@ gve_num_tx_qpls(struct gve_priv *priv) static uint32_t gve_num_rx_qpls(struct gve_priv *priv) { - if (priv->queue_format != GVE_GQI_QPL_FORMAT) + if (!gve_is_qpl(priv)) return (0); return (priv->rx_cfg.max_queues); @@ -189,6 +190,7 @@ gve_free_qpls(struct gve_priv *priv) int gve_alloc_qpls(struct gve_priv *priv) { int num_qpls = gve_num_tx_qpls(priv) + gve_num_rx_qpls(priv); + int num_pages; int err; int i; @@ -198,15 +200,19 @@ int gve_alloc_qpls(struct gve_priv *priv) priv->qpls = malloc(num_qpls * sizeof(*priv->qpls), M_GVE_QPL, M_WAITOK | M_ZERO); + num_pages = gve_is_gqi(priv) ? + priv->tx_desc_cnt / GVE_QPL_DIVISOR : + GVE_TX_NUM_QPL_PAGES_DQO; for (i = 0; i < gve_num_tx_qpls(priv); i++) { - err = gve_alloc_qpl(priv, i, priv->tx_desc_cnt / GVE_QPL_DIVISOR, + err = gve_alloc_qpl(priv, i, num_pages, /*single_kva=*/true); if (err != 0) goto abort; } + num_pages = gve_is_gqi(priv) ? priv->rx_desc_cnt : GVE_RX_NUM_QPL_PAGES_DQO; for (; i < num_qpls; i++) { - err = gve_alloc_qpl(priv, i, priv->rx_desc_cnt, /*single_kva=*/false); + err = gve_alloc_qpl(priv, i, num_pages, /*single_kva=*/false); if (err != 0) goto abort; } @@ -283,3 +289,21 @@ gve_unregister_qpls(struct gve_priv *priv) gve_clear_state_flag(priv, GVE_STATE_FLAG_QPLREG_OK); return (0); } + +void +gve_mextadd_free(struct mbuf *mbuf) +{ + vm_page_t page = (vm_page_t)mbuf->m_ext.ext_arg1; + vm_offset_t va = (vm_offset_t)mbuf->m_ext.ext_arg2; + + /* + * Free the page only if this is the last ref. + * The interface might no longer exist by the time + * this callback is called, see gve_free_qpl. + */ + if (__predict_false(vm_page_unwire_noq(page))) { + pmap_qremove(va, 1); + kva_free(va, PAGE_SIZE); + vm_page_free(page); + } +} diff --git a/sys/dev/gve/gve_rx.c b/sys/dev/gve/gve_rx.c index 69bb13fc56c6..35f22f2308f0 100644 --- a/sys/dev/gve/gve_rx.c +++ b/sys/dev/gve/gve_rx.c @@ -409,24 +409,6 @@ gve_set_rss_type(__be16 flag, struct mbuf *mbuf) } } -static void -gve_mextadd_free(struct mbuf *mbuf) -{ - vm_page_t page = (vm_page_t)mbuf->m_ext.ext_arg1; - vm_offset_t va = (vm_offset_t)mbuf->m_ext.ext_arg2; - - /* - * Free the page only if this is the last ref. - * The interface might no longer exist by the time - * this callback is called, see gve_free_qpl. - */ - if (__predict_false(vm_page_unwire_noq(page))) { - pmap_qremove(va, 1); - kva_free(va, PAGE_SIZE); - vm_page_free(page); - } -} - static void gve_rx_flip_buff(struct gve_rx_slot_page_info *page_info, __be64 *slot_addr) { diff --git a/sys/dev/gve/gve_rx_dqo.c b/sys/dev/gve/gve_rx_dqo.c index b391449328e1..6c5d656aaa04 100644 --- a/sys/dev/gve/gve_rx_dqo.c +++ b/sys/dev/gve/gve_rx_dqo.c @@ -38,6 +38,9 @@ gve_free_rx_mbufs_dqo(struct gve_rx_ring *rx) struct gve_rx_buf_dqo *buf; int i; + if (gve_is_qpl(rx->com.priv)) + return; + for (i = 0; i < rx->dqo.buf_cnt; i++) { buf = &rx->dqo.bufs[i]; if (!buf->mbuf) @@ -70,7 +73,7 @@ gve_rx_free_ring_dqo(struct gve_priv *priv, int i) if (rx->dqo.bufs != NULL) { gve_free_rx_mbufs_dqo(rx); - if (rx->dqo.buf_dmatag) { + if (!gve_is_qpl(priv) && rx->dqo.buf_dmatag) { for (j = 0; j < rx->dqo.buf_cnt; j++) if (rx->dqo.bufs[j].mapped) bus_dmamap_destroy(rx->dqo.buf_dmatag, @@ -81,7 +84,7 @@ gve_rx_free_ring_dqo(struct gve_priv *priv, int i) rx->dqo.bufs = NULL; } - if (rx->dqo.buf_dmatag) + if (!gve_is_qpl(priv) && rx->dqo.buf_dmatag) bus_dma_tag_destroy(rx->dqo.buf_dmatag); } @@ -103,6 +106,31 @@ gve_rx_alloc_ring_dqo(struct gve_priv *priv, int i) rx->dqo.desc_ring = rx->desc_ring_mem.cpu_addr; rx->dqo.mask = priv->rx_desc_cnt - 1; + err = gve_dma_alloc_coherent(priv, + sizeof(struct gve_rx_compl_desc_dqo) * priv->rx_desc_cnt, + CACHE_LINE_SIZE, &rx->dqo.compl_ring_mem); + if (err != 0) { + device_printf(priv->dev, + "Failed to alloc compl ring for rx ring %d", i); + goto abort; + } + rx->dqo.compl_ring = rx->dqo.compl_ring_mem.cpu_addr; + rx->dqo.mask = priv->rx_desc_cnt - 1; + + rx->dqo.buf_cnt = gve_is_qpl(priv) ? GVE_RX_NUM_QPL_PAGES_DQO : + priv->rx_desc_cnt; + rx->dqo.bufs = malloc(rx->dqo.buf_cnt * sizeof(struct gve_rx_buf_dqo), + M_GVE, M_WAITOK | M_ZERO); + + if (gve_is_qpl(priv)) { + rx->com.qpl = &priv->qpls[priv->tx_cfg.max_queues + i]; + if (rx->com.qpl == NULL) { + device_printf(priv->dev, "No QPL left for rx ring %d", i); + return (ENOMEM); + } + return (0); + } + err = bus_dma_tag_create( bus_get_dma_tag(priv->dev), /* parent */ 1, 0, /* alignment, bounds */ @@ -123,9 +151,6 @@ gve_rx_alloc_ring_dqo(struct gve_priv *priv, int i) goto abort; } - rx->dqo.buf_cnt = priv->rx_desc_cnt; - rx->dqo.bufs = malloc(rx->dqo.buf_cnt * sizeof(struct gve_rx_buf_dqo), - M_GVE, M_WAITOK | M_ZERO); for (j = 0; j < rx->dqo.buf_cnt; j++) { err = bus_dmamap_create(rx->dqo.buf_dmatag, 0, &rx->dqo.bufs[j].dmamap); @@ -138,17 +163,6 @@ gve_rx_alloc_ring_dqo(struct gve_priv *priv, int i) rx->dqo.bufs[j].mapped = true; } - err = gve_dma_alloc_coherent(priv, - sizeof(struct gve_rx_compl_desc_dqo) * priv->rx_desc_cnt, - CACHE_LINE_SIZE, &rx->dqo.compl_ring_mem); - if (err != 0) { - device_printf(priv->dev, - "Failed to alloc compl ring for rx ring %d", i); - goto abort; - } - rx->dqo.compl_ring = rx->dqo.compl_ring_mem.cpu_addr; - rx->dqo.mask = priv->rx_desc_cnt - 1; - return (0); abort: @@ -202,10 +216,36 @@ gve_clear_rx_ring_dqo(struct gve_priv *priv, int i) gve_free_rx_mbufs_dqo(rx); - SLIST_INIT(&rx->dqo.free_bufs); - for (j = 0; j < rx->dqo.buf_cnt; j++) - SLIST_INSERT_HEAD(&rx->dqo.free_bufs, - &rx->dqo.bufs[j], slist_entry); + if (gve_is_qpl(priv)) { + SLIST_INIT(&rx->dqo.free_bufs); + STAILQ_INIT(&rx->dqo.used_bufs); + + for (j = 0; j < rx->dqo.buf_cnt; j++) { + struct gve_rx_buf_dqo *buf = &rx->dqo.bufs[j]; + + vm_page_t page = rx->com.qpl->pages[buf - rx->dqo.bufs]; + u_int ref_count = atomic_load_int(&page->ref_count); + + /* + * An ifconfig down+up might see pages still in flight + * from the previous innings. + */ + if (VPRC_WIRE_COUNT(ref_count) == 1) + SLIST_INSERT_HEAD(&rx->dqo.free_bufs, + buf, slist_entry); + else + STAILQ_INSERT_TAIL(&rx->dqo.used_bufs, + buf, stailq_entry); + + buf->num_nic_frags = 0; + buf->next_idx = 0; + } + } else { + SLIST_INIT(&rx->dqo.free_bufs); + for (j = 0; j < rx->dqo.buf_cnt; j++) + SLIST_INSERT_HEAD(&rx->dqo.free_bufs, + &rx->dqo.bufs[j], slist_entry); + } } int @@ -223,6 +263,20 @@ gve_rx_intr_dqo(void *arg) return (FILTER_HANDLED); } +static void +gve_rx_advance_head_dqo(struct gve_rx_ring *rx) +{ + rx->dqo.head = (rx->dqo.head + 1) & rx->dqo.mask; + rx->fill_cnt++; /* rx->fill_cnt is just a sysctl counter */ + + if ((rx->dqo.head & (GVE_RX_BUF_THRESH_DQO - 1)) == 0) { + bus_dmamap_sync(rx->desc_ring_mem.tag, rx->desc_ring_mem.map, + BUS_DMASYNC_PREWRITE); + gve_db_bar_dqo_write_4(rx->com.priv, rx->com.db_offset, + rx->dqo.head); + } +} + static void gve_rx_post_buf_dqo(struct gve_rx_ring *rx, struct gve_rx_buf_dqo *buf) { @@ -235,15 +289,7 @@ gve_rx_post_buf_dqo(struct gve_rx_ring *rx, struct gve_rx_buf_dqo *buf) desc->buf_id = htole16(buf - rx->dqo.bufs); desc->buf_addr = htole64(buf->addr); - rx->dqo.head = (rx->dqo.head + 1) & rx->dqo.mask; - rx->fill_cnt++; /* rx->fill_cnt is just a sysctl counter */ - - if ((rx->dqo.head & (GVE_RX_BUF_THRESH_DQO - 1)) == 0) { - bus_dmamap_sync(rx->desc_ring_mem.tag, rx->desc_ring_mem.map, - BUS_DMASYNC_PREWRITE); - gve_db_bar_dqo_write_4(rx->com.priv, rx->com.db_offset, - rx->dqo.head); - } + gve_rx_advance_head_dqo(rx); } static int @@ -294,6 +340,103 @@ abort_with_buf: return (err); } +static struct gve_dma_handle * +gve_get_page_dma_handle(struct gve_rx_ring *rx, struct gve_rx_buf_dqo *buf) +{ + return (&(rx->com.qpl->dmas[buf - rx->dqo.bufs])); +} + +static void +gve_rx_post_qpl_buf_dqo(struct gve_rx_ring *rx, struct gve_rx_buf_dqo *buf, + uint8_t frag_num) +{ + struct gve_rx_desc_dqo *desc = &rx->dqo.desc_ring[rx->dqo.head]; + union gve_rx_qpl_buf_id_dqo composed_id; + struct gve_dma_handle *page_dma_handle; + + composed_id.buf_id = buf - rx->dqo.bufs; + composed_id.frag_num = frag_num; + desc->buf_id = htole16(composed_id.all); + + page_dma_handle = gve_get_page_dma_handle(rx, buf); + bus_dmamap_sync(page_dma_handle->tag, page_dma_handle->map, + BUS_DMASYNC_PREREAD); + desc->buf_addr = htole64(page_dma_handle->bus_addr + + frag_num * GVE_DEFAULT_RX_BUFFER_SIZE); + + buf->num_nic_frags++; + gve_rx_advance_head_dqo(rx); +} + +static void +gve_rx_maybe_extract_from_used_bufs(struct gve_rx_ring *rx, bool just_one) +{ + struct gve_rx_buf_dqo *hol_blocker = NULL; + struct gve_rx_buf_dqo *buf; + u_int ref_count; + vm_page_t page; + + while (true) { + buf = STAILQ_FIRST(&rx->dqo.used_bufs); + if (__predict_false(buf == NULL)) + break; + + page = rx->com.qpl->pages[buf - rx->dqo.bufs]; + ref_count = atomic_load_int(&page->ref_count); + + if (VPRC_WIRE_COUNT(ref_count) != 1) { + /* Account for one head-of-line blocker */ + if (hol_blocker != NULL) + break; + hol_blocker = buf; + STAILQ_REMOVE_HEAD(&rx->dqo.used_bufs, + stailq_entry); + continue; + } + + STAILQ_REMOVE_HEAD(&rx->dqo.used_bufs, + stailq_entry); + SLIST_INSERT_HEAD(&rx->dqo.free_bufs, + buf, slist_entry); + if (just_one) + break; + } + + if (hol_blocker != NULL) + STAILQ_INSERT_HEAD(&rx->dqo.used_bufs, + hol_blocker, stailq_entry); +} + +static int +gve_rx_post_new_dqo_qpl_buf(struct gve_rx_ring *rx) +{ + struct gve_rx_buf_dqo *buf; + + buf = SLIST_FIRST(&rx->dqo.free_bufs); + if (__predict_false(buf == NULL)) { + gve_rx_maybe_extract_from_used_bufs(rx, /*just_one=*/true); + buf = SLIST_FIRST(&rx->dqo.free_bufs); + if (__predict_false(buf == NULL)) + return (ENOBUFS); + } + + gve_rx_post_qpl_buf_dqo(rx, buf, buf->next_idx); + if (buf->next_idx == GVE_DQ_NUM_FRAGS_IN_PAGE - 1) + buf->next_idx = 0; + else + buf->next_idx++; + + /* + * We have posted all the frags in this buf to the NIC. + * - buf will enter used_bufs once the last completion arrives. + * - It will renter free_bufs in gve_rx_maybe_extract_from_used_bufs + * when its wire count drops back to 1. + */ + if (buf->next_idx == 0) + SLIST_REMOVE_HEAD(&rx->dqo.free_bufs, slist_entry); + return (0); +} + static void gve_rx_post_buffers_dqo(struct gve_rx_ring *rx, int how) { @@ -306,7 +449,10 @@ gve_rx_post_buffers_dqo(struct gve_rx_ring *rx, int how) num_to_post = rx->dqo.mask - num_pending_bufs; for (i = 0; i < num_to_post; i++) { - err = gve_rx_post_new_mbuf_dqo(rx, how); + if (gve_is_qpl(rx->com.priv)) + err = gve_rx_post_new_dqo_qpl_buf(rx); + else + err = gve_rx_post_new_mbuf_dqo(rx, how); if (err) break; } @@ -427,7 +573,7 @@ gve_rx_input_mbuf_dqo(struct gve_rx_ring *rx, } static int -gve_rx_copybreak_dqo(struct gve_rx_ring *rx, struct gve_rx_buf_dqo *buf, +gve_rx_copybreak_dqo(struct gve_rx_ring *rx, void *va, struct gve_rx_compl_desc_dqo *compl_desc, uint16_t frag_len) { struct mbuf *mbuf; @@ -440,14 +586,13 @@ gve_rx_copybreak_dqo(struct gve_rx_ring *rx, struct gve_rx_buf_dqo *buf, counter_u64_add_protected(rx->stats.rx_copybreak_cnt, 1); counter_exit(); - m_copyback(mbuf, 0, frag_len, mtod(buf->mbuf, char*)); + m_copyback(mbuf, 0, frag_len, va); mbuf->m_len = frag_len; rx->ctx.mbuf_head = mbuf; rx->ctx.mbuf_tail = mbuf; rx->ctx.total_size += frag_len; - gve_rx_post_buf_dqo(rx, buf); gve_rx_input_mbuf_dqo(rx, compl_desc); return (0); } @@ -495,10 +640,12 @@ gve_rx_dqo(struct gve_priv *priv, struct gve_rx_ring *rx, frag_len = compl_desc->packet_len; if (frag_len <= priv->rx_copybreak && !ctx->mbuf_head && is_last_frag) { - err = gve_rx_copybreak_dqo(rx, buf, compl_desc, frag_len); + err = gve_rx_copybreak_dqo(rx, mtod(buf->mbuf, char*), + compl_desc, frag_len); if (__predict_false(err != 0)) goto drop_frag; (*work_done)++; + gve_rx_post_buf_dqo(rx, buf); return; } @@ -579,6 +726,233 @@ drop_frag_clear_ctx: rx->ctx = (struct gve_rx_ctx){}; } +static void * +gve_get_cpu_addr_for_qpl_buf(struct gve_rx_ring *rx, + struct gve_rx_buf_dqo *buf, uint8_t buf_frag_num) +{ + int page_idx = buf - rx->dqo.bufs; + void *va = rx->com.qpl->dmas[page_idx].cpu_addr; + + va = (char *)va + (buf_frag_num * GVE_DEFAULT_RX_BUFFER_SIZE); + return (va); +} + +static int +gve_rx_add_clmbuf_to_ctx(struct gve_rx_ring *rx, + struct gve_rx_ctx *ctx, struct gve_rx_buf_dqo *buf, + uint8_t buf_frag_num, uint16_t frag_len) +{ + void *va = gve_get_cpu_addr_for_qpl_buf(rx, buf, buf_frag_num); + struct mbuf *mbuf; + + if (ctx->mbuf_tail == NULL) { + mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + if (mbuf == NULL) + return (ENOMEM); + ctx->mbuf_head = mbuf; + ctx->mbuf_tail = mbuf; + } else { + mbuf = m_getcl(M_NOWAIT, MT_DATA, 0); + if (mbuf == NULL) + return (ENOMEM); + ctx->mbuf_tail->m_next = mbuf; + ctx->mbuf_tail = mbuf; + } + + mbuf->m_len = frag_len; + ctx->total_size += frag_len; + + m_copyback(mbuf, 0, frag_len, va); + counter_enter(); + counter_u64_add_protected(rx->stats.rx_frag_copy_cnt, 1); + counter_exit(); + return (0); +} + +static int +gve_rx_add_extmbuf_to_ctx(struct gve_rx_ring *rx, + struct gve_rx_ctx *ctx, struct gve_rx_buf_dqo *buf, + uint8_t buf_frag_num, uint16_t frag_len) +{ + struct mbuf *mbuf; + void *page_addr; + vm_page_t page; + int page_idx; + void *va; + + if (ctx->mbuf_tail == NULL) { *** 763 LINES SKIPPED *** From nobody Wed Nov 6 15:17:44 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xk82w3h0lz5chXB; Wed, 06 Nov 2024 15:17: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xk82w2vCCz4G91; Wed, 6 Nov 2024 15:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730906264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u27AYmrMYypEH4uRfkEjm05BvsYHINmGR0V0kbzgnTU=; b=OdZXC81OmEMeZwCvBVKoEdSXvhjNEI+eZA45ClRBqwrrGU5g78crVJVO/aW3wVFB5Ymd07 F313QBdg94P8iKq01yX0F77mlA9ztcX9M8EASEKEFMpiusd0QB10KX8hKu6vkr0YGPxAd3 DVG4dLku+5DdB1NA29rA48zg6myJY7WkXg44X1NKfIdNhQjnM1aJ/wQHr9aHKTE/7dGXuF sJ/9HTrevqB4hfnm7ejgXCG+RLHKdRpINOfVKalblEW38jvBK3F511WfvZiRaHG9Vmv+vE FDRxfPo8vjSakIN+AM8+4f8kG1wtydhNnSwnFk8qa+fsgjWs+HijvXEfeujxPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730906264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u27AYmrMYypEH4uRfkEjm05BvsYHINmGR0V0kbzgnTU=; b=mNSPZK7Dt0GMElTgRHHDT7CsQrYCG1BQExQ96+K3MJXhdjqV+gz+13T1Ig7pd1NNQCCv2Q j97l0GzC8xO1wKEPLZERCREG4i31MXChZAI7zZMpRgH7QxZWT9I8EsYDuL42j7w/B45qkl CEY4BPR0WLxhiYIDVDxlra7bpBCCOebG63DnRzfqwFLE/pFXI/+R3qYU+P9ecPu62R9JM8 ZdDZBsfCjtKSx0hPTpP5gJ+Ok3N7M/idN7nIWR1QJn02rgKD3wt78FuCzc5OX+xnHordLk k6tqqebQXkHc1i0bPX7TyOBwJCmnxG3lzsP5PjVA/MYWLUcObeQv2KuUXqcD0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730906264; a=rsa-sha256; cv=none; b=AkcNZPwmkLY7SLVfhRS789SAtXtz0PAHTeRfokThK5XP6v15X+/6/3Da1vPLAnkj8kw0Xh BfWLmAHOQrLtHK1hOSN9ReYf/XLPqCFKkUEMrZxwvtWGDN/lcG9E3NsuY3L9Ci8sgsYI2S pfBhDObjGLpzguRFqfKIt4l9cDet/HAH5Hd73NRjxV5+skM+/cslBXAUA3TUxFSaBeqcW7 lnUNe4XdtPFGV2Wpv3P8iOQrs3+kiwkiS3hQy2GreMozxPktEzXYrQFcEZhPthaJeGkzdq FKvX5jbkY205WG+/S2OqTe1kP6jIulYpLFZDchl5E1IXk/thIfChC7TdDhFpEw== 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 4Xk82w27k4z14t2; Wed, 6 Nov 2024 15:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A6FHiRu043223; Wed, 6 Nov 2024 15:17:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A6FHinD043220; Wed, 6 Nov 2024 15:17:44 GMT (envelope-from git) Date: Wed, 6 Nov 2024 15:17:44 GMT Message-Id: <202411061517.4A6FHinD043220@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 40097cd67c0d - main - gve: Fix TX livelock List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 40097cd67c0d52e2b288e8555b12faf02768d89c Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=40097cd67c0d52e2b288e8555b12faf02768d89c commit 40097cd67c0d52e2b288e8555b12faf02768d89c Author: Shailend Chand AuthorDate: 2024-11-05 19:38:31 +0000 Commit: Mark Johnston CommitDate: 2024-11-06 15:06:41 +0000 gve: Fix TX livelock Before this change the transmit taskqueue would enqueue itself when it cannot find space on the NIC ring with the hope that eventually space would be made. This results in the following livelock that only occurs after passing ~200Gbps of TCP traffic for many hours: 100% CPU ┌───────────┐wait on ┌──────────┐ ┌───────────┐ │user thread│ cpu │gve xmit │wait on │gve cleanup│ │with mbuf ├────────►│taskqueue ├────────►│taskqueue │ │uma lock │ │ │ NIC ring│ │ └───────────┘ └──────────┘ space └─────┬─────┘ ▲ │ │ wait on mbuf uma lock │ └───────────────────────────────────────────┘ Further details about the livelock are available on https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281560. After this change, the transmit taskqueue no longer spins till there is room on the NIC ring. It instead stops itself and lets the completion-processing taskqueue wake it up. Since I'm touching the trasnmit taskqueue I've also corrected the name of a counter and also fixed a bug where EINVAL mbufs were not being freed and were instead living forever on the bufring. Signed-off-by: Shailend Chand Reviewed-by: markj MFC-after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47138 --- sys/dev/gve/gve.h | 3 +- sys/dev/gve/gve_main.c | 4 +- sys/dev/gve/gve_sysctl.c | 6 +-- sys/dev/gve/gve_tx.c | 98 ++++++++++++++++++++++++++++++++++++++---------- sys/dev/gve/gve_tx_dqo.c | 10 +++++ 5 files changed, 95 insertions(+), 26 deletions(-) diff --git a/sys/dev/gve/gve.h b/sys/dev/gve/gve.h index 43082d64ba95..92ab6838d5bb 100644 --- a/sys/dev/gve/gve.h +++ b/sys/dev/gve/gve.h @@ -341,7 +341,7 @@ struct gve_txq_stats { counter_u64_t tpackets; counter_u64_t tso_packet_cnt; counter_u64_t tx_dropped_pkt; - counter_u64_t tx_dropped_pkt_nospace_device; + counter_u64_t tx_delayed_pkt_nospace_device; counter_u64_t tx_dropped_pkt_nospace_bufring; counter_u64_t tx_delayed_pkt_nospace_descring; counter_u64_t tx_delayed_pkt_nospace_compring; @@ -383,6 +383,7 @@ struct gve_tx_ring { struct task xmit_task; struct taskqueue *xmit_tq; + bool stopped; /* Accessed when writing descriptors */ struct buf_ring *br; diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c index b627c3f2b4ca..0e40656ca928 100644 --- a/sys/dev/gve/gve_main.c +++ b/sys/dev/gve/gve_main.c @@ -32,10 +32,10 @@ #include "gve_adminq.h" #include "gve_dqo.h" -#define GVE_DRIVER_VERSION "GVE-FBSD-1.3.0\n" +#define GVE_DRIVER_VERSION "GVE-FBSD-1.3.1\n" #define GVE_VERSION_MAJOR 1 #define GVE_VERSION_MINOR 3 -#define GVE_VERSION_SUB 0 +#define GVE_VERSION_SUB 1 #define GVE_DEFAULT_RX_COPYBREAK 256 diff --git a/sys/dev/gve/gve_sysctl.c b/sys/dev/gve/gve_sysctl.c index b9f2eefa5bb0..7a091d9caa43 100644 --- a/sys/dev/gve/gve_sysctl.c +++ b/sys/dev/gve/gve_sysctl.c @@ -140,9 +140,9 @@ gve_setup_txq_sysctl(struct sysctl_ctx_list *ctx, "tx_bytes", CTLFLAG_RD, &stats->tbytes, "Bytes transmitted"); SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, - "tx_dropped_pkt_nospace_device", CTLFLAG_RD, - &stats->tx_dropped_pkt_nospace_device, - "Packets dropped due to no space in device"); + "tx_delayed_pkt_nospace_device", CTLFLAG_RD, + &stats->tx_delayed_pkt_nospace_device, + "Packets delayed due to no space in device"); SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, "tx_dropped_pkt_nospace_bufring", CTLFLAG_RD, &stats->tx_dropped_pkt_nospace_bufring, diff --git a/sys/dev/gve/gve_tx.c b/sys/dev/gve/gve_tx.c index 60a54878b685..e7e10e526cb9 100644 --- a/sys/dev/gve/gve_tx.c +++ b/sys/dev/gve/gve_tx.c @@ -246,6 +246,8 @@ gve_start_tx_ring(struct gve_priv *priv, int i, struct gve_tx_ring *tx = &priv->tx[i]; struct gve_ring_com *com = &tx->com; + atomic_store_bool(&tx->stopped, false); + NET_TASK_INIT(&com->cleanup_task, 0, cleanup, tx); com->cleanup_tq = taskqueue_create_fast("gve tx", M_WAITOK, taskqueue_thread_enqueue, &com->cleanup_tq); @@ -427,6 +429,11 @@ gve_tx_cleanup_tq(void *arg, int pending) gve_db_bar_write_4(priv, tx->com.irq_db_offset, GVE_IRQ_MASK); taskqueue_enqueue(tx->com.cleanup_tq, &tx->com.cleanup_task); } + + if (atomic_load_bool(&tx->stopped) && space_freed) { + atomic_store_bool(&tx->stopped, false); + taskqueue_enqueue(tx->xmit_tq, &tx->xmit_task); + } } static void @@ -671,8 +678,7 @@ gve_xmit(struct gve_tx_ring *tx, struct mbuf *mbuf) bytes_required = gve_fifo_bytes_required(tx, first_seg_len, pkt_len); if (__predict_false(!gve_can_tx(tx, bytes_required))) { counter_enter(); - counter_u64_add_protected(tx->stats.tx_dropped_pkt_nospace_device, 1); - counter_u64_add_protected(tx->stats.tx_dropped_pkt, 1); + counter_u64_add_protected(tx->stats.tx_delayed_pkt_nospace_device, 1); counter_exit(); return (ENOBUFS); } @@ -733,6 +739,59 @@ gve_xmit(struct gve_tx_ring *tx, struct mbuf *mbuf) return (0); } +static int +gve_xmit_mbuf(struct gve_tx_ring *tx, + struct mbuf **mbuf) +{ + if (gve_is_gqi(tx->com.priv)) + return (gve_xmit(tx, *mbuf)); + + if (gve_is_qpl(tx->com.priv)) + return (gve_xmit_dqo_qpl(tx, *mbuf)); + + /* + * gve_xmit_dqo might attempt to defrag the mbuf chain. + * The reference is passed in so that in the case of + * errors, the new mbuf chain is what's put back on the br. + */ + return (gve_xmit_dqo(tx, mbuf)); +} + +/* + * Has the side-effect of stopping the xmit queue by setting tx->stopped + */ +static int +gve_xmit_retry_enobuf_mbuf(struct gve_tx_ring *tx, + struct mbuf **mbuf) +{ + int err; + + atomic_store_bool(&tx->stopped, true); + + /* + * Room made in the queue BEFORE the barrier will be seen by the + * gve_xmit_mbuf retry below. + * + * If room is made in the queue AFTER the barrier, the cleanup tq + * iteration creating the room will either see a tx->stopped value + * of 0 or the 1 we just wrote: + * + * If it sees a 1, then it would enqueue the xmit tq. Enqueue + * implies a retry on the waiting pkt. + * + * If it sees a 0, then that implies a previous iteration overwrote + * our 1, and that iteration would enqueue the xmit tq. Enqueue + * implies a retry on the waiting pkt. + */ + atomic_thread_fence_seq_cst(); + + err = gve_xmit_mbuf(tx, mbuf); + if (err == 0) + atomic_store_bool(&tx->stopped, false); + + return (err); +} + static void gve_xmit_br(struct gve_tx_ring *tx) { @@ -743,24 +802,23 @@ gve_xmit_br(struct gve_tx_ring *tx) while ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0 && (mbuf = drbr_peek(ifp, tx->br)) != NULL) { + err = gve_xmit_mbuf(tx, &mbuf); - if (gve_is_gqi(priv)) - err = gve_xmit(tx, mbuf); - else { - /* - * gve_xmit_dqo might attempt to defrag the mbuf chain. - * The reference is passed in so that in the case of - * errors, the new mbuf chain is what's put back on the br. - */ - if (gve_is_qpl(priv)) - err = gve_xmit_dqo_qpl(tx, mbuf); - else - err = gve_xmit_dqo(tx, &mbuf); - } + /* + * We need to stop this taskqueue when we can't xmit the pkt due + * to lack of space in the NIC ring (ENOBUFS). The retry exists + * to guard against a TOCTTOU bug that could end up freezing the + * queue forever. + */ + if (__predict_false(mbuf != NULL && err == ENOBUFS)) + err = gve_xmit_retry_enobuf_mbuf(tx, &mbuf); if (__predict_false(err != 0 && mbuf != NULL)) { - drbr_putback(ifp, tx->br, mbuf); - taskqueue_enqueue(tx->xmit_tq, &tx->xmit_task); + if (err == EINVAL) { + drbr_advance(ifp, tx->br); + m_freem(mbuf); + } else + drbr_putback(ifp, tx->br, mbuf); break; } @@ -827,7 +885,8 @@ gve_xmit_ifp(if_t ifp, struct mbuf *mbuf) is_br_empty = drbr_empty(ifp, tx->br); err = drbr_enqueue(ifp, tx->br, mbuf); if (__predict_false(err != 0)) { - taskqueue_enqueue(tx->xmit_tq, &tx->xmit_task); + if (!atomic_load_bool(&tx->stopped)) + taskqueue_enqueue(tx->xmit_tq, &tx->xmit_task); counter_enter(); counter_u64_add_protected(tx->stats.tx_dropped_pkt_nospace_bufring, 1); counter_u64_add_protected(tx->stats.tx_dropped_pkt, 1); @@ -842,9 +901,8 @@ gve_xmit_ifp(if_t ifp, struct mbuf *mbuf) if (is_br_empty && (GVE_RING_TRYLOCK(tx) != 0)) { gve_xmit_br(tx); GVE_RING_UNLOCK(tx); - } else { + } else if (!atomic_load_bool(&tx->stopped)) taskqueue_enqueue(tx->xmit_tq, &tx->xmit_task); - } return (0); } diff --git a/sys/dev/gve/gve_tx_dqo.c b/sys/dev/gve/gve_tx_dqo.c index 323c032a3e65..fab2d6d0f613 100644 --- a/sys/dev/gve/gve_tx_dqo.c +++ b/sys/dev/gve/gve_tx_dqo.c @@ -1052,6 +1052,16 @@ gve_tx_cleanup_dqo(struct gve_priv *priv, struct gve_tx_ring *tx, int budget) work_done++; } + /* + * Waking the xmit taskqueue has to occur after room has been made in + * the queue. + */ + atomic_thread_fence_seq_cst(); + if (atomic_load_bool(&tx->stopped) && work_done) { + atomic_store_bool(&tx->stopped, false); + taskqueue_enqueue(tx->xmit_tq, &tx->xmit_task); + } + tx->done += work_done; /* tx->done is just a sysctl counter */ counter_enter(); counter_u64_add_protected(tx->stats.tbytes, bytes_done); From nobody Wed Nov 6 18:02:59 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkCjb2dWcz1GnmF; Wed, 06 Nov 2024 18:02: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkCjb1w80z4k0p; Wed, 6 Nov 2024 18:02:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730916179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7hT2HwKvYjj7gQXIID3cesUgxz3Vh5T6kmOXcK4mZaY=; b=adljFiHqBT9lco+x3G/0WZhtIYTurUINAnk+2sa/s39QPRCpCZkcqksGMbqoNoGln9Lb1Y pT4RD6rRQBQLp1ioKoW4igfu8LWSY0Vzedg6Kb7wwLISx3Fb0wi2WP2Gn9EAvcD7mTYB1z KdDzJTQ2Mfv/TLYG7yvY/7B66CuY8o3ESHp9dmYqJMEQBCvAw+/uIakjQTDL62MYWPMm2d hO7ZTa8Xrwwb+GtU/W7NZlA7EYWEkyQkTe3zCRhx5azLN5IW2IuL5CSGFdJTIgX8C30JSV DuHvLEHqwID1hxQqFnydlipZ2WBo8nD4DzyKJyx+d6MnprYAQCDvBq9rJe9LoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730916179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7hT2HwKvYjj7gQXIID3cesUgxz3Vh5T6kmOXcK4mZaY=; b=fiK6DyYnO9gLntNTCmkCIb+qM/8dvBjQDk804PPhTWwFcnICeHisKGySHXowYW7IZhYibM 4X6x0Q9C8gNBWSeWSsxw3yIw5f8VKXEoDMuYKTpF7OlOXhO9YmCVcfT8dcuTyOzEhdVGMv oo9Bybv/B2fx+6BbUpwngK5IAiFcvJZWLwicIP2krqr/qHZopTRmEHfu63ARzbKeiH6zsx MtmcUIL6zUSXA6b6uVYW1PBDZ8XBnrEMY48b4VnGe35XqnuixinOoktN9e03gxKrbNcfGO 8/4GsjhFfANlcj8+ibpHtcDjwekJ7haJzHU9rGBQJXhE2n0SoMfSkF3kYo4xqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730916179; a=rsa-sha256; cv=none; b=fC4vv7Bo/6HPuJIj199BLlV6TREU5GGze+/7oM8LkYEQ3aWkzctk8s+AcOkFBJ3Ju1PsjR VNOggTCn6IF8idPNZbq6PKCgI6zsTi/NRJvjsK1wfUQV+3H3yX1fhXkvTOCX/DMABATBRD QuRXQsbvsca/Q+2cFfSZkDPI2plLvx3KkUaSlzy90G96pdxR4HHOyNRsjKopFxvSeazclU WPRWZR4WFLDlu0c7oTd4dtLM+tuIZwl4jauRmA14KIWSrIWpssCc8r/Ylvhnr5Ggm0nSca M8aEVG8W+KF4cMEoXww8jvCTxP2tVD0KcAKmH/xZWie35XtYNFx5NXnVfNdb1w== 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 4XkCjb16gjz19W0; Wed, 6 Nov 2024 18:02:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A6I2xpD059242; Wed, 6 Nov 2024 18:02:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A6I2x1c059239; Wed, 6 Nov 2024 18:02:59 GMT (envelope-from git) Date: Wed, 6 Nov 2024 18:02:59 GMT Message-Id: <202411061802.4A6I2x1c059239@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: a4e64fcd6808 - main - pf tests: test kill and clear source nodes paths List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: a4e64fcd6808f638ce938ed028716a5c87b75dae Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a4e64fcd6808f638ce938ed028716a5c87b75dae commit a4e64fcd6808f638ce938ed028716a5c87b75dae Author: Kristof Provost AuthorDate: 2024-11-06 14:28:31 +0000 Commit: Kristof Provost CommitDate: 2024-11-06 18:02:03 +0000 pf tests: test kill and clear source nodes paths Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/src_track.sh | 70 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/tests/sys/netpfil/pf/src_track.sh b/tests/sys/netpfil/pf/src_track.sh index 2038393a240e..9d0ca690d344 100755 --- a/tests/sys/netpfil/pf/src_track.sh +++ b/tests/sys/netpfil/pf/src_track.sh @@ -52,7 +52,19 @@ source_track_body() "pass out keep state (source-track)" ping -c 3 192.0.2.1 - jexec alcatraz pfctl -s all -v + atf_check -s exit:0 -o match:'192.0.2.2 -> 0.0.0.0 \( states 1,.*' \ + jexec alcatraz pfctl -sS + + # Flush all source nodes + jexec alcatraz pfctl -FS + + # We can't find the previous source node any more + atf_check -s exit:0 -o not-match:'192.0.2.2 -> 0.0.0.0 \( states 1,.*' \ + jexec alcatraz pfctl -sS + + # But we still have the state + atf_check -s exit:0 -o match:'all icmp 192.0.2.1:8 <- 192.0.2.2:.*' \ + jexec alcatraz pfctl -ss } source_track_cleanup() @@ -60,6 +72,61 @@ source_track_cleanup() pft_cleanup } +atf_test_case "kill" "cleanup" +kill_head() +{ + atf_set descr 'Test killing source nodes' + atf_set require.user root +} + +kill_body() +{ + pft_init + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}b + + ifconfig ${epair}a 192.0.2.2/24 up + ifconfig ${epair}a inet alias 192.0.2.3/24 up + jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up + + # Enable pf! + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "pass in keep state (source-track)" \ + "pass out keep state (source-track)" + + # Establish two sources + atf_check -s exit:0 -o ignore \ + ping -c 1 -S 192.0.2.2 192.0.2.1 + atf_check -s exit:0 -o ignore \ + ping -c 1 -S 192.0.2.3 192.0.2.1 + + # Check that both source nodes exist + atf_check -s exit:0 -o match:'192.0.2.2 -> 0.0.0.0 \( states 1,.*' \ + jexec alcatraz pfctl -sS + atf_check -s exit:0 -o match:'192.0.2.3 -> 0.0.0.0 \( states 1,.*' \ + jexec alcatraz pfctl -sS + + +jexec alcatraz pfctl -sS + + # Kill the 192.0.2.2 source + jexec alcatraz pfctl -K 192.0.2.2 + + # The other source still exists + atf_check -s exit:0 -o match:'192.0.2.3 -> 0.0.0.0 \( states 1,.*' \ + jexec alcatraz pfctl -sS + + # But not the one we killed + atf_check -s exit:0 -o not-match:'192.0.2.2 -> 0.0.0.0 \( states 1,.*' \ + jexec alcatraz pfctl -sS +} + +kill_cleanup() +{ + pft_cleanup +} max_src_conn_rule_head() { @@ -188,6 +255,7 @@ max_src_states_rule_cleanup() atf_init_test_cases() { atf_add_test_case "source_track" + atf_add_test_case "kill" atf_add_test_case "max_src_conn_rule" atf_add_test_case "max_src_states_rule" } From nobody Wed Nov 6 18:03:00 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkCjc3GPhz1GnJv; Wed, 06 Nov 2024 18: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkCjc27skz4kBX; Wed, 6 Nov 2024 18:03:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730916180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vKU+SWVV/mn5dKWHREN4yJkJoTpoDfIFIiDDpd4L2Z8=; b=eYB3+71TaVz37adTlFwHJwYEmuHHtPEvyI8hRSqgfQOqVuYGw3Q+7dEcasXezhUvUzzqYc r4I+bkJyac96MmPTbudBbqgOmCDCT874YeigbSXLhTJz0ZI2DBVvi7WR3CErY0is3UYTHh wwBWmBDrO+A5Dj1b55JaLtusLKBdlke4GMaD64/Gw+NvrOLGZ8DfazD4Z9niNJdUhVf6dR Ftv9/r4Q9bE1OGGh76bVONUahNU4w8KSvKVlLMR5TwCOOKyZQEKVQlN3cEQ9rm1T0pyJjh CVavFgqcqdUT4yGk8FTtMOCBo+Zika3yV7hV8il4BGhVJWKMiQ4ZvXnxidcmug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730916180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vKU+SWVV/mn5dKWHREN4yJkJoTpoDfIFIiDDpd4L2Z8=; b=TPpHspy/s32hIxz21XRCaDU7ys2rGfSXXTcG7CJdV0EnmZtnS/YzxfQO+UD+fhqeyy1TkH fwKgMXnjVjs23cx8H16Wt4UsqpFHMlbnDQRG98uD+GeMrd8VhLMBJw6Sr6tAr0CtkfAIs/ 45F+U1L0DArNRZaIeMyVqdUMSvkIk1C6QnmCsVeqImql4qtdKcjrWw2L1KPy2K3rLDKE79 xfCVRMm0mdZYY245CbaXigUmeTWYVEkUIONj1UV7O0Bz+5sKZvE2tInZQM5yuln4CrbebG Vxq67rbGI+ecY+n3I3jMQFp8htG6fhOHjCqPBk/JXwaK3DUKq4dhZatfPFpfmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730916180; a=rsa-sha256; cv=none; b=FqOTjGRkbMY6npjKcp5J/Hki22Mdx1bmen9odkFrhIyMhtwDDn3L0xgDKDQAHLaLLhopfs gnLVzDj7urISRMSLgNhvNAEYctfAmX3WRLWWrPM4hgcqAi5KN3Lv5L7z5/nNWrhqUxh9dO R2TJEAuYIMsGXM+TGGwvA+iyOkRY9I9Jmzgt0g6OhuNH6s6U6XxVlijx0iiMvXEMH5WAWT Zq+buEdgEQDl0cSvSj9Su6WsOrkf/6cMSQtqXYqxZ78UTNe136M/BCRvqEsGpy6WJXCtDH 1Oizg4KrDviR5nGuylBSYTKOn/CDSzY/P3AprhVWPGmMtbbgE+wa1nw675Jo2A== 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 4XkCjc1l1fz19qQ; Wed, 6 Nov 2024 18:03:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A6I30ZY059298; Wed, 6 Nov 2024 18:03:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A6I30uv059295; Wed, 6 Nov 2024 18:03:00 GMT (envelope-from git) Date: Wed, 6 Nov 2024 18:03:00 GMT Message-Id: <202411061803.4A6I30uv059295@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 609fa228bae6 - main - pft_ping: improve IPv6 address comparison List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 609fa228bae6d864558f5167d4a964aab2a5fc88 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=609fa228bae6d864558f5167d4a964aab2a5fc88 commit 609fa228bae6d864558f5167d4a964aab2a5fc88 Author: Kristof Provost AuthorDate: 2024-10-28 13:54:50 +0000 Commit: Kristof Provost CommitDate: 2024-11-06 18:02:04 +0000 pft_ping: improve IPv6 address comparison Don't use string comparisons, use socket.inet_pton() instead. This avoids confusion when there are different ways to spell the same IP addres. e.g. 64:ff9b::c000:202 and 64:ff9b::192.0.2.2 are two representations of the same address. Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/common/pft_ping.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/sys/netpfil/common/pft_ping.py b/tests/sys/netpfil/common/pft_ping.py index 0d1134a22dda..a2a1d9c7f4ec 100644 --- a/tests/sys/netpfil/common/pft_ping.py +++ b/tests/sys/netpfil/common/pft_ping.py @@ -33,6 +33,7 @@ logging.getLogger("scapy").setLevel(logging.CRITICAL) import math import scapy.all as sp import sys +import socket from copy import copy from sniffer import Sniffer @@ -227,10 +228,12 @@ def check_ipv6(expect_params, packet): if not ip6: LOGGER.debug('Packet is not IPv6!') return False - if src_address and ip6.src != src_address: + if src_address and socket.inet_pton(socket.AF_INET6, ip6.src) != \ + socket.inet_pton(socket.AF_INET6, src_address): LOGGER.debug(f'Wrong IPv6 source {ip6.src}, expected {src_address}') return False - if dst_address and ip6.dst != dst_address: + if dst_address and socket.inet_pton(socket.AF_INET6, ip6.dst) != \ + socket.inet_pton(socket.AF_INET6, dst_address): LOGGER.debug(f'Wrong IPv6 destination {ip6.dst}, expected {dst_address}') return False # IPv6 has no IP-level checksum. From nobody Wed Nov 6 21:59:50 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkJzB3Y65z5btcl for ; Wed, 06 Nov 2024 22:00:06 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkJz94jYFz4DZ4 for ; Wed, 6 Nov 2024 22:00:04 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.44 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none) Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-37d49ffaba6so161135f8f.0 for ; Wed, 06 Nov 2024 14:00:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730930402; x=1731535202; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fGoL0yajA4BHCKT4ZtV51wlk4vOmA/Qw6bpf76MwgzI=; b=uWU0DZ6eSBgPztH+R1DKoVvIenpnSOCu2rBkMht9N1yLwLHaEw4M4DwS8Y69DD+aGR A5eM/5UGHz2jRsLSPYkK3eCDCQmtrCgYp92GezjIWyDg/FfeRmKzcsUMVJnVk29yMGDc uuT16iLHZKNr5RrNUmGblcMmPeBhdxQVQJjRTa+CVqAxczgzWi1vlyu5Xe7EszV1jOrj lMZiofTEsJQpBp3+iNnHs2sIZL4xbYDu7N4arBv4mfhVw4us6fNCAnQxoMMVEKENZF+J v4ZwreSJyRR0vpJBhVUfeNbQ1MLmi9I/b6nI+tVFF6wWrjU5xsHPofI6XP7ntMh7NSEF Pz3w== X-Forwarded-Encrypted: i=1; AJvYcCVtAPfoaOWHgvbc2rGW1vjyWzgQa59O8qq8WCgvUAeM+3yjNFJJDl4Gs865ToNCDnYU1HGRYmLlQ+Up4epxRuV1JT0sBw==@freebsd.org X-Gm-Message-State: AOJu0YyBjIkzuIZ3o596hexBf6y/aLmqxjHW/xDL5UIK2LsKcHGxEYVL GNKi6GVuWz58yiPNYifA0vvNL2Ag9CjnchliKWuryYrce7sHHHGbbEtKN8mbY6GiKw1ncnwTF9O J X-Google-Smtp-Source: AGHT+IElsFloyq1B+sIdL7Bd28E7Kug0Ku1GznP35njo8YXR75x2OF3wU6/XXWlECrow49fijHXJBA== X-Received: by 2002:a05:6000:b4c:b0:37d:3735:8fe7 with SMTP id ffacd0b85a97d-381b708b14bmr18803314f8f.32.1730930402299; Wed, 06 Nov 2024 14:00:02 -0800 (PST) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c10ea7c2sm20285043f8f.57.2024.11.06.14.00.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Nov 2024 14:00:01 -0800 (PST) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3818.100.11.1.3\)) Subject: Re: git: cdfd0600dc88 - main - release: Include -dbg files in dvd image From: Jessica Clarke In-Reply-To: <202411052139.4A5Ldkj3078621@gitrepo.freebsd.org> Date: Wed, 6 Nov 2024 21:59:50 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202411052139.4A5Ldkj3078621@gitrepo.freebsd.org> To: Colin Percival X-Mailer: Apple Mail (2.3818.100.11.1.3) X-Spamd-Result: default: False [-1.20 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; MV_CASE(0.50)[]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; NEURAL_SPAM_SHORT(0.20)[0.200]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[jrtc27]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.44:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.44:from] X-Rspamd-Queue-Id: 4XkJz94jYFz4DZ4 X-Spamd-Bar: - On 5 Nov 2024, at 21:39, Colin Percival wrote: >=20 > The branch main has been updated by cperciva: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dcdfd0600dc8882f0a0d0e6d9a1cdcf92= 6edba6d6 >=20 > commit cdfd0600dc8882f0a0d0e6d9a1cdcf926edba6d6 > Author: Colin Percival > AuthorDate: 2024-11-05 21:35:17 +0000 > Commit: Colin Percival > CommitDate: 2024-11-05 21:39:38 +0000 >=20 > release: Include -dbg files in dvd image >=20 > In 2016, commit 8834318685bc reworked the code for excluding -dbg > files from install media, and in the process accidentally broke it > for dvd images ('grep -v' should have been 'grep -vE'). >=20 > FreeBSD Update builds later began to depend on this, and in any = case > since DVD images are intended as "include everything" images = there's > no point excluding those; so remove the (broken) filtering from DVD > image builds. Ah, my bad, I found this a couple of years ago downstream[1] but should have upstreamed the second half of that commit (which also went one further than this commit and removed the now-pointless $$(ls ...). Jess [1] = https://github.com/CTSRD-CHERI/cheribsd/commit/7cd4d52c6df917ec4dc8aa74ad2= 88de83441d8c8 > Sponsored by: Amazon > MFC after: 2 days > --- > release/Makefile | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/release/Makefile b/release/Makefile > index 6f59647ff5db..9f19b150ae65 100644 > --- a/release/Makefile > +++ b/release/Makefile > @@ -241,12 +241,12 @@ dvd: packagesystem > -DDB_FROM_SRC ) > # Copy distfiles > mkdir -p ${.TARGET}/usr/freebsd-dist > - for dist in MANIFEST $$(ls *.txz | grep -v -- '(${base = ${_ALL_libcompats}:L:ts|})-dbg'); \ > + for dist in MANIFEST $$(ls *.txz); \ > do cp $${dist} ${.TARGET}/usr/freebsd-dist; \ > done > .if defined(NO_ROOT) > echo "./usr/freebsd-dist type=3Ddir uname=3Droot gname=3Dwheel = mode=3D0755" >> ${.TARGET}/METALOG > - for dist in MANIFEST $$(ls *.txz | grep -vE -- '(${base = ${_ALL_libcompats}:L:ts|})-dbg'); \ > + for dist in MANIFEST $$(ls *.txz); \ > do echo "./usr/freebsd-dist/$${dist} type=3Dfile uname=3Droot = gname=3Dwheel mode=3D0644" >> ${.TARGET}/METALOG; \ > done > .endif From nobody Wed Nov 6 22:26:20 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkKYS3D1Mz5bvtZ; Wed, 06 Nov 2024 22:26: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkKYS2XjDz4GXR; Wed, 6 Nov 2024 22:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730931980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nHeqvWhKQWL0N79JseEi5znehpTywWUba2n/V3BlQf8=; b=x+PxC8w8cKF54lgsW+sqj7F1qReZabz4r83N0xCx5ge2ytDSr874XMfYnMry0/geTVp0Xn A4q9KZ50Aqo8JUY91ofoAJN58ru8pAEpidiTfWF8sLfEE0P4vsex4AvOD1ORhLo9+DRp3x nbRIxO9I2OM1CX2JmVgP2ZABC+NkNYSHoHUoNMnV5Rd3oeJx0lG5yLEfaG1r8PWg0mJJQo iJ4suZIiTGaCjOU5XUdP9OmxsAmxUgGr3Dx4I+nwLlyu8n4TmL6J8E+mboJbjxc4LHsZa2 2QM7aqcjNn5MbLsdEidVYkLIknEEFsL4Blyv+Gkzh6Atyb/wjKmS03/VqkeRWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730931980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nHeqvWhKQWL0N79JseEi5znehpTywWUba2n/V3BlQf8=; b=O0ACREflX+lvLVhlfJolDrK0AirO/mtDpJdXRjjzXI0N8UzdpTZVWSFrrPAzHLhk7w3QBL daBw1HkEuGIhPneimtzHjz+hYjaHR1bHRx7LgkwDObGG17ilf4n1zySF7nsz2KWJO0891D z8aMSCuYlnVZJtPpXmNHFBNi9IdI3jZ8SarJFbMCqPOe4OGA/rYymeKtrmnFfMizZgRzOI 8RGZg/tMiQE76O8lqIpxd517qn1IHLTHini7wDBoBwS89rooVpB3msQDYn3Cf73RSDl+AU 9OGISq+aY6yFZiDuiqm2QghT/5+gTfDRDlwLr14ODUBAOfbwihKxqfVgpXn++A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730931980; a=rsa-sha256; cv=none; b=WG97mFaVooSDwZDNLNQCjQpZHJeQzWb0zqnXG13etRUhQ+mESGwgxMfvM6s7mylANFUXuo LvL1+FVQSngo4mkdZMtNYBttXVSEkPUH+0Fqtb/Kuw/2/mE7d3xVz20iwTqNCFWS1Ew7cd w3sZcXH9PzN7axcor+Cfhu/R30cpVbeVaO1HmdnUPyFA0RBtSzlhjZ+AtyJESkoaesqmJP z0pLDLQiT0alFw6WPaiFMPbQOpzptE4aPNmpJwH7i3bqbburL/I+E7XLP1DJTEP6p+sAo/ a4IqZ+8CocBByB6yEx0070FA9nj2wcUdCf85LZiAwk9pi/5AdE6BQg/raNYOSg== 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 4XkKYS1vXmzK20; Wed, 6 Nov 2024 22:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A6MQKAg042215; Wed, 6 Nov 2024 22:26:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A6MQKLl042212; Wed, 6 Nov 2024 22:26:20 GMT (envelope-from git) Date: Wed, 6 Nov 2024 22:26:20 GMT Message-Id: <202411062226.4A6MQKLl042212@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: e166fea685da - main - release: Remove useless ls List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e166fea685da4ac6a6891f10b07f98d0e9fcfce3 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=e166fea685da4ac6a6891f10b07f98d0e9fcfce3 commit e166fea685da4ac6a6891f10b07f98d0e9fcfce3 Author: Colin Percival AuthorDate: 2024-11-06 22:24:34 +0000 Commit: Colin Percival CommitDate: 2024-11-06 22:26:09 +0000 release: Remove useless ls Replace "$((ls *.txz))" with "*.txz" Reported by: jrtc27 --- release/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/Makefile b/release/Makefile index 9f19b150ae65..be628d20ba8d 100644 --- a/release/Makefile +++ b/release/Makefile @@ -241,12 +241,12 @@ dvd: packagesystem -DDB_FROM_SRC ) # Copy distfiles mkdir -p ${.TARGET}/usr/freebsd-dist - for dist in MANIFEST $$(ls *.txz); \ + for dist in MANIFEST *.txz; \ do cp $${dist} ${.TARGET}/usr/freebsd-dist; \ done .if defined(NO_ROOT) echo "./usr/freebsd-dist type=dir uname=root gname=wheel mode=0755" >> ${.TARGET}/METALOG - for dist in MANIFEST $$(ls *.txz); \ + for dist in MANIFEST *.txz; \ do echo "./usr/freebsd-dist/$${dist} type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG; \ done .endif From nobody Wed Nov 6 22:28:38 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkKc83xsVz5bwG9 for ; Wed, 06 Nov 2024 22:28:40 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from mail.tarsnap.com (mail.tarsnap.com [54.86.246.204]) by mx1.freebsd.org (Postfix) with SMTP id 4XkKc827sdz4Gcf for ; Wed, 6 Nov 2024 22:28:40 +0000 (UTC) (envelope-from cperciva@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: (qmail 176 invoked from network); 6 Nov 2024 22:28:39 -0000 Received: from unknown (HELO framework.daemonology.net) (127.0.0.1) by mail.tarsnap.com with SMTP; 6 Nov 2024 22:28:39 -0000 Received: (qmail 29100 invoked from network); 6 Nov 2024 22:28:39 -0000 Received: from unknown (HELO ?127.0.0.1?) (127.0.0.1) by localhost with SMTP; 6 Nov 2024 22:28:39 -0000 Message-ID: <135bc5fa-6cfb-40f8-93f6-8e99fca1cc20@freebsd.org> Date: Wed, 6 Nov 2024 14:28:38 -0800 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: cdfd0600dc88 - main - release: Include -dbg files in dvd image To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202411052139.4A5Ldkj3078621@gitrepo.freebsd.org> Content-Language: en-US From: Colin Percival Autocrypt: addr=cperciva@freebsd.org; keydata= xsFNBGWMSrYBEACdWRqDn3B3SKO7IG0/fGHYtfs26f3Q5QeAcasy1fQLniwGQWn5rlILhbCD K/jdNoDm5Zxq20eqyffoDNObCjnHgg4tGANdi+RmDy+7CDpE789H8dss9y7Pt5DlGGAXQQnt hxush3EYS/Ctprd9UUL/lzOOLOU1aNtzB84tNrJBtcJmL7OYHfyTSNFxvedqJrrasejIQOLI t/DQ89BPzz+vsKHz7FJPXh3fsVkzLA00DJYcfkgxyABfJNA7U6yMwd4DVSdx/SsvfIDMVXnu UXCXswo106WPZbYGlZPpq0wW6iibtTerJix+8AeuwXvl9O1p8yESK4ErkIxCnmghTSz+pdzj z/6xBRkdDM9VdZ0r+CzsaNXMpDOzFuKyjaiYBdgCLljbDnXIHFcqXenrZ7Xwkm09g/M4uVSh pIUG2RYa6tsHSQoGCp3f2RZv1znfViKQFbbL83QjtPA20AhseZSYbHp1FPhXyy9J0wkGL16L e99g6gdGeIRE82BZjBjKGDkoyDPq+oDRSFl8NtzmIKy+cfz00nViqcTF4bREXEawFGhlpO0X O9q8mijI9iFB6zaPBiSdJGBL5ML5qLTNCl8Zlf4m1TBvmRTqF/lzMHVXHidDoUhpSh/y3AFZ 1KrYc27ztJQywDJPJPWPbtY8YhFLFs377gfP8WldsZjzp8nvoQARAQABzSVDb2xpbiBQZXJj aXZhbCA8Y3BlcmNpdmFARnJlZUJTRC5vcmc+wsGRBBMBCAA7FiEEglY7hNBiDtwN+4ZBOJfy 4i5lrT8FAmWMSrYCGwMICwkNCAwHCwMFFQoJCAsFFgMCAQACHgUCF4AACgkQOJfy4i5lrT++ ig/9GZKdN2fHSyrANKZX38ivd7IX2wAYouqH9DrQM94W8IciaDLmarN4Pl9mY+aucMwQUSyp uNtKOJwKqhVVaalF9Zw0sRMH4CJuvT7vKCtZ3q1Okb7soRvFte4d+vXhvPxCvBFDA5JzU7Lg DR5eqqcvF1dN1OuCq16pl0zCOSH/Jr5ToE3LM3Av1KBGcZD7ZSzHRWsFjV5AOUJKySuA3GwJ e/jASQcQ0YfCnru8ntLmYg/2SKvZFlfthZiCBnAppMt4n4BUAw3TDvf10HIDtdneejawcbLS gofLCvGqumwbZYAMKWrFzT4+7KQvr0pOw8QD7EbxnB4f9hQ7UiVF8qWsyKU3iv6b5JLhbS59 ooKRccyOvdMLcVJ0ZdpqoxrNv061ZUqLL5RiWjBlc1qjBnDxeg5oyM0rT8WLftdgvyH6RQt0 KWngumBAT5AT2DUYL8Uz1490cqfO9K4yEGZAJB9XRVX1g2IWTOjae+0g9ZII+h91UngFz+Rz aKDeseKBbCGDOFXx1TqKiHl2g255ZnUxKYTlucFtguv4gDGBgEk4G9JaEWBw1IWblcKhxH7L 2vWsUhvwghjIxHdO/RkeIeHvSp4YZxCJ7a3TaJLYAlwYopfTKVzNhcDY5h5syEuoHjyJCxXK SyoJYAVu8Yl2KUhvOtOmL1VZ6xyHnpdMRWKJZ5jOwU0EZYxKtgEQANYfgbtUMVnhjxDHhWLp g5kLHK3YW0TfJKzpXqDB7NiqxHofn4OcbZnVC3MKggcbs9o1/UtsjnlsG8550PfiYkDXvPiO RJwgbGs6MGIDK797C6cnBLQ8xwBa9SL4cl5iQFnhWmt6vwnJ+an/cm5JpYves3wL7jV09qU9 57hkHXEUcl38r4FssZzVcLKPUVTa3Un+QGRTGDGe/f4ctjMaqv0ZCM+l2ixPhf/vqESrfSLv V/+T3dmtUfXjazO3SABvsHwxgGuTTYOlKoPCaebr+BRdqm0xeIShoIlhvTI8y4clchqx/Uxg UG5X2kvU13k3DS3Q8uLE4Et9x1CcZT6WGgBZSR6R0WfD0SDnzufNnRWJ0dEPA2MtJHE7+85R Vi9j/IgZV+y5Ur+bnPkjDG1s2SVciX5v9HQ0oilcBhvx0j5lGE9hhurD9F+fCvkr4KdbCknE 6Y8ce8pCNBUoB/DqibJivOzTk9K9MGB5x0De5TerIrFiaw3/mQC9nGeO9dtE7wvDJetWeoTq 4BEaCzpufNqbkpOaTQILr4V6Gp7M6v97g83TVAwZntz/q8ptwuKQPZ2JaSFLZn7oWUpYXA5s +SIODFHLn6iMoYpBQskHQjnj4lEPJadl4qj+ZKA89iDAKsniyoFXsbJe2CPbMS1yzBxKZq6K D/jpt7BOnuHr/JrXABEBAAHCwXYEGAEIACAWIQSCVjuE0GIO3A37hkE4l/LiLmWtPwUCZYxK tgIbDAAKCRA4l/LiLmWtP3jmEACQrh9gWe8F1Tkw3m6VoHKwLc5he4tX3WpQa//soPO6iGG3 S3WPruQ46NrAaAojoOcKI9UONDO5rxG0ZTX53S+lu2EO47jbcLwOCjaEpjKpDRt9ZXBQE8Xl mtBE9Bp3W9gpjB1nE3KNM1mJYgsK0QdRpwwfh4pVgGpOj8j23I6MCK+v99zEBnpgCn2GX8W/ kctRXHqWwndHysOJtRP/zrl7dDaABF1f9efUl0LL3TD3GJ9VDz+DNOin/uK2a1hiJo8QzTRk PpfUQ2ebzDsrd1i/pOWkMSkdH+rEu4AGrXWtaBwrMyrGkL6Icb6yO+P9/z0W2wlgBf3P1YRt JPgQt/Dj3yvA/UnaV/QmuVQPjl13o24UnJGsZM8XGnNdfWBKkC1Q6VXC4QT+dyBHYH9MuE9d 6oGl8pFM1+cTfEfbM62/rRoPkF1yHMsI/903VxEvuUIKfhEZAVLFyHldooNxuchntHQP9y8J 8Ou9bWYQP7MnEn+kwSwrZkjurfPkan+xQvp6dDYnj3V0GwA5pprBMaB928VIDVOv+1PNQI3t Cvk5VPv/skq+TJRMHW7bFSt8PRa91cUf1FOLIz9APDiJOzXkwxUEHGV3zPSaUhs1JYjyBeGT wDAvtLUdjOnRhEUOwlnIrztmvyciutjJoVzKEEjj5WXnHk9L9kQ1bpAjkjTONw== In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:14618, ipnet:54.86.0.0/16, country:US] X-Rspamd-Queue-Id: 4XkKc827sdz4Gcf X-Spamd-Bar: ---- On 11/6/24 13:59, Jessica Clarke wrote: > On 5 Nov 2024, at 21:39, Colin Percival wrote: >> release: Include -dbg files in dvd image > > Ah, my bad, I found this a couple of years ago downstream[1] but should > have upstreamed the second half of that commit (which also went one > further than this commit and removed the now-pointless $$(ls ...). Good point, I've taken out the useless ls now. BTW I opted to keep the -dbg files out of disc1; that image tries to be less expansive than the dvd image. So there's still a little bit of divergence between FreeBSD and cheribsd here. -- Colin Percival FreeBSD Release Engineering Lead & EC2 platform maintainer Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From nobody Wed Nov 6 23:31:51 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkM136y7Bz5c0WV; Wed, 06 Nov 2024 23:31: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkM1361lkz4LqR; Wed, 6 Nov 2024 23:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730935911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KPrzk5K1tYzUWoHFEtVd0bhzZAvIaLZmA8K5r4VzNjc=; b=hJfvq0DoEJMFxxC/ycOhhcZL5Bony6NZH+e09jdU2cfV3IGVaxUt8NQK3w1e22iX+6W90Q lmzyAk1MCy8czeWqCa459Zq/K6HLeL5Jp2XtidSImaiSFpeOmHvXJ6VcZvYCEhSOh/HRg9 LBYMLZuFCCi7rKeVcw+mW19ERuaNF3Ebry1YAAS1Hc3wTUhFXR2G7PQlBBt+voJMvhGHM1 Wnxi9oJc6qLp/nBqrYaUZpCuc3ScML1f4Pb3BHitFYmDeb2ichNu8GuBqULfk0Too438WJ Im4GkGtVsuU/qE9fDM0kf2AVpBxKhvRH5HhI8k92WoZ24sgo+pIr8aCRCrdkjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730935911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KPrzk5K1tYzUWoHFEtVd0bhzZAvIaLZmA8K5r4VzNjc=; b=L9LptVC3YKYWwHxF+ZjRQHki0inajwmFUpPuATfmR+XMo/B71yhqlLF/um1AV6o/3CYCIC QSHMrnk55vjRc1VkMHxXyBQUe/dEBSb5vbou5CLVlq7ewLqV0b/O4T3vRORU6PLGSiQs95 x90L4K/B82J9hMJCOICiRqpwtxldNk7a/zdEg3VoMLf1a7TDm2Ycm7pYNZfqBAHbdgiBX0 2SELPWzBrEZ3yC2XgvEmm2EK1dux5B5m185ucZyG6DhZQ1KaI19/sFBSXxVYf6lxVCBAKO tG7HdUXB9kwZL3oselZVRh/rQJmvA7Bb+frWfkUJkN5TGZW7hdlJa2kWADKl3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730935911; a=rsa-sha256; cv=none; b=tBy/M573eNg751d547ZZI5qCK1NA0fRmWkA9R1LklivZWa7M0/HO2ZPli3ynthgXn76erO pWXDiXCpr+rfGzdLoLMv/3KKtaOH0EEsXABeF+K2xVeYydyZYzvJvkqOOw7GU+jE0oswk9 o2LTrfD5E8r+BsyL/Z79n0kRUaJ2u1z2dR1S8bttZ9hb0OIwOfW3+L37GlWyA0SbxFTYoF Mrm7nUU624jYkN6aV1rY483ksfyPqylHp8lhaedcItL1qvuhPdIphOhBnf/tQ6zc79OnPo TTHOl7vihD2REhOvQyV/rlGSnHDgU75DVlWKlpnr2q990jHh9LBCXcuiTpQzvQ== 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 4XkM135K9jzLn7; Wed, 6 Nov 2024 23:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A6NVpYd069814; Wed, 6 Nov 2024 23:31:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A6NVptU069811; Wed, 6 Nov 2024 23:31:51 GMT (envelope-from git) Date: Wed, 6 Nov 2024 23:31:51 GMT Message-Id: <202411062331.4A6NVptU069811@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 19a577ea5cae - main - ng_ubt_intel: Allow to attach to 9260 bluetooth adaptors List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 19a577ea5cae1238065106de9080cb6f3e66034d Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=19a577ea5cae1238065106de9080cb6f3e66034d commit 19a577ea5cae1238065106de9080cb6f3e66034d Author: Vladimir Kondratyev AuthorDate: 2024-11-06 23:25:56 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-11-06 23:25:56 +0000 ng_ubt_intel: Allow to attach to 9260 bluetooth adaptors with operational mode firmware. Sponsored by: Future Crew LLC MFC after: 1 month Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D46734 --- sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c | 69 ++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c index ad71cae5fa83..f93b74b264ad 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c @@ -6,6 +6,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2019, 2021 Vladimir Kondratyev + * Copyright (c) 2023 Future Crew LLC. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -56,9 +57,13 @@ #include #include +#define UBT_INTEL_HCICMD_TIMEOUT 2000 /* ms */ +#define UBT_INTEL_TLV_IMAGE_TYPE 0x1c + enum { UBT_INTEL_DEVICE_7260, UBT_INTEL_DEVICE_8260, + UBT_INTEL_DEVICE_9260, }; struct ubt_intel_version_rp { @@ -93,6 +98,9 @@ static const STRUCT_USB_HOST_ID ubt_intel_devs[] = { USB_VPI(USB_VENDOR_INTEL2, 0x0025, UBT_INTEL_DEVICE_8260) }, { USB_VPI(USB_VENDOR_INTEL2, 0x0026, UBT_INTEL_DEVICE_8260) }, { USB_VPI(USB_VENDOR_INTEL2, 0x0029, UBT_INTEL_DEVICE_8260) }, + /* Intel Wireless 9260/9560 and successors */ + { USB_VPI(USB_VENDOR_INTEL2, 0x0032, UBT_INTEL_DEVICE_9260) }, + { USB_VPI(USB_VENDOR_INTEL2, 0x0033, UBT_INTEL_DEVICE_9260) }, }; /* @@ -103,7 +111,6 @@ static usb_error_t ubt_intel_do_hci_request(struct usb_device *udev, uint16_t opcode, void *resp, uint8_t resp_len) { -#define UBT_INTEL_HCICMD_TIMEOUT 2000 /* ms */ struct ubt_hci_event_command_compl *evt; struct ubt_hci_cmd cmd; usb_error_t error; @@ -128,6 +135,53 @@ exit: return (error); } +static uint8_t +ubt_intel_get_img_type(struct usb_device *udev) +{ +#define UBT_INTEL_MAX_EVT_SIZE 256 + static struct ubt_hci_cmd cmd = { + .opcode = htole16(NG_HCI_OPCODE(NG_HCI_OGF_VENDOR, 0x05)), + .length = 1, + .data = { 0xff }, + }; + struct ubt_hci_event_command_compl *evt; + usb_error_t error; + uint8_t status, datalen, type, len, img_type = 0; + uint8_t *data; + + evt = malloc(UBT_INTEL_MAX_EVT_SIZE, M_TEMP, M_ZERO | M_WAITOK); + evt->header.length = + UBT_INTEL_MAX_EVT_SIZE - sizeof(struct ubt_hci_evhdr); + + error = ubt_do_hci_request(udev, &cmd, evt, UBT_INTEL_HCICMD_TIMEOUT); + if (error != USB_ERR_NORMAL_COMPLETION) + goto exit; + + datalen = evt->header.length - UBT_HCI_EVENT_COMPL_HEAD_SIZE; + data = evt->data; + status = *data++; + if (status != 0) + goto exit; + datalen--; + + while (datalen >= 2) { + type = *data++; + len = *data++; + datalen -= 2; + if (datalen < len) + break; + if (type == UBT_INTEL_TLV_IMAGE_TYPE && len == 1) { + img_type = *data; + break; + } + datalen -= len; + data += len; + } +exit: + free(evt, M_TEMP); + return (img_type); +} + /* * Probe for a Intel Wireless Bluetooth device. */ @@ -139,6 +193,7 @@ ubt_intel_probe(device_t dev) struct ubt_intel_version_rp version; ng_hci_reset_rp reset; int error; + uint8_t img_type; if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); @@ -193,6 +248,18 @@ ubt_intel_probe(device_t dev) return (ENXIO); break; + case UBT_INTEL_DEVICE_9260: + /* + * Find if the Intel Wireless 9260/9560 device is in bootloader + * mode or is running operational firmware with checking of + * image type byte of "Intel version" HCI command response. + * The value 0x03 identifies the operational firmware. + */ + img_type = ubt_intel_get_img_type(uaa->device); + if (img_type != 0x03) + return (ENXIO); + break; + default: KASSERT(0 == 1, ("Unknown DRIVER_INFO")); } From nobody Wed Nov 6 23:31:52 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkM1518Wcz5c0Nk; Wed, 06 Nov 2024 23:31: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkM146ppdz4Lwh; Wed, 6 Nov 2024 23:31:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730935912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d0aArOOUU056ppT+5Z+W386+H8km1bXxWkyGYM7feAM=; b=opOXJ9/LtWDQ+RIVevnJXCyflrJDiZqeEa/A1w/UPETVtgkrse5pijzzVQi6gg/PomclUJ 8ozAVMj6KIVdlblEilZvEsotKiGJY+84LdMry5MXvaZhkS/DS6YSb3UrYcb+QDoE8o4SbG TFmz39M7YgHlqEeQ2LdPnETRG1rYE5OanUo4bPoXT0MSNxdOG2Yd723IwqRp2+oZxjQ0Hi VbTFvPchUNLcVz1CypR3q7zGlJLJuh1NM68ouOUwJ01BlTez4iAp07Y4+9b1/v+DK64WwF DNN5aCK/R0G8VlJBtHcbEhTaHSopM6BVyG963PPqLBWtD2AbQfIRVVsDFiPIxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730935912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d0aArOOUU056ppT+5Z+W386+H8km1bXxWkyGYM7feAM=; b=OlVe0ERjo6yJ+Esv12d8Tgbeo64qzVRuSbQtfAI3N1A3hRz0lATfdYSkDeEzv2wTWfR5Ju XyvMJ90b5P21QInQ/hAUQo+NPHT+H6syaE85uvMUZcAkQUrZG6YKTeEf5l27XG7zYuU903 kVpeHMpvYeEu5khMczCT0qhWrxD9yPq+YSHxsqwrAga/jqjrylSzMyO3uR+uqVnLwJ4y6e D+JXMIRy628xubuav01FzLGUFUrmQnxT6j8kYzP0G1kH0UVJCnq3NGxF4iA/4zTK8Ruf8q ZPRvjjQozE74rU1DI6cdDLb6eNQNBmxuHzq90C0GXS/U0ozAtdpD9yqNvHZ8OQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730935912; a=rsa-sha256; cv=none; b=x0mwEPAZazeu89cGcoTUnOJNEFFKEJJMUoscBVxT+yqKGPGP6cWPKiNoPhLKFKOaWYstga 4mXzKj2nc6f0/IcRsRC2711mPuG4lAGbqeRGFCLe2u1dMjnr0g/ltmh5tE6a4Qbfwv1fZJ as90qyE+9C8u2bmKr2cYpjBFqFoDbOLW1DiXBVqNwQIrzYfMOYxrvcjt0aIhjuEPBIM+S3 pVIHqNJHaW0Njw7E3/MAq2GRX4MCtl/lQAvPm3Xv3l2uJxXJrYxrR+oVXDLaSk5wbJP6So 8AYMV2a/38fE94l1GGtSgOdYI+7oUKc1COMkpGa1CxFVYO/aV/r0Hu5IJv7vJQ== 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 4XkM146PpKzKqt; Wed, 6 Nov 2024 23:31:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A6NVqHI069875; Wed, 6 Nov 2024 23:31:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A6NVqZ8069872; Wed, 6 Nov 2024 23:31:52 GMT (envelope-from git) Date: Wed, 6 Nov 2024 23:31:52 GMT Message-Id: <202411062331.4A6NVqZ8069872@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: c1643cedbf24 - main - iwmbtfw(4): Add support for 9260/9560 bluetooth adaptors List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: c1643cedbf243424370162febf6d9180bdd1df58 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=c1643cedbf243424370162febf6d9180bdd1df58 commit c1643cedbf243424370162febf6d9180bdd1df58 Author: Vladimir Kondratyev AuthorDate: 2024-11-06 23:26:51 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-11-06 23:26:51 +0000 iwmbtfw(4): Add support for 9260/9560 bluetooth adaptors Required firmware files are already included in to comms/iwmbt-firmware port Sponsored by: Future Crew LLC MFC after: 1 month Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D46735 --- usr.sbin/bluetooth/iwmbtfw/Makefile | 2 + usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c | 21 +++ usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.h | 71 +++++++ usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c | 183 ++++++++++++++++-- usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h | 12 +- usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 | 4 +- usr.sbin/bluetooth/iwmbtfw/iwmbtfw.conf | 5 +- usr.sbin/bluetooth/iwmbtfw/main.c | 323 +++++++++++++++++++++++++------- 8 files changed, 531 insertions(+), 90 deletions(-) diff --git a/usr.sbin/bluetooth/iwmbtfw/Makefile b/usr.sbin/bluetooth/iwmbtfw/Makefile index dde586b3aa99..c5cf037eac06 100644 --- a/usr.sbin/bluetooth/iwmbtfw/Makefile +++ b/usr.sbin/bluetooth/iwmbtfw/Makefile @@ -4,6 +4,8 @@ CONFSDIR= /etc/devd PROG= iwmbtfw MAN= iwmbtfw.8 LIBADD+= usb +# Not having NDEBUG defined will enable assertions +CFLAGS+= -DNDEBUG SRCS= main.c iwmbt_fw.c iwmbt_hw.c .include diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c b/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c index 6816b152912d..815b40982d5b 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.c @@ -3,6 +3,7 @@ * * Copyright (c) 2013 Adrian Chadd * Copyright (c) 2019 Vladimir Kondratyev + * Copyright (c) 2023 Future Crew LLC. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -170,3 +171,23 @@ iwmbt_get_fwname(struct iwmbt_version *ver, struct iwmbt_boot_params *params, return (fwname); } + +char * +iwmbt_get_fwname_tlv(struct iwmbt_version_tlv *ver, const char *prefix, + const char *suffix) +{ + char *fwname; + +#define IWMBT_PACK_CNVX_TOP(cnvx_top) ((uint16_t)( \ + ((cnvx_top) & 0x0f000000) >> 16 | \ + ((cnvx_top) & 0x0000000f) << 12 | \ + ((cnvx_top) & 0x00000ff0) >> 4)) + + asprintf(&fwname, "%s/ibt-%04x-%04x.%s", + prefix, + IWMBT_PACK_CNVX_TOP(ver->cnvi_top), + IWMBT_PACK_CNVX_TOP(ver->cnvr_top), + suffix); + + return (fwname); +} diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.h b/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.h index f737c1c0c2c8..2666d123c8f0 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.h +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_fw.h @@ -3,6 +3,7 @@ * * Copyright (c) 2013 Adrian Chadd * Copyright (c) 2019 Vladimir Kondratyev + * Copyright (c) 2023 Future Crew LLC. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,6 +30,15 @@ #ifndef __IWMBT_FW_H__ #define __IWMBT_FW_H__ +#include +#define L2CAP_SOCKET_CHECKED +#include + +#define RSA_HEADER_LEN 644 +#define ECDSA_HEADER_LEN 320 +#define ECDSA_OFFSET RSA_HEADER_LEN +#define CSS_HEADER_OFFSET 8 + struct iwmbt_version { uint8_t status; uint8_t hw_platform; @@ -62,6 +72,65 @@ struct iwmbt_boot_params { uint8_t unlocked_state; } __attribute__ ((packed)); +enum { + IWMBT_TLV_CNVI_TOP = 0x10, + IWMBT_TLV_CNVR_TOP, + IWMBT_TLV_CNVI_BT, + IWMBT_TLV_CNVR_BT, + IWMBT_TLV_CNVI_OTP, + IWMBT_TLV_CNVR_OTP, + IWMBT_TLV_DEV_REV_ID, + IWMBT_TLV_USB_VENDOR_ID, + IWMBT_TLV_USB_PRODUCT_ID, + IWMBT_TLV_PCIE_VENDOR_ID, + IWMBT_TLV_PCIE_DEVICE_ID, + IWMBT_TLV_PCIE_SUBSYSTEM_ID, + IWMBT_TLV_IMAGE_TYPE, + IWMBT_TLV_TIME_STAMP, + IWMBT_TLV_BUILD_TYPE, + IWMBT_TLV_BUILD_NUM, + IWMBT_TLV_FW_BUILD_PRODUCT, + IWMBT_TLV_FW_BUILD_HW, + IWMBT_TLV_FW_STEP, + IWMBT_TLV_BT_SPEC, + IWMBT_TLV_MFG_NAME, + IWMBT_TLV_HCI_REV, + IWMBT_TLV_LMP_SUBVER, + IWMBT_TLV_OTP_PATCH_VER, + IWMBT_TLV_SECURE_BOOT, + IWMBT_TLV_KEY_FROM_HDR, + IWMBT_TLV_OTP_LOCK, + IWMBT_TLV_API_LOCK, + IWMBT_TLV_DEBUG_LOCK, + IWMBT_TLV_MIN_FW, + IWMBT_TLV_LIMITED_CCE, + IWMBT_TLV_SBE_TYPE, + IWMBT_TLV_OTP_BDADDR, + IWMBT_TLV_UNLOCKED_STATE +}; + +struct iwmbt_version_tlv { + uint32_t cnvi_top; + uint32_t cnvr_top; + uint32_t cnvi_bt; + uint32_t cnvr_bt; + uint16_t dev_rev_id; + uint8_t img_type; + uint16_t timestamp; + uint8_t build_type; + uint32_t build_num; + uint8_t secure_boot; + uint8_t otp_lock; + uint8_t api_lock; + uint8_t debug_lock; + uint8_t min_fw_build_nn; + uint8_t min_fw_build_cw; + uint8_t min_fw_build_yy; + uint8_t limited_cce; + uint8_t sbe_type; + bdaddr_t otp_bd_addr; +}; + struct iwmbt_firmware { char *fwname; int len; @@ -73,5 +142,7 @@ extern void iwmbt_fw_free(struct iwmbt_firmware *fw); extern char *iwmbt_get_fwname(struct iwmbt_version *ver, struct iwmbt_boot_params *params, const char *prefix, const char *suffix); +extern char *iwmbt_get_fwname_tlv(struct iwmbt_version_tlv *ver, + const char *prefix, const char *suffix); #endif diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c index ea732c9925ee..05a851f9d85b 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2019 Vladimir Kondratyev + * Copyright (c) 2023 Future Crew LLC. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,6 +30,7 @@ #include #include +#include #include #include #include @@ -267,16 +269,6 @@ iwmbt_patch_fwfile(struct libusb_device_handle *hdl, return (activate_patch); } -int -iwmbt_load_fwfile(struct libusb_device_handle *hdl, - const struct iwmbt_firmware *fw, uint32_t *boot_param) -{ - int ready = 0, sent = 0; - int ret, transferred; - struct iwmbt_hci_cmd *cmd; - struct iwmbt_hci_event *event; - uint8_t buf[IWMBT_HCI_MAX_EVENT_SIZE]; - #define IWMBT_SEND_FRAGMENT(fragment_type, size, msg) do { \ iwmbt_debug("transferring %d bytes, offset %d", size, sent); \ \ @@ -293,12 +285,11 @@ iwmbt_load_fwfile(struct libusb_device_handle *hdl, sent += size; \ } while (0) - if (fw->len < 644) { - iwmbt_err("Invalid size of firmware file (%d)", fw->len); - return (-1); - } - - iwmbt_debug("file=%s, size=%d", fw->fwname, fw->len); +int +iwmbt_load_rsa_header(struct libusb_device_handle *hdl, + const struct iwmbt_firmware *fw) +{ + int ret, sent = 0; IWMBT_SEND_FRAGMENT(0x00, 0x80, "CCS segment"); IWMBT_SEND_FRAGMENT(0x03, 0x80, "public key / part 1"); @@ -310,6 +301,32 @@ iwmbt_load_fwfile(struct libusb_device_handle *hdl, IWMBT_SEND_FRAGMENT(0x02, 0x80, "signature / part 1"); IWMBT_SEND_FRAGMENT(0x02, 0x80, "signature / part 2"); + return (0); +} + +int +iwmbt_load_ecdsa_header(struct libusb_device_handle *hdl, + const struct iwmbt_firmware *fw) +{ + int ret, sent = ECDSA_OFFSET; + + IWMBT_SEND_FRAGMENT(0x00, 0x80, "CCS segment"); + IWMBT_SEND_FRAGMENT(0x03, 0x60, "public key"); + IWMBT_SEND_FRAGMENT(0x02, 0x60, "signature"); + + return (0); +} + +int +iwmbt_load_fwfile(struct libusb_device_handle *hdl, + const struct iwmbt_firmware *fw, uint32_t *boot_param, int offset) +{ + int ready = 0, sent = offset; + int ret, transferred; + struct iwmbt_hci_cmd *cmd; + struct iwmbt_hci_event *event; + uint8_t buf[IWMBT_HCI_MAX_EVENT_SIZE]; + /* * Send firmware chunks. Chunk len must be 4 byte aligned. * multiple commands can be combined @@ -460,6 +477,140 @@ iwmbt_get_version(struct libusb_device_handle *hdl, return (0); } +int +iwmbt_get_version_tlv(struct libusb_device_handle *hdl, + struct iwmbt_version_tlv *version) +{ + int ret, transferred; + struct iwmbt_hci_event_cmd_compl *event; + static struct iwmbt_hci_cmd cmd = { + .opcode = htole16(0xfc05), + .length = 1, + .data = { 0xff }, + }; + uint8_t status, datalen, type, len; + uint8_t *data; + uint8_t buf[255]; + + memset(buf, 0, sizeof(buf)); + + ret = iwmbt_hci_command(hdl, + &cmd, + buf, + sizeof(buf), + &transferred, + IWMBT_HCI_CMD_TIMEOUT); + + if (ret < 0 || transferred < (int)IWMBT_HCI_EVT_COMPL_SIZE(uint16_t)) { + iwmbt_debug("Can't get version: code=%d, size=%d", + ret, + transferred); + return (-1); + } + + event = (struct iwmbt_hci_event_cmd_compl *)buf; + memcpy(version, event->data, sizeof(struct iwmbt_version)); + + datalen = event->header.length - IWMBT_HCI_EVENT_COMPL_HEAD_SIZE; + data = event->data; + status = *data++; + if (status != 0) + return (-1); + datalen--; + + while (datalen >= 2) { + type = *data++; + len = *data++; + datalen -= 2; + + if (datalen < len) + return (-1); + + switch (type) { + case IWMBT_TLV_CNVI_TOP: + assert(len == 4); + version->cnvi_top = le32dec(data); + break; + case IWMBT_TLV_CNVR_TOP: + assert(len == 4); + version->cnvr_top = le32dec(data); + break; + case IWMBT_TLV_CNVI_BT: + assert(len == 4); + version->cnvi_bt = le32dec(data); + break; + case IWMBT_TLV_CNVR_BT: + assert(len == 4); + version->cnvr_bt = le32dec(data); + break; + case IWMBT_TLV_DEV_REV_ID: + assert(len == 2); + version->dev_rev_id = le16dec(data); + break; + case IWMBT_TLV_IMAGE_TYPE: + assert(len == 1); + version->img_type = *data; + break; + case IWMBT_TLV_TIME_STAMP: + assert(len == 2); + version->min_fw_build_cw = data[0]; + version->min_fw_build_yy = data[1]; + version->timestamp = le16dec(data); + break; + case IWMBT_TLV_BUILD_TYPE: + assert(len == 1); + version->build_type = *data; + break; + case IWMBT_TLV_BUILD_NUM: + assert(len == 4); + version->min_fw_build_nn = *data; + version->build_num = le32dec(data); + break; + case IWMBT_TLV_SECURE_BOOT: + assert(len == 1); + version->secure_boot = *data; + break; + case IWMBT_TLV_OTP_LOCK: + assert(len == 1); + version->otp_lock = *data; + break; + case IWMBT_TLV_API_LOCK: + assert(len == 1); + version->api_lock = *data; + break; + case IWMBT_TLV_DEBUG_LOCK: + assert(len == 1); + version->debug_lock = *data; + break; + case IWMBT_TLV_MIN_FW: + assert(len == 3); + version->min_fw_build_nn = data[0]; + version->min_fw_build_cw = data[1]; + version->min_fw_build_yy = data[2]; + break; + case IWMBT_TLV_LIMITED_CCE: + assert(len == 1); + version->limited_cce = *data; + break; + case IWMBT_TLV_SBE_TYPE: + assert(len == 1); + version->sbe_type = *data; + break; + case IWMBT_TLV_OTP_BDADDR: + memcpy(&version->otp_bd_addr, data, sizeof(bdaddr_t)); + break; + default: + /* Ignore other types */ + break; + } + + datalen -= len; + data += len; + } + + return (0); +} + int iwmbt_get_boot_params(struct libusb_device_handle *hdl, struct iwmbt_boot_params *params) diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h index eafb2c3f31d8..9467c3807a2a 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2019 Vladimir Kondratyev + * Copyright (c) 2023 Future Crew LLC. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -59,6 +60,9 @@ struct iwmbt_hci_event_cmd_compl { #define IWMBT_HCI_EVT_COMPL_SIZE(payload) \ (offsetof(struct iwmbt_hci_event_cmd_compl, data) + sizeof(payload)) +#define IWMBT_HCI_EVENT_COMPL_HEAD_SIZE \ + (offsetof(struct iwmbt_hci_event_cmd_compl, data) - \ + offsetof(struct iwmbt_hci_event_cmd_compl, numpkt)) #define IWMBT_CONTROL_ENDPOINT_ADDR 0x00 #define IWMBT_INTERRUPT_ENDPOINT_ADDR 0x81 @@ -73,13 +77,19 @@ struct iwmbt_hci_event_cmd_compl { extern int iwmbt_patch_fwfile(struct libusb_device_handle *hdl, const struct iwmbt_firmware *fw); +extern int iwmbt_load_rsa_header(struct libusb_device_handle *hdl, + const struct iwmbt_firmware *fw); +extern int iwmbt_load_ecdsa_header(struct libusb_device_handle *hdl, + const struct iwmbt_firmware *fw); extern int iwmbt_load_fwfile(struct libusb_device_handle *hdl, - const struct iwmbt_firmware *fw, uint32_t *boot_param); + const struct iwmbt_firmware *fw, uint32_t *boot_param, int offset); extern int iwmbt_enter_manufacturer(struct libusb_device_handle *hdl); extern int iwmbt_exit_manufacturer(struct libusb_device_handle *hdl, int mode); extern int iwmbt_get_version(struct libusb_device_handle *hdl, struct iwmbt_version *version); +extern int iwmbt_get_version_tlv(struct libusb_device_handle *hdl, + struct iwmbt_version_tlv *version); extern int iwmbt_get_boot_params(struct libusb_device_handle *hdl, struct iwmbt_boot_params *params); extern int iwmbt_intel_reset(struct libusb_device_handle *hdl, diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 b/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 index 1924c5f3ce74..2ce828cb5ebe 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 @@ -26,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 31, 2024 +.Dd September 15, 2024 .Dt IWMBTFW 8 .Os .Sh NAME @@ -48,7 +48,7 @@ device. .Pp This utility will .Em only -work with Intel Wireless 7260/8260/8265 chip based Bluetooth USB devices +work with Intel Wireless 7260/8260/9260 chip based Bluetooth USB devices and some of their successors. The identification is currently based on USB vendor ID/product ID pair. The vendor ID should be 0x8087 diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.conf b/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.conf index ef8d5263383b..e30a3c15ccaa 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.conf +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.conf @@ -1,11 +1,12 @@ # -# Download Intel Wireless 8260/8265 bluetooth adaptor firmware +# Download Intel Wireless bluetooth adaptor firmware +# notify 100 { match "system" "USB"; match "subsystem" "DEVICE"; match "type" "ATTACH"; match "vendor" "0x8087"; - match "product" "(0x07dc|0x0a2a|0x0aa7|0x0a2b|0x0aaa|0x0025|0x0026|0x0029)"; + match "product" "(0x07dc|0x0a2a|0x0aa7|0x0a2b|0x0aaa|0x0025|0x0026|0x0029|0x0032|0x0033)"; action "/usr/sbin/iwmbtfw -d $cdev -f /usr/local/share/iwmbt-firmware"; }; diff --git a/usr.sbin/bluetooth/iwmbtfw/main.c b/usr.sbin/bluetooth/iwmbtfw/main.c index 9ef31b906b77..c2b67ce01906 100644 --- a/usr.sbin/bluetooth/iwmbtfw/main.c +++ b/usr.sbin/bluetooth/iwmbtfw/main.c @@ -3,6 +3,7 @@ * * Copyright (c) 2013 Adrian Chadd * Copyright (c) 2019 Vladimir Kondratyev + * Copyright (c) 2023 Future Crew LLC. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -50,71 +51,63 @@ int iwmbt_do_debug = 0; int iwmbt_do_info = 0; +enum iwmbt_device { + IWMBT_DEVICE_UNKNOWN, + IWMBT_DEVICE_7260, + IWMBT_DEVICE_8260, + IWMBT_DEVICE_9260, +}; + struct iwmbt_devid { uint16_t product_id; uint16_t vendor_id; + enum iwmbt_device device; }; -static struct iwmbt_devid iwmbt_list_72xx[] = { +static struct iwmbt_devid iwmbt_list[] = { - /* Intel Wireless 7260/7265 and successors */ - { .vendor_id = 0x8087, .product_id = 0x07dc }, - { .vendor_id = 0x8087, .product_id = 0x0a2a }, - { .vendor_id = 0x8087, .product_id = 0x0aa7 }, -}; + /* Intel Wireless 7260/7265 and successors */ + { .vendor_id = 0x8087, .product_id = 0x07dc, .device = IWMBT_DEVICE_7260 }, + { .vendor_id = 0x8087, .product_id = 0x0a2a, .device = IWMBT_DEVICE_7260 }, + { .vendor_id = 0x8087, .product_id = 0x0aa7, .device = IWMBT_DEVICE_7260 }, -static struct iwmbt_devid iwmbt_list_82xx[] = { + /* Intel Wireless 8260/8265 and successors */ + { .vendor_id = 0x8087, .product_id = 0x0a2b, .device = IWMBT_DEVICE_8260 }, + { .vendor_id = 0x8087, .product_id = 0x0aaa, .device = IWMBT_DEVICE_8260 }, + { .vendor_id = 0x8087, .product_id = 0x0025, .device = IWMBT_DEVICE_8260 }, + { .vendor_id = 0x8087, .product_id = 0x0026, .device = IWMBT_DEVICE_8260 }, + { .vendor_id = 0x8087, .product_id = 0x0029, .device = IWMBT_DEVICE_8260 }, - /* Intel Wireless 8260/8265 and successors */ - { .vendor_id = 0x8087, .product_id = 0x0a2b }, - { .vendor_id = 0x8087, .product_id = 0x0aaa }, - { .vendor_id = 0x8087, .product_id = 0x0025 }, - { .vendor_id = 0x8087, .product_id = 0x0026 }, - { .vendor_id = 0x8087, .product_id = 0x0029 }, + /* Intel Wireless 9260/9560 and successors */ + { .vendor_id = 0x8087, .product_id = 0x0032, .device = IWMBT_DEVICE_9260 }, + { .vendor_id = 0x8087, .product_id = 0x0033, .device = IWMBT_DEVICE_9260 }, }; -static int -iwmbt_is_7260(struct libusb_device_descriptor *d) +static enum iwmbt_device +iwmbt_is_supported(struct libusb_device_descriptor *d) { int i; /* Search looking for whether it's an 7260/7265 */ - for (i = 0; i < (int) nitems(iwmbt_list_72xx); i++) { - if ((iwmbt_list_72xx[i].product_id == d->idProduct) && - (iwmbt_list_72xx[i].vendor_id == d->idVendor)) { - iwmbt_info("found 7260/7265"); - return (1); - } - } - - /* Not found */ - return (0); -} - -static int -iwmbt_is_8260(struct libusb_device_descriptor *d) -{ - int i; - - /* Search looking for whether it's an 8260/8265 */ - for (i = 0; i < (int) nitems(iwmbt_list_82xx); i++) { - if ((iwmbt_list_82xx[i].product_id == d->idProduct) && - (iwmbt_list_82xx[i].vendor_id == d->idVendor)) { - iwmbt_info("found 8260/8265"); - return (1); + for (i = 0; i < (int) nitems(iwmbt_list); i++) { + if ((iwmbt_list[i].product_id == d->idProduct) && + (iwmbt_list[i].vendor_id == d->idVendor)) { + iwmbt_info("found iwmbtfw compatible"); + return (iwmbt_list[i].device); } } /* Not found */ - return (0); + return (IWMBT_DEVICE_UNKNOWN); } static libusb_device * iwmbt_find_device(libusb_context *ctx, int bus_id, int dev_id, - int *iwmbt_use_old_method) + enum iwmbt_device *iwmbt_device) { libusb_device **list, *dev = NULL, *found = NULL; struct libusb_device_descriptor d; + enum iwmbt_device device; ssize_t cnt, i; int r; @@ -141,20 +134,13 @@ iwmbt_find_device(libusb_context *ctx, int bus_id, int dev_id, } /* Match on the vendor/product id */ - if (iwmbt_is_7260(&d)) { + device = iwmbt_is_supported(&d); + if (device != IWMBT_DEVICE_UNKNOWN) { /* * Take a reference so it's not freed later on. */ found = libusb_ref_device(dev); - *iwmbt_use_old_method = 1; - break; - } else - if (iwmbt_is_8260(&d)) { - /* - * Take a reference so it's not freed later on. - */ - found = libusb_ref_device(dev); - *iwmbt_use_old_method = 0; + *iwmbt_device = device; break; } } @@ -200,6 +186,44 @@ iwmbt_dump_boot_params(struct iwmbt_boot_params *params) params->otp_bdaddr[0]); } +static void +iwmbt_dump_version_tlv(struct iwmbt_version_tlv *ver) +{ + iwmbt_info("cnvi_top 0x%08x", ver->cnvi_top); + iwmbt_info("cnvr_top 0x%08x", ver->cnvr_top); + iwmbt_info("cnvi_bt 0x%08x", ver->cnvi_bt); + iwmbt_info("cnvr_bt 0x%08x", ver->cnvr_bt); + iwmbt_info("dev_rev_id 0x%04x", ver->dev_rev_id); + iwmbt_info("img_type 0x%02x", ver->img_type); + iwmbt_info("timestamp 0x%04x", ver->timestamp); + iwmbt_info("build_type 0x%02x", ver->build_type); + iwmbt_info("build_num 0x%08x", ver->build_num); + iwmbt_info("Secure Boot: %s", ver->secure_boot ? "on" : "off"); + iwmbt_info("OTP lock: %s", ver->otp_lock ? "on" : "off"); + iwmbt_info("API lock: %s", ver->api_lock ? "on" : "off"); + iwmbt_info("Debug lock: %s", ver->debug_lock ? "on" : "off"); + iwmbt_info("Minimum firmware build %u week %u year %u", + ver->min_fw_build_nn, + ver->min_fw_build_cw, + 2000 + ver->min_fw_build_yy); + iwmbt_info("limited_cce 0x%02x", ver->limited_cce); + iwmbt_info("sbe_type 0x%02x", ver->sbe_type); + iwmbt_info("OTC BD_ADDR: %02x:%02x:%02x:%02x:%02x:%02x", + ver->otp_bd_addr.b[5], + ver->otp_bd_addr.b[4], + ver->otp_bd_addr.b[3], + ver->otp_bd_addr.b[2], + ver->otp_bd_addr.b[1], + ver->otp_bd_addr.b[0]); + if (ver->img_type == 0x01 || ver->img_type == 0x03) + iwmbt_info("%s timestamp %u.%u buildtype %u build %u", + ver->img_type == 0x01 ? "Bootloader" : "Firmware", + 2000 + (ver->timestamp >> 8), + ver->timestamp & 0xff, + ver->build_type, + ver->build_num); +} + static int iwmbt_patch_firmware(libusb_device_handle *hdl, const char *firmware_path) { @@ -227,10 +251,10 @@ iwmbt_patch_firmware(libusb_device_handle *hdl, const char *firmware_path) static int iwmbt_init_firmware(libusb_device_handle *hdl, const char *firmware_path, - uint32_t *boot_param) + uint32_t *boot_param, uint8_t hw_variant, uint8_t sbe_type) { struct iwmbt_firmware fw; - int ret; + int header_len, ret = -1; iwmbt_debug("loading %s", firmware_path); @@ -240,12 +264,76 @@ iwmbt_init_firmware(libusb_device_handle *hdl, const char *firmware_path, return (-1); } - /* Load in the firmware */ - ret = iwmbt_load_fwfile(hdl, &fw, boot_param); + iwmbt_debug("Firmware file size=%d", fw.len); + + if (hw_variant <= 0x14) { + /* + * Hardware variants 0x0b, 0x0c, 0x11 - 0x14 .sfi file have + * a RSA header of 644 bytes followed by Command Buffer. + */ + header_len = RSA_HEADER_LEN; + if (fw.len < header_len) { + iwmbt_err("Invalid size of firmware file (%d)", fw.len); + ret = -1; + goto exit; + } + + /* Check if the CSS Header version is RSA(0x00010000) */ + if (le32dec(fw.buf + CSS_HEADER_OFFSET) != 0x00010000) { + iwmbt_err("Invalid CSS Header version"); + ret = -1; + goto exit; + } + + /* Only RSA secure boot engine supported */ + if (sbe_type != 0x00) { + iwmbt_err("Invalid SBE type for hardware variant (%d)", + hw_variant); + ret = -1; + goto exit; + } + + } else if (hw_variant >= 0x17) { + /* + * Hardware variants 0x17, 0x18 onwards support both RSA and + * ECDSA secure boot engine. As a result, the corresponding sfi + * file will have RSA header of 644, ECDSA header of 320 bytes + * followed by Command Buffer. + */ + header_len = ECDSA_OFFSET + ECDSA_HEADER_LEN; + if (fw.len < header_len) { + iwmbt_err("Invalid size of firmware file (%d)", fw.len); + ret = -1; + goto exit; + } + + /* Check if CSS header for ECDSA follows the RSA header */ + if (fw.buf[ECDSA_OFFSET] != 0x06) { + ret = -1; + goto exit; + } + + /* Check if the CSS Header version is ECDSA(0x00020000) */ + if (le32dec(fw.buf + ECDSA_OFFSET + CSS_HEADER_OFFSET) != 0x00020000) { + iwmbt_err("Invalid CSS Header version"); + ret = -1; + goto exit; + } + } + + /* Load in the CSS header */ + if (sbe_type == 0x00) + ret = iwmbt_load_rsa_header(hdl, &fw); + else if (sbe_type == 0x01) + ret = iwmbt_load_ecdsa_header(hdl, &fw); if (ret < 0) - iwmbt_debug("Loading firmware file failed"); + goto exit; - /* free it */ + /* Load in the Command Buffer */ + ret = iwmbt_load_fwfile(hdl, &fw, boot_param, header_len); + +exit: + /* free firmware */ iwmbt_fw_free(&fw); return (ret); @@ -318,6 +406,7 @@ main(int argc, char *argv[]) libusb_device *dev = NULL; libusb_device_handle *hdl = NULL; static struct iwmbt_version ver; + static struct iwmbt_version_tlv ver_tlv; static struct iwmbt_boot_params params; uint32_t boot_param; int r; @@ -327,7 +416,7 @@ main(int argc, char *argv[]) char *firmware_dir = NULL; char *firmware_path = NULL; int retcode = 1; - int iwmbt_use_old_method = 0; + enum iwmbt_device iwmbt_device; /* Parse command line arguments */ while ((n = getopt(argc, argv, "Dd:f:hIm:p:v:")) != -1) { @@ -372,7 +461,7 @@ main(int argc, char *argv[]) iwmbt_debug("opening dev %d.%d", (int) bus_id, (int) dev_id); /* Find a device based on the bus/dev id */ - dev = iwmbt_find_device(ctx, bus_id, dev_id, &iwmbt_use_old_method); + dev = iwmbt_find_device(ctx, bus_id, dev_id, &iwmbt_device); if (dev == NULL) { iwmbt_err("device not found"); goto shutdown; @@ -401,16 +490,16 @@ main(int argc, char *argv[]) goto shutdown; } - /* Get Intel version */ - r = iwmbt_get_version(hdl, &ver); - if (r < 0) { - iwmbt_debug("iwmbt_get_version() failed code %d", r); - goto shutdown; - } - iwmbt_dump_version(&ver); - iwmbt_debug("fw_variant=0x%02x", (int) ver.fw_variant); + if (iwmbt_device == IWMBT_DEVICE_7260) { - if (iwmbt_use_old_method) { + /* Get Intel version */ + r = iwmbt_get_version(hdl, &ver); + if (r < 0) { + iwmbt_debug("iwmbt_get_version() failed code %d", r); + goto shutdown; + } + iwmbt_dump_version(&ver); + iwmbt_debug("fw_patch_num=0x%02x", (int) ver.fw_patch_num); /* fw_patch_num = >0 operational mode */ if (ver.fw_patch_num > 0x00) { @@ -469,7 +558,16 @@ main(int argc, char *argv[]) iwmbt_info("Intel Event Mask is set"); (void)iwmbt_exit_manufacturer(hdl, 0x00); - } else { + } else if (iwmbt_device == IWMBT_DEVICE_8260) { + + /* Get Intel version */ + r = iwmbt_get_version(hdl, &ver); + if (r < 0) { + iwmbt_debug("iwmbt_get_version() failed code %d", r); + goto shutdown; + } + iwmbt_dump_version(&ver); + iwmbt_debug("fw_variant=0x%02x", (int) ver.fw_variant); /* fw_variant = 0x06 bootloader mode / 0x23 operational mode */ if (ver.fw_variant == 0x23) { @@ -509,7 +607,7 @@ main(int argc, char *argv[]) iwmbt_debug("firmware_path = %s", firmware_path); /* Download firmware and parse it for magic Intel Reset parameter */ - r = iwmbt_init_firmware(hdl, firmware_path, &boot_param); + r = iwmbt_init_firmware(hdl, firmware_path, &boot_param, 0, 0); free(firmware_path); if (r < 0) goto shutdown; @@ -546,6 +644,93 @@ main(int argc, char *argv[]) r = iwmbt_set_event_mask(hdl); if (r == 0) iwmbt_info("Intel Event Mask is set"); + + } else { + + /* Get Intel version */ + r = iwmbt_get_version_tlv(hdl, &ver_tlv); + if (r < 0) { + iwmbt_debug("iwmbt_get_version_tlv() failed code %d", r); + goto shutdown; + } + iwmbt_dump_version_tlv(&ver_tlv); + iwmbt_debug("img_type=0x%02x", (int) ver_tlv.img_type); + + /* img_type = 0x01 bootloader mode / 0x03 operational mode */ + if (ver_tlv.img_type == 0x03) { + iwmbt_info("Firmware has already been downloaded"); + retcode = 0; + goto reset; + } + + if (ver_tlv.img_type != 0x01){ + iwmbt_err("unknown img_type 0x%02x", (int) ver_tlv.img_type); + goto shutdown; + } + + /* Check if firmware fragments are ACKed with a cmd complete event */ + if (ver_tlv.limited_cce != 0x00) { + iwmbt_err("Unsupported Intel firmware loading method (%u)", + ver_tlv.limited_cce); + goto shutdown; + } + + /* Check if secure boot engine is supported: 1 (ECDSA) or 0 (RSA) */ + if (ver_tlv.sbe_type > 0x01) { + iwmbt_err("Unsupported secure boot engine (%u)", + ver_tlv.sbe_type); + goto shutdown; + } + + /* Default the firmware path */ + if (firmware_dir == NULL) + firmware_dir = strdup(_DEFAULT_IWMBT_FIRMWARE_PATH); + + firmware_path = iwmbt_get_fwname_tlv(&ver_tlv, firmware_dir, "sfi"); + if (firmware_path == NULL) + goto shutdown; + + iwmbt_debug("firmware_path = %s", firmware_path); + + /* Download firmware and parse it for magic Intel Reset parameter */ + r = iwmbt_init_firmware(hdl, firmware_path, &boot_param, + ver_tlv.cnvi_bt >> 16 & 0x3f, ver_tlv.sbe_type); + free(firmware_path); + if (r < 0) + goto shutdown; + + r = iwmbt_intel_reset(hdl, boot_param); + if (r < 0) { + iwmbt_debug("iwmbt_intel_reset() failed!"); + goto shutdown; + } + + iwmbt_info("Firmware operational"); + + /* Once device is running in operational mode we can ignore failures */ + retcode = 0; + + /* Execute Read Intel Version one more time */ + r = iwmbt_get_version(hdl, &ver); + if (r == 0) + iwmbt_dump_version(&ver); + + /* Apply the device configuration (DDC) parameters */ + firmware_path = iwmbt_get_fwname_tlv(&ver_tlv, firmware_dir, "ddc"); + iwmbt_debug("ddc_path = %s", firmware_path); + if (firmware_path != NULL) { + r = iwmbt_init_ddc(hdl, firmware_path); + if (r == 0) + iwmbt_info("DDC download complete"); + free(firmware_path); + } + + /* Set Intel Event mask */ + r = iwmbt_set_event_mask(hdl); + if (r == 0) + iwmbt_info("Intel Event Mask is set"); + + iwmbt_info("Firmware download complete"); } reset: From nobody Wed Nov 6 23:31:53 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkM162N4Kz5c01D; Wed, 06 Nov 2024 23:31: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkM160MLGz4Lt4; Wed, 6 Nov 2024 23:31:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730935914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cMg8Nx8HrRnwSr3p2o4JWwa8gEOOiTDJBxYoTEvPfw8=; b=X/TtGEHoFJpl0KPOzZ973qVlI2WSv0rxEp1In09XZZcaYuF7+3ZGDhMxxcuoAvFkFgpArj huMcIQ9GLR5iDwyssaAqRj4ajiaHQqEh+6zWJWZ/q06DJz/4AAiKIbktajAP/9b5f5G38G SAWEIT9qOdyMqImvRGwjv4rwwTOg76aZFgp+rxC6loeiGZPqd5lwer6bNmAZZ4I4FkN8gO 625ToTF8OLOp9qkelW6QriY6ShPkTN2t3qRJNrWv+424WGagGR052nMD+w9HD+51lw4xPd uD1JEzY6QVGtrzrzTZdVVBxkJKfEMEyeoGxYFJ/hSt1F4LzJ1KtfxGcpbReDkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730935914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cMg8Nx8HrRnwSr3p2o4JWwa8gEOOiTDJBxYoTEvPfw8=; b=yDMad+ITRg0X0CDo2nKSn0zC2RCHcwrUb5aeOC0ufn/DFiDD6bMTdpjrqtch6RFMehTHLI mBz519fp68iPTsYVMhaGN6Q0BPpTLPPIOPJQAxHgX1if93S89l9jYTUoGSZORppN8G+v/U 4U2a6MCmZzfzP3qsuMsk1gIOFkVXFxvqghFJXZG5qGIwVrHZPPW7qNO+knOmWe8yoO55t/ QS20fc8hm00hSfsmHz9KKnJc4FmYKI5nA2sZ4wK03oVFb3xz5LSLZJ2xB/Aqmr399wVN0R f+JV+/mWAhLQRwZ1duN7HmpSzSyduhcPCF4XuAg/bic2R9AQkQ9f1SfvImSJNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730935914; a=rsa-sha256; cv=none; b=RSo0+bKw8yR0AjJ6xKP6R5noRWIOxINAtK+7Fek1D9n9aMR/SOBq2ZxO9QtSo4WCZ0+ksL eESTipJClbPd/jhKwytPa3+UppOOK6wLEt3amo+wveNkJVI0PTmad8eI68vWElB504wLl3 J5K7v5ZuGIR9h6L3KmwACOcoSTk/1cYiieovjgeAVlOzM6gI6FnPZf2H6laelSUwClpviP OCiTWoBcWm0wu/iprA2+QGRccQPmA0q53FGCEweEcgIF+3tBSsCpyPhkI+2Zfk6h2EKb+v XLq7syDLsx3ws45jO9je6i+H3+JVNLJH9cRSniTuxiemWr2h9EspK/+GxkkLBA== 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 4XkM1575VzzLc7; Wed, 6 Nov 2024 23:31:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A6NVrNW069918; Wed, 6 Nov 2024 23:31:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A6NVrCG069915; Wed, 6 Nov 2024 23:31:53 GMT (envelope-from git) Date: Wed, 6 Nov 2024 23:31:53 GMT Message-Id: <202411062331.4A6NVrCG069915@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 0b23c50ae834 - main - ng_ubt_intel: Ignore unexpected HCI events List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 0b23c50ae834d11842810304e4ddad2754298ada Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=0b23c50ae834d11842810304e4ddad2754298ada commit 0b23c50ae834d11842810304e4ddad2754298ada Author: Vladimir Kondratyev AuthorDate: 2024-11-06 23:27:20 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-11-06 23:27:20 +0000 ng_ubt_intel: Ignore unexpected HCI events If Intel firmware is already in operational mode at boot that takes place at warm boot, BT adaptor can generate extra HCI events which interferes with firmware mode detection logic. Ignore them. Sponsored by: Future Crew LLC MFC after: 1 month Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D46736 --- sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c | 27 +++++++++++++++++++++++ sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c | 5 +++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c index a63ccae3cc03..59405629efb1 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c @@ -534,6 +534,7 @@ static const STRUCT_USB_HOST_ID ubt_devs[] = * Size of both command and response buffers are passed in length field of * corresponding structures in "Parameter Total Length" format i.e. * not including HCI packet headers. + * Expected event code must be placed into "Event code" of the response buffer. * * Must not be used after USB transfers have been configured in attach routine. */ @@ -572,6 +573,12 @@ ubt_do_hci_request(struct usb_device *udev, struct ubt_hci_cmd *cmd, if (evt == NULL) return (USB_ERR_NORMAL_COMPLETION); + /* Save operation code if we expect completion event in response */ + if(((struct ubt_hci_event *)evt)->header.event == + NG_HCI_EVENT_COMMAND_COMPL) + ((struct ubt_hci_event_command_compl *)evt)->opcode = + cmd->opcode; + /* Initialize INTR endpoint xfer and wait for response */ mtx_init(&mtx, "ubt pb", NULL, MTX_DEF | MTX_NEW); @@ -842,6 +849,8 @@ ubt_probe_intr_callback(struct usb_xfer *xfer, usb_error_t error) struct ubt_hci_event *evt = usbd_xfer_softc(xfer); struct usb_page_cache *pc; int actlen; + struct ubt_hci_evhdr evhdr; + uint16_t opcode; usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); @@ -849,7 +858,25 @@ ubt_probe_intr_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_TRANSFERRED: if (actlen > UBT_HCI_EVENT_SIZE(evt)) actlen = UBT_HCI_EVENT_SIZE(evt); + if (actlen < sizeof(evhdr)) + goto submit_next; pc = usbd_xfer_get_frame(xfer, 0); + usbd_copy_out(pc, 0, &evhdr, sizeof(evhdr)); + /* Check for expected event code */ + if (evt->header.event != 0 && + (evt->header.event != evhdr.event)) + goto submit_next; + /* For completion events check operation code as well */ + if (evt->header.event == NG_HCI_EVENT_COMMAND_COMPL) { + if (actlen < sizeof(struct ubt_hci_event_command_compl)) + goto submit_next; + usbd_copy_out(pc, + offsetof(struct ubt_hci_event_command_compl, opcode), + &opcode, sizeof(opcode)); + if (opcode != + ((struct ubt_hci_event_command_compl *)evt)->opcode) + goto submit_next; + } usbd_copy_out(pc, 0, evt, actlen); /* OneShot mode */ wakeup(evt); diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c index f93b74b264ad..c4410b7b2c80 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c @@ -119,14 +119,14 @@ ubt_intel_do_hci_request(struct usb_device *udev, uint16_t opcode, cmd.opcode = htole16(opcode); evt = malloc(offsetof(struct ubt_hci_event_command_compl, data) + resp_len, M_TEMP, M_ZERO | M_WAITOK); + evt->header.event = NG_HCI_EVENT_COMMAND_COMPL; evt->header.length = resp_len + UBT_HCI_EVENT_COMPL_HEAD_SIZE; error = ubt_do_hci_request(udev, &cmd, evt, UBT_INTEL_HCICMD_TIMEOUT); if (error != USB_ERR_NORMAL_COMPLETION) goto exit; - if (evt->header.event == NG_HCI_EVENT_COMMAND_COMPL && - evt->header.length == resp_len + UBT_HCI_EVENT_COMPL_HEAD_SIZE) + if (evt->header.length == resp_len + UBT_HCI_EVENT_COMPL_HEAD_SIZE) memcpy(resp, evt->data, resp_len); else error = USB_ERR_INVAL; @@ -150,6 +150,7 @@ ubt_intel_get_img_type(struct usb_device *udev) uint8_t *data; evt = malloc(UBT_INTEL_MAX_EVT_SIZE, M_TEMP, M_ZERO | M_WAITOK); + evt->header.event = NG_HCI_EVENT_COMMAND_COMPL; evt->header.length = UBT_INTEL_MAX_EVT_SIZE - sizeof(struct ubt_hci_evhdr); From nobody Wed Nov 6 23:31:55 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkM172K37z5c0Nl; Wed, 06 Nov 2024 23:31: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkM171gjVz4LtL; Wed, 6 Nov 2024 23:31:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730935915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ihtha4jDNtjnYfQJaNatJTzQu/CA1VlGpeCcRDuju9c=; b=IpHIchABucaWQZqlw/TeLf1n+t0YkyHCWRsVFU8z5RN5CvDT6+B1/LpljgJL4IOlrig+z2 K/NnImBkdampntTzmgow8V2cqKpE0Q8ktbtMdEKH384T0T5VhntlIjYEjA9JxhCUUivd/A HWcM1hd3D7DP88f/x0NYCkrQLXl4M2tBvBzl6ItO1gaYt1C8/fhbyI2rvAk2VZGRrpOqrw SI/PFtC6IIguqtWyTrgLC8FLl1FmB4sMreBWP8LJl6hl129Ar/QxQXQtTTkdchyhcs39vm aOiHi5wlLWcN2tkXThjZtR1z4j3uPDVb53pRHrhGkn3mSCLPm+BhVK1pXf2gJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730935915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ihtha4jDNtjnYfQJaNatJTzQu/CA1VlGpeCcRDuju9c=; b=R+VNlFfYgS7H2xRBPcGb1B8muEbRg8Nb71QyGoM9l4KUh2K5vIbxCG+TSQVx8lH+Lv5Zkb iZ98KNYsgdnrhzsPYc1/st/PtPLi2rPGtTY6/5wWuCX1i/Z3kPSoXSFGIpLHvHm7tgagGA CNTliMfVMkeZ0c5s6d1to3i+463LHhGFqvJblckUVSuS8MrQ+BGvH/7gAQ7TzKRFWQAZSi dHlcSi/opQIuPFdwfsvsQeuZu1d3d2TL6KENLfut0tBsdO/PSCKukWb7Q4EyubWa+Kcb86 7ClD37/ewETf2YNQDqzUJaLm84ShGjwDlFEaRl7H0+loLrJ2StKLfvrSrzel9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730935915; a=rsa-sha256; cv=none; b=TgRCCqsB2oNrZzK56+fanbuMoIKOHTe0Oc2pBaQNvrAF7bOMNkNdSRITKbNiqaPNDcypqr cDHOc7FN9STASyQrw8HEMoz/5GRB1wEIPit+GGB2fFcs4ejSAld/Pc9MZjHHF+LNDwEY66 CUI1g1/VrAVkbvxneFD36w6oHHBVyqRyZoUMl3FPuNwzaPHqjLATLc+FSczOQyawZ6yVLx MH8tkpqDdcOWDsgfXvFNSvuffDil8KAIIOvEKxZpafw1quQwWwP3K+jcs/K8r203R3ut4i BsHamjM8nateiIG4Vtia0Xl59Cw5u4wHWO6npeoET/eg+HNB6WKNZKtME5Z0vw== 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 4XkM171GMbzL7d; Wed, 6 Nov 2024 23:31:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A6NVtjA069960; Wed, 6 Nov 2024 23:31:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A6NVt5g069957; Wed, 6 Nov 2024 23:31:55 GMT (envelope-from git) Date: Wed, 6 Nov 2024 23:31:55 GMT Message-Id: <202411062331.4A6NVt5g069957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: aa0b938434a8 - main - iwmbtfw(8): Ignore unexpected HCI events List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: aa0b938434a8af8eebf8f2634914f2d9fe8a5dc4 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=aa0b938434a8af8eebf8f2634914f2d9fe8a5dc4 commit aa0b938434a8af8eebf8f2634914f2d9fe8a5dc4 Author: Vladimir Kondratyev AuthorDate: 2024-11-06 23:27:48 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-11-06 23:27:48 +0000 iwmbtfw(8): Ignore unexpected HCI events If Intel firmware is already in operational mode at boot that takes place at warm boot, BT adaptor can generate extra HCI events which interferes with firmware mode detection logic. Ignore them. Sponsored by: Future Crew LLC MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46737 --- usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c | 58 +++++++++++++++++++++++++++-------- usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h | 6 ++++ 2 files changed, 52 insertions(+), 12 deletions(-) diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c index 05a851f9d85b..1efd24ecf9f6 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.c @@ -37,10 +37,13 @@ #include #include #include +#include #include #include +#include + #include "iwmbt_fw.h" #include "iwmbt_hw.h" #include "iwmbt_dbg.h" @@ -95,6 +98,7 @@ static int iwmbt_hci_command(struct libusb_device_handle *hdl, struct iwmbt_hci_cmd *cmd, void *event, int size, int *transferred, int timeout) { + struct timespec to, now, remains; int ret; ret = libusb_control_transfer(hdl, @@ -112,18 +116,47 @@ iwmbt_hci_command(struct libusb_device_handle *hdl, struct iwmbt_hci_cmd *cmd, return (ret); } - ret = libusb_interrupt_transfer(hdl, - IWMBT_INTERRUPT_ENDPOINT_ADDR, - event, - size, - transferred, - timeout); + clock_gettime(CLOCK_MONOTONIC, &now); + to = IWMBT_MSEC2TS(timeout); + timespecadd(&to, &now, &to); - if (ret < 0) - iwmbt_err("libusb_interrupt_transfer() failed: err=%s", - libusb_strerror(ret)); + do { + timespecsub(&to, &now, &remains); + ret = libusb_interrupt_transfer(hdl, + IWMBT_INTERRUPT_ENDPOINT_ADDR, + event, + size, + transferred, + IWMBT_TS2MSEC(remains) + 1); - return (ret); + if (ret < 0) { + iwmbt_err("libusb_interrupt_transfer() failed: err=%s", + libusb_strerror(ret)); + return (ret); + } + + switch (((struct iwmbt_hci_event *)event)->header.event) { + case NG_HCI_EVENT_COMMAND_COMPL: + if (*transferred < + (int)offsetof(struct iwmbt_hci_event_cmd_compl, data)) + break; + if (cmd->opcode != + ((struct iwmbt_hci_event_cmd_compl *)event)->opcode) + break; + /* FALLTHROUGH */ + case 0xFF: + return (0); + default: + break; + } + iwmbt_debug("Stray HCI event: %x", + ((struct iwmbt_hci_event *)event)->header.event); + } while (timespeccmp(&to, &now, >)); + + iwmbt_err("libusb_interrupt_transfer() failed: err=%s", + libusb_strerror(LIBUSB_ERROR_TIMEOUT)); + + return (LIBUSB_ERROR_TIMEOUT); } int @@ -691,6 +724,7 @@ iwmbt_load_ddc(struct libusb_device_handle *hdl, int size, sent = 0; int ret, transferred; uint8_t buf[IWMBT_HCI_MAX_CMD_SIZE]; + uint8_t evt[IWMBT_HCI_MAX_CMD_SIZE]; struct iwmbt_hci_cmd *cmd = (struct iwmbt_hci_cmd *)buf; size = ddc->len; @@ -713,8 +747,8 @@ iwmbt_load_ddc(struct libusb_device_handle *hdl, ret = iwmbt_hci_command(hdl, cmd, - buf, - sizeof(buf), + evt, + sizeof(evt), &transferred, IWMBT_HCI_CMD_TIMEOUT); diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h index 9467c3807a2a..89ee344fe587 100644 --- a/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h +++ b/usr.sbin/bluetooth/iwmbtfw/iwmbt_hw.h @@ -72,6 +72,12 @@ struct iwmbt_hci_event_cmd_compl { #define IWMBT_HCI_MAX_CMD_SIZE 256 #define IWMBT_HCI_MAX_EVENT_SIZE 16 +#define IWMBT_MSEC2TS(msec) \ + (struct timespec) { \ + .tv_sec = (msec) / 1000, \ + .tv_nsec = ((msec) % 1000) * 1000000 \ + }; +#define IWMBT_TS2MSEC(ts) ((ts).tv_sec * 1000 + (ts).tv_nsec / 1000000) #define IWMBT_HCI_CMD_TIMEOUT 2000 /* ms */ #define IWMBT_LOADCMPL_TIMEOUT 5000 /* ms */ From nobody Wed Nov 6 23:31:56 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkM184ySGz5c0YW; Wed, 06 Nov 2024 23:31: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkM182ntJz4Ltl; Wed, 6 Nov 2024 23:31:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730935916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jqqnU7r2k7eq+nRcZf3oyuxECbjLyL9n5c8zcYXBnPw=; b=aJF7dAJevkMJeZ4vhvaz8g1PBcQZfZuGUIGwhdCIMA+SKkFMfeROf9tk8FvQ6baQ+VtbMU eAV12GueLCmrcFicaSSOOKxAKVtp/TMafMkVwAdhbD6+De6ng0i7WtNi+VT78GJl1Y0wYu CnSyOWEqElvfZt0Nchp57S7yqBvieKbUCAifkDaY2Ahv/ypsSGFKXqREbhDAhas8f/Ps2r xcNQV7IvCQya9bmtYtqN/CPz6T8TVg9BOhk9ZW/j1kQYZgQPzGs80vZ5L/eEfIeHh6BUiN kl4iFB4Uj4LjPMZjft234FyytkwPQqakWmXBmPZGbP90fGpylVNUIrvifq6Y/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730935916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jqqnU7r2k7eq+nRcZf3oyuxECbjLyL9n5c8zcYXBnPw=; b=ClV3NOp+y0AtM8N5dQ2uptoPWSJVOIhSc30Ft+eWuq/5e4ZHaRfocLn/iPhXeYk2EcI8Wt 83RfV6ZIe/nJw/Z4TB28LLPiB+qLFg+ciKlxp3CtqJMTx/dj0542RXVh4f1yK6TKlaM/AE ARfo0zwD48pcZi9CCRh3Hcoe/PNXhmY0Ykp2BsNCR6O2iutpOUDl3i2UOpC4euPyuBfJ/d Cu27Jq/IH9odwWbr4Vy5XxTwr7IguKxQjMzAg46nmpGm27rAvEa6WiLizB5KEhtkwWKu17 zMXRKvs9VcF5lUX9GCQ0eoi3RqSD5/IWVIvlUScbaRqxhc9fSREz80LNcBT3fA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730935916; a=rsa-sha256; cv=none; b=E2MZyPFxoApOe8H3+YLh1YOS3TYLahZ9Ckkd98tfo6/ulDh6e6eUe086n4avhWO3iHrHmN NVUDpi5H4utVQLJ1gjFz7ckWyjYhNXdPBCZbAGGfI2uBeCT2t80cIWdCMm7McInumMSx6g hml+iyfZQUtcDGCNn5LkCdL9wngXZcMvVfKDxu1hbvW1cHqs6EnUfLQQNJrdgdtsYItrhT A3TK1vjIoSMzZ9/jZOjmW4HPhBS87iGZdalHHNsv6LeU0xb03tP6RS5N8yQyFzQV7Ux/ss 8i4KHGiNMon/5m3wLxEbSD50SbeiTHMSyMwG9/Uo2LtYEn+/dc0PNoEIY4FbBQ== 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 4XkM182PF3zLs8; Wed, 6 Nov 2024 23:31:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A6NVueo070021; Wed, 6 Nov 2024 23:31:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A6NVuiE070018; Wed, 6 Nov 2024 23:31:56 GMT (envelope-from git) Date: Wed, 6 Nov 2024 23:31:56 GMT Message-Id: <202411062331.4A6NVuiE070018@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 24ae172a5035 - main - ng_ubt(4): do not attach Realtek 87XX/88XX adaptors in bootloader mode. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 24ae172a50352ad4fd22989477f29ecca5aed6e3 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=24ae172a50352ad4fd22989477f29ecca5aed6e3 commit 24ae172a50352ad4fd22989477f29ecca5aed6e3 Author: Vladimir Kondratyev AuthorDate: 2024-11-06 23:28:11 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-11-06 23:28:11 +0000 ng_ubt(4): do not attach Realtek 87XX/88XX adaptors in bootloader mode. Attempt to initialize FreeBSD bluetooth stack while such a device is in bootloader mode locks the adapter hardly so it requires power on/off cycle to restore. This change blocks ng_ubt attachment unless operational firmware is loaded thus preventing the lock up. Sponsored by: Future Crew LLC MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46738 --- sys/conf/files | 1 + sys/modules/netgraph/bluetooth/ubt/Makefile | 4 +- sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c | 3 + sys/netgraph/bluetooth/drivers/ubt/ng_ubt_rtl.c | 265 ++++++++++++++++++++++++ sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h | 3 + 5 files changed, 274 insertions(+), 2 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 7bf2cffe8b09..7818104b8d50 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4267,6 +4267,7 @@ net80211/ieee80211_alq.c optional wlan ieee80211_alq netgraph/bluetooth/common/ng_bluetooth.c optional netgraph_bluetooth netgraph/bluetooth/drivers/ubt/ng_ubt.c optional netgraph_bluetooth_ubt usb netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c optional netgraph_bluetooth_ubt usb +netgraph/bluetooth/drivers/ubt/ng_ubt_rtl.c optional netgraph_bluetooth_ubt usb netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c optional netgraph_bluetooth_ubtbcmfw usb netgraph/bluetooth/hci/ng_hci_cmds.c optional netgraph_bluetooth_hci netgraph/bluetooth/hci/ng_hci_evnt.c optional netgraph_bluetooth_hci diff --git a/sys/modules/netgraph/bluetooth/ubt/Makefile b/sys/modules/netgraph/bluetooth/ubt/Makefile index 6ef7da5fbfb2..1d95fd567888 100644 --- a/sys/modules/netgraph/bluetooth/ubt/Makefile +++ b/sys/modules/netgraph/bluetooth/ubt/Makefile @@ -6,7 +6,7 @@ CFLAGS+= -I${SRCTOP}/sys/netgraph/bluetooth/include \ -I${SRCTOP}/sys/netgraph/bluetooth/drivers/ubt KMOD= ng_ubt -SRCS= ng_ubt.c ng_ubt_intel.c opt_bus.h opt_usb.h device_if.h \ - bus_if.h usb_if.h usbdevs.h +SRCS= ng_ubt.c ng_ubt_intel.c ng_ubt_rtl.c opt_bus.h opt_usb.h \ + device_if.h bus_if.h usb_if.h usbdevs.h .include diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c index 59405629efb1..def589107725 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c @@ -625,6 +625,9 @@ ubt_probe(device_t dev) if (usbd_lookup_id_by_uaa(ubt_ignore_devs, sizeof(ubt_ignore_devs), uaa) == 0) return (ENXIO); + if (usbd_lookup_id_by_uaa(ubt_rtl_devs, + ubt_rtl_devs_sizeof, uaa) == 0) + return (ENXIO); id = usbd_lookup_id_by_info(ubt_devs, sizeof(ubt_devs), &uaa->info); diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_rtl.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_rtl.c new file mode 100644 index 000000000000..b9fbc1c12a29 --- /dev/null +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_rtl.c @@ -0,0 +1,265 @@ +/* + * ng_ubt_rtl.c + */ + +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Vladimir Kondratyev + * Copyright (c) 2023 Future Crew LLC. + * + * 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. + */ + +/* + * Attempt to initialize FreeBSD bluetooth stack while Realtek 87XX/88XX USB + * device is in bootloader mode locks the adapter hardly so it requires power + * on/off cycle to restore. This driver blocks ng_ubt attachment until + * operational firmware is loaded by rtlbtfw utility thus avoiding the lock up. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "usbdevs.h" +#include +#include +#define USB_DEBUG_VAR usb_debug +#include + +#include +#include +#include +#include +#include +#include +#include + +static device_probe_t ubt_rtl_probe; + +/* + * List of supported bluetooth devices. If you add a new device PID here ensure + * that it is blacklisted in ng_ubt.c and is supported by rtlbtfw utility. + */ + +const STRUCT_USB_HOST_ID ubt_rtl_devs[] = +{ + /* Generic Realtek Bluetooth class devices */ + { USB_VENDOR(USB_VENDOR_REALTEK), + USB_IFACE_CLASS(UDCLASS_WIRELESS), + USB_IFACE_SUBCLASS(UDSUBCLASS_RF), + USB_IFACE_PROTOCOL(UDPROTO_BLUETOOTH) }, + + /* Realtek 8821CE Bluetooth devices */ + { USB_VPI(0x13d3, 0x3529, 0) }, + + /* Realtek 8822CE Bluetooth devices */ + { USB_VPI(0x0bda, 0xb00c, 0) }, + { USB_VPI(0x0bda, 0xc822, 0) }, + + /* Realtek 8822CU Bluetooth devices */ + { USB_VPI(0x13d3, 0x3549, 0) }, + + /* Realtek 8852AE Bluetooth devices */ + { USB_VPI(0x0bda, 0x2852, 0) }, + { USB_VPI(0x0bda, 0xc852, 0) }, + { USB_VPI(0x0bda, 0x385a, 0) }, + { USB_VPI(0x0bda, 0x4852, 0) }, + { USB_VPI(0x04c5, 0x165c, 0) }, + { USB_VPI(0x04ca, 0x4006, 0) }, + { USB_VPI(0x0cb8, 0xc549, 0) }, + + /* Realtek 8852CE Bluetooth devices */ + { USB_VPI(0x04ca, 0x4007, 0) }, + { USB_VPI(0x04c5, 0x1675, 0) }, + { USB_VPI(0x0cb8, 0xc558, 0) }, + { USB_VPI(0x13d3, 0x3587, 0) }, + { USB_VPI(0x13d3, 0x3586, 0) }, + { USB_VPI(0x13d3, 0x3592, 0) }, + + /* Realtek 8852BE Bluetooth devices */ + { USB_VPI(0x0cb8, 0xc559, 0) }, + { USB_VPI(0x0bda, 0x887b, 0) }, + { USB_VPI(0x13d3, 0x3571, 0) }, + + /* Realtek 8723AE Bluetooth devices */ + { USB_VPI(0x0930, 0x021d, 0) }, + { USB_VPI(0x13d3, 0x3394, 0) }, + + /* Realtek 8723BE Bluetooth devices */ + { USB_VPI(0x0489, 0xe085, 0) }, + { USB_VPI(0x0489, 0xe08b, 0) }, + { USB_VPI(0x04f2, 0xb49f, 0) }, + { USB_VPI(0x13d3, 0x3410, 0) }, + { USB_VPI(0x13d3, 0x3416, 0) }, + { USB_VPI(0x13d3, 0x3459, 0) }, + { USB_VPI(0x13d3, 0x3494, 0) }, + + /* Realtek 8723BU Bluetooth devices */ + { USB_VPI(0x7392, 0xa611, 0) }, + + /* Realtek 8723DE Bluetooth devices */ + { USB_VPI(0x0bda, 0xb009, 0) }, + { USB_VPI(0x2ff8, 0xb011, 0) }, + + /* Realtek 8761BUV Bluetooth devices */ + { USB_VPI(0x2357, 0x0604, 0) }, + { USB_VPI(0x0b05, 0x190e, 0) }, + { USB_VPI(0x2550, 0x8761, 0) }, + { USB_VPI(0x0bda, 0x8771, 0) }, + { USB_VPI(0x6655, 0x8771, 0) }, + { USB_VPI(0x7392, 0xc611, 0) }, + { USB_VPI(0x2b89, 0x8761, 0) }, + + /* Realtek 8821AE Bluetooth devices */ + { USB_VPI(0x0b05, 0x17dc, 0) }, + { USB_VPI(0x13d3, 0x3414, 0) }, + { USB_VPI(0x13d3, 0x3458, 0) }, + { USB_VPI(0x13d3, 0x3461, 0) }, + { USB_VPI(0x13d3, 0x3462, 0) }, + + /* Realtek 8822BE Bluetooth devices */ + { USB_VPI(0x13d3, 0x3526, 0) }, + { USB_VPI(0x0b05, 0x185c, 0) }, + + /* Realtek 8822CE Bluetooth devices */ + { USB_VPI(0x04ca, 0x4005, 0) }, + { USB_VPI(0x04c5, 0x161f, 0) }, + { USB_VPI(0x0b05, 0x18ef, 0) }, + { USB_VPI(0x13d3, 0x3548, 0) }, + { USB_VPI(0x13d3, 0x3549, 0) }, + { USB_VPI(0x13d3, 0x3553, 0) }, + { USB_VPI(0x13d3, 0x3555, 0) }, + { USB_VPI(0x2ff8, 0x3051, 0) }, + { USB_VPI(0x1358, 0xc123, 0) }, + { USB_VPI(0x0bda, 0xc123, 0) }, + { USB_VPI(0x0cb5, 0xc547, 0) }, +}; +const size_t ubt_rtl_devs_sizeof = sizeof(ubt_rtl_devs); + +/* + * List of lmp_subversion values that correspond to Realtek firmwares + * incompatible with ng_ubt driver. Alternative firmware for these devices + * has to be loaded with rtlbtfw utility. That will trigger lmp_subversion + * change to different value. + */ +static const uint16_t ubt_rtl_lmp_subvers[] = { + 0x8703, 0x1200, 0x8723, 0x8821, + 0x8761, 0x8822, 0x8852, 0x8851, +}; + +/* + * Execute generic HCI command and return response in provided buffer. + */ + +static usb_error_t +ubt_rtl_do_hci_request(struct usb_device *udev, uint16_t opcode, + void *resp, uint8_t resp_len) +{ +#define UBT_RTL_HCICMD_TIMEOUT 2000 /* ms */ + struct ubt_hci_event_command_compl *evt; + struct ubt_hci_cmd cmd; + usb_error_t error; + + memset(&cmd, 0, sizeof(cmd)); + cmd.opcode = htole16(opcode); + evt = malloc(offsetof(struct ubt_hci_event_command_compl, data) + + resp_len, M_TEMP, M_ZERO | M_WAITOK); + evt->header.event = NG_HCI_EVENT_COMMAND_COMPL; + evt->header.length = resp_len + UBT_HCI_EVENT_COMPL_HEAD_SIZE; + + error = ubt_do_hci_request(udev, &cmd, evt, UBT_RTL_HCICMD_TIMEOUT); + if (error != USB_ERR_NORMAL_COMPLETION) + goto exit; + + if (evt->header.event == NG_HCI_EVENT_COMMAND_COMPL && + evt->header.length == resp_len + UBT_HCI_EVENT_COMPL_HEAD_SIZE) + memcpy(resp, evt->data, resp_len); + else + error = USB_ERR_INVAL; +exit: + free(evt, M_TEMP); + return (error); +} + +/* + * Probe for a Realtek 87XX/88XX USB Bluetooth device. + */ + +static int +ubt_rtl_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + ng_hci_read_local_ver_rp ver; + unsigned int i; + int error; + + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + + if (uaa->info.bIfaceIndex != 0) + return (ENXIO); + + error = usbd_lookup_id_by_uaa(ubt_rtl_devs, sizeof(ubt_rtl_devs), uaa); + if (error != 0) + return (error); + + if (ubt_rtl_do_hci_request(uaa->device, + NG_HCI_OPCODE(NG_HCI_OGF_INFO, NG_HCI_OCF_READ_LOCAL_VER), + &ver, sizeof(ver)) != USB_ERR_NORMAL_COMPLETION) + return (ENXIO); + + DPRINTFN(2, "hci_version 0x%02x\n", ver.hci_version); + DPRINTFN(2, "hci_revision 0x%04x\n", le16toh(ver.hci_revision)); + DPRINTFN(2, "lmp_version 0x%02x\n", ver.lmp_version); + DPRINTFN(2, "lmp_subversion 0x%04x\n", le16toh(ver.lmp_subversion)); + + for (i = 0; i < nitems(ubt_rtl_lmp_subvers); i++) + if (le16toh(ver.lmp_subversion) == ubt_rtl_lmp_subvers[i]) + return (ENXIO); + + return (BUS_PROBE_DEFAULT); +} + +/* + * Module interface. Attach and detach methods, netgraph node type + * registration and PNP string are inherited from ng_ubt.c driver. + */ + +static device_method_t ubt_rtl_methods[] = +{ + DEVMETHOD(device_probe, ubt_rtl_probe), + DEVMETHOD_END +}; + +DEFINE_CLASS_1(ubt, ubt_rtl_driver, ubt_rtl_methods, + sizeof(struct ubt_softc), ubt_driver); +DRIVER_MODULE(ng_ubt_rtl, uhub, ubt_rtl_driver, 0, 0); +MODULE_VERSION(ng_ubt_rtl, NG_BLUETOOTH_VERSION); +MODULE_DEPEND(ng_ubt_rtl, netgraph, NG_ABI_VERSION, NG_ABI_VERSION, NG_ABI_VERSION); +MODULE_DEPEND(ng_ubt_rtl, ng_hci, NG_BLUETOOTH_VERSION, NG_BLUETOOTH_VERSION, NG_BLUETOOTH_VERSION); +MODULE_DEPEND(ng_ubt_rtl, usb, 1, 1, 1); diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h index 7b97ad245a68..a48a6732f5a8 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h @@ -164,6 +164,9 @@ typedef struct ubt_softc * ubt_softc_p; usb_error_t ubt_do_hci_request(struct usb_device *, struct ubt_hci_cmd *, void *, usb_timeout_t); +extern const STRUCT_USB_HOST_ID ubt_rtl_devs[]; +extern const size_t ubt_rtl_devs_sizeof; + extern driver_t ubt_driver; #endif /* ndef _NG_UBT_VAR_H_ */ From nobody Wed Nov 6 23:31:57 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkM194P70z5c0RW; Wed, 06 Nov 2024 23:31:57 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkM193P8Xz4M9C; Wed, 6 Nov 2024 23:31:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730935917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZsAWSdrZgHCu9VBO7KavlGarGvWKSZCHgbVt4RV/UgE=; b=Ts9hEWXZLhBPLlOKUrNBBnP6+Ulur/aXrhE74hZZuKLXWCLc2M9O5LptlNkeP/IDkTkBIN AfaBnBiVCgWFhFa4jgJeX+N3sVeEUVjqQgLPhl7XBC2mGYSZlu1OMzfjnJHy0ZhgRtVHvp mAco4hmwTcsbfJVSFga6H3mdrDI26qEZdSLLiKuJ5OFtVhBAyRENXBjxq6p4dE+M5COyyM AKoqo9Wcx+n0TirlcaksJdkchBQaAWJsFieXIr9G4d0N99/fTU6zO5b1MZhNN2o5rnDg5x 5X9NVr9ajx82ynptAAYHIFIK22zLTVQUHdlIi4JRbMVodd5ASkkn2lxTxnjl4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730935917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZsAWSdrZgHCu9VBO7KavlGarGvWKSZCHgbVt4RV/UgE=; b=xJLLCyJ38HMEzKNB/vzqIsYzAcNrINWe511xvlQkxBNXhGnwwdVeNn/KewIKsN6sSNFX5x 7sUBrZmTIw5yTuPwiLAWNQkkzTh7AMmyuH3ojy1UHMQr77RvrLOWO69W1l+if62LdUZrWf j0Z2HkVhvV1Wp2Ik/ktUKET64g+lAxwZwVLJGoHCRPwr1/K+Fh0eaISIlQV7FNQrOHHGat vTHMjJ7oMnXByHvhk7OO4rEH/JfHixj2+OS3R7PgIQW6uuHF3Uy89xVhIsd17VUtefuj/O HJYZu0uFT2G7z/0d34uJdN0p8OkHdbuA2AJjpJuPggRZLjjjNnnysoUWeTaWhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730935917; a=rsa-sha256; cv=none; b=n2KUhiWR+s099YbK2SwJfqvJ/vKAbzPgd2C0EmK7H1I1xtIXy2UsgD5TeOM9E7rthBJE0X lrsljrlsI1g2iDvGhcjuHNe8r7ChbYxnwnPslpBeupaW0hNGLoIfGpUmw7nRnn2j8Y6kee /giJpqtPuZF47rD2rMKgtNIBqK6KL/3zzIGyezpjCR78x+lKxscNcD3AiaqN+GWRgjlBoO nhLOT7A2phw7YzCNfpcPgQ4Aa0XHpsoO7BAx5cRTn0zA/mHfGSrUqeWnPujxUgb0JZ1TXC Voh02fg7kj5LsRQwPM4eo0+YU1swgHsfd3ERze2tRxvkflG1YUHcbLu13j72og== 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 4XkM192qZDzL7p; Wed, 6 Nov 2024 23:31:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A6NVvFp070077; Wed, 6 Nov 2024 23:31:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A6NVv8o070074; Wed, 6 Nov 2024 23:31:57 GMT (envelope-from git) Date: Wed, 6 Nov 2024 23:31:57 GMT Message-Id: <202411062331.4A6NVv8o070074@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 5036d9652a57 - main - rtlbtfw: Firmware loader for Realtek 87XX/88XX bluetooth USB adaptors List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 5036d9652a5701d00e9e40ea942c278e9f77d33d Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=5036d9652a5701d00e9e40ea942c278e9f77d33d commit 5036d9652a5701d00e9e40ea942c278e9f77d33d Author: Vladimir Kondratyev AuthorDate: 2024-11-06 23:28:49 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-11-06 23:30:29 +0000 rtlbtfw: Firmware loader for Realtek 87XX/88XX bluetooth USB adaptors Firmware files are available in the comms/rtlbt-firmware port. Sponsored by: Future Crew LLC MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46739 --- targets/pseudo/userland/Makefile.depend | 1 + tools/build/mk/OptionalObsoleteFiles.inc | 3 + usr.sbin/bluetooth/Makefile | 1 + usr.sbin/bluetooth/rtlbtfw/Makefile | 9 + usr.sbin/bluetooth/rtlbtfw/main.c | 525 +++++++++++++++++++++++++++++++ usr.sbin/bluetooth/rtlbtfw/rtlbt_dbg.h | 46 +++ usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c | 385 +++++++++++++++++++++++ usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.h | 92 ++++++ usr.sbin/bluetooth/rtlbtfw/rtlbt_hw.c | 236 ++++++++++++++ usr.sbin/bluetooth/rtlbtfw/rtlbt_hw.h | 104 ++++++ usr.sbin/bluetooth/rtlbtfw/rtlbtfw.8 | 100 ++++++ usr.sbin/bluetooth/rtlbtfw/rtlbtfw.conf | 373 ++++++++++++++++++++++ 12 files changed, 1875 insertions(+) diff --git a/targets/pseudo/userland/Makefile.depend b/targets/pseudo/userland/Makefile.depend index 6a844630c999..698db40042ef 100644 --- a/targets/pseudo/userland/Makefile.depend +++ b/targets/pseudo/userland/Makefile.depend @@ -430,6 +430,7 @@ DIRDEPS+= \ usr.sbin/bluetooth/l2control \ usr.sbin/bluetooth/l2ping \ usr.sbin/bluetooth/rfcomm_pppd \ + usr.sbin/bluetooth/rtlbtfw \ usr.sbin/bluetooth/sdpcontrol \ usr.sbin/bluetooth/sdpd \ usr.sbin/bootparamd/bootparamd \ diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index da2f0c15d11e..c03611c976a6 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -193,6 +193,7 @@ OLD_FILES+=etc/bluetooth/hosts OLD_FILES+=etc/bluetooth/protocols OLD_FILES+=etc/defaults/bluetooth.device.conf OLD_FILES+=etc/devd/iwmbtfw.conf +OLD_FILES+=etc/devd/rtlbtfw.conf OLD_DIRS+=etc/bluetooth OLD_FILES+=etc/rc.d/bluetooth OLD_FILES+=etc/rc.d/bthidd @@ -240,6 +241,7 @@ OLD_FILES+=usr/sbin/iwmbtfw OLD_FILES+=usr/sbin/l2control OLD_FILES+=usr/sbin/l2ping OLD_FILES+=usr/sbin/rfcomm_pppd +OLD_FILES+=usr/sbin/rtlbtfw OLD_FILES+=usr/sbin/sdpcontrol OLD_FILES+=usr/sbin/sdpd OLD_FILES+=usr/share/examples/etc/defaults/bluetooth.device.conf @@ -318,6 +320,7 @@ OLD_FILES+=usr/share/man/man8/iwmbtfw.8.gz OLD_FILES+=usr/share/man/man8/l2control.8.gz OLD_FILES+=usr/share/man/man8/l2ping.8.gz OLD_FILES+=usr/share/man/man8/rfcomm_pppd.8.gz +OLD_FILES+=usr/share/man/man8/rtlbtfw.8.gz OLD_FILES+=usr/share/man/man8/sdpcontrol.8.gz OLD_FILES+=usr/share/man/man8/sdpd.8.gz .endif diff --git a/usr.sbin/bluetooth/Makefile b/usr.sbin/bluetooth/Makefile index fb660029b3d1..5afc12450194 100644 --- a/usr.sbin/bluetooth/Makefile +++ b/usr.sbin/bluetooth/Makefile @@ -19,6 +19,7 @@ SUBDIR+= bcmfw SUBDIR+= bthidcontrol SUBDIR+= bthidd SUBDIR+= iwmbtfw +SUBDIR+= rtlbtfw .endif .include diff --git a/usr.sbin/bluetooth/rtlbtfw/Makefile b/usr.sbin/bluetooth/rtlbtfw/Makefile new file mode 100644 index 000000000000..f9c5dfd12b1f --- /dev/null +++ b/usr.sbin/bluetooth/rtlbtfw/Makefile @@ -0,0 +1,9 @@ +PACKAGE= bluetooth +CONFS= rtlbtfw.conf +CONFSDIR= /etc/devd +PROG= rtlbtfw +MAN= rtlbtfw.8 +LIBADD+= usb +SRCS= main.c rtlbt_fw.c rtlbt_hw.c + +.include diff --git a/usr.sbin/bluetooth/rtlbtfw/main.c b/usr.sbin/bluetooth/rtlbtfw/main.c new file mode 100644 index 000000000000..029c04f98b26 --- /dev/null +++ b/usr.sbin/bluetooth/rtlbtfw/main.c @@ -0,0 +1,525 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2013 Adrian Chadd + * Copyright (c) 2019 Vladimir Kondratyev + * Copyright (c) 2023 Future Crew LLC. + * + * 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 +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "rtlbt_fw.h" +#include "rtlbt_hw.h" +#include "rtlbt_dbg.h" + +#define _DEFAULT_RTLBT_FIRMWARE_PATH "/usr/share/firmware/rtlbt" + +int rtlbt_do_debug = 0; +int rtlbt_do_info = 0; + +struct rtlbt_devid { + uint16_t product_id; + uint16_t vendor_id; +}; + +static struct rtlbt_devid rtlbt_list[] = { + /* Realtek 8821CE Bluetooth devices */ + { .vendor_id = 0x13d3, .product_id = 0x3529 }, + + /* Realtek 8822CE Bluetooth devices */ + { .vendor_id = 0x0bda, .product_id = 0xb00c }, + { .vendor_id = 0x0bda, .product_id = 0xc822 }, + + /* Realtek 8822CU Bluetooth devices */ + { .vendor_id = 0x13d3, .product_id = 0x3549 }, + + /* Realtek 8852AE Bluetooth devices */ + { .vendor_id = 0x0bda, .product_id = 0x2852 }, + { .vendor_id = 0x0bda, .product_id = 0xc852 }, + { .vendor_id = 0x0bda, .product_id = 0x385a }, + { .vendor_id = 0x0bda, .product_id = 0x4852 }, + { .vendor_id = 0x04c5, .product_id = 0x165c }, + { .vendor_id = 0x04ca, .product_id = 0x4006 }, + { .vendor_id = 0x0cb8, .product_id = 0xc549 }, + +#ifdef RTLBTFW_SUPPORTS_FW_V2 + /* Realtek 8852CE Bluetooth devices */ + { .vendor_id = 0x04ca, .product_id = 0x4007 }, + { .vendor_id = 0x04c5, .product_id = 0x1675 }, + { .vendor_id = 0x0cb8, .product_id = 0xc558 }, + { .vendor_id = 0x13d3, .product_id = 0x3587 }, + { .vendor_id = 0x13d3, .product_id = 0x3586 }, + { .vendor_id = 0x13d3, .product_id = 0x3592 }, +#endif + + /* Realtek 8852BE Bluetooth devices */ + { .vendor_id = 0x0cb8, .product_id = 0xc559 }, + { .vendor_id = 0x0bda, .product_id = 0x887b }, + { .vendor_id = 0x13d3, .product_id = 0x3571 }, + + /* Realtek 8723AE Bluetooth devices */ + { .vendor_id = 0x0930, .product_id = 0x021d }, + { .vendor_id = 0x13d3, .product_id = 0x3394 }, + + /* Realtek 8723BE Bluetooth devices */ + { .vendor_id = 0x0489, .product_id = 0xe085 }, + { .vendor_id = 0x0489, .product_id = 0xe08b }, + { .vendor_id = 0x04f2, .product_id = 0xb49f }, + { .vendor_id = 0x13d3, .product_id = 0x3410 }, + { .vendor_id = 0x13d3, .product_id = 0x3416 }, + { .vendor_id = 0x13d3, .product_id = 0x3459 }, + { .vendor_id = 0x13d3, .product_id = 0x3494 }, + + /* Realtek 8723BU Bluetooth devices */ + { .vendor_id = 0x7392, .product_id = 0xa611 }, + + /* Realtek 8723DE Bluetooth devices */ + { .vendor_id = 0x0bda, .product_id = 0xb009 }, + { .vendor_id = 0x2ff8, .product_id = 0xb011 }, + + /* Realtek 8761BUV Bluetooth devices */ + { .vendor_id = 0x2357, .product_id = 0x0604 }, + { .vendor_id = 0x0b05, .product_id = 0x190e }, + { .vendor_id = 0x2550, .product_id = 0x8761 }, + { .vendor_id = 0x0bda, .product_id = 0x8771 }, + { .vendor_id = 0x6655, .product_id = 0x8771 }, + { .vendor_id = 0x7392, .product_id = 0xc611 }, + { .vendor_id = 0x2b89, .product_id = 0x8761 }, + + /* Realtek 8821AE Bluetooth devices */ + { .vendor_id = 0x0b05, .product_id = 0x17dc }, + { .vendor_id = 0x13d3, .product_id = 0x3414 }, + { .vendor_id = 0x13d3, .product_id = 0x3458 }, + { .vendor_id = 0x13d3, .product_id = 0x3461 }, + { .vendor_id = 0x13d3, .product_id = 0x3462 }, + + /* Realtek 8822BE Bluetooth devices */ + { .vendor_id = 0x13d3, .product_id = 0x3526 }, + { .vendor_id = 0x0b05, .product_id = 0x185c }, + + /* Realtek 8822CE Bluetooth devices */ + { .vendor_id = 0x04ca, .product_id = 0x4005 }, + { .vendor_id = 0x04c5, .product_id = 0x161f }, + { .vendor_id = 0x0b05, .product_id = 0x18ef }, + { .vendor_id = 0x13d3, .product_id = 0x3548 }, + { .vendor_id = 0x13d3, .product_id = 0x3549 }, + { .vendor_id = 0x13d3, .product_id = 0x3553 }, + { .vendor_id = 0x13d3, .product_id = 0x3555 }, + { .vendor_id = 0x2ff8, .product_id = 0x3051 }, + { .vendor_id = 0x1358, .product_id = 0xc123 }, + { .vendor_id = 0x0bda, .product_id = 0xc123 }, + { .vendor_id = 0x0cb5, .product_id = 0xc547 }, +}; + +static int +rtlbt_is_realtek(struct libusb_device_descriptor *d) +{ + int i; + + /* Search looking for whether it's a Realtek-based device */ + for (i = 0; i < (int) nitems(rtlbt_list); i++) { + if ((rtlbt_list[i].product_id == d->idProduct) && + (rtlbt_list[i].vendor_id == d->idVendor)) { + rtlbt_info("found USB Realtek"); + return (1); + } + } + + /* Not found */ + return (0); +} + +static int +rtlbt_is_bluetooth(struct libusb_device *dev) +{ + struct libusb_config_descriptor *cfg; + const struct libusb_interface *ifc; + const struct libusb_interface_descriptor *d; + int r; + + r = libusb_get_active_config_descriptor(dev, &cfg); + if (r < 0) { + rtlbt_err("Cannot retrieve config descriptor: %s", + libusb_error_name(r)); + return (0); + } + + if (cfg->bNumInterfaces != 0) { + /* Only 0-th HCI/ACL interface is supported by downloader */ + ifc = &cfg->interface[0]; + if (ifc->num_altsetting != 0) { + /* BT HCI/ACL interface has no altsettings */ + d = &ifc->altsetting[0]; + /* Check if interface is a bluetooth */ + if (d->bInterfaceClass == LIBUSB_CLASS_WIRELESS && + d->bInterfaceSubClass == 0x01 && + d->bInterfaceProtocol == 0x01) { + rtlbt_info("found USB Realtek"); + libusb_free_config_descriptor(cfg); + return (1); + } + } + } + libusb_free_config_descriptor(cfg); + + /* Not found */ + return (0); +} + +static libusb_device * +rtlbt_find_device(libusb_context *ctx, int bus_id, int dev_id) +{ + libusb_device **list, *dev = NULL, *found = NULL; + struct libusb_device_descriptor d; + ssize_t cnt, i; + int r; + + cnt = libusb_get_device_list(ctx, &list); + if (cnt < 0) { + rtlbt_err("libusb_get_device_list() failed: code %lld", + (long long int) cnt); + return (NULL); + } + + /* + * Scan through USB device list. + */ + for (i = 0; i < cnt; i++) { + dev = list[i]; + if (bus_id == libusb_get_bus_number(dev) && + dev_id == libusb_get_device_address(dev)) { + /* Get the device descriptor for this device entry */ + r = libusb_get_device_descriptor(dev, &d); + if (r != 0) { + rtlbt_err("libusb_get_device_descriptor: %s", + libusb_strerror(r)); + break; + } + + /* For non-Realtek match on the vendor/product id */ + if (rtlbt_is_realtek(&d)) { + /* + * Take a reference so it's not freed later on. + */ + found = libusb_ref_device(dev); + break; + } + /* For Realtek vendor match on the interface class */ + if (d.idVendor == 0x0bda && rtlbt_is_bluetooth(dev)) { + /* + * Take a reference so it's not freed later on. + */ + found = libusb_ref_device(dev); + break; + } + } + } + + libusb_free_device_list(list, 1); + return (found); +} + +static void +rtlbt_dump_version(ng_hci_read_local_ver_rp *ver) +{ + rtlbt_info("hci_version 0x%02x", ver->hci_version); + rtlbt_info("hci_revision 0x%04x", le16toh(ver->hci_revision)); + rtlbt_info("lmp_version 0x%02x", ver->lmp_version); + rtlbt_info("lmp_subversion 0x%04x", le16toh(ver->lmp_subversion)); +} + +/* + * Parse ugen name and extract device's bus and address + */ + +static int +parse_ugen_name(char const *ugen, uint8_t *bus, uint8_t *addr) +{ + char *ep; + + if (strncmp(ugen, "ugen", 4) != 0) + return (-1); + + *bus = (uint8_t) strtoul(ugen + 4, &ep, 10); + if (*ep != '.') + return (-1); + + *addr = (uint8_t) strtoul(ep + 1, &ep, 10); + if (*ep != '\0') + return (-1); + + return (0); +} + +static void +usage(void) +{ + fprintf(stderr, + "Usage: rtlbtfw (-D) -d ugenX.Y (-f firmware path) (-I)\n"); + fprintf(stderr, " -D: enable debugging\n"); + fprintf(stderr, " -d: device to operate upon\n"); + fprintf(stderr, " -f: firmware path, if not default\n"); + fprintf(stderr, " -I: enable informational output\n"); + exit(127); +} + +int +main(int argc, char *argv[]) +{ + libusb_context *ctx = NULL; + libusb_device *dev = NULL; + libusb_device_handle *hdl = NULL; + ng_hci_read_local_ver_rp ver; + int r; + uint8_t bus_id = 0, dev_id = 0; + int devid_set = 0; + int n; + char *firmware_dir = NULL; + char *firmware_path = NULL; + char *config_path = NULL; + int retcode = 1; + const struct rtlbt_id_table *ic; + uint8_t rom_version; + struct rtlbt_firmware fw, cfg; + enum rtlbt_fw_type fw_type; + uint16_t fw_lmp_subversion; + + /* Parse command line arguments */ + while ((n = getopt(argc, argv, "Dd:f:hIm:p:v:")) != -1) { + switch (n) { + case 'd': /* ugen device name */ + devid_set = 1; + if (parse_ugen_name(optarg, &bus_id, &dev_id) < 0) + usage(); + break; + case 'D': + rtlbt_do_debug = 1; + break; + case 'f': /* firmware dir */ + if (firmware_dir) + free(firmware_dir); + firmware_dir = strdup(optarg); + break; + case 'I': + rtlbt_do_info = 1; + break; + case 'h': + default: + usage(); + break; + /* NOT REACHED */ + } + } + + /* Ensure the devid was given! */ + if (devid_set == 0) { + usage(); + /* NOTREACHED */ + } + + /* libusb setup */ + r = libusb_init(&ctx); + if (r != 0) { + rtlbt_err("libusb_init failed: code %d", r); + exit(127); + } + + rtlbt_debug("opening dev %d.%d", (int) bus_id, (int) dev_id); + + /* Find a device based on the bus/dev id */ + dev = rtlbt_find_device(ctx, bus_id, dev_id); + if (dev == NULL) { + rtlbt_err("device not found"); + goto shutdown; + } + + /* XXX enforce that bInterfaceNumber is 0 */ + + /* XXX enforce the device/product id if they're non-zero */ + + /* Grab device handle */ + r = libusb_open(dev, &hdl); + if (r != 0) { + rtlbt_err("libusb_open() failed: code %d", r); + goto shutdown; + } + + /* Check if ng_ubt is attached */ + r = libusb_kernel_driver_active(hdl, 0); + if (r < 0) { + rtlbt_err("libusb_kernel_driver_active() failed: code %d", r); + goto shutdown; + } + if (r > 0) { + rtlbt_info("Firmware has already been downloaded"); + retcode = 0; + goto shutdown; + } + + /* Get local version */ + r = rtlbt_read_local_ver(hdl, &ver); + if (r < 0) { + rtlbt_err("rtlbt_read_local_ver() failed code %d", r); + goto shutdown; + } + rtlbt_dump_version(&ver); + + ic = rtlbt_get_ic(ver.lmp_subversion, ver.hci_revision, + ver.hci_version); + if (ic == NULL) { + rtlbt_err("rtlbt_get_ic() failed: Unknown IC"); + goto shutdown; + } + + /* Default the firmware path */ + if (firmware_dir == NULL) + firmware_dir = strdup(_DEFAULT_RTLBT_FIRMWARE_PATH); + + firmware_path = rtlbt_get_fwname(ic->fw_name, firmware_dir, "_fw.bin"); + if (firmware_path == NULL) + goto shutdown; + + rtlbt_debug("firmware_path = %s", firmware_path); + + rtlbt_info("loading firmware %s", firmware_path); + + /* Read in the firmware */ + if (rtlbt_fw_read(&fw, firmware_path) <= 0) { + rtlbt_debug("rtlbt_fw_read() failed"); + return (-1); + } + + fw_type = rtlbt_get_fw_type(&fw, &fw_lmp_subversion); + if (fw_type == RTLBT_FW_TYPE_UNKNOWN && + (ic->flags & RTLBT_IC_FLAG_SIMPLE) == 0) { + rtlbt_debug("Unknown firmware type"); + goto shutdown; + } + + if (fw_type != RTLBT_FW_TYPE_UNKNOWN) { + + /* Match hardware and firmware lmp_subversion */ + if (fw_lmp_subversion != ver.lmp_subversion) { + rtlbt_err("firmware is for %x but this is a %x", + fw_lmp_subversion, ver.lmp_subversion); + goto shutdown; + } + + /* Query a ROM version */ + r = rtlbt_read_rom_ver(hdl, &rom_version); + if (r < 0) { + rtlbt_err("rtlbt_read_rom_ver() failed code %d", r); + goto shutdown; + } + rtlbt_debug("rom_version = %d", rom_version); + + /* Load in the firmware */ + r = rtlbt_parse_fwfile_v1(&fw, rom_version); + if (r < 0) { + rtlbt_err("Parseing firmware file failed"); + goto shutdown; + } + + config_path = rtlbt_get_fwname(ic->fw_name, firmware_dir, + "_config.bin"); + if (config_path == NULL) + goto shutdown; + + rtlbt_info("loading config %s", config_path); + + /* Read in the config file */ + if (rtlbt_fw_read(&cfg, config_path) <= 0) { + rtlbt_err("rtlbt_fw_read() failed"); + if ((ic->flags & RTLBT_IC_FLAG_CONFIG) != 0) + goto shutdown; + } else { + r = rtlbt_append_fwfile(&fw, &cfg); + rtlbt_fw_free(&cfg); + if (r < 0) { + rtlbt_err("Appending config file failed"); + goto shutdown; + } + } + } + + r = rtlbt_load_fwfile(hdl, &fw); + if (r < 0) { + rtlbt_debug("Loading firmware file failed"); + goto shutdown; + } + + /* free it */ + rtlbt_fw_free(&fw); + + rtlbt_info("Firmware download complete"); + + /* Execute Read Local Version one more time */ + r = rtlbt_read_local_ver(hdl, &ver); + if (r < 0) { + rtlbt_err("rtlbt_read_local_ver() failed code %d", r); + goto shutdown; + } + rtlbt_dump_version(&ver); + + retcode = 0; + + /* Ask kernel driver to probe and attach device again */ + r = libusb_reset_device(hdl); + if (r != 0) + rtlbt_err("libusb_reset_device() failed: %s", + libusb_strerror(r)); + +shutdown: + + /* Shutdown */ + + if (hdl != NULL) + libusb_close(hdl); + + if (dev != NULL) + libusb_unref_device(dev); + + if (ctx != NULL) + libusb_exit(ctx); + + if (retcode == 0) + rtlbt_info("Firmware download is successful!"); + else + rtlbt_err("Firmware download failed!"); + + return (retcode); +} diff --git a/usr.sbin/bluetooth/rtlbtfw/rtlbt_dbg.h b/usr.sbin/bluetooth/rtlbtfw/rtlbt_dbg.h new file mode 100644 index 000000000000..54c982119d40 --- /dev/null +++ b/usr.sbin/bluetooth/rtlbtfw/rtlbt_dbg.h @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2013 Adrian Chadd + * Copyright (c) 2019 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 __RTLBT_DEBUG_H__ +#define __RTLBT_DEBUG_H__ + +extern int rtlbt_do_debug; +extern int rtlbt_do_info; + +#define rtlbt_err(fmt, ...) \ + fprintf(stderr, "rtlbtfw: %s: "fmt"\n", __func__, ##__VA_ARGS__) +#define rtlbt_info(fmt, ...) do { \ + if (rtlbt_do_info) \ + fprintf(stderr, "%s: "fmt"\n", __func__, ##__VA_ARGS__);\ +} while (0) +#define rtlbt_debug(fmt, ...) do { \ + if (rtlbt_do_debug) \ + fprintf(stderr, "%s: "fmt"\n", __func__, ##__VA_ARGS__);\ +} while (0) + +#endif diff --git a/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c b/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c new file mode 100644 index 000000000000..bb3d20d79527 --- /dev/null +++ b/usr.sbin/bluetooth/rtlbtfw/rtlbt_fw.c @@ -0,0 +1,385 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2013 Adrian Chadd + * Copyright (c) 2019 Vladimir Kondratyev + * Copyright (c) 2023 Future Crew LLC. + * + * 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 +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "rtlbt_fw.h" +#include "rtlbt_dbg.h" + +static const struct rtlbt_id_table rtlbt_ic_id_table[] = { + { /* 8723A */ + .lmp_subversion = RTLBT_ROM_LMP_8723A, + .hci_revision = 0xb, + .hci_version = 0x6, + .flags = RTLBT_IC_FLAG_SIMPLE, + .fw_name = "rtl8723a", + }, { /* 8723B */ + .lmp_subversion = RTLBT_ROM_LMP_8723B, + .hci_revision = 0xb, + .hci_version = 0x6, + .fw_name = "rtl8723b", + }, { /* 8723D */ + .lmp_subversion = RTLBT_ROM_LMP_8723B, + .hci_revision = 0xd, + .hci_version = 0x8, + .flags = RTLBT_IC_FLAG_CONFIG, + .fw_name = "rtl8723d", + }, { /* 8821A */ + .lmp_subversion = RTLBT_ROM_LMP_8821A, + .hci_revision = 0xa, + .hci_version = 0x6, + .fw_name = "rtl8821a", + }, { /* 8821C */ + .lmp_subversion = RTLBT_ROM_LMP_8821A, + .hci_revision = 0xc, + .hci_version = 0x8, + .flags = RTLBT_IC_FLAG_MSFT, + .fw_name = "rtl8821c", + }, { /* 8761A */ + .lmp_subversion = RTLBT_ROM_LMP_8761A, + .hci_revision = 0xa, + .hci_version = 0x6, + .fw_name = "rtl8761a", + }, { /* 8761BU */ + .lmp_subversion = RTLBT_ROM_LMP_8761A, + .hci_revision = 0xb, + .hci_version = 0xa, + .fw_name = "rtl8761bu", + }, { /* 8822C with USB interface */ + .lmp_subversion = RTLBT_ROM_LMP_8822B, + .hci_revision = 0xc, + .hci_version = 0xa, + .flags = RTLBT_IC_FLAG_MSFT, + .fw_name = "rtl8822cu", + }, { /* 8822B */ + .lmp_subversion = RTLBT_ROM_LMP_8822B, + .hci_revision = 0xb, + .hci_version = 0x7, + .flags = RTLBT_IC_FLAG_CONFIG | RTLBT_IC_FLAG_MSFT, + .fw_name = "rtl8822b", + }, { /* 8852A */ + .lmp_subversion = RTLBT_ROM_LMP_8852A, + .hci_revision = 0xa, + .hci_version = 0xb, + .flags = RTLBT_IC_FLAG_MSFT, + .fw_name = "rtl8852au", + }, { /* 8852B */ + .lmp_subversion = RTLBT_ROM_LMP_8852A, + .hci_revision = 0xb, + .hci_version = 0xb, + .flags = RTLBT_IC_FLAG_MSFT, + .fw_name = "rtl8852bu", +#ifdef RTLBTFW_SUPPORTS_FW_V2 + }, { /* 8852C */ + .lmp_subversion = RTLBT_ROM_LMP_8852A, + .hci_revision = 0xc, + .hci_version = 0xc, + .flags = RTLBT_IC_FLAG_MSFT, + .fw_name = "rtl8852cu", + }, { /* 8851B */ + .lmp_subversion = RTLBT_ROM_LMP_8851B, + .hci_revision = 0xb, + .hci_version = 0xc, + .flags = RTLBT_IC_FLAG_MSFT, + .fw_name = "rtl8851bu", +#endif + }, +}; + +static const uint16_t project_ids[] = { + [ 0 ] = RTLBT_ROM_LMP_8723A, + [ 1 ] = RTLBT_ROM_LMP_8723B, + [ 2 ] = RTLBT_ROM_LMP_8821A, + [ 3 ] = RTLBT_ROM_LMP_8761A, + [ 7 ] = RTLBT_ROM_LMP_8703B, + [ 8 ] = RTLBT_ROM_LMP_8822B, + [ 9 ] = RTLBT_ROM_LMP_8723B, /* 8723DU */ + [ 10 ] = RTLBT_ROM_LMP_8821A, /* 8821CU */ + [ 13 ] = RTLBT_ROM_LMP_8822B, /* 8822CU */ + [ 14 ] = RTLBT_ROM_LMP_8761A, /* 8761BU */ + [ 18 ] = RTLBT_ROM_LMP_8852A, /* 8852AU */ + [ 19 ] = RTLBT_ROM_LMP_8723B, /* 8723FU */ + [ 20 ] = RTLBT_ROM_LMP_8852A, /* 8852BU */ + [ 25 ] = RTLBT_ROM_LMP_8852A, /* 8852CU */ + [ 33 ] = RTLBT_ROM_LMP_8822B, /* 8822EU */ + [ 36 ] = RTLBT_ROM_LMP_8851B, /* 8851BU */ +}; + +/* Signatures */ +static const uint8_t fw_header_sig_v1[8] = + {0x52, 0x65, 0x61, 0x6C, 0x74, 0x65, 0x63, 0x68}; /* Realtech */ +#ifdef RTLBTFW_SUPPORTS_FW_V2 +static const uint8_t fw_header_sig_v2[8] = + {0x52, 0x54, 0x42, 0x54, 0x43, 0x6F, 0x72, 0x65}; /* RTBTCore */ +#endif +static const uint8_t fw_ext_sig[4] = {0x51, 0x04, 0xFD, 0x77}; + +int +rtlbt_fw_read(struct rtlbt_firmware *fw, const char *fwname) +{ + int fd; + struct stat sb; + unsigned char *buf; + ssize_t r; + + fd = open(fwname, O_RDONLY); + if (fd < 0) { + warn("%s: open: %s", __func__, fwname); + return (0); + } + + if (fstat(fd, &sb) != 0) { + warn("%s: stat: %s", __func__, fwname); + close(fd); + return (0); + } + + buf = calloc(1, sb.st_size); + if (buf == NULL) { + warn("%s: calloc", __func__); + close(fd); + return (0); + } + + /* XXX handle partial reads */ + r = read(fd, buf, sb.st_size); + if (r < 0) { + warn("%s: read", __func__); + free(buf); + close(fd); + return (0); + } + + if (r != sb.st_size) { + rtlbt_err("read len %d != file size %d", + (int) r, + (int) sb.st_size); + free(buf); + close(fd); + return (0); + } + + /* We have everything, so! */ + + memset(fw, 0, sizeof(*fw)); + + fw->fwname = strdup(fwname); + fw->len = sb.st_size; + fw->buf = buf; + + close(fd); + return (1); +} + +void +rtlbt_fw_free(struct rtlbt_firmware *fw) +{ + if (fw->fwname) + free(fw->fwname); + if (fw->buf) + free(fw->buf); + memset(fw, 0, sizeof(*fw)); +} + +char * +rtlbt_get_fwname(const char *fw_name, const char *prefix, const char *suffix) +{ + char *fwname; + + asprintf(&fwname, "%s/%s%s", prefix, fw_name, suffix); + + return (fwname); +} + +const struct rtlbt_id_table * +rtlbt_get_ic(uint16_t lmp_subversion, uint16_t hci_revision, + uint8_t hci_version) +{ + unsigned int i; + + for (i = 0; i < nitems(rtlbt_ic_id_table); i++) { + if (rtlbt_ic_id_table[i].lmp_subversion == lmp_subversion && + rtlbt_ic_id_table[i].hci_revision == hci_revision && + rtlbt_ic_id_table[i].hci_version == hci_version) + return (rtlbt_ic_id_table + i); + } + + return (NULL); +} + +enum rtlbt_fw_type +rtlbt_get_fw_type(struct rtlbt_firmware *fw, uint16_t *fw_lmp_subversion) +{ + enum rtlbt_fw_type fw_type; + size_t fw_header_len; + uint8_t *ptr; + uint8_t opcode, oplen, project_id; + + if (fw->len < 8) { + rtlbt_err("firmware file too small"); + return (RTLBT_FW_TYPE_UNKNOWN); + } + + if (memcmp(fw->buf, fw_header_sig_v1, sizeof(fw_header_sig_v1)) == 0) { + fw_type = RTLBT_FW_TYPE_V1; + fw_header_len = sizeof(struct rtlbt_fw_header_v1); + } else +#ifdef RTLBTFW_SUPPORTS_FW_V2 + if (memcmp(fw->buf, fw_header_sig_v2, sizeof(fw_header_sig_v2)) == 0) { + fw_type = RTLBT_FW_TYPE_V2; + fw_header_len = sizeof(struct rtlbt_fw_header_v2); + } else +#endif + return (RTLBT_FW_TYPE_UNKNOWN); + + if (fw->len < fw_header_len + sizeof(fw_ext_sig) + 4) { + rtlbt_err("firmware file too small"); + return (RTLBT_FW_TYPE_UNKNOWN); + } + + ptr = fw->buf + fw->len - sizeof(fw_ext_sig); + if (memcmp(ptr, fw_ext_sig, sizeof(fw_ext_sig)) != 0) { + rtlbt_err("invalid extension section signature"); + return (RTLBT_FW_TYPE_UNKNOWN); + } + + do { + opcode = *--ptr; + oplen = *--ptr; + ptr -= oplen; + + rtlbt_debug("code=%x len=%x", opcode, oplen); + + if (opcode == 0x00) { + if (oplen != 1) { + rtlbt_err("invalid instruction length"); + return (RTLBT_FW_TYPE_UNKNOWN); + } + project_id = *ptr; + rtlbt_debug("project_id=%x", project_id); + if (project_id >= nitems(project_ids) || + project_ids[project_id] == 0) { + rtlbt_err("unknown project id %x", project_id); *** 1022 LINES SKIPPED *** From nobody Thu Nov 7 03:43:12 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkSb50n4cz5cGy4; Thu, 07 Nov 2024 03:43: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkSb44qxcz4smY; Thu, 7 Nov 2024 03:43:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730950992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IlkZ9Q9iZ2GN95KnHWgxqSqIE5gsvAkClRR+G826FbA=; b=yr7wNVllmU7fc2Irpqhu5mh6R5ZXlBoubU7KiKl8P/azJ4Q6hkuFyI4s/Fiv7go84RkxxT sqcYYASJYu6Q3H5jte0BfXv+fK4Uh6GVRUuOVxcRUs344MQdUs2RsntZCUHq3GgOzbS/BS jXHzQMpRuTBv0WqxhjdPdezXTB+FPbfVwjlj0+ov0feWNRdEhq6ar3ONBFEKtSu/whgrHB HCNs1DOfh1eCLWZhFYRb5EakOjoQ8JDtoHNu3sKd1dz4kvm94AY6XU+ahM2108T+80NHAc b3G7FAW+QSRfpNQW/1QUMC5neRYJRv8Q1fp0+J1SREj1PGiOYbLV/hiAl8Ylww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730950992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IlkZ9Q9iZ2GN95KnHWgxqSqIE5gsvAkClRR+G826FbA=; b=Fq31tExbetHmgxkJUdEY470jX2gUqrkclIi3vDYfBNr1L2LtBR1yRa6t2cPxwuBVaX9QdF 6gu/Yyjq2rlN4iDeqV02nPJ1rvQeM5pKA20dharohwE6Fpvk6TNhSZ1hVlyz1VN72F+97J 16HXCLk6e45xz8KWLVDPF7gb6E1zN8TNwu5oE8ruIg0cu5lupp2Egus+WLUu7het5E8xx0 enufh8Bj32Y0KsOOxBTfHtbQFejUicoGU8rB3A34IKVaKsHGkXD2cijBBqXBCj7z7JWI9I sZyD2tsWZEcNMlYoKtngtmPvqYu1jJWvUpvByEXPo6lUSmRzZm0Yn5ElUoILvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730950992; a=rsa-sha256; cv=none; b=tByXAL7E2oo9KnDL92ANbrzCqLFNNNqP7KwqInWCDQh2JXSTmHCzvxomtd85DE7ZlXo+MF YA+R2oFk0KxeJ89+Te2hNptO12mpMv5ZCxPF0Kt5BCarzlOGyjKSzsY+mRmn62W5Uw/pdk PWtIH1L9KGrTxSvgnRwzapc4zT2VV6qluKwHimHgVk84q65wXDm/zAQGWfQHP4ouXi8yAT EbZBGIFUfyI88bMj9l7NvuA1ZZqlt2RjT8/KQ7uQBcWw6tHqrlL15iKxOplzAYT8/ait06 JHfD2nXENv55A36JoGRrxAyKwe/oBfU0m8BEVSz2SeKjmXHX6AiJBGBPRLzRjQ== 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 4XkSb44RRWzTQx; Thu, 7 Nov 2024 03:43:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A73hCFQ035272; Thu, 7 Nov 2024 03:43:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A73hC21035269; Thu, 7 Nov 2024 03:43:12 GMT (envelope-from git) Date: Thu, 7 Nov 2024 03:43:12 GMT Message-Id: <202411070343.4A73hC21035269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 0552fdc62caf - main - sed: fix commandline-given expression when -e is not used List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0552fdc62caf034397ffd5b07dfbad853aef5aa8 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=0552fdc62caf034397ffd5b07dfbad853aef5aa8 commit 0552fdc62caf034397ffd5b07dfbad853aef5aa8 Author: Martin Cracauer AuthorDate: 2024-11-07 03:40:02 +0000 Commit: Kyle Evans CommitDate: 2024-11-07 03:40:45 +0000 sed: fix commandline-given expression when -e is not used Make explicit sed commands (first on commandline) behave the same as those given with -e. Without this patch the following two commands behave differently, the second one being wrong: echo ab | sed -e $'1 i\\\n--' echo ab | sed $'1 i\\\n--' Reviewed by: 0mp, des, kevans Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D47377 --- usr.bin/sed/main.c | 10 +++++----- usr.bin/sed/tests/sed2_test.sh | 13 +++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c index 7cc01eb18147..84e1dfa538e6 100644 --- a/usr.bin/sed/main.c +++ b/usr.bin/sed/main.c @@ -137,10 +137,8 @@ main(int argc, char *argv[]) break; case 'e': eflag = 1; - if ((temp_arg = malloc(strlen(optarg) + 2)) == NULL) - err(1, "malloc"); - strcpy(temp_arg, optarg); - strcat(temp_arg, "\n"); + if (asprintf(&temp_arg, "%s\n", optarg) == -1) + err(1, "asprintf"); add_compunit(CU_STRING, temp_arg); break; case 'f': @@ -173,7 +171,9 @@ main(int argc, char *argv[]) /* First usage case; script is the first arg */ if (!eflag && !fflag && *argv) { - add_compunit(CU_STRING, *argv); + if (asprintf(&temp_arg, "%s\n", *argv) == -1) + err(1, "asprintf"); + add_compunit(CU_STRING, temp_arg); argv++; } diff --git a/usr.bin/sed/tests/sed2_test.sh b/usr.bin/sed/tests/sed2_test.sh index a7408b2560a7..f50619612561 100755 --- a/usr.bin/sed/tests/sed2_test.sh +++ b/usr.bin/sed/tests/sed2_test.sh @@ -147,6 +147,18 @@ bracket_y_body() echo 'bra[ke]' | sed 'y[\[][ct[' } +atf_test_case minus_e +minus_e_head() +{ + atf_set "descr" "Verify that -e and implicit arg do the same thing" +} +minus_e_body() +{ + printf "ab\n" > a + atf_check -o 'inline:--\nab\n' sed -e $'1 i\\\n--' a + atf_check -o 'inline:--\nab\n' sed $'1 i\\\n--' a +} + atf_init_test_cases() { atf_add_test_case inplace_command_q @@ -156,4 +168,5 @@ atf_init_test_cases() atf_add_test_case commands_on_stdin atf_add_test_case hex_subst atf_add_test_case bracket_y + atf_add_test_case minus_e } From nobody Thu Nov 7 05:20:32 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkVlP1ld0z5cNG5; Thu, 07 Nov 2024 05:20: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkVlN6Zn7z54xG; Thu, 7 Nov 2024 05:20:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730956832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wo2Zy5Lb/axQYVFQ9RqZ60FaMgkpbNEb8/nP755vejg=; b=KsMxvik1p9QVKHQeQPNFHmcW1EUvsTzOo1Ezj+OqPFfiRj17WgT/4gh74mYbO9r+i+GPRq FfCzpqm04p2Lpurziz/qWxGOpWOwdHJJrXyhbTpBdzuZAkGeidBjwkKTfM25YN16TD9A4N +1YRa2X4gPhU5tXfctvXxdCJVH2QSieO3z6Y5S2HuFVbfF30c5Gn48ie7KDmcPEOcoD9JL tfOGYdHihv7vA+dm3x5IYbQskEKXDgqIC6iopkkABJdpF54R25eENnwmAUM62iAUg6wT0N ipnablSXR2c2WmEQAD25x6/Y6DLPro1sd97ly1+wxvMJ6pvy1Kmp9asAwLDjYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730956832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wo2Zy5Lb/axQYVFQ9RqZ60FaMgkpbNEb8/nP755vejg=; b=Jriw1MBLYfgWcn69Pb9JNi5UGEG8OMliLpy+RBblHjMtCZh0+O1dqa2tjFpIe5eNFE9IKz DpPyfB73h3mt/Z1G/GsCtwSqAhfSSRtRc+hEdXcadfT7D8qOZDEWXwZ9g+OsUZmXtDQGMC AA4BIFkAoChJLDVv+ajAGLwK7+54sr9JjbarjOCze20ry/R1F4K02EO9K/tdzf0tcpNg/+ ZrSVaMYGICc4EtIdLKlR9ZammBDTmOfYgX/dgqzjUc0vMDtmtQSWgZu17NnTyK7j/fj8Zd c5AOTYqqKF6pRQ1XfGiP12t7DTFCAkc4BM2oN+B5e33vxv2oh1US3OcJd5g6dQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730956832; a=rsa-sha256; cv=none; b=a7brGhGOXDoplHIN7/7nOh2x3mXdj0JEem5QpYWF79S9GtfJLUjfiqViA4sZHyTgWwKWec sr1PQKOSWxktCBclpnouDHpHbsyXNacWtzHpOsWIhnpf05jB5vdphMZ3NxPw6/o4ogfnkz +ov7baEEauM7SIs4tftTFql5dLG0FrWI5y4BfqEu1sbv7Z6zJ/vmjVAD/rkvvFRUmA0DvO Kw8yXq7LxGIegmx484j1W0etiF0VaaqkiIYk6ghqXlxMVqq9niWdQkvuMMAikVgCpNnArL qKLllMVZUgGi6HRCsJhY/hN4wlTTkS0XFYp+kQoE9/S9OuLRSfE/o5fvxC/GCA== 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 4XkVlN5WK3zY5c; Thu, 7 Nov 2024 05:20:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A75KWvO014393; Thu, 7 Nov 2024 05:20:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A75KWd7014390; Thu, 7 Nov 2024 05:20:32 GMT (envelope-from git) Date: Thu, 7 Nov 2024 05:20:32 GMT Message-Id: <202411070520.4A75KWd7014390@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 7cd3e2696ca3 - main - sys/link_elf.h: remove extern linkage specifier from dl_iterate_phdr() prototype List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 7cd3e2696ca357630ff591959956295da9abbe2d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7cd3e2696ca357630ff591959956295da9abbe2d commit 7cd3e2696ca357630ff591959956295da9abbe2d Author: Konstantin Belousov AuthorDate: 2024-10-31 05:55:43 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-07 05:14:38 +0000 sys/link_elf.h: remove extern linkage specifier from dl_iterate_phdr() prototype Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47351 --- sys/sys/link_elf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/link_elf.h b/sys/sys/link_elf.h index 9752bdff55dc..7b51b3e87d1d 100644 --- a/sys/sys/link_elf.h +++ b/sys/sys/link_elf.h @@ -93,7 +93,7 @@ struct dl_phdr_info __BEGIN_DECLS typedef int (*__dl_iterate_hdr_callback)(struct dl_phdr_info *, size_t, void *); -extern int dl_iterate_phdr(__dl_iterate_hdr_callback, void *); +int dl_iterate_phdr(__dl_iterate_hdr_callback, void *); int _rtld_addr_phdr(const void *, struct dl_phdr_info *); int _rtld_get_stack_prot(void); int _rtld_is_dlopened(void *); From nobody Thu Nov 7 05:20:33 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkVlQ30v1z5cN4H; Thu, 07 Nov 2024 05:20:34 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkVlQ1vvCz54xH; Thu, 7 Nov 2024 05:20:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730956834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9DikfKERbdF3bd40HtQFKOKD1Ds4I6zoU7xDDqPTBeM=; b=ew4SERktkNndU42F88VqhOqmQ2/U3Vt+KIuTEUAOb4DUpElRDMZE3xN4ApmwKqKUxn+6kK 8Lr6P1SlM4iv+bp0CHzWF1vHq+p1wiu+ks7I+gDYKQfrGJj+tndSdDBcp5BHZQE7yKWkZV PG+GjbBnwgRceN7GBVwTipLyY98Hk9lWNiCnwuh4UQ/1jYLFzzTOIOkv7kBIXMc57vXEn4 QzUKpR+hyAvekXd1rWjSUcPei30xMHw4kD4Qm+cIZnwyKEyTt2bdpEeNArF47jaYW93Ova zz8uLcIihEgtqj5oCdNQao8f+rHiGz9FaRexEgAkjceqJ0WCHHwtQdUiosEU0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730956834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9DikfKERbdF3bd40HtQFKOKD1Ds4I6zoU7xDDqPTBeM=; b=WT4SwDOoHJcuML817DaeXvKeumF7G9WjnExIFg+r02Lk3FwiRPdzvvxLpyDP7bbsWK7aW2 YJXgweouN6CdkZuVKPzYn5BXnHjRBJT8TRIABDwSHf/Z7HayoXXUghiCGEfUfvvC6WL2+1 fyIS4+fPDBT2cBf/KNggSePVp6Wii3QOLR3H1/6wsPZTIf0KhQ18HzF91VpjFap1JgJxc0 SkNYyOapHmRzbJJne61e50APApcCighM2C5tRi5rFgcvus6lLZ0B6CYWDRGRUW0s/7HpNF zuJ0y6ntLcbAtz7vZGdaZyuh2sY5vaMDQeqaIdqQtvwVljSGN4DalWFrxb9seQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730956834; a=rsa-sha256; cv=none; b=tEYns5Ylfioq2uHYj/m5HN6YXJAPlRmBMfNIKi7b1KHtU64QhldMZmalGRnJAlIBb2Amcx aM9TsYoUpyhW2P/uuMoDjSIsWjiXqXDvb6zJshAl/taRJjRGA0KOH+jFNPIe1B6c74cvew rcv6HUx/4SZM+hyWAWe+KloQ2nmBZaQJqEWFE1fISJf/vyXVdCy/fR+E7EtmvjIGptCRFy 0xjngAKLrW0OBco/91CLmUhWlGOF20Cthh/HGba8zT5wNHxAo2S7ZbUNC5/wQ5M1wX0+Ec d5h6PyGE//YOYkDtctKS3JEYYTO/Nosb7IkytuTvoLA2CuLOLj1bg7ubTnQBCQ== 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 4XkVlP6WkWzXhM; Thu, 7 Nov 2024 05:20:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A75KXJb014464; Thu, 7 Nov 2024 05:20:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A75KXXn014461; Thu, 7 Nov 2024 05:20:33 GMT (envelope-from git) Date: Thu, 7 Nov 2024 05:20:33 GMT Message-Id: <202411070520.4A75KXXn014461@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 450e684e0fea - main - rtld: 1-bit for bool is enough List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 450e684e0fea2785b5770241f51e897070c86726 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=450e684e0fea2785b5770241f51e897070c86726 commit 450e684e0fea2785b5770241f51e897070c86726 Author: Konstantin Belousov AuthorDate: 2024-10-31 19:11:02 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-07 05:14:38 +0000 rtld: 1-bit for bool is enough Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47351 --- libexec/rtld-elf/rtld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index a8db1198a899..c670ec7f0009 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -346,7 +346,7 @@ ld_utrace_log(int event, void *handle, void *mapbase, size_t mapsize, struct ld_env_var_desc { const char * const n; const char *val; - const bool unsecure; + const bool unsecure:1; }; #define LD_ENV_DESC(var, unsec) \ [LD_##var] = { .n = #var, .unsecure = unsec } From nobody Thu Nov 7 05:20:34 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkVlR3yq7z5cN4J; Thu, 07 Nov 2024 05:20: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkVlR0wb9z54pk; Thu, 7 Nov 2024 05:20:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730956835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3yTSoAtJ5cF6vStX+u66j6e8YWkoSaHKdqPH+MFcwtg=; b=Q2giQxc3XqeNfsSiinHF8p+BBrJh0iBQl6LTlPs7pAbqhSVb7CyQMe4ixDXWpOCXdqLYyQ uNTtHpWI36Zn1K06XycxwRkcwmmhdB6qAzLeHAVCJG/qHrdKX9BZpvkr79jC+OZn2cc04g 1XYVX04qsYvAAeVGLvFke2o2/JmhuVzUfnb2jeA0xdf6fQAfLahIl5rXt5oMWHT3rRlIDr k/A1KZQHvt7h6Xe7rbczLEZmHQ0VvttP9UQuoLas5EhBtN/xKaipaILmFvN1n6IKAwI9Su HMQ1qWDUNmMIqflxRLycv076CtEmwZ5xLBlZy/hMCn8gYZ1gnK1HIka9bTM82A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730956835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3yTSoAtJ5cF6vStX+u66j6e8YWkoSaHKdqPH+MFcwtg=; b=GH4SlDsEKzN4yJ8pkN5UDurVZVRZdewHizyu73iNivq6JblqCg/Ku4MbGcMg8hI0gNz32o nbMLN3uwOcJzsCaOnP5hq5+1hk/viQjOXX9eY4yhcYr/FVXpVi7PWT71mzLuN6Y1pLwTAz 3QJKKSHDpx1pcJPailMTtlpTnrugq7wHBlPt6CleuvuGslVgEWULQaRIxogWHKBw+0mWp8 7FDE0BimWo9po3BKHtHYlW3fGt4XG76KbrmLHEObLNmXN66aS8iuTKMnZ9sWlNG+32/yrH tdz98Jo8RvXiq9X6+RyfEBMKybhTw6JwHQWzxwEptmCaSUDxXrPYKj4ydZluVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730956835; a=rsa-sha256; cv=none; b=csj311GgG+N/GeLUwGfhDN3FH4W0LaQo7wPv1wO+h4QoKDMTPx9DbdVogOHpGgjsxYns2C /6H3BYloXDBCZaDDa0p5WUcUxZ2/rt4kJuYovP48+5+ZiTtVawq6nBJxprlnKN7zp2LWhV IhkUZI/oki/i79HN4ZigjkbfhhI1JWfDmZkeXatXIgSNVUCstsrJCUlNlIlT9SWaUo8IWg N8T5tXRbESqPWixk1gk+FsmAKtU0vxETuKo578Wsz7nFY48hkVDEAUfWwsuWyIqGxFbq3m mCJpqdXRavt567WLtZT1rSSO6NdFuLamMz3JDAKDnosWf/5MM8bIXmuS5JzrcQ== 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 4XkVlR0PHSzXT2; Thu, 7 Nov 2024 05:20:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A75KYZM014528; Thu, 7 Nov 2024 05:20:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A75KYrK014525; Thu, 7 Nov 2024 05:20:34 GMT (envelope-from git) Date: Thu, 7 Nov 2024 05:20:34 GMT Message-Id: <202411070520.4A75KYrK014525@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: d7214577ff00 - main - rtld: make it easier to add sparce non-default members to ld_env_var_desc List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: d7214577ff00221ac84a85e61794a5e126b952dd Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d7214577ff00221ac84a85e61794a5e126b952dd commit d7214577ff00221ac84a85e61794a5e126b952dd Author: Konstantin Belousov AuthorDate: 2024-11-01 19:20:17 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-07 05:14:38 +0000 rtld: make it easier to add sparce non-default members to ld_env_var_desc by making the LD_ENV_DESC() macro variadic. Suggested by: brooks Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47351 --- libexec/rtld-elf/rtld.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index c670ec7f0009..7c61fec44ef7 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -348,8 +348,11 @@ struct ld_env_var_desc { const char *val; const bool unsecure:1; }; -#define LD_ENV_DESC(var, unsec) \ - [LD_##var] = { .n = #var, .unsecure = unsec } +#define LD_ENV_DESC(var, unsec, ...) \ + [LD_##var] = { \ + .n = #var, \ + .unsecure = unsec, \ + __VA_ARGS__ \ static struct ld_env_var_desc ld_env_vars[] = { LD_ENV_DESC(BIND_NOW, false), From nobody Thu Nov 7 05:20:36 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkVlS4ntrz5cND0; Thu, 07 Nov 2024 05:20: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkVlS1cFBz54xM; Thu, 7 Nov 2024 05:20:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730956836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uSf9US9+ZbIc6JUh/xXXa6obtzGCoiNZ7WGEoCPteeQ=; b=VZ/VG+KV9/4oB3p5XXgSrkuOZhUVZ5UpbBreHct7wpzBeU2OqUzIjv6cmAMVAdzbmoAAKV 3hvdqW1Nyk6C5P+CRzyG/alfWAqdnIdcIVXrQAO+bFms01V5LHYEwTPuunKCu0nWRWxysZ Gr5E6auo4cQxrIf2oXJgzEAMB2u6h0jkXySDeIqEmG2+zC8cS+Q5Ccb45wTV3xeuxjzRgD l8acuib5kCNIq+KKd7H6gnrGQ0TI0qYII5r9K0OZAvxp1JcbtMfkE/H9N7qFmp2pam1lse TenHG7Q0d1LmlPz3qXOnPQsbHoqfSeggISs1alQaDFEmXRprz9YN+WwKhCJOdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730956836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uSf9US9+ZbIc6JUh/xXXa6obtzGCoiNZ7WGEoCPteeQ=; b=aH+nMcgRB4PLQnzq5uvzX0QZopYe9YTnpls9+sv6fbpy868Qf9S9uY4NZ1fqJZyiufDG+f kLKn2/jqRco6d6iDONRWG5ye1fYeNP7MbZRFexoX0xkuRY0xWJ6QyMGOp7eH7KN4Q+l5+O 2mfVjdBkCVWBk3Jp3twZU6yf6fpHgDHjuk+W0SxZS4rRJx/LP6AUii2dhhmJ879XdwUNI2 rMasMA1nG2RJ3uIawGtorK6p2m8v7IzuT9NzDhj43ISKnZZkxFwrXZggkiVQsS7aPsOMtL 3Y+bISaGsFY+947E/Vc6LPGn1yvXSE6202laIT9x7GaOO7dmu7Hq+bJHy5chqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730956836; a=rsa-sha256; cv=none; b=EQloVYQg7faDmXSVYYzcKt6kgcVsB/8fWnj3ZJc6wmfOldZH9ooDXGH2KANJssrxW2Smr3 Z8d1tslNmp3RrGWs2n6meVZK+0zE4pUpsMjYSydMAoYAXGDejwSw5KV0KGG+idD+WLZVM8 HO1nfc9Z+c60SjH8oGLLS3Q4gtH3QfFU4ffOG06tP6W8lHK9u+o84lZszpcUSQtSFzMLv5 rUEnfNcJ65KdrJs2w4pVWx4+oG7odwaSHpzHL2xskgGMW3JbtHJBxwCCs8WcjUOS78F5KG +EXvf2J3skrTkq36f1Ep69jFGA4LFJu+tgxcDFpwYoAeho7aFzN7+qvzUfzJ1w== 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 4XkVlS0mK3zXDN; Thu, 7 Nov 2024 05:20:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A75KaQp014618; Thu, 7 Nov 2024 05:20:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A75Kaeh014614; Thu, 7 Nov 2024 05:20:36 GMT (envelope-from git) Date: Thu, 7 Nov 2024 05:20:36 GMT Message-Id: <202411070520.4A75Kaeh014614@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: c56df6ce71ae - main - rtld: add rtld_{get,set}_var List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: c56df6ce71ae96f00b088790d3ad2e0ebebdd59a Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c56df6ce71ae96f00b088790d3ad2e0ebebdd59a commit c56df6ce71ae96f00b088790d3ad2e0ebebdd59a Author: Konstantin Belousov AuthorDate: 2024-10-31 06:01:39 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-07 05:15:23 +0000 rtld: add rtld_{get,set}_var Reviewed by: brooks (previous version) Discussed with: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47351 --- lib/libc/gen/Symbol.map | 2 ++ lib/libc/gen/dlfcn.c | 17 +++++++++++++ lib/libdl/Symbol.map | 5 ++++ libexec/rtld-elf/Symbol.map | 5 ++++ libexec/rtld-elf/rtld.c | 62 +++++++++++++++++++++++++++++++++++++++------ sys/sys/link_elf.h | 2 ++ 6 files changed, 85 insertions(+), 8 deletions(-) diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index 17d114c96677..df950697cf23 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -456,6 +456,8 @@ FBSD_1.8 { aio_read2; aio_write2; execvpe; + rtld_get_var; + rtld_set_var; }; FBSDprivate_1.0 { diff --git a/lib/libc/gen/dlfcn.c b/lib/libc/gen/dlfcn.c index b678df9eef47..b30cb82e5e43 100644 --- a/lib/libc/gen/dlfcn.c +++ b/lib/libc/gen/dlfcn.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -337,4 +338,20 @@ _rtld_is_dlopened(void *arg __unused) return (0); } +#pragma weak rtld_get_var +const char * +rtld_get_var(const char *name __unused) +{ + _rtld_error(sorry); + return (NULL); +} + +#pragma weak rtld_set_var +int +rtld_set_var(const char *name __unused, const char *val __unused) +{ + _rtld_error(sorry); + return (EINVAL); +} + #endif /* !defined(IN_LIBDL) || defined(PIC) */ diff --git a/lib/libdl/Symbol.map b/lib/libdl/Symbol.map index 67d26c1f1dfe..dd9a8252e4a3 100644 --- a/lib/libdl/Symbol.map +++ b/lib/libdl/Symbol.map @@ -17,3 +17,8 @@ FBSD_1.0 { FBSD_1.3 { fdlopen; }; + +FBSD_1.8 { + rtld_get_var; + rtld_set_var; +}; diff --git a/libexec/rtld-elf/Symbol.map b/libexec/rtld-elf/Symbol.map index 0b7ad63f60a7..3cdbb30d04a0 100644 --- a/libexec/rtld-elf/Symbol.map +++ b/libexec/rtld-elf/Symbol.map @@ -21,6 +21,11 @@ FBSD_1.3 { fdlopen; }; +FBSD_1.8 { + rtld_get_var; + rtld_set_var; +}; + FBSDprivate_1.0 { _rtld_thread_init; _rtld_allocate_tls; diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 7c61fec44ef7..f1075bc75d5f 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -257,6 +257,8 @@ int _rtld_addr_phdr(const void *, struct dl_phdr_info *) __exported; int _rtld_get_stack_prot(void) __exported; int _rtld_is_dlopened(void *) __exported; void _rtld_error(const char *, ...) __exported; +const char *rtld_get_var(const char *name) __exported; +int rtld_set_var(const char *name, const char *val) __exported; /* Only here to fix -Wmissing-prototypes warnings */ int __getosreldate(void); @@ -347,31 +349,35 @@ struct ld_env_var_desc { const char * const n; const char *val; const bool unsecure:1; + const bool can_update:1; + const bool debug:1; + bool owned:1; }; #define LD_ENV_DESC(var, unsec, ...) \ [LD_##var] = { \ .n = #var, \ .unsecure = unsec, \ __VA_ARGS__ \ + } static struct ld_env_var_desc ld_env_vars[] = { LD_ENV_DESC(BIND_NOW, false), LD_ENV_DESC(PRELOAD, true), LD_ENV_DESC(LIBMAP, true), - LD_ENV_DESC(LIBRARY_PATH, true), - LD_ENV_DESC(LIBRARY_PATH_FDS, true), + LD_ENV_DESC(LIBRARY_PATH, true, .can_update = true), + LD_ENV_DESC(LIBRARY_PATH_FDS, true, .can_update = true), LD_ENV_DESC(LIBMAP_DISABLE, true), LD_ENV_DESC(BIND_NOT, true), - LD_ENV_DESC(DEBUG, true), + LD_ENV_DESC(DEBUG, true, .can_update = true, .debug = true), LD_ENV_DESC(ELF_HINTS_PATH, true), LD_ENV_DESC(LOADFLTR, true), - LD_ENV_DESC(LIBRARY_PATH_RPATH, true), + LD_ENV_DESC(LIBRARY_PATH_RPATH, true, .can_update = true), LD_ENV_DESC(PRELOAD_FDS, true), - LD_ENV_DESC(DYNAMIC_WEAK, true), + LD_ENV_DESC(DYNAMIC_WEAK, true, .can_update = true), LD_ENV_DESC(TRACE_LOADED_OBJECTS, false), - LD_ENV_DESC(UTRACE, false), - LD_ENV_DESC(DUMP_REL_PRE, false), - LD_ENV_DESC(DUMP_REL_POST, false), + LD_ENV_DESC(UTRACE, false, .can_update = true), + LD_ENV_DESC(DUMP_REL_PRE, false, .can_update = true), + LD_ENV_DESC(DUMP_REL_POST, false, .can_update = true), LD_ENV_DESC(TRACE_LOADED_OBJECTS_PROGNAME, false), LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT1, false), LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT2, false), @@ -6329,6 +6335,46 @@ dump_auxv(Elf_Auxinfo **aux_info) } } +const char * +rtld_get_var(const char *name) +{ + const struct ld_env_var_desc *lvd; + u_int i; + + for (i = 0; i < nitems(ld_env_vars); i++) { + lvd = &ld_env_vars[i]; + if (strcmp(lvd->n, name) == 0) + return (lvd->val); + } + return (NULL); +} + +int +rtld_set_var(const char *name, const char *val) +{ + struct ld_env_var_desc *lvd; + u_int i; + + for (i = 0; i < nitems(ld_env_vars); i++) { + lvd = &ld_env_vars[i]; + if (strcmp(lvd->n, name) != 0) + continue; + if (!lvd->can_update || (lvd->unsecure && !trust)) + return (EPERM); + if (lvd->owned) + free(__DECONST(char *, lvd->val)); + if (val != NULL) + lvd->val = xstrdup(val); + else + lvd->val = NULL; + lvd->owned = true; + if (lvd->debug) + debug = lvd->val != NULL && *lvd->val != '\0'; + return (0); + } + return (ENOENT); +} + /* * Overrides for libc_pic-provided functions. */ diff --git a/sys/sys/link_elf.h b/sys/sys/link_elf.h index 7b51b3e87d1d..996e1f70a9f1 100644 --- a/sys/sys/link_elf.h +++ b/sys/sys/link_elf.h @@ -97,6 +97,8 @@ int dl_iterate_phdr(__dl_iterate_hdr_callback, void *); int _rtld_addr_phdr(const void *, struct dl_phdr_info *); int _rtld_get_stack_prot(void); int _rtld_is_dlopened(void *); +const char *rtld_get_var(const char *name); +int rtld_set_var(const char *name, const char *val); #ifdef __ARM_EABI__ void * dl_unwind_find_exidx(const void *, int *); From nobody Thu Nov 7 05:20:37 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkVlW1jjTz5cNLB; Thu, 07 Nov 2024 05:20: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkVlT3zCZz55Jx; Thu, 7 Nov 2024 05:20:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730956837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BkSbij8aJp11SmUDBL25mIDzTyjglqCd07LvhgOzgV0=; b=Eqd72vTtZMare1NN/4vxgbrJ0atOrxOc1x/J6iB/LmdUypRgDAHkXBlhjQAIpMgjBpv8mL EwHoRzB0fbVDyU8wioHEUoEQUNPIp/tEV6Gp14Hpq4HqxES3xqKG+gATk8f5vvWJd+Hr0c B2qm2lI0bNuHeeFd/EgN7Yw4bFumMgU1r4VRZo3i0tGApgIGo5JEX/9VFLgdPnWeUeCbA0 gQQeiBZXjhEFHXU0DhTmsWiQRL5xsOIePpbowzT1sltIxx2Bz249H6uGbG0DmKVHdwQDN0 BCiHv1tNpNhLeECpXzXVEuNp5HIHYBpqVqAdEIwPHzhgyKVYFq6kqiriHtQmGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730956837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BkSbij8aJp11SmUDBL25mIDzTyjglqCd07LvhgOzgV0=; b=FZvpqLbOzK4GuNxSw7hpskPfwGidBk4rD/8iHN3QYgxYtFtfsCE6BMQqz4H17PHYTLYZXt comnIcABvvyStZB+T7aOzf4YtRE/jpLLRXTowWSG/KCtX7xwCZX5/SXNXz8ps7UArgXYi8 toOVsyi4PIaSd6wILQvEhyH24xzev3DL7zWLd5zyyjXiVZFE3qt6otKPNfmu0qWmohBCnt sxIZ7d+nROJPM8onUd5a/0HBRTZX3pxpfOjD6gSUuRoUN/v67vwhky0E/b917pPIcqIyr7 Dff3ChtfM++huHEi5DUT5s55ylfAAt8vPHNa+Pr1jK+Qd7oyrsqUrDdNbXW+XQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730956837; a=rsa-sha256; cv=none; b=hgX4hU/YUbZyK+P2imzmrzRNjNvBHqAe+DmQt8dRPoO3PMaN/jrcZVRWHdsC9vUkcO/x5J LvTefYJGGZn3Mx9Idqqx5GE1ZNTpKwYVDGr8GbrsOrkc9hcGM5N8cjrG/qd781tv79Kk07 GYWneqyf+9zX3ZQHNdLTlwcolNiQKtdJZoZHWct0RXfkBzCOrIqKg85qaCOaBP4yRgx4R+ 1zeURdtVovtvHOeYtaDjUDQvwSUYP1mwqoUalr7rxp+9B42LUtDBuGI1rnsxH14532gfHb lv3y/bZlBuzOEUi84WB6ZCERFJ0CJo1naHt18Tt4uvnDEWGABQnfHaGlHBtRkA== 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 4XkVlT23PTzXDQ; Thu, 7 Nov 2024 05:20:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A75KbBI014653; Thu, 7 Nov 2024 05:20:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A75KbkS014650; Thu, 7 Nov 2024 05:20:37 GMT (envelope-from git) Date: Thu, 7 Nov 2024 05:20:37 GMT Message-Id: <202411070520.4A75KbkS014650@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 3820f784597c - main - Document rtld_get_var(3) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 3820f784597cf87deb42522f108c5ee477a1f282 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3820f784597cf87deb42522f108c5ee477a1f282 commit 3820f784597cf87deb42522f108c5ee477a1f282 Author: Konstantin Belousov AuthorDate: 2024-10-31 20:15:33 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-07 05:15:30 +0000 Document rtld_get_var(3) Reviewed by: Alexander Ziaee Discussed with: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47351 --- lib/libc/gen/Makefile.inc | 3 ++ lib/libc/gen/rtld_get_var.3 | 106 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+) diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index 8111b0d24345..42a359ccfb72 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -275,6 +275,7 @@ MAN+= alarm.3 \ raise.3 \ rand48.3 \ readpassphrase.3 \ + rtld_get_var.3 \ scandir.3 \ sem_destroy.3 \ sem_getvalue.3 \ @@ -481,6 +482,8 @@ MLINKS+=rand48.3 _rand48.3 \ rand48.3 nrand48.3 \ rand48.3 seed48.3 \ rand48.3 srand48.3 +MLINKS+=rtld_get_var.3 \ + rtld_set_var.3 MLINKS+=scandir.3 alphasort.3 \ scandir.3 scandirat.3 \ scandir.3 scandir_b.3 \ diff --git a/lib/libc/gen/rtld_get_var.3 b/lib/libc/gen/rtld_get_var.3 new file mode 100644 index 000000000000..06d2e8a41cbc --- /dev/null +++ b/lib/libc/gen/rtld_get_var.3 @@ -0,0 +1,106 @@ +.\" Copyright (c) 2024 The FreeBSD Foundation +.\" +.\" This documentation was written 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 AUTHORS 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 AUTHORS 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. +.\" +.Dd October 31, 2024 +.Dt RTLD_GET_VAR 3 +.Os +.Sh NAME +.Nm rtld_get_var , +.Nm rtld_set_var +.Nd query or change run-time linker parameters after image activation +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/errno.h +.In link.h +.Ft const char * +.Fn rtld_get_var "const char *name" +.Ft int +.Fn rtld_set_var "const char *name" "const char *value" +.Sh DESCRIPTION +The dynamic linker +.Xr rtld 1 +can be configured be setting some environment variables for the process, +before image activation. +Sometimes it is desirable to query the current effective settings or +change them afterward. +.Pp +Since the process environment variables are maintained by higher-level +libraries, the run-time linker cannot access them after the image +activation. +The described functions make it possible to operate on rtld settings. +.Pp +The +.Fn rtld_get_var +function returns the current value of the named parameter. +.Pp +The +.Fn rtld_set_var +functions changes the value of the parameter to the new +.Fa value +value, if possible. +The +.Fa name +argument to both functions is the name of the parameter, which +is same as the corresponding environment variable +.Pq see Xr rtld 1 +but without the +.Ev LD_ +(or +.Ev LD_32_ +or any other ABI-specific) prefix. +.Sh RETURN VALUES +The +.Fn rtld_get_var +returns the current value of the named parameter, or +.Dv NULL +if the name is invalid. +.Pp +The +.Fn rtld_set_var +returns 0 on success, or an integer indicating the error condition +which prevented the operation. +.Sh ERRORS +Possible errors returned from +.Fn rtld_set_var : +.Bl -tag -width Er +.It Bq Er EPERM +The requested change cannot be made at runtime, either because the +runtime linker can only take this parameter at initialization time, +or because the current process is executing with elevated privileges. +.It Bq ENOENT +The supplied parameter +.Fa name +is unknown. +.El +.Sh SEE ALSO +.Xr rtld 1 +.Sh HISTORY +The +.Nm +function first appeared in +.Fx 15.0 . From nobody Thu Nov 7 05:20:38 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkVlX1w1gz5cNHr; Thu, 07 Nov 2024 05:20: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkVlV4NMcz55H8; Thu, 7 Nov 2024 05:20:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730956838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VqyRKdAkHosStlwj3hJKbM8NAx5OOY+ye77oCytZEK4=; b=wWXlnkuynhI0oqzbp15of0BSWWS6njh/HlYH3bFkOcaKbLIm9wuCaYLI6E1nxyXGbeepBc v/eMBN3YPEF5/MsH7SOOvtMIP2K7bA0GAPsa3rIB7LTvMMTkCLKT68GSUt7iAdInDexPIf NSwNz2mSvIKqtnwrtQiXQVPyOSGteTnCL4JW7LZnJ+0U47YdwxbSJ1rVTzACz4hVlmoZLL 8q515lF06Eo7yW0vzhU3JGrLKVy65BAsFVOHi0nD0t6rwMedCuKSOrZsRIgpl0hjb2kXrz 5loutzz9GprV8ENVquHwFN0mV59XiELqecsC7K5Xnz9/BJ7tn4kuvHYdbln/iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730956838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VqyRKdAkHosStlwj3hJKbM8NAx5OOY+ye77oCytZEK4=; b=Bjl622KtPuCB0WUrAQrntY7TbGNc0Nz9fv6/IvYdDFwM6feGOz/1e0FJqmX/Fon77PFznw /JtN25PjKjal/6XtcJoMaT7x4BVHpI9CHcrh2Bd+G9ZAtksYgDEZ15mAi8/cdAZFuJem+6 MAJtHByvthBVaHIG+OeRdtFdy4ER5oIicNE/MzGha3NU7Hev0e8lueubCyvAoFe3ppeFVO CT1QzdICWdQmS5lNeeiXmGp4/NVoRatmMBvEHM1belxEHlYguDjc7RBNpeXMGIF5iePsVs 6O66NAP4oU2BDW5X7K2xE7POV+Q+0kxSTNmYDpFhOlGrAWi9S/lJBsoJRum5Qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730956838; a=rsa-sha256; cv=none; b=KGB/rImU0WW4prJIXvGRJmVRmWKTFKPO5yxiM6MK8Uvt3lWhfaLShWYRyGKLqaHbSVX7mw j20exGX+iydJXvuNQnuQG/z+vF7qCze8qtyniVJXpmAn+GU6MBBgItL/TjSBU8s3W7h7oB +bTxpuD8039rpp5wyMda00TYAkQ2zA5fuWMnEkHgpOGUIbS6LgS0Iy1aBcJMC9uEeMtCgA 6stobBqw2nBnu9vO6JkFcG6F0gejjow3QoLoBACsI5Y6gDMhEE9SRI8IL7/PKhYABVAv04 +2yBvhsQbcA2uRYgT3mbELjPDo+CnrvM09vaFUParP5voF/vuqNFtoIHBqRmFQ== 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 4XkVlV2z8KzXtf; Thu, 7 Nov 2024 05:20:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A75KcSU014694; Thu, 7 Nov 2024 05:20:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A75KcVr014691; Thu, 7 Nov 2024 05:20:38 GMT (envelope-from git) Date: Thu, 7 Nov 2024 05:20:38 GMT Message-Id: <202411070520.4A75KcVr014691@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 16d000bdac54 - main - rtld.1: cross-reference rtld_get_var.3 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 16d000bdac54d7153f33a0d050bcc4307b702751 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=16d000bdac54d7153f33a0d050bcc4307b702751 commit 16d000bdac54d7153f33a0d050bcc4307b702751 Author: Konstantin Belousov AuthorDate: 2024-10-31 20:20:39 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-07 05:15:30 +0000 rtld.1: cross-reference rtld_get_var.3 Reviewed by: Alexander Ziaee Discussed with: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47351 --- libexec/rtld-elf/rtld.1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index 5631c28e1f84..62e4fc5676c2 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -138,6 +138,15 @@ all the environment variables listed below, but is being prefixed with for example: .Ev LD_32_TRACE_LOADED_OBJECTS . If the activated image is setuid or setgid, the variables are ignored. +.Pp +The run-time linker is able to access the environment provided +at process startup. +After startup, environment variables are maintained by higher-level +libraries and are not accessible by the run-time linker. +At run-time, effective settings can be queried using +.Xr rtld_get_var 3 , +and some of them can be changed with +.Xr rtld_set_var 3 . .Bl -tag -width ".Ev LD_LIBMAP_DISABLE" .It Ev LD_DUMP_REL_POST If set, @@ -527,6 +536,7 @@ The libmap configuration file for 32-bit binaries on 64-bit system. .Xr ld 1 , .Xr ldd 1 , .Xr dlinfo 3 , +.Xr rtld_get_var 3 , .Xr capsicum 4 , .Xr elf 5 , .Xr libmap.conf 5 , From nobody Thu Nov 7 06:16:29 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkWzy0JK0z5cRJL; Thu, 07 Nov 2024 06:16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkWzx6vdRz3y0y; Thu, 7 Nov 2024 06:16:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730960190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lwwyos9KmGoYoncYEM4muQCdJAFR9VxiMyeMZhwBICs=; b=nvQtAxGd7QgylljVqFP1xkyaLffC7G5J0KwwChTs5hkkc60utcV+ChkNbZPfY0+K1Z83PK y+whqt7YX6b9Xo5MRQSNV0ZDguqVxleKGelK/p/c7VBZpa5fyQsKZS3t/sY2JHTqhQRNzt U1npri6uwJ3yY7UhL+lP5Gyd+9zGhagQje3Avff9a4YT9e6JVeV54FlGTnNvff4q/+4+JG wVGftbpAt5fUmyork7YftY6c6sqIKj5ESvJ7bx88r10KA4OJzFvPeGr0lf9Sa18waSLgyZ 9gnBQfWuu/ycIfvXv+PUlv48hjfHYXUYcku+Fxml1/xgFqvSO1P6pbnNhEr4ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730960190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lwwyos9KmGoYoncYEM4muQCdJAFR9VxiMyeMZhwBICs=; b=puqTGm3XZYRfYvUHTH5C/N1wIxe9dB3gYDFbgHqffU8VcrQFzXOXftTtz2Tq1UhW6nyA4X EJUopFTB2OpryaZ9kiCyHQo+4lhXI7c9ktt/8TZ8KRCy445hnYuILoY3Hq1HQr0Ma+8jXv 5D4nZgFQPdaB3uX/12/AN95wlOexNL0Z3ks/txFM4ovssRi/R7BbGXEqCgMLm1KVaVuIKE HA2QFkr+gicXxBtMRAXV0BX4d2xvx3O2VWWuS1ccbyDIIPY2/c4loonGN7SZSMAa+wtuPd qR5h9TOzM7iKxpG3iKEbhU5Cabeu4+fo2u2b2B69q98DhtaZENNYZnJhOWjJHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730960190; a=rsa-sha256; cv=none; b=hKjWWLizbeRyU+LsRSIjr3mec3q/MEB/fsXFWZrMYL31vK2Bwaz/03EZ3xzn9DytgH6BmE rrwFNledPsr0/ynGkS1dYFZmpw+qzIte4PBeb078pS6UWN6J/ZnpvXbWIRDNSQrNUKT/Ow gO23doZjjI8IsxFuwksQKJp9VYDu/Ic5vgRDu76kLGZOxYYg3buHGVttR1moRrS2xi7yl3 SmMoJaixB9OdGclWckLUpsJ9VvDvs4paORSeLE5vN1IeMnIjANVQ6D0WGZbVAJSHExTucX s+QTK2puG6e3++cMxJ3qVl+EJkBDqu7qH771X7NWSwC7RTiZ76BPMRUOP+9ahw== 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 4XkWzx6VbPzZGX; Thu, 7 Nov 2024 06:16:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A76GTc8016249; Thu, 7 Nov 2024 06:16:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A76GTjb016246; Thu, 7 Nov 2024 06:16:29 GMT (envelope-from git) Date: Thu, 7 Nov 2024 06:16:29 GMT Message-Id: <202411070616.4A76GTjb016246@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 15853a5fc954 - main - e1000: Improve igb(4) SFP support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 15853a5fc9548d9805a2ef22f24e2eb580198341 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=15853a5fc9548d9805a2ef22f24e2eb580198341 commit 15853a5fc9548d9805a2ef22f24e2eb580198341 Author: Kevin Bowling AuthorDate: 2024-11-07 06:02:10 +0000 Commit: Kevin Bowling CommitDate: 2024-11-07 06:10:14 +0000 e1000: Improve igb(4) SFP support * Adds support for SFPs that are not correctly coded as an SFP transceiver. i.e. Coherent-Finisar FCLF8522P2BTL. * Configures multi-rate SFPs i.e. Coherent-Finisar FCLF8522P2BTL as SGMII so they can do 10/100/1000 auto-negotiation. * Adds support for 100BaseLX SGMII transceivers. * Some code cleanup and additional debugging. Reviewed by: emaste, markj, Franco Fichtner Tested by: Natalino Picone MFC after: 2 weeks Sponsored by: Nozomi Networks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D47337 --- sys/dev/e1000/e1000_82575.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index a33aa9eb2903..47b8006314f8 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -1686,20 +1686,19 @@ static s32 e1000_get_media_type_82575(struct e1000_hw *hw) break; } - /* do not change link mode for 100BaseFX */ - if (dev_spec->eth_flags.e100_base_fx) - break; - /* change current link mode setting */ ctrl_ext &= ~E1000_CTRL_EXT_LINK_MODE_MASK; - if (hw->phy.media_type == e1000_media_type_copper) + if (dev_spec->sgmii_active) ctrl_ext |= E1000_CTRL_EXT_LINK_MODE_SGMII; else ctrl_ext |= E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES; E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext); + break; + default: + DEBUGOUT("e1000_get_media_type_82575 unknown link type\n"); break; } @@ -1750,24 +1749,27 @@ static s32 e1000_set_sfp_media_type_82575(struct e1000_hw *hw) /* Check if there is some SFP module plugged and powered */ if ((tranceiver_type == E1000_SFF_IDENTIFIER_SFP) || - (tranceiver_type == E1000_SFF_IDENTIFIER_SFF)) { + (tranceiver_type == E1000_SFF_IDENTIFIER_SFF)) dev_spec->module_plugged = true; - if (eth_flags->e1000_base_lx || eth_flags->e1000_base_sx) { - hw->phy.media_type = e1000_media_type_internal_serdes; - } else if (eth_flags->e100_base_fx) { - dev_spec->sgmii_active = true; - hw->phy.media_type = e1000_media_type_internal_serdes; - } else if (eth_flags->e1000_base_t) { - dev_spec->sgmii_active = true; - hw->phy.media_type = e1000_media_type_copper; - } else { - hw->phy.media_type = e1000_media_type_unknown; - DEBUGOUT("PHY module has not been recognized\n"); - goto out; - } + else + DEBUGOUT("PHY module is not SFP/SFF %x\n", tranceiver_type); + + if (eth_flags->e1000_base_lx || eth_flags->e1000_base_sx) { + hw->phy.media_type = e1000_media_type_internal_serdes; + DEBUGOUT("PHY module is 1000_base_lxsx\n"); + } else if (eth_flags->e100_base_fx || eth_flags->e100_base_lx) { + dev_spec->sgmii_active = true; + hw->phy.media_type = e1000_media_type_internal_serdes; + DEBUGOUT("PHY module is 100_base_fxlx\n"); + } else if (eth_flags->e1000_base_t) { + dev_spec->sgmii_active = true; + hw->phy.media_type = e1000_media_type_copper; + DEBUGOUT("PHY module is 1000_base_t\n"); } else { hw->phy.media_type = e1000_media_type_unknown; + DEBUGOUT("PHY module has not been recognized\n"); } + ret_val = E1000_SUCCESS; out: /* Restore I2C interface setting */ From nobody Thu Nov 7 18:31:27 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkrHz2s0Vz5cM6v; Thu, 07 Nov 2024 18:31: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkrHz2Mbcz4Xs8; Thu, 7 Nov 2024 18:31:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731004287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DSRBUDIDOG7TuRH6pN4ZEhX9gx0eziCzQqPeNoP5Ugo=; b=yik3bq1uOJz3MUlzCiiis8HKna/06LCrJvwNZPhJB5V4QzVCB0V0olRslJAgTotQUykp2c hUbY3vIfBj1WEBMbYUwJI2K0U2foI7cm0NgDbYUS6Pvim1LGmxC/CKIudChabcXBDe4zKU UxLviGAyDddgpzUYzmUcqWYlphqdp+ZZCB5DjvQRexYGmrxd44Ze+pagZ9w8GLdlIoFsRu 2o2IFdxV41pq6ciKPM6T3lfCxc9sblqkZ1V13UG1HgqLRD9Kesz9zqFOH8UvjWaQCmRkhD sGrvBy7Skg7vdY8FWaVK62UDkAGLHFV+3HsgfpQmhtJ2QzExwoMDqOtvfpq4Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731004287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DSRBUDIDOG7TuRH6pN4ZEhX9gx0eziCzQqPeNoP5Ugo=; b=DAf7VDC+JQOu3uj4Jp0yM0+cEx3z4N2H8Z+GuxOZu2HDpsLlLuIW+ASH2WaZVkJQt8Z17O 7O52TyMgPN3MGgS3eA8VHisXehT0TpaXKWMp09ns8r9QdLeLSyBh7BaYwP+EftG2BERbsi bAI0MxajZ1PA+byPIV6N3cpPoVNgrpvGYSWyT+zWvd9apw7cCCgsD98tEVUuPgkjzAOPDk zYpxbLOvf7IPV+tg4C78RGEo7bTI7pdc0Kagl2jd3eskrA3GVloEWig4mfeVySdXK3O5XG Rv/DNZDqnvlr3uQB3FgafPxi/st2AV7dgC1HyE6qyPXHSGeHCl+4tv00+KxAuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731004287; a=rsa-sha256; cv=none; b=e97HC+TzTgoDjJBE6wSgrbeGJWxv2669ozP4nazvI+QgbX1H391bXDafkSAvO2sW4MSgVN rtgopHr9KjjnJugnMNWPccNwJf0Q3sIFxikEwsA9zaqJ4L9E2BTm9DvoFL2D/zEylmwi5h nh0ElXZODaKg8Y1Ta3Tzxm3x39enCpd6hpBlmgEWM8zw+XRwM2iFtt+ic+whDWxj4frvX6 1BY1oftHZLeGP4dtBSSGE89MUfklE6ED46Azhyj5RUptGov9cuPqUspkuDTIZGmjRlrYk+ FqauIp2C6aPnP+Rnsn8QfEZwA9ZVFzdlJrz6sF09Qbh4yFySbKAPjtlk+GRVCw== 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 4XkrHz1yhVzx0s; Thu, 7 Nov 2024 18:31:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A7IVReU093626; Thu, 7 Nov 2024 18:31:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A7IVRPO093623; Thu, 7 Nov 2024 18:31:27 GMT (envelope-from git) Date: Thu, 7 Nov 2024 18:31:27 GMT Message-Id: <202411071831.4A7IVRPO093623@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 1d99e8d9a37e - main - p9fs: Use UNLINKAT instead of REMOVE to implement removals List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 1d99e8d9a37e1ba528628186df57b79fe74e196c Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1d99e8d9a37e1ba528628186df57b79fe74e196c commit 1d99e8d9a37e1ba528628186df57b79fe74e196c Author: Mark Johnston AuthorDate: 2024-11-07 18:23:32 +0000 Commit: Mark Johnston CommitDate: 2024-11-07 18:23:32 +0000 p9fs: Use UNLINKAT instead of REMOVE to implement removals REMOVE doesn't work properly in the face of hard links. Use UNLINKAT instead, which is implemented by qemu and bhyve and lets the client specify the name being removed. PR: 282432 Reviewed by: dfr Differential Revision: https://reviews.freebsd.org/D47438 --- sys/fs/p9fs/p9_client.c | 21 +++++++++++++++++++++ sys/fs/p9fs/p9_client.h | 1 + sys/fs/p9fs/p9_protocol.h | 2 ++ sys/fs/p9fs/p9fs_vnops.c | 21 ++++++++++++++------- 4 files changed, 38 insertions(+), 7 deletions(-) diff --git a/sys/fs/p9fs/p9_client.c b/sys/fs/p9fs/p9_client.c index 45d24870306c..547de98c4c03 100644 --- a/sys/fs/p9fs/p9_client.c +++ b/sys/fs/p9fs/p9_client.c @@ -669,6 +669,27 @@ p9_client_remove(struct p9_fid *fid) return (error); } +int +p9_client_unlink(struct p9_fid *dfid, const char *name, int32_t flags) +{ + int error; + struct p9_client *clnt; + struct p9_req_t *req; + + error = 0; + clnt = dfid->clnt; + + req = p9_client_request(clnt, P9PROTO_TUNLINKAT, &error, "dsd", + dfid->fid, name, flags); + if (error != 0) { + P9_DEBUG(PROTO, "RUNLINKAT fid %d\n", dfid->fid); + return (error); + } + + p9_free_req(clnt, req); + return (error); +} + /* Inform the file server that the current file represented by fid is no longer * needed by the client. Any allocated fid on the server needs a clunk to be * destroyed. diff --git a/sys/fs/p9fs/p9_client.h b/sys/fs/p9fs/p9_client.h index 8597c0732ba3..79d402c174e8 100644 --- a/sys/fs/p9fs/p9_client.h +++ b/sys/fs/p9fs/p9_client.h @@ -140,6 +140,7 @@ int p9_client_write(struct p9_fid *fid, uint64_t offset, uint32_t count, char *d int p9_client_file_create(struct p9_fid *fid, char *name, uint32_t perm, int mode, char *extension); int p9_client_remove(struct p9_fid *fid); +int p9_client_unlink(struct p9_fid *dfid, const char *name, int32_t flags); int p9_dirent_read(struct p9_client *clnt, char *buf, int start, int len, struct p9_dirent *dirent); int p9_client_statfs(struct p9_fid *fid, struct p9_statfs *stat); diff --git a/sys/fs/p9fs/p9_protocol.h b/sys/fs/p9fs/p9_protocol.h index ddd8571adc8d..7ffd7dd67bcf 100644 --- a/sys/fs/p9fs/p9_protocol.h +++ b/sys/fs/p9fs/p9_protocol.h @@ -267,6 +267,8 @@ struct p9_iattr_dotl { #define P9PROTO_TGETATTR_BLK 512 +#define P9PROTO_UNLINKAT_REMOVEDIR 0x200 + /* PDU buffer used for SG lists. */ struct p9_buffer { uint32_t size; diff --git a/sys/fs/p9fs/p9fs_vnops.c b/sys/fs/p9fs/p9fs_vnops.c index 14951e96b59d..cfb50c704019 100644 --- a/sys/fs/p9fs/p9fs_vnops.c +++ b/sys/fs/p9fs/p9fs_vnops.c @@ -1497,7 +1497,8 @@ out: * After that, does a node metadata cleanup on client side. */ static int -remove_common(struct p9fs_node *np, struct ucred *cred) +remove_common(struct p9fs_node *dnp, struct p9fs_node *np, const char *name, + struct ucred *cred) { int error; struct p9fs_session *vses; @@ -1508,21 +1509,23 @@ remove_common(struct p9fs_node *np, struct ucred *cred) vses = np->p9fs_ses; vp = P9FS_NTOV(np); - vfid = p9fs_get_fid(vses->clnt, np, cred, VFID, -1, &error); + vfid = p9fs_get_fid(vses->clnt, dnp, cred, VFID, -1, &error); if (error != 0) return (error); - error = p9_client_remove(vfid); + error = p9_client_unlink(vfid, name, + np->v_node->v_type == VDIR ? P9PROTO_UNLINKAT_REMOVEDIR : 0); if (error != 0) return (error); /* Remove all non-open fids associated with the vp */ - p9fs_fid_remove_all(np, TRUE); + if (np->inode.i_links_count == 1) + p9fs_fid_remove_all(np, TRUE); /* Invalidate all entries of vnode from name cache and hash list. */ cache_purge(vp); - vfs_hash_remove(vp); + np->flags |= P9FS_NODE_DELETED; return (error); @@ -1537,8 +1540,10 @@ p9fs_remove(struct vop_remove_args *ap) struct vnode *dvp; struct p9fs_node *dnp; struct p9fs_inode *dinode; + struct componentname *cnp; int error; + cnp = ap->a_cnp; vp = ap->a_vp; np = P9FS_VTON(vp); dvp = ap->a_dvp; @@ -1550,7 +1555,7 @@ p9fs_remove(struct vop_remove_args *ap) if (vp->v_type == VDIR) return (EISDIR); - error = remove_common(np, ap->a_cnp->cn_cred); + error = remove_common(dnp, np, cnp->cn_nameptr, cnp->cn_cred); if (error == 0) P9FS_DECR_LINKS(dinode); @@ -1566,8 +1571,10 @@ p9fs_rmdir(struct vop_rmdir_args *ap) struct vnode *dvp; struct p9fs_node *dnp; struct p9fs_inode *dinode; + struct componentname *cnp; int error; + cnp = ap->a_cnp; vp = ap->a_vp; np = P9FS_VTON(vp); dvp = ap->a_dvp; @@ -1576,7 +1583,7 @@ p9fs_rmdir(struct vop_rmdir_args *ap) P9_DEBUG(VOPS, "%s: vp %p node %p \n", __func__, vp, np); - error = remove_common(np, ap->a_cnp->cn_cred); + error = remove_common(dnp, np, cnp->cn_nameptr, cnp->cn_cred); if (error == 0) P9FS_DECR_LINKS(dinode); From nobody Thu Nov 7 18:40:21 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XkrVJ6LzGz5cMrh for ; Thu, 07 Nov 2024 18:40:24 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XkrVJ1clvz4YfZ for ; Thu, 7 Nov 2024 18:40:23 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=bKsqRKm0; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::129 as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org; dmarc=none Received: by mail-il1-x129.google.com with SMTP id e9e14a558f8ab-3a6c1cfcb91so5003905ab.0 for ; Thu, 07 Nov 2024 10:40:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1731004823; x=1731609623; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=CQ8tRD4mee3MG0lNgBTYS7alPkUQz18Pzvb0uA/MAMc=; b=bKsqRKm0aZLhOBGfWxye+06BElSWDFQVdisX9Q894lZ2TyH3e0zQaaXrT1BJf/gyDS yVHNHIi4W0KZNez/3tSHa2x/G8JdiVokIbJNkw/qfyOq4ab3lKIbXyOQgjiRFsX6qXJo hLnOPNsiZF25VGlUSTOcrmMlmE3T+0x/a3E2w6GBarlG4KoPsTEsYYYOfR7GouSDL0fA sHyaH9vF5dPJJutBg+vPVa00HpaTiY0Ak/wGSgTyJt3itZ6DWa4JQibr62omivFuSf+U HrRdWhwEF6IHC0oC8byPu27Wz4WxzWIb7Fsi7qsfRDla/cBCnkqHr50Q27fJC9lqgqDV gF7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731004823; x=1731609623; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CQ8tRD4mee3MG0lNgBTYS7alPkUQz18Pzvb0uA/MAMc=; b=IARkqB48Xpe0ulmHw11VB+PPJRY9lh6Voi4LdJvTsGS+Te+v4iAsj8UbK8Nod3J5Vh Yc1YDObL0mo4MZcSrhXRvsxlVKTdnJLV+ZRkDlzvE0fhEc+a/GV8kV/b0/1qjDfjbJ9H 4FKuJ/yHUf6PPjR1xsZHW6dL5S3MGJJ5fhhbKsMdkOE5jCi/my4FVF/xcZe2/8l9ftmv 1yedYtW3VWBhk4KUDnGCMjS7Nysg+C9zpQxoM3aMGC/1syjA0hz6KFuFxbXRWnx0de/t lTaTCSVKtCDtlMitXR5D+2rX8yd0RCCorqmegN7TpCuKlEnp2rfy6hGuBwh2KtxNdbqZ CTMw== X-Forwarded-Encrypted: i=1; AJvYcCXebe2gKseLbpBlSI2TKP1pxiVvWUTL/cFgSUgWNt4NXTxQL5HNMiH4fe1Kny7Lhpw7+dpalGcxSUFgCNGzk8KWBOnQJA==@freebsd.org X-Gm-Message-State: AOJu0Yz95H+MbDVJkI6YqpfQ2JUALfSS7galLlaKxmrbNZOTR8o2Cfpo OzvzOjWYnap2V8WL9TO9Jv5LIlTzpxCkvrdbolRUiABP7FKQU0/avngaN0t9LfE= X-Google-Smtp-Source: AGHT+IEbO4LZ1V8chM6XOlQ46eZ5xQd1ulremTzEfQTs5Zu5prdQUha9ZTO2swEcscpE6tt8Q5W8aw== X-Received: by 2002:a92:c264:0:b0:3a6:bb77:a362 with SMTP id e9e14a558f8ab-3a6f199037bmr3154345ab.4.1731004822672; Thu, 07 Nov 2024 10:40:22 -0800 (PST) Received: from mutt-hbsd (174-24-91-193.clsp.qwest.net. [174.24.91.193]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4de5f7e35cfsm430686173.27.2024.11.07.10.40.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2024 10:40:21 -0800 (PST) Date: Thu, 7 Nov 2024 18:40:21 +0000 From: Shawn Webb To: Corvin =?utf-8?B?S8O2aG5l?= Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d93fbcf0222b - main - bhyve: TPM 2.0 emulation with swtpm Message-ID: X-Operating-System: FreeBSD mutt-hbsd 15.0-CURRENT-HBSD FreeBSD 15.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202410221206.49MC6pt3085294@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gzn2iwiddjqor6t3" Content-Disposition: inline In-Reply-To: <202410221206.49MC6pt3085294@gitrepo.freebsd.org> X-Spamd-Result: default: False [-5.08 / 15.00]; SIGNED_PGP(-2.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.982]; MID_RHS_NOT_FQDN(0.50)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::129:from]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DMARC_NA(0.00)[hardenedbsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; DKIM_TRACE(0.00)[hardenedbsd.org:+] X-Rspamd-Queue-Id: 4XkrVJ1clvz4YfZ X-Spamd-Bar: ----- --gzn2iwiddjqor6t3 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 22, 2024 at 12:06:51PM UTC, Corvin K=F6hne wrote: > The branch main has been updated by corvink: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3Dd93fbcf0222b05fcd7704b35bc= 94e5513c2682e2 >=20 > commit d93fbcf0222b05fcd7704b35bc94e5513c2682e2 > Author: Hans Rosenfeld > AuthorDate: 2024-09-09 08:45:40 +0000 > Commit: Corvin K=F6hne > CommitDate: 2024-10-22 12:04:24 +0000 >=20 > bhyve: TPM 2.0 emulation with swtpm > =20 > Implement a TPM 2.0 emulation backend to connect to a running swtpm > instance using a UNIX domain socket. > =20 > Reviewed by: corvink > MFC after: 1 week Hey Corvin, Are you still planning on MFCing this? Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --gzn2iwiddjqor6t3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmctCY0ACgkQ/y5nonf4 4frMchAAgekolPPRkGDbBADN1GdskqnF4/ezDFmrRvDyx4Z3iIPSnsEAgbhFwtIN h+L4mjt4MCQc/xcrDOT47c+wta1O1QDD5vFR+vXvNZczqVMr05XAHymcsl7edMxn ZFMMWOOtdnuf63eaesSQkSi7FaMdyV8rEWh2TNqInm0YeEPwWmRJld3f76vKDzbh 6KChf7GwD2wQFQhmWcq77UnjT1NBRF7qrU2RAsl5Ayi7+GLI0xUewEf/+E/Zjpj6 kEw5x9m+EV9euuIi3FuHwWSj7WCVcvu73XfWw79CLeLs7N3k6qDnoIjXygYl5BWd RkZ+gJsEFV7HBJ3NGYjWpU9Yhl0SrnTbVXjFw0aTMx/kFail0S7bH2HoFKZ8w42X /NiAymw9Kskqqzhp6bD8gustiCqpA9peLV6+x8EHAg07yr7P7yFke8kCYubDn0kC kq3x7GIDxMqPOH9HDf6qYae+q0zUgb3Ngkg6cem8D667Wpttk24jWp+BMzJ46Tp8 MIBhmbfR5jOiFEYfs/61l0X3U5W8iHl/s4a684cJdm4FxyktbmVUdNiNeRQqGuPO xPzM2sP/xwIoppmGvq768tjA/EYx3fr86ImrB8dK3xtfTGzNFjVPpz/0IIy5/Kwi CvjsH45GEa+wMuZMj3OVKIrhprGfXwFSmD/DV653AqdDS87OBcg= =KwBF -----END PGP SIGNATURE----- --gzn2iwiddjqor6t3-- From nobody Thu Nov 7 18:49:43 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xkrj41Y8dz5cNb3; Thu, 07 Nov 2024 18:49: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xkrj34cmZz4bNy; Thu, 7 Nov 2024 18:49:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731005383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mkfjCHMsRVaq15nrF9wNbaFnrEsB2hR1b0qMNEFYwio=; b=hNgUgl0cM6uxAJthvJtl+bT2LNPRAaAbSfeXfo+MxAgiyk6i59ulw9Npqc3RnmzjdL9UoZ k9jdxQiqC0XhSWxohxKscytjKKzGi96v+C6U0bNDPjG5R76OER6dSXIm7gL5BRzdLtmQUz 9BsgQ1YubV7DMaNQtpPnwQclHJiy6r4YCK7Ti/EH9pD97XQr88MMBfGrCu9XHPrKcmnglN uEwWZ0dqwGqrIx4C/sZjbEzo2tu8Ovf/snkc4kJem2+qsxGCWZnMTJ8g1A8zRPDZPVvuk6 FcPXWt38oWS30aH6Tmwyh3RsFE5c3KH+WPID4ALFHEODy0Ny6vSpiXH4WNnT5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731005383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mkfjCHMsRVaq15nrF9wNbaFnrEsB2hR1b0qMNEFYwio=; b=q29xVp2hP+mxX3wI7zbncZqO7AFe4H4K0Jst5lNrveNhSefe+wCKcsjKD9284V321UzUKd RcSfuyusy+lgrpH0z1Qq1AkvCiiR2SUzRkgwqrav7dr0odsCAtDDm5N7orl05tAyayNQIo v0yz1EXHJHYpES32TLC+AsIfRqruPW5E+XRWxC23uc9z/j61VMe2b3QZcKsbONm8lA44a8 EolOA5KIkVBuUwnnzWebSKfKtqx9Fxaux6E1pmzQVBCFeDE8yaK5pN5TMs1+YR7BBRoZqH 5kXic+RKiVOjMHf1FDNryTaGbzpAz1cnCoM9s2GeoIywJT/gZ1EnrVnOzqw15Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731005383; a=rsa-sha256; cv=none; b=bWtb0feMcgIHp+fKhh6WPCzX8WPwFC/6FpNLLr7GFepFwdLMj788ZPqvszfE96ixsbqRKN PVAFISvIUGcB+FAOF+XUdHc+jQ6Uv2pfs5beAAmsdwBbsvRHSZtaKAeDBOi3a8ME4UlkF6 n44V47QvWYANHx1B0F/NssCSwLTXLrcSYYh7XC7a7TBe85zrreXdiK52+LxCI8ujiwPXI4 KAtEfUwnSUzv9FlebM9kB+/q5p1kd1sZ3RBzO5wFz0erSxjMv2JYQYHZlbKUVAZQyZYUlg imPsX5tZ8e6bF2HZcgjvmLMjur78BcgZriqPc1Nhs9MQEBbYBor2FrrofyrNAw== 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 4Xkrj335Fszx0K; Thu, 7 Nov 2024 18:49:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A7InhDL015905; Thu, 7 Nov 2024 18:49:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A7InhEs015902; Thu, 7 Nov 2024 18:49:43 GMT (envelope-from git) Date: Thu, 7 Nov 2024 18:49:43 GMT Message-Id: <202411071849.4A7InhEs015902@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e434c56fcd4f - main - rtld_get_var.3: fix typo List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: e434c56fcd4f9eee04ac6bb5e0cf028db3006be3 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e434c56fcd4f9eee04ac6bb5e0cf028db3006be3 commit e434c56fcd4f9eee04ac6bb5e0cf028db3006be3 Author: Konstantin Belousov AuthorDate: 2024-11-07 18:48:28 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-07 18:48:28 +0000 rtld_get_var.3: fix typo Noted by: Christos Longros @github MFC after: 3 days --- lib/libc/gen/rtld_get_var.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/gen/rtld_get_var.3 b/lib/libc/gen/rtld_get_var.3 index 06d2e8a41cbc..e211d78345e3 100644 --- a/lib/libc/gen/rtld_get_var.3 +++ b/lib/libc/gen/rtld_get_var.3 @@ -44,7 +44,7 @@ .Sh DESCRIPTION The dynamic linker .Xr rtld 1 -can be configured be setting some environment variables for the process, +can be configured by setting some environment variables for the process, before image activation. Sometimes it is desirable to query the current effective settings or change them afterward. From nobody Thu Nov 7 20:38:54 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xkv723h6Cz5cZZZ; Thu, 07 Nov 2024 20:38: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xkv722lGrz3ww2; Thu, 7 Nov 2024 20:38:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731011934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uMZFnrVknnmbSCi4rUJ146B75tUqLYpMkc31JFJ0IcQ=; b=rmoS4C/P/e5c4v5yhglEXSQ/rTDUIcF2VJL/aGqXoUePpa6zpmZUaqtRMABXd/OR0bMq5/ uIwIVrWcrFCsvCDoPTwllhvoCzCZCZ7zPQK9ou4aC9SlU6AeXWilTX19K+RXmox16I9MXJ nmxTJ1xGOgqM+VJNrQGA9shom4DMkp2dXbq1YgmoU8Z10qsC0j/1zsCqaxgEseRNomwarc s1N0P72En2UKmWtEhLAx7nU6JBU9cJqV7f+kpJK31JZLpOJtIdbUukRcUi7KCgkHmd4QPY rS1o3d9SwHabGblVlvFFiE/B9PIe+Y8QOpSK+AC1XJRDMQZJyXBG0YlQulAeJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731011934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uMZFnrVknnmbSCi4rUJ146B75tUqLYpMkc31JFJ0IcQ=; b=m1eVNf0wQdiihn0l4Pz9flqmn5OS82ME8MqUzP3OUDsxFvi/A2NOUk5IgI1Y1mbNXQ130p VtlOjxJBiuPm97+QvGmZeYundcFqW+K9eicFVeGqBTQyIk/x6utyiZlrJMYboYreCXQzda UJKnB2Ux+B7tPILlSAeQEQNB3Y3ObZseDu++kqryiajeniyRWI+tQQD74xLB9z0NShSNek jYaMhEmjL0T+Xwzy2xbj6mID6ipcXn4NbuUgX88hYRVl6amYG6umA3mwcmN/WCNM8XPwT/ 4rUJcyIYLXFJ3R62oxW8StteerlXhy+RVCDw2P3w+hbGSBu9LFs/zrQSPaj5lg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731011934; a=rsa-sha256; cv=none; b=OjhIfdHVReza59gyvaNXSY98rspYxKpmQyVhFcVDbxm7KGlf1CJjrymuWA4xOwN5tQ85II 26oEB1+wgRB6+Y5qoSo6P58Gmc1uXUyfLMR89JPoeT7YHGVQkGd36LE1UJnDSZ2uA0IRLW qcQNzkA8q1IohqHVZRRuTeWctcQ1nsst0HP/tQDKYqnweGSbFZDSh/3ZgHHVFgJ7Xv/EKF a1mEYlBlMWf2irQc8GL2UHKyJhdFJZdkfRtHenuMJOBVGjrDP1b7DPWZKBVJqydwE6Tp4c jz78+WpsnNBt5+7ETic1+7RsZc/CnmEOH47MMgmmf8LsX+EgF7ygOex1fUAThg== 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 4Xkv7223l6z118q; Thu, 7 Nov 2024 20:38:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A7Kcskr019886; Thu, 7 Nov 2024 20:38:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A7KcsDC019883; Thu, 7 Nov 2024 20:38:54 GMT (envelope-from git) Date: Thu, 7 Nov 2024 20:38:54 GMT Message-Id: <202411072038.4A7KcsDC019883@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 541e7a98b762 - main - ukbd: Enable ukbd_apple_swap for all Apple ISO keyboards List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 541e7a98b762916cd951a64dd7e77efd51dfa8dc Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=541e7a98b762916cd951a64dd7e77efd51dfa8dc commit 541e7a98b762916cd951a64dd7e77efd51dfa8dc Author: Frank Hilgendorf AuthorDate: 2024-11-01 19:37:38 +0000 Commit: Mark Johnston CommitDate: 2024-11-07 20:38:38 +0000 ukbd: Enable ukbd_apple_swap for all Apple ISO keyboards Key code swapping between [<>] and [^°] key is enabled for all Apple ISO type keyboards. Before, swapping was enabled when the Eject key was detected in HID usage. This did not correlate well with the swapped keys presence. usbdevs file is extended by several Apple keyboard models to support ISO model identification. Reviewed by: markj MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1506 --- sys/dev/usb/input/ukbd.c | 72 ++++++++++++++++++++++++++++++++++++++++++++---- sys/dev/usb/usbdevs | 42 ++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+), 6 deletions(-) diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c index f33ae6e8a620..9ff093628312 100644 --- a/sys/dev/usb/input/ukbd.c +++ b/sys/dev/usb/input/ukbd.c @@ -72,6 +72,8 @@ #include +#include "usbdevs.h" + #ifdef EVDEV_SUPPORT #include #include @@ -173,13 +175,19 @@ struct ukbd_softc { #define UKBD_FLAG_ATTACHED 0x00000010 #define UKBD_FLAG_GONE 0x00000020 -#define UKBD_FLAG_HID_MASK 0x003fffc0 -#define UKBD_FLAG_APPLE_EJECT 0x00000040 -#define UKBD_FLAG_APPLE_FN 0x00000080 -#define UKBD_FLAG_APPLE_SWAP 0x00000100 +/* set in ukbd_attach */ +#define UKBD_FLAG_APPLE_SWAP 0x00000040 +/* set in ukbd_parse_hid */ +#define UKBD_FLAG_APPLE_EJECT 0x00000080 +#define UKBD_FLAG_APPLE_FN 0x00000100 #define UKBD_FLAG_NUMLOCK 0x00080000 #define UKBD_FLAG_CAPSLOCK 0x00100000 #define UKBD_FLAG_SCROLLLOCK 0x00200000 +#define UKBD_FLAG_HID_MASK UKBD_FLAG_APPLE_EJECT | \ + UKBD_FLAG_APPLE_FN | \ + UKBD_FLAG_NUMLOCK | \ + UKBD_FLAG_CAPSLOCK | \ + UKBD_FLAG_SCROLLLOCK int sc_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */ int sc_state; /* shift/lock key state */ @@ -296,6 +304,48 @@ static const uint8_t ukbd_boot_desc[] = { 0xff, 0x00, 0x81, 0x00, 0xc0 }; +static const STRUCT_USB_HOST_ID ukbd_apple_iso_models[] = { + /* PowerBooks Feb 2005, iBooks G4 */ + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_FOUNTAIN_ISO) }, + /* PowerBooks Oct 2005 */ + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_GEYSER_ISO) }, + /* Core Duo MacBook & MacBook Pro */ + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_GEYSER3_ISO) }, + /* Core2 Duo MacBook & MacBook Pro */ + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_GEYSER4_ISO) }, + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_GEYSER4_HF_ISO) }, + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_ALU_MINI_ISO) }, + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_ALU_ISO) }, + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_ALU_REVB_ISO) }, + /* MacbookAir, aka wellspring */ + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_WELLSPRING_ISO) }, + /* MacbookProPenryn, aka wellspring2 */ + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_WELLSPRING2_ISO) }, + /* Macbook5,1 (unibody), aka wellspring3 */ + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_WELLSPRING3_ISO) }, + /* MacbookAir3,2 (unibody), aka wellspring4 */ + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_WELLSPRING4_ISO) }, + /* MacbookAir3,1 (unibody), aka wellspring4 */ + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_WELLSPRING4A_ISO) }, + /* Macbook8 (unibody, March 2011) */ + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_WELLSPRING5_ISO) }, + /* Macbook8,2 (unibody) */ + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_WELLSPRING5A_ISO) }, + /* MacbookAir4,2 (unibody, July 2011) */ + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_WELLSPRING6_ISO) }, + /* MacbookAir4,1 (unibody, July 2011) */ + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_WELLSPRING6A_ISO) }, + /* MacbookPro10,1 (unibody, June 2012) */ + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_WELLSPRING7_ISO) }, + /* MacbookPro10,2 (unibody, October 2012) */ + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_WELLSPRING7A_ISO) }, + /* MacbookAir6,2 (unibody, June 2013) */ + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_WELLSPRING8_ISO) }, + /* MacbookPro12,1 */ + { USB_VP(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_WELLSPRING9_ISO) }, +}; + + /* prototypes */ static void ukbd_timeout(void *); static void ukbd_set_leds(struct ukbd_softc *, uint8_t); @@ -1001,8 +1051,7 @@ ukbd_parse_hid(struct ukbd_softc *sc, const uint8_t *ptr, uint32_t len) hid_input, 0, &sc->sc_loc_apple_eject, &flags, &sc->sc_id_apple_eject)) { if (flags & HIO_VARIABLE) - sc->sc_flags |= UKBD_FLAG_APPLE_EJECT | - UKBD_FLAG_APPLE_SWAP; + sc->sc_flags |= UKBD_FLAG_APPLE_EJECT; DPRINTFN(1, "Found Apple eject-key\n"); } if (hid_locate(ptr, len, @@ -1138,6 +1187,17 @@ ukbd_attach(device_t dev) sc->sc_fkeymap[n] = fkey_tab[n]; } + /* check if this is an Apple keyboard with swapped key codes + * apparently, these are the ISO layout models + */ + DPRINTF("uaa vendor: 0x%04x, uaa product 0x%04x\n", uaa->info.idVendor, uaa->info.idProduct ); + if (usbd_lookup_id_by_uaa(ukbd_apple_iso_models, sizeof(ukbd_apple_iso_models), uaa) == 0) { + sc->sc_flags |= UKBD_FLAG_APPLE_SWAP; + DPRINTF("UKBD_FLAG_APPLE_SWAP set\n"); + } else { + DPRINTF("UKBD_FLAG_APPLE_SWAP not set\n"); + } + kbd_set_maps(kbd, &sc->sc_keymap, &sc->sc_accmap, sc->sc_fkeymap, UKBD_NFKEY); diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 61c7686da957..9a2f6a41c499 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -1141,10 +1141,38 @@ product AOX USB101 0x0008 Ethernet product APPLE IMAC_KBD 0x0201 USB iMac Keyboard product APPLE KBD 0x0202 USB Keyboard M2452 product APPLE EXT_KBD 0x020c Apple Extended USB Keyboard +/* PowerBooks Feb 2005, iBooks G4 */ +product APPLE FOUNTAIN_ANSI 0x020e Apple Internal Keyboard/Trackpad +product APPLE FOUNTAIN_ISO 0x020f Apple Internal Keyboard/Trackpad +/* 17 inch PowerBook */ +product APPLE GEYSER_17 0x020d Apple Internal Keyboard/Trackpad +/* PowerBooks Oct 2005 */ +product APPLE GEYSER_ANSI 0x0214 Apple Internal Keyboard/Trackpad +product APPLE GEYSER_ISO 0x0215 Apple Internal Keyboard/Trackpad +product APPLE GEYSER_JIS 0x0216 Apple Internal Keyboard/Trackpad +/* Core Duo MacBook & MacBook Pro */ +product APPLE GEYSER3_ANSI 0x0217 Apple Internal Keyboard/Trackpad +product APPLE GEYSER3_ISO 0x0218 Apple Internal Keyboard/Trackpad +product APPLE GEYSER3_JIS 0x0219 Apple Internal Keyboard/Trackpad +/* Core2 Duo MacBook & MacBook Pro */ +product APPLE GEYSER4_ANSI 0x021a Apple Internal Keyboard/Trackpad +product APPLE GEYSER4_ISO 0x021b Apple Internal Keyboard/Trackpad +product APPLE GEYSER4_JIS 0x021c Apple Internal Keyboard/Trackpad +/* External */ +product APPLE ALU_MINI_ANSI 0x021d Apple Keyboard/Trackpad +product APPLE ALU_MINI_ISO 0x021e Apple Keyboard/Trackpad +product APPLE ALU_MINI_JIS 0x021f Apple Keyboard/Trackpad +product APPLE ALU_ANSI 0x0220 Apple Keyboard/Trackpad +product APPLE ALU_ISO 0x0221 Apple Keyboard/Trackpad +product APPLE ALU_JIS 0x0222 Apple Keyboard/Trackpad /* MacbookAir, aka wellspring */ product APPLE WELLSPRING_ANSI 0x0223 Apple Internal Keyboard/Trackpad product APPLE WELLSPRING_ISO 0x0224 Apple Internal Keyboard/Trackpad product APPLE WELLSPRING_JIS 0x0225 Apple Internal Keyboard/Trackpad +/* Core2 Duo MacBook3,1 */ +product APPLE GEYSER4_HF_ANSI 0x0229 Apple Internal Keyboard/Trackpad +product APPLE GEYSER4_HF_ISO 0x022a Apple Internal Keyboard/Trackpad +product APPLE GEYSER4_HF_JIS 0x022b Apple Internal Keyboard/Trackpad /* MacbookProPenryn, aka wellspring2 */ product APPLE WELLSPRING2_ANSI 0x0230 Apple Internal Keyboard/Trackpad product APPLE WELLSPRING2_ISO 0x0231 Apple Internal Keyboard/Trackpad @@ -1173,6 +1201,10 @@ product APPLE WELLSPRING6A_JIS 0x024b Apple Internal Keyboard/Trackpad product APPLE WELLSPRING6_ANSI 0x024c Apple Internal Keyboard/Trackpad product APPLE WELLSPRING6_ISO 0x024d Apple Internal Keyboard/Trackpad product APPLE WELLSPRING6_JIS 0x024e Apple Internal Keyboard/Trackpad +/* External */ +product APPLE ALU_REVB_ANSI 0x024f Apple Keyboard/Trackpad +product APPLE ALU_REVB_ISO 0x0250 Apple Keyboard/Trackpad +product APPLE ALU_REVB_JIS 0x0251 Apple Keyboard/Trackpad /* Macbook8,2 (unibody) */ product APPLE WELLSPRING5A_ANSI 0x0252 Apple Internal Keyboard/Trackpad product APPLE WELLSPRING5A_ISO 0x0253 Apple Internal Keyboard/Trackpad @@ -1193,6 +1225,16 @@ product APPLE WELLSPRING8_JIS 0x0292 Apple Internal Keyboard/Trackpad product APPLE WELLSPRING9_ANSI 0x0272 Apple Internal Keyboard/Trackpad product APPLE WELLSPRING9_ISO 0x0273 Apple Internal Keyboard/Trackpad product APPLE WELLSPRING9_JIS 0x0274 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRINGT2_J140K 0x027a Apple Internal Keyboard/Trackpad +product APPLE WELLSPRINGT2_J132 0x027b Apple Internal Keyboard/Trackpad +product APPLE WELLSPRINGT2_J680 0x027c Apple Internal Keyboard/Trackpad +product APPLE WELLSPRINGT2_J213 0x027d Apple Internal Keyboard/Trackpad +product APPLE WELLSPRINGT2_J214K 0x027e Apple Internal Keyboard/Trackpad +product APPLE WELLSPRINGT2_J223 0x027f Apple Internal Keyboard/Trackpad +product APPLE WELLSPRINGT2_J230K 0x0280 Apple Internal Keyboard/Trackpad +product APPLE WELLSPRINGT2_J152F 0x0340 Apple Internal Keyboard/Trackpad +product APPLE MAGIC_KEYBOARD_2021 0x029c Apple Internal Keyboard/Trackpad +product APPLE MAGIC_KEYBOARD_FINGERPRINT_2021 0x029a Apple Keyboard/Trackpad product APPLE MAGIC_TRACKPAD2 0x0265 Apple Magic Trackpad 2 product APPLE MOUSE 0x0301 Mouse M4848 product APPLE OPTMOUSE 0x0302 Optical mouse From nobody Thu Nov 7 20:38:55 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xkv7341YQz5cZGv; Thu, 07 Nov 2024 20:38: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xkv733Lnjz3x1k; Thu, 7 Nov 2024 20:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731011935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3Xk7Wz6ZNtmQssVIlV/dvtEy0h5ViFu532PIrJuPEJk=; b=D93VijtmT6Kpv0RR6LeROYkXFtKlYh0BMMK2Qu5r2iSVE/T/BGc7+nhao+MwQiZs8kg+DP PtzPgugmOE3XtjIr8np183kAbKDrEFu7eqsm2hnc9MOXysY8XJtyTadvM+M5rCt7SAsFdG dvrMavsqfdvGzb8oFoH6uSgpNyfp8q6v9fJjNTt2Swqf02fLbTNoDAHaLiOdmKoNpvvLdF XB1ev2r1+gAwFrs9uTblEfNptq9TO4X9tvKDOJ1fabIq4r4z/JNwAiKWbaXXnxrcLE2lP7 Q+3C04daa9n8xTsGdbYCtzYJPUpK2ClFx5GFbwhgwCQw1iTNajzFYn7lJqLQvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731011935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3Xk7Wz6ZNtmQssVIlV/dvtEy0h5ViFu532PIrJuPEJk=; b=Tjlz9g4C+oIMvsozx6KQEXk/Ff4Yom1UYdIX0f3huRViuHoNndeUBMyZEMicAIiBzC2O1U JYMKx4DV8AowxbD5Xvsl+puO99Eq6kxC77EAdWykRyWUoTHadvVom79iSy4KOQkVZ5nVze 8A+FeY+6DoQqx/All40Mu9ZVDyxj1agGuejSt8KVtRhUsMzyRhXKNGYIxDdIA5G/jRJYk3 K7lyFTweuror07Aau1y6klzQKToEohkWCnlgGY8u3YRWgsAvtazysicEAQQ4oJfYIJG0VO xI1uf62cBV0gzcTrrdTdfzH+v+cNYtJlgCBw4UCv4GLTKefYR5aItJHgWZpxsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731011935; a=rsa-sha256; cv=none; b=j60lQX9Jsw3Pbj4JWYWirrSJULWe0M2yVRt8k3Vcg6q5bb6BXgWOeG8I1iTtpv6/kYSihG ZBx5g62CeXxIUES+b96it3PlrcEiqvvx33cRB0d4xBjP3Iej+Kyv2fwLvxJSnyKGdmm1RI yp1o8D3Cx4qxfmzOou/Q5hR/8tzbm/gXUtV3KHyp2YI2h+DpRZFUMqBFmpAf2QwVfD75g5 0o4+90wzMnnYEVZfJ0RLPQ+bYNaHmNQHplF45CTuWUSFVx/+boQg/EcFznoGJpSe4/0M3p 6Nh5z502+YnzMDAeu8GKeofk8B0cP1VkischaDHt3yKGSJ8jgSUKVaLfh1thnA== 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 4Xkv732pDRz10JK; Thu, 7 Nov 2024 20:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A7KctC3019958; Thu, 7 Nov 2024 20:38:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A7KctUv019955; Thu, 7 Nov 2024 20:38:55 GMT (envelope-from git) Date: Thu, 7 Nov 2024 20:38:55 GMT Message-Id: <202411072038.4A7KctUv019955@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d70230783ae2 - main - vmm: Postpone vmm module initialization to after SI_SUB_DEVFS List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: d70230783ae27594a77560582093dd86426d3360 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d70230783ae27594a77560582093dd86426d3360 commit d70230783ae27594a77560582093dd86426d3360 Author: Mark Johnston AuthorDate: 2024-11-07 20:07:39 +0000 Commit: Mark Johnston CommitDate: 2024-11-07 20:38:38 +0000 vmm: Postpone vmm module initialization to after SI_SUB_DEVFS vmmops_modinit() needs to create a device file, and this must happen after SI_SUB_DEVFS. On non-EARLY_AP_STARTUP platforms (i.e., !x86) this happens already by accident, but we shouldn't rely on it. On riscv, remove the current SI_SUB_SMP ordering since that was copied from arm64 and isn't needed. In particular, riscv's vmmops_modinit() does not call smp_rendezvous(). Reported by: Oleksandr Kryvulia Fixes: a97f683fe3c4 ("vmm: Add a device file interface for creating and destroying VMs") --- sys/amd64/vmm/vmm.c | 3 ++- sys/arm64/vmm/vmm.c | 3 ++- sys/riscv/vmm/vmm.c | 5 ++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index 77e0adda86f5..9569f8ace909 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -513,8 +513,9 @@ static moduledata_t vmm_kmod = { * * - VT-x initialization requires smp_rendezvous() and therefore must happen * after SMP is fully functional (after SI_SUB_SMP). + * - vmm device initialization requires an initialized devfs. */ -DECLARE_MODULE(vmm, vmm_kmod, SI_SUB_SMP + 1, SI_ORDER_ANY); +DECLARE_MODULE(vmm, vmm_kmod, MAX(SI_SUB_SMP, SI_SUB_DEVFS) + 1, SI_ORDER_ANY); MODULE_VERSION(vmm, 1); static void diff --git a/sys/arm64/vmm/vmm.c b/sys/arm64/vmm/vmm.c index 2f4f3a2b59ea..808df5e599ac 100644 --- a/sys/arm64/vmm/vmm.c +++ b/sys/arm64/vmm/vmm.c @@ -396,8 +396,9 @@ static moduledata_t vmm_kmod = { * * - HYP initialization requires smp_rendezvous() and therefore must happen * after SMP is fully functional (after SI_SUB_SMP). + * - vmm device initialization requires an initialized devfs. */ -DECLARE_MODULE(vmm, vmm_kmod, SI_SUB_SMP + 1, SI_ORDER_ANY); +DECLARE_MODULE(vmm, vmm_kmod, MAX(SI_SUB_SMP, SI_SUB_DEVFS) + 1, SI_ORDER_ANY); MODULE_VERSION(vmm, 1); static void diff --git a/sys/riscv/vmm/vmm.c b/sys/riscv/vmm/vmm.c index 1c0290ace570..f8be363b6170 100644 --- a/sys/riscv/vmm/vmm.c +++ b/sys/riscv/vmm/vmm.c @@ -287,10 +287,9 @@ static moduledata_t vmm_kmod = { /* * vmm initialization has the following dependencies: * - * - HYP initialization requires smp_rendezvous() and therefore must happen - * after SMP is fully functional (after SI_SUB_SMP). + * - vmm device initialization requires an initialized devfs. */ -DECLARE_MODULE(vmm, vmm_kmod, SI_SUB_SMP + 1, SI_ORDER_ANY); +DECLARE_MODULE(vmm, vmm_kmod, SI_SUB_DEVFS + 1, SI_ORDER_ANY); MODULE_VERSION(vmm, 1); static void From nobody Fri Nov 8 00:59:57 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xl0wF2gqdz5cxVW; Fri, 08 Nov 2024 00:59:57 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xl0wF1Fdgz4VSw; Fri, 8 Nov 2024 00:59:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731027597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9tXoLPWAATQx79XzIFXwKMlCczf8ZaP3eudrZS8cKsM=; b=Y2Bt1VTPrZCOQyy8+v8z++HrTtWYeWx2sKHl/4ELIMSurBYKALAbpkF426m4BciJX981XI 2bTlXqtVB0JoCEtJ7rVcOJ/yhodh0/liiwTXl3bshQZpPmLmGal0M6gFrVnfMGzbIvUnqW zosl9LneCJAHEfGXqsPmpDpHtk8WKcqmAM/2YEjQvr+pnccMYVGGpqCX4IFAX4yuersUgs CvQShvIz8ZrSsGHYwUWGB7qHk9CMrKS7vQpycWyJ+SW8a5ODIwc7CSoEzv5cVwswsYYzPQ xEs91caWU5xC3x2KbHMVw83UQJy7tecj/rP6RcqagoFgKcs1CxHQCut9xplJmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731027597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9tXoLPWAATQx79XzIFXwKMlCczf8ZaP3eudrZS8cKsM=; b=nD3sGEL9RqxG+ZKgJiPdybjVpTloeT13LwKfTEJzXtZ32eg6j27L30SNtGJmOlxp4kh8Ho Vjm66EAPbZND2aGIIraSeMoLRev4hKw8wEvk6ZbNbCcCeox8xbznATVzt6VrlXzzBr1aH1 VkT0M0PWetGT1BB9vFrcwLLWHeVM77teFNkRIQYNU4riVioDWxmPWwt86ol5Z9YxEy1xfs 5AsyKFsFLJYdpINmEfdoI2oMRaWprp1FzG6/JdjLc3Y5kM8YxwhrOhDXOpWtKJdlB/SV+d fn3YjgSH9TASSAJSI+Ty68Nn2vis01U/l5UI7uR/RXZaG3aQanSyJQB0u8w1wQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731027597; a=rsa-sha256; cv=none; b=u/g64s2in5ZM0CUju4OiY1ZzY9NZTQdQTFlrRHUty/34KITmaUga36jb+KTwgsWwmuYYgD Nf760bT9GiOQprpYoATlUj+xG9lpmR1JwZyjt6YwjQqlwmOJAvcpa4YtIs07F4x2Rw+qu7 wn9ZMxeILm1LwneEuZnkUGiXAFZSsO8VUY8u7a7nHBvDLussd8+tYbUmyQT/C/em8Osj/B hRiKWBAQ2esMb/Xp9MGtD5JeRCIxd3mryOnZSgWtxvPC5CRg954Q982guleIbH8sg1XXW1 0Sv+N6ezap8P+gz9LsDw3aCJ1f7U0AzV1srFjdRTkWxeJvJ4NTRnqGtzfn+X7w== 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 4Xl0wF0lpRz17kn; Fri, 8 Nov 2024 00:59:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A80xv8g000457; Fri, 8 Nov 2024 00:59:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A80xv9q000454; Fri, 8 Nov 2024 00:59:57 GMT (envelope-from git) Date: Fri, 8 Nov 2024 00:59:57 GMT Message-Id: <202411080059.4A80xv9q000454@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d2434697bc9c - main - loader.kboot: Build on amd64 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: d2434697bc9cc2d36da0f356cc5942b33df87896 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d2434697bc9cc2d36da0f356cc5942b33df87896 commit d2434697bc9cc2d36da0f356cc5942b33df87896 Author: Warner Losh AuthorDate: 2024-11-07 22:59:04 +0000 Commit: Warner Losh CommitDate: 2024-11-07 23:23:26 +0000 loader.kboot: Build on amd64 But comment out FDT stuff for amd64 built inside kboot. This also restricts a bit the powerpc platforms we build on to powerpc64. Sponsored by: Netflix --- stand/Makefile | 2 +- stand/kboot/kboot/Makefile | 5 ++++- stand/kboot/kboot/main.c | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/stand/Makefile b/stand/Makefile index ce91802d4a8b..5d81e5f8a032 100644 --- a/stand/Makefile +++ b/stand/Makefile @@ -37,7 +37,7 @@ INTERP_DEPENDS+= lua .include S.${MK_EFI}+= efi -.if ${MK_FDT} != "no" +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "powerpc64" S.${MK_LOADER_KBOOT}+= kboot .endif S.${MK_LOADER_UBOOT}+= uboot diff --git a/stand/kboot/kboot/Makefile b/stand/kboot/kboot/Makefile index d354e1bc7e60..064d43701ebd 100644 --- a/stand/kboot/kboot/Makefile +++ b/stand/kboot/kboot/Makefile @@ -24,12 +24,15 @@ SRCS= \ hostdisk.c \ hostfs.c \ init.c \ - kbootfdt.c \ main.c \ seg.c \ util.c \ vers.c +.if ${MK_FDT} != "no" +SRCS+= kbootfdt.c +.endif + .if ${MK_LOADER_ZFS} != "no" CFLAGS+= -I${ZFSSRC} CFLAGS+= -I${SYSDIR}/contrib/openzfs/include diff --git a/stand/kboot/kboot/main.c b/stand/kboot/kboot/main.c index 994df1ec9fa1..a9ea2d9354c9 100644 --- a/stand/kboot/kboot/main.c +++ b/stand/kboot/kboot/main.c @@ -26,7 +26,9 @@ #include #include #include +#ifdef LOADER_FDT_SUPPORT #include +#endif #include #include @@ -620,6 +622,7 @@ kboot_zfs_probe(void) #endif } +#ifdef LOADER_FDT_SUPPORT /* * Since proper fdt command handling function is defined in fdt_loader_cmd.c, * and declaring it as extern is in contradiction with COMMAND_SET() macro @@ -634,4 +637,4 @@ command_fdt(int argc, char *argv[]) } COMMAND_SET(fdt, "fdt", "flattened device tree handling", command_fdt); - +#endif From nobody Fri Nov 8 00:59:58 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xl0wG2nf5z5cxvl; Fri, 08 Nov 2024 00:59: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xl0wG27Lvz4VGh; Fri, 8 Nov 2024 00:59:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731027598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UYnxK7oRYhKsmPLSq7ffpoVrIvdKZCM95KerxZC4td4=; b=BwPh9p3vI4NjpMlz0036lMKQ6hiwebzTuNCZsyPGj2BR7/6oONYQ9bLPD5CY683XaMslbD OamSGAUoe+XlFu01YE2Dv74Wybe+V9uEcfA92/FPNfYIZrZO1IsaZJPOZ08XZOP2kNuDMd zfpDRmXZyh/xfkIMN0QUHY6tG570H9ci/Pqxj8sUPoliyDRXfKg1OAdKjmPOuCeohn0vzk zlit4pn9vsjLq8uJqpj1sCQHg/1tLVDzAMJrUNAuPbMqp+tqJRiHpIb7eE+v4DCnVMbIRz 5Qt1TgyllEMRGXsZK/uUt1/pRrju1/fs7uVSOK0hOzfCe0BPjURYHusy1wE7rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731027598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UYnxK7oRYhKsmPLSq7ffpoVrIvdKZCM95KerxZC4td4=; b=oCGPAvLairRPjqHQBcP5w9R///0AO9YrRThhcTQhUH3lB+cPR/gSZlqyAeHnMHFTBwPSGw rwRK6Q3kmkda1OjXvyqvuuKY0s3yPpPHt84SpuzNyvcdXKRcmJ6+jyNAU51WNrcogQ4fwO nDV5pawDg06iGY0YoHXgZSZF3uec33EFBW8/z10f0s7MgkcBERgySNBpH8gru6Mmaa7Pxs wWuHgFxrmk8QpIQSEDt5WiP22kqIiaGnXfB9YaJyjP8c5Ui5/AUDCfaZ6Yh+jxQ+8dmVpK qoDtYnUpRA/nCKtnMajlqE+FxyfAWajb7HjRgNh1geQzVeBvKavl8+PYHNMXQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731027598; a=rsa-sha256; cv=none; b=dH3Rjcofen/eH/DtJWanGK2CcOHyeg6RgX02jTAGCqCTgusr3jD5P9bkF/Mf77cu949qL7 UPHOhUXLD16nmkLPl8ud8kqgCgn7Uc4tZ2Poroc/n/5r/j46Rg0QXDIaHzS1t01aNT3hZb 40Vqndt95Rvh5lHyj87eFEXM6lAkzxXJHnf/g+uGV+XGfMlGRlDE3aDXPhR/lfxtOj/loF c0pwzvAEHDjNpvGCuOVaNWJg1DOZm2PngJ9OmCHmb3uJsKSkWidy6gbaS6nPseONugN383 oGACgbEPt64DvdEKXoZudZTAf7+4wAmyOKTgbjnXeyDv5l+INrOhn8sve+fvlg== 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 4Xl0wG1lPgz17kp; Fri, 8 Nov 2024 00:59:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A80xwkC000505; Fri, 8 Nov 2024 00:59:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A80xwIx000502; Fri, 8 Nov 2024 00:59:58 GMT (envelope-from git) Date: Fri, 8 Nov 2024 00:59:58 GMT Message-Id: <202411080059.4A80xwIx000502@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: f11b6ce4a3bc - main - da: Add quirk for ADATA USB Drive List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: f11b6ce4a3bc6d455dbec375218c01ce9b6b5dc2 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f11b6ce4a3bc6d455dbec375218c01ce9b6b5dc2 commit f11b6ce4a3bc6d455dbec375218c01ce9b6b5dc2 Author: Warner Losh AuthorDate: 2024-11-08 00:11:15 +0000 Commit: Warner Losh CommitDate: 2024-11-08 00:40:05 +0000 da: Add quirk for ADATA USB Drive ADATA USB Drive lies about the RC16, so add a quirk to ignore it. MFC After: 3 days PR: 188999 Sponsored by: Netflix --- sys/cam/scsi/scsi_da.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 5e562122c5d5..e8e13613413a 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -881,6 +881,11 @@ static struct da_quirk_entry da_quirk_table[] = {T_DIRECT, SIP_MEDIA_REMOVABLE, "JetFlash", "Transcend*", "*"}, /*quirks*/ DA_Q_NO_RC16 }, + { + /* ADATA USB sticks lie on RC16. */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "ADATA", "USB Flash Drive*", + "*"}, /*quirks*/ DA_Q_NO_RC16 + }, { /* * I-O Data USB Flash Disk From nobody Fri Nov 8 01:03:13 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xl10J22KCz5cyMH for ; Fri, 08 Nov 2024 01:03:28 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xl10H6sQLz4WrP for ; Fri, 8 Nov 2024 01:03:27 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-43163667f0eso14185805e9.0 for ; Thu, 07 Nov 2024 17:03:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731027806; x=1731632606; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Cqe0i+libYJxUEt7XbFY+ueSoe58woMK7aY8Cram6LI=; b=cV2uxkMie8o9DEgylN5ISg9jq8iFeu8k6bL2zNdrz8XKXK1tVmquhSQsSR50Zzkedo vf3TqADK8hCJGEhSkY9cWr5fNqzVo2y7DubnUXI1dfa/DMLKLUhVqmWQqIhBpWoc9Ygh 6zB3ZZsPqfg6vIRarT9b6R/UnKMvjl2awdP5XFdqI3VA6rgxDhhsKP8QdHsC6oXSGJbw fDOdaxbK/UA7JidA+IJaoBdJuzuK2qH1sQPt2r4u3gfNy/rHhlAOQMWudZFFiknIBRx5 jLR7TjC3teFgx4O0Uoa5MSySOi9Ahccc7G+1wRPOYvQi1VhSAeG8uMOotvW+2kM7ePbt WGcA== X-Forwarded-Encrypted: i=1; AJvYcCV/DJQEGkIFeOslIf07R7MsAw7K5lGldiqgQVHoeh3rCkhOtOuDM0Qo2pOXnsMmuI3RCxfftRhSOndyQiYHs5boEu3Brg==@freebsd.org X-Gm-Message-State: AOJu0Yw6PzTAeXzqyR+ywm0VQ+AK8OzILur1KbrcyQecgBmbvE7yr7IL n11C6J5mvqnbtwf3H26InZAskoX4XSiFjzVqpqBJR8RqCztEvZs63x9bsKoYIORE79xQDN4Kjv6 F X-Google-Smtp-Source: AGHT+IHJ6Htb6QIkz/Tlbe0yucKQbgbVyGH7uzRJtJ4i3S4LlD7iwtIX495GLE7h748f+OBfv/SiTw== X-Received: by 2002:a5d:5886:0:b0:37d:4a7b:eeb2 with SMTP id ffacd0b85a97d-381f186d34amr748975f8f.35.1731027806424; Thu, 07 Nov 2024 17:03:26 -0800 (PST) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381ed9ea6b5sm3107480f8f.84.2024.11.07.17.03.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Nov 2024 17:03:25 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3818.100.11.1.3\)) Subject: Re: git: d2434697bc9c - main - loader.kboot: Build on amd64 From: Jessica Clarke In-Reply-To: <202411080059.4A80xv9q000454@gitrepo.freebsd.org> Date: Fri, 8 Nov 2024 01:03:13 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <5B288C0C-5A9A-4772-8B14-06BDCC527B04@freebsd.org> References: <202411080059.4A80xv9q000454@gitrepo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3818.100.11.1.3) X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4Xl10H6sQLz4WrP X-Spamd-Bar: ---- On 8 Nov 2024, at 00:59, Warner Losh wrote: >=20 > The branch main has been updated by imp: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dd2434697bc9cc2d36da0f356cc5942b3= 3df87896 >=20 > commit d2434697bc9cc2d36da0f356cc5942b33df87896 > Author: Warner Losh > AuthorDate: 2024-11-07 22:59:04 +0000 > Commit: Warner Losh > CommitDate: 2024-11-07 23:23:26 +0000 >=20 > loader.kboot: Build on amd64 >=20 > But comment out FDT stuff for amd64 built inside kboot. This also > restricts a bit the powerpc platforms we build on to powerpc64. >=20 > Sponsored by: Netflix > --- > stand/Makefile | 2 +- > stand/kboot/kboot/Makefile | 5 ++++- > stand/kboot/kboot/main.c | 5 ++++- > 3 files changed, 9 insertions(+), 3 deletions(-) >=20 > diff --git a/stand/Makefile b/stand/Makefile > index ce91802d4a8b..5d81e5f8a032 100644 > --- a/stand/Makefile > +++ b/stand/Makefile > @@ -37,7 +37,7 @@ INTERP_DEPENDS+=3D lua > .include >=20 > S.${MK_EFI}+=3D efi > -.if ${MK_FDT} !=3D "no" > +.if ${MACHINE_ARCH} =3D=3D "amd64" || ${MACHINE_ARCH} =3D=3D = "aarch64" || ${MACHINE_ARCH} =3D=3D "powerpc64" > S.${MK_LOADER_KBOOT}+=3D kboot > .endif Hm, is the outer if really needed? We already have: # KBOOT is only for powerpc64 (powerpc64le broken) amd64 and aarch64 .if ${__T} !=3D "powerpc64" && ${__T} !=3D "amd64" && ${__T} !=3D = =E2=80=9Caarch64" BROKEN_OPTIONS+=3DLOADER_KBOOT .endif in src.opts.mk, which is generally where these kinds of restrictions should live. Jess From nobody Fri Nov 8 03:19:13 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xl41B5fGSz5bx2l for ; Fri, 08 Nov 2024 03:19:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xl41B3xq6z4mY4 for ; Fri, 8 Nov 2024 03:19:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-7240fa50694so759564b3a.1 for ; Thu, 07 Nov 2024 19:19:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1731035965; x=1731640765; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=UYkc1vIHtZefaNuKlZGOBiwEmWF+usbINxZ0HihKSaE=; b=jGum1v0+tjlPyvVxmSdaMKyV8I+/SrbuJrTH93R58pyihPXfbrY2yb8xqANRT9yaFx v/ZaAMGk+7sCqZgdk/bBlNhlWrXdMYypPUV7WICtwdAdMlxMbXDYydgrmcVgzfTjHoYL Bylb1YBkkc3KtXi/b46kJn/uMa5CKLi46rcvcxy6i0q/QLuM1VxxShSWKNaQbSpnooGQ isRfpgDOJ4ZAER13gHX7GIdsLwhHmDe7ro3aGiiUloUugG34UQw+IJFDI+PX+1OSsZB7 ZPuTfryzfDXImE6E8uWXpw5iVF01Gcte/vDVDLL2OboNO0VX76gmkUWrUdzyPSBG3srq erxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731035965; x=1731640765; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UYkc1vIHtZefaNuKlZGOBiwEmWF+usbINxZ0HihKSaE=; b=HgH3mNfpBpiu4/1FcM+HvFnVkUcxD6CkfQDeskuG/8AcT/ETSHfXPLRYab9PVKAUEu 6375D3TpJ8nvvnwPNG33L+BR086G+8vvm6yZ+G0D9UoT0Qcsky+cVyixvDjUyv4llkbE b1P2ZqDLbh9jGM0jUkR4Zi4xqUBWQbG/du5KQc4heaCzXh1FUb1AYI7hOGkZswcXkEZB oMCoLyDd1ql0yA6qU7DCzF1dwAJINUWuwC+N/BwkEJAjAFpxpwUVuTE4k9wbfp/DqYg+ 8RJPqppvxt/B9WP8OFTwGP4MnyeGxi6YtDjXELt69g3bcHSgFRmbVUBMv1t1F478poVo 8/LQ== X-Forwarded-Encrypted: i=1; AJvYcCUFk//kU0cV/Z63fz9HArSlNAc3XZkAth4/1nOWFErjNHMNkteCMCxoe/swlOv9pyV5YgIP/BNQV4rmVIUGNh+PeyxS0Q==@freebsd.org X-Gm-Message-State: AOJu0Yyhg4x98htS+cYJu5NWzRxy9V4Dx9zgLraEpLNFbNHVKVPxKuGN fqrta8swgNsPk7sZYYrVbRcSgGdKrI0thnjDcBDfDLDHkk8RGs1KuoVnlyR8dvnflkghEi5mk6w YobEZk9+hGpLdfjB6HyPQop1ETEPIG8lSvNJNfg== X-Google-Smtp-Source: AGHT+IGys9WFYQc6wKC7kFDxDW9yb86aBekbsa7XfvCwdyK+udzssVqK9nsPTkB8KhSWyb0i2IvhoDj72UC+JHIyLSc= X-Received: by 2002:a05:6a21:999f:b0:1db:d84f:c7d8 with SMTP id adf61e73a8af0-1dc228c6919mr1973539637.2.1731035965326; Thu, 07 Nov 2024 19:19:25 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202411080059.4A80xv9q000454@gitrepo.freebsd.org> <5B288C0C-5A9A-4772-8B14-06BDCC527B04@freebsd.org> In-Reply-To: <5B288C0C-5A9A-4772-8B14-06BDCC527B04@freebsd.org> From: Warner Losh Date: Thu, 7 Nov 2024 19:19:13 -0800 Message-ID: Subject: Re: git: d2434697bc9c - main - loader.kboot: Build on amd64 To: Jessica Clarke Cc: Warner Losh , src-committers , "" , "" Content-Type: multipart/alternative; boundary="000000000000cea0c506265e3729" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4Xl41B3xq6z4mY4 X-Spamd-Bar: ---- --000000000000cea0c506265e3729 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Nov 7, 2024, 5:03=E2=80=AFPM Jessica Clarke wr= ote: > On 8 Nov 2024, at 00:59, Warner Losh wrote: > > > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3Dd2434697bc9cc2d36da0f356cc5942b= 33df87896 > > > > commit d2434697bc9cc2d36da0f356cc5942b33df87896 > > Author: Warner Losh > > AuthorDate: 2024-11-07 22:59:04 +0000 > > Commit: Warner Losh > > CommitDate: 2024-11-07 23:23:26 +0000 > > > > loader.kboot: Build on amd64 > > > > But comment out FDT stuff for amd64 built inside kboot. This also > > restricts a bit the powerpc platforms we build on to powerpc64. > > > > Sponsored by: Netflix > > --- > > stand/Makefile | 2 +- > > stand/kboot/kboot/Makefile | 5 ++++- > > stand/kboot/kboot/main.c | 5 ++++- > > 3 files changed, 9 insertions(+), 3 deletions(-) > > > > diff --git a/stand/Makefile b/stand/Makefile > > index ce91802d4a8b..5d81e5f8a032 100644 > > --- a/stand/Makefile > > +++ b/stand/Makefile > > @@ -37,7 +37,7 @@ INTERP_DEPENDS+=3D lua > > .include > > > > S.${MK_EFI}+=3D efi > > -.if ${MK_FDT} !=3D "no" > > +.if ${MACHINE_ARCH} =3D=3D "amd64" || ${MACHINE_ARCH} =3D=3D "aarch64"= || > ${MACHINE_ARCH} =3D=3D "powerpc64" > > S.${MK_LOADER_KBOOT}+=3D kboot > > .endif > > Hm, is the outer if really needed? We already have: > > # KBOOT is only for powerpc64 (powerpc64le broken) amd64 and aarch64 > .if ${__T} !=3D "powerpc64" && ${__T} !=3D "amd64" && ${__T} !=3D =E2= =80=9Caarch64" > BROKEN_OPTIONS+=3DLOADER_KBOOT > .endif > > in src.opts.mk, which is generally where these kinds of restrictions > should live. > Oh. That's a great idea. I'll update. Warner > --000000000000cea0c506265e3729 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, Nov 7, 2024, 5:03=E2=80=AFPM Jessica Clarke &l= t;jrtc27@freebsd.org> wrote:
On 8 Nov 2024, at 00:59, Warner Losh= <imp@FreeBSD.org> wrote:
>
> The branch main has been updated by imp:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=3Dd2434697bc9cc2d36da0f356cc5942= b33df87896
>
> commit d2434697bc9cc2d36da0f356cc5942b33df87896
> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2024-11-07 22:59:04 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2024-11-07 23:23:26 +0000
>
>=C2=A0 =C2=A0 loader.kboot:=C2=A0 Build on amd64
>
>=C2=A0 =C2=A0 But comment out FDT stuff for amd64 built inside kboot. T= his also
>=C2=A0 =C2=A0 restricts a bit the powerpc platforms we build on to powe= rpc64.
>
>=C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Net= flix
> ---
> stand/Makefile=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 2 +- > stand/kboot/kboot/Makefile | 5 ++++-
> stand/kboot/kboot/main.c=C2=A0 =C2=A0| 5 ++++-
> 3 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/stand/Makefile b/stand/Makefile
> index ce91802d4a8b..5d81e5f8a032 100644
> --- a/stand/Makefile
> +++ b/stand/Makefile
> @@ -37,7 +37,7 @@ INTERP_DEPENDS+=3D lua
> .include <bsd.arch.inc.mk>
>
> S.${MK_EFI}+=3D efi
> -.if ${MK_FDT} !=3D "no"
> +.if ${MACHINE_ARCH} =3D=3D "amd64" || ${MACHINE_ARCH} =3D= =3D "aarch64" || ${MACHINE_ARCH} =3D=3D "powerpc64"
> S.${MK_LOADER_KBOOT}+=3D kboot
> .endif

Hm, is the outer if really needed? We already have:

=C2=A0 # KBOOT is only for powerpc64 (powerpc64le broken) amd64 and aarch64=
=C2=A0 .if ${__T} !=3D "powerpc64" && ${__T} !=3D "a= md64" && ${__T} !=3D =E2=80=9Caarch64"
=C2=A0 BROKEN_OPTIONS+=3DLOADER_KBOOT
=C2=A0 .endif

in src.opts.mk, which is generally where these kinds of restriction= s
should live.

Oh. That's a great idea. I'll update.

Warner
--000000000000cea0c506265e3729-- From nobody Fri Nov 8 13:25:38 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XlKSf3DpZz5ckfj; Fri, 08 Nov 2024 13:25: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XlKSf2Tvfz4SMm; Fri, 8 Nov 2024 13:25:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731072338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DVuj6LclpM8aUfza4xAsk6GPLQbTsjWGPAxPMU7VMlM=; b=j5JhxXeb4afDmheH5sccPfuGU7qNjjM7C6lzeB2YsAbrHOam6kQ7/pcm/iE0X0PLdKMB1v xXx1WAu24yxYZHkEILsAHO1YbPFFSzESp1nlxLXDrtADJlTLf5iHWB8E/teV4xxW1UpndY E/YmYZfqx84Ae8xyKz1C+CyccPbt/KeT0XA6akLjm518N6a6Ul7t/0Zr6XHMOnAnNSsxbO L3PmqcBOcIbOpRuJlA2jcnCRL1oaFjcUNcUgCtFuV1pLHUVksNXv6onneCpN+5736Ori9D Br8537BwB2JEtMchqx+GOJmy2dbrB3kR7789RQKUdSCudOuglT9BftSc5U/lBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731072338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DVuj6LclpM8aUfza4xAsk6GPLQbTsjWGPAxPMU7VMlM=; b=HeK7/VeHwGzuQCVYUPIqOEX0gOqREtduFjYtfUOwJ6vhhSwSKuZVEzwX5r2abTfipzrFIG hIus3UEVSgvPMNnlDLej6JzBv4262nIBp0T5xXTE6fLlxHzGf/b9Tkn/lwhihw0UDhgfQb 5y3i3JDP95mT4pwD+A0YUZFU++QNpuABisaqIbb1KPIm5cGGYMnzxuwWeBuEhEtQSigdCU IgOQ1SViY+o3PTZIKs1NMWTljSa3sNTeN2cEkn6f1swwBiFlLmacRZA95RZkEK/dNcfEUg OR6hnq9Hsu4eX/xUdN+UkLfgLPHzooB4rSWZ8qXBUAbtHNvlp11k7A4AaAB4xQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731072338; a=rsa-sha256; cv=none; b=tnqmiIoTk01y+Jp6S6PZrn1JxBxXKYde/3uRUgkjorj0XU87rNV4ySDIm35Je7bdhpyRdd Y7adsVEjgVT9jpimVqFwZXBi+PMH+/3Z/iMQ+sVNTNfO2kg5jn0NMvqXwTj/SFHbRAmYbn 7/wobbaewWxAdrH6QAePbqCmGEbM4bZpsxAAsUZtOFI3qf8BsA43htRhusnJriXEXZ+OXQ r8PNBE1Qv5atMHQOqEm5EnLBZ/I0bZCPWn8AoEBsI4GIN4Rkj6eGFUGrzScFwyiZDKcDL+ LEgtuxZHGho81L+Dz71R4MlkWoYCCaiDcIoIvuFE0eRwydT2Fo1siPDz1YLGmg== 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 4XlKSf1yY9zXHH; Fri, 8 Nov 2024 13:25:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A8DPc2m094553; Fri, 8 Nov 2024 13:25:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A8DPc8u094550; Fri, 8 Nov 2024 13:25:38 GMT (envelope-from git) Date: Fri, 8 Nov 2024 13:25:38 GMT Message-Id: <202411081325.4A8DPc8u094550@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Rabson Subject: git: d03c82c28da8 - main - release: add optional OCI images List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dfr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d03c82c28da86e0812b98b051d24ae5980804ad7 Auto-Submitted: auto-generated The branch main has been updated by dfr: URL: https://cgit.FreeBSD.org/src/commit/?id=d03c82c28da86e0812b98b051d24ae5980804ad7 commit d03c82c28da86e0812b98b051d24ae5980804ad7 Author: Doug Rabson AuthorDate: 2024-08-14 15:39:24 +0000 Commit: Doug Rabson CommitDate: 2024-11-08 13:23:08 +0000 release: add optional OCI images This adds three OCI archive format files to the release containing FreeBSD base images suitable for static linked, dynamic linked and shell workloads. The shell image also contains pkg-bootstrap and can be easily extended by installing packages (including pkgbase packages). Reviewed by: dch, cpersiva, jlduran, zlei Differential Revision: https://reviews.freebsd.org/D46759 MFC after: 2 days --- release/Makefile | 11 ++++--- release/Makefile.oci | 34 +++++++++++++++++++ release/release.conf.sample | 4 +++ release/release.sh | 47 ++++++++++++++++++++++++++- release/scripts/make-oci-image.sh | 63 ++++++++++++++++++++++++++++++++++++ release/tools/oci-image-dynamic.conf | 11 +++++++ release/tools/oci-image-minimal.conf | 19 +++++++++++ release/tools/oci-image-static.conf | 42 ++++++++++++++++++++++++ share/examples/Makefile | 6 ++++ share/examples/oci/Containerfile.pkg | 27 ++++++++++++++++ share/examples/oci/README | 7 ++++ share/man/man7/release.7 | 14 +++++++- 12 files changed, 279 insertions(+), 6 deletions(-) diff --git a/release/Makefile b/release/Makefile index be628d20ba8d..85da63b0c49a 100644 --- a/release/Makefile +++ b/release/Makefile @@ -7,14 +7,16 @@ # memstick: Builds memory stick image (memstick.img) # mini-memstick: Builds minimal memory stick image (mini-memstick.img) # ftp: Sets up FTP distribution area (ftp) -# release: Invokes real-release, vm-release, and cloudware-release targets +# release: Invokes real-release, vm-release, cloudware-release and oci-release targets # real-release: Build all media and FTP distribution area # vm-release: Build all virtual machine image targets # cloudware-release: Build all cloud hosting provider targets -# install: Invokes the release-install and vm-install targets +# oci-release: Build all OCI container images +# install: Invokes the release-install, vm-install and oci-install targets # release-install: Copies all release installation media into ${DESTDIR} # vm-install: Copies all virtual machine images into ${DESTDIR} # cloud-install: Copies non-uploaded cloud images into ${DESTDIR} +# oci-install: Copies all OCI container images into ${DESTDIR} # # Variables affecting the build process: # WORLDDIR: location of src tree -- must have built world and default kernel @@ -316,7 +318,7 @@ ftp: packagesystem mkdir -p ftp cp *.txz MANIFEST ftp -release: real-release vm-release cloudware-release +release: real-release vm-release cloudware-release oci-release ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} release-done true @@ -327,7 +329,7 @@ real-release: ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj ${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${RELEASE_TARGETS} -install: release-install vm-install .WAIT cloud-install +install: release-install vm-install oci-install .WAIT cloud-install release-install: .if defined(DESTDIR) && !empty(DESTDIR) @@ -347,3 +349,4 @@ release-install: .include "${.CURDIR}/Makefile.inc1" .include "${.CURDIR}/Makefile.vm" +.include "${.CURDIR}/Makefile.oci" diff --git a/release/Makefile.oci b/release/Makefile.oci new file mode 100644 index 000000000000..461c95f49636 --- /dev/null +++ b/release/Makefile.oci @@ -0,0 +1,34 @@ +# +# +# +# Makefile for building OCI container images. +# + +.if defined(WITH_OCIIMAGES) && !empty(WITH_OCIIMAGES) +OCI_IMAGES= static dynamic minimal +.endif + +oci-install: +.if defined(WITH_OCIIMAGES) && !empty(WITH_OCIIMAGES) + mkdir -p ${DESTDIR}/ociimages +. for _IMG in ${OCI_IMAGES} + cp -p ${.OBJDIR}/container-image-${_IMG}.txz ${DESTDIR}/ociimages +. endfor +.endif + +OCI_TARGETS= +OCI_DEPS_static= +OCI_DEPS_dynamic= container-image-static.txz +OCI_DEPS_minimal= container-image-dynamic.txz + +.for _IMG in ${OCI_IMAGES} +OCI_TARGETS+= container-image-${_IMG}.txz +container-image-${_IMG}.txz: ${OCI_DEPS_${_IMG}} + sh ${.CURDIR}/scripts/make-oci-image.sh ${.CURDIR} ${REVISION} ${BRANCH} ${TARGET_ARCH} ${_IMG} + skopeo copy \ + containers-storage:localhost/freebsd${REVISION:R}-${_IMG}:latest \ + oci-archive:${.OBJDIR}/container-image-${_IMG}.tar:freebsd${REVISION:R}-${_IMG}:${REVISION}-${BRANCH}-${TARGET_ARCH} + ${XZ_CMD} < ${.OBJDIR}/container-image-${_IMG}.tar > ${.OBJDIR}/container-image-${_IMG}.txz +.endfor + +oci-release: ${OCI_TARGETS} diff --git a/release/release.conf.sample b/release/release.conf.sample index c306efb13b65..e583e49828d4 100644 --- a/release/release.conf.sample +++ b/release/release.conf.sample @@ -114,3 +114,7 @@ PORTBRANCH="main" ## If WITH_CLOUDWARE is set to a non-empty value, this is a list of providers ## to create disk images. #CLOUDWARE="EC2 GCE ORACLE VAGRANT-VIRTUALBOX VAGRANT-VMWARE" + +## If WITH_OCIIMAGES is set to a non-empty value, build Open Container +## Initiative (OCI) base images as part of the release. +#WITH_OCIIMAGES= diff --git a/release/release.sh b/release/release.sh index cee0fbd5643d..d6752e016994 100755 --- a/release/release.sh +++ b/release/release.sh @@ -120,6 +120,9 @@ env_setup() { # cloud providers as part of the release. WITH_CLOUDWARE= + # Set to non-empty to build OCI images as part of the release + WITH_OCIIMAGES= + return 0 } # env_setup() @@ -195,7 +198,8 @@ env_check() { RELEASE_RMAKEFLAGS="${ARCH_FLAGS} ${RELEASE_FLAGS} \ KERNCONF=\"${KERNEL}\" ${CONF_FILES} ${SRCPORTS} \ WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES} \ - WITH_CLOUDWARE=${WITH_CLOUDWARE} XZ_THREADS=${XZ_THREADS}" + WITH_CLOUDWARE=${WITH_CLOUDWARE} WITH_OCIIMAGES=${WITH_OCIIMAGES} \ + XZ_THREADS=${XZ_THREADS}" return 0 } # env_check() @@ -288,6 +292,44 @@ extra_chroot_setup() { fi fi + if [ ! -z "${WITH_OCIIMAGES}" ]; then + # Install buildah and skopeo from ports if the ports tree is available; + # otherwise install the pkg. + if [ -d ${CHROOTDIR}/usr/ports ]; then + # Trick the ports 'run-autotools-fixup' target to do the right + # thing. + _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) + REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) + BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) + UNAME_r=${REVISION}-${BRANCH} + GITUNSETOPTS="CONTRIB CURL CVS GITWEB GUI HTMLDOCS" + GITUNSETOPTS="${GITUNSETOPTS} ICONV NLS P4 PERL" + GITUNSETOPTS="${GITUNSETOPTS} SEND_EMAIL SUBTREE SVN" + GITUNSETOPTS="${GITUNSETOPTS} PCRE PCRE2" + PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes" + PBUILD_FLAGS="${PBUILD_FLAGS} UNAME_r=${UNAME_r}" + PBUILD_FLAGS="${PBUILD_FLAGS} OSREL=${REVISION}" + PBUILD_FLAGS="${PBUILD_FLAGS} WRKDIRPREFIX=/tmp/ports" + PBUILD_FLAGS="${PBUILD_FLAGS} DISTDIR=/tmp/distfiles" + for _PORT in sysutils/buildah sysutils/skopeo; do + eval chroot ${CHROOTDIR} env ${PBUILD_FLAGS} make -C \ + /usr/ports/${_PORT} \ + FORCE_PKG_REGISTER=1 deinstall install clean distclean + done + else + eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ + pkg install -y sysutils/buildah sysutils/skopeo + eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ + pkg clean -y + fi + # Use the vfs storage driver so that this works whether or not + # the build directory is on ZFS. The images are small so the + # performance difference is negligible. + eval chroot ${CHROOTDIR} sed -I .bak -e '/^driver/s/zfs/vfs/' /usr/local/etc/containers/storage.conf + # Remove any stray images from previous builds + eval chroot ${CHROOTDIR} buildah rmi -af + fi + if [ ! -z "${EMBEDDEDPORTS}" ]; then _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) @@ -323,6 +365,9 @@ chroot_build_target() { fi eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_WMAKEFLAGS} buildworld eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_KMAKEFLAGS} buildkernel + if [ ! -z "${WITH_OCIIMAGES}" ]; then + eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_WMAKEFLAGS} packages + fi return 0 } # chroot_build_target diff --git a/release/scripts/make-oci-image.sh b/release/scripts/make-oci-image.sh new file mode 100644 index 000000000000..a139a38d1930 --- /dev/null +++ b/release/scripts/make-oci-image.sh @@ -0,0 +1,63 @@ +#! /bin/sh + +# Build an Open Container Initiative (OCI) container image + +curdir=$1; shift +rev=$1; shift +branch=$1; shift +arch=$1; shift +image=$1; shift + +major=${rev%.*} +minor=${rev#*.} + +abi=FreeBSD:${major}:${arch} + +echo "Building OCI freebsd${major}-${image} image for ${abi}" + +. ${curdir}/tools/oci-image-${image}.conf + +init_workdir() { + local abi=$1; shift + local workdir=$(mktemp -d -t oci-images) + + mkdir ${workdir}/repos + cat > ${workdir}/repos/base.conf < /dev/null + mtree -deU -p $m/var -f /etc/mtree/BSD.var.dist > /dev/null + mtree -deU -p $m/usr -f /etc/mtree/BSD.usr.dist > /dev/null + mtree -deU -p $m/usr/include -f /etc/mtree/BSD.include.dist > /dev/null + mtree -deU -p $m/usr/lib -f /etc/mtree/BSD.debug.dist > /dev/null + install_packages ${abi} ${workdir} $m FreeBSD-caroot FreeBSD-zoneinfo + cp /etc/master.passwd $m/etc + pwd_mkdb -p -d $m/etc $m/etc/master.passwd || return $? + cp /etc/group $m/etc || return $? + cp /etc/termcap.small $m/etc/termcap.small || return $? + cp /etc/termcap.small $m/usr/share/misc/termcap || return $? + env DESTDIR=$m /usr/sbin/certctl rehash + # Generate a suitable repo config for pkgbase + case ${branch} in + CURRENT|STABLE|BETA*) + repo=base_latest + ;; + *) + repo=base_release_${minor} + ;; + esac + mkdir -p $m/usr/local/etc/pkg/repos + cat > $m/usr/local/etc/pkg/repos/base.conf < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 21d7ac8c79a3 - main - inpcb: Remove some unused parameters in internal hash lookup functions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 21d7ac8c79a34cf3b7205d0c32014ee39f1f28ab Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=21d7ac8c79a34cf3b7205d0c32014ee39f1f28ab commit 21d7ac8c79a34cf3b7205d0c32014ee39f1f28ab Author: Mark Johnston AuthorDate: 2024-11-08 14:25:19 +0000 Commit: Mark Johnston CommitDate: 2024-11-08 14:25:19 +0000 inpcb: Remove some unused parameters in internal hash lookup functions in_pcblookup_hash_wild_* looks up unconnected inpcbs, so there is no point in passing the foreign address and port, and indeed those parameters are not used. So, remove them. No functional change intended. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D47385 --- sys/netinet/in_pcb.c | 17 ++++++++--------- sys/netinet6/in6_pcb.c | 14 ++++++-------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 6ea197cf68d8..769724fd5063 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -2179,9 +2179,8 @@ in_pcblookup_wild_match(const struct inpcb *inp, struct in_addr laddr, #define INP_LOOKUP_AGAIN ((struct inpcb *)(uintptr_t)-1) static struct inpcb * -in_pcblookup_hash_wild_smr(struct inpcbinfo *pcbinfo, struct in_addr faddr, - u_short fport, struct in_addr laddr, u_short lport, - const inp_lookup_t lockflags) +in_pcblookup_hash_wild_smr(struct inpcbinfo *pcbinfo, struct in_addr laddr, + u_short lport, const inp_lookup_t lockflags) { struct inpcbhead *head; struct inpcb *inp; @@ -2217,8 +2216,8 @@ in_pcblookup_hash_wild_smr(struct inpcbinfo *pcbinfo, struct in_addr faddr, } static struct inpcb * -in_pcblookup_hash_wild_locked(struct inpcbinfo *pcbinfo, struct in_addr faddr, - u_short fport, struct in_addr laddr, u_short lport) +in_pcblookup_hash_wild_locked(struct inpcbinfo *pcbinfo, struct in_addr laddr, + u_short lport) { struct inpcbhead *head; struct inpcb *inp, *local_wild, *local_exact, *jail_wild; @@ -2319,8 +2318,8 @@ in_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, struct in_addr faddr, inp = in_pcblookup_lbgroup(pcbinfo, &faddr, fport, &laddr, lport, numa_domain); if (inp == NULL) { - inp = in_pcblookup_hash_wild_locked(pcbinfo, faddr, - fport, laddr, lport); + inp = in_pcblookup_hash_wild_locked(pcbinfo, laddr, + lport); } } @@ -2402,8 +2401,8 @@ in_pcblookup_hash_smr(struct inpcbinfo *pcbinfo, struct in_addr faddr, } inp = INP_LOOKUP_AGAIN; } else { - inp = in_pcblookup_hash_wild_smr(pcbinfo, faddr, fport, - laddr, lport, lockflags); + inp = in_pcblookup_hash_wild_smr(pcbinfo, laddr, lport, + lockflags); } if (inp == INP_LOOKUP_AGAIN) { return (in_pcblookup_hash(pcbinfo, faddr, fport, laddr, diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 501434f2fac6..49a430ea6d01 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -997,8 +997,7 @@ in6_pcblookup_wild_match(const struct inpcb *inp, const struct in6_addr *laddr, static struct inpcb * in6_pcblookup_hash_wild_smr(struct inpcbinfo *pcbinfo, - const struct in6_addr *faddr, u_short fport, const struct in6_addr *laddr, - u_short lport, const inp_lookup_t lockflags) + const struct in6_addr *laddr, u_short lport, const inp_lookup_t lockflags) { struct inpcbhead *head; struct inpcb *inp; @@ -1035,8 +1034,7 @@ in6_pcblookup_hash_wild_smr(struct inpcbinfo *pcbinfo, static struct inpcb * in6_pcblookup_hash_wild_locked(struct inpcbinfo *pcbinfo, - const struct in6_addr *faddr, u_short fport, const struct in6_addr *laddr, - u_short lport) + const struct in6_addr *laddr, u_short lport) { struct inpcbhead *head; struct inpcb *inp, *jail_wild, *local_exact, *local_wild; @@ -1118,8 +1116,8 @@ in6_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, inp = in6_pcblookup_lbgroup(pcbinfo, faddr, fport, laddr, lport, numa_domain); if (inp == NULL) { - inp = in6_pcblookup_hash_wild_locked(pcbinfo, faddr, - fport, laddr, lport); + inp = in6_pcblookup_hash_wild_locked(pcbinfo, + laddr, lport); } } return (inp); @@ -1195,8 +1193,8 @@ in6_pcblookup_hash_smr(struct inpcbinfo *pcbinfo, struct in6_addr *faddr, } inp = INP_LOOKUP_AGAIN; } else { - inp = in6_pcblookup_hash_wild_smr(pcbinfo, faddr, fport, - laddr, lport, lockflags); + inp = in6_pcblookup_hash_wild_smr(pcbinfo, laddr, lport, + lockflags); } if (inp == INP_LOOKUP_AGAIN) { return (in6_pcblookup_hash(pcbinfo, faddr, fport, laddr, From nobody Fri Nov 8 15:09:51 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XlMn20YgKz5cN8q; Fri, 08 Nov 2024 15:09:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XlMn203n4z4gGc; Fri, 8 Nov 2024 15:09:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731078598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DUBps9LHPogNg+DXKT07RWCy0DAwIHuivPcg6p4jNSA=; b=GQhEcyoNJKdZ2L7DXFtVvhQCE+oMebnMmoUoMx73gmtQuwZ2xccRSbkIjQmLDXHSprAZMw 7aRIEzmg4FIk7qYjkOILVbU/ViwZzKjRc0Y4Y6cLOpkBx4k34HVRr7WWYBev1bCDk5bb+l TwKVVz5M471iMp0vUEgv02Ss+ChIoq/BesZ7OywkUjitOMO10qT4xBEtkurGrtVR/LQjVj l8CvwYgZbMmB7nxg+KxrTljJdBPiAYLMrsr6up2TIvpnGEL3XLfbYou5lB8w0CznL72NhB 6OooKIxRKcw5weQ921aJ7VfdT9BZE+D4l8EqFR6myjkdeop13INEWEsJc4NUsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731078598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DUBps9LHPogNg+DXKT07RWCy0DAwIHuivPcg6p4jNSA=; b=ICZCojaGg7JTSyoxrtjeRnodwh8MuMqepU4i2R0FbeZQzGJ6nee1DXklVOOoUhQdT5EY6B ZAbVY+IqDvd1HI5/or8bfqT0AK/I9qpnHHkMeencZu/QOfqQn7g3KyUuFg+mhLIOojsk4n mMYaXtrUIon8MMjHYjbe40ljBchi10KT+3uyxAl6062VHbPNmKixVtR+iCuD8+fHu2LTaw y1SHaLJCdx8p1hnSt/t16j12URj+nK6TPO+/xJwhnPLz7+pVxvaRV9+ataL/FGZe6+NGct Wq7SHgqXeqFizmPOvKeKODgfpawMXz8jkNjwoDzWdVl3BdeLjlCmdM+Q0kFfXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731078598; a=rsa-sha256; cv=none; b=cE7OMMu68+AGhXmn4/6gBTjmlk/YO5aeaV+OOTk07u5aQ40MH/7aQpt/DUY+MTdH5cYeww O7FwNqVr6nv4oQlUkOfWew/g8hskMeZ8wSjvR5xK2OGEGWXrvdDSbLF3FlI8USttNuqOhJ FHMLx7pIk0vKXZZyPXVYgS1DAyTf3zR2rPSEdI8j50R1LIKQ1XShlZTXN+/ZqXJ5X7GMuC jxithKdbwa9F+vU2JZnVO7pCSfr4h3WO7teuouMq28aAzfsaJy+r3pXNkyXKHPDSWAWoNI yv7Ce3jcPnfwyDv3qC3CyPsdSthvEFOBhrniy9HKa8LuBBgS4LutLzh8G+x4XA== Received: from [10.9.4.95] (unknown [209.182.120.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XlMmz1x99zftQ; Fri, 8 Nov 2024 15:09:55 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: Date: Fri, 8 Nov 2024 09:09:51 -0600 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: d2434697bc9c - main - loader.kboot: Build on amd64 To: Jessica Clarke , Warner Losh Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202411080059.4A80xv9q000454@gitrepo.freebsd.org> <5B288C0C-5A9A-4772-8B14-06BDCC527B04@freebsd.org> Content-Language: en-US From: Kyle Evans In-Reply-To: <5B288C0C-5A9A-4772-8B14-06BDCC527B04@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 11/7/24 19:03, Jessica Clarke wrote: > On 8 Nov 2024, at 00:59, Warner Losh wrote: >> >> The branch main has been updated by imp: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=d2434697bc9cc2d36da0f356cc5942b33df87896 >> >> commit d2434697bc9cc2d36da0f356cc5942b33df87896 >> Author: Warner Losh >> AuthorDate: 2024-11-07 22:59:04 +0000 >> Commit: Warner Losh >> CommitDate: 2024-11-07 23:23:26 +0000 >> >> loader.kboot: Build on amd64 >> >> But comment out FDT stuff for amd64 built inside kboot. This also >> restricts a bit the powerpc platforms we build on to powerpc64. >> >> Sponsored by: Netflix >> --- >> stand/Makefile | 2 +- >> stand/kboot/kboot/Makefile | 5 ++++- >> stand/kboot/kboot/main.c | 5 ++++- >> 3 files changed, 9 insertions(+), 3 deletions(-) >> >> diff --git a/stand/Makefile b/stand/Makefile >> index ce91802d4a8b..5d81e5f8a032 100644 >> --- a/stand/Makefile >> +++ b/stand/Makefile >> @@ -37,7 +37,7 @@ INTERP_DEPENDS+= lua >> .include >> >> S.${MK_EFI}+= efi >> -.if ${MK_FDT} != "no" >> +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "powerpc64" >> S.${MK_LOADER_KBOOT}+= kboot >> .endif > > Hm, is the outer if really needed? We already have: > > # KBOOT is only for powerpc64 (powerpc64le broken) amd64 and aarch64 > .if ${__T} != "powerpc64" && ${__T} != "amd64" && ${__T} != “aarch64" > BROKEN_OPTIONS+=LOADER_KBOOT > .endif > > in src.opts.mk, which is generally where these kinds of restrictions > should live. > I had the same thought about the BHYVE option the other day... it'd be useful if we BROKEN_OPTION'd it so that MK_BHYVE is accurate on platforms that don't support it. The particular context where it would've been nice is depend-cleanup.sh, since we could've used it as a heuristic to nuke the errant include dirs if the option was properly disabled. Thanks, Kyle Evans From nobody Fri Nov 8 16:26:15 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XlPT4033vz5cSnR; Fri, 08 Nov 2024 16:26: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XlPT34W6kz4nFF; Fri, 8 Nov 2024 16:26:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731083175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cL+IrwCFege9RQ0d2U3ip1pq3ecBwWNGb6+9lt015NE=; b=n+Bv2oI6zanVcU5HdSjNjaQqcIlQzDrdpLyK29NEdTnDwExpicqtO70qrgnj6+1fxfFObN hxFy5K5wys3V0fFTqDMEy+F2AAqajc882KSFxKmUpG9FRH+/u29ONEo16736+OwiC/Rwdk 1hPT+J8Z2uRO85mVzCUhgyhqlgiL3fyjyxsRBAaB+0o7PGZwnDns8/DKWc6tGJse7EKot0 +E5lMOfa/g/jvpXB5/gvEDFLyWW4ptBRwsFngeETv9YqxrP97U2sdq5SXrwks9Ka5lRge/ tM0dHPq4GRgYdrVVJEDbmgof+/ATlVZowOmgNnQlGhEFwgVGAnKRFr1MPF77pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731083175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cL+IrwCFege9RQ0d2U3ip1pq3ecBwWNGb6+9lt015NE=; b=PY347be1W3FoQ+y68A9IPEhjDPDGDVBGQ7u0rajvGAygObvkXAWBr8H8YSo27ojY7zWsWS tV4jm5rGkidecLiYlbsf2PgRVPLtjW5APfOLj2iibtMQzja0DAPrqFKcHl/O4w8FTIQvvi U2g1WJVhMv7RpXHA6Tgx+TsIweLsYAZy9BdKDVVIz1TYwdgpGTBE/2bRPz4CR7/sCpja14 6YlvWnDTzzAemzUpVzLwkiPhDMOeuyluF2Lznd73I3pRICps/ny/eVQliivHUfxR0Iy8qZ XNCVl8VuNWfi/QZd5bFBcJFw33EIFzla10i51aofFSKOl2/9Yls1TXwtJBalYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731083175; a=rsa-sha256; cv=none; b=MY4BvikFN+hX3l25ywH4/ExRQCxbmSYw6UOxSQCHLDGTzq/MJAi2+BxedtwYpadctp/I+K EzPgRAw2Xd57uAxduzvKZhpNICs1t5cv52yW1C60Lb7qcoLLPaOKb34qj+OluX0CCPaSIv 8V0JUAwER8Y87l7wb1Z74kdSLRXXQAw4PwN3CB9n2fQST6pPGUIzDsGaYKUHyPSrPm7PMn MlJTXxu/kH1ynuT5nQ/b72+nbx5NMBkgS5wG25qu6CgUqQ7A8tg0NgGDDmoGHbs4ylMybT 0thNFoMJVqohmgTTuB94Lnn5ZgONC2YOgJu08nkqEmEy3QnSO6If2BTI9Vg/rg== 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 4XlPT346Ddzc6q; Fri, 8 Nov 2024 16:26:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A8GQFDj029741; Fri, 8 Nov 2024 16:26:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A8GQF5J029738; Fri, 8 Nov 2024 16:26:15 GMT (envelope-from git) Date: Fri, 8 Nov 2024 16:26:15 GMT Message-Id: <202411081626.4A8GQF5J029738@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 8838f3c32ac0 - main - rtwn: ensure TX work isn't scheduled during reset / abort List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8838f3c32ac0ebcb8b20863f8c455375039a505e Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=8838f3c32ac0ebcb8b20863f8c455375039a505e commit 8838f3c32ac0ebcb8b20863f8c455375039a505e Author: Adrian Chadd AuthorDate: 2024-11-08 16:26:05 +0000 Commit: Adrian Chadd CommitDate: 2024-11-08 16:26:05 +0000 rtwn: ensure TX work isn't scheduled during reset / abort Don't schedule work during reset / abort. For USB NICs, work must not be scheduled during a call to rtwn_usb_abort_xfers(), as then it'll cause the call to usbd_transfer_drain() to hang. This fixes a hang I've been seeing where the NIC hits a TX timeout and then the reset/re-init path is called. If data is scheduled to be transmitted in that window, the call to usbd_transfer_drain() would hang and require a hard reboot to recover. Differential Revision: https://reviews.freebsd.org/D47479 --- sys/dev/rtwn/if_rtwn_tx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/rtwn/if_rtwn_tx.c b/sys/dev/rtwn/if_rtwn_tx.c index f5e97933b314..bf45d14f7edc 100644 --- a/sys/dev/rtwn/if_rtwn_tx.c +++ b/sys/dev/rtwn/if_rtwn_tx.c @@ -263,6 +263,11 @@ rtwn_start(struct rtwn_softc *sc) struct mbuf *m; RTWN_ASSERT_LOCKED(sc); + + /* Ensure no work is scheduled during reset/teardown */ + if ((sc->sc_flags & RTWN_RUNNING) == 0) + return; + while ((m = mbufq_dequeue(&sc->sc_snd)) != NULL) { if (sc->qfullmsk != 0) { mbufq_prepend(&sc->sc_snd, m); From nobody Fri Nov 8 16:46:32 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XlPwZ3FXDz5cTh7; Fri, 08 Nov 2024 16:46: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XlPwZ2x59z4psH; Fri, 8 Nov 2024 16:46:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731084398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ir0hYDI3F/ukJ/X/TmUYnmRD5ftgIjPaWjmOcKpl0mA=; b=pMLub+2aD7gzuiMIPKj6tkWetbjEQYKVy0Rpx9lHodC9rwlgyHVfWPvIn+bJQgrpQ2FNf4 vmuREfZK5LgviBVqTrLrsgRB8wCnnfhXvUfYebqh44oqUT8y5GyoHchiWINiYml82h+wi2 NVL1ktcdKkv4fKJiYp4BEPi8hAcnuSFepss4H288Eu6raI/tdYxbXcPqL9OoiiWhoizFv/ Rf1/8Mvva9IGDY/rYPP8PX764n1jpb3B5KggGRUqVDIgA3F0ZBESJOSOdAYOWQ03wgAV6c mkMzlKq6Kzr5XqcUn4gtc+Jl3gF9fvDN98q+mXfJkH03xGYxSUgthgxXhugrTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731084398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ir0hYDI3F/ukJ/X/TmUYnmRD5ftgIjPaWjmOcKpl0mA=; b=gpUOgGc2T5wDKIsHxNROkQ8WKsjTCyC8omVNzulwv+srVW+zyOarLl20thNak8HNJQdZbX DRzhPJrJkTJfLB1Imi6h/Rhbk413dsqOS1lC36hKw/1XY4Rz4Rvst/GeV5kQ1m+mVCiXGS LxkIlu5EgvULM1Vo8bimNJ+0VlPIQAtFvGfm9s/71+q888uZm/sBG3PoTBe5AxeLPAaIfx ccwtko/wN9GD4Szn+B+ma6n3YsEzGvYlAhG1f4jd78CtelmfjVWb6+RmeAdzb3SSb3T754 2O40ej3kJKQBY2eUKsfJeI380JFCMQx0Lel3sYduXSEnMq9WZzRFcKRLINpZeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731084398; a=rsa-sha256; cv=none; b=totYMGM3+MUlImcxMF+V9oEDQ66MQi2CBAQ8pPxrvgirJmin8ioLDL5q9TVwTP9r4OrEYO 1vdJGRyaoiiMkIh5Hhdhs+9CtXtCiuhUTKVMq/MDjv3h7KNdjrJr0NBp0/sg8JX2GVu4bN W/MqA7Ulej2DBUW/AAHzoGz4joPJHdGb18QaFAR1JhiNTq3eAynSKiXDxXaogWu3ctwOcD PZpGmpZsoRBcyaJVSvb2YfEEG2mPezlSX3SaXi6RKMtaEJZD17qipccBb0SyDqkkqxgfIi 9b69sQ4hOsU9d0BASo3KEHOJR36Ytg2Hmzsd/LBW+EflU4rleU2mazdewHBzAQ== 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 4XlPwZ2Pwlzcgf; Fri, 8 Nov 2024 16:46:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A8GkcLS066424; Fri, 8 Nov 2024 16:46:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A8GkWip066394; Fri, 8 Nov 2024 16:46:32 GMT (envelope-from git) Date: Fri, 8 Nov 2024 16:46:32 GMT Message-Id: <202411081646.4A8GkWip066394@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: d686ce931cab - main - Merge llvm-project release/19.x llvmorg-19.1.3-0-gab51eccf88f5 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d686ce931cab72612a9e1ada9fe99d65e11a32a3 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=d686ce931cab72612a9e1ada9fe99d65e11a32a3 commit d686ce931cab72612a9e1ada9fe99d65e11a32a3 Merge: 8838f3c32ac0 efdccd835863 Author: Dimitry Andric AuthorDate: 2024-11-08 11:32:34 +0000 Commit: Dimitry Andric CommitDate: 2024-11-08 16:45:31 +0000 Merge llvm-project release/19.x llvmorg-19.1.3-0-gab51eccf88f5 This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.3-0-gab51eccf88f5, a.k.a. 19.1.3 release. PR: 280562 MFC after: 1 month .../clang/include/clang/AST/ExternalASTSource.h | 48 ++++++++++++++++------ .../llvm-project/clang/lib/Basic/Targets/ARM.cpp | 2 + .../clang/lib/Basic/Targets/OSTargets.h | 4 ++ .../llvm-project/clang/lib/CodeGen/CGBuiltin.cpp | 45 +++++++++----------- .../clang/lib/CodeGen/CodeGenModule.cpp | 10 +++-- .../llvm-project/clang/lib/CodeGen/Targets/ARM.cpp | 3 ++ contrib/llvm-project/clang/lib/Driver/Driver.cpp | 5 ++- .../clang/lib/Driver/ToolChains/Arch/ARM.cpp | 7 ++++ .../clang/lib/Driver/ToolChains/Gnu.cpp | 2 + .../clang/lib/Driver/ToolChains/Linux.cpp | 1 + .../clang/lib/Format/UnwrappedLineParser.cpp | 5 +++ contrib/llvm-project/clang/lib/Parse/ParseStmt.cpp | 11 +++-- .../clang/lib/Sema/SemaTemplateDeductionGuide.cpp | 21 ++++++++-- .../clang/lib/Serialization/ASTReaderDecl.cpp | 3 +- .../clang/lib/Serialization/ASTWriterDecl.cpp | 5 ++- .../sanitizer_procmaps_solaris.cpp | 4 ++ contrib/llvm-project/libcxx/include/__config | 2 +- .../llvm/include/llvm/TargetParser/Triple.h | 35 +++++++++++++--- .../llvm/lib/Analysis/ConstantFolding.cpp | 4 +- .../llvm/lib/Target/ARM/ARMSubtarget.h | 4 +- .../llvm/lib/Target/ARM/ARMTargetMachine.cpp | 2 + .../llvm/lib/Target/ARM/ARMTargetMachine.h | 1 + .../lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp | 6 +-- .../WebAssembly/WebAssemblyTargetMachine.cpp | 12 ++---- .../llvm/lib/TargetParser/ARMTargetParser.cpp | 3 ++ .../llvm-project/llvm/lib/TargetParser/Triple.cpp | 6 +++ .../llvm/lib/Transforms/Utils/InlineFunction.cpp | 2 +- .../llvm/lib/Transforms/Utils/ModuleUtils.cpp | 12 +++--- lib/clang/include/VCSVersion.inc | 6 +-- lib/clang/include/clang/Basic/Version.inc | 6 +-- lib/clang/include/lld/Common/Version.inc | 2 +- lib/clang/include/lldb/Version/Version.inc | 6 +-- lib/clang/include/llvm/Config/config.h | 4 +- lib/clang/include/llvm/Config/llvm-config.h | 4 +- lib/clang/include/llvm/Support/VCSRevision.h | 2 +- lib/libc++/__assertion_handler | 3 +- lib/libomp/kmp_config.h | 2 +- 37 files changed, 203 insertions(+), 97 deletions(-) diff --cc lib/clang/include/VCSVersion.inc index 5b4ac649986a,000000000000..b514dee27f3a mode 100644,000000..100644 --- a/lib/clang/include/VCSVersion.inc +++ b/lib/clang/include/VCSVersion.inc @@@ -1,8 -1,0 +1,8 @@@ - #define LLVM_REVISION "llvmorg-19.1.2-0-g7ba7d8e2f7b6" ++#define LLVM_REVISION "llvmorg-19.1.3-0-gab51eccf88f5" +#define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git" + - #define CLANG_REVISION "llvmorg-19.1.2-0-g7ba7d8e2f7b6" ++#define CLANG_REVISION "llvmorg-19.1.3-0-gab51eccf88f5" +#define CLANG_REPOSITORY "https://github.com/llvm/llvm-project.git" + - #define LLDB_REVISION "llvmorg-19.1.2-0-g7ba7d8e2f7b6" ++#define LLDB_REVISION "llvmorg-19.1.3-0-gab51eccf88f5" +#define LLDB_REPOSITORY "https://github.com/llvm/llvm-project.git" diff --cc lib/clang/include/clang/Basic/Version.inc index 163d9b601b93,000000000000..2795c08bec37 mode 100644,000000..100644 --- a/lib/clang/include/clang/Basic/Version.inc +++ b/lib/clang/include/clang/Basic/Version.inc @@@ -1,8 -1,0 +1,8 @@@ - #define CLANG_VERSION 19.1.2 - #define CLANG_VERSION_STRING "19.1.2" ++#define CLANG_VERSION 19.1.3 ++#define CLANG_VERSION_STRING "19.1.3" +#define CLANG_VERSION_MAJOR 19 +#define CLANG_VERSION_MAJOR_STRING "19" +#define CLANG_VERSION_MINOR 1 - #define CLANG_VERSION_PATCHLEVEL 2 ++#define CLANG_VERSION_PATCHLEVEL 3 + +#define CLANG_VENDOR "FreeBSD " diff --cc lib/clang/include/lld/Common/Version.inc index 555a95af9183,000000000000..6a1154413579 mode 100644,000000..100644 --- a/lib/clang/include/lld/Common/Version.inc +++ b/lib/clang/include/lld/Common/Version.inc @@@ -1,4 -1,0 +1,4 @@@ +// Local identifier in __FreeBSD_version style +#define LLD_FREEBSD_VERSION 1500001 + - #define LLD_VERSION_STRING "19.1.2 (FreeBSD llvmorg-19.1.2-0-g7ba7d8e2f7b6-" __XSTRING(LLD_FREEBSD_VERSION) ")" ++#define LLD_VERSION_STRING "19.1.3 (FreeBSD llvmorg-19.1.3-0-gab51eccf88f5-" __XSTRING(LLD_FREEBSD_VERSION) ")" diff --cc lib/clang/include/lldb/Version/Version.inc index be36ec215810,000000000000..1e614fc8a0cc mode 100644,000000..100644 --- a/lib/clang/include/lldb/Version/Version.inc +++ b/lib/clang/include/lldb/Version/Version.inc @@@ -1,6 -1,0 +1,6 @@@ - #define LLDB_VERSION 19.1.2 - #define LLDB_VERSION_STRING "19.1.2" ++#define LLDB_VERSION 19.1.3 ++#define LLDB_VERSION_STRING "19.1.3" +#define LLDB_VERSION_MAJOR 19 +#define LLDB_VERSION_MINOR 1 - #define LLDB_VERSION_PATCH 2 ++#define LLDB_VERSION_PATCH 3 +/* #undef LLDB_FULL_VERSION_STRING */ diff --cc lib/clang/include/llvm/Config/config.h index 2ad54b836743,000000000000..972b3c894dac mode 100644,000000..100644 --- a/lib/clang/include/llvm/Config/config.h +++ b/lib/clang/include/llvm/Config/config.h @@@ -1,372 -1,0 +1,372 @@@ +#ifndef CONFIG_H +#define CONFIG_H + +// Include this header only under the llvm source tree. +// This is a private header. + +/* Exported configuration */ +#include "llvm/Config/llvm-config.h" + +/* Bug report URL. */ +#define BUG_REPORT_URL "https://bugs.freebsd.org/submit/" + +/* Define to 1 to enable backtraces, and to 0 otherwise. */ +#define ENABLE_BACKTRACES 1 + +/* Define to 1 to enable crash overrides, and to 0 otherwise. */ +#define ENABLE_CRASH_OVERRIDES 1 + +/* Define to 1 to enable crash memory dumps, and to 0 otherwise. */ +#define LLVM_ENABLE_CRASH_DUMPS 0 + +/* Define to 1 to prefer forward slashes on Windows, and to 0 prefer + backslashes. */ +#define LLVM_WINDOWS_PREFER_FORWARD_SLASH 0 + +/* Define to 1 if you have the `backtrace' function. */ +#define HAVE_BACKTRACE TRUE + +#define BACKTRACE_HEADER + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CRASHREPORTERCLIENT_H */ + +/* can use __crashreporter_info__ */ +#if defined(__APPLE__) +#define HAVE_CRASHREPORTER_INFO 1 +#else +#define HAVE_CRASHREPORTER_INFO 0 +#endif + +/* Define to 1 if you have the declaration of `arc4random', and to 0 if you + don't. */ +#define HAVE_DECL_ARC4RANDOM 1 + +/* Define to 1 if you have the declaration of `FE_ALL_EXCEPT', and to 0 if you + don't. */ +#define HAVE_DECL_FE_ALL_EXCEPT 1 + +/* Define to 1 if you have the declaration of `FE_INEXACT', and to 0 if you + don't. */ +#define HAVE_DECL_FE_INEXACT 1 + +/* Define to 1 if you have the declaration of `strerror_s', and to 0 if you + don't. */ +#define HAVE_DECL_STRERROR_S 0 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define if dlopen() is available on this platform. */ +#define HAVE_DLOPEN 1 + +/* Define if dladdr() is available on this platform. */ +#define HAVE_DLADDR 1 + +#if !defined(__arm__) || defined(__USING_SJLJ_EXCEPTIONS__) || defined(__ARM_DWARF_EH__) +/* Define to 1 if we can register EH frames on this platform. */ +#define HAVE_REGISTER_FRAME 1 + +/* Define to 1 if we can deregister EH frames on this platform. */ +#define HAVE_DEREGISTER_FRAME 1 +#endif // !arm || USING_SJLJ_EXCEPTIONS || ARM_DWARF_EH_ + +/* Define if __unw_add_dynamic_fde() is available on this platform. */ +/* #undef HAVE_UNW_ADD_DYNAMIC_FDE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FENV_H 1 + +/* Define if libffi is available on this platform. */ +/* #undef HAVE_FFI_CALL */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_FFI_FFI_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_FFI_H */ + +/* Define to 1 if you have the `futimens' function. */ +#define HAVE_FUTIMENS 1 + +/* Define to 1 if you have the `futimes' function. */ +#define HAVE_FUTIMES 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + +/* Define to 1 if you have the `getrusage' function. */ +#define HAVE_GETRUSAGE 1 + +/* Define to 1 if you have the `isatty' function. */ +#define HAVE_ISATTY 1 + +/* Define to 1 if you have the `edit' library (-ledit). */ +#define HAVE_LIBEDIT TRUE + +/* Define to 1 if you have the `pfm' library (-lpfm). */ +/* #undef HAVE_LIBPFM */ + +/* Define to 1 if the `perf_branch_entry' struct has field cycles. */ +/* #undef LIBPFM_HAS_FIELD_CYCLES */ + +/* Define to 1 if you have the `psapi' library (-lpsapi). */ +/* #undef HAVE_LIBPSAPI */ + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +#define HAVE_LIBPTHREAD 1 + +/* Define to 1 if you have the `pthread_getname_np' function. */ +#define HAVE_PTHREAD_GETNAME_NP 1 + +/* Define to 1 if you have the `pthread_setname_np' function. */ +#define HAVE_PTHREAD_SETNAME_NP 1 + +/* Define to 1 if you have the header file. */ +#if __has_include() +#define HAVE_LINK_H 1 +#else +#define HAVE_LINK_H 0 +#endif + +/* Define to 1 if you have the header file. */ +#if __has_include() +#define HAVE_MACH_MACH_H 1 +#endif + +/* Define to 1 if you have the `mallctl' function. */ +#if defined(__FreeBSD__) +#define HAVE_MALLCTL 1 +#endif + +/* Define to 1 if you have the `mallinfo' function. */ +#if defined(__linux__) +#define HAVE_MALLINFO 1 +#endif + +/* Define to 1 if you have the `mallinfo2' function. */ +/* #undef HAVE_MALLINFO2 */ + +/* Define to 1 if you have the header file. */ +#if __has_include() +#define HAVE_MALLOC_MALLOC_H 1 +#endif + +/* Define to 1 if you have the `malloc_zone_statistics' function. */ +#if defined(__APPLE__) +#define HAVE_MALLOC_ZONE_STATISTICS 1 +#endif + +/* Define to 1 if you have the `posix_spawn' function. */ +#define HAVE_POSIX_SPAWN 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_PTHREAD_H 1 + +/* Have pthread_mutex_lock */ +#define HAVE_PTHREAD_MUTEX_LOCK 1 + +/* Have pthread_rwlock_init */ +#define HAVE_PTHREAD_RWLOCK_INIT 1 + +/* Define to 1 if you have the `sbrk' function. */ +#define HAVE_SBRK 1 + +/* Define to 1 if you have the `setenv' function. */ +#define HAVE_SETENV 1 + +/* Define to 1 if you have the `setrlimit' function. */ +#define HAVE_SETRLIMIT 1 + +/* Define to 1 if you have the `sigaltstack' function. */ +#define HAVE_SIGALTSTACK 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the `strerror_r' function. */ +#define HAVE_STRERROR_R 1 + +/* Define to 1 if you have the `sysconf' function. */ +#define HAVE_SYSCONF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MMAN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if stat struct has st_mtimespec member .*/ +#if !defined(__linux__) +#define HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1 +#endif + +/* Define to 1 if stat struct has st_mtim member. */ +#if !defined(__APPLE__) +#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1 +#endif + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TERMIOS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_VALGRIND_VALGRIND_H */ + +/* Have host's _alloca */ +/* #undef HAVE__ALLOCA */ + +/* Define to 1 if you have the `_chsize_s' function. */ +/* #undef HAVE__CHSIZE_S */ + +/* Define to 1 if you have the `_Unwind_Backtrace' function. */ +#define HAVE__UNWIND_BACKTRACE 1 + +/* Have host's __alloca */ +/* #undef HAVE___ALLOCA */ + +/* Have host's __ashldi3 */ +/* #undef HAVE___ASHLDI3 */ + +/* Have host's __ashrdi3 */ +/* #undef HAVE___ASHRDI3 */ + +/* Have host's __chkstk */ +/* #undef HAVE___CHKSTK */ + +/* Have host's __chkstk_ms */ +/* #undef HAVE___CHKSTK_MS */ + +/* Have host's __cmpdi2 */ +/* #undef HAVE___CMPDI2 */ + +/* Have host's __divdi3 */ +/* #undef HAVE___DIVDI3 */ + +/* Have host's __fixdfdi */ +/* #undef HAVE___FIXDFDI */ + +/* Have host's __fixsfdi */ +/* #undef HAVE___FIXSFDI */ + +/* Have host's __floatdidf */ +/* #undef HAVE___FLOATDIDF */ + +/* Have host's __lshrdi3 */ +/* #undef HAVE___LSHRDI3 */ + +/* Have host's __main */ +/* #undef HAVE___MAIN */ + +/* Have host's __moddi3 */ +/* #undef HAVE___MODDI3 */ + +/* Have host's __udivdi3 */ +/* #undef HAVE___UDIVDI3 */ + +/* Have host's __umoddi3 */ +/* #undef HAVE___UMODDI3 */ + +/* Have host's ___chkstk */ +/* #undef HAVE____CHKSTK */ + +/* Have host's ___chkstk_ms */ +/* #undef HAVE____CHKSTK_MS */ + +/* Linker version detected at compile time. */ +/* #undef HOST_LINK_VERSION */ + +/* Define if overriding target triple is enabled */ +/* #undef LLVM_TARGET_TRIPLE_ENV */ + +/* Whether tools show host and target info when invoked with --version */ +#define LLVM_VERSION_PRINTER_SHOW_HOST_TARGET_INFO 1 + +/* Whether tools show optional build config flags when invoked with --version */ +#define LLVM_VERSION_PRINTER_SHOW_BUILD_CONFIG 1 + +/* Define if libxml2 is supported on this platform. */ +/* #undef LLVM_ENABLE_LIBXML2 */ + +/* Define to the extension used for shared libraries, say, ".so". */ +#if defined(__APPLE__) +#define LTDL_SHLIB_EXT ".dylib" +#else +#define LTDL_SHLIB_EXT ".so" +#endif + +/* Define to the extension used for plugin libraries, say, ".so". */ +#if defined(__APPLE__) +#define LLVM_PLUGIN_EXT ".dylib" +#else +#define LLVM_PLUGIN_EXT ".so" +#endif + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "https://bugs.freebsd.org/submit/" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "LLVM" + +/* Define to the full name and version of this package. */ - #define PACKAGE_STRING "LLVM 19.1.2" ++#define PACKAGE_STRING "LLVM 19.1.3" + +/* Define to the version of this package. */ - #define PACKAGE_VERSION "19.1.2" ++#define PACKAGE_VERSION "19.1.3" + +/* Define to the vendor of this package. */ +/* #undef PACKAGE_VENDOR */ + +/* Define to a function implementing stricmp */ +/* #undef stricmp */ + +/* Define to a function implementing strdup */ +/* #undef strdup */ + +/* Whether GlobalISel rule coverage is being collected */ +#define LLVM_GISEL_COV_ENABLED 0 + +/* Define to the default GlobalISel coverage file prefix */ +/* #undef LLVM_GISEL_COV_PREFIX */ + +/* Whether Timers signpost passes in Xcode Instruments */ +#if defined(__APPLE__) +#define LLVM_SUPPORT_XCODE_SIGNPOSTS 1 +#else +#define LLVM_SUPPORT_XCODE_SIGNPOSTS 0 +#endif + +/* #undef HAVE_PROC_PID_RUSAGE */ + +#define HAVE_BUILTIN_THREAD_POINTER 1 + +#endif diff --cc lib/clang/include/llvm/Config/llvm-config.h index 0d8253e78646,000000000000..c3a1df747ff6 mode 100644,000000..100644 --- a/lib/clang/include/llvm/Config/llvm-config.h +++ b/lib/clang/include/llvm/Config/llvm-config.h @@@ -1,232 -1,0 +1,232 @@@ +/*===------- llvm/Config/llvm-config.h - llvm configuration -------*- C -*-===*/ +/* */ +/* Part of the LLVM Project, under the Apache License v2.0 with LLVM */ +/* Exceptions. */ +/* See https://llvm.org/LICENSE.txt for license information. */ +/* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ +/* */ +/*===----------------------------------------------------------------------===*/ + +/* This file enumerates variables from the LLVM configuration so that they + can be in exported headers and won't override package specific directives. + This is a C header that can be included in the llvm-c headers. */ + +#ifndef LLVM_CONFIG_H +#define LLVM_CONFIG_H + +/* Define if LLVM_ENABLE_DUMP is enabled */ +/* #undef LLVM_ENABLE_DUMP */ + +/* Target triple LLVM will generate code for by default */ +/* Doesn't use `cmakedefine` because it is allowed to be empty. */ +/* #undef LLVM_DEFAULT_TARGET_TRIPLE */ + +/* Define if threads enabled */ +#define LLVM_ENABLE_THREADS 1 + +/* Has gcc/MSVC atomic intrinsics */ +#define LLVM_HAS_ATOMICS 1 + +/* Host triple LLVM will be executed on */ +/* #undef LLVM_HOST_TRIPLE */ + +/* LLVM architecture name for the native architecture, if available */ +/* #undef LLVM_NATIVE_ARCH */ + +/* LLVM name for the native AsmParser init function, if available */ +/* #undef LLVM_NATIVE_ASMPARSER */ + +/* LLVM name for the native AsmPrinter init function, if available */ +/* #undef LLVM_NATIVE_ASMPRINTER */ + +/* LLVM name for the native Disassembler init function, if available */ +/* #undef LLVM_NATIVE_DISASSEMBLER */ + +/* LLVM name for the native Target init function, if available */ +/* #undef LLVM_NATIVE_TARGET */ + +/* LLVM name for the native TargetInfo init function, if available */ +/* #undef LLVM_NATIVE_TARGETINFO */ + +/* LLVM name for the native target MC init function, if available */ +/* #undef LLVM_NATIVE_TARGETMC */ + +/* LLVM name for the native target MCA init function, if available */ +/* #undef LLVM_NATIVE_TARGETMCA */ + +/* Define if the AArch64 target is built in */ +#ifdef LLVM_TARGET_ENABLE_AARCH64 +#define LLVM_HAS_AARCH64_TARGET 1 +#else +#define LLVM_HAS_AARCH64_TARGET 0 +#endif + +/* Define if the AMDGPU target is built in */ +#define LLVM_HAS_AMDGPU_TARGET 0 + +/* Define if the ARC target is built in */ +#define LLVM_HAS_ARC_TARGET 0 + +/* Define if the ARM target is built in */ +#ifdef LLVM_TARGET_ENABLE_ARM +#define LLVM_HAS_ARM_TARGET 1 +#else +#define LLVM_HAS_ARM_TARGET 0 +#endif + +/* Define if the AVR target is built in */ +#define LLVM_HAS_AVR_TARGET 0 + +/* Define if the BPF target is built in */ +#ifdef LLVM_TARGET_ENABLE_BPF +#define LLVM_HAS_BPF_TARGET 1 +#else +#define LLVM_HAS_BPF_TARGET 0 +#endif + +/* Define if the CSKY target is built in */ +#define LLVM_HAS_CSKY_TARGET 0 + +/* Define if the DirectX target is built in */ +#define LLVM_HAS_DIRECTX_TARGET 0 + +/* Define if the Hexagon target is built in */ +#define LLVM_HAS_HEXAGON_TARGET 0 + +/* Define if the Lanai target is built in */ +#define LLVM_HAS_LANAI_TARGET 0 + +/* Define if the LoongArch target is built in */ +#define LLVM_HAS_LOONGARCH_TARGET 0 + +/* Define if the M68k target is built in */ +#define LLVM_HAS_M68K_TARGET 0 + +/* Define if the Mips target is built in */ +#ifdef LLVM_TARGET_ENABLE_MIPS +#define LLVM_HAS_MIPS_TARGET 1 +#else +#define LLVM_HAS_MIPS_TARGET 0 +#endif + +/* Define if the MSP430 target is built in */ +#define LLVM_HAS_MSP430_TARGET 0 + +/* Define if the NVPTX target is built in */ +#define LLVM_HAS_NVPTX_TARGET 0 + +/* Define if the PowerPC target is built in */ +#ifdef LLVM_TARGET_ENABLE_POWERPC +#define LLVM_HAS_POWERPC_TARGET 1 +#else +#define LLVM_HAS_POWERPC_TARGET 0 +#endif + +/* Define if the RISCV target is built in */ +#ifdef LLVM_TARGET_ENABLE_RISCV +#define LLVM_HAS_RISCV_TARGET 1 +#else +#define LLVM_HAS_RISCV_TARGET 0 +#endif + +/* Define if the Sparc target is built in */ +#define LLVM_HAS_SPARC_TARGET 0 + +/* Define if the SPIRV target is built in */ +#define LLVM_HAS_SPIRV_TARGET 0 + +/* Define if the SystemZ target is built in */ +#define LLVM_HAS_SYSTEMZ_TARGET 0 + +/* Define if the VE target is built in */ +#define LLVM_HAS_VE_TARGET 0 + +/* Define if the WebAssembly target is built in */ +#define LLVM_HAS_WEBASSEMBLY_TARGET 0 + +/* Define if the X86 target is built in */ +#ifdef LLVM_TARGET_ENABLE_X86 +#define LLVM_HAS_X86_TARGET 1 +#else +#define LLVM_HAS_X86_TARGET 0 +#endif + +/* Define if the XCore target is built in */ +#define LLVM_HAS_XCORE_TARGET 0 + +/* Define if the Xtensa target is built in */ +#define LLVM_HAS_XTENSA_TARGET 0 + +/* Define if this is Unixish platform */ +#define LLVM_ON_UNIX 1 + +/* Define if we have the Intel JIT API runtime support library */ +#define LLVM_USE_INTEL_JITEVENTS 0 + +/* Define if we have the oprofile JIT-support library */ +#define LLVM_USE_OPROFILE 0 + +/* Define if we have the perf JIT-support library */ +#define LLVM_USE_PERF 0 + +/* Major version of the LLVM API */ +#define LLVM_VERSION_MAJOR 19 + +/* Minor version of the LLVM API */ +#define LLVM_VERSION_MINOR 1 + +/* Patch version of the LLVM API */ - #define LLVM_VERSION_PATCH 2 ++#define LLVM_VERSION_PATCH 3 + +/* LLVM version string */ - #define LLVM_VERSION_STRING "19.1.2" ++#define LLVM_VERSION_STRING "19.1.3" + +/* Whether LLVM records statistics for use with GetStatistics(), + * PrintStatistics() or PrintStatisticsJSON() + */ +#define LLVM_FORCE_ENABLE_STATS 0 + +/* Define if we have z3 and want to build it */ +/* #undef LLVM_WITH_Z3 */ + +/* Define if we have curl and want to use it */ +/* #undef LLVM_ENABLE_CURL */ + +/* Define if we have cpp-httplib and want to use it */ +/* #undef LLVM_ENABLE_HTTPLIB */ + +/* Define if zlib compression is available */ +#define LLVM_ENABLE_ZLIB 1 + +/* Define if zstd compression is available */ +#define LLVM_ENABLE_ZSTD 1 + +/* Define if LLVM is using tflite */ +/* #undef LLVM_HAVE_TFLITE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYSEXITS_H 1 + +/* Define if building libLLVM shared library */ +/* #undef LLVM_BUILD_LLVM_DYLIB */ + +/* Define if building LLVM with BUILD_SHARED_LIBS */ +/* #undef LLVM_BUILD_SHARED_LIBS */ + +/* Define if building LLVM with LLVM_FORCE_USE_OLD_TOOLCHAIN_LIBS */ +/* #undef LLVM_FORCE_USE_OLD_TOOLCHAIN */ + +/* Define if llvm_unreachable should be optimized with undefined behavior + * in non assert builds */ +#define LLVM_UNREACHABLE_OPTIMIZE 1 + +/* Define to 1 if you have the DIA SDK installed, and to 0 if you don't. */ +#define LLVM_ENABLE_DIA_SDK 0 + +/* Define if plugins enabled */ +/* #undef LLVM_ENABLE_PLUGINS */ + +/* Define if logf128 is available */ +/* #undef LLVM_HAS_LOGF128 */ + +#endif diff --cc lib/clang/include/llvm/Support/VCSRevision.h index a9cdf75b6b13,000000000000..361bd66edf2f mode 100644,000000..100644 --- a/lib/clang/include/llvm/Support/VCSRevision.h +++ b/lib/clang/include/llvm/Support/VCSRevision.h @@@ -1,2 -1,0 +1,2 @@@ - #define LLVM_REVISION "llvmorg-19.1.2-0-g7ba7d8e2f7b6" ++#define LLVM_REVISION "llvmorg-19.1.3-0-gab51eccf88f5" +#define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git" diff --cc lib/libc++/__assertion_handler index 3b6d6b2cca53,000000000000..e12ccccdaff3 mode 100644,000000..100644 --- a/lib/libc++/__assertion_handler +++ b/lib/libc++/__assertion_handler @@@ -1,40 -1,0 +1,41 @@@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___ASSERTION_HANDLER +#define _LIBCPP___ASSERTION_HANDLER + +#include <__config> +#include <__verbose_abort> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +#endif + +#if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG + +# define _LIBCPP_ASSERTION_HANDLER(message) _LIBCPP_VERBOSE_ABORT("%s", message) + +#else + +# if __has_builtin(__builtin_verbose_trap) +// AppleClang shipped a slightly different version of __builtin_verbose_trap from the upstream +// version before upstream Clang actually got the builtin. - # if defined(_LIBCPP_APPLE_CLANG_VER) && _LIBCPP_APPLE_CLANG_VER < 17000 ++// TODO: Remove once AppleClang supports the two-arguments version of the builtin. ++# if defined(_LIBCPP_APPLE_CLANG_VER) && _LIBCPP_APPLE_CLANG_VER < 1700 +# define _LIBCPP_ASSERTION_HANDLER(message) __builtin_verbose_trap(message) +# else +# define _LIBCPP_ASSERTION_HANDLER(message) __builtin_verbose_trap("libc++", message) +# endif +# else +# define _LIBCPP_ASSERTION_HANDLER(message) ((void)message, __builtin_trap()) +# endif + +#endif // _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG + +#endif // _LIBCPP___ASSERTION_HANDLER diff --cc lib/libomp/kmp_config.h index 3a8f726353bf,000000000000..9caf4b8cdf44 mode 100644,000000..100644 --- a/lib/libomp/kmp_config.h +++ b/lib/libomp/kmp_config.h @@@ -1,196 -1,0 +1,196 @@@ +/* + * kmp_config.h -- Feature macros + */ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef KMP_CONFIG_H +#define KMP_CONFIG_H + +#include "kmp_platform.h" + +// cmakedefine01 MACRO will define MACRO as either 0 or 1 +// cmakedefine MACRO 1 will define MACRO as 1 or leave undefined +#define DEBUG_BUILD 0 +#define RELWITHDEBINFO_BUILD 0 +#define LIBOMP_USE_ITT_NOTIFY 1 +#define USE_ITT_NOTIFY LIBOMP_USE_ITT_NOTIFY +#if ! LIBOMP_USE_ITT_NOTIFY +# define INTEL_NO_ITTNOTIFY_API +#endif +#define LIBOMP_USE_VERSION_SYMBOLS 1 +#if LIBOMP_USE_VERSION_SYMBOLS +# define KMP_USE_VERSION_SYMBOLS +#endif +#define LIBOMP_HAVE_WEAK_ATTRIBUTE 1 +#define KMP_HAVE_WEAK_ATTRIBUTE LIBOMP_HAVE_WEAK_ATTRIBUTE +#define LIBOMP_HAVE_PSAPI 0 +#define KMP_HAVE_PSAPI LIBOMP_HAVE_PSAPI +#define LIBOMP_STATS 0 +#define KMP_STATS_ENABLED LIBOMP_STATS +#define LIBOMP_HAVE_X86INTRIN_H 0 +#define KMP_HAVE_X86INTRIN_H LIBOMP_HAVE_X86INTRIN_H +#define LIBOMP_HAVE___BUILTIN_READCYCLECOUNTER 0 +#define KMP_HAVE___BUILTIN_READCYCLECOUNTER LIBOMP_HAVE___BUILTIN_READCYCLECOUNTER +#define LIBOMP_HAVE___RDTSC 0 +#define KMP_HAVE___RDTSC LIBOMP_HAVE___RDTSC +#define LIBOMP_USE_DEBUGGER 0 +#define USE_DEBUGGER LIBOMP_USE_DEBUGGER +#define LIBOMP_OMPT_DEBUG 0 +#define OMPT_DEBUG LIBOMP_OMPT_DEBUG +#define LIBOMP_OMPT_SUPPORT 1 +#define OMPT_SUPPORT LIBOMP_OMPT_SUPPORT +#define LIBOMP_OMPD_SUPPORT 0 +#define OMPD_SUPPORT LIBOMP_OMPD_SUPPORT +#define LIBOMP_OMPX_TASKGRAPH 0 +#define OMPX_TASKGRAPH LIBOMP_OMPX_TASKGRAPH +#define LIBOMP_PROFILING_SUPPORT 0 +#define OMP_PROFILING_SUPPORT LIBOMP_PROFILING_SUPPORT +#define LIBOMP_OMPT_OPTIONAL 1 +#define OMPT_OPTIONAL LIBOMP_OMPT_OPTIONAL +#if KMP_ARCH_X86 || KMP_ARCH_X86_64 // FreeBSD customization { +#define LIBOMP_USE_ADAPTIVE_LOCKS 1 +#else +#define LIBOMP_USE_ADAPTIVE_LOCKS 0 +#endif // } FreeBSD customization +#define KMP_USE_ADAPTIVE_LOCKS LIBOMP_USE_ADAPTIVE_LOCKS +#define KMP_DEBUG_ADAPTIVE_LOCKS 0 +#define LIBOMP_USE_INTERNODE_ALIGNMENT 0 +#define KMP_USE_INTERNODE_ALIGNMENT LIBOMP_USE_INTERNODE_ALIGNMENT +#define LIBOMP_ENABLE_ASSERTIONS 1 +#define KMP_USE_ASSERT LIBOMP_ENABLE_ASSERTIONS +#define LIBOMP_USE_HIER_SCHED 0 +#define KMP_USE_HIER_SCHED LIBOMP_USE_HIER_SCHED +#define STUBS_LIBRARY 0 +#define LIBOMP_USE_HWLOC 0 +#define KMP_USE_HWLOC LIBOMP_USE_HWLOC +#define LIBOMP_ENABLE_SHARED 1 +#define KMP_DYNAMIC_LIB LIBOMP_ENABLE_SHARED +#if KMP_ARCH_X86 // FreeBSD customization { +#define KMP_ARCH_STR "IA-32" +#elif KMP_ARCH_X86_64 +#define KMP_ARCH_STR "Intel(R) 64" +#elif KMP_ARCH_AARCH64 +#define KMP_ARCH_STR "AARCH64" +#elif KMP_ARCH_PPC64 +#define KMP_ARCH_STR "PPC64BE" +#elif KMP_ARCH_MIPS +#define KMP_ARCH_STR "MIPS" +#elif KMP_ARCH_MIPS64 +#define KMP_ARCH_STR "MIPS64" +#elif KMP_ARCH_RISCV64 +#define KMP_ARCH_STR "RISCV64" +#else +#error Unknown KMP_ARCH value +#endif // } FreeBSD customization +#define KMP_LIBRARY_FILE "libomp.so" +#define KMP_VERSION_MAJOR 5 +#define KMP_VERSION_MINOR 0 +#define MSVC 0 +#define KMP_MSVC_COMPAT MSVC +#if KMP_ARCH_X86 || KMP_ARCH_X86_64 // FreeBSD customization { +#define LIBOMP_HAVE_WAITPKG_INTRINSICS 1 +#else +#define LIBOMP_HAVE_WAITPKG_INTRINSICS 0 +#endif // } FreeBSD customization +#define KMP_HAVE_WAITPKG_INTRINSICS LIBOMP_HAVE_WAITPKG_INTRINSICS +#if KMP_ARCH_X86 || KMP_ARCH_X86_64 // FreeBSD customization { +#define LIBOMP_HAVE_RTM_INTRINSICS 1 +#else +#define LIBOMP_HAVE_RTM_INTRINSICS 0 +#endif // } FreeBSD customization +#define KMP_HAVE_RTM_INTRINSICS LIBOMP_HAVE_RTM_INTRINSICS +#if KMP_ARCH_X86 || KMP_ARCH_X86_64 // FreeBSD customization { +#define LIBOMP_HAVE_IMMINTRIN_H 1 +#else +#define LIBOMP_HAVE_IMMINTRIN_H 0 +#endif // } FreeBSD customization +#define KMP_HAVE_IMMINTRIN_H LIBOMP_HAVE_IMMINTRIN_H +#define LIBOMP_HAVE_INTRIN_H 0 +#define KMP_HAVE_INTRIN_H LIBOMP_HAVE_INTRIN_H +#if KMP_ARCH_X86 || KMP_ARCH_X86_64 // FreeBSD customization { +#define LIBOMP_HAVE_ATTRIBUTE_WAITPKG 1 +#else +#define LIBOMP_HAVE_ATTRIBUTE_WAITPKG 0 +#endif // } FreeBSD customization +#define KMP_HAVE_ATTRIBUTE_WAITPKG LIBOMP_HAVE_ATTRIBUTE_WAITPKG +#if KMP_ARCH_X86 || KMP_ARCH_X86_64 // FreeBSD customization { +#define LIBOMP_HAVE_ATTRIBUTE_RTM 1 +#else +#define LIBOMP_HAVE_ATTRIBUTE_RTM 0 +#endif // } FreeBSD customization +#define KMP_HAVE_ATTRIBUTE_RTM LIBOMP_HAVE_ATTRIBUTE_RTM +#define LIBOMP_ARCH_AARCH64_A64FX 0 +#define KMP_ARCH_AARCH64_A64FX LIBOMP_ARCH_AARCH64_A64FX +#if KMP_ARCH_X86 || KMP_ARCH_X86_64 // FreeBSD customization { +#define LIBOMP_HAVE_XMMINTRIN_H 1 +#else +#define LIBOMP_HAVE_XMMINTRIN_H 0 +#endif // } FreeBSD customization +#define KMP_HAVE_XMMINTRIN_H LIBOMP_HAVE_XMMINTRIN_H +#if KMP_ARCH_X86 || KMP_ARCH_X86_64 // FreeBSD customization { +#define LIBOMP_HAVE__MM_MALLOC 1 +#else +#define LIBOMP_HAVE__MM_MALLOC 0 +#endif // } FreeBSD customization +#define KMP_HAVE__MM_MALLOC LIBOMP_HAVE__MM_MALLOC +#define LIBOMP_HAVE_ALIGNED_ALLOC 1 +#define KMP_HAVE_ALIGNED_ALLOC LIBOMP_HAVE_ALIGNED_ALLOC +#define LIBOMP_HAVE_POSIX_MEMALIGN 1 +#define KMP_HAVE_POSIX_MEMALIGN LIBOMP_HAVE_POSIX_MEMALIGN +#define LIBOMP_HAVE__ALIGNED_MALLOC 0 +#define KMP_HAVE__ALIGNED_MALLOC LIBOMP_HAVE__ALIGNED_MALLOC +#define OPENMP_ENABLE_LIBOMPTARGET 0 +#define ENABLE_LIBOMPTARGET OPENMP_ENABLE_LIBOMPTARGET + +// Configured cache line based on architecture - #if KMP_ARCH_PPC64 ++#if KMP_ARCH_PPC64 || KMP_ARCH_PPC +# define CACHE_LINE 128 +#elif KMP_ARCH_AARCH64_A64FX +# define CACHE_LINE 256 +#elif KMP_ARCH_S390X +# define CACHE_LINE 256 +#else +# define CACHE_LINE 64 +#endif + +#if ! KMP_32_BIT_ARCH +# define BUILD_I8 1 +#endif + +#define KMP_NESTED_HOT_TEAMS 1 +#define KMP_ADJUST_BLOCKTIME 1 +#define BUILD_PARALLEL_ORDERED 1 +#define KMP_ASM_INTRINS 1 +#define USE_ITT_BUILD LIBOMP_USE_ITT_NOTIFY +#define INTEL_ITTNOTIFY_PREFIX __kmp_itt_ +#if ! KMP_MIC +# define USE_LOAD_BALANCE 1 +#endif +#if ! (KMP_OS_WINDOWS || KMP_OS_DARWIN) +# define KMP_TDATA_GTID 1 +#endif +#if STUBS_LIBRARY +# define KMP_STUB 1 +#endif +#if DEBUG_BUILD || RELWITHDEBINFO_BUILD +# define KMP_DEBUG 1 +#endif + *** 13 LINES SKIPPED *** From nobody Fri Nov 8 18:13:17 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XlRrY5MNCz5cbLy; Fri, 08 Nov 2024 18:13: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XlRrY4n3gz42rJ; Fri, 8 Nov 2024 18:13:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731089597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tjpE0V/uobuYkqmHurwPEK47VscKo/M3YiYbrKvfCmA=; b=e3MffsDIqnIGtblxU61C+YjcSZqsO/tFSNSxYqUzfY/q+WfO9rAn5R8tb7JBPwJ/KiT9jT W9r0bv6DMad2dyvbL4occHm17Z+ADdWxLv0Ss0eWjCkyuIJsUtCPvJ31srqC9mva5U/NBc RVepjp9SCqu8xn/lGzlpo3h+pW2SjaLHk+NWAuaARIgThQ7auHTMm6D2fhmX5emlNZPCjI y8snIbM+J82pw8gmSAPCMt+0v42/MYqSE3EzDfUXFnNMfZhkaZhqjjc+fYHaJ/e0YkbfQ3 uJTHfdnmtqewkrwaF0zF2qO82Sij6kxm72xrF3vfF+ueixWbxJ7HebHHLUuSKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731089597; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tjpE0V/uobuYkqmHurwPEK47VscKo/M3YiYbrKvfCmA=; b=HNMKtUBJczv4AXhxlJpJopVEtxDt9A3WY/cDWOb2qqGFm6hZjvORe5Z11iWWwm95itsvVz 7lOtlkRhTiveGIb+GKgAZ//gZswhzzQUWY2RmwUEtH44IwyeVXpFMytHZl/tSoWkpO8TjE 11CU2T7ACalifry0P/BlEdunQ0PHv6I3Tn9nvBuE827KJwJ1LE6vB7em+RhM9phQ4Ntqx+ At4trUojcaAIBuFOZuKMoRbQsTr3GvXM5svtDt3VyU9BsSEnJmHe2WiXKV+pO/WW4GQB6H bb89zcpU0s/GgE8vu5PL7U0+Tx2sS0RyDFaXbfAy9mIB6a+c5KiZyXyiS9qX9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731089597; a=rsa-sha256; cv=none; b=aWD7DX4aejyZS8MMaRaGdmkFvEgwc6RI21QcbJYU6kiIxyDxkO1RAtE5NozWYM5heDSo12 y/t9G6fITc7NisyeER+iQUzxCFeEMm2Ea/XS9dROXPQZyhIKJ9KN39BloDHTPtrJvdLyaY 3Jb9WTnJsi6ZrqtzqmmdGJKoaPNMppKn0kV0dcXHoC6ijQwbGucRE/Og5+OViPFMKkRexa 19P+1//AANG2tz5ZyBoq3btKLMavUV0Ipbz/GViBPRCJv2JtXfNXMNRXyk7UWQKInB3LqU vtNDGbu+belWlAhnUMBV2/9wUdpugW7Tokx8UZj7msijGwE2IDyFEAl/Sie2Qg== 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 4XlRrY4HlMzgYF; Fri, 8 Nov 2024 18:13:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A8IDH6c033743; Fri, 8 Nov 2024 18:13:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A8IDHmi033740; Fri, 8 Nov 2024 18:13:17 GMT (envelope-from git) Date: Fri, 8 Nov 2024 18:13:17 GMT Message-Id: <202411081813.4A8IDHmi033740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 52f8e99e7e5e - main - iwlwifi: script to extract firmware details List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 52f8e99e7e5e6fab52b3fff535d62b873f8c02dd Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=52f8e99e7e5e6fab52b3fff535d62b873f8c02dd commit 52f8e99e7e5e6fab52b3fff535d62b873f8c02dd Author: Bjoern A. Zeeb AuthorDate: 2024-11-08 18:09:37 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-11-08 18:09:37 +0000 iwlwifi: script to extract firmware details When having to find a firmware image with a lower version number we must only break the inner but not also the outer loop so we keep looking at any possibly remaining firmware details. While here also try to find a version from max..1 and not from 1..max. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/contrib/dev/iwlwifi/zzz_fw_ports_fwget.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/contrib/dev/iwlwifi/zzz_fw_ports_fwget.sh b/sys/contrib/dev/iwlwifi/zzz_fw_ports_fwget.sh index 60c75c00cbc7..6b6798aae49e 100644 --- a/sys/contrib/dev/iwlwifi/zzz_fw_ports_fwget.sh +++ b/sys/contrib/dev/iwlwifi/zzz_fw_ports_fwget.sh @@ -155,11 +155,11 @@ list_fw() vn=$(echo ${fx} | awk '{ gsub(".ucode$", ""); gsub("^.*-", ""); print; }') #echo "BN ${bn} VN ${vn}" # Single digits are not zero-padded so just ${i} will be fine. - for i in `jot ${vn} 1`; do + for i in `jot ${vn} ${vn} 1`; do xn="${bn}-${i}.ucode" if test -e ${LFWDIR}/${xn}; then lx="${lx} ${xn}" - break 2; + break fi done ;; From nobody Fri Nov 8 18:15:56 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XlRvc58Vdz5cbpt; Fri, 08 Nov 2024 18:15: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XlRvc4fQNz42vZ; Fri, 8 Nov 2024 18:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731089756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Y4YCb2PHeAeb32z/URzlu24OynwbRkNqfZQb+WUpXo=; b=xb1Y1rL/iyJV+zXSpitfaOtAFTJ2Rz87Uhmt543eCgvOWscoeoo51N+iRkckW32BKKXtSB E8YO4GYXU3hJP966SGmkRQM2ROVRca8xRDbjd8KzUtba96W8L6QadKZJvXtHmOazj3UIDm n6tE3J+IDFEZRf9EQSHeLEci/ZAMDkXo398q4fJtpDvoSa0SUrc5MNkyJJMUqm48fcsHTb Q+UQ5visX60t6kSoxoZM+4g2gFZBt+rNJxexFhaQSpglzrTaTptrM7bFl7S8gkEwlyiFg4 eKnbv7q4DY257mEsMRPNTnJKVDUaSHJoFb65xvYtFLMzt1oWVIoi/XQ/2QSVbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731089756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Y4YCb2PHeAeb32z/URzlu24OynwbRkNqfZQb+WUpXo=; b=uje1el5L6jIygO+H0icwbtMVBLb/fHZAj5YYfxf0ylK4ikG6jThUqDKiuOGPCGVptfKRP5 huTuiH1ouo0P1d0ouXPa5othMaRN/qDmKsFnYVdmYqg57BoDYZVqff+GChsiVVbbx/PXMu M3flPXaUWJ521Q9z1Vicv9V123egse+IivMl/7WjpkgAF3Ka7N3aWTroNH23OcuVCO5cey okjf0waV8cUOKA/C5l8jYmeB1+XRVjFYTVmadkU9zQSRkjNddgZg9Js5KOkCULDnz+ICzo RBu2D269OxQBSlmQgNwt5MStqyweBSkGa+TVxractR7e8yeYYnZacuoh+kCzGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731089756; a=rsa-sha256; cv=none; b=CCAZ76zWGHUBLaT7qPFkkXvdSnZc47tk2tFjTohMAQmGFopKOWEu4fKkXbWdhx4a4T0Dbi ult8e7SY79MD9DKJtgB3kaow8AG/0FiSJxMVIE6moRM7wk8HFaETApg+Zk+jCjsadHKKr/ 1jsGUyJnTpswCcN31v9PSVpHI+uX2toPSKbPSRK3dzrXy3eqSfHwQXAwzgSWbsTN1gQGRV lfVjTFrWjK+CuKd3NglgiNv3CRPgCoIzfYdklPZBsNNnAKYYjGHsLvX3VrnabWlEwJIR2u /dMTd4CMXbUCGBRLTFfN+FlAd7cLJPnMoj9gMAOZWT5hEWQoa/nyFMobb1EoSg== 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 4XlRvc4BMHzgNR; Fri, 8 Nov 2024 18:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A8IFunG034593; Fri, 8 Nov 2024 18:15:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A8IFubf034590; Fri, 8 Nov 2024 18:15:56 GMT (envelope-from git) Date: Fri, 8 Nov 2024 18:15:56 GMT Message-Id: <202411081815.4A8IFubf034590@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 1eb3f15c149b - main - fwget: add -q for quiet output List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1eb3f15c149b9a2e5b6f5e10aed454fc85945bbd Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1eb3f15c149b9a2e5b6f5e10aed454fc85945bbd commit 1eb3f15c149b9a2e5b6f5e10aed454fc85945bbd Author: Bjoern A. Zeeb AuthorDate: 2024-11-04 23:59:58 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-11-08 18:13:54 +0000 fwget: add -q for quiet output Introduce -q to quieten other output (unless -v is also given). pkg-install(8) currently has no option to allow skipping unavail packages but it will just fail. We would realy want to try to install as much firmware found as possible from the installer. Work around this by doing one firmware package at a time. For that it is highly helpful to be able to query (or possibly re-query) all outstanding fimrware packages. -q together with -n only shows each package to be installed one by line. Once https://github.com/freebsd/pkg/issues/2195 will be implemented we could undo this part of the change and future changes to the installer and use the new option for pkg-install(8) there. While here switch to getopts so -qn works and not just -q -n. Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D47445 --- usr.sbin/fwget/fwget.sh | 48 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/usr.sbin/fwget/fwget.sh b/usr.sbin/fwget/fwget.sh old mode 100644 new mode 100755 index 154fb7dc92e1..3e2181e53b73 --- a/usr.sbin/fwget/fwget.sh +++ b/usr.sbin/fwget/fwget.sh @@ -38,7 +38,8 @@ Supported subsystems pci Options: - -n -- Do not install package, only print the results + -n -- Do not install packages, only print the results + -q -- Quiet mode. If used with -n only prints a package a line -v -- More verbose EOF exit 1 @@ -75,22 +76,27 @@ addpkg() } DRY_RUN=n +QUIET=n VERBOSE=n -while [ $# -gt 0 ]; do - case $1 in - -n) - DRY_RUN=y - ;; - -v) - VERBOSE=y - ;; - *) - subsystems="${subsystems} $1" - ;; +while getopts ":nqv" _arg; do + case ${_arg} in + n) + DRY_RUN=y + ;; + q) + QUIET=y + ;; + v) + VERBOSE=y + ;; + ?) + usage + ;; esac - shift done +shift $(($OPTIND - 1)) +subsystems="$@" # Default searching PCI subsystem if [ -z "${subsystems}" ]; then @@ -112,13 +118,25 @@ done case "${packages}" in ""|^[[:space:]]*$) - echo "No firmware packages to install." + if [ "${QUIET}" != "y" ]; then + echo "No firmware packages to install." + fi exit 0 ;; esac -echo "Needed firmware packages: '${packages}'" +if [ "${QUIET}" != "y" ]; then + echo "Needed firmware packages: '${packages}'" +fi if [ "${DRY_RUN}" = "y" ]; then + if [ "${QUIET}" = "y" ]; then + for pkg in ${packages}; do + case "${pkg}" in + ""|^[[:space:]]*$) continue ;; + esac + echo "${pkg}" + done + fi exit 0 fi From nobody Fri Nov 8 18:17:00 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XlRwz26PKz5cc1l; Fri, 08 Nov 2024 18:17:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XlRwz18Ldz43rj; Fri, 8 Nov 2024 18:17:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731089827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Unv8iPqV46+xvqBeGGw6Efsto4OCA+AXdes1VsMvjE4=; b=V5C+0X1KFFhweOhoFpNLp2bTol3kF3UJf3S9NG0i9k0ThNv7NB1r2CP2auk13K2MFjkZ0O BUQWphr6qUTE8UAw8wA3L0HUf1qnTK+5yFkrgu/Gnw7/ix86FmMgyZYNU0x+xiCWUZue26 8bos0CsDw/9M5k/mvLI2V+VukVinVJbxJ8HLwYBhixtFsFUX45gMesB4vfrj2DdBb2pBIu Y7tMow7t0bGberBC2sBv3AqsXtYMJIEiJY/wkhAw1kGmZB6K8dJ5HrjZxzLFxrKruEUg9p XnGgC7vAe9o7PVzZKyc+4EspzuX+Bs8xIqwG0QygJxbOKjkyrfQ6/3JOZ+UiBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731089827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Unv8iPqV46+xvqBeGGw6Efsto4OCA+AXdes1VsMvjE4=; b=fa8Jj7TZo7t3JcSxKuY2HkwXGIT5tVoGGa2u3YJcKDkB/cLonIuGfkgNcVXvLTY0zAE4HG YTFUPtE+rft0MW3fy1IAdolTo3qPaoOIVpo3WEPUCmKshoTHWODQHFGxQFEMqbgQIE/oMp HOjg3Aj8JBi2uzxBWD9Ec+u+jCzuJhF51ZJ7PkZ/8qV7BsYs72W6dvzHKt2uN6qXimlHBR 50otQUlWK58MLH6ek4iy/BXvMk1HXIJMXDwwI4Sk3saiEhBAfGANUjlz1YtmT37k8ZMyjr C4yr9NDcQpAPFD6+HFdMZKj2AyU6DLA94AlYtM9Yc5v4PgbjwEIZRGnvlMUdQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731089827; a=rsa-sha256; cv=none; b=yGlN5ki7cm4sSnByhiLxR6GeEw2lXkin3GiTI1kJ0Qdyv+LYm8z8yHtXiU7ICiAOWcZ5KE MS06oZyujz4PqdzZ/VXvLyHQz76MWe4ZD/yhWhXi8LnzkzeAW1AV2PI1jv1z/1xOwL4W8L b3TJKvAsWIMQBfoMJMvWZvQJhbUEPbCEKxTDdwWRW4NQYLBg3xwnL8QPfxcQ8HNVF7YISe R7/AXXrVDjRartDKDMRE/QDf3dSQYXm4u6G/nJErzs06Fw7pa1R78wxYsrluZ4vcyt+0xV CelYD9Yk18hjyR/gwK7gJGw6G5hv00v7H9i/Iv7592E3ssAU8+OLzJV7QHn/5Q== Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (P-256) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E6" (verified OK)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XlRwy24k6z10w7; Fri, 8 Nov 2024 18:17:06 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id 2CCC9A64805; Fri, 08 Nov 2024 18:16:57 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 7767A2D029D9; Fri, 8 Nov 2024 18:17:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id 7biDhOWLGx4D; Fri, 8 Nov 2024 18:17:01 +0000 (UTC) Received: from strong-iwl0.sbone.de (strong-iwl0.sbone.de [IPv6:fde9:577b:c1a9:4902:b66b:fcff:fef3:e3d2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id A9C442D029D8; Fri, 8 Nov 2024 18:17:01 +0000 (UTC) Date: Fri, 8 Nov 2024 18:17:00 +0000 (UTC) From: "Bjoern A. Zeeb" To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 1eb3f15c149b - main - fwget: add -q for quiet output In-Reply-To: <202411081815.4A8IFubf034590@gitrepo.freebsd.org> Message-ID: References: <202411081815.4A8IFubf034590@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Fri, 8 Nov 2024, Bjoern A. Zeeb wrote: > The branch main has been updated by bz: > > URL: https://cgit.FreeBSD.org/src/commit/?id=1eb3f15c149b9a2e5b6f5e10aed454fc85945bbd > > commit 1eb3f15c149b9a2e5b6f5e10aed454fc85945bbd > Author: Bjoern A. Zeeb > AuthorDate: 2024-11-04 23:59:58 +0000 > Commit: Bjoern A. Zeeb > CommitDate: 2024-11-08 18:13:54 +0000 > > fwget: add -q for quiet output > > Introduce -q to quieten other output (unless -v is also given). > > pkg-install(8) currently has no option to allow skipping unavail > packages but it will just fail. > We would realy want to try to install as much firmware found as > possible from the installer. > Work around this by doing one firmware package at a time. > For that it is highly helpful to be able to query (or possibly re-query) > all outstanding fimrware packages. > -q together with -n only shows each package to be installed one by line. > > Once https://github.com/freebsd/pkg/issues/2195 will be implemented > we could undo this part of the change and future changes to the installer > and use the new option for pkg-install(8) there. > > While here switch to getopts so -qn works and not just -q -n. > > Sponsored by: The FreeBSD Foundation > MFC after: 3 days Reviewed by: manu > Differential Revision: https://reviews.freebsd.org/D47445 -- Bjoern A. Zeeb r15:7 From nobody Fri Nov 8 22:12:48 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XlY8w6nlVz5csRg; Fri, 08 Nov 2024 22:12: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XlY8w6Gzzz4SGX; Fri, 8 Nov 2024 22:12:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731103968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s63tWWu50uGuamoX2bcOLhZVnaySwXXGL1SEDJDepx8=; b=Bq61UQvvQ1+JjqRZ1ofG73cPtcXR0KmgIZbCCSe0rix/RvOWnLcjnCloFUCkkqoDv718Mh hqemkCFMuREv4He+OLQ3wGQqqPE/fU6CzoPBfsL0c53fWqKZOPZTVFDBjhBOhZ+nipfzrm 9cUYlF/BEXg7DG1GVB0C35wbCRanPEZl9S1b9mwS41PuUA3YfGxbQJlEcUyg+1C/OKIoFQ nIq172rNruod6Y1T+axAZ/y2RN4+AHmFIAem1Jydr03ecnVbO78yPz+z4I9IH24C3ofnvs 1j10JBc6QF8kVLhikpkW+TtT+ZpPKIanmk221nTCzCYaHCP4ayG5SfPteWYneg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731103968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s63tWWu50uGuamoX2bcOLhZVnaySwXXGL1SEDJDepx8=; b=esx4B/JFYkl+pJn9d4IfZ6nlMKwldSr9Jme35YpEgNYNoKOEJWCLmH5g0a8EaTBXYLMQ04 nbhYwo5WtJAJL1it8n0yo3mtJE0uGequRtzTJ7vlnCI5kE8zbtNVeWPb2hEjL2dwtsrVln xqN5qj9Dk0uIK42CJiOlx86sxdVZJrHLAn5LM05LCbAO1ZSwsGuebFo7+BvZC9yP1iIjIi 4PWFNvSebAyQBAU6rRa6C8MBThq+hpRjqCjr28b2WY6eNtmUpRNZhMfWvtI1iv/ViKC335 656PEKuVqdILv3Upt4d1EpkqKrBz5KiYVopzMLlYiy72A5H1OCEBqhHVtmfodw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731103968; a=rsa-sha256; cv=none; b=fqPFVO2GHKk396TqwdYmeEX4wz+ZSGtKZyVS6rSDEx2x98sURSX++GsTXpKUhDrQEWlQFn gOClY4ch6kp/031kZ6q5i21FrNOmgd40IjqbMPFJd01oj9kdsh0JKnVOb95hZfjWBkZBwa OLkwFrrIaUA4q45ErvpdVPEBJNmKIjaPW6l7WYTWbh+aFHXDbQwvwPMZ/D1JHMs90SDLfP 8TAacL66ZfjM2mMKPQ+9Tt9AvC7v8e5IDzosdyfihhdN/bFuw7H8AxzsTTLl7CRzMgK+Up JzdeYd9A/dWcySnN7zi8ysPsb/oNjYOl9Tc2eRBlYtYKg5UCXdfOxjTYDnYbww== 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 4XlY8w5tS6znP1; Fri, 8 Nov 2024 22:12:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A8MCmGD080910; Fri, 8 Nov 2024 22:12:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A8MCmsw080907; Fri, 8 Nov 2024 22:12:48 GMT (envelope-from git) Date: Fri, 8 Nov 2024 22:12:48 GMT Message-Id: <202411082212.4A8MCmsw080907@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: fd67ff5c7a6c - main - Use the correct idle routine on recent AMD EPYC servers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd67ff5c7a6cd9a2e82e6a02ea249cec76a4c030 Auto-Submitted: auto-generated The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=fd67ff5c7a6cd9a2e82e6a02ea249cec76a4c030 commit fd67ff5c7a6cd9a2e82e6a02ea249cec76a4c030 Author: Andrew Gallatin AuthorDate: 2024-11-08 21:37:32 +0000 Commit: Andrew Gallatin CommitDate: 2024-11-08 22:10:44 +0000 Use the correct idle routine on recent AMD EPYC servers We have been incorrectly choosing the "hlt" idle method on modern AMD EPYC servers for C1 idle. This is because AMD also uses the Functional Fixed Hardware interface. Due to not parsing the table properly for AMD, and due to a weird quirk where the mwait latency for C1 is mis-interpreted as the latency for hlt, we wind up choosing hlt for c1, which has a far higher wake up latency (similar to IO) of roughly 400us on my test system (AMD 7502P). This patch fixes this by: - Looking for AMD in addition to Intel in the FFH (Note the vendor id of "2" for AMD is not publically documented, but AMD has confirmed they are using "2" and has promised to document it.) - Using mwait on AMD when specified in the table, and when CPUid says its supported - Fixing a weird issue where we copy the contents of cx_ptr for C1 and when moving to C2, we do not reinitialize cx_ptr. This leads to mwait being selected, and ignoring the specified i/o halt method unless we clear mwait before looking at the table for C2. Differential Revision: https://reviews.freebsd.org/D47444 Reviewed by: dab, kib, vangyzen Sponsored by: Netflix --- sys/dev/acpica/acpi_cpu.c | 9 +++++++-- sys/x86/include/x86_var.h | 1 + sys/x86/x86/identcpu.c | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c index 80855cf168e9..63e17de1ff28 100644 --- a/sys/dev/acpica/acpi_cpu.c +++ b/sys/dev/acpica/acpi_cpu.c @@ -131,6 +131,7 @@ struct acpi_cpu_device { #define PIIX4_PCNTRL_BST_EN (1<<10) #define CST_FFH_VENDOR_INTEL 1 +#define CST_FFH_VENDOR_AMD 2 #define CST_FFH_INTEL_CL_C1IO 1 #define CST_FFH_INTEL_CL_MWAIT 2 #define CST_FFH_MWAIT_HW_COORD 0x0001 @@ -855,7 +856,8 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *sc) acpi_cpu_cx_cst_free_plvlx(sc->cpu_dev, cx_ptr); #if defined(__i386__) || defined(__amd64__) if (acpi_PkgFFH_IntelCpu(pkg, 0, &vendor, &class, &address, - &accsize) == 0 && vendor == CST_FFH_VENDOR_INTEL) { + &accsize) == 0 && + (vendor == CST_FFH_VENDOR_INTEL || vendor == CST_FFH_VENDOR_AMD)) { if (class == CST_FFH_INTEL_CL_C1IO) { /* C1 I/O then Halt */ cx_ptr->res_rid = sc->cpu_cx_count; @@ -872,7 +874,9 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *sc) "degrading to C1 Halt", (int)address); } } else if (class == CST_FFH_INTEL_CL_MWAIT) { - acpi_cpu_cx_cst_mwait(cx_ptr, address, accsize); + if (vendor == CST_FFH_VENDOR_INTEL || + (vendor == CST_FFH_VENDOR_AMD && cpu_mon_mwait_edx != 0)) + acpi_cpu_cx_cst_mwait(cx_ptr, address, accsize); } } #endif @@ -922,6 +926,7 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *sc) acpi_PkgGas(sc->cpu_dev, pkg, 0, &cx_ptr->res_type, &cx_ptr->res_rid, &cx_ptr->p_lvlx, RF_SHAREABLE); if (cx_ptr->p_lvlx) { + cx_ptr->do_mwait = false; ACPI_DEBUG_PRINT((ACPI_DB_INFO, "acpi_cpu%d: Got C%d - %d latency\n", device_get_unit(sc->cpu_dev), cx_ptr->type, diff --git a/sys/x86/include/x86_var.h b/sys/x86/include/x86_var.h index f19c557e270b..6609871bf89e 100644 --- a/sys/x86/include/x86_var.h +++ b/sys/x86/include/x86_var.h @@ -62,6 +62,7 @@ extern char cpu_vendor[]; extern char cpu_model[]; extern u_int cpu_vendor_id; extern u_int cpu_mon_mwait_flags; +extern u_int cpu_mon_mwait_edx; extern u_int cpu_mon_min_size; extern u_int cpu_mon_max_size; extern u_int cpu_maxphyaddr; diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index d3aec5b5e0c6..3f8f11fda011 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -117,6 +117,7 @@ u_int cpu_stdext_feature3; /* %edx */ uint64_t cpu_ia32_arch_caps; u_int cpu_max_ext_state_size; u_int cpu_mon_mwait_flags; /* MONITOR/MWAIT flags (CPUID.05H.ECX) */ +u_int cpu_mon_mwait_edx; /* MONITOR/MWAIT supported on AMD (CPUID.05H.EDX) */ u_int cpu_mon_min_size; /* MONITOR minimum range size, bytes */ u_int cpu_mon_max_size; /* MONITOR minimum range size, bytes */ u_int cpu_maxphyaddr; /* Max phys addr width in bits */ @@ -1634,6 +1635,7 @@ finishidentcpu(void) if (cpu_high >= 5 && (cpu_feature2 & CPUID2_MON) != 0) { do_cpuid(5, regs); cpu_mon_mwait_flags = regs[2]; + cpu_mon_mwait_edx = regs[3]; cpu_mon_min_size = regs[0] & CPUID5_MON_MIN_SIZE; cpu_mon_max_size = regs[1] & CPUID5_MON_MAX_SIZE; } From nobody Sat Nov 9 00:12:58 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xlbqb2WPGz5d1Jy; Sat, 09 Nov 2024 00:12: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xlbqb0jgBz4ZJc; Sat, 9 Nov 2024 00:12:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731111179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oL4c9zqUiharGLtO8GQo/PY0TSi3V+UvgKZcTOlcxQM=; b=NWAGzT2VHEUbBtKexbybLpS5pRAr6t3NqgOyvykAN5A/e1UKh5VyQlJjkfKjzF+R507c8z wl8HzmkOrGsKDcg7+Zw0FulW7gBPeylcU04j72Ih+7yy36LGvKWUpTjf1d2tmkHwVBRY+l 6YiXmLLoWeKen1i7GPL3Ekl2XKECiPIyQqIIYxqEgbey00jp2yC4lWTadSye1m9HqtYjMT LJHjmf6V5i5HNt/mruQLVRcXwTIasxXTjPOx0qkH43Y8hvuymMgs0AXQjEd4dO/gTfrgOS X7YuI0gu+woCyRjo6JezXJxkNviezw84eAQQROfoa7KRec0ntiDXZzERXn+/Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731111179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oL4c9zqUiharGLtO8GQo/PY0TSi3V+UvgKZcTOlcxQM=; b=XFUphcTYL+W+K8LAkUfdF8fFKChBB3+8eoR74PhFexWSztUdPoJfZuAkYXJ0rgMQUCZOdK RqQDTBf6Jldilg/XoSFqY/ZL/AF17+YdWLEvfBPYZG63tWMRcDS0GwK15EB/w7WM9v2XZB Qy+VMnpKI5Oxz1A2HYbJxxTj3lDfpBEKF3OwEWxoRfDMxtZm0aV4Gmb4oeb97b6OnwK/UF vKDj3KdjKEi498Tc+bmwg21NW5D497YtLAR/Iu3MuzMeq4Oi8wjBlZ3U1WA+zjAztAmI8P SxehTMrSUej0wIjjLuBzLA39i3yx6ydLy2h3qyYLPewcArWT6CfQx+I68GHX2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731111179; a=rsa-sha256; cv=none; b=V90FZXPxGznDCkHhL39xw7PEFqA7uyuL7pwBSdv7eCftSGYIwCERPBqSY2kg9WyVjvtnMk pv34QL+6pUD9Y/9I8HgQDlmQfQRhWxPsXh8vTEj7yt4lJPonDswkQZvo8zLbTW97BkECLS Dt2qoP86JcFhv50d1vHDi0V+fsuRIISOz6o7NFIMybYfFwjgpsiU63+X1/dC6e/SdjXGmy ARH950FIWpkLU8Pbgp6Vt2cll+G/Dxu0zGtASbWB2Z8AvmVrCyKGTTbs9qZvNBzM7cHGKg 2mjyYXmGyLQf/9aNkaDTHS15bfv9Dxo8JgV3KfB+fXNxcvWZNTfnSOljiZ3MrQ== 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 4Xlbqb0KQ2zrRf; Sat, 9 Nov 2024 00:12:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A90Cw0V003903; Sat, 9 Nov 2024 00:12:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A90CwwZ003900; Sat, 9 Nov 2024 00:12:58 GMT (envelope-from git) Date: Sat, 9 Nov 2024 00:12:58 GMT Message-Id: <202411090012.4A90CwwZ003900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: f239981ed58c - main - proc_rwmem check PRIV_PROC_MEM_WRITE when writing List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f239981ed58ca632d4dba39b2229c3152dd32a15 Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=f239981ed58ca632d4dba39b2229c3152dd32a15 commit f239981ed58ca632d4dba39b2229c3152dd32a15 Author: Simon J. Gerraty AuthorDate: 2024-11-09 00:11:12 +0000 Commit: Simon J. Gerraty CommitDate: 2024-11-09 00:11:33 +0000 proc_rwmem check PRIV_PROC_MEM_WRITE when writing This will fail when mac_veriexec is enforced. Move the check from procfs_doprocmem to proc_rwmem to ensure all cases are covered. Reviewed by: olce, markj Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D47484 --- sys/fs/procfs/procfs_mem.c | 2 -- sys/kern/sys_process.c | 6 ++++++ sys/sys/priv.h | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/fs/procfs/procfs_mem.c b/sys/fs/procfs/procfs_mem.c index 159b40785172..0020b8f8a8d8 100644 --- a/sys/fs/procfs/procfs_mem.c +++ b/sys/fs/procfs/procfs_mem.c @@ -62,8 +62,6 @@ procfs_doprocmem(PFS_FILL_ARGS) PROC_LOCK(p); error = p_candebug(td, p); - if (error == 0 && uio->uio_rw == UIO_WRITE) - error = priv_check(td, PRIV_PROC_MEM_WRITE); PROC_UNLOCK(p); if (error == 0) error = proc_rwmem(p, uio); diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index a3a7a22f4cd3..fe2e112dbcfa 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -361,6 +361,12 @@ proc_rwmem(struct proc *p, struct uio *uio) reqprot = writing ? VM_PROT_COPY | VM_PROT_READ : VM_PROT_READ; fault_flags = writing ? VM_FAULT_DIRTY : VM_FAULT_NORMAL; + if (writing) { + error = priv_check_cred(p->p_ucred, PRIV_PROC_MEM_WRITE); + if (error) + return (error); + } + /* * Only map in one page at a time. We don't have to, but it * makes things easier. This way is trivial - right? diff --git a/sys/sys/priv.h b/sys/sys/priv.h index 5e14fee2cce1..864fb5b9cdea 100644 --- a/sys/sys/priv.h +++ b/sys/sys/priv.h @@ -515,7 +515,7 @@ */ #define PRIV_KMEM_READ 680 /* Open mem/kmem for reading. */ #define PRIV_KMEM_WRITE 681 /* Open mem/kmem for writing. */ -#define PRIV_PROC_MEM_WRITE 682 /* Open /proc//mem for writing. */ +#define PRIV_PROC_MEM_WRITE 682 /* Writes via proc_rwmem */ /* * Kernel debugger privileges. From nobody Sat Nov 9 05:12:07 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XlkSl4Vctz5dKlg; Sat, 09 Nov 2024 05:12: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XlkSl3p6Cz4GxY; Sat, 9 Nov 2024 05:12:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731129127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xtJIhZX8YtLztye5mDagqeHKkzLkwfmLuDPyYwJTzIc=; b=QWYB0TVXXwtLyN6zQXRxDHG9BsJODFd5tRYA+ASgZRQNcdY60WTspPb6ewN2HWY7aTHp4y rs+0MMdJznNhxmV1IDEctap/8aBiFnZp7VP1s9Fe14V4rIp5yWoKDgKbpb8Q/VnellHgwX BdrHhZ3pmqlPh+daF8k8cqYmsRhH5m64coaVIO3fcN+Z5tSceKgRWUGo7C/wvh4fMAaE0e aI6fCIufJQMEpwRaMEeOclvQil9zvmQwiugUMUEMAjbh28f8FBCRVs2Ttgo3AtJ9JFhs/D NK1JtmwIGrQRJ73gJikanIeaznyA9qwpmyQz+sb8R9Uip5n7K1hk59mIWY8IKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731129127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xtJIhZX8YtLztye5mDagqeHKkzLkwfmLuDPyYwJTzIc=; b=YOYeSz3+jkL8SnENsDFAaaLBH2F/mUdKxiMKqkcGmZavmscjDtGZYJliPvzETY1ERTs3pN QgTuwJU8TmcVEYTLbg+bYcMXHjsze3NeynE9kve6An9dMStt9gOBmDsJIubYAjrXUYLkCb 3jvi4+SrTUsV+maemOZ5PuD++Q8VqPvQ/tuRLvamVkL49MnZuaPMGCQlt+ZMaZoIUiD+CW rSWeCtsv/czH6lAtmUBV6673d+kaH/agc9laQYr7le6vGtqx9eWbHrLu/0y5Gn2BpSduBN TcO0RchdxN6AE10eE8/DW9kB0Wn3a7GZxfV648/PjtV24joCLK70H7W5f2eakA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731129127; a=rsa-sha256; cv=none; b=QMUZGqLn9bg/espXnxwDG9mtwHiHI4rJ/z3VFAt/r1YEPfTQpBMWNuVq3FW8YVpk3PUj3O MLYZ9/e9fbywS25Mb61MlChYOLD3fAEtv2fY1s7xmyjDXHENntWj5w4ihl9aGM91nbuZrN 1Z9TcdNl2oDE0U+rSmIIC6TrjZaNbvTsiJ1X/3/WAC1TDT416EsxqeNcW7YDvxtCYFe6gB xiGJFGoO4kA3jqSZKMFVoxcEofUyJk2Rx8zdrOZOHU7v3UZ+aLzf2tpHrb0T3LyVszmmEg qOkslOO0SL2FwgpR3kIpBrwy2+1iew1LbtnFmk4hOoydsvVkBsNxE9e5/66PzQ== 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 4XlkSl3P8Tz11RR; Sat, 9 Nov 2024 05:12:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A95C7CG063415; Sat, 9 Nov 2024 05:12:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A95C7J2063412; Sat, 9 Nov 2024 05:12:07 GMT (envelope-from git) Date: Sat, 9 Nov 2024 05:12:07 GMT Message-Id: <202411090512.4A95C7J2063412@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 018cb11cb7d4 - main - iichid(4): Do not power down opened device in attach handler List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 018cb11cb7d412b031e1be681a6a19e734473f99 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=018cb11cb7d412b031e1be681a6a19e734473f99 commit 018cb11cb7d412b031e1be681a6a19e734473f99 Author: Vladimir Kondratyev AuthorDate: 2024-11-08 19:23:38 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-11-09 05:11:09 +0000 iichid(4): Do not power down opened device in attach handler Some iichid(4) child devices, currently hkbd(4) only, opens parent device in their attach handlers. That breaks internal iichid(4) state leading to rejecting any incoming data on software and hardware levels. Fix it with adding of extra state check in iichid(4) attach handler. Reported by: many Submitted by: trasz (initial version) PR: 280290 MFC after: 3 days --- sys/dev/iicbus/iichid.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c index fc9f5c2a68b3..86b02250d5d3 100644 --- a/sys/dev/iicbus/iichid.c +++ b/sys/dev/iicbus/iichid.c @@ -1205,8 +1205,12 @@ iichid_attach(device_t dev) iichid_detach(dev); } done: - (void)iichid_set_power(sc, I2C_HID_POWER_OFF); - sc->power_on = false; + iicbus_request_bus(device_get_parent(dev), dev, IIC_WAIT); + if (!sc->open) { + (void)iichid_set_power(sc, I2C_HID_POWER_OFF); + sc->power_on = false; + } + iicbus_release_bus(device_get_parent(dev), dev); return (error); } From nobody Sat Nov 9 05:12:08 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XlkSm68cVz5dKlh; Sat, 09 Nov 2024 05:12: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XlkSm4KGyz4Grx; Sat, 9 Nov 2024 05:12:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731129128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6YkuOJVrL41QIL32rtFpzYqQ4wIyBh3rZU9c8Zy6x1g=; b=IBV+F9Au12NDhWJQ3Dwg56re4/AEAKlQuZnEMhE1mSomMZqCDVHHKD4ojXMQRT0Au/qjV2 +SOvbsB7buupxoa6kJANfnIKnEGXD61YnSTVNnNzUphcJIFxH2+D0wwjlCcER5sL0xcC5E /H68QuUpFpCGXzCnmgcHHF5DNuQ2T7j01x4RpTbH+yzV7FAYT9xp5Ome1diPv8RzBxbit2 U7PaxatweMEcmLo4vPSKgp+4Q2PM4KqRuHp8V9RDeMzSw+QqRusiCsTyhK5ity7dKn92EI TPqEyIaIvYatiQpoNtt+r1svn99m6oFkewIcHV1cm9aLQjK1SDHQXKbtzJR1Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731129128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6YkuOJVrL41QIL32rtFpzYqQ4wIyBh3rZU9c8Zy6x1g=; b=HcjoCFp6fpfG2mcECl4+wcpt9PPsZMvkdN9Ye+xuGmemGHGIOiDCMdzijuGztEtJCX2YWm a2SAhH/axJ/D65p3HSViUCR3Xwp4FKjU6KFxY2nr7iNTdDsowcWhMjS+WLI7HTLuF5ny1R OuUDW8WDu6CUQNSn9+slfGK4mLVoJnKQSTdx/4Yuf7VDy2dM4u7GYywZISY/s/Kpl5dJ+5 iL/CI87YPN9uilC0Y+1i+8SYCCxJ7FayzYiOKXXndsnYE2qSt/2AKwG1XhqH1yP94YosWv BOqlIS6cmobrjNE9RzflG+2kQIIoeixJ1E9Mqxv8jTFEaFVZmj/5D/3dCZjJxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731129128; a=rsa-sha256; cv=none; b=dzYWwNrqvZdY2ScUqFLrjdzadT7OJLoZVqxTJGTS/qMSoWtFg7zXaXhTpHo45yVamW39Vs UZWZGB2InQG5tPH2Kx5Pb9q8b2nCDGthe3Oi/aUvw/nRUXm6QQdqXytqCzpzktxuFC+23w OKatUNQg4QS8nsV9c0nxlWstiJQaS2QybeSXbJwmSawVaivkIUMu9ugjf1oxSBkBmaWvni Z+mfq0Mlm6QfRpgmp29DdQp+Yu8IUNCQcBuhRVbVFP/wwnBxhXeVezEmd69mLmksuzbbYH KQG5tLWcnT/ZPSFZyikudC8a+7JSasW7hy6j/pfgErKQM3bxRzM/DZoZ2QMTyg== 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 4XlkSm3x1Xz11Fp; Sat, 9 Nov 2024 05:12:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A95C8nH063537; Sat, 9 Nov 2024 05:12:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A95C81K063534; Sat, 9 Nov 2024 05:12:08 GMT (envelope-from git) Date: Sat, 9 Nov 2024 05:12:08 GMT Message-Id: <202411090512.4A95C81K063534@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: bab5e3d46830 - main - ig4(4): Add Meteor Lake PCI IDs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: bab5e3d468305928e9e5cf1ca9efcee4c89f6a76 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=bab5e3d468305928e9e5cf1ca9efcee4c89f6a76 commit bab5e3d468305928e9e5cf1ca9efcee4c89f6a76 Author: Austin Shafer AuthorDate: 2024-11-09 05:05:34 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-11-09 05:11:09 +0000 ig4(4): Add Meteor Lake PCI IDs PR: 282389 MFC after: 3 days --- sys/dev/ichiic/ig4_pci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/ichiic/ig4_pci.c b/sys/dev/ichiic/ig4_pci.c index 138de77c35db..874d6a9abc55 100644 --- a/sys/dev/ichiic/ig4_pci.c +++ b/sys/dev/ichiic/ig4_pci.c @@ -172,6 +172,8 @@ static int ig4iic_pci_detach(device_t dev); #define PCI_CHIP_METEORLAKE_M_I2C_1 0x7e798086 #define PCI_CHIP_METEORLAKE_M_I2C_2 0x7e508086 #define PCI_CHIP_METEORLAKE_M_I2C_3 0x7e518086 +#define PCI_CHIP_METEORLAKE_M_I2C_4 0x7e7a8086 +#define PCI_CHIP_METEORLAKE_M_I2C_5 0x7e7b8086 struct ig4iic_pci_device { uint32_t devid; @@ -288,6 +290,8 @@ static struct ig4iic_pci_device ig4iic_pci_devices[] = { { PCI_CHIP_METEORLAKE_M_I2C_1, "Intel Meteor Lake-M I2C Controller-1", IG4_TIGERLAKE}, { PCI_CHIP_METEORLAKE_M_I2C_2, "Intel Meteor Lake-M I2C Controller-2", IG4_TIGERLAKE}, { PCI_CHIP_METEORLAKE_M_I2C_3, "Intel Meteor Lake-M I2C Controller-3", IG4_TIGERLAKE}, + { PCI_CHIP_METEORLAKE_M_I2C_4, "Intel Meteor Lake-M I2C Controller-4", IG4_TIGERLAKE}, + { PCI_CHIP_METEORLAKE_M_I2C_5, "Intel Meteor Lake-M I2C Controller-5", IG4_TIGERLAKE}, }; static int From nobody Sat Nov 9 07:16:31 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XlnDH6WvMz5dRqb; Sat, 09 Nov 2024 07:16: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XlnDH5rkMz4RFx; Sat, 9 Nov 2024 07:16:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731136591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DeaQhYivflgcKXgRItmV6oR/pwdezpEUFwkykSP687k=; b=FTwDg8P0F2vvXm8/K/fCGj8czx2GaizK8XgvFCMahp1YC/23bl8SACWcrFfTfrNetUbH3k hYCoOHj0rct0xrN+7m+DQqoHgk2unx3M8g/Gy/h6CUQq4E4MFDs+XOajXdzK0dW5Cf3apw /NvesxdEhmdmmkYeIwJuog57CbeJO7jiHqnsYg+EKZngKVjrrO17q6yrKchRXatK9LZVE/ GbpyUNun2/eEZWOmuRk8tZjV02iln9hEdXVjpGN/PaI5LPhHWJZqMocnZ/hD23D9P4dib5 I0aydE/LITiByext+qT/8SkLOs7A4w9uihkrJzl1JGWVBZLlbXwnqHngGAs7sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731136591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DeaQhYivflgcKXgRItmV6oR/pwdezpEUFwkykSP687k=; b=qimlZTA8sZZwFsJPycgfH0aiygNEuYujauaknVAyQxZO/q5iZIa/tQTJxypRYXSGBeycDI AavhHistuWaJszHhFzC4K1520Wq5qOSqPopOytCX/JatWu3ifXlTjvoJaWhrvYOwIbYPXL D5kW1nuVoXR4k187iy9a8CMq3wBZl8w5x8vFd1TtrtG3ixSce5A3Z9rM6e8HuSCpmDMrXl i8EOcxA1+jitVdC00UiJERept2ZBM2Yjhi3F9+8XxVEOHBprv9x1z1OPLDTxRUhHpx921U eJNDnRmlbVIbX0DwCLhqlmiG1Xz/RuSOg39lqrLaKMlR+1YbKHxS+tKwMu2GSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731136591; a=rsa-sha256; cv=none; b=j1WwwaS8nd8mBtA1XtmzzWTueWBCtIrWwUfAPjHzo9sj9ogj+NL4GWv1v3uHeuI2h5fOPB jot3X4d+JDUvQ9Jsd75kXp1hRKkLpXDaSvwMg+QRkPTtq8Xp3L2O871l+fZksHGYiPRc/H n0RkMm4y1TOnmdCEOOKjRGfQr0Z5WuoglEfawEiYMSqlZUBSGWtEVJVkduS9tVm21nI5LR 3Ht+SHiew1FLWkBmRXBgP4XNxYsAng/p5pKGa/zm5lZjAxFLLTg64+VR6ftFzpUs/U7uNI akgPmSR7J5oiwve3El0s334eUBVgMI5pS2Z/q9/r2kB8fC4jK2iQlGSeHTjh/g== 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 4XlnDH5BP5z14Jm; Sat, 9 Nov 2024 07:16:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A97GVCk087310; Sat, 9 Nov 2024 07:16:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A97GVDt087307; Sat, 9 Nov 2024 07:16:31 GMT (envelope-from git) Date: Sat, 9 Nov 2024 07:16:31 GMT Message-Id: <202411090716.4A97GVDt087307@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michal Meloun Subject: git: ba045ba49ded - main - arm: Improve the creation of kernel.bin List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ba045ba49dedb068ba2f0e13fbb1c1a91fde8333 Auto-Submitted: auto-generated The branch main has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=ba045ba49dedb068ba2f0e13fbb1c1a91fde8333 commit ba045ba49dedb068ba2f0e13fbb1c1a91fde8333 Author: Michal Meloun AuthorDate: 2024-11-03 12:15:33 +0000 Commit: Michal Meloun CommitDate: 2024-11-09 07:15:23 +0000 arm: Improve the creation of kernel.bin Instead of relinking the kernel without elf headers, replace them with a binary blob of the same length starting with a jump to the kernel's start address. This ensures that all symbols stay at the same offsets as in the original kernel, so kernel.debug remains valid also for kernel.bin. Also ensure that the awk script used runs with the neutral locale defined. Awk 'write' is a locale compilant, and script is used to write binary data to a file, so it needs to ensure that bytes > 127 are written unchanged. While I'm on, set the neutral locale also for arm64, where the same script is used to generate the kernel booti image. Reviewed by: emaste, imp Differential Revision: https://reviews.freebsd.org/D47488 --- sys/conf/Makefile.arm | 36 ++++++++++++++++++++---------------- sys/conf/Makefile.arm64 | 1 + 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/sys/conf/Makefile.arm b/sys/conf/Makefile.arm index 5416aff76666..8e98e5b07648 100644 --- a/sys/conf/Makefile.arm +++ b/sys/conf/Makefile.arm @@ -57,6 +57,7 @@ KERNVIRTADDR= 0xc0000000 # "ELF for the ARM architecture" for more info on the mapping symbols. SYSTEM_LD= \ ${SYSTEM_LD_BASECMD} \ + --Map=/usr2/Meloun/ld.map \ --defsym='text_start=kernbase + SIZEOF_HEADERS' \ -o ${.TARGET} ${SYSTEM_OBJS} vers.o; \ $(OBJCOPY) \ @@ -64,22 +65,6 @@ SYSTEM_LD= \ --strip-symbol='$$[adt]*' \ ${.TARGET} -# Generate the .bin (no elf headers) kernel as an extra build output. -# We must relink to generate the .bin kernel, because without headers the -# location of everything changes. We also strip the ARM marker symbols. -${KERNEL_KO}.bin: ${SYSTEM_DEP} vers.o - @echo "linking ${.TARGET}" - @${SYSTEM_LD_BASECMD} \ - --defsym='text_start=kernbase' \ - -o ${.TARGET} ${SYSTEM_OBJS} vers.o - ${SIZE} ${.TARGET} - @${OBJCOPY} \ - --wildcard \ - --strip-symbol='$$[adt]*' \ - --output-target=binary \ - ${.TARGET} - @chmod 755 ${.TARGET} - # hack because genassym.c includes sys/bus.h which includes these. genassym.o: bus_if.h device_if.h @@ -98,3 +83,22 @@ genassym.o: bus_if.h device_if.h %RULES .include "$S/conf/kern.post.mk" + +# Generate the .bin (no elf headers) kernel +# Copy the kernel to directly executable format (the elf headers are +# stripped and a binary head blob with jump to kernel start address is +# prepended), saving the output in a temp file. +# We also strip arm "marker" symbols which are used only by elf toolchains. Read +# the symbols from kernel.full and pass them to arm_kernel_boothdr.awk, which +# generates a binary header blob that goes on the front of the stripped kernel. +# Cat the header blob and the temp file together to make the kernel.bin file. +${KERNEL_KO}.bin: ${FULLKERNEL} + @${OBJCOPY} --wildcard --strip-symbol='$$[adtx]*' \ + --output-target=binary ${FULLKERNEL} ${.TARGET}.temp + @{ ${NM} ${FULLKERNEL} | \ + LC_ALL=C \ + ${AWK} -f $S/tools/arm_kernel_boothdr.awk -v hdrtype=v7jump && \ + cat ${.TARGET}.temp; \ + } > ${.TARGET} + @rm ${.TARGET}.temp + @echo "created ${.TARGET} from ${.ALLSRC}" diff --git a/sys/conf/Makefile.arm64 b/sys/conf/Makefile.arm64 index 52f0f9052db3..ed9624ee5446 100644 --- a/sys/conf/Makefile.arm64 +++ b/sys/conf/Makefile.arm64 @@ -88,6 +88,7 @@ ${KERNEL_KO}.bin: ${FULLKERNEL} @${OBJCOPY} --wildcard --strip-symbol='$$[adtx]*' \ --output-target=binary ${FULLKERNEL} ${.TARGET}.temp @{ ${NM} ${FULLKERNEL} | \ + LC_ALL=C \ ${AWK} -f $S/tools/arm_kernel_boothdr.awk -v hdrtype=v8booti && \ cat ${.TARGET}.temp; \ } > ${.TARGET} From nobody Sat Nov 9 07:31:54 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XlnZ26j5Tz5dSQr; Sat, 09 Nov 2024 07:31: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XlnZ26Cylz4ST6; Sat, 9 Nov 2024 07:31:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731137514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gYrjGOB2NQGCuwdjGgUffwEKuFfimtn80t5SFA/UFP8=; b=Tf6FodyK1B4uncWPrRY0qdiboIllO2qFSCTv7U1JoFGSmfoQTxNytMe5wYiv7DGfOrdq4I P3fI4lVxS5ZlX7P6M72DqIK0f3nPMGKe3f7V5xrgxsW8wl6003BS5Bk3Z/MrRzjOTTorxM yecG7wWhUKO9QhZjUF1k+SffiRe1v14ZFft7vREobQ3zK8XgSJkXaIZv8tP9tTZbrM3kFc UuTRVLnZMRJwCoepzArItFRJdvdqwjbK20v0jWUtZhpgkh9uyaD4jl63TwnNL/ElnN7wnk wKdsH/kcBfer9IPrNc0GnQJklvLwDHzlfiGXFconyqurHqDdBZrKYyOclv1xaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731137514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gYrjGOB2NQGCuwdjGgUffwEKuFfimtn80t5SFA/UFP8=; b=p9+R4Zm6HUm6VLGlKuDALlCd0ntphsEMJUxQ6yGyuvC1EjULRLxrS2k2apZT9G7krYFXDU FVnyIrzr/JPt6T7ditNxAlxjG3s1XkENFfTOCnxke+67WN5KwYByIiiY8LDQ7/BDWdgfWj zn2OYLmvQ6mRMwVuQ/jho/YrOSVz5XwvVkw6QnGCPZeSlnMQJU1SGudiDgPEub0zSuTTkG 3T4fuwVqNd2mreFbnLsfVnquuV6RERsNP183M+B2GHKkDqb3jRbrPnwP95zasaHzja3lcY QPm0hFyjASLrYWrhHEJActzMbjJV187NOm3l0m5XGWuFFGNqH48c+PRH/KZx2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731137514; a=rsa-sha256; cv=none; b=PmX2PCJi+rfgehmhBrxG/i7IJG3iLTOamDpSiBCTCq5D4JCW2aZttarlP0+iNNsVKVnaUf DZ6Dzr9ujne+YbhTq/0/Q0fVE1hPjLFH4W5znFIs7D9OTlTej3KHZZhHc0J9BtvAGehnlp fHlpAz07zLZ8bVIWvh8b5qwZ/uWtO8zTHGV5/q9ZaMZqQxcq1rXzZl7UGaPHNqaqKleg6H IpzgY5tF7oIxxmQOkLFJPoSmydh2RieWo8KHFlD8LY+6Pn3CfwVB6/Wx+P0/XfzYl9ukC5 l8c60AQxeVp3/jSY9ImYMDqeDrKHjBzYM82oq82lUefZHJz99rRz85rLh/ujiA== 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 4XlnZ25mwRz14Gy; Sat, 9 Nov 2024 07:31:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A97VsT9021689; Sat, 9 Nov 2024 07:31:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A97Vsdu021686; Sat, 9 Nov 2024 07:31:54 GMT (envelope-from git) Date: Sat, 9 Nov 2024 07:31:54 GMT Message-Id: <202411090731.4A97Vsdu021686@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michal Meloun Subject: git: 0283eebb4a54 - main - arm: remove accidentally added -Map switch to linker List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0283eebb4a54c7270f9ac03bb4ed2742cb959c28 Auto-Submitted: auto-generated The branch main has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=0283eebb4a54c7270f9ac03bb4ed2742cb959c28 commit 0283eebb4a54c7270f9ac03bb4ed2742cb959c28 Author: Michal Meloun AuthorDate: 2024-11-09 07:25:15 +0000 Commit: Michal Meloun CommitDate: 2024-11-09 07:31:14 +0000 arm: remove accidentally added -Map switch to linker Fixes: ba045ba49ded --- sys/conf/Makefile.arm | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/conf/Makefile.arm b/sys/conf/Makefile.arm index 8e98e5b07648..2dc566869c14 100644 --- a/sys/conf/Makefile.arm +++ b/sys/conf/Makefile.arm @@ -57,7 +57,6 @@ KERNVIRTADDR= 0xc0000000 # "ELF for the ARM architecture" for more info on the mapping symbols. SYSTEM_LD= \ ${SYSTEM_LD_BASECMD} \ - --Map=/usr2/Meloun/ld.map \ --defsym='text_start=kernbase + SIZEOF_HEADERS' \ -o ${.TARGET} ${SYSTEM_OBJS} vers.o; \ $(OBJCOPY) \ From nobody Sat Nov 9 17:25:09 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xm2kY4Jpjz5cRS5; Sat, 09 Nov 2024 17:25: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xm2kY3NDgz4MLP; Sat, 9 Nov 2024 17:25:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731173109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d1UL0Y11l0eytDLTqkHknNS4u+VUHefUi3oNHjmwOBY=; b=oIb8tOKfF/OUY9ywxU14MKlYmLX+x9Flia3dorHGLNb97xWox86b6do9vG948xV49FEeTe 0iWCP2MSBS9KwbKD9aioeIe6dsOeBRE+nKjBeHqk8qDWNrBFpWKmR5pAfvwbS/n7KGTixp 5Np9106EfcqHWfDLv9QoZ+pnObXFEsMlV+gxt6cmYi1ScalxahFf4PIYmSJAoJevyD4UYn tTLCZ521aCKwldpGWQxlXujYjQm4qdYZNtoCMh4Cf3jHQtywCVj2QAms+GpA4oD+FbjxZF pylpdGRgT2ksaTOyDFciO1hWRpQrXY5JhzB8ZedHbQXqftgKGjvOzECzy4ZR7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731173109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d1UL0Y11l0eytDLTqkHknNS4u+VUHefUi3oNHjmwOBY=; b=f1PJ4pFOkeOld1PGgOBN9RwXxwGuLYHpDH46JKtjxDDhg3f6pH5TlcbY+1YN4oF4FWXTwd U/ath+XzDDJ6MC9Ju7nKkB/2bLqrbYrlGSt+2egn1PE0Px66XYk31rpTbuzVh6+oABMC4C mX/d9+D+p8ON2Abd9kx5cScCcVEdUZY4TYt3azkPvnWl+6ti3Xwcqfo1d+aJlNzvfcvRTP vj5WHy647qNdLNunXTlt3IMJuPkRdlN55cFhy7Zbpgv5uEHvm+cGffd6NuEcuPP48rC8Dr qQCD6jRMPB5EuITGfjP0BwUDkgrZXom67qRG5Hs7KTln4Z9gQ/M4rm8//GxhIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731173109; a=rsa-sha256; cv=none; b=yg2RrZ8mquVspuynBq1Qjv7ukhAIZH8iwxJ/xZxPRhLxqPQtN9xvQgpbGr93FUWq+N8qds kuP2CNcon0vYdIRJ4EmE+mvJhgCNa5X+K6qn2RKxOEjk8B1KgvG8fDDNg0SZC34UHJW4ns 9eYnSADfa9z4f+107Ao+vmAxowG3NoKteZ6QJyFW9LhkCs1X44Ci7aUzTsA0VbK5G6IuOe Bk8HWYFP+sZB73CYMSXzYRhPlM8gnx/eK/Es+rriICr0LbrJBe+pkAvMiOvvaeOgbuJk21 4GCchWoUCp/saIx1MAJAOB2Rb8EXNQVX9Dll6Q3hrs0aLWkFzOPOim1f/cchiw== 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 4Xm2kY2jSRz1MYH; Sat, 9 Nov 2024 17:25:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A9HP9Mj015690; Sat, 9 Nov 2024 17:25:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A9HP9gO015687; Sat, 9 Nov 2024 17:25:09 GMT (envelope-from git) Date: Sat, 9 Nov 2024 17:25:09 GMT Message-Id: <202411091725.4A9HP9gO015687@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: cd9e781e76d9 - main - ps.1: visually align process flags hex values by filling leading zeroes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: cd9e781e76d90275b26b92ba512297ea3ca852e5 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cd9e781e76d90275b26b92ba512297ea3ca852e5 commit cd9e781e76d90275b26b92ba512297ea3ca852e5 Author: Konstantin Belousov AuthorDate: 2024-11-09 01:43:31 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-09 17:22:22 +0000 ps.1: visually align process flags hex values by filling leading zeroes Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47492 --- bin/ps/ps.1 | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/bin/ps/ps.1 b/bin/ps/ps.1 index bac86ad8a882..121757fb943d 100644 --- a/bin/ps/ps.1 +++ b/bin/ps/ps.1 @@ -331,33 +331,33 @@ The flags associated with the process as in the include file .In sys/proc.h : .Bl -column P_SINGLE_BOUNDARY 0x40000000 -.It Dv "P_ADVLOCK" Ta No "0x00001" Ta "Process may hold a POSIX advisory lock" -.It Dv "P_CONTROLT" Ta No "0x00002" Ta "Has a controlling terminal" -.It Dv "P_KPROC" Ta No "0x00004" Ta "Kernel process" -.It Dv "P_PPWAIT" Ta No "0x00010" Ta "Parent is waiting for child to exec/exit" -.It Dv "P_PROFIL" Ta No "0x00020" Ta "Has started profiling" -.It Dv "P_STOPPROF" Ta No "0x00040" Ta "Has thread in requesting to stop prof" -.It Dv "P_HADTHREADS" Ta No "0x00080" Ta "Has had threads (no cleanup shortcuts)" -.It Dv "P_SUGID" Ta No "0x00100" Ta "Had set id privileges since last exec" -.It Dv "P_SYSTEM" Ta No "0x00200" Ta "System proc: no sigs, stats or swapping" -.It Dv "P_SINGLE_EXIT" Ta No "0x00400" Ta "Threads suspending should exit, not wait" -.It Dv "P_TRACED" Ta No "0x00800" Ta "Debugged process being traced" -.It Dv "P_WAITED" Ta No "0x01000" Ta "Someone is waiting for us" -.It Dv "P_WEXIT" Ta No "0x02000" Ta "Working on exiting" -.It Dv "P_EXEC" Ta No "0x04000" Ta "Process called exec" -.It Dv "P_WKILLED" Ta No "0x08000" Ta "Killed, shall go to kernel/user boundary ASAP" -.It Dv "P_CONTINUED" Ta No "0x10000" Ta "Proc has continued from a stopped state" -.It Dv "P_STOPPED_SIG" Ta No "0x20000" Ta "Stopped due to SIGSTOP/SIGTSTP" -.It Dv "P_STOPPED_TRACE" Ta No "0x40000" Ta "Stopped because of tracing" -.It Dv "P_STOPPED_SINGLE" Ta No "0x80000" Ta "Only one thread can continue" -.It Dv "P_PROTECTED" Ta No "0x100000" Ta "Do not kill on memory overcommit" -.It Dv "P_SIGEVENT" Ta No "0x200000" Ta "Process pending signals changed" -.It Dv "P_SINGLE_BOUNDARY" Ta No "0x400000" Ta "Threads should suspend at user boundary" -.It Dv "P_HWPMC" Ta No "0x800000" Ta "Process is using HWPMCs" -.It Dv "P_JAILED" Ta No "0x1000000" Ta "Process is in jail" -.It Dv "P_TOTAL_STOP" Ta No "0x2000000" Ta "Stopped for system suspend" -.It Dv "P_INEXEC" Ta No "0x4000000" Ta Process is in Xr execve 2 -.It Dv "P_STATCHILD" Ta No "0x8000000" Ta "Child process stopped or exited" +.It Dv "P_ADVLOCK" Ta No "0x00000001" Ta "Process may hold a POSIX advisory lock" +.It Dv "P_CONTROLT" Ta No "0x00000002" Ta "Has a controlling terminal" +.It Dv "P_KPROC" Ta No "0x00000004" Ta "Kernel process" +.It Dv "P_PPWAIT" Ta No "0x00000010" Ta "Parent is waiting for child to exec/exit" +.It Dv "P_PROFIL" Ta No "0x00000020" Ta "Has started profiling" +.It Dv "P_STOPPROF" Ta No "0x00000040" Ta "Has thread in requesting to stop prof" +.It Dv "P_HADTHREADS" Ta No "0x00000080" Ta "Has had threads (no cleanup shortcuts)" +.It Dv "P_SUGID" Ta No "0x00000100" Ta "Had set id privileges since last exec" +.It Dv "P_SYSTEM" Ta No "0x00000200" Ta "System proc: no sigs, stats or swapping" +.It Dv "P_SINGLE_EXIT" Ta No "0x00000400" Ta "Threads suspending should exit, not wait" +.It Dv "P_TRACED" Ta No "0x00000800" Ta "Debugged process being traced" +.It Dv "P_WAITED" Ta No "0x00001000" Ta "Someone is waiting for us" +.It Dv "P_WEXIT" Ta No "0x00002000" Ta "Working on exiting" +.It Dv "P_EXEC" Ta No "0x00004000" Ta "Process called exec" +.It Dv "P_WKILLED" Ta No "0x00008000" Ta "Killed, shall go to kernel/user boundary ASAP" +.It Dv "P_CONTINUED" Ta No "0x00010000" Ta "Proc has continued from a stopped state" +.It Dv "P_STOPPED_SIG" Ta No "0x00020000" Ta "Stopped due to SIGSTOP/SIGTSTP" +.It Dv "P_STOPPED_TRACE" Ta No "0x00040000" Ta "Stopped because of tracing" +.It Dv "P_STOPPED_SINGLE" Ta No "0x00080000" Ta "Only one thread can continue" +.It Dv "P_PROTECTED" Ta No "0x00100000" Ta "Do not kill on memory overcommit" +.It Dv "P_SIGEVENT" Ta No "0x00200000" Ta "Process pending signals changed" +.It Dv "P_SINGLE_BOUNDARY" Ta No "0x00400000" Ta "Threads should suspend at user boundary" +.It Dv "P_HWPMC" Ta No "0x00800000" Ta "Process is using HWPMCs" +.It Dv "P_JAILED" Ta No "0x01000000" Ta "Process is in jail" +.It Dv "P_TOTAL_STOP" Ta No "0x02000000" Ta "Stopped for system suspend" +.It Dv "P_INEXEC" Ta No "0x04000000" Ta Process is in Xr execve 2 +.It Dv "P_STATCHILD" Ta No "0x08000000" Ta "Child process stopped or exited" .It Dv "P_INMEM" Ta No "0x10000000" Ta "Loaded into memory" .It Dv "P_SWAPPINGOUT" Ta No "0x20000000" Ta "Process is being swapped out" .It Dv "P_SWAPPINGIN" Ta No "0x40000000" Ta "Process is being swapped in" From nobody Sat Nov 9 17:25:10 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xm2kZ4MZ0z5cRS6; Sat, 09 Nov 2024 17:25: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xm2kZ3WyYz4MLQ; Sat, 9 Nov 2024 17:25:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731173110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ORUiKX0kArdGn/OTuAca6t5lE3lRxjM/kuPbrIJj/LI=; b=rBBG+75cap1a7092bWRKKsNGtazUK0J4lOjWUMzGf94ali7Lhd51v8CEcu66Rh56Vqathh kHnqXHDRp7Ps9EVPmgDl0LYcH24l36D4dRhr5ps3Bv1jFsYLoHg7Wbl5ZSrKJ1eOSsDs9p X3bfMQhN8I+bAY0bEgImlvFI8dh52QxHSH6a88aCPvXdlwX44mlPZcKjMbpJ9IMj0N2o/c HG/hM+7o9nelV10welvkRE0+b2ZgKJwNU8RQEq33JiQh1yf9SrN9hG3qbeV6VEJstUX82Z puDCpV7QkMHnao0wqYHn/tLn4f8k95QSdGdiKEqC6NlNvp1IP7aCOw4tQeyWRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731173110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ORUiKX0kArdGn/OTuAca6t5lE3lRxjM/kuPbrIJj/LI=; b=Tb0H02wxTtYK0NokQ0S6n8DJAGrwICUQ+3rtdY0Rmx+ds7DZX0tH4Q8QJNmWrn+oWDf/BR 0oD61OLJXYUVH6O8D5t1IbUidgwr6jiNOuj81InEzL5TSgiSA+jbZGTIlfIWKoW01cCRFQ Gdu2qmjGj252JOae1ZQnKkuNmO/iE9dY58KwDzWDvdRfr9Sdn4MR3PqU9Nkh3YZjt3Hxh1 eWLY3Aj/4htbsNv8d8E/HRza7n0DV7P5hOuikhnBnv9ZW2C9jGLo5vjfVXvSfY4JuMyOAA WQZN9kOcoXwO3bInuyiOjW10zcABkqnvFSMedEcc/3BumRblA0r80iNlCOwUGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731173110; a=rsa-sha256; cv=none; b=GX6JF0eC+s1xW/iIGxLjpKxv3/G3eKuFrgKCnBfBxBhsaMI81iqCO/d8PvllwGKlFxiBVh tp+7acwdKoXMhqVIK1a/4uLd6fLbFYzwqYn8RRYdxEx/116F9lvAbIpy/44UFVVIS+U/HS q+jBGVREeahqocq6VQMIXR9GiB6a9YyEpmDckuxIOljBlUbu7VPJlsxA83iwVUberwbMWD wey2UzCbnYS16cbdH+hf+5zRlWxyC65jRSzyD+sS3NXo+XwdqUIjroYi9WBfGKM7A0uKtx xjZ3p60xfq6vQJ9UB0XjOwhpXFbyU6ZFNZ8cXxxaji3aqygoMz6qpvlrOBA6rA== 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 4Xm2kZ37Ldz1MHg; Sat, 9 Nov 2024 17:25:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A9HPAvD015744; Sat, 9 Nov 2024 17:25:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A9HPAkf015741; Sat, 9 Nov 2024 17:25:10 GMT (envelope-from git) Date: Sat, 9 Nov 2024 17:25:10 GMT Message-Id: <202411091725.4A9HPAkf015741@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 4c367bc90ba0 - main - ps.1: document rest of flag2 bits List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 4c367bc90ba02a76d015364345343eed1cc4492a Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4c367bc90ba02a76d015364345343eed1cc4492a commit 4c367bc90ba02a76d015364345343eed1cc4492a Author: Konstantin Belousov AuthorDate: 2024-11-09 02:00:42 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-09 17:22:29 +0000 ps.1: document rest of flag2 bits Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47492 --- bin/ps/ps.1 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/bin/ps/ps.1 b/bin/ps/ps.1 index 121757fb943d..828239fd2ba9 100644 --- a/bin/ps/ps.1 +++ b/bin/ps/ps.1 @@ -375,6 +375,24 @@ the include file .It Dv "P2_NOTRACE_EXEC" Ta No "0x00000004" Ta Keep P2_NOPTRACE on Xr execve 2 .It Dv "P2_AST_SU" Ta No "0x00000008" Ta "Handles SU ast for kthreads" .It Dv "P2_PTRACE_FSTP" Ta No "0x00000010" Ta "SIGSTOP from PT_ATTACH not yet handled" +.It Dv "P2_TRAPCAP" Ta No "0x00000020" Ta "SIGTRAP on ENOTCAPABLE" +.It Dv "P2_ASLR_ENABLE" Ta No "0x00000040" Ta "Force enable ASLR" +.It Dv "P2_ASLR_DISABLE" Ta No "0x00000080" Ta "Force disable ASLR" +.It Dv "P2_ASLR_IGNSTART" Ta No "0x00000100" Ta "Enable ASLR to consume sbrk area" +.It Dv "P2_PROTMAX_ENABLE" Ta No "0x00000200" Ta "Force enable implied PROT_MAX" +.It Dv "P2_PROTMAX_DISABLE" Ta No "0x00000400" Ta "Force disable implied PROT_MAX" +.It Dv "P2_STKGAP_DISABLE" Ta No "0x00000800" Ta "Disable stack gap for MAP_STACK" +.It Dv "P2_STKGAP_DISABLE_EXEC" Ta No " 0x00001000" Ta "Stack gap disabled after exec" +.It Dv "P2_ITSTOPPED" Ta No "0x00002000" Ta "itimers stopped (as part of process stop)" +.It Dv "P2_PTRACEREQ" Ta No "0x00004000" Ta "Active ptrace req" +.It Dv "P2_NO_NEW_PRIVS" Ta No "0x00008000" Ta "Ignore setuid on exec" +.It Dv "P2_WXORX_DISABLE" Ta No "0x00010000" Ta "WX mappings enabled" +.It Dv "P2_WXORX_ENABLE_EXEC" Ta No "0x00020000" Ta "WxorX enabled after exec" +.It Dv "P2_WEXIT" Ta No "0x00040000" Ta "Internal exit early state" +.It Dv "P2_REAPKILLED" Ta No "0x00080000" Ta "REAP_KILL pass handled the process" +.It Dv "P2_MEMBAR_PRIVE" Ta No "0x00100000" Ta "membarrier private expedited registered" +.It Dv "P2_MEMBAR_PRIVE_SYNCORE" Ta No "0x00200000" Ta "membarrier private expedited sync core registered" +.It Dv "P2_MEMBAR_GLOBE" Ta No "0x00400000" Ta "membar global expedited registered" .El .It Cm label The MAC label of the process. From nobody Sat Nov 9 17:25:11 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xm2kb67MGz5cRQT; Sat, 09 Nov 2024 17:25: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xm2kb570dz4M8h; Sat, 9 Nov 2024 17:25:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731173111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GtvINwBUdMTzTEaOMGI/iT28eORGkgxsVc2PrkMKV0c=; b=aC7JvVOF+4RRU0RqTZhrH4oxdNhb6Ni3BrkH3zcB5QNQWqYv4fMS2cQ3mwr0vpylGNqSSK rETL6l8uHFYp4a6jAd72CZOBHSPc0DYOfYRYGoq8wydt55RBudqiu2IG4nj1fTWNVruMj7 3LA8F0rp2HgejkAwCj6DUhGwt8FC42HcWGTmP4lQejZBz/E/RBXprSPXw8x/6xiUQIMAp9 vqgdQ5PMS3N633tSKVD2yjA+2ONSENssCdE2j5wiH2lakCWiRTfvmAm2mqw7+wWzoAmUyi zGHO0OMt5/qQ6Whr2V6fmS6VXNFtFJeJuY9m/4P8sNUDAfcTkDCkDAOTOWB84A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731173111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GtvINwBUdMTzTEaOMGI/iT28eORGkgxsVc2PrkMKV0c=; b=OiYMc6uW0vCv7ImOKsKLHOXuKxwHGMKv7oB2OWc3JtiAq76Aee+4321xrf6AsUOnyQj/CE Crr9+sApPv1V7t7qXtaE5lyetvN3NSMJLMSgm8ynIoMm0rVvreZ15IaWdZUaNmwEi59A/H iNyaoE736Tdu4H+VSAIsJsyj21pMx5x0zPX9wUBYFv7PenskQRc2IAs0dSTiOiOLxBK5B5 K8DD/5cRgWDfSEa9r3H9SWwiHne0fz8xqO1L+lt2pdQZSHpFC6ndPcZfQbkF7WwA2tPO4G pgPNo92UZ8ZndwCeIdIiA4V41Q8d5wosJzciwpAXa1g0rtsv/ltWO79Nc60yPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731173111; a=rsa-sha256; cv=none; b=vxaFgE0zLmD36hHnYnl1hpmgL/DgRH70Ky7FPJh+O8NEwnPruL6JN4N8EvAooR7/6FwqTC wzoU9ioEbqQUth6lrUgTzxbVbWtEFUyxnkDLHqQuOWCdBYwJt33+2f9xewl2XERZrljcmy C/WFF3y98JYTgtLpYvZJz/M2y/HDPRCmCAernrL1dKw9k2QhjkEJLzkPltywEjZIk1xUnE 9qDT4VpR/xxMATGeyMoTRMnhcV1lQ870Po8FJWR7Lz6QykiGp0DAyt2QesTKst+oHf+lZT Ck8+T7UYgllGI3978HsNut/lO5w76KAzzMTXQ6Z25xH+VmJjFCCS7YvRjTCQzA== 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 4Xm2kb4SKtz1MNB; Sat, 9 Nov 2024 17:25:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A9HPB02015794; Sat, 9 Nov 2024 17:25:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A9HPB7r015791; Sat, 9 Nov 2024 17:25:11 GMT (envelope-from git) Date: Sat, 9 Nov 2024 17:25:11 GMT Message-Id: <202411091725.4A9HPB7r015791@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 14b3a4564af3 - main - sys/proc.h: add comments to the flag2 bits List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 14b3a4564af36d30a94f01d7d94e64f72df7b880 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=14b3a4564af36d30a94f01d7d94e64f72df7b880 commit 14b3a4564af36d30a94f01d7d94e64f72df7b880 Author: Konstantin Belousov AuthorDate: 2024-11-09 02:02:36 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-09 17:22:36 +0000 sys/proc.h: add comments to the flag2 bits Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47492 --- sys/sys/proc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 466fb3c0cd41..c56d3debd5c0 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -868,7 +868,7 @@ struct proc { MAP_STACK */ #define P2_STKGAP_DISABLE_EXEC 0x00001000 /* Stack gap disabled after exec */ -#define P2_ITSTOPPED 0x00002000 +#define P2_ITSTOPPED 0x00002000 /* itimers stopped */ #define P2_PTRACEREQ 0x00004000 /* Active ptrace req */ #define P2_NO_NEW_PRIVS 0x00008000 /* Ignore setuid */ #define P2_WXORX_DISABLE 0x00010000 /* WX mappings enabled */ @@ -876,7 +876,7 @@ struct proc { #define P2_WEXIT 0x00040000 /* exit just started, no external thread_single() is permitted */ -#define P2_REAPKILLED 0x00080000 +#define P2_REAPKILLED 0x00080000 /* REAP_KILL pass touched me */ #define P2_MEMBAR_PRIVE 0x00100000 /* membar private expedited registered */ #define P2_MEMBAR_PRIVE_SYNCORE 0x00200000 /* membar private expedited From nobody Sat Nov 9 17:25:12 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xm2kd26R1z5cR7F; Sat, 09 Nov 2024 17:25: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xm2kc64c7z4M8w; Sat, 9 Nov 2024 17:25:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731173112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lc0i1dMwHo4de86uOJk0yGjkZXDrv7a6W60efNqvRF0=; b=tUci5AllkwYJOhuF2xT8L6K3q0UJ4cgv1KvmHaa4BjmrM7vz5F/eSkDOwxn3iygwvAL833 oqNrJ6FlwGM2pcQNVGXS1qeC+8qK021WWkrqIOwcIkR9RwxmboCp6HImDUek+I6Hxo7wM+ 1V8dCIOJF1l3cLn8R3FEmIqGFubFbAZp57Xj0jAPqJj+mI2T94OhRilX5pQnzmKozs+v6f SNx4SS6lfewMqSVyMI6aMvr+/On8hx4Bs34jU2H7tyVLPLDGJeAaoCK0zc1T3dK/5VY6v4 t/sxLA+kh3TaZWmy6HC2BBTORpE7cswCX7cAfOe0zHydK/6dvFiAfecASNJXaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731173112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lc0i1dMwHo4de86uOJk0yGjkZXDrv7a6W60efNqvRF0=; b=JHoRWXT+hiHfkHaKh7sl1pXw/hb1vex8bHwa0UrneMap0NfAIRw45nLAjyv5VKiO5z5XBj xlD7wmbaqczklNroq9Twc6rPU7t+liYoIyW9R6C+wXI004U9mOIaPRyfl5IniAQZ2KNF4r JAEbDvtdAG+rcVw47OeA08HQjJKJT/kKA9IYcgV+KZOtbNdv9DqUWdG6VD+KiJPecbMKQG AQ0jkg+L/0z1IPSK9qtQpm5r2aOWGAv9cN+/ibxh2li8j2XenzztzPUVPAI3NkIjS9bdQj d/h2WBE96p8V5VASGKa/sMY36q0OzfzDToyd6YhXpBKXAN4GKCsRJ7oLPosfWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731173112; a=rsa-sha256; cv=none; b=Z/ADdBd25vab5DYoDQJZoQwqSeXpHKAgfXsHh5sYLxvSs+C+8n6ySXIVw3rhn+I07FamzJ kxgdRzL0NSFyeIyz5gFaerQpCZulcvucyShaP52dDcD3emjoC83oSitWNDGRWITuOoxTCH eACzuIvkkjYu07fBSehsUn8ricmmJ9Wt+ErwESqjPbSoBPZS46YyO1pds/OVMqMe0kss5d MzRGV33igrzCVTHXehJjKaeeR46nqOfzMhe9hu2Pd6LULgxmZURCLCHJ3qrImkUXYti/QG nc3I84tKgRtAj8sXtLXaF5rSAHEEY+vDyV6VwJU2cKKHDmBZxq7QyvWUrssfvQ== 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 4Xm2kc5T29z1Lbb; Sat, 9 Nov 2024 17:25:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A9HPCgE015839; Sat, 9 Nov 2024 17:25:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A9HPCHC015836; Sat, 9 Nov 2024 17:25:12 GMT (envelope-from git) Date: Sat, 9 Nov 2024 17:25:12 GMT Message-Id: <202411091725.4A9HPCHC015836@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 62e6ca0f07e4 - main - ps(1): clean up after swapout removal List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 62e6ca0f07e448da27cb2cc8165e749e7fdfcd7e Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=62e6ca0f07e448da27cb2cc8165e749e7fdfcd7e commit 62e6ca0f07e448da27cb2cc8165e749e7fdfcd7e Author: Konstantin Belousov AuthorDate: 2024-11-09 01:37:07 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-09 17:22:42 +0000 ps(1): clean up after swapout removal The process flag P_INMEM is always set. Eliminate all checks for the bit. Also eliminate LAZY_PS define and code covered by it: we do not have an u-area for long time, and it cannot be swapped out. Also eliminate setting controlled by the '-f' switch, but accept it for backward compatibility. The 'W' process secondary state (swapped out) is impossible, stop calculating it. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D47492 --- bin/ps/Makefile | 7 ------- bin/ps/print.c | 6 +----- bin/ps/ps.1 | 9 +-------- bin/ps/ps.c | 41 ++++++++--------------------------------- 4 files changed, 10 insertions(+), 53 deletions(-) diff --git a/bin/ps/Makefile b/bin/ps/Makefile index a25b6a796ed0..71973b34dd24 100644 --- a/bin/ps/Makefile +++ b/bin/ps/Makefile @@ -2,13 +2,6 @@ PACKAGE=runtime PROG= ps SRCS= fmt.c keyword.c nlist.c print.c ps.c -# -# To support "lazy" ps for non root/wheel users -# add -DLAZY_PS to the cflags. This helps -# keep ps from being an unnecessary load -# on large systems. -# -CFLAGS+=-DLAZY_PS LIBADD= m kvm jail xo .include diff --git a/bin/ps/print.c b/bin/ps/print.c index a3423d8b3956..59631fb66a10 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -253,8 +253,6 @@ state(KINFO *k, VARENT *ve __unused) *cp = '?'; } cp++; - if (!(flag & P_INMEM)) - *cp++ = 'W'; if (k->ki_p->ki_nice < NZERO || k->ki_p->ki_pri.pri_class == PRI_REALTIME) *cp++ = '<'; else if (k->ki_p->ki_nice > NZERO || k->ki_p->ki_pri.pri_class == PRI_IDLE) @@ -633,7 +631,7 @@ getpcpu(const KINFO *k) #define fxtofl(fixpt) ((double)(fixpt) / fscale) /* XXX - I don't like this */ - if (k->ki_p->ki_swtime == 0 || (k->ki_p->ki_flag & P_INMEM) == 0) + if (k->ki_p->ki_swtime == 0) return (0.0); if (rawcpu) return (100.0 * fxtofl(k->ki_p->ki_pctcpu)); @@ -661,8 +659,6 @@ getpmem(KINFO *k) if (failure) return (0.0); - if ((k->ki_p->ki_flag & P_INMEM) == 0) - return (0.0); /* XXX want pmap ptpages, segtab, etc. (per architecture) */ /* XXX don't have info about shared */ fracmem = ((double)k->ki_p->ki_rssize) / mempages; diff --git a/bin/ps/ps.1 b/bin/ps/ps.1 index 828239fd2ba9..8ece5b1bbfad 100644 --- a/bin/ps/ps.1 +++ b/bin/ps/ps.1 @@ -159,9 +159,6 @@ does not imply but works well with it. .It Fl e Display the environment as well. -.It Fl f -Show command-line and environment information about swapped out processes. -This option is honored only if the UID of the user is 0. .It Fl G Display information about processes which are running with the specified real group IDs. @@ -358,9 +355,7 @@ the include file .It Dv "P_TOTAL_STOP" Ta No "0x02000000" Ta "Stopped for system suspend" .It Dv "P_INEXEC" Ta No "0x04000000" Ta Process is in Xr execve 2 .It Dv "P_STATCHILD" Ta No "0x08000000" Ta "Child process stopped or exited" -.It Dv "P_INMEM" Ta No "0x10000000" Ta "Loaded into memory" -.It Dv "P_SWAPPINGOUT" Ta No "0x20000000" Ta "Process is being swapped out" -.It Dv "P_SWAPPINGIN" Ta No "0x40000000" Ta "Process is being swapped in" +.It Dv "P_INMEM" Ta No "0x10000000" Ta "Always set, unused" .It Dv "P_PPTRACE" Ta No "0x80000000" Ta "Vforked child issued ptrace(PT_TRACEME)" .El .It Cm flags2 @@ -491,8 +486,6 @@ The process is a session leader. The process' parent is suspended during a .Xr vfork 2 , waiting for the process to exec or exit. -.It Li W -The process is swapped out. .It Li X The process is being traced or debugged. .El diff --git a/bin/ps/ps.c b/bin/ps/ps.c index b0af2bdf37ca..49c69bb76084 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -68,14 +68,6 @@ #define W_SEP " \t" /* "Whitespace" list separators */ #define T_SEP "," /* "Terminate-element" list separators */ -#ifdef LAZY_PS -#define DEF_UREAD 0 -#define OPT_LAZY_f "f" -#else -#define DEF_UREAD 1 /* Always do the more-expensive read. */ -#define OPT_LAZY_f /* I.e., the `-f' option is not added. */ -#endif - /* * isdigit takes an `int', but expects values in the range of unsigned char. * This wrapper ensures that values from a 'char' end up in the correct range. @@ -92,7 +84,6 @@ int showthreads; /* will threads be shown? */ struct velisthead varlist = STAILQ_HEAD_INITIALIZER(varlist); -static int forceuread = DEF_UREAD; /* Do extra work to get u-area. */ static kvm_t *kd; static int needcomm; /* -o "command" */ static int needenv; /* -e */ @@ -154,7 +145,7 @@ static char vfmt[] = "pid,state,time,sl,re,pagein,vsz,rss,lim,tsiz," "%cpu,%mem,command"; static char Zfmt[] = "label"; -#define PS_ARGS "AaCcD:de" OPT_LAZY_f "G:gHhjJ:LlM:mN:O:o:p:rSTt:U:uvwXxZ" +#define PS_ARGS "AaCcD:defG:gHhjJ:LlM:mN:O:o:p:rSTt:U:uvwXxZ" int main(int argc, char *argv[]) @@ -272,12 +263,9 @@ main(int argc, char *argv[]) case 'e': /* XXX set ufmt */ needenv = 1; break; -#ifdef LAZY_PS case 'f': - if (getuid() == 0 || getgid() == 0) - forceuread = 1; + /* compat */ break; -#endif case 'G': add_list(&gidlist, optarg); xkeep_implied = 1; @@ -1276,31 +1264,21 @@ fmt(char **(*fn)(kvm_t *, const struct kinfo_proc *, int), KINFO *ki, return (s); } -#define UREADOK(ki) (forceuread || (ki->ki_p->ki_flag & P_INMEM)) - static void saveuser(KINFO *ki) { char tdname[COMMLEN + 1]; char *argsp; - if (ki->ki_p->ki_flag & P_INMEM) { - /* - * The u-area might be swapped out, and we can't get - * at it because we have a crashdump and no swap. - * If it's here fill in these fields, otherwise, just - * leave them 0. - */ - ki->ki_valid = 1; - } else - ki->ki_valid = 0; + ki->ki_valid = 1; + /* * save arguments if needed */ if (needcomm) { if (ki->ki_p->ki_stat == SZOMB) { ki->ki_args = strdup(""); - } else if (UREADOK(ki) || (ki->ki_p->ki_args != NULL)) { + } else if (ki->ki_p->ki_args != NULL) { (void)snprintf(tdname, sizeof(tdname), "%s%s", ki->ki_p->ki_tdname, ki->ki_p->ki_moretdname); ki->ki_args = fmt(kvm_getargv, ki, @@ -1315,11 +1293,8 @@ saveuser(KINFO *ki) ki->ki_args = NULL; } if (needenv) { - if (UREADOK(ki)) - ki->ki_env = fmt(kvm_getenvv, ki, - (char *)NULL, (char *)NULL, 0); - else - ki->ki_env = strdup("()"); + ki->ki_env = fmt(kvm_getenvv, ki, (char *)NULL, + (char *)NULL, 0); if (ki->ki_env == NULL) xo_errx(1, "malloc failed"); } else { @@ -1479,7 +1454,7 @@ pidmax_init(void) static void __dead2 usage(void) { -#define SINGLE_OPTS "[-aCcde" OPT_LAZY_f "HhjlmrSTuvwXxZ]" +#define SINGLE_OPTS "[-aCcdeHhjlmrSTuvwXxZ]" xo_error("%s\n%s\n%s\n%s\n%s\n", "usage: ps [--libxo] " SINGLE_OPTS " [-O fmt | -o fmt]", From nobody Sat Nov 9 17:35:10 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xm2y64kW7z5cRjR; Sat, 09 Nov 2024 17:35: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xm2y64Bbvz4PSv; Sat, 9 Nov 2024 17:35:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731173710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LMkWeH6pRhNJgG1xcG16ylMpgPsCiQ/UKVcK8x72XZw=; b=njTytJulG8AcXERQ2beSLBWuXra78fyay7HRmKYPxyT98yZoBumcR2b1yJjje+A3bgARp+ XuC7CaBm5I+7e9guSCofl1WB2m7z36gxiH1unHIWQs2N1a2X7RNYLBINXhZD5r3/FjPAGx glQ/2GqVjLeLYL3/j+XO1+FfcMpTu574SUvZ5kFXCpfJtnd5af4edloQbO1EbBrDNZSHJE 8zGfcKcYSXJzmO3inz6//X+Q6zLU1o8G25RQgkguLBYa7DAIslz5o7k2oB/ithPb84EnMu wdJDkhDvOCN6gIavj40MLp6/c6dQax2iucLUJAhDneBnrkwmvY2hCig2PG41zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731173710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LMkWeH6pRhNJgG1xcG16ylMpgPsCiQ/UKVcK8x72XZw=; b=BinO7Vyyf4ahhBT/jYfWuReg2cUTfzQzFBocSTVShx8G5btKJ6Mrfcut4OApLfHcDibjML MfKQs6o20usVx3lteDk5snRGEb6J5QBuRL8Ixt4QHalXftMwwdGeszjYxdGtUhx17xUsOq GF1+xj5d7GFgbQsrPXkhlxGrAqZ7KApLV5DEqC1jAE+9YSEsEYKMhAXfgbgKWS/xev/iDX uaywWJQoqtUjufg16YZ3wwFl4oIVEp2lEnwpNizMg4ZH+8I43mosaT/5ttVf7xZwh7spwh 3W9QuOhN9c07wsmq9Yh4doaF6PYcrE5VVN1TQrocfBDbXEKUd1lXm+qoqfT1Tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731173710; a=rsa-sha256; cv=none; b=ykMREY1vo66eaffebYs9ShGnW91ZBh/Rqy75kv+kSwm1L6x2h/YmtJxb+B0pRtI6Qd6WfJ R0l11PBHcTk98YkxyD9LI9gG31AceD1/je1norVMKqzt4QGab8N8uRNYDShNQkuyNDDBRh psjZkzsRj+D7krm+oLdCDd0oVEbVu2Qyol7719FfPxVjrohe0E9JRCSURTihJrm9uV1G42 mI3mOhxOGCSj/m9lSyY5gak5wgLyhbg3Awq9S1xWxGtvxJUwqOe9zLnuHUXE+6JMLTxo00 ru1PHMm3tdfbm1nHqAoXK7CRgx+br1nO/Avo75bpc4mR18DX88yR+vw0nbktiQ== 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 4Xm2y63lVLz1Lc5; Sat, 9 Nov 2024 17:35:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A9HZAqK034661; Sat, 9 Nov 2024 17:35:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A9HZAYx034658; Sat, 9 Nov 2024 17:35:10 GMT (envelope-from git) Date: Sat, 9 Nov 2024 17:35:10 GMT Message-Id: <202411091735.4A9HZAYx034658@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: f08746a7e319 - main - nvme: Pass malloc flags to request allocation functions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: f08746a7e3195a6e144e6f58003dc5c221d15d02 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f08746a7e3195a6e144e6f58003dc5c221d15d02 commit f08746a7e3195a6e144e6f58003dc5c221d15d02 Author: Mark Johnston AuthorDate: 2024-11-09 17:34:12 +0000 Commit: Mark Johnston CommitDate: 2024-11-09 17:34:12 +0000 nvme: Pass malloc flags to request allocation functions There are some contexts where it is safe to sleep, so we should pass M_WAITOK to ensure that a null pointer dereference can't happen. A few places allocate with M_NOWAIT but have no way to signal an error. Flag those with an XXX comment. PR: 276770 Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47307 --- sys/dev/nvme/nvme_ctrlr.c | 22 ++++++++++++++-------- sys/dev/nvme/nvme_ctrlr_cmd.c | 29 +++++++++++++++++++---------- sys/dev/nvme/nvme_ns_cmd.c | 24 +++++++++--------------- sys/dev/nvme/nvme_private.h | 26 +++++++++++++++----------- sys/dev/nvme/nvme_sim.c | 11 ++++++----- 5 files changed, 63 insertions(+), 49 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 994994c3643f..29c165899f7f 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -820,7 +820,13 @@ nvme_ctrlr_construct_and_submit_aer(struct nvme_controller *ctrlr, struct nvme_request *req; aer->ctrlr = ctrlr; - req = nvme_allocate_request_null(nvme_ctrlr_async_event_cb, aer); + /* + * XXX-MJ this should be M_WAITOK but we might be in a non-sleepable + * callback context. AER completions should be handled on a dedicated + * thread. + */ + req = nvme_allocate_request_null(M_NOWAIT, nvme_ctrlr_async_event_cb, + aer); aer->req = req; /* @@ -1272,12 +1278,12 @@ nvme_ctrlr_passthrough_cmd(struct nvme_controller *ctrlr, goto err; } req = nvme_allocate_request_vaddr(buf->b_data, pt->len, - nvme_pt_done, pt); + M_WAITOK, nvme_pt_done, pt); } else req = nvme_allocate_request_vaddr(pt->buf, pt->len, - nvme_pt_done, pt); + M_WAITOK, nvme_pt_done, pt); } else - req = nvme_allocate_request_null(nvme_pt_done, pt); + req = nvme_allocate_request_null(M_WAITOK, nvme_pt_done, pt); /* Assume user space already converted to little-endian */ req->cmd.opc = pt->cmd.opc; @@ -1363,14 +1369,14 @@ nvme_ctrlr_linux_passthru_cmd(struct nvme_controller *ctrlr, ret = EFAULT; goto err; } - req = nvme_allocate_request_vaddr(buf->b_data, npc->data_len, - nvme_npc_done, npc); + req = nvme_allocate_request_vaddr(buf->b_data, + npc->data_len, M_WAITOK, nvme_npc_done, npc); } else req = nvme_allocate_request_vaddr( (void *)(uintptr_t)npc->addr, npc->data_len, - nvme_npc_done, npc); + M_WAITOK, nvme_npc_done, npc); } else - req = nvme_allocate_request_null(nvme_npc_done, npc); + req = nvme_allocate_request_null(M_WAITOK, nvme_npc_done, npc); req->cmd.opc = npc->opcode; req->cmd.fuse = npc->flags; diff --git a/sys/dev/nvme/nvme_ctrlr_cmd.c b/sys/dev/nvme/nvme_ctrlr_cmd.c index 68934b9b3947..993a7718356d 100644 --- a/sys/dev/nvme/nvme_ctrlr_cmd.c +++ b/sys/dev/nvme/nvme_ctrlr_cmd.c @@ -37,7 +37,7 @@ nvme_ctrlr_cmd_identify_controller(struct nvme_controller *ctrlr, void *payload, struct nvme_command *cmd; req = nvme_allocate_request_vaddr(payload, - sizeof(struct nvme_controller_data), cb_fn, cb_arg); + sizeof(struct nvme_controller_data), M_WAITOK, cb_fn, cb_arg); cmd = &req->cmd; cmd->opc = NVME_OPC_IDENTIFY; @@ -59,7 +59,7 @@ nvme_ctrlr_cmd_identify_namespace(struct nvme_controller *ctrlr, uint32_t nsid, struct nvme_command *cmd; req = nvme_allocate_request_vaddr(payload, - sizeof(struct nvme_namespace_data), cb_fn, cb_arg); + sizeof(struct nvme_namespace_data), M_WAITOK, cb_fn, cb_arg); cmd = &req->cmd; cmd->opc = NVME_OPC_IDENTIFY; @@ -79,7 +79,7 @@ nvme_ctrlr_cmd_create_io_cq(struct nvme_controller *ctrlr, struct nvme_request *req; struct nvme_command *cmd; - req = nvme_allocate_request_null(cb_fn, cb_arg); + req = nvme_allocate_request_null(M_WAITOK, cb_fn, cb_arg); cmd = &req->cmd; cmd->opc = NVME_OPC_CREATE_IO_CQ; @@ -103,7 +103,7 @@ nvme_ctrlr_cmd_create_io_sq(struct nvme_controller *ctrlr, struct nvme_request *req; struct nvme_command *cmd; - req = nvme_allocate_request_null(cb_fn, cb_arg); + req = nvme_allocate_request_null(M_WAITOK, cb_fn, cb_arg); cmd = &req->cmd; cmd->opc = NVME_OPC_CREATE_IO_SQ; @@ -127,7 +127,7 @@ nvme_ctrlr_cmd_delete_io_cq(struct nvme_controller *ctrlr, struct nvme_request *req; struct nvme_command *cmd; - req = nvme_allocate_request_null(cb_fn, cb_arg); + req = nvme_allocate_request_null(M_WAITOK, cb_fn, cb_arg); cmd = &req->cmd; cmd->opc = NVME_OPC_DELETE_IO_CQ; @@ -148,7 +148,7 @@ nvme_ctrlr_cmd_delete_io_sq(struct nvme_controller *ctrlr, struct nvme_request *req; struct nvme_command *cmd; - req = nvme_allocate_request_null(cb_fn, cb_arg); + req = nvme_allocate_request_null(M_WAITOK, cb_fn, cb_arg); cmd = &req->cmd; cmd->opc = NVME_OPC_DELETE_IO_SQ; @@ -171,7 +171,7 @@ nvme_ctrlr_cmd_set_feature(struct nvme_controller *ctrlr, uint8_t feature, struct nvme_request *req; struct nvme_command *cmd; - req = nvme_allocate_request_null(cb_fn, cb_arg); + req = nvme_allocate_request_null(M_WAITOK, cb_fn, cb_arg); cmd = &req->cmd; cmd->opc = NVME_OPC_SET_FEATURES; @@ -193,7 +193,7 @@ nvme_ctrlr_cmd_get_feature(struct nvme_controller *ctrlr, uint8_t feature, struct nvme_request *req; struct nvme_command *cmd; - req = nvme_allocate_request_null(cb_fn, cb_arg); + req = nvme_allocate_request_null(M_WAITOK, cb_fn, cb_arg); cmd = &req->cmd; cmd->opc = NVME_OPC_GET_FEATURES; @@ -259,7 +259,12 @@ nvme_ctrlr_cmd_get_log_page(struct nvme_controller *ctrlr, uint8_t log_page, struct nvme_request *req; struct nvme_command *cmd; - req = nvme_allocate_request_vaddr(payload, payload_size, cb_fn, cb_arg); + /* + * XXX-MJ this should be M_WAITOK but we might be called from AER + * completion processing, which is a non-sleepable context. + */ + req = nvme_allocate_request_vaddr(payload, payload_size, + M_NOWAIT, cb_fn, cb_arg); cmd = &req->cmd; cmd->opc = NVME_OPC_GET_LOG_PAGE; @@ -319,7 +324,11 @@ nvme_ctrlr_cmd_abort(struct nvme_controller *ctrlr, uint16_t cid, struct nvme_request *req; struct nvme_command *cmd; - req = nvme_allocate_request_null(cb_fn, cb_arg); + /* + * XXX-MJ this should be M_WAITOK, we do reset from non-sleepable + * context and abort commands as part of that. + */ + req = nvme_allocate_request_null(M_NOWAIT, cb_fn, cb_arg); cmd = &req->cmd; cmd->opc = NVME_OPC_ABORT; diff --git a/sys/dev/nvme/nvme_ns_cmd.c b/sys/dev/nvme/nvme_ns_cmd.c index 8cbeac025307..1bad9929cb09 100644 --- a/sys/dev/nvme/nvme_ns_cmd.c +++ b/sys/dev/nvme/nvme_ns_cmd.c @@ -36,8 +36,7 @@ nvme_ns_cmd_read(struct nvme_namespace *ns, void *payload, uint64_t lba, struct nvme_request *req; req = nvme_allocate_request_vaddr(payload, - lba_count*nvme_ns_get_sector_size(ns), cb_fn, cb_arg); - + lba_count * nvme_ns_get_sector_size(ns), M_NOWAIT, cb_fn, cb_arg); if (req == NULL) return (ENOMEM); @@ -56,11 +55,9 @@ nvme_ns_cmd_read_bio(struct nvme_namespace *ns, struct bio *bp, uint64_t lba; uint64_t lba_count; - req = nvme_allocate_request_bio(bp, cb_fn, cb_arg); - + req = nvme_allocate_request_bio(bp, M_NOWAIT, cb_fn, cb_arg); if (req == NULL) return (ENOMEM); - lba = bp->bio_offset / nvme_ns_get_sector_size(ns); lba_count = bp->bio_bcount / nvme_ns_get_sector_size(ns); nvme_ns_read_cmd(&req->cmd, ns->id, lba, lba_count); @@ -77,8 +74,7 @@ nvme_ns_cmd_write(struct nvme_namespace *ns, void *payload, uint64_t lba, struct nvme_request *req; req = nvme_allocate_request_vaddr(payload, - lba_count*nvme_ns_get_sector_size(ns), cb_fn, cb_arg); - + lba_count * nvme_ns_get_sector_size(ns), M_NOWAIT, cb_fn, cb_arg); if (req == NULL) return (ENOMEM); @@ -97,8 +93,7 @@ nvme_ns_cmd_write_bio(struct nvme_namespace *ns, struct bio *bp, uint64_t lba; uint64_t lba_count; - req = nvme_allocate_request_bio(bp, cb_fn, cb_arg); - + req = nvme_allocate_request_bio(bp, M_NOWAIT, cb_fn, cb_arg); if (req == NULL) return (ENOMEM); lba = bp->bio_offset / nvme_ns_get_sector_size(ns); @@ -118,8 +113,8 @@ nvme_ns_cmd_deallocate(struct nvme_namespace *ns, void *payload, struct nvme_command *cmd; req = nvme_allocate_request_vaddr(payload, - num_ranges * sizeof(struct nvme_dsm_range), cb_fn, cb_arg); - + num_ranges * sizeof(struct nvme_dsm_range), M_NOWAIT, cb_fn, + cb_arg); if (req == NULL) return (ENOMEM); @@ -141,8 +136,7 @@ nvme_ns_cmd_flush(struct nvme_namespace *ns, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - req = nvme_allocate_request_null(cb_fn, cb_arg); - + req = nvme_allocate_request_null(M_NOWAIT, cb_fn, cb_arg); if (req == NULL) return (ENOMEM); @@ -165,8 +159,8 @@ nvme_ns_dump(struct nvme_namespace *ns, void *virt, off_t offset, size_t len) int i; status.done = FALSE; - req = nvme_allocate_request_vaddr(virt, len, nvme_completion_poll_cb, - &status); + req = nvme_allocate_request_vaddr(virt, len, M_NOWAIT, + nvme_completion_poll_cb, &status); if (req == NULL) return (ENOMEM); diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h index dd7a849b6782..949e69ec9290 100644 --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -486,11 +486,14 @@ nvme_single_map(void *arg, bus_dma_segment_t *seg, int nseg, int error) } static __inline struct nvme_request * -_nvme_allocate_request(nvme_cb_fn_t cb_fn, void *cb_arg) +_nvme_allocate_request(const int how, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - req = malloc(sizeof(*req), M_NVME, M_NOWAIT | M_ZERO); + KASSERT(how == M_WAITOK || how == M_NOWAIT, + ("nvme_allocate_request: invalid how %d", how)); + + req = malloc(sizeof(*req), M_NVME, how | M_ZERO); if (req != NULL) { req->cb_fn = cb_fn; req->cb_arg = cb_arg; @@ -501,11 +504,11 @@ _nvme_allocate_request(nvme_cb_fn_t cb_fn, void *cb_arg) static __inline struct nvme_request * nvme_allocate_request_vaddr(void *payload, uint32_t payload_size, - nvme_cb_fn_t cb_fn, void *cb_arg) + const int how, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - req = _nvme_allocate_request(cb_fn, cb_arg); + req = _nvme_allocate_request(how, cb_fn, cb_arg); if (req != NULL) { req->payload = memdesc_vaddr(payload, payload_size); req->payload_valid = true; @@ -514,20 +517,21 @@ nvme_allocate_request_vaddr(void *payload, uint32_t payload_size, } static __inline struct nvme_request * -nvme_allocate_request_null(nvme_cb_fn_t cb_fn, void *cb_arg) +nvme_allocate_request_null(const int how, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; - req = _nvme_allocate_request(cb_fn, cb_arg); + req = _nvme_allocate_request(how, cb_fn, cb_arg); return (req); } static __inline struct nvme_request * -nvme_allocate_request_bio(struct bio *bio, nvme_cb_fn_t cb_fn, void *cb_arg) +nvme_allocate_request_bio(struct bio *bio, const int how, nvme_cb_fn_t cb_fn, + void *cb_arg) { struct nvme_request *req; - req = _nvme_allocate_request(cb_fn, cb_arg); + req = _nvme_allocate_request(how, cb_fn, cb_arg); if (req != NULL) { req->payload = memdesc_bio(bio); req->payload_valid = true; @@ -536,16 +540,16 @@ nvme_allocate_request_bio(struct bio *bio, nvme_cb_fn_t cb_fn, void *cb_arg) } static __inline struct nvme_request * -nvme_allocate_request_ccb(union ccb *ccb, nvme_cb_fn_t cb_fn, void *cb_arg) +nvme_allocate_request_ccb(union ccb *ccb, const int how, nvme_cb_fn_t cb_fn, + void *cb_arg) { struct nvme_request *req; - req = _nvme_allocate_request(cb_fn, cb_arg); + req = _nvme_allocate_request(how, cb_fn, cb_arg); if (req != NULL) { req->payload = memdesc_ccb(ccb); req->payload_valid = true; } - return (req); } diff --git a/sys/dev/nvme/nvme_sim.c b/sys/dev/nvme/nvme_sim.c index 8bdeb4be49f3..4974bb718222 100644 --- a/sys/dev/nvme/nvme_sim.c +++ b/sys/dev/nvme/nvme_sim.c @@ -96,15 +96,16 @@ nvme_sim_nvmeio(struct cam_sim *sim, union ccb *ccb) /* SG LIST ??? */ if ((nvmeio->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_BIO) req = nvme_allocate_request_bio((struct bio *)payload, - nvme_sim_nvmeio_done, ccb); + M_NOWAIT, nvme_sim_nvmeio_done, ccb); else if ((nvmeio->ccb_h.flags & CAM_DATA_SG) == CAM_DATA_SG) - req = nvme_allocate_request_ccb(ccb, nvme_sim_nvmeio_done, ccb); + req = nvme_allocate_request_ccb(ccb, M_NOWAIT, + nvme_sim_nvmeio_done, ccb); else if (payload == NULL) - req = nvme_allocate_request_null(nvme_sim_nvmeio_done, ccb); + req = nvme_allocate_request_null(M_NOWAIT, nvme_sim_nvmeio_done, + ccb); else - req = nvme_allocate_request_vaddr(payload, size, + req = nvme_allocate_request_vaddr(payload, size, M_NOWAIT, nvme_sim_nvmeio_done, ccb); - if (req == NULL) { nvmeio->ccb_h.status = CAM_RESRC_UNAVAIL; xpt_done(ccb); From nobody Sat Nov 9 19:37:33 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xm5gK4c5gz5cZFr; Sat, 09 Nov 2024 19:37: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xm5gK45hRz4Z3v; Sat, 9 Nov 2024 19:37:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731181053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kLoOG6/Ha4DHfFblwGSFwytNFur3JIy/x3hnh6SeaT4=; b=iKN60pj9Gr2StWNZU8regDP5FsMY0eVlHMuBgK2djn/KOghjPAKPzKfam+adxD2hEDXxpl iKgyyDNtMKqfLr9x99/lpIY73U0Kw5FwIAvu1nW+Irz/ijoqZSaJt/w8BbK4/hr7G0cBWc dHb80B5odlmnrcZw4UyQWZ1Mt7AdmQQk0eVHpuLlIPdX/r6PbOv5epsEp0KcJVKbaO2iPg ja+5vGnm5+gmldLnDpBBrtihGyDjVL9Z7Fdi0LfTs+XkNleGOR62pxwWaSJZ5MCb8Kq5gV k4qmxTmg+Bz85IXmE2rhuGTlHOuICOUFC5/n7bPSihaZHF4vujek01YekQyJuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731181053; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kLoOG6/Ha4DHfFblwGSFwytNFur3JIy/x3hnh6SeaT4=; b=jPd0Yby7ZElayUjKEPO0d1CVKR+D5a3+ylBUXCQboEcBuKA61BeQtYl9eAcl/Use28VibQ VgyQnbfehbMoNovYOUzvpjTNOP0wpuyXTInI+jfw1nENuyYERdQjN+NY+0H8LNAhizA01C nLq9KG81rsj9So1PS+et4ahiERj7PmdpY8pQGgJ2PxAvOy0ZcsYy8GGbnPr13gG4Czq6G2 Hlo3NQFLw6RnJtIQedlYOW8t18Mb6FAbU5JZKf5X+B1w20bmFsZuu2crrA3ma56hnh5sXD OizocLtypsSSsfKgZtJJDqUZtOv4WfCQ3NSUO51dfpSbLvo1CcJdiuiM2rgUGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731181053; a=rsa-sha256; cv=none; b=U0abaDU2E4s/egqm7WCPhArOH+fP+DJmnF7cs8YFDblPDO9omL/ikRzdDaJQZoJ9XvyJJJ y2dRNngLtlg1ZM9sTsY5MdG/QOL8RXB6KXDY4HHwYs7lFEQDElYvVwbo3o/J5sNchkf3A/ R5ss8N5BYJJja1N9cw81GaFg7SrO6YBswxTtNu9S6M6UHCGxmvCvtoeB5lZq+RRvR9Ri0y NK0G0Jvyil3enochjpdfPOVzLHta8j59xUJ3zpvpsPxKdT/F0LSbRIPiTsVlrxM2obj6sH Am+KUzlJnZg7nC1+2PecSk6uhWZchWaJwSBNcuwW89KoIcIcEdWaW+GMmkXkSg== 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 4Xm5gK3YfYz1Qk5; Sat, 9 Nov 2024 19:37:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A9JbXCF057682; Sat, 9 Nov 2024 19:37:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A9JbXk0057679; Sat, 9 Nov 2024 19:37:33 GMT (envelope-from git) Date: Sat, 9 Nov 2024 19:37:33 GMT Message-Id: <202411091937.4A9JbXk0057679@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: f3895e983ce8 - main - vm_radix: Add iter lookup_le interface List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f3895e983ce82474e3ae5825baa295ec1c923203 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=f3895e983ce82474e3ae5825baa295ec1c923203 commit f3895e983ce82474e3ae5825baa295ec1c923203 Author: Doug Moore AuthorDate: 2024-11-09 19:32:58 +0000 Commit: Doug Moore CommitDate: 2024-11-09 19:32:58 +0000 vm_radix: Add iter lookup_le interface Add a function to the vm_radix interface to lookup the greatest page less than or equal to some given page. Reviewed by: alc Differential Revision: https://reviews.freebsd.org/D47046 --- sys/vm/vm_radix.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/vm/vm_radix.h b/sys/vm/vm_radix.h index e1f7323dd205..561e36f2e164 100644 --- a/sys/vm/vm_radix.h +++ b/sys/vm/vm_radix.h @@ -257,6 +257,19 @@ vm_radix_iter_step(struct pctrie_iter *pages) return (VM_RADIX_PCTRIE_ITER_STEP_GE(pages)); } +/* + * Initialize an iterator pointing to the page with the greatest pindex that is + * less than or equal to the specified pindex, or NULL if there are no such + * pages. Return the page. + * + * Requires that access be externally synchronized by a lock. + */ +static __inline vm_page_t +vm_radix_iter_lookup_le(struct pctrie_iter *pages, vm_pindex_t index) +{ + return (VM_RADIX_PCTRIE_ITER_LOOKUP_LE(pages, index)); +} + /* * Update the iterator to point to the page with the pindex that is one greater * than the current pindex, or NULL if there is no such page. Return the page. From nobody Sat Nov 9 20:04:53 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xm6Gt0HMxz5cbr6; Sat, 09 Nov 2024 20:04: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xm6Gs6d5gz4cL7; Sat, 9 Nov 2024 20:04:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731182693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rVTiPJBlVWQQ7zicuqGWpwFooixYdGmT//sopLPuV4Q=; b=QBnK/5dNWj8MN4KcCNjaiBZTX8bT6+paoHkzrQ1Cgc51D5M60EP8tBIV75qqUjnwxVKfqU Kbr6TqapUl5TEH/TAn8zSUxICXBBMiQpMdTC8I1XJ2w1vdJXMCQrTxdI4kug2GfSbBrWoK oXwrZKmq8l9z5SPLkZfC+Ur7bRc0rV3BoBwQt5Y8cc5iHjWGinokJIym/AomM7kbYVAlEs O8XgfkOa6w0crsUF5z5jZwFkdZRpQ2uQzejCYsd2XRUPB4iDw9edhX25YBjsu1YKoEHBFL zFTQQTz7/LyYzhIiu/D3Z5naY7iWh9+fMzL9NtyHApohwBa7b3Od5isM9aBKRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731182693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rVTiPJBlVWQQ7zicuqGWpwFooixYdGmT//sopLPuV4Q=; b=Wpj2ud0yldeXrCsyD/dpmKTfiQlYqLMK1x25FkKp4LOXJvj0iN05ZLjeP1evIgjr/DW4yx X24wCDCEt6jOAIjQQ7kfCOexajOadkO8tb2jtOzCmFWnY3pylaZleSAe4/TRoPPlwOD++x infXFGqL0jIuyw8gb26gWVqip6koQgG2M4U7yqBRs1Gg6spAllcG85CQqz2bar8FykjljO b3hGQGF/ULipaaujlBIl6b/PxeNk+HTK9N06h90saNC381+WM6VLZV97wI9txX7co3MStK QbbTnJLvzF0EyiD6rTBDecI3WOqGmNyahx2wUJ3q/TIgJJxT9MGzvh7/J2FTXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731182693; a=rsa-sha256; cv=none; b=AL0ouUBJhrHw2R/FxgKCj9Ug8EGtco931jkci3lS8ImRfijpQ3NgF/jyTbMsAwktETBhfP KtcAuTbSAGnh2cZBNhaIhV9tVM8GwHwcfpmuEnO16/xBTKxweqfp5LVIZA6HuFfXEYOTNe tV9qDpU/jV14EpD1nnpZOYfujJiVYp7uixD+9D1AUwaJLYmdC15+vugzYNGInk3BDcXNSv S/K9WXlOUp74CdPNjQapoaDiERQjxMqoPj/sntmweUtz5ZZTlOWyhEYnOAFvHvWsZ22Jin sh1DmPxEe2Lfmq1nC06MOdtdhNCbVapIiJNUSiNIo9qCmLf/qCHE0MDy12M0Ww== 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 4Xm6Gs61PKz1R9f; Sat, 9 Nov 2024 20:04:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A9K4rYl013313; Sat, 9 Nov 2024 20:04:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A9K4rvW013310; Sat, 9 Nov 2024 20:04:53 GMT (envelope-from git) Date: Sat, 9 Nov 2024 20:04:53 GMT Message-Id: <202411092004.4A9K4rvW013310@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: f7c45c012201 - main - nvmecontrol tests: Fix nvmecontrol usage in a couple of tests List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: f7c45c012201aff52a83c45c1ba516a855b11ed9 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f7c45c012201aff52a83c45c1ba516a855b11ed9 commit f7c45c012201aff52a83c45c1ba516a855b11ed9 Author: Mark Johnston AuthorDate: 2024-11-09 19:59:46 +0000 Commit: Mark Johnston CommitDate: 2024-11-09 20:04:04 +0000 nvmecontrol tests: Fix nvmecontrol usage in a couple of tests nvmecontrol {admin,io}-passthru's -r option doesn't take an argument, so the tests which added one failed because they tried to open /dev/0. MFC after: 1 week --- sbin/nvmecontrol/tests/basic.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sbin/nvmecontrol/tests/basic.sh b/sbin/nvmecontrol/tests/basic.sh index f4a6b9504a3e..83b74721c66b 100755 --- a/sbin/nvmecontrol/tests/basic.sh +++ b/sbin/nvmecontrol/tests/basic.sh @@ -94,11 +94,11 @@ admin_passthru_head() admin_passthru_body() { if [ -c "${TEST_DEV_PATH}" ] ; then - atf_check -o not-empty -e empty nvmecontrol admin-passthru --opcode=06 --data-len=4096 --cdw10=1 -r 0 ${TEST_DEV} + atf_check -o not-empty -e empty nvmecontrol admin-passthru --opcode=06 --data-len=4096 --cdw10=1 -r ${TEST_DEV} else - atf_check -s not-exit:0 -o empty -e not-empty nvmecontrol admin-passthru --opcode=06 --data-len=4096 --cdw10=1 -r 0 ${TEST_DEV} + atf_check -s not-exit:0 -o empty -e not-empty nvmecontrol admin-passthru --opcode=06 --data-len=4096 --cdw10=1 -r ${TEST_DEV} fi - atf_check -s not-exit:0 -o ignore -e match:"${INV_OPT_MSG}" nvmecontrol admin-passthru ${INV_OPT} --opcode=06 --data-len=4096 --cdw10=1 -r 0 ${TEST_DEV} + atf_check -s not-exit:0 -o ignore -e match:"${INV_OPT_MSG}" nvmecontrol admin-passthru ${INV_OPT} --opcode=06 --data-len=4096 --cdw10=1 -r ${TEST_DEV} } atf_test_case devlist @@ -142,11 +142,11 @@ io_passthru_head() io_passthru_body() { if [ -c "${TEST_DEV_PATH}" ] ; then - atf_check -o not-empty -e empty nvmecontrol io-passthru --opcode=02 --data-len=4096 --cdw10=0 --cdw11=0 --cdw12=0x70000 -r 0 nvme0 ${TEST_DEV} + atf_check -o not-empty -e empty nvmecontrol io-passthru --opcode=02 --data-len=4096 --cdw10=0 --cdw11=0 --cdw12=0x70000 -r nvme0 ${TEST_DEV} else - atf_check -s not-exit:0 -o empty -e not-empty nvmecontrol io-passthru --opcode=02 --data-len=4096 --cdw10=0 --cdw11=0 --cdw12=0x70000 -r 0 nvme0 ${TEST_DEV} + atf_check -s not-exit:0 -o empty -e not-empty nvmecontrol io-passthru --opcode=02 --data-len=4096 --cdw10=0 --cdw11=0 --cdw12=0x70000 -r nvme0 ${TEST_DEV} fi - atf_check -s not-exit:0 -o ignore -e match:"${INV_OPT_MSG}" nvmecontrol io-passthru ${INV_OPT} --opcode=02 --data-len=4096 --cdw10=0 --cdw11=0 --cdw12=0x70000 -r 0 nvme0 ${TEST_DEV} + atf_check -s not-exit:0 -o ignore -e match:"${INV_OPT_MSG}" nvmecontrol io-passthru ${INV_OPT} --opcode=02 --data-len=4096 --cdw10=0 --cdw11=0 --cdw12=0x70000 -r nvme0 ${TEST_DEV} } atf_test_case logpage From nobody Sat Nov 9 21:07:58 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xm7gg16x5z5cgBX; Sat, 09 Nov 2024 21:07: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xm7gg0VPMz4lk3; Sat, 9 Nov 2024 21:07:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731186479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uLWkkjfr09SLxOgEbKGjeSXJeV3CT6LS0PE5CqUqWPM=; b=hCKKyUEViGh/2NcswMAJX8w0/+NMdCtdNBRHcXK5mhgjEXXTxOmA4LiiLDJ5leNxDdiIWC PEamBq5N3fNepmaCT+AjIpuzCHaEvjp6VqFRALNpZHKLaoTe+o0dEzZP7H2UtoTcPZBRka RzJNgtSzwRNjZ+GBydFxJ5SnCDu/AOdRc70jqiAcE4YesXCM7dhlhM0gLH65BLIs4yNQwD Ilchl5nVpXpdEWp80g6ghCVFmhOeDnkliqXEAfnUBoeXvAclNBn7cVzJfK+wyOl8uf8maE WnRxLq/cS5JE7ZQi9yXA0CtmGBDoPg8XAbWs36DKfUlJ5JHdUHMuF4e9e4+m/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731186479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uLWkkjfr09SLxOgEbKGjeSXJeV3CT6LS0PE5CqUqWPM=; b=fBHFcABvXnlfMi1rXAg6nnw8OyedTXKW5DPHfLw+/23jWsFtGh8+I0x5iiEolRhRlUiOWd 0JANQPOIf5hbcneCxXju6ZCgBkFzLvu1RpR5l6MWTObIALK/AUc0WBpCU7/R0QGQFckNUv fn4Z19Lk8rC+wnzxv7ALmidfYmLagjReOw68iHlfWssPfqQSCdssepWUXGMPFQBzwbxrJJ r0cfb76QxNjMYQrLZcsqSrAlywn5VB1AxqIFw1N0oEcdm2ethn9qILB/U4OFBukWXS5rUH W4s/IWmukL9vxLnGrZor2jjFWBvgiD3jyT4/Y9wc7Ey2eneogUOPGgxkYhEXew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731186479; a=rsa-sha256; cv=none; b=NEKB623YpV8GjNU+L/Zua2ApFTyJJJyb5QyIE/no6/sMA5XX3jONq7yE4qVzBwrfj3SULi 0kxpxjFw+X/tjdwxdevkVeVonkFzSqAwq+Bvi3sOIlbDmK7bSmH0KZdh/546/KKJzrcjJ2 bx7bvtur0SBW5Sg1VghmUPxoHFpfFm79k2sK1z7nK0jLep91NEdAegw3uiK+uY3lMRd0Ad WQJtwMyjMS2QOGpVUXFzwGTnkhhTTrK9747YeQST78LoDbaF6oH6pSs5bOHIBiyRJphtXY mlbS+wlzQ0zVeyc5PftGH9Grd0/cXD9KOgpN+BHiabYRNWmgKzcwj2/90HCrVA== 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 4Xm7gf70CZz1SPx; Sat, 9 Nov 2024 21:07:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A9L7wjM026249; Sat, 9 Nov 2024 21:07:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A9L7wU2026246; Sat, 9 Nov 2024 21:07:58 GMT (envelope-from git) Date: Sat, 9 Nov 2024 21:07:58 GMT Message-Id: <202411092107.4A9L7wU2026246@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 1bca58a1d40d - main - amdiommu: hide HPET report under verbose List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 1bca58a1d40d10c7cdd14b2988924cadd6efdc43 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1bca58a1d40d10c7cdd14b2988924cadd6efdc43 commit 1bca58a1d40d10c7cdd14b2988924cadd6efdc43 Author: Konstantin Belousov AuthorDate: 2024-11-09 21:06:06 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-09 21:07:41 +0000 amdiommu: hide HPET report under verbose Reported by: markj Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/x86/iommu/amd_drv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/x86/iommu/amd_drv.c b/sys/x86/iommu/amd_drv.c index 257de73baab5..d8f3c25fcae0 100644 --- a/sys/x86/iommu/amd_drv.c +++ b/sys/x86/iommu/amd_drv.c @@ -1001,8 +1001,9 @@ amdiommu_find_unit_for_hpet(device_t hpet, struct amdiommu_unit **unitp, res = amdiommu_ivrs_iterate_tbl(amdiommu_find_unit_scan_0x11, amdiommu_find_unit_scan_0x11, amdiommu_find_unit_scan_0x10, &ifu); if (!res) { - printf("amdiommu cannot match hpet no %d in IVHD\n", - hpet_no); + if (verbose) + printf("amdiommu cannot match hpet no %d in IVHD\n", + hpet_no); return (ENXIO); } From nobody Sat Nov 9 21:48:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xm8ZM1Nkbz5cjJw; Sat, 09 Nov 2024 21:48: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xm8ZL69fGz4nTx; Sat, 9 Nov 2024 21:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731188906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qdKyTffyR1A+i9mu2D5A6xM90N3MshzUnITDSJTHRLo=; b=C3OWnAkGSnQnOFlHEOnoCxs/co5PmfUqnZMlEhJnmvQtD7YO+APMXxzt8jOGgJl8aZHELn jfq7kFbhIXPcaV6o/mn6AK3FdyRqbTraKnu4XwYcuBQuTkNAaSvhC+OEX09I91vjxz8i2Q ivV/sQlpMrlKycsYFGuxHto9HDQw/35djdFBBPzs1Id9n1RhrwTEjvd4QnghDjs9dpLnHx XzvrkdfWfrTmKFA3ZvFzYbiXr0UxmG69Mob07V1W7xB9sdT5FnAH1RG0JBAzfYOmFNIp2h wOYCTIqp0sHbmp9mwk/9kwfctVrJjHfFwZyOHbi60pmzoIWMq2+az53hBa1q+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731188906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qdKyTffyR1A+i9mu2D5A6xM90N3MshzUnITDSJTHRLo=; b=WyPDQkZ35Wx6ZF+YdkZ9Bn+WsyUNpQwp0u33EXIcwOStYVV/BiMXFzH9jz/oluMKLcqmnW Owgnc+XQdEM2D5uHSoZWHOr7SQ4dnjrUkqHM0Yh/qtLwbkOVJPl9m8E9iSXH1fBEko5lPf 1bmV2qCy4lYg+H2SPrHZKGbH0gcwN8ojnwWqIoh/zErLm0kdPvCPysNJ42XPfAQzqW2Sqg g4/Nd1Yk2Lup6IvhvBpYWnO1T2qqbeZFRwoOc5hkr4qKzlF6aHYTyQvFifKzUaxA1V5fR9 nalBAvcaf2mAy0BrOcHzrE5+TVeOHUtO5Tego2VawEP7RiAZm8Gv2gIVEOXOyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731188906; a=rsa-sha256; cv=none; b=LFkBDa98olrOMET4MnImb8d8B+SQX0fK2BDSWXboxht/Koh/KdD7mttbHyIAneaQlryPD+ faQZs9QjTUUKmNWZbcNOaU9LD8GAzfskY279IpwvaqWRsHl1HJEU7HC/o22HAdigqU7ao0 K+b16dvWhZuLgaoORFfUZstro6nZ72EH4npil6uB+Jv8eXY8YjZ6o6HVsDpnAc/GXDiscW zXyhBdbZCr7Fa3qc1rLAws7huqK2fCR1voJgfoebHKB3RMpmW82UogAL6jsNhcub2UdslW uWAYwT+bV94bT/I62PVw15BDx50tWfKBDBLfaAdSw3ZJDJbZTHm5YnJeNUyqLg== 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 4Xm8ZL5f70zDsS; Sat, 9 Nov 2024 21:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A9LmQ2q099533; Sat, 9 Nov 2024 21:48:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A9LmQ2o099530; Sat, 9 Nov 2024 21:48:26 GMT (envelope-from git) Date: Sat, 9 Nov 2024 21:48:26 GMT Message-Id: <202411092148.4A9LmQ2o099530@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: edab5a280e0b - main - LinuxKPI: 802.11: improve lladdr change to not use ifnet internals List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: edab5a280e0b4a53d0f3e34957075c7efe048e8d Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=edab5a280e0b4a53d0f3e34957075c7efe048e8d commit edab5a280e0b4a53d0f3e34957075c7efe048e8d Author: Bjoern A. Zeeb AuthorDate: 2024-11-08 21:24:00 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-11-09 21:45:14 +0000 LinuxKPI: 802.11: improve lladdr change to not use ifnet internals The changes from 4aff4048 were based on net80211 which is still using if_private.h details. Adjust the code to no longer depend on internal details of ifnet. We also switch the "check"-functionn from if_init to if_transmit which we can query. Given we do have a per-vif eventhandler we could do without that check but would still need to check if_getflags() for IFF_UP. Sponsored by: The FreeBSD Foundation Reported by: jhibbits Fixes: 4aff4048 MFC after: 3 days Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D47490 --- sys/compat/linuxkpi/common/src/linux_80211.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index ec471db21efd..9d0166829d52 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -2763,6 +2763,10 @@ lkpi_ic_wme_update(struct ieee80211com *ic) * we do use a per-[l]vif event handler to be sure we exist as we * cannot assume that from every vap derives a vif and we have a hard * time checking based on net80211 information. + * Should this ever become a real problem we could add a callback function + * to wlan_iflladdr() to be set optionally but that would be for a + * single-consumer (or needs a list) -- was just too complicated for an + * otherwise perfect mechanism FreeBSD already provides. */ static void lkpi_vif_iflladdr(void *arg, struct ifnet *ifp) @@ -2771,8 +2775,9 @@ lkpi_vif_iflladdr(void *arg, struct ifnet *ifp) struct ieee80211_vif *vif; NET_EPOCH_ENTER(et); - /* NB: identify vap's by if_init; left as an extra check. */ - if (ifp->if_init != ieee80211_init || (ifp->if_flags & IFF_UP) != 0) { + /* NB: identify vap's by if_transmit; left as an extra check. */ + if (if_gettransmitfn(ifp) != ieee80211_vap_transmit || + (if_getflags(ifp) & IFF_UP) != 0) { NET_EPOCH_EXIT(et); return; } From nobody Sat Nov 9 22:32:56 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xm9Yh5K1xz5cldx; Sat, 09 Nov 2024 22:32: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xm9Yh4Ht6z4tCc; Sat, 9 Nov 2024 22:32:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731191576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RiOBtoY1a3WJB7fa4dNeAJj/MAVafVsZCIojJyzWquo=; b=w5+L1QR3Gsyjsi0sv48ZcSRAO7K2l8pcvXj7PpGT7c4w4nH6wx+RHGXZefhLS7DdtGFvc/ 0wJ7f0FSBrIhd1G/MgNTyrWlFpNYMU7YZnBhR+cAUnyFcqrbp6B9GsG0SYlSxqGbGmHQc8 PV+SBRRTi+CYQfAuHzDgjEuzUQqoH5AH3Ds5eQ1LTaPvlv0DyPBqWlrENjsYfKwh1Z32xq HBKtHRzfJxfoW0c/HMK+JQt5ihQOgVPB8CGbUF0G4qAmTvQcTK+69LCJpkMemLW3JS37tE MYRtfUz64RdB6ZWrxSWeADl6b/ChOU1aJGj0RBcUJ8jVD6SJ1rx1tma8PyA13A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731191576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RiOBtoY1a3WJB7fa4dNeAJj/MAVafVsZCIojJyzWquo=; b=qDTIIXMnE3B8Y28BVlpKiIbc4HMJasDJfMH+zM6dsalQd7hPYK9agxMZilo6AaWdQQOMCT lSnQSP20HkGKqH67nsiw+67qWVoHP9Kt/Fgi16eqRctUZURPhmLlJarMQKJ2YMtCpMy+Zb C0c91AU6vEI2FdgIv5zVSja2udoZKrmr2YE4S4o+ca8yNs90QE/B4IXNwPNKHBwkZn1OGz bp0ocr2lp52X9m1QucBwlK8cUE/yV/aaQu2lm0AqBrDN0yjq/m9Yz4GHPfzyhWFUBcH7zw 4EXcAeeRyrAc+y/y9eefs0dN1xXuTBmO+pCEGhdEtnbdS+gcFOpjbr96CP5HWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731191576; a=rsa-sha256; cv=none; b=tXLBKTt79+vnkrwLelkFDg0oIOefIWRvMfOrasU3X/vGJn6o60aEaTqU6TdKMzFyC7jinE DK1VDTvYG5xESpgWC4Z6azPMewk+N5fi4Ea8w6TITYrNWVucPO1qYM3TvRGWn9HdC1FlFb CaWFnYx2nZodV3HMDeyOv8n/k9utIgIK0rZu3GimAKzppHA5JaDT+rZYCp8UuhoRYdVm4D hTEcLvUhXJSjPUWLw0J73zpB37yrRdfNIY43sDjtErs4yKDQ1pRx5Q8mi54QadCqV9fGvf KKzz61+TeoE4WfM+ep2ARaOXIBIdCErsrilnSlOkoz5Z73IWgsicGSor0MAzow== 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 4Xm9Yh3vZgzG8j; Sat, 9 Nov 2024 22:32:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A9MWu7m091024; Sat, 9 Nov 2024 22:32:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A9MWubs091021; Sat, 9 Nov 2024 22:32:56 GMT (envelope-from git) Date: Sat, 9 Nov 2024 22:32:56 GMT Message-Id: <202411092232.4A9MWubs091021@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 9805e5b071a1 - main - amdiommu: short-circuit all amdiommu_find_unit() functions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 9805e5b071a10711cfcd3c7a750ac4a4d14b6e3f Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9805e5b071a10711cfcd3c7a750ac4a4d14b6e3f commit 9805e5b071a10711cfcd3c7a750ac4a4d14b6e3f Author: Konstantin Belousov AuthorDate: 2024-11-09 22:29:20 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-09 22:32:37 +0000 amdiommu: short-circuit all amdiommu_find_unit() functions for the case where amdiommu is not enabled. In this case, it does not matter if IVHD does not describe some device. Similarly, no unit can be found for a device, because units are not instantiated, but it does not matter. Reported by: mav Sponsored by: Advanced Micro Devices (AMD) Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/x86/iommu/amd_drv.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/x86/iommu/amd_drv.c b/sys/x86/iommu/amd_drv.c index d8f3c25fcae0..d35c6c8dddc8 100644 --- a/sys/x86/iommu/amd_drv.c +++ b/sys/x86/iommu/amd_drv.c @@ -879,6 +879,9 @@ amdiommu_find_unit(device_t dev, struct amdiommu_unit **unitp, uint16_t *ridp, int error, flags; bool res; + if (!amdiommu_enable) + return (ENXIO); + if (device_get_devclass(device_get_parent(dev)) != devclass_find("pci")) return (ENXIO); @@ -943,6 +946,9 @@ amdiommu_find_unit_for_ioapic(int apic_id, struct amdiommu_unit **unitp, device_t apic_dev; bool res; + if (!amdiommu_enable) + return (ENXIO); + bzero(&ifu, sizeof(ifu)); ifu.type = IFU_DEV_IOAPIC; ifu.devno = apic_id; @@ -992,6 +998,9 @@ amdiommu_find_unit_for_hpet(device_t hpet, struct amdiommu_unit **unitp, int hpet_no; bool res; + if (!amdiommu_enable) + return (ENXIO); + hpet_no = hpet_get_uid(hpet); bzero(&ifu, sizeof(ifu)); ifu.type = IFU_DEV_HPET; @@ -1042,7 +1051,7 @@ amdiommu_find_method(device_t dev, bool verbose) error = amdiommu_find_unit(dev, &unit, &rid, &dte, &edte, verbose); if (error != 0) { - if (verbose) + if (verbose && amdiommu_enable) device_printf(dev, "cannot find amdiommu unit, error %d\n", error); From nobody Sun Nov 10 02:46:54 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XmHBk5dGsz5c4jC; Sun, 10 Nov 2024 02:46: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XmHBk4n2Pz43dR; Sun, 10 Nov 2024 02:46:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731206814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1FMURDOuE4j0GBsnIegmmmHOeu6Vs0L+8SvE+jB113A=; b=KeXxdv3E6Zdi8p8TxTSsunkNj14fLzHFYj50xGkC4dbsWzgHrsrwMRNexmPL1FGFX8NwBy 0XJyQ3LNaVVJLjDroiNcmdlq1y5a43tPoPZlIQyfVNOnlb8CQ07y3X5C9Wz1a4IewkrqY9 QdHIp8tXEXh0ff1URldQC1y3U63bRGjaCX4YFyybheZI7D3cWtpJHpA9yApAjb41/RMGqk 6m0W8ux6GyBPQAYK7iVMdJZ0o7NfJPEBE4CFKEvi9br6KuQpnHSuiH8jQBcct79k3jjbRm QbMd5gLqrGHqruZ9BMRknaHpUWPSJnX8TSJwWaSwBi5zFygnxFpWScgU0EilhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731206814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1FMURDOuE4j0GBsnIegmmmHOeu6Vs0L+8SvE+jB113A=; b=lZ26Y5VFj68LE9PODtIqxvoHoYKW7VctbdaY/tKJ1mPBfCtM7E1vxsmB1NFnYPVSh5bP21 V/exY+fFcIEZGdlCSSt4zMEEKkPZHgx1UA4Haxrebentb5xJNZ7uB/eaCMlYxcal74zwWI nEzNLAwx32aeZfNM4ICZRj/qIS5bLu/R4J1X/sOZu/4N6KgAPKA8J1LSe2ZXt4tLISPqas iLR1i3z/YU3I3PGRHnWsbBrpvZQ/JseyHeWqahT1Om49n5B9H7qta+QfSk871lI480UuAT v9FGs525pZlhA8tRV3M9tonNBeSnKaXF3uOJ7I7fVVfzrv9ZxBi9BVZp4s40DQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731206814; a=rsa-sha256; cv=none; b=Elr3zmm3zw/r5xVVFjaroXEl3FqdSIyOme8wKDJF2+vcZprndKiial7hFNE3A2/BT9SUdl /SNCZk3b1ZW7Oe07EEL7EgfRO8NdDLuQAaTfWjGQtOOqDp7zHZbq3CWzk+o1t9x2RtJvfc Jt2dlzIGy8yxGzzmXMWPexMlBvlYU5axaEpv+BxY5TJsR+1R/H8LDbh5DEiwYBDYjWzpfe IwnvpBirK6FhxEbpNkikFOCRbSfDWAyf+GBDmTGZyIuHUea0elsbbLehpGdSz52KY4m7XI jPc86f3QpxIAzhTlEObqMR8zMB4NihN5h4AF3Ado2zRnJjuainFgW04E00rv8w== 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 4XmHBk4G9jzPkb; Sun, 10 Nov 2024 02:46:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4AA2ksxZ054911; Sun, 10 Nov 2024 02:46:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AA2ks1r054907; Sun, 10 Nov 2024 02:46:54 GMT (envelope-from git) Date: Sun, 10 Nov 2024 02:46:54 GMT Message-Id: <202411100246.4AA2ks1r054907@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: cdd3234186b1 - main - sound: Include ai2s and davbus for PowerPC List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cdd3234186b19e1b9d7cfc985ef8d247552b0f11 Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=cdd3234186b19e1b9d7cfc985ef8d247552b0f11 commit cdd3234186b19e1b9d7cfc985ef8d247552b0f11 Author: Jose Luis Duran AuthorDate: 2024-11-10 02:44:14 +0000 Commit: Jose Luis Duran CommitDate: 2024-11-10 02:44:14 +0000 sound: Include ai2s and davbus for PowerPC Include PowerPC ai2s and davbus sound modules in the metadriver. Reviewed by: christos, emaste Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D47467 --- sys/dev/sound/driver.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/dev/sound/driver.c b/sys/dev/sound/driver.c index 13218f419a28..c9219261e08f 100644 --- a/sys/dev/sound/driver.c +++ b/sys/dev/sound/driver.c @@ -55,6 +55,9 @@ static moduledata_t snd_mod = { DECLARE_MODULE(snd_driver, snd_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); MODULE_VERSION(snd_driver, 1); +#if defined(__powerpc__) +MODULE_DEPEND(snd_driver, snd_ai2s, 1, 1, 1); +#endif MODULE_DEPEND(snd_driver, snd_als4000, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_atiixp, 1, 1, 1); #if defined(__i386__) || defined(__amd64__) @@ -63,6 +66,9 @@ MODULE_DEPEND(snd_driver, snd_cmi, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_cs4281, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_csa, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_csapcm, 1, 1, 1); +#if defined(__powerpc__) +MODULE_DEPEND(snd_driver, snd_davbus, 1, 1, 1); +#endif MODULE_DEPEND(snd_driver, snd_emu10kx, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_envy24, 1, 1, 1); MODULE_DEPEND(snd_driver, snd_envy24ht, 1, 1, 1); From nobody Sun Nov 10 19:02:34 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XmhrV40b6z5c6yY; Sun, 10 Nov 2024 19:02:34 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XmhrV1NSZz4Pcw; Sun, 10 Nov 2024 19:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731265354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9foQMq+RZa1K4BIZqOB+Fo1JGSmMrjk55I8XsnN0Htg=; b=ekEf2vWFKEEnSGLm6tI1jV8Q44ma02S1BIhgtm8+u7O9xUl4smLWPgHCQpXT0AV/HYlHuI 7tXJ+ouewwDk6eEKHFf6OvXaqC4MG8/jFMhyKpyk0kubB24imMPJI4PFD7Qe16+Oo5DZNg 4sl+3I0DtKjJjQDVBviplcEjedeM/3kCSFV46yDzAWmxANJMYtON5suuYuF293SuN+gbtM SOW0YTm4Cq7Oeo83ZHK9PE4lqp8FjK8ppf9H1Nj+6HJbIres2tmG9DS/B4IZFluwFrOGqc sChFqZ9qaaJlSXwbMtVOTJnsxwYbWIvMiUsN0BuA/EUg36CBmOVx2Wo1BC9YWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731265354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9foQMq+RZa1K4BIZqOB+Fo1JGSmMrjk55I8XsnN0Htg=; b=vx0ELgibQ3mbO1GKVFy3JuuaVsrPYTqWe/nyHMzaNkXlBRcktE0SKgK1KHCqqLDXaUS9rj tfp69sBD41s5ZdqJxhN4LI8kWIIDzMXFHI2iziq1pAPsytWQYO87itS4l/0mpRDB5/MbTw a+WRgyqXi2AczxVnZXxibUSWfb6f/KjBTUPvsbSPdHh+OFwSDhpTo9/u/wK9lfYZX/La5+ 38P62ZY1B9yRTkf07Bo8UvVtbfpEaohP0ASDi9kh/UbgPZOHlG1an2etKJr8lQN8fSzndF 9wRzu2JIseZfhu62S1nicvxANEqvnvmOwNiUP5i7mXIz1WA59BfIBBn829gAPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731265354; a=rsa-sha256; cv=none; b=PXNp2i7Sm0U5jcWd4bgGZBY+7aa6jNVacoNsKSwz+6z0lJTNYzRINLnhp1hsRBqzJRlhij 4U4SMharNlejWmNWF9I16Tgk+CnQthvdugVEzimOmSrG8njobuyQv/i2pv3cX0wcCp36Cd H9SFZWYOC6KhWlgDjzYvGVCVEAcKV/PCW91vs52XWoy8d4HI3ZwmlQHXA8PsScL38ABT9u bnnIiT7KEk6pPQhbFDtP9lh64i36JQWJIEZhv7NXjr1F0S5Oa1x73WP6ZM3kRtEgChZIqm 4uUPVj3biBxwO95W9mwbX3gR6ua8p2pHraZacvIt6cdaO5Jb9iyR9UkLl50weQ== 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 4XmhrV0zmYztcn; Sun, 10 Nov 2024 19:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4AAJ2YgP071581; Sun, 10 Nov 2024 19:02:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AAJ2YRE071578; Sun, 10 Nov 2024 19:02:34 GMT (envelope-from git) Date: Sun, 10 Nov 2024 19:02:34 GMT Message-Id: <202411101902.4AAJ2YRE071578@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 2483a2d36803 - main - release: add wifi-firmware-kmod@release to ship as package List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2483a2d36803896d27861c03e1f53dd9546b1e73 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2483a2d36803896d27861c03e1f53dd9546b1e73 commit 2483a2d36803896d27861c03e1f53dd9546b1e73 Author: Bjoern A. Zeeb AuthorDate: 2024-11-02 23:47:14 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-11-10 19:00:55 +0000 release: add wifi-firmware-kmod@release to ship as package Rather than adding the rtw88 package add the flavored port for all the supported wireless drivers we recently added support for. Sponsored by: The FreeBSD Foundation MFC after: 3 days Pointed out by: cperciva (as part of the set of changes) Reviewed by: cperciva (#releng) Differential Revision: https://reviews.freebsd.org/D47406 --- release/scripts/pkg-stage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/scripts/pkg-stage.sh b/release/scripts/pkg-stage.sh index a887173aa858..8f96bd5cf5a1 100755 --- a/release/scripts/pkg-stage.sh +++ b/release/scripts/pkg-stage.sh @@ -19,7 +19,7 @@ graphics/drm-515-kmod misc/freebsd-doc-all net/mpd5 net/rsync -net/wifi-firmware-rtw88-kmod +net/wifi-firmware-kmod@release ports-mgmt/pkg shells/bash shells/zsh From nobody Sun Nov 10 19:34:06 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XmjXt2qfWz5c8lS; Sun, 10 Nov 2024 19:34: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XmjXt20tZz4R5D; Sun, 10 Nov 2024 19:34:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731267246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DYl8nybdjipLTRFcSc7BLBg7WzTzRCIC5Hz+31l6oxE=; b=btzcNQgH15YADt9wHUB1jYov8rd0b+z3n8PVeCu8wHo86GaMcF4oalCC3tmxYnD7g/ZXSG LF2OClfWaoycNMTr9ZCvuftUdjCQOMfPWv33LXRiukDKMRz5QgUXD55coW5CufH7jsaJTS 7opYaiMI4iiryS8AJXMTW+6f5uPpfhj6xsKSs2Y54ptg61nzGKQ9//Zznw8JR/PrhRyXvK 7887RhxScUyQxL8Q55RwXsIZHdRzrq14bUG5OnwvGJavaKHwSDcEsMoe79XNF/WS9FHRLY aTi2RjzdJOO/fqA/ZCsHNEUAIWNelts5D9F4yjjDz9lKQT0F0gasHATijauTnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731267246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DYl8nybdjipLTRFcSc7BLBg7WzTzRCIC5Hz+31l6oxE=; b=g0T1O3jCF24yHdd6Rfei5P66htCxr5/YNkXMXyBuFE8TV7n/eylspqfMNUSMSQGXJ3pdY1 omHIR73xCnD6RnL1+b8xchuOkp6JD1A64e++vZlMz0/6SettQY+CJ1TKk2EiJs12WkmmAZ Qd88vm//Go/M9ZKDqWt+hoxhfgQBaSE8WnwXyhLzCYOqIiCtagbsqktNkBHaVfhX2dH+g0 qTLpKerYc4wlrlLcp5gAAkRP+aPfzByeF7s4YfqnTjZXmbWtibPuH987gmdWAPPUCP5iLn LMZ2EkySrEuDF5ZZZBbXC3K46jUMFtz6LrY+tpuUsolJkG6mconUXqQCOKHX1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731267246; a=rsa-sha256; cv=none; b=wWcK3BHA/GJRmWikPQoRP6HgUaWxoYYZcRn4lvIu4xK57n7ZyooL14m95b5H15B1JmAv/l b8RRhu+KB1vg7s+jQqh/etvZHwwM2hCowwUjPgran7xShQSqSDowTYnmf18EYAkO4av69d PduhGvsOXGSBFuobjW0hEpypkE6u2HqXDHUD8SmaHhkDcrqUBkrEgmIQMSKWtESSaBCXbA ZFLaud7CuxqZTzKTuc5WaoKZjztEgLzqBqJhWj7ouIxGQKG2V1TGwTyzNyKjwo1rJtT+Vi h9u8Th5TOK7EksihT9zwv2uLtURSRNjH1RY9REyEcGZRVGzcvO/s04ss1AlpQw== 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 4XmjXt1cXWzvkT; Sun, 10 Nov 2024 19:34:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4AAJY6Bs026732; Sun, 10 Nov 2024 19:34:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AAJY6Ac026729; Sun, 10 Nov 2024 19:34:06 GMT (envelope-from git) Date: Sun, 10 Nov 2024 19:34:06 GMT Message-Id: <202411101934.4AAJY6Ac026729@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 8f1a2d507e25 - main - iwm.4: move hardware list to .Sh HARDWARE and minor cleanup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8f1a2d507e25e77d20a5d7675dc8eee9b83d3570 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8f1a2d507e25e77d20a5d7675dc8eee9b83d3570 commit 8f1a2d507e25e77d20a5d7675dc8eee9b83d3570 Author: Alexander Ziaee AuthorDate: 2024-11-10 19:28:22 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-11-10 19:33:18 +0000 iwm.4: move hardware list to .Sh HARDWARE and minor cleanup Add devices supported by this driver to a HARDWARE section for inclusion in the Release Hardware Compatibility Notes. While here: - license: add spdx license identifier tag - synopsis: join a line for grep/brevity - description: reflow for consistency, xref iwmfw(4) - examples: use test-net-1 in cidr notation as example IPv4 address - see also: add networking(7) quick start guide - bugs: move 'incompatible modes' here for consistency/flow - mention 802.11a support MFC after: 3 days Reported by: bz (relnotes generation, cidr, test-net-1 ip4addr) Reported by: Graham Percival (no prompt) Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D47171 --- share/man/man4/iwm.4 | 94 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 54 insertions(+), 40 deletions(-) diff --git a/share/man/man4/iwm.4 b/share/man/man4/iwm.4 index b810f7016e54..7fd301929524 100644 --- a/share/man/man4/iwm.4 +++ b/share/man/man4/iwm.4 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2004-2006 .\" Damien Bergamini . All rights reserved. .\" @@ -31,8 +34,7 @@ .Nd Intel IEEE 802.11ac wireless network driver .Sh SYNOPSIS To compile this driver into the kernel, -include the following lines in your -kernel configuration file: +include the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device iwm" .Cd "device pci" @@ -79,55 +81,59 @@ iwm9260fw_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for: -.Pp -.Bl -tag -width Ds -offset indent -compact -.It Intel Dual Band Wireless AC 3160 -.It Intel Dual Band Wireless AC 3165 -.It Intel Dual Band Wireless AC 3168 -.It Intel Dual Band Wireless AC 7260 -.It Intel Dual Band Wireless AC 7265 -.It Intel Dual Band Wireless AC 8260 -.It Intel Dual Band Wireless AC 8265 -.It Intel Dual Band Wireless AC 9260 -.It Intel Dual Band Wireless AC 9270 -.It Intel Dual Band Wireless AC 946X -.It Intel Dual Band Wireless AC 9560 -.El -.Pp -.Nm -supports +driver supports running most Intel Wireless AC series network devices in .Cm station mode operation. Only one virtual interface may be configured at any time. -For more information on configuring this device, see -.Xr ifconfig 8 . -.Pp This driver requires the firmware built with the -.Nm iwmfw +.Xr iwmfw 4 module to work. .Pp -Currently, +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh HARDWARE +The .Nm -only supports 802.11b and 802.11g modes. -It will not associate to access points that are configured to operate only -in 802.11n or 802.11ac modes. +driver supports the following PCIe Wi-Fi devices: +.Pp +.Bl -bullet -compact +.It +Intel Dual Band Wireless AC 3160 +.It +Intel Dual Band Wireless AC 3165 +.It +Intel Dual Band Wireless AC 3168 +.It +Intel Dual Band Wireless AC 7260 +.It +Intel Dual Band Wireless AC 7265 +.It +Intel Dual Band Wireless AC 8260 +.It +Intel Dual Band Wireless AC 8265 +.It +Intel Dual Band Wireless AC 9260 +.It +Intel Dual Band Wireless AC 9270 +.It +Intel Dual Band Wireless AC 946X +.It +Intel Dual Band Wireless AC 9560 +.El .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): -.Bd -literal -offset indent -ifconfig wlan create wlandev iwm0 inet 192.168.0.20 \e - netmask 0xffffff00 -.Ed +.Pp +.Dl ifconfig wlan create wlandev iwm0 inet 192.0.2.20/24 .Pp Join a specific BSS network with network name -.Dq Li my_net : +.Ar my_net : .Pp -.Dl "ifconfig wlan create wlandev iwm0 ssid my_net up" +.Dl ifconfig wlan create wlandev iwm0 ssid my_net up .Pp Join a specific BSS network with 64-bit WEP encryption: .Bd -literal -offset indent ifconfig wlan create wlandev iwm0 ssid my_net \e - wepmode on wepkey 0x1234567890 weptxkey 1 up + wepmode on wepkey 0x1234567890 weptxkey 1 up .Ed .Pp Join a specific BSS network with 128-bit WEP encryption: @@ -155,15 +161,16 @@ Verify the .Xr iwmfw 4 firmware module is present. .It "iwm%d: could not load boot firmware" -An attempt to upload the boot firmware image to the onboard microcontroller -failed. +An attempt to upload the boot firmware image +to the onboard microcontroller failed. This should not happen. .It "iwm%d: could not load microcode" -An attempt to upload the microcode image to the onboard microcontroller failed. +An attempt to upload the microcode image +to the onboard microcontroller failed. This should not happen. .It "iwm%d: could not load main firmware" -An attempt to upload the main firmware image to the onboard microcontroller -failed. +An attempt to upload the main firmware image +to the onboard microcontroller failed. This should not happen. .El .Sh SEE ALSO @@ -174,5 +181,12 @@ This should not happen. .Xr wlan_ccmp 4 , .Xr wlan_tkip 4 , .Xr wlan_wep 4 , +.Xr networking 7 , .Xr ifconfig 8 , .Xr wpa_supplicant 8 +.Sh BUGS +Currently, +.Nm +only supports 802.11a/b/g modes. +It will not associate to access points that are configured to operate +only in 802.11n/ac modes.