From nobody Mon Jun 15 01:47:09 2026 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 4gdtK9555lz6gBC0 for ; Mon, 15 Jun 2026 01:47: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gdtK92vM5z49Vc for ; Mon, 15 Jun 2026 01:47:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781488029; 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=b2da4ssSC/XrD7wXbhMS3zqa0dxM10o5nHf37gG7Y00=; b=aEJosyOPsQ9nUU9GKYtcgaC0s0zx9/+cYPHl9CeE0eCXy6RB2hHD00hitE136+6XKqVSlx lhsG7z7B4USPz/zXalXo5moBjniZUYL0JlN0W4dKfR8oxisRW1tAhq/NXWUnQaSURDt7G0 3WGJYjetH4aWHQr0tIT+wyxvn++SBLvUFv3Hllre0yQqa63XbRqX1Psh4rKPL3OCxP3OzC cN7f8S/Z6/Obcd96a1M2KzOM30WPL470E0eg/qaez38c8wfzIl9Lk7MM77uC7H7aUygsUr Ib55pILoo3tJxiKjN9asrZQNXrhGcBMZQUc61vr8FeUhsWPTC917PPrgPnbJgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781488029; a=rsa-sha256; cv=none; b=n1PXHCmZJSe2AO5iGm92Q7e4IngUfL+3wxVrAEkd9zMnF9bSpWVC8IAfW732a3PxcFmJbD +wvOthPXiyTClu8XJnvyTpCzViDhimOGh0CjbrARE+NFC0m3z+Ppw3G/PfWq1ihJk0J4Bc nuWxtQ7MQPLONXERlDNCLucGzBIk8BEMeYqiS5p841AGtg4r1qJJXsqeWIC/0itynmYo5O AVl5bnrdik5/4040uWIpQR/eVLb6KadUk21YJDNs01VJsSvSj7IbRMt9GMpjbgDo4ImTFm /gu4DfpFZCwL8Rkxsszwgwt3WKmYTks5XInOxbpjAcrwulkGISR882OgqvK3ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781488029; 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=b2da4ssSC/XrD7wXbhMS3zqa0dxM10o5nHf37gG7Y00=; b=h/gsrMUeSpHRo7olbbRo670HdOGTBAeCr9b1ndQnUs2UV+dBA+idUySzEb893IKgVpzVVO 4s2GFrsvqRDo2DbB17Dg8YnbGB4Tn/uFtfNfEkKizHdiP15JGlft8KQHJzuCQUiBzU8BqA TyoNoEae8oWz0tqRx9tjbguQ3fsghy7M14PCDiPgA8l2H4gdy7cQRrbADFfhb1kAh8fVh/ y2tqSAf37foMrg4o0cWvgBbnC5Tmt9LzYNslgNg5FIoadZkBkACp3a9l1L6nBxrXpWetyj g2etTsZWfTkxCjYp05FSqYeouGL9lbF2sTXae8hK95v/DN2C1DZsYQjKMZxPzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gdtK92VdJzbVZ for ; Mon, 15 Jun 2026 01:47:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 264d7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 01:47:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Lo Subject: git: fa75c1cc2426 - main - mwl: return ENOMEM when rx buffer allocation fails 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevlo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa75c1cc242665d123ef5bf2f4ced2e076b35450 Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 01:47:09 +0000 Message-Id: <6a2f599d.264d7.1185c1d0@gitrepo.freebsd.org> The branch main has been updated by kevlo: URL: https://cgit.FreeBSD.org/src/commit/?id=fa75c1cc242665d123ef5bf2f4ced2e076b35450 commit fa75c1cc242665d123ef5bf2f4ced2e076b35450 Author: Kevin Lo AuthorDate: 2026-06-15 01:43:57 +0000 Commit: Kevin Lo CommitDate: 2026-06-15 01:43:57 +0000 mwl: return ENOMEM when rx buffer allocation fails The malloc() failure path returned error, which is 0 at this point, so callers would treat the allocation failure as success. Return ENOMEM instead to correctly propagate the out-of-memory condition. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D42282 --- sys/dev/mwl/if_mwl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mwl/if_mwl.c b/sys/dev/mwl/if_mwl.c index 87e2679778db..3dc44ba20ee4 100644 --- a/sys/dev/mwl/if_mwl.c +++ b/sys/dev/mwl/if_mwl.c @@ -2165,7 +2165,7 @@ mwl_rxdma_setup(struct mwl_softc *sc) bf = malloc(bsize, M_MWLDEV, M_NOWAIT | M_ZERO); if (bf == NULL) { device_printf(sc->sc_dev, "malloc of %u rx buffers failed\n", bsize); - return error; + return ENOMEM; } sc->sc_rxdma.dd_bufptr = bf; From nobody Mon Jun 15 09:09:46 2026 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 4gf47t2B30z6hCJp for ; Mon, 15 Jun 2026 09:09: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gf47t1Lr6z41rr for ; Mon, 15 Jun 2026 09:09:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781514586; 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=gbKwHK/6GLzX2QMcySkUXjd7z7NeR/PacnXLjWtRneQ=; b=gwWOLfwPsAC+oGYjvelydjPQRDgSUQHW2e6N+4hRJWx0ezXLwb7Stq7qlgTE0HOS829gKo naiW6XKR9FnSGTD6BiBqdZYWMueOJ0rE6ta2yi73DfR9m4RqNizQXTlFgoqXCii0C9ePWU tOwn628t85UBt67FpVIrlQdI1NbNvOTZw5kZ83jMvhvrPjt6rglcK7svwbBEPm7y0JHyAQ GIwq8STbiFCJYRnRiC1ARqpNsuoxxgfcJfHLqcgYEskG31bsyKeqETQmhcR2C/yMoqd9AR DLajLiOWxRfU4sXWiwtdxpZmHZy2VZTwuJ8YW18LPKGL+F5Zj5kHnoFguFTO5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781514586; a=rsa-sha256; cv=none; b=Pn8WMpyiKBVb32C/RnLJtiIotEFUQfv3SXowXgeMBVOzIh7SCDZRn3INZAt4DwgKmj18aT BoATPRtEbnt/hamLvdAx25Ib+v2Um4OfzzrfneMMX3LMjTLErediKJb8L4DubE3k3k7XJ9 v8SsKdyjdDsThrK/jp0s/xRLfooxcfQtmJ+rl8IxPgGQuiiU/elrAJotaTjemioMiwdXwR zvLNdUIrkIKlkKC1t/31e4rU2jr7cWIHWAx2W+zPP6bGiMDq3g7XTzUPRArX2c7P+h/NMM y2mxXEKk5reo9ua7id/EmYupBsk1xPjnccggkqDXdPkkvjbcxc891FV+sVrI6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781514586; 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=gbKwHK/6GLzX2QMcySkUXjd7z7NeR/PacnXLjWtRneQ=; b=oEcbHWYPMteOjdPU136MU/sJU6dj0k5cCnDj0I9+ucQDmb7kuCGPHFyz7xLtdPc/OdXXxZ Y6+cpwhriXXQfr4pGGnS0CZ1esOCCIK6/QNSA6WitiJec7B+XP46yCODYfUBQZ6IlEkcpL dpXIIR+kJNfiuCVQqQew5YioP66MfOHjDeaHm+9kKZ8cDpV9vbYjZoV/j/kb/43Gn6I3pC X+lm+CfoV3bcBjGo16qElzfwfBJGaxfJf7Q+la6BmrR+kTncjR5lsXRwWqJ8YS+Gqy0U5I nR11j3YtSf9eOTsYW6xJ2vp8cRkBV8YyFWtr/NFSbSRT4sKkC7DuFBvcWPm7oA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gf47t0j9lznvJ for ; Mon, 15 Jun 2026 09:09:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3357c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 09:09:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: d9e0452f0c8a - main - jail.8: Fix two typos in the manual page 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d9e0452f0c8af6b0c03b0bb2e3b824095021e168 Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 09:09:46 +0000 Message-Id: <6a2fc15a.3357c.2d357069@gitrepo.freebsd.org> The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=d9e0452f0c8af6b0c03b0bb2e3b824095021e168 commit d9e0452f0c8af6b0c03b0bb2e3b824095021e168 Author: Gordon Bergling AuthorDate: 2026-06-15 09:07:24 +0000 Commit: Gordon Bergling CommitDate: 2026-06-15 09:07:24 +0000 jail.8: Fix two typos in the manual page - s/Similarily/Similarly/ - s/passtrough/passthrough/ MFC after: 5 days --- usr.sbin/jail/jail.8 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/jail/jail.8 b/usr.sbin/jail/jail.8 index adba3f34101b..3fc396824b58 100644 --- a/usr.sbin/jail/jail.8 +++ b/usr.sbin/jail/jail.8 @@ -683,7 +683,7 @@ to in the .Xr rc.conf 5 file outside of the jails. -Similarily, if the +Similarly, if the .Xr gssd 8 is to be run in a jail, either the kernel .Sy KGSSAPI @@ -834,7 +834,7 @@ This flag is only available when the .Xr vmm 4 kernel module is loaded. .It Va allow.vmm_ppt -The jail may configure PCI passtrough devices for use by +The jail may configure PCI passthrough devices for use by .Xr vmm 4 virtual machine guests. This allows privileged users inside the jail to manipulate physical devices From nobody Mon Jun 15 09:12:36 2026 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 4gf4C82F34z6hCng for ; Mon, 15 Jun 2026 09:12: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gf4C816Tkz42jq for ; Mon, 15 Jun 2026 09:12:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781514756; 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=KcS0s0aV4/vekXXLXJI8Nx8drGhbF3O0fWe9JmEcdPg=; b=PK8ZlAUMeQO+9MjZuhSjQTQoMHMy1+kI0Ew0lxbgwWAmyF/2x3xdyc/Q3TvFaldnlxBLve w2FTVu18OTWmiJ/QWkg8DVnK7MLA5YqumqA6EZECQG5iRKJO72qHtqrRySMsCAb4KWpc/2 WvATSLlp3yDHUEO+pegCIZ+G2dP8asGs5oqojdsmWt48QMaVC1jlnn749vS7txRbLONTEz C6wJe9TZN4PgE6uwlTRSJv0OFWMq+TqU7tNw77xz8yb/EBq9isd26M/Cxf1jIBaUS9u2on +GPj0T/2bNoFdFJ8RGPwLTE+2u8Wl9wrDCmaJHl4hpB0a25xrrHzu/LIXXk18g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781514756; a=rsa-sha256; cv=none; b=bkW+j0NKEX82DwDlKCRnE8g0WNZZ+09tE6NztW61bqDhQ5JsUdvon6jHjlvw5rvHECclyY +BsWSdcDREf/KjCWnmnhVSBChfD5cI23i2YIH+MdHQwcKhLkeODfNPLB6EaIe91vLFOYjc ylUlzz7byWwKlfJ0fySLxMPieiihU6MG+F4xDJ30sLx46ERCDbcgIgUgCbRPYKoeXusTPB Yp5OQ3DkTqW2D2YXVs1gxlgEIpA56bXa7QV1MvNWXd+aNVlSB61smXmHy1kVx63n+mNmFM ULrqkOAswUZrXszD3BWT/j3m4wNvmdwMRWoGzljpG3gZrJTOaAG2FKwDSnLXlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781514756; 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=KcS0s0aV4/vekXXLXJI8Nx8drGhbF3O0fWe9JmEcdPg=; b=eZrHjbJiGcBLebEHCUPftzWEiM9342qDFsfqNUSAehd7eI8Usgi3BhMIb1aTMpEn+2pLnH Li95RvXVAx14cuRDIunPg7dqQprRiOAcCAWsVlDmann1XTiY81WDBauNTlhBEZGP3Dxhj4 7rcwEDjROL45YR5WLCeAcQbfjsh5q+9FqPrbqJSGizKhy2Ps7E7yao4/BG309RBa8yDYyx SgjxWFICccEa+XGHvx0I1sZR6EYJGSVjNlQglMcCNR1HMGCX01CKSh7WoNNRum1xVuQNTB UYtT0YwyMGEi88fQbt4VyRRVv3Kf4VhJxJ7Q5LEd+Izkm/YnYsqblgQA9dtAoA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gf4C80YvtzpQq for ; Mon, 15 Jun 2026 09:12:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 370c4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 09:12:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 10b1a35d1186 - main - mixer.8: Fix a typo in the manual page 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 10b1a35d11866462b5e776015a1b79f4f8f704a6 Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 09:12:36 +0000 Message-Id: <6a2fc204.370c4.1e895694@gitrepo.freebsd.org> The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=10b1a35d11866462b5e776015a1b79f4f8f704a6 commit 10b1a35d11866462b5e776015a1b79f4f8f704a6 Author: Gordon Bergling AuthorDate: 2026-06-15 09:10:52 +0000 Commit: Gordon Bergling CommitDate: 2026-06-15 09:10:52 +0000 mixer.8: Fix a typo in the manual page - s/thet/the/ MFC after: 5 days --- usr.sbin/mixer/mixer.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/mixer/mixer.8 b/usr.sbin/mixer/mixer.8 index 2d12e6057797..2ba6cf031eb0 100644 --- a/usr.sbin/mixer/mixer.8 +++ b/usr.sbin/mixer/mixer.8 @@ -140,7 +140,7 @@ current settings by the amount specified. Note that relative percentages are still relative to 1.0, not to the current value. If the volume is currently 0.40 and an adjustment of +20% is specified, then -thet final volume will be set to 0.60. +the final volume will be set to 0.60. .Pp Volume can also be set using the shorthand .Ar dev Ns Cm =value . From nobody Mon Jun 15 09:16:18 2026 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 4gf4HR0SXjz6hCwf for ; Mon, 15 Jun 2026 09:16: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gf4HQ6vdpz436k for ; Mon, 15 Jun 2026 09:16:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781514979; 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=2yqMJqhxJejW5iSt2lerRXVdtO/PCtzuT47XwwyYZqs=; b=Eb+ewEdr6tVoofLjrgrwKUDz27eMgJ1tXuwjZ25PFpPv4U8wk8BCoC8rAl+rrq/u7qPLob VSjM/xUBOWBHgb/ZhV5TCYu3F1abR72jJvVTu1fTVHBUOy9syBccddrzxN9OVntOiHnUQD IkTc0atXsaeEZOrPnrF/jnkj3ndfUVqg53UuzTij8KWGWNg2ZNYnG+1+KpvxrFHpjA/XAy tKP3XCEGV3zRhYswboPz77/Egp0h7Z2KKeyaBB8Prifx2mYEhuFWql4Gupmf3q6O7DlKCT wmmil9cd9+4B2g6hGH+NGWVdHC8j0YUdn14EhXE5I0FL/D5jOxkY/w6UCRfRyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781514979; a=rsa-sha256; cv=none; b=YOohM0ZJ/BeW49VNLWHcj7nRD2lwebm5aAHeLDjV2LaED7ljotKBE3tl0r6teyZ6zTh/Vc WYYyGTLaFlGN4T8PgKpqR+rnutt7hlaf7z8vY1Vjow7qQbukuVLebmSbiP3MAYILBMGASO DMQFALba3n0c8KuP+SzI5TNXIOnwdFP9B/P9drUQhZhheodpkgvpE+oh+lxbaZPGxRgPRX 1tLG7GnUhN6DKpiyWkRbQaw9CUa3CpgZUzE9QelPRb31iUxV8XM5yaVpzz0BpTAOe1D7nF vkw99ZJMz/kqFD6jv06Cmxrz9+3+jDn1EIjzxyOKVPhrY30EiqCY50Vg1MphCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781514979; 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=2yqMJqhxJejW5iSt2lerRXVdtO/PCtzuT47XwwyYZqs=; b=RVxglx7a5FaJcli/+sozddBsZOy4X5HI1qwZzxYZJoMJFyRsuVfZjABmslxWJeofuMIOKb csrlXng+xHluKc6GnR5KfEvYqgj7s78AtgdLUGetb8QsRMXgHyERQiVST9znfRpHahhmoy ikZgqyXpwUJfVl6sCSMDVItrwMl3a/HGBDGLG/V7clRBBVjysvuUXdW2tB/dnqyndUaogG tCNwErBPJRMfZMuIeCVzC24Gn3SJSnjO2/oevvQJ+xz91fuIi+cA/hZlc0/YN//H5LM5P8 qzSS8LGY4XtLKELyqs/6O0vrVwpF7moeJP7QRrqIhglyt8lh66TyDstRDdLSHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gf4HQ6Nkczq59 for ; Mon, 15 Jun 2026 09:16:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 37705 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 09:16:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: f930d8a65406 - main - pnfs.4: Fix a typo in the manual page 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f930d8a6540648423288567ff473123ff5647484 Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 09:16:18 +0000 Message-Id: <6a2fc2e2.37705.696c3d5c@gitrepo.freebsd.org> The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=f930d8a6540648423288567ff473123ff5647484 commit f930d8a6540648423288567ff473123ff5647484 Author: Gordon Bergling AuthorDate: 2026-06-15 09:14:20 +0000 Commit: Gordon Bergling CommitDate: 2026-06-15 09:14:20 +0000 pnfs.4: Fix a typo in the manual page - s/Wihout/Without/ MFC after: 5 days --- usr.sbin/nfsd/pnfs.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/nfsd/pnfs.4 b/usr.sbin/nfsd/pnfs.4 index babd221a6d5a..d9818c051df4 100644 --- a/usr.sbin/nfsd/pnfs.4 +++ b/usr.sbin/nfsd/pnfs.4 @@ -215,7 +215,7 @@ set the sysctl .Dq vfs.nfsd.flexlinuxhack to one so that it works around the Linux client driver's limitations. -Wihout this sysctl being set, there will be access errors, since the Linux +Without this sysctl being set, there will be access errors, since the Linux client will use the authenticator in the layout (uid=999, gid=999) and not the authenticator specified in the RPC header. .Pp From nobody Mon Jun 15 11:35:35 2026 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 4gf7N741TFz6hBSm for ; Mon, 15 Jun 2026 11:35: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gf7N72wngz3Jk0 for ; Mon, 15 Jun 2026 11:35:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781523335; 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; bh=JDEpAsCqdRI/e716XI6h5cqJpTF+zZAHdFllN5scnRs=; b=WKtARarGaqdDR5NSIQTuE9n8LqhxuGYk2El2ZT5gd3fEAN3o3jrtOOScYEZXaJ2NphHqvn QU1MvyElk+jLVcVRRaOaTVbMk5/iTI04GEmxeqtKI5LwzLAxM9cv3DxHkg4W5r4DvvxEW3 vfJlbNMdMFhfBJVzRiCVW6W/Mut9lvGD+2tIsJXAVV37eCkDPfQutYyiO15gAMgkepf/Go nFlVXqnObQyoWbwgfoWF8rvBpHojdRzPd/Vzetl/b/P8/GrzU9YtS+rWGHGcXha2U5JtCU CWENWDNj3J/xs9kI72oCZGk16/TuDLnGbt07cr43YghPHfH9o34M4URqpHWe/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781523335; a=rsa-sha256; cv=none; b=oQGYE3uNHKxqwpCpubRWcTqI7htrZHHeZiM4Yt4SCngKKm4Gz/q5RXN/WvHkyRGnnHN/uB 4mt0sZ5DVgaAeyq5cJXUF+Ysa6wWNdEIYLA7Mg2qSSd4IPCFrtoM6kNMtdNfi2Wa5qChrp EgS8Hj1NahpRbHBNaKzISJDhdM0tK1mHakmO+xg3H1h4mKVKEaUwCVP7NLFgKTJwjSUVh6 Yt/9wnqffoNwmqprqqB1A+aDAAjm0b4b6M8MXNEmIZhMNiS+J4HfiloZ0TQqziV8Dw0lqj 8Zudvxpape88RnP4Hz6Z5vWgLaJLogE7aj3Uw4oTvEcGCsL4tLAGoErXSWoZjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781523335; 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; bh=JDEpAsCqdRI/e716XI6h5cqJpTF+zZAHdFllN5scnRs=; b=EZ7IxPSsG40zwV+RdKno0EwFThyDQMyZiSwlaL+4g6eXznvOwRSrBYMILEu08KO46HQKuy EF9VPWm4/pI9ULJQYujbN4nmamtpCYPgUCtnREdOjt2TRGOvTJ4DtbQ/FNAkN2YXC7CMoR CAUHS9gPcrrrHxTjfQm9ahYuGCCeVeSum3UbDy5NXFwf3IOAbsOdMC3r3it79W7X6eHVwn uZGzP7X2Pn5CnIQeS0Edv1lURH/3f0/R5iaFp878wcQ2dYqYdhLyQeb4BEEuMGsChknqi4 feg68QKkJ8681lk/sxiMVDNHKAjnUqmePMjMm1K9nWIYZVlXKoTPYIHtOV6JHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gf7N72G3ZzshF for ; Mon, 15 Jun 2026 11:35:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1ec98 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 11:35:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Sreekanth Reddy From: Sumit Saxena Subject: git: 308784bebe79 - main - if_bnxt/bnxt_re: Update hsi 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ssaxena X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 308784bebe796cbdaccf7ef259caf7d87f874d02 Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 11:35:35 +0000 Message-Id: <6a2fe387.1ec98.564976e8@gitrepo.freebsd.org> The branch main has been updated by ssaxena: URL: https://cgit.FreeBSD.org/src/commit/?id=308784bebe796cbdaccf7ef259caf7d87f874d02 commit 308784bebe796cbdaccf7ef259caf7d87f874d02 Author: Sreekanth Reddy AuthorDate: 2026-06-15 09:43:01 +0000 Commit: Sumit Saxena CommitDate: 2026-06-15 11:31:04 +0000 if_bnxt/bnxt_re: Update hsi headers Update hsi headers MFC after: 2 weeks Reviewed by: gallatin, ssaxena Differential Revision: https://reviews.freebsd.org/D56683 --- sys/dev/bnxt/bnxt_en/hsi_struct_def.h | 10642 +++++++++++++++++++++++++++++--- sys/dev/bnxt/bnxt_re/qplib_fp.c | 2 - sys/dev/bnxt/bnxt_re/qplib_fp.h | 1 - 3 files changed, 9668 insertions(+), 977 deletions(-) diff --git a/sys/dev/bnxt/bnxt_en/hsi_struct_def.h b/sys/dev/bnxt/bnxt_en/hsi_struct_def.h index 5914c70ce671..1bbc7b3962b9 100644 --- a/sys/dev/bnxt/bnxt_en/hsi_struct_def.h +++ b/sys/dev/bnxt/bnxt_en/hsi_struct_def.h @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright (c) 2025 Broadcom, All Rights Reserved. + * Copyright (c) 2026 Broadcom, All Rights Reserved. * The term Broadcom refers to Broadcom Limited and/or its subsidiaries * * Redistribution and use in source and binary forms, with or without @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); /* - * Copyright(c) 2001-2025, Broadcom. All rights reserved. The + * Copyright(c) 2001-2026, Broadcom. All rights reserved. The * term Broadcom refers to Broadcom Inc. and/or its subsidiaries. * Proprietary and Confidential Information. * @@ -119,6 +119,14 @@ typedef struct hwrm_resp_hdr { #define TLV_TYPE_QUERY_ROCE_CC_GEN2 UINT32_C(0x6) /* RoCE slow path command to modify CC Gen2 support. */ #define TLV_TYPE_MODIFY_ROCE_CC_GEN2 UINT32_C(0x7) +/* RoCE slow path command to query CC Gen1_ext support. */ +#define TLV_TYPE_QUERY_ROCE_CC_GEN1_EXT UINT32_C(0x8) +/* RoCE slow path command to modify CC Gen1_ext support. */ +#define TLV_TYPE_MODIFY_ROCE_CC_GEN1_EXT UINT32_C(0x9) +/* RoCE slow path command to query CC Gen2_ext support. */ +#define TLV_TYPE_QUERY_ROCE_CC_GEN2_EXT UINT32_C(0xa) +/* RoCE slow path command to modify CC Gen2_ext support. */ +#define TLV_TYPE_MODIFY_ROCE_CC_GEN2_EXT UINT32_C(0xb) /* Engine CKV - The Alias key EC curve and ECC public key information. */ #define TLV_TYPE_ENGINE_CKV_ALIAS_ECC_PUBLIC_KEY UINT32_C(0x8001) /* Engine CKV - Initialization vector. */ @@ -370,9 +378,11 @@ typedef struct hwrm_short_input { ((x) == 0x63 ? "HWRM_RING_QCFG": \ ((x) == 0x64 ? "HWRM_RESERVED5": \ ((x) == 0x65 ? "HWRM_RESERVED6": \ + ((x) == 0x66 ? "HWRM_PORT_ADSM_QSTATES": \ + ((x) == 0x67 ? "HWRM_PORT_EVENTS_LOG": \ ((x) == 0x70 ? "HWRM_VNIC_RSS_COS_LB_CTX_ALLOC": \ ((x) == 0x71 ? "HWRM_VNIC_RSS_COS_LB_CTX_FREE": \ - "Unknown decode" ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \ + "Unknown decode" ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \ (((x) < 0x100) ? \ ((x) == 0x80 ? "HWRM_QUEUE_MPLS_QCAPS": \ ((x) == 0x81 ? "HWRM_QUEUE_MPLSTC2PRI_QCFG": \ @@ -420,7 +430,7 @@ typedef struct hwrm_short_input { ((x) == 0xb7 ? "HWRM_PORT_PHY_MDIO_BUS_ACQUIRE": \ ((x) == 0xb8 ? "HWRM_PORT_PHY_MDIO_BUS_RELEASE": \ ((x) == 0xb9 ? "HWRM_PORT_QSTATS_EXT_PFC_WD": \ - ((x) == 0xba ? "HWRM_RESERVED7": \ + ((x) == 0xba ? "HWRM_PORT_QSTATS_EXT_PFC_ADV": \ ((x) == 0xbb ? "HWRM_PORT_TX_FIR_CFG": \ ((x) == 0xbc ? "HWRM_PORT_TX_FIR_QCFG": \ ((x) == 0xbd ? "HWRM_PORT_ECN_QSTATS": \ @@ -461,6 +471,10 @@ typedef struct hwrm_short_input { ((x) == 0xe1 ? "HWRM_REG_POWER_QUERY": \ ((x) == 0xe2 ? "HWRM_CORE_FREQUENCY_QUERY": \ ((x) == 0xe3 ? "HWRM_REG_POWER_HISTOGRAM": \ + ((x) == 0xe4 ? "HWRM_MONITOR_PAX_HISTOGRAM_START": \ + ((x) == 0xe5 ? "HWRM_MONITOR_PAX_HISTOGRAM_COLLECT": \ + ((x) == 0xe6 ? "HWRM_STAT_QUERY_ROCE_STATS": \ + ((x) == 0xe7 ? "HWRM_STAT_QUERY_ROCE_STATS_EXT": \ ((x) == 0xf0 ? "HWRM_WOL_FILTER_ALLOC": \ ((x) == 0xf1 ? "HWRM_WOL_FILTER_FREE": \ ((x) == 0xf2 ? "HWRM_WOL_FILTER_QCFG": \ @@ -474,7 +488,7 @@ typedef struct hwrm_short_input { ((x) == 0xfa ? "HWRM_CFA_METER_INSTANCE_CFG": \ ((x) == 0xfd ? "HWRM_CFA_VFR_ALLOC": \ ((x) == 0xfe ? "HWRM_CFA_VFR_FREE": \ - "Unknown decode" )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \ + "Unknown decode" )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) : \ (((x) < 0x180) ? \ ((x) == 0x100 ? "HWRM_CFA_VF_PAIR_ALLOC": \ ((x) == 0x101 ? "HWRM_CFA_VF_PAIR_FREE": \ @@ -596,10 +610,9 @@ typedef struct hwrm_short_input { ((x) == 0x1b1 ? "HWRM_FUNC_LAG_UPDATE": \ ((x) == 0x1b2 ? "HWRM_FUNC_LAG_FREE": \ ((x) == 0x1b3 ? "HWRM_FUNC_LAG_QCFG": \ - ((x) == 0x1c2 ? "HWRM_FUNC_TIMEDTX_PACING_RATE_ADD": \ - ((x) == 0x1c3 ? "HWRM_FUNC_TIMEDTX_PACING_RATE_DELETE": \ - ((x) == 0x1c4 ? "HWRM_FUNC_TIMEDTX_PACING_RATE_QUERY": \ - "Unknown decode" ))))))))))))))))))))))))))))))))))))))) : \ + ((x) == 0x1c3 ? "HWRM_FUNC_TTX_PACING_RATE_PROF_QUERY": \ + ((x) == 0x1c4 ? "HWRM_FUNC_TTX_PACING_RATE_QUERY": \ + "Unknown decode" )))))))))))))))))))))))))))))))))))))) : \ (((x) < 0x280) ? \ ((x) == 0x200 ? "HWRM_SELFTEST_QLIST": \ ((x) == 0x201 ? "HWRM_SELFTEST_EXEC": \ @@ -628,8 +641,11 @@ typedef struct hwrm_short_input { ((x) == 0x218 ? "HWRM_STAT_GENERIC_QSTATS": \ ((x) == 0x219 ? "HWRM_MFG_PRVSN_EXPORT_CERT": \ ((x) == 0x21a ? "HWRM_STAT_DB_ERROR_QSTATS": \ + ((x) == 0x21b ? "HWRM_MFG_TESTS": \ + ((x) == 0x21c ? "HWRM_MFG_WRITE_CERT_NVM": \ ((x) == 0x230 ? "HWRM_PORT_POE_CFG": \ ((x) == 0x231 ? "HWRM_PORT_POE_QCFG": \ + ((x) == 0x232 ? "HWRM_PORT_PHY_FDRSTAT": \ ((x) == 0x258 ? "HWRM_UDCC_QCAPS": \ ((x) == 0x259 ? "HWRM_UDCC_CFG": \ ((x) == 0x25a ? "HWRM_UDCC_QCFG": \ @@ -642,7 +658,9 @@ typedef struct hwrm_short_input { ((x) == 0x261 ? "HWRM_QUEUE_PFCWD_TIMEOUT_QCAPS": \ ((x) == 0x262 ? "HWRM_QUEUE_PFCWD_TIMEOUT_CFG": \ ((x) == 0x263 ? "HWRM_QUEUE_PFCWD_TIMEOUT_QCFG": \ - "Unknown decode" ))))))))))))))))))))))))))))))))))))))))) : \ + ((x) == 0x264 ? "HWRM_QUEUE_ADPTV_QOS_RX_QCFG": \ + ((x) == 0x265 ? "HWRM_QUEUE_ADPTV_QOS_TX_QCFG": \ + "Unknown decode" )))))))))))))))))))))))))))))))))))))))))))))) : \ (((x) < 0x300) ? \ ((x) == 0x2bc ? "HWRM_TF": \ ((x) == 0x2bd ? "HWRM_TF_VERSION_GET": \ @@ -709,7 +727,10 @@ typedef struct hwrm_short_input { ((x) == 0x399 ? "HWRM_TFC_IF_TBL_GET": \ ((x) == 0x39a ? "HWRM_TFC_TBL_SCOPE_CONFIG_GET": \ ((x) == 0x39b ? "HWRM_TFC_RESC_USAGE_QUERY": \ - "Unknown decode" )))))))))))))))))))))))))))) : \ + ((x) == 0x39c ? "HWRM_TFC_GLOBAL_ID_FREE": \ + ((x) == 0x39d ? "HWRM_TFC_TCAM_PRI_UPDATE": \ + ((x) == 0x3a0 ? "HWRM_TFC_HOT_UPGRADE_PROCESS": \ + "Unknown decode" ))))))))))))))))))))))))))))))) : \ (((x) < 0x480) ? \ ((x) == 0x400 ? "HWRM_SV": \ "Unknown decode" ) : \ @@ -747,7 +768,9 @@ typedef struct hwrm_short_input { ((x) == 0xff2c ? "HWRM_DBG_COREDUMP_CAPTURE": \ ((x) == 0xff2d ? "HWRM_DBG_PTRACE": \ ((x) == 0xff2e ? "HWRM_DBG_SIM_CABLE_STATE": \ - "Unknown decode" ))))))))))))))))))))))))))))))))) : \ + ((x) == 0xff2f ? "HWRM_DBG_TOKEN_QUERY_AUTH_IDS": \ + ((x) == 0xff30 ? "HWRM_DBG_TOKEN_CFG": \ + "Unknown decode" ))))))))))))))))))))))))))))))))))) : \ (((x) <= UINT16_MAX) ? \ ((x) == 0xffea ? "HWRM_NVM_GET_VPD_FIELD_INFO": \ ((x) == 0xffeb ? "HWRM_NVM_SET_VPD_FIELD_INFO": \ @@ -891,6 +914,8 @@ typedef struct cmd_nums { #define HWRM_RESERVED5 UINT32_C(0x64) /* Reserved for future use. */ #define HWRM_RESERVED6 UINT32_C(0x65) + #define HWRM_PORT_ADSM_QSTATES UINT32_C(0x66) + #define HWRM_PORT_EVENTS_LOG UINT32_C(0x67) #define HWRM_VNIC_RSS_COS_LB_CTX_ALLOC UINT32_C(0x70) #define HWRM_VNIC_RSS_COS_LB_CTX_FREE UINT32_C(0x71) #define HWRM_QUEUE_MPLS_QCAPS UINT32_C(0x80) @@ -944,8 +969,7 @@ typedef struct cmd_nums { #define HWRM_PORT_PHY_MDIO_BUS_ACQUIRE UINT32_C(0xb7) #define HWRM_PORT_PHY_MDIO_BUS_RELEASE UINT32_C(0xb8) #define HWRM_PORT_QSTATS_EXT_PFC_WD UINT32_C(0xb9) - /* Reserved. */ - #define HWRM_RESERVED7 UINT32_C(0xba) + #define HWRM_PORT_QSTATS_EXT_PFC_ADV UINT32_C(0xba) #define HWRM_PORT_TX_FIR_CFG UINT32_C(0xbb) #define HWRM_PORT_TX_FIR_QCFG UINT32_C(0xbc) #define HWRM_PORT_ECN_QSTATS UINT32_C(0xbd) @@ -994,6 +1018,14 @@ typedef struct cmd_nums { #define HWRM_REG_POWER_QUERY UINT32_C(0xe1) #define HWRM_CORE_FREQUENCY_QUERY UINT32_C(0xe2) #define HWRM_REG_POWER_HISTOGRAM UINT32_C(0xe3) + /* Start a PAX latency histogram measurement */ + #define HWRM_MONITOR_PAX_HISTOGRAM_START UINT32_C(0xe4) + /* Collect PAX latency histogram data and optionally stop measurement. */ + #define HWRM_MONITOR_PAX_HISTOGRAM_COLLECT UINT32_C(0xe5) + /* This command returns RoCE statistics for the function. */ + #define HWRM_STAT_QUERY_ROCE_STATS UINT32_C(0xe6) + /* This command returns Extended RoCE statistics for the function. */ + #define HWRM_STAT_QUERY_ROCE_STATS_EXT UINT32_C(0xe7) #define HWRM_WOL_FILTER_ALLOC UINT32_C(0xf0) #define HWRM_WOL_FILTER_FREE UINT32_C(0xf1) #define HWRM_WOL_FILTER_QCFG UINT32_C(0xf2) @@ -1257,18 +1289,16 @@ typedef struct cmd_nums { #define HWRM_FUNC_LAG_FREE UINT32_C(0x1b2) /* The command is used to query a link aggr group. */ #define HWRM_FUNC_LAG_QCFG UINT32_C(0x1b3) - /* This command is use to add TimeTX packet pacing rate. */ - #define HWRM_FUNC_TIMEDTX_PACING_RATE_ADD UINT32_C(0x1c2) /* - * This command is use to delete TimeTX packet pacing rate - * from the rate table. + * This command is used to retrieve all the TimeTX pacing rate + * profiles that are supported. */ - #define HWRM_FUNC_TIMEDTX_PACING_RATE_DELETE UINT32_C(0x1c3) + #define HWRM_FUNC_TTX_PACING_RATE_PROF_QUERY UINT32_C(0x1c3) /* * This command is used to retrieve all the TimeTX pacing rates * from the rate table that have been added for the function. */ - #define HWRM_FUNC_TIMEDTX_PACING_RATE_QUERY UINT32_C(0x1c4) + #define HWRM_FUNC_TTX_PACING_RATE_QUERY UINT32_C(0x1c4) /* Experimental */ #define HWRM_SELFTEST_QLIST UINT32_C(0x200) /* Experimental */ @@ -1347,6 +1377,10 @@ typedef struct cmd_nums { #define HWRM_MFG_PRVSN_EXPORT_CERT UINT32_C(0x219) /* Query the statistics for doorbell drops due to various error conditions. */ #define HWRM_STAT_DB_ERROR_QSTATS UINT32_C(0x21a) + /* This command is used to select and run manufacturing tests */ + #define HWRM_MFG_TESTS UINT32_C(0x21b) + /* This command is used to write a cert chain from production firmware */ + #define HWRM_MFG_WRITE_CERT_NVM UINT32_C(0x21c) /* * The command is used to enable/disable the power on ethernet for * a particular I/O expander port. @@ -1357,6 +1391,8 @@ typedef struct cmd_nums { * is enabled/disabled for a particular I/O expander port. */ #define HWRM_PORT_POE_QCFG UINT32_C(0x231) + /* Tells the fw to run fdrstat on a given port. */ + #define HWRM_PORT_PHY_FDRSTAT UINT32_C(0x232) /* * This command returns the capabilities related to User Defined * Congestion Control on a function. @@ -1393,6 +1429,16 @@ typedef struct cmd_nums { * timeout value. */ #define HWRM_QUEUE_PFCWD_TIMEOUT_QCFG UINT32_C(0x263) + /* + * This command is used to query the current configured RX cos mbuf related + * values for a port + */ + #define HWRM_QUEUE_ADPTV_QOS_RX_QCFG UINT32_C(0x264) + /* + * This command is used to query the current configured TX cos mbuf related + * values for a port + */ + #define HWRM_QUEUE_ADPTV_QOS_TX_QCFG UINT32_C(0x265) /* Experimental */ #define HWRM_TF UINT32_C(0x2bc) /* Experimental */ @@ -1515,6 +1561,12 @@ typedef struct cmd_nums { #define HWRM_TFC_TBL_SCOPE_CONFIG_GET UINT32_C(0x39a) /* TruFlow command to query the resource usage state. */ #define HWRM_TFC_RESC_USAGE_QUERY UINT32_C(0x39b) + /* TruFlow command to free resources for a global id. */ + #define HWRM_TFC_GLOBAL_ID_FREE UINT32_C(0x39c) + /* TruFlow command to update the priority of one tcam entry. */ + #define HWRM_TFC_TCAM_PRI_UPDATE UINT32_C(0x39d) + /* TruFlow command to process hot upgrade requests. */ + #define HWRM_TFC_HOT_UPGRADE_PROCESS UINT32_C(0x3a0) /* Experimental */ #define HWRM_SV UINT32_C(0x400) /* Run a PCIe or Ethernet serdes test and retrieve test data. */ @@ -1588,6 +1640,15 @@ typedef struct cmd_nums { * or removal. */ #define HWRM_DBG_SIM_CABLE_STATE UINT32_C(0xff2e) + /* + * This command is called to obtain a board's debug authorization id (DAI) + * and token nonce (cti aka CWT ID used to prevent replay) from a NIC. + * This is the data from the device required to produce a debug enable + * token which is tied specifically to an individual NIC. + */ + #define HWRM_DBG_TOKEN_QUERY_AUTH_IDS UINT32_C(0xff2f) + /* This API is used to enable or disable a debug enable token. */ + #define HWRM_DBG_TOKEN_CFG UINT32_C(0xff30) #define HWRM_NVM_GET_VPD_FIELD_INFO UINT32_C(0xffea) #define HWRM_NVM_SET_VPD_FIELD_INFO UINT32_C(0xffeb) #define HWRM_NVM_DEFRAG UINT32_C(0xffec) @@ -1722,6 +1783,11 @@ typedef struct ret_codes { * requested by the host is not present or does not exist. */ #define HWRM_ERR_CODE_ENTITY_NOT_PRESENT UINT32_C(0x13) + /* + * This error code is reported by Firmware when the secure soc is not + * responding. + */ + #define HWRM_ERR_CODE_SECURE_SOC_ERROR UINT32_C(0x14) /* * This value indicates that the HWRM response is in TLV format and * should be interpreted as one or more TLVs starting with the @@ -1760,7 +1826,8 @@ typedef struct ret_codes { ((x) == 0x11 ? "RESOURCE_LOCKED": \ ((x) == 0x12 ? "PF_UNAVAILABLE": \ ((x) == 0x13 ? "ENTITY_NOT_PRESENT": \ - "Unknown decode" )))))))))))))))))))) : \ + ((x) == 0x14 ? "SECURE_SOC_ERROR": \ + "Unknown decode" ))))))))))))))))))))) : \ (((x) < 0x8080) ? \ ((x) == 0x8000 ? "TLV_ENCAPSULATED_RESPONSE": \ "Unknown decode" ) : \ @@ -1848,8 +1915,8 @@ typedef struct hwrm_err_output { #define HWRM_VERSION_MINOR 10 #define HWRM_VERSION_UPDATE 3 /* non-zero means beta version */ -#define HWRM_VERSION_RSVD 61 -#define HWRM_VERSION_STR "1.10.3.61" +#define HWRM_VERSION_RSVD 147 +#define HWRM_VERSION_STR "1.10.3.147" /**************** * hwrm_ver_get * @@ -2158,6 +2225,12 @@ typedef struct hwrm_ver_get_output { * feature. */ #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SECURE_SOC_CAPABLE UINT32_C(0x10000) + /* + * If set to 1, then firmware is able to support secure debug tokens + * to enable debug on release builds. + * If set to 0, then firmware does not support debug tokens. + */ + #define HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_DEBUG_TOKEN_SUPPORTED UINT32_C(0x20000) /* * This field represents the major version of RoCE firmware. * A change in major version represents a major release. @@ -9850,8 +9923,10 @@ typedef struct hwrm_async_event_cmpl { * the coredump has been captured. */ #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HOST_COREDUMP UINT32_C(0x50) + /* Used to notify invalid adaptive QoS configuration events. */ + #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ADPTV_QOS UINT32_C(0x51) /* Maximum Registrable event id. */ - #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_MAX_RGTR_EVENT_ID UINT32_C(0x51) + #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_MAX_RGTR_EVENT_ID UINT32_C(0x52) /* * A trace log message. This contains firmware trace logs string * embedded in the asynchronous message. This is an experimental @@ -9932,8 +10007,9 @@ typedef struct hwrm_async_event_cmpl { ((x) == 0x4e ? "REPRESENTOR_PAIR_CHANGE": \ ((x) == 0x4f ? "VF_STAT_CHANGE": \ ((x) == 0x50 ? "HOST_COREDUMP": \ - ((x) == 0x51 ? "MAX_RGTR_EVENT_ID": \ - "Unknown decode" )))))))))))))))))))))))))))))))))))))))))))))))))) : \ + ((x) == 0x51 ? "ADPTV_QOS": \ + ((x) == 0x52 ? "MAX_RGTR_EVENT_ID": \ + "Unknown decode" ))))))))))))))))))))))))))))))))))))))))))))))))))) : \ (((x) < 0x100) ? \ ((x) == 0xfe ? "FW_TRACE_MSG": \ ((x) == 0xff ? "HWRM_ERROR": \ @@ -12432,8 +12508,8 @@ typedef struct hwrm_async_event_cmpl_dbg_buf_producer { * value of 8192. This field rolls over to zero once the firmware * writes the last page of the host buffer */ - #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA2_CURRENT_BUFFER_OFFSET_MASK UINT32_C(0xffffffff) - #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA2_CURRENT_BUFFER_OFFSET_SFT 0 + #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA2_CURR_OFF_MASK UINT32_C(0xffffffff) + #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA2_CURR_OFF_SFT 0 uint8_t opaque_v; /* * This value is written by the NIC such that it will be different @@ -12451,31 +12527,35 @@ typedef struct hwrm_async_event_cmpl_dbg_buf_producer { /* Event specific data */ uint32_t event_data1; /* Type of trace buffer that has been updated. */ - #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_MASK UINT32_C(0xffff) + #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_MASK UINT32_C(0xffff) #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_SFT 0 - /* SRT trace. */ - #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_SRT_TRACE UINT32_C(0x0) - /* SRT2 trace. */ + /* SRT or APE trace. */ + #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_SRT_TRACE UINT32_C(0x0) + /* SRT2 or AFM/Kong trace. */ #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_SRT2_TRACE UINT32_C(0x1) - /* CRT trace. */ - #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_CRT_TRACE UINT32_C(0x2) - /* CRT2 trace. */ + /* CRT or ChiMP trace. */ + #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_CRT_TRACE UINT32_C(0x2) + /* CRT2 or Bono trace. */ #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_CRT2_TRACE UINT32_C(0x3) /* RIGP0 trace. */ #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_RIGP0_TRACE UINT32_C(0x4) - /* L2 HWRM trace. */ + /* L2 or ChiMP HWRM trace. */ #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_L2_HWRM_TRACE UINT32_C(0x5) - /* RoCE HWRM trace. */ - #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_ROCE_HWRM_TRACE UINT32_C(0x6) + /* RoCE or Bono HWRM trace. */ + #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_ROCE_HWRM_TRACE UINT32_C(0x6) /* Context Accelerator CPU 0 trace. */ - #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_CA0_TRACE UINT32_C(0x7) + #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_CA0_TRACE UINT32_C(0x7) /* Context Accelerator CPU 1 trace. */ - #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_CA1_TRACE UINT32_C(0x8) + #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_CA1_TRACE UINT32_C(0x8) /* Context Accelerator CPU 2 trace. */ - #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_CA2_TRACE UINT32_C(0x9) + #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_CA2_TRACE UINT32_C(0x9) /* RIGP1 trace. */ #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_RIGP1_TRACE UINT32_C(0xa) - #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_RIGP1_TRACE + /* AFM/Kong HWRM trace. */ + #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_AFM_KONG_HWRM_TRACE UINT32_C(0xb) + /* ctxm error QPC trace. */ + #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_ERR_QPC_TRACE UINT32_C(0xc) + #define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_ERR_QPC_TRACE } hwrm_async_event_cmpl_dbg_buf_producer_t, *phwrm_async_event_cmpl_dbg_buf_producer_t; /* hwrm_async_event_cmpl_peer_mmap_change (size:128b/16B) */ @@ -12743,7 +12823,32 @@ typedef struct hwrm_async_event_cmpl_error_report_base { * on this board. */ #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED UINT32_C(0x6) - #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED + /* + * In UDCC per-QP mode, NIC detects that a new QP being created has + * the same destination as an existing UDCC session. The UDCC session + * for the new QP will not be created in this error situation. + * This error normally occurs when the peer reuses the QPN of + * a destroyed QP for creating a new QP before the NIC frees + * the destroyed QP locally. + */ + #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DUP_UDCC_SES UINT32_C(0x7) + /* + * NIC detects that a doorbell has been dropped by hardware. + * This error normally occurs when the doorbell is mal-formatted + * by the driver or using values out of supported range by hardware. + */ + #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DB_DROP UINT32_C(0x8) + /* + * Indicates the module temperature has crossed one of the thermal + * thresholds. + */ + #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_MD_TEMP UINT32_C(0x9) + /* + * Indicates to the host that the VNIC hw context has gone into the + * error state. + */ + #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_VNIC_ERR UINT32_C(0xa) + #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_VNIC_ERR } hwrm_async_event_cmpl_error_report_base_t, *phwrm_async_event_cmpl_error_report_base_t; #define GET_ERROR_REPORT_TYPE(x) \ @@ -12755,7 +12860,11 @@ typedef struct hwrm_async_event_cmpl_error_report_base { ((x) == 0x4 ? "DOORBELL_DROP_THRESHOLD": \ ((x) == 0x5 ? "THERMAL_THRESHOLD": \ ((x) == 0x6 ? "DUAL_DATA_RATE_NOT_SUPPORTED": \ - "Unknown decode" ))))))) : \ + ((x) == 0x7 ? "DUP_UDCC_SES": \ + ((x) == 0x8 ? "DB_DROP": \ + ((x) == 0x9 ? "MD_TEMP": \ + ((x) == 0xa ? "VNIC_ERR": \ + "Unknown decode" ))))))))))) : \ "Unknown decode" ) @@ -13154,6 +13263,333 @@ typedef struct hwrm_async_event_cmpl_error_report_dual_data_rate_not_supported { #define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_EVENT_DATA1_ERROR_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_DUAL_DATA_RATE_NOT_SUPPORTED_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED } hwrm_async_event_cmpl_error_report_dual_data_rate_not_supported_t, *phwrm_async_event_cmpl_error_report_dual_data_rate_not_supported_t; +/* hwrm_async_error_report_dup_udcc_ses (size:128b/16B) */ + +typedef struct hwrm_async_error_report_dup_udcc_ses { + uint16_t type; + /* + * This field indicates the exact type of the completion. + * By convention, the LSB identifies the length of the + * record in 16B units. Even values indicate 16B + * records. Odd values indicate 32B + * records. + */ + #define HWRM_ASYNC_ERROR_REPORT_DUP_UDCC_SES_TYPE_MASK UINT32_C(0x3f) + #define HWRM_ASYNC_ERROR_REPORT_DUP_UDCC_SES_TYPE_SFT 0 + /* HWRM Asynchronous Event Information */ + #define HWRM_ASYNC_ERROR_REPORT_DUP_UDCC_SES_TYPE_ASYNC_EVENT UINT32_C(0x2e) + #define HWRM_ASYNC_ERROR_REPORT_DUP_UDCC_SES_TYPE_LAST HWRM_ASYNC_ERROR_REPORT_DUP_UDCC_SES_TYPE_ASYNC_EVENT + /* Identifiers of events. */ + uint16_t event_id; + /* + * This async notification message is used to inform + * the driver that an error has occurred which may need + * the attention of the administrator. + */ + #define HWRM_ASYNC_ERROR_REPORT_DUP_UDCC_SES_EVENT_ID_ERROR_REPORT UINT32_C(0x45) + #define HWRM_ASYNC_ERROR_REPORT_DUP_UDCC_SES_EVENT_ID_LAST HWRM_ASYNC_ERROR_REPORT_DUP_UDCC_SES_EVENT_ID_ERROR_REPORT + /* Event specific data. */ + uint32_t event_data2; + /* Destination QPN of the QP being created */ + #define HWRM_ASYNC_ERROR_REPORT_DUP_UDCC_SES_DST_QPN_MASK UINT32_C(0xffffff) + #define HWRM_ASYNC_ERROR_REPORT_DUP_UDCC_SES_DST_QPN_SFT 0 + uint8_t opaque_v; + /* + * This value is written by the NIC such that it will be different + * for each pass through the completion queue. The even passes + * will write 1. The odd passes will write 0. + */ + #define HWRM_ASYNC_ERROR_REPORT_DUP_UDCC_SES_V UINT32_C(0x1) + /* opaque is 7 b */ + #define HWRM_ASYNC_ERROR_REPORT_DUP_UDCC_SES_OPAQUE_MASK UINT32_C(0xfe) + #define HWRM_ASYNC_ERROR_REPORT_DUP_UDCC_SES_OPAQUE_SFT 1 + /* 8-lsb timestamp (100-msec resolution) */ + uint8_t timestamp_lo; + /* 16-lsb timestamp (100-msec resolution) */ + uint16_t timestamp_hi; + /* Event specific data */ + uint32_t event_data1; + /* Indicates the type of error being reported. */ + #define HWRM_ASYNC_ERROR_REPORT_DUP_UDCC_SES_ERROR_TYPE_MASK UINT32_C(0xff) + #define HWRM_ASYNC_ERROR_REPORT_DUP_UDCC_SES_ERROR_TYPE_SFT 0 + /* + * In UDCC per-QP mode, NIC detects that a new QP being created has + * the same destination as an existing UDCC session. The UDCC session + * for the new QP will not be created in this error situation. + * This error normally occurs when the peer reuses the QPN of + * a destroyed QP for creating a new QP before the NIC frees + * the destroyed QP locally. + */ + #define HWRM_ASYNC_ERROR_REPORT_DUP_UDCC_SES_ERROR_TYPE_DUP_SES UINT32_C(0x7) + #define HWRM_ASYNC_ERROR_REPORT_DUP_UDCC_SES_ERROR_TYPE_LAST HWRM_ASYNC_ERROR_REPORT_DUP_UDCC_SES_ERROR_TYPE_DUP_SES + /* Source QPN of the QP being created */ + #define HWRM_ASYNC_ERROR_REPORT_DUP_UDCC_SES_SRC_QPN_MASK UINT32_C(0xffffff00) + #define HWRM_ASYNC_ERROR_REPORT_DUP_UDCC_SES_SRC_QPN_SFT 8 +} hwrm_async_error_report_dup_udcc_ses_t, *phwrm_async_error_report_dup_udcc_ses_t; + +/* hwrm_async_error_report_db_drop (size:128b/16B) */ + +typedef struct hwrm_async_error_report_db_drop { + uint16_t type; + /* + * This field indicates the exact type of the completion. + * By convention, the LSB identifies the length of the + * record in 16B units. Even values indicate 16B + * records. Odd values indicate 32B + * records. + */ + #define HWRM_ASYNC_ERROR_REPORT_DB_DROP_TYPE_MASK UINT32_C(0x3f) + #define HWRM_ASYNC_ERROR_REPORT_DB_DROP_TYPE_SFT 0 + /* HWRM Asynchronous Event Information */ + #define HWRM_ASYNC_ERROR_REPORT_DB_DROP_TYPE_ASYNC_EVENT UINT32_C(0x2e) + #define HWRM_ASYNC_ERROR_REPORT_DB_DROP_TYPE_LAST HWRM_ASYNC_ERROR_REPORT_DB_DROP_TYPE_ASYNC_EVENT + /* Identifiers of events. */ + uint16_t event_id; + /* + * This async notification message is used to inform + * the driver that an error has occurred which may need + * the attention of the administrator. + */ + #define HWRM_ASYNC_ERROR_REPORT_DB_DROP_EVENT_ID_ERROR_REPORT UINT32_C(0x45) + #define HWRM_ASYNC_ERROR_REPORT_DB_DROP_EVENT_ID_LAST HWRM_ASYNC_ERROR_REPORT_DB_DROP_EVENT_ID_ERROR_REPORT + /* Event specific data. */ + uint32_t event_data2; + uint8_t opaque_v; + /* + * This value is written by the NIC such that it will be different + * for each pass through the completion queue. The even passes + * will write 1. The odd passes will write 0. + */ + #define HWRM_ASYNC_ERROR_REPORT_DB_DROP_V UINT32_C(0x1) + /* opaque is 7 b */ + #define HWRM_ASYNC_ERROR_REPORT_DB_DROP_OPAQUE_MASK UINT32_C(0xfe) + #define HWRM_ASYNC_ERROR_REPORT_DB_DROP_OPAQUE_SFT 1 + /* 8-lsb timestamp (100-msec resolution) */ + uint8_t timestamp_lo; + /* 16-lsb timestamp (100-msec resolution) */ + uint16_t timestamp_hi; + /* Event specific data */ + uint32_t event_data1; + /* Indicates the type of error being reported. */ + #define HWRM_ASYNC_ERROR_REPORT_DB_DROP_ERROR_TYPE_MASK UINT32_C(0xff) + #define HWRM_ASYNC_ERROR_REPORT_DB_DROP_ERROR_TYPE_SFT 0 + /* + * NIC detects that a doorbell has been dropped by hardware. + * This error normally occurs when the doorbell is mal-formatted + * by the driver or using values out of supported range by hardware. + */ + #define HWRM_ASYNC_ERROR_REPORT_DB_DROP_ERROR_TYPE_DB_DROP UINT32_C(0x8) + #define HWRM_ASYNC_ERROR_REPORT_DB_DROP_ERROR_TYPE_LAST HWRM_ASYNC_ERROR_REPORT_DB_DROP_ERROR_TYPE_DB_DROP + /* + * The doorbell drops debug info. Encoded with device specific hardware + * block ID and event ID. + */ + #define HWRM_ASYNC_ERROR_REPORT_DB_DROP_DROP_DEBUG_INFO_MASK UINT32_C(0xffffff00) + #define HWRM_ASYNC_ERROR_REPORT_DB_DROP_DROP_DEBUG_INFO_SFT 8 +} hwrm_async_error_report_db_drop_t, *phwrm_async_error_report_db_drop_t; + +/* hwrm_async_error_report_md_temp (size:128b/16B) */ + +typedef struct hwrm_async_error_report_md_temp { + uint16_t type; + /* + * This field indicates the exact type of the completion. + * By convention, the LSB identifies the length of the + * record in 16B units. Even values indicate 16B + * records. Odd values indicate 32B + * records. + */ + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_TYPE_MASK UINT32_C(0x3f) + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_TYPE_SFT 0 + /* HWRM Asynchronous Event Information */ + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e) + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_TYPE_LAST HWRM_ASYNC_ERROR_REPORT_MD_TEMP_TYPE_HWRM_ASYNC_EVENT + /* Identifiers of events. */ + uint16_t event_id; + /* + * This async notification message is used to inform + * the driver that an error has occurred which may need + * the attention of the administrator. + */ + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_EVENT_ID_ERROR_REPORT UINT32_C(0x45) + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_EVENT_ID_LAST HWRM_ASYNC_ERROR_REPORT_MD_TEMP_EVENT_ID_ERROR_REPORT + /* Event specific data. */ + uint32_t event_data2; + /* Current temperature. In Celsius */ + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_EVENT_DATA2_CUR_TEMP_MASK UINT32_C(0xff) + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_EVENT_DATA2_CUR_TEMP_SFT 0 + /* + * The temperature setting of the threshold that was just crossed. + * In Celsius + */ + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_EVENT_DATA2_THR_TEMP_MASK UINT32_C(0xff00) + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_EVENT_DATA2_THR_TEMP_SFT 8 + /* Indicates the module on which this temperature change occurred */ + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_EVENT_DATA2_MODULE_MASK UINT32_C(0xff0000) + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_EVENT_DATA2_MODULE_SFT 16 + uint8_t opaque_v; + /* + * This value is written by the NIC such that it will be different + * for each pass through the completion queue. The even passes + * will write 1. The odd passes will write 0. + */ + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_V UINT32_C(0x1) + /* opaque is 7 b */ + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_OPAQUE_MASK UINT32_C(0xfe) + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_OPAQUE_SFT 1 + /* 8-lsb timestamp (100-msec resolution) */ + uint8_t timestamp_lo; + /* 16-lsb timestamp (100-msec resolution) */ + uint16_t timestamp_hi; + /* Event specific data */ + uint32_t event_data1; + /* Indicates the type of error being reported. */ + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_ERROR_TYPE_MASK UINT32_C(0xff) + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_ERROR_TYPE_SFT 0 + /* + * There was module thermal event. The type will be specified + * in the threshold_type. event_data2 will contain the current + * temperature and the configured value for the threshold that + * was just crossed. The threshold values are lower thresholds, + * so the event will trigger with an active flag when the + * temperature is on an increasing trajectory. + */ + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_ERROR_TYPE_MD_TEMP UINT32_C(0x9) + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_ERROR_TYPE_LAST HWRM_ASYNC_ERROR_REPORT_MD_TEMP_ERROR_TYPE_MD_TEMP + /* The specific type of thermal threshold error */ + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_TTYPE_MASK UINT32_C(0xff00) + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_TTYPE_SFT 8 + /* Warning thermal threshold was crossed */ + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_TTYPE_SFP_WARN (UINT32_C(0x0) << 8) + /* Alarm thermal threshold was crossed */ + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_TTYPE_SFP_ALM (UINT32_C(0x1) << 8) + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_TTYPE_LAST HWRM_ASYNC_ERROR_REPORT_MD_TEMP_TTYPE_SFP_ALM + /* + * Indicates if the thermal crossing occurs while the temperature is + * increasing or decreasing. + */ + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_DIR UINT32_C(0x10000) + /* Threshold is crossed while the temperature is falling. */ + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_DIR_FALL (UINT32_C(0x0) << 16) + /* Threshold is crossed while the temperature is rising. */ + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_DIR_RISE (UINT32_C(0x1) << 16) + #define HWRM_ASYNC_ERROR_REPORT_MD_TEMP_DIR_LAST HWRM_ASYNC_ERROR_REPORT_MD_TEMP_DIR_RISE +} hwrm_async_error_report_md_temp_t, *phwrm_async_error_report_md_temp_t; + +/* hwrm_async_error_report_vnic_err (size:128b/16B) */ + +typedef struct hwrm_async_error_report_vnic_err { + uint16_t type; + /* + * This field indicates the exact type of the completion. + * By convention, the LSB identifies the length of the + * record in 16B units. Even values indicate 16B + * records. Odd values indicate 32B + * records. + */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_TYPE_MASK UINT32_C(0x3f) + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_TYPE_SFT 0 + /* HWRM Asynchronous Event Information */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e) + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_TYPE_LAST HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_TYPE_HWRM_ASYNC_EVENT + /* Identifiers of events. */ + uint16_t event_id; + /* + * This async notification message is used to inform + * the driver that an error has occurred which may need + * the attention of the administrator. + */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_EVENT_ID_ERROR_REPORT UINT32_C(0x45) + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_EVENT_ID_LAST HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_EVENT_ID_ERROR_REPORT + /* Event specific data. */ + uint32_t event_data2; + /* + * The VNIC ID that was reported to the driver by firmware in + * response to HWRM_VNIC_ALLOC. + */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_EVENT_DATA2_VNIC_ID_MASK UINT32_C(0xffff) + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_EVENT_DATA2_VNIC_ID_SFT 0 + /* + * The internal firmware identifier for the VNIC + * context ID + */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_EVENT_DATA2_CTXM_XID_MASK UINT32_C(0xffff0000) + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_EVENT_DATA2_CTXM_XID_SFT 16 + uint8_t opaque_v; + /* + * This value is written by the NIC such that it will be different + * for each pass through the completion queue. The even passes + * will write 1. The odd passes will write 0. + */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_V UINT32_C(0x1) + /* opaque is 7 b */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_OPAQUE_MASK UINT32_C(0xfe) + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_OPAQUE_SFT 1 + /* 8-lsb timestamp (100-msec resolution) */ + uint8_t timestamp_lo; + /* 16-lsb timestamp (100-msec resolution) */ + uint16_t timestamp_hi; + /* Event specific data */ + uint32_t event_data1; + /* Indicates the type of error being reported. */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_ERROR_TYPE_MASK UINT32_C(0xff) + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_ERROR_TYPE_SFT 0 + /* + * Indicates to the host that the VNIC hw context has gone into the + * error state. + */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_ERROR_TYPE_VNIC_ERR UINT32_C(0xa) + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_ERROR_TYPE_LAST HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_ERROR_TYPE_VNIC_ERR + /* The hardware specific error state reason. */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_VNIC_ERR_REASON_MASK UINT32_C(0xff00) + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_VNIC_ERR_REASON_SFT 8 + /* No error. */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_VNIC_ERR_REASON_NO_ERR (UINT32_C(0x0) << 8) + /* + * A load error occurred on an attempt to load the Ring + * Table Context. + */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_VNIC_ERR_REASON_RT_LOAD_ERR (UINT32_C(0x1) << 8) + /* Rx Ring is not in the valid state. */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_VNIC_ERR_REASON_RX_RING_ERR (UINT32_C(0x12) << 8) + /* + * Agg ring is not in the valid state and an attempt was + * made to use jumbo, HDS, or statistics ejection + * placement. + */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_VNIC_ERR_REASON_AGG_RING_ERR (UINT32_C(0x13) << 8) + /* + * Completion error. No space available on completion ring, + * or completion ring not in VALID state. + */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_VNIC_ERR_REASON_CMP_ERR (UINT32_C(0x14) << 8) + /* + * Problem was found in the format of a BD on the rx or agg + * ring. + */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_VNIC_ERR_REASON_BD_FORMAT_ERR (UINT32_C(0x16) << 8) + /* A packet did not fit in the buffer(s) provided. */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_VNIC_ERR_REASON_DID_NOT_FIT_ERR (UINT32_C(0x17) << 8) + /* A load error occurred on an attempt to load the CQ Context. */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_VNIC_ERR_REASON_CQ_LOAD_ERR (UINT32_C(0x18) << 8) + /* + * A load error occurred on an attempt to load the context for + * the rx ring, or the context loaded but the type is not l2. + */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_VNIC_ERR_REASON_RX_RING_LOAD_ERR (UINT32_C(0x19) << 8) + /* + * A load error occurred on the context load for the agg ring, + * or the context loaded but the type is not l2. + */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_VNIC_ERR_REASON_AGG_RING_LOAD_ERR (UINT32_C(0x1a) << 8) + /* + * A fatal error was detected on an attempt to read from or + * write to PCIe on the receive side. + */ + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_VNIC_ERR_REASON_PCI_ERR (UINT32_C(0x1b) << 8) + #define HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_VNIC_ERR_REASON_LAST HWRM_ASYNC_ERROR_REPORT_VNIC_ERR_VNIC_ERR_REASON_PCI_ERR +} hwrm_async_error_report_vnic_err_t, *phwrm_async_error_report_vnic_err_t; + /* hwrm_async_event_cmpl_vf_stat_change (size:128b/16B) */ typedef struct hwrm_async_event_cmpl_vf_stat_change { @@ -13262,6 +13698,59 @@ typedef struct hwrm_async_event_cmpl_host_coredump { uint32_t event_data1; } hwrm_async_event_cmpl_host_coredump_t, *phwrm_async_event_cmpl_host_coredump_t; +/* hwrm_async_event_cmpl_adptv_qos (size:128b/16B) */ + +typedef struct hwrm_async_event_cmpl_adptv_qos { + uint16_t type; + /* + * This field indicates the exact type of the completion. + * By convention, the LSB identifies the length of the + * record in 16B units. Even values indicate 16B + * records. Odd values indicate 32B + * records. + */ + #define HWRM_ASYNC_EVENT_CMPL_ADPTV_QOS_TYPE_MASK UINT32_C(0x3f) + #define HWRM_ASYNC_EVENT_CMPL_ADPTV_QOS_TYPE_SFT 0 + /* HWRM Asynchronous Event Information */ + #define HWRM_ASYNC_EVENT_CMPL_ADPTV_QOS_TYPE_HWRM_ASYNC_EVENT UINT32_C(0x2e) + #define HWRM_ASYNC_EVENT_CMPL_ADPTV_QOS_TYPE_LAST HWRM_ASYNC_EVENT_CMPL_ADPTV_QOS_TYPE_HWRM_ASYNC_EVENT + /* Identifiers of events. */ + uint16_t event_id; + /* + * Used to notify adaptive QoS configuration events. + * Firmware fallback to default settings. + */ + #define HWRM_ASYNC_EVENT_CMPL_ADPTV_QOS_EVENT_ID_ADPTV_QOS UINT32_C(0x51) + #define HWRM_ASYNC_EVENT_CMPL_ADPTV_QOS_EVENT_ID_LAST HWRM_ASYNC_EVENT_CMPL_ADPTV_QOS_EVENT_ID_ADPTV_QOS + /* Event specific data */ + uint32_t event_data2; + uint8_t opaque_v; + /* + * This value is written by the NIC such that it will be different + * for each pass through the completion queue. The even passes + * will write 1. The odd passes will write 0. + */ + #define HWRM_ASYNC_EVENT_CMPL_ADPTV_QOS_V UINT32_C(0x1) + /* opaque is 7 b */ + #define HWRM_ASYNC_EVENT_CMPL_ADPTV_QOS_OPAQUE_MASK UINT32_C(0xfe) + #define HWRM_ASYNC_EVENT_CMPL_ADPTV_QOS_OPAQUE_SFT 1 + /* 8-lsb timestamp (100-msec resolution) */ + uint8_t timestamp_lo; + /* 16-lsb timestamp (100-msec resolution) */ + uint16_t timestamp_hi; + /* Event specific data */ + uint32_t event_data1; + /* Indicates the type of invalid adaptive QoS configuration. */ + #define HWRM_ASYNC_EVENT_CMPL_ADPTV_QOS_EVENT_DATA1_INVAL_MASK UINT32_C(0xff) + #define HWRM_ASYNC_EVENT_CMPL_ADPTV_QOS_EVENT_DATA1_INVAL_SFT 0 + /* + * This value indicates that the PFC headroom factor threshold value + * is out of bounds. + */ + #define HWRM_ASYNC_EVENT_CMPL_ADPTV_QOS_EVENT_DATA1_INVAL_HEADROOM UINT32_C(0x0) + #define HWRM_ASYNC_EVENT_CMPL_ADPTV_QOS_EVENT_DATA1_INVAL_LAST HWRM_ASYNC_EVENT_CMPL_ADPTV_QOS_EVENT_DATA1_INVAL_HEADROOM +} hwrm_async_event_cmpl_adptv_qos_t, *phwrm_async_event_cmpl_adptv_qos_t; + /* metadata_base_msg (size:64b/8B) */ typedef struct metadata_base_msg { @@ -14758,6 +15247,52 @@ typedef struct hwrm_func_vf_cfg_output { uint8_t valid; } hwrm_func_vf_cfg_output_t, *phwrm_func_vf_cfg_output_t; +/* hwrm_func_vf_cfg_cmd_err (size:64b/8B) */ + +typedef struct hwrm_func_vf_cfg_cmd_err { + /* + * command specific error codes for the command + * hwrm_func_vf_cfg. + */ + uint8_t code; + /* Unknown error. */ + #define HWRM_FUNC_VF_CFG_CMD_ERR_CODE_UNKNOWN UINT32_C(0x0) + /* Failed to perform TX ring asset test. */ + #define HWRM_FUNC_VF_CFG_CMD_ERR_CODE_TX_RING_ASSET_TEST_FAILED UINT32_C(0x1) + /* Failed to update TX ring PF reservation. */ + #define HWRM_FUNC_VF_CFG_CMD_ERR_CODE_TX_RING_RES_UPDATE_FAILED UINT32_C(0x2) + /* Failed to perform RSSCOS context asset test. */ + #define HWRM_FUNC_VF_CFG_CMD_ERR_CODE_RSS_CTXT_ASSET_TEST_FAILED UINT32_C(0x3) + /* Failed to update RSSCOS context PF reservation. */ + #define HWRM_FUNC_VF_CFG_CMD_ERR_CODE_RSS_CTXT_RES_UPDATE_FAILED UINT32_C(0x4) + /* Failed to perform completion ring asset test. */ + #define HWRM_FUNC_VF_CFG_CMD_ERR_CODE_CMPL_RING_ASSET_TEST_FAILED UINT32_C(0x5) + /* Failed to update completion ring PF reservation. */ + #define HWRM_FUNC_VF_CFG_CMD_ERR_CODE_CMPL_RING_RES_UPDATE_FAILED UINT32_C(0x6) + /* Failed to perform RX ring asset test. */ + #define HWRM_FUNC_VF_CFG_CMD_ERR_CODE_RX_RING_ASSET_TEST_FAILED UINT32_C(0x7) + /* Failed to update RX ring PF reservation. */ + #define HWRM_FUNC_VF_CFG_CMD_ERR_CODE_RX_RING_RES_UPDATE_FAILED UINT32_C(0x8) + /* Failed to perform VNIC asset test. */ + #define HWRM_FUNC_VF_CFG_CMD_ERR_CODE_VNIC_ASSET_TEST_FAILED UINT32_C(0x9) + /* Failed to update VNIC ring PF reservation. */ + #define HWRM_FUNC_VF_CFG_CMD_ERR_CODE_VNIC_RES_UPDATE_FAILED UINT32_C(0xa) + /* Failed to sync and start STATS thread. */ + #define HWRM_FUNC_VF_CFG_CMD_ERR_CODE_SYNC_STATS_THREAD_FAILED UINT32_C(0xb) + /* Not enough l2_ctxt_entries available for the VF. */ + #define HWRM_FUNC_VF_CFG_CMD_ERR_CODE_L2_CTXT_RES_ALLOC_FAILED UINT32_C(0xc) + /* Failed to update TX KTLS PF reservation. */ + #define HWRM_FUNC_VF_CFG_CMD_ERR_CODE_TX_KTLS_RES_UPDATE_FAILED UINT32_C(0xd) + /* Failed to update RX KTLS PF reservation. */ + #define HWRM_FUNC_VF_CFG_CMD_ERR_CODE_RX_KTLS_RES_UPDATE_FAILED UINT32_C(0xe) + /* Failed to update TX QUIC PF reservation. */ + #define HWRM_FUNC_VF_CFG_CMD_ERR_CODE_TX_QUIC_RES_UPDATE_FAILED UINT32_C(0xf) + /* Failed to update RX QUIC PF reservation. */ + #define HWRM_FUNC_VF_CFG_CMD_ERR_CODE_RX_QUIC_RES_UPDATE_FAILED UINT32_C(0x10) + #define HWRM_FUNC_VF_CFG_CMD_ERR_CODE_LAST HWRM_FUNC_VF_CFG_CMD_ERR_CODE_RX_QUIC_RES_UPDATE_FAILED + uint8_t unused_0[7]; +} hwrm_func_vf_cfg_cmd_err_t, *phwrm_func_vf_cfg_cmd_err_t; + /******************* * hwrm_func_qcaps * *******************/ @@ -15075,9 +15610,7 @@ typedef struct hwrm_func_qcaps_output { /* * The maximum number of VFs that can be * allocated to the function. This is valid only on the - * PF with SR-IOV enabled. 0xFF... (All Fs) if this - * command is called on a PF with SR-IOV disabled or - * on a VF. + * PF with SR-IOV enabled. */ uint16_t max_vfs; /* @@ -15687,8 +16220,88 @@ typedef struct hwrm_func_qcaps_output { * if the driver tries to set the reservation to be less than the * number of allocated resources. */ - #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT3_RM_RSV_WHILE_ALLOC_CAP UINT32_C(0x1) - uint8_t unused_3[7]; + #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT3_RM_RSV_WHILE_ALLOC_CAP UINT32_C(0x1) + /* + * When this bit is '1', the PF requires an L2 filter to be + * allocated by the driver using HWRM_CFA_L2_FILTER_ALLOC after + * bringing the interface up, before traffic is sent. + */ + #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT3_REQUIRE_L2_FILTER UINT32_C(0x2) + /* + * When set to 1, indicates the field max_roce_vfs in the structure + * is valid. If this bit is 0, the driver should not use the + * 'max_roce_vfs' field. + */ + #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT3_MAX_ROCE_VFS_SUPPORTED UINT32_C(0x4) + /* + * When set to 1, indicates the field 'rx_rate_profile_sel' in + * RING_ALLOC can specify a valid RX rate profile when allocating + * RX or RX aggregation rings. If this bit is 0, the driver + * should not use the 'rx_rate_profile_sel' field. + */ + #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT3_RX_RATE_PROFILE_SEL_SUPPORTED UINT32_C(0x8) + /* + * When set to 1, indicates that the device is capable of supporting + * the RoCE bi-directional optimization feature. + */ + #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT3_BIDI_OPT_SUPPORTED UINT32_C(0x10) + /* + * When set to 1, indicates that the device is capable of supporting + * port mirroring on RoCE device. + */ + #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT3_MIRROR_ON_ROCE_SUPPORTED UINT32_C(0x20) + /* + * When set to 1, indicates that the PF is capable of supporting + * dynamic distribution of RoCE resources amongst its VFs + */ + #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT3_ROCE_VF_DYN_ALLOC_SUPPORT UINT32_C(0x40) + /* + * When set to 1, indicates that the device supports changing UDP + * source port of RoCEv2 packets + */ + #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT3_CHANGE_UDP_SRCPORT_SUPPORT UINT32_C(0x80) + /* + * When set to 1, indicates that the device supports enabling or + * disabling pcie compliance. + */ + #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT3_PCIE_COMPLIANCE_SUPPORTED UINT32_C(0x100) + /* + * When this bit is '1', it indicates that, when rx/tx/cq/nq l2 + * rings are allocated, each ring can be associated with a + * non-common doorbell page index. When '0', a common doorbell + * page is used for all rings on a PF. This bit is only set on a + * PF. + */ + #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT3_MULTI_L2_DB_SUPPORTED UINT32_C(0x200) + /* + * When this bit is '1', it indicates that the firmware supports + * PCIe secure ATS solution. + */ + #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT3_PCIE_SECURE_ATS_SUPPORTED UINT32_C(0x400) + /* *** 12097 LINES SKIPPED *** From nobody Mon Jun 15 11:35:36 2026 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 4gf7N8696xz6hBps for ; Mon, 15 Jun 2026 11:35: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gf7N83X69z3Jbb for ; Mon, 15 Jun 2026 11:35:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781523336; 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; bh=wpFXZdYt6lulZ2/pKhg2eBTFy0DR/OYm0BO7N7FpZbg=; b=hDWeJAVMeddRx2MVhDRPMeqkBmbk5vlzibx4RMvZUNj/rPkn8OcoKbaUdb7nFO90UJ6rdw MAkhYJcZ1mPYjudozg+J1MeZGcYx/i/g1aUndflb7a+FzpS6X3GWVh6MrV9J/hz9gFuVkG lIb33l4gXR/HQXvrqsbt8lqx43o5852ZbmOUz9877ULDoGU/4wCvj5yV9Z4TNXxW8PnhaD n7f8sbOw9wgd4YYzmLwniWoGH7PDqmkDuDzmi/4XYfH61L1iD6vmx7vzNL7b+PBZ62mSa6 QKWoGMFEMDAOLYxzRVbCa8jcu68g+8o7Ogki2uh9v4grldGHfXrxNuPJYLBz2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781523336; a=rsa-sha256; cv=none; b=JoqZ47bexAF5vJ5A2TzP9Ha/p2cgv3m6gFrN6mP9VgL+sMgjueZg/z7Io0XyJPVp19AEpU yW6rzxd7XFVHJ4iGd5Tw/D9g+h4x/C9JJS9vt+0G7iV42ICG+b4U8ygOksZx0U8Z2sgyXg xcELfQnsHbkWQbAaz+H/wQm8dDsGtzGzO6B4HdR60ctXhBpnvMO/jvYuCUQUH4qz5rIAPG 2t00rMIs81yjm5o49xQ0XLLycV+7jToLxqLwxz0iOF+2UbXhzaluNB2S4ffqQR3HPY3RvJ +fOk3YBNHq1spaqa54uqazdqNnXdqxIFLAU+ouG9j+oYHXKwbx6wKE0ISHgt1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781523336; 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; bh=wpFXZdYt6lulZ2/pKhg2eBTFy0DR/OYm0BO7N7FpZbg=; b=nTH+noao6Upgf04KEvjNpSjEqDySYkKAJBYI4IpFJK4eYjYuB536sj055MYzneURGL3kEr LDpZ/yl3U12LfryXJn63xtiXD0oRcL/aUn6c4EM3AlR8iUdofCIvaP6bCSqTxHnLCHUATZ hGfBGsN+6GZmUwnSItWpJpNWJPShSnpW1CW25fWOmjsv6mnNpFSsIO4U0mAFEaesM9Ln6/ d5H9SwjQFmnhq2OOmYBV8JdV2mX8kYeP5szYLxMTMVH8T3VN7/QM6LOS2xxXFP+oW0oGoJ tIxunJs9iczsmTjlztTHjRNHpZHqoe/5qSvHeePmf5uR+MveFacyYFGqAFE21g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gf7N833qNzsx4 for ; Mon, 15 Jun 2026 11:35:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1ec9f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 11:35:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Sreekanth Reddy From: Sumit Saxena Subject: git: 03839879a2dd - main - if_bnxt: Add Firmware crashdump collection 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ssaxena X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 03839879a2dd2505eab80b99211b0637ebdc9d32 Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 11:35:36 +0000 Message-Id: <6a2fe388.1ec9f.2de835f@gitrepo.freebsd.org> The branch main has been updated by ssaxena: URL: https://cgit.FreeBSD.org/src/commit/?id=03839879a2dd2505eab80b99211b0637ebdc9d32 commit 03839879a2dd2505eab80b99211b0637ebdc9d32 Author: Sreekanth Reddy AuthorDate: 2026-06-15 09:46:51 +0000 Commit: Sumit Saxena CommitDate: 2026-06-15 11:33:51 +0000 if_bnxt: Add Firmware crashdump collection support This patch adds support for DDR-based firmware coredump memory handling. It detects firmware coredump capability, allocates host DDR (DMA) memory for crash dumps, and programs the firmware with the allocated memory during attach. The allocated memory is released during driver detach. Also, This patch adds functions to retrieve crash dump data from host DDR memory. The implementation handles data copying from page tables and checks dump availability. Main function bnxt_get_coredump() copies stored crash dump data from DDR memory to the application buffer. MFC after: 2 weeks Reviewed by: gallatin, ssaxena Differential Revision: https://reviews.freebsd.org/D56684 --- sys/dev/bnxt/bnxt_en/bnxt.h | 20 ++++- sys/dev/bnxt/bnxt_en/bnxt_hwrm.c | 120 ++++++++++++++++++++++++++++++ sys/dev/bnxt/bnxt_en/bnxt_mgmt.c | 151 ++++++++++++++++++++++++++++++++++++++ sys/dev/bnxt/bnxt_en/bnxt_mgmt.h | 29 +++++++- sys/dev/bnxt/bnxt_en/if_bnxt.c | 48 ++++++++++-- sys/modules/bnxt/bnxt_en/Makefile | 1 + 6 files changed, 362 insertions(+), 7 deletions(-) diff --git a/sys/dev/bnxt/bnxt_en/bnxt.h b/sys/dev/bnxt/bnxt_en/bnxt.h index 554e24563db6..dfbf1d8f03d3 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt.h +++ b/sys/dev/bnxt/bnxt_en/bnxt.h @@ -1129,6 +1129,18 @@ struct bnxt_softc { uint16_t hwrm_cmd_seq; uint32_t hwrm_cmd_timeo; /* milliseconds */ + + /* DDR Crash Dump Support */ + struct bnxt_ctx_pg_info *fw_crash_mem; + uint32_t fw_crash_len; + uint32_t fw_dbg_cap; + #define BNXT_FW_DBG_CAP_CRASHDUMP_SOC 0x00000001 + #define BNXT_FW_DBG_CAP_CRASHDUMP_HOST 0x00000002 + uint16_t dump_flag; + #define BNXT_DUMP_LIVE 0 + #define BNXT_DUMP_CRASH 1 + #define BNXT_DUMP_DRIVER 2 + #define BNXT_DUMP_LIVE_WITH_CTX_L1_CACHE 3 struct iflib_dma_info hwrm_cmd_resp; struct iflib_dma_info hwrm_short_cmd_req_addr; /* Interrupt info for HWRM */ @@ -1220,6 +1232,7 @@ struct bnxt_softc { struct sysctl_oid *dcb_oid; struct bnxt_ver_info *ver_info; + struct hwrm_ver_get_output ver_resp; struct bnxt_nvram_info *nvm_info; bool wol; bool is_dev_init; @@ -1439,5 +1452,10 @@ int bnxt_dcb_ieee_listapp(struct bnxt_softc *softc, struct bnxt_dcb_app *app, size_t nitems, int *num_inputs); void bnxt_set_flags_by_devid(struct bnxt_softc *softc); int bnxt_hwrm_reserve_rings(struct bnxt_softc *softc); - +void bnxt_free_ctx_pg_tbls(struct bnxt_softc *softc, + struct bnxt_ctx_pg_info *ctx_pg); +int bnxt_alloc_ctx_pg_tbls(struct bnxt_softc *softc, + struct bnxt_ctx_pg_info *ctx_pg, + uint32_t mem_size, uint8_t depth, + struct bnxt_ctx_mem_type *ctxm); #endif /* _BNXT_H */ diff --git a/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c index b89a44e4677b..5964511f8276 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_en/bnxt_hwrm.c @@ -33,6 +33,7 @@ #include "bnxt.h" #include "bnxt_hwrm.h" #include "hsi_struct_def.h" +#include "bnxt_coredump.h" static int bnxt_hwrm_err_map(uint16_t err); static inline int _is_valid_ether_addr(uint8_t *); @@ -889,6 +890,8 @@ bnxt_hwrm_ver_get(struct bnxt_softc *softc) if (rc) goto fail; + memcpy(&softc->ver_resp, resp, sizeof(struct hwrm_ver_get_output)); + snprintf(softc->ver_info->hwrm_if_ver, BNXT_VERSTR_SIZE, "%d.%d.%d", resp->hwrm_intf_maj_8b, resp->hwrm_intf_min_8b, resp->hwrm_intf_upd_8b); softc->ver_info->hwrm_if_major = resp->hwrm_intf_maj_8b; @@ -3327,3 +3330,120 @@ void bnxt_hwrm_ring_info_get(struct bnxt_softc *softc, uint8_t ring_type, return; } + +/* Query debug capabilities */ +void +bnxt_hwrm_dbg_qcaps(struct bnxt_softc *softc) +{ + hwrm_dbg_qcaps_input_t req = {0}; + hwrm_dbg_qcaps_output_t *resp; + uint32_t flags; + int rc; + + softc->fw_dbg_cap = 0; + if (!(softc->fw_cap & BNXT_FW_CAP_DBG_QCAPS)) + return; + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_DBG_QCAPS); + req.fid = htole16(0xffff); + resp = (hwrm_dbg_qcaps_output_t *)(void *) + softc->hwrm_cmd_resp.idi_vaddr; + rc = hwrm_send_message(softc, &req, sizeof(req)); + if (rc) + return; + + flags = le32toh(resp->flags); + if (flags & HWRM_DBG_QCAPS_OUTPUT_FLAGS_CRASHDUMP_SOC_DDR) + softc->fw_dbg_cap |= BNXT_FW_DBG_CAP_CRASHDUMP_SOC; + if (flags & HWRM_DBG_QCAPS_OUTPUT_FLAGS_CRASHDUMP_HOST_DDR) + softc->fw_dbg_cap |= BNXT_FW_DBG_CAP_CRASHDUMP_HOST; +} + +/* Configure firmware with DDR crash dump memory */ +int +bnxt_hwrm_crash_dump_mem_cfg(struct bnxt_softc *softc) +{ + hwrm_dbg_crashdump_medium_cfg_input_t req = {0}; + uint16_t page_attr = 0; + int rc; + + if (!(softc->fw_dbg_cap & BNXT_FW_DBG_CAP_CRASHDUMP_HOST)) + return (0); + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_DBG_CRASHDUMP_MEDIUM_CFG); + + if (BNXT_PAGE_SIZE == 0x2000) + page_attr = HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_8K; + else if (BNXT_PAGE_SIZE == 0x10000) + page_attr = HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_64K; + else + page_attr = HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_PG_SIZE_PG_4K; + + req.pg_size_lvl = htole16(page_attr | + softc->fw_crash_mem->ring_mem.depth); + + if (softc->fw_crash_mem->ring_mem.depth > 1) + req.pbl = htole64( + softc->fw_crash_mem->ring_mem.pg_tbl.idi_paddr); + else + req.pbl = htole64( + softc->fw_crash_mem->ring_mem.pg_arr[0].idi_paddr); + + req.size = htole32(softc->fw_crash_len); + req.output_dest_flags = htole16( + HWRM_DBG_CRASHDUMP_MEDIUM_CFG_INPUT_TYPE_DDR); + + rc = hwrm_send_message(softc, &req, sizeof(req)); + return (rc); +} + +/* Get dump length from firmware */ +int +bnxt_hwrm_get_dump_len(struct bnxt_softc *softc, uint16_t dump_type, + uint32_t *dump_len) +{ + hwrm_dbg_qcfg_output_t *resp; + hwrm_dbg_qcfg_input_t req = {0}; + int rc; + + if (!(softc->fw_cap & BNXT_FW_CAP_DBG_QCAPS) || + dump_type == BNXT_DUMP_DRIVER) + return (-EOPNOTSUPP); + + if (dump_type == BNXT_DUMP_CRASH && + !(softc->fw_dbg_cap & BNXT_FW_DBG_CAP_CRASHDUMP_SOC || + (softc->fw_dbg_cap & BNXT_FW_DBG_CAP_CRASHDUMP_HOST))) + return (-EOPNOTSUPP); + + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_DBG_QCFG); + + req.fid = htole16(0xffff); + if (dump_type == BNXT_DUMP_CRASH) { + if (softc->fw_dbg_cap & BNXT_FW_DBG_CAP_CRASHDUMP_SOC) + req.flags = htole16( + HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_DEST_SOC_DDR); + else + req.flags = htole16( + HWRM_DBG_QCFG_INPUT_FLAGS_CRASHDUMP_SIZE_FOR_DEST_DEST_HOST_DDR); + } + + resp = (hwrm_dbg_qcfg_output_t *)(void *)softc->hwrm_cmd_resp.idi_vaddr; + rc = hwrm_send_message(softc, &req, sizeof(req)); + if (rc) + goto get_dump_len_exit; + + if (dump_type == BNXT_DUMP_CRASH) { + if (softc->fw_dbg_cap & BNXT_FW_DBG_CAP_CRASHDUMP_SOC) + *dump_len = BNXT_CRASH_DUMP_LEN; + else + *dump_len = le32toh(resp->crashdump_size); + } else { + *dump_len = le32_to_cpu(resp->coredump_size); + } + if (*dump_len <= 0) + rc = -EINVAL; + +get_dump_len_exit: + return (rc); +} + diff --git a/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c b/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c index fd6d7b904dca..0a12bea17ead 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c +++ b/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c @@ -29,6 +29,7 @@ #include "bnxt_mgmt.h" #include "bnxt.h" #include "bnxt_hwrm.h" +#include "bnxt_coredump.h" #include "bnxt_log.h" #include #include @@ -266,6 +267,152 @@ bnxt_get_ctx_coredump(struct bnxt_softc *softc, void *buf) } } +/* DDR Crash Dump IOCTL handler */ +static int +bnxt_mgmt_crash_dump(struct cdev *dev, u_long cmd, caddr_t data, + int flag, struct thread *td) +{ + struct bnxt_softc *softc = NULL; + struct bnxt_mgmt_crash_dump mgmt_crash_dump = {0}; + void *user_ptr; + int ret = 0; + void *dump_buf = NULL; + uint32_t dump_len; + + memcpy(&user_ptr, data, sizeof(user_ptr)); + if (copyin(user_ptr, &mgmt_crash_dump, sizeof(mgmt_crash_dump))) { + printf("%s: %s:%d Failed to copy data from user\n", + DRIVER_NAME, __func__, __LINE__); + return (-EFAULT); + } + softc = bnxt_find_dev(mgmt_crash_dump.hdr.domain, + mgmt_crash_dump.hdr.bus, + mgmt_crash_dump.hdr.devfn, NULL); + if (!softc) { + printf("%s: %s:%d unable to find softc reference\n", + DRIVER_NAME, __func__, __LINE__); + return (-ENODEV); + } + + switch (mgmt_crash_dump.op) { + case BNXT_MGMT_SET_DUMP_FLAG: + if (mgmt_crash_dump.req.set_flag.dump_flag > + BNXT_DUMP_LIVE_WITH_CTX_L1_CACHE) { + device_printf(softc->dev, + "Supports only Live(0), Crash(1), Driver(2), " + "Live with cached context(3) dumps.\n"); + ret = -EINVAL; + break; + } + + if (mgmt_crash_dump.req.set_flag.dump_flag == BNXT_DUMP_CRASH) { + if (softc->fw_dbg_cap & BNXT_FW_DBG_CAP_CRASHDUMP_SOC) { + device_printf(softc->dev, + "Cannot collect crash dump as TEE is not supported.\n"); + ret = -ENOTSUP; + break; + } else if (!(softc->fw_dbg_cap & + BNXT_FW_DBG_CAP_CRASHDUMP_HOST)) { + device_printf(softc->dev, + "FW does not support crash dump collection.\n"); + ret = -ENOTSUP; + break; + } + } + + softc->dump_flag = mgmt_crash_dump.req.set_flag.dump_flag; + break; + + case BNXT_MGMT_GET_DUMP_FLAG: + if (softc->hwrm_spec_code < 0x10801) { + ret = -ENOTSUP; + break; + } + + /* Build FW version - same as Linux bnxt_get_dump_flag() */ + mgmt_crash_dump.req.get_flag.version = + (softc->ver_resp.hwrm_fw_maj_8b << 24) | + (softc->ver_resp.hwrm_fw_min_8b << 16) | + (softc->ver_resp.hwrm_fw_bld_8b << 8) | + (softc->ver_resp.hwrm_fw_rsvd_8b); + + mgmt_crash_dump.req.get_flag.dump_flag = softc->dump_flag; + mgmt_crash_dump.req.get_flag.dump_len = + bnxt_get_coredump_length(softc, softc->dump_flag); + break; + + case BNXT_MGMT_GET_DUMP_DATA: + if (softc->hwrm_spec_code < 0x10801) { + ret = -ENOTSUP; + break; + } + + dump_len = bnxt_get_coredump_length(softc, + mgmt_crash_dump.req.get_data.dump_flag); + if (dump_len == 0) { + device_printf(softc->dev, "No dump data available\n"); + ret = -ENOENT; + break; + } + + if (mgmt_crash_dump.req.get_data.buffer_size < dump_len) { + device_printf(softc->dev, + "Buffer too small: need %u bytes, got %zu bytes\n", + dump_len, mgmt_crash_dump.req.get_data.buffer_size); + mgmt_crash_dump.req.get_data.dump_len = dump_len; + ret = -ENOSPC; + break; + } + + dump_buf = malloc(dump_len, M_BNXT, M_WAITOK); + if (!dump_buf) { + ret = -ENOMEM; + break; + } + + ret = bnxt_get_coredump(softc, + mgmt_crash_dump.req.get_data.dump_flag, + dump_buf, &dump_len); + if (ret) { + device_printf(softc->dev, + "Failed to get coredump: %d\n", ret); + free(dump_buf, M_BNXT); + break; + } + + if (copyout(dump_buf, + mgmt_crash_dump.req.get_data.dump_buffer, dump_len)) { + device_printf(softc->dev, + "%s:%d Failed to copy dump data to user\n", + __func__, __LINE__); + ret = -EFAULT; + free(dump_buf, M_BNXT); + break; + } + + mgmt_crash_dump.req.get_data.dump_len = dump_len; + mgmt_crash_dump.req.get_data.dump_flag = softc->dump_flag; + free(dump_buf, M_BNXT); + break; + + default: + device_printf(softc->dev, "%s:%d Invalid op 0x%x\n", + __func__, __LINE__, mgmt_crash_dump.op); + ret = -EFAULT; + break; + } + + if (!ret && copyout(&mgmt_crash_dump, user_ptr, + sizeof(mgmt_crash_dump))) { + device_printf(softc->dev, + "%s:%d Failed to copy response to user\n", + __func__, __LINE__); + ret = -EFAULT; + } + + return (ret); +} + /* * This function is called by the kld[un]load(2) system calls to * determine what actions to take when a module is loaded or unloaded. @@ -693,6 +840,10 @@ bnxt_mgmt_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, case IOW_BNXT_MGMT_OPCODE_DRV_DUMP: ret = bnxt_mgmt_drv_dump(dev, cmd, data, flag, td); break; + case IO_BNXT_MGMT_OPCODE_CRASH_DUMP: + case IOW_BNXT_MGMT_OPCODE_CRASH_DUMP: + ret = bnxt_mgmt_crash_dump(dev, cmd, data, flag, td); + break; default: printf("%s: Unknown command 0x%lx\n", DRIVER_NAME, cmd); ret = -EINVAL; diff --git a/sys/dev/bnxt/bnxt_en/bnxt_mgmt.h b/sys/dev/bnxt/bnxt_en/bnxt_mgmt.h index cdd6964158ee..272fb0e298cb 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_mgmt.h +++ b/sys/dev/bnxt/bnxt_en/bnxt_mgmt.h @@ -44,11 +44,13 @@ #define IOW_BNXT_MGMT_OPCODE_PASSTHROUGH_HWRM _IOW(0, 1, 0) #define IOW_BNXT_MGMT_OPCODE_DCB_OPS _IOW(0, 2, 0) #define IOW_BNXT_MGMT_OPCODE_DRV_DUMP _IOW(0, 3, 0) +#define IOW_BNXT_MGMT_OPCODE_CRASH_DUMP _IOW(0, 4, 0) #define IO_BNXT_MGMT_OPCODE_GET_DEV_INFO _IO(0, 0) #define IO_BNXT_MGMT_OPCODE_PASSTHROUGH_HWRM _IO(0, 1) #define IO_BNXT_MGMT_OPCODE_DCB_OPS _IO(0, 2) #define IO_BNXT_MGMT_OPCODE_DRV_DUMP _IO(0, 3) +#define IO_BNXT_MGMT_OPCODE_CRASH_DUMP _IO(0, 4) #define BNXT_MGMT_MAX_HWRM_REQ_LENGTH HWRM_MAX_REQ_LEN #define BNXT_MGMT_MAX_HWRM_RESP_LENGTH (512) @@ -81,7 +83,7 @@ struct bnxt_pci_info { } __packed; struct bnxt_dev_info { - struct bnxt_nic_info nic_info; + struct bnxt_nic_info nic_info; struct bnxt_pci_info pci_info; } __packed; @@ -165,6 +167,31 @@ struct bnxt_mgmt_drv_dump { uint32_t buf_size; } __attribute__ ((__packed__)); +struct bnxt_mgmt_crash_dump { + struct bnxt_mgmt_req_hdr hdr; +#define BNXT_MGMT_SET_DUMP_FLAG 0x1 +#define BNXT_MGMT_GET_DUMP_FLAG 0x2 +#define BNXT_MGMT_GET_DUMP_DATA 0x3 +#define BNXT_MGMT_CRASH_DUMP_MAX BNXT_MGMT_GET_DUMP_DATA + uint32_t op; + union { + struct { + uint32_t dump_flag; + } set_flag; + struct { + uint32_t dump_flag; + uint32_t dump_len; + uint32_t version; + } get_flag; + struct { + uint32_t dump_flag; + uint32_t dump_len; + void *dump_buffer; + size_t buffer_size; + } get_data; + } req; +} __attribute__ ((__packed__)); + struct bnxt_driver_segment_record { uint32_t max_entries; uint32_t entry_size; diff --git a/sys/dev/bnxt/bnxt_en/if_bnxt.c b/sys/dev/bnxt/bnxt_en/if_bnxt.c index 83f339bb045f..c10a66156563 100644 --- a/sys/dev/bnxt/bnxt_en/if_bnxt.c +++ b/sys/dev/bnxt/bnxt_en/if_bnxt.c @@ -73,6 +73,7 @@ #include "bnxt_auxbus_compat.h" #include "bnxt_log.h" #include "bnxt_log_data.h" +#include "bnxt_coredump.h" /* * PCI Device ID Table @@ -269,6 +270,7 @@ static void bnxt_queue_fw_reset_work(struct bnxt_softc *bp, unsigned long delay) void bnxt_queue_sp_work(struct bnxt_softc *bp); void bnxt_fw_reset(struct bnxt_softc *bp); +static int bnxt_crash_dump_init(struct bnxt_softc *softc); /* * Device Interface Declaration */ @@ -1101,9 +1103,10 @@ static int bnxt_alloc_ctx_mem_blk(struct bnxt_softc *softc, return bnxt_alloc_ring(softc, rmem); } -static int bnxt_alloc_ctx_pg_tbls(struct bnxt_softc *softc, - struct bnxt_ctx_pg_info *ctx_pg, u32 mem_size, - u8 depth, struct bnxt_ctx_mem_type *ctxm) +int +bnxt_alloc_ctx_pg_tbls(struct bnxt_softc *softc, + struct bnxt_ctx_pg_info *ctx_pg, uint32_t mem_size, uint8_t depth, + struct bnxt_ctx_mem_type *ctxm) { struct bnxt_ring_mem_info *rmem = &ctx_pg->ring_mem; int rc; @@ -1161,8 +1164,8 @@ static int bnxt_alloc_ctx_pg_tbls(struct bnxt_softc *softc, return rc; } -static void bnxt_free_ctx_pg_tbls(struct bnxt_softc *softc, - struct bnxt_ctx_pg_info *ctx_pg) +void bnxt_free_ctx_pg_tbls(struct bnxt_softc *softc, + struct bnxt_ctx_pg_info *ctx_pg) { struct bnxt_ring_mem_info *rmem = &ctx_pg->ring_mem; @@ -2241,6 +2244,8 @@ static int bnxt_open(struct bnxt_softc *bp) if (rc) return rc; + bnxt_hwrm_dbg_qcaps(bp); + /* Register the driver with the FW */ rc = bnxt_drv_rgtr(bp); if (rc) @@ -2388,6 +2393,7 @@ static void bnxt_fw_reset_task(struct work_struct *work) bnxt_ulp_start(bp, 0); clear_bit(BNXT_STATE_FW_ACTIVATE, &bp->state); set_bit(BNXT_STATE_OPEN, &bp->state); + bnxt_crash_dump_init(bp); #ifdef PCI_IOV bnxt_reenable_sriov(bp); #endif @@ -2514,6 +2520,29 @@ bnxt_log_live_data(void *d) bnxt_log_ring_states(bp); } +/* DDR Crash Dump Setup */ +static int +bnxt_crash_dump_init(struct bnxt_softc *softc) +{ + int rc; + + rc = bnxt_alloc_crash_dump_mem(softc); + if (rc) { + device_printf(softc->dev, + "crash dump mem alloc failure rc: %d\n", rc); + return (rc); + } + + rc = bnxt_hwrm_crash_dump_mem_cfg(softc); + if (rc) { + bnxt_free_crash_dump_mem(softc); + device_printf(softc->dev, + "hwrm crash dump mem failure rc: %d\n", rc); + } + + return (rc); +} + /* Device setup and teardown */ static int bnxt_attach_pre(if_ctx_t ctx) @@ -2706,6 +2735,8 @@ bnxt_attach_pre(if_ctx_t ctx) } } + bnxt_hwrm_dbg_qcaps(softc); + /* * Register the driver with the FW * Register the async events with the FW @@ -2893,6 +2924,7 @@ bnxt_attach_pre(if_ctx_t ctx) return (rc); + failed: bnxt_free_sysctl_ctx(softc); init_sysctl_failed: @@ -2952,6 +2984,11 @@ bnxt_attach_post(if_ctx_t ctx) if (BNXT_PF(softc) && BNXT_CHIP_P5_PLUS(softc)) bnxt_sriov_attach(softc); + rc = bnxt_crash_dump_init(softc); + if (rc) + device_printf(softc->dev, + "crash dump init failure rc: %d\n", rc); + failed: return rc; } @@ -2973,6 +3010,7 @@ bnxt_detach(if_ctx_t ctx) bnxt_wol_config(ctx); bnxt_do_disable_intr(&softc->def_cp_ring); bnxt_free_sysctl_ctx(softc); + bnxt_free_crash_dump_mem(softc); bnxt_hwrm_func_reset(softc); bnxt_free_ctx_mem(softc); bnxt_clear_ids(softc); diff --git a/sys/modules/bnxt/bnxt_en/Makefile b/sys/modules/bnxt/bnxt_en/Makefile index 7cb450baac4e..e3cc3e79377c 100644 --- a/sys/modules/bnxt/bnxt_en/Makefile +++ b/sys/modules/bnxt/bnxt_en/Makefile @@ -13,6 +13,7 @@ SRCS += bnxt_sriov.c bnxt_sriov.h SRCS += bnxt_ulp.c bnxt_ulp.h SRCS += bnxt_log.c bnxt_log.h SRCS += bnxt_log_data.c bnxt_log_data.h +SRCS += bnxt_coredump.c bnxt_coredump.h SRCS += ${LINUXKPI_GENSRCS} CFLAGS+= -DIFLIB From nobody Mon Jun 15 11:35:34 2026 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 4gf7ND00cxz6hBpx for ; Mon, 15 Jun 2026 11:35: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gf7NC465Rz3Jmn for ; Mon, 15 Jun 2026 11:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781523339; 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; bh=kjwrP4J+VEgE9VMlm5ggJF2AiyVysaoU8UC1IRlML2w=; b=cibbroRaYyDcNAhxu/ws2ypT2RJqtRPGp9KlHa/ohrtRnavsRss1qHrbqrnvzSBqkqOVKr 2xPFMlw10KrOXQO03blZs7Evi/mMWX/RPIjUqXaQpjIZIg6erdmv3pWBYOfSaTY4vHRsja P9qeR/vLn8eZDkyWjDiedfe0sZIauT4BCNvYMMcPGSupqDerUyL+XMR9E0t3tN+cWTkCkm C3+GkmSRYFCAkS9pbMLeyBIZOHzlFfFRa7nGhM+5IDz+kuiFJfPTxg21SD1Zx7qTZjdFR3 R4629WaNoSavdMzvBL/bm9ipku2WQImhbSFA7pOnz+YPNQ6feHuc3sxYRwASBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781523339; a=rsa-sha256; cv=none; b=IxxtfYoAplgXrVpYyBXI89CjZ7C+5U0JhePS/oe/ic5XV1oBJgr45CurWclaDW992c/XYr mbxJZQa1EF4Zhh317N9HqaygfTEzfESCnxQHW+eSKcyL+3QxKuxgJAmqPPAI5sR3qmOmeh pqz5xTa616MZMqu5e0x78diRi8jJBrota3OURwUTF5WmLQvt+UjfL6OM5MVS1IJ+bfdkia N1ASEoCbsDs8qH257kEBygHtBtbe7G0VPU7YdkljNR0k8T9I411jP//oapAZfZUryPAklI a02Lwh/18nsvrayqXCOonhTql8/xnWqORI64XZp6nHI1rEJS1iSRFR0KRQRteg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781523339; 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; bh=kjwrP4J+VEgE9VMlm5ggJF2AiyVysaoU8UC1IRlML2w=; b=J8pnGYotZqnv/my5T5hLOOop64Lz5knpNC+FIbRAJX+nsn5PA9rOd3KdNNZcQYx7gKoH9L JQNHC1yyJIYWJPaF8Xd5g1cv1s1QRIOAUidcShya2GumkmDdyQ1YPTmdw76YIMVvpzkY6W 79S+T8MXj+I5dwTLG6/Fw6sNnKIKuNBusw6Grvlr9Azc0nNxaIVJ32W5W/edC5dWr9d3uX 5k8q0+mR8jKFLcfGjOlbRapfJiJdJfKIc0afSe4C1mHMdd07bS2KbLOneDAjkvhMV4Hro8 dbVSMESEbOPLee7Bl3hsqo9qRdcHghyhtM6gC4V6QhIdRLi6EGC4RrRHnr31eg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gf7NC0KPXzsx7 for ; Mon, 15 Jun 2026 11:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1de68 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 11:35:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Sreekanth Reddy From: Sumit Saxena Subject: git: f85e66e655c9 - main - if_bnxt/bnxt_re: add support for driver snapdump 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ssaxena X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f85e66e655c9293ea049814e21ed67ab246a7305 Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 11:35:34 +0000 Message-Id: <6a2fe386.1de68.388fda90@gitrepo.freebsd.org> The branch main has been updated by ssaxena: URL: https://cgit.FreeBSD.org/src/commit/?id=f85e66e655c9293ea049814e21ed67ab246a7305 commit f85e66e655c9293ea049814e21ed67ab246a7305 Author: Sreekanth Reddy AuthorDate: 2026-06-15 09:40:30 +0000 Commit: Sumit Saxena CommitDate: 2026-06-15 11:30:40 +0000 if_bnxt/bnxt_re: add support for driver snapdump Add a logging module which helps to log and collect the driver`s various events and state of device data structures. APIs help modules like l2, RoCE etc. to register and add logs into thg buffers. A segment header is added to the data available in buffers. The final log messages are arranged in following fashion |SegHeader0|Data0|SegHeader1|Data1| Logging module provides two different kinds of buffers: a) A large contiguous memory chunk is used to form circular buffers. Module need to provide a number of buffers while registering to the logging module.Please note that, since memory for the buffers remains with the module as long as it is registered, memory footprints of the driver could be higher so the modules should allocate an appropriate number of buffers. Also, due to limited space, modules should only log important events/messages into the buffer. Modules must use bnxt_log_add_mssg() to add the message into the list. b) Live buffer - They are allocated during coredump retrieval and freed after the coredump data is returned to the user. This helps to collect live data from the driver. Modules must use the bnxt_log_live() function to add the log messages. When coredump is retrieved all the messages available in above buffers are copied into the coredump buffer. Test Plan: Generate the coredump using below niccli command ./niccli.freebsd -i 1 debug --coredump and then verify the coredump contents using the Broadcom's Coredump decoder. MFC after: 2 weeks Reviewed by: gallatin, ssaxena Differential Revision: https://reviews.freebsd.org/D56682 --- sys/dev/bnxt/bnxt_en/bnxt.h | 44 ++++- sys/dev/bnxt/bnxt_en/bnxt_mgmt.c | 378 +++++++++++++++++++++++++++++++++----- sys/dev/bnxt/bnxt_en/bnxt_mgmt.h | 31 ++++ sys/dev/bnxt/bnxt_en/bnxt_ulp.c | 35 ++++ sys/dev/bnxt/bnxt_en/bnxt_ulp.h | 4 + sys/dev/bnxt/bnxt_en/if_bnxt.c | 82 ++++++++- sys/dev/bnxt/bnxt_re/main.c | 65 +++++++ sys/modules/bnxt/bnxt_en/Makefile | 2 + 8 files changed, 593 insertions(+), 48 deletions(-) diff --git a/sys/dev/bnxt/bnxt_en/bnxt.h b/sys/dev/bnxt/bnxt_en/bnxt.h index b15cc65e290e..554e24563db6 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt.h +++ b/sys/dev/bnxt/bnxt_en/bnxt.h @@ -829,10 +829,34 @@ struct bnxt_ctx_mem_type { #define BNXT_CTX_L2_MAX (BNXT_CTX_FTQM + 1) #define BNXT_CTX_V2_MAX (HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_ROCE_HWRM_TRACE + 1) -#define BNXT_CTX_SRT_TRACE HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_SRT_TRACE -#define BNXT_CTX_ROCE_HWRM_TRACE HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_ROCE_HWRM_TRACE + +#define BNXT_CTX_SRT_TRACE \ + HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_SRT_TRACE + +#define BNXT_CTX_SRT2_TRACE \ + HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_SRT2_TRACE + +#define BNXT_CTX_CRT_TRACE \ + HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_CRT_TRACE + +#define BNXT_CTX_CRT2_TRACE \ + HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_CRT2_TRACE + +#define BNXT_CTX_RIGP0_TRACE \ + HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_RIGP0_TRACE + +#define BNXT_CTX_L2_HWRM_TRACE \ + HWRM_FUNC_BACKING_STORE_QCFG_V2_OUTPUT_TYPE_L2_HWRM_TRACE + +#define BNXT_CTX_ROCE_HWRM_TRACE \ + HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_ROCE_HWRM_TRACE + #define BNXT_CTX_INV ((u16)-1) +#define BNXT_CTX_TRACE_BUF_COUNT \ + (BNXT_CTX_ROCE_HWRM_TRACE - BNXT_CTX_SRT_TRACE + 1) + + struct bnxt_ctx_mem_info { u8 tqm_fp_rings_count; @@ -1045,6 +1069,17 @@ struct bnxt_fw_health { #define DB_RING_IDX(ring, idx, bit) (((idx) & (ring)->db_ring_mask) | \ ((bit) << (24))) +struct bnxt_bs_trace_info { + u8 *magic_byte; +#define BNXT_TRACE_BUF_MAGIC_BYTE ((uint8_t)0xBC) + u32 last_offset; + u8 wrapped:1; + u16 ctx_type; + u16 trace_type; +}; + +struct bnxt_logger; + struct bnxt_softc { device_t dev; if_ctx_t ctx; @@ -1344,6 +1379,11 @@ struct bnxt_softc { struct bnxt_fw_health *fw_health; char board_partno[64]; + TAILQ_HEAD(, bnxt_logger) loggers_list; + void *debug_buf; + struct mtx log_lock; /* logging ops lock */ + struct callout time_sync_callout; + struct bnxt_bs_trace_info bs_trace[BNXT_CTX_TRACE_BUF_COUNT]; }; struct bnxt_filter_info { diff --git a/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c b/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c index 98ae9848c42b..fd6d7b904dca 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c +++ b/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c @@ -26,9 +26,10 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#include "bnxt_mgmt.h" +#include "bnxt_mgmt.h" #include "bnxt.h" -#include "bnxt_hwrm.h" +#include "bnxt_hwrm.h" +#include "bnxt_log.h" #include #include #include @@ -54,6 +55,217 @@ struct mtx mgmt_lock; MALLOC_DEFINE(M_BNXT, "bnxt_mgmt_buffer", "buffer for bnxt_mgmt module"); + +static uint32_t +bnxt_get_driver_coredump_len(struct bnxt_softc *softc) +{ + + uint32_t type, i, j, n; + uint32_t buf_size = 0; + int ctx_page_count = 0; + int segment_len = 0; + int driver_segment_record_len = 0; + uint32_t dump_len = 0; + int record_len = sizeof(struct bnxt_driver_segment_record); + struct bnxt_ctx_mem_info *ctx = softc->ctx_mem; + + if (!ctx) + return (dump_len); + + for (type = BNXT_CTX_SRT_TRACE; type <= BNXT_CTX_ROCE_HWRM_TRACE; + type++) { + struct bnxt_ctx_mem_type *ctxm = &ctx->ctx_arr[type]; + struct bnxt_ctx_pg_info *ctx_pg = ctxm->pg_info; + + if (!ctx_pg) + continue; + + if (ctxm->instance_bmap) + n = bitcount32(ctxm->instance_bmap); + else + n = 1; + + for (i = 0; i < n; i++) { + struct bnxt_ring_mem_info *rmem = &ctx_pg->ring_mem; + + if (ctx_pg->nr_pages > MAX_CTX_PAGES || + ctx_pg->ctx_pg_tbl) { + int k = 0, nr_tbls = rmem->nr_pages; + + for (k = 0; k < nr_tbls; k++) { + struct bnxt_ctx_pg_info *pg_tbl; + struct bnxt_ring_mem_info *rmem2; + + pg_tbl = ctx_pg->ctx_pg_tbl[k]; + if (!pg_tbl) + continue; + rmem2 = &pg_tbl->ring_mem; + for (j = 0; j < rmem2->nr_pages; j++) { + if (!rmem2->pg_arr[j].idi_vaddr) + continue; + ctx_page_count++; + } + } + } else { + struct bnxt_ring_mem_info *rmem2 = rmem; + + for (j = 0; j < rmem2->nr_pages; j++) { + if (!rmem2->pg_arr[j].idi_vaddr) + continue; + ctx_page_count++; + } + } + } + segment_len += 64; + driver_segment_record_len += record_len; + } + + buf_size = driver_segment_record_len + segment_len + + (ctx_page_count * 4096); + + return (buf_size); +} + +inline void +bnxt_bs_trace_check_wrapping(struct bnxt_bs_trace_info *bs_trace, + u32 offset) +{ + if (!bs_trace->wrapped && + *bs_trace->magic_byte != BNXT_TRACE_BUF_MAGIC_BYTE) + bs_trace->wrapped = 1; + bs_trace->last_offset = offset; +} + + + +static int +bnxt_hwrm_dbg_log_buffer_flush(struct bnxt_softc *bp, u16 type, u32 flags, + u32 *offset) +{ + int status = 0; + + hwrm_dbg_log_buffer_flush_input_t buff_flush_req; + hwrm_dbg_log_buffer_flush_output_t *buff_flush_resp = + (hwrm_dbg_log_buffer_flush_output_t *)(void *) + bp->hwrm_cmd_resp.idi_vaddr; + bnxt_hwrm_cmd_hdr_init(bp, &buff_flush_req, HWRM_DBG_LOG_BUFFER_FLUSH); + buff_flush_req.type = type; + buff_flush_req.flags = flags; + + status = hwrm_send_message(bp, &buff_flush_req, sizeof(buff_flush_req)); + if (!status) + *offset = buff_flush_resp->current_buffer_offset; + return (status); +} + +static void +bnxt_fill_driver_segment_record(struct bnxt_softc *bp, + struct bnxt_driver_segment_record *drv_seg_rec, + struct bnxt_ctx_mem_type *ctxm, uint16_t type) +{ + struct bnxt_bs_trace_info *bs_trace = &bp->bs_trace[type]; + uint32_t offset; + + if (bnxt_hwrm_dbg_log_buffer_flush(bp, type, 0, &offset) == 0) { + bnxt_bs_trace_check_wrapping(bs_trace, offset); + } + drv_seg_rec->max_entries = ctxm->max_entries; + drv_seg_rec->entry_size = ctxm->entry_size; + drv_seg_rec->offset = bs_trace->last_offset; + drv_seg_rec->wrapped = bs_trace->wrapped; +} + +static void +bnxt_retrieve_driver_coredump(struct bnxt_softc *softc, void *buf, + uint16_t type, uint32_t *seg_len) +{ + struct bnxt_driver_segment_record drv_seg_rec = {0}; + struct bnxt_ctx_mem_info *ctx = softc->ctx_mem; + struct bnxt_ctx_mem_type *ctxm = &ctx->ctx_arr[type]; + struct bnxt_ctx_pg_info *ctx_pg = ctxm->pg_info; + uint32_t dump_len, data_offset, record_len, seg_hdr_len; + uint32_t i, j, k, n = 1, nr_tbls; + + dump_len = 0; + + record_len = sizeof(struct bnxt_driver_segment_record); + seg_hdr_len = sizeof(struct bnxt_coredump_segment_hdr); + data_offset = seg_hdr_len + record_len; + + bnxt_fill_driver_segment_record(softc, &drv_seg_rec, ctxm, + (type - BNXT_CTX_SRT_TRACE)); + + for (i = 0; i < n; i++) { + struct bnxt_ring_mem_info *rmem = &ctx_pg->ring_mem; + + if (ctx_pg->nr_pages > MAX_CTX_PAGES || ctx_pg->ctx_pg_tbl) { + nr_tbls = rmem->nr_pages; + for (j = 0; j < nr_tbls; j++) { + struct bnxt_ctx_pg_info *pg_tbl; + struct bnxt_ring_mem_info *rmem2; + + pg_tbl = ctx_pg->ctx_pg_tbl[j]; + if (!pg_tbl) + continue; + rmem2 = &pg_tbl->ring_mem; + for (k = 0; k < rmem2->nr_pages; k++) { + if (!rmem2->pg_arr[k].idi_vaddr) + continue; + memcpy((uint8_t *)buf + data_offset, + rmem2->pg_arr[k].idi_vaddr, + rmem2->page_size); + data_offset += rmem2->page_size; + dump_len += rmem2->page_size; + } + } + } else { + for (k = 0; k < rmem->nr_pages; k++) { + if (!rmem->pg_arr[k].idi_vaddr) + continue; + memcpy((uint8_t *)buf + data_offset, + rmem->pg_arr[k].idi_vaddr, + rmem->page_size); + data_offset += rmem->page_size; + dump_len += rmem->page_size; + } + } + } + memcpy((uint8_t *)buf + seg_hdr_len, &drv_seg_rec, record_len); + *seg_len = dump_len + record_len; +} + +void +bnxt_get_ctx_coredump(struct bnxt_softc *softc, void *buf) +{ + struct bnxt_ctx_mem_info *ctx = softc->ctx_mem; + struct bnxt_coredump_segment_hdr seg_hdr; + uint32_t type = 0, i = 0; + uint32_t seg_hdr_len = 0; + + seg_hdr_len = sizeof(seg_hdr); + for (type = BNXT_CTX_SRT_TRACE, i = DRV_SRT_TRACE_SEG_ID; + type <= BNXT_CTX_ROCE_HWRM_TRACE; type++, i++) { + struct bnxt_ctx_mem_type *ctxm = &ctx->ctx_arr[type]; + uint16_t comp_id = DRV_COREDUMP_COMP_ID; + uint16_t seg_id = i; + uint32_t seg_len = 0; + + ctxm = &ctx->ctx_arr[type]; + + if (!(ctxm->flags & BNXT_CTX_MEM_TYPE_VALID) || + !ctxm->mem_valid) + continue; + + bnxt_retrieve_driver_coredump(softc, buf, type, &seg_len); + + bnxt_fill_coredump_seg_hdr(softc, &seg_hdr, NULL, seg_len, + 0, 0, 0, comp_id, seg_id); + + memcpy((uint8_t *)buf, &seg_hdr, seg_hdr_len); + buf = (uint8_t *)buf + seg_hdr_len + seg_len; + } +} + /* * This function is called by the kld[un]load(2) system calls to * determine what actions to take when a module is loaded or unloaded. @@ -76,7 +288,7 @@ bnxt_mgmt_loader(struct module *m, int what, void *arg) if (error != 0) { printf("%s: %s:%s:%d Failed to create the" "bnxt_mgmt device node\n", DRIVER_NAME, - __FILE__, __FUNCTION__, __LINE__); + __FILE__, __func__, __LINE__); return (error); } @@ -107,14 +319,14 @@ bnxt_mgmt_process_dcb(struct cdev *dev, u_long cmd, caddr_t data, memcpy(&user_ptr, data, sizeof(user_ptr)); if (copyin(user_ptr, &mgmt_dcb, sizeof(mgmt_dcb))) { printf("%s: %s:%d Failed to copy data from user\n", - DRIVER_NAME, __FUNCTION__, __LINE__); + DRIVER_NAME, __func__, __LINE__); return -EFAULT; } softc = bnxt_find_dev(mgmt_dcb.hdr.domain, mgmt_dcb.hdr.bus, mgmt_dcb.hdr.devfn, NULL); if (!softc) { printf("%s: %s:%d unable to find softc reference\n", - DRIVER_NAME, __FUNCTION__, __LINE__); + DRIVER_NAME, __func__, __LINE__); return -ENODEV; } @@ -144,14 +356,14 @@ bnxt_mgmt_process_dcb(struct cdev *dev, u_long cmd, caddr_t data, break; default: device_printf(softc->dev, "%s:%d Invalid op 0x%x\n", - __FUNCTION__, __LINE__, mgmt_dcb.op); + __func__, __LINE__, mgmt_dcb.op); ret = -EFAULT; goto end; } if (copyout(&mgmt_dcb, user_ptr, sizeof(mgmt_dcb))) { device_printf(softc->dev, "%s:%d Failed to copy response to user\n", - __FUNCTION__, __LINE__); + __func__, __LINE__); ret = -EFAULT; goto end; } @@ -173,35 +385,35 @@ bnxt_mgmt_process_hwrm(struct cdev *dev, u_long cmd, caddr_t data, uint16_t num_ind = 0; memcpy(&user_ptr, data, sizeof(user_ptr)); - if (copyin(user_ptr, &mgmt_req, sizeof(struct bnxt_mgmt_req))) { + if (copyin(user_ptr, &mgmt_req, sizeof(struct bnxt_mgmt_req))) { printf("%s: %s:%d Failed to copy data from user\n", - DRIVER_NAME, __FUNCTION__, __LINE__); + DRIVER_NAME, __func__, __LINE__); return -EFAULT; } softc = bnxt_find_dev(mgmt_req.hdr.domain, mgmt_req.hdr.bus, mgmt_req.hdr.devfn, NULL); if (!softc) { printf("%s: %s:%d unable to find softc reference\n", - DRIVER_NAME, __FUNCTION__, __LINE__); + DRIVER_NAME, __func__, __LINE__); return -ENODEV; } if (copyin((void*)mgmt_req.req.hreq, &msg_temp, sizeof(msg_temp))) { device_printf(softc->dev, "%s:%d Failed to copy data from user\n", - __FUNCTION__, __LINE__); + __func__, __LINE__); return -EFAULT; } if (msg_temp.len_req > BNXT_MGMT_MAX_HWRM_REQ_LENGTH || msg_temp.len_resp > BNXT_MGMT_MAX_HWRM_RESP_LENGTH) { - device_printf(softc->dev, "%s:%d Invalid length\n", - __FUNCTION__, __LINE__); + device_printf(softc->dev, "%s:%d Invalid length\n", + __func__, __LINE__); return -EINVAL; } if (msg_temp.num_dma_indications > 1) { device_printf(softc->dev, "%s:%d Max num_dma_indications " - "supported is 1 \n", __FUNCTION__, __LINE__); + "supported is 1\n", __func__, __LINE__); return -EINVAL; } @@ -210,7 +422,7 @@ bnxt_mgmt_process_hwrm(struct cdev *dev, u_long cmd, caddr_t data, if (copyin((void *)msg_temp.usr_req, req, msg_temp.len_req)) { device_printf(softc->dev, "%s:%d Failed to copy data from user\n", - __FUNCTION__, __LINE__); + __func__, __LINE__); ret = -EFAULT; goto end; } @@ -222,35 +434,35 @@ bnxt_mgmt_process_hwrm(struct cdev *dev, u_long cmd, caddr_t data, void *dma_ptr; uint64_t *dmap; - size = sizeof(struct bnxt_mgmt_fw_msg) + + size = sizeof(struct bnxt_mgmt_fw_msg) + (num_ind * sizeof(struct dma_info)); msg2 = malloc(size, M_BNXT, M_WAITOK | M_ZERO); - if (copyin((void *)mgmt_req.req.hreq, msg2, size)) { + if (copyin((void *)mgmt_req.req.hreq, msg2, size)) { device_printf(softc->dev, "%s:%d Failed to copy" - "data from user\n", __FUNCTION__, __LINE__); + "data from user\n", __func__, __LINE__); ret = -EFAULT; goto end; } msg = msg2; - + ret = iflib_dma_alloc(softc->ctx, msg->dma[0].length, &dma_data, BUS_DMA_NOWAIT); if (ret) { device_printf(softc->dev, "%s:%d iflib_dma_alloc" - "failed with ret = 0x%x\n", __FUNCTION__, + "failed with ret = 0x%x\n", __func__, __LINE__, ret); ret = -ENOMEM; goto end; } if (!(msg->dma[0].read_or_write)) { - if (copyin((void *)msg->dma[0].data, - dma_data.idi_vaddr, + if (copyin((void *)msg->dma[0].data, + dma_data.idi_vaddr, msg->dma[0].length)) { device_printf(softc->dev, "%s:%d Failed to copy" - "data from user\n", __FUNCTION__, + "data from user\n", __func__, __LINE__); ret = -EFAULT; goto end; @@ -260,27 +472,27 @@ bnxt_mgmt_process_hwrm(struct cdev *dev, u_long cmd, caddr_t data, dmap = dma_ptr; *dmap = htole64(dma_data.idi_paddr); } - + ret = bnxt_hwrm_passthrough(softc, req, msg->len_req, resp, msg->len_resp, msg->timeout); if(ret) goto end; - + if (num_ind) { if ((msg->dma[0].read_or_write)) { - if (copyout(dma_data.idi_vaddr, - (void *)msg->dma[0].data, + if (copyout(dma_data.idi_vaddr, + (void *)msg->dma[0].data, msg->dma[0].length)) { device_printf(softc->dev, "%s:%d Failed to copy data" - "to user\n", __FUNCTION__, __LINE__); + "to user\n", __func__, __LINE__); ret = -EFAULT; goto end; } } } - + if (copyout(resp, (void *) msg->usr_resp, msg->len_resp)) { device_printf(softc->dev, "%s:%d Failed to copy response to user\n", - __FUNCTION__, __LINE__); + __func__, __LINE__); ret = -EFAULT; goto end; } @@ -313,14 +525,14 @@ bnxt_mgmt_get_dev_info(struct cdev *dev, u_long cmd, caddr_t data, memcpy(&user_ptr, data, sizeof(user_ptr)); if (copyin(user_ptr, &dev_info, sizeof(dev_info))) { printf("%s: %s:%d Failed to copy data from user\n", - DRIVER_NAME, __FUNCTION__, __LINE__); + DRIVER_NAME, __func__, __LINE__); return -EFAULT; } - + softc = bnxt_find_dev(0, 0, 0, dev_info.nic_info.dev_name); if (!softc) { printf("%s: %s:%d unable to find softc reference\n", - DRIVER_NAME, __FUNCTION__, __LINE__); + DRIVER_NAME, __func__, __LINE__); return -ENODEV; } @@ -339,7 +551,7 @@ bnxt_mgmt_get_dev_info(struct cdev *dev, u_long cmd, caddr_t data, dev_info.pci_info.chip_rev_id |= dev_info.pci_info.revision; if (pci_find_extcap(softc->dev, PCIZ_SERNUM, &dev_sn_offset)) { device_printf(softc->dev, "%s:%d device serial number is not found" - "or not supported\n", __FUNCTION__, __LINE__); + "or not supported\n", __func__, __LINE__); } else { dev_sn_lo = pci_read_config(softc->dev, dev_sn_offset + 4, 4); dev_sn_hi = pci_read_config(softc->dev, dev_sn_offset + 8, 4); @@ -354,27 +566,103 @@ bnxt_mgmt_get_dev_info(struct cdev *dev, u_long cmd, caddr_t data, (dev_sn_hi >> 24 ) & 0xFF); strncpy(dev_info.nic_info.device_serial_number, dsn, sizeof(dsn)); } - + if_t ifp = iflib_get_ifp(softc->ctx); dev_info.nic_info.mtu = if_getmtu(ifp); memcpy(dev_info.nic_info.mac, softc->func.mac_addr, ETHER_ADDR_LEN); - + if (pci_find_cap(softc->dev, PCIY_EXPRESS, &capreg)) { device_printf(softc->dev, "%s:%d pci link capability is not found" - "or not supported\n", __FUNCTION__, __LINE__); + "or not supported\n", __func__, __LINE__); } else { lnk = pci_read_config(softc->dev, capreg + PCIER_LINK_STA, 2); dev_info.nic_info.pci_link_speed = (lnk & PCIEM_LINK_STA_SPEED); dev_info.nic_info.pci_link_width = (lnk & PCIEM_LINK_STA_WIDTH) >> 4; } - + if (copyout(&dev_info, user_ptr, sizeof(dev_info))) { device_printf(softc->dev, "%s:%d Failed to copy data to user\n", - __FUNCTION__, __LINE__); - return -EFAULT; + __func__, __LINE__); + return (-EFAULT); + } + + return (0); +} + +static int +bnxt_mgmt_drv_dump(struct cdev *dev, u_long cmd, caddr_t data, + int flag, struct thread *td) +{ + struct bnxt_softc *softc = NULL; + void *buf = NULL; + struct bnxt_logger *logger = NULL, *lg_tmp; + int buf_sz = 0; + struct bnxt_mgmt_drv_dump mgmt_drv_dump = {}; + void *user_ptr; + int ret = 0, offset = 0; + + memcpy(&user_ptr, data, sizeof(user_ptr)); + if (copyin(user_ptr, &mgmt_drv_dump, sizeof(mgmt_drv_dump))) { + printf("%s: %s:%d Failed to copy data from user\n", + DRIVER_NAME, __func__, __LINE__); + return (-EFAULT); + } + softc = bnxt_find_dev(mgmt_drv_dump.hdr.domain, mgmt_drv_dump.hdr.bus, + mgmt_drv_dump.hdr.devfn, NULL); + if (!softc) { + printf("%s: %s:%d unable to find softc reference\n", + DRIVER_NAME, __func__, __LINE__); + return (-ENODEV); + } + + switch (mgmt_drv_dump.op) { + case BNXT_MGMT_GET_DRV_DUMP_SIZE: + mtx_lock(&softc->log_lock); + TAILQ_FOREACH_SAFE(logger, &softc->loggers_list, list, lg_tmp) + buf_sz += logger->buffer_size; + mtx_unlock(&softc->log_lock); + + mgmt_drv_dump.buf_size = buf_sz + + bnxt_get_driver_coredump_len(softc); + if (copyout(&mgmt_drv_dump, user_ptr, sizeof(mgmt_drv_dump))) { + device_printf(softc->dev, + "%s:%d Failed to copy response to user\n", + __func__, __LINE__); + ret = -EFAULT; + } + break; + case BNXT_MGMT_GET_DRV_DUMP: + buf = malloc(mgmt_drv_dump.buf_size, M_BNXT, M_WAITOK); + /*Dump the driver logs */ + memset(buf, 0, mgmt_drv_dump.buf_size); + offset = bnxt_start_logging_driver_coredump(softc, buf); + + if (!offset) { + device_printf(softc->dev, + "%s:%d Drivers logs are empty\n", + __func__, __LINE__); + } + + /* Dump the ctx logs*/ + if (softc->ctx_mem) + bnxt_get_ctx_coredump(softc, (uint8_t *)buf + offset); + + if (copyout(buf, mgmt_drv_dump.buf, mgmt_drv_dump.buf_size)) { + device_printf(softc->dev, + "%s:%d Failed to copy response to user\n", + __func__, __LINE__); + ret = -EFAULT; + } + + free(buf, M_BNXT); + break; + default: + device_printf(softc->dev, "%s:%d Invalid op 0x%x\n", + __func__, __LINE__, mgmt_drv_dump.op); + ret = -EFAULT; } - return 0; + return (ret); } /* @@ -385,7 +673,7 @@ bnxt_mgmt_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) { int ret = 0; - + switch(cmd) { case IO_BNXT_MGMT_OPCODE_GET_DEV_INFO: case IOW_BNXT_MGMT_OPCODE_GET_DEV_INFO: @@ -401,13 +689,17 @@ bnxt_mgmt_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, case IOW_BNXT_MGMT_OPCODE_DCB_OPS: ret = bnxt_mgmt_process_dcb(dev, cmd, data, flag, td); break; + case IO_BNXT_MGMT_OPCODE_DRV_DUMP: + case IOW_BNXT_MGMT_OPCODE_DRV_DUMP: + ret = bnxt_mgmt_drv_dump(dev, cmd, data, flag, td); + break; default: printf("%s: Unknown command 0x%lx\n", DRIVER_NAME, cmd); ret = -EINVAL; break; } - return ret; + return (ret); } static int diff --git a/sys/dev/bnxt/bnxt_en/bnxt_mgmt.h b/sys/dev/bnxt/bnxt_en/bnxt_mgmt.h index 5b94184b1646..cdd6964158ee 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_mgmt.h +++ b/sys/dev/bnxt/bnxt_en/bnxt_mgmt.h @@ -43,10 +43,12 @@ #define IOW_BNXT_MGMT_OPCODE_GET_DEV_INFO _IOW(0, 0, 0) #define IOW_BNXT_MGMT_OPCODE_PASSTHROUGH_HWRM _IOW(0, 1, 0) #define IOW_BNXT_MGMT_OPCODE_DCB_OPS _IOW(0, 2, 0) +#define IOW_BNXT_MGMT_OPCODE_DRV_DUMP _IOW(0, 3, 0) #define IO_BNXT_MGMT_OPCODE_GET_DEV_INFO _IO(0, 0) #define IO_BNXT_MGMT_OPCODE_PASSTHROUGH_HWRM _IO(0, 1) #define IO_BNXT_MGMT_OPCODE_DCB_OPS _IO(0, 2) +#define IO_BNXT_MGMT_OPCODE_DRV_DUMP _IO(0, 3) #define BNXT_MGMT_MAX_HWRM_REQ_LENGTH HWRM_MAX_REQ_LEN #define BNXT_MGMT_MAX_HWRM_RESP_LENGTH (512) @@ -152,3 +154,32 @@ struct bnxt_mgmt_dcb { struct bnxt_mgmt_app_tlv app_tlv; } req; } __attribute__ ((__packed__)); + +struct bnxt_mgmt_drv_dump { + struct bnxt_mgmt_req_hdr hdr; +#define BNXT_MGMT_GET_DRV_DUMP_SIZE 0x1 +#define BNXT_MGMT_GET_DRV_DUMP 0x2 +#define BNXT_MGMT_DRV_DUMP_MAX BNXT_MGMT_GET_DRV_DUMP + uint32_t op; + void *buf; + uint32_t buf_size; +} __attribute__ ((__packed__)); + +struct bnxt_driver_segment_record { + uint32_t max_entries; + uint32_t entry_size; + uint32_t offset; + uint8_t wrapped:1; + uint8_t reserved[3]; +}; + +#define DRV_COREDUMP_COMP_ID 0xD +#define DRV_SRT_TRACE_SEG_ID 1 +#define DRV_SRT2_TRACE_SEG_ID 2 +#define DRV_CRT_TRACE_SEG_ID 3 +#define DRV_CRT2_TRACE_SEG_ID 4 +#define DRV_RIGP0_TRACE_SEG_ID 5 +#define DRV_LOG_HWRM_L2_TRACE_SEG_ID 6 +#define DRV_LOG_HWRM_ROCE_TRACE_SEG_ID 7 + +void bnxt_get_ctx_coredump(struct bnxt_softc *, void *); diff --git a/sys/dev/bnxt/bnxt_en/bnxt_ulp.c b/sys/dev/bnxt/bnxt_en/bnxt_ulp.c index c6d862a36a9a..c38521abd17f 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_ulp.c +++ b/sys/dev/bnxt/bnxt_en/bnxt_ulp.c @@ -48,6 +48,7 @@ #include "bnxt.h" #include "bnxt_hwrm.h" #include "bnxt_ulp.h" +#include "bnxt_log.h" void bnxt_destroy_irq(struct bnxt_softc *softc); @@ -335,6 +336,40 @@ void bnxt_ulp_irq_stop(struct bnxt_softc *bp) } } +void +bnxt_logger_ulp_live_data(void *d) +{ + struct bnxt_en_dev *edev; + struct bnxt_softc *bp; + + bp = d; + edev = bp->edev; + + if (!edev) + return; + + if (bnxt_ulp_registered(edev, BNXT_ROCE_ULP)) { + struct bnxt_ulp_ops *ops; + struct bnxt_ulp *ulp; + + ulp = edev->ulp_tbl; + //ops = rtnl_dereference(ulp->ulp_ops); + ops = ulp->ulp_ops; + if (!ops || !ops->ulp_log_live) + return; + + ops->ulp_log_live(ulp->handle); + } +} + +void +bnxt_ulp_log_live(struct bnxt_en_dev *edev, u16 logger_id, + const char *format, ...) +{ + bnxt_log_live(if_getsoftc(edev->net), logger_id, format); +} +EXPORT_SYMBOL(bnxt_ulp_log_live); + void bnxt_ulp_async_events(struct bnxt_softc *bp, struct hwrm_async_event_cmpl *cmpl) { u16 event_id = le16_to_cpu(cmpl->event_id); diff --git a/sys/dev/bnxt/bnxt_en/bnxt_ulp.h b/sys/dev/bnxt/bnxt_en/bnxt_ulp.h index 53bb51b07135..057e193aa00b 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_ulp.h +++ b/sys/dev/bnxt/bnxt_en/bnxt_ulp.h @@ -57,6 +57,7 @@ struct bnxt_ulp_ops { void (*ulp_shutdown)(void *); void (*ulp_irq_stop)(void *); void (*ulp_irq_restart)(void *, struct bnxt_msix_entry *); + void (*ulp_log_live)(void *handle); }; struct bnxt_fw_msg { @@ -162,8 +163,11 @@ void bnxt_ulp_shutdown(struct bnxt_softc *bp); void bnxt_ulp_irq_stop(struct bnxt_softc *bp); void bnxt_ulp_irq_restart(struct bnxt_softc *bp, int err); void bnxt_ulp_async_events(struct bnxt_softc *bp, struct hwrm_async_event_cmpl *cmpl); +void bnxt_ulp_log_live(struct bnxt_en_dev *edev, u16 logger_id, + const char *format, ...); struct bnxt_en_dev *bnxt_ulp_probe(struct net_device *dev); void bnxt_aux_dev_release(struct device *dev); int bnxt_rdma_aux_device_add(struct bnxt_softc *bp); int bnxt_rdma_aux_device_del(struct bnxt_softc *bp); +void bnxt_logger_ulp_live_data(void *d); #endif diff --git a/sys/dev/bnxt/bnxt_en/if_bnxt.c b/sys/dev/bnxt/bnxt_en/if_bnxt.c index 6d82302615e1..83f339bb045f 100644 --- a/sys/dev/bnxt/bnxt_en/if_bnxt.c +++ b/sys/dev/bnxt/bnxt_en/if_bnxt.c @@ -71,6 +71,8 @@ #include "bnxt_mgmt.h" #include "bnxt_ulp.h" #include "bnxt_auxbus_compat.h" +#include "bnxt_log.h" +#include "bnxt_log_data.h" /* * PCI Device ID Table @@ -1243,6 +1245,64 @@ static void bnxt_free_ctx_mem(struct bnxt_softc *softc) softc->ctx_mem = NULL; } +const u16 bnxt_bstore_to_trace[] = { + [BNXT_CTX_SRT_TRACE] = + HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_SRT_TRACE, + [BNXT_CTX_SRT2_TRACE] = + HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_SRT2_TRACE, + [BNXT_CTX_CRT_TRACE] = + HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_CRT_TRACE, + [BNXT_CTX_CRT2_TRACE] = + HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_CRT2_TRACE, + [BNXT_CTX_RIGP0_TRACE] = + HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_RIGP0_TRACE, + [BNXT_CTX_L2_HWRM_TRACE] = + HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_L2_HWRM_TRACE, + [BNXT_CTX_ROCE_HWRM_TRACE] = + HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_ROCE_HWRM_TRACE, +}; + +static void +bnxt_bs_trace_init(struct bnxt_softc *bp, struct bnxt_ctx_mem_type *ctxm) +{ + uint32_t mem_size, pages, rem_bytes, magic_byte_offset; + struct bnxt_ctx_pg_info *ctx_pg = ctxm->pg_info; + struct bnxt_ring_mem_info *rmem, *rmem_pg_tbl; + uint32_t last_pg, n = 1, size = sizeof(uint8_t); + struct bnxt_bs_trace_info *bs_trace; + uint16_t trace_type; + + mem_size = ctxm->max_entries * ctxm->entry_size; + rem_bytes = mem_size % BNXT_PAGE_SIZE; + pages = DIV_ROUND_UP(mem_size, BNXT_PAGE_SIZE); + + last_pg = (pages - 1) & (MAX_CTX_PAGES - 1); + magic_byte_offset = ((rem_bytes ? rem_bytes : BNXT_PAGE_SIZE) - size); + + if (ctxm->instance_bmap) { + if (ctxm->instance_bmap > 1) + return; + n = bitcount32(ctxm->instance_bmap); + } + + rmem = &ctx_pg[n - 1].ring_mem; + trace_type = bnxt_bstore_to_trace[ctxm->type]; + bs_trace = &bp->bs_trace[trace_type]; + bs_trace->ctx_type = ctxm->type; + bs_trace->trace_type = trace_type; + if (pages > MAX_CTX_PAGES) { + int last_pg_directory = rmem->nr_pages - 1; + + rmem_pg_tbl = + &ctx_pg[n - 1].ctx_pg_tbl[last_pg_directory]->ring_mem; + bs_trace->magic_byte = rmem_pg_tbl->pg_arr[last_pg].idi_vaddr; + } else { + bs_trace->magic_byte = rmem->pg_arr[last_pg].idi_vaddr; + } + bs_trace->magic_byte += magic_byte_offset; + *bs_trace->magic_byte = BNXT_TRACE_BUF_MAGIC_BYTE; +} + static int bnxt_backing_store_cfg_v2(struct bnxt_softc *softc, u32 ena) { @@ -1264,7 +1324,7 @@ bnxt_backing_store_cfg_v2(struct bnxt_softc *softc, u32 ena) continue; } /* ckp TODO: this is trace buffer related stuff, so keeping it diabled now. needs revisit */ - //bnxt_bs_trace_init(bp, ctxm, type - BNXT_CTX_SRT_TRACE); + bnxt_bs_trace_init(softc, ctxm); last_type = type; } } @@ -2198,7 +2258,7 @@ static int bnxt_open(struct bnxt_softc *bp) if (BNXT_CHIP_P5_PLUS(bp)) bnxt_hwrm_reserve_rings(bp); - + /* Get the current configuration of this function */ rc = bnxt_hwrm_func_qcfg(bp); if (rc) { @@ -2446,6 +2506,14 @@ bnxt_hwrm_reserve_rings(struct bnxt_softc *softc) return bnxt_hwrm_reserve_vf_rings(softc); } +static void +bnxt_log_live_data(void *d) +{ + struct bnxt_softc *bp = d; + + bnxt_log_ring_states(bp); +} + /* Device setup and teardown */ static int bnxt_attach_pre(if_ctx_t ctx) @@ -2495,6 +2563,11 @@ bnxt_attach_pre(if_ctx_t ctx) goto pci_attach_fail; } + mtx_init(&softc->log_lock, "BNXT LOG Lock", NULL, MTX_DEF); + TAILQ_INIT(&softc->loggers_list); + bnxt_register_logger(softc, BNXT_LOGGER_L2, BNXT_L2_MAX_LOG_BUFFERS, + bnxt_log_live_data, BNXT_L2_MAX_LIVE_LOG_SIZE); + /* HWRM setup/init */ BNXT_HWRM_LOCK_INIT(softc, device_get_nameunit(softc->dev)); rc = bnxt_alloc_hwrm_dma_mem(softc); @@ -2527,7 +2600,7 @@ bnxt_attach_pre(if_ctx_t ctx) if (rc) goto hwrm_short_cmd_alloc_fail; } - + /* Now perform a function reset */ rc = bnxt_hwrm_func_reset(softc); @@ -2931,6 +3004,9 @@ bnxt_detach(if_ctx_t ctx) bnxt_free_hwrm_short_cmd_req(softc); BNXT_HWRM_LOCK_DESTROY(softc); + bnxt_unregister_logger(softc, BNXT_LOGGER_L2); + mtx_destroy(&softc->log_lock); + if (!bnxt_num_pfs && bnxt_pf_wq) destroy_workqueue(bnxt_pf_wq); diff --git a/sys/dev/bnxt/bnxt_re/main.c b/sys/dev/bnxt/bnxt_re/main.c index 01c2710bc3ea..5b1fe2ae0faa 100644 --- a/sys/dev/bnxt/bnxt_re/main.c +++ b/sys/dev/bnxt/bnxt_re/main.c @@ -52,6 +52,7 @@ #include "ib_verbs.h" #include "bnxt_re-abi.h" #include "bnxt.h" +#include "bnxt_log.h" *** 100 LINES SKIPPED *** From nobody Mon Jun 15 11:35:38 2026 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 4gf7NC2jGmz6hBl7 for ; Mon, 15 Jun 2026 11:35: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gf7NC05Ltz3Jdq for ; Mon, 15 Jun 2026 11:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781523339; 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; bh=PM70prObBbTqgUWkSQrA2AgobUW49lXucS0Wm/mluOE=; b=WFHLtpi2Mro7QiqdCkSLPGdfJeU9QBNZe16dw9hR8mZqAPdNsB2FVXHWSzqAUzj4c8ZvY9 gQTpnLmhnm9xvG/6CJFyIyJPWBdp9U7N44DZ5FDNuwuzuFMD7RGq8KMYYXgtryJ//Ny9cz nHXf3dRgxl31I144xhf8BWLpuAc7vI1pj95LtkrIdG3qAvY2PH0ULYC1UR+1LGA+Q++105 mcXJKi1kHEI5fn7LeDziVLD6nUKWLgs0sV0GmOxyBzw9ROL/Pv03f9W8u9+LQ9GSGBR4LX 180EAWZk5XzstSdRhSTvCZCS4G9a8PPo8Auj1i3fJ/pQ+5YUl/TOz8Vx3oreAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781523339; a=rsa-sha256; cv=none; b=OLS70519YJBnZ4V4lBTW2Vy0D81Lvyf1Vgk38+TQi7/bbLu6ljxuyrRoleEde6cIgHgtsh bcVhfgiiFYOBYzAQdWvsn2vtTzKEIaNb0wddE+btV7VNesfejT7RmJP3OucOQmBDD76dDB 14KJ/O6eC5TerKCRxp3DVhIuCOJKPN7DZpULxdt3erWKWhxPp+ibCigeAorD7GFJPfpjeO ogTCFyAIaRzoNj4PfTB2u7wAObjNe6tq6y2iOvYBQoeFcqtf6yIqYVSHeqjZW0lvWfYHgX GRfma5E49VEjCm+TtB6zgvaR7c7zVyXu+43XB0x3JpFS14tLv38E2xGb3cHHqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781523339; 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; bh=PM70prObBbTqgUWkSQrA2AgobUW49lXucS0Wm/mluOE=; b=Gy5Qv01LXdfL8Q/AJ6HXQgzUjbq07z0+smxcjSoB//kA14XDUDW7Guhtsqoka9IAUwj2QS 1sYWFvZjL8Cj69fTjXTCL9rP+sDbb6M5REFSKUWcBz0UQTMQsu1rO1yYOt0NRzgMK9o1xk zbsEZnKIVREC1eWFJJx5eCH1evD4fTWbNDlTKVVfRqaWXY9VKuJbs/7Nac6Ge4q/6vkV3W yHSSIIsXBr/FiXPRzcfTLc6oBPLNosZ5CUYW779eoPZ7beybCvIoEjmpL2hPdUhgcSk4f2 fMRI3axzuuyJMgY9HLkO2TNLz9beMRCaw0NLTlPrX6Jya52L4HQW7LTfL1Z6RA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gf7NB4lGRzskt for ; Mon, 15 Jun 2026 11:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1c475 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 11:35:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Sreekanth Reddy From: Sumit Saxena Subject: git: 9d87ca8b9f60 - main - if_bnxt: Add support for HWRM passthrough with multiple DMA buffers 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ssaxena X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d87ca8b9f60bdec0bbc1733920df250a08beb0c Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 11:35:38 +0000 Message-Id: <6a2fe38a.1c475.1aea1c80@gitrepo.freebsd.org> The branch main has been updated by ssaxena: URL: https://cgit.FreeBSD.org/src/commit/?id=9d87ca8b9f60bdec0bbc1733920df250a08beb0c commit 9d87ca8b9f60bdec0bbc1733920df250a08beb0c Author: Sreekanth Reddy AuthorDate: 2026-06-15 09:49:40 +0000 Commit: Sumit Saxena CommitDate: 2026-06-15 11:34:12 +0000 if_bnxt: Add support for HWRM passthrough with multiple DMA buffers Added support for HWRM passthrough commands with multiple DMA buffers. Also, changed the mgmt_lock to sleepable exclusive lock. MFC after: 2 weeks Reviewed by: gallatin, ssaxena Differential Revision: https://reviews.freebsd.org/D56686 --- sys/dev/bnxt/bnxt_en/bnxt.h | 3 ++ sys/dev/bnxt/bnxt_en/bnxt_mgmt.c | 96 ++++++++++++++++++++++++---------------- 2 files changed, 60 insertions(+), 39 deletions(-) diff --git a/sys/dev/bnxt/bnxt_en/bnxt.h b/sys/dev/bnxt/bnxt_en/bnxt.h index dfbf1d8f03d3..7e58139f1ab6 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt.h +++ b/sys/dev/bnxt/bnxt_en/bnxt.h @@ -1397,6 +1397,9 @@ struct bnxt_softc { struct mtx log_lock; /* logging ops lock */ struct callout time_sync_callout; struct bnxt_bs_trace_info bs_trace[BNXT_CTX_TRACE_BUF_COUNT]; + +#define MAX_NUM_DMA_INDICATIONS 10 + struct iflib_dma_info mgmt_dma_data[MAX_NUM_DMA_INDICATIONS]; }; struct bnxt_filter_info { diff --git a/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c b/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c index 0a12bea17ead..edf50ac1432f 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c +++ b/sys/dev/bnxt/bnxt_en/bnxt_mgmt.c @@ -52,7 +52,7 @@ static struct cdevsw bnxt_mgmt_cdevsw = { /* Global vars */ static struct cdev *bnxt_mgmt_dev; -struct mtx mgmt_lock; +struct sx mgmt_lock; MALLOC_DEFINE(M_BNXT, "bnxt_mgmt_buffer", "buffer for bnxt_mgmt module"); @@ -439,11 +439,11 @@ bnxt_mgmt_loader(struct module *m, int what, void *arg) return (error); } - mtx_init(&mgmt_lock, "BNXT MGMT Lock", NULL, MTX_DEF); + sx_init(&mgmt_lock, "BNXT MGMT Lock"); break; case MOD_UNLOAD: - mtx_destroy(&mgmt_lock); + sx_destroy(&mgmt_lock); destroy_dev(bnxt_mgmt_dev); break; default: @@ -526,9 +526,8 @@ bnxt_mgmt_process_hwrm(struct cdev *dev, u_long cmd, caddr_t data, struct bnxt_softc *softc = NULL; struct bnxt_mgmt_req mgmt_req = {}; struct bnxt_mgmt_fw_msg msg_temp, *msg, *msg2 = NULL; - struct iflib_dma_info dma_data = {}; void *user_ptr, *req, *resp; - int ret = 0; + int ret = 0, num_allocated = 0, i; uint16_t num_ind = 0; memcpy(&user_ptr, data, sizeof(user_ptr)); @@ -558,9 +557,10 @@ bnxt_mgmt_process_hwrm(struct cdev *dev, u_long cmd, caddr_t data, return -EINVAL; } - if (msg_temp.num_dma_indications > 1) { + if (msg_temp.num_dma_indications > MAX_NUM_DMA_INDICATIONS) { device_printf(softc->dev, "%s:%d Max num_dma_indications " - "supported is 1\n", __func__, __LINE__); + "supported is %d\n", __func__, __LINE__, + MAX_NUM_DMA_INDICATIONS); return -EINVAL; } @@ -594,43 +594,58 @@ bnxt_mgmt_process_hwrm(struct cdev *dev, u_long cmd, caddr_t data, } msg = msg2; - ret = iflib_dma_alloc(softc->ctx, msg->dma[0].length, &dma_data, - BUS_DMA_NOWAIT); - if (ret) { - device_printf(softc->dev, "%s:%d iflib_dma_alloc" - "failed with ret = 0x%x\n", __func__, - __LINE__, ret); - ret = -ENOMEM; - goto end; - } + for (i = 0; i < num_ind; i++) { - if (!(msg->dma[0].read_or_write)) { - if (copyin((void *)msg->dma[0].data, - dma_data.idi_vaddr, - msg->dma[0].length)) { - device_printf(softc->dev, "%s:%d Failed to copy" - "data from user\n", __func__, - __LINE__); - ret = -EFAULT; + if (msg->dma[i].length == 0) { + device_printf(softc->dev, + "%s:%d i:%d Invalid DMA memory length\n", + __func__, __LINE__, i); + ret = -ENOMEM; + goto end; + } + + memset(&softc->mgmt_dma_data[i], 0, sizeof(struct iflib_dma_info)); + + ret = iflib_dma_alloc(softc->ctx, msg->dma[i].length, &softc->mgmt_dma_data[i], + BUS_DMA_WAITOK); + if (ret) { + device_printf(softc->dev, + "%s:%d iflib_dma_alloc failed with ret = 0x%x\n", + __func__, __LINE__, ret); + ret = -ENOMEM; goto end; } + + num_allocated++; + if (!(msg->dma[i].read_or_write)) { + if (copyin((void *)msg->dma[i].data, + softc->mgmt_dma_data[i].idi_vaddr, + msg->dma[i].length)) { + device_printf(softc->dev, + "%s:%d Failed to copy data from user\n", + __func__, __LINE__); + ret = -EFAULT; + goto end; + } + } + dma_ptr = (void *) ((uint64_t) req + msg->dma[i].offset); + dmap = dma_ptr; + *dmap = htole64(softc->mgmt_dma_data[i].idi_paddr); } - dma_ptr = (void *) ((uint64_t) req + msg->dma[0].offset); - dmap = dma_ptr; - *dmap = htole64(dma_data.idi_paddr); } ret = bnxt_hwrm_passthrough(softc, req, msg->len_req, resp, msg->len_resp, msg->timeout); - if(ret) + if (ret) goto end; - if (num_ind) { - if ((msg->dma[0].read_or_write)) { - if (copyout(dma_data.idi_vaddr, - (void *)msg->dma[0].data, - msg->dma[0].length)) { - device_printf(softc->dev, "%s:%d Failed to copy data" - "to user\n", __func__, __LINE__); + for (i = 0; i < num_ind; i++) { + if ((msg->dma[i].read_or_write)) { + if (copyout(softc->mgmt_dma_data[i].idi_vaddr, + (void *)msg->dma[i].data, + msg->dma[i].length)) { + device_printf(softc->dev, + "%s:%d Failed to copy data to user\n", + __func__, __LINE__); ret = -EFAULT; goto end; } @@ -651,8 +666,11 @@ end: free(resp, M_BNXT); if (msg2) free(msg2, M_BNXT); - if (dma_data.idi_paddr) - iflib_dma_free(&dma_data); + if (num_allocated) { + for (i = 0; i < num_allocated; i++) + if (softc->mgmt_dma_data[i].idi_paddr) + iflib_dma_free(&softc->mgmt_dma_data[i]); + } return ret; } @@ -828,9 +846,9 @@ bnxt_mgmt_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, break; case IO_BNXT_MGMT_OPCODE_PASSTHROUGH_HWRM: case IOW_BNXT_MGMT_OPCODE_PASSTHROUGH_HWRM: - mtx_lock(&mgmt_lock); + sx_xlock(&mgmt_lock); ret = bnxt_mgmt_process_hwrm(dev, cmd, data, flag, td); - mtx_unlock(&mgmt_lock); + sx_xunlock(&mgmt_lock); break; case IO_BNXT_MGMT_OPCODE_DCB_OPS: case IOW_BNXT_MGMT_OPCODE_DCB_OPS: From nobody Mon Jun 15 11:35:37 2026 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 4gf7NH1kJKz6hBgw for ; Mon, 15 Jun 2026 11:35: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gf7NH0Dctz3JsG for ; Mon, 15 Jun 2026 11:35:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781523343; 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; bh=u0804m+NXnKbh8g3VxCPv3vTXRUzShV4ePT6ldPRIBs=; b=Mt208I1z6HsVE98WMh+62eH5jp4I/Lft5lIIMaKa5eOel1GMHJoiIsgmpTdwPEDEbXKw9V eeaV1H7fZDuoqY8vw7QfHjfxhN0G0vb4xPozTmls8T10SvxOfUIUo+Z+QxSSZWOf8WUtGb cNtKlTmVAYwiyol8z4ecWXs8kfz8PczwXh/jSHCTJ3s7mWu0+nRs3v5L327kNo04eBHEbc SZgqcL6mtk8/zySEghN5jLrO8nxNeUWe5MyHTMM5wB1xsHY+jfWEYrn1CSLVWjoAf6xqV8 Vfvz/nLD6p8SsAa3Zh/JaHLtOpOG+tyEu2ArNVSk4kmb9FwqvdRQtvHa3A4qaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781523343; a=rsa-sha256; cv=none; b=ZG6fpgS556jXzLIrVko17CNIRp9gqTlvI3kWxO9dOhTQlHx/Uvw8aRWyGT3JCBh8UubIC/ uDiJEoAdlTgGVRQxPlQ6JGv4+3Q+WplOohHp1BnZyfn3y4Y/tFrENLaGFWGFhY83MzwEJG ErFcRjAng581s5DT2g6j9AfrojGuSfrZd3TMM33G43IOvO5uwgYZOVdpYmFT1zfQYnNgXn qcR/3Z7gZEe1S67MvnUFc3gT9pCdylHDHpLSDFAmbYjSUxrytsFghsHyB1AcutfdZzPVdN xLtXI1MoqOPl8kM8ZtakfvxWFKackMImsdwb4pdB7B2H4pV4nm6GGn82WbXVfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781523343; 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; bh=u0804m+NXnKbh8g3VxCPv3vTXRUzShV4ePT6ldPRIBs=; b=bToLnGYxuKekEVGp2ZaLJUWbZP2whW1fTF2a0l+D2VTD02hMhf/n+pSxV+LM1SF16i1P9g YNhZryG4wB309U1DzBiuS8Iyd702DSmt+OfhkF1cgCXGGMyrT3ex4hU/NmxTmOolw2Eris r7qSuEIVLhTRklbfFqvG3tUPLRZcX+XlGQsYsHHK4SoAIofaUcnLeZcj1vQqV8dVhS0/3w H613QlKOgMUvAFAlVYeZcuYiLN7MOLY70aT3eGIE9lZCj4E6yx6XD/YsSxCxE85Cz5TvbJ sh7kDSXZwWTg//grbLl645/kaWqBgRQxK2/veBsRxq7SzuJdf+bkb9zgJX3AGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gf7NG3w2Tzt9h for ; Mon, 15 Jun 2026 11:35:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1d4b6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 11:35:37 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Sreekanth Reddy From: Sumit Saxena Subject: git: 3987058a3a94 - main - if_bnxt: Fix the Unknown command 0x80000000 ioctl command error 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ssaxena X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3987058a3a943c461c27dbebf10dad555b1bb2fa Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 11:35:37 +0000 Message-Id: <6a2fe389.1d4b6.646e7e2f@gitrepo.freebsd.org> The branch main has been updated by ssaxena: URL: https://cgit.FreeBSD.org/src/commit/?id=3987058a3a943c461c27dbebf10dad555b1bb2fa commit 3987058a3a943c461c27dbebf10dad555b1bb2fa Author: Sreekanth Reddy AuthorDate: 2026-06-15 09:48:34 +0000 Commit: Sumit Saxena CommitDate: 2026-06-15 11:34:12 +0000 if_bnxt: Fix the Unknown command 0x80000000 ioctl command error With the latest niccli version, user will observe below Unknown command command error when try to list the devices. if_bnxt: Unknown command 0x80000000 Here, niccli is issuing command opcode as 0x80000000 but driver is expecting 0x20000000 command opcode. So, replaced _IOW(0,0,0) with the _IOC(IOC_IN,0,0,0). Fixes: d53d7b4 ("bnxt: Fix up ioctl opcodes to support IOC_VOID along with IOC_IN") MFC after: 2 weeks Reviewed by: gallatin, ssaxena Differential Revision: https://reviews.freebsd.org/D56685 --- sys/dev/bnxt/bnxt_en/bnxt_mgmt.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/dev/bnxt/bnxt_en/bnxt_mgmt.h b/sys/dev/bnxt/bnxt_en/bnxt_mgmt.h index 272fb0e298cb..169434633b9a 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt_mgmt.h +++ b/sys/dev/bnxt/bnxt_en/bnxt_mgmt.h @@ -40,11 +40,11 @@ #define DRIVER_NAME "if_bnxt" -#define IOW_BNXT_MGMT_OPCODE_GET_DEV_INFO _IOW(0, 0, 0) -#define IOW_BNXT_MGMT_OPCODE_PASSTHROUGH_HWRM _IOW(0, 1, 0) -#define IOW_BNXT_MGMT_OPCODE_DCB_OPS _IOW(0, 2, 0) -#define IOW_BNXT_MGMT_OPCODE_DRV_DUMP _IOW(0, 3, 0) -#define IOW_BNXT_MGMT_OPCODE_CRASH_DUMP _IOW(0, 4, 0) +#define IOW_BNXT_MGMT_OPCODE_GET_DEV_INFO _IOC(IOC_IN, 0, 0, 0) +#define IOW_BNXT_MGMT_OPCODE_PASSTHROUGH_HWRM _IOC(IOC_IN, 0, 1, 0) +#define IOW_BNXT_MGMT_OPCODE_DCB_OPS _IOC(IOC_IN, 0, 2, 0) +#define IOW_BNXT_MGMT_OPCODE_DRV_DUMP _IOC(IOC_IN, 0, 3, 0) +#define IOW_BNXT_MGMT_OPCODE_CRASH_DUMP _IOC(IOC_IN, 0, 4, 0) #define IO_BNXT_MGMT_OPCODE_GET_DEV_INFO _IO(0, 0) #define IO_BNXT_MGMT_OPCODE_PASSTHROUGH_HWRM _IO(0, 1) From nobody Mon Jun 15 12:28:49 2026 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 4gf8YZ0rnxz6hGWQ for ; Mon, 15 Jun 2026 12:28:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gf8YY72zdz3RYS for ; Mon, 15 Jun 2026 12:28:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781526530; 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=viCC8pKQnwr4fVlQnoPdmeisD1TsCM3167l5NrG3gkU=; b=HrXwfm6CqR1yhfM1jud0nyH1W02oqygrT+iCNeZwm/wOlck7gebRM2Vnky13VolcvhkA4g Sg3DAAaLYkNCE80FpDZhDcqdnp5nNbVpdX9RrjlOq6kp6GmytWGCMm//X4XXxVCZOxvS8v 6n0+91+ri5yeSPRm/9bVIUkssYBZw6IPH6aoKlt9pkKaTInjzArRXlvncxAQUKmJPOcZaW HAPAHa7hdsehChSCERFmJrH+GSGVWMLjbBz+QK7ZKWaHRWagJdeIXn+NIHssVZsf1Iz+k4 JUQANf1QJxkcmRul2PwD7wzNe2gmYaSUmjwUA8PKQ4tLjoW8vSsbehcawTpR+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781526530; a=rsa-sha256; cv=none; b=yr3HNraIPsqz50c5ZlkSGQnEV3PBu3HCzP/x9Pe52cT8s9BYsoooJetp2LSExG6BHOgA3I jZWzKL32QF/FpbQWaTQy0FbaohAAPqsmfnkZyKqX9h3A3dhyQpFd7UHv+Yu1BC0KDXw/K2 XfzVtK3mWvTg4BzbA89j8spgCGbxMhtSzci6+n3ix3dE0JKVhW+0M5ih9fIsoRmDXv8Kfx p4sOoVQQ6A+MjaVl1TLFsJdm2A8kcxRELxF4viwYcZHRSXPh9LUqr4i1agpiMlfuPOt12+ vG1da5285gapvU86zW/d0h5eeIDhdt/CpgiPc6PlKr2uUbMVpLVTlyouuHwlHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781526530; 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=viCC8pKQnwr4fVlQnoPdmeisD1TsCM3167l5NrG3gkU=; b=F7XvXxx8B9b19gM5joCysMblMYzK4FOR2WeUvGmjSTdvCBIxhiflsHPmUk/EStkOG5gaRp mSiZX4vLjkegVEca0jXc7zv8UqO6zQ+M0jSFsp+/l49Pke0TW0PSOfhL2Da+2Gqg/PdrlH w+nuq0lO2z1hjPfBjAZXdd+zFYIb4VQZr1SuwyauWsBHq9wc3+F/Ll/5N4Ih8NDJAowpqr Ub00Hjjn6rlai68XWoQZfnkiOcBCu63j5E24VrR7JKG6OqCgaLy+wE6DtujypmN4KeFiW/ ZgUX1ngsKKk6eapDcY0BMNUPzxWRj378XjXHAFa16kTR0E7ru2bYts8IG38AJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gf8YY6PNtzvk8 for ; Mon, 15 Jun 2026 12:28:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23d17 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 12:28:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Sumit Saxena Subject: git: 03676cafa882 - main - if_bnxt: add bnxt logger module files to sys/conf/files for built-in kernel builds 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ssaxena X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 03676cafa882c471a29436aae76c8751d451dd07 Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 12:28:49 +0000 Message-Id: <6a2ff001.23d17.661deb7a@gitrepo.freebsd.org> The branch main has been updated by ssaxena: URL: https://cgit.FreeBSD.org/src/commit/?id=03676cafa882c471a29436aae76c8751d451dd07 commit 03676cafa882c471a29436aae76c8751d451dd07 Author: Sumit Saxena AuthorDate: 2026-06-15 12:22:25 +0000 Commit: Sumit Saxena CommitDate: 2026-06-15 12:25:05 +0000 if_bnxt: add bnxt logger module files to sys/conf/files for built-in kernel builds The bnxt snapdump and coredump support patches added bnxt_log/{_data}.c. and listed it in sys/modules/bnxt/bnxt_en/Makefile, but missed to add these files in sys/conf/files. Fix up the issue by adding bnxt_log/{_data}.c in sys/conf/files. Fixes: f85e66e655c9 ("if_bnxt/bnxt_re: add support for driver snapdump") --- sys/conf/files | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/conf/files b/sys/conf/files index 324ee35d490d..67f0dcedd346 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1326,6 +1326,8 @@ dev/bnxt/bnxt_en/bnxt_sriov.c optional bnxt iflib pci compile-with "${BNXT_C}" dev/bnxt/bnxt_en/bnxt_sysctl.c optional bnxt iflib pci compile-with "${BNXT_C}" dev/bnxt/bnxt_en/bnxt_txrx.c optional bnxt iflib pci compile-with "${BNXT_C}" dev/bnxt/bnxt_en/bnxt_ulp.c optional bnxt iflib pci compile-with "${BNXT_C}" +dev/bnxt/bnxt_en/bnxt_log.c optional bnxt iflib pci compile-with "${BNXT_C}" +dev/bnxt/bnxt_en/bnxt_log_data.c optional bnxt iflib pci compile-with "${BNXT_C}" dev/bnxt/bnxt_en/if_bnxt.c optional bnxt iflib pci compile-with "${BNXT_C}" dev/bwi/bwimac.c optional bwi dev/bwi/bwiphy.c optional bwi From nobody Mon Jun 15 12:36:32 2026 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 4gf8kS64glz6hHJ3 for ; Mon, 15 Jun 2026 12:36: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gf8kS5Q3Tz3SqH for ; Mon, 15 Jun 2026 12:36:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781526992; 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=N060wFbp0FROQ4M2NvcQLhD42mH9tFVlVSqaBtfeofE=; b=BJQ78IrK+WaUH+oSsxsAbDB0IYx2JixhIcomZ59g8u91D0+XbGTGFk09Ttf8clPxmnk2ez Ctq1T9mayNgLcVP4iJWFng8b/S/IcYJI4/YnEm8Bi62xJVOzxWIKa5l9v/2dUduYylZ54L 9KIgeDAVKeqR83VGPyZODNTdtH435Z7cq5ScJjdxwY/ZSd6FQdlGleFYgnudvYwL1J7JEm ghH6KOmtUmcSUo5D4XsrBF0f4xzhosHGSwJih2olMjGZwlyhZ7uW1HpCwEdoaxh03s4+nL PjJcgimSSpx2nUidQDC0I0b1XVvZTC4dv8FXqLNehyQCboHa7YcA5Sq80lq4Kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781526992; a=rsa-sha256; cv=none; b=P0Nl1BXIzfFXMZ++PSeR6JRlpShUQGYtpxr5ziAJdGC/aaIb2+TfcNBTeEzLJD5bNQuDtd nfYY0RVpQz289++Bks995ANOUWq8cdQLZtjWItAc/LcCSZ8QbPFHMdhIkync9Sw9MWShnP 80R8H0Cr4+Md8yxkJOEmC8K/FxNG02ri5QolprEJZgn6IYqcPmKJBvi500GcQRu1SXjrsN bsXgt1yWSlkaVq3Z0Auw5yVpcV5fqNXTSUCCKiRtWwpsWY7wp6PapEmejb2n5jlarKzWw5 QTuV1XUUBvCWidmzMjqD8m8HRrRvUYwW0FJy47cvD5uqVm6x1V8aCk4Z4aGwDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781526992; 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=N060wFbp0FROQ4M2NvcQLhD42mH9tFVlVSqaBtfeofE=; b=F8SkbmW4ScfqjbE8VTl+w3D7gnmcfoXP15jyIrTwI62BMCahPQB0axvSwvCOyyNvxr67oj kWeYj4/Rs8V6Cm5GRSBUwjvN2+Ako0Zy+xRYTveW3zVp/lH9KB/Av9DpM34pi73yrJPe7F t+lD/UOEh99Nbc6z+pSzJpERS1jM/4Is4ErQD4JVTdHM1RQN3eSCEeLYlgUviaDUvCpQs6 cke08xfx9hipjuu0SBBsFqmbkrv0xSnm8ZOjNdPAre5z/clvfjvfJS+4sCybhw5vc4dHxn WTxBgq8QWg6UHVXKG4IxNG1qbDRLrSnJPPaUyQLxd5k9sBnBufUeapQFv3zl7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gf8kS4k6DzvD7 for ; Mon, 15 Jun 2026 12:36:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22ef1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 12:36:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 21a75a85f0e0 - main - netlink: Indicate that ifinfomsg uses IFT_* types 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 21a75a85f0e0cc328b6e9b437d783ef0c25dc52e Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 12:36:32 +0000 Message-Id: <6a2ff1d0.22ef1.718b4901@gitrepo.freebsd.org> The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=21a75a85f0e0cc328b6e9b437d783ef0c25dc52e commit 21a75a85f0e0cc328b6e9b437d783ef0c25dc52e Author: Ed Maste AuthorDate: 2026-05-29 16:23:17 +0000 Commit: Ed Maste CommitDate: 2026-06-15 12:36:16 +0000 netlink: Indicate that ifinfomsg uses IFT_* types On Linux struct ifinfomsg uses ARPHRD_* values, while we used IFT_* types (which derive from SNMP ifType definitions in RFC 1573). Update the header to reflect this. PR: 272144 Reviewed by: pouria Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57334 --- share/man/man4/rtnetlink.4 | 17 +++++++++++++++-- sys/netlink/route/interface.h | 4 ++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/share/man/man4/rtnetlink.4 b/share/man/man4/rtnetlink.4 index 2161db157234..d756cd031145 100644 --- a/share/man/man4/rtnetlink.4 +++ b/share/man/man4/rtnetlink.4 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 15, 2026 +.Dd June 15, 2026 .Dt RTNETLINK 4 .Os .Sh NAME @@ -275,12 +275,25 @@ All interface configuration messages share the common header: struct ifinfomsg { unsigned char ifi_family; /* not used, set to 0 */ unsigned char __ifi_pad; - unsigned short ifi_type; /* ARPHRD_* */ + unsigned short ifi_type; /* IFT_* */ int ifi_index; /* Interface index */ unsigned ifi_flags; /* IFF_* flags */ unsigned ifi_change; /* IFF_* change mask */ }; .Ed +.Pp +.Sy Note : +On +.Fx +the +.Va ifi_type +field uses +.Dv IFT_* +constants from +.In net/if_types.h +rather than +.Dv ARPHRD_* +as on Linux. .Ss RTM_NEWLINK Creates a new interface. The only mandatory TLV is diff --git a/sys/netlink/route/interface.h b/sys/netlink/route/interface.h index 0bd06ff1f6d5..e6aef3d702d8 100644 --- a/sys/netlink/route/interface.h +++ b/sys/netlink/route/interface.h @@ -36,8 +36,8 @@ struct ifinfomsg { unsigned char ifi_family; /* not used */ unsigned char __ifi_pad; - unsigned short ifi_type; /* ARPHRD_* */ - int ifi_index; /* Inteface index */ + unsigned short ifi_type; /* IFT_* (net/if_types.h) */ + int ifi_index; /* Interface index */ unsigned ifi_flags; /* IFF_* flags */ unsigned ifi_change; /* IFF_* change mask */ }; From nobody Mon Jun 15 12:58:43 2026 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 4gf9D4055Mz6hJk9 for ; Mon, 15 Jun 2026 12:58: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gf9D34ryJz3WVn for ; Mon, 15 Jun 2026 12:58:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781528323; 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=b3OrtNM+N8MX+qQtt9QVrhjvulT1tj5l+GA7hcRdwJU=; b=kWD+9F4aV3Fmn3rmZGv3jVFx/GW7N3gVi7JXVGt422H2x6vEBq6NDUxckAAPzK9jPaSDZD b6wm+JCuyUZPEqvG3QjhO8JlPddYXHrdCEGw8icx7/iIgRc+zqFD+lsYYT1kaSzqurhZZ9 KXlbdZIxBq0cNdCzoRn0DDCVp5mbKd/sRJna8NhF6XGiQWJLlpa+szl+eYA9PQoLhsZgaJ Euac0ZBxz14Td/P4F3C03nkk9qQdLFV0WVnwapVqumfo5RgFf3V2P+sa5HjJtzqy89zwOC AaWDfX8ydw6/TKDi28xklgAlrIaGWA3yCKW+eTFhumu/KIxr5349YpYCM3xNPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781528323; a=rsa-sha256; cv=none; b=yb7HdVsmPMl4vEbAJJ405vCx4FG1uRHjR5NxR31zqRk3oAQHvzuSUajAAkppAaqf3URba8 s8XaBPegAt+k95hdvVHJ8DYU4yZlgGsXEm+4DjkEC6lE8fMRyy1rCBLmh+MMADycn99fIc JyuNthL5wO9KDZXOYFi48micHjidwPJom2QHe9AqgOjBAczZmteK+T3Z2VHre+Wxqn+jao 2EHZQ8aJoEkWRFHv1ECPK3DYSmjErDJxFz1HJFtOrDBGc6MRvbS/tyyM0I5w0A67nubKpY wUzPk/5B4otI7XhNAUOtOGqHtltcDIjoqB1ZIaqDQa7/9pn8q5ds1dRBpZgRiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781528323; 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=b3OrtNM+N8MX+qQtt9QVrhjvulT1tj5l+GA7hcRdwJU=; b=i4ev+Zm1ggkGerfc8er46ckom9SjrKDv1dYZWMKdGfJXBDJsLXHluSclKF5KD7Yy4mS7h7 hH//SzBg4DYEXt4h7Q+kFNuGHo0wz9HwbXgcCplfzb0HCzEp59Sj6TXbru3h5ocZjEjVdS o2e1HG9L70BQ3u3oegPDDh7BCR27UEAPaxqCm5aC1+3lMetjl95/zkzsoZozxrarN1nbxO Y0UKk8yOujBw1xH80M07oSHdo/cnxNkQbil4+OD6hBLZQF16zwkjUwSXbpnODLZC+SaFj+ 3BtneJhynM4foO2FLQHRE4gyJZ2PVwyVvtivR483+xCnUT+wvBZuByLeaayivQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gf9D34GtVzw3C for ; Mon, 15 Jun 2026 12:58:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25bd5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 12:58:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 96759ab67a42 - main - ntsync(9): properly handle timeouts 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 96759ab67a42226679675e24e35549aea2aa49e0 Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 12:58:43 +0000 Message-Id: <6a2ff703.25bd5.10fe416f@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=96759ab67a42226679675e24e35549aea2aa49e0 commit 96759ab67a42226679675e24e35549aea2aa49e0 Author: Konstantin Belousov AuthorDate: 2026-06-15 00:59:46 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-15 12:56:40 +0000 ntsync(9): properly handle timeouts Reported by: Alex S Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/dev/ntsync/ntsync.c | 16 ++++++++++++---- sys/dev/ntsync/ntsyncvar.h | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/sys/dev/ntsync/ntsync.c b/sys/dev/ntsync/ntsync.c index a7b002de7cb6..2d3054e0a4ee 100644 --- a/sys/dev/ntsync/ntsync.c +++ b/sys/dev/ntsync/ntsync.c @@ -215,7 +215,7 @@ ntsync_wait_locked(struct ntsync_wait_state *state, struct thread *td) if (state->ready) break; error = msleep_sbt(state, &state->owner->lock, - PCATCH, "ntsync", state->sb, 0, + PCATCH, "ntsync", state->sb, state->prec, C_ABSOLUTE /* | C_HARDCLOCK XXXKIB */); /* @@ -1195,7 +1195,6 @@ ntsync_wait_state_get(struct ntsync_wait_args *nwa, u_long cmd, { struct ntsync_wait_state *state; struct ntsync_obj *obj; - struct bintime btb; int error, i, j; if (nwa->count > NTSYNC_MAX_WAIT_COUNT) @@ -1270,14 +1269,23 @@ ntsync_wait_state_get(struct ntsync_wait_args *nwa, u_long cmd, } } + state->prec = 0; if (nwa->timeout == UINT64_MAX) { state->sb = 0; } else { state->sb = nstosbt(nwa->timeout); if ((nwa->flags & NTSYNC_WAIT_REALTIME) != 0) { - getboottimebin(&btb); - state->sb += bttosbt(btb); + struct bintime btb; + + bintime(&btb); + state->sb -= bttosbt(btb); + } else { + struct timespec ts; + + nanouptime(&ts); + state->sb -= tstosbt(ts); } + state->sb += sbinuptime(); } *statep = state; diff --git a/sys/dev/ntsync/ntsyncvar.h b/sys/dev/ntsync/ntsyncvar.h index fd875588e889..97828c99bb7d 100644 --- a/sys/dev/ntsync/ntsyncvar.h +++ b/sys/dev/ntsync/ntsyncvar.h @@ -81,6 +81,7 @@ struct ntsync_wait_state { struct ntsync_obj *objs[NTSYNC_MAX_WAIT_COUNT + 1]; struct ntsync_obj_event *alert_event; sbintime_t sb; + sbintime_t prec; int error; int index; bool any; From nobody Mon Jun 15 12:58:44 2026 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 4gf9D460WBz6hJW6 for ; Mon, 15 Jun 2026 12:58: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gf9D44wtvz3WVp for ; Mon, 15 Jun 2026 12:58:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781528324; 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=9p2AiVm+flJu2W4GHCLD2+qEloF3tsBuZuuP4pVM+6Q=; b=NsZq9AX0lLAAMkNw0H7hM7jT5RRwHy3ZBxkXy024BKsBQUiBFxp+IJYHckxCj7V9Gv6/Pu gfoClHhZSydk+BTWkbMO8K5Oif0WUOJnJXzOGZfA12Fu1RdAiP/uJkmnIEuZk/E8ZQGqVm D8iwq7KUiZfcV9kXGI6p4dhoUx5F794L8e9Ct8tDByig6pGUITsnRTaLYT3Y2LCPOh5VxD 7krYDYBSLoBSBBxLAbVcM+mVpZqzzeicwrkqjP3kkMO9+r5yNrP5PGNFjTcazs94fHQzI3 ElCw8jtShkwKoSlZI/NWAEkpSwUhMzRtuUY3kwrsL3V5sEI6HpFjsm2l9St48Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781528324; a=rsa-sha256; cv=none; b=ZzlfhB4Q+hPLJHNC7080CGXUo98mVN23BEjdmOiW3YGaCcQvDxz7uFdHS8UzBmACT2lnSr CwEZNJhQzD7OoZJoexJujr3CzsYJWvRdLp5751YDqYBOWIiJvdIJAmKjMFeH9TmLjBit5h t2AMm0dD7p5naxDg4c26PrUt7tgHXqezF6l3Ox8eSHnartwtdeLhUwlVVqU+Obz8vyV7qA kcqsFNk9de3t/QJTaLbsKmDiR4y3prb8qiON6k5FiI91lEaj2dqugwojIPegnmpKu6SLMG Yqq8B2qqPWglVi6xQUndpTsyWVpxdGTCl54IgKY5mqtc/Q578haKn5bY8fJkVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781528324; 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=9p2AiVm+flJu2W4GHCLD2+qEloF3tsBuZuuP4pVM+6Q=; b=EQhFVTUxCZUVj/n5frvdOlIItOVRyqc8qPgx+hrm8chQ4irITmfxxKmyDh03WQ8wIIooBx yrwgVR7/RqFG8IDp8bBcgTSQR569IT640RFn0z99WxdY+ShkNHEmlgp0aSPBGG9BSyZTWQ FQP3IrBhSkA44abaUg2C221cvIKPJ+61XXpAU4DLw9Slv0AEnYmRSCBTf7/gUxHWnSo3RD 4ZJzYj1LnCMCZV8JiQufXVkX7md+HuipakSNpfvPW4lQqQ2g2B5AonYyWqx4uPIm7vEEJc hfokTRTBthTGq3ReOou34XEAlimaZIMH3nuEZRdAv5GW3ny4hLRa+KO9/N0NNA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gf9D44SZnzwYc for ; Mon, 15 Jun 2026 12:58:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25dc3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 12:58:44 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 281e350942b2 - main - ntsync(9): free wait state on error from copyin of the object's array 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 281e350942b26b054ba5bc820c6aae4ae0e03a38 Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 12:58:44 +0000 Message-Id: <6a2ff704.25dc3.7d0d0514@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=281e350942b26b054ba5bc820c6aae4ae0e03a38 commit 281e350942b26b054ba5bc820c6aae4ae0e03a38 Author: Konstantin Belousov AuthorDate: 2026-06-15 04:31:03 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-15 12:57:25 +0000 ntsync(9): free wait state on error from copyin of the object's array Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/dev/ntsync/ntsync.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/ntsync/ntsync.c b/sys/dev/ntsync/ntsync.c index 2d3054e0a4ee..5fba9775be0e 100644 --- a/sys/dev/ntsync/ntsync.c +++ b/sys/dev/ntsync/ntsync.c @@ -1210,7 +1210,7 @@ ntsync_wait_state_get(struct ntsync_wait_args *nwa, u_long cmd, error = copyin((void *)(uintptr_t)nwa->objs, &state->fds[0], nwa->count * sizeof(state->fds[0])); if (error != 0) - return (error); + goto error_ret; i = 0; if (nwa->alert != 0) { @@ -1296,6 +1296,8 @@ error_out: fdrop(state->fps[j], td); if (state->fp_alert != NULL) fdrop(state->fp_alert, td); +error_ret: + free(state, M_NTSYNC); return (error); } From nobody Mon Jun 15 12:58:45 2026 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 4gf9D60LVTz6hJWB for ; Mon, 15 Jun 2026 12:58: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gf9D55NnVz3WbX for ; Mon, 15 Jun 2026 12:58:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781528325; 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=urawPso8+REUkabxOX1v19S9E6wzRVR5sivaunL8PRI=; b=DjGBUYvYsVoZH4x8Qwhzp9SuzJg3lhNUt1TA23ug8mWf1HQbKQXUZv+lrh7rF9bNhQUFiY xZSIwM2xlIXW3/jjfd14z6bZgbMzg80/UlLLFj4NZcSBkc0tfqwk0qvkaI2GwxoH/7a1wy mR84Qqfk4VDrNUUOXscfnzLH7JJh9xMkRiZhU5vNR2EL1Iifh7DiUf27YRp7+m8RGRucDu v7Slmo2DEKQ9BLOld+0l3WEnRMqMbjnXkA5m7onEpjs3GeOMCBOMFS8/ZvtiF37h1vJjJT CbY2AJcdwXcwiiMEEaqcxud2xFRrDGJQaBQQuFlwB6Is2Zs2uP7fsdz00uUysQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781528325; a=rsa-sha256; cv=none; b=BGLj0uTWUDnmmrebfd4pW1n0/g8vdWqLqwgWQddp9CFLnDJdFn9/ztWPgOH10eyEiPju3C vik4f1/QUW3PmmI4HyCsTkrLz6retTSZzfK0C6H26gTtuf90Wbc1xeMpzPCR3A8RFPuR0R DZ8PW+91G9BR1sbbGvJq72kcyW1JMVWcxMzg7DPr/av5W/ft6dCLCJs7v35XGPkGhK04+n bTJ9Q7j/wir5F8WLOTgvq78Wb8fRL1gjbl/PIwox/qUptK/tldQ/Huj5Wy78m+6kXjDtrb JNOKlp/85+likDC93ouna7H9vSwGDXZK88l57+Fc/+0NktX2NXVl8urls5xU9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781528325; 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=urawPso8+REUkabxOX1v19S9E6wzRVR5sivaunL8PRI=; b=ZmIj/9DXwM4Bf0st+cJjUIolfjhPviy8pUocfdrBmuGzgOGU3XRfjRnh7TWHK23dmI6KAD QYWQPN5YGlR7c+Ne2UEvIvBGQR6tH2kAzMV9pjBcZ9ks+tAsJh7HmFjcIAbOUix2lV/9DZ 0+mRWvwTAr+xMJZIi14UZWTzwkh7Wtfi4heLdve8iokUsK6/tyR4K5Rgfat96JpxVamVzu GfhN6vGP4BA27FiXyiSgOL+MBJP1oFUdKBk4HGlc4CF1rx3eNdB2+W9Pk0ZZVQvr0mIVYn 2IRdk7pJT5tU9CcLQNy/GpHFlT7OJAsewLuwbo2zyexuqv4Scvh8pyugIHDW+A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gf9D54s7TzwRk for ; Mon, 15 Jun 2026 12:58:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24d39 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 12:58:45 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 1491ab351b45 - main - ntsync(9): do not double-free obj when finstall() failed 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 1491ab351b45b1c727eeed40027f7b5074b19ff5 Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 12:58:45 +0000 Message-Id: <6a2ff705.24d39.46b7366a@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1491ab351b45b1c727eeed40027f7b5074b19ff5 commit 1491ab351b45b1c727eeed40027f7b5074b19ff5 Author: Konstantin Belousov AuthorDate: 2026-06-15 04:41:53 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-15 12:57:41 +0000 ntsync(9): do not double-free obj when finstall() failed Reported by: Alex S Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/dev/ntsync/ntsync.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/ntsync/ntsync.c b/sys/dev/ntsync/ntsync.c index 5fba9775be0e..2dec2f68aa80 100644 --- a/sys/dev/ntsync/ntsync.c +++ b/sys/dev/ntsync/ntsync.c @@ -297,6 +297,7 @@ ntsync_create_obj(struct ntsync_obj *obj, struct fileops *fops, finit(fp, FREAD | FWRITE, DTYPE_NTSYNC, obj, fops); error = finstall(td, fp, &fd, 0, NULL); if (error != 0) { + finit(fp, FREAD | FWRITE, DTYPE_NONE, NULL, &badfileops); NTSYNC_PRIV_LOCK(priv); MPASS(priv->objs_cnt > 0); priv->objs_cnt--; From nobody Mon Jun 15 13:42:43 2026 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 4gfBBq2fyKz6hN5b for ; Mon, 15 Jun 2026 13:42: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfBBq1wd1z3gPN for ; Mon, 15 Jun 2026 13:42:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781530963; 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=laRqxsOYXiaqfVhnf6OaekZ6MOmckxwmZ02Mf/dofWo=; b=GLzDUebMrZNZqiIXqG5Mco+tp+pS9Dif+6G5d0mMl3kthaaQsJ4qyTq7zBnkdkukIUn9Js sJtjhSZfrA098nnTAIzAI6v8HieDYSBfj8wmv1YNGUt3WB4jO0UGaU28FVLmBnDO7hnotc G2oM2DqjNxyG8IX+GXwJFGcgZ36cT3KSp0M51RvZnJcMClewctYabhQ8wEmHQs6Trq9kR0 Qt8U+CgTjjXKiaeP5A9SLj6VZxUe//gc8JTF9pRvfci47EvxcSaPJDo7fwjZmh9x1aAsDW HP4CR5j7JtYUG1FhdOAWqGUezqRENuZQ2RuF/IpX7EGJxfOlH0fmJ3rbHh9dvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781530963; a=rsa-sha256; cv=none; b=DJLXyaDzxGOlh/gsG3DO59DIGwDqDAahfk83EhFSRsDf8DACEIiB4LHGZREaND/T21O0+i //n3TPxUwvvr4LM9tpg0TlNaM54ZyEbnhnVGgSRbuTsGvxpl1irmoiASTF4KusE9duZR6C AfamrdhRYgEVOAsXzrVfDdGhZGeuZl5XApAh2UzHv2pnKc6XmJJBPo95vbGuN8t6+nZIq3 gpIL1seKrmcB2PRyBLtrPNsKZ6tt1N87gGhvOqcDJQ8qeLeH0WuGzHLlnADlYFD9EJGZVV e4PFT5iLABNaoUAv1mT8MpOtQZjZC4NdLGDagdhaTOKPQefZJjwHoQKO10Go0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781530963; 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=laRqxsOYXiaqfVhnf6OaekZ6MOmckxwmZ02Mf/dofWo=; b=V1YixlcUTrY+x2WRTNRxpD6vFr3HmJryLh215zbaOuaOYRTGGR7Oz2vFIqv5XOE2TXwY29 fsLzehbBipnFFj8QnbJAYu+E7q0vhIJ30cZbunrBEG8gOSxQ8uZm1XOYUn3t6hjiq9ldKO hattjnOy4cNcctrCW/NY6Ei2HELdMqkD3EWRERlg0txJlbVBSXawVpsw+YYtKf8pTnO9JP qi4K5exeo1D3sDwaxEUNeOPDtNkDLWxICodCoJzUe84pS5Mo5CMZehk7YVQz951xH7skdQ 2yaPAD1gFt6PIoj+we9UertjuqHZdLVoY7EUZdLMfZL6VTcK9A+OawTe2YP8Jw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfBBq1SvBzxZj for ; Mon, 15 Jun 2026 13:42:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 341ab by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 13:42:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 586a5bc03541 - main - pwd.1: Fix a typo in the .dD 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 586a5bc03541397c432ce98a1551ebeee7c04ef2 Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 13:42:43 +0000 Message-Id: <6a300153.341ab.6980c2f2@gitrepo.freebsd.org> The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=586a5bc03541397c432ce98a1551ebeee7c04ef2 commit 586a5bc03541397c432ce98a1551ebeee7c04ef2 Author: Gordon Bergling AuthorDate: 2026-06-15 13:40:05 +0000 Commit: Gordon Bergling CommitDate: 2026-06-15 13:40:05 +0000 pwd.1: Fix a typo in the .dD - s/Februrary/February/ MFC after: 1 week --- bin/pwd/pwd.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/pwd/pwd.1 b/bin/pwd/pwd.1 index 8b03d060bc8e..f27b4aa1bff0 100644 --- a/bin/pwd/pwd.1 +++ b/bin/pwd/pwd.1 @@ -29,7 +29,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd Februrary 6, 2026 +.Dd February 6, 2026 .Dt PWD 1 .Os .Sh NAME From nobody Mon Jun 15 14:14:34 2026 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 4gfBvZ3nJ5z6hPdY for ; Mon, 15 Jun 2026 14:14: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfBvZ34VFz3kRH for ; Mon, 15 Jun 2026 14:14:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781532874; 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=GlMclFMxuvsRW/F7bkiUdH84gUXy6ShCC27Xugf896Y=; b=P8bNQBv4C4h1tsGQ+ZBQ8gGHzQRYz6XZWGBttwANXtYsQoMlR1gJbI0yZ7hrnSqc1lcgKV eRGsXzcR9rxD4n/ErO/JuBjbkkKwKUbzo6yuEDh+gbsEBmseDhT4y5A/dDvvPtT8ddmRg7 7zV6nAN6slt6s6fITfbbtg9Tc3jlJYuoIvD/mEgwbc+25bbp1gWlRhioyC7NRGm+H763j/ pRwUkBqewe9OH2xAzYpjv3Ofa8ZpLndcftMZSiRRIgRtaP3kkDSg88u3Z5hzmqB9JfuJIl Q9S738f6K6Udl29g5DFq6aqnMCChAEfNcGD4zfSH09Ld4r1CGdD0yOYJ7LKs7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781532874; a=rsa-sha256; cv=none; b=R+/AgNh8Jeg+SOJa1hEw0f7pbegxwmruTidXrtolNiMcFYpGxtURwF14+eY5Cci/wuSuHH axqIn+gTbPkOoIBh8AmBQ5Zm7PCJvuN+0Y9lY6fbEV0ECSypfUgf1i1pVvzKaO+3/FecCD l0zh9qmw1CeKQzL/1Zlhhf1lVXrrYw20G9DG70hf2EmgV66obvKEBleuozCst9jjf2C8OC JHN++8VAv0bGZBXVzv06TOOk37dPxv1smj/H1nBceVkyeI/3R7PqXkm9KVpJ/ufqZQ0GF2 Mg3tpONXbGscxHtT4o0eGx3vGPkcPYMTKB0UeOwpLmyY8aScPcH/oSJ6k3mluQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781532874; 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=GlMclFMxuvsRW/F7bkiUdH84gUXy6ShCC27Xugf896Y=; b=kJNlqDl15D7WNGv1phPJxABxjM+MQF3/ss4gAqwOJaCO4SOGl6SVcAFKEuM/sz1fB+9F4g dmSqiD5FfMdMj1m+vvFR9yStt1PXmCefBgCQNk+zL+UYMDkQl4VWkr8h1QUmMdKyI0Qa8o gDyfgLghzZPOgREQYrlD013p4foOh3xl61PEXK+EEc3trxLKlmAXxfLW2c41h9ISYLOIuy u2IOvxloXpS1pKKoR3Yt2ZdnV6BbQgCuqmiyYkkDRdLmX4QKWA6bZPfHqmQfwkuFImrxAJ KqsPYCYDB/dWDBdUoaqMFYfryOoBCcnekhjB/RIUgif97Cx8i+tY3W/xjO8oBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfBvZ2cj2zykB for ; Mon, 15 Jun 2026 14:14:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3695c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 14:14:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: c5d6e2085a47 - main - LinuxKPI: add KERNEL_VERSION() macro 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: c5d6e2085a471cbb75cc7b88b37a2fe6276c16f8 Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 14:14:34 +0000 Message-Id: <6a3008ca.3695c.4c96f05f@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c5d6e2085a471cbb75cc7b88b37a2fe6276c16f8 commit c5d6e2085a471cbb75cc7b88b37a2fe6276c16f8 Author: Bjoern A. Zeeb AuthorDate: 2026-06-13 11:08:00 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-06-15 14:14:19 +0000 LinuxKPI: add KERNEL_VERSION() macro Add a KERNEL_VERSION() macro which normally would be in linux/version.h. On Linux that file is auto-generated and we are supporting more than one Linux version in LinuxKPI anyway so any further defines in there would likely be wrong. Adding the macro helps to support (vendor/out of tree) drivers more easily which are supporting multiple Linux versions. MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D57590 --- sys/compat/linuxkpi/common/include/linux/kernel.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index afbd9208a410..3fcc6c1a925e 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -67,6 +67,9 @@ #include +#define KERNEL_VERSION(a,b,c) \ + (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c))) + #define KERN_CONT "" #define KERN_EMERG "<0>" #define KERN_ALERT "<1>" From nobody Mon Jun 15 14:14:35 2026 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 4gfBvb59bTz6hPXM for ; Mon, 15 Jun 2026 14:14: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfBvb3pNBz3k91 for ; Mon, 15 Jun 2026 14:14:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781532875; 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=GiC/AyNIByD4HS70T05lLEwtDaUpWUiAsn1HZ5UzvL0=; b=cg+ElLUpxuC7lvM9DCa+FH+css8i0ngUbw0CpuPvfKZdcl/265l4eLA4LVrlUqmXq92Xtf odomAiu8qiXiHUGCAsfDAEmt2HlDFCMVzjE/0Wnt6qyuK/VcOjzmBvO1nVBAUA8L4jccPW /b94hWSXsc/tQdf8QQbabgIvjNSrzFNqopHkB+EXD1tvYPMPumTVP+1FNkFzwJ2BU4U2jn Rwhnesw9GD2zFKUil/Hj8xpuSuxSGzHWZ+i+g7wmEskZkxBXmfnwsjzWPom8XpDWJeqhsj WSqfsiA/pzpEorlpvoM8JJDyhUOBCJ9MjvNTYekhkzfv5cIlmqzWVDRHNaQ/sw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781532875; a=rsa-sha256; cv=none; b=jbHqYLpdMe7ErSCgcwZcEizkbyDEZmBl5MmGpeP4ullqhi6ZeQ4GOmTCGLsfWOIthj5HbP zUtYs01+Hb5fT9DbWmWUd1LW5D1Ag+GzDYYhlHvLHcgFYFr7Bmg4/CtBRFuiE/sguPCykR AR5NdJf0oW0mBm2Lg/N4GE3CNwl0TzVtTdCXr5ougJkN4YELy1s788YJXKcjbqQB1Bsx9j KcjBqbbDzsdcYyrXNTF3fridvRozKE0wy2wsg5oHehbnBS6oHsQZIuTTOo5pm/Qgd7v9Sa 6MhAR8pDRPAM+txx3/DXtgxPeXIEpk5oeiaoeLt+IvWImc45oA2Jjj7QPsQioA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781532875; 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=GiC/AyNIByD4HS70T05lLEwtDaUpWUiAsn1HZ5UzvL0=; b=BIoK2AsUgxcqY4pxF13uoFlKCYqp2EOi+eJkitKa9OxCuJgIV9rzely+MDjNnbT6q3MPqB B59AZwq4yT97Xnolx980ZtfIwuq3xnY2RxXwj1H4oGzMaQOUEJQdh6S/8V6cKWTfXiNxmL QqXwZXyUcqfNlIO88UyL1naMNau6Eg9C3gb3YLX9TLQtsRon7HMMR9oml3xfsH9oXk7MT1 oVQgrg6PX61axXIuoPyHgpZi2jPw1IU6jgQo8HHbkAyymkWurRdMI7EUSlPgw10IzguUsZ FqCCUu2cn0kWnGybS3Mypr24Lo9Qb/CUuiLdPZ6CnjylzTZzXD69Upk6WWLxfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfBvb3PjgzyjC for ; Mon, 15 Jun 2026 14:14:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3726c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 14:14:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 3d0b6c69dced - main - LinuxKPI: scatterlist.h: implement sg_init_marker() 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 3d0b6c69dced4936fccff6733912a0ef93214dbe Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 14:14:35 +0000 Message-Id: <6a3008cb.3726c.168cf0ab@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3d0b6c69dced4936fccff6733912a0ef93214dbe commit 3d0b6c69dced4936fccff6733912a0ef93214dbe Author: Bjoern A. Zeeb AuthorDate: 2026-02-03 18:29:09 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-06-15 14:14:19 +0000 LinuxKPI: scatterlist.h: implement sg_init_marker() Add sg_init_marker() which is needed by mt76 drivers USB attachment. Sponosored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste, dumbbell Differential Revision: https://reviews.freebsd.org/D57594 --- sys/compat/linuxkpi/common/include/linux/scatterlist.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/scatterlist.h b/sys/compat/linuxkpi/common/include/linux/scatterlist.h index c49c2179d359..4ab3de5fb64d 100644 --- a/sys/compat/linuxkpi/common/include/linux/scatterlist.h +++ b/sys/compat/linuxkpi/common/include/linux/scatterlist.h @@ -188,6 +188,12 @@ sg_mark_end(struct scatterlist *sg) sg->page_link &= ~SG_PAGE_LINK_CHAIN; } +static inline void +sg_init_marker(struct scatterlist *sg, uint32_t num_sgs) +{ + sg_mark_end(&sg[num_sgs - 1]); +} + static inline void sg_init_table(struct scatterlist *sg, unsigned int nents) { From nobody Mon Jun 15 14:32:21 2026 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 4gfCJ54VVMz6hQwV for ; Mon, 15 Jun 2026 14:32: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfCJ539GKz3m98 for ; Mon, 15 Jun 2026 14:32:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781533941; 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=/bCmMGt5Rkpzu2NyslrZubN7jGvTGYUs5lcC5BVBiYs=; b=XThHf6IJ8LhGIjJV4JVvg/9+fpTB8+DM5HPCVJ4gICUjer+d9nhfxkt3fHdIGDiDeJ9f5+ N9SUElx4BhniAEyn0DnWv8orTIrVip61w4hgC9SgHQ0vaYgxhdg+kn0Kmnn4SQx09O3a3d abns39qsqaf7JFNzMHmvA9F/82mpg0vJBGu50sVvw1n1uzQciUz4aZFA3W5x1LDq6weg8W h0TeF9KWpphBnwYGqJHBY/zy1wT3DgPlALi4LDWWE/rN2J1OOh/putx8xe82LAlaV/QQUS gFoops3GbfkAV27QgVN3B/3bppXjKv7XwU9h/RT5uSIJ2cvV+Uow2LUacViE6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781533941; a=rsa-sha256; cv=none; b=qwKzaLcmpXyA3jp0Sdv4FGFCjnAOwviX8n1Eu7Nf5jzEXc+Ta9FmanY1GEIDLuvtWFESRB iEdH7eayDH4kxB9sx2icqwPXyhcATmKWApdedc38KHiss3oqr3m3mQbp8wLRYJLHpzzXpp JtN+29paHq3PjlzFwi4lFWNTLxz1MkWZ8RamjsXRqx4NEhbuVXw4D0F/0mVjquMiTWpV0o qtOUV/VjriCwsmU5Y6LsHBq5rvxrlru+C9A1rcTawZbHPD82MaqI893A1v46DFWENb2jHI gkom2CcTmi/yfa9vIMedk32+6AS+d79Ax3zklhEUXbHy3XGNUu0Le8318L/8Uw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781533941; 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=/bCmMGt5Rkpzu2NyslrZubN7jGvTGYUs5lcC5BVBiYs=; b=vplKlddBLiqyRRgT78cVuLv81UOquBjiNwuueDqthWN2ZTO4J4xLCcDYw+Hd3FbJbkXlwu TIHk3rVAZc24cb5/dVLFDYVVVoKZhPJPvIXnomvqy1/4HBspVmNWwZHIY6EwWN3m9wfqnz kBkkjm5774qBQVV1dSq4QzglZYadqO6XJjxOQqEy7hhySciL4AMFqWAMz+V7SxO5mVREns vfZqbmQTxV21+XdN2EVhbELftjmb3uREyNK+dPs7LSkmaYtcaXjBf2zGvXluPngsqCzpTa KsCRZ9utzYbhMWIy1xd+9N22MOrtAd4M+vaqkqzahO76WIfAN/328jwKeWEh5w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfCJ52k0Sz10GL for ; Mon, 15 Jun 2026 14:32:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38378 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 14:32:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 39e2fe23238f - main - if_tsec: Free entire mbuf chain on failure 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 39e2fe23238f4d49cd6f2c3ce9d0d9c1c3bcbedd Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 14:32:21 +0000 Message-Id: <6a300cf5.38378.78ddb816@gitrepo.freebsd.org> The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=39e2fe23238f4d49cd6f2c3ce9d0d9c1c3bcbedd commit 39e2fe23238f4d49cd6f2c3ce9d0d9c1c3bcbedd Author: Ed Maste AuthorDate: 2026-06-05 21:05:34 +0000 Commit: Ed Maste CommitDate: 2026-06-15 14:32:02 +0000 if_tsec: Free entire mbuf chain on failure Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57478 --- sys/dev/tsec/if_tsec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/tsec/if_tsec.c b/sys/dev/tsec/if_tsec.c index 80e42116ed9f..b35f04500436 100644 --- a/sys/dev/tsec/if_tsec.c +++ b/sys/dev/tsec/if_tsec.c @@ -1321,7 +1321,7 @@ tsec_receive_intr_locked(struct tsec_softc *sc, int count) ~TSEC_RXBD_ZEROONINIT) | TSEC_RXBD_E | TSEC_RXBD_I; if (sc->frame != NULL) { - m_free(sc->frame); + m_freem(sc->frame); sc->frame = NULL; } From nobody Mon Jun 15 14:40:56 2026 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 4gfCV03crwz6hRNQ for ; Mon, 15 Jun 2026 14: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfCV033rnz3n2k for ; Mon, 15 Jun 2026 14:40:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781534456; 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=o5PQmFfys1RJXC9RMQMTmxy8+0A2qCKws+9TDikKDig=; b=Cpv/GUTbPzojgyVPFS+29IbU3b3rbMcxf4p5Tof+LvRo+LOVv5B1BI1WKZkRRNVBpvdb1l 4lTHr7WVXyJZr7PBVARXkkAjZTsinlG347aDJhJkfzg52AznRd0IkdLuvybeeqdyb33LDe xx2auP/pQv98y0/0V8Rg0UjFX8hZaE+qQdef7eYieNDLDKQj+vzd3SwHHidvT2HSo7tpnM 6MrASrA20hFCLiTGl94KSqi7dl1t3479Mx52QqLp4hXYBvejwE1KLSM4+ef8BY0UTAxI7X 22aBcEaAqIu5uH+ANLYY1JfspRS0hob4TZ1Gen10LuBPcvSBV/0Yl2ba7VngZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781534456; a=rsa-sha256; cv=none; b=bTu0wdfypFpXX75ca44sh11V5dEExJh73IkEXfNkXYyYIE0IXp9CNfgcG07L6jWxTkMdG9 FNZrSReC4o1Vh8pnHQOKuf5/KfJ68bgIs6OFUWIaOpK5MqqbfYeEGPFb22J5R9khNfAnFQ +SzLXXE2QMyuXcwubTWqg7JVkIVvMFHiok3Y/pHxYdrPPwKeNGSjCn0f3T/wFANvY7r11z NI4Hx5NyconbQUG0BlQA0rhFjMfUQsTikvi7G1uCmoUHkLw5hJYu38uRsjyB4Q6ehvWcG/ +DN5cuX8XtUcLcaA6vTmZ0ecVQwRjyFeFSWDWdU57qfKElhow3BXboVuVQJHug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781534456; 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=o5PQmFfys1RJXC9RMQMTmxy8+0A2qCKws+9TDikKDig=; b=VaWVXvGyJKrlxRcqx/7OnhTZ4B5QdtRTOKs4A1r5hWzFGtsfgevMdLUHoe2aUdK32AtB8F OWDESNDUmQfM84HeoCYRgS6McYVuUklVGgaiXypHRI54WUbkeK3tUods228YY0TAs0cuCb I0HkbVwO7Ap1RfrYG2OsyL1Ez1WG2VrZiE7RzoCgTOOyUP7Hke5b9S8gMob08nr7gG3F7G 5wumvnxli6j5vWIMANaTCm/QZ9F8Nf/FSIbE+fd5WvC0gkLlHDTtM0dxYjZFsXP40RwGeu SWPCFvLlR2f3GXux3KPf34p8vYU1yrFb7X94MO6AMjBFjIeTJxKmH+sDrDvWJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfCV02dLGz1061 for ; Mon, 15 Jun 2026 14:40:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3b120 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 14:40:56 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Sumit Saxena Subject: git: 9931dc5bf383 - main - if_bnxt: add few source files to version control 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ssaxena X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9931dc5bf3831146c08a381c42ecbfcedb8ac7f1 Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 14:40:56 +0000 Message-Id: <6a300ef8.3b120.2c43d3e4@gitrepo.freebsd.org> The branch main has been updated by ssaxena: URL: https://cgit.FreeBSD.org/src/commit/?id=9931dc5bf3831146c08a381c42ecbfcedb8ac7f1 commit 9931dc5bf3831146c08a381c42ecbfcedb8ac7f1 Author: Sumit Saxena AuthorDate: 2026-06-15 14:30:26 +0000 Commit: Sumit Saxena CommitDate: 2026-06-15 14:40:39 +0000 if_bnxt: add few source files to version control Commits- f85e66e655c9 ("if_bnxt/bnxt_re: add support for driver snapdump") and 03839879a2dd ("if_bnxt: Add Firmware crashdump collection support") missed to add few files under version control, those files are added now: sys/dev/bnxt/bnxt_en/bnxt_log.c sys/dev/bnxt/bnxt_en/bnxt_log.h sys/dev/bnxt/bnxt_en/bnxt_log_data.c sys/dev/bnxt/bnxt_en/bnxt_log_data.h sys/dev/bnxt/bnxt_en/bnxt_coredump.c sys/dev/bnxt/bnxt_en/bnxt_coredump.h bnxt_coredump.c entry is added in sys/conf/files as well. Fixes: f85e66e655c9 ("if_bnxt/bnxt_re: add support for driver snapdump") Fixes: 03839879a2dd ("if_bnxt: Add Firmware crashdump collection support") --- sys/conf/files | 1 + sys/dev/bnxt/bnxt_en/bnxt_coredump.c | 186 ++++++++++++++++++++ sys/dev/bnxt/bnxt_en/bnxt_coredump.h | 50 ++++++ sys/dev/bnxt/bnxt_en/bnxt_log.c | 318 +++++++++++++++++++++++++++++++++++ sys/dev/bnxt/bnxt_en/bnxt_log.h | 123 ++++++++++++++ sys/dev/bnxt/bnxt_en/bnxt_log_data.c | 78 +++++++++ sys/dev/bnxt/bnxt_en/bnxt_log_data.h | 35 ++++ 7 files changed, 791 insertions(+) diff --git a/sys/conf/files b/sys/conf/files index 67f0dcedd346..1332f4bd8cc6 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1328,6 +1328,7 @@ dev/bnxt/bnxt_en/bnxt_txrx.c optional bnxt iflib pci compile-with "${BNXT_C}" dev/bnxt/bnxt_en/bnxt_ulp.c optional bnxt iflib pci compile-with "${BNXT_C}" dev/bnxt/bnxt_en/bnxt_log.c optional bnxt iflib pci compile-with "${BNXT_C}" dev/bnxt/bnxt_en/bnxt_log_data.c optional bnxt iflib pci compile-with "${BNXT_C}" +dev/bnxt/bnxt_en/bnxt_coredump.c optional bnxt iflib pci compile-with "${BNXT_C}" dev/bnxt/bnxt_en/if_bnxt.c optional bnxt iflib pci compile-with "${BNXT_C}" dev/bwi/bwimac.c optional bwi dev/bwi/bwiphy.c optional bwi diff --git a/sys/dev/bnxt/bnxt_en/bnxt_coredump.c b/sys/dev/bnxt/bnxt_en/bnxt_coredump.c new file mode 100644 index 000000000000..6aafa9182883 --- /dev/null +++ b/sys/dev/bnxt/bnxt_en/bnxt_coredump.c @@ -0,0 +1,186 @@ +/*- + * Broadcom NetXtreme-C/E network driver. + * + * Copyright (c) 2026 Broadcom Inc. All Rights Reserved. + * The term Broadcom refers to Broadcom Limited and/or its subsidiaries + * + * 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 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 OWNER 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 "bnxt.h" +#include "bnxt_coredump.h" +#include "hsi_struct_def.h" + + +/* Free crash dump memory */ +void +bnxt_free_crash_dump_mem(struct bnxt_softc *softc) +{ + if (softc->fw_crash_mem) { + bnxt_free_ctx_pg_tbls(softc, softc->fw_crash_mem); + free(softc->fw_crash_mem, M_DEVBUF); + softc->fw_crash_len = 0; + softc->fw_crash_mem = NULL; + } +} + +/* Allocate crash dump memory */ +int +bnxt_alloc_crash_dump_mem(struct bnxt_softc *softc) +{ + uint32_t mem_size = 0; + int rc; + + if (!(softc->fw_dbg_cap & BNXT_FW_DBG_CAP_CRASHDUMP_HOST)) + return (0); + + rc = bnxt_hwrm_get_dump_len(softc, BNXT_DUMP_CRASH, &mem_size); + if (rc) + return (rc); + + mem_size = roundup(mem_size, 4); + + if (softc->fw_crash_mem && mem_size == softc->fw_crash_len) + return (0); + + bnxt_free_crash_dump_mem(softc); + + softc->fw_crash_mem = malloc(sizeof(*softc->fw_crash_mem), + M_DEVBUF, M_NOWAIT | M_ZERO); + if (!softc->fw_crash_mem) + return (-ENOMEM); + + rc = bnxt_alloc_ctx_pg_tbls(softc, softc->fw_crash_mem, + mem_size, 1, NULL); + if (rc) { + bnxt_free_crash_dump_mem(softc); + return (rc); + } + + softc->fw_crash_len = mem_size; + return (0); +} + +/* Copy crash data from ring memory */ +static uint32_t +bnxt_copy_crash_data(struct bnxt_ring_mem_info *rmem, void *buf, + uint32_t dump_len) +{ + uint32_t data_copied = 0; + uint32_t data_len; + int i; + + for (i = 0; i < rmem->nr_pages; i++) { + if (!rmem->pg_arr[i].idi_vaddr) + continue; + data_len = rmem->page_size; + if (data_copied + data_len > dump_len) + data_len = dump_len - data_copied; + memcpy((uint8_t *)buf + data_copied, + rmem->pg_arr[i].idi_vaddr, data_len); + data_copied += data_len; + if (data_copied >= dump_len) + break; + } + return (data_copied); +} + +/* Copy crash dump from DDR memory */ +static int +bnxt_copy_crash_dump(struct bnxt_softc *softc, void *buf, uint32_t dump_len) +{ + struct bnxt_ring_mem_info *rmem; + uint32_t offset = 0; + + if (!softc->fw_crash_mem) + return (-ENOENT); + + rmem = &softc->fw_crash_mem->ring_mem; + + if (rmem->depth > 1) { + int i; + + for (i = 0; i < rmem->nr_pages; i++) { + struct bnxt_ctx_pg_info *pg_tbl; + + pg_tbl = softc->fw_crash_mem->ctx_pg_tbl[i]; + if (!pg_tbl) + continue; + offset += bnxt_copy_crash_data(&pg_tbl->ring_mem, + (uint8_t *)buf + offset, + dump_len - offset); + if (offset >= dump_len) + break; + } + } else { + bnxt_copy_crash_data(rmem, buf, dump_len); + } + + return (0); +} + +/* Check if crash dump is available */ +static bool +bnxt_crash_dump_avail(struct bnxt_softc *softc) +{ + uint32_t sig = 0; + + /* First 4 bytes(signature) of crash dump is always non-zero */ + bnxt_copy_crash_dump(softc, &sig, sizeof(uint32_t)); + return (!!sig); +} + +/* Get coredump */ +int +bnxt_get_coredump(struct bnxt_softc *softc, uint16_t dump_type, void *buf, + uint32_t *dump_len) +{ + if (dump_type == BNXT_DUMP_CRASH && + softc->fw_dbg_cap & BNXT_FW_DBG_CAP_CRASHDUMP_HOST) { + return (bnxt_copy_crash_dump(softc, buf, *dump_len)); + } else { + /* Other dump types not implemented yet */ + return (-EOPNOTSUPP); + } +} + +/* Get coredump length */ +uint32_t +bnxt_get_coredump_length(struct bnxt_softc *softc, uint16_t dump_type) +{ + uint32_t len = 0; + + if (dump_type == BNXT_DUMP_CRASH && + softc->fw_dbg_cap & BNXT_FW_DBG_CAP_CRASHDUMP_HOST && + softc->fw_crash_mem) { + if (!bnxt_crash_dump_avail(softc)) + return (0); + + return (softc->fw_crash_len); + } + + if (bnxt_hwrm_get_dump_len(softc, dump_type, &len)) + return (0); + + return (len); +} diff --git a/sys/dev/bnxt/bnxt_en/bnxt_coredump.h b/sys/dev/bnxt/bnxt_en/bnxt_coredump.h new file mode 100644 index 000000000000..4af42b707987 --- /dev/null +++ b/sys/dev/bnxt/bnxt_en/bnxt_coredump.h @@ -0,0 +1,50 @@ +/*- + * Broadcom NetXtreme-C/E network driver. + * + * Copyright (c) 2026 Broadcom Inc. All Rights Reserved. + * The term Broadcom refers to Broadcom Limited and/or its subsidiaries + * + * 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 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 OWNER 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 _BNXT_COREDUMP_H +#define _BNXT_COREDUMP_H + +#define BNXT_CRASH_DUMP_LEN 0x400000 /* 4MB default for SOC DDR */ + +/* Capability detection */ +void bnxt_hwrm_dbg_qcaps(struct bnxt_softc *softc); + +/* Memory management */ +int bnxt_alloc_crash_dump_mem(struct bnxt_softc *softc); +void bnxt_free_crash_dump_mem(struct bnxt_softc *softc); +int bnxt_hwrm_crash_dump_mem_cfg(struct bnxt_softc *softc); +int bnxt_hwrm_get_dump_len(struct bnxt_softc *softc, uint16_t dump_type, + uint32_t *dump_len); + +/* Coredump retrieval */ +uint32_t bnxt_get_coredump_length(struct bnxt_softc *softc, uint16_t dump_type); +int bnxt_get_coredump(struct bnxt_softc *softc, uint16_t dump_type, void *buf, + uint32_t *dump_len); + + +#endif /* _BNXT_COREDUMP_H */ diff --git a/sys/dev/bnxt/bnxt_en/bnxt_log.c b/sys/dev/bnxt/bnxt_en/bnxt_log.c new file mode 100644 index 000000000000..e891dab80491 --- /dev/null +++ b/sys/dev/bnxt/bnxt_en/bnxt_log.c @@ -0,0 +1,318 @@ +/*- + * Broadcom NetXtreme-C/E network driver. + * + * Copyright (c) 2026 Broadcom Inc. + * + * 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 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 OWNER 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 "bnxt.h" +#include "bnxt_log.h" + +MALLOC_DEFINE(M_BNXT_LOG, "bnxt_log_buffer", "buffer for bnxt logging module"); + +void +bnxt_fill_coredump_seg_hdr(struct bnxt_softc *bp, + struct bnxt_coredump_segment_hdr *seg_hdr, + struct coredump_segment_record *seg_rec, + uint32_t seg_len, int status, uint32_t duration, + uint32_t instance, uint32_t comp_id, uint32_t seg_id) +{ + memset(seg_hdr, 0, sizeof(*seg_hdr)); + memcpy(seg_hdr->signature, "sEgM", 4); + if (seg_rec) { + seg_hdr->component_id = + htole32((uint32_t)seg_rec->component_id); + seg_hdr->segment_id = htole32((uint32_t)seg_rec->segment_id); + seg_hdr->low_version = seg_rec->version_low; + seg_hdr->high_version = seg_rec->version_hi; + seg_hdr->flags = seg_rec->compress_flags; + } else { + seg_hdr->component_id = htole32(comp_id); + seg_hdr->segment_id = htole32(seg_id); + } + seg_hdr->function_id = htole16(bp->func.fw_fid); + seg_hdr->length = htole32(seg_len); + seg_hdr->status = htole32((uint32_t)status); + seg_hdr->duration = htole32(duration); + seg_hdr->data_offset = htole32(sizeof(*seg_hdr)); + seg_hdr->instance = htole32(instance); +} + +int +bnxt_register_logger(struct bnxt_softc *bp, uint16_t logger_id, + uint32_t num_buffs, void (*log_live)(void *), + uint32_t live_max_size) +{ + struct bnxt_logger *logger; + void *data; + + if (!log_live || !live_max_size) + return (EINVAL); + + if (num_buffs == 0 || (num_buffs & (num_buffs - 1)) != 0) + return (EINVAL); + + logger = malloc(sizeof(*logger), M_BNXT_LOG, M_WAITOK | M_ZERO); + + logger->logger_id = logger_id; + logger->buffer_size = num_buffs * BNXT_LOG_MSG_SIZE; + logger->log_live_op = log_live; + logger->max_live_buff_size = live_max_size; + + data = malloc(logger->buffer_size, M_BNXT_LOG, M_WAITOK); + logger->msgs = data; + + mtx_lock(&bp->log_lock); + TAILQ_INSERT_TAIL(&bp->loggers_list, logger, list); + mtx_unlock(&bp->log_lock); + return (0); +} + +void +bnxt_unregister_logger(struct bnxt_softc *bp, int logger_id) +{ + struct bnxt_logger *l = NULL, *tmp; + + mtx_lock(&bp->log_lock); + TAILQ_FOREACH_SAFE(l, &bp->loggers_list, list, tmp) { + if (l->logger_id == logger_id) { + TAILQ_REMOVE(&bp->loggers_list, l, list); + break; + } + } + mtx_unlock(&bp->log_lock); + + if (!l) { + device_printf(bp->dev, "logger id %d not registered\n", + logger_id); + return; + } + + free(l->msgs, M_BNXT_LOG); + free(l, M_BNXT_LOG); +} + +static int +bnxt_log_info(char *buf, size_t max_len, const char *format, va_list args) +{ + static char textbuf[BNXT_LOG_MSG_SIZE]; + char *text = textbuf; + size_t text_len; + char *next; + + text_len = vsnprintf(text, sizeof(textbuf), format, args); + if (text_len >= sizeof(textbuf)) + text_len = sizeof(textbuf) - 1; + + next = memchr(text, '\n', text_len); + if (next) + text_len = next - text; + else if (text[text_len] == '\0') + text[text_len] = '\n'; + + if (text_len > max_len) { + /* Truncate */ + text_len = max_len; + text[text_len] = '\n'; + } + + memcpy(buf, text, text_len + 1); + + return (text_len + 1); +} + +void +bnxt_log_add_msg(struct bnxt_softc *bp, uint16_t logger_id, + const char *format, ...) +{ + struct bnxt_logger *logger = NULL, *tmp; + uint16_t start, tail; + va_list args; + void *buf; + uint32_t mask; + + mtx_lock(&bp->log_lock); + TAILQ_FOREACH_SAFE(logger, &bp->loggers_list, list, tmp) { + if (logger->logger_id == logger_id) + break; + } + + if (!logger) { + mtx_unlock(&bp->log_lock); + return; + } + + mask = BNXT_LOG_NUM_BUFFERS(logger->buffer_size) - 1; + tail = logger->tail; + start = logger->head; + + if (logger->valid && start == tail) + logger->head = ++start & mask; + + buf = (uint8_t *)logger->msgs + BNXT_LOG_MSG_SIZE * logger->tail; + logger->tail = ++tail & mask; + + if (!logger->valid) + logger->valid = true; + + va_start(args, format); + bnxt_log_info(buf, BNXT_LOG_MSG_SIZE, format, args); + va_end(args); + mtx_unlock(&bp->log_lock); +} + +void +bnxt_log_live(struct bnxt_softc *bp, uint16_t logger_id, + const char *format, ...) +{ + struct bnxt_logger *logger = NULL, *tmp; + va_list args; + int len; + + TAILQ_FOREACH_SAFE(logger, &bp->loggers_list, list, tmp) { + if (logger->logger_id == logger_id) + break; + } + + if (!logger || !logger->live_msgs) + return; + + va_start(args, format); + len = bnxt_log_info( + (uint8_t *)logger->live_msgs + logger->live_msgs_len, + logger->max_live_buff_size - logger->live_msgs_len, + format, args); + va_end(args); + + logger->live_msgs_len += len; +} + +static size_t +bnxt_get_data_len(char *buf) +{ + size_t count = 0; + + while (*buf++ != '\n') + count++; + return (count + 1); +} + +static size_t +bnxt_collect_logs_buffer(struct bnxt_logger *logger, char *dest) +{ + uint32_t mask = BNXT_LOG_NUM_BUFFERS(logger->buffer_size) - 1; + uint16_t head = logger->head; + uint16_t tail = logger->tail; + size_t total_len = 0; + int count; + + if (!logger->valid) + return (0); + + count = (tail > head) ? (tail - head) : (tail - head + mask + 1); + while (count--) { + void *src = (uint8_t *)logger->msgs + + BNXT_LOG_MSG_SIZE * (head & mask); + size_t len; + + len = bnxt_get_data_len(src); + memcpy(dest + total_len, src, len); + total_len += len; + head++; + } + + return (total_len); +} + +size_t +bnxt_get_loggers_coredump_size(struct bnxt_softc *bp) +{ + struct bnxt_logger *logger, *tmp; + size_t len = 0; + + mtx_lock(&bp->log_lock); + TAILQ_FOREACH_SAFE(logger, &bp->loggers_list, list, tmp) { + len += sizeof(struct bnxt_coredump_segment_hdr) + + logger->max_live_buff_size + logger->buffer_size; + } + mtx_unlock(&bp->log_lock); + return (len); +} + +int +bnxt_start_logging_driver_coredump(struct bnxt_softc *bp, char *dest_buf) +{ + struct bnxt_logger *logger, *tmp; + size_t offset = 0; + uint32_t seg_id = 0; + + if (!dest_buf) + return (0); + + mtx_lock(&bp->log_lock); + TAILQ_FOREACH_SAFE(logger, &bp->loggers_list, list, tmp) { + struct bnxt_coredump_segment_hdr seg_hdr; + void *seg_hdr_dest = dest_buf + offset; + size_t len; + + offset += sizeof(seg_hdr); + /* First collect logs from buffer */ + len = bnxt_collect_logs_buffer(logger, dest_buf + offset); + offset += len; + /* Let logger to collect live messages */ + logger->live_msgs = dest_buf + offset; + logger->live_msgs_len = 0; + logger->log_live_op(bp); + + len += logger->buffer_size; + offset += logger->buffer_size; + + bnxt_fill_coredump_seg_hdr(bp, &seg_hdr, NULL, len, + 0, 0, 0, 13, seg_id); + memcpy(seg_hdr_dest, &seg_hdr, sizeof(seg_hdr)); + seg_id++; + } + mtx_unlock(&bp->log_lock); + return (offset); +} + +void +bnxt_reset_loggers(struct bnxt_softc *bp) +{ + struct bnxt_logger *logger, *tmp; + + mtx_lock(&bp->log_lock); + TAILQ_FOREACH_SAFE(logger, &bp->loggers_list, list, tmp) { + logger->head = 0; + logger->tail = 0; + logger->valid = false; + } + mtx_unlock(&bp->log_lock); +} diff --git a/sys/dev/bnxt/bnxt_en/bnxt_log.h b/sys/dev/bnxt/bnxt_en/bnxt_log.h new file mode 100644 index 000000000000..ad92065bf76d --- /dev/null +++ b/sys/dev/bnxt/bnxt_en/bnxt_log.h @@ -0,0 +1,123 @@ +/*- + * Broadcom NetXtreme-C/E network driver. + * + * Copyright (c) 2026 Broadcom Inc. + * + * 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 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 OWNER 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 BNXT_LOG_H +#define BNXT_LOG_H + +#define BNXT_LOGGER_L2 1 +#define BNXT_LOGGER_ROCE 2 + +#define BNXT_LOG_MSG_SIZE 256 +#define BNXT_LOG_NUM_BUFFERS(x) ((x) / BNXT_LOG_MSG_SIZE) + +struct bnxt_logger { + TAILQ_ENTRY(bnxt_logger) list; + uint16_t logger_id; + uint32_t buffer_size; + uint16_t head; + uint16_t tail; + bool valid; + void *msgs; + uint32_t live_max_size; + void *live_msgs; + uint32_t max_live_buff_size; + uint32_t live_msgs_len; + void (*log_live_op)(void *dev); +}; + +struct bnxt_coredump_segment_hdr { + uint8_t signature[4]; + uint32_t component_id; + uint32_t segment_id; + uint32_t flags; + uint8_t low_version; + uint8_t high_version; + uint16_t function_id; + uint32_t offset; + uint32_t length; + uint32_t status; + uint32_t duration; + uint32_t data_offset; + uint32_t instance; + uint32_t rsvd[5]; +}; + +struct bnxt_coredump_record { + uint8_t signature[4]; + uint32_t flags; + uint8_t low_version; + uint8_t high_version; + uint8_t asic_state; + uint8_t rsvd0[5]; + char system_name[32]; + uint16_t year; + uint16_t month; + uint16_t day; + uint16_t hour; + uint16_t minute; + uint16_t second; + uint16_t utc_bias; + uint16_t rsvd1; + char commandline[256]; + uint32_t total_segments; + uint32_t os_ver_major; + uint32_t os_ver_minor; + uint32_t rsvd2; + char os_name[32]; + uint16_t end_year; + uint16_t end_month; + uint16_t end_day; + uint16_t end_hour; + uint16_t end_minute; + uint16_t end_second; + uint16_t end_utc_bias; + uint32_t asic_id1; + uint32_t asic_id2; + uint32_t coredump_status; + uint8_t ioctl_low_version; + uint8_t ioctl_high_version; + uint16_t rsvd3[313]; +}; + +int bnxt_register_logger(struct bnxt_softc *bp, uint16_t logger_id, + uint32_t num_buffers, void (*log_live)(void *), + uint32_t live_size); +void bnxt_unregister_logger(struct bnxt_softc *bp, int logger_id); +void bnxt_log_add_msg(struct bnxt_softc *bp, uint16_t logger_id, + const char *format, ...); +void bnxt_log_live(struct bnxt_softc *bp, uint16_t logger_id, + const char *format, ...); +void bnxt_reset_loggers(struct bnxt_softc *bp); +size_t bnxt_get_loggers_coredump_size(struct bnxt_softc *bp); +int bnxt_start_logging_driver_coredump(struct bnxt_softc *bp, char *dest_buf); +void bnxt_fill_coredump_seg_hdr(struct bnxt_softc *bp, + struct bnxt_coredump_segment_hdr *seg_hdr, + struct coredump_segment_record *seg_rec, + uint32_t seg_len, int status, + uint32_t duration, uint32_t instance, + uint32_t comp_id, uint32_t seg_id); +#endif diff --git a/sys/dev/bnxt/bnxt_en/bnxt_log_data.c b/sys/dev/bnxt/bnxt_en/bnxt_log_data.c new file mode 100644 index 000000000000..180cd72361a9 --- /dev/null +++ b/sys/dev/bnxt/bnxt_en/bnxt_log_data.c @@ -0,0 +1,78 @@ +/*- + * Broadcom NetXtreme-C/E network driver. + * + * Copyright (c) 2026 Broadcom Inc. + * + * 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 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 OWNER 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 "bnxt.h" +#include "bnxt_hwrm.h" +#include "bnxt_log.h" +#include "bnxt_log_data.h" + +static void +bnxt_log_drv_version(struct bnxt_softc *bp) +{ + bnxt_log_live(bp, BNXT_LOGGER_L2, "\n"); + + bnxt_log_live(bp, BNXT_LOGGER_L2, "Interface: L2 driver version: %s\n", + bnxt_driver_version); +} + +static void +bnxt_log_tx_sw_state(struct bnxt_softc *softc) +{ + int i; + uint32_t prod, cons; + + for (i = 0; i < softc->ntxqsets; i++) { + bnxt_hwrm_ring_info_get(softc, + HWRM_DBG_RING_INFO_GET_INPUT_RING_TYPE_TX, i, &prod, &cons); + bnxt_log_live(softc, BNXT_LOGGER_L2, + "tx {fw_ring: %d prod: %x cons: %x}\n", + i, prod, cons); + } +} + +static void +bnxt_log_rx_sw_state(struct bnxt_softc *softc) +{ + int i; + uint32_t prod, cons; + + for (i = 0; i < softc->nrxqsets; i++) { + bnxt_hwrm_ring_info_get(softc, + HWRM_DBG_RING_INFO_GET_INPUT_RING_TYPE_RX, i, &prod, &cons); + bnxt_log_live(softc, BNXT_LOGGER_L2, + "rx{fw_ring: %d prod: %x}\n", i, prod); + } + +} + +void +bnxt_log_ring_states(struct bnxt_softc *bp) +{ + bnxt_log_drv_version(bp); + bnxt_log_tx_sw_state(bp); + bnxt_log_rx_sw_state(bp); +} diff --git a/sys/dev/bnxt/bnxt_en/bnxt_log_data.h b/sys/dev/bnxt/bnxt_en/bnxt_log_data.h new file mode 100644 index 000000000000..63b84ba7a7e4 --- /dev/null +++ b/sys/dev/bnxt/bnxt_en/bnxt_log_data.h @@ -0,0 +1,35 @@ +/*- + * Broadcom NetXtreme-C/E network driver. + * + * Copyright (c) 2026 Broadcom Inc. + * + * 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 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 OWNER 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 BNXT_LOG_DATA_H +#define BNXT_LOG_DATA_H + +#define BNXT_L2_MAX_LOG_BUFFERS 1024 +#define BNXT_L2_MAX_LIVE_LOG_SIZE (4 << 20) + +void bnxt_log_ring_states(struct bnxt_softc *bp); +#endif From nobody Mon Jun 15 15:05:10 2026 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 4gfD1y46smz6hTcy for ; Mon, 15 Jun 2026 15:05: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfD1y1JK8z3pyC for ; Mon, 15 Jun 2026 15:05:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781535910; 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=YtIw1aVpEkv68yP/PiG2pHMCw+Lr9b6rv1SHLOk8d74=; b=F6aq91aW0WI5zudUH/yuZdbkJSDwggOIjDugF73IrjtXcHnKj/g8vhp86g7y4q3v5oPgtm zoQVcqBgSASsnp6HFz+vQkg5vt5B7GTsgLgHN5eKS/Zxlv583cbD1PfUwk6PBGY+SBJ3vd HQduKaimzLEntUJTiVHiD5PAx2Cfefi628VsBrjikoXFI2KJ28Mm2GLRVRX6KrS9KgPdW2 ql+KbWIL0gc8wD3I1Tf8yUaZ4olLrZYtJljiTC71WLcC8AlD+FlA++pGlvFUnDYQHXx2fT CQKnYPshW0ImK3nQJ18IRxukrsVLhlRneMYvxamIKYZFPFsWTgbQ+H3HlRyoVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781535910; a=rsa-sha256; cv=none; b=a9jaDYq41k3nYD/4/TOzL0LJ+LST04rYR8YiWqNfJ3mnOaWhmLI4X2B/k51o57mTTQnw/1 KtCfYrGEOUW8+DHOLCgbp81LXJvzR28qqaL9Mi/E9UpYqxU7MaZnpu5xuBM48BP+nWV6bv P6l7R2C9gPxKFkSiENrPLe/+dXRxxiUeh9vFt94Y+PDQ257NSWrpolU/0ye1ttKY990Nv1 wfCfFoOtQwhIwL5pmZQVryzuF5M3wJOYv5AuWuGuwCOLHSJfrwp6MZ3LY8971iDsMVCvgt N17tzBnbR7/RBAQ8a5OE4fiq105nIw1FXcSbAWpRlYvFzXDMmwwlnswEGFRP4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781535910; 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=YtIw1aVpEkv68yP/PiG2pHMCw+Lr9b6rv1SHLOk8d74=; b=lG343q2DBvMppOZhuLOI0OA8WnRQ3nmW0dfJTiUmQZbkaoV6nA81ef9up5ypRBamvj7MNp G7MiMXw3490/mL5xVdm/ak8/bhCoDgQ7mFTVdrCeK70vzX4f8VYBr87Kpuxd96LB9hdiEw eaJwgUwezzAsJUaWzAYu+SgZ6YiB0jUEY9RbMYguMCY3mTIgFAodB5MDLMuIFzGfP5mE6R JiZ2PNetIhZuhSvOqEN1YQwB3qn6x19W1Sp52BgxGMAPIXTnvKbOhQuGtS6BJQ6lWTznET dAhvCrIawm/iaKP+nrKuG3lWJ8j8FMnSMOwZj96/SiwJP9x1GXfJqkOG03E+4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfD1y0wBQz10JT for ; Mon, 15 Jun 2026 15:05:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3c151 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 15:05:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: a6aa95eba6ee - main - sound: Create all device nodes with GID_AUDIO 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a6aa95eba6ee2dd199d6cb8063dbaccd8a6f7512 Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 15:05:10 +0000 Message-Id: <6a3014a6.3c151.59eed2c6@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a6aa95eba6ee2dd199d6cb8063dbaccd8a6f7512 commit a6aa95eba6ee2dd199d6cb8063dbaccd8a6f7512 Author: Christos Margiolis AuthorDate: 2026-05-21 18:03:31 +0000 Commit: Christos Margiolis CommitDate: 2026-06-15 15:03:48 +0000 sound: Create all device nodes with GID_AUDIO Commit 6024e3f99a1e ("Add audio group") introduced GID_AUDIO, initially for virtual_oss(8) loopback devices. Now make all of them with GID_AUDIO. Relnotes: yes Sponsored by: The FreeBSD Foundation Reviewed by: emaste Pull-Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/35 --- UPDATING | 3 +++ share/man/man4/pcm.4 | 11 +++++++-- sys/dev/sound/midi/midi.c | 2 +- sys/dev/sound/pci/emu10kx.c | 2 +- sys/dev/sound/pcm/dsp.c | 4 +-- sys/dev/sound/pcm/mixer.c | 2 +- sys/dev/sound/sndstat.c | 2 +- sys/dev/sound/usb/uaudio.c | 2 +- usr.sbin/virtual_oss/virtual_oss/main.c | 34 ++++++++++---------------- usr.sbin/virtual_oss/virtual_oss/virtual_oss.8 | 8 +++--- 10 files changed, 35 insertions(+), 35 deletions(-) diff --git a/UPDATING b/UPDATING index 58d12856c581..a83925a811a4 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 16.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20260521: + Audio devices are now created with GID 43 / audio. You will need to add + users who need access to audio devices to this group. 20260512: "bsdinstall script" will now do a pkgbase installation by default. To revert to the legacy distset installation, set "DISTRIBUTIONS" in diff --git a/share/man/man4/pcm.4 b/share/man/man4/pcm.4 index 9ea0f14c3930..181b2120c2e6 100644 --- a/share/man/man4/pcm.4 +++ b/share/man/man4/pcm.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 15, 2026 +.Dd May 21, 2026 .Dt SOUND 4 .Os .Sh NAME @@ -559,6 +559,12 @@ Additional messages are sometimes recorded when the device is probed and attached, these messages can be viewed with the .Xr dmesg 8 utility. +.Pp +Users have to be part of the audio group in order to access any device node +created by +.Nm , +as well as the device drivers, and +.Xr virtual_oss 8 . .Sh EXAMPLES Use the sound metadriver to load all .Nm @@ -625,7 +631,8 @@ A device node is not created properly. .Xr dmesg 8 , .Xr kldload 8 , .Xr mixer 8 , -.Xr sysctl 8 +.Xr sysctl 8 , +.Xr virtual_oss 8 .Rs .%T "Cookbook formulae for audio EQ biquad filter coefficients (Audio-EQ-Cookbook.txt), by Robert Bristow-Johnson" .%U "https://www.musicdsp.org/en/latest/Filters/197-rbj-audio-eq-cookbook.html" diff --git a/sys/dev/sound/midi/midi.c b/sys/dev/sound/midi/midi.c index e70f76a44ed9..9a19b0bc2e30 100644 --- a/sys/dev/sound/midi/midi.c +++ b/sys/dev/sound/midi/midi.c @@ -143,7 +143,7 @@ midi_init(kobj_class_t cls, void *cookie) mtx_unlock(&m->lock); - m->dev = make_dev(&midi_cdevsw, m->unit, UID_ROOT, GID_WHEEL, 0666, + m->dev = make_dev(&midi_cdevsw, m->unit, UID_ROOT, GID_AUDIO, 0660, "midi%d.%d", m->unit, m->channel); m->dev->si_drv1 = m; diff --git a/sys/dev/sound/pci/emu10kx.c b/sys/dev/sound/pci/emu10kx.c index 9cd7dbca1cb2..582006e001c2 100644 --- a/sys/dev/sound/pci/emu10kx.c +++ b/sys/dev/sound/pci/emu10kx.c @@ -2312,7 +2312,7 @@ emu10kx_dev_init(struct emu_sc_info *sc) mtx_init(&sc->emu10kx_lock, device_get_nameunit(sc->dev), "kxdevlock", 0); unit = device_get_unit(sc->dev); - sc->cdev = make_dev(&emu10kx_cdevsw, unit, UID_ROOT, GID_WHEEL, 0640, "emu10kx%d", unit); + sc->cdev = make_dev(&emu10kx_cdevsw, unit, UID_ROOT, GID_AUDIO, 0640, "emu10kx%d", unit); if (sc->cdev != NULL) { sc->cdev->si_drv1 = sc; return (0); diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 089e193ee8b4..05fdc18e31f8 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -122,8 +122,8 @@ dsp_make_dev(device_t dev) make_dev_args_init(&devargs); devargs.mda_devsw = &dsp_cdevsw; devargs.mda_uid = UID_ROOT; - devargs.mda_gid = GID_WHEEL; - devargs.mda_mode = 0666; + devargs.mda_gid = GID_AUDIO; + devargs.mda_mode = 0660; devargs.mda_si_drv1 = sc; err = make_dev_s(&devargs, &sc->dsp_dev, "dsp%d", unit); if (err != 0) { diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index 3ddee24417cc..1d74af76b757 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -646,7 +646,7 @@ mixer_init(device_t dev, kobj_class_t cls, void *devinfo) mixer_setrecsrc(m, 0); /* Set default input. */ - pdev = make_dev(&mixer_cdevsw, 0, UID_ROOT, GID_WHEEL, 0666, "mixer%d", + pdev = make_dev(&mixer_cdevsw, 0, UID_ROOT, GID_AUDIO, 0660, "mixer%d", unit); pdev->si_drv1 = m; snddev->mixer_dev = pdev; diff --git a/sys/dev/sound/sndstat.c b/sys/dev/sound/sndstat.c index c28a932c784e..68902012563e 100644 --- a/sys/dev/sound/sndstat.c +++ b/sys/dev/sound/sndstat.c @@ -1437,7 +1437,7 @@ static void sndstat_sysinit(void *p) { sx_init(&sndstat_lock, "sndstat lock"); - sndstat_dev = make_dev(&sndstat_cdevsw, 0, UID_ROOT, GID_WHEEL, 0644, + sndstat_dev = make_dev(&sndstat_cdevsw, 0, UID_ROOT, GID_AUDIO, 0640, "sndstat"); } SYSINIT(sndstat_sysinit, SI_SUB_DRIVERS, SI_ORDER_FIRST, sndstat_sysinit, NULL); diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index eedd52774b70..4072c8138cea 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -6049,7 +6049,7 @@ umidi_attach(device_t dev) error = usb_fifo_attach(sc->sc_udev, chan, &chan->mtx, &umidi_fifo_methods, &sub->fifo, unit, n, chan->iface_index, - UID_ROOT, GID_OPERATOR, 0666); + UID_ROOT, GID_AUDIO, 0660); if (error) { goto detach; } diff --git a/usr.sbin/virtual_oss/virtual_oss/main.c b/usr.sbin/virtual_oss/virtual_oss/main.c index 5b50f8e5ef6c..1b03e2c8cf37 100644 --- a/usr.sbin/virtual_oss/virtual_oss/main.c +++ b/usr.sbin/virtual_oss/virtual_oss/main.c @@ -1642,6 +1642,9 @@ static int voss_ntds; static pthread_t *voss_tds; static int voss_fd_sta = -1; +static gid_t voss_gid; +static int voss_perm = 0660; + /* XXX I do not like the prefix argument... */ static struct voss_backend * voss_load_backend(const char *prefix, const char *name, const char *dir) @@ -1874,25 +1877,8 @@ dup_profile(vprofile_t *pvp, int *pamp, int pol, int rx_mute, { vprofile_t *ptr; struct cuse_dev *pdev; - struct group *gr; const char *errstr; - gid_t gid; - int x, perm; - - if (!is_client) { - /* - * Loopback devices can be used only by users who part of the - * audio group, to avoid unintended snooping by unprivileged - * users. - */ - if ((gr = getgrnam("audio")) == NULL) - return ("getgrnam() failed"); - gid = gr->gr_gid; - perm = 0660; - } else { - gid = 0; - perm = 0666; - } + int x; rx_mute = rx_mute ? 1 : 0; tx_mute = tx_mute ? 1 : 0; @@ -1945,7 +1931,7 @@ dup_profile(vprofile_t *pvp, int *pamp, int pol, int rx_mute, /* create DSP character device */ pdev = cuse_dev_create(&vclient_oss_methods, ptr, NULL, - 0, gid, perm, ptr->oss_name); + 0, voss_gid, voss_perm, ptr->oss_name); if (pdev == NULL) { errstr = "Could not create CUSE DSP device"; goto err; @@ -1964,7 +1950,7 @@ dup_profile(vprofile_t *pvp, int *pamp, int pol, int rx_mute, /* create WAV device */ if (ptr->wav_name[0] != 0) { pdev = cuse_dev_create(&vclient_wav_methods, ptr, NULL, - 0, gid, perm, ptr->wav_name); + 0, voss_gid, voss_perm, ptr->wav_name); if (pdev == NULL) { errstr = "Could not create CUSE WAV device"; goto err; @@ -2581,6 +2567,12 @@ main(int argc, char **argv) struct sigaction sa; struct cuse_dev *pdev = NULL; struct virtual_profile *pvp; + struct group *gr; + + /* Devices can be used only by users who part of the audio group. */ + if ((gr = getgrnam("audio")) == NULL) + err(EX_USAGE, "getgrnam"); + voss_gid = gr->gr_gid; TAILQ_INIT(&virtual_profile_client_head); TAILQ_INIT(&virtual_profile_loopback_head); @@ -2650,7 +2642,7 @@ main(int argc, char **argv) if (voss_ctl_device[0] != 0) { pdev = cuse_dev_create(&vctl_methods, NULL, NULL, - 0, 0, 0666, voss_ctl_device); + 0, voss_gid, voss_perm, voss_ctl_device); if (pdev == NULL) errx(EX_USAGE, "Could not create '/dev/%s'", voss_ctl_device); diff --git a/usr.sbin/virtual_oss/virtual_oss/virtual_oss.8 b/usr.sbin/virtual_oss/virtual_oss/virtual_oss.8 index b9dc8fd86a3c..4db4492a0842 100644 --- a/usr.sbin/virtual_oss/virtual_oss/virtual_oss.8 +++ b/usr.sbin/virtual_oss/virtual_oss/virtual_oss.8 @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" -.Dd May 7, 2026 +.Dd May 21, 2026 .Dt VIRTUAL_OSS 8 .Os .Sh NAME @@ -162,8 +162,6 @@ This option should be specified before the -d and -l options. Create an OSS device by given name. .It Fl l Ar name Create a loopback OSS device by given name. -Users have to be part of the audio group to access this device. -This is a security measure to avoid unintended snooping by unprivileged users. .It Fl L Ar name Create a loopback OSS device which acts as a master device. This option is used in conjunction with -f /dev/null . @@ -328,8 +326,8 @@ virtual_oss -S -b 16 -C 2 -c 2 -r 48000 -s 4ms \\ -f /dev/sndio/default -d dsp .Ed .Sh NOTES -All character devices are created using the 0666 mode which gives -everyone in the system access. +Users have to be part of the audio group to access any device node created by +.Nm . .Sh SEE ALSO .Xr cuse 3 , .Xr sound 4 , From nobody Mon Jun 15 15:05:11 2026 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 4gfD1z3MBDz6hTd0 for ; Mon, 15 Jun 2026 15:05: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfD1z283nz3qJS for ; Mon, 15 Jun 2026 15:05:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781535911; 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=JYNr32lSOJRex1GuDnabQBIl5ClJkqbJWjXPxVFKuwU=; b=qPRCirwUUB4Xd4iIBhB8KSW+zY7vB681t6s7gi6OcYOWAP0UHFvzK9pYXHGp66TlV/k4y+ tyXi66LWGju4OZo0v8T90cZBlGAD4qOva85oDBDHQfpTN5EZJTKgInwHzIJRXPVY+iTtTt 30gkel+nu650z5pHdzcCykIxFWlMVa3ljeenzDEf3zvc3TvnLsqnHHk8jLji7AO8J9V3Wu 4JG4SH6WnfyegN0T8ONedTFTrW3KkXWZCljmfEfuSNsD9tOpBn83asu6BnKZH2e0+OdP9s stlqV8qh0QXmNuSfvYBnUpcHSxvR2lkFw2+a3/VmcT/MhpB1N+7rqsJelWVAyQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781535911; a=rsa-sha256; cv=none; b=k4HMYvACv6GM7t50h8Yx/cKuIxkGT3axvniApx8OUWO3r7SoysRTsxM+V9Vj5teO0lK8j5 sKC9DhfYrQy3toGWqY3dnfTXZd57PpqLK/1GnDOkwHaGSrM/V3EYbt82JmkRMawlqdMLeT 0ol5dQbpITDoSn7BezydRQoy5EXDy4N6WtwtXUz05ETVG0Es9vqGXW2dg55RWrr0lkDkbs +Y37aTfQOss3n/p7359dHTwgmp1/A4ZasYW68yTqL3V/VPVzXnqWefzCCISSmTok27kFFb LqNI9Ix+vIaMOWtMHX93KROEnXDTxCjt5NO3bQzQ08lx0Mp7rSz2QbvEmr3x8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781535911; 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=JYNr32lSOJRex1GuDnabQBIl5ClJkqbJWjXPxVFKuwU=; b=xZQncxI7fWmLao3tmKwI/cdBbdOwFf8rx+15+80FrUlA6gZt5fYhAOdeqQqN71xI3uBer9 nB5p82R2wAng7EEW+DAXivdkblN7ycl8kP0vjRDrK6vwKwBqVMsh7fieI/UE4OFqsr2zLD IA4OS5u0d1fxG423paMTybugy+hhBhXkfzEUz6kuAbgWOElXGgO7/P/k6ZKWQZON6ZfTxw zA+sGL+MCjthz5QO/jJhRl/x629KLVcLtKj/NdrdW7g6FwTON/UeAO1iminC+iQikJQiWu CwHb2c4BseldTgEhvxdEElr1zYt3jl8HcgbLPWgICa8KiUFdFlv4+lP8CNyvXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfD1z1SJ1z10Xw for ; Mon, 15 Jun 2026 15:05:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3c88e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 15:05:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 7f2d79082469 - main - groups.7: Document audio group 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7f2d790824692b16ab2bf64a9b1e176f192cf319 Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 15:05:11 +0000 Message-Id: <6a3014a7.3c88e.4b01cbf6@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=7f2d790824692b16ab2bf64a9b1e176f192cf319 commit 7f2d790824692b16ab2bf64a9b1e176f192cf319 Author: Christos Margiolis AuthorDate: 2026-05-21 18:42:25 +0000 Commit: Christos Margiolis CommitDate: 2026-06-15 15:03:55 +0000 groups.7: Document audio group Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: emaste Pull-Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/35 --- share/man/man7/groups.7 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/share/man/man7/groups.7 b/share/man/man7/groups.7 index d928dbb41e0f..2b5c34ca08cd 100644 --- a/share/man/man7/groups.7 +++ b/share/man/man7/groups.7 @@ -26,7 +26,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 19, 2026 +.Dd May 21, 2026 .Dt GROUPS 7 .Os .Sh NAME @@ -183,6 +183,11 @@ group). Not used by .Fx ; available for the administrator's interpretation. +.It Em audio +Used to access any device node created by +.Xr sound 4 , +device drivers, and +.Xr virtual_oss 8 . .It Em video Used for access to .Pa /dev/drm/* From nobody Mon Jun 15 15:43:23 2026 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 4gfDt34LC5z6hWLX for ; Mon, 15 Jun 2026 15:43:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfDt31nqPz3tVt for ; Mon, 15 Jun 2026 15:43:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781538203; 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=Srhb235rzpN8yk2mi6iph/vRVY5bEUixb7GxeUPgYbE=; b=xsHXmmWnT98H1ZYa5F70kXIm7uJnBziBVjlm8IiVZrcwL/EXcSFcZSdn1YiEowawQNpW7D EyQ5o4OW7t5SMMZSfPqauKdO/l98YLvTYsYIi2YKXwGFSINxXdL8a3Y1rHfwiflLQMjc32 Q4uEgUTxc5mwd3aLhFdkRNGkLvo1A/2Tcc/9fXHgNmImOGVxC2t0seQDDY6gittIwldOOZ r4Euvvamn6CG5QsXnSlaXpfLmF0EyxqIN2wklxFekv3ftHHivaKoDahoM+3TS0P91iZxNi 1I6lqmyJDgVSx0DOIeG5UmEw/uyXMEgTYUB7r+IR+ERDdiDn2790yCLRQfdybQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781538203; a=rsa-sha256; cv=none; b=A2whlYxgfGS+HA27NeFzV57sauuYXT1OmHXmiUsK6DKyTuFH9ptJEUWKtRcGbTZHMPc/K5 43e8xbQExHn9/yoPyM/BZAxXhPDSKqsWihiHwoH9zNaFd4B3HYAVNco5JoP+4EX00t+oMZ frTu2ex7nPsgImKQvV9/oIucaryv0lCcVjmglattyZy/ibCihSAm+t4IMS8LcPEzNVBjcs PBlFebeOb46hXGNIO989kuN3zg5JN/b6lt1uD3RobBfoiz3PghSGBhDsw8LhNKyK6GF6Ci ePuMwANClSgl4KHYhNvAc6F0McF6Y+WULi0T8cVMWmeazg1TA3evaixYrldMjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781538203; 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=Srhb235rzpN8yk2mi6iph/vRVY5bEUixb7GxeUPgYbE=; b=u9Fik0+QkpEdvcm+lkAS4uMHnZrE0tNsZ9HSVrB1hDJ4eqiDHU2qfewB+C7a/qQd2GmvIb nrtO41/Lt5Ou+jrD9JPrHI6ZVXeVChJdhWNixwujQPHjaI9zdbY4c+nnPIUAP8oWtAhdLF uP547rZmGCHSJ6BMRFdXLNNzmspFZHniqxfPlIr/YDLld/sjz/+uQlRuY7joDsl9GRtGcO JK/mrIFZjg7UWEGQoHm0A5Z25uEOUb6ATXRXHpfRVrQ1DeF/0WQqZ2z7zp8Kx0RDO5TQSO 6+a6ymSzAKIvZfKVpMATWy9hqPj2U+AT9AR2irReGaSXs4ZfTCznFYtoB4X1Cw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfDt3182Lz125K for ; Mon, 15 Jun 2026 15:43:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f98a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 15:43:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 52a2b4bc5da2 - main - tests: Fix build if TIOCSTI is not defined 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 52a2b4bc5da21d7a54cb16b9450196244b59b8c0 Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 15:43:23 +0000 Message-Id: <6a301d9b.3f98a.7e4d47ce@gitrepo.freebsd.org> The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=52a2b4bc5da21d7a54cb16b9450196244b59b8c0 commit 52a2b4bc5da21d7a54cb16b9450196244b59b8c0 Author: Ed Maste AuthorDate: 2025-05-30 15:58:41 +0000 Commit: Ed Maste CommitDate: 2026-06-15 15:42:48 +0000 tests: Fix build if TIOCSTI is not defined Some downstream projects (e.g. ElectroBSD) have removed the TIOCSTI We already have some components (such as mail and tcsh) that build without TIOCSTI defined. This is (existing portability support in those projects. Simplify things for downstreams by extending this approach to this additional TIOCSTI user. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D50614 --- tests/sys/kern/tty/test_sti.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/sys/kern/tty/test_sti.c b/tests/sys/kern/tty/test_sti.c index f792001b4e3f..d6ce05f76d81 100644 --- a/tests/sys/kern/tty/test_sti.c +++ b/tests/sys/kern/tty/test_sti.c @@ -19,6 +19,7 @@ #include #include +#if defined(TIOCSTI) enum stierr { STIERR_CONFIG_FETCH, STIERR_CONFIG, @@ -325,13 +326,18 @@ ATF_TC_BODY(unprivileged_fail_noread, tc) finalize_child(pid, -1); } +#endif /* defined(TIOCSTI) */ ATF_TP_ADD_TCS(tp) { +#if !defined(TIOCSTI) + (void)tp; +#else ATF_TP_ADD_TC(tp, basic); ATF_TP_ADD_TC(tp, root); ATF_TP_ADD_TC(tp, unprivileged_fail_noctty); ATF_TP_ADD_TC(tp, unprivileged_fail_noread); +#endif return (atf_no_error()); } From nobody Mon Jun 15 15:54:41 2026 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 4gfF760hF1z6hXnT for ; Mon, 15 Jun 2026 15:54: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfF756vKyz3w1B for ; Mon, 15 Jun 2026 15:54:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781538882; 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=liV4bOT0k7QildVrMO+EQDajqyA8bdrHbQgQFD92rsg=; b=efVuNZAhlbwtaYZ1qotoCqSdHyPtMxaNCybs/KRB7xRig5pr+ud/HkjPvYM47rvn3sUEPU l2m09UMMWI11yL1sgFgl7Q7J3kQs9vq5M/J0ryw2sGNRiRVjb7BMGh1l7r+bfCSNmMwTF8 7CPEtcc4ZeNZdRqAECPJVSBOuNL4e84y0K6xqoGdPuUTIrShRbWS91Ki90k1wpT7Q1elUk 66/cVDTQPhtby5oBUlxCPgr5/+CpsBjbDgJO358VFf7wm8lDfX0ee/yKMB7FeT5ZJgWVnN gG6DRzNfKEbUmJU2nyscy4xxbLIBid8N42W462F7Lw2gFoyHLDX/Sape2kLFzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781538882; a=rsa-sha256; cv=none; b=jWyrlZ3o6sChmQos2aBb3o7ombR974Zy5/y3e9VcaWKX5+kRQIRsNPljd+P77kSdawO1mT PCSTYSHRwLWSbI1utlyjup6cVbBLK6pc+qbO7vEuYDZX+ysXv6VlLORR5ik1gPnXf491pU oOxwYsP3q+R1m6n80OrM/7jN4tpiEP5s8seO2FWC78E7dBWiq8M8VuKLlH5dSgEzgsajaI zyWV2XWbuYiBcllycMPvu+r8QLc26CEhy/y9PHJaPh9eWPjIfaIWajElXja5695tk4l8jS hzbnGLLVoaylv0HwsAW6HAB0RQXaTuGK4RzjSSXO9H1r3utm0HmuwgywfQlluA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781538882; 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=liV4bOT0k7QildVrMO+EQDajqyA8bdrHbQgQFD92rsg=; b=RJn1GXAG8VvegzngEdFBRpR35fNI+pLvB6m/JeQS5vygjUEShpipY9EPjxEGu1gGBx2lId mhwP6pLvCMvGq27885VBY8WWr76OgEvleMh22dt/8SvRC/VYihSPGRZ2W0lL7yYGnzTr42 p6SnkV0ntsFCJC0bCNAZkCftuPJhxPHzrVtUCOUTtmZK02Xt3t/iWUc5jfJtboDB5WE8L0 6UBHBIhKRreBJl5a9w7W72mWApzLwzYH4uMOu711abtB5KXHmnGcizbvJjyJju6jK915dm sG3t4yqHlgzdwB28CTbSCRlZpJmE4LWkwL5r4eX9lRVmeW6FLxb7PnyAUuLfYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfF756Vhzz126F for ; Mon, 15 Jun 2026 15:54:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 40f75 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 15:54:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: fc7993cf2d6d - main - rpcsec_tls: Avoid a socket reference underflow in rpctls_server() 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: fc7993cf2d6ddba9f94683565838bf8fabc0145c Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 15:54:41 +0000 Message-Id: <6a302041.40f75.510b45cf@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fc7993cf2d6ddba9f94683565838bf8fabc0145c commit fc7993cf2d6ddba9f94683565838bf8fabc0145c Author: Mark Johnston AuthorDate: 2026-06-15 15:52:24 +0000 Commit: Mark Johnston CommitDate: 2026-06-15 15:54:30 +0000 rpcsec_tls: Avoid a socket reference underflow in rpctls_server() The upcall_sockets tree owns a ref on any resident socket. When a socket is removed after a TLS handshake failure, rpctls_rpc_failed() thus calls soclose(). rpctls_server() does not acquire an extra ref to compensate for this. So, if the upcall fails, e.g., because rpc.tlsservd is not running, we'll call soclose() to drop the reference, but this effectively releases the xprt layer's reference. Fix the problem by explicitly acquiring a socket reference when adding a socket to the upcall tree. PR: 289734 Reviewed by: rmacklem, glebius MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57555 --- sys/rpc/rpcsec_tls/rpctls_impl.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/sys/rpc/rpcsec_tls/rpctls_impl.c b/sys/rpc/rpcsec_tls/rpctls_impl.c index e1b80217263f..621f6bcac3e4 100644 --- a/sys/rpc/rpcsec_tls/rpctls_impl.c +++ b/sys/rpc/rpcsec_tls/rpctls_impl.c @@ -190,7 +190,6 @@ sys_rpctls_syscall(struct thread *td, struct rpctls_syscall_args *uap) CURVNET_RESTORE(); return (error); } - soref(ups.so); if (ups.server) { /* * Once this file descriptor is associated @@ -277,6 +276,7 @@ rpctls_connect(CLIENT *newclient, char *certname, struct socket *so, if (stat != RPC_SUCCESS) return (RPC_SYSTEMERROR); + soref(so); mtx_lock(&rpctls_lock); RB_INSERT(upsock_t, &upcall_sockets, &ups); mtx_unlock(&rpctls_lock); @@ -294,9 +294,16 @@ rpctls_connect(CLIENT *newclient, char *certname, struct socket *so, stat = rpctlscd_connect_2(&arg, &res, rpctls_connect_handle); if (stat == RPC_SUCCESS) *reterr = res.reterr; - else + else { rpctls_rpc_failed(&ups, so); + /* + * The socket was closed, make sure the krpc code doesn't close + * it a second time. + */ + CLNT_CONTROL(newclient, CLSET_TLS, &(int){RPCTLS_INHANDSHAKE}); + } + /* Unblock reception. */ CLNT_CONTROL(newclient, CLSET_BLOCKRCV, &(int){0}); @@ -388,6 +395,7 @@ rpctls_server(SVCXPRT *xprt, uint32_t *flags, uid_t *uid, int *ngrps, uint32_t *gidv; int i; + soref(xprt->xp_socket); mtx_lock(&rpctls_lock); RB_INSERT(upsock_t, &upcall_sockets, &ups); mtx_unlock(&rpctls_lock); @@ -407,9 +415,18 @@ rpctls_server(SVCXPRT *xprt, uint32_t *flags, uid_t *uid, int *ngrps, for (i = 0; i < *ngrps; i++) *gidp++ = *gidv++; } - } else + } else { rpctls_rpc_failed(&ups, xprt->xp_socket); + /* + * The socket was closed, make sure the krpc code doesn't close + * it a second time. + */ + sx_xlock(&ups.xp->xp_lock); + ups.xp->xp_tls = RPCTLS_FLAGS_HANDSHFAIL; + sx_xunlock(&ups.xp->xp_lock); + } + mem_free(res.gid.gid_val, 0); #ifdef INVARIANTS From nobody Mon Jun 15 15:59:28 2026 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 4gfFDd1Nqdz6hXwg for ; Mon, 15 Jun 2026 15:59:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfFDd0FMbz40wV for ; Mon, 15 Jun 2026 15:59:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781539169; 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=AeBOGw3HZPrqD1pIeE47BzkpZd1nqJJKJHzS/84YEV0=; b=UOpdwQqu8I3wpl0A2CxhONYwwGsomqE3ZWR77snKqeWiQSWdQyJOwNAG0GrdFyawxfePJm OcVF/iZJvkE3jhrDLX0ykA12svHXmzytTiRBxQxS2USFdkgAPvQDICNjB7l7zncZvCXhAv L42mi7vC4B5dXwxsq5OVV+kGRpHlixoWd9RX4KWY1UJVNETb8tuUHh8BNMkPylmTrzlYoc TVTeo3yzdeCgnDbRgFzjndz/M4pBI+1jIsFteQJLoFVvpegWq7QoHjVNNGemaa7noUFhWi /PJrkq+ZJBET61o+AwLKGtLsYV4M7PJQ1EADor6HRjcYCI2uWeTNqucgZfTEGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781539169; a=rsa-sha256; cv=none; b=hCGQepQB2w56DpHTwVKSHiep8MvBsbnqcJNB3WH0F7O/wKRgxAzKybDcrrbhSUvikRzxnt YVKQc6x87ogt4XD0uciNDbEbOomUExdtpHuGaeMFEILBb3dYn0DrwJQv9+baqH57/JMihm 16h1tbA6v6+ZdDKfjHyZIkzOvY3iVtRV1bgOJUf6qlfQsKsGU4KVb5OWVoXtPED4KTgowF UOE7/vT1Fk4FU2AoDW1KgOL4TJYmaJUeVn0dKsOkwSmz2fuv9JD1d6YdYO3BUaHF00+5bt r39Yn8zdPocLNIbAmA5cvbZBdybwNwfQoZof4K+m/Ub4QUyZ3LErpEqBlwOQ2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781539169; 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=AeBOGw3HZPrqD1pIeE47BzkpZd1nqJJKJHzS/84YEV0=; b=L0Ww9U6/NKreC7OAfbtodSTU6ZWTvG5CSk6iMUUeM1n2cH0eC7fdZQVgW92nHMYe9Kr3n4 BmF5KEqg1MjbfU2NDg28QUYxfHMPUo04POQlWz7smg0XqsPj/FiCS15UA23hFo+GMeNI/J mD9DKJarOEf4nh6m9UmZqTWXzI1TE8cmDvWrLQX7e6J6oHstadftGDQjEr4YofvvYJrPU7 x95BZigHC3p2j2cBTT8RIoOVviB1pSxV8KTVjaRbw5zutmoxg8ZObmx++K4vmqAw9UNHzg 3idBu6PmMDsChida2bJXKuLkVCEWn9YMmfflMe6R5hGn1Q9HddU2S/wfe7KnLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfFDc6glDz11Hp for ; Mon, 15 Jun 2026 15:59:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 42606 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 15:59:28 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 3b69c7201fd0 - main - udp: Wrap a long line in udp_send() 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 3b69c7201fd06b368090f2ee3840d384a949cba8 Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 15:59:28 +0000 Message-Id: <6a302160.42606.3d4c60a4@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3b69c7201fd06b368090f2ee3840d384a949cba8 commit 3b69c7201fd06b368090f2ee3840d384a949cba8 Author: Mark Johnston AuthorDate: 2026-06-15 15:57:01 +0000 Commit: Mark Johnston CommitDate: 2026-06-15 15:57:01 +0000 udp: Wrap a long line in udp_send() No functional change intended. MFC after: 1 week --- sys/netinet/udp_usrreq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 22faf1cc1ec9..3237b12f80c0 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1164,7 +1164,8 @@ udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, * We will need network epoch in either case, to safely lookup into * pcb hash. */ - use_cached_route = sin == NULL || (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0); + use_cached_route = sin == NULL || + (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0); if (use_cached_route || (flags & PRUS_IPV6) != 0) INP_WLOCK(inp); else From nobody Mon Jun 15 21:39:26 2026 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 4gfNmv0nYxz6hxw3 for ; Mon, 15 Jun 2026 21:39: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfNmv054fz3fWb for ; Mon, 15 Jun 2026 21:39:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781559567; 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=JNfdTRpgieJcZM1N+i5Jt5gnZuvNXLv7I7/47Rmb/kg=; b=IrNaJplbVRDXm3+8UNPSmzxlG1gt7IA0cBKAJmiF5uRKmhCMjAMxt5DcvS3M/3aILt/KYT FXzOGY16vMy4RwBk8ptz/JB7T/MERZCWI6YNB0SnfG2uqH0mdOXDf8hu0FYSxtElL5smYP M0S7BVFxqZpL1yfp9sMEkjiyxAtc7rQ7ynaMbxRVFuCIogG1dDintDeHB09wcfAJ3h3L0Q JcFc5RyF0BR6sO0uTF12IhJBADl8lDKR07U6hr7ntZzgHOrcjdGIZ5rh6BJ6Mi21TR4X1x sjaXroZW9MHWsYxlHn9aD0dk9Wk6RnUZKvEPj/x/31dqrmTQH3sofc+bW/R9AA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781559567; a=rsa-sha256; cv=none; b=CvVl7kFQ6h9VWoUiYUlgemTZsMrA4LnrjbDjs0nLw27meavckD34EUcjUNriyTF/x5SEfw AqnOqLuoZonDq8VUICoMyjrLlB3sayJ/iWjXBrcy71mt+XCQvZMYu/ITx1q+1KRdFTD9aL G2JTQ4ClZoDfpVtysGK0yRI/WUPEWIsslexhBqdESqOWKnFaLtO/zOg0hPu+tNUvQnOiQC pi/1ixWnxZhGgU1BuR58k63+KkKrtPB00ZSeuGXafTlnnXa3xGbbNoVs6TrWpjRITV2yfm /wO+236g/bLICZ638veNebrizdnTN47ONLisdQJmWQ+EHSU+9F78Uive9z6ghA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781559567; 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=JNfdTRpgieJcZM1N+i5Jt5gnZuvNXLv7I7/47Rmb/kg=; b=Zm9lMeyYXp9Wx+rmiv9vWLhvgayBf9Q4bb6TXbV8ki8clIxcMktsV+H+uTQy0uEbTosf21 sBvc0kscdpemFfvixlf0H7eKtfgePuy5TiKOmPIpItSGDz17CcLgzRwWCi1XDqQeG9mx4L 8N49PHkTZC2KkG9mfwWIMOf8ArHKJvhqqpBTrlZpWplMy5bH9ZhPVRC7Dz8sLh/YNJB2Yt gPfIWbM+bGHb7V7bjZ8WVwPoO4YAiuFXnEU2Ese6bOFEdcUopEaU5HbAWJ8PnKHmBzYYBl 0Jd3E99vJS/3mXXmBYO99Wd1q4zPERd0DpxYlKGeB2DPTjxCX36fd5/bcqYsOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfNmt6FR5z1BBT for ; Mon, 15 Jun 2026 21:39:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3df14 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 21:39:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brad Davis Subject: git: cd0a101b01d6 - main - packages: Fix building packages when WITHOUT_BLOCKLIST is set 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd0a101b01d685092d073a367f0e7374f7259256 Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 21:39:26 +0000 Message-Id: <6a30710e.3df14.19412112@gitrepo.freebsd.org> The branch main has been updated by brd: URL: https://cgit.FreeBSD.org/src/commit/?id=cd0a101b01d685092d073a367f0e7374f7259256 commit cd0a101b01d685092d073a367f0e7374f7259256 Author: Brad Davis AuthorDate: 2026-06-15 17:59:19 +0000 Commit: Brad Davis CommitDate: 2026-06-15 21:39:16 +0000 packages: Fix building packages when WITHOUT_BLOCKLIST is set Reviewed by: emaste MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D57601 --- packages/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/Makefile b/packages/Makefile index 71a49d6d06ea..6faa6c37d485 100644 --- a/packages/Makefile +++ b/packages/Makefile @@ -16,7 +16,7 @@ .include -SUBDIR= blocklist \ +SUBDIR= \ bsdconfig \ bzip2 \ clibs \ @@ -100,6 +100,7 @@ SUBDIR+= caroot SUBDIR.${MK_AT}+= at SUBDIR.${MK_AUDIT}+= audit SUBDIR.${MK_AUTOFS}+= autofs +SUBDIR.${MK_BLOCKLIST}+= blocklist SUBDIR.${MK_BLUETOOTH}+= bluetooth SUBDIR.${MK_BOOT}+= bootloader SUBDIR.${MK_BSDINSTALL}+= bsdinstall From nobody Mon Jun 15 22:57:07 2026 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 4gfQVX0W2Gz6j47M for ; Mon, 15 Jun 2026 22:57: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfQVW5pVqz3p1h for ; Mon, 15 Jun 2026 22:57:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781564227; 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=FYBQw3jjhM6iJmB75GlbIlBwOYfMVJ1ohzgTklvNw9s=; b=BuexHBHreYbCq5HC9Mt95EdGo7DUGGdDqT/vMCQtjEgzeMSoMPR/423F9wud2emfrBlJ+q R210Rz2SCcBo4X1UMYa1z3l7hC9Ob29oXfyD6sNNL7OxAVVcTFajJxKsXlWMmNu9L3vNIQ PVS+jdxEPMy5uzBdhbs8w2hiIbOUvU7AqaPqnYUsWh5197KTNvyYup+6tPmyQxZoQGH9a/ rLX1n4sYKKWhryqSFy1vskH7ihDEh8ITv2NLnQIEnMqsZlpWyQOWS180AJW19QGqgWjOJL IJtkYd1Jbdv/XSA7LASksLBZMxqzrCrJaD2Ra993+k8Hd5/CUW98SGOD7px76Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781564227; a=rsa-sha256; cv=none; b=ywvEVOpRxqsza8mM0d8BUIGr22j0atHfbZe3TGutcS6VTmAsR9IvIpBRYRF0lhJ2bs5d05 Mk32dlcRfeVOKyxbgJ7gsl4QaT6C5Bh80DRDldtz5RAhH989pXUcwaoHKRtLDcTDbF0SeK gX906Wb7qNHdF2Ok9KTBf/bjcCY3yT7zWyGkca8DEcXtRrTqg5qKX8WPrO/ozMytPOnmtF naWDQV6/5t+jsXZKgUph7J7gaAva7UJjpiOKVSry6rJqsXbMQ5CbDgR/lZ/OZuUyadvWP0 Y+TmfhuJXFA1wlmHIoY4dqrfwo9CZI+aPsc7tB3eUNVwjX8Jx+zHR1XTmx07Nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781564227; 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=FYBQw3jjhM6iJmB75GlbIlBwOYfMVJ1ohzgTklvNw9s=; b=PWimAV790hT3ItCsGd7YDAc3PBzi4G1jnKuKfsTK7aSwMyY0aPG1O2pLQJQL1tZraRhsUn ezgoL5/JgR6tuphVE1k5Bu9pQm86JKmI1scB7JH1/Xbi9rj1GFwEbOz0E8hmvN4AtEbB4o yMbNX6mRTjYaLXIh/4UhKvnuFgucwUwl/V95tEyvPXUPUy5UUpGD9nYlVi8oNRw1xMRP4C DTbF5Q6XidjvJdiKvqiQltJQrK9IXEmq91SvsOogOsWHPUOAA53hI/6btHaWD5v/KwSmg0 xrZyxlOy//Ujm1iL4Rnr3MyeoGrlixmRzbzU2grxd1qTFZUSODPeXjqM7n1WBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfQVW5FHtz1DZt for ; Mon, 15 Jun 2026 22:57:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4542c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 22:57:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: e821152cc71d - main - symlink.7: Clean up markup and tag SPDX 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e821152cc71dbd09f5bd28be86499165c553f3ae Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 22:57:07 +0000 Message-Id: <6a308343.4542c.52fed828@gitrepo.freebsd.org> The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=e821152cc71dbd09f5bd28be86499165c553f3ae commit e821152cc71dbd09f5bd28be86499165c553f3ae Author: Alexander Ziaee AuthorDate: 2026-06-12 15:47:54 +0000 Commit: Alexander Ziaee CommitDate: 2026-06-15 22:49:29 +0000 symlink.7: Clean up markup and tag SPDX Also unwind some parentheticals. MFC after: 3 days --- bin/ln/symlink.7 | 92 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 49 insertions(+), 43 deletions(-) diff --git a/bin/ln/symlink.7 b/bin/ln/symlink.7 index db251e1d2985..5cb883efed36 100644 --- a/bin/ln/symlink.7 +++ b/bin/ln/symlink.7 @@ -1,4 +1,6 @@ -.\"- +.\" +.\" SPDX-License-Identifier: BSD-3-Clause +.\" .\" Copyright (c) 1992, 1993, 1994 .\" The Regents of the University of California. All rights reserved. .\" @@ -68,9 +70,9 @@ in which case the links are dereferenced until an object that is not a symbolic link is found, a symbolic link which references a file which does not exist is found, or a loop is detected. -(Loop detection is done by placing an upper limit on the number of +Loop detection is done by placing an upper limit on the number of links that may be followed, and an error results if this limit is -exceeded.) +exceeded. .Pp There are four separate areas that need to be discussed. They are as follows: @@ -84,11 +86,11 @@ Mount options to ignore symbolic links. Symbolic links specified as command line arguments to utilities that are not traversing a file tree. .It -Symbolic links encountered by utilities that are traversing a file tree -(either specified on the command line or encountered as part of the -file hierarchy walk). +Symbolic links encountered by utilities that are traversing a file tree, +either specified on the command line or encountered as part of the +file hierarchy walk. .El -.Ss System calls. +.Ss System calls The first area is symbolic links used as file name arguments for system calls. .Pp @@ -182,19 +184,26 @@ system call was added later when the limitations of the new became apparent. .Ss Mount options .Fx -has a +has a .Xr mount 8 -option nosymfollow. When this option is enabled, the kernel -does not follow symlinks on the mounted file system and return EACCES. +option +.Cm nosymfollow . +When this option is enabled, the kernel +does not follow symlinks on the mounted file system and return +.Er EACCES . You can still create or remove symlinks, or read the value of a symbolic link. .Pp This option is intended to be used when mounting file systems from -untrusted external storage systems or public writable /tmp file systems +untrusted external storage systems or public writable +.Pa /tmp +file systems to prevent symlink-based privilege escalation and sandbox escape attacks. .Pp -The mount option nosymfollow first appeared in +The mount option +.Cm nosymfollow +first appeared in .Fx 3.0 -.Ss Commands not traversing a file tree. +.Ss Commands not traversing a file tree The second area is symbolic links, specified as command line file name arguments, to commands which are not traversing a file tree. .Pp @@ -215,7 +224,7 @@ optionally traverse file trees, e.g.\& the command is included in this rule, while the command .Dq Li "chown -R file" is not. -(The latter is described in the third area, below.) +The latter is described in the third area, below. .Pp If it is explicitly intended that the command operate on the symbolic link instead of following the symbolic link, e.g., it is desired that @@ -242,20 +251,20 @@ and .Xr rm 1 commands do not follow symbolic links named as arguments, but respectively attempt to rename and delete them. -(Note, if the symbolic link references a file via a relative path, +Note, if the symbolic link references a file via a relative path, moving it to another directory may very well cause it to stop working, -since the path may no longer be correct.) +since the path may no longer be correct. .Pp The .Xr ls 1 command is also an exception to this rule. For compatibility with historic systems (when -.Nm ls +.Xr ls 1 is not doing a tree walk, i.e., the .Fl R option is not specified), the -.Nm ls +.Xr ls 1 command follows symbolic links named as arguments if the .Fl H or @@ -267,14 +276,14 @@ or if the or .Fl l options are not specified. -(The -.Nm ls +The +.Xr ls 1 command is the only command where the .Fl H and .Fl L options affect its behavior even though it is not doing a walk of -a file tree.) +a file tree. .Pp The .Xr file 1 @@ -292,11 +301,11 @@ The system differs from historical .Bx 4 systems in that the -.Nm chown +.Sy chown and -.Nm chgrp +.Sy chgrp commands follow symbolic links specified on the command line. -.Ss Commands traversing a file tree. +.Ss Commands traversing a file tree The following commands either optionally or always traverse file trees: .Xr chflags 1 , .Xr chgrp 1 , @@ -328,7 +337,7 @@ as well as any symbolic links encountered in the tree traversal of .Dq Li directory , because symbolic links may be removed. In no case will -.Nm rm +.Xr rm 1 affect the file which .Dq Li slink references in any way. @@ -342,22 +351,21 @@ This is often referred to as a .Dq physical walk, as opposed to a .Dq logical -walk (where symbolic links referencing directories are followed). +walk where symbolic links referencing directories are followed. .Pp As consistently as possible, you can make commands doing a file tree walk follow any symbolic links named on the command line, regardless of the type of file they reference, by specifying the .Fl H -(for -.Dq half\-logical ) +.Pq Dq half-logical flag. This flag is intended to make the command line name space look like the logical name space. -(Note, for commands that do not always do file tree traversals, the +Note, for commands that do not always do file tree traversals, the .Fl H flag will be ignored if the .Fl R -flag is not also specified.) +flag is not also specified. .Pp For example, the command .Dq Li "chown -HR user slink" @@ -380,16 +388,15 @@ walk follow any symbolic links named on the command line, as well as any symbolic links encountered during the traversal, regardless of the type of file they reference, by specifying the .Fl L -(for -.Dq logical ) +.Pq Dq logical flag. This flag is intended to make the entire name space look like the logical name space. -(Note, for commands that do not always do file tree traversals, the +Note, for commands that do not always do file tree traversals, the .Fl L flag will be ignored if the .Fl R -flag is not also specified.) +flag is not also specified. .Pp For example, the command .Dq Li "chown -LR user slink" @@ -398,19 +405,18 @@ will change the owner of the file referenced by If .Dq Li slink references a directory, -.Nm chown +.Xr chown 1 will traverse the file hierarchy rooted in the directory that it references. In addition, if any symbolic links are encountered in any file tree that -.Nm chown +.Xr chown 1 traverses, they will be treated in the same fashion as .Dq Li slink . .Pp As consistently as possible, you can specify the default behavior by specifying the .Fl P -(for -.Dq physical ) +.Pq Dq physical flag. This flag is intended to make the entire name space look like the physical name space. @@ -439,11 +445,11 @@ and .Xr rm 1 commands have exceptions to these rules. The -.Nm rm +.Xr rm 1 command operates on the symbolic link, and not the file it references, and therefore never follows a symbolic link. The -.Nm rm +.Xr rm 1 command does not support the .Fl H , .Fl L @@ -453,7 +459,7 @@ options. .Pp To maintain compatibility with historic systems, the -.Nm ls +.Xr ls 1 command acts a little differently. If you do not specify the .Fl F , @@ -461,12 +467,12 @@ If you do not specify the or .Fl l options, -.Nm ls +.Xr ls 1 will follow symbolic links specified on the command line. If the .Fl L flag is specified, -.Nm ls +.Xr ls 1 follows all symbolic links, regardless of their type, whether specified on the command line or encountered in the tree walk. From nobody Mon Jun 15 22:57:08 2026 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 4gfQVY3h5Zz6j44V for ; Mon, 15 Jun 2026 22:57:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfQVX6SvWz3nlX for ; Mon, 15 Jun 2026 22:57:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781564228; 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; bh=R3ZsVNm0E7MUurUsXBlgHFBjoFGAw8WFzJzXpbea5AQ=; b=lioP11txr29Zml1HN77LRmOL6b4j6t1trpuWhEeS2RL54QNQ+RH8uX+fwAH+LkOBNyXUam mmKvSXNZtuvT1Qxgb3AryKYzaOt122oAwRDhRaF6ne8KcjWOnfMdLIv/nImEzg0G+xVjIh rxf+S4SsmaNISpY3Of/HGl5dCWPYF+rGNBgY8DR+hrSMbdV4uwqeV2JvObaDMutEpkK1WL TRpL2EO6ppHop/G77eX8zwX04yeECLW79e1zChTEK7aPfeVj8nzCb2RCUoQnsusza9AJP/ H/C3XRkkSImzHIPn9lS3BfKwMAsqWORuEYmGvhR1cKg6Mldgy5P//OK9ej97lA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781564228; a=rsa-sha256; cv=none; b=SDDl8/1/TATtajkJYWgwKqtNzseSRzKw7VmpohB8BFXZ3HwCUXddZI9JQwm97UKfOAVbcj t8+PzgBF9zhtvAKghOoIiqsJRZaeSpLVnlVnPyyLvfDqe2mO6X9Q6qs80+Zlfnp11yQlqQ XftvGdc96QdleUU3MjkryAYnW6671fQLdEr9q54gxSlB3ravGS2DApUOTRcWHr1JxiNALB e0xu+9YLw4sLquhCSDWwVY4MC6eqod7eyM3MXoYgSrXZ3lq70Hpi7Vj9QZCJ8JT/2snrHW HTlBq5O1v0PN/jg6+EaC051hV9DOFT/ue+OLcRBSbkpqRIydy6wkoWVdC6TaWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781564228; 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; bh=R3ZsVNm0E7MUurUsXBlgHFBjoFGAw8WFzJzXpbea5AQ=; b=Ztti8fztjmR52fQ8o0lAw5lTnlzYlfRyyjhDwRwL6VtyQ5dpBU62mF/MUmJKfI0B55dSKL EC2ijRmpvWt+iIIUNG/aQ/4zUl99bYPOZQNhyHQdXqLgobNY0tVZ78ScXi2j6aLNRYjHvA EP8co87JGEvfpOFpgyrp/iY6P4SOm24sYRoYqq1yVY4K7scjUc9kT9PgVP4KhgUmz9Ne+B 8jmaa4Wo3Phg8S87j74atYIHFBZ5ybpgrhpyYsVGO4AaJr/UW5cugf7qTgqEQqBBhtZQA5 5gOKfBcEZEXVOOM33TEDfS1eNu0Kxrt3d1SUQQ9H+iI1KBUMbM1+CDtlKlUjkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfQVX61prz1FDZ for ; Mon, 15 Jun 2026 22:57:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 45039 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 15 Jun 2026 22:57:08 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Caleb Harper From: Alexander Ziaee Subject: git: a641aa1c80f8 - main - loader.efi.8: hw.uart.console is explained in uart 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a641aa1c80f80e44cd9212b95e6584db9533712c Auto-Submitted: auto-generated Date: Mon, 15 Jun 2026 22:57:08 +0000 Message-Id: <6a308344.45039.4dec9c5a@gitrepo.freebsd.org> The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=a641aa1c80f80e44cd9212b95e6584db9533712c commit a641aa1c80f80e44cd9212b95e6584db9533712c Author: Caleb Harper AuthorDate: 2026-06-15 22:51:05 +0000 Commit: Alexander Ziaee CommitDate: 2026-06-15 22:56:01 +0000 loader.efi.8: hw.uart.console is explained in uart PR: 295944 MFC to: 15 MFC after: 3 days --- stand/man/loader.efi.8 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stand/man/loader.efi.8 b/stand/man/loader.efi.8 index 8ddc869e0a27..1f55342e0ef7 100644 --- a/stand/man/loader.efi.8 +++ b/stand/man/loader.efi.8 @@ -152,9 +152,8 @@ The kernel will look at the .Dv hw.uart.console variable to set its serial console. -Its format should be described in -.Xr uart 4 -but is not. +Its format is described in +.Xr uart 4 . Set it to .Dq io:0x3f8,br:115200 with the proper port address. From nobody Tue Jun 16 03:26:38 2026 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 4gfXTV3Vwcz6gkqM for ; Tue, 16 Jun 2026 03:26: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfXTV2mFqz3Nxr for ; Tue, 16 Jun 2026 03:26:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781580398; 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=La34Cnv+vn7Bo/p++xElE+dai/xEBb4Bf7CL44AFkJs=; b=ZRTqm60npt7J421+7ukKNrByvhPeNT11krqLqGckbmTgc8cQF6F+coFYwRc5R2ZCnMwP3T XV6U6A8KHe92yfRrvV3J72KZpvCbNAdxNO59WxpzVw0b+bcvvS453nbaCQ7pI22ladV9aE d/ubcuto3dGj3g6tJknkGLSZwwHhHvSgtw0sIm16gyEpwT8x5mF3QUy7ZHiDwGy2T1P2/V O9Meno3fESEHNFP8kqNT34O81ERSQZOdGS4V14ulHjbUUjXhb6Xj7F9LAyED1U+gcvaI+U xbkag3d9Of5RK7aLOdNNKi35qAXfhNRXBfXSnnPxOxtf5E8FfRMqnZ/DOsVVhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781580398; a=rsa-sha256; cv=none; b=b9mizJJLGSmz3XPXEx/TkGFUigQwq0N2DTOTAmjZxOEauCxF4MH339WpwtnMsRc47netQ0 16W6jV4QWQxLZf+NY31mVjcR8HkvQBOOGHW2Cg93u6Ilu5ULTDDp05QOuW8Q+GG1SjUxpB 7ZzReOT3PQuK1wraAGtQvWHtWREKFmrGGpN/UGMRLJcH2jkXtyXvt7tGBTedelUKS3YU6N 17sF3d/jukrZtfmKddkRnaVA9P+D3J79fFBYYn7yyrIG56LJrIjxPfWCJUvSXd7uW5HW7i arPm5o10jWXYwGYIcWJA+LBVI0C7SMIF96tDCYnSJZK0xzSRGqynXXgjg6quxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781580398; 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=La34Cnv+vn7Bo/p++xElE+dai/xEBb4Bf7CL44AFkJs=; b=isF2MQo6S+qVYKG39Ef3tdJBwdzwFAmKQzxwvmMHT8iMoxNxfHPilCqZmvu/kULJDP5us3 hryJScuSUF8byJwd2jI7fIIkPE8dRKNDZA2xV7Y/NXdmJgMULC6//yM+4oKvBKHcqSt/WE L7h2TD5TAe4xhkIsRJ7T9zgDLZIdww8hvY0l9gxQLSD4fP0Uh9SdlmrT5IgnSK9pUBImPU +pZM/QRFTf7ymymoTLRm+G1z39aLIbjAUYAsZppksFVBc3EO+YXSd6d7xBZFwSV2ZUM4HP wtT3PW0iphcCY7Wofiww9RHNpc7pIPyTfEPlLT9mTVTIzyXomY/0HO7SgWC2uA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfXTV2LDTz1Mxh for ; Tue, 16 Jun 2026 03:26:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 39c4e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 03:26:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Siva Mahadevan Subject: git: 0010c4b8a020 - main - tests/sigtramp_test: xfail on non-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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: siva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0010c4b8a020dbeb81e61b71117d1caae9b044cc Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 03:26:38 +0000 Message-Id: <6a30c26e.39c4e.76d6b6ef@gitrepo.freebsd.org> The branch main has been updated by siva: URL: https://cgit.FreeBSD.org/src/commit/?id=0010c4b8a020dbeb81e61b71117d1caae9b044cc commit 0010c4b8a020dbeb81e61b71117d1caae9b044cc Author: Siva Mahadevan AuthorDate: 2026-06-15 22:09:05 +0000 Commit: Siva Mahadevan CommitDate: 2026-06-16 03:21:10 +0000 tests/sigtramp_test: xfail on non-amd64 This test fail until at least https://reviews.llvm.org/D155066 is rebased and picked up for aarch64 and more work is done for the other archs. PR: 289096 Reviewed by: jlduran Fixes: fef84fd8ae845e19cec0f6b9aac0e6451cca3d7a MFC after: 3 days --- lib/libexecinfo/tests/sigtramp_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libexecinfo/tests/sigtramp_test.c b/lib/libexecinfo/tests/sigtramp_test.c index 5dead9a4146b..b440781aa857 100644 --- a/lib/libexecinfo/tests/sigtramp_test.c +++ b/lib/libexecinfo/tests/sigtramp_test.c @@ -45,12 +45,12 @@ handler(int signum __unused) ATF_TC_WITHOUT_HEAD(test_backtrace_sigtramp); ATF_TC_BODY(test_backtrace_sigtramp, tc) { -#if defined(__aarch64__) +#if !defined(__amd64__) /* * https://reviews.llvm.org is deprecated and * this review is never going to be updated or completed */ - atf_tc_expect_fail("https://reviews.llvm.org/D155066"); + atf_tc_expect_fail("https://reviews.llvm.org/D155066 and https://bugs.freebsd.org/289096"); #endif struct sigaction act; From nobody Tue Jun 16 11:23:02 2026 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 4gfl3B3lBxz6hTBk for ; Tue, 16 Jun 2026 11:23:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfl3B1hKlz3MWX for ; Tue, 16 Jun 2026 11:23:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781608982; 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=AzyVGu79yH9PM05nujzewHDquwU2hMaQq2nQLRYtptE=; b=WOoDUP7QPqzfJlHmueB1Qj0xrWA9ztMIKcRZhQMkK77cQ5Cmyp8prHjw69uU+dWez09Ta7 AqWUC5Yixpc9dROV01Ey46VLeOsC95FNd093FXXCni5guIijxl8usR0IJhJh6ZZDXfrban EaHXOIk8Gc/9zY13zHw1L5XHCPKk8z/Q9+L132JodQZzddo1vvSTqW8/O+U0iSEPD4ExMW WWstuGF931F5abTgIAV0GThqBvtvIgomiJ9TlE/bipibW4z3HFZ4ZVU0/gdvWxQi4ermSk 3vTz8QJnKNLzaBU/xk5e6DJe/6X/8MPdIcpXblJvLVSzgxKXFVEaHqKrIOGjAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781608982; a=rsa-sha256; cv=none; b=RoYOW45m5jMxlCzT5YEtl4KBVN9qeuflh2focSH6zkFgMewK3WilUvMLk3imhHlEqhnIl1 i3imZW4YaopzgO1an7hBXvQfKNrb94iirtoFXNE4Mx0+QXZ8T4/f4+UJOVN0D/iyKJn5G2 ltdegKYn9qZJZOPBUKHMWBgaH6tbz2aWq3UDqXxNOUamtIWOIeJ68MpIC02XzeyMsRmR0M 2gTZOuWBkshOzKxpMZlAF+9nFjpGD+eZDBjic2fX0UszVxIonwvsYMFUjHmhJPKBPeUMzq Ot+ZYS6ROHi7qmLQHTR6Iqv/VZwldpGvXrRFHGHh/VGRBwyo4vn4TAJzz1SUBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781608982; 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=AzyVGu79yH9PM05nujzewHDquwU2hMaQq2nQLRYtptE=; b=hwlRJlSyu1uAlPP3uYmhlcMoS35jP0KqzePIKY0dbrcrRHDOeU+dz7qAcJlPlJcZbMHkGV 6xI7D5iA6BL04c0F7ywBDS6oDszqfGhwVoQ/wzur75+69/B/Ws3DmqHznvHgontrMIoUiM 87vZPJVn7xfIHu/FQcn79ryBGLohH12RWUBBcx/OmYFwYvxD2JuXZDH0O1oTKDTZQ9Fw1u khqxBRWSl/Y70eRooem+bu+n/hp1Pj55RODHkHLs4DK6ZZlQYrbGBmrU1Y46La5wx2qwOI AYft5sPWlzI1yjAsb9yOVmsxeqgs5s8H4CxzwXraAKp7pd1xBCOdgVYe/m3WWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfl3B11Cgz7nY for ; Tue, 16 Jun 2026 11:23:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1ef1d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 11:23:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: b711ef9c75ba - main - uvideo: import uvideo(4) driver from OpenBSD 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: b711ef9c75ba71d6258d028aaf7b119ccfffaa0a Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 11:23:02 +0000 Message-Id: <6a313216.1ef1d.188daf34@gitrepo.freebsd.org> The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=b711ef9c75ba71d6258d028aaf7b119ccfffaa0a commit b711ef9c75ba71d6258d028aaf7b119ccfffaa0a Author: Baptiste Daroussin AuthorDate: 2026-05-05 20:29:47 +0000 Commit: Baptiste Daroussin CommitDate: 2026-06-16 11:20:52 +0000 uvideo: import uvideo(4) driver from OpenBSD Port the uvideo(4) driver from OpenBSD. This provides native USB Video Class (UVC) support for webcams and video capture devices. The main changes are adaptation for: - USB transfer callback model - isoc data extraction via usbd_copy_out(), - V4L2 struct alignment for ABI compatibility with v4l_compat. Note that this implementation can coexist with webcamd. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D56960 --- sys/conf/files | 1 + sys/dev/usb/usb.h | 6 + sys/dev/usb/video/uvideo.c | 3493 +++++++++++++++++++++++++++++++++++++++ sys/dev/usb/video/uvideo.h | 687 ++++++++ sys/dev/usb/video/uvideo_v4l2.h | 483 ++++++ sys/modules/usb/Makefile | 1 + sys/modules/usb/uvideo/Makefile | 10 + 7 files changed, 4681 insertions(+) diff --git a/sys/conf/files b/sys/conf/files index 1332f4bd8cc6..126a08d697b4 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3497,6 +3497,7 @@ dev/usb/template/usb_template_cdceem.c optional usb_template # USB video drivers # dev/usb/video/udl.c optional udl +dev/usb/video/uvideo.c optional uvideo # # USB END # diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h index 3e972f876c6a..da27c97bd5c7 100644 --- a/sys/dev/usb/usb.h +++ b/sys/dev/usb/usb.h @@ -459,6 +459,12 @@ typedef struct usb_interface_assoc_descriptor usb_interface_assoc_descriptor_t; #define UICLASS_PHYSICAL 0x05 #define UICLASS_IMAGE 0x06 #define UISUBCLASS_SIC 1 /* still image class */ + +#define UICLASS_VIDEO 0x0e /* video */ +#define UISUBCLASS_VIDEOCONTROL 1 +#define UISUBCLASS_VIDEOSTREAMING 2 +#define UISUBCLASS_VIDEO_IFACE_COLL 3 + #define UICLASS_PRINTER 0x07 #define UISUBCLASS_PRINTER 1 #define UIPROTO_PRINTER_UNI 1 diff --git a/sys/dev/usb/video/uvideo.c b/sys/dev/usb/video/uvideo.c new file mode 100644 index 000000000000..310c66db2846 --- /dev/null +++ b/sys/dev/usb/video/uvideo.c @@ -0,0 +1,3493 @@ +/*- + * SPDX-License-Identifier: ISC + * + * Copyright (c) 2008 Robert Nagy + * Copyright (c) 2008 Marcus Glocker + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Ported from OpenBSD to FreeBSD by Baptiste Daroussin + */ + +/* + * USB Video Class (UVC) driver. + * + * Implements standard UVC 1.0/1.1/1.5 devices only. + * Creates /dev/videoN character devices with V4L2 ioctl interface. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include "usbdevs.h" + +#include + +#define USB_DEBUG_VAR uvideo_debug +#include + +static SYSCTL_NODE(_hw_usb, OID_AUTO, uvideo, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "USB uvideo"); + +#ifdef USB_DEBUG +static int uvideo_debug = 0; + +SYSCTL_INT(_hw_usb_uvideo, OID_AUTO, debug, CTLFLAG_RWTUN, + &uvideo_debug, 0, "Debug level"); +#endif + +#define byteof(x) ((x) >> 3) +#define bitof(x) (1L << ((x) & 0x7)) + +/* OpenBSD macros not present in FreeBSD USB headers */ +#define UE_GET_SIZE(x) ((x) & 0x7FF) +#define UE_GET_TRANS(x) (((x) >> 11) & 0x03) + +/* IO_NDELAY from sys/vnode.h - avoid pulling in vnode_if.h dependency */ +#ifndef IO_NDELAY +#define IO_NDELAY 0x0004 +#endif + +/* Forward declarations */ +struct uvideo_softc; + +static device_probe_t uvideo_probe; +static device_attach_t uvideo_attach; +static device_detach_t uvideo_detach; + +static usb_callback_t uvideo_isoc_callback; +static usb_callback_t uvideo_bulk_callback; + +static usb_error_t uvideo_vc_parse_desc(struct uvideo_softc *); +static usb_error_t uvideo_vc_parse_desc_header(struct uvideo_softc *, + const struct usb_descriptor *); +static usb_error_t uvideo_vc_parse_desc_pu(struct uvideo_softc *, + const struct usb_descriptor *); +static usb_error_t uvideo_vc_get_ctrl(struct uvideo_softc *, uint8_t *, + uint8_t, uint8_t, uint16_t, uint16_t); +static usb_error_t uvideo_vc_set_ctrl(struct uvideo_softc *, uint8_t *, + uint8_t, uint8_t, uint16_t, uint16_t); +static int uvideo_find_ctrl(struct uvideo_softc *, int); +static int uvideo_has_ctrl(struct usb_video_vc_processing_desc *, + int); + +static usb_error_t uvideo_vs_parse_desc(struct uvideo_softc *, + struct usb_config_descriptor *); +static usb_error_t uvideo_vs_parse_desc_input_header(struct uvideo_softc *, + const struct usb_descriptor *); +static usb_error_t uvideo_vs_parse_desc_format(struct uvideo_softc *); +static void uvideo_vs_parse_desc_colorformat(struct uvideo_softc *, + const struct usb_descriptor *); +static void uvideo_vs_parse_desc_format_frame_based( + struct uvideo_softc *, + const struct usb_descriptor *); +static void uvideo_vs_parse_desc_format_h264(struct uvideo_softc *, + const struct usb_descriptor *); +static void uvideo_vs_parse_desc_format_mjpeg(struct uvideo_softc *, + const struct usb_descriptor *); +static void uvideo_vs_parse_desc_format_uncompressed( + struct uvideo_softc *, + const struct usb_descriptor *); +static usb_error_t uvideo_vs_parse_desc_frame(struct uvideo_softc *); +static usb_error_t uvideo_vs_parse_desc_frame_buffer_size( + struct uvideo_softc *, + const struct usb_descriptor *); +static usb_error_t uvideo_vs_parse_desc_frame_max_rate( + struct uvideo_softc *, + const struct usb_descriptor *); +static usb_error_t uvideo_vs_parse_desc_alt(struct uvideo_softc *, int, + int, int); +static int uvideo_desc_len(const struct usb_descriptor *, int, + int, int, int); +static void uvideo_find_res(struct uvideo_softc *, int, int, int, + struct uvideo_res *); +static usb_error_t uvideo_vs_negotiation(struct uvideo_softc *, int); +static usb_error_t uvideo_vs_set_probe(struct uvideo_softc *, uint8_t *); +static usb_error_t uvideo_vs_get_probe(struct uvideo_softc *, uint8_t *, + uint8_t); +static usb_error_t uvideo_vs_set_commit(struct uvideo_softc *, uint8_t *); +static usb_error_t uvideo_vs_alloc_frame(struct uvideo_softc *); +static void uvideo_vs_free_frame(struct uvideo_softc *); +static usb_error_t uvideo_vs_open(struct uvideo_softc *); +static void uvideo_vs_close(struct uvideo_softc *); +static usb_error_t uvideo_vs_init(struct uvideo_softc *); +static void uvideo_vs_decode_stream_header(struct uvideo_softc *, + uint8_t *, int); +static void uvideo_isoc_decode(struct uvideo_softc *, + struct usb_page_cache *, int, int); +static uint8_t *uvideo_mmap_getbuf(struct uvideo_softc *); +static void uvideo_mmap_queue(struct uvideo_softc *, int, int); +static void uvideo_read_frame(struct uvideo_softc *, uint8_t *, int); + +static d_open_t uvideo_cdev_open; +static d_close_t uvideo_cdev_close; +static d_read_t uvideo_cdev_read; +static d_ioctl_t uvideo_cdev_ioctl; +static d_poll_t uvideo_cdev_poll; +static d_mmap_t uvideo_cdev_mmap; + +static int uvideo_querycap(struct uvideo_softc *, struct v4l2_capability *); +static int uvideo_enum_fmt(struct uvideo_softc *, struct v4l2_fmtdesc *); +static int uvideo_enum_fsizes(struct uvideo_softc *, + struct v4l2_frmsizeenum *); +static int uvideo_enum_fivals(struct uvideo_softc *, + struct v4l2_frmivalenum *); +static int uvideo_s_fmt(struct uvideo_softc *, struct v4l2_format *); +static int uvideo_g_fmt(struct uvideo_softc *, struct v4l2_format *); +static int uvideo_s_parm(struct uvideo_softc *, struct v4l2_streamparm *); +static int uvideo_g_parm(struct uvideo_softc *, struct v4l2_streamparm *); +static int uvideo_enum_input(struct uvideo_softc *, struct v4l2_input *); +static int uvideo_s_input(struct uvideo_softc *, int); +static int uvideo_g_input(struct uvideo_softc *, int *); +static int uvideo_reqbufs(struct uvideo_softc *, + struct v4l2_requestbuffers *); +static int uvideo_querybuf(struct uvideo_softc *, struct v4l2_buffer *); +static int uvideo_qbuf(struct uvideo_softc *, struct v4l2_buffer *); +static int uvideo_dqbuf(struct uvideo_softc *, struct v4l2_buffer *); +static int uvideo_streamon(struct uvideo_softc *, int); +static int uvideo_streamoff(struct uvideo_softc *, int); +static int uvideo_try_fmt(struct uvideo_softc *, struct v4l2_format *); +static int uvideo_queryctrl(struct uvideo_softc *, + struct v4l2_queryctrl *); +static int uvideo_g_ctrl(struct uvideo_softc *, struct v4l2_control *); +static int uvideo_s_ctrl(struct uvideo_softc *, struct v4l2_control *); + +/* + * Transfer configuration indices. + */ +enum { + UVIDEO_ISOC_RX_0, + UVIDEO_ISOC_RX_1, + UVIDEO_ISOC_RX_2, + UVIDEO_BULK_RX, + UVIDEO_N_XFER +}; + +/* + * The softc structure. + */ +struct uvideo_softc { + device_t sc_dev; + struct usb_device *sc_udev; + struct mtx sc_mtx; + struct cdev *sc_cdev; + int sc_unit; + + uint8_t sc_iface_index; + uint8_t sc_nifaces; + int sc_dying; + int sc_open; + uint32_t sc_priority; + struct proc *sc_owner; + + struct usb_xfer *sc_xfer[UVIDEO_N_XFER]; + int sc_streaming; + + int sc_max_ctrl_size; + int sc_max_fbuf_size; + int sc_negotiated_flag; + int sc_frame_rate; + + struct uvideo_frame_buffer sc_frame_buffer; + + struct uvideo_mmap sc_mmap[UVIDEO_MAX_BUFFERS]; + struct uvideo_mmap *sc_mmap_cur; + uint8_t *sc_mmap_buffer; + size_t sc_mmap_buffer_size; + int sc_mmap_buffer_idx; + q_mmap sc_mmap_q; + int sc_mmap_count; + int sc_mmap_flag; + + uint8_t *sc_tmpbuf; + int sc_tmpbuf_size; + + int sc_nframes; + struct usb_video_probe_commit sc_desc_probe; + struct usb_video_header_desc_all sc_desc_vc_header; + struct usb_video_input_header_desc_all sc_desc_vs_input_header; + +#define UVIDEO_MAX_PU 8 + int sc_desc_vc_pu_num; + struct usb_video_vc_processing_desc *sc_desc_vc_pu_cur; + struct usb_video_vc_processing_desc *sc_desc_vc_pu[UVIDEO_MAX_PU]; + +#define UVIDEO_MAX_FORMAT 8 + int sc_fmtgrp_idx; + int sc_fmtgrp_num; + struct uvideo_format_group *sc_fmtgrp_cur; + struct uvideo_format_group sc_fmtgrp[UVIDEO_MAX_FORMAT]; + +#define UVIDEO_MAX_VS_NUM 8 + struct uvideo_vs_iface *sc_vs_cur; + struct uvideo_vs_iface sc_vs_coll[UVIDEO_MAX_VS_NUM]; + + int sc_fsize; + uint8_t *sc_fbuffer; + size_t sc_fbufferlen; + int sc_vidmode; +#define VIDMODE_NONE 0 +#define VIDMODE_MMAP 1 +#define VIDMODE_READ 2 + int sc_frames_ready; + + struct selinfo sc_selinfo; + + void (*sc_decode_stream_header)( + struct uvideo_softc *, uint8_t *, int); +}; + +/* + * Processing Unit control descriptors + */ +static struct uvideo_controls uvideo_ctrls[] = { + { + V4L2_CID_BRIGHTNESS, + V4L2_CTRL_TYPE_INTEGER, + "Brightness", + 0, + PU_BRIGHTNESS_CONTROL, + 2, + 1 + }, + { + V4L2_CID_CONTRAST, + V4L2_CTRL_TYPE_INTEGER, + "Contrast", + 1, + PU_CONTRAST_CONTROL, + 2, + 0 + }, + { + V4L2_CID_HUE, + V4L2_CTRL_TYPE_INTEGER, + "Hue", + 2, + PU_HUE_CONTROL, + 2, + 1 + }, + { + V4L2_CID_SATURATION, + V4L2_CTRL_TYPE_INTEGER, + "Saturation", + 3, + PU_SATURATION_CONTROL, + 2, + 0 + }, + { + V4L2_CID_SHARPNESS, + V4L2_CTRL_TYPE_INTEGER, + "Sharpness", + 4, + PU_SHARPNESS_CONTROL, + 2, + 0 + }, + { + V4L2_CID_GAMMA, + V4L2_CTRL_TYPE_INTEGER, + "Gamma", + 5, + PU_GAMMA_CONTROL, + 2, + 0 + }, + { + V4L2_CID_WHITE_BALANCE_TEMPERATURE, + V4L2_CTRL_TYPE_INTEGER, + "White Balance Temperature", + 6, + PU_WHITE_BALANCE_TEMPERATURE_CONTROL, + 2, + 0 + }, + { + V4L2_CID_BACKLIGHT_COMPENSATION, + V4L2_CTRL_TYPE_INTEGER, + "Backlight Compensation", + 8, + PU_BACKLIGHT_COMPENSATION_CONTROL, + 2, + 0 + }, + { + V4L2_CID_GAIN, + V4L2_CTRL_TYPE_INTEGER, + "Gain", + 9, + PU_GAIN_CONTROL, + 2, + 0 + }, + { + V4L2_CID_POWER_LINE_FREQUENCY, + V4L2_CTRL_TYPE_MENU, + "Power Line Frequency", + 10, + PU_POWER_LINE_FREQUENCY_CONTROL, + 2, + 0 + }, + { + V4L2_CID_HUE_AUTO, + V4L2_CTRL_TYPE_BOOLEAN, + "Hue Auto", + 11, + PU_HUE_AUTO_CONTROL, + 1, + 0 + }, + { + V4L2_CID_AUTO_WHITE_BALANCE, + V4L2_CTRL_TYPE_BOOLEAN, + "White Balance Temperature Auto", + 12, + PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL, + 1, + 0 + }, + { + V4L2_CID_AUTO_WHITE_BALANCE, + V4L2_CTRL_TYPE_BOOLEAN, + "White Balance Component Auto", + 13, + PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL, + 1, + 0 + }, + { 0, 0, "", 0, 0, 0, 0 } +}; + +/* + * Format GUID to V4L2 pixel format mapping + */ +static const struct { + uint8_t guidFormat[16]; + uint32_t pixelformat; +} uvideo_map_fmts[] = { + { UVIDEO_FORMAT_GUID_YUY2, V4L2_PIX_FMT_YUYV }, + { UVIDEO_FORMAT_GUID_YV12, V4L2_PIX_FMT_YVU420 }, + { UVIDEO_FORMAT_GUID_I420, V4L2_PIX_FMT_YUV420 }, + { UVIDEO_FORMAT_GUID_Y800, V4L2_PIX_FMT_GREY }, + { UVIDEO_FORMAT_GUID_Y8, V4L2_PIX_FMT_GREY }, + { UVIDEO_FORMAT_GUID_D3DFMT_L8, V4L2_PIX_FMT_GREY }, + { UVIDEO_FORMAT_GUID_KSMEDIA_L8_IR, V4L2_PIX_FMT_GREY }, + { UVIDEO_FORMAT_GUID_BY8, V4L2_PIX_FMT_SBGGR8 }, + { UVIDEO_FORMAT_GUID_BA81, V4L2_PIX_FMT_SBGGR8 }, + { UVIDEO_FORMAT_GUID_GBRG, V4L2_PIX_FMT_SGBRG8 }, + { UVIDEO_FORMAT_GUID_GRBG, V4L2_PIX_FMT_SGRBG8 }, + { UVIDEO_FORMAT_GUID_RGGB, V4L2_PIX_FMT_SRGGB8 }, + { UVIDEO_FORMAT_GUID_RGBP, V4L2_PIX_FMT_RGB565 }, + { UVIDEO_FORMAT_GUID_D3DFMT_R5G6B5, V4L2_PIX_FMT_RGB565 }, + { UVIDEO_FORMAT_GUID_BGR3, V4L2_PIX_FMT_BGR24 }, + { UVIDEO_FORMAT_GUID_BGR4, V4L2_PIX_FMT_XBGR32 }, + { UVIDEO_FORMAT_GUID_H265, V4L2_PIX_FMT_HEVC }, + { UVIDEO_FORMAT_GUID_RW10, V4L2_PIX_FMT_SRGGB10P }, + { UVIDEO_FORMAT_GUID_BG16, V4L2_PIX_FMT_SBGGR16 }, + { UVIDEO_FORMAT_GUID_GB16, V4L2_PIX_FMT_SGBRG16 }, + { UVIDEO_FORMAT_GUID_RG16, V4L2_PIX_FMT_SRGGB16 }, + { UVIDEO_FORMAT_GUID_GR16, V4L2_PIX_FMT_SGRBG16 }, + { UVIDEO_FORMAT_GUID_INVZ, V4L2_PIX_FMT_Z16 }, + { UVIDEO_FORMAT_GUID_INVI, V4L2_PIX_FMT_Y10 }, +}; + +/* + * Color matching tables from UVC spec + */ +static const enum v4l2_colorspace uvideo_color_primaries[] = { + V4L2_COLORSPACE_SRGB, /* Unspecified */ + V4L2_COLORSPACE_SRGB, + V4L2_COLORSPACE_470_SYSTEM_M, + V4L2_COLORSPACE_470_SYSTEM_BG, + V4L2_COLORSPACE_SMPTE170M, + V4L2_COLORSPACE_SMPTE240M, +}; + +static const enum v4l2_xfer_func uvideo_xfer_characteristics[] = { + V4L2_XFER_FUNC_DEFAULT, /* Unspecified */ + V4L2_XFER_FUNC_709, + V4L2_XFER_FUNC_709, /* Substitution for BT.470-2 M */ + V4L2_XFER_FUNC_709, /* Substitution for BT.470-2 B, G */ + V4L2_XFER_FUNC_709, /* Substitution for SMPTE 170M */ + V4L2_XFER_FUNC_SMPTE240M, + V4L2_XFER_FUNC_NONE, + V4L2_XFER_FUNC_SRGB, +}; + +static const enum v4l2_ycbcr_encoding uvideo_matrix_coefficients[] = { + V4L2_YCBCR_ENC_DEFAULT, /* Unspecified */ + V4L2_YCBCR_ENC_709, + V4L2_YCBCR_ENC_601, /* Substitution for FCC */ + V4L2_YCBCR_ENC_601, /* Substitution for BT.470-2 B, G */ + V4L2_YCBCR_ENC_601, + V4L2_YCBCR_ENC_SMPTE240M, +}; + +/* + * USB device ID table - match standard UVC devices + */ +static const STRUCT_USB_HOST_ID uvideo_devs[] = { + {USB_IFACE_CLASS(UICLASS_VIDEO), + USB_IFACE_SUBCLASS(UISUBCLASS_VIDEOCONTROL),}, +}; + +/* + * Device methods + */ +static device_method_t uvideo_methods[] = { + DEVMETHOD(device_probe, uvideo_probe), + DEVMETHOD(device_attach, uvideo_attach), + DEVMETHOD(device_detach, uvideo_detach), + DEVMETHOD_END +}; + +static driver_t uvideo_driver = { + .name = "uvideo", + .methods = uvideo_methods, + .size = sizeof(struct uvideo_softc), +}; + +DRIVER_MODULE(uvideo, uhub, uvideo_driver, NULL, NULL); +MODULE_DEPEND(uvideo, usb, 1, 1, 1); +MODULE_VERSION(uvideo, 1); +USB_PNP_HOST_INFO(uvideo_devs); + +/* + * Transfer configuration: triple-buffered isochronous + single bulk + */ +static const struct usb_config uvideo_isoc_config[UVIDEO_IXFERS] = { + [0] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = 0, /* use wMaxPacketSize * frames */ + .frames = UVIDEO_NFRAMES_MAX, + .flags = {.short_xfer_ok = 1, .short_frames_ok = 1,}, + .callback = &uvideo_isoc_callback, + }, + [1] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = 0, + .frames = UVIDEO_NFRAMES_MAX, + .flags = {.short_xfer_ok = 1, .short_frames_ok = 1,}, + .callback = &uvideo_isoc_callback, + }, + [2] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = 0, + .frames = UVIDEO_NFRAMES_MAX, + .flags = {.short_xfer_ok = 1, .short_frames_ok = 1,}, + .callback = &uvideo_isoc_callback, + }, +}; + +static const struct usb_config uvideo_bulk_config[1] = { + [0] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = 65536, + .flags = {.short_xfer_ok = 1, .pipe_bof = 1,}, + .callback = &uvideo_bulk_callback, + }, +}; + +/* + * Character device switch + */ +static struct cdevsw uvideo_cdevsw = { + .d_version = D_VERSION, + .d_open = uvideo_cdev_open, + .d_close = uvideo_cdev_close, + .d_read = uvideo_cdev_read, + .d_ioctl = uvideo_cdev_ioctl, + .d_poll = uvideo_cdev_poll, + .d_mmap = uvideo_cdev_mmap, + .d_name = "video", +}; + +/* + * Unit number allocator + */ +/* Unit number allocation is handled by scanning for free /dev/videoN names */ + +/* ---------------------------------------------------------------- */ +/* Probe / Attach / Detach */ +/* ---------------------------------------------------------------- */ + +static int +uvideo_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + + if (uaa->info.bInterfaceClass != UICLASS_VIDEO) + return (ENXIO); + + if (uaa->info.bInterfaceSubClass != UISUBCLASS_VIDEOCONTROL) + return (ENXIO); + + return (usbd_lookup_id_by_uaa(uvideo_devs, sizeof(uvideo_devs), uaa)); +} + +static int +uvideo_attach(device_t dev) +{ + struct uvideo_softc *sc = device_get_softc(dev); + struct usb_attach_arg *uaa = device_get_ivars(dev); + struct usb_config_descriptor *cdesc; + struct usb_descriptor *desc; + struct usb_interface_assoc_descriptor *iad; + struct make_dev_args args; + usb_error_t error; + int first_iface, nifaces; + int i; + + sc->sc_dev = dev; + sc->sc_udev = uaa->device; + sc->sc_iface_index = uaa->info.bIfaceIndex; + + device_set_usb_desc(dev); + mtx_init(&sc->sc_mtx, "uvideo", NULL, MTX_DEF); + knlist_init_mtx(&sc->sc_selinfo.si_note, &sc->sc_mtx); + + /* Get the config descriptor to iterate */ + cdesc = usbd_get_config_descriptor(sc->sc_udev); + if (cdesc == NULL) { + device_printf(dev, "failed to get config descriptor\n"); + goto detach; + } + + /* + * Find the Interface Association Descriptor (IAD) that groups + * the video control and video streaming interfaces. + */ + iad = NULL; + desc = NULL; + while ((desc = usb_desc_foreach(cdesc, desc)) != NULL) { + if (desc->bDescriptorType != UDESC_IFACE_ASSOC) + continue; + iad = (struct usb_interface_assoc_descriptor *)desc; + if (uaa->info.bIfaceIndex >= iad->bFirstInterface && + uaa->info.bIfaceIndex < + iad->bFirstInterface + iad->bInterfaceCount) + break; + iad = NULL; + } + if (iad == NULL) { + device_printf(dev, "can't find interface association\n"); + goto detach; + } + + first_iface = iad->bFirstInterface; + nifaces = iad->bInterfaceCount; + + /* Claim all interfaces in this association */ + for (i = first_iface; i < first_iface + nifaces; i++) { + if (i == uaa->info.bIfaceIndex) + continue; + usbd_set_parent_iface(sc->sc_udev, i, uaa->info.bIfaceIndex); + } + + sc->sc_iface_index = first_iface; + sc->sc_nifaces = nifaces; + + /* Standard UVC stream header decode */ + sc->sc_decode_stream_header = uvideo_vs_decode_stream_header; + + /* Parse video control descriptors */ + error = uvideo_vc_parse_desc(sc); + if (error != USB_ERR_NORMAL_COMPLETION) { + device_printf(dev, "failed to parse VC descriptors\n"); + goto detach; + } + + /* Parse video stream descriptors */ + error = uvideo_vs_parse_desc(sc, cdesc); + if (error != USB_ERR_NORMAL_COMPLETION) { + device_printf(dev, "failed to parse VS descriptors\n"); + goto detach; + } + + /* Set default video stream interface to alt 0 */ + if (sc->sc_vs_cur != NULL) { + error = usbd_set_alt_interface_index(sc->sc_udev, + sc->sc_vs_cur->iface_index, 0); + if (error != USB_ERR_NORMAL_COMPLETION) { + device_printf(dev, + "failed to set default alt interface\n"); + goto detach; + } + } + + /* Do device negotiation without commit */ + error = uvideo_vs_negotiation(sc, 0); + if (error != USB_ERR_NORMAL_COMPLETION) { + device_printf(dev, "initial negotiation failed\n"); + goto detach; + } + + /* Report what we found */ + if (sc->sc_vs_cur != NULL) { + device_printf(dev, "%d format(s), iface_index=%d, " + "endpoint=0x%02x, psize=%u, %s\n", + sc->sc_fmtgrp_num, + sc->sc_vs_cur->iface_index, + sc->sc_vs_cur->endpoint, + sc->sc_vs_cur->psize, + sc->sc_vs_cur->bulk_endpoint ? "bulk" : "isoc"); + if (sc->sc_fmtgrp_cur != NULL) { + struct usb_video_frame_desc *fr = + sc->sc_fmtgrp_cur->frame_cur; + device_printf(dev, "default format: pixfmt=0x%08x, " + "%dx%d, max_fbuf=%d\n", + sc->sc_fmtgrp_cur->pixelformat, + fr ? UGETW(UVIDEO_FRAME_FIELD(fr, wWidth)) : 0, + fr ? UGETW(UVIDEO_FRAME_FIELD(fr, wHeight)) : 0, + sc->sc_max_fbuf_size); + } + } + + /* Init mmap queue */ + STAILQ_INIT(&sc->sc_mmap_q); + sc->sc_mmap_count = 0; + + /* Allocate unit number and create character device */ + make_dev_args_init(&args); + args.mda_devsw = &uvideo_cdevsw; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_VIDEO; + args.mda_mode = 0660; + args.mda_si_drv1 = sc; + args.mda_flags = MAKEDEV_CHECKNAME; + + sc->sc_unit = -1; + for (i = 0; i < 256; i++) { + if (make_dev_s(&args, &sc->sc_cdev, "video%d", i) == 0) { + sc->sc_unit = i; + break; + } + } + if (sc->sc_unit < 0) { + device_printf(dev, "failed to create /dev/video device\n"); + goto detach; + } + + device_printf(dev, "UVC camera on /dev/video%d\n", sc->sc_unit); + + return (0); + +detach: + uvideo_detach(dev); + return (ENXIO); +} + +static int +uvideo_detach(device_t dev) +{ + struct uvideo_softc *sc = device_get_softc(dev); + + sc->sc_dying = 1; + + /* Stop any active streaming */ + if (sc->sc_streaming) { + mtx_lock(&sc->sc_mtx); + sc->sc_streaming = 0; + mtx_unlock(&sc->sc_mtx); + uvideo_vs_close(sc); + } + + /* Destroy character device */ + if (sc->sc_cdev != NULL) { + destroy_dev(sc->sc_cdev); + sc->sc_cdev = NULL; + } + + /* Unit number is implicitly freed when the cdev is destroyed */ + + /* Free frame buffers */ + uvideo_vs_free_frame(sc); + + /* Unsetup USB transfers */ + usbd_transfer_unsetup(sc->sc_xfer, UVIDEO_N_XFER); + + seldrain(&sc->sc_selinfo); + knlist_destroy(&sc->sc_selinfo.si_note); + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +/* ---------------------------------------------------------------- */ +/* Descriptor Parsing */ +/* ---------------------------------------------------------------- */ + +static usb_error_t +uvideo_vc_parse_desc(struct uvideo_softc *sc) +{ + struct usb_config_descriptor *cdesc; + struct usb_descriptor *desc; + struct usb_interface_descriptor *id; + int vc_header_found; + usb_error_t error; + int past_our_iface; + + DPRINTFN(1, "uvideo_vc_parse_desc\n"); + + vc_header_found = 0; + past_our_iface = 0; + + cdesc = usbd_get_config_descriptor(sc->sc_udev); + if (cdesc == NULL) + return (USB_ERR_INVAL); + + desc = NULL; + while ((desc = usb_desc_foreach(cdesc, desc)) != NULL) { + /* Look for our VC interface */ + if (desc->bDescriptorType == UDESC_INTERFACE) { + id = (struct usb_interface_descriptor *)desc; + if (id->bInterfaceNumber == sc->sc_iface_index) { + past_our_iface = 1; + continue; + } else if (past_our_iface && + id->bInterfaceNumber != sc->sc_iface_index) { + /* + * We have left our VC interface; + * stop if we hit a new IAD or unrelated iface. + */ + } + } + if (desc->bDescriptorType == UDESC_IFACE_ASSOC && + past_our_iface) + break; + + if (!past_our_iface) + continue; + + if (desc->bDescriptorType != UDESC_CS_INTERFACE) + continue; + + switch (desc->bDescriptorSubtype) { + case UDESCSUB_VC_HEADER: + if (!uvideo_desc_len(desc, 12, 11, 1, 0)) + break; + if (vc_header_found) { + device_printf(sc->sc_dev, + "too many VC_HEADERs!\n"); + return (USB_ERR_INVAL); + } + error = uvideo_vc_parse_desc_header(sc, desc); + if (error != USB_ERR_NORMAL_COMPLETION) + return (error); + vc_header_found = 1; + break; + case UDESCSUB_VC_PROCESSING_UNIT: + (void)uvideo_vc_parse_desc_pu(sc, desc); + break; + } + } + + if (vc_header_found == 0) { + device_printf(sc->sc_dev, "no VC_HEADER found!\n"); + return (USB_ERR_INVAL); + } + + return (USB_ERR_NORMAL_COMPLETION); +} + +static usb_error_t +uvideo_vc_parse_desc_header(struct uvideo_softc *sc, + const struct usb_descriptor *desc) +{ + struct usb_video_header_desc *d; + + d = __DECONST(struct usb_video_header_desc *, desc); + + if (d->bInCollection == 0) { + device_printf(sc->sc_dev, "no VS interface found!\n"); + return (USB_ERR_INVAL); + } + + sc->sc_desc_vc_header.fix = d; + sc->sc_desc_vc_header.baInterfaceNr = (uByte *)(d + 1); + if (UGETW(d->bcdUVC) < 0x0110) + sc->sc_max_ctrl_size = 26; + else if (UGETW(d->bcdUVC) < 0x0150) + sc->sc_max_ctrl_size = 34; + else + sc->sc_max_ctrl_size = 48; + + return (USB_ERR_NORMAL_COMPLETION); +} + +static usb_error_t +uvideo_vc_parse_desc_pu(struct uvideo_softc *sc, + const struct usb_descriptor *desc) +{ + struct usb_video_vc_processing_desc *d; + + d = __DECONST(struct usb_video_vc_processing_desc *, desc); + + if (sc->sc_desc_vc_pu_num == UVIDEO_MAX_PU) { + device_printf(sc->sc_dev, + "too many PU descriptors found!\n"); + return (USB_ERR_INVAL); + } + + sc->sc_desc_vc_pu[sc->sc_desc_vc_pu_num] = d; + sc->sc_desc_vc_pu_num++; + + return (USB_ERR_NORMAL_COMPLETION); +} + +static usb_error_t +uvideo_vc_get_ctrl(struct uvideo_softc *sc, uint8_t *ctrl_data, + uint8_t request, uint8_t unitid, uint16_t ctrl_selector, uint16_t ctrl_len) +{ + struct usb_device_request req; + usb_error_t error; + + req.bmRequestType = UVIDEO_GET_IF; + req.bRequest = request; + USETW(req.wValue, (ctrl_selector << 8)); + USETW(req.wIndex, (unitid << 8)); + USETW(req.wLength, ctrl_len); + + error = usbd_do_request(sc->sc_udev, NULL, &req, ctrl_data); + if (error) { + DPRINTFN(1, "could not GET ctrl: %s\n", + usbd_errstr(error)); + return (USB_ERR_INVAL); + } + + return (USB_ERR_NORMAL_COMPLETION); +} + +static usb_error_t +uvideo_vc_set_ctrl(struct uvideo_softc *sc, uint8_t *ctrl_data, + uint8_t request, uint8_t unitid, uint16_t ctrl_selector, uint16_t ctrl_len) +{ + struct usb_device_request req; + usb_error_t error; + + req.bmRequestType = UVIDEO_SET_IF; + req.bRequest = request; + USETW(req.wValue, (ctrl_selector << 8)); + USETW(req.wIndex, (unitid << 8)); + USETW(req.wLength, ctrl_len); *** 3786 LINES SKIPPED *** From nobody Tue Jun 16 11:23:03 2026 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 4gfl3C3d9Pz6hSsJ for ; Tue, 16 Jun 2026 11:23:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfl3C2JLKz3MR5 for ; Tue, 16 Jun 2026 11:23:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781608983; 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=OVibnSOpE7Y2RAfJGNAIyX6vmwHAVBgBmtFk4YkVmig=; b=LSPrM/iF8KuIotKrUAae7L9YucYVdeh4iSnYHjnZ19QxZFjQZcJd8RMYbOlyB5MIgpwtR4 sxdVqfjKC07HGuk9GWdSNoQrRfgLqvEywpTM04PfBPfs84kqbI8XZxik0uxdYX3Yjk1OgK wXZhH5aZ/SBLCUbgoI+HxSjK2uZhb3x7l5dcthCQK+Ft73G+TcJ+x9ziWmrSRgd0pXn1T1 NFlIfzbyPtSNN5iFDd38xTEFFDKoJdw2iB0u7utCAXJ75ulVIgP0tRQDLTTpt4sbaHTbUB NU1D60sHdtVoLrxlf7HwD1wgPsQbZZ5LfhzdkBCpMV05NUp/XgyVd03iI9QS5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781608983; a=rsa-sha256; cv=none; b=NfworEgC0rHRqM0JAhyCEkLLPah0bZoqnmbx5mGoifmcGN9lk6yM7l6QPwZx+59m02tOuH /hjQczS0bjnBySqCVDdkHVdMSyPLiMLLwPZ/oWUFeRRkxjwVUKM8DTT1nE8STuH4uNGKPy Zbk33cUmx14M5stt9+ftNJ8fNHKMG4x+bHq8Ce8esQaQn1ufaPnrVvIDZw4WTkYr7iHoTi f6lt6dQruhu12ax/iyaL0VGxDJ/tOSsc/YzaIV0t+GXd0xmtKIfoyEq9/BD/Q/IJr6t+uH 66lJxlwJ8Ip1HSWn5E1PRdoP5UhX89PY8yDKRPp0lcbePm+ia/TookAIpSNwhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781608983; 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=OVibnSOpE7Y2RAfJGNAIyX6vmwHAVBgBmtFk4YkVmig=; b=FL6nqJnxxhdY2Wml+D82YzpKoSIwuEhkvyG1UVyfefy7fD1/UC/StGwQpOM5LQbg+a+JTk 60pl8B/k0gSADNliSZCS6hvpnv5jQhgsE7aJe0LObThOQrhlcv/fW3KuK2S7HUFeaWigRQ FJ0pRQm3f1J7wdIUutiJmrY0kFhfB6ssQNan6xofZwE26dC26WIF+htB3cBEs5zbtVGYM4 xVz3af9mhA04ptOSAbaf1JSXSve/AT46ct8KFylLk5KQY3DSU00DeULjg9lEg0+McfYyg4 52Rs6MfEIT/mr8UTUpZWHjf9lwSd8dQDtQCx84v9iB438eUKFCbAum0oICsVCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfl3C1pQVz7Z8 for ; Tue, 16 Jun 2026 11:23:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1e99f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 11:23:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 54df18cbb400 - main - uvideo: add kqueue 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 54df18cbb400e6394edad8abab0e5cb3a97e4df3 Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 11:23:03 +0000 Message-Id: <6a313217.1e99f.3d1c1d4@gitrepo.freebsd.org> The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=54df18cbb400e6394edad8abab0e5cb3a97e4df3 commit 54df18cbb400e6394edad8abab0e5cb3a97e4df3 Author: Baptiste Daroussin AuthorDate: 2026-05-06 16:22:07 +0000 Commit: Baptiste Daroussin CommitDate: 2026-06-16 11:20:57 +0000 uvideo: add kqueue support Add EVFILT_READ kqueue filter so applications using kqueue/kevent can efficiently wait for video frames instead of polling. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D56961 --- sys/dev/usb/video/uvideo.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/sys/dev/usb/video/uvideo.c b/sys/dev/usb/video/uvideo.c index 310c66db2846..a33b3ac31ea6 100644 --- a/sys/dev/usb/video/uvideo.c +++ b/sys/dev/usb/video/uvideo.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -155,6 +156,7 @@ static d_close_t uvideo_cdev_close; static d_read_t uvideo_cdev_read; static d_ioctl_t uvideo_cdev_ioctl; static d_poll_t uvideo_cdev_poll; +static d_kqfilter_t uvideo_cdev_kqfilter; static d_mmap_t uvideo_cdev_mmap; static int uvideo_querycap(struct uvideo_softc *, struct v4l2_capability *); @@ -540,6 +542,7 @@ static struct cdevsw uvideo_cdevsw = { .d_read = uvideo_cdev_read, .d_ioctl = uvideo_cdev_ioctl, .d_poll = uvideo_cdev_poll, + .d_kqfilter = uvideo_cdev_kqfilter, .d_mmap = uvideo_cdev_mmap, .d_name = "video", }; @@ -2433,6 +2436,7 @@ uvideo_mmap_queue(struct uvideo_softc *sc, int len, int err) wakeup(sc); selwakeup(&sc->sc_selinfo); + KNOTE_LOCKED(&sc->sc_selinfo.si_note, 0); } static void @@ -2453,6 +2457,7 @@ uvideo_read_frame(struct uvideo_softc *sc, uint8_t *buf, int len) wakeup(sc); selwakeup(&sc->sc_selinfo); + KNOTE_LOCKED(&sc->sc_selinfo.si_note, 0); } /* ---------------------------------------------------------------- */ @@ -2690,6 +2695,49 @@ uvideo_cdev_poll(struct cdev *dev, int events, struct thread *td) return (revents); } +static void +uvideo_kqfilter_detach(struct knote *kn) +{ + struct uvideo_softc *sc = kn->kn_hook; + + knlist_remove(&sc->sc_selinfo.si_note, kn, 0); +} + +static int +uvideo_kqfilter_read(struct knote *kn, long hint __unused) +{ + struct uvideo_softc *sc = kn->kn_hook; + + if (sc->sc_mmap_flag) + return (!STAILQ_EMPTY(&sc->sc_mmap_q)); + return (sc->sc_frames_ready > 0); +} + +static struct filterops uvideo_filtops_read = { + .f_isfd = 1, + .f_detach = uvideo_kqfilter_detach, + .f_event = uvideo_kqfilter_read, +}; + +static int +uvideo_cdev_kqfilter(struct cdev *dev, struct knote *kn) +{ + struct uvideo_softc *sc = dev->si_drv1; + + if (sc == NULL || sc->sc_dying) + return (ENXIO); + + switch (kn->kn_filter) { + case EVFILT_READ: + kn->kn_fop = &uvideo_filtops_read; + kn->kn_hook = sc; + knlist_add(&sc->sc_selinfo.si_note, kn, 0); + return (0); + default: + return (EINVAL); + } +} + static int uvideo_cdev_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr) From nobody Tue Jun 16 11:23:04 2026 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 4gfl3D4drSz6hSsM for ; Tue, 16 Jun 2026 11:23: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfl3D2gxwz3MJb for ; Tue, 16 Jun 2026 11:23:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781608984; 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=daRk4e6YK/9oDX95ULpU0dOAQAr7lpxzOg7oXB3nFfs=; b=haoV5+nCm+lWjOqtliPjE7qUwlPthrt73t0Q5TI+E9dB6zLvcpzPldvsCxOsu8zDpnp1+r bg5chPoUvdzyQOXBBthzktqMrh9fHrp267Urva5kUtobNaZgONHaUyiMz79rtbVg3RphXI YUt85UZrOv/9z02t+Yt6mn70sh5yIn1TDNXztKAN31BvCd1sW3bgyD/0QXh0XupxH55Ysr j3FQWe6F7KcbU/nK39/Qf+EaiqBebfuFfiO9KQn9wUCq7bC0MJ55X7FUYh5S+r+nPN4r9a p45AjjQAsT2MR7Je0CfXtmVaFBAiVEq8fP0FODiJxyBscAAF4Xxz+WfUPmebJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781608984; a=rsa-sha256; cv=none; b=O8AjApO0I3UzA6TX/OcOxLIZPMNgSs9uik8sdTf2d5vgjfShedKx26Xc++d0mwGtO6pB+i NV6VOCc/H0mXWXzgQJB3VadN5w3OXTZXSZB7eNtAeQ/co5YZ0iXLS/G64rNB4nfIe6goUN 29bz2cwyAXLZgUbK+S3bmqHVWUZHvLuvULZX1YPKYK7FXEzXF3RVzXuFhdPNveQXaRcJK6 Ig/8wwtcmoXP44GTnN+BR8dMEQKPY4/YQ96BhBuIfH91mTq4Ej6GRnmyjf6bs2Kywqdqhu OmBdw85aRPvLNdM1Ovi1pkYAqOiErgNqB9BdJ5rtRFtrgIQeQPpmi2KZtxX+oQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781608984; 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=daRk4e6YK/9oDX95ULpU0dOAQAr7lpxzOg7oXB3nFfs=; b=gjCFMLLAF3g3hNQFRpP+V67VI5sf8GoqWG0xpBIcAJGrPXvEyLz9tcV/j+QyU7EGzdiwbr qhmrsjbRtOyTrBNtkL2/ojfyc5dAimjZpSlXiWkTJSFdzPYsL0hGOKKaQM73uqPqL3jzNn pi6ZnEy4LEGWSFWCdsZbvl0omwmHs5KpcwrFGD/zx57Miq/4zZoMDBQ6hOnAuilZYlRO+h Vre/DJWbDReXhrUrPuz4JAqkK0djcP5+29256Zu5HGoYXOMegnEKuwKZwCdtoX7QJHX8LD WHbUUlNPEDLBKPcuMBQd+LmBnW0QX/PX3bXkiAQdLMzKosRDeAi1up/K1HfwLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfl3D2DVzz821 for ; Tue, 16 Jun 2026 11:23:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1e0cd by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 11:23:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: d0450cbec7e6 - main - uvideo: add Camera Terminal controls 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: d0450cbec7e66ee56fd48c6482fd3bd9fb6549dc Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 11:23:04 +0000 Message-Id: <6a313218.1e0cd.1a843b45@gitrepo.freebsd.org> The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=d0450cbec7e66ee56fd48c6482fd3bd9fb6549dc commit d0450cbec7e66ee56fd48c6482fd3bd9fb6549dc Author: Baptiste Daroussin AuthorDate: 2026-05-06 16:28:27 +0000 Commit: Baptiste Daroussin CommitDate: 2026-06-16 11:21:01 +0000 uvideo: add Camera Terminal controls Implement UVC Camera Terminal (CT) controls per UVC 1.5 specification Table A-12. This adds support for camera-specific controls that are separate from the Processing Unit controls already supported. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D56962 --- sys/dev/usb/video/uvideo.c | 210 +++++++++++++++++++++++++++++++++++++--- sys/dev/usb/video/uvideo.h | 2 +- sys/dev/usb/video/uvideo_v4l2.h | 13 +++ 3 files changed, 211 insertions(+), 14 deletions(-) diff --git a/sys/dev/usb/video/uvideo.c b/sys/dev/usb/video/uvideo.c index a33b3ac31ea6..52998fbc9b40 100644 --- a/sys/dev/usb/video/uvideo.c +++ b/sys/dev/usb/video/uvideo.c @@ -95,6 +95,10 @@ static usb_error_t uvideo_vc_parse_desc_header(struct uvideo_softc *, const struct usb_descriptor *); static usb_error_t uvideo_vc_parse_desc_pu(struct uvideo_softc *, const struct usb_descriptor *); +static usb_error_t uvideo_vc_parse_desc_ct(struct uvideo_softc *, + const struct usb_descriptor *); +static int uvideo_has_ct_ctrl( + struct usb_video_camera_terminal_desc *, int); static usb_error_t uvideo_vc_get_ctrl(struct uvideo_softc *, uint8_t *, uint8_t, uint8_t, uint16_t, uint16_t); static usb_error_t uvideo_vc_set_ctrl(struct uvideo_softc *, uint8_t *, @@ -245,6 +249,11 @@ struct uvideo_softc { struct usb_video_vc_processing_desc *sc_desc_vc_pu_cur; struct usb_video_vc_processing_desc *sc_desc_vc_pu[UVIDEO_MAX_PU]; +#define UVIDEO_MAX_CT 8 + int sc_desc_vc_ct_num; + struct usb_video_camera_terminal_desc *sc_desc_vc_ct_cur; + struct usb_video_camera_terminal_desc *sc_desc_vc_ct[UVIDEO_MAX_CT]; + #define UVIDEO_MAX_FORMAT 8 int sc_fmtgrp_idx; int sc_fmtgrp_num; @@ -391,6 +400,88 @@ static struct uvideo_controls uvideo_ctrls[] = { 1, 0 }, + /* Camera Terminal Controls (UVC 1.5 spec Table A-12) */ + { + V4L2_CID_EXPOSURE_AUTO, + V4L2_CTRL_TYPE_MENU, + "Exposure, Auto", + 1, + CT_AE_MODE_CONTROL, + 1, + 0 + }, + { + V4L2_CID_EXPOSURE_AUTO_PRIORITY, + V4L2_CTRL_TYPE_BOOLEAN, + "Exposure, Auto Priority", + 2, + CT_AE_PRIORITY_CONTROL, + 1, + 0 + }, + { + V4L2_CID_EXPOSURE_ABSOLUTE, + V4L2_CTRL_TYPE_INTEGER, + "Exposure (Absolute)", + 3, + CT_EXPOSURE_TIME_ABSOLUTE_CONTROL, + 4, + 0 + }, + { + V4L2_CID_FOCUS_ABSOLUTE, + V4L2_CTRL_TYPE_INTEGER, + "Focus (Absolute)", + 5, + CT_FOCUS_ABSOLUTE_CONTROL, + 2, + 0 + }, + { + V4L2_CID_FOCUS_AUTO, + V4L2_CTRL_TYPE_BOOLEAN, + "Focus, Auto", + 17, + CT_FOCUS_AUTO_CONTROL, + 1, + 0 + }, + { + V4L2_CID_ZOOM_ABSOLUTE, + V4L2_CTRL_TYPE_INTEGER, + "Zoom (Absolute)", + 9, + CT_ZOOM_ABSOLUTE_CONTROL, + 2, + 0 + }, + { + V4L2_CID_PAN_ABSOLUTE, + V4L2_CTRL_TYPE_INTEGER, + "Pan (Absolute)", + 11, + CT_PANTILT_ABSOLUTE_CONTROL, + 4, + 1 + }, + { + V4L2_CID_TILT_ABSOLUTE, + V4L2_CTRL_TYPE_INTEGER, + "Tilt (Absolute)", + 11, + CT_PANTILT_ABSOLUTE_CONTROL, + 4, + 1 + }, + { + V4L2_CID_PRIVACY, + V4L2_CTRL_TYPE_BOOLEAN, + "Privacy", + 18, + CT_PRIVACY_CONTROL, + 1, + 0 + }, { 0, 0, "", 0, 0, 0, 0 } }; @@ -824,6 +915,14 @@ uvideo_vc_parse_desc(struct uvideo_softc *sc) return (error); vc_header_found = 1; break; + case UDESCSUB_VC_INPUT_TERMINAL: + { + struct usb_video_input_terminal_desc *itd; + itd = (struct usb_video_input_terminal_desc *)desc; + if (UGETW(itd->wTerminalType) == ITT_CAMERA) + (void)uvideo_vc_parse_desc_ct(sc, desc); + break; + } case UDESCSUB_VC_PROCESSING_UNIT: (void)uvideo_vc_parse_desc_pu(sc, desc); break; @@ -883,6 +982,25 @@ uvideo_vc_parse_desc_pu(struct uvideo_softc *sc, return (USB_ERR_NORMAL_COMPLETION); } +static usb_error_t +uvideo_vc_parse_desc_ct(struct uvideo_softc *sc, + const struct usb_descriptor *desc) +{ + struct usb_video_camera_terminal_desc *d; + + d = __DECONST(struct usb_video_camera_terminal_desc *, desc); + + if (sc->sc_desc_vc_ct_num == UVIDEO_MAX_CT) { + device_printf(sc->sc_dev, "too many CT descriptors\n"); + return (USB_ERR_INVAL); + } + + sc->sc_desc_vc_ct[sc->sc_desc_vc_ct_num] = d; + sc->sc_desc_vc_ct_num++; + + return (USB_ERR_NORMAL_COMPLETION); +} + static usb_error_t uvideo_vc_get_ctrl(struct uvideo_softc *sc, uint8_t *ctrl_data, uint8_t request, uint8_t unitid, uint16_t ctrl_selector, uint16_t ctrl_len) @@ -934,8 +1052,8 @@ uvideo_find_ctrl(struct uvideo_softc *sc, int id) { int i, j, found; - if (sc->sc_desc_vc_pu_num == 0) { - DPRINTFN(1, "no processing unit descriptors found!\n"); + if (sc->sc_desc_vc_pu_num == 0 && sc->sc_desc_vc_ct_num == 0) { + DPRINTFN(1, "no PU or CT descriptors found!\n"); return (EINVAL); } @@ -951,19 +1069,34 @@ uvideo_find_ctrl(struct uvideo_softc *sc, int id) return (EINVAL); } - /* does the device support this control? */ + /* does a PU support this control? */ + sc->sc_desc_vc_pu_cur = NULL; + sc->sc_desc_vc_ct_cur = NULL; for (found = 0, j = 0; j < sc->sc_desc_vc_pu_num; j++) { if (uvideo_has_ctrl(sc->sc_desc_vc_pu[j], uvideo_ctrls[i].ctrl_bit) != 0) { found = 1; + sc->sc_desc_vc_pu_cur = sc->sc_desc_vc_pu[j]; break; } } + + /* does a CT support this control? */ + if (found == 0) { + for (j = 0; j < sc->sc_desc_vc_ct_num; j++) { + if (uvideo_has_ct_ctrl(sc->sc_desc_vc_ct[j], + uvideo_ctrls[i].ctrl_bit) != 0) { + found = 1; + sc->sc_desc_vc_ct_cur = sc->sc_desc_vc_ct[j]; + break; + } + } + } + if (found == 0) { DPRINTFN(1, "control not supported by device!\n"); return (EINVAL); } - sc->sc_desc_vc_pu_cur = sc->sc_desc_vc_pu[j]; return (i); } @@ -978,6 +1111,16 @@ uvideo_has_ctrl(struct usb_video_vc_processing_desc *desc, int ctrl_bit) return (desc->bmControls[byteof(ctrl_bit)] & bitof(ctrl_bit)); } +static int +uvideo_has_ct_ctrl(struct usb_video_camera_terminal_desc *desc, int ctrl_bit) +{ + + if (desc->bControlSize * 8 <= ctrl_bit) + return (0); + + return (desc->bmControls[byteof(ctrl_bit)] & bitof(ctrl_bit)); +} + static usb_error_t uvideo_vs_parse_desc(struct uvideo_softc *sc, struct usb_config_descriptor *cdesc) @@ -3353,13 +3496,19 @@ uvideo_queryctrl(struct uvideo_softc *sc, struct v4l2_queryctrl *qctrl) usb_error_t error; uint8_t *ctrl_data; uint16_t ctrl_len; + uint8_t unit_id; i = uvideo_find_ctrl(sc, qctrl->id); if (i == EINVAL) return (i); + if (sc->sc_desc_vc_ct_cur != NULL) + unit_id = sc->sc_desc_vc_ct_cur->bTerminalID; + else + unit_id = sc->sc_desc_vc_pu_cur->bUnitID; + ctrl_len = uvideo_ctrls[i].ctrl_len; - if (ctrl_len < 1 || ctrl_len > 2) { + if (ctrl_len < 1 || ctrl_len > 4) { device_printf(sc->sc_dev, "invalid control length: %d\n", ctrl_len); return (EINVAL); @@ -3374,7 +3523,7 @@ uvideo_queryctrl(struct uvideo_softc *sc, struct v4l2_queryctrl *qctrl) /* get minimum */ error = uvideo_vc_get_ctrl(sc, ctrl_data, GET_MIN, - sc->sc_desc_vc_pu_cur->bUnitID, + unit_id, uvideo_ctrls[i].ctrl_selector, uvideo_ctrls[i].ctrl_len); if (error != USB_ERR_NORMAL_COMPLETION) { ret = EINVAL; @@ -3389,11 +3538,15 @@ uvideo_queryctrl(struct uvideo_softc *sc, struct v4l2_queryctrl *qctrl) qctrl->minimum = uvideo_ctrls[i].sig ? (int16_t)UGETW(ctrl_data) : UGETW(ctrl_data); break; + case 4: + qctrl->minimum = uvideo_ctrls[i].sig ? + (int32_t)UGETDW(ctrl_data) : UGETDW(ctrl_data); + break; } /* get maximum */ error = uvideo_vc_get_ctrl(sc, ctrl_data, GET_MAX, - sc->sc_desc_vc_pu_cur->bUnitID, + unit_id, uvideo_ctrls[i].ctrl_selector, uvideo_ctrls[i].ctrl_len); if (error != USB_ERR_NORMAL_COMPLETION) { ret = EINVAL; @@ -3408,11 +3561,15 @@ uvideo_queryctrl(struct uvideo_softc *sc, struct v4l2_queryctrl *qctrl) qctrl->maximum = uvideo_ctrls[i].sig ? (int16_t)UGETW(ctrl_data) : UGETW(ctrl_data); break; + case 4: + qctrl->maximum = uvideo_ctrls[i].sig ? + (int32_t)UGETDW(ctrl_data) : UGETDW(ctrl_data); + break; } /* get resolution/step */ error = uvideo_vc_get_ctrl(sc, ctrl_data, GET_RES, - sc->sc_desc_vc_pu_cur->bUnitID, + unit_id, uvideo_ctrls[i].ctrl_selector, uvideo_ctrls[i].ctrl_len); if (error != USB_ERR_NORMAL_COMPLETION) { ret = EINVAL; @@ -3427,11 +3584,15 @@ uvideo_queryctrl(struct uvideo_softc *sc, struct v4l2_queryctrl *qctrl) qctrl->step = uvideo_ctrls[i].sig ? (int16_t)UGETW(ctrl_data) : UGETW(ctrl_data); break; + case 4: + qctrl->step = uvideo_ctrls[i].sig ? + (int32_t)UGETDW(ctrl_data) : UGETDW(ctrl_data); + break; } /* get default */ error = uvideo_vc_get_ctrl(sc, ctrl_data, GET_DEF, - sc->sc_desc_vc_pu_cur->bUnitID, + unit_id, uvideo_ctrls[i].ctrl_selector, uvideo_ctrls[i].ctrl_len); if (error != USB_ERR_NORMAL_COMPLETION) { ret = EINVAL; @@ -3446,6 +3607,10 @@ uvideo_queryctrl(struct uvideo_softc *sc, struct v4l2_queryctrl *qctrl) qctrl->default_value = uvideo_ctrls[i].sig ? (int16_t)UGETW(ctrl_data) : UGETW(ctrl_data); break; + case 4: + qctrl->default_value = uvideo_ctrls[i].sig ? + (int32_t)UGETDW(ctrl_data) : UGETDW(ctrl_data); + break; } qctrl->flags = 0; @@ -3462,13 +3627,19 @@ uvideo_g_ctrl(struct uvideo_softc *sc, struct v4l2_control *gctrl) usb_error_t error; uint8_t *ctrl_data; uint16_t ctrl_len; + uint8_t unit_id; i = uvideo_find_ctrl(sc, gctrl->id); if (i == EINVAL) return (i); + if (sc->sc_desc_vc_ct_cur != NULL) + unit_id = sc->sc_desc_vc_ct_cur->bTerminalID; + else + unit_id = sc->sc_desc_vc_pu_cur->bUnitID; + ctrl_len = uvideo_ctrls[i].ctrl_len; - if (ctrl_len < 1 || ctrl_len > 2) + if (ctrl_len < 1 || ctrl_len > 4) return (EINVAL); ctrl_data = malloc(ctrl_len, M_USBDEV, M_WAITOK | M_ZERO); @@ -3476,7 +3647,7 @@ uvideo_g_ctrl(struct uvideo_softc *sc, struct v4l2_control *gctrl) return (ENOMEM); error = uvideo_vc_get_ctrl(sc, ctrl_data, GET_CUR, - sc->sc_desc_vc_pu_cur->bUnitID, + unit_id, uvideo_ctrls[i].ctrl_selector, uvideo_ctrls[i].ctrl_len); if (error != USB_ERR_NORMAL_COMPLETION) { ret = EINVAL; @@ -3491,6 +3662,10 @@ uvideo_g_ctrl(struct uvideo_softc *sc, struct v4l2_control *gctrl) gctrl->value = uvideo_ctrls[i].sig ? (int16_t)UGETW(ctrl_data) : UGETW(ctrl_data); break; + case 4: + gctrl->value = uvideo_ctrls[i].sig ? + (int32_t)UGETDW(ctrl_data) : UGETDW(ctrl_data); + break; } out: @@ -3505,13 +3680,19 @@ uvideo_s_ctrl(struct uvideo_softc *sc, struct v4l2_control *sctrl) usb_error_t error; uint8_t *ctrl_data; uint16_t ctrl_len; + uint8_t unit_id; i = uvideo_find_ctrl(sc, sctrl->id); if (i == EINVAL) return (i); + if (sc->sc_desc_vc_ct_cur != NULL) + unit_id = sc->sc_desc_vc_ct_cur->bTerminalID; + else + unit_id = sc->sc_desc_vc_pu_cur->bUnitID; + ctrl_len = uvideo_ctrls[i].ctrl_len; - if (ctrl_len < 1 || ctrl_len > 2) + if (ctrl_len < 1 || ctrl_len > 4) return (EINVAL); ctrl_data = malloc(ctrl_len, M_USBDEV, M_WAITOK | M_ZERO); @@ -3528,10 +3709,13 @@ uvideo_s_ctrl(struct uvideo_softc *sc, struct v4l2_control *sctrl) case 2: USETW(ctrl_data, sctrl->value); break; + case 4: + USETDW(ctrl_data, sctrl->value); + break; } error = uvideo_vc_set_ctrl(sc, ctrl_data, SET_CUR, - sc->sc_desc_vc_pu_cur->bUnitID, + unit_id, uvideo_ctrls[i].ctrl_selector, uvideo_ctrls[i].ctrl_len); if (error != USB_ERR_NORMAL_COMPLETION) ret = EINVAL; diff --git a/sys/dev/usb/video/uvideo.h b/sys/dev/usb/video/uvideo.h index bccaf4cf0216..00e5118a65ae 100644 --- a/sys/dev/usb/video/uvideo.h +++ b/sys/dev/usb/video/uvideo.h @@ -211,7 +211,7 @@ struct usb_video_camera_terminal_desc { uWord wObjectiveFocalLengthMax; uWord wOcularFocalLength; uByte bControlSize; - uByte *bmControls; + uByte bmControls[255]; /* [bControlSize] */ } __packed; /* Table 3-8: VC Processing Unit Descriptor */ diff --git a/sys/dev/usb/video/uvideo_v4l2.h b/sys/dev/usb/video/uvideo_v4l2.h index 05736bff3e9c..6192ada9fbb6 100644 --- a/sys/dev/usb/video/uvideo_v4l2.h +++ b/sys/dev/usb/video/uvideo_v4l2.h @@ -453,6 +453,19 @@ struct v4l2_frmivalenum { #define V4L2_CID_SHARPNESS (V4L2_CID_BASE + 27) #define V4L2_CID_BACKLIGHT_COMPENSATION (V4L2_CID_BASE + 28) +#define V4L2_CID_CAMERA_CLASS_BASE 0x009a0000 +#define V4L2_CID_EXPOSURE_AUTO (V4L2_CID_CAMERA_CLASS_BASE + 1) +#define V4L2_CID_EXPOSURE_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE + 2) +#define V4L2_CID_EXPOSURE_AUTO_PRIORITY (V4L2_CID_CAMERA_CLASS_BASE + 3) +#define V4L2_CID_FOCUS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE + 4) +#define V4L2_CID_FOCUS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE + 5) +#define V4L2_CID_PAN_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE + 8) +#define V4L2_CID_TILT_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE + 9) +#define V4L2_CID_FOCUS_AUTO (V4L2_CID_CAMERA_CLASS_BASE + 12) +#define V4L2_CID_ZOOM_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE + 13) +#define V4L2_CID_ZOOM_CONTINUOUS (V4L2_CID_CAMERA_CLASS_BASE + 15) +#define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE + 16) + /* * V4L2 ioctl definitions */ From nobody Tue Jun 16 11:23:05 2026 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 4gfl3F70vrz6hSh9 for ; Tue, 16 Jun 2026 11:23: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfl3F3wXcz3MGF for ; Tue, 16 Jun 2026 11:23:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781608985; 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=/APZduZ7kWul1N84e6kcuAqUa954vMQwWjPxlEM1T30=; b=gXCvcP43UyMHtpeoaobqeo2dkgX/VdBGU/7fiAsly50w6BJLffaHKN7rxy1v4iXPDSV0Dh jM9ipnajzqGnHPZ5b4rTg3Rhk43DgBubmv5Wvn5b814jNVkBZ15ays8h9LqWiQrOm4AZ9F 0NVtYgADZ1Z9pL3655pZJQdPr1T14aGwCAYPUJoLxTe7CSOU3Xz8xxqoqXVouF3BFadZLV Ges1BimkHkxhQyyi7uw0i6/uzbcDNVJgFgm0u/9A/rLf0aTEnsy1uksYPiDoc1D+ytN9cV xf5vG2wgrcOuKSkzIU2J+yW4t14Cd5QCniI/oL+spTeaf0LTWjNwZ6AOuF9MwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781608985; a=rsa-sha256; cv=none; b=isBfelZdST5HoU8/azBJOATZMEp+o5YnzkT3olNuEjv9fCfys9ip39tcuxO4CR/Fpzf1Yk tgM2m5ej39itmjLaIFJqPUte/+ej3V/bP6+uVzL9fdixNxfD1hcz30v7G6Li8yuzLX/ctl 3ecUfV2ao7BCnLB/OAL0KhCYQ+XOUhwzVfVUBPrh/dIJdfZFOpw4L50i6qzRRitOxmGHkB xC+JQbl9FlE39KYjLqRoKME3mS4EZSf9ZU/5U2KyUDAu/Htlxkfv2fryklmY2QVAlpQ58j qgU8mGA/43Q48arAVAwUWtNnbh8dC0zrg0QoEfb8XKn1MomlpgUV7pFieqnA8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781608985; 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=/APZduZ7kWul1N84e6kcuAqUa954vMQwWjPxlEM1T30=; b=fne4on5ZOu522mva99yTk1GiYUP1Xld2jOcrDaSSE/XYWMedXokjy3vASNH7heGzL0PRdo QTta4WnTA5aonAa4CryHC9tBr0w34Ri7HFj9UyADuirhAySOGxO3lV4+vEJnwm+Y2Qn63H bCnBeaJosvsmzpyGb9RvdROdcwgdAhNkHfDxwhkDYG6eGETBGYUXlYzpdR8pAcpE0PKB4W zQtRoD6c2k6l6hRvxWkMiAXYo1hfbS4iV+MMnmgfhIt8AMI/jeADnzmDP/AMRq5pW3Yh3B L0zV+8+hBhii56EQT6Z5B0ndTJGif/Smk/kkxR26XA1aVR89L+vwbIunknL1qA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfl3F2lSBz8Cn for ; Tue, 16 Jun 2026 11:23:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1e898 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 11:23:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 8bc06ffbbd80 - main - uvideo: add missing formats to be in par with webcamd's uvcvideo 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 8bc06ffbbd80533eda0784d2a6f5a1476f9d550c Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 11:23:05 +0000 Message-Id: <6a313219.1e898.26ae607@gitrepo.freebsd.org> The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=8bc06ffbbd80533eda0784d2a6f5a1476f9d550c commit 8bc06ffbbd80533eda0784d2a6f5a1476f9d550c Author: Baptiste Daroussin AuthorDate: 2026-05-18 20:17:34 +0000 Commit: Baptiste Daroussin CommitDate: 2026-06-16 11:21:03 +0000 uvideo: add missing formats to be in par with webcamd's uvcvideo --- sys/dev/usb/video/uvideo.c | 19 +++++++++++++++++++ sys/dev/usb/video/uvideo.h | 24 ++++++++++++++++++++++++ sys/dev/usb/video/uvideo_v4l2.h | 6 ++++++ 3 files changed, 49 insertions(+) diff --git a/sys/dev/usb/video/uvideo.c b/sys/dev/usb/video/uvideo.c index 52998fbc9b40..b35561ff6a24 100644 --- a/sys/dev/usb/video/uvideo.c +++ b/sys/dev/usb/video/uvideo.c @@ -493,12 +493,18 @@ static const struct { uint32_t pixelformat; } uvideo_map_fmts[] = { { UVIDEO_FORMAT_GUID_YUY2, V4L2_PIX_FMT_YUYV }, + { UVIDEO_FORMAT_GUID_NV12, V4L2_PIX_FMT_NV12 }, + { UVIDEO_FORMAT_GUID_NV21, V4L2_PIX_FMT_NV21 }, { UVIDEO_FORMAT_GUID_YV12, V4L2_PIX_FMT_YVU420 }, { UVIDEO_FORMAT_GUID_I420, V4L2_PIX_FMT_YUV420 }, + { UVIDEO_FORMAT_GUID_M420, V4L2_PIX_FMT_M420 }, + { UVIDEO_FORMAT_GUID_UYVY, V4L2_PIX_FMT_UYVY }, { UVIDEO_FORMAT_GUID_Y800, V4L2_PIX_FMT_GREY }, { UVIDEO_FORMAT_GUID_Y8, V4L2_PIX_FMT_GREY }, { UVIDEO_FORMAT_GUID_D3DFMT_L8, V4L2_PIX_FMT_GREY }, { UVIDEO_FORMAT_GUID_KSMEDIA_L8_IR, V4L2_PIX_FMT_GREY }, + { UVIDEO_FORMAT_GUID_Y12, V4L2_PIX_FMT_Y12 }, + { UVIDEO_FORMAT_GUID_Y16, V4L2_PIX_FMT_Y16 }, { UVIDEO_FORMAT_GUID_BY8, V4L2_PIX_FMT_SBGGR8 }, { UVIDEO_FORMAT_GUID_BA81, V4L2_PIX_FMT_SBGGR8 }, { UVIDEO_FORMAT_GUID_GBRG, V4L2_PIX_FMT_SGBRG8 }, @@ -2939,9 +2945,16 @@ static const struct { } uvideo_fmt_names[] = { { V4L2_PIX_FMT_MJPEG, "Motion-JPEG", V4L2_FMT_FLAG_COMPRESSED }, { V4L2_PIX_FMT_YUYV, "YUYV 4:2:2", 0 }, + { V4L2_PIX_FMT_UYVY, "UYVY 4:2:2", 0 }, + { V4L2_PIX_FMT_NV12, "Y/UV 4:2:0", 0 }, + { V4L2_PIX_FMT_NV21, "Y/VU 4:2:0", 0 }, { V4L2_PIX_FMT_YVU420, "Planar YVU 4:2:0", 0 }, { V4L2_PIX_FMT_YUV420, "Planar YUV 4:2:0", 0 }, + { V4L2_PIX_FMT_M420, "M420 YUV 4:2:0", 0 }, { V4L2_PIX_FMT_GREY, "8-bit Greyscale", 0 }, + { V4L2_PIX_FMT_Y10, "10-bit Greyscale", 0 }, + { V4L2_PIX_FMT_Y12, "12-bit Greyscale", 0 }, + { V4L2_PIX_FMT_Y16, "16-bit Greyscale", 0 }, { V4L2_PIX_FMT_RGB565, "16-bit RGB 5-6-5", 0 }, { V4L2_PIX_FMT_BGR24, "24-bit BGR 8-8-8", 0 }, { V4L2_PIX_FMT_XBGR32, "32-bit BGRX 8-8-8-8", 0 }, @@ -2951,6 +2964,12 @@ static const struct { { V4L2_PIX_FMT_SGBRG8, "8-bit Bayer GBGB/RGRG", 0 }, { V4L2_PIX_FMT_SGRBG8, "8-bit Bayer GRGR/BGBG", 0 }, { V4L2_PIX_FMT_SRGGB8, "8-bit Bayer RGRG/GBGB", 0 }, + { V4L2_PIX_FMT_SBGGR16, "16-bit Bayer BGBG/GRGR", 0 }, + { V4L2_PIX_FMT_SGBRG16, "16-bit Bayer GBGB/RGRG", 0 }, + { V4L2_PIX_FMT_SGRBG16, "16-bit Bayer GRGR/BGBG", 0 }, + { V4L2_PIX_FMT_SRGGB16, "16-bit Bayer RGRG/GBGB", 0 }, + { V4L2_PIX_FMT_SRGGB10P, "10-bit Bayer RGRG/GBGB Packed", 0 }, + { V4L2_PIX_FMT_Z16, "16-bit Depth", 0 }, { 0, NULL, 0 } }; diff --git a/sys/dev/usb/video/uvideo.h b/sys/dev/usb/video/uvideo.h index 00e5118a65ae..fc811c5d65fa 100644 --- a/sys/dev/usb/video/uvideo.h +++ b/sys/dev/usb/video/uvideo.h @@ -312,6 +312,14 @@ struct usb_video_probe_commit { 'Y', 'U', 'Y', '2', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } +#define UVIDEO_FORMAT_GUID_NV12 { \ + 'N', 'V', '1', '2', 0x00, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } + +#define UVIDEO_FORMAT_GUID_NV21 { \ + 'N', 'V', '2', '1', 0x00, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } + #define UVIDEO_FORMAT_GUID_YV12 { \ 'Y', 'V', '1', '2', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } @@ -320,6 +328,14 @@ struct usb_video_probe_commit { 'I', '4', '2', '0', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } +#define UVIDEO_FORMAT_GUID_M420 { \ + 'M', '4', '2', '0', 0x00, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } + +#define UVIDEO_FORMAT_GUID_UYVY { \ + 'U', 'Y', 'V', 'Y', 0x00, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } + #define UVIDEO_FORMAT_GUID_Y800 { \ 'Y', '8', '0', '0', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } @@ -336,6 +352,14 @@ struct usb_video_probe_commit { 0x32, 0x00, 0x00, 0x00, 0x02, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } +#define UVIDEO_FORMAT_GUID_Y12 { \ + 'Y', '1', '2', ' ', 0x00, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } + +#define UVIDEO_FORMAT_GUID_Y16 { \ + 'Y', '1', '6', ' ', 0x00, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } + #define UVIDEO_FORMAT_GUID_BY8 { \ 'B', 'Y', '8', ' ', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } diff --git a/sys/dev/usb/video/uvideo_v4l2.h b/sys/dev/usb/video/uvideo_v4l2.h index 6192ada9fbb6..7e0aa2eda097 100644 --- a/sys/dev/usb/video/uvideo_v4l2.h +++ b/sys/dev/usb/video/uvideo_v4l2.h @@ -364,6 +364,10 @@ struct v4l2_frmivalenum { /* Luminance+Chrominance formats */ #define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') +#define V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') +#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') +#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') +#define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') #define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') @@ -375,6 +379,8 @@ struct v4l2_frmivalenum { /* Grey formats */ #define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') #define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') +#define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') +#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* RGB formats */ #define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P') From nobody Tue Jun 16 11:23:06 2026 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 4gfl3H0D0zz6hSwG for ; Tue, 16 Jun 2026 11:23: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfl3G42Pxz3MJx for ; Tue, 16 Jun 2026 11:23:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781608986; 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=lnhF5qHA7kefsz/Td6TAss/okivN0G7+Tg1rdJmIWR8=; b=ANbJ4883Z7WV+Dd/LfV9hVzgFN1WYVFAWYUactoIkYoLPWDuellDDs/0m4Ygc376Pv6Tg0 OmmEAn2PDgF6/2+3JXGVkVuUXQKstQHgl8it3V6i9Whvpkkwl/Q4d+C9+DaXTkm+7rA6AT 78W+vMfsNljmGl4VqcRLXg7BlBXTXBJh4oReRfVEpD1gVW6BNwXhyQoAYeNsodkh0TlNFy 8luWCn7jWNju32T456tzi5JOwi42tO+2Nkj2tS2g+niVhUcLOR3i7nYo9sTtg96T3PygCr NZTlHME7eidftKvlsiNxTpDfxxR9bheU5AaC+zDL72dixmR7a0sZpJdP/F2XGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781608986; a=rsa-sha256; cv=none; b=W+SHuSAHbXFsqjQhe8HgSPPMHLP+XIRr5Z4NB7iOLZ9ZJw7WQ9x0CcVwdQ9ZMBurXXLIr/ drl7wcQP5nhlo2U0cg0dVZq6qPjVUj2F6S5Mgnu0ZDhl8HN/h0iPp5cFAvGaSP3z9MoFho jzIgE9hMaep/PPO//Y1cEYQTOJunGKCw3EB2+iXFJI5MMicek+X40yaolid0sd9hGpoJns htQ8EoQL/35lJFRGKGEaP1SMYJ3Bd9keNOCi1NILPu04Dr/IncH1YveChKpBRdr09pM47Z Fk4y0dqAY/dJNjNCh3S784AYT1KHoMnfl6MuVJQf8ed4qN4YQbo8N7kO1BNlkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781608986; 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=lnhF5qHA7kefsz/Td6TAss/okivN0G7+Tg1rdJmIWR8=; b=byxTtbE2oGvfl/L0YzPmvKivsn7KKKLMoMoMkxYi4j+zDLoA4w097uh77YGnG5CdEvJduV XrCCXcSW3zFBN7nuId1KuVPaNNWqOdTFxf2wzU0dKZTxxXN2+fL9hQRQkTaA+ERNM8v0Yq IepKVnxwYEGOsmz2tqxu1QPiZlCHhBSs1i7LwKGchdZ17P6BrVlQKxRBnLObpxPi3mLlrN fCpdSEC2L+qjcvvcl5HSViwJCAYzPdix9YkMkN9i8Q1DGFwAy3q6/NWJXeajxnbC/9ddxh U1QNrdBGAg+QZGJmvveA5v4KSptA/pV76GY9z3jQCUERjFun66tVgJTkD7/ipw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfl3G3bYXz8Fp for ; Tue, 16 Jun 2026 11:23:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1e7a6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 11:23:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 3b6f833c95eb - main - uvideo: increase isochronous transfer depth for throughput 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 3b6f833c95eb65b29a9f506928467236a11d5169 Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 11:23:06 +0000 Message-Id: <6a31321a.1e7a6.2fe02931@gitrepo.freebsd.org> The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=3b6f833c95eb65b29a9f506928467236a11d5169 commit 3b6f833c95eb65b29a9f506928467236a11d5169 Author: Baptiste Daroussin AuthorDate: 2026-05-18 21:44:27 +0000 Commit: Baptiste Daroussin CommitDate: 2026-06-16 11:21:05 +0000 uvideo: increase isochronous transfer depth for throughput Increase NFRAMES_MAX from 40 to 128 and IXFERS from 3 to 5 to keep more packets in flight on the USB bus. This brings throughput from ~13.5 MB/s to ~21 MB/s (for comparison on the same camera webcamd provided ~20MB/s. The linux driver also uses 5 IXFERS (but only 32 NFRAMES_MAX) Tested by: manu --- sys/dev/usb/video/uvideo.c | 20 ++++++++++++++++++++ sys/dev/usb/video/uvideo.h | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/video/uvideo.c b/sys/dev/usb/video/uvideo.c index b35561ff6a24..9229aa34fc47 100644 --- a/sys/dev/usb/video/uvideo.c +++ b/sys/dev/usb/video/uvideo.c @@ -196,6 +196,8 @@ enum { UVIDEO_ISOC_RX_0, UVIDEO_ISOC_RX_1, UVIDEO_ISOC_RX_2, + UVIDEO_ISOC_RX_3, + UVIDEO_ISOC_RX_4, UVIDEO_BULK_RX, UVIDEO_N_XFER }; @@ -616,6 +618,24 @@ static const struct usb_config uvideo_isoc_config[UVIDEO_IXFERS] = { .flags = {.short_xfer_ok = 1, .short_frames_ok = 1,}, .callback = &uvideo_isoc_callback, }, + [3] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = 0, + .frames = UVIDEO_NFRAMES_MAX, + .flags = {.short_xfer_ok = 1, .short_frames_ok = 1,}, + .callback = &uvideo_isoc_callback, + }, + [4] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = 0, + .frames = UVIDEO_NFRAMES_MAX, + .flags = {.short_xfer_ok = 1, .short_frames_ok = 1,}, + .callback = &uvideo_isoc_callback, + }, }; static const struct usb_config uvideo_bulk_config[1] = { diff --git a/sys/dev/usb/video/uvideo.h b/sys/dev/usb/video/uvideo.h index fc811c5d65fa..9f8570aaf7ed 100644 --- a/sys/dev/usb/video/uvideo.h +++ b/sys/dev/usb/video/uvideo.h @@ -640,9 +640,9 @@ struct usb_video_format_desc { /* * Driver specific private definitions. */ -#define UVIDEO_NFRAMES_MAX 40 +#define UVIDEO_NFRAMES_MAX 128 -#define UVIDEO_IXFERS 3 +#define UVIDEO_IXFERS 5 struct uvideo_vs_iface { uint8_t iface_index; int numalts; From nobody Tue Jun 16 12:35:05 2026 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 4gfmfK2RGVz6hZfn for ; Tue, 16 Jun 2026 12:35: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfmfK1z7fz3WvR for ; Tue, 16 Jun 2026 12:35:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781613305; 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=aLEuGPj8Upm0IWlHG6gPVGyZiakY4chacaGApZ30zV8=; b=W6D4AgDOOPYziRKSvsdDdQOnTmVlYOJdqYVLt7T2tj2BZsfkUsmDViAp2cei5sXIbdy+2k A8mf87YCGz5lC++MQFg/kerwuAuM+44J3tmaTpLNFrh37BplGSuibigiOOS68NPQPQdLzE LpwvDD+cwv4AGmDEe6OLLiWAWBe7nPH89iR0Jc6hT3hD+VADSdwuNIJvcpqlToVcz399uf G1kZbfcBXidOygfJh0PjmmdzYZ12W/dSVUr1Tev+NYvFNBS9VJsv3I2/ft2SlYplfBVN7o rZB/SuEgGZv8e8PHrqwOcSke1zzRfjh4o8ew5pEbJ38a7I4svb6ljbIu1yTS/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781613305; a=rsa-sha256; cv=none; b=NxkjJQuFgk6XQw/5aarDrDV1maxJmw005NCkrhdklQ9YjuBejGzq7bbqXhoEAiV8VB1StZ I8l8qqHlCHTigY3DuWMIVDnDWZnRhDhImurWi+MEAelTtfIySUo/vQ2GpmOFgMInvDY5EN lW9Np08xHfFbQFqtjXR8OWweiOcxaG4/MkMidusoVy/uSRlrwZVdIX5NrApMniGjucsx0g Gl+BIdm/kyJIQVJwp49rZbf+nf77WTsRl7Z3m6fUA/B1MhFzzzu7RegXLPy4am3cwSoD/m Oj8AD6uYPMHSR2JArgroefIUxH06wUdzBuVynLApedfbEqp/qiL3Jr2rvEJ1HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781613305; 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=aLEuGPj8Upm0IWlHG6gPVGyZiakY4chacaGApZ30zV8=; b=CXPiM/EGqjvJAkPMZbUCbJOGZmzDGf5Q/pHG8IXM0oqFyRyQkPSR87ONVS1HwTD6NtNEMj qjP6riTxqnryasOp7aJdeXGiBE4vV+A0DxtbJjnvbrNNPXD0IZ69ElX0NpxWOo+RuBJ1CZ ozWbDIRa4IoSllLjcjV8VPmqHfqmu7oCmI6y8fzh7ndJ2SnRpfaEAnESzQ3HtqFW+l93Jg CkdcJl/PBXxgI5vl2GDftBoe55wh1zWZ35R54GCoiNfwBifHlUIcImCz6cBzHk8UubSpvL rXUKwN0XWNweBf5rP4mb/flNfXcrgtf6XB0iXQCckJCoRwABh124Kaiz0NUO2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfmfK1MCLz9DX for ; Tue, 16 Jun 2026 12:35:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2608b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 12:35:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Maxim Konovalov Subject: git: f8b5df434e41 - main - bsd-family-tree: add FreeBSD 15.1 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: maxim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f8b5df434e419e00272bfce343bf7da239081276 Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 12:35:05 +0000 Message-Id: <6a3142f9.2608b.83acd9b@gitrepo.freebsd.org> The branch main has been updated by maxim: URL: https://cgit.FreeBSD.org/src/commit/?id=f8b5df434e419e00272bfce343bf7da239081276 commit f8b5df434e419e00272bfce343bf7da239081276 Author: Maxim Konovalov AuthorDate: 2026-06-16 12:34:28 +0000 Commit: Maxim Konovalov CommitDate: 2026-06-16 12:34:28 +0000 bsd-family-tree: add FreeBSD 15.1 --- share/misc/bsd-family-tree | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 1847105e5f34..f7b75a232bea 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -485,9 +485,11 @@ FreeBSD 5.2 | | | | | | | | OpenBSD 7.8 | *--FreeBSD | | | | | | 15.0 | | | | | - | FreeBSD | | | | - | 14.4 | | | | - | | | | OpenBSD 7.9 | + | | FreeBSD | | | | + | | 14.4 | | | | + | | | | OpenBSD 7.9 | + | FreeBSD | | | | + | 15.1 | | | | | | | | | FreeBSD 16 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -938,6 +940,7 @@ OpenBSD 7.8 2025-10-22 [OBD] FreeBSD 15.0 2025-12-02 [FBD] FreeBSD 14.4 2026-03-10 [FBD] OpenBSD 7.9 2026-05-19 [OBD] +FreeBSD 15.1 2026-06-16 [FBD] Bibliography ------------------------ From nobody Tue Jun 16 13:11:57 2026 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 4gfnSz0l4Pz6h8Xf for ; Tue, 16 Jun 2026 13:12:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfnSy7301z3gfJ for ; Tue, 16 Jun 2026 13:12:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781615523; 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; bh=WpsXTHwDfLFJq+vBgfqvx4/esP7zGX9m8Ae4/38F/Cs=; b=G3KwmO9zqkGt2Gxl8YUIdKouxZHXUBPsWgDxHN0YFeWky+hKgJZa4FJeVMOKCDk1s3aiYd RJrY7I3n51F9MQeo5qbGiNdLXyW+ivheHBw+wLUB3blF9ycLrNOtwx4DvamwnDXH9fVjm0 ubNh2wt/s9NiiL//7gY72zMpUk0SHWRbPIfrE1SYehF8o6Ec/0YSfKwUAQb3S75zeEkZW3 +LdGbtzR6stp5x0pogKfJItv9ZOytnhxCN4BY4rQASHlh6ui0So/swOKTiTWd+MoWQ+JHy 10Luulm80c+ci353c+4acsJ8cMfKeEY6rU80UD9kQvAXYBzLeiiP3yK/mttZ5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781615523; a=rsa-sha256; cv=none; b=clflVQZfDttH57KPXKFd693q+CVnnwQt4uKp9uZQvxjsImkVKX38HfMYz23UKpvynSjlEq ef33OrNixtCBibDfFjoFGeh3nhwj2DP2opKQFotNivg6P2DrsjE7UoPNmJBojFlvZEW6as 2NxlrMcPtZy3A3JD+VrPa0EcRIs2wVD+/ekUOpBL+9zbf9BMdA6p9RzANk4Cx+B2SPxkzd 8CkfeUiRD22hm1fLt3rp3jnA3RhKOApqNF8qKO4P+eLrKC/t8IRnLP8hR5QLvuU7fAPk1N QEJqXsRCC4cOYa90f0pRRedSrhgI3wtdKz9GHCUniuLFHTCEhJRk8/HmwkTZuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781615523; 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; bh=WpsXTHwDfLFJq+vBgfqvx4/esP7zGX9m8Ae4/38F/Cs=; b=Rjxg5XJsiJsikyNNTF6XX0irWkay5OvXs4zwT0UEdE8P6wfNNnvWNn11I4KxYxBnXRpKYX PEXBHWUPQ+R0va2nhv7VgdlDx0zpuV3GgcUBiyDHltuqXyYD2qt2T4ggqCSiK4kMdqT2c0 p4YcmYcyw2JrV5IR3Xe6IaKrEUiOFIUfWjm6szOfi2dmqYM1Whbij6HJLvdbjaIYongwwp 1HAHZ7AQMEYYxwJJCSokRr0SVyDK+7ZAlR7gu33I0Hwi7ClcLpPT7/+VmicBuyMxEcvXez zDKL7MFW4gmLOAQm18tUL7pNohmBXbfToj2r8aJAC7dmIuL+TPFGcHstYIs3tg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfnSy6fc5zBZj for ; Tue, 16 Jun 2026 13:12:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3263c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 13:11:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: John From: Adrian Chadd Subject: git: 76f9bb488e77 - main - rge: fix VLAN hardware tagging 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 76f9bb488e77ae4cc220b0bbbc53f1a7315ef977 Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 13:11:57 +0000 Message-Id: <6a314b9d.3263c.c4418f@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=76f9bb488e77ae4cc220b0bbbc53f1a7315ef977 commit 76f9bb488e77ae4cc220b0bbbc53f1a7315ef977 Author: John AuthorDate: 2026-06-16 13:06:40 +0000 Commit: Adrian Chadd CommitDate: 2026-06-16 13:11:14 +0000 rge: fix VLAN hardware tagging Set the correct value in the TX descriptor for the vlan header. PR: kern/295175 --- sys/dev/rge/if_rge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/rge/if_rge.c b/sys/dev/rge/if_rge.c index 06f034ebd61d..800c1f797f6b 100644 --- a/sys/dev/rge/if_rge.c +++ b/sys/dev/rge/if_rge.c @@ -833,7 +833,7 @@ rge_encap(struct rge_softc *sc, struct rge_queues *q, struct mbuf *m, int idx) /* Set up hardware VLAN tagging */ if (m->m_flags & M_VLANTAG) { sc->sc_drv_stats.tx_offload_vlan_tag_set++; - cflags |= htole16(m->m_pkthdr.ether_vtag) | RGE_TDEXTSTS_VTAG; + cflags |= htons(m->m_pkthdr.ether_vtag) | RGE_TDEXTSTS_VTAG; } cur = idx; From nobody Tue Jun 16 14:58:21 2026 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 4gfqqf13rQz6hJZH for ; Tue, 16 Jun 2026 14:58:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfqqd6BDLz40Zq for ; Tue, 16 Jun 2026 14:58:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781621901; 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; bh=aBn6D8c/jymxkPQcJEomWWSGndJmdsO4vWKhjhXk5uM=; b=vasecO3c5U4CZsZuz73yTirN9/XaT7Bj7qEtCNgPU14TepmyKhPjeQ3W+2K9ir91hbxBMH dTHUca4rK2nDrxcaFyt2L7ptGoOg/WqGse4sbT5wbUpO+EMWxIfSPNsN8LTyv4mOSLeydB tTttkCexLqvjX+nd5wry7FJH7VCOuBOGXFxRre+sST9ebEkGpD+AlMP17mbBmxeg3Ttul2 ybXw1BWuRvGghSfvSoAHD7ig8/1yaS8vEfJmbMsD6MtNmyk6v8fNQQfr3KZY1WFhohIWoi x4rl0qxWt0C8WRJ41+ubjObgfPfpEshxJ5Va8FFDZ8w2mmGiWeavreq09J8HIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781621901; a=rsa-sha256; cv=none; b=XSlgh/jMnnG/P8glEn6FZ2hQ2Kq7Q2mKWkPJESuGp4/MlnuAcxXpHXFuR3aXsnq14+3J5C +0F4CHtbLo4zwhQx66Nx3MB4ZUFZu2B4NDKMmXk/Hi0dtfL6Y5olIdIbsl30yxL3lRz1Hd r1r5hofIIzrAjTfqWnmVhC1Wc6FfM9CDz/hXSpi+bV/AoEavntg9dUgd//INX0y48DNLU3 kJRDfhUwmv7upOjQKro0Et9vMOgKeuV/QcvOF7bSJdrJbzrjI/g1jTe5JWItujIHifaLDM 2Zd6Dvcc8f8AW8zbPiwmSiGXstC9dluC7fff/CdDz2FOFleD1sg6gkZu+5rVyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781621901; 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; bh=aBn6D8c/jymxkPQcJEomWWSGndJmdsO4vWKhjhXk5uM=; b=NkMZyYpjyjEuM1vQAo7qOdCL/56GXoXRZqCzCD712YWndpgOzZZ1KGa9O9weXGfl5nnr+c NSIZ5ydTikVVy6tjL4sCuwFZa509oalJxDG3FhmraoEpKqxruVAAzhIRKIxwYnUoT9ydow e73Vr8VrF7cSvnYtyF4nkndXvfVsEwwp7HSw5TSgRK42h0+uWAYx0hta50hzySWpeTibrF YfdYPTIfTGF5vjiZAeFQJ36AkDkDtv++qsEViai16LkLs4x6reAXT5CWrAyPVFqtIKyNq3 DA6aplD95anUTadeCMQIX1LQ6wOtJRYLXt+4v/XsT3/0J+zK8GoRqvFmCk0JKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfqqd4mbbzVrd for ; Tue, 16 Jun 2026 14:58:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3ce81 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 14:58:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: EN-WEU WU From: Adrian Chadd Subject: git: d4de0a69a92e - main - wtap(4): Implement STA/HostAP mode and support WPA/WPA2 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: d4de0a69a92e560c77df83d7b342566ce353792c Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 14:58:21 +0000 Message-Id: <6a31648d.3ce81.3cccde8a@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=d4de0a69a92e560c77df83d7b342566ce353792c commit d4de0a69a92e560c77df83d7b342566ce353792c Author: EN-WEU WU AuthorDate: 2026-06-16 14:35:20 +0000 Commit: Adrian Chadd CommitDate: 2026-06-16 14:35:20 +0000 wtap(4): Implement STA/HostAP mode and support WPA/WPA2 Below is the commit message: ``` Wtap originally only supported mesh/ad-hoc mode, and cannot be combined with wpa_supplicant(8) and hostapd(8) since it's unaware of encryption/decryption. This commit adds support for hostap and sta mode with WPA/WPA2, thus wtap(4) can now be used with hostapd(8) and wpa_supplicant(8). ``` Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D36243 --- sys/dev/wtap/if_wtap.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/sys/dev/wtap/if_wtap.c b/sys/dev/wtap/if_wtap.c index 51733a05bd93..d22b79a20dc4 100644 --- a/sys/dev/wtap/if_wtap.c +++ b/sys/dev/wtap/if_wtap.c @@ -297,6 +297,7 @@ wtap_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) switch (vap->iv_opmode) { case IEEE80211_M_IBSS: case IEEE80211_M_MBSS: + case IEEE80211_M_HOSTAP: /* * Stop any previous beacon callout. This may be * necessary, for example, when an ibss merge @@ -600,6 +601,16 @@ wtap_transmit(struct ieee80211com *ic, struct mbuf *m) (struct ieee80211_node *) m->m_pkthdr.rcvif; struct ieee80211vap *vap = ni->ni_vap; struct wtap_vap *avp = WTAP_VAP(vap); + struct ieee80211_key *k; + struct ieee80211_frame *wh; + + wh = mtod(m, struct ieee80211_frame *); + + if (IEEE80211_IS_PROTECTED(wh)) { + k = ieee80211_crypto_encap(ni, m); + if (k == NULL) + return (ENOBUFS); + } if (ieee80211_radiotap_active_vap(vap)) ieee80211_radiotap_tx(vap, m); @@ -652,7 +663,18 @@ wtap_attach(struct wtap_softc *sc, const uint8_t *macaddr) ic->ic_name = sc->name; ic->ic_phytype = IEEE80211_T_DS; ic->ic_opmode = IEEE80211_M_MBSS; - ic->ic_caps = IEEE80211_C_MBSS | IEEE80211_C_IBSS; + ic->ic_caps = + IEEE80211_C_MBSS /* mesh point link mode */ + | IEEE80211_C_IBSS /* ibss, nee adhoc, mode */ + | IEEE80211_C_STA /* station mode */ + | IEEE80211_C_HOSTAP /* hostap mode */ + | IEEE80211_C_WPA; /* capable of WPA1+WPA2 */ + + ic->ic_cryptocaps = + IEEE80211_CRYPTO_WEP + | IEEE80211_CRYPTO_AES_CCM + | IEEE80211_CRYPTO_TKIP + | IEEE80211_CRYPTO_TKIPMIC; ic->ic_max_keyix = 128; /* A value read from Atheros ATH_KEYMAX */ From nobody Tue Jun 16 14:58:22 2026 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 4gfqqg31Zxz6hJVM for ; Tue, 16 Jun 2026 14:58:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfqqf6Q3rz40HN for ; Tue, 16 Jun 2026 14:58:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781621902; 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; bh=tW2XRjQCXRMgM2m51y9shhtvHFUJuxas0BMfstMEb6s=; b=tg5dcxxGaz+ttt6uedYCTLQoMsq+GJeYbE2x7uQy8TVjS63Z+T6aWrQR6Dsv/SxJ0+npK3 83oAmpTB0KUm6Nre9fKun/Ze85lntNWvfP6q5u8BCjQOXzsM0hHAfF6OmbAAhiXMfG8lQK MXYSk1WKRBSbzvhHkWEwrYGB8eN1eZy/3dMLgL/qtNarEeP62NRnmWAZb22csWF3brt4oM XCzJj1Ef9HRV8fFVmBRse0olNe9oKlk/DkjSO3SR+6MI9Qftgo6rnc5VV9+C1FmxrN8L5w eHEJyistBKIK12xG+lh170+TefjkOTtzXo8uB6F6mVDQ6nu/UrEWY193fTg9gg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781621902; a=rsa-sha256; cv=none; b=xWl6+Y16CdeAjBTHUuTrJLvo/4G7Hy9EFCeWkKLZ0bKvVg+AUCCn+wxeoPvDum77eTHQAg L5Kj58a95UlBSOIkGeNxK7HYp+B12MHNI4DHg7Wl7J+xWymVvGqjwDD4dnWTWozJ7zqbWj VlfurLvrrV+frMkFRHI/E2ceLpmDjtJkUWzYSP7WnP22nHU5/iKokgCEWuwbXsKi+A7c2x b9f2LJdQGB5jaJ0xWHW/QiFLBE8Uz0D39xD2NSuDuniXZOZloqCH2Y4krcRLgcNLVhVt2o azVMRJDtpsYCDnP2+4U/Te1h4sU4nAkRYmCHQfCTgbFb8bZKSg3QDBMmbrKi8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781621902; 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; bh=tW2XRjQCXRMgM2m51y9shhtvHFUJuxas0BMfstMEb6s=; b=JJtaSSHCM9gqoPcMhEjLcGY/f2Nnnkrd+rhKvhj07rdPow6OXE3fVDKiOrwnq3aNj96ASA ATmc4ij7UcmWwsX/wHFCuBzQ0yQNvQM/1hQVfj/yB0sOqPHemVXwEcVLQN81RATk7w1ehU 9zMLPB8Aww8dgtibBhzGIypoENvbETEIXl+yIueyFRtdnx1emVckm8yG19SUUxC/q22f5C wKyHvSG6BZpd1R2aUyLxnpITCmVPdXK4FCZkMiN9jLltsLloDLTvrqhRocL+LDoRoi3lAY CPPVXohr7tZ3WmP+XganSpDY/sd8X8ay01Xwp7aNJ6Cj6cQVs3e1MVWBHq/rEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfqqf5ZB9zVF8 for ; Tue, 16 Jun 2026 14:58:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3bc54 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 14:58:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: EN-WEU WU From: Adrian Chadd Subject: git: 93c6906e36a4 - main - wtap(4): implement monitor mode and handle radiotap 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 93c6906e36a4e60e59279b6b6e18403ea23d56e1 Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 14:58:22 +0000 Message-Id: <6a31648e.3bc54.2c0ca6bf@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=93c6906e36a4e60e59279b6b6e18403ea23d56e1 commit 93c6906e36a4e60e59279b6b6e18403ea23d56e1 Author: EN-WEU WU AuthorDate: 2026-06-16 14:54:05 +0000 Commit: Adrian Chadd CommitDate: 2026-06-16 14:54:55 +0000 wtap(4): implement monitor mode and handle radiotap Implement monitor mode by simply adding IEEE80211_C_MONITOR to ic->ic_cap. To get additional informations when capturing 802.11 frames, radiotap is inserted by wtap_tx_tap() when TX and wtap_rx_tap() when RX. There are some type faults in struct wtap_rx_radiotap_header which are mainly mistakenly store unsigned values into signed integers. I have fixed them (wtap(4)) by complying with the types defined in https://www.radiotap.org/fields/defined. Becuase the struct wtap_rx_radiotap_header comes from ath(4), there may be another patch to fix the type faults in ath(4). Differential Review: https://reviews.freebsd.org/D36469 --- sys/dev/wtap/if_wtap.c | 59 ++++++++++++++++++++++++++++++++++++++++++--- sys/dev/wtap/if_wtapioctl.h | 31 ++++++++++++------------ 2 files changed, 71 insertions(+), 19 deletions(-) diff --git a/sys/dev/wtap/if_wtap.c b/sys/dev/wtap/if_wtap.c index d22b79a20dc4..d23036575d7a 100644 --- a/sys/dev/wtap/if_wtap.c +++ b/sys/dev/wtap/if_wtap.c @@ -229,6 +229,43 @@ wtap_beacon_config(struct wtap_softc *sc, struct ieee80211vap *vap) DWTAP_PRINTF("%s\n", __func__); } +static void +wtap_rx_tap(struct wtap_softc *sc, uint64_t tsf) +{ + struct ieee80211com *ic = &sc->sc_ic; + const struct ieee80211_rate_table *rt = ic->ic_rt; + struct wtap_rx_radiotap_header *rh = &sc->sc_rx_th; + + rh->wr_tsf = tsf; + rh->wr_flags = 0; + if (rt->rateCount) { + /* choose the fastest rate */ + rh->wr_rate = IEEE80211_RV(rt->info[rt->rateCount - 1].dot11Rate); + } + rh->wr_chan_flags = IEEE80211_CHAN_2GHZ; + rh->wr_chan_freq = ic->ic_curchan->ic_freq; + rh->wr_chan_ieee = ic->ic_curchan->ic_ieee; + rh->wr_chan_maxpow = 0; +} + +static void +wtap_tx_tap(struct wtap_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + const struct ieee80211_rate_table *rt = ic->ic_rt; + struct wtap_tx_radiotap_header *th = &sc->sc_tx_th; + + th->wt_flags = 0; + if (rt->rateCount) { + /* choose the fastest rate */ + th->wt_rate = IEEE80211_RV(rt->info[rt->rateCount - 1].dot11Rate); + } + th->wt_chan_flags = IEEE80211_CHAN_2GHZ; + th->wt_chan_freq = ic->ic_curchan->ic_freq; + th->wt_chan_ieee = ic->ic_curchan->ic_ieee; + th->wt_chan_maxpow = 0; +} + static void wtap_beacon_intrp(void *arg) { @@ -261,8 +298,10 @@ wtap_beacon_intrp(void *arg) wh = mtod(m, struct ieee80211_frame *); memcpy(&wh[1], &tsf, sizeof(tsf)); - if (ieee80211_radiotap_active_vap(vap)) - ieee80211_radiotap_tx(vap, m); + if (ieee80211_radiotap_active_vap(vap)) { + wtap_tx_tap(sc); + ieee80211_radiotap_tx(vap, m); + } #if 0 medium_transmit(avp->av_md, avp->id, m); @@ -459,6 +498,8 @@ static int wtap_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, const struct ieee80211_bpf_params *params) { + struct ieee80211com *ic = ni->ni_ic; + struct wtap_softc *sc = ic->ic_softc; #if 0 DWTAP_PRINTF("%s, %p\n", __func__, m); #endif @@ -466,6 +507,7 @@ wtap_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, struct wtap_vap *avp = WTAP_VAP(vap); if (ieee80211_radiotap_active_vap(vap)) { + wtap_tx_tap(sc); ieee80211_radiotap_tx(vap, m); } if (m->m_flags & M_TXCB) @@ -529,6 +571,10 @@ wtap_rx_proc(void *arg, int npending) #if 0 ieee80211_dump_pkt(ic, mtod(m, caddr_t), 0,0,0); #endif + if (ieee80211_radiotap_active(ic)) { + uint64_t tsf = wtap_hal_get_tsf(sc->hal); + wtap_rx_tap(sc, tsf); + } /* * Use arbitrary but sane values, and do the correct conversion @@ -600,6 +646,7 @@ wtap_transmit(struct ieee80211com *ic, struct mbuf *m) struct ieee80211_node *ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; struct ieee80211vap *vap = ni->ni_vap; + struct wtap_softc *sc = ic->ic_softc; struct wtap_vap *avp = WTAP_VAP(vap); struct ieee80211_key *k; struct ieee80211_frame *wh; @@ -612,8 +659,10 @@ wtap_transmit(struct ieee80211com *ic, struct mbuf *m) return (ENOBUFS); } - if (ieee80211_radiotap_active_vap(vap)) + if (ieee80211_radiotap_active_vap(vap)) { + wtap_tx_tap(sc); ieee80211_radiotap_tx(vap, m); + } if (m->m_flags & M_TXCB) ieee80211_process_callback(ni, m, 0); ieee80211_free_node(ni); @@ -668,7 +717,9 @@ wtap_attach(struct wtap_softc *sc, const uint8_t *macaddr) | IEEE80211_C_IBSS /* ibss, nee adhoc, mode */ | IEEE80211_C_STA /* station mode */ | IEEE80211_C_HOSTAP /* hostap mode */ - | IEEE80211_C_WPA; /* capable of WPA1+WPA2 */ + | IEEE80211_C_WPA /* capable of WPA1+WPA2 */ + | IEEE80211_C_MONITOR /* Enable monitor mode */ + ; ic->ic_cryptocaps = IEEE80211_CRYPTO_WEP diff --git a/sys/dev/wtap/if_wtapioctl.h b/sys/dev/wtap/if_wtapioctl.h index 05f88a5dcb81..f9fe35813576 100644 --- a/sys/dev/wtap/if_wtapioctl.h +++ b/sys/dev/wtap/if_wtapioctl.h @@ -139,41 +139,42 @@ struct wtap_stats { /* * Radio capture format. */ -#define WTAP_RX_RADIOTAP_PRESENT ( \ +#define WTAP_RX_RADIOTAP_PRESENT ( \ + (1 << IEEE80211_RADIOTAP_TSFT) | \ + (1 << IEEE80211_RADIOTAP_FLAGS) | \ + (1 << IEEE80211_RADIOTAP_RATE) | \ + (1 << IEEE80211_RADIOTAP_XCHANNEL) | \ 0) struct wtap_rx_radiotap_header { struct ieee80211_radiotap_header wr_ihdr; -#if 0 + u_int64_t wr_tsf; u_int8_t wr_flags; u_int8_t wr_rate; - int8_t wr_antsignal; - int8_t wr_antnoise; - u_int8_t wr_antenna; - u_int8_t wr_pad[3]; + u_int8_t wr_pad[2]; u_int32_t wr_chan_flags; u_int16_t wr_chan_freq; u_int8_t wr_chan_ieee; - int8_t wr_chan_maxpow; -#endif + u_int8_t wr_chan_maxpow; } __packed __aligned(8); -#define WTAP_TX_RADIOTAP_PRESENT ( \ +#define WTAP_TX_RADIOTAP_PRESENT ( \ + (1 << IEEE80211_RADIOTAP_FLAGS) | \ + (1 << IEEE80211_RADIOTAP_RATE) | \ + (1 << IEEE80211_RADIOTAP_XCHANNEL) | \ 0) struct wtap_tx_radiotap_header { struct ieee80211_radiotap_header wt_ihdr; -#if 0 + u_int8_t wt_flags; u_int8_t wt_rate; - u_int8_t wt_txpower; - u_int8_t wt_antenna; + u_int8_t wr_pad[2]; u_int32_t wt_chan_flags; u_int16_t wt_chan_freq; u_int8_t wt_chan_ieee; - int8_t wt_chan_maxpow; -#endif -} __packed; + u_int8_t wt_chan_maxpow; +} __packed __aligned(8); #endif From nobody Tue Jun 16 14:58:20 2026 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 4gfqqk1jBLz6hJRp for ; Tue, 16 Jun 2026 14:58: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfqqj5yydz40XN for ; Tue, 16 Jun 2026 14:58:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781621905; 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; bh=v7+pLm+V0bPSb73LlmeqyNhGgSaKRuuXn/dezb9Xv4k=; b=cuQz/jH+PsCbbFxeIq7Y6e7Rq+g8NWpVtSA7/elInyjJ7+Gjv0Vv40elN2uoEjZHtNBdBY oZrUtfkpjl19p8HtowokukQM0XtLqP5IiBVHDzcW6M1r79twvXgO+9enO58VmpbJG7QrXh kyMammm7oZCAJZS/E8Lr0p9rhdIT2kSkTiUdg/6NRFq/2fMJObni3ujXU2UFXmFFeqOc3V XK+Hc4sIYzZ8KyW1umzu53LrAZON53SePnqpxLTNWX/TtzGDOjKGvuNDcqkV+juQi+wDDx 6HdE04P0ftTx2GQaS+C8pWgtb4GRMMS61kczHbmCL7frGbeE4NxdZFuSTNdU5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781621905; a=rsa-sha256; cv=none; b=eVUjf9lPSPZXTikvWQHXlcNZcHtXBETcdXN3jMNzQ38J3hx9w0CeIXJrKdHIiQu5nnc81t 2LaqOUPNPzXPkAkeM3ighNjqU6irfsxXbTa4yR0ttXTkaqzArwhLZt/w7cYssasiuFN7Cu TYjXfWiwyU3zcOCOycj3cOK16dwP1nnxz5E4KVxrjrJwSetmryyGKpnjTcfKZiGgbYi7PL Bq05ZpBl+dH2KZC52CsGqsUkgpcZMI33WQAMdLxV1xINtsfMf3+KIEuiX4ylbOuaisOc8j MTj8h1ZyyVMOM2LSkPsZdNEJZ+yXtLXGP1c9ktpffO0eiOVPB0TYWTCvpAygjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781621905; 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; bh=v7+pLm+V0bPSb73LlmeqyNhGgSaKRuuXn/dezb9Xv4k=; b=C+cf9yvvyQyLl3LTGA9tHPdvFWVT+b2Q5BjfNXbppunmeD0Wtlz5elAcw0RLo7h5TB4cDz DQPQXnavuqOGALS3j1hCKI1qLxzFQCyXS97hMZtWM50wR/2DQF1CPdG8R/wFRn/NIo7/yI sKtriGaRzsLty7XyMHSAaakXprJWFwFtV1OCgAYpJBuQrV3/jNSk/O2OCx3TjWrY80ib1/ L4WFeQSJ/KRVwUdnobja2aPW35d4e1AQC1oYk0qgGnwzBepHBsvM8IpfK6ISxyF2lXG+03 MNN4N7xPVt6T1USXBCNo7W/8P3kctivmLFgtbx6OCHEDmlySFOD0t9G7Vd/dLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfqqj5HmvzVFY for ; Tue, 16 Jun 2026 14:58:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3bd39 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 14:58:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: EN-WEU WU From: Adrian Chadd Subject: git: 9ef75e05ba91 - main - wtap: Remove bogus NULL check in wtap_transmit 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 9ef75e05ba91b72c10a411fdd21fa5ca98efa0c9 Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 14:58:20 +0000 Message-Id: <6a31648c.3bd39.7b98d671@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=9ef75e05ba91b72c10a411fdd21fa5ca98efa0c9 commit 9ef75e05ba91b72c10a411fdd21fa5ca98efa0c9 Author: EN-WEU WU AuthorDate: 2026-06-16 14:34:39 +0000 Commit: Adrian Chadd CommitDate: 2026-06-16 14:34:39 +0000 wtap: Remove bogus NULL check in wtap_transmit The node pointer is guaranteed to be non-NULL by the net80211 stack. The original check was also ineffective as it dereferenced ni->ni_vap before the NULL check. Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D54547 --- sys/dev/wtap/if_wtap.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/dev/wtap/if_wtap.c b/sys/dev/wtap/if_wtap.c index 376b63e38f2b..51733a05bd93 100644 --- a/sys/dev/wtap/if_wtap.c +++ b/sys/dev/wtap/if_wtap.c @@ -601,12 +601,8 @@ wtap_transmit(struct ieee80211com *ic, struct mbuf *m) struct ieee80211vap *vap = ni->ni_vap; struct wtap_vap *avp = WTAP_VAP(vap); - if(ni == NULL){ - printf("m->m_pkthdr.rcvif is NULL we can't radiotap_tx\n"); - }else{ - if (ieee80211_radiotap_active_vap(vap)) - ieee80211_radiotap_tx(vap, m); - } + if (ieee80211_radiotap_active_vap(vap)) + ieee80211_radiotap_tx(vap, m); if (m->m_flags & M_TXCB) ieee80211_process_callback(ni, m, 0); ieee80211_free_node(ni); From nobody Tue Jun 16 15:02:04 2026 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 4gfqvx1JmYz6hK1j for ; Tue, 16 Jun 2026 15:02: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfqvx0RpZz43Hr for ; Tue, 16 Jun 2026 15:02:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781622125; 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=wiVwgVVX/SY41vtwbaABdy/A5d/o28YUtzDziYLedVk=; b=iN4JqhMOwqks/OTDIjh//kndRgnXLHDmyl+npUXOdGFaHS5eqkoiwfkgik11iLNDHEE1sd dck45+npgpxwnoeJCcGo6cGUwC3kM8rAKgzZv7jrlczLMTD7HhWGLxXJgm9tBN5JIO9drj UdO8zCsYZjiZq/B05HKR4RO0ar7DOlg9aFVhhCpkSEnjOXitR14WP2DZADWPB6X3QQXuGY UM3A+jd3H15c4qjxgkqJD2G9nhcrp8H/95gUpKcX/xFmhDeestZHHeFVRDo/8oeckYAVvx cp2UWVpYD5+vP5u+jyduvTuv1HTKHOB1dNDvq2TbPdoYDOs+rNVNbYxKyan1Wg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781622125; a=rsa-sha256; cv=none; b=XMe5BwkKFrNvhlMwPzIXlZGNgOweZsBgyXlRBXk+OostpQ8B5YXGbZNl5y2nyd2kjMHTkx 01OgLUziVzij7l47lLdd7btZUWmURxqO44LhnsNfrz7+A8rrd5LW4ZoymsB+B0/5d2nXXA yG0/Z8f65o4jNKkW5LGs3HdSJGdHsuMFXzCAIzl3a+MCNgH4VTELtHgm94SaeNdAReTlmm 2yE17Av7vWzJ5/uK8pwHXx0k2DVyRV/H94HJGW5hDxepSh+kd4Av3g+HT22YCoMchcmNho 2Z6GoV3NqnJIon1kmHz31tBJihggBptiIagTpcUwT0nI3IcHENoCyIbA9hiklw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781622125; 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=wiVwgVVX/SY41vtwbaABdy/A5d/o28YUtzDziYLedVk=; b=NN3lBB1nE+nLaPeLG6LaBOx8OIH7aaMqOltvHXou5WfGCPC6Ec+uXrzz0pm13j4oEw5eOc tK8iz2wkllR0q7gfTjDE61hobX8eB/JcVLwQehHOpRrmKAVblNtx2W+1QB2jK5JEdEdwZ7 fqG/SBlUr+/ipkmVp/R5EfNRnMshVJrzUMilnlphY+0j7EJC263RMT8WQI9r/aJOuUQx1X jbN/QlAQXdGYCbj+9ahVfCcsV7um9u/iW5wa+4ld4XURCv0AwWKGTLlrdGYm7lqBkR1HWu FQt3vrIRs2LOwRB8aa6uUujhBfVzIMTUTilvwtVhkD+EDh0VRwB+4A9+V6gQsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfqvx01FBzVR2 for ; Tue, 16 Jun 2026 15:02:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3c16f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 15:02:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Siva Mahadevan Subject: git: f38cbefef809 - main - GENERIC: enable extended error strings on all archs 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: siva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f38cbefef8090f3363e5685c5a3b30ffbf1d3ad0 Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 15:02:04 +0000 Message-Id: <6a31656c.3c16f.484102ec@gitrepo.freebsd.org> The branch main has been updated by siva: URL: https://cgit.FreeBSD.org/src/commit/?id=f38cbefef8090f3363e5685c5a3b30ffbf1d3ad0 commit f38cbefef8090f3363e5685c5a3b30ffbf1d3ad0 Author: Siva Mahadevan AuthorDate: 2025-07-15 16:45:24 +0000 Commit: Siva Mahadevan CommitDate: 2026-06-16 15:01:32 +0000 GENERIC: enable extended error strings on all archs This follows commit 3296fda0c309c873ae37a0a4e25ded3ae04b421c. PR: 289236 Reviewed by: kib MFC after: 3 days --- sys/amd64/conf/GENERIC | 2 +- sys/arm/conf/std.armv7 | 1 + sys/arm64/conf/std.arm64 | 2 +- sys/i386/conf/GENERIC | 1 + sys/powerpc/conf/GENERIC | 1 + sys/riscv/conf/GENERIC | 1 + 6 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index 1376011de4ee..f9cef6c71d67 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -27,7 +27,7 @@ options SCHED_ULE # ULE scheduler options SCHED_4BSD # Original 4.xBSD scheduler options NUMA # Non-Uniform Memory Architecture support options PREEMPTION # Enable kernel thread preemption -options EXTERR_STRINGS +options EXTERR_STRINGS # Retain exterror(9) strings in the kernel options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols diff --git a/sys/arm/conf/std.armv7 b/sys/arm/conf/std.armv7 index 4ef60c331212..1f8e93fe53f3 100644 --- a/sys/arm/conf/std.armv7 +++ b/sys/arm/conf/std.armv7 @@ -3,6 +3,7 @@ options HZ=1000 options PREEMPTION # Enable kernel thread preemption +options EXTERR_STRINGS # Retain exterror(9) strings in the kernel options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols diff --git a/sys/arm64/conf/std.arm64 b/sys/arm64/conf/std.arm64 index 8069703626c9..5f02a0291721 100644 --- a/sys/arm64/conf/std.arm64 +++ b/sys/arm64/conf/std.arm64 @@ -7,7 +7,7 @@ makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support options SCHED_ULE # ULE scheduler options NUMA # Non-Uniform Memory Architecture support options PREEMPTION # Enable kernel thread preemption -options EXTERR_STRINGS +options EXTERR_STRINGS # Retain exterror(9) strings in the kernel options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index 595683883686..5f1e81b46129 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -29,6 +29,7 @@ makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption +options EXTERR_STRINGS # Retain exterror(9) strings in the kernel options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols diff --git a/sys/powerpc/conf/GENERIC b/sys/powerpc/conf/GENERIC index f0aacb49f6e1..155a8c4eeeb5 100644 --- a/sys/powerpc/conf/GENERIC +++ b/sys/powerpc/conf/GENERIC @@ -34,6 +34,7 @@ options PSERIES # PAPR-compliant systems options FDT options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption +options EXTERR_STRINGS # Retain exterror(9) strings in the kernel options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index cce2787ed5d7..ec248bd38813 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -25,6 +25,7 @@ makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption +options EXTERR_STRINGS # Retain exterror(9) strings in the kernel options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols From nobody Tue Jun 16 15:07:05 2026 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 4gfr1j1wzCz6hK7M for ; Tue, 16 Jun 2026 15:07: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfr1j0x2Dz43nd for ; Tue, 16 Jun 2026 15:07:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781622425; 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=8HzlmOi70dSiwfFwHIVOU2l7SG2CUC6OMUVbwYAXC4k=; b=FFAlMb8UnNHR6XrmZ22SaQUkb/jAWYqYL/ADO9IfOd6ayO0/68dAMZTaPYm+ItTMnKRwnc b/AspzWf2uSucuIeympvcquI2rp/5XziKiDnFodqJWBgg3Zg3vvUvkezmzVQTzLmexxowz oOtEvNcGjM1Yui5lgub560j/weysh4vg5gbCoGs1VG9jtznvYjUo8WSqnY14LWbnkpCNZP ehp2kCGCeOluZUsv71d5pus4QfvhgXsJk9Hp0H6x4j5Wf4V/3C8qZ3jvqg77P0vTurl3Dx wExUP/NelLwA4WU8/xrUy4IUPsQLMonSah3wW/hFHeXf/fUX6R3hGnw19qbF8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781622425; a=rsa-sha256; cv=none; b=fnV2+SIG2bDMmIuFGe7jvUp6Kdg9nasxXq23+rvok8NTZOCqbklcel4trQ/EP2U5T+idz1 /71H3vbzqQ2p+I8Fr0iPUXQvyIjshUq+jF+YN4Rl1QVuCppWChRIjBH+SO2ULr2ILkdsdA rKAuc+qJTle1Pk3RzVy1H1Gt+cBh/B1ewuaUs5zz6R7bxCBnF+XFyZV9vTLKQk4YY8TUWQ iADw4veCWG64U5mrKEPj/Hfun5YBHNKRE9UKqJkVEnu1mHgClGqHi/dENT05PcaFC/jK9Z S9XjxiCuPlqSI0ZFSDPWaqoXQP/V2fPj5zgZOo+27LLSo2pm+iwBSqpgxH4sAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781622425; 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=8HzlmOi70dSiwfFwHIVOU2l7SG2CUC6OMUVbwYAXC4k=; b=GsDOTocBLDlBuFWeMEpNvKV2nD2VLdz5lv4Bo8sJ6hA0uWEMvt5CXWP81xTSY4/s5jJcK1 5BB1OtII9R/BlcyI7T0e6giVrPDi8BlFCVX1U46M2OL2BEcAF7Gi7aV4eZ2RUnXYIIrJK7 ojq++xov28DH8Z0eCq4VlqfCjG1Rp6aZxLkyKxFQ5IpX6KTY0/05tutyzpwGdJpco3BUBC +LRR3t00JBSzdGUPstafHy8G/GggDSzfNT1b/Ixhtb30x75eK5L4i/RxeKMdzcW3kGeToh B0kcq/jjfhJbK4Gn+KnvhcB3q5AQAQwLBl+qNGf+gtgr924m5rpiuxNHXIabVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfr1j0K3ZzVhB for ; Tue, 16 Jun 2026 15:07:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3bc7e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 15:07:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 9a10af53dbf5 - main - Revert "kldload: Improve error handling" 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 9a10af53dbf5b1268d6b74e94f2f8054caab9243 Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 15:07:05 +0000 Message-Id: <6a316699.3bc7e.6c216c1b@gitrepo.freebsd.org> The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9a10af53dbf5b1268d6b74e94f2f8054caab9243 commit 9a10af53dbf5b1268d6b74e94f2f8054caab9243 Author: Ed Maste AuthorDate: 2026-06-16 15:06:17 +0000 Commit: Ed Maste CommitDate: 2026-06-16 15:06:30 +0000 Revert "kldload: Improve error handling" It broke the test suite, and will be recommitted when fixed. This reverts commit db887713de2bf5c77494220a9e0ddfa7d4290155. Reported by: markj --- lib/libc/gen/exterr_cat_filenames.h | 1 - sbin/kldload/kldload.c | 17 ++++---- sys/kern/kern_linker.c | 83 +++++++++++++------------------------ sys/sys/exterr_cat.h | 1 - 4 files changed, 37 insertions(+), 65 deletions(-) diff --git a/lib/libc/gen/exterr_cat_filenames.h b/lib/libc/gen/exterr_cat_filenames.h index 90e231879ccd..be65c1990af5 100644 --- a/lib/libc/gen/exterr_cat_filenames.h +++ b/lib/libc/gen/exterr_cat_filenames.h @@ -12,7 +12,6 @@ [EXTERR_CAT_FILEDESC] = "kern/kern_descrip.c", [EXTERR_CAT_PROCEXIT] = "kern/kern_exit.c", [EXTERR_CAT_FORK] = "kern/kern_fork.c", - [EXTERR_CAT_LINKER] = "kern/kern_linker.c", [EXTERR_CAT_GENIO] = "kern/sys_generic.c", [EXTERR_CAT_VFSBIO] = "kern/vfs_bio.c", [EXTERR_CAT_INOTIFY] = "kern/vfs_inotify.c", diff --git a/sbin/kldload/kldload.c b/sbin/kldload/kldload.c index 79c28e19ed5d..82469a2d40f3 100644 --- a/sbin/kldload/kldload.c +++ b/sbin/kldload/kldload.c @@ -95,9 +95,8 @@ path_check(const char *kldname, int quiet) if (sb.st_dev != dev || sb.st_ino != ino) { if (!quiet) - warnx( -"%s will be loaded from %s, not the current directory", - kldname, element); + warnx("%s will be loaded from %s, not the " + "current directory", kldname, element); break; } else if (sb.st_dev == dev && sb.st_ino == ino) break; @@ -172,13 +171,15 @@ main(int argc, char** argv) if (!quiet) { switch (errno) { case EEXIST: - warnx( -"can't load %s: module already loaded or in kernel", argv[0]); + warnx("can't load %s: module " + "already loaded or " + "in kernel", argv[0]); break; case ENOEXEC: - warnx( -"an error occurred while loading module %s. Please check dmesg(8) for more details.", - argv[0]); + warnx("an error occurred while " + "loading module %s. " + "Please check dmesg(8) for " + "more details.", argv[0]); break; default: warn("can't load %s", argv[0]); diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 770374449a17..9559b5233a3e 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -32,12 +32,10 @@ #include "opt_hwpmc_hooks.h" #include "opt_hwt_hooks.h" -#define EXTERR_CATEGORY EXTERR_CAT_LINKER #include #include #include #include -#include #include #include #include @@ -457,14 +455,13 @@ linker_load_file(const char *filename, linker_file_t *result) /* Refuse to load modules if securelevel raised */ if (prison0.pr_securelevel > 0) - return (EXTERROR(EPERM, "security level %jd", - prison0.pr_securelevel)); + return (EPERM); sx_assert(&kld_sx, SA_XLOCKED); lf = linker_find_file_by_name(filename); if (lf) { - KLD_DPF(FILE, -("linker_load_file: file %s is already loaded, incrementing refs\n", filename)); + KLD_DPF(FILE, ("linker_load_file: file %s is already loaded," + " incrementing refs\n", filename)); *result = lf; lf->refs++; return (0); @@ -511,7 +508,7 @@ linker_load_file(const char *filename, linker_file_t *result) */ if (modules && TAILQ_EMPTY(&lf->modules)) { linker_file_unload(lf, LINKER_UNLOAD_FORCE); - return (EXTERROR(ENOEXEC, "no modules loaded")); + return (ENOEXEC); } linker_file_enable_sysctls(lf); @@ -538,19 +535,17 @@ linker_load_file(const char *filename, linker_file_t *result) __func__, filename); /* - * Format not recognized, version incompatible, or - * otherwise unloadable. When loading a module that is - * statically built into the kernel EEXIST percolates - * back up as the return value. Preserve this so that - * apps like sysinstall can recognize this special case - * and not post bogus dialog boxes. + * Format not recognized or otherwise unloadable. + * When loading a module that is statically built into + * the kernel EEXIST percolates back up as the return + * value. Preserve this so that apps like sysinstall + * can recognize this special case and not post bogus + * dialog boxes. */ if (error != EEXIST) - error = EXTERROR(ENOEXEC, - "module format or version error"); + error = ENOEXEC; } else - error = EXTERROR(ENOENT, "kld file not found"); - /* Nothing found */ + error = ENOENT; /* Nothing found */ return (error); } @@ -2254,7 +2249,6 @@ linker_load_module(const char *kldname, const char *modname, struct linker_file *parent, const struct mod_depend *verinfo, struct linker_file **lfpp) { - modlist_t mod; linker_file_t lfdep; const char *filename; char *pathname; @@ -2265,15 +2259,16 @@ linker_load_module(const char *kldname, const char *modname, /* * We have to load KLD */ - MPASS(verinfo == NULL); + KASSERT(verinfo == NULL, ("linker_load_module: verinfo" + " is not NULL")); if (!linker_root_mounted()) - return (EXTERROR(ENXIO, "root not yet mounted")); + return (ENXIO); pathname = linker_search_kld(kldname); } else { if (modlist_lookup2(modname, verinfo) != NULL) - return (EXTERROR(EEXIST, "module already loaded")); + return (EEXIST); if (!linker_root_mounted()) - return (EXTERROR(ENXIO, "root not yet mounted")); + return (ENXIO); if (kldname != NULL) pathname = strdup(kldname, M_LINKER); else @@ -2284,7 +2279,7 @@ linker_load_module(const char *kldname, const char *modname, strlen(modname), verinfo); } if (pathname == NULL) - return (EXTERROR(ENOENT, "kld file not found")); + return (ENOENT); /* * Can't load more than one file with the same basename XXX: @@ -2293,36 +2288,16 @@ linker_load_module(const char *kldname, const char *modname, * provide different versions of the same modules. */ filename = linker_basename(pathname); - lfdep = linker_find_file_by_name(filename); - if (lfdep) { - mod = modlist_lookup(modname, 0); - MPASS(mod != NULL); - - if (modname && verinfo && - modlist_lookup2(modname, verinfo) == NULL) { - /* - * Desired module is already loaded, but the correct - * version does not exist. - */ - error = EXTERROR(ENOEXEC, - "incompatible module version %jd already loaded", - mod->version); - } else { - error = EXTERROR(EEXIST, - "module version %jd already loaded", - mod->version); - } - } else do { + if (linker_find_file_by_name(filename)) + error = EEXIST; + else do { error = linker_load_file(pathname, &lfdep); if (error) break; if (modname && verinfo && modlist_lookup2(modname, verinfo) == NULL) { - mod = modlist_lookup(modname, 0); - error = EXTERROR(ENOEXEC, - "incompatible module version %jd already loaded", - mod->version); linker_file_unload(lfdep, LINKER_UNLOAD_FORCE); + error = ENOENT; break; } if (parent) @@ -2368,11 +2343,10 @@ linker_load_dependencies(linker_file_t lf) ver = ((const struct mod_version *)mp->md_data)->mv_version; mod = modlist_lookup(modname, ver); if (mod != NULL) { - printf( -"interface %s.%d already present in the KLD '%s'!\n", - modname, ver, mod->container->filename); - return (EXTERROR(EEXIST, - "module version %jd already loaded", ver)); + printf("interface %s.%d already present in the KLD" + " '%s'!\n", modname, ver, + mod->container->filename); + return (EEXIST); } } @@ -2402,9 +2376,8 @@ linker_load_dependencies(linker_file_t lf) } error = linker_load_module(NULL, modname, lf, verinfo, NULL); if (error) { - printf( -"KLD %s: depends on %s - not available or version mismatch\n", - lf->filename, modname); + printf("KLD %s: depends on %s - not available or" + " version mismatch\n", lf->filename, modname); break; } } diff --git a/sys/sys/exterr_cat.h b/sys/sys/exterr_cat.h index 1c3f894e8aff..edc23d7dfbe6 100644 --- a/sys/sys/exterr_cat.h +++ b/sys/sys/exterr_cat.h @@ -41,7 +41,6 @@ #define EXTERR_CAT_PROCEXIT 16 #define EXTERR_CAT_VMM 17 #define EXTERR_CAT_HWPMC_IBS 18 -#define EXTERR_CAT_LINKER 19 #endif From nobody Tue Jun 16 15:37:10 2026 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 4gfrhR2B9Yz6hMGj for ; Tue, 16 Jun 2026 15:37: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfrhQ62D4z470g for ; Tue, 16 Jun 2026 15:37:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781624230; 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=vlCfmKtprQgYF4I8Enkra/6SLQL5PfE5ctJJ1QPslrA=; b=oWyFQ2HN51do0u40AgvIgalpPNMXuTamNFZakBPFUHY5Rjd6Ox7JxluYlmT01C849C7Sjx BAMa8+kG8z1tieXz/9RpAxtk0A7yNE8+kuEaWVErU3WHvp2BfCyVJ9cJAGtcZ8vSMpqkEV AuyVhU/kL3WdX4rTDEhwE7RcBHRG7KLiFQR+DxRW9bRwQqPOGaT0czbXBQp8s2MQzWWDME /1y8/zPi4EhHWdFNyH1M3D+nlI6MBcm1qinMEi04V2lf/p9bv5xba/7N7W8ARiqL5kwVFs fCuGLUQr+WeOt9sV7qUKtoce8FkuBGbGs37gXB7DVU45Dr4bB0Q6pl4jPIzyrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781624230; a=rsa-sha256; cv=none; b=rrwDsyXVl7NWkGgFXxRcDNvPQtzBBwKzxcP4HqBOmV//8MlGbhTyPBrBkUHBOE0kNNB3ek 1Aq2qGQj2wKNEjNQPzaI1eFpQiUguRiEvtbxRz1ygZp965VUYZvgGtKd2Abh7xqL4c3A3r qrEGJfXWTfer/Eyq2UK9zL6aLiO4v5z02ImZj8ANYCV8N0Tetx0BWXiL7Mm+tM81xHfinW IDCOZWt8RixROHEWlZNk0nemoe5IHtp3YKXOOwq+DjI/+IHXy9suKpOEAwg0N8YSUt0VJ3 FUK/fMOzU/zIU0CmX9jkN5+7/24vGJ3rYvCMp5EQsCii/BH5AeOPa1pNLhCKYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781624230; 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=vlCfmKtprQgYF4I8Enkra/6SLQL5PfE5ctJJ1QPslrA=; b=W9zt3L8Mxv3iZ6PhY8nmrcBTcBhcKtarRE+3AEL9ZiTCyGqmn0bcEwk3ia7pz+mjCmkizq VycvtbByZWgOazBBybFLX0C/k5s2TkmHZkLYgf43HlR8u/ePpA/v+mTEogDmBJ/aJJTDvq uUGG6yWM8aTH/++soPpQxAKx7yJFtIiecIJ+TIDaISI3jLKtPuwoBBdRoWpXktxbZfg4rQ /0qWVouu6SDFAPScsnyFoQmiokS0FVePklq1z1ej7M/BAmuHAHfeDo+hqtalWRm5wE+GSE gfx+tawO++24+fGli829+1Tj2DOFDvCejy6YVQA2vyrZk64Gf5QETyZiU/UowA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfrhQ5MKFzXRt for ; Tue, 16 Jun 2026 15:37:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 40f86 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 15:37:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 2e6615b26bb5 - main - netexport: Move struct netexport in a .h file and refcnt it 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2e6615b26bb51ceadc99121f16856aad9345a3cf Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 15:37:10 +0000 Message-Id: <6a316da6.40f86.5c81b1a5@gitrepo.freebsd.org> The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=2e6615b26bb51ceadc99121f16856aad9345a3cf commit 2e6615b26bb51ceadc99121f16856aad9345a3cf Author: Rick Macklem AuthorDate: 2026-06-16 15:35:30 +0000 Commit: Rick Macklem CommitDate: 2026-06-16 15:35:30 +0000 netexport: Move struct netexport in a .h file and refcnt it This patch moves "struct netexport" into a separate netexport.h file and refcounts the structure, plus adds a few fields that will be used in a future NFS server commit. The patch also includes some helper functions for handling the netextport structure: vfs_netexport_alloc(), vfs_netexport_acquire(), vfs_netexport_release() and vfs_netexport_reset(). Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D57553 --- sys/kern/vfs_export.c | 79 ++++++++++++++++++++++++++++---------------- sys/kern/vfs_mount.c | 2 +- sys/sys/mount.h | 2 ++ sys/sys/netexport.h | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 145 insertions(+), 29 deletions(-) diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index 566dd3d8770d..6dc4eafc4c60 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -58,6 +58,7 @@ #include #include +#include #include #include @@ -72,31 +73,13 @@ static struct radix_node_head *vfs_create_addrlist_af( struct radix_node_head **prnh, int off); #endif static int vfs_free_netcred(struct radix_node *rn, void *w); +static struct netexport *vfs_netexport_alloc(void); +static void vfs_netexport_reset(struct netexport *nep); static void vfs_free_addrlist_af(struct radix_node_head **prnh); static int vfs_hang_addrlist(struct mount *mp, struct netexport *nep, struct export_args *argp); static struct netcred *vfs_export_lookup(struct mount *, struct sockaddr *); -/* - * Network address lookup element - */ -struct netcred { - struct radix_node netc_rnodes[2]; - uint64_t netc_exflags; - struct ucred *netc_anon; - int netc_numsecflavors; - int netc_secflavors[MAXSECFLAVORS]; -}; - -/* - * Network export information - */ -struct netexport { - struct netcred ne_defexported; /* Default export */ - struct radix_node_head *ne4; - struct radix_node_head *ne6; -}; - /* * Build hash lists of net addresses and hang them off the mount point. * Called by vfs_export() to set up the lists of export addresses. @@ -350,7 +333,7 @@ vfs_export(struct mount *mp, struct export_args *argp, bool do_exjail) } vfs_free_addrlist(nep); mp->mnt_export = NULL; - free(nep, M_MOUNT); + vfs_netexport_release(nep); nep = NULL; MNT_ILOCK(mp); cr = mp->mnt_exjail; @@ -369,7 +352,7 @@ vfs_export(struct mount *mp, struct export_args *argp, bool do_exjail) MNT_IUNLOCK(mp); if (do_exjail && nep != NULL) { vfs_free_addrlist(nep); - memset(nep, 0, sizeof(*nep)); + vfs_netexport_reset(nep); new_nep = true; } } else if (mp->mnt_exjail->cr_prison != pr) { @@ -379,16 +362,14 @@ vfs_export(struct mount *mp, struct export_args *argp, bool do_exjail) } else MNT_IUNLOCK(mp); if (nep == NULL) { - nep = malloc(sizeof(struct netexport), M_MOUNT, - M_WAITOK | M_ZERO); - mp->mnt_export = nep; + nep = mp->mnt_export = vfs_netexport_alloc(); new_nep = true; } if (argp->ex_flags & MNT_EXPUBLIC) { if ((error = vfs_setpublicfs(mp, nep, argp)) != 0) { if (new_nep) { mp->mnt_export = NULL; - free(nep, M_MOUNT); + vfs_netexport_release(nep); } goto out; } @@ -408,7 +389,7 @@ vfs_export(struct mount *mp, struct export_args *argp, bool do_exjail) if ((error = vfs_hang_addrlist(mp, nep, argp))) { if (new_nep) { mp->mnt_export = NULL; - free(nep, M_MOUNT); + vfs_netexport_release(nep); } goto out; } @@ -507,7 +488,7 @@ tryagain: mp->mnt_flag &= ~(MNT_EXPORTED | MNT_DEFEXPORTED); MNT_IUNLOCK(mp); vfs_free_addrlist(mp->mnt_export); - free(mp->mnt_export, M_MOUNT); + vfs_netexport_release(mp->mnt_export); mp->mnt_export = NULL; } else MNT_IUNLOCK(mp); @@ -698,3 +679,45 @@ vfs_stdcheckexp(struct mount *mp, struct sockaddr *nam, uint64_t *extflagsp, lockmgr(&mp->mnt_explock, LK_RELEASE, NULL); return (0); } + +static struct netexport * +vfs_netexport_alloc(void) +{ + struct netexport *nep; + + nep = malloc(sizeof(struct netexport), M_MOUNT, M_WAITOK | M_ZERO); + refcount_init(&nep->ne_ref, 1); + mtx_init(&nep->ne_mtx, "mntexplock", NULL, MTX_DEF); + return (nep); +} + +static void +vfs_netexport_reset(struct netexport *nep) +{ + + KASSERT(refcount_load(&nep->ne_ref) > 0, + ("vfs_netexport_reset: invalid refcount")); + memset(&nep->ne_startzero, 0, __rangeof(struct netexport, ne_startzero, + ne_endzero)); +} + +u_int +vfs_netexport_acquire(struct netexport *nep) +{ + + KASSERT(refcount_load(&nep->ne_ref) > 0, + ("vfs_netexport_acquire: invalid refcount")); + return (refcount_acquire(&nep->ne_ref)); +} + +void +vfs_netexport_release(struct netexport *nep) +{ + + KASSERT(refcount_load(&nep->ne_ref) > 0, + ("vfs_netexport_release: invalid refcount")); + if (!refcount_release(&nep->ne_ref)) + return; + mtx_destroy(&nep->ne_mtx); + free(nep, M_MOUNT); +} diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index d7e6683e0446..4d724a0f1c38 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -765,7 +765,7 @@ vfs_mount_destroy(struct mount *mp) } if (mp->mnt_export != NULL) { vfs_free_addrlist(mp->mnt_export); - free(mp->mnt_export, M_MOUNT); + vfs_netexport_release(mp->mnt_export); } vfsconf_lock(); mp->mnt_vfc->vfc_refcount--; diff --git a/sys/sys/mount.h b/sys/sys/mount.h index fa4c98d93bf8..dc4a49828bbe 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -1061,6 +1061,8 @@ void vfs_exjail_delete(struct prison *); int vfs_export /* process mount export info */ (struct mount *, struct export_args *, bool); void vfs_free_addrlist(struct netexport *); +u_int vfs_netexport_acquire(struct netexport *); +void vfs_netexport_release(struct netexport *); void vfs_allocate_syncvnode(struct mount *); void vfs_deallocate_syncvnode(struct mount *); int vfs_donmount(struct thread *td, uint64_t fsflags, diff --git a/sys/sys/netexport.h b/sys/sys/netexport.h new file mode 100644 index 000000000000..4d0e7f987f93 --- /dev/null +++ b/sys/sys/netexport.h @@ -0,0 +1,91 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * 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 University 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_NETEXPORT_H_ +#define _SYS_NETEXPORT_H_ + +/* + * This file must be included after net/radix.h so that "struct radix_node" + * is defined. + */ +#ifdef _KERNEL +/* + * Network address lookup element + */ +struct netcred { + struct radix_node netc_rnodes[2]; + uint64_t netc_exflags; + struct ucred *netc_anon; + int netc_numsecflavors; + int netc_secflavors[MAXSECFLAVORS]; +}; + +/* + * Network export information + * ne_defexported - Protected by mnt_explock. + * ne4 - Protected by mnt_explock. + * ne6 - Protected by mnt_explock. + * The following fields are used by the pNFS server's replenisher process. + * ne_pnfsnumfile - Protected by the ne_mtx mutex. + * ne_pnfsnextfile - Protected by the vnode lock for the numfiles directory. + * ne_pnfsnumcnt - Handled as an atomic. + * (Although this value doesn't need to be exact, so using + * an atomic is not really necessary.) + */ +struct netexport { +#define ne_startzero ne_defexported + struct netcred ne_defexported; /* Default export */ + struct radix_node_head *ne4; + struct radix_node_head *ne6; +#define ne_endzero ne_mtx + struct mtx ne_mtx; /* For ne_pnfsnumfile. */ + struct vnode *ne_pnfsnumfile; + uint64_t ne_pnfsnextfile; + u_int ne_ref; /* Refcount for structure */ + u_int ne_pnfsnumcnt; /* For stats, not protected. */ +}; + +#define MNTEXP_LOCK(n) mtx_lock(&(n)->ne_mtx) +#define MNTEXP_UNLOCK(n) mtx_unlock(&(n)->ne_mtx) +#define MNTEXP_MTX(n) (&(n)->ne_mtx) + +#define PNFSD_START ((struct vnode *)-1) +#define PNFSD_STOP ((struct vnode *)-2) +#define PNFSD_STOPPED ((struct vnode *)-3) + +#endif /* _KERNEL */ + +#endif /* !_SYS_NETEXPORT_H_ */ From nobody Tue Jun 16 16:12:37 2026 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 4gfsTf0ZKvz6hPnW; Tue, 16 Jun 2026 16:12:54 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfsTd3y9jz4CSJ; Tue, 16 Jun 2026 16:12:53 +0000 (UTC) (envelope-from kib@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 65GGCbxB036330; Tue, 16 Jun 2026 19:12:40 +0300 (EEST) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 65GGCbxB036330 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 65GGCbmP036329; Tue, 16 Jun 2026 19:12:37 +0300 (EEST) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Tue, 16 Jun 2026 19:12:37 +0300 From: Konstantin Belousov To: Ed Maste Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 9a10af53dbf5 - main - Revert "kldload: Improve error handling" Message-ID: References: <6a316699.3bc7e.6c216c1b@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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6a316699.3bc7e.6c216c1b@gitrepo.freebsd.org> X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=4.0.2 X-Spam-Checker-Version: SpamAssassin 4.0.2 (2025-08-27) on tom.home X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4gfsTd3y9jz4CSJ X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Tue, Jun 16, 2026 at 03:07:05PM +0000, Ed Maste wrote: > The branch main has been updated by emaste: > > URL: https://cgit.FreeBSD.org/src/commit/?id=9a10af53dbf5b1268d6b74e94f2f8054caab9243 > > commit 9a10af53dbf5b1268d6b74e94f2f8054caab9243 > Author: Ed Maste > AuthorDate: 2026-06-16 15:06:17 +0000 > Commit: Ed Maste > CommitDate: 2026-06-16 15:06:30 +0000 > > Revert "kldload: Improve error handling" > > It broke the test suite, and will be recommitted when fixed. > This reverts commit db887713de2bf5c77494220a9e0ddfa7d4290155. > > Reported by: markj > --- > lib/libc/gen/exterr_cat_filenames.h | 1 - > sbin/kldload/kldload.c | 17 ++++---- > sys/kern/kern_linker.c | 83 +++++++++++++------------------------ > sys/sys/exterr_cat.h | 1 - > 4 files changed, 37 insertions(+), 65 deletions(-) > > diff --git a/lib/libc/gen/exterr_cat_filenames.h b/lib/libc/gen/exterr_cat_filenames.h > index 90e231879ccd..be65c1990af5 100644 > --- a/lib/libc/gen/exterr_cat_filenames.h > +++ b/lib/libc/gen/exterr_cat_filenames.h > @@ -12,7 +12,6 @@ > [EXTERR_CAT_FILEDESC] = "kern/kern_descrip.c", > [EXTERR_CAT_PROCEXIT] = "kern/kern_exit.c", > [EXTERR_CAT_FORK] = "kern/kern_fork.c", > - [EXTERR_CAT_LINKER] = "kern/kern_linker.c", This part ... > [EXTERR_CAT_GENIO] = "kern/sys_generic.c", > [EXTERR_CAT_VFSBIO] = "kern/vfs_bio.c", > [EXTERR_CAT_INOTIFY] = "kern/vfs_inotify.c", > diff --git a/sys/sys/exterr_cat.h b/sys/sys/exterr_cat.h > index 1c3f894e8aff..edc23d7dfbe6 100644 > --- a/sys/sys/exterr_cat.h > +++ b/sys/sys/exterr_cat.h > @@ -41,7 +41,6 @@ > #define EXTERR_CAT_PROCEXIT 16 > #define EXTERR_CAT_VMM 17 > #define EXTERR_CAT_HWPMC_IBS 18 > -#define EXTERR_CAT_LINKER 19 > > #endif > .. and this, together with the define in kern_linker.c, should not been removed. The category indexes are kind of ABI contract between libc and kernel, since libc hard-codes the translation of indexes into the source file names. When reverted, the index appears unused and could be consumed by something else, which introduces (minor) breakage for old libc. From nobody Tue Jun 16 16:18:01 2026 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 4gfsbY4C2vz6hPvV for ; Tue, 16 Jun 2026 16:18: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfsbY3YpQz4DGt for ; Tue, 16 Jun 2026 16:18:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781626681; 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=BIoh3yr/faa2LXfzeCMOaZtVQHTCzd2gMc1/P9DiV7s=; b=t0kR1zQJ3ArgfMlnaMQGtRVmGito4wGIvcSp9xBeZd5hsv4zpKJLIVq0KbzoGn4F3tPbp8 m7jR+16L8TpYouUSBh5LYHPhYICQfkIKXtshNOtCTlDgkHMUAaxnWJMyk96TnU2Lptrkgd OTAJMJPXp/zx5PMf8GrNGHZE5QEJgIh8E5/DkRaMN0ahGTj985mziS04QTWXITHAEvL2pe ICMAS6mSyFaP3/kOnyqo8GvDiDm/SonGbEC1mDOVedtmfOXWPzLPMjBwyBm5b09/7oybG4 kn27VID0jK4otRWPWPXAxm9btQPc/u4LNWWjwXYXxZI8il3T7yIflBmjeIooFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781626681; a=rsa-sha256; cv=none; b=Nu2odc4lt761KXoc9gCHEueXR7OA3hVKxT0gz39miteItRsW6936STRs4LhK8+3I6uUs++ BBzPoLWOeWXLkc0GjwRoPnoMV/J79jgEKgXtGeDR0H/7tvfYhhngTgRXs+OUH3lqFULxTe n8yAEKO50Wo3bHxpJX2f7Qgf3oOKgAO2ONH141jIQzWoz6xTy/deKf0ryEN/9KNDPnTSmw /Yy19V3wl/eXIZ0ILSGesa27fhlYWhGKHzxNrcOI5d+HWVEd0/YJ1ulHFzFNn+g/ak2Yvp fyZdT/6Dt7Gy4cN1V/6VqsOh0B8jTtYqmEy/6lNDb69WDPMclMsuw8+Nz2fqpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781626681; 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=BIoh3yr/faa2LXfzeCMOaZtVQHTCzd2gMc1/P9DiV7s=; b=e+2U9BFGGYykdSDee9FDlQnYyAD6h+UHHazRQWq/7GJVrfdQSxqS4hwa7DSvAoIDtluPBe BVWo487rAYcANOXr2WM0XL34csQ1NhzXHrUi4WDV8OXlBQ0Tqje7uMmzgHx8t0WsBdtgx6 J8YJ3CPXNEan/FqgRrQeq1CbXA8/4wj8rH5uE3d8h26nFjQazL5CvOvkzKvPuPZ5L6alo6 z0NvU1W9GL4Pvo5zIm0LvkJ8FzJkvkC3q+2phm+TgYGsEjRiYFQyS5SvkNp4SO3RwJnX22 jt6LBFh+8f7RsEJGewr6afsvuqhsi//wjzj2LYalWmuvekqKebrBUbn2Iov6sw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfsbY2w0KzYqQ for ; Tue, 16 Jun 2026 16:18:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 44e2a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 16:18:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 62e7ac83ae14 - main - Revert "rpc.tlsservd.c: Pin max threads at 1 for now" 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62e7ac83ae14fcc1847d607e98284bd4a98e7127 Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 16:18:01 +0000 Message-Id: <6a317739.44e2a.10c90ccb@gitrepo.freebsd.org> The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=62e7ac83ae14fcc1847d607e98284bd4a98e7127 commit 62e7ac83ae14fcc1847d607e98284bd4a98e7127 Author: Rick Macklem AuthorDate: 2026-06-16 16:15:25 +0000 Commit: Rick Macklem CommitDate: 2026-06-16 16:15:25 +0000 Revert "rpc.tlsservd.c: Pin max threads at 1 for now" This reverts commit 7a289fe3cd5c6de7ddbe394b7700b20b0bafdb3e. Hopefully, commit fc7993cf2d6d has fixed the underlying problem reported by PR#289734, so I am reverting this temporary work-around. I will delay MFC'ng this for a while, to see if the problem occurs again. MFC after: 3 months --- usr.sbin/rpc.tlsservd/rpc.tlsservd.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/usr.sbin/rpc.tlsservd/rpc.tlsservd.c b/usr.sbin/rpc.tlsservd/rpc.tlsservd.c index fb0501b2db4c..f07385a2baa7 100644 --- a/usr.sbin/rpc.tlsservd/rpc.tlsservd.c +++ b/usr.sbin/rpc.tlsservd/rpc.tlsservd.c @@ -168,12 +168,7 @@ main(int argc, char **argv) rpctls_verbose = false; ncpu = (u_int)sysconf(_SC_NPROCESSORS_ONLN); -#ifdef notnow rpctls_maxthreads = ncpu > 1 ? ncpu / 2 : 1; -#else - /* XXX For now, until fixed properly!! */ - rpctls_maxthreads = 1; -#endif while ((ch = getopt_long(argc, argv, "2C:D:dhl:N:n:mp:r:uvWw", longopts, NULL)) != -1) { @@ -204,8 +199,6 @@ main(int argc, char **argv) if (rpctls_maxthreads < 1 || rpctls_maxthreads > ncpu) errx(1, "maximum threads must be between 1 and " "number of CPUs (%d)", ncpu); - /* XXX For now, until fixed properly!! */ - rpctls_maxthreads = 1; break; case 'n': hostname[0] = '@'; From nobody Tue Jun 16 17:03:26 2026 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 4gftby4mQ6z6hT2G for ; Tue, 16 Jun 2026 17:03: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gftby1bNCz4K1N for ; Tue, 16 Jun 2026 17:03:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781629406; 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=nJ12D59eGYZbtRuR7b04pynvDIaCW8U/pO/Cansqnvk=; b=KMS17BvgOyU2p1T/8r77LQWax43qqzxhOS98L4u73eMLf2BCL/ypKaUjupLR5rjbzBWwZf N4OZCnYUyDuYbbyfMvL5kRR1DgXrQSkUdTiG7meAq+IGkaBO1iSGc8vSlIYvuICH4kEgoD +TeKI+W1rwcsa1IHaEDVrePNvyufxAwxXx5dlzzVVx+/2GTvqhtpI4+AuWFnUSbMzu9/h5 EeYL/HZ3ayF+lGoZiv4Y2jwUGn5hoNyAaNas2uTo/W21GfkaWl9zGa+QMY77WKA0yjZ8uw rtfeubI4ypsvn3PZoYj6RQAfB0TKrQfzFBlv4zqf82xxyq50ikGewqBMZ3M9EA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781629406; a=rsa-sha256; cv=none; b=I8R/J6G21u/7sLOYdDNUOsTyHXnwXbInuj+91+d87prufxJGCdmDRmkp060BzunxmftRhK w9BqDdmmqeTlWMpJhjWQ5QW0mf5unjbk5884n347Ncyp2K9rcbb9n/iUDtz1cy+u+6qkRr HsnpxB6zXnsnOYgVKu1H61K0PtHeWZEpyjBdG8pCS7+x0AJdSEjwQ6SJmEkF7iAbBnKbUA 8Xa9msSjvryoEXNlvB2EmCz2AOJdc4OStRNIxWKO3/sf8IjgsN51W+rUFVBFlJqGinMv5v Y4n3/kfYvY7Xj2exq5E4SWlGGf2rvYAPEkshotEKrhQOcDOgoccl1I+NpVBb3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781629406; 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=nJ12D59eGYZbtRuR7b04pynvDIaCW8U/pO/Cansqnvk=; b=Nv8f1SnziL1RWfJ0NXLLq4Ljyxnlv7VxmozVrxHZiMLTkOTZlZcSsckVUJA9qeB2Al61oV 1jTJGCnbK69onUlq8NR0Ouro37+7jovNcbhCzN3SWaAgalkf+RUX5bLVRkjAGhWdmzUQIA iHOcAyldIzeiBi1U0/MjFWv8sIXkSWdE27iGWPdsZLY5pYdzMvLoazSglJWeH9wOrBbyCU VFlPD8PxW6ow8Z5fJdfjXtwpo0C1HffD4eh63n75PtCKwMgemg4qmLVUyhN5cwGJFgh9Qb x77aqINyHRlRZoQbnTTTghAxg4IgHkGyaLP7RX4BN0qHS5ShAHS7kqKKRrBfiQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gftby17Fxzbc1 for ; Tue, 16 Jun 2026 17:03:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 19e57 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 17:03:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 8b2b62b49d88 - main - sockstat: consolidate unix(4) protocols in the array of protocols 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b2b62b49d886816213fb6b39258afb1373ef43b Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 17:03:26 +0000 Message-Id: <6a3181de.19e57.30da57e9@gitrepo.freebsd.org> The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=8b2b62b49d886816213fb6b39258afb1373ef43b commit 8b2b62b49d886816213fb6b39258afb1373ef43b Author: Gleb Smirnoff AuthorDate: 2026-06-16 16:59:01 +0000 Commit: Gleb Smirnoff CommitDate: 2026-06-16 16:59:01 +0000 sockstat: consolidate unix(4) protocols in the array of protocols This makes it possible to list unix(4) protocols in -P, which was not possible before. Update the manual page and provide an example. In 'struct sock' make member proto a pointer into the protocols table instead of a number. This removes namespace collision that mixed IPPROTO_TCP and etc with SOCK_STREAM and etc. There were no known bugs due to this collision, though. Preserve all current UI bugs for possible combinations of protocol selection options. Should be no UI changes outside the improved -P. Reviewed by: pouria, tuexen Differential Revision: https://reviews.freebsd.org/D57508 --- usr.bin/sockstat/main.c | 214 ++++++++++++++++++++++---------------------- usr.bin/sockstat/sockstat.1 | 12 ++- 2 files changed, 120 insertions(+), 106 deletions(-) diff --git a/usr.bin/sockstat/main.c b/usr.bin/sockstat/main.c index aa7d8f3d378c..0edf8dcbd431 100644 --- a/usr.bin/sockstat/main.c +++ b/usr.bin/sockstat/main.c @@ -107,49 +107,59 @@ static bool show_path_state = false; /* * Protocols that we support. - * TODO: merge unix(4) protocols into here. */ +enum sockstatproto { + SCTP = 0, TCP, UDP, UDPLITE, DIVERT, STREAM, DGRAM, SEQPACK +}; struct proto; typedef void gather_func_t(struct proto *); -static gather_func_t gather_sctp, gather_inet; +static gather_func_t gather_sctp, gather_inet, gather_unix; static struct proto { gather_func_t *gather; const char *name; const char *pcblist; - union { - int protonum; /* gather_inet() */ - }; bool disabled; } protos[] = { - { + [SCTP] = { .name = "sctp", .gather = gather_sctp, .pcblist = "net.inet.sctp.assoclist", - .protonum = IPPROTO_SCTP, }, - { + [TCP] = { .name = "tcp", .gather = gather_inet, .pcblist = "net.inet.tcp.pcblist", - .protonum = IPPROTO_TCP, }, - { + [UDP] = { .name = "udp", .gather = gather_inet, .pcblist = "net.inet.udp.pcblist", - .protonum = IPPROTO_UDP, }, - { + [UDPLITE] = { .name = "udplite", .gather = gather_inet, .pcblist = "net.inet.udplite.pcblist", - .protonum = IPPROTO_UDPLITE, }, - { + [DIVERT] = { .name = "divert", .gather = gather_inet, .pcblist = "net.inet.divert.pcblist", }, + [STREAM] = { + .name = "unix/stream", + .gather = gather_unix, + .pcblist = "net.local.stream.pcblist", + }, + [DGRAM] = { + .name = "unix/dgram", + .gather = gather_unix, + .pcblist = "net.local.dgram.pcblist", + }, + [SEQPACK] = { + .name = "unix/seqpack", + .gather = gather_unix, + .pcblist = "net.local.seqpacket.pcblist", + }, }; /* @@ -185,10 +195,10 @@ struct sock { int shown; int vflag; int family; - int proto; int state; int fibnum; int bblog_state; + const struct proto *proto; const char *protoname; char stack[TCP_FUNCTION_NAME_LEN_MAX]; char cc[TCP_CA_NAME_MAX]; @@ -387,8 +397,7 @@ gather_sctp(struct proto *proto) if ((sock = calloc(1, sizeof *sock)) == NULL) xo_err(1, "malloc()"); sock->socket = xinpcb->socket; - sock->proto = IPPROTO_SCTP; - sock->protoname = "sctp"; + sock->proto = proto; if (xinpcb->maxqlen == 0) sock->state = SCTP_CLOSED; else @@ -488,8 +497,7 @@ gather_sctp(struct proto *proto) if ((sock = calloc(1, sizeof *sock)) == NULL) xo_err(1, "malloc()"); sock->socket = xinpcb->socket; - sock->proto = IPPROTO_SCTP; - sock->protoname = "sctp"; + sock->proto = proto; sock->state = (int)xstcb->state; if (xinpcb->flags & SCTP_PCB_FLAGS_BOUND_V6) { sock->family = AF_INET6; @@ -665,7 +673,7 @@ gather_inet(struct proto *proto) xig = (struct xinpgen *)(void *)((char *)xig + xig->xig_len); if (xig >= exig) break; - if (proto->protonum == IPPROTO_TCP) { + if (proto == &protos[TCP]) { xtp = (struct xtcpcb *)xig; xip = &xtp->xt_inp; if (!check_ksize(xtp->xt_len, struct xtcpcb)) @@ -713,7 +721,7 @@ gather_inet(struct proto *proto) sock->socket = so->xso_so; sock->pcb = so->so_pcb; sock->splice_socket = so->so_splice_so; - sock->proto = proto->protonum; + sock->proto = proto; sock->inp_gencnt = xip->inp_gencnt; sock->fibnum = so->so_fibnum; if (xip->inp_vflag & INP_IPV4) { @@ -729,14 +737,14 @@ gather_inet(struct proto *proto) sockaddr(&faddr->address, sock->family, &xip->in6p_faddr, xip->inp_fport); } - if (proto->protonum == IPPROTO_TCP) + if (proto == &protos[TCP]) faddr->encaps_port = xtp->xt_encaps_port; laddr->next = NULL; faddr->next = NULL; sock->laddr = laddr; sock->faddr = faddr; sock->vflag = xip->inp_vflag; - if (proto->protonum == IPPROTO_TCP) { + if (proto == &protos[TCP]) { sock->state = xtp->t_state; sock->bblog_state = xtp->t_logstate; memcpy(sock->stack, xtp->xt_stack, @@ -755,33 +763,22 @@ out: } static void -gather_unix(int proto) +gather_unix(struct proto *proto) { struct xunpgen *xug, *exug; struct xunpcb *xup; struct sock *sock; struct addr *laddr, *faddr; - const char *varname, *protoname; + const char *protoname; size_t len, bufsize; void *buf; int retry; - switch (proto) { - case SOCK_STREAM: - varname = "net.local.stream.pcblist"; - protoname = "stream"; - break; - case SOCK_DGRAM: - varname = "net.local.dgram.pcblist"; - protoname = "dgram"; - break; - case SOCK_SEQPACKET: - varname = "net.local.seqpacket.pcblist"; - protoname = is_xo_style_encoding ? "seqpacket" : "seqpack"; - break; - default: - abort(); - } + if (proto == &protos[SEQPACK] && is_xo_style_encoding) + protoname = "seqpacket"; + else + protoname = strchr(proto->name, '/') + 1; + buf = NULL; bufsize = 8192; retry = 5; @@ -790,8 +787,8 @@ gather_unix(int proto) if ((buf = realloc(buf, bufsize)) == NULL) xo_err(1, "realloc()"); len = bufsize; - if (cap_sysctlbyname(capsysctl, varname, buf, &len, - NULL, 0) == 0) + if (cap_sysctlbyname(capsysctl, proto->pcblist, buf, + &len, NULL, 0) == 0) break; if (errno != ENOMEM || len != bufsize) xo_err(1, "cap_sysctlbyname()"); @@ -1256,8 +1253,8 @@ calculate_sock_column_widths(struct col_widths *cw, struct sock *s) } } if (opt_i) { - if (s->proto == IPPROTO_TCP || - s->proto == IPPROTO_UDP) { + if (s->proto == &protos[TCP] || + s->proto == &protos[UDP]) { len = snprintf(NULL, 0, "%" PRIu64, s->inp_gencnt); cw->inp_gencnt = MAX(cw->inp_gencnt, len); @@ -1265,11 +1262,11 @@ calculate_sock_column_widths(struct col_widths *cw, struct sock *s) } if (opt_U) { if (faddr != NULL && - ((s->proto == IPPROTO_SCTP && + ((s->proto == &protos[SCTP] && s->state != SCTP_CLOSED && s->state != SCTP_BOUND && s->state != SCTP_LISTEN) || - (s->proto == IPPROTO_TCP && + (s->proto == &protos[TCP] && s->state != TCPS_CLOSED && s->state != TCPS_LISTEN))) { len = snprintf(NULL, 0, "%u", @@ -1279,7 +1276,7 @@ calculate_sock_column_widths(struct col_widths *cw, struct sock *s) } if (opt_s) { if (faddr != NULL && - s->proto == IPPROTO_SCTP && + s->proto == &protos[SCTP] && s->state != SCTP_CLOSED && s->state != SCTP_BOUND && s->state != SCTP_LISTEN) { @@ -1289,33 +1286,27 @@ calculate_sock_column_widths(struct col_widths *cw, struct sock *s) } if (first) { if (opt_s) { - if (s->proto == IPPROTO_SCTP || - s->proto == IPPROTO_TCP) { - switch (s->proto) { - case IPPROTO_SCTP: + if (s->proto == &protos[SCTP]) { + len = strlen(sctp_conn_state(s->state)); + cw->conn_state = MAX(cw->conn_state, + len); + } + if (s->proto == &protos[TCP]) { + if (s->state >= 0 && + s->state < TCP_NSTATES) { len = strlen( - sctp_conn_state(s->state)); + tcpstates[s->state]); cw->conn_state = MAX( - cw->conn_state, len); - break; - case IPPROTO_TCP: - if (s->state >= 0 && - s->state < TCP_NSTATES) { - len = strlen( - tcpstates[s->state]); - cw->conn_state = MAX( - cw->conn_state, - len); - } - break; + cw->conn_state, + len); } } } - if (opt_S && s->proto == IPPROTO_TCP) { + if (opt_S && s->proto == &protos[TCP]) { len = strlen(s->stack); cw->stack = MAX(cw->stack, len); } - if (opt_C && s->proto == IPPROTO_TCP) { + if (opt_C && s->proto == &protos[TCP]) { len = strlen(s->cc); cw->cc = MAX(cw->cc, len); } @@ -1482,8 +1473,8 @@ display_sock(struct sock *s, struct col_widths *cw, char *buf, size_t bufsize) cw->splice_address, buf); } if (opt_i) { - if (s->proto == IPPROTO_TCP || - s->proto == IPPROTO_UDP) { + if (s->proto == &protos[TCP] || + s->proto == &protos[UDP]) { snprintf(buf, bufsize, "%" PRIu64, s->inp_gencnt); xo_emit(" {:id/%*s}", cw->inp_gencnt, buf); @@ -1492,11 +1483,11 @@ display_sock(struct sock *s, struct col_widths *cw, char *buf, size_t bufsize) } if (opt_U) { if (faddr != NULL && - ((s->proto == IPPROTO_SCTP && + ((s->proto == &protos[SCTP] && s->state != SCTP_CLOSED && s->state != SCTP_BOUND && s->state != SCTP_LISTEN) || - (s->proto == IPPROTO_TCP && + (s->proto == &protos[TCP] && s->state != TCPS_CLOSED && s->state != TCPS_LISTEN))) { xo_emit(" {:encaps/%*u}", cw->encaps, @@ -1506,7 +1497,7 @@ display_sock(struct sock *s, struct col_widths *cw, char *buf, size_t bufsize) } if (opt_s && show_path_state) { if (faddr != NULL && - s->proto == IPPROTO_SCTP && + s->proto == &protos[SCTP] && s->state != SCTP_CLOSED && s->state != SCTP_BOUND && s->state != SCTP_LISTEN) { @@ -1518,31 +1509,25 @@ display_sock(struct sock *s, struct col_widths *cw, char *buf, size_t bufsize) } if (first) { if (opt_s) { - if (s->proto == IPPROTO_SCTP || - s->proto == IPPROTO_TCP) { - switch (s->proto) { - case IPPROTO_SCTP: + if (s->proto == &protos[SCTP]) { + xo_emit(" {:conn-state/%-*s}", + cw->conn_state, + sctp_conn_state(s->state)); + } else if (s->proto == &protos[TCP]) { + if (s->state >= 0 && + s->state < TCP_NSTATES) xo_emit(" {:conn-state/%-*s}", cw->conn_state, - sctp_conn_state(s->state)); - break; - case IPPROTO_TCP: - if (s->state >= 0 && - s->state < TCP_NSTATES) - xo_emit(" {:conn-state/%-*s}", - cw->conn_state, - tcpstates[s->state]); - else if (!is_xo_style_encoding) - xo_emit(" {:conn-state/%-*s}", - cw->conn_state, "??"); - break; - } + tcpstates[s->state]); + else if (!is_xo_style_encoding) + xo_emit(" {:conn-state/%-*s}", + cw->conn_state, "??"); } else if (!is_xo_style_encoding) xo_emit(" {:conn-state/%-*s}", cw->conn_state, "??"); } if (opt_b) { - if (s->proto == IPPROTO_TCP) + if (s->proto == &protos[TCP]) xo_emit(" {:bblog-state/%-*s}", cw->bblog_state, bblog_state(s->bblog_state)); @@ -1551,7 +1536,7 @@ display_sock(struct sock *s, struct col_widths *cw, char *buf, size_t bufsize) cw->bblog_state, "??"); } if (opt_S) { - if (s->proto == IPPROTO_TCP) + if (s->proto == &protos[TCP]) xo_emit(" {:stack/%-*s}", cw->stack, s->stack); else if (!is_xo_style_encoding) @@ -1559,7 +1544,7 @@ display_sock(struct sock *s, struct col_widths *cw, char *buf, size_t bufsize) cw->stack, "??"); } if (opt_C) { - if (s->proto == IPPROTO_TCP) + if (s->proto == &protos[TCP]) xo_emit(" {:cc/%-*s}", cw->cc, s->cc); else if (!is_xo_style_encoding) xo_emit(" {:cc/%-*s}", cw->cc, "??"); @@ -1983,23 +1968,42 @@ main(int argc, char *argv[]) if (opt_F && !parse_filter_user()) xo_errx(1, "Invalid username or UID specified"); - if ((!opt_4 && !opt_6) && protos_defined) - opt_4 = opt_6 = true; - if (!opt_4 && !opt_6 && !opt_u) - opt_4 = opt_6 = opt_u = true; if (!opt_c && !opt_l) opt_c = opt_l = true; - if (opt_4 || opt_6) - for (u_int i = 0; i < nitems(protos); i++) - if (!protos[i].disabled) - protos[i].gather(&protos[i]); - - if (opt_u || (!protos_defined && !opt_4 && !opt_6)) { - gather_unix(SOCK_STREAM); - gather_unix(SOCK_DGRAM); - gather_unix(SOCK_SEQPACKET); + /* + * By default all protocols are gathered. + * + * With -u and without -[46] disables all but unix(4). + * With -[46] and without -u disables unix(4). + * With -P only specified are gathered and -4 and -6 are ignored, + * however -u is not ignored (historical bug). + * + * divert(4) is controlled by -4 (historical bug). + * + * NB: opt_4 and opt_6 are used outside this function, thus need to + * be set to true if both are false. + */ + if (protos_defined) { + if (opt_u) + protos[STREAM].disabled = protos[DGRAM].disabled = + protos[SEQPACK].disabled = false; + } else { + if (!opt_u && (opt_4 || opt_6)) + protos[STREAM].disabled = protos[DGRAM].disabled = + protos[SEQPACK].disabled = true; + if (opt_u && !(opt_4 || opt_6)) + protos[SCTP].disabled = protos[TCP].disabled = + protos[UDP].disabled = protos[UDPLITE].disabled = + true; } + if (!opt_4 && !opt_6) + opt_4 = opt_6 = true; + + for (u_int i = 0; i < nitems(protos); i++) + if (!protos[i].disabled) + protos[i].gather(&protos[i]); + getfiles(); display(); exit(0); diff --git a/usr.bin/sockstat/sockstat.1 b/usr.bin/sockstat/sockstat.1 index 385b1c4952dc..b8fb420bb105 100644 --- a/usr.bin/sockstat/sockstat.1 +++ b/usr.bin/sockstat/sockstat.1 @@ -119,7 +119,10 @@ Recognized protocols are .Qq tcp , .Qq sctp , .Qq udp , -.Qq udplite +.Qq udplite , +.Qq unix/stream , +.Qq unix/dgram , +.Qq unix/seqpack , and .Qq divert . .It Fl q @@ -257,6 +260,13 @@ Show TCP IPv6 sockets which are listening and connected (default): $ sockstat -6 -P tcp .Ed .Pp +Show all listening +.Xr unix 4 +datagram sockets: +.Bd -literal -offset indent +$ sockstat -P unix/dgram -l +.Ed +.Pp Show all sockets in JSON format with neat alignment: .Bd -literal -offset indent $ sockstat --libxo json,pretty From nobody Tue Jun 16 17:03:25 2026 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 4gftbx43K7z6hSw6 for ; Tue, 16 Jun 2026 17:03:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gftbx0ryJz4K1M for ; Tue, 16 Jun 2026 17:03:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781629405; 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=D84zPrPg+ov795TDqs8BvTuq68wK+LppoqAnH5p4vO8=; b=iMijYqEoPhIkGsF9s6WOGXCKz2Ot5iTt1+CSHC5iZYIfKnfoPpWsjiMehA1te/EVAL6MEc 931Ld52D1bm+hmaSltyjs1aHJpZtEUk+F9W6EBJyrd6ANLvWlwIj1kCyaZObjhMq50ArPU 5cQvw2G6cMxGpjkwm+e1baJPzssj5Bn5wB5qy+rs82pHozxMrCxGurLGAafw3vOt52Lgjm VURiy+cZBIpDM/I/0/X5JRMsQLwyTpgaZQa7mF3+QBOe16Nnc48Q9R/Evwz1qwqfUF+rLC u0X9hWJ7K7HqL5LF9uw1B6Ppd4A52/P4SABUDBdtDtVWOFSvajiBqKa20L9ROQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781629405; a=rsa-sha256; cv=none; b=ltV7q8WcEbnvh9LjqVmtZyaEFKAaMJfbL4Q3a5ZrKvSn9W2PmfwF4LoaU3ellJfuTs/MKU duQrG76Dn2wfH9h9GPK8uOryKH1n+GuktEBnVpg2vuyu5IZpI3MEcF3+sSdeTuwAotLuhy hl9alUgen7yEpnadR8j+rY/S/8JcMBGpaCzdmMysolAUgZ78kc80TxKtSnQDBVouuXsZyx zpkoDwmkXvLBUyeCahFN0KeNydAXguSdTi5nMn0x4oc2dS230FYQo665H33wpTzb/8NNPL G39ZXanJLM1LLHGJQ1tyT3+HHsZGeJgdQ+qgo9dJZWdUeVZToDGbSBAp7I3/ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781629405; 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=D84zPrPg+ov795TDqs8BvTuq68wK+LppoqAnH5p4vO8=; b=k47UkAqIYVjs5F3wddt0+Ai4fGvKFfe98tUm1yNlvQZG9ZcHUaELOXnYEDohwfnYBxqHJ2 WWAzj1Ch9ITPAXREtYynpEeQd8TjWBUlcajpuEtNPI5bXExQLezh6brM+1Yw/GuXAQWUjr 8Ze+46m11zCXAM7NPFcVh6b439gTEFhXDmf/SV7GC8vk00myVEvTS6a20y/fN37nniV5cs KPt+aszkOd1SaGVRt0qhcfQb0cfOIynihfj/iA2uBWAu37LDNrUd4w88RvE4/ZqIbNqsGL S2FOQrirCJMDtzHKcx88X/w59GhCBDs5lzKX337XzrIP/imAHECchPjL/bV9IQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gftbx0HGPzbcq for ; Tue, 16 Jun 2026 17:03:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1975d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 17:03:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 3a58a50dd4fa - main - sockstat: don't use getprotoent(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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a58a50dd4fa05d4a09054cf66701dc2409b0032 Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 17:03:25 +0000 Message-Id: <6a3181dd.1975d.2192e630@gitrepo.freebsd.org> The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=3a58a50dd4fa05d4a09054cf66701dc2409b0032 commit 3a58a50dd4fa05d4a09054cf66701dc2409b0032 Author: Gleb Smirnoff AuthorDate: 2026-06-16 16:58:13 +0000 Commit: Gleb Smirnoff CommitDate: 2026-06-16 16:58:13 +0000 sockstat: don't use getprotoent(3) This removes requirement for existence of obsolete IPPROTO_DIVERT in and the 'divert' entry in /etc/protocols. Also, this avoids running through the nsdispatch(3) machinery on startup, cutting down about 20 syscalls, three of which are open(2). The code of sockstat(1) itself is also reduced. The only UI change for a normal execution is that now the divert(4) sockets are reported as "divert4" instead of "div4". The prefix "4" itself is also incorrect, as divert(4) is not a part of IPv4. This will be addressed in a separate change. There is small UI change for incorrect runs. Previously protocols listed in /etc/protocols, but not supported, would err out like this: # sockstat -P ggp sockstat: protocol 3 not supported And non-existent protocols would err out like this: # sockstat -P foo sockstat: cap_getprotobyname: No error: 0 USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS Now both cases will consistently err: sockstat: protocol foo not supported Reviewed by: pouria, tuexen Differential Revision: https://reviews.freebsd.org/D57507 --- usr.bin/sockstat/main.c | 210 ++++++++++++++++---------------------------- usr.bin/sockstat/sockstat.1 | 19 ++-- 2 files changed, 92 insertions(+), 137 deletions(-) diff --git a/usr.bin/sockstat/main.c b/usr.bin/sockstat/main.c index ea4449300866..aa7d8f3d378c 100644 --- a/usr.bin/sockstat/main.c +++ b/usr.bin/sockstat/main.c @@ -58,7 +58,6 @@ #include #include #include -#include #include #include #include @@ -107,14 +106,51 @@ static bool is_xo_style_encoding; static bool show_path_state = false; /* - * Default protocols to use if no -P was defined. + * Protocols that we support. + * TODO: merge unix(4) protocols into here. */ -static const char *default_protos[] = {"sctp", "tcp", "udp", "udplite", - "divert" }; -static size_t default_numprotos = nitems(default_protos); - -static int *protos; /* protocols to use */ -static size_t numprotos; /* allocated size of protos[] */ +struct proto; +typedef void gather_func_t(struct proto *); +static gather_func_t gather_sctp, gather_inet; +static struct proto { + gather_func_t *gather; + const char *name; + const char *pcblist; + union { + int protonum; /* gather_inet() */ + }; + bool disabled; +} protos[] = { + { + .name = "sctp", + .gather = gather_sctp, + .pcblist = "net.inet.sctp.assoclist", + .protonum = IPPROTO_SCTP, + }, + { + .name = "tcp", + .gather = gather_inet, + .pcblist = "net.inet.tcp.pcblist", + .protonum = IPPROTO_TCP, + }, + { + .name = "udp", + .gather = gather_inet, + .pcblist = "net.inet.udp.pcblist", + .protonum = IPPROTO_UDP, + }, + { + .name = "udplite", + .gather = gather_inet, + .pcblist = "net.inet.udplite.pcblist", + .protonum = IPPROTO_UDPLITE, + }, + { + .name = "divert", + .gather = gather_inet, + .pcblist = "net.inet.divert.pcblist", + }, +}; /* * Show sockets for user username or UID specified @@ -236,63 +272,26 @@ need_nosocks(void) return !(opt_F || (opt_j >= 0)); } -static int -get_proto_type(const char *proto) -{ - struct protoent *pent; - - if (strlen(proto) == 0) - return (0); - if (capnetdb != NULL) - pent = cap_getprotobyname(capnetdb, proto); - else - pent = getprotobyname(proto); - if (pent == NULL) { - xo_warn("cap_getprotobyname"); - return (-1); - } - return (pent->p_proto); -} - static void -init_protos(int num) -{ - int proto_count = 0; - - if (num > 0) { - proto_count = num; - } else { - /* Find the maximum number of possible protocols. */ - while (getprotoent() != NULL) - proto_count++; - endprotoent(); - } - - if ((protos = malloc(sizeof(int) * proto_count)) == NULL) - xo_err(1, "malloc"); - numprotos = proto_count; -} - -static int parse_protos(char *protospec) { char *prot; - int proto_type, proto_index; + u_int i; - if (protospec == NULL) - return (-1); + for (i = 0; i < nitems(protos); i++) + protos[i].disabled = true; - init_protos(0); - proto_index = 0; while ((prot = strsep(&protospec, ",")) != NULL) { if (strlen(prot) == 0) continue; - proto_type = get_proto_type(prot); - if (proto_type != -1) - protos[proto_index++] = proto_type; + for (i = 0; i < nitems(protos); i++) + if (strcmp(prot, protos[i].name) == 0) { + protos[i].disabled = false; + break; + } + if (i == nitems(protos)) + xo_errx(1, "protocol %s not supported", prot); } - numprotos = proto_index; - return (proto_index); } static void @@ -349,7 +348,7 @@ free_socket(struct sock *sock) } static void -gather_sctp(void) +gather_sctp(struct proto *proto) { struct sock *sock; struct addr *laddr, *prev_laddr, *faddr, *prev_faddr; @@ -357,7 +356,6 @@ gather_sctp(void) struct xsctp_tcb *xstcb; struct xsctp_raddr *xraddr; struct xsctp_laddr *xladdr; - const char *varname; size_t len, offset; char *buf; int vflag; @@ -369,8 +367,7 @@ gather_sctp(void) if (opt_6) vflag |= INP_IPV6; - varname = "net.inet.sctp.assoclist"; - if (cap_sysctlbyname(capsysctl, varname, 0, &len, 0, 0) < 0) { + if (cap_sysctlbyname(capsysctl, proto->pcblist, 0, &len, 0, 0) < 0) { if (errno != ENOENT) xo_err(1, "cap_sysctlbyname()"); return; @@ -379,7 +376,7 @@ gather_sctp(void) xo_err(1, "malloc()"); return; } - if (cap_sysctlbyname(capsysctl, varname, buf, &len, 0, 0) < 0) { + if (cap_sysctlbyname(capsysctl, proto->pcblist, buf, &len, 0, 0) < 0) { xo_err(1, "cap_sysctlbyname()"); free(buf); return; @@ -618,7 +615,7 @@ gather_sctp(void) } static void -gather_inet(int proto) +gather_inet(struct proto *proto) { struct xinpgen *xig, *exig; struct xinpcb *xip; @@ -626,7 +623,7 @@ gather_inet(int proto) struct xsocket *so; struct sock *sock; struct addr *laddr, *faddr; - const char *varname, *protoname; + const char *protoname = proto->name; size_t len, bufsize; void *buf; int retry, vflag; @@ -637,27 +634,6 @@ gather_inet(int proto) if (opt_6) vflag |= INP_IPV6; - switch (proto) { - case IPPROTO_TCP: - varname = "net.inet.tcp.pcblist"; - protoname = "tcp"; - break; - case IPPROTO_UDP: - varname = "net.inet.udp.pcblist"; - protoname = "udp"; - break; - case IPPROTO_UDPLITE: - varname = "net.inet.udplite.pcblist"; - protoname = "udplite"; - break; - case IPPROTO_DIVERT: - varname = "net.inet.divert.pcblist"; - protoname = "div"; - break; - default: - xo_errx(1, "protocol %d not supported", proto); - } - buf = NULL; bufsize = 8192; retry = 5; @@ -666,8 +642,8 @@ gather_inet(int proto) if ((buf = realloc(buf, bufsize)) == NULL) xo_err(1, "realloc()"); len = bufsize; - if (cap_sysctlbyname(capsysctl, varname, buf, &len, - NULL, 0) == 0) + if (cap_sysctlbyname(capsysctl, proto->pcblist, buf, + &len, NULL, 0) == 0) break; if (errno == ENOENT) goto out; @@ -689,23 +665,17 @@ gather_inet(int proto) xig = (struct xinpgen *)(void *)((char *)xig + xig->xig_len); if (xig >= exig) break; - switch (proto) { - case IPPROTO_TCP: + if (proto->protonum == IPPROTO_TCP) { xtp = (struct xtcpcb *)xig; xip = &xtp->xt_inp; if (!check_ksize(xtp->xt_len, struct xtcpcb)) goto out; - protoname = xtp->t_flags & TF_TOE ? "toe" : "tcp"; - break; - case IPPROTO_UDP: - case IPPROTO_UDPLITE: - case IPPROTO_DIVERT: + if (xtp->t_flags & TF_TOE) + protoname = "toe"; + } else { xip = (struct xinpcb *)xig; if (!check_ksize(xip->xi_len, struct xinpcb)) goto out; - break; - default: - xo_errx(1, "protocol %d not supported", proto); } so = &xip->xi_socket; if ((xip->inp_vflag & vflag) == 0) @@ -743,7 +713,7 @@ gather_inet(int proto) sock->socket = so->xso_so; sock->pcb = so->so_pcb; sock->splice_socket = so->so_splice_so; - sock->proto = proto; + sock->proto = proto->protonum; sock->inp_gencnt = xip->inp_gencnt; sock->fibnum = so->so_fibnum; if (xip->inp_vflag & INP_IPV4) { @@ -759,14 +729,14 @@ gather_inet(int proto) sockaddr(&faddr->address, sock->family, &xip->in6p_faddr, xip->inp_fport); } - if (proto == IPPROTO_TCP) + if (proto->protonum == IPPROTO_TCP) faddr->encaps_port = xtp->xt_encaps_port; laddr->next = NULL; faddr->next = NULL; sock->laddr = laddr; sock->faddr = faddr; sock->vflag = xip->inp_vflag; - if (proto == IPPROTO_TCP) { + if (proto->protonum == IPPROTO_TCP) { sock->state = xtp->t_state; sock->bblog_state = xtp->t_logstate; memcpy(sock->stack, xtp->xt_stack, @@ -1776,26 +1746,6 @@ out: cap_endpwent(cappwd); } -static int -set_default_protos(void) -{ - struct protoent *prot; - const char *pname; - size_t pindex; - - init_protos(default_numprotos); - - for (pindex = 0; pindex < default_numprotos; pindex++) { - pname = default_protos[pindex]; - prot = cap_getprotobyname(capnetdb, pname); - if (prot == NULL) - xo_err(1, "cap_getprotobyname: %s", pname); - protos[pindex] = prot->p_proto; - } - numprotos = pindex; - return (pindex); -} - /* * Return the vnet property of the jail, or -1 on error. */ @@ -1881,8 +1831,8 @@ main(int argc, char *argv[]) cap_net_limit_t *limit; const char *pwdcmds[] = { "setpassent", "getpwuid", "getpwnam" }; const char *pwdfields[] = { "pw_name", "pw_uid" }; - int protos_defined = -1; - int o, i, err; + bool protos_defined = false; + int o, err; argc = xo_parse_args(argc, argv); if (argc < 0) @@ -1953,7 +1903,8 @@ main(int argc, char *argv[]) } break; case 'P': - protos_defined = parse_protos(optarg); + parse_protos(optarg); + protos_defined = true; break; case 'q': opt_q = true; @@ -2032,24 +1983,19 @@ main(int argc, char *argv[]) if (opt_F && !parse_filter_user()) xo_errx(1, "Invalid username or UID specified"); - if ((!opt_4 && !opt_6) && protos_defined != -1) + if ((!opt_4 && !opt_6) && protos_defined) opt_4 = opt_6 = true; if (!opt_4 && !opt_6 && !opt_u) opt_4 = opt_6 = opt_u = true; - if ((opt_4 || opt_6) && protos_defined == -1) - protos_defined = set_default_protos(); if (!opt_c && !opt_l) opt_c = opt_l = true; - if (opt_4 || opt_6) { - for (i = 0; i < protos_defined; i++) - if (protos[i] == IPPROTO_SCTP) - gather_sctp(); - else - gather_inet(protos[i]); - } + if (opt_4 || opt_6) + for (u_int i = 0; i < nitems(protos); i++) + if (!protos[i].disabled) + protos[i].gather(&protos[i]); - if (opt_u || (protos_defined == -1 && !opt_4 && !opt_6)) { + if (opt_u || (!protos_defined && !opt_4 && !opt_6)) { gather_unix(SOCK_STREAM); gather_unix(SOCK_DGRAM); gather_unix(SOCK_SEQPACKET); diff --git a/usr.bin/sockstat/sockstat.1 b/usr.bin/sockstat/sockstat.1 index 70513794ebd9..385b1c4952dc 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 April 15, 2026 +.Dd June 8, 2026 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -114,9 +114,14 @@ Only show sockets of the specified .Ar protocols . The .Ar protocols -argument is a comma-separated list of protocol names, -as they are defined in -.Xr protocols 5 . +argument is a comma-separated list of protocol names. +Recognized protocols are +.Qq tcp , +.Qq sctp , +.Qq udp , +.Qq udplite +and +.Qq divert . .It Fl q Quiet mode, do not print the header line. .It Fl S @@ -264,7 +269,11 @@ $ sockstat --libxo json,pretty .Xr libxo 3 , .Xr inet 4 , .Xr inet6 4 , -.Xr protocols 5 , +.Xr divert 4 , +.Xr tcp 4 , +.Xr sctp 4 , +.Xr udp 4 , +.Xr unix 4 , .Xr xo_options 7 .Sh HISTORY The From nobody Tue Jun 16 17:07:03 2026 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 4gfth71Z9gz6hTKH for ; Tue, 16 Jun 2026 17:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfth70pDQz4LJw for ; Tue, 16 Jun 2026 17:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781629623; 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=WWiA6/uAkqNc/iUWFCOVU/NaJM3al5csOEeUaYfl4rQ=; b=G8B1KAfFHlzSYM3KmI3YIdeZOlf6dITDsAOUv8iYF+pYmlzbihjFdSkqb7rUbYOWCsKyK2 DX2vpB5pxh3Kya5I49OMz+vJFsumRrk6B8cT3WMZJCxVHYhwQRhASazHn7rKQAnnZxJ4iA vM4jS0LayXhgYv59oNrtfE4afT7HhsWI/9hEhgM5HG3903W49frIWVh+tXtkSFrJTjJJ5z iHjqO6pStSlOwAvVUJN2arWmS1vYG41nbW/QAkdS9fqoPOPif+SO6Ry1gkJNdAb2yYuCFC XzgslsF6/nokRTX3ixD9Qlr+SmBvQFHxC3zbL/wAoq4P89ygDK3KtphhwjNl8A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781629623; a=rsa-sha256; cv=none; b=R2MejJyMF/APaTI6V7vXxtxpnzfillXmlEXKvdf8ABQT8llSJtECENd0dUjTLwfXAMvdeE ncfNkHYK0eEKiuUYw6VrlmCT4TR3EPWNDnJ7z1AKndhFOpkrBMFJldv6byrT/YPPhY/pa0 63FGuGF59gL7YXzOpQbRHzgMWU37kqrAKpahS0pbtycVsCReMhh1ZWcgbenEO3zGAjeRUE iFGpS0cZZ2KHRl0EZ8zUD/fbKV3Ara0Wv0h47OqzwE2W/iAhm8i9W+itZAjYTpMjsX0lFy IRD/3OPdqjxUrFcgdmlDwrBZv6e5YWiYVA1+E0ACbG1l+wxL3kZjxhVm+1BpcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781629623; 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=WWiA6/uAkqNc/iUWFCOVU/NaJM3al5csOEeUaYfl4rQ=; b=ZQrtVr9zPuC2O6BLl2LPQnDVdBiw6hnISKXw0XW8cOH5Ugx7qfQF5RowR7hm9ISC7wFwCz et7AAGdrMOIx0oO6YzC124CoqU5/ekMA5PQMJxrXRoCHkwhusQClaD7KOoJ//H6J6gxPdw B2ela9k8IF7P31tkMWKjzsVC+ffj2ysu7oGx8XJ31QWvTkqCmbNNdnLWM+J1kDly1BXnJO dVAQxRYJfanrY92flfusTcWO2noJwirFqqW8ZBkZOq/bLPmzNJPAV/NAp1+M8AVJS3GVn+ ZURjZeaOa0vQGj5m2j7WbUa7rojGTagATRJm/dflgQdx8C1WQ+t7Uux2FZk96A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfth70PyFzZmm for ; Tue, 16 Jun 2026 17:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1aa13 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 17:07:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: e15be258bbf2 - main - ping6: fix outpack overflow in pattern fill loop 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e15be258bbf2978dfc62b5483d86c76884eb8576 Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 17:07:03 +0000 Message-Id: <6a3182b7.1aa13.55d2ccdb@gitrepo.freebsd.org> The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=e15be258bbf2978dfc62b5483d86c76884eb8576 commit e15be258bbf2978dfc62b5483d86c76884eb8576 Author: Mariusz Zaborski AuthorDate: 2026-06-16 17:02:02 +0000 Commit: Mariusz Zaborski CommitDate: 2026-06-16 17:02:02 +0000 ping6: fix outpack overflow in pattern fill loop The fill loop was bounded by packlen, which is sized for the receive buffer (datalen + IP6LEN + ICMP6ECHOLEN + EXTRA), not for outpack. With large datalen the loop wrote past outpack[MAXPACKETLEN]. Bound it to the actual data area in outpack instead. Reported by: Oculytic Reviewed by: des, markj Differential Revision: https://reviews.freebsd.org/D57441 --- sbin/ping/ping6.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sbin/ping/ping6.c b/sbin/ping/ping6.c index b00b00ac8ce1..48f376ac6e5c 100644 --- a/sbin/ping/ping6.c +++ b/sbin/ping/ping6.c @@ -238,7 +238,7 @@ static struct iovec smsgiov; static char *scmsg = 0; static cap_channel_t *capdns_setup(void); -static void fill(char *, char *); +static void fill(char *, size_t, char *); static int get_hoplim(struct msghdr *); static int get_pathmtu(struct msghdr *); static struct in6_pktinfo *get_rcvpktinfo(struct msghdr *); @@ -273,7 +273,8 @@ ping6(int argc, char *argv[]) struct sockaddr_in6 from, *sin6; struct addrinfo hints, *res; struct sigaction si_sa; - int cc, i; + int cc; + size_t i; int almost_done, ch, hold, packlen, preload, optval, error; int nig_oldmcprefix = -1; u_char *datap; @@ -483,7 +484,8 @@ ping6(int argc, char *argv[]) break; case 'p': /* fill buffer with user pattern */ options |= F_PINGFILLED; - fill((char *)datap, optarg); + fill((char *)datap, + sizeof(outpack) - (datap - outpack), optarg); break; case 'q': options |= F_QUIET; @@ -762,7 +764,7 @@ ping6(int argc, char *argv[]) if (!(packet = (u_char *)malloc((u_int)packlen))) err(1, "Unable to allocate packet"); if (!(options & F_PINGFILLED)) - for (i = ICMP6ECHOLEN; i < packlen; ++i) + for (i = (size_t)(datap - outpack); i < sizeof(outpack); ++i) *datap++ = i; ident = getpid() & 0xFFFF; @@ -2631,7 +2633,7 @@ pr_retip(struct ip6_hdr *ip6, u_char *end) } static void -fill(char *bp, char *patp) +fill(char *bp, size_t bplen, char *patp) { int ii, jj, kk; int pat[16]; @@ -2646,13 +2648,11 @@ fill(char *bp, char *patp) &pat[7], &pat[8], &pat[9], &pat[10], &pat[11], &pat[12], &pat[13], &pat[14], &pat[15]); -/* xxx */ - if (ii > 0) - for (kk = 0; - (size_t)kk <= MAXDATALEN - 8 + sizeof(struct tv32) + ii; - kk += ii) + if (ii > 0) { + for (kk = 0; (size_t)kk + ii <= bplen; kk += ii) for (jj = 0; jj < ii; ++jj) bp[jj + kk] = pat[jj]; + } if (!(options & F_QUIET)) { (void)printf("PATTERN: 0x"); for (jj = 0; jj < ii; ++jj) From nobody Tue Jun 16 17:12:33 2026 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 4gftpZ4RqMz6hVLT for ; Tue, 16 Jun 2026 17:12: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gftpZ3s8hz4Nxd for ; Tue, 16 Jun 2026 17:12:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781629958; 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; bh=zuRnhhUmPGxP7DdvXcdTDeLRRX002L3jFHGuzBBogDo=; b=XnasrgGM+MFacFGrOlOe9Vur/G61u8ua7kKrE/djvAnVJ33kVYR4sT3IIdqzv4YQCQrCdk dikmPZcp++Tqmqh0AF2v0aam1ED+uSrtqEqKiHXAz/9onvbHcui+TZDedNjDrub3nuJXzm ClpM3J2GlAdRJNc6OugyrzOwfJFAxb0PaTlY6juArgkZxnL7d2AcFNShlZnwzAyHc08Cjy XoUNH+IGPLfoHyGOtMsmRdQoW+91yeFSCSglD/zYUfRg4uwRuwA3ehY4qOOJXrqDzNgGJ1 tFdJPovCv5OUmXDuX+23lyt6UBUd3yzj0/T4WijoM2txvXSYdxkkQJmnQCDilQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781629958; a=rsa-sha256; cv=none; b=iY339qYzu9HSm18z6Q9nIYARzeeAk4INUfDxtMEh2trJjhvFiGTtMnC/nea2PPiI5fUlq/ E7dqc2XXYfX7Wt8a7dJjZPHXYDYakVflyTsfWF506Za0X6ZvlZOngt4r7H474quNMGByDK okrLN/ee30cgv3a1sFaOIzjbOulRz3Ooheird0MR7yQz3W3fgdhpw6mnpUzdih/8X0qwGZ 5vrcy49kmJvL2H0PkfXABeYSfaG7P7Ilijs18+o3jVDA+TRtjxrewbw8n5g3lY9NldGwfr zSP046Lp3ovK0SXLCSrBheZkkGi8rhxQakv7zab4KP82i0LZU+3q0cpqLZAg2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781629958; 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; bh=zuRnhhUmPGxP7DdvXcdTDeLRRX002L3jFHGuzBBogDo=; b=ZCqGvsvksI5vPpWBkN3OeDg19JRH1WFpUcyeLbw86heRu3cJXJm1Tp5vDwXQbhDGKLZ9wI C9T8ncLydMHelqEYF0vbzUhtl/6SXoiwQ7TYL8pKfHBSkVL4TVZVv7iT4FeXq+XJD7aiPw 8dz2cQkFUulJuEKXUVRY5uIgHwdIepbDgb2e40kGoUO6zG3E3p0FWCOhpmZaJ+hRRo057V GJK12bEwEX4VwlnytDOKZ6lxqUzpcog2rPbO6GZj33sxC6q9wD08sV5Y6ssCji+avSWB+K hI57yMwfGBCC53sMv4CcXAa8wBtWOwgfU1bpGH0J61EG0e2/SzJxmB6nmEwIqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gftpZ3SCqzbw3 for ; Tue, 16 Jun 2026 17:12:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1c221 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 17:12:33 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Jim Huang Chen From: Ed Maste Subject: git: 6616c7a9a17d - main - sys: Reserve EXTERR_CAT_LINKER for kld linker exterrors 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 6616c7a9a17d1870a7f15aded0b499b1373ba8b0 Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 17:12:33 +0000 Message-Id: <6a318401.1c221.1b2fefc8@gitrepo.freebsd.org> The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6616c7a9a17d1870a7f15aded0b499b1373ba8b0 commit 6616c7a9a17d1870a7f15aded0b499b1373ba8b0 Author: Jim Huang Chen AuthorDate: 2026-05-25 16:23:29 +0000 Commit: Ed Maste CommitDate: 2026-06-16 17:12:11 +0000 sys: Reserve EXTERR_CAT_LINKER for kld linker exterrors Reviewed by: imp, kib (in D57002) Sponsored by: The FreeBSD Foundation --- lib/libc/gen/exterr_cat_filenames.h | 1 + sys/sys/exterr_cat.h | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/libc/gen/exterr_cat_filenames.h b/lib/libc/gen/exterr_cat_filenames.h index be65c1990af5..90e231879ccd 100644 --- a/lib/libc/gen/exterr_cat_filenames.h +++ b/lib/libc/gen/exterr_cat_filenames.h @@ -12,6 +12,7 @@ [EXTERR_CAT_FILEDESC] = "kern/kern_descrip.c", [EXTERR_CAT_PROCEXIT] = "kern/kern_exit.c", [EXTERR_CAT_FORK] = "kern/kern_fork.c", + [EXTERR_CAT_LINKER] = "kern/kern_linker.c", [EXTERR_CAT_GENIO] = "kern/sys_generic.c", [EXTERR_CAT_VFSBIO] = "kern/vfs_bio.c", [EXTERR_CAT_INOTIFY] = "kern/vfs_inotify.c", diff --git a/sys/sys/exterr_cat.h b/sys/sys/exterr_cat.h index edc23d7dfbe6..1c3f894e8aff 100644 --- a/sys/sys/exterr_cat.h +++ b/sys/sys/exterr_cat.h @@ -41,6 +41,7 @@ #define EXTERR_CAT_PROCEXIT 16 #define EXTERR_CAT_VMM 17 #define EXTERR_CAT_HWPMC_IBS 18 +#define EXTERR_CAT_LINKER 19 #endif From nobody Tue Jun 16 20:20:02 2026 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 4gfyyp60FZz6hlYw for ; Tue, 16 Jun 2026 20:20:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfyyp5JHNz3f41 for ; Tue, 16 Jun 2026 20:20:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781641202; 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=65tWpgVETG/gveweFPe/7w46UNv+pLS4OpGcNBK+JjA=; b=ukr1q7aiil1Ekq00On0FIeh9IVFQIGrjgDz6Hsg1B1+v0wZpDoD5Tzp7CUcdhRYoam5Otq aWWskyprLWvFrXLA75gfJ1nK0W4aWXSr9CX7n8Zra4x9+QIxImUE/OhxDL9MxNlp8mrAaN gHLfXxoCo2hcX/W2bdvt2jEQRjANNYP2qlfvfMvvzjd+mbWgPiRj5y4XfHkkKK21MeADM3 +WeJdrVhUDWUDz+dzyzfmISi23S8UxygL4Isv4eq73zjqiTj5mqTR8ooG0+XfHuMEXm1Y+ BRns5iQ7nYQauaUi2pa0vmrrJXVVe0FNGUh07HzpGSemxRODrXo+7HQ9tfGPPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781641202; a=rsa-sha256; cv=none; b=PmkU2hyeZabWJ/95EDyx/u8ZALWvgN7rZ9uT/ZQWUDzuXx6YCRHWZ4Sl+uf5TrUtGS6RGe kJ1OVrxGF4va/Xc5TpSc8U/G5acUMFsdWFL21yBaAETod7feOEAYlEXh+SwBlm6rgfSXST N5dBlODGs/ZWJ+iz3OJql0BOoDvSXRpVPNHXVUK9YDS2uaUtuNFg0TjwA9EXqj8TkBRhxw 4gL6gqGv2NZMpSRlXHcAoVmHiiOSoESJwxrB/GCchbgkpGN/QUe/t6jP8Rg/hXCsVtIToC 9CfvqxR5yCQp9j/QiQS4uooE6BJ+fl4Owzbq1SJCHzVbztvn0WHgcW1TlNAn5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781641202; 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=65tWpgVETG/gveweFPe/7w46UNv+pLS4OpGcNBK+JjA=; b=BgIZ/6VBRgbpx+pUwaj+IOkz1IacLrllxUmRQhk6wTbHC39KTB3otV2u6LQux5WIu2cEv8 g5ksa4wfnJblL2ZbuzHaj4WDpNEfTZvoqeIoQvYwN53Uan2qnTo/F7IwnqC3OasxKbQYlT zm6WmdFqF32sqcxM+8SJHqd72y0mVfelbOlG3+5ZahRYIsAhTVMm+Yop/xem3G6j4vPL+W qzCZWrDLo72Vw28Km5E9Kyt3kRM8cMQc/Lfi2ZcNBw0HnczeitBTDB83sNEO7oaV8iz4+P gQ4euZ/rTBD6dw0wuDYc+rbjpvtQu7tJVcfikqradNoyIO93C0fU1ogLydqLzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfyyp4k7fzh5t for ; Tue, 16 Jun 2026 20:20:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38020 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 20:20:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 34e155336f0d - main - pfctl: pfctl_get_astats() doesn't set errno 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 34e155336f0dd10efa8261b971fd540d92817339 Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 20:20:02 +0000 Message-Id: <6a31aff2.38020.7bdfa38a@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=34e155336f0dd10efa8261b971fd540d92817339 commit 34e155336f0dd10efa8261b971fd540d92817339 Author: Mark Johnston AuthorDate: 2026-06-16 19:37:35 +0000 Commit: Mark Johnston CommitDate: 2026-06-16 20:19:44 +0000 pfctl: pfctl_get_astats() doesn't set errno After commit 08f54dfca197 pfctl_get_astats() doesn't set errno anymore, except in one place. Fix up that one place and adjust callers appropriately. Reviewed by: kp Fixes: 08f54dfca197 ("pf: convert DIOCRGETASTATS to netlink") Differential Revision: https://reviews.freebsd.org/D57608 --- lib/libpfctl/libpfctl.c | 6 ++---- sbin/pfctl/pfctl_radix.c | 9 ++++++++- usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c | 6 +++--- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 839693269102..50d85a7869c9 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -3877,10 +3877,8 @@ pfctl_get_astats(struct pfctl_handle *h, const struct pfr_table *tbl, uint32_t seq_id; if (tbl == NULL || size == NULL || *size < 0 || - (*size && as == NULL)) { - errno = EINVAL; - return (-1); - } + (*size && as == NULL)) + return (EINVAL); snl_init_writer(&h->ss, &nw); hdr = snl_create_genl_msg_request(&nw, h->family_id, diff --git a/sbin/pfctl/pfctl_radix.c b/sbin/pfctl/pfctl_radix.c index 608c22141ae8..db6153941cca 100644 --- a/sbin/pfctl/pfctl_radix.c +++ b/sbin/pfctl/pfctl_radix.c @@ -194,7 +194,14 @@ int pfr_get_astats(struct pfr_table *tbl, struct pfr_astats *addr, int *size, int flags) { - return (pfctl_get_astats(pfh, tbl, addr, size, flags)); + int ret; + + ret = pfctl_get_astats(pfh, tbl, addr, size, flags); + if (ret) { + errno = ret; + return (-1); + } + return (0); } int diff --git a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c index f01218bee5f8..8221bbac812f 100644 --- a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c +++ b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c @@ -1355,7 +1355,7 @@ pfa_table_addrs(u_int sidx, struct pfr_table *pt) struct pfr_table tbl = { 0 }; struct pfr_astats *t = NULL; struct pfa_entry *e; - int i, numaddrs = 1, outnum; + int error, i, numaddrs = 1, outnum; if (pt == NULL) return (-1); @@ -1373,9 +1373,9 @@ pfa_table_addrs(u_int sidx, struct pfr_table *pt) } outnum = numaddrs; - if (pfctl_get_astats(pfh, &tbl, t, &outnum, 0) != 0) { + if ((error = pfctl_get_astats(pfh, &tbl, t, &outnum, 0)) != 0) { syslog(LOG_ERR, "pfa_table_addrs(): ioctl() on %s: %s", - pt->pfrt_name, strerror(errno)); + pt->pfrt_name, strerror(error)); numaddrs = -1; break; } From nobody Tue Jun 16 20:23:46 2026 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 4gfz365Dbcz6hlrb for ; Tue, 16 Jun 2026 20:23: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gfz364lxxz3fmB for ; Tue, 16 Jun 2026 20:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781641426; 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=2X6DmIgdQy/UCmtbq/oVBBhl07/1Y6gNq9lesU7AI7s=; b=XzETxiZEI5t09MWi+DoB43Ia0gINg98HH6mr3K4zA175aFHzqIYSl1j+8nKATceqkcrR4W 99zG79GC2KHWl/ZNXqvYtEXOfGk3V8H9FIFqHzfjZFoDQILqL5YdTEejXNMT93rm5NFWjz LA1P2shKn745gaXOiZbSQGfLrBpW1ffMT6WTW5ahB6klEP0eIBE17V/NOC86FfodW7LEA9 EMYwHfGixwb+RoYkGAuhwpwg5ReytXE+/cIyBfuRm2Jyf/kdeqjAub5jVjVJZ80/CeXlRt LTxmx0+96b77fUXoU3/riQ0klVQCPbuOfx24WYl2vK5cgZao+O8EREm624ycBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781641426; a=rsa-sha256; cv=none; b=TWjIH1ERZ/EK9LF5fV2Aao5Y7CIVxB5+EsBWPZTXZ3S7VxFplYqoDcG7Wx6wG2ABKPhGTT tS8m0yoXScWzdjB5/0simgWJIYGtfI1OIbIuVJjRUmdtz6CyqfoNR2fCLgVxJEux+tyT87 pcNlgXX/tb82UIs6RMQBZ/uVpkepevOhKq3psG0dLZbMK2hpOpwYfzRv8OpBqfwHUNNt/1 6hLX2HAOmTNHuwVohiM+zM5n6ZeIF8YgDYlTFwEq3etwUJ7EQjxPF33K5ohezUbr/KOnG7 nkaICFnodd0gCJ3S9Ol8QxKd+RN9nUAZy48uAafY5uJHVw2GlFkyRZql1CwdWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781641426; 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=2X6DmIgdQy/UCmtbq/oVBBhl07/1Y6gNq9lesU7AI7s=; b=CJcB/A4tf7OQhuy4Q5HX/IdR/RQOVrNjaDLSp7F8tg0RSQ5C4As1RWiWn9OiA2cnl6B/St BoD72qv/FVHNcMRSccdfgXXTPmJ4QqOxW/d9u7eTjEV2x4GCvVu4KtLM+apwhFIvMZl0NJ b8MWdkmvUdKQ/lAQy/WbZ1xfwONPsMZo0fnMI+DraqMNI5yMSycZpNX0GBhbf2WgyAa6ef lPW9YKc5KCjX72hDN4g6TPLh9e43x87fS1ZrSUWLWwJE9dYduhRbh3DrpevCQLyABd9+hG TRyXvUz1n6YFm9EaedODqVw6A2ScugDfV7v6pJDTCq3+34bfi1vr9kTk3C6obw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gfz36429FzhnQ for ; Tue, 16 Jun 2026 20:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38e9d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Jun 2026 20:23:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 556e793d803e - main - sh: Improve function documentation 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 556e793d803e12e9ad9361c6c53ed0433151f41e Auto-Submitted: auto-generated Date: Tue, 16 Jun 2026 20:23:46 +0000 Message-Id: <6a31b0d2.38e9d.aa8215c@gitrepo.freebsd.org> The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=556e793d803e12e9ad9361c6c53ed0433151f41e commit 556e793d803e12e9ad9361c6c53ed0433151f41e Author: Dag-Erling Smørgrav AuthorDate: 2026-06-16 20:23:18 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-06-16 20:23:18 +0000 sh: Improve function documentation * Mention that the function body can be in parentheses. It is already implied since the function body can be any valid statement, but it may not be obvious to a reader who has only ever seen functions that used curly brackets and assumes that they are part of the function syntax. * Remove the incorrect claim that a local statement may only occur at the top of a function. * Show that a value may be assigned to a variable in a local statement. * While here, replace unpaired double quotes with \(dq to avoid confusing syntax highlighters. PR: 296050 MFC after: 1 week Reviewed by: ziaee, jilles Differential Revision: https://reviews.freebsd.org/D57596 --- bin/sh/sh.1 | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index 4f860d89c654..e76ddc80187a 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -487,7 +487,7 @@ Vertical tab Literal backslash .It \e\&' Literal single-quote -.It \e\&" +.It \e\(dq Literal double-quote .It \e Ns Ar nnn The byte whose octal value is @@ -529,7 +529,7 @@ It remains literal unless it precedes the following characters, which it serves to quote: .Pp .Bl -column "XXX" "XXX" "XXX" "XXX" "XXX" -offset center -compact -.It Li $ Ta Li ` Ta Li \&" Ta Li \e Ta Li \en +.It Li $ Ta Li ` Ta Li \(dq Ta Li \e Ta Li \en .El .It Backslash A backslash preserves the literal meaning of the following @@ -1164,16 +1164,20 @@ is normally a list enclosed between .Ql { and -.Ql } . +.Ql } +or +.Ql \&( +and +.Ql \&) . +In the latter case, the function will be executed in a subshell when +invoked. .Pp Variables may be declared to be local to a function by using the .Ic local -command. -This should appear as the first statement of a function, -and the syntax is: +command: .Pp -.D1 Ic local Oo Ar variable ... Oc Op Fl +.D1 Ic local Oo Ar variable Ns Oo = Ns value Oc ... Oc Op Fl .Pp The .Ic local @@ -1185,7 +1189,10 @@ When a variable is made local, it inherits the initial value and exported and readonly flags from the variable with the same name in the surrounding scope, if there is one. -Otherwise, the variable is initially unset. +Otherwise, the variable is initially unset unless assigned a value in +the +.Ic local +statement. The shell uses dynamic scoping, so that if the variable .Va x @@ -2637,7 +2644,7 @@ by means of specifying their job IDs as arguments. See .Sx Job Control for a list of job ID forms. -.It Ic local Oo Ar variable ... Oc Op Fl +.It Ic local Oo Ar variable Ns Oo = Ns value Oc ... Oc Op Fl See the .Sx Functions subsection. From nobody Wed Jun 17 03:08:21 2026 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 4gg81x4CG4z6jFLW for ; Wed, 17 Jun 2026 03:08: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gg81x2Gp9z3VZ1 for ; Wed, 17 Jun 2026 03:08:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781665701; 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=UxhEZhJIuvrSAMr74Zc8UpdqTXTrnXwYKbk3Ufm4v90=; b=qgp4lGKL6HIpxiBspRjPleLQOv0itusXYSoFT+smuuyNgqaHeITkJ0WvLPTn9O2WiSCyFL DJGp6LFbKVk7dGk2RXztd+ShNjh2JN9c0xDJwPDHtPMfu5F01AfWd+RyiLFhvLEEMTM8bb hbIVRpmx/1aB0GQU+UQjrmykxHo19ACcHehs6h/dBhzAlX8fyQbezZWitNsAIuqmxCNF0s QeKdlnW1RpMsaloceA2YunAF/5jSGTwMlxdp+oP2Vv0CeaeurTj3QZKbcEcmgKOSCsg/6I JjQ0qWl4IEBvcfGjQDDTLRYYVlq/F3zUL+DcdMFBwo8mgAtwj4jO2DayN4g7Lw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781665701; a=rsa-sha256; cv=none; b=oE67Cx73qYruKpYct2UGCgI8K6xrzbrqlxvXmDOAHSUTHsowQlysLu4NCO8XBW3d++rHKk JdpMPcUpz0bc4Hy2gUBEiYmxSD649atZJ1kMfEKT+WZedxTto0DUp8zgvNPhxtgZvmNUKd A8LrWCyoDTH6m7S+XhahUa1ncenRZ46MB9wWM7VYsxFAtbcWfZna/6Te1ZzT6qXzLXKaAu hWqTaUGCasLBD9OxrCZIAE7M31/MT875ya7Nw23KpwAwOl0YTvnjqqGJmfqaiuG7l1MG+r 3rvNDKFqybBlJcoPzCq8XhpE6CZvxpFcfF2L5eQhGbJI1Iw8+X8CemUGhPGS2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781665701; 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=UxhEZhJIuvrSAMr74Zc8UpdqTXTrnXwYKbk3Ufm4v90=; b=g4REcqxENAMWRC6XQ10To5gAVykHssqAlC34fysn9e2phK8JCr+Vjl1QdRmj714Sp4rHM0 cwcFt5Ie+Wp1sQIiLjcZwxD3hC4BEHMgv8i68xFd4BXRQeu9yGzL51KF1x0InFVdc484ET bA8s74IpIoUXfaVvtKHI5jfmpaMHiCHNDtZ4Y0ObFmNRi2AS9I7W8LMgCEmyvTh2mmElSO Bik7ayXx6Yr8FW2VnSisO4xTqpnAcW8WwiJlds5UqhgiEhORzpArdtwekTakhiUuowjDh5 my4XeQ/WgwRlsBYavMiEPgHczlEM5cfTIiGLM6AfFBeSPuFZsxMH25T+7WRsNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gg81x1byPztc0 for ; Wed, 17 Jun 2026 03:08:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3b184 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 03:08:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 6a2c4f0c0d9a - main - acpi: Fix panic when reading 'hw.acpi.suspend_state' knob on S1/S2 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 6a2c4f0c0d9a9b93b26a1ad76f3a3fcbc590140c Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 03:08:21 +0000 Message-Id: <6a320fa5.3b184.51e2dd51@gitrepo.freebsd.org> The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=6a2c4f0c0d9a9b93b26a1ad76f3a3fcbc590140c commit 6a2c4f0c0d9a9b93b26a1ad76f3a3fcbc590140c Author: Olivier Certner AuthorDate: 2026-06-03 08:43:27 +0000 Commit: Olivier Certner CommitDate: 2026-06-17 03:06:11 +0000 acpi: Fix panic when reading 'hw.acpi.suspend_state' knob on S1/S2 The 'hw.acpi.suspend_state' sysctl knob was re-introduced with a bug. Its handler, acpi_suspend_state_sysctl(), expects the ACPI softc in 'arg1', but the knob was registered with NULL there. This causes a panic (NULL dereference) when reading the knob if the suspend state has been set to S1 or S2 or equivalently the suspend sleep type to STANDBY. Fix it by passing the ACPI softc as 'arg1' when registering the knob. Reviewed by: obiwac Fixes: 9e1e29bd5ec6 ("acpi: Add back `hw.acpi.suspend_state` sysctl") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57412 --- sys/dev/acpica/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 5cb0afa581ca..107fb64459ce 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -748,7 +748,7 @@ acpi_attach(device_t dev) "your laptop when you close the lid."); SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "suspend_state", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - NULL, 0, acpi_suspend_state_sysctl, "A", + sc, 0, acpi_suspend_state_sysctl, "A", "Current ACPI suspend state. This sysctl is deprecated; you probably " "want to use kern.power.suspend instead."); SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), From nobody Wed Jun 17 03:08:23 2026 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 4gg81z53JWz6jFLX for ; Wed, 17 Jun 2026 03:08:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gg81z2tNpz3VTH for ; Wed, 17 Jun 2026 03:08:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781665703; 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=IHgcg9u7cMqZnAREORGfRoUmXqiCFA6bARXVttgNUvQ=; b=KQkzbVj5GaP5XhUk3M2kB3kx6NbKJu8vgNeUHyrfFhhrqqUnrkuHotZGSGaRchMvdNIjpe dxc02wJtnEFJ5ge29zywZ/+xwkT1Jq3bPVl3aBmeRkbzNS1ALFDsGtHvBt4IX+QVdWcoIg wcbfM7TEhFkMNwolKXMWHiSk/6xyYSTao2MR/Q4MOi2C1xMqhr/A90bXuetmlqVl0b3Dhb MoR9WlYRdhD7G69Fq7M9PowoX1vPQ861ZrfFFU+VZfQUkxyLxiNJzi4cZVBZJM7gy/GsMZ 7dBryGkYJZAGGENKMliMdtMYtfi26qK+9Aqn3SmM3z4f/0gk3Ic8YHE9suMn3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781665703; a=rsa-sha256; cv=none; b=NCtVsCd0WWtWk/kydurhJZFD4UW05YoXHjsVrTgELytvUSfgdX6V8rSshB5Z7M6ZhdqsQu LVOUnr0o1bu6oaP7vzwtwNiHaSbWEVd6mY27h1NMG+QYeTqUrgpYhdczjxsmOT2mIRltcB dasgR8KoThkHPQc1BMhX+w77dmMPdX0WXoe9L9iBNxFlRRDnQkiBK25VHWiTIB6qU3rVlF /nnhQHrZm4OmZZB8ZmhR4WC2oYM7BaJJ6bdnJjI8aH/u/2Dy0KOuKArHr5UR0wP+iMDHul dglVLBY7olJRzkn4k1tv3pGq3feChmU+Pkxt7i2fj0rO6x7LnrS3FZnqPreRLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781665703; 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=IHgcg9u7cMqZnAREORGfRoUmXqiCFA6bARXVttgNUvQ=; b=XIml1CidWa8pwNLF8sUYHcOZEaR4xtOeaYxZN4yc03lLiIasOAwBEaNSDRhByh7U2YHkUg dAm9mS6kEu89EkXLtKPM0mLMY4UiTSsxckU7IaEb/FB0RhfTc54NEL4OdCH6GMouShVLgK CR6wB9drXWRa5r9LTJN4ndhis+h616HGAuDBMmIDZTJ4cdBzcBp6vBqH7j7UteV6NTM3nz N3fLCgvbAm0oEz2ijWuBUfMkkjenSrz0sGSz2p62ZiHjHQaaIGUxGjHWURMZI6ehqwAIRk Va4PgKjtYEPai8PgxjNYIqmCwVjZDiQvJymP/Yu3d2KM/sF8432969pIPJ59bQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gg81z2T6YztwS for ; Wed, 17 Jun 2026 03:08:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 39b7c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 03:08:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 554a459ff599 - main - acpi: Constify acpi_stype_to_sstate() and some 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 554a459ff59969e0f66b1b1c6695d249e2eecd84 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 03:08:23 +0000 Message-Id: <6a320fa7.39b7c.5887a2d5@gitrepo.freebsd.org> The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=554a459ff59969e0f66b1b1c6695d249e2eecd84 commit 554a459ff59969e0f66b1b1c6695d249e2eecd84 Author: Olivier Certner AuthorDate: 2026-06-17 03:03:20 +0000 Commit: Olivier Certner CommitDate: 2026-06-17 03:06:22 +0000 acpi: Constify acpi_stype_to_sstate() and some users Reviewed by: obiwac Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57413 --- sys/dev/acpica/acpi.c | 14 ++++++++------ sys/kern/subr_power.c | 2 +- sys/sys/power.h | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 75cb99d2cdfe..9a85a0844de6 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -197,7 +197,8 @@ static int acpi_suspend_state_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_sleep_state_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_stype_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_debug_objects_sysctl(SYSCTL_HANDLER_ARGS); -static int acpi_stype_to_sstate(struct acpi_softc *sc, enum power_stype stype); +static int acpi_stype_to_sstate(const struct acpi_softc *const sc, + const enum power_stype stype); static int acpi_pm_func(u_long cmd, void *arg, enum power_stype stype); static void acpi_enable_pcie(void); static void acpi_reset_interfaces(device_t dev); @@ -808,7 +809,8 @@ acpi_attach(device_t dev) } static int -acpi_stype_to_sstate(struct acpi_softc *sc, enum power_stype stype) +acpi_stype_to_sstate(const struct acpi_softc *const sc, + const enum power_stype stype) { switch (stype) { case POWER_STYPE_AWAKE: @@ -2160,7 +2162,7 @@ acpi_device_pwr_for_sleep_sxd(device_t dev, ACPI_HANDLE handle, int state, int acpi_device_pwr_for_sleep(device_t bus, device_t dev, int *dstate) { - struct acpi_softc *sc = device_get_softc(bus); + const struct acpi_softc *const sc = device_get_softc(bus); ACPI_HANDLE handle = acpi_get_handle(dev); int state; @@ -3846,7 +3848,7 @@ acpi_wake_set_enable(device_t dev, int enable) } static int -acpi_wake_sleep_prep(struct acpi_softc *sc, ACPI_HANDLE handle, +acpi_wake_sleep_prep(struct acpi_softc *const sc, ACPI_HANDLE handle, enum power_stype stype) { int sstate; @@ -3884,7 +3886,7 @@ acpi_wake_sleep_prep(struct acpi_softc *sc, ACPI_HANDLE handle, } static int -acpi_wake_run_prep(struct acpi_softc *sc, ACPI_HANDLE handle, +acpi_wake_run_prep(struct acpi_softc *const sc, ACPI_HANDLE handle, enum power_stype stype) { int sstate; @@ -4557,7 +4559,7 @@ acpi_supported_sleep_state_sysctl(SYSCTL_HANDLER_ARGS) static int acpi_suspend_state_sysctl(SYSCTL_HANDLER_ARGS) { - struct acpi_softc *const sc = oidp->oid_arg1; + const struct acpi_softc *const sc = oidp->oid_arg1; const enum power_stype old_stype = power_suspend_stype; enum power_stype new_stype; int old_sstate = acpi_stype_to_sstate(sc, old_stype); diff --git a/sys/kern/subr_power.c b/sys/kern/subr_power.c index 1cfa6e5c77dd..5c1f6283caff 100644 --- a/sys/kern/subr_power.c +++ b/sys/kern/subr_power.c @@ -191,7 +191,7 @@ power_pm_deferred_fn(void *arg, int pending) int power_pm_register(u_int pm_type, power_pm_fn_t pm_fn, void *pm_arg, - bool pm_supported[static POWER_STYPE_COUNT]) + const bool pm_supported[static POWER_STYPE_COUNT]) { int error; diff --git a/sys/sys/power.h b/sys/sys/power.h index b2d49781d359..c9439d89db20 100644 --- a/sys/sys/power.h +++ b/sys/sys/power.h @@ -107,7 +107,7 @@ extern const char *power_stype_to_name(enum power_stype _stype); typedef int (*power_pm_fn_t)(u_long _cmd, void* _arg, enum power_stype _stype); extern int power_pm_register(u_int _pm_type, power_pm_fn_t _pm_fn, void *_pm_arg, - bool _pm_supported[static POWER_STYPE_COUNT]); + const bool _pm_supported[static POWER_STYPE_COUNT]); extern u_int power_pm_get_type(void); extern int power_pm_suspend(enum power_transition _trans); From nobody Wed Jun 17 03:08:22 2026 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 4gg81y5lg2z6jFNr for ; Wed, 17 Jun 2026 03:08:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gg81y2ZFQz3Vfl for ; Wed, 17 Jun 2026 03:08:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781665702; 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=k3RweXoUHFyXlgAFqRYjTna5yCaTFwWBkhn8Rntdwio=; b=N3Ss8UjRwhwJFkFbidn64D32Vjg490EjlA402Kvdc5DOolct1mP/vQ+tRLt1+IHQ//O+JJ FGAKwWKMcsjASStxb9at/u/zQ00tjpLomH46MehAhE6cAGBUInGmppnWQw4Dc+IwmJBZWi PZubdFVPQfRdk3Tp+4LPbs44LwBrDn9s5g6VsqrKY/hURWbdnMfQb7NH8IlYB8nvDpSE4N 20Rb9myR/C1vZ7epPC5mNsWNelHFDxEgBWdZK9yhz78DFJEF1BNL3jdaXbLnSPs4vwPThb cQHfNj8u+SLXrJt5bj/ZIEyE52grE3LdU+mFPeey1d+lWWZBJv6a+iWp7lxFiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781665702; a=rsa-sha256; cv=none; b=u9EYgYZsPZgf3Lhs95n/SikuW++LhkzSvwUPa4C3DsxGpiOttBnIZcCvAx5VSuvBeifOn4 kyrRQJSJImtQCWcasEVMApghnb6hF9eFNCXIsrchQe1XO4/6BI8y4tKvE7dixHWHBzFJQf UPjYDcCTegKC6+vxsC5nog3ItGYA7kKTzWVTX/TakDAz4fWUzWE4oxULV9DAsJGDlTZbXB 50Aem4UMFslVNb4vcIMEtU6hJqvZ6detc8qxUSAOCAg3vzvlRBRNOHyR89zWvNw8/PQZYz SIOY5+65+n5EEhpKZHZs1EZ0iDFbui1LGHEKxibl0CBQKjtkF/gWFj/zTfyo+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781665702; 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=k3RweXoUHFyXlgAFqRYjTna5yCaTFwWBkhn8Rntdwio=; b=qknZbg66GUpkVttvoakiScYAJ2rTOb24FtXZmMM2zPBXJE2FQdPPXGen+uBEm9uDA8jmoL xlIOUL3DUz3o7SUAZDBzRCs6Gh8kDuU3dZtEZPsyNR5m1COMdtnA/5Og/odNjKeHyoTRad UVLK0D+x9riGou+VDqgfWRWZ6EIAsuy2+cGZ5vNhFfzewH6tkXp3Zyh1pi60NMHCfBll2s kuMpX4UGsvGu+bSxfaVM8x2meFHB0mh7f3a0dCz8L9GQVK1zOxTFTgAahYM3RwS9okHRhm 3AMKdwlvKtyr9CRkJG3MKhfZMVLVZETp7xI7zERVXq3nKy9UGOu+6TFtSU8ddQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gg81y20cdztc1 for ; Wed, 17 Jun 2026 03:08:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3aa1a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 03:08:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: ea44698a74ce - main - acpi: Move supported states arrays into the softc 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: ea44698a74ce0395231fe9e25e74e620d02b60f9 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 03:08:22 +0000 Message-Id: <6a320fa6.3aa1a.4f7f0ada@gitrepo.freebsd.org> The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ea44698a74ce0395231fe9e25e74e620d02b60f9 commit ea44698a74ce0395231fe9e25e74e620d02b60f9 Author: Olivier Certner AuthorDate: 2026-06-02 19:51:54 +0000 Commit: Olivier Certner CommitDate: 2026-06-17 03:06:21 +0000 acpi: Move supported states arrays into the softc This is done in preparation of having some machine-dependent code access these arrays through the softc. Before this change, these arrays were static. We chose to make them part of the softc, instead of just exporting them ('acpi_quirks' remains a known offender; some better way forward is to declare the whole ACPI softc as static). Some sysctl handlers now need to be passed the softc to access the arrays, and some already needed to be passed a pointer to a field in the softc. As sysctl handlers are provided with a single pointer (arg1) and a single integer (arg2), and now that the softc has to be passed into the pointer argument (arg1), point indirectly to the wanted softc's field by passing its offset in the integer argument (arg2). To preserve the statically sized array in the signature of power_pm_register(), and consequently avoid constructing such a dummy array in early initialization (after this change, we can't pass acpi_supported_stypes[] anymore as there is no existing ACPI softc at this point), just remove the early ACPI registration via power_pm_register(). This existed in the past as a hack to ensure ACPI would be registered in priority, but for a long time now ACPI has been the only subsystem that registers itself to the generic power infrastructure, so this early registration has not been needed. Reviewed by: obiwac Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57413 --- sys/dev/acpica/acpi.c | 98 ++++++++++++++++++++++-------------------------- sys/dev/acpica/acpivar.h | 4 ++ 2 files changed, 49 insertions(+), 53 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 107fb64459ce..75cb99d2cdfe 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -117,10 +117,6 @@ struct callout acpi_sleep_timer; /* Bitmap of device quirks. */ int acpi_quirks; -/* Supported sleep states and types. */ -static bool acpi_supported_stypes[POWER_STYPE_COUNT]; -static bool acpi_supported_sstates[ACPI_S_STATE_COUNT]; - static void acpi_lookup(void *arg, const char *name, device_t *dev); static int acpi_modevent(struct module *mod, int event, void *junk); @@ -636,17 +632,17 @@ acpi_attach(device_t dev) * Probe all supported ACPI sleep states. Awake (S0) is always supported, * and suspend-to-idle is always supported on x86 only (at the moment). */ - acpi_supported_sstates[ACPI_STATE_S0] = true; - acpi_supported_stypes[POWER_STYPE_AWAKE] = true; + sc->acpi_supported_sstates[ACPI_STATE_S0] = true; + sc->acpi_supported_stypes[POWER_STYPE_AWAKE] = true; #if defined(__i386__) || defined(__amd64__) - acpi_supported_stypes[POWER_STYPE_SUSPEND_TO_IDLE] = true; + sc->acpi_supported_stypes[POWER_STYPE_SUSPEND_TO_IDLE] = true; #endif for (state = ACPI_STATE_S1; state <= ACPI_STATE_S5; state++) { UINT8 TypeA, TypeB; if (ACPI_SUCCESS(AcpiGetSleepTypeData(state, &TypeA, &TypeB))) { - acpi_supported_sstates[state] = true; - acpi_supported_stypes[acpi_sstate_to_stype(state)] = true; + sc->acpi_supported_sstates[state] = true; + sc->acpi_supported_stypes[acpi_sstate_to_stype(state)] = true; } } @@ -654,14 +650,14 @@ acpi_attach(device_t dev) * Dispatch the default sleep type to devices. The lid switch is set * to UNKNOWN by default to avoid surprising users. */ - sc->acpi_power_button_stype = acpi_supported_stypes[POWER_STYPE_POWEROFF] ? + sc->acpi_power_button_stype = sc->acpi_supported_stypes[POWER_STYPE_POWEROFF] ? POWER_STYPE_POWEROFF : POWER_STYPE_UNKNOWN; sc->acpi_lid_switch_stype = POWER_STYPE_UNKNOWN; sc->acpi_standby_sx = ACPI_STATE_UNKNOWN; - if (acpi_supported_sstates[ACPI_STATE_S1]) + if (sc->acpi_supported_sstates[ACPI_STATE_S1]) sc->acpi_standby_sx = ACPI_STATE_S1; - else if (acpi_supported_sstates[ACPI_STATE_S2]) + else if (sc->acpi_supported_sstates[ACPI_STATE_S2]) sc->acpi_standby_sx = ACPI_STATE_S2; /* @@ -674,13 +670,13 @@ acpi_attach(device_t dev) */ sc->acpi_sleep_button_stype = POWER_STYPE_UNKNOWN; for (stype = POWER_STYPE_STANDBY; stype <= POWER_STYPE_FW_HIBERNATE; stype++) - if (acpi_supported_stypes[stype]) { + if (sc->acpi_supported_stypes[stype]) { sc->acpi_sleep_button_stype = stype; break; } if (sc->acpi_sleep_button_stype == POWER_STYPE_FW_HIBERNATE || sc->acpi_sleep_button_stype == POWER_STYPE_UNKNOWN) { - if (acpi_supported_stypes[POWER_STYPE_SUSPEND_TO_IDLE]) + if (sc->acpi_supported_stypes[POWER_STYPE_SUSPEND_TO_IDLE]) sc->acpi_sleep_button_stype = POWER_STYPE_SUSPEND_TO_IDLE; } @@ -728,24 +724,25 @@ acpi_attach(device_t dev) SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "supported_sleep_state", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - 0, 0, acpi_supported_sleep_state_sysctl, "A", + sc, 0, acpi_supported_sleep_state_sysctl, "A", "List supported ACPI sleep states."); SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "power_button_state", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - &sc->acpi_power_button_stype, 0, acpi_stype_sysctl, "A", - "Power button ACPI sleep state."); + sc, offsetof(struct acpi_softc, acpi_power_button_stype), + acpi_stype_sysctl, "A", "Power button ACPI sleep state."); SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "sleep_button_state", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - &sc->acpi_sleep_button_stype, 0, acpi_stype_sysctl, "A", + sc, offsetof(struct acpi_softc, acpi_sleep_button_stype), acpi_stype_sysctl, "A", "Sleep button ACPI sleep state."); SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "lid_switch_state", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - &sc->acpi_lid_switch_stype, 0, acpi_stype_sysctl, "A", - "Lid ACPI sleep state. Set to suspend_to_idle or fw_suspend if you want to suspend " - "your laptop when you close the lid."); + sc, offsetof(struct acpi_softc, acpi_lid_switch_stype), + acpi_stype_sysctl, "A", + "Lid ACPI sleep state. Set to suspend_to_idle or fw_suspend " + "if you want to suspend your laptop when you close the lid."); SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "suspend_state", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, acpi_suspend_state_sysctl, "A", @@ -754,7 +751,8 @@ acpi_attach(device_t dev) SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "standby_state", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, - &sc->acpi_standby_sx, 0, acpi_sleep_state_sysctl, "A", + sc, offsetof(struct acpi_softc, acpi_standby_sx), + acpi_sleep_state_sysctl, "A", "ACPI Sx state to use when going standby (usually S1 or S2)."); SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "sleep_delay", CTLFLAG_RW, &sc->acpi_sleep_delay, 0, @@ -783,7 +781,7 @@ acpi_attach(device_t dev) /* Register ACPI again to pass the correct argument of pm_func. */ power_pm_register(POWER_PM_TYPE_ACPI, acpi_pm_func, sc, - acpi_supported_stypes); + sc->acpi_supported_stypes); acpi_platform_osc(dev); @@ -3342,7 +3340,7 @@ acpi_ReqSleepState(struct acpi_softc *sc, enum power_stype stype) if (stype < POWER_STYPE_AWAKE || stype >= POWER_STYPE_COUNT) return (EINVAL); - if (!acpi_supported_stypes[stype]) + if (!sc->acpi_supported_stypes[stype]) return (EOPNOTSUPP); /* @@ -3637,7 +3635,7 @@ acpi_EnterSleepState(struct acpi_softc *sc, enum power_stype stype) if (stype <= POWER_STYPE_AWAKE || stype >= POWER_STYPE_COUNT) return_ACPI_STATUS (AE_BAD_PARAMETER); - if (!acpi_supported_stypes[stype]) { + if (!sc->acpi_supported_stypes[stype]) { device_printf(sc->acpi_dev, "Sleep type %s not supported on this " "platform\n", power_stype_to_name(stype)); return (AE_SUPPORT); @@ -4475,7 +4473,7 @@ acpiioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *t sstate = *(int *)addr; if (sstate < ACPI_STATE_S0 || sstate > ACPI_STATE_S5) return (EINVAL); - if (!acpi_supported_sstates[sstate]) + if (!sc->acpi_supported_sstates[sstate]) return (EOPNOTSUPP); if (ACPI_FAILURE(acpi_SetSleepState(sc, acpi_sstate_to_stype(sstate)))) error = ENXIO; @@ -4540,13 +4538,14 @@ acpi_sstate_to_sname(int state) static int acpi_supported_sleep_state_sysctl(SYSCTL_HANDLER_ARGS) { + const struct acpi_softc *const sc = arg1; int error; struct sbuf sb; UINT8 state; sbuf_new(&sb, NULL, 32, SBUF_AUTOEXTEND); for (state = ACPI_STATE_S1; state < ACPI_S_STATE_COUNT; state++) - if (acpi_supported_sstates[state]) + if (sc->acpi_supported_sstates[state]) sbuf_printf(&sb, "%s ", acpi_sstate_to_sname(state)); sbuf_trim(&sb); sbuf_finish(&sb); @@ -4558,13 +4557,13 @@ acpi_supported_sleep_state_sysctl(SYSCTL_HANDLER_ARGS) static int acpi_suspend_state_sysctl(SYSCTL_HANDLER_ARGS) { - char name[10]; - int err; - struct acpi_softc *sc = oidp->oid_arg1; + struct acpi_softc *const sc = oidp->oid_arg1; + const enum power_stype old_stype = power_suspend_stype; enum power_stype new_stype; - enum power_stype old_stype = power_suspend_stype; int old_sstate = acpi_stype_to_sstate(sc, old_stype); int new_sstate; + char name[10]; + int err; strlcpy(name, acpi_sstate_to_sname(old_sstate), sizeof(name)); err = sysctl_handle_string(oidp, name, sizeof(name), req); @@ -4576,7 +4575,7 @@ acpi_suspend_state_sysctl(SYSCTL_HANDLER_ARGS) return (EINVAL); new_stype = acpi_sstate_to_stype(new_sstate); if (new_sstate != ACPI_STATE_UNKNOWN && - acpi_supported_stypes[new_stype] == false) + sc->acpi_supported_stypes[new_stype] == false) return (EOPNOTSUPP); if (new_stype != old_stype) @@ -4587,11 +4586,13 @@ acpi_suspend_state_sysctl(SYSCTL_HANDLER_ARGS) static int acpi_sleep_state_sysctl(SYSCTL_HANDLER_ARGS) { + struct acpi_softc *const sc = arg1; + int *const state_field = (int *)((char *)sc + arg2); + const int old_sstate = *state_field; char sleep_state[10]; int error; - int new_sstate, old_sstate; + int new_sstate; - old_sstate = *(int *)oidp->oid_arg1; strlcpy(sleep_state, acpi_sstate_to_sname(old_sstate), sizeof(sleep_state)); error = sysctl_handle_string(oidp, sleep_state, sizeof(sleep_state), req); if (error == 0 && req->newptr != NULL) { @@ -4599,10 +4600,10 @@ acpi_sleep_state_sysctl(SYSCTL_HANDLER_ARGS) if (new_sstate < 0) return (EINVAL); if (new_sstate < ACPI_S_STATE_COUNT && - !acpi_supported_sstates[new_sstate]) + !sc->acpi_supported_sstates[new_sstate]) return (EOPNOTSUPP); if (new_sstate != old_sstate) - *(int *)oidp->oid_arg1 = new_sstate; + *state_field = new_sstate; } return (error); } @@ -4610,12 +4611,15 @@ acpi_sleep_state_sysctl(SYSCTL_HANDLER_ARGS) static int acpi_stype_sysctl(SYSCTL_HANDLER_ARGS) { + struct acpi_softc *const sc = arg1; + enum power_stype *const stype_field = + (enum power_stype *)((char *)sc + arg2); + const enum power_stype old_stype = *stype_field; + enum power_stype new_stype; char name[POWER_STYPE_NAME_LEN]; int err; int sstate; - enum power_stype new_stype, old_stype; - old_stype = *(enum power_stype *)oidp->oid_arg1; strlcpy(name, power_stype_to_name(old_stype), sizeof(name)); err = sysctl_handle_string(oidp, name, sizeof(name), req); if (err != 0 || req->newptr == NULL) @@ -4633,16 +4637,16 @@ acpi_stype_sysctl(SYSCTL_HANDLER_ARGS) "an ACPI S-state has been passed to it. This functionality " "is deprecated; see acpi(4).\n", oidp->oid_name); MPASS(sstate < ACPI_S_STATE_COUNT); - if (acpi_supported_sstates[sstate] == false) + if (sc->acpi_supported_sstates[sstate] == false) return (EOPNOTSUPP); new_stype = acpi_sstate_to_stype(sstate); } - if (acpi_supported_stypes[new_stype] == false) + if (sc->acpi_supported_stypes[new_stype] == false) return (EOPNOTSUPP); } if (new_stype != old_stype) - *(enum power_stype *)oidp->oid_arg1 = new_stype; + *stype_field = new_stype; return (0); } @@ -5076,15 +5080,3 @@ acpi_pm_func(u_long cmd, void *arg, enum power_stype stype) out: return (error); } - -static void -acpi_pm_register(void *arg) -{ - if (!cold || resource_disabled("acpi", 0)) - return; - - power_pm_register(POWER_PM_TYPE_ACPI, acpi_pm_func, NULL, - acpi_supported_stypes); -} - -SYSINIT(power, SI_SUB_KLD, SI_ORDER_ANY, acpi_pm_register, NULL); diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index 7bcac6239253..476170f5743b 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -57,6 +57,10 @@ struct acpi_softc { enum power_stype acpi_stype; int acpi_sleep_disabled; + /* Supported sleep states and types. */ + bool acpi_supported_stypes[POWER_STYPE_COUNT]; + bool acpi_supported_sstates[ACPI_S_STATE_COUNT]; + struct sysctl_ctx_list acpi_sysctl_ctx; struct sysctl_oid *acpi_sysctl_tree; enum power_stype acpi_power_button_stype; From nobody Wed Jun 17 08:21:05 2026 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 4ggGyp1RxPz6gx70 for ; Wed, 17 Jun 2026 08:21: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggGyp0hHnz49ZH for ; Wed, 17 Jun 2026 08:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781684466; 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=VPTIgejpNNkq46YV4Tj7XEWGmF97sY6tkPN8Bnj04wQ=; b=b3Ar3LGSH3w/6FsupjtV0BFaVEWjnzj0poGj+R1weIRnOgGUZg7c/hi8EHQ5gr93ZKdCcM bzjQsK7OX9accWbdQPjruflWmeATD0IxHYvkB3KeZd8nyTslMfd0QkzXqPc3dXxslSQKyT 0wg6nkPOpw9JcOCusqbyb2HhH4BL4Ube/4kSy9aKlY8HNwRj9Gvm+sqYVJ1QGi+5HoubM6 fAd4qwNmMpAsojbxvhOT/IibT6E/6bOuKoEH1vpLrII1wj1r/AWB8y29OhmMJeBQ3m+E77 vIBB/+YPO0sJxKwn9nHs9K7R7CMQBJTk75lrWSU/UMGJwexlSjkY1BUPB2sArQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781684466; a=rsa-sha256; cv=none; b=kqXjQLKUm0XCeMBr/6F8WHaojnWp0jSc0o8HEg4mvCAhrIbhhLJYOv1F866P+R4WuEIyQW G3ufSCwRp3MUyavY8yta3ENCIcljWYqQgUzyYM9N3eLfY38WwZeeLYWd5e8w3k171Gn9yi thW7TouAVyckXFkcatJrcYwa5N0d58r56cqXiLHjZblBp1NhkMLRcK0JxBUV+D6Fu+qb+i jLmrn7+JL2c1egSzd4X02UjE5HC1/aL301bOBWM4ywpuqeBMkxq4iRuP3+Ob5IdviigwL6 PSbETJoEnCpvjl5oH+hfVzocpETYZYLSJuryarAIV/hw016Sm0HaH4MmIbeTXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781684466; 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=VPTIgejpNNkq46YV4Tj7XEWGmF97sY6tkPN8Bnj04wQ=; b=aYzL1CLlTM8233sLThvSLVJAiLoU9xa2cGvOGBLWnzxcJk3jrEMCKDwm8xXT8zj6CU2xb8 u5yhjbuR3tY1r1KhZjien01yHr0PoOPriFeKY8eiozG9MCULyNXtI/vYyxlNvtwl/qjZwG Ot2XoIJGRkinUD2Do/Sj1rj+tR9A5M6nSTLi1LrpU8LwwlYa0yZdf9xlo8/O8X/8Za2SzI E2xt/EXfsBly8zdsNhRlzbkYoG2Efn7hlXG9R4WzjzX/zwYWFy6Ls0x2+pRYza8FcKcQ2n 8FiqdrD1mQoD7/D+67yal4SVaZaENHfst7+cOqPYzF5dVKUi9iZ64WuTCwxwfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggGyn6z0Vz13d6 for ; Wed, 17 Jun 2026 08:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33c58 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 08:21:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 9889fac5b82c - main - kern_linker.c: re-apply some more bits from db887713de2bf5 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 9889fac5b82c8de5b55c9ae708d57bc64c10c87a Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 08:21:05 +0000 Message-Id: <6a3258f1.33c58.250409a0@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9889fac5b82c8de5b55c9ae708d57bc64c10c87a commit 9889fac5b82c8de5b55c9ae708d57bc64c10c87a Author: Konstantin Belousov AuthorDate: 2026-06-17 07:12:29 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-17 08:20:25 +0000 kern_linker.c: re-apply some more bits from db887713de2bf5 The definition of the EXTERR_CATEGORY symbol in the .c file is needed for the script to regenerate identical context of gen/exterr_cat_filenames.h. Sponsored by: The FreeBSD Foundation --- sys/kern/kern_linker.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 9559b5233a3e..b183d18eaea6 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -32,10 +32,12 @@ #include "opt_hwpmc_hooks.h" #include "opt_hwt_hooks.h" +#define EXTERR_CATEGORY EXTERR_CAT_LINKER #include #include #include #include +#include #include #include #include From nobody Wed Jun 17 10:52:50 2026 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 4ggLKv0PKJz6h8pd for ; Wed, 17 Jun 2026 10:52: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggLKt6jZPz3QXK for ; Wed, 17 Jun 2026 10:52:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781693571; 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; bh=ZHBJDpNlCbElkGfF4h7VKb0FoDt6ciODrPB0FQieApA=; b=NNjhX4mPIpBaO0UAnBJ86oCZ/jNj7wKRC+exH8F0cGoWfO+sYsQf18k8mk34qGhsEaLFKO IQW0RmeCib69ZNSfIS7iAPejFQ48A/+N1DhunGA9XMg+wYPMDrHMhBRE4KlpEN50tkso/6 YjJS+LdutgEp3D/z1JZG2xyjHXO0fD4RZgt4nrdqnvifcAij0bb2wTg4R/25zEr5K/waah 6AK0VQXfJOieCfSnl3nUfRIR5XGHZ7ntHmoBjTjLf8egnEktmdCoAHaTtAns2bXwHIKU0C J4BrzYE4ADAvlch8mL4eTIstC681GVCrXPSQ6JOO3JRDeZhC2SP1J19lmBOOHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781693571; a=rsa-sha256; cv=none; b=SmoY8ihlquNAl3FML5/E2wkrHvGpiEduBrI2ZmYAPwPza94ZP6Nm7hiL6/tMXr1ES+fphy kmU5HQtv7a9LbiXMAq4tiB8y98Ub4/loZt46O7tEClno6ghkr6oNiQ3Hi5SgQ1xmMXdK9p qMJaB9AYoywbuAxvQ4ovfiRWT+r/BgaC2rR+YDw2rEJWjKhAOq0VsRVAR2qKN6FlD7rfWd jcV9U8T1Dc6UVOkWeg+4Je0Y8oTBYVycPbaxnfM5fgnytszCnSSlVfXoyByYQCydaXTYrB h8tUQc49nfyPu/YTuz540CkRQitsQZ9Ls28AlUDM9cGUvSmTs10/a+uxhIMXIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781693571; 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; bh=ZHBJDpNlCbElkGfF4h7VKb0FoDt6ciODrPB0FQieApA=; b=mgTNePLzVvFEwHWxvL5NwRARwqRIo4uSOa+3EaTWhFB6KFIkUraqs5dHVvP5Ceszz4ayeH vC5AyoEl/kwQaohh6L5MkdnXo/5Oi320KXa3bt8T+IVP2TUBoA3CpdPZjaqhogtSM5F0Hs v4QPvrc4B/FXPxcPKDzXZ/u1/N9Fekdqz9lHQI1zo97s3/1jrDbK511wECZQ2uUHPaXTno BV7Vt2O8lyN6o36myA8oz6l5DoaHZtgLREfg9sDLkv8er4et+mn2pIk2Tud9mype+jQpVr NnJfJsdqiWkwTNJzhAI/Re+sHdgnirCkDaTj+3bTmFq+dVHW+YgF3Q99VT6vdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggLKt6Ff1z16tf for ; Wed, 17 Jun 2026 10:52:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1c91f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 10:52:50 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Goran=?utf-8?Q? Meki=C4=87?= From: Christos Margiolis Subject: git: fe13f70b95a7 - main - sound: Include more information in kevent returned from the kernel 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe13f70b95a762e19c38d1152eac6312d8578f84 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 10:52:50 +0000 Message-Id: <6a327c82.1c91f.60041f72@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=fe13f70b95a762e19c38d1152eac6312d8578f84 commit fe13f70b95a762e19c38d1152eac6312d8578f84 Author: Goran Mekić AuthorDate: 2026-06-17 10:35:07 +0000 Commit: Christos Margiolis CommitDate: 2026-06-17 10:50:39 +0000 sound: Include more information in kevent returned from the kernel Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D57362 --- share/man/man4/pcm.4 | 78 ++++++++++++++++++++++++++++++++++++++++++++++++- sys/dev/sound/pcm/dsp.c | 14 +++++++-- 2 files changed, 89 insertions(+), 3 deletions(-) diff --git a/share/man/man4/pcm.4 b/share/man/man4/pcm.4 index 181b2120c2e6..cda27d734b74 100644 --- a/share/man/man4/pcm.4 +++ b/share/man/man4/pcm.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 21, 2026 +.Dd June 17, 2026 .Dt SOUND 4 .Os .Sh NAME @@ -529,6 +529,82 @@ See for a complete list of the supported .Fn ioctl functions. +.Ss kqueue Support +The +.Va kevent +structure's fields are defined as follows: +.Bl -tag -width "Fa filter" +.It Fa ident +The file descriptor for the device. +.It Fa filter +The kernel filter used to process the event. +This is either +.Dv EVFILT_READ +for recording or +.Dv EVFILT_WRITE +for playback. +.It Fa data +The number of bytes available to be read or written. +.It Fa ext +.Bl -bullet -compact +.It +.Va ext[0] +For devices that use +.Xr mmap 2 , +it contains the +.Va count_info.ptr +field reported by +.Va SNDCTL_DSP_GETIPTR +for recording or +.Va SNDCTL_DSP_GETOPTR +for playback, whereas for devices that do not use +.Xr mmap 2 , +it contains the +.Va oss_count_t.fifo_samples +field reported by +.Va SNDCTL_DSP_CURRENT_IPTR +for recording or +.Va SNDCTL_DSP_CURRENT_OPTR +for playback. +.It +.Va ext[1] +contains the +.Va audio_errinfo.rec_overruns +field for recording events, or the +.Va audio_errinfo.play_underruns +field for playback events, as reported by +.Va SNDCTL_DSP_GETERROR . +.Pp +This allows a single +.Va kevent +to report that data is ready, how many bytes can be read or written, the +current buffer position, and the current error count. +This is especially useful for scenarios that use +.Xr mmap 2 , +because without +.Xr kqueue 2 +the typical processing loop consists of: +.Bl -bullet -compact +.It +Calculating the wait time and calling +.Xr clock_nanosleep 2 . +.It +Calling +.Xr ioctl 2 +for +.Va SNDCTL_DSP_GETIPTR +or +.Va SNDCTL_DSP_GETOPTR +to get the pointer into the memory-mapped buffer where new data starts. +.It +Calling +.Xr ioctl 2 +for +.Va SNDCTL_DSP_GETERROR +to get over/underruns and handle them. +.El +.El +.El .Sh FILES The .Nm diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 1fa665b6b6cf..7f05da62a173 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -3020,10 +3020,20 @@ dsp_kqevent(struct knote *kn, long hint) } kn->kn_data = 0; if (chn_polltrigger(ch)) { - if (kn->kn_filter == EVFILT_READ) + if (kn->kn_filter == EVFILT_READ) { kn->kn_data = sndbuf_getready(ch->bufsoft); - else + if (ch->flags & CHN_F_MMAP) + kn->kn_kevent.ext[0] = sndbuf_getfreeptr(ch->bufsoft); + else + kn->kn_kevent.ext[0] = sndbuf_getready(ch->bufsoft) / ch->bufsoft->align; + } else { kn->kn_data = sndbuf_getfree(ch->bufsoft); + if (ch->flags & CHN_F_MMAP) + kn->kn_kevent.ext[0] = sndbuf_getreadyptr(ch->bufsoft); + else + kn->kn_kevent.ext[0] = sndbuf_getready(ch->bufsoft) / ch->bufsoft->align; + } + kn->kn_kevent.ext[1] = ch->xruns; } return (kn->kn_data > 0); From nobody Wed Jun 17 10:52:51 2026 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 4ggLKw3w5hz6h8th for ; Wed, 17 Jun 2026 10:52: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggLKw1RfGz3QRr for ; Wed, 17 Jun 2026 10:52:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781693572; 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; bh=3/Ciw8n3knFWRm+jdC9HyTdNsvlXP2QQL7sbfi+rQ+4=; b=Iw0TdBq/+rzktO9952Ae1y8SJAVTJSFoOnqqITD9GOWtbfkI87Qss8xpyWTkHwuQKrwd3s xoc1ZH7aWc5ZvUHG39Vhw9oylQZRV4IDObzbJHhuBNznM0vHgVR8tMxiBYOM0JIq+DC1fq DQC5Wldz5Rcg69PN+7CCXuOU1aGxXGxN0MkZXn6AJNgjJ86uO3Us/8gBj7Yc3ItirQjMtu AqTgdbVbcWb96CM8zjGzKo5vcyaKP+aHWkRWSkgBj/6z9hSv6kmLXwZUUQwWljJ3lWBh2Z 6MIHovqX3p7tDvUPB6gIVDQBbONaAA+EooByby/6WfHXzs+Fk35YSv7u+U7eHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781693572; a=rsa-sha256; cv=none; b=TYr5s64jhGMNcAclZuhWyziqGv52c/9BBa0IjgtwSgig9YYwWLGwQFMrACBJShmVDy0zsv 4nWyVUF464ohm6aKN6P+UXeCsMB3xmhrYse+ThtyZh0SA0j6bT+pIPVrlI8Qb0DRM/gi70 5A9RohsggAjerIHVtcsK6KQOMCXjnyNqplKBYpt+U0J6QA3QpZvNmIFiVwp9LWqvSgGMkl n7vaUCfHsAqlo9yfRkSPlDiYDWYYIsTRMgIEGxZGnDJ/eNid0j7DUf7IHsmp8g4IrFpgc/ pD1FOzvLCUshpFCEWbipSziaIDlzqQtETUixzv2pznwbwLiX6gVUfLW1Tc83qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781693572; 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; bh=3/Ciw8n3knFWRm+jdC9HyTdNsvlXP2QQL7sbfi+rQ+4=; b=cIuB8mI7hAvcw9leLleS8T0WAimmznEn31xtJCM84V+mccDZzm/nVVFX1Qsrykf00ziGMt kpEdhQA+/1cJW+bBoAYbjpuC1TgFLOwGCR3hmOdDp0lJtjzRgQocbaGSNERkDpyu1LNAc2 fT2YAzDQgU8P0j1EKVdqzFva0VLAoCkNQR61nm7+a575rfPOHo4HslnOhh8/3rsbJKrqq2 ahl5MbSW3B8w+cx/sS6v3jV5KSQjACnGeYqdscLaOlwy3FzwsJbcqtC+EkdvfRuItK9/e1 AhuVOaM0khsb+EUUGUuHQ1jNKoUnxhhFzRkGjIobK6jkcRXKnc6H2l9WVk1WUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggLKw010Rz17bj for ; Wed, 17 Jun 2026 10:52:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1d17d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 10:52:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Goran=?utf-8?Q? Meki=C4=87?= From: Christos Margiolis Subject: git: a48bbef5eb32 - main - sound: Adjust mmap example to use kqueue 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a48bbef5eb32508a8d7b3b986c9b1d28176d1694 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 10:52:51 +0000 Message-Id: <6a327c83.1d17d.446e4ec@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a48bbef5eb32508a8d7b3b986c9b1d28176d1694 commit a48bbef5eb32508a8d7b3b986c9b1d28176d1694 Author: Goran Mekić AuthorDate: 2026-06-17 10:36:12 +0000 Commit: Christos Margiolis CommitDate: 2026-06-17 10:50:44 +0000 sound: Adjust mmap example to use kqueue Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D57410 --- share/examples/sound/mmap.c | 178 +++++++++++++------------------------------- 1 file changed, 50 insertions(+), 128 deletions(-) diff --git a/share/examples/sound/mmap.c b/share/examples/sound/mmap.c index 7f165d417020..3710483361ac 100644 --- a/share/examples/sound/mmap.c +++ b/share/examples/sound/mmap.c @@ -26,114 +26,18 @@ */ /* - * This program demonstrates low-latency audio pass-through using mmap. - * Opens input and output audio devices using memory-mapped I/O, - * synchronizes them in a sync group for simultaneous start, - * then continuously copies audio data from input to output. + * This program demonstrates low-latency audio pass-through using mmap + * and kqueue. It opens input and output audio devices using memory- + * mapped I/O, synchronizes them in a sync group for simultaneous start, + * then continuously copies audio data from input to output. Buffer + * positions are obtained from kqueue's ext[0] (replacing GETIPTR/ + * GETOPTR ioctls) and error counters from ext[1] (replacing GETERROR). */ -#include +#include #include "oss.h" -/* - * Get current time in nanoseconds using monotonic clock. - * Monotonic clock is not affected by system time changes. - */ -static int64_t -gettime_ns(void) -{ - struct timespec ts; - - if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) - err(1, "clock_gettime failed"); - return ((int64_t)ts.tv_sec * 1000000000LL + ts.tv_nsec); -} - -/* - * Sleep until the specified absolute time (in nanoseconds). - * Uses TIMER_ABSTIME for precise timing synchronization. - */ -static void -sleep_until_ns(int64_t target_ns) -{ - struct timespec ts; - - ts.tv_sec = target_ns / 1000000000LL; - ts.tv_nsec = target_ns % 1000000000LL; - if (clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &ts, NULL) != 0) - err(1, "clock_nanosleep failed"); -} - -/* - * Calculate the number of frames to process per iteration. - * Higher sample rates require larger steps to maintain efficiency. - */ -static unsigned -frame_stepping(unsigned sample_rate) -{ - return (16U * (1U + (sample_rate / 50000U))); -} - -/* - * Update the mmap pointer and calculate progress. - * Returns the absolute progress in bytes. - * - * fd: file descriptor for the audio device - * request: ioctl request (SNDCTL_DSP_GETIPTR or SNDCTL_DSP_GETOPTR) - * map_pointer: current pointer position in the ring buffer - * map_progress: absolute progress in bytes - * buffer_bytes: total size of the ring buffer - * frag_size: size of each fragment - * frame_size: size of one audio frame in bytes - */ -static int64_t -update_map_progress(int fd, unsigned long request, int *map_pointer, - int64_t *map_progress, int buffer_bytes, int frag_size, int frame_size) -{ - count_info info = {}; - unsigned delta, max_bytes, cycles; - int fragments; - - if (ioctl(fd, request, &info) < 0) - err(1, "Failed to get mmap pointer"); - if (info.ptr < 0 || info.ptr >= buffer_bytes) - errx(1, "Pointer out of bounds: %d", info.ptr); - if ((info.ptr % frame_size) != 0) - errx(1, "Pointer %d not aligned to frame size %d", info.ptr, - frame_size); - if (info.blocks < 0) - errx(1, "Invalid block count %d", info.blocks); - - /* - * Calculate delta: how many bytes have been processed since last check. - * Handle ring buffer wraparound using modulo arithmetic. - */ - delta = (info.ptr + buffer_bytes - *map_pointer) % buffer_bytes; - - /* - * Adjust delta based on reported blocks available. - * This accounts for cases where the pointer has wrapped multiple times. - */ - max_bytes = (info.blocks + 1) * frag_size - 1; - if (max_bytes >= delta) { - cycles = max_bytes - delta; - cycles -= cycles % buffer_bytes; - delta += cycles; - } - - /* Verify fragment count matches expected value */ - fragments = delta / frag_size; - if (info.blocks < fragments || info.blocks > fragments + 1) - warnx("Pointer block mismatch: ptr=%d blocks=%d delta=%u", - info.ptr, info.blocks, delta); - - /* Update pointer and progress tracking */ - *map_pointer = info.ptr; - *map_progress += delta; - return (*map_progress); -} - /* * Copy data between ring buffers, handling wraparound. * The copy starts at 'offset' and copies 'length' bytes. @@ -169,8 +73,6 @@ main(int argc, char *argv[]) int ch, bytes; int frag_size, frame_size, verbose = 0; int map_pointer = 0; - unsigned step_frames; - int64_t frame_ns, start_ns, next_wakeup_ns; int64_t read_progress = 0, write_progress = 0; oss_syncgroup sync_group = { 0, 0, { 0 } }; struct config config_in = { @@ -187,6 +89,8 @@ main(int argc, char *argv[]) .sample_rate = 48000, .mmap = 1, }; + struct kevent ev; + int kq; while ((ch = getopt(argc, argv, "v")) != -1) { switch (ch) { @@ -228,10 +132,6 @@ main(int argc, char *argv[]) errx(1, "Input and output configurations have different fragment sizes"); - /* Calculate timing parameters */ - step_frames = frame_stepping(config_in.sample_rate); - frame_ns = 1000000000LL / config_in.sample_rate; - /* Clear output buffer to prevent noise on startup */ memset(config_out.buf, 0, bytes); @@ -245,25 +145,51 @@ main(int argc, char *argv[]) if (ioctl(config_in.fd, SNDCTL_DSP_SYNCSTART, &sync_group.id) < 0) err(1, "Starting sync group failed"); - /* Initialize timing and progress tracking */ - start_ns = gettime_ns(); - read_progress = update_map_progress(config_in.fd, SNDCTL_DSP_GETIPTR, - &map_pointer, &read_progress, bytes, frag_size, frame_size); - write_progress = read_progress; - next_wakeup_ns = start_ns; + /* Create kqueue and register input device for read events */ + kq = kqueue(); + if (kq < 0) + err(1, "kqueue failed"); + EV_SET(&ev, config_in.fd, EVFILT_READ, EV_ADD, 0, 0, NULL); + if (kevent(kq, &ev, 1, NULL, 0, NULL) < 0) + err(1, "kevent register failed"); /* * Main processing loop: - * 1. Sleep until next scheduled wakeup - * 2. Check how much new audio data is available - * 3. Copy available data from input to output buffer - * 4. Schedule next wakeup + * Block on kevent() until input data is available. + * ext[0] holds the current DMA pointer (GETIPTR/GETOPTR equivalent). + * ext[1] holds the xrun count for the channel (GETERROR equivalent). */ for (;;) { - sleep_until_ns(next_wakeup_ns); - read_progress = update_map_progress(config_in.fd, - SNDCTL_DSP_GETIPTR, &map_pointer, &read_progress, bytes, - frag_size, frame_size); + int n; + int ptr; + unsigned delta; + + n = kevent(kq, NULL, 0, &ev, 1, NULL); + if (n < 0) + err(1, "kevent failed"); + if (n == 0) + continue; + + ptr = (int)ev.ext[0]; + if (ptr < 0 || ptr >= bytes) + errx(1, "Pointer out of bounds: %d", ptr); + if ((ptr % frame_size) != 0) + errx(1, "Pointer %d not aligned to frame size %d", ptr, + frame_size); + + /* + * Calculate delta: how many bytes have been processed since + * last check. Handle ring buffer wraparound. + */ + delta = (ptr + bytes - map_pointer) % bytes; + + /* Update pointer and progress tracking */ + map_pointer = ptr; + read_progress += delta; + + /* Report xruns if any */ + if (ev.ext[1] != 0 && verbose) + warnx("xruns: %llu", (unsigned long long)ev.ext[1]); /* Copy new audio data if available */ if (read_progress > write_progress) { @@ -277,13 +203,9 @@ main(int argc, char *argv[]) printf("copied %d bytes at %d (abs %lld)\n", length, offset, (long long)write_progress); } - - /* Schedule next wakeup based on frame timing */ - next_wakeup_ns += (int64_t)step_frames * frame_ns; - if (next_wakeup_ns < gettime_ns()) - next_wakeup_ns = gettime_ns(); } + close(kq); if (munmap(config_in.buf, bytes) != 0) err(1, "Memory unmap failed"); config_in.buf = NULL; From nobody Wed Jun 17 10:52:49 2026 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 4ggLKz3TMsz6h8HV for ; Wed, 17 Jun 2026 10:52: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggLKy74L5z3QqT for ; Wed, 17 Jun 2026 10:52:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781693575; 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; bh=db92OdfliZNSLH3eExCDpZKXo0X70NvzhyEpiC30rXE=; b=OMwJbRHq6HXO0fT4+qI4P3mCpKRTMlc1lljoVwpQfsLbsoTFnjMMe+wVB3ekatDZcU3PBk SwFHPcGNg4hXs5NMCItldhNGpnosLllia6/ZIlyV4RanDkHEXUkfJk9VNZRCPPLXXHqkmw L6txtfBUDmMqr2qWJiuGZpW5zfP2Z1+5GIkiJHgqsX2pYU089DP/By76FriucJaysWDJEu KlixR5/BxzL5Zk00Mt6Nk8WORvXYbJxkW1Wp63gXvzqP0OqgatWwZsM3D8h8lG79Y/HzEV KJHQBV9SG5Susd4N3HVAGPcJqor7tgptWD2SHuZS3/Nt4jxAqvHRN1WXEw6Lqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781693575; a=rsa-sha256; cv=none; b=n8D9pIBJuWhvY7e1TVlOQdsa1g9fSHlsza6hL9Yaik6duhYe0KuNztg/iOGtp3LohVJdZ2 4LVv/SarhUw1eBK3ps5U9rlxQDJAY1VdnrhUZ3uCrkJFhm4l1me3dn4WvjyF0DhMXHoAmQ H02JUurwb8ZxGODbrg0MXrkwPfYmxVE+3/sgW8MznOlvI+ANpZZxUXyun0l91JtgyX16ME Ix3BkZ16YmG7HEX/eJcgD1+It796GwkDvhrSXrXNKf6cf7XP4rLa8NjDylcW/aw+uY+dye O1FNVK2RddhUckKkML6n9LaddjpMScwpowbBfv524hAX+Or1TVGaQ+KErKxR/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781693575; 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; bh=db92OdfliZNSLH3eExCDpZKXo0X70NvzhyEpiC30rXE=; b=Y1uCd3AGZpglyQo6QM1V8iG7SmNdVEXe/aomzmNbc1deXKdp0AbBvyjh534b4TjwkWzc6T eHUwSGgzyNvZv6wQtrxQ6GVlcuIxZdUXlkpSE8wPL0bbyo486pReDNqKGoFpBErNwYy0E0 vwlGHIhs6OzAZ9ek0c3n8YpwIRbzsG58oXh5xbKLQNEWTXpi8FQkLe1mv7i5NQxMiio94w 60Gexcw2IUBSYQEkPopiNsmM7Gm61AKvrYqj0bucX6exazZWwzLyyNCIkUN9sGauS+Y95Y NcKv2HqzcASRdD0bqOT5oVy5ts1ZkwMts0ay2Cjy80dgbymkb3wEP/HS310Z6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggLKy6Wf8z16tj for ; Wed, 17 Jun 2026 10:52:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1bbd0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 10:52:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Goran=?utf-8?Q? Meki=C4=87?= From: Christos Margiolis Subject: git: 47ae0a869c7d - main - sound: Start each channel individually 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47ae0a869c7db693ffb1ac058d63dcb79c4e68a8 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 10:52:49 +0000 Message-Id: <6a327c81.1bbd0.3aad8c2b@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=47ae0a869c7db693ffb1ac058d63dcb79c4e68a8 commit 47ae0a869c7db693ffb1ac058d63dcb79c4e68a8 Author: Goran Mekić AuthorDate: 2026-06-17 10:34:05 +0000 Commit: Christos Margiolis CommitDate: 2026-06-17 10:34:45 +0000 sound: Start each channel individually Unlock all members before starting any of them. Holding multiple channel locks while calling chn_start() on a virtual channel can trigger the parent, which acquires PCM_LOCK() while other virtual channels are still locked -- a lock order reversal. Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D57399 --- sys/dev/sound/pcm/dsp.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 05fdc18e31f8..1fa665b6b6cf 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -2742,16 +2742,29 @@ dsp_oss_syncstart(int sg_id) /* Proceed only if no errors encountered. */ if (ret == 0) { - /* Launch channels */ - while ((sm = SLIST_FIRST(&sg->members)) != NULL) { - SLIST_REMOVE_HEAD(&sg->members, link); + /* + * Unlock all members before starting any of them. + * Holding multiple channel locks while calling chn_start() + * on a virtual channel can trigger the parent, which + * acquires PCM_LOCK() while other virtual channels are + * still locked -- a lock order reversal. + */ + SLIST_FOREACH(sm, &sg->members, link) { + sm->ch->sm = NULL; + sm->ch->flags &= ~CHN_F_NOTRIGGER; + CHN_UNLOCK(sm->ch); + } + /* + * Start each channel individually, then remove it from + * the sync group and free its member structure. + */ + while ((sm = SLIST_FIRST(&sg->members)) != NULL) { c = sm->ch; - c->sm = NULL; + CHN_LOCK(c); chn_start(c, 1); - c->flags &= ~CHN_F_NOTRIGGER; CHN_UNLOCK(c); - + SLIST_REMOVE_HEAD(&sg->members, link); free(sm, M_DEVBUF); } From nobody Wed Jun 17 13:56:33 2026 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 4ggQPs3wxjz6hP1S for ; Wed, 17 Jun 2026 13: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggQPs3CfMz3sjc for ; Wed, 17 Jun 2026 13: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=1781704593; 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=QeWCUZe4q1rD8fuIDgAFXfNW4bi7gabEoV2fd036EVY=; b=Dk0T2bkpAqyJFag38av+VO+5qDLrm/zPdc36ypAafTxyCB98bNSW1Y52l71pVDkbGA4g4c T2S7MjrWIe28Nb/3BizFrIjLYBJVFRNSMGaXpL28qE/lfQ7cG0braAgffxnFyBm1FeJZns xVrHbljIloTEuw18trWR5/MEGUj3RlwmX3mKqsX9uLuyjuasAjG//QJlp3cG43UNcBOc7O 3wkPzmb0wgkJT/FwGq4Ry+eU9Tis3ZP7NWVEqmI/9fo1r0Cn+1lTnyU0Tr5pB4LyRQU5lN Tt+YmCmtY79uZExRemqUolhO7DyhGEIC23yLnwW/uuOa1CY26Q0FND5iXqtzLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781704593; a=rsa-sha256; cv=none; b=jlTv2b/hoOn0H888AZ8AFmilNvrlnuOhfZkCH4qDJDL5LdyB3RIXKKGZq1IVq7LERMavTh Tepqb76Opoe7OBNYEKF74eSqUOXPfpNZtcERafFG3oPHAomnHcRpeOuMzu1Pl6ealVNHwo p9tH3PuO+XOD4yfyc9uJ1xfINpwllsgewFXTdD6y++sg9IwwYuqgLR+arrYsy1J4C5SplZ RXNvw8SBVD28VEpwQ8ZfqauQ3xI4s3JcUs/CWdkD/gpq0lsVwUUf0SWQe6PJ99QfSeOu9F vqbmItsFK1AU9/8DFfVaN47VLfruJsZ9ddlMbckn8gYYiM5ljOGpTJz4Om2Dkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781704593; 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=QeWCUZe4q1rD8fuIDgAFXfNW4bi7gabEoV2fd036EVY=; b=iWc/MhquX2pnot+1WZoDusS5p6KJBh7TffrF5AWTW5XLqF2Fn7TTuqCtklb5KORhTvOowO qy5NSsTzWqORK/FRXpN5WiYaBLo0/Zdd3alBOaxnybNSkpEn1NpHIiPvKAhmWbrKHNjau/ HvDBcErge2ZFN8P8cNA+pq7OmL62t90axtN/qhpwr6kcdeN+no3KK/WwSdAjc+vWR2e2IJ IPHMCbVUfYht0oSDvWvRFyTFCNWoG/1T35px1AOtHzoIlOYWvRUFACQsGN86N7TmFL3Uc9 maWiooAt8ah0gqy9GTOFODfQZziCKvwMy59812McmJFKBw5bnCHfR/hQPcmIrw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggQPs2gMBzgY for ; Wed, 17 Jun 2026 13:56:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3864d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 13:56:33 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 1ed2bf1e0052 - main - tcp: cleanup resource handling in SYN handling 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 1ed2bf1e0052df8dd6b429fc4ddd1908005f39ef Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 13:56:33 +0000 Message-Id: <6a32a791.3864d.76a27e68@gitrepo.freebsd.org> The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=1ed2bf1e0052df8dd6b429fc4ddd1908005f39ef commit 1ed2bf1e0052df8dd6b429fc4ddd1908005f39ef Author: Michael Tuexen AuthorDate: 2026-06-17 13:46:56 +0000 Commit: Michael Tuexen CommitDate: 2026-06-17 13:46:56 +0000 tcp: cleanup resource handling in SYN handling Handle cred, ipopts, and maclabel using the same pattern: allocate at the beginning and set to NULL when the object is transferred to a struct syncache. When exiting the function, free these objects if not transferred or when transferred to the on-stack struct syncache. This makes use of a new function syncache_release(). This fixes a use after free problem: ipopts should only be freed, if the on-stack struct syncache is used and the pointer in this structure still points to the allocated ipopts. If the ipopts are moved from the struct syncache to the struct inpcb in syncache_socket(), which is called by syncache_tfo_expand(), the pointer in the struct syncache is set to NULL. In a FreeBSD default setup this problem is mitigated by 1. TCP fast open support on the server side not being enabled (the sysctl-variable net.inet.tcp.fastopen.server_enable is 0). 2. Incoming IP packet with source routing options are not being processed by the host stack (the sysctl-variable net.inet.ip.accept_sourceroute is 0). Only if these two sysctl-variables are changed, a FreeBSD system is affected, if a server actually using TCP fast open is running. Reported by: Yuxiang Yang, Yizhou Zhao, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM5.1 from Z.ai Reviewed by: markj, rscheff MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D57374 --- sys/netinet/tcp_syncache.c | 70 +++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 42 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 22f260db9805..0d8f725455b7 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -224,21 +224,25 @@ static MALLOC_DEFINE(M_SYNCACHE, "syncache", "TCP syncache"); #define SCH_UNLOCK(sch) mtx_unlock(&(sch)->sch_mtx) #define SCH_LOCK_ASSERT(sch) mtx_assert(&(sch)->sch_mtx, MA_OWNED) -/* - * Requires the syncache entry to be already removed from the bucket list. - */ static void -syncache_free(struct syncache *sc) +syncache_release(struct syncache *sc) { - - if (sc->sc_ipopts) + if (sc->sc_ipopts != NULL) (void)m_free(sc->sc_ipopts); - if (sc->sc_cred) + if (sc->sc_cred != NULL) crfree(sc->sc_cred); #ifdef MAC mac_syncache_destroy(&sc->sc_label); #endif +} +/* + * Requires the syncache entry to be already removed from the bucket list. + */ +static void +syncache_free(struct syncache *sc) +{ + syncache_release(sc); uma_zfree(V_tcp_syncache.zone, sc); } @@ -1427,6 +1431,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, */ KASSERT(SOLISTENING(so), ("%s: %p not listening", __func__, so)); tp = sototcpcb(so); + bzero(&scs, sizeof(scs)); cred = V_tcp_syncache.see_other ? NULL : crhold(so->so_cred); #ifdef INET6 @@ -1551,14 +1556,15 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, if (tfo_cookie_valid) INP_RUNLOCK(inp); TCPSTAT_INC(tcps_sc_dupsyn); - if (ipopts) { + if (ipopts != NULL) { /* * If we were remembering a previous source route, * forget it and use the new one we've been given. */ - if (sc->sc_ipopts) + if (sc->sc_ipopts != NULL) (void)m_free(sc->sc_ipopts); sc->sc_ipopts = ipopts; + ipopts = NULL; } /* * Update timestamp if present. @@ -1575,14 +1581,6 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, sc->sc_flags &= ~SCF_ECN_MASK; sc->sc_flags |= tcp_ecn_syncache_add(tcp_get_flags(th), iptos); } -#ifdef MAC - /* - * Since we have already unconditionally allocated label - * storage, free it up. The syncache entry will already - * have an initialized label we can use. - */ - mac_syncache_destroy(&maclabel); -#endif TCP_PROBE5(receive, NULL, NULL, m, NULL, th); /* Retransmit SYN|ACK and reset retransmit count. */ if ((s = tcp_log_addrs(&sc->sc_inc, th, NULL, NULL))) { @@ -1613,10 +1611,9 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, * Skip allocating a syncache entry if we are just going to discard * it later. */ - if (!locked || tfo_cookie_valid) { - bzero(&scs, sizeof(scs)); + if (!locked || tfo_cookie_valid) sc = &scs; - } else { + else { sc = uma_zalloc(V_tcp_syncache.zone, M_NOWAIT | M_ZERO); if (sc == NULL) { /* @@ -1633,10 +1630,9 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, } sc = uma_zalloc(V_tcp_syncache.zone, M_NOWAIT | M_ZERO); if (sc == NULL) { - if (V_tcp_syncookies) { - bzero(&scs, sizeof(scs)); + if (V_tcp_syncookies) sc = &scs; - } else { + else { KASSERT(locked, ("%s: bucket unexpectedly unlocked", __func__)); @@ -1656,23 +1652,13 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, */ #ifdef MAC sc->sc_label = maclabel; + maclabel = NULL; #endif - /* - * sc_cred is only used in syncache_pcblist() to list TCP endpoints in - * TCPS_SYN_RECEIVED state when V_tcp_syncache.see_other is false. - * Therefore, store the credentials only when needed: - * - sc is allocated from the zone and not using the on stack instance. - * - the sysctl variable net.inet.tcp.syncache.see_other is false. - * The reference count is decremented when a zone allocated sc is - * freed in syncache_free(). - */ - if (sc != &scs && !V_tcp_syncache.see_other) { - sc->sc_cred = cred; - cred = NULL; - } else - sc->sc_cred = NULL; - sc->sc_port = port; + sc->sc_cred = cred; + cred = NULL; sc->sc_ipopts = ipopts; + ipopts = NULL; + sc->sc_port = port; bcopy(inc, &sc->sc_inc, sizeof(struct in_conninfo)); sc->sc_ip_tos = ip_tos; sc->sc_ip_ttl = ip_ttl; @@ -1819,13 +1805,13 @@ donenoprobe: tfo_expanded: if (cred != NULL) crfree(cred); - if (sc == NULL || sc == &scs) { #ifdef MAC + if (maclabel != NULL) mac_syncache_destroy(&maclabel); #endif - if (ipopts) - (void)m_free(ipopts); - } + if (ipopts != NULL) + (void)m_free(ipopts); + syncache_release(&scs); return (rv); } From nobody Wed Jun 17 14:22:43 2026 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 4ggR090bm9z6hRTt for ; Wed, 17 Jun 2026 14:22:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggR0874Y9z3wfs for ; Wed, 17 Jun 2026 14:22:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781706169; 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=1trP8++gB7BO7VlpW10a4KpYP2cTmweqz2YwTO8wcCk=; b=kpSF1XFhmGHN6jl7IZFHgdIeKBpJVYRuMcGj8ZL9Lp78g8gEUMKcBeMf6es71Me9XoMUGo zebhBWvElloF9qMhAdcICmSWMo0dBwYS/QRbY0+Ldb7QJG4YjvfpU5CN0k1l8gM3/uRlpg AG0dUkAIVxNlBquOTZ46BdoponBHgo9nZqG5haIfTllbHWBGbm86dfuub2iMKZvjLHmUy6 jJ72lOP0Dw3FRiB92YqrPgnG2Yy4CBuK457sLLoMDEj1bfQPuirl6ZrvUUQdP5PDuIE/ij kKMijt3U/5B8AVX7GlursK9nCWBrVXEWk/gH5W2PufKpggqv8mxWstd+is0tGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781706169; a=rsa-sha256; cv=none; b=mmk4Gv/pLG47iV2qK01FeRVlPMPSUoQSNKgrvCXBnP4aTF4M5qRp89NBjMF3N1A8yih3BF ZaKLnNvqZPofXaJzo74kNeG2NpqyYtoItFcyEAHHiJyuNLlbZnGGj4L9gsOWEu5AyT4iYS DgtY5u8NdRGgmJh2Zxjgoavd/F8ffFltKVfR3wdzIvQDOiN6ii56XSiL6xbRAnwlN6ZK0f AAWyavQQgZREKJotD2/sng95WnMUK98Bs2Jbd0cZGmSxf7/iG8mVhet//YyGXlAokC6Pkr RBHjIy3+01cEOfDgLWZq9U3GgQudeyF/Bvc+y1Chy0MbTB4TPtzXQeUZ3/al/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781706169; 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=1trP8++gB7BO7VlpW10a4KpYP2cTmweqz2YwTO8wcCk=; b=etBkHJXXjtR5U0fwqYAhAS67b3aowWE7ljiEkFl/ISVZhtDI2LTGWMlYUF87oNuCNk+AsN 4HgyEJOnT9f1ASkpEow71clLaoPbw9Kz+RZ3xotHrPlX9eqvjGBTVv0ZuQDQuetzE3glJW jgt40oBjYnusGvSOHO+LbW0QKNkQmPVI62jyW+YA3SJNQnAsDvuIYzCZ5VgRwcYOPCDuPT GTK7YC4VQEd+AOWRTJZkfDVAPP6fnDOKO+EhTYuCWdOXYb/N4F1ph8++VBsCrFTjHMFZC1 vOHmff3RuqLurmr6avhbXYEc4+ypgN8DA2FE+py80NXcz7kvquztDwiWBUMxew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggR086dsSz19h for ; Wed, 17 Jun 2026 14:22:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3a653 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 14:22:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Devin Teske Subject: git: ef0654f2c650 - main - Update bsdconfig dot USAGE 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dteske X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef0654f2c65066b8e69c3e543099f7034def4fb1 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 14:22:43 +0000 Message-Id: <6a32adb3.3a653.32e97892@gitrepo.freebsd.org> The branch main has been updated by dteske: URL: https://cgit.FreeBSD.org/src/commit/?id=ef0654f2c65066b8e69c3e543099f7034def4fb1 commit ef0654f2c65066b8e69c3e543099f7034def4fb1 Author: Devin Teske AuthorDate: 2026-06-17 14:22:33 +0000 Commit: Devin Teske CommitDate: 2026-06-17 14:22:33 +0000 Update bsdconfig dot USAGE Replace mention of graphics/ImageMagick with graphics/GraphicsMagick --- usr.sbin/bsdconfig/dot/USAGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdconfig/dot/USAGE b/usr.sbin/bsdconfig/dot/USAGE index 6de68c1dc3bb..ab8c80334d7d 100644 --- a/usr.sbin/bsdconfig/dot/USAGE +++ b/usr.sbin/bsdconfig/dot/USAGE @@ -107,7 +107,7 @@ EXAMPLES: convert bsdconfig.ps bsdconfig.pdf xpdf bsdconfig.pdf - NOTE: Requires both `graphics/ImageMagick' and + NOTE: Requires both `graphics/GraphicsMagick' and `graphics/xdpf' from ports/packages. NOTE: The converted PDF file is not suitable for From nobody Wed Jun 17 14:31:03 2026 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 4ggR9h30nMz6hRXf for ; Wed, 17 Jun 2026 14:31: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggR9h0JF8z3xCs for ; Wed, 17 Jun 2026 14:31:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781706664; 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=5BIVmc1+lGEMRWYlvUAGr1c1MYDR8SLwTHu7zC4vtqw=; b=vmxYooF0mw7nZ1yqyyOxmjzpAuKns+tqiGZNXUyzTwGk34HcWUsv6JbK62sDTBgWUYfEN/ cOEjIDnW4I3aO0lgPtfBPkPAHwe6i8FZNnUuENNvAJ3Q+5GXNpOtY1Itka6GE53BjVneZx mYCjkBu5+cQ9NPzh5ACM8aJqL9FAWFRbkExBhx+4sSquYzIQE7G+7qEEbdlzhBk2U5fFGm yRc9Kyh+O/L9pcs2+9uJ+U4IJr8IDer4beNO0fCYLi0Qs86h1/sbmKWM3CeRQn2+17dGMT CEZBPhLGtl8QDLHNkuRyj8m2MYZTIaqV4ZU6qBAnfGCbCXEssiD5TdgWo7dHvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781706664; a=rsa-sha256; cv=none; b=f+7m/R8rBTmFDYwoB0xAtcqxfbNkF59uqRXs9oCPoleDvY9p4j1HxubvjcnpR7BizqNJDp hiIQhVQbo/lvY2XQJT+uoU8kbFicaUupcDJSO1Byqi0F1QwldSibQj1XEmv1VshBoX19lL RCPM+HqUhPsX8nS3KuDvchTB+q7nKV6VmjA3lpvroLEpQcrQzhPEB0s4tuXHNIATolez5x +0cnn/EDC4JUNhQuSbE01dCA2WZFry54b46MS0K+uCFr1sYKMzqIc/Ib+a85vXTcOJIb7H +DC0VLJq8zu1/dm7c3AAaL/oWIU6c3gxvwzC2bstYXsWxDfrdz9Ks+A56PdSqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781706664; 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=5BIVmc1+lGEMRWYlvUAGr1c1MYDR8SLwTHu7zC4vtqw=; b=BYvB+SURJxWCmkOQTmR9KJM4Dp57u4O3QWNm5BCPbyYO8tJbT9aQPPYP88NL6kqkwKl9t8 ccY0TbrWDVueu/wi88/xXz1gYgqTeuJ7WbZt2YmxYRAm/rBPx9gyw8QDoJq4kOFNdyVxis klV+WjSXbLlDu0QA51+ZzhlYGa4pvkUBIRd46tNhYkNa6BOvihVlAApp062pYg36NFYhVW IK0inXFjGBZffDxa94DNr7VMj63Iqo7VrITJAb8y3PC4ZbCoNS3MazXj7bRxFxNXBMX67W 7U6FKCUwEhT0mteqGIP4XJMzqhdeogHYhy7krNQZOTMAp5yJt1qz7zSG47LZfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggR9g6cv3zxG for ; Wed, 17 Jun 2026 14:31:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3afcc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 14:31:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Devin Teske Subject: git: 234bb65d0bf3 - main - Update bsdconfig dot USAGE 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dteske X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 234bb65d0bf34580bc93e44a802c0c60e7f31009 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 14:31:03 +0000 Message-Id: <6a32afa7.3afcc.6c806fe8@gitrepo.freebsd.org> The branch main has been updated by dteske: URL: https://cgit.FreeBSD.org/src/commit/?id=234bb65d0bf34580bc93e44a802c0c60e7f31009 commit 234bb65d0bf34580bc93e44a802c0c60e7f31009 Author: Devin Teske AuthorDate: 2026-06-17 14:30:39 +0000 Commit: Devin Teske CommitDate: 2026-06-17 14:30:39 +0000 Update bsdconfig dot USAGE graphics/gimmage is no longer in ports, remove mention --- usr.sbin/bsdconfig/dot/USAGE | 6 ------ 1 file changed, 6 deletions(-) diff --git a/usr.sbin/bsdconfig/dot/USAGE b/usr.sbin/bsdconfig/dot/USAGE index ab8c80334d7d..79b3089d6aac 100644 --- a/usr.sbin/bsdconfig/dot/USAGE +++ b/usr.sbin/bsdconfig/dot/USAGE @@ -44,12 +44,6 @@ EXAMPLES: View the above-rendered SVG file using your favorite X11-based viewer: - gimmage bsdconfig.svg - - NOTE: Requires `graphics/gimmage' from ports/packages. - - or - gthumb bsdconfig.svg NOTE: Image is scaled to fit window on launch. From nobody Wed Jun 17 14:33:01 2026 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 4ggRCx4W2Nz6hS1k for ; Wed, 17 Jun 2026 14:33: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggRCx43bpz3xwn for ; Wed, 17 Jun 2026 14:33:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781706781; 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=OLVnM967Mnvww12StEoJJRPhjSYl5WSTyRS32MhG5Yg=; b=j03wYUr9JNt+7ZfvDM4DVDdIdTLSyFCbFtBXGG774TJbqxLUxffud26H5gha39gXZPUk2S WFimP3TOtXWZgUxpzb1gLWp4BrnQ7j2Z6PZo97wTxLHK2rGlzZz5MbEa4HZimBHFREcz7U wvhJl+jy+9Vj+FTTEuBE1PTO6ivzP9x/FbCKNV/PgsntOTgih2Gy6UlKP+4ztRgljR088g yF0nPuJQP/cJyGf5+8EDIM4Jl3pyT6EFmJ9NkKpoKlDHNH3qQ54D+xFE0j/ahDZfYnVC+N sp6xNKtaTnlvXcOgV50STK2hhTGX49CeY77fwT5KUv7VA+bUmVMXgO7Ms9Dk1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781706781; a=rsa-sha256; cv=none; b=IDzIj+ofXzELVHtVgvVgfl4kywiPBTeDCwFZ+DPxkq8e7TPv2/c17FHnKGPes5cUxf4Gy7 UjQLo9BLKr6h2gzTfPCGaO2laSwE35GX5CRaDviunlBSjnXC1GOvJjTQ7NWMIKnPM5qOSV l5bOSYL8pGmnX57Vdo1yVSFpqWjgyPyZ3Jo2eUHp7/lfztAMR4cwsOv6ylJdQP79Vs6zTu ZKRi0Sn9sAUAAhHkWmgRjNZqpmLNEK+vyc1Xoc+nsjF5ER/eNLEDwIyWq7MA43HrPGn/c+ UflrYEnP0OJ6oPnSMpRr2sy0HdXwGFY199fyN2e3R9Rs2YGhXd1Dx936YVOKXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781706781; 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=OLVnM967Mnvww12StEoJJRPhjSYl5WSTyRS32MhG5Yg=; b=CnLN78I85l2HZH6JZXgjJkDkKy0L8qRnj4WdV5GioUytZJQMy7DJkBncaHP3HDMdn8+D7q +1bJ2sT/jja9z6uOBEm9sehrIBfHae+ia83qenSvQCem8BFL1jeJBPofTKiDRD7lWVHr8z L8Gv/p+mSjgYzJsaazc+99j7wR+0cymp7nrK3pPtErIIQtgzc57wTWyt8tzJfPpp9yAW3k mtn0qMLz8mVeRPbRkaeOg5Rq64jbctHtfc41HC458YEw7m3E+lmSMiQiVqKdM3vf35ABBV BJL8FDdSHyeZ1XOszKmCtlTjvKMJGaIG9d0kF7EHTPiLyt/jxrXdqKVnV+o1Xw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggRCx3fW0z1HG for ; Wed, 17 Jun 2026 14:33:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3acc0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 14:33:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Devin Teske Subject: git: 12ec78284337 - main - Update bsdconfig dot USAGE 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dteske X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12ec78284337c6aef0acdf942c210cf08e367da6 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 14:33:01 +0000 Message-Id: <6a32b01d.3acc0.52467c11@gitrepo.freebsd.org> The branch main has been updated by dteske: URL: https://cgit.FreeBSD.org/src/commit/?id=12ec78284337c6aef0acdf942c210cf08e367da6 commit 12ec78284337c6aef0acdf942c210cf08e367da6 Author: Devin Teske AuthorDate: 2026-06-17 14:32:12 +0000 Commit: Devin Teske CommitDate: 2026-06-17 14:32:12 +0000 Update bsdconfig dot USAGE graphics/gqview is no longer in ports, remove mention --- usr.sbin/bsdconfig/dot/USAGE | 6 ------ 1 file changed, 6 deletions(-) diff --git a/usr.sbin/bsdconfig/dot/USAGE b/usr.sbin/bsdconfig/dot/USAGE index 79b3089d6aac..6cc4d9edfb17 100644 --- a/usr.sbin/bsdconfig/dot/USAGE +++ b/usr.sbin/bsdconfig/dot/USAGE @@ -51,12 +51,6 @@ EXAMPLES: or - gqview bsdconfig.svg - - NOTE: Requires `graphics/gqview' from ports/packages. - - or - gx bsdconfig.svg NOTE: Image is scaled to fit window on launch. From nobody Wed Jun 17 14:39:13 2026 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 4ggRMC11lCz6hS05 for ; Wed, 17 Jun 2026 14:39: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggRMB1MFgz40NL for ; Wed, 17 Jun 2026 14:39:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781707158; 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; bh=YzrYvZgX3FOyYhVhfURQSluKMi9+Dft1vYs+DrUNzyU=; b=wcBUGYmRQr6v0QI/NHgMADmWURLAYnSwWEc/g3/b/MewaAmhaSCSWFVX7AvZsQxIKYe262 exCb8BUE3hu6NTuy3YXT9eVuKsLDv1CFzJyKVtrWgv33LuYZ88V3Wq9avsk9pBqRJeAOYL 1sF2NtxYTLkGu7Z67oc1LYYtqRPmAumF10mJWdabhHMsuQ3EG6NYONbm4fSXHgxxB0U5P9 wH7tTNv1L0gefxqwPR59TCI+dpaFfAJYtK3kjoZrCBr/ZvMeisuZOBJbJqu6nxu9Z0EgP+ IxEADBiijAbuw1VH46QqyELeJM/RavjK/cvHNfIv51PCDpFta6k6lxtGuj1TuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781707158; a=rsa-sha256; cv=none; b=xdfuFYnv03aKzhqiSY1Vvs5nBfx9PNNLzPQS3BHybbpidFDEpxEPiL6uSzpmHj27Piha18 A9nNasWZ3al5GOYYWwzty0gouGwPyymhxD0lHhIaVTE//n/Y8mXv4UiUz+AagMyGtBL1qT Tr5JniAQHY+OZjmbDmrSGWiEKFHcDmX1uUhDMaOrnLyPS3WsxqZTWIYcXWCxbE2l6OL/Qu XbzMhvC76chcuREieMXwpUnlsLVcg9dSXetXoERhdlkM0wK2VzY8ykPdKaW28XQAn6gReu o7y2CSrCEqw9PeBQk9qRyt5EiCiCOTxhw4Bm9xiw3YwpccNAThPbe9pkHONY4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781707158; 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; bh=YzrYvZgX3FOyYhVhfURQSluKMi9+Dft1vYs+DrUNzyU=; b=S7j7yFTWVUWjUU4usLNA+XLSLTtt2jysn0Z3TW+YdYLR2Ct4CFVFXZu4lyNsSVwXzPfC1B OYXXjX4wD9sOh8BFMS1+sYEXgigUgC9vCj9EF9kCs5+x9bHTrz3ytRJZ4BTS1+BJdatAOE zr4HjSqHu5PJMr9CdylJcsBEnV+l4mcPnbzPxYjZTQ6rNGnq8oZHROQl7iwRCZJoJMlUsV h4ZCQHzWn6YWioRhBG9nZYGr67iJ16/ZG/IAych7f4ol3HUKh/g7v3GZikEoCbiDZIFnkJ pGTg+Pb0MK1jgsWPaW6jlLXRDtywvfXL7TEH2JSnUAIDaHGHFRhxnX7zI6e8fQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggRMB0rnYz1bB for ; Wed, 17 Jun 2026 14:39:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3acc4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 14:39:13 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Abdelkader Boudih From: Adrian Chadd Subject: git: f981fa12b760 - main - mtw: Fix firmware loading and memory leaks 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: f981fa12b760a5f0983eeec8065a4dec5295ab24 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 14:39:13 +0000 Message-Id: <6a32b191.3acc4.25da149a@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=f981fa12b760a5f0983eeec8065a4dec5295ab24 commit f981fa12b760a5f0983eeec8065a4dec5295ab24 Author: Abdelkader Boudih AuthorDate: 2026-06-17 14:30:21 +0000 Commit: Adrian Chadd CommitDate: 2026-06-17 14:39:09 +0000 mtw: Fix firmware loading and memory leaks - Skip firmware reload if MCU already initialized - Fix firmware_put() memory leaks on error paths - Increase MCU init timeout to 15 seconds - Use debug macros instead of device_printf for verbose output - Remove unused 'ret' variable - Fix space indentation to tabs per style(9) Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57597 --- sys/dev/usb/wlan/if_mtw.c | 103 +++++++++++++++++++++++++++------------------- 1 file changed, 60 insertions(+), 43 deletions(-) diff --git a/sys/dev/usb/wlan/if_mtw.c b/sys/dev/usb/wlan/if_mtw.c index 9d256056f6b2..5eaa31267b42 100644 --- a/sys/dev/usb/wlan/if_mtw.c +++ b/sys/dev/usb/wlan/if_mtw.c @@ -125,6 +125,11 @@ enum { #define MTW_MAX_TXSZ \ (sizeof(struct mtw_txd) + sizeof(struct mtw_txwi) + MCLBYTES + 11) +#define MTW_FW_READY_RETRIES 500 +#define MTW_FW_READY_DELAY_MS 30 +#define MTW_FWLOAD_TIMEOUT \ + (((MTW_FW_READY_RETRIES * MTW_FW_READY_DELAY_MS) / 1000 + 5) * hz) + /* * Because of LOR in mtw_key_delete(), use atomic instead. * '& MTW_CMDQ_MASQ' is to loop cmdq[]. @@ -516,7 +521,7 @@ mtw_attach(device_t self) struct usb_attach_arg *uaa = device_get_ivars(self); struct ieee80211com *ic = &sc->sc_ic; uint32_t ver; - int i, ret; + int i; uint32_t tmp; uint8_t iface_index; int ntries, error; @@ -536,7 +541,7 @@ mtw_attach(device_t self) DELAY(100000); /* 100ms settle time */ mtx_init(&sc->sc_mtx, device_get_nameunit(sc->sc_dev), - MTX_NETWORK_LOCK, MTX_DEF); + MTX_NETWORK_LOCK, MTX_DEF); iface_index = 0; @@ -595,8 +600,10 @@ mtw_attach(device_t self) sc->mac_rev = tmp & 0xffff; mtw_load_microcode(sc); - ret = msleep(&sc->fwloading, &sc->sc_mtx, 0, "fwload", 10 * hz); - if (ret == EWOULDBLOCK || sc->fwloading != 1) { + if (sc->fwloading != 1) + (void)msleep(&sc->fwloading, &sc->sc_mtx, 0, "fwload", + MTW_FWLOAD_TIMEOUT); + if (sc->fwloading != 1) { device_printf(sc->sc_dev, "timeout waiting for MCU to initialize\n"); goto detach; @@ -633,11 +640,11 @@ mtw_attach(device_t self) IEEE80211_C_WME | /* WME */ IEEE80211_C_WPA; /* WPA1|WPA2(RSN) */ device_printf(sc->sc_dev, "[HT] Enabling 802.11n\n"); - ic->ic_htcaps = IEEE80211_HTC_HT - | IEEE80211_HTC_AMPDU - | IEEE80211_HTC_AMSDU - | IEEE80211_HTCAP_MAXAMSDU_3839 - | IEEE80211_HTCAP_SMPS_OFF; + ic->ic_htcaps = IEEE80211_HTC_HT + | IEEE80211_HTC_AMPDU + | IEEE80211_HTC_AMSDU + | IEEE80211_HTCAP_MAXAMSDU_3839 + | IEEE80211_HTCAP_SMPS_OFF; ic->ic_rxstream = sc->nrxchains; ic->ic_txstream = sc->ntxchains; @@ -1107,6 +1114,7 @@ mtw_load_microcode(void *arg) struct mtw_softc *sc = (struct mtw_softc *)arg; const struct mtw_ucode_hdr *hdr; + const struct firmware *firmware_rom = NULL, *firmware = NULL; // onst struct mtw_ucode *fw = NULL; const char *fwname; size_t size; @@ -1114,47 +1122,43 @@ mtw_load_microcode(void *arg) uint32_t tmp, iofs = 0x40; // int ntries; int dlen, ilen; - device_printf(sc->sc_dev, "version:0x%hx\n", sc->asic_ver); - /* - * Firmware may still be running from a previous warm reboot. - * Force a reset of the MCU to ensure a clean state. - */ + MTW_DPRINTF(sc, MTW_DEBUG_FIRMWARE, "version:0x%hx\n", sc->asic_ver); + /* Check if MCU is already initialized and skip firmware reload */ mtw_read_cfg(sc, MTW_MCU_DMA_ADDR, &tmp); if (tmp == MTW_MCU_READY) { - device_printf(sc->sc_dev, "MCU already running, resetting\n"); - mtw_write(sc, MTW_MCU_RESET_CTL, MTW_RESET); - DELAY(10000); - mtw_write(sc, MTW_MCU_RESET_CTL, 0); - DELAY(10000); - /* Clear ready flag */ - mtw_write_cfg(sc, MTW_MCU_DMA_ADDR, 0); - DELAY(1000); + MTW_DPRINTF(sc, MTW_DEBUG_FIRMWARE, + "MCU already running, skipping firmware reload\n"); + sc->fwloading = 1; + wakeup(&sc->fwloading); + return; } if (sc->asic_ver == 0x7612) { fwname = "mtw-mt7662u_rom_patch"; - const struct firmware *firmware = firmware_get_flags(fwname,FIRMWARE_GET_NOWARN); - if (firmware == NULL) { + firmware_rom = firmware_get_flags(fwname, FIRMWARE_GET_NOWARN); + if (firmware_rom == NULL) { device_printf(sc->sc_dev, - "failed loadfirmware of file %s (error %d)\n", - fwname, error); + "failed to load firmware file %s\n", + fwname); return; } - size = firmware->datasize; + size = firmware_rom->datasize; const struct mtw_ucode *fw = (const struct mtw_ucode *) - firmware->data; + firmware_rom->data; hdr = (const struct mtw_ucode_hdr *)&fw->hdr; - // memcpy(fw,(const unsigned char*)firmware->data + - // 0x1e,size-0x1e); + // memcpy(fw,(const unsigned char*)firmware_rom->data + + // 0x1e,size-0x1e); ilen = size - 0x1e; mtw_ucode_setup(sc); - if ((error = mtw_ucode_write(sc, firmware->data, fw->ivb, ilen, - 0x90000)) != 0) { - goto fail; + if ((error = mtw_ucode_write(sc, firmware_rom->data, fw->ivb, + ilen, 0x90000)) != 0) { + device_printf(sc->sc_dev, + "Could not write ROM patch\n"); + goto fail_rom; } mtw_usb_dma_write(sc, 0x00e41814); } @@ -1171,13 +1175,15 @@ mtw_load_microcode(void *arg) // dofs = 0x80000; } MTW_UNLOCK(sc); - const struct firmware *firmware = firmware_get_flags(fwname, FIRMWARE_GET_NOWARN); + firmware = firmware_get_flags(fwname, FIRMWARE_GET_NOWARN); if (firmware == NULL) { device_printf(sc->sc_dev, - "failed loadfirmware of file %s (error %d)\n", fwname, - error); + "failed to load firmware file %s\n", + fwname); MTW_LOCK(sc); + if (firmware_rom != NULL) + firmware_put(firmware_rom, FIRMWARE_UNLOAD); return; } MTW_LOCK(sc); @@ -1214,11 +1220,21 @@ mtw_load_microcode(void *arg) device_printf(sc->sc_dev, "Could not write ucode errro=%d\n", error); - device_printf(sc->sc_dev, "loaded firmware ver %.8x %.8x %s\n", + MTW_DPRINTF(sc, MTW_DEBUG_FIRMWARE, + "loaded firmware ver %.8x %.8x %s\n", le32toh(hdr->fw_ver), le32toh(hdr->build_ver), hdr->build_time); + /* Release firmware objects */ + firmware_put(firmware, FIRMWARE_UNLOAD); + if (firmware_rom != NULL) + firmware_put(firmware_rom, FIRMWARE_UNLOAD); return; + fail: + firmware_put(firmware, FIRMWARE_UNLOAD); +fail_rom: + if (firmware_rom != NULL) + firmware_put(firmware_rom, FIRMWARE_UNLOAD); return; } static usb_error_t @@ -2877,12 +2893,13 @@ mtw_fw_callback(struct usb_xfer *xfer, usb_error_t error) } mtw_delay(sc, 10); - for (ntries = 0; ntries < 300; ntries++) { + for (ntries = 0; ntries < MTW_FW_READY_RETRIES; + ntries++) { if ((error = mtw_read_cfg(sc, MTW_MCU_DMA_ADDR, - &tmp)) != 0) { + &tmp)) != 0) { device_printf(sc->sc_dev, - "Could not read cfg error: %d\n", error); - + "Could not read cfg error: %d\n", + error); } if (tmp == MTW_MCU_READY) { MTW_DPRINTF(sc, MTW_DEBUG_FIRMWARE, @@ -2891,9 +2908,9 @@ mtw_fw_callback(struct usb_xfer *xfer, usb_error_t error) break; } - mtw_delay(sc, 30); + mtw_delay(sc, MTW_FW_READY_DELAY_MS); } - if (ntries == 300) + if (ntries == MTW_FW_READY_RETRIES) sc->fwloading = 0; wakeup(&sc->fwloading); return; From nobody Wed Jun 17 14:50:32 2026 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 4ggRcG0DqHz6hT1T for ; Wed, 17 Jun 2026 14:50: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggRcF5sSwz42JJ for ; Wed, 17 Jun 2026 14:50:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781707837; 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; bh=YbKlvZL0+LU2LldzHf8ZgQtsT/xdvZIssHCv1AFGiLM=; b=g1t6OB9thEhqEk6/+tl2F752Yn0K733bFnHGijBdbUKotDriqtH4PG3eLwwoJrb9aD/wBj rei2DOFSH9+Op5DPK3Lbi2i3EqkQ75woP7mS4AJ9SWZZRTLCgoORScH6jKEFpiB9XGc0Ho iJOUf7691a/5Qr38+s0j5GoqBSoff8E5Zspd1Q7aj5yNd/rOuyDtfaxUBfrtgXW4YYSZ9j V74luE5oaPN6AeGh4p4ScJCsGn35lGjPPzpxzv6kJw7tVGRhzbnFyW5/94msHNK9SAg2Tf Mvb8fScF8yONtfv/2k79O9TAgYUR3zxAPKxx0FH09Voe+YDfzOx0Wfxiiw6vPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781707837; a=rsa-sha256; cv=none; b=UpCPK+NQTg+SowpONVBCR/O13lTtnPavWX/UiMs7teRR3DHFSVJzPRkgy2ABNVNHuKukxM SAVnJyhtriTwhCARb1D6PZ0f8cygr7iYXxtfirc9QuxySK9nTw5yVBcPc7WI47FWXbVDKy 0FBouTiF7hTN2/jjCtfbDaSIqUbkX8RQmXcyzbKD5uT77QyrfyYmXKuLEdXQnU9/zI4TNF IMpa4BiLdSe4NVgo66jRSA3Hk5l4hDVDHfbn85NeAgNCD0+z7Cfywr4gYq5/CNaPC5o/3f eLml7r83m7rEv70Y2Mf9efHuCSUeji4fWK/JDXGh54lGwIsNxaZAqz47pupp2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781707837; 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; bh=YbKlvZL0+LU2LldzHf8ZgQtsT/xdvZIssHCv1AFGiLM=; b=GRnkCIThlfnR3IRwWuPYudzMgipUv0/G2B4o+JhGPSKyKtbOgFLJHtg3/AKX3hI/S7/O3e /8VJY9U42J04OGJUZNC70iniOFSWrZaOVF2Wd3cBsgdAtoXpLtdJNhKMV4aXwsIazdfNZ4 jqeXEKB7eD0iejUxGE/uLr5e2QtzuwKjQ2auVcjMg+6yuLvjmO3d0g/FScr/0OamDzif6F HjKch5tcJzBr3idXXn+OYV/78ElFyDQvyC66Qs6nnyIFCSbvomk/+IMBA8pxnLKmXBcPG+ xA8xL6vsl6AWau6x2jiLnRgvuxAxLDZ1PWz233dATVPzUw/ENx7ZyAoG+uPwXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggRcF55m2z1d3 for ; Wed, 17 Jun 2026 14:50:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3dc25 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 14:50:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Abdelkader Boudih From: Adrian Chadd Subject: git: 021a190c88fc - main - est: prevent divide-by-zero in est_msr_info 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 021a190c88fc41f981a79fe6822bdafbcda14e99 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 14:50:32 +0000 Message-Id: <6a32b438.3dc25.45509592@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=021a190c88fc41f981a79fe6822bdafbcda14e99 commit 021a190c88fc41f981a79fe6822bdafbcda14e99 Author: Abdelkader Boudih AuthorDate: 2026-06-17 14:49:52 +0000 Commit: Adrian Chadd CommitDate: 2026-06-17 14:49:52 +0000 est: prevent divide-by-zero in est_msr_info When hw.est.msr_info=1 is set, est_msr_info() extracts the bus clock from MSR_PERF_STATUS upper bits. On secondary CPUs, the MSR may contain zero in the frequency ratio field, causing a divide-by-zero panic. Observed in pre Skylake Intel cpu. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57614 --- sys/x86/cpufreq/est.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/x86/cpufreq/est.c b/sys/x86/cpufreq/est.c index 82f35934aa99..804de162ec60 100644 --- a/sys/x86/cpufreq/est.c +++ b/sys/x86/cpufreq/est.c @@ -1181,11 +1181,15 @@ est_msr_info(device_t dev, uint64_t msr, freq_info **freqs, size_t *freqslen) /* Figure out the bus clock. */ freq = atomic_load_acq_64(&tsc_freq) / 1000000; id = msr >> 32; + if ((id >> 8) == 0) + return (EOPNOTSUPP); bus = freq / (id >> 8); device_printf(dev, "Guessed bus clock (high) of %d MHz\n", bus); if (!bus_speed_ok(bus)) { /* We may be running on the low frequency. */ id = msr >> 48; + if ((id >> 8) == 0) + return (EOPNOTSUPP); bus = freq / (id >> 8); device_printf(dev, "Guessed bus clock (low) of %d MHz\n", bus); if (!bus_speed_ok(bus)) From nobody Wed Jun 17 14:51:16 2026 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 4ggRd03MV8z6hT5g for ; Wed, 17 Jun 2026 14:51: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggRd01qDlz42bp for ; Wed, 17 Jun 2026 14:51:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781707876; 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; bh=FEorwAmOcxUD5ageQ8MB0phcjRwzcqUSD9UDITtr+nU=; b=Ot1LbBSFP3vnRfPsGOZ//Pe+1OZy8FoNGxahckIEUHBL5s3nVAjy+kjEVbIjqFpkp16ULV zUAlraI9eaymaqaGuvOEH1TN7Ru851aA4AV0S1Qtj8ZR9Iwv8mpZpueK1g5Ekvmh4m0bGY EbKlAK5uZWkBE0j7Aqg/a9tD9x/hStqkrfwhG7aMaUSSWmxw/yfOhiq9QCmgkntFuNevTv Zm8S9nSjV7zL/GHl3NXB3FO7jP7WO/we6KGUiCb1ZSAL214kGMlPEmxwT87audJnBQjjbX ZAlwNiyVLUfNthmStxXTWjLRuaxkSoLuR34Q4PCP4T0MMAXwF20K3F2yglBO8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781707876; a=rsa-sha256; cv=none; b=QHZqLAmsVJ6M10dM0UriWefUKDzqg5Bgoz78YgxHOGETXyhEa0CXwywQuvPhttfruNlsC2 27GB7qGvKmh84yIHGfBxhHGsmrC7Yn88yRx9lhfgGpYNrUzhYXzFqQWtYjT4FKrR1kfqbw 8m8XyK1ZhRTCnOk2qlj9ifW6gJz7VOhy0OO6hwYvIRJBVIakO0qO28/avd8MF3gg1hpsOb b842de8CRjO30VF1hp46Gm09tTBx2gHWOV6CfR2XsBeFgWwxnMGlnoRmYmDBppIQWkS19z VTlB2dRABLiV+tSzIH6KjDMkMjclRKZPUOnS9kXezeEjSic8sJAsuoH1zsTsxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781707876; 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; bh=FEorwAmOcxUD5ageQ8MB0phcjRwzcqUSD9UDITtr+nU=; b=EqareFR3h/h5v5q3Lzdp7sMSvz9HE4LzcU4ta8s3kM5qEjbxqdMHjAkHbYIRTw7RKC/2ai Q8AncLkDzJychm9sof6UoEtw+Qu6a5nSGZ3biemed96rLKPAbSgrGkxCySNqa7ZqQglEou Y8+A+SGW+9rwsfjJ+Hw/7UL/TbkZoW5rT4fjOBQjG1LenU0pH4ZGQKYqYivjmmQZq3y66d QTmsK2BZMU9/Xf7K2HLm7W3q+2X7EulEaVwBGWwoKErYNQUdJMbzrciBC34iXuZFeH2kW0 2hS/XpxVv8zQGCl73nl3FpROHuB+J7oQBHsuKgjTDXYDOxN0zWuHeFV8z8Fu5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggRd01PGCz1xb for ; Wed, 17 Jun 2026 14:51:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3cf38 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 14:51:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Abdelkader Boudih From: Adrian Chadd Subject: git: 85814f591261 - main - est: gate "not recognized" message behind bootverbose 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 85814f5912618808ebe5b7065b70344675c98b5b Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 14:51:16 +0000 Message-Id: <6a32b464.3cf38.a161767@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=85814f5912618808ebe5b7065b70344675c98b5b commit 85814f5912618808ebe5b7065b70344675c98b5b Author: Abdelkader Boudih AuthorDate: 2026-06-17 14:50:48 +0000 Commit: Adrian Chadd CommitDate: 2026-06-17 14:50:48 +0000 est: gate "not recognized" message behind bootverbose On modern Intel CPUs that use HWP (hwpstate_intel: /usr/src/sys/x86/cpufreq/hwpstate_intel.c) instead of EST, this message prints unconditionally during probe even though it is expected and harmless. Gated behind bootverbose to reduce console noise on systems where EST is present but considered legacy. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57616 --- sys/x86/cpufreq/est.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/x86/cpufreq/est.c b/sys/x86/cpufreq/est.c index 804de162ec60..7f5bce5ad29d 100644 --- a/sys/x86/cpufreq/est.c +++ b/sys/x86/cpufreq/est.c @@ -1046,9 +1046,10 @@ est_get_info(device_t dev) error = est_msr_info(dev, msr, &sc->freq_list, &sc->flist_len); if (error) { - printf( - "est: CPU supports Enhanced Speedstep, but is not recognized.\n" - "est: cpu_vendor %s, msr %0jx\n", cpu_vendor, msr); + if (bootverbose) + printf( + "est: CPU supports Enhanced Speedstep, but is not recognized.\n" + "est: cpu_vendor %s, msr %0jx\n", cpu_vendor, msr); return (ENXIO); } From nobody Wed Jun 17 15:05:18 2026 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 4ggRxB4pFbz6hVB2 for ; Wed, 17 Jun 2026 15:05:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggRxB40kqz43t2 for ; Wed, 17 Jun 2026 15:05:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781708718; 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=fMkPmOVrcHW/5/ejoP/CySmcaO+6KvO50orgQwVNve4=; b=Mrh+K6QbDkV22memreH+R23zWmY0OHGSDI/mA4UWtDBf93Buw5oykL66EI3HtC6cE4NAsh MdT7CsL/YBMM5HKRk2J03be1hHNHYsK8DpalhK+97EHlWsTjYIhA4hxCQhlOZUV/X5r24d 3pxHFs+4U0JR/Ei3ONKrMU4l3vsTNzIRr21RVEwGIdqxqxpefQd4fafHWj/egZBgfDhye6 Mao9we/0nB99naakD0QXuW6dsIWoQ6vJnbKexQBF2TqsNLj4V8aaZt3pGb8C7XM65wPLjD kPSyzNFAQfIF0a9fSdmqmjdjhDLqmnMhUpNZVchPJIMH7VLERHA3cFo7coLKWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781708718; a=rsa-sha256; cv=none; b=WaqR3b4VitbuEq75i9b3Kn2ugwMmooKymtmNn1QN9wj2JKgDFqpg7Pg40MafFenlPEX8ha qiQvgP5EczKZYonylqBUo2xkqWgftXrJFavg0VUPl3A0mPaKHlkU5wsxtDEy9f2aDI8LV9 AHkXxB5gsFkAVIRgCTov5kEFtDkWEKTXqKZcvkBNXtMd3sLFzLyZ6fS2xrKO9/Hsmuj1O4 pFNJvPxCxrrBP+vnjuEw/6E19+Nbj8xUL9HHvXZuOM5J0fTUrQuASqkW+6/Kr4QUoLtO8C 3oOtZLx7r7npH8+r+0rQU3irzRXnDm4N24y+ePfFY1/a+0m2o+gKq9Ou9QJ45w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781708718; 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=fMkPmOVrcHW/5/ejoP/CySmcaO+6KvO50orgQwVNve4=; b=CpWNewcOElzHEfoR+RgQO5ZzY59tP59KEVVp6qBApip8KjWb6CH0qpzm0FE2JUFgaiF1x6 aN8d+ASslQIyMGNXL7Y++wZurvSUci/CeTLHUZjyaKc23p9FWUW3J8/TBIiG5obu1R83wc W/FeF6dBchMbLJk90VfjikwEPUCmfiVojJ23lDEmOjAIfxQcmmYArK3Se/BDRTSp6TIooA iROWU4vPCmri+5PZmNE7CPaBrsddC6q3tYfqEe8IPRPnTVDjvUWWjQbo7Y0F4kV0h1McWQ YIg5HUJYjpUd/5IKX6Uqi1oFc9e72GYyn75vbj7TjK5NbvXDWY3i1p9m/20ZIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggRxB3LcYz1qq for ; Wed, 17 Jun 2026 15:05:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f164 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 15:05:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 52c0d52b91e3 - main - socket: Tag all socket option comments consistently 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 52c0d52b91e34f9190c9ba8fab7b6bc463bc4cbb Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 15:05:18 +0000 Message-Id: <6a32b7ae.3f164.49572fd9@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=52c0d52b91e34f9190c9ba8fab7b6bc463bc4cbb commit 52c0d52b91e34f9190c9ba8fab7b6bc463bc4cbb Author: Warner Losh AuthorDate: 2026-06-17 13:39:05 +0000 Commit: Warner Losh CommitDate: 2026-06-17 15:03:21 +0000 socket: Tag all socket option comments consistently For all the socket options that have a fixed type, add the type of the socket option arg to the comment. Most of them already had this, but a few did not. The ones that don't have a tag use a variable length data structure of some kind, and are beyond the scope of this commit. Slightly expand the syntax to allow a comma separated list for those sockopts that have multiple fixed-length versions. Sponsored by: Netflix Reviewed by: pouria, peter.lei_ieee.org, tuexen Differential Revision: https://reviews.freebsd.org/D57545 --- sys/netinet/in.h | 40 ++++----- sys/netinet/tcp.h | 240 ++++++++++++++++++++++++++--------------------------- sys/netinet/udp.h | 2 +- sys/netinet6/in6.h | 8 +- sys/sys/socket.h | 72 ++++++++-------- sys/sys/un.h | 4 +- 6 files changed, 183 insertions(+), 183 deletions(-) diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 0cd55bd1e409..fc30228422f3 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -444,25 +444,25 @@ VNET_DECLARE(uint32_t, in_loopback_mask); #define IP_RETOPTS 8 /* ip_opts; set/get IP options */ #define IP_MULTICAST_IF 9 /* struct in_addr *or* struct ip_mreqn; * set/get IP multicast i/f */ -#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */ -#define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */ +#define IP_MULTICAST_TTL 10 /* u_char,u_int; set/get IP multicast ttl */ +#define IP_MULTICAST_LOOP 11 /* u_char,u_int; set/get IP multicast loopback */ #define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */ #define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */ -#define IP_MULTICAST_VIF 14 /* set/get IP mcast virt. iface */ -#define IP_RSVP_ON 15 /* enable RSVP in kernel */ -#define IP_RSVP_OFF 16 /* disable RSVP in kernel */ -#define IP_RSVP_VIF_ON 17 /* set RSVP per-vif socket */ -#define IP_RSVP_VIF_OFF 18 /* unset RSVP per-vif socket */ +#define IP_MULTICAST_VIF 14 /* int; set/get IP mcast virt. iface */ +#define IP_RSVP_ON 15 /* int; enable RSVP in kernel */ +#define IP_RSVP_OFF 16 /* int; disable RSVP in kernel */ +#define IP_RSVP_VIF_ON 17 /* int; set RSVP per-vif socket */ +#define IP_RSVP_VIF_OFF 18 /* int; unset RSVP per-vif socket */ #define IP_PORTRANGE 19 /* int; range to choose for unspec port */ #define IP_RECVIF 20 /* bool; receive reception if w/dgram */ /* for IPSEC */ #define IP_IPSEC_POLICY 21 /* int; set/get security policy */ /* unused; was IP_FAITH */ -#define IP_ONESBCAST 23 /* bool: send all-ones broadcast */ -#define IP_BINDANY 24 /* bool: allow bind to any address */ +#define IP_ONESBCAST 23 /* bool; send all-ones broadcast */ +#define IP_BINDANY 24 /* bool; allow bind to any address */ /* unused; was IP_BIND_MULTI */ /* unused; was IP_RSS_LISTEN_BUCKET */ -#define IP_ORIGDSTADDR 27 /* bool: receive IP dst addr/port w/dgram */ +#define IP_ORIGDSTADDR 27 /* bool; receive IP dst addr/port w/dgram */ #define IP_RECVORIGDSTADDR IP_ORIGDSTADDR /* @@ -497,18 +497,18 @@ VNET_DECLARE(uint32_t, in_loopback_mask); #define IP_DUMMYNET_GET 64 /* get entire dummynet pipes */ #define IP_RECVTTL 65 /* bool; receive IP TTL w/dgram */ -#define IP_MINTTL 66 /* minimum TTL for packet or drop */ -#define IP_DONTFRAG 67 /* don't fragment packet */ +#define IP_MINTTL 66 /* int; minimum TTL for packet or drop */ +#define IP_DONTFRAG 67 /* int; don't fragment packet */ #define IP_RECVTOS 68 /* bool; receive IP TOS w/dgram */ /* IPv4 Source Filter Multicast API [RFC3678] */ -#define IP_ADD_SOURCE_MEMBERSHIP 70 /* join a source-specific group */ -#define IP_DROP_SOURCE_MEMBERSHIP 71 /* drop a single source */ -#define IP_BLOCK_SOURCE 72 /* block a source */ -#define IP_UNBLOCK_SOURCE 73 /* unblock a source */ +#define IP_ADD_SOURCE_MEMBERSHIP 70 /* ip_mreq_source; join a source-specific group */ +#define IP_DROP_SOURCE_MEMBERSHIP 71 /* ip_mreq_source; drop a single source */ +#define IP_BLOCK_SOURCE 72 /* ip_mreq_source; block a source */ +#define IP_UNBLOCK_SOURCE 73 /* ip_mreq_source; unblock a source */ /* The following option is private; do not use it from user applications. */ -#define IP_MSFILTER 74 /* set/get filter list */ +#define IP_MSFILTER 74 /* __msfilterreq; set/get filter list */ /* The following option deals with the 802.1Q Ethernet Priority Code Point */ #define IP_VLAN_PCP 75 /* int; set/get PCP used for packet, */ @@ -523,9 +523,9 @@ VNET_DECLARE(uint32_t, in_loopback_mask); #define MCAST_UNBLOCK_SOURCE 85 /* unblock a source */ /* Flow and RSS definitions */ -#define IP_FLOWID 90 /* get flow id for the given socket/inp */ -#define IP_FLOWTYPE 91 /* get flow type (M_HASHTYPE) */ -#define IP_RSSBUCKETID 92 /* get RSS flowid -> bucket mapping */ +#define IP_FLOWID 90 /* int; get flow id for the given socket/inp */ +#define IP_FLOWTYPE 91 /* int; get flow type (M_HASHTYPE) */ +#define IP_RSSBUCKETID 92 /* int; get RSS flowid -> bucket mapping */ #define IP_RECVFLOWID 93 /* bool; receive IP flowid/flowtype w/ datagram */ #define IP_RECVRSSBUCKETID 94 /* bool; receive IP RSS bucket id w/ datagram */ diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index cab7d1c5e726..14dc971010d8 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -180,169 +180,169 @@ __tcp_set_flags(struct tcphdr *th, uint16_t flags) * values and are not masked together. Some values appear to be * bitmasks for historical reasons. */ -#define TCP_NODELAY 1 /* don't delay send to coalesce packets */ +#define TCP_NODELAY 1 /* int; don't delay send to coalesce packets */ #if __BSD_VISIBLE -#define TCP_MAXSEG 2 /* set maximum segment size */ -#define TCP_NOPUSH 4 /* don't push last block of write */ -#define TCP_NOOPT 8 /* don't use TCP options */ -#define TCP_MD5SIG 16 /* use MD5 digests (RFC2385) */ -#define TCP_INFO 32 /* retrieve tcp_info structure */ +#define TCP_MAXSEG 2 /* int; set maximum segment size */ +#define TCP_NOPUSH 4 /* int; don't push last block of write */ +#define TCP_NOOPT 8 /* int; don't use TCP options */ +#define TCP_MD5SIG 16 /* int; use MD5 digests (RFC2385) */ +#define TCP_INFO 32 /* struct tcp_info; retrieve tcp_info structure */ #define TCP_STATS 33 /* retrieve stats blob structure */ -#define TCP_LOG 34 /* configure event logging for connection */ +#define TCP_LOG 34 /* int; configure event logging for connection */ #define TCP_LOGBUF 35 /* retrieve event log for connection */ #define TCP_LOGID 36 /* configure log ID to correlate connections */ #define TCP_LOGDUMP 37 /* dump connection log events to device */ #define TCP_LOGDUMPID 38 /* dump events from connections with same ID to device */ #define TCP_TXTLS_ENABLE 39 /* TLS framing and encryption for transmit */ -#define TCP_TXTLS_MODE 40 /* Transmit TLS mode */ +#define TCP_TXTLS_MODE 40 /* u_int; Transmit TLS mode */ #define TCP_RXTLS_ENABLE 41 /* TLS framing and encryption for receive */ -#define TCP_RXTLS_MODE 42 /* Receive TLS mode */ -#define TCP_IWND_NB 43 /* Override initial window (units: bytes) */ -#define TCP_IWND_NSEG 44 /* Override initial window (units: MSS segs) */ +#define TCP_RXTLS_MODE 42 /* int; Receive TLS mode */ +#define TCP_IWND_NB 43 /* int; Override initial window (units: bytes) */ +#define TCP_IWND_NSEG 44 /* int; Override initial window (units: MSS segs) */ #ifdef _KERNEL -#define TCP_USE_DDP 45 /* Use direct data placement for so_rcvbuf */ +#define TCP_USE_DDP 45 /* int; Use direct data placement for so_rcvbuf */ #endif -#define TCP_LOGID_CNT 46 /* get number of connections with the same ID */ +#define TCP_LOGID_CNT 46 /* int; get number of connections with the same ID */ #define TCP_LOG_TAG 47 /* configure tag for grouping logs */ -#define TCP_USER_LOG 48 /* userspace log event */ +#define TCP_USER_LOG 48 /* int; userspace log event */ #define TCP_CONGESTION 64 /* get/set congestion control algorithm */ #define TCP_CCALGOOPT 65 /* get/set cc algorithm specific options */ -#define TCP_MAXUNACKTIME 68 /* maximum time without making progress (sec) */ +#define TCP_MAXUNACKTIME 68 /* u_int; maximum time without making progress (sec) */ /* unused 69 */ -#define TCP_IDLE_REDUCE 70 /* Reduce cwnd on idle input */ -#define TCP_REMOTE_UDP_ENCAPS_PORT 71 /* Enable TCP over UDP tunneling via the specified port */ -#define TCP_DELACK 72 /* socket option for delayed ack */ -#define TCP_FIN_IS_RST 73 /* A fin from the peer is treated has a RST */ -#define TCP_LOG_LIMIT 74 /* Limit to number of records in tcp-log */ -#define TCP_SHARED_CWND_ALLOWED 75 /* Use of a shared cwnd is allowed */ -#define TCP_PROC_ACCOUNTING 76 /* Do accounting on tcp cpu usage and counts */ -#define TCP_USE_CMP_ACKS 77 /* The transport can handle the Compressed mbuf acks */ -#define TCP_PERF_INFO 78 /* retrieve accounting counters */ -#define TCP_KEEPINIT 128 /* N, time to establish connection */ -#define TCP_KEEPIDLE 256 /* L,N,X start keeplives after this period */ -#define TCP_KEEPINTVL 512 /* L,N interval between keepalives */ -#define TCP_KEEPCNT 1024 /* L,N number of keepalives before close */ -#define TCP_FASTOPEN 1025 /* enable TFO / was created via TFO */ +#define TCP_IDLE_REDUCE 70 /* int; Reduce cwnd on idle input */ +#define TCP_REMOTE_UDP_ENCAPS_PORT 71 /* int; Enable TCP over UDP tunneling via the specified port */ +#define TCP_DELACK 72 /* int; socket option for delayed ack */ +#define TCP_FIN_IS_RST 73 /* int; A fin from the peer is treated has a RST */ +#define TCP_LOG_LIMIT 74 /* int; Limit to number of records in tcp-log */ +#define TCP_SHARED_CWND_ALLOWED 75 /* int; Use of a shared cwnd is allowed */ +#define TCP_PROC_ACCOUNTING 76 /* int; Do accounting on tcp cpu usage and counts */ +#define TCP_USE_CMP_ACKS 77 /* int; The transport can handle the Compressed mbuf acks */ +#define TCP_PERF_INFO 78 /* struct tcp_perf_info; retrieve accounting counters */ +#define TCP_KEEPINIT 128 /* u_int; N, time to establish connection */ +#define TCP_KEEPIDLE 256 /* u_int; L,N,X start keeplives after this period */ +#define TCP_KEEPINTVL 512 /* u_int; L,N interval between keepalives */ +#define TCP_KEEPCNT 1024 /* u_int; L,N number of keepalives before close */ +#define TCP_FASTOPEN 1025 /* int,struct tcp_fastopen; enable TFO / was created via TFO */ /* unused 2048 was TCP_PCAP_OUT */ /* unused 4096 was TCP_PCAP_IN */ -#define TCP_FUNCTION_BLK 8192 /* Set the tcp function pointers to the specified stack */ -#define TCP_FUNCTION_ALIAS 8193 /* Get the current tcp function pointer name alias */ +#define TCP_FUNCTION_BLK 8192 /* struct tcp_function_set; Set the tcp function pointers to the specified stack */ +#define TCP_FUNCTION_ALIAS 8193 /* struct tcp_function_set; Get the current tcp function pointer name alias */ /* Options for Rack and BBR */ -#define TCP_REUSPORT_LB_NUMA 1026 /* set listen socket numa domain */ -#define TCP_RACK_MBUF_QUEUE 1050 /* Do we allow mbuf queuing if supported */ +#define TCP_REUSPORT_LB_NUMA 1026 /* int; set listen socket numa domain */ +#define TCP_RACK_MBUF_QUEUE 1050 /* int; Do we allow mbuf queuing if supported */ /* unused 1051 */ -#define TCP_RACK_TLP_REDUCE 1052 /* RACK TLP cwnd reduction (bool) */ +#define TCP_RACK_TLP_REDUCE 1052 /* int; RACK TLP cwnd reduction */ /* unused 1053 */ -#define TCP_RACK_PACE_MAX_SEG 1054 /* Max TSO size we will send */ -#define TCP_RACK_PACE_ALWAYS 1055 /* Use the always pace method */ +#define TCP_RACK_PACE_MAX_SEG 1054 /* int; Max TSO size we will send */ +#define TCP_RACK_PACE_ALWAYS 1055 /* int; Use the always pace method */ /* unused 1056 */ -#define TCP_RACK_PRR_SENDALOT 1057 /* Allow PRR to send more than one seg */ -#define TCP_RACK_MIN_TO 1058 /* Minimum time between rack t-o's in ms */ +#define TCP_RACK_PRR_SENDALOT 1057 /* int; Allow PRR to send more than one seg */ +#define TCP_RACK_MIN_TO 1058 /* int; Minimum time between rack t-o's in ms */ /* unused 1059 */ -#define TCP_RACK_EARLY_SEG 1060 /* If early recovery max segments */ -#define TCP_RACK_REORD_THRESH 1061 /* RACK reorder threshold (shift amount) */ -#define TCP_RACK_REORD_FADE 1062 /* Does reordering fade after ms time */ -#define TCP_RACK_TLP_THRESH 1063 /* RACK TLP theshold i.e. srtt+(srtt/N) */ -#define TCP_RACK_PKT_DELAY 1064 /* RACK added ms i.e. rack-rtt + reord + N */ +#define TCP_RACK_EARLY_SEG 1060 /* int; If early recovery max segments */ +#define TCP_RACK_REORD_THRESH 1061 /* int; RACK reorder threshold (shift amount) */ +#define TCP_RACK_REORD_FADE 1062 /* int; Does reordering fade after ms time */ +#define TCP_RACK_TLP_THRESH 1063 /* int; RACK TLP theshold i.e. srtt+(srtt/N) */ +#define TCP_RACK_PKT_DELAY 1064 /* int; RACK added ms i.e. rack-rtt + reord + N */ /* unused 1065 */ /* unused 1066 */ -#define TCP_BBR_IWINTSO 1067 /* Initial TSO window for BBRs first sends */ +#define TCP_BBR_IWINTSO 1067 /* int; Initial TSO window for BBRs first sends */ /* unused 1068 */ -#define TCP_BBR_STARTUP_PG 1069 /* Startup pacing gain */ -#define TCP_BBR_DRAIN_PG 1070 /* Drain pacing gain */ +#define TCP_BBR_STARTUP_PG 1069 /* int; Startup pacing gain */ +#define TCP_BBR_DRAIN_PG 1070 /* int; Drain pacing gain */ /* unused 1071 */ -#define TCP_BBR_PROBE_RTT_INT 1072 /* How long in useconds between probe-rtt */ +#define TCP_BBR_PROBE_RTT_INT 1072 /* int; How long in useconds between probe-rtt */ /* unused 1073 */ -#define TCP_BBR_STARTUP_LOSS_EXIT 1074 /* Do we exit a loss during startup if not 20% incr */ +#define TCP_BBR_STARTUP_LOSS_EXIT 1074 /* int; Do we exit a loss during startup if not 20% incr */ /* unused 1075 */ -#define TCP_BBR_TSLIMITS 1076 /* Do we use experimental Timestamp limiting for our algo */ -#define TCP_BBR_PACE_OH 1077 /* pacing overhead setting */ +#define TCP_BBR_TSLIMITS 1076 /* int; Do we use experimental Timestamp limiting for our algo */ +#define TCP_BBR_PACE_OH 1077 /* int; pacing overhead setting */ /* unused 1078 */ -#define TCP_BBR_USEDEL_RATE 1079 /* Enable use of delivery rate for loss recovery */ -#define TCP_BBR_MIN_RTO 1080 /* Min RTO in milliseconds */ -#define TCP_BBR_MAX_RTO 1081 /* Max RTO in milliseconds */ +#define TCP_BBR_USEDEL_RATE 1079 /* int; Enable use of delivery rate for loss recovery */ +#define TCP_BBR_MIN_RTO 1080 /* int; Min RTO in milliseconds */ +#define TCP_BBR_MAX_RTO 1081 /* int; Max RTO in milliseconds */ /* unused 1082 */ -#define TCP_BBR_ALGORITHM 1083 /* What measurement algo does BBR use netflix=0, google=1 */ +#define TCP_BBR_ALGORITHM 1083 /* int; What measurement algo does BBR use netflix=0, google=1 */ /* unused 1084 */ /* unused 1085 */ -#define TCP_BBR_PACE_PER_SEC 1086 -#define TCP_BBR_PACE_DEL_TAR 1087 -#define TCP_BBR_PACE_SEG_MAX 1088 -#define TCP_BBR_PACE_SEG_MIN 1089 -#define TCP_BBR_PACE_CROSS 1090 +#define TCP_BBR_PACE_PER_SEC 1086 /* int; */ +#define TCP_BBR_PACE_DEL_TAR 1087 /* int; */ +#define TCP_BBR_PACE_SEG_MAX 1088 /* int; */ +#define TCP_BBR_PACE_SEG_MIN 1089 /* int; */ +#define TCP_BBR_PACE_CROSS 1090 /* int; */ /* unused 1091 */ /* unused 1092 */ /* unused 1093 */ /* unused 1094 */ -#define TCP_RACK_TLP_USE 1095 -#define TCP_BBR_TMR_PACE_OH 1096 /* ??? */ -#define TCP_RACK_DO_DETECTION 1097 /* Recycle of extra gain for rack, attack detection */ -#define TCP_BBR_RACK_RTT_USE 1098 /* what RTT should we use 0, 1, or 2? */ -#define TCP_BBR_RETRAN_WTSO 1099 -#define TCP_DATA_AFTER_CLOSE 1100 -#define TCP_BBR_PROBE_RTT_GAIN 1101 -#define TCP_BBR_PROBE_RTT_LEN 1102 -#define TCP_BBR_SEND_IWND_IN_TSO 1103 /* Do we burst out whole iwin size chunks at start? */ -#define TCP_BBR_USE_RACK_RR 1104 /* Do we use the rack rapid recovery for pacing rxt's */ +#define TCP_RACK_TLP_USE 1095 /* int; */ +#define TCP_BBR_TMR_PACE_OH 1096 /* int; */ +#define TCP_RACK_DO_DETECTION 1097 /* int; Recycle of extra gain for rack, attack detection */ +#define TCP_BBR_RACK_RTT_USE 1098 /* int; what RTT should we use 0, 1, or 2? */ +#define TCP_BBR_RETRAN_WTSO 1099 /* int; */ +#define TCP_DATA_AFTER_CLOSE 1100 /* int; */ +#define TCP_BBR_PROBE_RTT_GAIN 1101 /* int; */ +#define TCP_BBR_PROBE_RTT_LEN 1102 /* int; */ +#define TCP_BBR_SEND_IWND_IN_TSO 1103 /* int; Do we burst out whole iwin size chunks at start? */ +#define TCP_BBR_USE_RACK_RR 1104 /* int; Do we use the rack rapid recovery for pacing rxt's */ #define TCP_BBR_USE_RACK_CHEAT TCP_BBR_USE_RACK_RR /* Compat. */ -#define TCP_BBR_HDWR_PACE 1105 /* Enable/disable hardware pacing */ -#define TCP_BBR_UTTER_MAX_TSO 1106 /* Do we enforce an utter max TSO size */ -#define TCP_BBR_EXTRA_STATE 1107 /* Special exit-persist catch up */ -#define TCP_BBR_FLOOR_MIN_TSO 1108 /* The min tso size */ -#define TCP_BBR_MIN_TOPACEOUT 1109 /* Do we suspend pacing until */ -#define TCP_BBR_TSTMP_RAISES 1110 /* Can a timestamp measurement raise the b/w */ -#define TCP_BBR_POLICER_DETECT 1111 /* Turn on/off google mode policer detection */ -#define TCP_BBR_RACK_INIT_RATE 1112 /* Set an initial pacing rate for when we have no b/w in kbits per sec */ -#define TCP_RACK_RR_CONF 1113 /* Rack rapid recovery configuration control*/ -#define TCP_RACK_GP_INCREASE_CA 1114 /* GP increase for Congestion Avoidance */ -#define TCP_RACK_GP_INCREASE_SS 1115 /* GP increase for Slow Start */ -#define TCP_RACK_GP_INCREASE_REC 1116 /* GP increase for Recovery */ -#define TCP_RACK_FORCE_MSEG 1117 /* Override to use the user set max-seg value */ -#define TCP_RACK_PACE_RATE_CA 1118 /* Pacing rate for Congestion Avoidance */ -#define TCP_RACK_PACE_RATE_SS 1119 /* Pacing rate for Slow Start */ -#define TCP_RACK_PACE_RATE_REC 1120 /* Pacing rate for Recovery */ -#define TCP_NO_PRR 1122 /* If pacing, don't use prr */ -#define TCP_RACK_NONRXT_CFG_RATE 1123 /* In recovery does a non-rxt use the cfg rate */ -#define TCP_SHARED_CWND_ENABLE 1124 /* Use a shared cwnd if allowed */ -#define TCP_TIMELY_DYN_ADJ 1125 /* Do we attempt dynamic multipler adjustment with timely. */ -#define TCP_RACK_NO_PUSH_AT_MAX 1126 /* For timely do not push if we are over max rtt */ -#define TCP_RACK_PACE_TO_FILL 1127 /* If we are not in recovery, always pace to fill the cwnd in 1 RTT */ -#define TCP_SHARED_CWND_TIME_LIMIT 1128 /* we should limit to low time values the scwnd life */ -#define TCP_RACK_PROFILE 1129 /* Select a profile that sets multiple options */ -#define TCP_HDWR_RATE_CAP 1130 /* Allow hardware rates to cap pacing rate */ -#define TCP_PACING_RATE_CAP 1131 /* Highest rate allowed in pacing in bytes per second (uint64_t) */ -#define TCP_HDWR_UP_ONLY 1132 /* Allow the pacing rate to climb but not descend (with the exception of fill-cw */ -#define TCP_RACK_ABC_VAL 1133 /* Set a local ABC value different then the system default */ -#define TCP_REC_ABC_VAL 1134 /* Do we use the ABC value for recovery or the override one from sysctl */ -#define TCP_RACK_MEASURE_CNT 1135 /* How many measurements are required in GP pacing */ -#define TCP_DEFER_OPTIONS 1136 /* Defer options until the proper number of measurements occur, does not defer TCP_RACK_MEASURE_CNT */ +#define TCP_BBR_HDWR_PACE 1105 /* int; Enable/disable hardware pacing */ +#define TCP_BBR_UTTER_MAX_TSO 1106 /* int; Do we enforce an utter max TSO size */ +#define TCP_BBR_EXTRA_STATE 1107 /* int; Special exit-persist catch up */ +#define TCP_BBR_FLOOR_MIN_TSO 1108 /* int; The min tso size */ +#define TCP_BBR_MIN_TOPACEOUT 1109 /* int; Do we suspend pacing until */ +#define TCP_BBR_TSTMP_RAISES 1110 /* int; Can a timestamp measurement raise the b/w */ +#define TCP_BBR_POLICER_DETECT 1111 /* int; Turn on/off google mode policer detection */ +#define TCP_BBR_RACK_INIT_RATE 1112 /* int; Set an initial pacing rate for when we have no b/w in kbits per sec */ +#define TCP_RACK_RR_CONF 1113 /* int; Rack rapid recovery configuration control*/ +#define TCP_RACK_GP_INCREASE_CA 1114 /* int; GP increase for Congestion Avoidance */ +#define TCP_RACK_GP_INCREASE_SS 1115 /* int; GP increase for Slow Start */ +#define TCP_RACK_GP_INCREASE_REC 1116 /* int; GP increase for Recovery */ +#define TCP_RACK_FORCE_MSEG 1117 /* int; Override to use the user set max-seg value */ +#define TCP_RACK_PACE_RATE_CA 1118 /* int; Pacing rate for Congestion Avoidance */ +#define TCP_RACK_PACE_RATE_SS 1119 /* int; Pacing rate for Slow Start */ +#define TCP_RACK_PACE_RATE_REC 1120 /* int; Pacing rate for Recovery */ +#define TCP_NO_PRR 1122 /* int; If pacing, don't use prr */ +#define TCP_RACK_NONRXT_CFG_RATE 1123 /* int; In recovery does a non-rxt use the cfg rate */ +#define TCP_SHARED_CWND_ENABLE 1124 /* int; Use a shared cwnd if allowed */ +#define TCP_TIMELY_DYN_ADJ 1125 /* int; Do we attempt dynamic multipler adjustment with timely. */ +#define TCP_RACK_NO_PUSH_AT_MAX 1126 /* int; For timely do not push if we are over max rtt */ +#define TCP_RACK_PACE_TO_FILL 1127 /* int; If we are not in recovery, always pace to fill the cwnd in 1 RTT */ +#define TCP_SHARED_CWND_TIME_LIMIT 1128 /* int; we should limit to low time values the scwnd life */ +#define TCP_RACK_PROFILE 1129 /* int; Select a profile that sets multiple options */ +#define TCP_HDWR_RATE_CAP 1130 /* int; Allow hardware rates to cap pacing rate */ +#define TCP_PACING_RATE_CAP 1131 /* uint64_t; Highest rate allowed in pacing in bytes per second */ +#define TCP_HDWR_UP_ONLY 1132 /* int; Allow the pacing rate to climb but not descend (with the exception of fill-cw */ +#define TCP_RACK_ABC_VAL 1133 /* int; Set a local ABC value different then the system default */ +#define TCP_REC_ABC_VAL 1134 /* int; Do we use the ABC value for recovery or the override one from sysctl */ +#define TCP_RACK_MEASURE_CNT 1135 /* int; How many measurements are required in GP pacing */ +#define TCP_DEFER_OPTIONS 1136 /* int; Defer options until the proper number of measurements occur, does not defer TCP_RACK_MEASURE_CNT */ /* unused 1137 */ -#define TCP_RACK_PACING_BETA 1138 /* Changing the beta for pacing */ -#define TCP_RACK_PACING_BETA_ECN 1139 /* Changing the beta for ecn with pacing */ -#define TCP_RACK_TIMER_SLOP 1140 /* Set or get the timer slop used */ -#define TCP_RACK_DSACK_OPT 1141 /* How do we setup rack timer DSACK options bit 1/2 */ -#define TCP_RACK_ENABLE_HYSTART 1142 /* Do we allow hystart in the CC modules */ -#define TCP_RACK_SET_RXT_OPTIONS 1143 /* Set the bits in the retransmit options */ -#define TCP_RACK_HI_BETA 1144 /* Turn on/off high beta */ -#define TCP_RACK_SPLIT_LIMIT 1145 /* Set a split limit for split allocations */ -#define TCP_RACK_PACING_DIVISOR 1146 /* Pacing divisor given to rate-limit code for burst sizing */ -#define TCP_RACK_PACE_MIN_SEG 1147 /* Pacing min seg size rack will use */ -#define TCP_RACK_DGP_IN_REC 1148 /* Do we use full DGP in recovery? */ +#define TCP_RACK_PACING_BETA 1138 /* int; Changing the beta for pacing */ +#define TCP_RACK_PACING_BETA_ECN 1139 /* int; Changing the beta for ecn with pacing */ +#define TCP_RACK_TIMER_SLOP 1140 /* int; Set or get the timer slop used */ +#define TCP_RACK_DSACK_OPT 1141 /* int; How do we setup rack timer DSACK options bit 1/2 */ +#define TCP_RACK_ENABLE_HYSTART 1142 /* int; Do we allow hystart in the CC modules */ +#define TCP_RACK_SET_RXT_OPTIONS 1143 /* int; Set the bits in the retransmit options */ +#define TCP_RACK_HI_BETA 1144 /* int; Turn on/off high beta */ +#define TCP_RACK_SPLIT_LIMIT 1145 /* int; Set a split limit for split allocations */ +#define TCP_RACK_PACING_DIVISOR 1146 /* int; Pacing divisor given to rate-limit code for burst sizing */ +#define TCP_RACK_PACE_MIN_SEG 1147 /* int; Pacing min seg size rack will use */ +#define TCP_RACK_DGP_IN_REC 1148 /* int; Do we use full DGP in recovery? */ /* unused 1149 */ #define TCP_HYBRID_PACING 1150 /* Hybrid pacing enablement */ -#define TCP_PACING_DND 1151 /* When pacing with rr_config=3 can sacks disturb us */ -#define TCP_SS_EEXIT 1152 /* Do we do early exit from slowtart if no b/w growth */ -#define TCP_DGP_UPPER_BOUNDS 1153 /* SS and CA upper bound in percentage */ -#define TCP_NO_TIMELY 1154 /* Disable/enable Timely */ -#define TCP_HONOR_HPTS_MIN 1155 /* Do we honor hpts min to */ -#define TCP_REC_IS_DYN 1156 /* Do we allow timely to change recovery multiplier? */ -#define TCP_SIDECHAN_DIS 1157 /* Disable/enable the side-channel */ -#define TCP_FILLCW_RATE_CAP 1158 /* Set a cap for DGP's fillcw */ +#define TCP_PACING_DND 1151 /* int; When pacing with rr_config=3 can sacks disturb us */ +#define TCP_SS_EEXIT 1152 /* int; Do we do early exit from slowtart if no b/w growth */ +#define TCP_DGP_UPPER_BOUNDS 1153 /* int; SS and CA upper bound in percentage */ +#define TCP_NO_TIMELY 1154 /* int; Disable/enable Timely */ +#define TCP_HONOR_HPTS_MIN 1155 /* int; Do we honor hpts min to */ +#define TCP_REC_IS_DYN 1156 /* int; Do we allow timely to change recovery multiplier? */ +#define TCP_SIDECHAN_DIS 1157 /* int; Disable/enable the side-channel */ +#define TCP_FILLCW_RATE_CAP 1158 /* int; Set a cap for DGP's fillcw */ /* unused 1159 */ #define TCP_STACK_SPEC_INFO 1160 /* Get stack specific information (if present) */ #define RACK_CSPR_IS_FCC 1161 -#define TCP_GP_USE_LTBW 1162 /* how we use lt_bw 0=not, 1=min, 2=max */ +#define TCP_GP_USE_LTBW 1162 /* int; how we use lt_bw 0=not, 1=min, 2=max */ /* Start of reserved space for third-party user-settable options. */ diff --git a/sys/netinet/udp.h b/sys/netinet/udp.h index 010f2210b516..448f7b68ae3f 100644 --- a/sys/netinet/udp.h +++ b/sys/netinet/udp.h @@ -49,7 +49,7 @@ struct udphdr { /* * User-settable options (used with setsockopt). */ -#define UDP_ENCAP 1 +#define UDP_ENCAP 1 /* int; UDP encapsulation type */ /* Start of reserved space for third-party user-settable options. */ #define UDP_VENDOR SO_VENDOR diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h index 1206960357da..168bb927fb57 100644 --- a/sys/netinet6/in6.h +++ b/sys/netinet6/in6.h @@ -407,7 +407,7 @@ struct route_in6 { #define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */ #define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */ #define IPV6_MULTICAST_IF 9 /* u_int; set/get IP6 multicast i/f */ -#define IPV6_MULTICAST_HOPS 10 /* int; set/get IP6 multicast hops */ +#define IPV6_MULTICAST_HOPS 10 /* u_int; set/get IP6 multicast hops */ #define IPV6_MULTICAST_LOOP 11 /* u_int; set/get IP6 multicast loopback */ #define IPV6_JOIN_GROUP 12 /* ipv6_mreq; join a group membership */ #define IPV6_LEAVE_GROUP 13 /* ipv6_mreq; leave a group membership */ @@ -430,7 +430,7 @@ struct route_in6 { #define IPV6_BINDV6ONLY IPV6_V6ONLY #endif -#define IPV6_IPSEC_POLICY 28 /* struct; get/set security policy */ +#define IPV6_IPSEC_POLICY 28 /* struct sadb_x_policy; get/set security policy */ /* 29; unused; was IPV6_FAITH */ #if 1 /* IPV6FIREWALL */ #define IPV6_FW_ADD 30 /* add a firewall rule to chain */ @@ -485,7 +485,7 @@ struct route_in6 { * the source address. */ -#define IPV6_BINDANY 64 /* bool: allow bind to any address */ +#define IPV6_BINDANY 64 /* bool; allow bind to any address */ /* unused; was IPV6_BIND_MULTI */ /* unused; was IPV6_RSS_LISTEN_BUCKET */ #define IPV6_FLOWID 67 /* int; flowid of given socket */ @@ -494,7 +494,7 @@ struct route_in6 { #define IPV6_RECVFLOWID 70 /* bool; receive IP6 flowid/flowtype w/ datagram */ #define IPV6_RECVRSSBUCKETID 71 /* bool; receive IP6 RSS bucket id w/ datagram */ -#define IPV6_ORIGDSTADDR 72 /* bool: allow getting dstaddr /port info */ +#define IPV6_ORIGDSTADDR 72 /* bool; allow getting dstaddr /port info */ #define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR /* diff --git a/sys/sys/socket.h b/sys/sys/socket.h index 25b6fce75b94..8477e122520a 100644 --- a/sys/sys/socket.h +++ b/sys/sys/socket.h @@ -125,55 +125,55 @@ typedef __uintptr_t uintptr_t; /* * Option flags per-socket. */ -#define SO_DEBUG 0x00000001 /* turn on debugging info recording */ -#define SO_ACCEPTCONN 0x00000002 /* socket has had listen() */ -#define SO_REUSEADDR 0x00000004 /* allow local address reuse */ -#define SO_KEEPALIVE 0x00000008 /* keep connections alive */ -#define SO_DONTROUTE 0x00000010 /* just use interface addresses */ -#define SO_BROADCAST 0x00000020 /* permit sending of broadcast msgs */ +#define SO_DEBUG 0x00000001 /* int; turn on debugging info recording */ +#define SO_ACCEPTCONN 0x00000002 /* int; socket has had listen() */ +#define SO_REUSEADDR 0x00000004 /* int; allow local address reuse */ +#define SO_KEEPALIVE 0x00000008 /* int; keep connections alive */ +#define SO_DONTROUTE 0x00000010 /* int; just use interface addresses */ +#define SO_BROADCAST 0x00000020 /* int; permit sending of broadcast msgs */ #if __BSD_VISIBLE -#define SO_USELOOPBACK 0x00000040 /* bypass hardware when possible */ +#define SO_USELOOPBACK 0x00000040 /* int; bypass hardware when possible */ #endif -#define SO_LINGER 0x00000080 /* linger on close if data present */ -#define SO_OOBINLINE 0x00000100 /* leave received OOB data in line */ +#define SO_LINGER 0x00000080 /* struct linger; linger on close if data present */ +#define SO_OOBINLINE 0x00000100 /* int; leave received OOB data in line */ #if __BSD_VISIBLE -#define SO_REUSEPORT 0x00000200 /* allow local address & port reuse */ -#define SO_TIMESTAMP 0x00000400 /* timestamp received dgram traffic */ -#define SO_NOSIGPIPE 0x00000800 /* no SIGPIPE from EPIPE */ -#define SO_ACCEPTFILTER 0x00001000 /* there is an accept filter */ -#define SO_BINTIME 0x00002000 /* timestamp received dgram traffic */ +#define SO_REUSEPORT 0x00000200 /* int; allow local address & port reuse */ +#define SO_TIMESTAMP 0x00000400 /* int; timestamp received dgram traffic */ +#define SO_NOSIGPIPE 0x00000800 /* int; no SIGPIPE from EPIPE */ +#define SO_ACCEPTFILTER 0x00001000 /* struct accept_filter_arg; accept filter */ +#define SO_BINTIME 0x00002000 /* int; timestamp received dgram traffic */ #endif -#define SO_NO_OFFLOAD 0x00004000 /* socket cannot be offloaded */ -#define SO_NO_DDP 0x00008000 /* disable direct data placement */ -#define SO_REUSEPORT_LB 0x00010000 /* reuse with load balancing */ -#define SO_RERROR 0x00020000 /* keep track of receive errors */ +#define SO_NO_OFFLOAD 0x00004000 /* int; socket cannot be offloaded */ +#define SO_NO_DDP 0x00008000 /* int; disable direct data placement */ +#define SO_REUSEPORT_LB 0x00010000 /* int; reuse with load balancing */ +#define SO_RERROR 0x00020000 /* int; keep track of receive errors */ /* * Additional options, not kept in so_options. */ -#define SO_SNDBUF 0x1001 /* send buffer size */ -#define SO_RCVBUF 0x1002 /* receive buffer size */ -#define SO_SNDLOWAT 0x1003 /* send low-water mark */ -#define SO_RCVLOWAT 0x1004 /* receive low-water mark */ -#define SO_SNDTIMEO 0x1005 /* send timeout */ -#define SO_RCVTIMEO 0x1006 /* receive timeout */ -#define SO_ERROR 0x1007 /* get error status and clear */ -#define SO_TYPE 0x1008 /* get socket type */ +#define SO_SNDBUF 0x1001 /* int; send buffer size */ +#define SO_RCVBUF 0x1002 /* int; receive buffer size */ +#define SO_SNDLOWAT 0x1003 /* int; send low-water mark */ +#define SO_RCVLOWAT 0x1004 /* int; receive low-water mark */ +#define SO_SNDTIMEO 0x1005 /* struct timeval; send timeout */ +#define SO_RCVTIMEO 0x1006 /* struct timeval; receive timeout */ +#define SO_ERROR 0x1007 /* int; get error status and clear */ +#define SO_TYPE 0x1008 /* int; get socket type */ #if __BSD_VISIBLE #define SO_LABEL 0x1009 /* socket's MAC label */ #define SO_PEERLABEL 0x1010 /* socket's peer's MAC label */ -#define SO_LISTENQLIMIT 0x1011 /* socket's backlog limit */ -#define SO_LISTENQLEN 0x1012 /* socket's complete queue length */ -#define SO_LISTENINCQLEN 0x1013 /* socket's incomplete queue length */ -#define SO_FIB 0x1014 /* get or set socket FIB */ +#define SO_LISTENQLIMIT 0x1011 /* int; socket's backlog limit */ +#define SO_LISTENQLEN 0x1012 /* int; socket's complete queue length */ +#define SO_LISTENINCQLEN 0x1013 /* int; socket's incomplete queue length */ +#define SO_FIB 0x1014 /* int; get or set socket FIB */ #define SO_SETFIB SO_FIB /* backward compat alias */ -#define SO_USER_COOKIE 0x1015 /* user cookie (dummynet etc.) */ -#define SO_PROTOCOL 0x1016 /* get socket protocol (Linux name) */ +#define SO_USER_COOKIE 0x1015 /* uint32_t; user cookie (dummynet etc.) */ +#define SO_PROTOCOL 0x1016 /* int; get socket protocol (Linux name) */ #define SO_PROTOTYPE SO_PROTOCOL /* alias for SO_PROTOCOL (SunOS name) */ -#define SO_TS_CLOCK 0x1017 /* clock type used for SO_TIMESTAMP */ -#define SO_MAX_PACING_RATE 0x1018 /* socket's max TX pacing rate (Linux name) */ -#define SO_DOMAIN 0x1019 /* get socket domain */ -#define SO_SPLICE 0x1023 /* splice data to other socket */ +#define SO_TS_CLOCK 0x1017 /* int; clock type used for SO_TIMESTAMP */ +#define SO_MAX_PACING_RATE 0x1018 /* uint32_t; socket's max TX pacing rate (Linux name) */ +#define SO_DOMAIN 0x1019 /* int; get socket domain */ +#define SO_SPLICE 0x1023 /* struct splice; splice data to other socket */ #endif #if __BSD_VISIBLE diff --git a/sys/sys/un.h b/sys/sys/un.h index 41bde1701900..10ba6a51b2d8 100644 --- a/sys/sys/un.h +++ b/sys/sys/un.h @@ -63,8 +63,8 @@ struct sockaddr_un { /* Socket options. */ #define LOCAL_PEERCRED 1 /* retrieve peer credentials */ -#define LOCAL_CREDS 2 /* pass credentials to receiver */ -#define LOCAL_CREDS_PERSISTENT 3 /* pass credentials to receiver */ +#define LOCAL_CREDS 2 /* int; pass credentials to receiver */ +#define LOCAL_CREDS_PERSISTENT 3 /* int; pass credentials to receiver */ /* Start of reserved space for third-party socket options. */ #define LOCAL_VENDOR SO_VENDOR From nobody Wed Jun 17 15:05:19 2026 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 4ggRxC4HmKz6hVGf for ; Wed, 17 Jun 2026 15:05: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggRxC38gwz43t4 for ; Wed, 17 Jun 2026 15:05:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781708719; 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=/6Xp0Kj+wJfs6jNFHHWj2SRCD7LbFCjbRRYQyrxE/N8=; b=TI+cE2Vl2YvyELmhGh8P0g4ZVVosQZRPExwUAXaF/QR8iC06JyWEk5k5aAKk+Csq24Z5si obzV0v0jV5t9snxyB036ClqZ/IYEQRAwnToA23rnFmqHk7hzH+IfEsGRltrr4jyKdWdv3i rXTOjV5D5FZtdqc3SCXpeJfuc5buCWZ6Rx0FF5zbG9467ZLdu6ivNEnlH8bPQgrzrfvXgT 0tDa7idSl/VYS0D5lftfR35HKumRNgNNpihlmlKg3wlMb/qGv1w9Hs7SI8w+PH7bWvziIJ huBk8tK6hrd5UieMSRw8xol0URT72ibDZh9fXzZrXK/IPTGTkAcgQfSC599Cwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781708719; a=rsa-sha256; cv=none; b=YSNozBFBUbHayA6qRgXNF7EtBLg+2UpjaFKVrNCbdEM3V0leKxtJq6IfovQgVPSkNPo+os wIYzrfRpcBcGtmW1Cx32SurxY3cLBkWV+YNwzRjQy1T9K+evI1pLFD34T/a8yqxPwqBkCj LJjRFw4gFqk34sdS/TB17n3QpfpFj57fNDiyBeZpFIEPrrnQ6GVaV5TWCGd5Vgdre8bapO O6q8g+elP90ghFfQKDZ0FY1BtuLyHtTeounPyUC4tA7ZlBspc2JSg9IVHc8b/AfehZk5W2 1NEP67oLg3rKWgedR7oF4Nqj8AIQUr26FjBwp+a65A3oFvGobSmm/ccuRKMAbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781708719; 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=/6Xp0Kj+wJfs6jNFHHWj2SRCD7LbFCjbRRYQyrxE/N8=; b=QgFCSbtQdXlij3+sdKOjystP17qKPbM4e4SBGDhKruiA0pRWA456Vk6LFKP2lR2i6M3XqB 4iiBT4/n1PfbVU2K8YLlOaQysk+I8aY/bTlhqkLepk+1rwcDKYmPnHcVYZntflZbNdllsJ AVKbxx1KtunGk4UdvwdmPlMuDKe5K8r0a6oxPoqadpMIQp3692E5AhSWbLl09yyUBqFk/n BXbcgzp/lMlnAkP0iVbIwC28rjvUCgrHEgMwdAVJrd/Qgx1RFf3pj8/RrnRl/r/88MHRJ5 fR62eGQS3p5bO7WlGcJCfJApFBxO6nroY+EEWruUjbaowntByrf+zD3FPJIjcA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggRxC2TrMz2D8 for ; Wed, 17 Jun 2026 15:05:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3e162 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 15:05:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 949804c81909 - main - nvme: Use newbus to ask if a device is storage 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 949804c819096b40210e0b0729e54ba10b79c2e8 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 15:05:19 +0000 Message-Id: <6a32b7af.3e162.34185707@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=949804c819096b40210e0b0729e54ba10b79c2e8 commit 949804c819096b40210e0b0729e54ba10b79c2e8 Author: Warner Losh AuthorDate: 2026-06-17 15:03:31 +0000 Commit: Warner Losh CommitDate: 2026-06-17 15:03:31 +0000 nvme: Use newbus to ask if a device is storage As NVMe is in more places, it has a variety of attachments. On non PCI busses, we assume we're a storage device. For PCI, we look at the interface ID. Add newbus glue to make this happen. Sponsored by: Netflix Discussed with: jhb Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D56994 --- sys/dev/nvme/nvme_if.m | 15 +++++++++++++++ sys/dev/nvme/nvme_pci.c | 15 +++++++++++++++ sys/dev/nvme/nvme_sim.c | 3 +++ 3 files changed, 33 insertions(+) diff --git a/sys/dev/nvme/nvme_if.m b/sys/dev/nvme/nvme_if.m index 5a06ff112f4c..9705aeb7ce0b 100644 --- a/sys/dev/nvme/nvme_if.m +++ b/sys/dev/nvme/nvme_if.m @@ -12,6 +12,14 @@ HEADER { #include "dev/nvme/nvme_private.h" }; +CODE { + static bool + default_is_storage_device(device_t dev) + { + return (true); + } +} + # # A new namespace is now available # @@ -53,3 +61,10 @@ METHOD int handle_aen { void *page; /* Contents of the page */ uint32_t page_len; /* Length of the page */ }; + +# +# is this device a storage device or not. +# +METHOD bool is_storage_device { + device_t dev; +} default default_is_storage_device; diff --git a/sys/dev/nvme/nvme_pci.c b/sys/dev/nvme/nvme_pci.c index 0566b227ad7c..8389c7535c3d 100644 --- a/sys/dev/nvme/nvme_pci.c +++ b/sys/dev/nvme/nvme_pci.c @@ -38,11 +38,15 @@ #include "nvme_private.h" +#include "nvme_if.h" + static int nvme_pci_probe(device_t); static int nvme_pci_attach(device_t); static int nvme_pci_detach(device_t); static int nvme_pci_suspend(device_t); static int nvme_pci_resume(device_t); +static bool nvme_pci_is_storage_device(device_t); + static int nvme_ctrlr_setup_interrupts(struct nvme_controller *ctrlr); @@ -54,6 +58,7 @@ static device_method_t nvme_pci_methods[] = { DEVMETHOD(device_suspend, nvme_pci_suspend), DEVMETHOD(device_resume, nvme_pci_resume), DEVMETHOD(device_shutdown, nvme_shutdown), + DEVMETHOD(nvme_is_storage_device, nvme_pci_is_storage_device), DEVMETHOD_END }; @@ -421,3 +426,13 @@ nvme_pci_resume(device_t dev) ctrlr = DEVICE2SOFTC(dev); return (nvme_ctrlr_resume(ctrlr)); } + +static bool +nvme_pci_is_storage_device(device_t dev) +{ + /* + * NVMHCI 1.0 interfaces are the only devices that + * have namespaces with LBA ranges. + */ + return (pci_get_progif(dev) == PCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0); +} diff --git a/sys/dev/nvme/nvme_sim.c b/sys/dev/nvme/nvme_sim.c index 89cdd0903b39..8f6cef4109f0 100644 --- a/sys/dev/nvme/nvme_sim.c +++ b/sys/dev/nvme/nvme_sim.c @@ -324,6 +324,9 @@ nvme_sim_probe(device_t dev) if (nvme_use_nvd) return (ENXIO); + if (!NVME_IS_STORAGE_DEVICE(device_get_parent(dev))) + return (ENXIO); + device_set_desc(dev, "nvme cam"); return (BUS_PROBE_DEFAULT); } From nobody Wed Jun 17 15:13:24 2026 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 4ggS6X2qSkz6hVCf for ; Wed, 17 Jun 2026 15:13:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggS6X23vMz458T for ; Wed, 17 Jun 2026 15:13:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781709204; 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=F94vIEdyulNwYHPLYf/UqSPirgd52hzxe4oU0mwozD0=; b=k9TYS/pd/8QHMwWQFNO+jFx7l8WAE3DbttqPd0yviFdU+h7/OaiHpZVHifnZkC9D+Srs0D yc1Nr7rqtPJsOj3s1tGdVfaLSsuShNc2GNugYDq1qAKvmkVWDTN5WWtU3245hsVSdKWkJ9 aGcPF6GPaB6YZLznCuXdE8+YvRaf5N2qw7si+n9IVNfhS7GjEqOENKsFqxfb5GyZS4iX5X oZxDBCJTMq6Y8EvWKUrDaiR4nSMyYitean7w4M8KdVRoFvHUteRi6sT7iSgS64ZV/4amG5 hfqGQ9s7w06ZRejZPwOxkzwQImCWLeX00VB+04fcCfaJmnYo4MWU+MblLTt0BQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781709204; a=rsa-sha256; cv=none; b=HBDo/c2x6m434SgQCUMnc0vbpfGg33uf8o6Nlm+gO57aOy3PgnXkYOVEkoer9q34XLWenF M/bnySDPE2WOnEDSDQ2VHCb2cUZKEc/anyE0jkf6cwSCv8uzkK5bXnyPpOp72OwSksXgCO l6khMR2qhw2vCLd4YqzJUpUp2yqbnudF4XgNSaWM2CfXvDiUUO5ez1+Vy4YQrr9OOsZDtw z6LDfLV9AiVnZXmtkGEqJpHnJG6JuqZVIMHiENWaCGV1UolNoEGqANLaWSHjuX4PH43OSu dhMdQ5lFSM27eOkvFR3rfXG4btBsv8oFPW7m9OKLkJMq+yh/UAp6Nan6kKMWQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781709204; 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=F94vIEdyulNwYHPLYf/UqSPirgd52hzxe4oU0mwozD0=; b=sawe6rXGiitGkD2X1toTHLkmSdEjcEpZUCATPGOgSyM6ieuUc4T3bv5jHefP63j9krCZ6s 1wuED3Jfs2uXRkCwmpdZof0TlijR9krscdZTGXcrfua4iTxB94M0CeW6seetY7yhzOdtob N6qONWpjPi7WLoaRVWbHEVgeoSMDwI7ThAZ3nwtxZiz6bKVd7XfzqpqRW9n+KEggl3XZ+g 70kVBI79OBWvvI8N5JvgSmJ+s9fo4NWl3xtgAsS6icsLdUg4kERasUUvJDCMMz3MhB8m9Y ttyvZbbAnRivDL5bi8Iu8N0QlgtfhUi+7AOx6/8+auwj3Pk1grnEdxyBjTObOQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggS6X1W9Nz2Dr for ; Wed, 17 Jun 2026 15:13:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3fd92 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 15:13:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Devin Teske Subject: git: 08da4322ff62 - main - Update bsdconfig dot USAGE copyright following previous commits 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dteske X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 08da4322ff6225aacb315e475537229c11a6badf Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 15:13:24 +0000 Message-Id: <6a32b994.3fd92.7b592311@gitrepo.freebsd.org> The branch main has been updated by dteske: URL: https://cgit.FreeBSD.org/src/commit/?id=08da4322ff6225aacb315e475537229c11a6badf commit 08da4322ff6225aacb315e475537229c11a6badf Author: Devin Teske AuthorDate: 2026-06-17 15:13:19 +0000 Commit: Devin Teske CommitDate: 2026-06-17 15:13:19 +0000 Update bsdconfig dot USAGE copyright following previous commits --- usr.sbin/bsdconfig/dot/USAGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdconfig/dot/USAGE b/usr.sbin/bsdconfig/dot/USAGE index 6cc4d9edfb17..0a8d9d690b89 100644 --- a/usr.sbin/bsdconfig/dot/USAGE +++ b/usr.sbin/bsdconfig/dot/USAGE @@ -1,4 +1,4 @@ -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2026 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without From nobody Wed Jun 17 15:24:18 2026 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 4ggSM66s5Xz6hWDF for ; Wed, 17 Jun 2026 15:24:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggSM66HThz46Xw for ; Wed, 17 Jun 2026 15:24:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781709858; 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=kExmmNVp/WuyWVcPAYXqhnDvcDC0pFXGQkMvZ1uYAU4=; b=k3yl0WLX9N4UehEKCE5rn9ZwMoreI507D43Io7KfkWzGZ1hjfyG9aMsekQNibHN+iQnEe7 Gl/i2hGSn/LWBAZj4nhMrL3j5Yobkzg502Omr/htRXJgNKwFyJ1MfePCHqkEolY8KSO/D0 y4Q4LCIg6wKTosrP9Sp1M9Ot7KfR/qNcHhOv5MCKgjtHZnTM0bBkQqGe842JB8uxVdQ5lj J+APs/kuf+GgQklPXuerwlqXNLEWLSpR3ztBruEno97sScKoGLPv8txgwVk6mPnflew6Ns snWPCPIMWxUzFDFxkzh/UOSpcuIOBNZDxXXNBwzZV4dLVeAffVV3hrznbOUcvw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781709858; a=rsa-sha256; cv=none; b=PdO0b0/JjOQpmPQ3UONxbV1ljjF+QGWvw8BABY//W075GMRN9AjRyzCdvh9k2r8YPpxfH9 BcamRCgplEyZxKHkOEaAwX364JsLnuBhjL67KrVYMS9tPUx5LH81E7XgapJO53bODXeV/Q xW7ey2jUS9ps64UHbY9C/MMNNpR1vjYDqlj3LLhIMlFvZkACYoXzfeLtiGIfFl59t65+6/ IHQkuxUg7/pkmA732XTaPoSo006GlR5BhRga6hJAZGomk3yhaO4vfg9sHctveaGJuexcTT q4JC6rN/+J0/nKDrrqK5iQSf/IdZ+5vz9ehEcmDTxq/JQbHFmvytExRjOn/c8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781709858; 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=kExmmNVp/WuyWVcPAYXqhnDvcDC0pFXGQkMvZ1uYAU4=; b=qjdlhHNB4n6u1PtZkexrX64iCIAuF0vSw2Axk9wVeu4HXqXDQeajPvOgrZhFfs7D3QlVXi jDoO0B+g+omuYR8Q8KLrpVEqhv4TJmeBVyuijOZvDqCDTLLebKHxlXZfC+qQkCXjPKtcE1 ptTj/ItqrQmJQd4Re4YgCwoWD2Grs/wtjJqmbEtmQPNt++lofHtoB+84H2zaQ3tkJxyXDG ObsI4+2VOKNthrIhAH2+fnh3jmqxX95JVfx63k6/LjQHIeUGkT8xq9/ajiq1hpeC+kDYat dr/p1Idp3Jx6gGkcMn7mDXLrQHXMnrAJFfha/XEgDMLQKLIi/Xhq6ftrjqmXGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggSM65qT8z2fb for ; Wed, 17 Jun 2026 15:24:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 40fad by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 15:24:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Devin Teske Subject: git: 4519d987c4db - main - Update bsdconfig dot USAGE 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dteske X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4519d987c4db2c500c34b324b315c5dfd6efb3bc Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 15:24:18 +0000 Message-Id: <6a32bc22.40fad.4d7f0572@gitrepo.freebsd.org> The branch main has been updated by dteske: URL: https://cgit.FreeBSD.org/src/commit/?id=4519d987c4db2c500c34b324b315c5dfd6efb3bc commit 4519d987c4db2c500c34b324b315c5dfd6efb3bc Author: Devin Teske AuthorDate: 2026-06-17 15:17:02 +0000 Commit: Devin Teske CommitDate: 2026-06-17 15:17:02 +0000 Update bsdconfig dot USAGE print/gsview is no longer in ports, remove mention --- usr.sbin/bsdconfig/dot/USAGE | 6 ------ 1 file changed, 6 deletions(-) diff --git a/usr.sbin/bsdconfig/dot/USAGE b/usr.sbin/bsdconfig/dot/USAGE index 0a8d9d690b89..1252c0b68eae 100644 --- a/usr.sbin/bsdconfig/dot/USAGE +++ b/usr.sbin/bsdconfig/dot/USAGE @@ -86,12 +86,6 @@ EXAMPLES: View the above-rendered PostScript poster using X11: - gsview bsdconfig.ps - - NOTE: Requires `print/gsview' from ports/packages. - - or - convert bsdconfig.ps bsdconfig.pdf xpdf bsdconfig.pdf From nobody Wed Jun 17 15:27:00 2026 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 4ggSQF1F5rz6hWHj for ; Wed, 17 Jun 2026 15:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggSQF0dC2z46tb for ; Wed, 17 Jun 2026 15:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781710021; 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=BpW6cf4Z1kohqrANbsaCdBSGAhtX5SzLal/UeTlPnu8=; b=wcEJ7i9vkCV9k41BsCq/suNvxY0KaO8MkHhNJYQosBxR4XQn9bhaadCfxDbIWfuM9x9Zfi sMKUY3eCGBeHg6JiFy+Q0m45pamG6EniRvtPqJiBB8e3aE7weU7Vr1hh9CoRqJ7hRJPF4G ISUBfLr3+GiNlnkRDmaeGjIkXj8RxdNTgDnPW9DE2HTG4XkNz/njPkl6MGcFcPCOJG68vN vCdU1I2fP+RGz8sq2SZmJrbm+WRUr2Ix90QKKfHGlznz4/7PZl/+/OLNxh4BZPr8y+3LzG LzL9Z/dr1UBgygc/33wg4UaD+n0PUiCfmrORLsO/J925pgr8BRMH4259Sk7b4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781710021; a=rsa-sha256; cv=none; b=IkthOXiUPPm/UNgQGvOBkeGqstmeBhFDh/7wpMzAaqfOeGLbjWZgYZu1MFB213IVfxuUww k3mjKeXnao235wDsBN/gfTcCJnDhY1Ik90BdZ/R0apSLA7XrNc8A9Z+oV4sJKdcku+0gfc FbmVgDfjBMWpIcL3IXEr8pGMjMEqDd06Z9IhGDmAEGP24RCBWCkx0c/akssf/IaYKgCG5U fm5jGyGOQQh0r9vf3P6l8iqRMiaBYtj66x5LVZnsIGbhoitfyMWvH96k6VQSAZcDKZjMz3 tQZRGZylETyPQZd807a5tbXqWEqSbRvDOXzbaduSGOhxPsEBcZBgK6ykbZwX8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781710021; 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=BpW6cf4Z1kohqrANbsaCdBSGAhtX5SzLal/UeTlPnu8=; b=JDZ4p3j96iJ7fzOXkfhZLoBvj9EE/vhE7DurtlschOelPbtb7cxWlfMQ9j0+ibQgxPtilY UILqP94Ho8f/7elnd8wxHNC2Bu9c1VHH3k16DUa4MknX81XLKPSAUuhAfZi4tCV0Qi1Lpc axoStOfwtiaestMn/ajVBwdaR4VsV3H4L+gOQ7ucblhlF7RzKZXjm0OxwM4NlwPoQuN6ke PrxjZEf+XfmH/jyzRKlPHBJ36vE9nokY1jkiNHXxv7PzEM0i6tv3K5cyds67rnz3u4IFml HpjHFXi9P2YeUY03ynR/hseNMHOTR7XMaszjyj3btX+c05xsWq819jDZulVipg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggSQD74bcz30J for ; Wed, 17 Jun 2026 15:27:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 414a6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 15:27:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Devin Teske Subject: git: 4acaa22829f7 - main - Update bsdconfig dot USAGE 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dteske X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4acaa22829f77d287a4c99a7709fea80040998c8 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 15:27:00 +0000 Message-Id: <6a32bcc4.414a6.40ff79f3@gitrepo.freebsd.org> The branch main has been updated by dteske: URL: https://cgit.FreeBSD.org/src/commit/?id=4acaa22829f77d287a4c99a7709fea80040998c8 commit 4acaa22829f77d287a4c99a7709fea80040998c8 Author: Devin Teske AuthorDate: 2026-06-17 15:24:48 +0000 Commit: Devin Teske CommitDate: 2026-06-17 15:24:48 +0000 Update bsdconfig dot USAGE Add gm prefix to convert command. `convert` of ImageMagick is now available under `gm convert` where `gm` is the main entry point for GraphicsMagick commands. --- usr.sbin/bsdconfig/dot/USAGE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdconfig/dot/USAGE b/usr.sbin/bsdconfig/dot/USAGE index 1252c0b68eae..3093c86d3dd3 100644 --- a/usr.sbin/bsdconfig/dot/USAGE +++ b/usr.sbin/bsdconfig/dot/USAGE @@ -86,7 +86,7 @@ EXAMPLES: View the above-rendered PostScript poster using X11: - convert bsdconfig.ps bsdconfig.pdf + gm convert bsdconfig.ps bsdconfig.pdf xpdf bsdconfig.pdf NOTE: Requires both `graphics/GraphicsMagick' and From nobody Wed Jun 17 16:35:11 2026 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 4ggTwv68P3z6h73r for ; Wed, 17 Jun 2026 16:35: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggTwv5Ydtz3H3s for ; Wed, 17 Jun 2026 16:35:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781714111; 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=SO93/8HajbFb07FSk5u3JYFsul/bEhbt3BVHZSqQmII=; b=AxJ3UEbY8yDD2LP5NyyNl6oeYbZvkWFj02woL3wL2dHJzR2MBg/gD5Vx6uX+3vnAjrJbAl CH+xy5ha38i/pCFL4y071ZemvoerecJ71LL/U6DA6orgE8EKQyow9zgjahiCv9sWPuK1u9 OQzeCSRVM1qUNwFFC4l7MbCzYw08pjQle62OF1nPiFsWmo7Ofw4C3nos6Imbhd9olyXoIz yvMsvsxA6ie2xTKHUvhhy3gYCkDFaRu6vEuDKR/tDz7OjGfL5/cOaJHFm45hOEbCnZuLAN eokm1PKuDvr6xR6T7N/gTq3BvwsvmtqrznzXqYolu8yCq8uIBEA71Zbyh8BCbQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781714111; a=rsa-sha256; cv=none; b=mv7gmOifbKtL31p9KzApwd6MLG8LAHyM56QG3ZRu8CFiHx1gfYzoAj3MRgUWzt6l8QXue6 +j9wJMyXq2QtkbhceWxXLPGf4hyJpkE78falbvkY2ozCRqfTBTvpWMrHH2t/yOyRSr/Psm kzdgz2Tl9j2VUk66334xjN92cDTR/7iqCF6yz3/Lbs54zeG2F2fzqw1d8XRMr29/1tHfG4 tGi3kYi3XVs+YVJ8aafvJVDjGuNDhonxuYSP4lNXD5R7ywwD98wPHKTjKbI0xTAodAnPL0 FCVpzsQTNHQPTpJTAFso2BGC9GEtkWOFyCjN1WVmGhoyvXDo89hI761C5Nydfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781714111; 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=SO93/8HajbFb07FSk5u3JYFsul/bEhbt3BVHZSqQmII=; b=MsKKmiPRTZSwXVKZtk/P3IxihA8zBBWcW8OSxMKd7O77NWJWptTBMMfdW70nnqsfO/kerj QdOyigUG2j+WzjIerGZUhaivCtrJVM25Dkf+mM4aLsu0lQb9GFMjSR9rs/7npD3KT32Yyz Rh8iZmEvM01nOrgAWHL8ZdWztIik/2f7g93oZaDz4mnMff2DPQ1i3RTPPTZ6IF7a/fvr25 7ihlJRWlwMgZoN8AmynKVjYHcoPQS1KWhQOoRp0GYncO1W/a5GFs37iPAB7ad3Acs7KpnP WiJA4cPN5T2swCmsyiumYbAeHl7Z34B7ofCgnUG1arJeQE/bNuNo219YBdajMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggTwv591Rz4jp for ; Wed, 17 Jun 2026 16:35:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1828e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 16:35:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Devin Teske Subject: git: 00c8e7691001 - main - bsdconfig: Update dot USAGE 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dteske X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 00c8e7691001f5659f2bd2dbadb31fe48d9f61c7 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 16:35:11 +0000 Message-Id: <6a32ccbf.1828e.fb23753@gitrepo.freebsd.org> The branch main has been updated by dteske: URL: https://cgit.FreeBSD.org/src/commit/?id=00c8e7691001f5659f2bd2dbadb31fe48d9f61c7 commit 00c8e7691001f5659f2bd2dbadb31fe48d9f61c7 Author: Devin Teske AuthorDate: 2026-06-17 16:34:46 +0000 Commit: Devin Teske CommitDate: 2026-06-17 16:34:46 +0000 bsdconfig: Update dot USAGE graphics/gx is no longer in ports, remove reference --- usr.sbin/bsdconfig/dot/USAGE | 7 ------- 1 file changed, 7 deletions(-) diff --git a/usr.sbin/bsdconfig/dot/USAGE b/usr.sbin/bsdconfig/dot/USAGE index 3093c86d3dd3..53dd1c1a04f5 100644 --- a/usr.sbin/bsdconfig/dot/USAGE +++ b/usr.sbin/bsdconfig/dot/USAGE @@ -51,13 +51,6 @@ EXAMPLES: or - gx bsdconfig.svg - - NOTE: Image is scaled to fit window on launch. - NOTE: Requires `graphics/gx' from ports/packages. - - or - eog bsdconfig.svg NOTE: Requires `graphics/eog' from ports/packages. From nobody Wed Jun 17 16:53:23 2026 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 4ggVL10y7Xz6h8Zq for ; Wed, 17 Jun 2026 16:53:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggVL100b3z3T5l for ; Wed, 17 Jun 2026 16:53:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781715209; 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=pg0AQcigK/d9sINDJE5Wwx9Y/+FHL0uF7gMgbSD21IE=; b=As7klP2fd1SbyMZ3CRwlOIVa0n14GooM+gRInHeJsJS11YJso3a5TDA51LRe5ov38fgrBF tyqZEdc3yv+Qfi4HzUFbzMr3RfNtRFs7Wps709Pgm9RKYAzU+HLJOiaidoXRn0nCCwf2i9 IzDIjbqabH+VL7Ild2PYViFXvhnIkgmTNGqAWGSjUThXjwLKAAHOw1uQQIUjSmso0IHnOs qAIoDIdT8RUf+CysEko/keSLMNt/zUNcjC6hArdcFDzBKaeHwx5YTAQFvdGfwu2I3Dtx1I 9DUPwrfr+MsVrOebgFWKjZCe774gcNhVTfSfRR93qXHGSKL0OOBGfKdKgwEW+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781715209; a=rsa-sha256; cv=none; b=HBriPKPq3w6EXrlUg/KPVvrGA/SdDVbFROfS+2G3iStGxLmnncVIeetzukAkMN0X2GeDc+ YLeMybhvrlcnJ2sNdwY/mHNjjKZ9He49sn0/RznSKjL0vsm3aW/btXY5+6RL30SdHiHsSy tWaYqdtDiaYFIEg+fZIUM13hwT+g37ov7ElGxvhpvmUukcVi1EMHRi/0pRnCa5IKQdQxH4 hQmkTUxTUgUS03vyjbFgdTtaMARhEh7BFHs6owT5GDMc6BXlsevj3zG+3KB6PAdX5tF++R PADUYStzyRDdxRpLR0Gx9Cct42ncRjDR6ztqEZnCzn1JMpSivzU+ky/06Mg7mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781715209; 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=pg0AQcigK/d9sINDJE5Wwx9Y/+FHL0uF7gMgbSD21IE=; b=oGxWrCdAvWbp8RG/oByJplIwgt4uSwY+cRqjDSsZ+KdxnMjAP9f/gb4HjcB3qgqiW6PKom X9LSrrHFVg7gdvkBgiUNYgg5t7YWddZI4XqYxjllvRO1FU+JgnMeiQRMuLl88EX1ssqlHN hQyLDIXAgstbIJjJuQh9/Kv5Ja1ydK7pHFPMUSwS9YHx8EC8UGjDuEdbN1ml4Bo2v90np/ OWorAZkllYMxwDlhGlcIw6hlL/eQG4cWiIrzeaeMjgvTO0qQt0J8jMk/iQcVSmPq1rWKNm pfm217nJV+hIP6480FyIn8v9gebKL4SvvBsN+gOpYgba+8/1lnrHBhmsJpG8uA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggVL06fMyz4Tt for ; Wed, 17 Jun 2026 16:53:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 19a1d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 16:53:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Siva Mahadevan Subject: git: 1294f332aec0 - main - tests/pf/route_to: check_random: rely on test timeout to fail 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: siva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1294f332aec02e111b47d69e0d91e32dc2624001 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 16:53:23 +0000 Message-Id: <6a32d103.19a1d.3b02302a@gitrepo.freebsd.org> The branch main has been updated by siva: URL: https://cgit.FreeBSD.org/src/commit/?id=1294f332aec02e111b47d69e0d91e32dc2624001 commit 1294f332aec02e111b47d69e0d91e32dc2624001 Author: Siva Mahadevan AuthorDate: 2026-06-17 16:52:00 +0000 Commit: Siva Mahadevan CommitDate: 2026-06-17 16:53:14 +0000 tests/pf/route_to: check_random: rely on test timeout to fail This test is known to be flaky if 10 attempts happens to be not enough for the test to pass. Usually, this test passes in ~4-6 attempts. See https://ci.freebsd.org/job/FreeBSD-main-amd64-test/28664/testReport/junit/sys.netpfil.pf/route_to/random_table/ Rely on the timeout (default 5 mins) to catch a failure here, rather than just 10 attempts. It's very unlikely that 5 mins worth of attempts still isn't enough. For a history of flakiness, see https://ci.freebsd.org/job/FreeBSD-main-amd64-test/lastSuccessfulBuild/testReport/junit/sys.netpfil.pf/route_to/random_table/history/ PR: 289477 Reviewed by: kp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D57408 --- tests/sys/netpfil/pf/route_to.sh | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/tests/sys/netpfil/pf/route_to.sh b/tests/sys/netpfil/pf/route_to.sh index 7bf4b11788d8..1caf2367a9e3 100644 --- a/tests/sys/netpfil/pf/route_to.sh +++ b/tests/sys/netpfil/pf/route_to.sh @@ -29,10 +29,10 @@ common_dir=$(atf_get_srcdir)/../common # We need to somehow test if the random algorithm of pf_map_addr() is working. -# The table or prefix contains multiple IP next-hop addresses, for each one try -# to establish up to 10 connections. Fail the test if with this many attempts -# the "good" target has not been chosen. However this choice is random, -# the check might still ocasionally fail. +# The table or prefix contains multiple IP next-hop addresses. For each one, +# repeatedly try to establish connections until the "good" target has been chosen. +# However, since this choice is random, the test might still ocasionally fail +# due to timeout. check_random() { if [ "$1" = "IPv4" ]; then ping_from="${net_clients_4}.1" @@ -47,8 +47,9 @@ check_random() { port=42000 states=$(mktemp) || exit 1 for good_target in $good_targets; do - found="no" - for attempt in $(seq 1 10); do + # Loop until either the "good" target has been chosen + # or the test times out. + while :; do port=$(( port + 1 )) jexec router pfctl -Fs atf_check -s exit:0 ${common_dir}/pft_ping.py \ @@ -65,13 +66,9 @@ check_random() { done fi; if grep -qE "route-to: ${good_target}@" $states; then - found=yes break fi done - if [ "${found}" = "no" ]; then - atf_fail "Target ${good_target} not selected after ${attempt} attempts!" - fi done } @@ -1428,8 +1425,7 @@ prefer_ipv6_nexthop_mixed_af_roundrobin_ipv6_body() # The "random" flag will pick random hosts from the table but will # not dive into prefixes, always choosing the 0th address. # Proper address family will be choosen. The choice being random makes - # testing it non-trivial. We do 10 attempts to have each target chosen. - # Hopefully this is enough to have this test pass often enough. + # testing it non-trivial. # pf_map_addr() starts iterating over hosts of the pool from the 2nd # host. This behaviour was here before adding prefer-ipv6-nexthop From nobody Wed Jun 17 17:09:27 2026 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 4ggVhS1mYVz6hBFW for ; Wed, 17 Jun 2026 17:09:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggVhS0dFSz3Yj3 for ; Wed, 17 Jun 2026 17:09:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781716168; 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=DN3e76fX8v976PiqhCLRyT2vdHO5B5JvXcJ1EA4xwKI=; b=xkvO9c93qj/VBUmdLHFGINEBs9ELF+bfVYyUt8Jsr2paglvU8kJ2uSIdd7WEGlz1QUdLis T9Q7SmBHsXkmHRcVNFj929iISeOK6iJsJvhoE4lG5DC85faJqHJptZrRsmh0UxTl0pVulD u1ynmocFziJL5Ld0Y6kmlrOBezAcU9O3iQJcF6dMWpJJ5AWW4cUE7Lzhsrmfyl3eztDa2o mEHp4mu5btfRDQFQdi3CDAY/hAJlmVOBqdrGdGZGCcYWoLxcqyXGfJ1nJKIq6KAedWGNk4 sjckBFuvtSlnsFAloRLWknGbVB+7r7i4c3tDRLvoZNOmNrUxLy7wHUN89vnoxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781716168; a=rsa-sha256; cv=none; b=Tm6OounsLCqwYEaJoCE7Ql/jfCN5urT4BAtFnwyiEPEqEFC6Wup73/6eyynbOS603lvBtK prEeeUqg/A3DK5Qo60pe8x+oEHZ9nT22IKdyKjY6nfDcQtXmRBucIfalZGMEkM5aH7Sj8V 8lqWc2Msrto6K50xuPvml7u4ynXTdspZs2b1AOahe2ppcXPHIWao+vrMUl/Nt1Uy5Q6XJW HKzoHNqDt90jT1TbQmfpvi2qa6L2nZR14661fu9JFoZbaXG95TwSnSJ6bFsu0PdHBRhz4i YYu9ouxurAgE709YtBbgZZ0ngXfcm4USXVAFdJ1eyLejszYQXZvNRWrh5d0MjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781716168; 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=DN3e76fX8v976PiqhCLRyT2vdHO5B5JvXcJ1EA4xwKI=; b=R4f97rStJmV4v5pXihCzx/JFWcO+q93rRiUYpaZ5vzX9+OZ8KViZXOW+64FHgfxSQz6rfm Z+2k2Am7DWzd1nNeqkRNlQptMcUd3wNAknXRtasWBqLsZlm1yPRH4UWQcNsl2xxinBagp7 qch1llUli5I9X/D/7Ts+f5ltrPzpbIJl9BZK0yPheJp5L5l2mYZVOO5+VLu1vYSFY0uy5h Asr/4xpwOzaoFOhIx5GiYz49qEStmahwEvBVww0SHYHQDuie7I6aBLc4earKRCWCRuFC4g 4OZuZwFkQOKbH2j0j2ZCktRxwSkSBJhUejWkb8jLY9fUXz0TB9Fhx9iTn7OQAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggVhR737Yz5B2 for ; Wed, 17 Jun 2026 17:09:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1a234 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 17:09:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Siva Mahadevan Subject: git: 19af9c77acc9 - main - msun/logarithm_test: expect_fail log1p_accuracy_tests in the correct spot 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: siva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 19af9c77acc912e4bf90a667924f5f4ff78a7759 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 17:09:27 +0000 Message-Id: <6a32d4c7.1a234.248f5ac5@gitrepo.freebsd.org> The branch main has been updated by siva: URL: https://cgit.FreeBSD.org/src/commit/?id=19af9c77acc912e4bf90a667924f5f4ff78a7759 commit 19af9c77acc912e4bf90a667924f5f4ff78a7759 Author: Siva Mahadevan AuthorDate: 2026-06-17 17:04:54 +0000 Commit: Siva Mahadevan CommitDate: 2026-06-17 17:04:54 +0000 msun/logarithm_test: expect_fail log1p_accuracy_tests in the correct spot While here, remove the conditional on the "ci" config var to ensure that this is reproducible locally as well. This fixes a case where we are expecting a fail before the failing ATF_CHECK_* assertion happens. Found in a CI failure here: https://ci.freebsd.org/job/FreeBSD-main-riscv64-test/16608/testReport/lib.msun/logarithm_test/log1p_accuracy_tests/ PR: 253984 Fixes: 405188aeac540f7666dfde37c2f32d222119f56e MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D57351 --- lib/msun/tests/logarithm_test.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/msun/tests/logarithm_test.c b/lib/msun/tests/logarithm_test.c index df1fcdc8627d..a605fa6a6bfc 100644 --- a/lib/msun/tests/logarithm_test.c +++ b/lib/msun/tests/logarithm_test.c @@ -249,10 +249,6 @@ ATF_TC_BODY(accuracy_tests, tc) ATF_TC_WITHOUT_HEAD(log1p_accuracy_tests); ATF_TC_BODY(log1p_accuracy_tests, tc) { -#if LDBL_MANT_DIG > 64 - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_expect_fail("https://bugs.freebsd.org/253984"); -#endif #if defined(__riscv) atf_tc_expect_death("https://bugs.freebsd.org/290099"); #endif @@ -260,6 +256,9 @@ ATF_TC_BODY(log1p_accuracy_tests, tc) 1.82321546859847114303367992804596800640e-1L, FLT_ULP()); test_tol(log1p, 0x0.3333333333333p0, 1.82321556793954589204283870982629267635e-1L, DBL_ULP()); +#if LDBL_MANT_DIG > 64 + atf_tc_expect_fail("https://bugs.freebsd.org/253984"); +#endif test_tol(log1pl, 0x0.33333333333333332p0L, 1.82321556793954626202683007050468762914e-1L, LDBL_ULP()); From nobody Wed Jun 17 17:15:35 2026 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 4ggVqW6Hb0z6hC4Y for ; Wed, 17 Jun 2026 17:15: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggVqW3KzLz3ZXR for ; Wed, 17 Jun 2026 17:15:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781716535; 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; bh=qUuVc8lALASfqNzosBMNQw61ZCVL2INrbcUY5sQjIRg=; b=FdfQLVVEK5dQVi35ArJ/1e7PnF4mVsGVENT0L01STTMvrFV8WxXAF06Q73Zh1lAmVPSVNG 37he79tMCj0vSU9MdFVs4rvNuvuVdNoUMJL8cWk1ENYAZvxoWtPf+GiH+qmokPC3szslyw HTNkSO6QqGYsK4yDMlchRUc7VNWza9k9rxXe9WCNHbWSyshYZeLi0eWNK6Jg+XL9viRSt5 NSROBWxUWpFEeqbjjnrjkHT6Fprkjsd7p8YFuBYy29C0g2gIWTcVuEMNuJksqrH86xbndt yYXXeccrQIgBrFgSymjYc8IMtHN4N01EFalU9ilznIIFc0sAClUqCqT0qGv8sg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781716535; a=rsa-sha256; cv=none; b=Q9XCVuHQ8Ub005lPi7yrcUh0u09FgyjTff88ryyTTwR2ay3MAfw4QqmlFZ03B/p2zUvCmq FABNTt8RNAt93DSGwYHmOnEAZdQshOLU2kA6wn1V1M/a6uqnYUFWPJTVIbQhXVk19RfQtT 11E4Hf40SyozjqFZgzqY9O+ToJFYvMSEoyBWpxQI35i/ai7FTVGyjDDo1ruoQ+0g0m1OZ8 TS+BIpGv7azrGIjT4nAGPdd23B27WyJGyxc868yWhSR5f7hROyZEA7FjZFy94WN0XPJPcq SvjfN1zshuZFRKH+ioZ1XxCejDblkpaNOIBB02rGPGVuitEk+e5oWKuH1oMTIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781716535; 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; bh=qUuVc8lALASfqNzosBMNQw61ZCVL2INrbcUY5sQjIRg=; b=MkWvXL426FdAtWpPoJxu1TdyxASM0mUDFzLXJnm+tB+F5lT0bMqjvoDTizRhAhAMdsN7kG 84LzPAiJf+2EiBumGtz63EuUoYYd9VrNDOVuoq3dcp85yoa6N8/cP0PyxAHQhdPhlp9hUp TIkWasJvw3mf6yiRUbcJkI8fr8YocdoxXowvBL3QKBZi3lCCDTzEBT6RkNi5OgzyzY2ZB/ eLoUy6t3Kf7T5rEBpUdjQS3PHm88tBg4uZFOQLvCxToge3Fa+0PyHi/ITYIsmoKs4aN+Ho bkw0EF5DeDO3MDA11TD3yBZRHwZzRFMm/MVts62OapMGhQyDAS+sPCl0XaJxsA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggVqW2vbGz5hd for ; Wed, 17 Jun 2026 17:15:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1cd31 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 17:15:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Matteo Riondato From: Alexander Ziaee Subject: git: 0bc852cc62af - main - tcp.fastopen.client_enable: Fix documented default 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0bc852cc62afcd79fc776f784623c3f2b7691d27 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 17:15:35 +0000 Message-Id: <6a32d637.1cd31.6ae43664@gitrepo.freebsd.org> The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=0bc852cc62afcd79fc776f784623c3f2b7691d27 commit 0bc852cc62afcd79fc776f784623c3f2b7691d27 Author: Matteo Riondato AuthorDate: 2026-06-17 14:59:01 +0000 Commit: Alexander Ziaee CommitDate: 2026-06-17 17:12:52 +0000 tcp.fastopen.client_enable: Fix documented default The default value has been 1 since June 2018, but the docs were not updated to reflect the change. MFC after: 3 days Reviewed by: ziaee Fixes: af4da5865557 (Enable TCP_FASTOPEN by default) Signed-off-by: Matteo Riondato Closes: https://github.com/freebsd/freebsd-src/pull/2285 --- share/man/man4/tcp.4 | 4 ++-- sys/netinet/tcp_fastopen.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index 8bc1eb858a07..425c1a6e5e89 100644 --- a/share/man/man4/tcp.4 +++ b/share/man/man4/tcp.4 @@ -31,7 +31,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 17, 2026 +.Dd June 17, 2026 .Dt TCP 4 .Os .Sh NAME @@ -589,7 +589,7 @@ On the transition from enabled to disabled, the client cookie cache is cleared and disabled. The transition from enabled to disabled does not affect any active TFO connections in progress; it only prevents new ones from being established. -The default is 0. +The default is 1. .It Va fastopen.keylen The key length in bytes. Read-only. diff --git a/sys/netinet/tcp_fastopen.c b/sys/netinet/tcp_fastopen.c index fb1386c03d22..4557a2c08cd2 100644 --- a/sys/netinet/tcp_fastopen.c +++ b/sys/netinet/tcp_fastopen.c @@ -84,7 +84,7 @@ * net.inet.tcp.fastopen.ccache_list (RO) * Print the client cookie cache. * - * net.inet.tcp.fastopen.client_enable (RW, default 0) + * net.inet.tcp.fastopen.client_enable (RW, default 1) * When zero, no new active (i.e., client) TFO connections can be * created. On the transition from enabled to disabled, the client * cookie cache is cleared and disabled. The transition from enabled to From nobody Wed Jun 17 18:23:49 2026 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 4ggXLF5pk3z6hJPq for ; Wed, 17 Jun 2026 18:23:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggXLF4mYVz3k6m for ; Wed, 17 Jun 2026 18:23:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781720629; 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; bh=GOdfcAN7cX2bPhdFY9jFI9mDvXQOhLuH0zN/FxSjYmo=; b=PQ5YQ9i7DVbYinSpe4ho5SZEu+BZkT/mRbyRHgFbpKOipSKPtsYz4ckdDCqNLE0bjKnuHD UUGy5UHnzc/ta59ZRqj1eB1HWQ+6W9DBz1jKg/CwZU5VqzQWz9RtwHShxCRaxzRh8drjgz KZlBM3o3WLx+MuDnXnNrvHRBuhUvZB7ZlEtuxOAKZbZ6/0T5PSn/85WLUkkKAiGd1aTMhs y+3/OiNLQH3gJG0ynNwrldHAyrRiu+g9kyy4A0sSbgeFjGyTCg3dRVcKa0kPyMWNXP/tZR OOuCft+LJHxErGxd6bpINriGw6QTejNntZeCXHTIhZykYUKwzkGAzhoTiEYSHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781720629; a=rsa-sha256; cv=none; b=iNhliG2QEEw9V7fvn7RCgJXutYPoIAdUzNZPyZ5Gpl4uzgvWlO8CPNYTq4R9U9z/NwJV3S rrmjWaZalQFf1xic5uE1K2uDVlgH1UzF5VRYhG90Z5YrxQvlKcZVsySjQbhgKKBGTI8s1n uO8wSHtHPWiPOkKiOKPkJIBvcHjr/4/FEm4YWOY56xGVBKN9Ywuoz9b4DnUh3NZ0SdQrbv x0SuT+1N92eV+CNq2SGIuBv9BK5kqUC94HgLOzZu1TuGwUr1UgsMRDeksKbIVCU6h66yPc t2gs10LMtUaIPlK3VnqxnVP/lZsWyya9vHKmsymAf0jcS5LsdAdB0TIGqJngNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781720629; 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; bh=GOdfcAN7cX2bPhdFY9jFI9mDvXQOhLuH0zN/FxSjYmo=; b=birhBuWGJA0u9IUDq3z9gpNQCCsv2tcgftT8hhR73IaJRQbI7PH7SOZ//VHK/UCbdlH1K3 10p9y4Kmepq8bNYQmAafoBNwbuGFDGIociRuLmwY/PkHlX602OONX075o8UMVyEwg2+KXP v1qwypUhZNe5QTTKRpXOEQqWYmn90MDUxpnEsfawiuV4zFN3SXpI6C4qrWCEGAghkKseu7 cC2cUumqqUwlCvoUBR+vGUX45nSKCtrScnIN+Yn81dvp+n8bCM75MmAoipIdNJYqUf6u/r dQScP3Ma8vC8cmqCNjcKr35P7KIdvxhYk8o3eausnfktQ8EPO07OLqn9DIByYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggXLF4KVsz7pC for ; Wed, 17 Jun 2026 18:23:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24c26 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 18:23:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Slava Shwartsman From: Konstantin Belousov Subject: git: e5d8b775bbf6 - main - RDMA: Fix link active_speed size 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: e5d8b775bbf6f378a591211e373859ec44f74149 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 18:23:49 +0000 Message-Id: <6a32e635.24c26.3632fed5@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e5d8b775bbf6f378a591211e373859ec44f74149 commit e5d8b775bbf6f378a591211e373859ec44f74149 Author: Slava Shwartsman AuthorDate: 2026-05-13 14:54:51 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-17 18:23:14 +0000 RDMA: Fix link active_speed size According to the IB spec active_speed size should be u16 and not u8 as before. Changing it to allow further extensions in offered speeds. Linux commit: 376ceb31ff87 RDMA: Fix link active_speed size Reviewed by: kib Tested by: Wafa Hamzah MFC after: 1 week Sponsored by: NVIDIA Networking Differential revision: https://reviews.freebsd.org/D57084 --- sys/dev/bnxt/bnxt_re/ib_verbs.c | 5 +++-- sys/dev/irdma/irdma_kcompat.c | 2 +- sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c | 6 +++--- sys/dev/qlnx/qlnxr/qlnxr_verbs.c | 2 +- sys/ofed/drivers/infiniband/core/ib_uverbs_std_types_device.c | 3 ++- sys/ofed/include/rdma/ib_verbs.h | 2 +- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/dev/bnxt/bnxt_re/ib_verbs.c b/sys/dev/bnxt/bnxt_re/ib_verbs.c index 32899abab9ff..9e6887a7c6e1 100644 --- a/sys/dev/bnxt/bnxt_re/ib_verbs.c +++ b/sys/dev/bnxt/bnxt_re/ib_verbs.c @@ -241,7 +241,7 @@ int bnxt_re_modify_device(struct ib_device *ibdev, return 0; } -static void __to_ib_speed_width(u32 espeed, u8 lanes, u8 *speed, u8 *width) +static void __to_ib_speed_width(u32 espeed, u8 lanes, u16 *speed, u8 *width) { if (!lanes) { switch (espeed) { @@ -342,7 +342,8 @@ int bnxt_re_query_port(struct ib_device *ibdev, u8 port_num, { struct bnxt_re_dev *rdev = to_bnxt_re_dev(ibdev, ibdev); struct bnxt_qplib_dev_attr *dev_attr = rdev->dev_attr; - u8 active_speed = 0, active_width = 0; + u16 active_speed = 0; + u8 active_width = 0; dev_dbg(rdev_to_dev(rdev), "QUERY PORT with port_num 0x%x\n", port_num); memset(port_attr, 0, sizeof(*port_attr)); diff --git a/sys/dev/irdma/irdma_kcompat.c b/sys/dev/irdma/irdma_kcompat.c index 51f44133252c..4d02bd08ca65 100644 --- a/sys/dev/irdma/irdma_kcompat.c +++ b/sys/dev/irdma/irdma_kcompat.c @@ -1634,7 +1634,7 @@ irdma_query_port(struct ib_device *ibdev, u8 port, props->state = IB_PORT_DOWN; props->phys_state = IB_PORT_PHYS_STATE_DISABLED; } - ib_get_eth_speed(ibdev, port, (u16 *)& props->active_speed, &props->active_width); + ib_get_eth_speed(ibdev, port, &props->active_speed, &props->active_width); if (rdma_protocol_roce(ibdev, 1)) { props->gid_tbl_len = 32; diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c index 5825cee87d9b..6ff4e55630d7 100644 --- a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c +++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c @@ -155,7 +155,7 @@ static if_t mlx5_ib_get_netdev(struct ib_device *device, return ndev; } -static int translate_eth_proto_oper(u32 eth_proto_oper, u8 *active_speed, +static int translate_eth_proto_oper(u32 eth_proto_oper, u16 *active_speed, u8 *active_width) { switch (eth_proto_oper) { @@ -216,7 +216,7 @@ static int translate_eth_proto_oper(u32 eth_proto_oper, u8 *active_speed, return 0; } -static int translate_eth_ext_proto_oper(u32 eth_proto_oper, u8 *active_speed, +static int translate_eth_ext_proto_oper(u32 eth_proto_oper, u16 *active_speed, u8 *active_width) { switch (eth_proto_oper) { @@ -969,7 +969,7 @@ static int mlx5_query_hca_port(struct ib_device *ibdev, u8 port, if (err) goto out; - props->active_speed = (u8)ptys->ib_proto_oper; + props->active_speed = (u16)ptys->ib_proto_oper; pmtu->local_port = port; err = mlx5_core_access_pmtu(mdev, pmtu, 0); diff --git a/sys/dev/qlnx/qlnxr/qlnxr_verbs.c b/sys/dev/qlnx/qlnxr/qlnxr_verbs.c index d74f51831da7..f3a054c707c3 100644 --- a/sys/dev/qlnx/qlnxr/qlnxr_verbs.c +++ b/sys/dev/qlnx/qlnxr/qlnxr_verbs.c @@ -546,7 +546,7 @@ qlnxr_query_device(struct ib_device *ibdev, struct ib_device_attr *attr, } static inline void -get_link_speed_and_width(int speed, uint8_t *ib_speed, uint8_t *ib_width) +get_link_speed_and_width(int speed, uint16_t *ib_speed, uint8_t *ib_width) { switch (speed) { case 1000: diff --git a/sys/ofed/drivers/infiniband/core/ib_uverbs_std_types_device.c b/sys/ofed/drivers/infiniband/core/ib_uverbs_std_types_device.c index 5d45a22eb9fe..a245cbdd440e 100644 --- a/sys/ofed/drivers/infiniband/core/ib_uverbs_std_types_device.c +++ b/sys/ofed/drivers/infiniband/core/ib_uverbs_std_types_device.c @@ -153,7 +153,8 @@ void copy_port_attr_to_resp(struct ib_port_attr *attr, resp->subnet_timeout = attr->subnet_timeout; resp->init_type_reply = attr->init_type_reply; resp->active_width = attr->active_width; - resp->active_speed = attr->active_speed; + /* This ABI needs to be extended to provide any speed more than IB_SPEED_NDR */ + resp->active_speed = min_t(u16, attr->active_speed, IB_SPEED_NDR); resp->phys_state = attr->phys_state; resp->link_layer = rdma_port_get_link_layer(ib_dev, port_num); } diff --git a/sys/ofed/include/rdma/ib_verbs.h b/sys/ofed/include/rdma/ib_verbs.h index 0c40a6f18f7c..0908c106f513 100644 --- a/sys/ofed/include/rdma/ib_verbs.h +++ b/sys/ofed/include/rdma/ib_verbs.h @@ -609,7 +609,7 @@ struct ib_port_attr { u8 subnet_timeout; u8 init_type_reply; u8 active_width; - u8 active_speed; + u16 active_speed; u8 phys_state; bool grh_required; }; From nobody Wed Jun 17 18:23:50 2026 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 4ggXLH1bRgz6hJPr for ; Wed, 17 Jun 2026 18:23: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggXLG5WJjz3kFj for ; Wed, 17 Jun 2026 18:23:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781720630; 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; bh=tdeLHmg+3HYbKxQ/+bsvc6U4USPUXop5z3O1RM1YPdM=; b=WozQfyCBr49VmNc8nfOiJVE/NN80LaICCWTy8DVUkzedEdem8qY3r44vDDaoSsWabFvMvb n7Xakx5o4W4gOwXJtijrobKylZU9+epXwNrZJ8FBIS5BA8ehxWtRZcRSG2EuzxtTcSsjPZ 5pSbl+OsgzPhk3OaDXkJzCZtohtoVlB20w7pqX1hsindSSvNPkpZqkYUuuRsMWbpf54sEg aaP0j8UNdLYIJSN2ZY6zTCHGmO9lQn7BpYk4KMJb1eTAEmLtlG3R0hJ8V3IUP+BrnIg/NQ 2askIOD6fet8CyBLi74w5D6E0nXhdzkvX7NkJwXMOPKzsar92jAmkzp24ZYBWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781720630; a=rsa-sha256; cv=none; b=GNks4TmcyMHlqAeExLZTihrPWcz/9Nimq6Vzs8enbSgmhdkp5LftNeuS9PfK521xtuGSMG PMz66gHtweChA4j9mQ3xgB2bSXJFjittcdoetDj2i1ZwQBOpIbEa5oz23RsW/YzVQ70QJS Y1eTuuMfM+12XEpFydAjzNsZCqGVXQbWQtYfvbAYAD+ZfCaDM0bDVwUxpSA7mr7v0txncj HdbCEYa5fXUuyPL+PE86M5mQ8q6yj0Zecfc+tta3WicnXgU8mYBiCxTyNa+GbA0dOmrQk9 1dxHRCaydMbLggtv8Vmc+HgHDOUlZTUXhpTNRm24pGwO6A9IF8eboff6EqtJYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781720630; 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; bh=tdeLHmg+3HYbKxQ/+bsvc6U4USPUXop5z3O1RM1YPdM=; b=sAK+2j3hJSSYIXIgwdqq6kX1qUEAXDsTyJ1QHE9ufHw47ZrtBr+1n5GjUg57XJbMNt7Erc CjCkVzurU4Kw1SqEgD9+2LwWdO073NT5cPFP/PnejIEBO+mtPoDAc21Q7lEr3j/P1gNwsK /y8AwYhg4RVCnojLzJ/eNswL3vaY58Rlx/sETnTM3UTT9UPnrcbYKUfiNq6IDidM6FyAtz CVfxfDsgJgN5Afd+S0hnfBKYvBuscQyi7mosP8wNTYhaVZ6eTa6SoBbiIYK6IZT1RZdOMT nqEev2ejl/0/J2pMrIwwgohKNYt8GhFwhfeXeCyxZGoGDMzOP7OqJsYqblebeg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggXLG55xQz7CG for ; Wed, 17 Jun 2026 18:23:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 246d6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 18:23:50 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Slava Shwartsman From: Konstantin Belousov Subject: git: b3c09af215ee - main - ibcore: Add support for XDR link speed. 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: b3c09af215ee4803fa67ca94301f662d5eca03a0 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 18:23:50 +0000 Message-Id: <6a32e636.246d6.14053416@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b3c09af215ee4803fa67ca94301f662d5eca03a0 commit b3c09af215ee4803fa67ca94301f662d5eca03a0 Author: Slava Shwartsman AuthorDate: 2026-05-13 14:20:35 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-17 18:23:14 +0000 ibcore: Add support for XDR link speed. Add new IBTA speed XDR, supporting signaling rate of 200Gb. Reviewed by: kib Tested by: Wafa Hamzah MFC after: 1 week Sponsored by: NVIDIA Networking Differential revision: https://reviews.freebsd.org/D57085 --- sys/ofed/drivers/infiniband/core/ib_sysfs.c | 4 ++++ sys/ofed/include/rdma/ib_verbs.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/ofed/drivers/infiniband/core/ib_sysfs.c b/sys/ofed/drivers/infiniband/core/ib_sysfs.c index 35451857d16d..e28cd48085a8 100644 --- a/sys/ofed/drivers/infiniband/core/ib_sysfs.c +++ b/sys/ofed/drivers/infiniband/core/ib_sysfs.c @@ -279,6 +279,10 @@ static ssize_t rate_show(struct ib_port *p, struct port_attribute *unused, speed = " NDR"; rate = 1000; break; + case IB_SPEED_XDR: + speed = " XDR"; + rate = 2000; + break; case IB_SPEED_SDR: default: /* default to SDR for invalid rates */ speed = " SDR"; diff --git a/sys/ofed/include/rdma/ib_verbs.h b/sys/ofed/include/rdma/ib_verbs.h index 0908c106f513..086251183a55 100644 --- a/sys/ofed/include/rdma/ib_verbs.h +++ b/sys/ofed/include/rdma/ib_verbs.h @@ -488,7 +488,8 @@ enum ib_port_speed { IB_SPEED_FDR = 16, IB_SPEED_EDR = 32, IB_SPEED_HDR = 64, - IB_SPEED_NDR = 128 + IB_SPEED_NDR = 128, + IB_SPEED_XDR = 256, }; /** From nobody Wed Jun 17 18:23:51 2026 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 4ggXLJ2sw0z6hJhF for ; Wed, 17 Jun 2026 18:23: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggXLH6RfVz3kL0 for ; Wed, 17 Jun 2026 18:23:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781720631; 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; bh=WhUyhPdUVagk2dAXsmJ0ktAKjNdnFVSoB2+4TLm3xvg=; b=VZAtW4kgTXHtI3DRShixdPpsQ/6lK+A5q30rn/MSw5GSvvXppoBYfqKJiaIb3LkD8Zqm5M fTAuTpu2rY9oM1TKN4IE4dVm0dFG1pBz7erN9EER6wx60V0e+Iz03J6hOQZRjyK06OhZoi vG9pgRm5GaNi8RmTFDoRk7JhxgzPiOQWp6cxyTNkVJaMn0rGEAxayFKTw1SWlI/kdcm2vu M+aZrTclKrMRdsM5arH/ZcpfAov04S5y/VusEhLjBW5pcVtKVmq5ZeztA2PoDGS1EEiUqg H3OPGoqLWLd6QHnMeZRhriXnTXr8zemic6Dipz9+TQkGA+KNs21NoqOcePly/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781720631; a=rsa-sha256; cv=none; b=khIXkks6K7hFWrQN0YgxrUp4hkHex29uRkaLd8IIL2XHu6qo2T2IxypuBRDMT//RNfR/sN Cj67gqwLaTUx3Txhd1xpsIm3djoM5J40qHw0LSaFXxhWBPl5hCa1XmbGaBCpBK++DhqqoZ zT7sKqfiDR2q399KMggkRO6Cn7mBuxcDk3uA57EAVBM9j86ucjQPqQKGgW+6SsrtKzpfZh nTgJlXBALo5I12QNQffUgf39MhUXho76RkIVw6X/QE44yppzx1bMj0VailYMYNW7ekrHWt XBa3iB0Om9zh9N4l9Csh1Vt28/S38y/nGAwI2jkSGMtorE2S1HvIrxPq05iPOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781720631; 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; bh=WhUyhPdUVagk2dAXsmJ0ktAKjNdnFVSoB2+4TLm3xvg=; b=WgUYtmz0eMx3y4PYlRaoCWa+935X5q6vrDsp7IyGClp67Jvg/yHCD7mDIwlfuSX1LzbhDT L7NP5tk9KmXYEevQ/ANGR+65ILnrjmsEDEuWyECsEjTYrVN1gJ0JZJ+/d80qWbAIPiDSLT qxHOVUZKnpmx06+xketVBYgAajyFl3kUD8N5tGJYyZ8ZI29upZgLQ2QK1xK5dTd2Ek54gp t56ncVx5txrJfGOuhhyhqteLbKbI/xBHcQa93d2zoJW/UHqCkFyCIHGzk4t5VCGYOqtNDW 1FqKKHIfmjGOsnkS+a5MBqwi47pHc4pzZVJ4qZYNYDExS1znpKPMJ7k8cZNaLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggXLH5zFXz7JH for ; Wed, 17 Jun 2026 18:23:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 238d2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 18:23:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Slava Shwartsman From: Konstantin Belousov Subject: git: 3e4cbdebfc9b - main - mlx5: Add support for 800Gbit/s and 400Gbit/s with 2 lanes 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 3e4cbdebfc9bcb2f2c64acc8ee8f67c3383cd676 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 18:23:51 +0000 Message-Id: <6a32e637.238d2.5edf3a04@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3e4cbdebfc9bcb2f2c64acc8ee8f67c3383cd676 commit 3e4cbdebfc9bcb2f2c64acc8ee8f67c3383cd676 Author: Slava Shwartsman AuthorDate: 2026-05-13 14:22:48 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-17 18:23:14 +0000 mlx5: Add support for 800Gbit/s and 400Gbit/s with 2 lanes Reviewed by: kib Tested by: Wafa Hamzah MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/mlx5/mlx5_core/mlx5_port.c | 4 ++++ sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 44 +++++++++++++++++++++++++++++++++++++ sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c | 12 ++++++++++ sys/dev/mlx5/port.h | 3 +++ 4 files changed, 63 insertions(+) diff --git a/sys/dev/mlx5/mlx5_core/mlx5_port.c b/sys/dev/mlx5/mlx5_core/mlx5_port.c index af01bfae1b4e..fc192ec6a23b 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_port.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_port.c @@ -1331,6 +1331,10 @@ static const u32 mlx5e_ext_link_speed[/*MLX5E_EXT_LINK_MODES_NUMBER*/] = { [MLX5E_CAUI_4_100GBASE_CR4_KR4] = 100000, [MLX5E_200GAUI_4_200GBASE_CR4_KR4] = 200000, [MLX5E_400GAUI_8] = 400000, + [MLX5E_400GAUI_4_400GBASE_CR4_KR4] = 400000, + [MLX5E_400GAUI_2_400GBASE_CR2_KR2] = 400000, + [MLX5E_800GAUI_8_800GBASE_CR8_KR8] = 800000, + [MLX5E_800GAUI_4_800GBASE_CR4_KR4] = 800000, }; static void mlx5e_port_get_speed_arr(struct mlx5_core_dev *mdev, diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index fb8b79c8f787..35450776e54e 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -352,6 +352,48 @@ static const struct media mlx5e_ext_mode_table[MLX5E_EXT_LINK_SPEEDS_NUMBER][MLX .subtype = IFM_400G_LR8, /* XXX */ .baudrate = IF_Gbps(400ULL), }, + + /**/ + [MLX5E_400GAUI_2_400GBASE_CR2_KR2][MLX5E_PORT_UNKNOWN] = { + .subtype = IFM_400G_KR2_PAM4, + .baudrate = IF_Gbps(400ULL), + }, + [MLX5E_400GAUI_2_400GBASE_CR2_KR2][MLX5E_PORT_DA] = { + .subtype = IFM_400G_CR2, + .baudrate = IF_Gbps(400ULL), + }, + [MLX5E_400GAUI_2_400GBASE_CR2_KR2][MLX5E_PORT_FIBRE] = { + .subtype = IFM_400G_SR2, + .baudrate = IF_Gbps(400ULL), + }, + + /**/ + [MLX5E_800GAUI_8_800GBASE_CR8_KR8][MLX5E_PORT_UNKNOWN] = { + .subtype = IFM_800G_KR8, /* 800GAUI-8 / KR8a */ + .baudrate = IF_Gbps(800ULL), + }, + [MLX5E_800GAUI_8_800GBASE_CR8_KR8][MLX5E_PORT_DA] = { + .subtype = IFM_800G_CR8, /* 800GBASE-CR8 */ + .baudrate = IF_Gbps(800ULL), + }, + [MLX5E_800GAUI_8_800GBASE_CR8_KR8][MLX5E_PORT_FIBRE] = { + .subtype = IFM_800G_SR8, + .baudrate = IF_Gbps(800ULL), + }, + + /**/ + [MLX5E_800GAUI_4_800GBASE_CR4_KR4][MLX5E_PORT_UNKNOWN] = { + .subtype = IFM_800G_KR4_PAM4, /* 800GAUI-4 / KR4 */ + .baudrate = IF_Gbps(800ULL), + }, + [MLX5E_800GAUI_4_800GBASE_CR4_KR4][MLX5E_PORT_DA] = { + .subtype = IFM_800G_CR4, /* 800GBASE-CR4 */ + .baudrate = IF_Gbps(800ULL), + }, + [MLX5E_800GAUI_4_800GBASE_CR4_KR4][MLX5E_PORT_FIBRE] = { + .subtype = IFM_800G_SR4, + .baudrate = IF_Gbps(800ULL), + }, }; static const struct if_snd_tag_sw mlx5e_ul_snd_tag_sw = { @@ -404,6 +446,8 @@ mlx5e_update_carrier(struct mlx5e_priv *priv) eth_proto_oper = MLX5_GET_ETH_PROTO(ptys_reg, out, ext, eth_proto_oper); connector_type = MLX5_GET(ptys_reg, out, connector_type); + if (connector_type >= MLX5E_CONNECTOR_TYPE_NUMBER) + connector_type = MLX5E_PORT_UNKNOWN; i = ilog2(eth_proto_oper); if (ext) { diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c index 6ff4e55630d7..cf1e5f4324d8 100644 --- a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c +++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c @@ -273,6 +273,18 @@ static int translate_eth_ext_proto_oper(u32 eth_proto_oper, u16 *active_speed, *active_width = IB_WIDTH_4X; *active_speed = IB_SPEED_NDR; break; + case MLX5E_PROT_MASK(MLX5E_400GAUI_2_400GBASE_CR2_KR2): + *active_width = IB_WIDTH_2X; + *active_speed = IB_SPEED_XDR; + break; + case MLX5E_PROT_MASK(MLX5E_800GAUI_8_800GBASE_CR8_KR8): + *active_width = IB_WIDTH_8X; + *active_speed = IB_SPEED_NDR; + break; + case MLX5E_PROT_MASK(MLX5E_800GAUI_4_800GBASE_CR4_KR4): + *active_width = IB_WIDTH_4X; + *active_speed = IB_SPEED_XDR; + break; default: *active_width = IB_WIDTH_4X; *active_speed = IB_SPEED_QDR; diff --git a/sys/dev/mlx5/port.h b/sys/dev/mlx5/port.h index a35265852ae4..6c1e6e629856 100644 --- a/sys/dev/mlx5/port.h +++ b/sys/dev/mlx5/port.h @@ -125,6 +125,9 @@ enum mlx5e_ext_link_speed { MLX5E_200GAUI_2_200GBASE_CR2_KR2 = 13, MLX5E_400GAUI_8 = 15, MLX5E_400GAUI_4_400GBASE_CR4_KR4 = 16, + MLX5E_400GAUI_2_400GBASE_CR2_KR2 = 17, + MLX5E_800GAUI_8_800GBASE_CR8_KR8 = 19, + MLX5E_800GAUI_4_800GBASE_CR4_KR4 = 20, MLX5E_EXT_LINK_SPEEDS_NUMBER = 32, }; From nobody Wed Jun 17 18:23:52 2026 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 4ggXLK3Ws1z6hJKG for ; Wed, 17 Jun 2026 18:23: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggXLK0NTlz3jmb for ; Wed, 17 Jun 2026 18:23:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781720633; 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; bh=J2C7BUvAqBWIo4WnVdB+ABBTHm4R3blQfj2dg9Oh+iY=; b=smAkxvu4HAIO3/Eko0UygO/+J2tbgCz3/yk66eEegpO8nGTfqgBKsWRyB8IWWiU6aYTJYI j2WQi/T6+i8cBCqcWvYE7DeAmh61yHNJbkF1yDIg+I/HTiTa8vxlcC5sAFVR+k6lhrKfCU nwRF4mvbHji9DmcULaRTk5TJm5EV1ptwU3IQNoU0DkmdPkcNGiWIQaH751efWdFSTdr1x2 IgPXnmQiHOXjnmZVZxBaJw8FE48EbF+4T9PKf6n8z0D7G9fFUA2O2wmsjG9ZCqYaVNoD8s Sx1kkFAT0yO4mSKk4NlHGdjD8IPh2Mv3RWU3QeUkSwq2wQ4iFYIfB6ee4/2fsg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781720633; a=rsa-sha256; cv=none; b=T5JtDf6xriZUVYty5bU5FAwE5wl6vdSw5E3KumA/KZYfAvG1/h2m3BTAM49VKkXYqBgYbj tp8fwJn1Rh+hsA1hIktBPmNlXL7mU8/R0Xr6iV1jbPFIFA8pEpauo6g9HgcNwrRHudmLme 3ukwPXeYC5k9Vb4NQUXlqLwDdpQ2ErbYtFLc9U7gHUQ2y07+Axd9IagCNhjrryNDgCyTts 2OTqeZPR2kgOdpVQim7yR/s6JSS7rDAU5OaRF1A1n82+vLxrx84zNoH1SlmzAYups64egK O1rf94VabRmOwTBtB0yX4euiN9y6jaMZKdfHuyAL88kTI8VRbjSfZT8XewjjJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781720633; 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; bh=J2C7BUvAqBWIo4WnVdB+ABBTHm4R3blQfj2dg9Oh+iY=; b=AJK2kxN3NUX1fJcauN2ys129Ipva/uHjoCR+t26jRDO6enxwvdesRWm9rq2ghlpcjPtzyK 2NUCKxBfTtjTbiC8oJw9M8xKr2jnAnQ9jGm5LZWbmkbUmgNsD8z7gD/WK/y1NnFj/dKWfk oFrrNFAHDMUxu3gdP+SHzcVA5p2T7/XJbIzpk209qqu7BOMridkL5ApGBmE12WXmjGAhVy wMmfF7kMV2ZZjUjv27OapaIlPSBSKutQbbD3/hUYeEU8JxAmMPMws+apJQkx9vTnmLKFYV elhjJt6DqTZ3mCVb7tlpujVNUleh4BqLPZCxszg9E6FElP0Rc3LmWS2pgSmibA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggXLJ6lLJz7CH for ; Wed, 17 Jun 2026 18:23:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 243fb by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 18:23:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Slava Shwartsman From: Konstantin Belousov Subject: git: 741f489ed09a - main - mlx5: Add PCI IDs for ConnectX-9. 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 741f489ed09ab1d9172d1f61aa341004b5c3e968 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 18:23:52 +0000 Message-Id: <6a32e638.243fb.b6dc93e@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=741f489ed09ab1d9172d1f61aa341004b5c3e968 commit 741f489ed09ab1d9172d1f61aa341004b5c3e968 Author: Slava Shwartsman AuthorDate: 2026-05-04 07:29:18 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-17 18:23:14 +0000 mlx5: Add PCI IDs for ConnectX-9. - Add descriptions for ConnectX-9. - Add ConnectX-9 for libmlx5 Reviewed by: kib Tested by: Wafa Hamzah Sponsored by: Nvidia networking MFC after: 1 week --- contrib/ofed/libmlx5/mlx5.c | 1 + sys/dev/mlx5/mlx5_core/mlx5_main.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/ofed/libmlx5/mlx5.c b/contrib/ofed/libmlx5/mlx5.c index f55be7dae45e..6b1cb770ddd8 100644 --- a/contrib/ofed/libmlx5/mlx5.c +++ b/contrib/ofed/libmlx5/mlx5.c @@ -84,6 +84,7 @@ static struct { HCA(MELLANOX, 4127), /* ConnectX-6 LX */ HCA(MELLANOX, 4129), /* ConnectX-7 */ HCA(MELLANOX, 4131), /* ConnectX-8 */ + HCA(MELLANOX, 4133), /* ConnectX-9 */ HCA(MELLANOX, 41682), /* BlueField integrated ConnectX-5 network controller */ HCA(MELLANOX, 41683), /* BlueField integrated ConnectX-5 network controller VF */ HCA(MELLANOX, 41686), /* BlueField-2 integrated ConnectX-6 Dx network controller */ diff --git a/sys/dev/mlx5/mlx5_core/mlx5_main.c b/sys/dev/mlx5/mlx5_core/mlx5_main.c index 221781327b51..058085348a3f 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_main.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_main.c @@ -2126,7 +2126,7 @@ static const struct pci_device_id mlx5_core_pci_table[] = { { PCI_VDEVICE(MELLANOX, 4130) }, { PCI_VDEVICE(MELLANOX, 4131) }, /* ConnectX-8 */ { PCI_VDEVICE(MELLANOX, 4132) }, - { PCI_VDEVICE(MELLANOX, 4133) }, + { PCI_VDEVICE(MELLANOX, 4133) }, /* ConnectX-9 */ { PCI_VDEVICE(MELLANOX, 4134) }, { PCI_VDEVICE(MELLANOX, 4135) }, { PCI_VDEVICE(MELLANOX, 4136) }, From nobody Wed Jun 17 18:23:54 2026 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 4ggXLL5c3Dz6hJQ7 for ; Wed, 17 Jun 2026 18:23: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggXLL0ys8z3jnm for ; Wed, 17 Jun 2026 18:23:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781720634; 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; bh=xbtaMezyxu0M0+yOBi/TPh0qYffnMxXUw59UNqI4x3w=; b=Py+mjkiAret4XDlw+r9ISCfx6S0PoeCF7b93Bqlmgo/J1jcGIlGtQ0TZaaIfZhXsUF5hwz rP5PLg89VGfc0m32telQT8ax4i6SH+KUTaQf7BUpbY9qJz4Lojq4RbXXFppTYKEuK9Eh4K 4al+fbb9BSPreAQqq0D1zVQAoEXP2f+QdMjlseDu0d4CcM6nj+/6DMr8mWe9g6as2t7+G5 Uk02OhTGEk7z76Yy3RQ1V75pzoOcJPD0qF9HruW5Bs1HXZUMRbuuzqwDj/qJZ1CWh/zPyZ Q8xLXQZBVWDO+C0QPv+Lh1TCtT1Nk8rP3SBiExIl/oyaUeLmbqehtGY2dccZNg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781720634; a=rsa-sha256; cv=none; b=WE75VH6ijL35Ajs7+unDcrx70ZhdX0HO6pJHzQpslY1yfeQ2DUzoWaKyxm2JXhw/ETApZ6 pqqSUflyBBjGlHlTZaV5y/Nraeb4kxJCxCJyAayi3/hk8dXkEnxBAI1S03k/hFN2k7V2JH NXtp0G+bqX9Eb9UrPT+LsvYMRibW5RqVFGtZtxySHoWVAK1UmMpUOlN7c9Tr8WeZuT9+mO 03zZpCVnD0JO8HG0XMg1sAWBoQOp2P0PnMXnfHrDaa8ciAfdgrdqWFqYQ9QD/DPponmyoj Tbk8CPTaynnildwoEV9eSxOlxtwB5v7qWeH3h+apxXBU9THCdcEWpfRl5WH4Ow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781720634; 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; bh=xbtaMezyxu0M0+yOBi/TPh0qYffnMxXUw59UNqI4x3w=; b=WOwNzZ0m93XHIGjhBnNH5O9Ryco/voKW8XsV2xJvG60t36ltSGHPm+zUK5qq8cI3d1IxNv zTnb4IeOkZORunyVZQEUst5e3aI36Xkilkvc/ql/JcJxPeKiGhnJkqDnWFdyzyZj1NItZD Otn8zzY8Q3oULJlkZF9w5QKpn51dZgIyKRH2zYk17px3hm99mKsGHB41eQqgpnPGKCvQCl bJrCPbSIYtE6zjMgFa0zL/Grka4H8qkAHB6xoq4RNqSuSpe/9ZKK4uaTVDovxLczZrw+cU o5kP6NwuCPRqPlTF8eETB9vSPSAgAa8191NnFyd5GwJBNvBrb0Y/vWvipUOILg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggXLL0TyGz6pH for ; Wed, 17 Jun 2026 18:23:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 244a9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 18:23:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Slava Shwartsman From: Konstantin Belousov Subject: git: 0e2175cef502 - main - libmlx5: sync PCI device allowlist with mlx5_core_pci_table 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 0e2175cef5027728c0ca1ff98366cf6ecfbe2db3 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 18:23:54 +0000 Message-Id: <6a32e63a.244a9.6331f0a6@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0e2175cef5027728c0ca1ff98366cf6ecfbe2db3 commit 0e2175cef5027728c0ca1ff98366cf6ecfbe2db3 Author: Slava Shwartsman AuthorDate: 2026-05-04 11:19:36 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-17 18:23:14 +0000 libmlx5: sync PCI device allowlist with mlx5_core_pci_table Userspace mlx5_driver_init() only attached when vendor/device matched hca_table, while the kernel already probed additional Mellanox PCI IDs That mismatch prevented libibverbs from loading the mlx5 provider on those HCAs. Extend hca_table to mirror mlx5_core_pci_table and add cross-references so future kernel ID additions are paired with a userspace update. Reviewed by: kib Tested by: Wafa Hamzah Sponsored by: Nvidia networking MFC after: 1 week --- contrib/ofed/libmlx5/mlx5.c | 19 +++++++++++++++++++ sys/dev/mlx5/mlx5_core/mlx5_main.c | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/contrib/ofed/libmlx5/mlx5.c b/contrib/ofed/libmlx5/mlx5.c index 6b1cb770ddd8..6fe6cf594c3b 100644 --- a/contrib/ofed/libmlx5/mlx5.c +++ b/contrib/ofed/libmlx5/mlx5.c @@ -67,6 +67,11 @@ static struct { unsigned vendor; unsigned device; } hca_table[] = { + /* + * PCI IDs must match mlx5_core_pci_table in + * sys/dev/mlx5/mlx5_core/mlx5_main.c so userspace loads for every + * mlx5 device the kernel probes. + */ HCA(MELLANOX, 4113), /* MT4113 Connect-IB */ HCA(MELLANOX, 4114), /* Connect-IB Virtual Function */ HCA(MELLANOX, 4115), /* ConnectX-4 */ @@ -82,9 +87,23 @@ static struct { HCA(MELLANOX, 4125), /* ConnectX-6 DX */ HCA(MELLANOX, 4126), /* ConnectX family mlx5Gen Virtual Function */ HCA(MELLANOX, 4127), /* ConnectX-6 LX */ + HCA(MELLANOX, 4128), HCA(MELLANOX, 4129), /* ConnectX-7 */ + HCA(MELLANOX, 4130), HCA(MELLANOX, 4131), /* ConnectX-8 */ + HCA(MELLANOX, 4132), HCA(MELLANOX, 4133), /* ConnectX-9 */ + HCA(MELLANOX, 4134), + HCA(MELLANOX, 4135), + HCA(MELLANOX, 4136), + HCA(MELLANOX, 4137), + HCA(MELLANOX, 4138), + HCA(MELLANOX, 4139), + HCA(MELLANOX, 4140), + HCA(MELLANOX, 4141), + HCA(MELLANOX, 4142), + HCA(MELLANOX, 4143), + HCA(MELLANOX, 4144), HCA(MELLANOX, 41682), /* BlueField integrated ConnectX-5 network controller */ HCA(MELLANOX, 41683), /* BlueField integrated ConnectX-5 network controller VF */ HCA(MELLANOX, 41686), /* BlueField-2 integrated ConnectX-6 Dx network controller */ diff --git a/sys/dev/mlx5/mlx5_core/mlx5_main.c b/sys/dev/mlx5/mlx5_core/mlx5_main.c index 058085348a3f..184457b7d0b5 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_main.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_main.c @@ -2105,6 +2105,10 @@ static void shutdown_one(struct pci_dev *pdev) mlx5_pci_disable_device(dev); } +/* + * When adding device IDs, also update hca_table in + * contrib/ofed/libmlx5/mlx5.c or libibverbs will reject the device. + */ static const struct pci_device_id mlx5_core_pci_table[] = { { PCI_VDEVICE(MELLANOX, 4113) }, /* Connect-IB */ { PCI_VDEVICE(MELLANOX, 4114) }, /* Connect-IB VF */ From nobody Wed Jun 17 18:23:48 2026 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 4ggXLK64yJz6hJP4 for ; Wed, 17 Jun 2026 18:23: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggXLK4J0lz3k8y for ; Wed, 17 Jun 2026 18:23:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781720633; 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; bh=j8BAW8WAUXnPz1pdGB3TbVS0kLpdrQ4WYwMYSoqNKco=; b=Puf9fyWl3eWxBQAQ791QlCMcCnUixUmRmKTa1lQj7hlJK4BNHcjzLil3QTxyYLkVjauzM/ 1jYhz+QJIWctRIIU6ZYvODl6QyqAwh+9ckpodw/MLWKbmW1WwUdf48lnqlIFqMYO+W+X8+ gJty+XVPMKQpVR/+crbmVImQ774E3u+U1l8fhAPqcH6TqJpHhUtSrYrXe3HfiTwpVCe0k4 4tLW4smP4146SMethngZ8UVF5FXztMy/UYUuVjLXnAWQcVYttkKZOfvTPNCx+EEwF83ZGo 2c90HkEvnvw19rqsn+HHb7j01QjnSBUPQAisQfz5uZsQUZaGPlHCltzAgsQaIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781720633; a=rsa-sha256; cv=none; b=pc8bU2GFFwAdmxMBC+63e4OppoIoU8ZPV8AD0XZe4k9uZBBrhi8GHnD5Km9yqfiXVG+vlE P7AWOjs6TORAsYfahvj9JciiI/cc/BqJaWDglXPJRRJMZQO+7AAinpSFhhDfP7qRguSVF4 iQmJkF50WLrM5hwkND2NRlri2szoZ6XawhROHnYrdOYyKAHKFsUsR9pepYQNCvjzAT69wp FCwFtWFEo7AQmRnUMx8rO5FZTGcCKKVDpZpantTDyBgTXYaBekuXZddyvBu8UDADPZFI58 T9Okg9k0MFF99vju2JBpENuUDek7VWgNdfR8EkeRwZZ0EleTtAo3gVmR7WhPeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781720633; 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; bh=j8BAW8WAUXnPz1pdGB3TbVS0kLpdrQ4WYwMYSoqNKco=; b=cT7pa41p5HfzJcCVrqb/SPdX/r7JvM3W+qUYNCBs4JF4VEVlB5lSoQuNFOBrCluhkz1vmy CxbuPz5GgBdYBPQm0Jayjep/x56J2RlnlpNv+LMITb5h3ejkZy87chowpP42tPbUkRdfun ls4JcajdnFcqHbm9cyKRrrdnkYof3I+kI6auqW00lphz8uG1eMjTOpHsb5Po7djTXpl5F9 SJJ4LzyQmw42KBWOmD/E2Rj1oqfTOQb/198v0Ln9uHFESCjXYHxRXdiDLMgfbllSQGZbGk ncamdwGXo5D9jKt/IEJaIq0MPGOd6HHJuQO12UHkjQ7OPxtPb5/rFUClsexsiQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggXLK3v5mz6pG for ; Wed, 17 Jun 2026 18:23:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24610 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 18:23:48 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Slava Shwartsman From: Konstantin Belousov Subject: git: 51f313dbc7a2 - main - net/if_media.h: Add 800GBase-X and 200Gbit/s per lane 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 51f313dbc7a28a7bd2013c205261f29f115eb0a7 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 18:23:48 +0000 Message-Id: <6a32e634.24610.4a811d49@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=51f313dbc7a28a7bd2013c205261f29f115eb0a7 commit 51f313dbc7a28a7bd2013c205261f29f115eb0a7 Author: Slava Shwartsman AuthorDate: 2026-05-13 10:10:50 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-17 18:23:14 +0000 net/if_media.h: Add 800GBase-X and 200Gbit/s per lane support Reviewed by: kib Tested by: Wafa Hamzah MFC after: 1 week Sponsored by: Nvidia networking Differential revision: https://reviews.freebsd.org/D57083 --- sys/net/ieee8023ad_lacp.c | 3 +++ sys/net/if_media.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c index 99eee570c2a2..5d5fc88f205f 100644 --- a/sys/net/ieee8023ad_lacp.c +++ b/sys/net/ieee8023ad_lacp.c @@ -1198,6 +1198,9 @@ lacp_compose_key(struct lacp_port *lp) case IF_Gbps(400): key = 14; break; + case IF_Gbps(800): + key = 15; + break; default: key = subtype; if (!warned) { diff --git a/sys/net/if_media.h b/sys/net/if_media.h index 5cc8714219c8..5e2548d844c9 100644 --- a/sys/net/if_media.h +++ b/sys/net/if_media.h @@ -264,6 +264,20 @@ uint64_t ifmedia_baudrate(int); #define IFM_400G_CR8 IFM_X(123) /* 400GBase-CR8 */ #define IFM_10_T1S IFM_X(124) /* 10BASE-T1S */ #define IFM_10_T1L IFM_X(125) /* 10BASE-T1L */ +#define IFM_400G_KR2_PAM4 IFM_X(126) /* 400GBase-KR2 PAM4 */ +#define IFM_400G_CR2 IFM_X(127) /* 400GBase-CR2 */ +#define IFM_400G_SR2 IFM_X(128) /* 400GBase-SR2 */ +#define IFM_800G_FR8 IFM_X(129) /* 800GBase-FR8 */ +#define IFM_800G_LR8 IFM_X(130) /* 800GBase-LR8 */ +#define IFM_800G_DR8 IFM_X(131) /* 800GBase-DR8 */ +#define IFM_800G_AUI8_AC IFM_X(132) /* 800G-AUI8 active copper/optical */ +#define IFM_800G_AUI8 IFM_X(133) /* 800G-AUI8 */ +#define IFM_800G_SR8 IFM_X(134) /* 800GBase-SR8 */ +#define IFM_800G_CR8 IFM_X(135) /* 800GBase-CR8 */ +#define IFM_800G_KR8 IFM_X(136) /* 800GBase-KR8 (KR8) */ +#define IFM_800G_CR4 IFM_X(137) /* 800GBase-CR4 */ +#define IFM_800G_SR4 IFM_X(138) /* 800GBase-SR4 */ +#define IFM_800G_KR4_PAM4 IFM_X(139) /* 800GBase-KR4 PAM4 */ /* * Please update ieee8023ad_lacp.c:lacp_compose_key() @@ -558,6 +572,20 @@ struct ifmedia_description { { IFM_400G_CR8, "400GBase-CR8" }, \ { IFM_10_T1S, "10BASE-T1S" }, \ { IFM_10_T1L, "10BASE-T1L" }, \ + { IFM_400G_KR2_PAM4, "400GBase-KR2-PAM4" }, \ + { IFM_400G_CR2, "400GBase-CR2" }, \ + { IFM_400G_SR2, "400GBase-SR2" }, \ + { IFM_800G_FR8, "800GBase-FR8" }, \ + { IFM_800G_LR8, "800GBase-LR8" }, \ + { IFM_800G_DR8, "800GBase-DR8" }, \ + { IFM_800G_AUI8_AC, "800G-AUI8-AC" }, \ + { IFM_800G_AUI8, "800G-AUI8" }, \ + { IFM_800G_SR8, "800GBase-SR8" }, \ + { IFM_800G_KR8, "800GBase-KR8" }, \ + { IFM_800G_CR8, "800GBase-CR8" }, \ + { IFM_800G_CR4, "800GBase-CR4" }, \ + { IFM_800G_SR4, "800GBase-SR4" }, \ + { IFM_800G_KR4_PAM4, "800GBase-KR4-PAM4" }, \ { 0, NULL }, \ } @@ -909,6 +937,20 @@ struct ifmedia_baudrate { { IFM_ETHER | IFM_400G_CR8, IF_Gbps(400ULL) }, \ { IFM_ETHER | IFM_10_T1S, IF_Mbps(10) }, \ { IFM_ETHER | IFM_10_T1L, IF_Mbps(10) }, \ + { IFM_ETHER | IFM_400G_KR2_PAM4, IF_Gbps(400ULL) }, \ + { IFM_ETHER | IFM_400G_CR2, IF_Gbps(400ULL) }, \ + { IFM_ETHER | IFM_400G_SR2, IF_Gbps(400ULL) }, \ + { IFM_ETHER | IFM_800G_FR8, IF_Gbps(800ULL) }, \ + { IFM_ETHER | IFM_800G_LR8, IF_Gbps(800ULL) }, \ + { IFM_ETHER | IFM_800G_DR8, IF_Gbps(800ULL) }, \ + { IFM_ETHER | IFM_800G_AUI8_AC, IF_Gbps(800ULL) }, \ + { IFM_ETHER | IFM_800G_AUI8, IF_Gbps(800ULL) }, \ + { IFM_ETHER | IFM_800G_SR8, IF_Gbps(800ULL) }, \ + { IFM_ETHER | IFM_800G_CR8, IF_Gbps(800ULL) }, \ + { IFM_ETHER | IFM_800G_KR8, IF_Gbps(800ULL) }, \ + { IFM_ETHER | IFM_800G_CR4, IF_Gbps(800ULL) }, \ + { IFM_ETHER | IFM_800G_SR4, IF_Gbps(800ULL) }, \ + { IFM_ETHER | IFM_800G_KR4_PAM4, IF_Gbps(800ULL) }, \ \ { IFM_IEEE80211 | IFM_IEEE80211_FH1, IF_Mbps(1) }, \ { IFM_IEEE80211 | IFM_IEEE80211_FH2, IF_Mbps(2) }, \ From nobody Wed Jun 17 18:23:56 2026 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 4ggXLN5yqwz6hJKJ for ; Wed, 17 Jun 2026 18:23: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggXLN27HXz3kLW for ; Wed, 17 Jun 2026 18:23:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781720636; 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; bh=yDbhbDUGAxRaj60GQFLhZflZNgh3qFj/NgSbImoyxxk=; b=toe68GKISmpBpHXNR/jtnbjzZy5/s7TJ6AjRNnHdcmVcW1eTqcxzK6sJB0TSrTjNmCicIu jI5jTWmH4UrupCLEDrdoHupRZDpSfIyhIyZZfk+Q/mC9K7+km7bfaolrVX504OFXkYzy01 pZYjdOifmHpF6TXkOzqpRD+f/wqytwD3Gu/JqbtsV5Nmab7FlrW0aH3lqDYFoTxnP28d81 ZJVzgdllYkDPaugCL3DbFnCC/uvb5Hr82xl/2AhQbETPsR+Iydtv0JhjP9UakKlG9HuEl7 +6tpZjQE8u2MhE303+ez0NjinIZRVIu8qeRWIjNLekPwqgoDQ2xFDQrqp4v1ZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781720636; a=rsa-sha256; cv=none; b=tcLZU060nDok+LR/ESoFlAWHJDHUxXul8bZTtqrmriqksoS78YO/L5WXFbMBAe6x18VbjH bwlsg4723qVDcd+XoIWaYoKtoEdGvc855WVKmDJFQANN1auCWVEts8PR17Udm+9rOyoLeW AvUiMvCDPLmb6cPnV7W6hFNe61P8s6v8txr30TXY4ilk8fhCtfWDT6qsXUtbri3cqnpHEI EafVjpCPjL38lcACXDhmjjtTK3YKlCDNCXvPvCxwwmSvhUBjwNFQ98WSDGH8rdxP0/d3OP oNEU/4+hF2Geb/hHI5aSFjFkOTxCD2KkAwOnJtybi+E2ZzKlZXQ+5r0aAXvxFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781720636; 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; bh=yDbhbDUGAxRaj60GQFLhZflZNgh3qFj/NgSbImoyxxk=; b=HVJpnZea8leus8eNtpZ1pWbvvT88+0JJOY/KbMI40I+yQZpLx6+Mj7j6Wg9zbMhcQkSzIZ eLhkgVRnclbG46Y+MSj/y3pe8qCfzvt48MVIfWZ/pRg5TNPUNNZZvpNQcWBEonr0+4xtgs tSb1dnyycZK7uhgxozt6JIu1nFgd+5Rq8kGF/c1gs/puarIh7SsyNAh9TvZUqERFMWp/S2 GRLxuM7+QBb5h2zPPdClQ5MMXh1JDAPsm+pvKcUepqUcsLMPE+l470XGPPpfhuAcMDxHz7 5v6qhJpa/OuxcUbI+pMxVP623OxBQDSw0eJLYmL7AMaYtRCtJ2qjaJP13WUD2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggXLN1gYgz7gp for ; Wed, 17 Jun 2026 18:23:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24615 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 18:23:56 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Slava Shwartsman From: Konstantin Belousov Subject: git: 17cf7760a98a - main - mlx5en: guard against empty eth_proto_oper mask 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 17cf7760a98a87c33d0415e2d2e1d4b24dd69e4d Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 18:23:56 +0000 Message-Id: <6a32e63c.24615.41d6a4d0@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=17cf7760a98a87c33d0415e2d2e1d4b24dd69e4d commit 17cf7760a98a87c33d0415e2d2e1d4b24dd69e4d Author: Slava Shwartsman AuthorDate: 2026-06-10 16:43:08 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-17 18:23:15 +0000 mlx5en: guard against empty eth_proto_oper mask eth_proto_oper is used to derive the active media mode, but an empty mask leaves no valid bit for ilog2() to consume. Treat this as an invalid carrier update, reset the active media state, and report the unexpected PTYS value. Reviewed by: kib Tested by: Wafa Hamzah MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 35450776e54e..6d8e1ba41709 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -445,9 +445,16 @@ mlx5e_update_carrier(struct mlx5e_priv *priv) ext = MLX5_CAP_PCAM_FEATURE(mdev, ptys_extended_ethernet); eth_proto_oper = MLX5_GET_ETH_PROTO(ptys_reg, out, ext, eth_proto_oper); + if (eth_proto_oper == 0) { + priv->media_active_last = IFM_ETHER; + if_setbaudrate(priv->ifp, 1); + mlx5_en_err(priv->ifp, "eth_proto_oper is 0\n"); + return; + } connector_type = MLX5_GET(ptys_reg, out, connector_type); if (connector_type >= MLX5E_CONNECTOR_TYPE_NUMBER) connector_type = MLX5E_PORT_UNKNOWN; + i = ilog2(eth_proto_oper); if (ext) { From nobody Wed Jun 17 18:23:55 2026 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 4ggXLM3XRTz6hJHZ for ; Wed, 17 Jun 2026 18:23: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggXLM1Nw7z3kD1 for ; Wed, 17 Jun 2026 18:23:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781720635; 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; bh=zZUFBfYucsyA/f+wg/bvUGKpgG9q/Vv9tN3WW/qGv1o=; b=WpqWrWxZdUJyr1+ULA1/IjNLE48xC9zz2RYBR8gNuLcSrgPqyFdbAGiy/xpJjmVN6i1SYk hYD7MCt/AkE1w6uL6VbM/3dm2lzALDx9bQJkLY01GrnWUAYidIOg8p+6KTNCssKSomYbmv xNfzgGzkrP69hdaHbjZPaZ9tZHhc7ig7Clmj1okauUdXCBOtL3NWe7B6/tyq3u38QImq/V kvLFts5q6FpIbdy8aobvn9vhIh46wkwq9QfyuegXVSXEixpXqGkKBNdwqffXP2ZNXDQ5gk S8kkxS5PYWWgEnjhJEkvEFrEtJG+q0QB3xPanU6qhV+NYCccetrXLW4cHicfDg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781720635; a=rsa-sha256; cv=none; b=eK2QCdUMJYYN7y6beCRERs9jIh69LkAeitDn9lUULKkoDRqYH8T6VZbDjPMGq5c5R3ECyV Mta+BuLd5j686M8DXdS233+A7PyZa/pDZZ4vAC0fsYxwtlE/Y9S9p96B1hhEhYSusZF1Bz zKj8sr3hovfrDlwG0tZzetenT5G5Woc/x1jEX9pJDTDT1YPmDvE5EZqX85gQeYLUDbcoGj vAAOnIquEmeTZqIUdys7VTBIuv3yMH7EE7WC170+xGsE/skkewqitCCzu7+/7/29xXGi6C drvbYm3JMizS1vS2549mPU6oTr7Ivm0EqKbhTOeqSPvHV0n2XNnULHwHqKde/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781720635; 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; bh=zZUFBfYucsyA/f+wg/bvUGKpgG9q/Vv9tN3WW/qGv1o=; b=wwauHBTzWc9ELnhLJbH94HK1Epa3sTNVG8img6UI+l3+PJXaP/ksbdLMi4VIPN3K8yTeea 7vd1JKhqtPewlInfTf7IW8rZ6KcaC4YlEwPCMBt25HxYfaujnPyBb8tpIISDnU9K7Y6WY+ 4VcUHa1N765h7f2aUPHW2G+/2gmt/XJubrw/YRdfRkMpCUpvV751D3kp/aYnfh+xLmPJjE 7GNNEIF0IS5Wu3/uYQTcmID/WmDP72kPG9tY0plBwxNT0ccx+pYxIj+XVMh8stuDoLWJJa uQJLggD34dFj0IiAc/wbcGtqEnUw3tMWCTgmlPQnHarYGxHYWOKwuR7eEplbTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggXLM0sj8z7LT for ; Wed, 17 Jun 2026 18:23:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23e52 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 18:23:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Slava Shwartsman From: Konstantin Belousov Subject: git: 49b78368c5ed - main - mlx5: Add missing speeds translation 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 49b78368c5ed9cf41dedfc1c02a597fd49468537 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 18:23:55 +0000 Message-Id: <6a32e63b.23e52.345ba538@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=49b78368c5ed9cf41dedfc1c02a597fd49468537 commit 49b78368c5ed9cf41dedfc1c02a597fd49468537 Author: Slava Shwartsman AuthorDate: 2026-05-18 11:22:43 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-17 18:23:14 +0000 mlx5: Add missing speeds translation Reviewed by: kib Tested by: Wafa Hamzah Sponsored by: Nvidia networking MFC after: 1 week --- sys/dev/mlx5/mlx5_core/mlx5_port.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/mlx5/mlx5_core/mlx5_port.c b/sys/dev/mlx5/mlx5_core/mlx5_port.c index fc192ec6a23b..4a76b70d6199 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_port.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_port.c @@ -1329,7 +1329,10 @@ static const u32 mlx5e_ext_link_speed[/*MLX5E_EXT_LINK_MODES_NUMBER*/] = { [MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2] = 50000, [MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR] = 50000, [MLX5E_CAUI_4_100GBASE_CR4_KR4] = 100000, + [MLX5E_100GAUI_2_100GBASE_CR2_KR2] = 100000, + [MLX5E_100GAUI_1_100GBASE_CR_KR] = 100000, [MLX5E_200GAUI_4_200GBASE_CR4_KR4] = 200000, + [MLX5E_200GAUI_2_200GBASE_CR2_KR2] = 200000, [MLX5E_400GAUI_8] = 400000, [MLX5E_400GAUI_4_400GBASE_CR4_KR4] = 400000, [MLX5E_400GAUI_2_400GBASE_CR2_KR2] = 400000, From nobody Wed Jun 17 19:30:04 2026 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 4ggYpn1fQLz6hfYC for ; Wed, 17 Jun 2026 19:30: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggYpn0rcpz3v1N for ; Wed, 17 Jun 2026 19:30:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781724609; 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; bh=DBH3GT7LGbULskipb/WVou0KY49viixgq+lstT48+C4=; b=HZfSP2jeMOEpsllkThc+8lTMSOLx/y3IQZs1XVFjlAYB2fweb1gA8EjAUSAJezXGjbVzxa Fc7iLsBMKqU0ds2UHKEiW4bctXW1r9MLf3248MWW06v4YR1X2QzfDxEcmQa2c6+mx3wbZj 4YYbMFD3nBNc3443uVZXRvep6Utvz0Gl+ILFh481mtaQ1zfu2G/0u63XH3E7SD1JixQBQ5 6kADbZ55hf0QLO8A7T4v4VjUwA/wnyrdsc62b5GZT1a/zgVYYYPrByizcxHfqcmppjDKrT g675p1difIgAoBXhBLBJqo4O1y0bFIvfPcg3CkxpxIEM3HSWT4mUAtq9yQD8sg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781724609; a=rsa-sha256; cv=none; b=J9HtReE+askd6CuhJNWLi8cbTDsPlu2pVbUvv3M0nQ8EwtPusBQMsB0MeO44ee0FWs/UMy uSYn9VgsG426oQXx/W7W4z72ItY15MXYd6gZ2Jgu7+886GGd0/8RrZWu2zCBib3L+2XNPI PGXZUYnS3inQ4VRYzTBIloR1wSsLh/YUMb0Zg/1RQ9qjHJNSU/bQ7jopfx6jIZq4JRN84V fUbjWQ+gUAZJDb45SVzO+hd6qk+5wh8M95Gl97bfT1rPBMb++Qi5A7O7/aJt6Fp1eqU/YT 5J+bT0pGOCTgkejac5c4OszlkmMKt/FE3+KC0Etj9zIw+Chh39IAetENZkmZ2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781724609; 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; bh=DBH3GT7LGbULskipb/WVou0KY49viixgq+lstT48+C4=; b=aodxrIxEQoKcWDyuPKWmVHmSnF7nbhZZ6xPgjhiNR9xwWxi3Y1ylrMBkJJ2iJAaUSJow3j D6bJT/ZLOQkuiJhEmzkxUSvPXBSNr7Mkk7CGPFN7xQxYSVLBPIIBT8daAjXwtCy9AoXqO/ nxckJo9glF+F8nHzgHWwDrszKz4qYtR6aDbMORwKck856Z/eGphr6Py9VmVVxMcPuMfQIf rSmit74oSeg6ZKgkkdMQ7MMc1dTJ6fDXsCb4IubAVdgv24amdc6GZNISAnEBzP1jkQmwFq +FTbMKJvhX7JUpZMvWcmbbrPGv14rGmBqXfvVbvKwFqYORGV6ptA1oFSxezvGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggYpn09vKz9FX for ; Wed, 17 Jun 2026 19:30:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3359b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 19:30:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Reid Linnemann From: Kristof Provost Subject: git: e2903636a069 - main - iflib: Fix mbufs leaked by 0 len packets emitted from the if driver 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: e2903636a069d5ef364c8f56452bff5818d15f99 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 19:30:04 +0000 Message-Id: <6a32f5bc.3359b.13c9d85d@gitrepo.freebsd.org> The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e2903636a069d5ef364c8f56452bff5818d15f99 commit e2903636a069d5ef364c8f56452bff5818d15f99 Author: Reid Linnemann AuthorDate: 2026-06-17 18:22:44 +0000 Commit: Kristof Provost CommitDate: 2026-06-17 19:29:31 +0000 iflib: Fix mbufs leaked by 0 len packets emitted from the if driver Some interface drivers, notably bnxt, can insert 0 length packets onto their receive queues when certain conditions are met, such as discarding packets in the case of bnxt. When this packet gets processed by assemble_segments(), The solitary mbuf on the queue that composes it consist of a single zero length fragment. The loop in assemble_segments() doesn't seem to expect that a 0 length fragment can exist in the iri_frags list without a non-zero length header preceding it. In this situation, without filter intervention rxd_frag_to_sd() returns a pointer to the corresponding mbuf in the rxq, where it is matched as a zero-length fragment and immediately discarded without freeing as mh has not yet been assigned. This change corrects this behavior by falling through the mh == NULL case and freeing m on the condition that it is not NULL before continuing the loop. Reviewed by: gallatin Sponsored by: Spectra Logic Differential Revision: https://reviews.freebsd.org/D57537 --- sys/net/iflib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 0ad805cb7c16..1af9d22db9a2 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -2797,14 +2797,14 @@ assemble_segments(iflib_rxq_t rxq, if_rxd_info_t ri, if_rxsd_t sd, int *pf_rv) if (ri->iri_frags[i].irf_len == 0 || consumed || *pf_rv == PFIL_CONSUMED || *pf_rv == PFIL_DROPPED) { if (mh == NULL) { - /* everything saved here */ consumed = true; pf_rv_ptr = NULL; - continue; } /* XXX we can save the cluster here, but not the mbuf */ - m_init(m, M_NOWAIT, MT_DATA, 0); - m_free(m); + if (m != NULL) { + m_init(m, M_NOWAIT, MT_DATA, 0); + m_free(m); + } continue; } if (mh == NULL) { From nobody Wed Jun 17 20:11:26 2026 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 4ggZkQ38ZRz6hjqM for ; Wed, 17 Jun 2026 20:11: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggZkQ0YH4z40yX for ; Wed, 17 Jun 2026 20:11:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781727086; 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=1tSmlguAUtF2/OVgJVFZa7si+DGehLlItkqzyciTqkc=; b=hnF3d93iUMmkTusvk+xYvE0H4tBP/TSC2klUqKO2DAlEtuuSztft2Udpz90h7sPR6SBdY4 9CFEftMdAsWC3WOSgVD02eZ4jdshn17Xj5HiV/rQmS2XCJt6EoCsf08ffvBkTVoZYHBQj8 BC5Hm7SNs0QyC+XMYNX8yAibsX8lMi01rmzhBNxNp42uU2w+AJYtHxsMjB0qc0FLRpR/vM hJoLBTZ1Fn9C2Iqimk7YJb7sdkDT83tVkK5NvHszsRTVTWwouRiIcGuLkB1+JnpSqHjh8k N/i2YKxoLtnWh9nvPm+gL0o6ZK2PyJLzrKFCjWgClTTOdZhJ0juKiHYgb+Ii2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781727086; a=rsa-sha256; cv=none; b=ZL85YMxJOn9clcFnqe97DdbSX/R1GUD5fhpIpN+YHhOqFVuY4iGftPadHUrNB+Pt7k35ZK iMfBshZbEJ84MrC9bvPLS/i8ylD+G6c0L9zMQp9Kp6f9dCIaqE1/iJXVYns2vr/MbxFv6J peMc7EoyQWEjkzipZSYaq1WUD0LKp2FgfwU4ZBPTSErYs0i9aZzjtrH81/a/8fXuV+tuDN 3vyMpugFczHXtCt7mZDpFmpzKR2s1w/QugF3+u7d3zBVhZhwrm1TkUvArSzoLQe7y/IiOB w/f3Omp7PCcBhO3G7f6oShC14x8Hr2BU6B/HXDtElt1YvngFrXBoTn1nGe2Z+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781727086; 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=1tSmlguAUtF2/OVgJVFZa7si+DGehLlItkqzyciTqkc=; b=e4xVqmcd5cW7+2n7Vf8/PBGsZ0ne/bZIylmyA8YjlLnqg2Q6BpdNwbF450EBLkIflPOT5a 0nfNDja2iH4OYTzUZ+NN7R3TD1MRvbpY1Ayz5nfLKpbIKREtXGnDj3dgUkC6EkhgyxLEbS KAVsvUylkmzpAM+W/6HKsYhHvSJxRrPu95QySmeJ8g728PCRQnYzMDZQ7sPg+gf7BBkMM5 e4fYWmlA4xONLV4AF8jrBdCREe//6/YgVNSCDKJ8py66PQ1na0ugqXuTOBdDbZFlro3yYc 2/IloAb3ao4y9KWqn17rKN7JBZCSwsrNzWBcNfJJSgjJ25o2gX0MVjAMkX5gzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggZkQ07vTzBRC for ; Wed, 17 Jun 2026 20:11:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 36354 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 20:11:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: ShengYi Hung Subject: git: 61e2ffd8168c - main - libusb: Sync libusb_class_code with upstream 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: aokblast X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 61e2ffd8168cc0f558ba7effe445573ffe2ad8c3 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 20:11:26 +0000 Message-Id: <6a32ff6e.36354.d20a9d@gitrepo.freebsd.org> The branch main has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=61e2ffd8168cc0f558ba7effe445573ffe2ad8c3 commit 61e2ffd8168cc0f558ba7effe445573ffe2ad8c3 Author: ShengYi Hung AuthorDate: 2026-06-17 19:50:54 +0000 Commit: ShengYi Hung CommitDate: 2026-06-17 20:11:13 +0000 libusb: Sync libusb_class_code with upstream This reflects the difference from the upstream libusb code. See: https://github.com/libusb/libusb/blob/master/libusb/libusb.h Reviewed by: adrian Event: BSDCan 2026 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57620 --- lib/libusb/libusb.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h index fd99a67216aa..55982be2ead3 100644 --- a/lib/libusb/libusb.h +++ b/lib/libusb/libusb.h @@ -64,6 +64,11 @@ enum libusb_class_code { LIBUSB_CLASS_CONTENT_SECURITY = 13, LIBUSB_CLASS_VIDEO = 14, LIBUSB_CLASS_PERSONAL_HEALTHCARE = 15, + LIBUSB_CLASS_AUDIO_VIDEO = 16, + LIBUSB_CLASS_BILLBOARD = 17, + LIBUSB_CLASS_TYPE_C_BRIDGE = 18, + LIBUSB_CLASS_BULK_DISPLAY_PROTOCOL = 19, + LIBUSB_CLASS_MCTP = 20, LIBUSB_CLASS_DIAGNOSTIC_DEVICE = 0xdc, LIBUSB_CLASS_WIRELESS = 0xe0, LIBUSB_CLASS_MISCELLANEOUS = 0xef, From nobody Wed Jun 17 22:40:54 2026 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 4ggf2t6XRKz6hvn3 for ; Wed, 17 Jun 2026 22: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggf2t3KnKz4K0f for ; Wed, 17 Jun 2026 22: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=1781736054; 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=5KkUyLktgG5/o3mmXH16oBrRKv5xiMtvFy2fBS8HAH4=; b=xTXseggJqYrMV8rHUYvzoVm+JBADpjRgovmHkfABnUJIiBLX8S2npwaWgSZBTsY4Nixz// RmpM8MV5PeDIkZHhGYYt2eh6qiVsMX5jJ/1PLBao8TabmhwJubCHz2l3EWabytnhAAa4JX k0nBZs3PDoL8gJ1kiOnLnM2Db8P/o87IhYErWJGDGzgX6dtt+vdefBu5wKDRTXgLTsKCEZ 4vKDKHJm4GGn2d5ECOOoTA1xAS7PfjddyevdkyqmVYD3j2WRxheMXLZVklaklklTHlzFWS RvoWm3u5PQ9c3khRF1Ped2/06AV/0Q1HGx91NmiAyysEvmyWcjM35yWYeyWmWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781736054; a=rsa-sha256; cv=none; b=gUrEPqZHRPnlDMjhr14HrYgqppKtq8BJG0tHqoVO+rTnzHbsSxsZ4dLp/aACRW/G05mae7 unhdBnAySsX2ZLK9kV7+VxALSGqHUZ2g4te1Rp4mPoV3gQfxu6HUGDMrLLu4F+rBdfhL0o UR1fMqqOEWwR2SvxNJ1r3lm5WUExSNgYPjjl1YLD1Y25CZo8xi6Y+vCEMEAgWE0Vra2KJs v/BBIwi9gaJw+bXjxCQYNGVW/2NDl1FwWBWJDRUdE0k2MtIW5NzlRZWRStm41dyc2hFSXb 05+UZaIVw2nl69YHzrR6m8iooFckM09F+N3GselgGhmxtAeVMTMqezGFgApxBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781736054; 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=5KkUyLktgG5/o3mmXH16oBrRKv5xiMtvFy2fBS8HAH4=; b=x90ZLUa7xHD48noKMo8tzeoFmECALCc5iqpYbs9/QBbU8Imyb29bl/Ora2mIdDWrpU42+w Khiah+QF3XPYkqPyv6T3LQA4JUrU5Kf32C3Cg2st501wFPbCDaWgZVO2rwy5VL2+1KD6xC lz7WKLsITsJCq+f5UiaUAD0NYPWCDp8jxKasYc9a1YOuts+Xbqgs2PyYWDfSYN07messh4 jTVzEcHkIh3/QY3VUyokLYYWDRn+6Ir4J7fW7qb4dLaETRaxmkw5mH1ytjlQRC8FSfQCWZ 5Nbb36PfFRjSiFFYEGZcwuzsn0tBkvlyrMHQ+Wm2xHrT25j3uqwva/4ruKc44g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggf2t2PD3zXgp for ; Wed, 17 Jun 2026 22:40:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4778c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 22:40:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 13184a69faa7 - main - build: provide a FORTIFY_SOURCE. override 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 13184a69faa700319ab16357cd39708a0e89fc15 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 22:40:54 +0000 Message-Id: <6a332276.4778c.72ea74c8@gitrepo.freebsd.org> The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=13184a69faa700319ab16357cd39708a0e89fc15 commit 13184a69faa700319ab16357cd39708a0e89fc15 Author: Kyle Evans AuthorDate: 2026-06-17 22:40:46 +0000 Commit: Kyle Evans CommitDate: 2026-06-17 22:40:46 +0000 build: provide a FORTIFY_SOURCE. override For native files we can do more minimal fixes to avoid this large of a hammer, but for third party files it may not be worth the effort to try and patch them. NetBSD has the original _FORTIFY_SOURCE implementation that ours is based on, for instance, but tests sourced from there can't do an __ssp_real(foo) without being certain that `foo` actually has a fortified definition. This change does always define _FORTIFY_SOURCE as a result, so gate it on CFLAGS not already containing _FORTIFY_SOURCE definitions. This re-applies c46a0b59071614, but without re-defining _FORTIFY_SOURCE needlessly. PR: 294881 Reviewed by: markj, sjg (both previous version) Differential Revision: https://reviews.freebsd.org/D57356 --- share/mk/bsd.sys.mk | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 4ffac401eb4c..139cb8bec843 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -307,9 +307,6 @@ CLANG_OPT_SMALL+= -mllvm -simplifycfg-dup-ret CLANG_OPT_SMALL+= -mllvm -enable-load-pre=false CFLAGS.clang+= -Qunused-arguments -# XXX This should be defaulted to 2 when WITH_SSP is in use after further -# testing and soak time. -FORTIFY_SOURCE?= 0 .if ${MK_SSP} != "no" # Don't use -Wstack-protector as it breaks world with -Werror. .if ${COMPILER_FEATURES:Mstackclash} @@ -319,9 +316,19 @@ SSP_CFLAGS?= -fstack-protector-strong .endif CFLAGS+= ${SSP_CFLAGS} .endif # SSP -.if ${FORTIFY_SOURCE} > 0 -CFLAGS+= -D_FORTIFY_SOURCE=${FORTIFY_SOURCE} -CXXFLAGS+= -D_FORTIFY_SOURCE=${FORTIFY_SOURCE} + +# XXX This should be defaulted to 2 when WITH_SSP is in use after further +# testing and soak time. +FORTIFY_SOURCE?= 0 + +# We want to avoid defining _FORTIFY_SOURCE if it's set to 0, but we rely on +# deferred-evaluation for ${.IMPSRC} to expand. The below construction +# is, unfortunately, necessary. +.if empty(CFLAGS:M-D_FORTIFY_SOURCE*) +CFLAGS+= ${FORTIFY_SOURCE.${.IMPSRC:T}:U${FORTIFY_SOURCE}:S/^/-D_FORTIFY_SOURCE=/:N*=0} +.endif +.if empty(CXXFLAGS:M-D_FORTIFY_SOURCE*) +CXXFLAGS+= ${FORTIFY_SOURCE.${.IMPSRC:T}:U${FORTIFY_SOURCE}:S/^/-D_FORTIFY_SOURCE=/:N*=0} .endif # Additional flags passed in CFLAGS and CXXFLAGS when MK_DEBUG_FILES is From nobody Wed Jun 17 22:45:35 2026 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 4ggf8J3sr9z6hw5b for ; Wed, 17 Jun 2026 22:45: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggf8J0s3Kz4KHJ for ; Wed, 17 Jun 2026 22:45:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781736336; 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=zEzuqVLzM/XciUfmIaZlbuHkk3XAP7H2+7/JUqUdrPU=; b=dciV1eDVlovfB3jhkF5NMBSR8ga7iapQaMsVRFhPQoZUeDjB1wR+flItquvpNaWPLNNXw4 ybRp5Y8fHyzxfb9SmoiH6mve3dCz8hHcktZZPrPKdBDf4bxukztOSM1trojEVwgAVQOtnz xgm+j6g5xTjz5SmJepvS/d8H78kzWKCgwygfc4U0lPZ1D+L8RZFCPowuW1mKSOvSi3o7Ii NydU5M8V63tg35r5OodESKFbl16E+4OTCsBFr5d1c0WYiYWY+odrUKaKTTOBHYQR0SBvuq Gd8JBcf/0DalTqubmuYg/OcDB21Qt2uW5N6Y0vAKX8qfkr+BWIdu6iKLQsH5Jw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781736336; a=rsa-sha256; cv=none; b=B1qw36spXGuX0tt+vDSFljFErXBAgeYsepCjzrdXcoHLdUKAPqxrOApyrO9YLA7AIpvzDd 8D0SsT0Zzkwxnjnx+PxJQE0Z4Fltm14XW3UUUsIz3ujmF2V+afPI1gNszlzZxG03xSGcNq qXZCAsOPNAtSbM+rInAFn0PwVAZLGR3ShegPepUEj/yvYsP9tBcMHkwl7QKPlbZpUJ8TX5 dgIwIrQXsFp+ql1m/OHglqw9KPoq3AzjEKNToESmtpiDZIm5w5v6P7egPdeTgxY7GkB+a4 J4KBXSS7j5Oevup/x1FjxeHCIo+yzDD4l1iqUOdJuzXlM76+0ePsIJiwJzmM/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781736336; 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=zEzuqVLzM/XciUfmIaZlbuHkk3XAP7H2+7/JUqUdrPU=; b=D3zT9LIbF+NR8Hz02P6Yxfa/2VNoS5F7QF7Dk36XAsGoshwxP9Dom7GxYXTK4M64v9F9ST ox+rVojqVrD2MlCjSyVxpM80Om5ju3v6pNCx+MBC0E82EbFRYm2/cDBUiNinBJHU3u+7mU /6iDVTztfyXFs6CcTQsSALjj1NeLozEkpm8pUsDmlofHgAOTbnOv9hPTR7jpX6PrzqObl/ Ol6nTuFz/kdLobnbAchqcecLxLa6jFBenfMnDjzbaotQe2DQhH40I8xsXsAF51qVZl/1Od ol8a4BwMeXetW/wqfS3NwMyuam5mQ6dpu72spUCluv6wnmKTaq8nVOtGFpLWFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggf8H6bl6zY1w for ; Wed, 17 Jun 2026 22:45:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 47105 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 22:45:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Aymeric Wibo Subject: git: bb14ba3777bb - main - daemon(3): Note about environment after calling daemon() 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: obiwac X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb14ba3777bb201abd6d4dfbf67d70b81f9c1e97 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 22:45:35 +0000 Message-Id: <6a33238f.47105.567c52b0@gitrepo.freebsd.org> The branch main has been updated by obiwac: URL: https://cgit.FreeBSD.org/src/commit/?id=bb14ba3777bb201abd6d4dfbf67d70b81f9c1e97 commit bb14ba3777bb201abd6d4dfbf67d70b81f9c1e97 Author: Aymeric Wibo AuthorDate: 2026-06-17 19:51:39 +0000 Commit: Aymeric Wibo CommitDate: 2026-06-17 22:44:46 +0000 daemon(3): Note about environment after calling daemon() While here, fix missing comma typo. Reviewed by: 0mp, ziaee Approved by: 0mp, ziaee MFC after: 3 days Obtained from: https://github.com/apple-oss-distributions/libc (partially) Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D57384 --- lib/libc/gen/daemon.3 | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/daemon.3 b/lib/libc/gen/daemon.3 index 4619ba3489aa..99a4f685bedb 100644 --- a/lib/libc/gen/daemon.3 +++ b/lib/libc/gen/daemon.3 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 27, 2023 +.Dd June 1, 2026 .Dt DAEMON 3 .Os .Sh NAME @@ -44,6 +44,13 @@ The .Fn daemon function is for programs wishing to detach themselves from the controlling terminal and run in the background as system daemons. +The +.Xr fork 2 +system call is used; see +.Sx CAVEATS +below about the environment after a +.Fn fork +.Pq without a corresponding call to one of the exec routines . .Pp If the argument .Fa nochdir @@ -89,7 +96,7 @@ and function may fail and set .Va errno for any of the errors specified for the library functions -.Xr fork 2 +.Xr fork 2 , .Xr open 2 , and .Xr setsid 2 . @@ -107,6 +114,21 @@ The function first appeared in .Fx 12.0 . .Sh CAVEATS +In multithreaded programs, the child process after +.Fn fork +inherits copies of all mutexes and other synchronization state, but only the +calling thread survives. +Any locks held by other threads at the time of the call will remain permanently +acquired in the child, causing deadlocks in any code that attempts to +acquire them. +Until one of the +.Xr exec 3 +functions is called, the child should restrict itself to async-signal safe +operations +.Po see +.Xr sigaction 2 +.Pc . +.Pp Unless the .Fa noclose argument is non-zero, From nobody Thu Jun 18 00:37:08 2026 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 4gghd045CWz6j4gf for ; Thu, 18 Jun 2026 00:37: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gghd03XFGz3GV7 for ; Thu, 18 Jun 2026 00:37:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781743028; 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=/arRObskPm7gp5z8ZJ8lDQiNe6va6/BWM9xOPdoKNjM=; b=ww3hg6r+uJgO2S3E/96vQGtWAaJJnfEbQBFUa6IsA/c8HlXbP/TF7Y9rXzoqBQuI+ABgBx g/LT8p78ii0VXsXBvaoe/Jmpxkx5CFfFFaaA72Tw+W4fOLAGexJM8O/HBuFAK4HIyQtyYr XUYFHBESOfBVt5Cn/Yyhord4jIhwN2Y95nZHjcyrhUXX2kGHJe41KT9ezR0I24/bitVohm /q09L7xemdfcsn0WKO8y53oR8PGhllq9RpzX1D0KNhbCKdh0HDs3DRIZfTQZ7idLQ9Kzxh DyHjjGcPF/n1nMW/XHrhOxpBZ9yh3O/hE9s+H32a/xbu4J9i9VT5GmOERcVzIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781743028; a=rsa-sha256; cv=none; b=DWhMuA6TTd3cTd7Lju8zP+/Vhd9+bFfVo/MIXJ2V2vPDqmPmRJ/baa5NEV9qz0mOrgbI+v qoGJFr9RTuBLnjxF82iJ+MXw2jpia/vE+UGQEHhKhlhkR11n0/Lz7ODOqzw9VJ9Y6lQI2n pzl/bwPopGwBAO1w2lOH3Nk+aKkodVdS9/VZjzEOEPSupJb9F55fKYTXKuobNtzKlY87nq K8SZTR1GANg8vrIIOmYemLE8TGiATjVrRWL8sjOPxQvUQKcux+IYroz9x2pLtEOB2/AFkn uc4SOzqbljEH4yOVIAZMIUdNDR6vfcSISmCTIvCztBFZVzbfc81+/wabt0u6Jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781743028; 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=/arRObskPm7gp5z8ZJ8lDQiNe6va6/BWM9xOPdoKNjM=; b=cjVLboLH4b7ye+hRQ9cF9VU78J9Atpjrri+vUWuVZDNKbdt0DvwOnd8dO8VldrbzfIRGR0 wFBgB9S0a3pP66Bi3gydDqMlR9t6+eQjyNA9UOZC9vbJDp/Mjns8DJzHAF5MRdgZzTIlvu AiY7GZpUQi94yw8eH6cO5agoyYpYj5pd49VvAGL1PdZ4Wl40o37Sq6HCptjtMb5+Fu/NkP kCBdYVjSEWRqc9Yw83PVjGyCYsHLrknqCkmrNefLGWY1wzFmsSy07wS5cZizx7KeoQujpC 3atEzdmutQG7WmsKYOyHgXfJ7tlCIm/DRRCi1aYUe61VlwGARquLRsZVWlkI6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gghd027C4zcST for ; Thu, 18 Jun 2026 00:37:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22974 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Jun 2026 00:37:08 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 572680712c31 - main - nfs_clvnops.c: Fix the case where va_flags are being cleared 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 572680712c317b81d66475203ac1b9d6bbeca5d5 Auto-Submitted: auto-generated Date: Thu, 18 Jun 2026 00:37:08 +0000 Message-Id: <6a333db4.22974.31da2a9@gitrepo.freebsd.org> The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=572680712c317b81d66475203ac1b9d6bbeca5d5 commit 572680712c317b81d66475203ac1b9d6bbeca5d5 Author: Rick Macklem AuthorDate: 2026-06-18 00:30:29 +0000 Commit: Rick Macklem CommitDate: 2026-06-18 00:34:57 +0000 nfs_clvnops.c: Fix the case where va_flags are being cleared Commits c5d72d2 and 3b6d4c6 broke the case where the archive/hidden/system attributes are being set false (UF_ARCHIVE, UF_HIDDEN or UF_SYSTEM bits being cleared.) and the NFS server does not support those attributes. These patches only checked for support if the archive/hidden/system attributes were non-zero. This patch fixes the problem. PR: 296088 Tested by: Joshua Kinard MFC after: 1 week Fixes: c5d72d29fe0e ("nfsv4: Add support for the NFSv4 hidden and system attributes") --- sys/fs/nfsclient/nfs_clvnops.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 26aa6491ac4a..5081e442882e 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1033,12 +1033,9 @@ nfs_setattr(struct vop_setattr_args *ap) nmp = VFSTONFS(vp->v_mount); if (vap->va_flags != VNOVAL && (!NFSHASNFSV4(nmp) || (vap->va_flags & ~(UF_ARCHIVE | UF_HIDDEN | UF_SYSTEM)) != 0 || - ((vap->va_flags & UF_ARCHIVE) != 0 && - !NFSISSET_ATTRBIT(&np->n_vattr.na_suppattr, NFSATTRBIT_ARCHIVE)) || - ((vap->va_flags & UF_HIDDEN) != 0 && - !NFSISSET_ATTRBIT(&np->n_vattr.na_suppattr, NFSATTRBIT_HIDDEN)) || - ((vap->va_flags & UF_SYSTEM) != 0 && - !NFSISSET_ATTRBIT(&np->n_vattr.na_suppattr, NFSATTRBIT_SYSTEM)))) + !NFSISSET_ATTRBIT(&np->n_vattr.na_suppattr, NFSATTRBIT_ARCHIVE) || + !NFSISSET_ATTRBIT(&np->n_vattr.na_suppattr, NFSATTRBIT_HIDDEN) || + !NFSISSET_ATTRBIT(&np->n_vattr.na_suppattr, NFSATTRBIT_SYSTEM))) return (EOPNOTSUPP); /* From nobody Thu Jun 18 04:17:16 2026 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 4ggnW129psz6jNf5 for ; Thu, 18 Jun 2026 04:17: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggnW10wgMz3kYf for ; Thu, 18 Jun 2026 04:17:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781756237; 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=XR9AkLgIe3sMjCON4BoorYC6CuxfkGGtSxxGdmkkNl8=; b=BpZtukXjZEIomMxBskse9fvvMnOhb4R8cqGdW/Efir/1zMAzruCuZialGC7CSP0eZhsLNW Vzfc/aZ94DUsG5xlRfav9yjbK/lc728TbBagTVsM1w8Cs1uhj2LSuhAwuQvmM+YA9EeR7S +0pDoOpFOOTEhYLQdfAe17BNdSs+io9TCFsGfeRoqyo77T9Qk+caNJRc20T3Xpz6wZgclR J257U+SeNPq0sSSJYKnDwy2I2jAidBNaL5anxz0HPttDm4d4aMw9LHonV7rlH5rQupBRUv TZa0L/PJ/orQY5C76i3yLLhleII1+FI2QyLL37txGA+jadZjqvndRtnK6JHZsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781756237; a=rsa-sha256; cv=none; b=CCcKhF5tyzvi29B3fdY3R/Xx3+Tdg4a3nGPW4ZqyEcVl3JsPOASkeuokcBscYWNhHf/Liz +DoDVM0V18R4KR5eiOdRYZRVMFxezzlKZpBpLm45RuWj624zuRWIbx1+7d0IU9cFQHSi2S +PM2ftL+XGnTdVkf5/8HY+9rlZQur+QZsQkqYJhV7eSjvmLUtTl3AyuU0bAMpL1H/w+pAv +TKy4LysOvwA3jace28LZ/CoU9W9R9Mb0IP3QYk9UfXfak/e538vQXthhy7oCC1jt/EYDk LU2YBcvAk25btRg+0vKTNEP9w0gvSOqaRX+qVh6zK/StL9KZXKbW2AbZzNXaiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781756237; 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=XR9AkLgIe3sMjCON4BoorYC6CuxfkGGtSxxGdmkkNl8=; b=seRKwC1RLw02wnBLoB0k+ttZAK7Rmmx6jchBLMAFTHeo4iSiRoNymRgVIOt5uj1qPqA9wI D1Kib4kxCbr7bSiILLLuPoHqZI1fpL3w1eLxExb9qlMljFd61MafgHR0KTyLfc4zi6NIlj zNT8wFGKvzDvGxhP7aYEU4ppJaz9lIz2YIVd66di+TpvSAkFnhRv6qzAcfJjcHh6DB9/S+ +mUfz7ZKOLb701+tMNyB43+7trJDZndBNOXoD1V6cM0/hkLe+/Lvi5QrGzsEwYYY26UHev DFKNsFcjoQ8VFc1OYmp7w1kSlEguzp8SnI7bL+o9YOm+nm6fp0GP7Q0UAfHVxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggnW06HQxzjh6 for ; Thu, 18 Jun 2026 04:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 187fe by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Jun 2026 04:17:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 08180f1b613b - main - witness: actually set read-only tunables in time for witness_startup 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 08180f1b613b6fe000135efa28b7c3293cbf1683 Auto-Submitted: auto-generated Date: Thu, 18 Jun 2026 04:17:16 +0000 Message-Id: <6a33714c.187fe.20ec4acc@gitrepo.freebsd.org> The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=08180f1b613b6fe000135efa28b7c3293cbf1683 commit 08180f1b613b6fe000135efa28b7c3293cbf1683 Author: Ryan Libby AuthorDate: 2026-06-18 03:52:53 +0000 Commit: Ryan Libby CommitDate: 2026-06-18 04:05:43 +0000 witness: actually set read-only tunables in time for witness_startup SYSCTL_XXX with CTLFLAG_RDTUN and without CTLFLAG_NOFETCH should not be used for values that are needed before SI_SUB_KLD. Otherwise they are tuned after they are needed. Set CTLFLAG_RDTUN | CTLFLAG_NOFETCH for the debug.witness.witness_count and debug.witness.skipspin sysctls and add separate tunables for them, which run at SI_SUB_TUNABLES time, i.e., in time for witness_startup. Reviewed by: kib, markj Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D57613 --- sys/kern/subr_witness.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index 3c192b2b0dce..2bfd8711eed7 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -404,17 +404,22 @@ SYSCTL_INT(_debug_witness, OID_AUTO, trace, CTLFLAG_RWTUN, &witness_trace, 0, "" #endif /* DDB || KDB */ #ifdef WITNESS_SKIPSPIN -int witness_skipspin = 1; +static bool witness_skipspin = true; #else -int witness_skipspin = 0; +static bool witness_skipspin = false; #endif -SYSCTL_INT(_debug_witness, OID_AUTO, skipspin, CTLFLAG_RDTUN, &witness_skipspin, 0, ""); +SYSCTL_BOOL(_debug_witness, OID_AUTO, skipspin, + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &witness_skipspin, 0, + "Skip all witness checks on spin locks"); +TUNABLE_BOOL("debug.witness.skipspin", &witness_skipspin); int badstack_sbuf_size; -int witness_count = WITNESS_COUNT; -SYSCTL_INT(_debug_witness, OID_AUTO, witness_count, CTLFLAG_RDTUN, - &witness_count, 0, ""); +static u_long witness_count = WITNESS_COUNT; +SYSCTL_ULONG(_debug_witness, OID_AUTO, witness_count, + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &witness_count, 0, + "Maximum count of lock type entries"); +TUNABLE_ULONG("debug.witness.witness_count", &witness_count); /* * Output channel for witness messages. By default we print to the console. @@ -790,7 +795,8 @@ witness_startup_count(void) /* * The WITNESS-enabled diagnostic code. Note that the witness code does * assume that the early boot is single-threaded at least until after this - * routine is completed. + * routine is completed. This routine runs during SI_SUB_VM. Any read-only + * tunables need to have been initialized by now. */ void witness_startup(void *mem) From nobody Thu Jun 18 04:17:17 2026 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 4ggnW22f4nz6jNHY for ; Thu, 18 Jun 2026 04:17:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggnW21Sysz3kYg for ; Thu, 18 Jun 2026 04:17:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781756238; 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=YrjtHoN0Ea3qtKsPNFWl4EbWLetWmck+f2L18FBhD94=; b=AnMQALZlD9nqd9HvT+Lbc1Ctch/hVTDJRTLHpIM2YDNYPZFgphcAFyZoV4LgLEpD8jkIlj 0/0nZBuHd2Z/y+SNOZcWauVnzjPwgH9F7+kh2O3BQXaO0U/YdmuZB8bUb6xlFiWyyaM1hZ yP8hAF/3AL7kw14noYqXvP59/SzoZFAqgrVaUirTxFVVIPMYZWVCjVoZZU2pZzIoV7Tn4i 1akVzATO0aBJ900NiHASE0RPUSrkbAsQXgvh1qsx/fjMcgEQmUY+l5PHZqaNXdE0/HtI3g CYs/Ndkxd6huAuHBGdcsw74W81vmWxhjJa8yTOotpm5J/7uIlbibZ+arV63emA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781756238; a=rsa-sha256; cv=none; b=uWu81CL3ObQzXo6N4n6NXzlR0gI9yDWKDlyLRdFcdmiYMeEewLNnwvnWYVTwSoSnQSTcFo Herm409YKlK0gq2WJlVqhWpooptkJszDfSyfzxPgUVZQj3JUslZRp//45+m6S14xVskGc7 yC83TTdlACg2inYDIqP3CjzlAuuLd6b6FRwc+znYN2IlATyMS+oriuqENHzgV0DKGi5lhY oGpwKY2yIh6Sk6kmh075yZwpfHD4H5nOfS/yKDzRG7C4lWErGm5ZEkmHK/dGTGNhiyGdMH abMMUSo2PiaK08i7BsvBHsJegaIc5xI3IeGjIHVDAk1MJkZ8Y51goVdS1tTJ0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781756238; 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=YrjtHoN0Ea3qtKsPNFWl4EbWLetWmck+f2L18FBhD94=; b=geZGhkIZLA9wnIS/c+HGT9RcpMiLOdhcw/bgnINitJ8Thxv3FTFNgXmpV7R/69pQnK7VrH wReTPJ461/JyegKZ2RSSRlwj8bHV2bs9IsBX4iZ73Xqw2W0wsBkhhwMW+eC/3ZS6qFgusr vU/fIrQKJ9O0fs0MZtN2WDvvjQ46altPU/Vid4bSnElKf3jZ17KT2wRp7CUn646PgpdBP1 ZTYVtwFQpArQhOu31CIEirA3jj9WDf/HlJqdG68QEZiT8sZa5JR4jIXDh6h77UAta3+dvU Jife0E43E3PW+51gA7givDjyyIx0d7UIKCbtIEao2z6CXqwZSrt1ndfLDQqpWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggnW16brdzjTP for ; Thu, 18 Jun 2026 04:17:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1bde8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Jun 2026 04:17:17 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: ca8a1c3c27b0 - main - witness: add tunables debug.witness.lock_order_{data_count,hash_size} 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ca8a1c3c27b0d5915e0dcfd02ea4ef703db4fe9a Auto-Submitted: auto-generated Date: Thu, 18 Jun 2026 04:17:17 +0000 Message-Id: <6a33714d.1bde8.72e15104@gitrepo.freebsd.org> The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=ca8a1c3c27b0d5915e0dcfd02ea4ef703db4fe9a commit ca8a1c3c27b0d5915e0dcfd02ea4ef703db4fe9a Author: Ryan Libby AuthorDate: 2026-06-18 03:54:26 +0000 Commit: Ryan Libby CommitDate: 2026-06-18 04:05:43 +0000 witness: add tunables debug.witness.lock_order_{data_count,hash_size} Add tunable debug.witness.lock_order_data_count to allow adjusting the number of witness lock order data entries (stacks) without recompiling the kernel. This may help to display stacks when a lock order reversal is reported but the number of entries is exhausted before recording the first lock order, by allowing the user to reboot with an adjusted tunable and try again. Tunable debug.witness.lock_order_hash_size is also provided to allow the hash table load factor to be managed, though that is not required. Also tweak witness_lock_order_add to avoid computing a hash when it won't be needed because the lock order data entries are exhausted. Reviewed by: kib, markj Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D57600 --- sys/kern/subr_witness.c | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index 2bfd8711eed7..21d015c4f381 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -264,7 +264,7 @@ struct witness_lock_order_data { * (struct witness_lock_order_data). */ struct witness_lock_order_hash { - struct witness_lock_order_data *wloh_array[WITNESS_LO_HASH_SIZE]; + struct witness_lock_order_data **wloh_array; u_int wloh_size; u_int wloh_count; }; @@ -421,6 +421,18 @@ SYSCTL_ULONG(_debug_witness, OID_AUTO, witness_count, "Maximum count of lock type entries"); TUNABLE_ULONG("debug.witness.witness_count", &witness_count); +static u_long witness_lo_data_count = WITNESS_LO_DATA_COUNT; +SYSCTL_ULONG(_debug_witness, OID_AUTO, lock_order_data_count, + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &witness_lo_data_count, 0, + "Maximum count of lock order data (stacks) to track"); +TUNABLE_ULONG("debug.witness.lock_order_data_count", &witness_lo_data_count); + +static u_long witness_lo_hash_size = WITNESS_LO_HASH_SIZE; +SYSCTL_ULONG(_debug_witness, OID_AUTO, lock_order_hash_size, + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &witness_lo_hash_size, 0, + "Hash table size for lock order data"); +TUNABLE_ULONG("debug.witness.lock_order_hash_size", &witness_lo_hash_size); + /* * Output channel for witness messages. By default we print to the console. */ @@ -479,7 +491,7 @@ static struct lock_list_entry w_locklistdata[LOCK_CHILDCOUNT]; static struct witness_hash w_hash; /* The witness hash table. */ /* The lock order data hash */ -static struct witness_lock_order_data w_lodata[WITNESS_LO_DATA_COUNT]; +static struct witness_lock_order_data *w_lodata; static struct witness_lock_order_data *w_lofree = NULL; static struct witness_lock_order_hash w_lohash; static int w_max_used_index = 0; @@ -788,6 +800,9 @@ witness_startup_count(void) sz += sizeof(*w_rmatrix) * (witness_count + 1); sz += sizeof(*w_rmatrix[0]) * (witness_count + 1) * (witness_count + 1); + sz += sizeof(void *); + sz += sizeof(w_lodata[0]) * witness_lo_data_count; + sz += sizeof(w_lohash.wloh_array[0]) * witness_lo_hash_size; return (sz); } @@ -818,6 +833,16 @@ witness_startup(void *mem) w_rmatrix[i] = (void *)p; p += sizeof(*w_rmatrix[i]) * (witness_count + 1); } + + /* Fix up alignment */ + p = roundup2(p, sizeof(void *)); + + w_lodata = (void *)p; + p += sizeof(w_lodata[0]) * witness_lo_data_count; + + w_lohash.wloh_array = (void *)p; + p += sizeof(w_lohash.wloh_array[0]) * witness_lo_hash_size; + badstack_sbuf_size = witness_count * 256; /* @@ -3300,14 +3325,14 @@ witness_init_hash_tables(void) /* Initialize the lock order data hash. */ w_lofree = NULL; - for (i = 0; i < WITNESS_LO_DATA_COUNT; i++) { + for (i = 0; i < witness_lo_data_count; i++) { memset(&w_lodata[i], 0, sizeof(w_lodata[i])); w_lodata[i].wlod_next = w_lofree; w_lofree = &w_lodata[i]; } - w_lohash.wloh_size = WITNESS_LO_HASH_SIZE; + w_lohash.wloh_size = witness_lo_hash_size; w_lohash.wloh_count = 0; - for (i = 0; i < WITNESS_LO_HASH_SIZE; i++) + for (i = 0; i < w_lohash.wloh_size; i++) w_lohash.wloh_array[i] = NULL; } @@ -3414,13 +3439,13 @@ witness_lock_order_add(struct witness *parent, struct witness *child) & WITNESS_LOCK_ORDER_KNOWN) return (1); - hash = witness_hash_djb2((const char *)&key, - sizeof(key)) % w_lohash.wloh_size; w_rmatrix[parent->w_index][child->w_index] |= WITNESS_LOCK_ORDER_KNOWN; data = w_lofree; if (data == NULL) return (0); w_lofree = data->wlod_next; + hash = witness_hash_djb2((const char *)&key, + sizeof(key)) % w_lohash.wloh_size; data->wlod_next = w_lohash.wloh_array[hash]; data->wlod_key = key; w_lohash.wloh_array[hash] = data; From nobody Thu Jun 18 13:48:59 2026 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 4gh2Bh1MBdz6hFK8 for ; Thu, 18 Jun 2026 13:49: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gh2Bg6yW3z3rj9 for ; Thu, 18 Jun 2026 13:48:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781790540; 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=Wd6nRGUu1PsIznftfy/UDVHwMifhBfuOkXSe7SbGyF8=; b=iLvzX6wWb5Eg9YYiR5UCMHRlbawcIkLWZN5IgIB/Yv0z0NB27YIqh6pOorqNdEpBeN2Mxx VK78Gdfltsm37REk6rRzjEeYveO1Od+AtFXcZvtcTeXZ6PO7gZlD+arpo/7miuH+tnUhfj kQe41vJ4wvxK3Z5ME98VZoIUrwyc0npjqroIKYdKNrwwlaRyGUBuR4hjRNH3XXgizrMhCW BvrnzjLpaOrdHOBaL8+LF2HCq1ST/x84LLpTR0KkdUbyJxeIc97HFxNvHRFLIPvfhUBRhu HEvULBCU/12XW/DuWzyJNQjOVAn8iUuOq661OyoG7ljfoeZW9ZvK1EFf1hOTBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781790540; a=rsa-sha256; cv=none; b=yAaeyC6IeB2aKInbPQTY0P+GOZO7AQqkUZWt+lMWhTF4VK8Sjs3Jv8uuydcs9+eKE+qzwf XxebAOIOnWSotle69lyenpQqTFUzgczH5X26TBhCmMYzhvy7UCR4N20fdMeBEQMjmQVZYQ t1GONLsvfxKg5snV0JkSr70McURTX1UGxzlj3EfVxKYjkdOXAMVqgAkokSMsdpSGOp4Mpi OlPL+zmIoeftBI4LHPaeAU8nqrtLGKiGkRHTuKSv8PDJSoH7z/CE8nThitV83vRrut81NY nP9nuxsQdoNULGuJObvdSWKkKCDV+qZ0f1BJG7R9GP2/8fbknBeO1k8K0jfkjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781790540; 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=Wd6nRGUu1PsIznftfy/UDVHwMifhBfuOkXSe7SbGyF8=; b=iVNbFeBcKa/Y09pyICNVmO6yn9i5nKGdRr6aHfVhhovKLraZStkTlX6IJYcZvRb2xiV6ls fmOBlYPEw3DjJDWZIdykVVzGu6rsIQ7NKLykgm5HIvEC0fMsQWayb5eb0LcpdYqUyiwt0v rUKm5wkf6oLH0+BRQDxZ2XCxpOzbJ6Vpxz6RqLjvXoi63lDX9+1wB2iUgar4Lcf+cNnVTq WDQUyJvbvwioecfPba6/zQsWW2uJpV/pdJzVw4xmICxGeZynxeQ0H7gpp+LJNBu1J7JFjW 7VQCA3LbQcG/8OZb34GYa7qB3z/Z8dFBaTFedBqEIGvEq8uCCt7G+HiXIKG60g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gh2Bg3fYdz118M for ; Thu, 18 Jun 2026 13:48:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 389d4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Jun 2026 13:48:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: fd1ee28bd014 - main - uvideo.4: Initial manual page 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd1ee28bd01429aa8c38199d5fc069e8b0b75442 Auto-Submitted: auto-generated Date: Thu, 18 Jun 2026 13:48:59 +0000 Message-Id: <6a33f74b.389d4.4d9894a5@gitrepo.freebsd.org> The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=fd1ee28bd01429aa8c38199d5fc069e8b0b75442 commit fd1ee28bd01429aa8c38199d5fc069e8b0b75442 Author: Alexander Ziaee AuthorDate: 2026-06-18 13:48:09 +0000 Commit: Alexander Ziaee CommitDate: 2026-06-18 13:48:19 +0000 uvideo.4: Initial manual page Fixes: b711ef9c75ba (import uvideo) Reviewed by: 0mp, bapt, kevans Differential Revision: https://reviews.freebsd.org/D57622 --- share/man/man4/Makefile | 1 + share/man/man4/uvideo.4 | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index a66d011f7b62..b451fe25d180 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -1133,6 +1133,7 @@ MAN+= \ usbhid.4 \ usfs.4 \ uslcom.4 \ + uvideo.4 \ uvisor.4 \ uvscom.4 \ veriexec.4 \ diff --git a/share/man/man4/uvideo.4 b/share/man/man4/uvideo.4 new file mode 100644 index 000000000000..c7de2d7a0859 --- /dev/null +++ b/share/man/man4/uvideo.4 @@ -0,0 +1,39 @@ +.\" +.\" Copyright (c) 2026 Alexander Ziaee. Ohio. +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd June 17, 2026 +.Dt UVIDEO 4 +.Os +.Sh NAME +.Nm uvideo +.Nd USB video class webcam and capture driver +.Sh SYNOPSIS +.Cd device uvideo +.Sh HARDWARE +The +.Nm +driver supports USB Video Class +.Pq UVC +devices such as: +.Pp +.Bl -bullet -compact +.It +Cameras +.It +Capture devices +.El +.Sh HISTORY +The +.Nm +driver appeared in +.Ox 4.4 +and +.Fx 16.0 . +.Pp +Historically, these devices were supported by +.Sy webcamd +from the +.Fx +Ports Collection. From nobody Thu Jun 18 14:57:38 2026 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 4gh3jt68wNz6hLyy for ; Thu, 18 Jun 2026 14:57: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gh3jt5C0Sz43mW for ; Thu, 18 Jun 2026 14:57:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781794658; 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=EJLgvs9YmhyhkAJAwKsOzt2Pz4wbuMyi7DN4C1dMgJw=; b=qyLdF7Thj/WJWg4MeK1GZR5g1qY/waUZVHxEQh7KTcrDAPLL8l7ZQ9N/nZyliNaGYuSosx ITQ5tP+EGpyybLUMq9kBr/UL7stTjx5HXppoSCeNoCeLY6LzWwbX0ZLhaZVo/8dwYFweRG VgcMdoJFzONzvtCErNZ1P3wWRuW3Sb+0rNk7NAlFieWYrTGLTfXdQCljufKcR90sAGk9kd 0jnbNsKNkR0WBsD+f5cmM/XVgGx2LLUDOyhC+wSIQkUsYhD6EZfDbxJpmiA4IpwY5oiwPV 80RU9kXanl0kxds/bXsRZVcX4iJV5tFPGr4dPelH5rDlmK39dgx2GhtKCNvcxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781794658; a=rsa-sha256; cv=none; b=vjXiBpUksz8VLgLztDnFv5xD+elzsPlYB4zR1PE8htPQYnpFUs+zsbKmsKFrZEARLU30qJ atLbjXe8kPfST8szv0oIdCvK6TNL5hi0hY5aTJ52g+sXLZC/HxMKutN5OSzVPha9SGJ0tD HSZovavNxAwb47zgZFcmHDC6F11HuzSLGSFYYJeRou8BqsKXF/aM2P37/TdoRQ9TDqYThI ipr0PqVVx+sjxKZ7SOtjdDvsU7VZIGd6VqojqUQhMX8xOJbOqL/vG2YLW0g/Iz6I1zxF1d KdKHV99vE+ub4QmxqkE6psbiZheBdPtFNg/FUPjJiF6X54acQafdhkEtSHohKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781794658; 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=EJLgvs9YmhyhkAJAwKsOzt2Pz4wbuMyi7DN4C1dMgJw=; b=j1B+zeA5Wyla2DaDwMdS5Y0O/i7KAB0wFnuaUM15nFLkByybCFuFYnMTFcKvara9aaAf2U BTDZ4Ow0GXtXuzMAf1U6fGPk1MMJyx2XtJsp6iAZ1PoKpYFb12qpzupZPVDS5oYGNmShLu Eynd8z2NZTHnlsMaK/+k65tYwsdYX4ftjEE6VBZkI0IRHYinDOZZqorFsTeH2YKPDBboiA exjyJd7FqHhEP8zSa+Ziae2B1+6ntw9bpTodLchM6R2cv/49GnM0r9IRbYkCV24Cq4W6s+ B/AanSnqpO+LdEQ73FSQirF+0ej3FFn8/zPQWdbqU2oGAfMqcOoS1XLVzrB9lQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gh3jt48djz138R for ; Thu, 18 Jun 2026 14:57:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f6d4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Jun 2026 14:57:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: a9e12d3ec8bd - main - arm64: Support building sys/sysl instructions 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a9e12d3ec8bde29e97227757bc08cb1a0a93afa9 Auto-Submitted: auto-generated Date: Thu, 18 Jun 2026 14:57:38 +0000 Message-Id: <6a340762.3f6d4.3fa74943@gitrepo.freebsd.org> The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=a9e12d3ec8bde29e97227757bc08cb1a0a93afa9 commit a9e12d3ec8bde29e97227757bc08cb1a0a93afa9 Author: Andrew Turner AuthorDate: 2026-06-18 13:34:04 +0000 Commit: Andrew Turner CommitDate: 2026-06-18 14:56:52 +0000 arm64: Support building sys/sysl instructions Add support to build system instructions from a macro. These are based on the existing support for msr/mrs instructions with adjustments for the different instruction format. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D57017 --- sys/arm64/include/_armreg.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/sys/arm64/include/_armreg.h b/sys/arm64/include/_armreg.h index 0f5134e5a978..0ade9e6168c9 100644 --- a/sys/arm64/include/_armreg.h +++ b/sys/arm64/include/_armreg.h @@ -52,6 +52,34 @@ #define WRITE_SPECIALREG(reg, _val) \ __asm __volatile("msr " __STRING(reg) ", %0" : : "r"((uint64_t)_val)) + +#define __SYS_ALT_NAME(op1, crn, crm, op2) \ + "#" #op1 ", C" #crn ", C" #crm ", #" #op2 +#define _SYS_ALT_NAME(op1, crn, crm, op2) \ + __SYS_ALT_NAME(op1, crn, crm, op2) +#define SYS_ALT_NAME(insn) \ + _SYS_ALT_NAME(insn##_op1, insn##_CRn, insn##_CRm, insn##_op2) + +#define SYS(insn) do { \ + _Static_assert(insn##_op0 == 1, "Invalid SYS instruction"); \ + __asm __volatile("sys " SYS_ALT_NAME(insn)); \ +} while (0) + +#define SYS_ARG(insn, _val) do { \ + _Static_assert(insn##_op0 == 1, "Invalid SYS instruction"); \ + __asm __volatile("sys " SYS_ALT_NAME(insn) ", %0" \ + : : "r"((uint64_t)_val)); \ +} while (0) + +#define SYSL(insn) \ +({ \ + uint64_t _val; \ + _Static_assert(insn##_op0 == 1, "Invalid SYS instruction"); \ + __asm __volatile("sysl %0, " SYS_ALT_NAME(insn) \ + : "=&r"(_val)); \ + _val; \ +}) + #define UL(x) UINT64_C(x) #endif /* !_MACHINE__ARMREG_H_ */ From nobody Thu Jun 18 14:57:39 2026 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 4gh3jv6qmTz6hM4y for ; Thu, 18 Jun 2026 14:57: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gh3jv5x45z43qr for ; Thu, 18 Jun 2026 14:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781794659; 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=RD41JtZ3nV0kHcqBTqe2PCnt4fB2YhiU3lurUPNI/a4=; b=H21yxigU7doKlVjgaTlXXfN196Bwf2SLyUShimVj7hjHkJMRYrHa/WtUnmt8F5HnKJBbHx HsmlTA3y0U8t1ibpH1G7EmKxnzRdUG39tSNCzEKJ6xumuGQPhdaCi1bufAL133HhJfZyHu xK88NgbZyf8fI8dpuxQwNB/vh8AskYRWVwftNzxxFauqkXH3VZwsP2aumIiDu3W85bWPcM iJUxRvmG4CRFwVxnInDpDs9BIPCn+NJx5Lgzjg5RmT+vDsYcOLXmgp0muZIgWzDjHKLMsj 1M5fD76cZQ5EH61r0tbmXZz9Uh8PN8XuwFnl7yLT59LI+uKj4ZrwBrqUJWaNGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781794659; a=rsa-sha256; cv=none; b=KdEVMrg4e3OAAtZfMGbvdSJtqyVptgyW/cq23p8P1P81lqhccB0G3hV9HpFh0rfWrJ4HVi FB2GexKhKbnQzX96Nc+BVRnL2x0lunbgxFbnxsYnGZUJQR72OYV9XHVP4tdMw8+h/a52Yb 9L4YSkIZJPfsJWZ/Ft/heLjB4oMJE5FPXAt1yLhPsAi6U6Z1/1mDtdT9KAQkFg3qGBwRHt naosvVn6rtTv1NrZ/WryAJP1RO0us1nd5TjkuYcINu3SSd+Hs3npjb8ei5NSVlXeJYg+Eg /7XAqpSfYehogSWi/kNON/BPpfKI0ThHAkBz5qsNcyMH4LJ+vOFc23bY+0HTdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781794659; 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=RD41JtZ3nV0kHcqBTqe2PCnt4fB2YhiU3lurUPNI/a4=; b=DT20UHDBti1uMJgbb1q/OdrfGhcnkr0J9kA92hYyR1R90EuEV64mdoFMrT5ET4OCLk1ckY 3tLpobMlDaMOV8AdGHY5Kg97DUygyBqGETL4rpTZp6Ml6faVFVYWK1lAO5q2SX7zY4F7Uj jQAfx+tK5FeYZhklhHn62WZvFSoQDP766umYkw0WBWEm83WL0LhNoMCT1eHN6HJ6INxIOY pS2c/Jt8yPJqo3PUvLexXXxK2Qx8c2x9HFtX6kgpGWfZOadcCfpzbtoAYz//iBJmlZ6idu dqS3byjYFyDDZSbYyaDKragHGot9EdFWZvo2AqxSX45Bdldd0VjyTPYP9E/L/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gh3jv4lFSz13HZ for ; Thu, 18 Jun 2026 14:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f5e5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Jun 2026 14:57:39 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: cd94485281f3 - main - arm64: Add FEAT_ALWAYS_ENABLE to cpu_feat 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd94485281f3fc6ae5414180420527ce11846742 Auto-Submitted: auto-generated Date: Thu, 18 Jun 2026 14:57:39 +0000 Message-Id: <6a340763.3f5e5.41d762a3@gitrepo.freebsd.org> The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=cd94485281f3fc6ae5414180420527ce11846742 commit cd94485281f3fc6ae5414180420527ce11846742 Author: Andrew Turner AuthorDate: 2026-06-18 13:34:47 +0000 Commit: Andrew Turner CommitDate: 2026-06-18 14:56:53 +0000 arm64: Add FEAT_ALWAYS_ENABLE to cpu_feat A use for it has been found in the GICv5 driver where we need to read the Interrupt Affinity ID early in the boot on the secondary CPUs. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D54249 --- sys/arm64/arm64/cpu_feat.c | 24 +++++++++++++----------- sys/arm64/include/cpu_feat.h | 7 ++++++- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/sys/arm64/arm64/cpu_feat.c b/sys/arm64/arm64/cpu_feat.c index 94114d47f846..8b8af5fc7cf7 100644 --- a/sys/arm64/arm64/cpu_feat.c +++ b/sys/arm64/arm64/cpu_feat.c @@ -87,17 +87,19 @@ enable_cpu_feat(uint32_t stage) if (check_status == FEAT_ALWAYS_DISABLE) goto next; - /* The user disabled the feature */ - if ((feat->feat_flags & CPU_FEAT_USER_DISABLED) != 0) - goto next; - - /* - * The feature was disabled by default and the user - * didn't enable it then skip. - */ - if (check_status == FEAT_DEFAULT_DISABLE && - (feat->feat_flags & CPU_FEAT_USER_ENABLED) == 0) - goto next; + if (check_status != FEAT_ALWAYS_ENABLE) { + /* The user disabled the feature */ + if ((feat->feat_flags & CPU_FEAT_USER_DISABLED) != 0) + goto next; + + /* + * The feature was disabled by default and the user + * didn't enable it then skip. + */ + if (check_status == FEAT_DEFAULT_DISABLE && + (feat->feat_flags & CPU_FEAT_USER_ENABLED) == 0) + goto next; + } /* * Check if the feature has any errata that may need a diff --git a/sys/arm64/include/cpu_feat.h b/sys/arm64/include/cpu_feat.h index 6a311d4000bb..5eff7f589d8b 100644 --- a/sys/arm64/include/cpu_feat.h +++ b/sys/arm64/include/cpu_feat.h @@ -62,7 +62,12 @@ typedef enum { */ FEAT_DEFAULT_ENABLE, - /* We could add FEAT_ALWAYS_ENABLE if a need was found. */ + /* + * Always enabled. Used when there is no way for the kernel to + * work without the feature, e.g. configuring the interrupt + * controller. + */ + FEAT_ALWAYS_ENABLE, } cpu_feat_en; #define CPU_FEAT_STAGE_MASK 0x00000001 From nobody Thu Jun 18 14:57:40 2026 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 4gh3jw6vrbz6hM50 for ; Thu, 18 Jun 2026 14:57: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gh3jw6NVWz43mX for ; Thu, 18 Jun 2026 14:57:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781794660; 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=j1bS1CVw0yK2Eh0A4v7ZZuiN885UEFFkGY6iS/jeFTk=; b=Fl/jZENu5oibVB0PPguJN6MrE/7ynXZJVlxwtgztLHnrzzLK76GwOPNITeButI5tNQU6d4 7LKWpYFuc04jTarpO52lrlaby8/wMMKPKmqmTjecriEFp4SCLtv4BWAz3sK288AwuSRFRD zonMGm+Qxjj+TQN0iZVOpzsuxt3uCKlQ+5/O+o7gN8OM+NpyWqxMqkvYVF/NyybDUR1qup 9ow6CBxEUEb1K9Gj4xCFdsqf5vsJ2whGX7nKv+UGABE/T09oipaLjxb7nuzP9W/TXpcfnG HmdEw/dgJg6ECQ/vS8bChgPmJ+RGE+I7aAJQxopG45pqBHgBS4w9+XFnGLeO7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781794660; a=rsa-sha256; cv=none; b=QIz/aM/ekdGVh85KtEU7Sc6qxEF3PYdnNmE/NO8VYQs/7pxL3bZwI8VFDXMmxI/cNZNTN5 ohlKc3S6nk91m6u+T1/ALI0Z8T38tk5gSyp6Mh2+78D3Ah4/f4iPeF4nN/m6AZ7h3+LW87 QrAjqAHBjR+UxKTr003gIily/mZ7c//KT2UAzUWlPvMaBy5/UQDOfUS3cv1fDAZkQVZVAu rqKaCp57l73nELK4K3SmPA2l6VwCdQfwyWIoue3/tu0MZipNnmTwy8RfD6a+fbJnoA3/j0 uKmMwpXL8ff4ixwnC1nHnkeB27ertn2vFsrIVK0zsIrvZH+AZe3HsEig/8+A+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781794660; 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=j1bS1CVw0yK2Eh0A4v7ZZuiN885UEFFkGY6iS/jeFTk=; b=NiTlcupgxckzadDp5gNAhmBQDczcD4B0dOgCj+HnQ75kzRnwVJ+tuc0Vt6u95v+IWklJfP cFE++WmYC4KusRYMxHVclHmCjjaoKW51w7H+/VYz7Ek1IBqS1Mw7hzsWRozIBArEsYyFFe veOOItF33c0dV54Obvh1nw27I+bpMUNQXvI3TqEW3miE4smsV5s1fHQ2iqG/8wI8mc0kg+ 2xMsd2KVpRMHDlGjdgH0RfJImGE0JZ2x5pil65cltiYnZGS5H30iIB+PKsmUaB9GAuPODt vLoJJxJ4Rn+8qSTOnMwXIP59pWq+cKbna4eceFk7Y8Ylpy/Eo0b2mVm2A33+Dg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gh3jw5K9Nz13Vt for ; Thu, 18 Jun 2026 14:57:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f96f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Jun 2026 14:57:40 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: c84261da6f6c - main - arm64: Add an initial GICv5 driver 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c84261da6f6ca6ae6d66eebb86da02467da3dd95 Auto-Submitted: auto-generated Date: Thu, 18 Jun 2026 14:57:40 +0000 Message-Id: <6a340764.3f96f.3b0a1d9d@gitrepo.freebsd.org> The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=c84261da6f6ca6ae6d66eebb86da02467da3dd95 commit c84261da6f6ca6ae6d66eebb86da02467da3dd95 Author: Andrew Turner AuthorDate: 2026-06-18 13:30:01 +0000 Commit: Andrew Turner CommitDate: 2026-06-18 14:56:53 +0000 arm64: Add an initial GICv5 driver Add an initial driver for the GICv5 interrupt controller. This provides host-only support for the GICv5 interrupt controller. It is specified in the ARM-AES-0070 document & based on version 00eac0. In the GICv5 there are 3 interrupt spaces: PPI, SPI, and LPI. Unlike previous interrupt controllers they don't share a single interrupt ID range, so PPI IRQ 1 and SPI IRQ 1 are different interrupts. There is a common irqsrc stricture that encodes this information as it is common across the interrupt types. Unlike previous GIC versions there are no software generated interrupts that can target a configurable collection of CPUs. These have been replaced with LPIs, where each CPU will have one allocated for each IPI type. This driver handles the CPU interface and interrupt routing service (IRS). The CPU interface provides the interface to manage and handle interrupts, while the IRS handles routing LPIs and SPIs to the target CPU. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D54250 --- sys/arm64/arm64/gicv5.c | 1611 +++++++++++++++++++++++++++++++++++++++++++ sys/arm64/arm64/gicv5_fdt.c | 300 ++++++++ sys/arm64/arm64/gicv5reg.h | 711 +++++++++++++++++++ sys/arm64/arm64/gicv5var.h | 71 ++ sys/conf/files.arm64 | 2 + 5 files changed, 2695 insertions(+) diff --git a/sys/arm64/arm64/gicv5.c b/sys/arm64/arm64/gicv5.c new file mode 100644 index 000000000000..f42e3c97352c --- /dev/null +++ b/sys/arm64/arm64/gicv5.c @@ -0,0 +1,1611 @@ +/*- + * Copyright (c) 2015-2016 The FreeBSD Foundation + * Copyright (c) 2025 Arm Ltd + * + * 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 "opt_acpi.h" +#include "opt_platform.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#ifdef FDT +#include +#include +#endif + +#include "pic_if.h" + +#include +#include "gicv5reg.h" +#include "gicv5var.h" +#include "gic_v3_var.h" /* For GICV3_IVAR_NIRQS */ + +#define GICV5_PPIS_PER_REG 64 +#define GICV5_PPI_COUNT 128 + +#define LPI_IPI_BASE 0 +#define LPI_IPI_LIMIT (LPI_IPI_BASE + (mp_maxid + 1) * INTR_IPI_COUNT) +#define LPI_IS_IPI(lpi) ((lpi) < LPI_ITS_BASE) +#define LPI_IPI_IDX(lpi) ((lpi) - LPI_IPI_BASE) +#define LPI_TO_IPI(lpi) (LPI_IPI_IDX(lpi) % INTR_IPI_COUNT) +#define IPI_TO_LPI(ipi, cpu) ((cpu) * INTR_IPI_COUNT + (ipi)) + +#define LPI_ITS_BASE (LPI_IPI_BASE + LPI_IPI_LIMIT) + +/* 2^12 LPIs should be enough for a linear table */ +#define GICV5_LPI_ID_BITS_MAX 12 + +#define IRS_CFG_READ_4(_irs, _reg) \ + bus_read_4((_irs)->irs_cfg, (_reg)) +#define IRS_CFG_WRITE_4(_irs, _reg, _val) \ + bus_write_4((_irs)->irs_cfg, (_reg), (_val)) +#define IRS_CFG_READ_8(_irs, _reg) \ + bus_read_8((_irs)->irs_cfg, (_reg)) +#define IRS_CFG_WRITE_8(_irs, _reg, _val) \ + bus_write_8((_irs)->irs_cfg, (_reg), (_val)) + +struct gicv5_irs { + cpuset_t irs_cpus; + struct resource *irs_cfg; + uint64_t *ist_base; + + u_int irs_next_irq_cpu; + + u_int irs_parange; + + int irs_cfg_rid; + u_int irs_spi_start; + u_int irs_spi_count; + + struct mtx irs_lock; + size_t irs_lpi_l2size; + u_int irs_lpi_l2bits; + bool irs_lpi_2l; + +#ifdef INVARIANTS + bool irs_ready; +#endif +}; + +struct gicv5_irqsrc { + struct gicv5_base_irqsrc gi_isrc; + struct gicv5_irs *gi_irs; + enum intr_polarity gi_pol; + enum intr_trigger gi_trig; +}; + +static __read_mostly int *gicv5_iaffids; + +static bus_print_child_t gicv5_print_child; +static bus_read_ivar_t gicv5_read_ivar; +static bus_get_cpus_t gicv5_get_cpus; +static bus_get_resource_list_t gicv5_get_resource_list; +static pic_disable_intr_t gicv5_disable_intr; +static pic_enable_intr_t gicv5_enable_intr; +static pic_map_intr_t gicv5_map_intr; +static pic_setup_intr_t gicv5_setup_intr; +static pic_teardown_intr_t gicv5_teardown_intr; +static pic_post_filter_t gicv5_post_filter; +static pic_post_ithread_t gicv5_post_ithread; +static pic_pre_ithread_t gicv5_pre_ithread; +static pic_bind_intr_t gicv5_bind_intr; +#ifdef SMP +static pic_init_secondary_t gicv5_init_secondary; +static pic_ipi_send_t gicv5_ipi_send; +static pic_ipi_setup_t gicv5_ipi_setup; +#endif + +static device_method_t gicv5_methods[] = { + /* Bus interface */ + DEVMETHOD(bus_print_child, gicv5_print_child), + DEVMETHOD(bus_read_ivar, gicv5_read_ivar), + DEVMETHOD(bus_get_cpus, gicv5_get_cpus), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_get_resource_list, gicv5_get_resource_list), + DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), + DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + + /* Interrupt controller interface */ + DEVMETHOD(pic_disable_intr, gicv5_disable_intr), + DEVMETHOD(pic_enable_intr, gicv5_enable_intr), + DEVMETHOD(pic_map_intr, gicv5_map_intr), + DEVMETHOD(pic_setup_intr, gicv5_setup_intr), + DEVMETHOD(pic_teardown_intr, gicv5_teardown_intr), + DEVMETHOD(pic_post_filter, gicv5_post_filter), + DEVMETHOD(pic_post_ithread, gicv5_post_ithread), + DEVMETHOD(pic_pre_ithread, gicv5_pre_ithread), + DEVMETHOD(pic_bind_intr, gicv5_bind_intr), +#ifdef SMP + DEVMETHOD(pic_init_secondary, gicv5_init_secondary), + DEVMETHOD(pic_ipi_send, gicv5_ipi_send), + DEVMETHOD(pic_ipi_setup, gicv5_ipi_setup), +#endif + + /* End */ + DEVMETHOD_END +}; + +DEFINE_CLASS_0(gic, gicv5_driver, gicv5_methods, sizeof(struct gicv5_softc)); + +static int +gicv5_wait_for_op(struct gicv5_irs *irs, bus_size_t reg, uint32_t mask, + uint32_t *valp) +{ + uint32_t val; + int timeout; + +#ifdef INVARIANTS + if (irs->irs_ready) + mtx_assert(&irs->irs_lock, MA_OWNED); +#endif + + /* Timeout of ~10ms */ + timeout = 10000; + do { + val = IRS_CFG_READ_4(irs, reg); + if ((val & mask) != 0) { + if (valp != NULL) + *valp = val; + return (0); + } + DELAY(1); + } while (--timeout > 0); + + return (ETIMEDOUT); +} + +static int +gicv5_wait_irs_cr0_idle(struct gicv5_irs *irs) +{ + return (gicv5_wait_for_op(irs, IRS_CR0, IRS_CR0_IDLE, NULL)); +} + +static int +gicv5_wait_irs_spi_status_idle(struct gicv5_irs *irs) +{ + uint32_t val; + int error; + + error = gicv5_wait_for_op(irs, IRS_SPI_STATUSR, IRS_SPI_STATUSR_IDLE, + &val); + if (error != 0) + return (error); + + if ((val & IRS_SPI_STATUSR_V) == 0) + return (EIO); + + return (0); +} + +static void +gicv5_irs_init_ist(struct gicv5_softc *sc, struct gicv5_irs *irs, + uint64_t cfgr) +{ + IRS_CFG_WRITE_4(irs, IRS_IST_CFGR, cfgr); + + KASSERT((vtophys(irs->ist_base) & ~IRS_IST_BASER_ADDR_MASK) == 0, + ("%s: Invalid IST base address %lx", __func__, + vtophys(irs->ist_base))); + IRS_CFG_WRITE_8(irs, IRS_IST_BASER, vtophys(irs->ist_base) | + IRS_IST_BASER_VALID); + + gicv5_wait_for_op(irs, IRS_IST_STATUSR, IRS_IST_STATUSR_IDLE, NULL); +} + +static void +gicv5_irs_alloc_ist(struct gicv5_softc *sc, struct gicv5_irs *irs, + size_t size) +{ + irs->ist_base = contigmalloc(size, M_DEVBUF, M_WAITOK | M_ZERO, 0, + (1ul << irs->irs_parange) - 1, size, 0); + if (sc->gic_coherent) + /* Ensure the IRS observed zeroed memory */ + dsb(ishst); + else + cpu_dcache_wbinv_range(irs->ist_base, size); + +} + +static void +gicv5_irs_alloc_linear(struct gicv5_softc *sc, struct gicv5_irs *irs, + uint32_t *cfgrp, u_int lpi_id_bits, u_int istsz) +{ + size_t size; + uint32_t cfgr; + u_int n; + + MPASS(istsz <= IRS_IST_CFGR_ISTSZ_16_VAL); + + /* + * This is the alignment calculation from the IRS_IST_BASER + * definition. If the size is > 64 bytes then size == align. + * For sizes < 64 bytes we can just round up the size. + */ + n = MAX(5, istsz + 1 + lpi_id_bits); + size = 1ul << (n + 1); + + gicv5_irs_alloc_ist(sc, irs, size); + + irs->irs_lpi_2l = false; + + cfgr = IRS_IST_CFGR_STRUCTURE_LINEAR; + cfgr |= istsz << IRS_IST_CFGR_ISTSZ_SHIFT; + cfgr |= lpi_id_bits << IRS_IST_CFGR_LPI_ID_BITS_SHIFT; + *cfgrp = cfgr; +} + +static void +gicv5_irs_alloc_2level(struct gicv5_softc *sc, struct gicv5_irs *irs, + uint32_t *cfgrp, u_int lpi_id_bits, u_int istsz, u_int l2sz) +{ + size_t size; + uint32_t cfgr; + u_int n; + + MPASS(istsz <= IRS_IST_CFGR_ISTSZ_16_VAL); + + /* + * This is the alignment calculation from the IRS_IST_BASER + * definition. If the size is > 64 bytes then size == align. + * for sizes < 64 bytes we can just round up the size. + */ + n = MAX(5, lpi_id_bits - L2_ISTE_LOG2_ENTRIES(istsz, l2sz) + 2); + size = 1ul << (n + 1); + + gicv5_irs_alloc_ist(sc, irs, size); + + irs->irs_lpi_l2size = 1ul << (L2_ISTE_LOG2_SIZE(l2sz)); + irs->irs_lpi_l2bits = L2_ISTE_LOG2_ENTRIES(istsz, l2sz); + irs->irs_lpi_2l = true; + + cfgr = IRS_IST_CFGR_STRUCTURE_2LVL; + cfgr |= istsz << IRS_IST_CFGR_ISTSZ_SHIFT; + cfgr |= l2sz << IRS_IST_CFGR_L2SZ_SHIFT; + cfgr |= lpi_id_bits << IRS_IST_CFGR_LPI_ID_BITS_SHIFT; + *cfgrp = cfgr; +} + +void +gicv5_irs_extend_ist(device_t dev, device_t child, u_int lpi) +{ + struct gicv5_softc *sc; + struct gicv5_devinfo *di; + struct gicv5_irs *irs; + void *l2_ist; + size_t size; + u_int index; + + di = device_get_ivars(child); + irs = di->di_irs; + MPASS(irs != NULL); + + /* + * If we have a linear table then we don't need to extend it, it is + * already large enough for all LPIs we could allocate. + */ + if (!irs->irs_lpi_2l) + return; + + sc = device_get_softc(dev); + index = lpi >> irs->irs_lpi_l2bits; + size = irs->irs_lpi_l2size; + + /* Check if there the l2 pointer is valid */ + if ((irs->ist_base[index] & L1_ISTE_VALID) != 0) { + return; + } + + /* Try allocating the level 2 IST */ + l2_ist = contigmalloc(size, M_DEVBUF, M_WAITOK | M_ZERO, 0, + (1ul << irs->irs_parange) - 1, size, 0); + + mtx_lock_spin(&irs->irs_lock); + + /* Check if we won the race */ + if ((irs->ist_base[index] & L1_ISTE_VALID) != 0) { + mtx_unlock_spin(&irs->irs_lock); + free(l2_ist, M_DEVBUF); + return; + } + + irs->ist_base[index] = vtophys(l2_ist) | L1_ISTE_VALID; + if (sc->gic_coherent) { + dsb(ishst); + } else { + cpu_dcache_wbinv_range(l2_ist, size); + cpu_dcache_wb_range(&irs->ist_base[index], + sizeof(irs->ist_base[index])); + } + + IRS_CFG_WRITE_4(irs, IRS_MAP_L2_ISTR, lpi); + + gicv5_wait_for_op(irs, IRS_IST_STATUSR, IRS_IST_STATUSR_IDLE, NULL); + + if (!sc->gic_coherent) + cpu_dcache_inv_range(&irs->ist_base[index], + sizeof(irs->ist_base[index])); + mtx_unlock_spin(&irs->irs_lock); +} + +void +gicv5_irs_init(device_t dev, u_int idx, cpuset_t *cpuset) +{ + struct gicv5_softc *sc; + + sc = device_get_softc(dev); + + MPASS(idx < sc->gic_nirs); + MPASS(sc->gic_irs != NULL); + MPASS(sc->gic_irs[idx] == NULL); + + sc->gic_irs[idx] = malloc(sizeof(*sc->gic_irs[0]), M_DEVBUF, + M_ZERO | M_WAITOK); + CPU_COPY(cpuset, &sc->gic_irs[idx]->irs_cpus); + sc->gic_irs[idx]->irs_cfg_rid = idx; +} + +static void +gicv5_irs_attach(device_t dev, struct gicv5_irs *irs, u_int idx) +{ + struct gicv5_softc *sc; + const char *name; + uint64_t icc_idr0; + uint32_t cfgr, cr1, idr2; + u_int istsz, lpi_id_bits, l2sz, spi_count, spi_end; + int error, iaffid; + bool two_levels; + + sc = device_get_softc(dev); + name = device_get_nameunit(dev); + + /* The attachment needs to set this */ + MPASS(!CPU_EMPTY(&irs->irs_cpus)); + +#ifdef INVARIANTS + irs->irs_ready = false; +#endif + mtx_init(&irs->irs_lock, "GICv5 IRS lock", NULL, MTX_SPIN); + + irs->irs_cfg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &irs->irs_cfg_rid, RF_ACTIVE); + if (irs->irs_cfg == NULL) + panic("%s: Unable to allocate memory resource", + device_get_nameunit(dev)); + + switch (bus_read_4(irs->irs_cfg, IRS_IDR0) & IRS_IDR0_PA_RANGE_MASK) { + default: + case IRS_IDR0_PA_RANGE_4G: + irs->irs_parange = 32; + break; + case IRS_IDR0_PA_RANGE_64G: + irs->irs_parange = 36; + break; + case IRS_IDR0_PA_RANGE_1T: + irs->irs_parange = 40; + break; + case IRS_IDR0_PA_RANGE_4T: + irs->irs_parange = 42; + break; + case IRS_IDR0_PA_RANGE_16T: + irs->irs_parange = 44; + break; + case IRS_IDR0_PA_RANGE_256T: + irs->irs_parange = 48; + break; + case IRS_IDR0_PA_RANGE_4P: + irs->irs_parange = 52; + break; + case IRS_IDR0_PA_RANGE_64P: + irs->irs_parange = 56; + break; + } + + /* Set the control registers */ + if (sc->gic_coherent) { + cr1 = IRS_CR1_VPED_WA | + IRS_CR1_VPED_RA | + IRS_CR1_VMD_WA | + IRS_CR1_VMD_RA | + IRS_CR1_VPET_WA | + IRS_CR1_VPET_RA | + IRS_CR1_VMT_WA | + IRS_CR1_VMT_RA | + IRS_CR1_IST_WA | + IRS_CR1_IST_RA | + IRS_CR1_IC_WB | + IRS_CR1_OC_WB | + IRS_CR1_SH_IS; + } else { + cr1 = IRS_CR1_VPED_NO_WA | + IRS_CR1_VPED_NO_RA | + IRS_CR1_VMD_NO_WA | + IRS_CR1_VMD_NO_RA | + IRS_CR1_VPET_NO_WA | + IRS_CR1_VPET_NO_RA | + IRS_CR1_VMT_NO_WA | + IRS_CR1_VMT_NO_RA | + IRS_CR1_IST_NO_WA | + IRS_CR1_IST_NO_RA | + IRS_CR1_IC_NC | + IRS_CR1_OC_NC | + IRS_CR1_SH_NS; + } + IRS_CFG_WRITE_4(irs, IRS_CR1, cr1); + IRS_CFG_WRITE_4(irs, IRS_CR0, IRS_CR0_IRSEN); + gicv5_wait_irs_cr0_idle(irs); + + idr2 = IRS_CFG_READ_4(irs, IRS_IDR2); + + two_levels = (idr2 & IRS_IDR2_IST_LEVELS) != 0; + lpi_id_bits = IRS_IDR2_ID_BITS(idr2); + + if (!two_levels) { + /* + * Limit the size of the table as we need to entierly allocate + * it for the linear table + */ + lpi_id_bits = MIN(lpi_id_bits, GICV5_LPI_ID_BITS_MAX); + /* Ensure lpi_id_bits is at least the mnimum value */ + lpi_id_bits = MAX(lpi_id_bits, IRS_IDR2_MIN_LPI_ID_BITS(idr2)); + } + + icc_idr0 = READ_SPECIALREG(ICC_IDR0_EL1); + switch(icc_idr0 & ICC_IDR0_ID_BITS_MASK) { + case ICC_IDR0_ID_BITS_16: + lpi_id_bits = MIN(lpi_id_bits, 16); + break; + default: + case ICC_IDR0_ID_BITS_24: + lpi_id_bits = MIN(lpi_id_bits, 24); + break; + } + + /* The IST entries contain metadata so the size will be larger */ + if ((idr2 & IRS_IRD2_ISTMD) != 0) { + uint64_t istmd_sz; + + istmd_sz = (idr2 & IRS_IDR2_ISTMD_SZ_MASK) >> + IRS_IDR2_ISTMD_SZ_SHIFT; + if (lpi_id_bits < istmd_sz) { + istsz = IRS_IST_CFGR_ISTSZ_8_VAL; + } else { + istsz = IRS_IST_CFGR_ISTSZ_16_VAL; + } + } else { + /* The default ITS entry size is 4 bytes */ + istsz = IRS_IST_CFGR_ISTSZ_4_VAL; + } + + if (two_levels) { + if ((idr2 & IRS_IDR2_IST_L2SZ_64K) != 0) + l2sz = IRS_IST_CFGR_L2SZ_64K_VAL; + else if ((idr2 & IRS_IDR2_IST_L2SZ_16K) != 0) + l2sz = IRS_IST_CFGR_L2SZ_16K_VAL; + else + l2sz = IRS_IST_CFGR_L2SZ_4K_VAL; + } + + /* + * Use 2 level tables if able, and the size is large enough for them + * to be worth it. This is based on the calculation in the GICv5 + * spec (ARM-AES-0070) 00EAC0 section 10.2.1.14 IRS_IST_CFGR. + */ + if (two_levels && + lpi_id_bits > L2_ISTE_LOG2_ENTRIES(istsz, l2sz)) { + gicv5_irs_alloc_2level(sc, irs, &cfgr, lpi_id_bits, istsz, + l2sz); + } else { + gicv5_irs_alloc_linear(sc, irs, &cfgr, lpi_id_bits, istsz); + } + + if (idx == 0) + sc->gic_nlpis = 1u << lpi_id_bits; + else + sc->gic_nlpis = MIN(sc->gic_nlpis, 1u << lpi_id_bits); + + spi_count = IRS_CFG_READ_4(irs, IRS_IDR5) & IRS_IDR5_SPI_RANGE; + if (sc->gic_irs_irqs == NULL) { + KASSERT(idx == 0, + ("%s: Null IRS table on no-zero index (idx = %d)", + __func__, idx)); + sc->gic_spi_count = spi_count; + sc->gic_irs_irqs = mallocarray(spi_count, + sizeof(struct gicv5_irqsrc), M_DEVBUF, M_WAITOK | M_ZERO); + } + + /* Read and check the IRS SPI details */ + irs->irs_spi_start = + IRS_CFG_READ_4(irs, IRS_IDR7) & IRS_IDR7_SPI_BASE; + + irs->irs_spi_count = + IRS_CFG_READ_4(irs, IRS_IDR6) & IRS_IDR6_SPI_IRS_RANGE; + + spi_end = irs->irs_spi_start + irs->irs_spi_count; + if (spi_end > spi_count) + panic("%s: IRS %u has SPIs past global count (%u > %u)\n", + device_get_nameunit(dev), idx, spi_end, spi_count); + + gicv5_irs_init_ist(sc, irs, cfgr); + + /* + * Set a valid interrupt affinity ID, even if it's for a CPU not + * attached to this IRS. + */ + iaffid = gicv5_iaffids[curcpu]; + MPASS(iaffid >= 0); + for (u_int irq = irs->irs_spi_start; irq < spi_end; irq++) { + struct gicv5_irqsrc *gi; + uint64_t cdaff, cdpri; + + gi = &sc->gic_irs_irqs[irq]; + MPASS(gi->gi_irs == NULL); + gi->gi_isrc.gbi_space = GICv5_SPI; + gi->gi_isrc.gbi_ipi = false; + gi->gi_isrc.gbi_irq = irq; + gi->gi_irs = irs; + gi->gi_pol = INTR_POLARITY_CONFORM; + gi->gi_trig = INTR_TRIGGER_CONFORM; + error = intr_isrc_register(&gi->gi_isrc.gbi_isrc, dev, + 0, "%s,s%u", name, irq); + if (error != 0) + panic("%s: Unable to register SPI irq src", + device_get_nameunit(dev)); + + /* Set the base priority */ + cdpri = GIC_CDPRI_PRORITY(GICV5_PRI_LOWEST); + cdpri |= GIC_CDPRI_TYPE_SPI; + cdpri |= GIC_CDPRI_ID(irq); + gic_cdpri(cdpri); + + /* Set the affinity */ + cdaff = GIC_CDAFF_IAFFID(iaffid); + cdaff |= GIC_CDAFF_TYPE_SPI; + cdaff |= GIC_CDAFF_IRM_TARGETED; + cdaff |= GIC_CDAFF_ID(irq); + gic_cdaff(cdaff); + isb(); + } + +#ifdef INVARIANTS + irs->irs_ready = true; +#endif +} + +void +gicv5_attach(device_t dev) +{ + struct gicv5_softc *sc; + const char *name; + int error; + + sc = device_get_softc(dev); + sc->gic_dev = dev; + name = device_get_nameunit(dev); + + MPASS(gicv5_iaffids == NULL); + gicv5_iaffids = mallocarray(mp_maxid + 1, sizeof(*gicv5_iaffids), + M_DEVBUF, M_WAITOK); + for (int i = 0; i <= mp_maxid; i++) + gicv5_iaffids[i] = -1; + gicv5_iaffids[curcpu] = + ICC_IAFFIDR_IAFFID_VAL(READ_SPECIALREG(ICC_IAFFIDR_EL1)); + + for (u_int i = 0; i < sc->gic_nirs; i++) + gicv5_irs_attach(dev, sc->gic_irs[i], i); + if (bootverbose) + device_printf(dev, "Limited to %u LPIs\n", sc->gic_nlpis); + + sc->gic_ppi_irqs = mallocarray(GICV5_PPI_COUNT, + sizeof(struct gicv5_irqsrc), M_DEVBUF, M_ZERO | M_WAITOK); + for (u_int irq = 0; irq < GICV5_PPI_COUNT; irq++) { + struct intr_irqsrc *isrc; + + sc->gic_ppi_irqs[irq].gi_irs = NULL; + sc->gic_ppi_irqs[irq].gi_isrc.gbi_space = GICv5_PPI; + sc->gic_ppi_irqs[irq].gi_isrc.gbi_ipi = false; + sc->gic_ppi_irqs[irq].gi_isrc.gbi_irq = irq; + sc->gic_ppi_irqs[irq].gi_pol = INTR_POLARITY_CONFORM; + sc->gic_ppi_irqs[irq].gi_trig = INTR_TRIGGER_CONFORM; + isrc = &sc->gic_ppi_irqs[irq].gi_isrc.gbi_isrc; + error = intr_isrc_register(isrc, dev, INTR_ISRCF_PPI, + "%s,p%u", name, irq); + if (error != 0) + panic("%s: Unable to register PPI irq src", + device_get_nameunit(dev)); + } + + /* Assign LPIs to be used as IPIs */ + sc->gic_ipi_irqs = mallocarray(INTR_IPI_COUNT, + sizeof(*sc->gic_ipi_irqs), M_DEVBUF, M_ZERO | M_WAITOK); + for (u_int ipi = 0; ipi < INTR_IPI_COUNT; ipi++) { + struct intr_irqsrc *isrc; + + sc->gic_ipi_irqs[ipi].gi_irs = NULL; + sc->gic_ipi_irqs[ipi].gi_isrc.gbi_space = GICv5_LPI; + sc->gic_ipi_irqs[ipi].gi_isrc.gbi_ipi = true; + sc->gic_ipi_irqs[ipi].gi_isrc.gbi_irq = ipi + LPI_IPI_BASE; + sc->gic_ipi_irqs[ipi].gi_pol = INTR_POLARITY_HIGH; + sc->gic_ipi_irqs[ipi].gi_trig = INTR_TRIGGER_EDGE; + isrc = &sc->gic_ipi_irqs[ipi].gi_isrc.gbi_isrc; + error = intr_isrc_register(isrc, dev, INTR_ISRCF_IPI, + "%s,ipi%u", name, ipi); + if (error != 0) + panic("%s: Unable to register LPI irq src", + device_get_nameunit(dev)); + } + + WRITE_SPECIALREG(ICC_PPI_PRIORITYR0_EL1, + ICC_PPI_PRIORITYR_PRIORITY_ALL(GICV5_PRI_LOWEST)); + WRITE_SPECIALREG(ICC_PPI_PRIORITYR1_EL1, + ICC_PPI_PRIORITYR_PRIORITY_ALL(GICV5_PRI_LOWEST)); + WRITE_SPECIALREG(ICC_PPI_PRIORITYR2_EL1, + ICC_PPI_PRIORITYR_PRIORITY_ALL(GICV5_PRI_LOWEST)); + WRITE_SPECIALREG(ICC_PPI_PRIORITYR3_EL1, + ICC_PPI_PRIORITYR_PRIORITY_ALL(GICV5_PRI_LOWEST)); + WRITE_SPECIALREG(ICC_PPI_PRIORITYR4_EL1, + ICC_PPI_PRIORITYR_PRIORITY_ALL(GICV5_PRI_LOWEST)); + WRITE_SPECIALREG(ICC_PPI_PRIORITYR5_EL1, + ICC_PPI_PRIORITYR_PRIORITY_ALL(GICV5_PRI_LOWEST)); + WRITE_SPECIALREG(ICC_PPI_PRIORITYR6_EL1, + ICC_PPI_PRIORITYR_PRIORITY_ALL(GICV5_PRI_LOWEST)); + WRITE_SPECIALREG(ICC_PPI_PRIORITYR7_EL1, + ICC_PPI_PRIORITYR_PRIORITY_ALL(GICV5_PRI_LOWEST)); + WRITE_SPECIALREG(ICC_PPI_PRIORITYR8_EL1, + ICC_PPI_PRIORITYR_PRIORITY_ALL(GICV5_PRI_LOWEST)); + WRITE_SPECIALREG(ICC_PPI_PRIORITYR9_EL1, + ICC_PPI_PRIORITYR_PRIORITY_ALL(GICV5_PRI_LOWEST)); + WRITE_SPECIALREG(ICC_PPI_PRIORITYR10_EL1, + ICC_PPI_PRIORITYR_PRIORITY_ALL(GICV5_PRI_LOWEST)); + WRITE_SPECIALREG(ICC_PPI_PRIORITYR11_EL1, + ICC_PPI_PRIORITYR_PRIORITY_ALL(GICV5_PRI_LOWEST)); + WRITE_SPECIALREG(ICC_PPI_PRIORITYR12_EL1, + ICC_PPI_PRIORITYR_PRIORITY_ALL(GICV5_PRI_LOWEST)); + WRITE_SPECIALREG(ICC_PPI_PRIORITYR13_EL1, + ICC_PPI_PRIORITYR_PRIORITY_ALL(GICV5_PRI_LOWEST)); + WRITE_SPECIALREG(ICC_PPI_PRIORITYR14_EL1, + ICC_PPI_PRIORITYR_PRIORITY_ALL(GICV5_PRI_LOWEST)); + WRITE_SPECIALREG(ICC_PPI_PRIORITYR15_EL1, + ICC_PPI_PRIORITYR_PRIORITY_ALL(GICV5_PRI_LOWEST)); + + WRITE_SPECIALREG(ICC_PPI_ENABLER0_EL1, ICC_PPI_ENABLER_NONE); + WRITE_SPECIALREG(ICC_PPI_ENABLER1_EL1, ICC_PPI_ENABLER_NONE); + isb(); + + /* Set the priority to the lowest value */ + WRITE_SPECIALREG(ICC_PCR_EL1, ICC_PCR_PRIORITY_LOWEST); + + /* Enable interrupts */ + WRITE_SPECIALREG(ICC_CR0_EL1, ICC_CR0_EN); + isb(); +} + +bool +gicv5_add_child(device_t dev, struct gicv5_devinfo *di) +{ + device_t cdev; + struct gicv5_softc *sc; + + cdev = device_add_child(dev, NULL, DEVICE_UNIT_ANY); + if (cdev == NULL) + return (false); + + sc = device_get_softc(dev); + sc->gic_nchildren++; + device_set_ivars(cdev, di); + + return (true); +} + +static int +gicv5_print_child(device_t bus, device_t child) +{ + struct resource_list *rl; + int retval = 0; + + rl = BUS_GET_RESOURCE_LIST(bus, child); + KASSERT(rl != NULL, ("%s: No resource list", __func__)); + retval += bus_print_child_header(bus, child); + retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#jx"); + retval += bus_print_child_footer(bus, child); + + return (retval); +} + +static u_int +gicv5_lpi_count(struct gicv5_softc *sc) +{ + MPASS(sc->gic_nlpis >= LPI_ITS_BASE); + return (sc->gic_nlpis - LPI_ITS_BASE); +} + +static int +gicv5_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) +{ + struct gicv5_softc *sc; + struct gicv5_devinfo *di; + u_int nlpis; + + switch (which) { + case GICV5_IVAR_LPI_START: + di = device_get_ivars(child); + if (di == NULL || di->di_irs == NULL) + return (EINVAL); + + sc = device_get_softc(dev); + nlpis = gicv5_lpi_count(sc) / sc->gic_nchildren; + *result = LPI_ITS_BASE + device_get_unit(dev) * nlpis; + return (0); + case GICV3_IVAR_NIRQS: + di = device_get_ivars(child); + if (di == NULL || di->di_irs == NULL) + return (EINVAL); + + sc = device_get_softc(dev); + *result = gicv5_lpi_count(sc) / sc->gic_nchildren; + return (0); + case GIC_IVAR_HW_REV: + *result = 5; + return (0); + case GIC_IVAR_BUS: + sc = device_get_softc(dev); + KASSERT(sc->gic_bus != GIC_BUS_UNKNOWN, + ("%s: Unknown bus type", __func__)); + KASSERT(sc->gic_bus <= GIC_BUS_MAX, + ("%s: Invalid bus type %u", __func__, sc->gic_bus)); + *result = sc->gic_bus; + return (0); + case GIC_IVAR_VGIC: + /* TODO when we have vgic support */ + *result = 0; + return (0); + case GIC_IVAR_SUPPORT_LPIS: + di = device_get_ivars(child); + if (di == NULL || di->di_irs == NULL) + return (EINVAL); + + *result = + (IRS_CFG_READ_4(di->di_irs, IRS_IDR2) & IRS_IDR2_LPI) != 0; + return (0); + } + + return (ENOENT); +} + +static int +gicv5_get_cpus(device_t dev, device_t child, enum cpu_sets op, size_t setsize, + cpuset_t *cpuset) +{ + struct gicv5_devinfo *di; + + if (op != LOCAL_CPUS) + return (bus_generic_get_cpus(dev, child, op, setsize, cpuset)); + + di = device_get_ivars(child); + if (di == NULL) + return (bus_generic_get_cpus(dev, child, op, setsize, cpuset)); + + if (setsize != sizeof(cpuset_t)) + return (EINVAL); + + *cpuset = di->di_irs->irs_cpus; + return (0); +} + +static struct resource_list * +gicv5_get_resource_list(device_t bus, device_t child) +{ + struct gicv5_devinfo *di; + + di = device_get_ivars(child); + KASSERT(di != NULL, ("%s: No devinfo", __func__)); + + return (&di->di_rl); +} + +static void +gicv5_eoi_intr(enum gicv5_irq_space space, uint32_t irq) +{ + uint64_t cddi; + + /* Drop the priority of the specified interrupt */ + cddi = (uint64_t)space << GIC_CDDI_Type_SHIFT; + cddi |= (uint64_t)irq << GIC_CDDI_ID_SHIFT; + gic_cddi(cddi); + + /* Drop the running priority of the CPU */ + gic_cdeoi(); +} + +static void +gicv5_eoi(struct gicv5_base_irqsrc *gbi) +{ + uint32_t irq; + enum gicv5_irq_space space; + + MPASS(!gbi->gbi_ipi); + space = gbi->gbi_space; + irq = gbi->gbi_irq; + + gicv5_eoi_intr(space, irq); +} + +int +gicv5_intr(void *arg) +{ + struct gicv5_softc *sc = arg; + struct gicv5_irqsrc *gi; + struct trapframe *tf; + uint64_t hppi; + u_int irq; + + tf = curthread->td_intr_frame; + for (;;) { + hppi = gicr_cdia(); + /* Ensure the interrupt activation has completed */ + gsb_ack(); + /* Ensure the gsb ack instruction has completed */ + isb(); + + if ((hppi & ICC_HPPIR_HPPIV) == 0) + return (FILTER_HANDLED); + + irq = (hppi & ICC_HPPIR_ID_MASK) >> ICC_HPPIR_ID_SHIFT; + switch (hppi & ICC_HPPIR_TYPE_MASK) { + case ICC_HPPIR_TYPE_PPI: + MPASS(irq < GICV5_PPI_COUNT); + gi = &sc->gic_ppi_irqs[irq]; + if (intr_isrc_dispatch(&gi->gi_isrc.gbi_isrc, tf) != 0){ + if (gi->gi_trig != INTR_TRIGGER_EDGE) + gicv5_eoi(&gi->gi_isrc); + gicv5_disable_intr(sc->gic_dev, + &gi->gi_isrc.gbi_isrc); + device_printf(sc->gic_dev, + "Stray PPI %u disabled\n", irq); + } + break; + case ICC_HPPIR_TYPE_LPI: + /* XXX */ + if (LPI_IS_IPI(irq)) { + u_int ipi; + + KASSERT(LPI_IPI_IDX(irq) < LPI_IPI_LIMIT, + ("%s: Invalid IPI LPI %u", __func__, irq)); + ipi = LPI_TO_IPI(irq); + intr_ipi_dispatch(ipi); + gicv5_eoi_intr(GICv5_LPI, irq); + } else { + intr_child_irq_handler(sc->gic_pic, irq); + } + break; + case ICC_HPPIR_TYPE_SPI: + MPASS(irq < sc->gic_spi_count); + gi = &sc->gic_irs_irqs[irq]; + if (intr_isrc_dispatch(&gi->gi_isrc.gbi_isrc, tf) != 0){ + if (gi->gi_trig != INTR_TRIGGER_EDGE) + gicv5_eoi(&gi->gi_isrc); + gicv5_disable_intr(sc->gic_dev, + &gi->gi_isrc.gbi_isrc); + device_printf(sc->gic_dev, + "Stray SPI %u disabled\n", irq); + } + break; *** 1786 LINES SKIPPED *** From nobody Thu Jun 18 14:57:41 2026 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 4gh3jy296Kz6hMTd for ; Thu, 18 Jun 2026 14:57: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gh3jy0Cgnz43xY for ; Thu, 18 Jun 2026 14:57:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781794662; 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=BaNysW8WNZuTuMI3OtTzbFKqlksMncGS3GrrzMTGa+s=; b=Rh6Hwb3W1fRL5FVIY1dh4bJE31F/LMxxcV4z4GqgcWXx/LBl+7ENCSG1aPgwH93T+8puFB C4c5lhnPwTb00OBwUxMYgmKFSA1Jz5cQFBDpagrcMqmbwZdHv6q6c4FxbA/d37mo57xFss sdI3bWe4Ygxi0HwPvVZsSJPmMsvbhKr7gb3xGtw+0KJcv5V7zJQlAQ82eN6k043RMHYGEm jkRzFw4nhCaHNCUHBGbWf6RYjVEYN1ySrUaMg6LpCQRbV1NqqznpcAUNKNg2ymv5Jpwb7Y aUwJRfcSrGEsPWO/EhEPNAh2AnkBWI5oiLfK3KCGwOwn4sXMFnmLgTN4az1EkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781794662; a=rsa-sha256; cv=none; b=pCKTjmFDDE76obnLayXa0r+4JYv61avDvp0IeFYGmV0pxof0juv6uYflmrTFc2rYPwjn+E ix+L7LVVeBe8Ahf7KWa2MwFZ90njMzdjw+ejpuM+r5HzYYJvq0xGhwjHtYtbqXDs/vQ6fr fneuBgKp8laW3AWUMtkjfAZL18T0joQYQNNgAfwmhjq8lI2xZj5x4P6wHn/uxbUj/LRk5X ORUbm1rndwe4rPc6Slp8DvasK0X8FU+5MU3HBiqXitf1DtVjNgqAXM2TMTIv6BwB1pOxfI 4nhlu7cid1gaOSWPNxKe9jm5m+bJug8DFyG5+zFQnTyzeX1LGTIhGzpjDdFiug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781794662; 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=BaNysW8WNZuTuMI3OtTzbFKqlksMncGS3GrrzMTGa+s=; b=b9qhQ3AgodusvCJ6STqx3I9no/tfqohv971xqGI1yCONWx5mA7E1OcNzbU4RK0f89UbcRL U8JyBE4zh7wa4JwLXyRGRst9pRQQzFginqbbpr8uVsCg7dKGILEgtZ9KzH1j1yyYAhWSaZ 4g6kE5La/20f957BGec1Ofk+lr1SIg69V5jUeJpqOz45JU8GkPEaIfnVAabkWel43dP6ZI BGZ2y3TpH3iOfvz9qC2trLnv3gJJGBhcT+BmqFg4pMZUQRJs1m8+7rxzRy/dAqcwlw3t76 l8V8LkVtaH1lqIJw/5bhArpBpmEUSgU2k+9O0fLgww1IWopbjr0oGHw55N7XBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gh3jx6Bmjz13Hd for ; Thu, 18 Jun 2026 14:57:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f023 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Jun 2026 14:57:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 06d64ee0ecc2 - main - arm64: Add an initial GICv5 ITS driver 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 06d64ee0ecc2ed25315b1afa20fea63c51b78abb Auto-Submitted: auto-generated Date: Thu, 18 Jun 2026 14:57:41 +0000 Message-Id: <6a340765.3f023.75aea47a@gitrepo.freebsd.org> The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=06d64ee0ecc2ed25315b1afa20fea63c51b78abb commit 06d64ee0ecc2ed25315b1afa20fea63c51b78abb Author: Andrew Turner AuthorDate: 2026-06-18 13:50:54 +0000 Commit: Andrew Turner CommitDate: 2026-06-18 14:56:53 +0000 arm64: Add an initial GICv5 ITS driver Add a driver to support the GICv5 interrupt translation service (ITS). The ITS is responsible to handling ITS events & translating them to an interrupt to be delivered to the interrupt routing service (IRS). An example event is a MSI or MSI-X is delivered. The ITS will generate an LPI depending on which device sent the interrupt and the value the device wrote. This is a similar concept to the GICv3 ITS, however the implementation details are different so it needs a new driver. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D54251 --- sys/arm64/arm64/gicv5_its.c | 1239 +++++++++++++++++++++++++++++++++++++++++++ sys/conf/files.arm64 | 1 + 2 files changed, 1240 insertions(+) diff --git a/sys/arm64/arm64/gicv5_its.c b/sys/arm64/arm64/gicv5_its.c new file mode 100644 index 000000000000..73395c2eb05b --- /dev/null +++ b/sys/arm64/arm64/gicv5_its.c @@ -0,0 +1,1239 @@ +/*- + * Copyright (c) 2015-2016 The FreeBSD Foundation + * Copyright (c) 2023,2025 Arm Ltd + * + * 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 "opt_acpi.h" +#include "opt_platform.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#ifdef FDT +#include +#include +#include +#include +#endif + +#include +#include + +#include "gicv5var.h" +#include "gic_v3_var.h" /* For GICV3_IVAR_NIRQS */ + +#include "pic_if.h" +#include "msi_if.h" + +/* ITS Config Frame */ +#define ITS_IDR0 0x0000 +#define ITS_IDR0_PA_RANGE_SHIFT 2 +#define ITS_IDR0_PA_RANGE_MASK (0xfu << ITS_IDR0_PA_RANGE_SHIFT) +#define ITS_IDR0_PA_RANGE_4G (0x0u << ITS_IDR0_PA_RANGE_SHIFT) +#define ITS_IDR0_PA_RANGE_64G (0x1u << ITS_IDR0_PA_RANGE_SHIFT) +#define ITS_IDR0_PA_RANGE_1T (0x2u << ITS_IDR0_PA_RANGE_SHIFT) +#define ITS_IDR0_PA_RANGE_4T (0x3u << ITS_IDR0_PA_RANGE_SHIFT) +#define ITS_IDR0_PA_RANGE_16T (0x4u << ITS_IDR0_PA_RANGE_SHIFT) +#define ITS_IDR0_PA_RANGE_256T (0x5u << ITS_IDR0_PA_RANGE_SHIFT) +#define ITS_IDR0_PA_RANGE_4P (0x6u << ITS_IDR0_PA_RANGE_SHIFT) +#define ITS_IDR0_PA_RANGE_64P (0x7u << ITS_IDR0_PA_RANGE_SHIFT) +#define ITS_IDR1 0x0004 +#define ITS_IDR1_L2SZ_SHIFT 8 +#define ITS_IDR1_L2SZ_MASK (0x7u << ITS_IDR1_L2SZ_SHIFT) +#define ITS_IDR1_L2SZ_64K_MASK (0x4u << ITS_IDR1_L2SZ_SHIFT) +#define ITS_IDR1_L2SZ_16K_MASK (0x2u << ITS_IDR1_L2SZ_SHIFT) +#define ITS_IDR1_L2SZ_4K_MASK (0x1u << ITS_IDR1_L2SZ_SHIFT) +#define ITS_IDR1_ITT_LEVELS (0x1u << 7) +#define ITS_IDR1_DT_LEVELS (0x1u << 6) +#define ITS_IDR1_DEVICEID_BITS_SHIFT 0 +#define ITS_IDR1_DEVICEID_BITS (0x3fu << ITS_IDR1_DEVICEID_BITS_SHIFT) +#define ITS_IDR1_DEVICEID_BITS_VAL(x) \ + (((x) & ITS_IDR1_DEVICEID_BITS) >> ITS_IDR1_DEVICEID_BITS_SHIFT) +#define ITS_IDR2 0x0008 +#define ITS_IDR2_XDMN_EVENTS_SHIFT 5 +#define ITS_IDR2_XDMN_EVENTS_MASK (0x3u << ITS_IDR2_XDMN_EVENTS_SHIFT) +#define ITS_IDR2_EVENTID_SHIFT 0 +#define ITS_IDR2_EVENTID_MASK (0x1fu << ITS_IDR2_EVENTID_SHIFT) +#define ITS_IIDR 0x0040 +#define ITS_AIDR 0x0044 +#define ITS_CR0 0x0080 +#define ITS_CR0_IDLE (0x1u << 1) +#define ITS_CR0_ITSEN (0x1u << 0) +#define ITS_CR1 0x0084 +#define ITS_CR1_ITT_RA (0x1u << 7) +#define ITS_CR1_DT_RA (0x1u << 6) +#define ITS_CR1_IC_SHIFT 4 +#define ITS_CR1_IC_MASK (0x3u << ITS_CR1_IC_SHIFT) +#define ITS_CR1_IC_NC (0x0u << ITS_CR1_IC_SHIFT) +#define ITS_CR1_IC_WB (0x1u << ITS_CR1_IC_SHIFT) +#define ITS_CR1_IC_WT (0x2u << ITS_CR1_IC_SHIFT) +#define ITS_CR1_OC_SHIFT 2 +#define ITS_CR1_OC_MASK (0x3u << ITS_CR1_OC_SHIFT) +#define ITS_CR1_OC_NC (0x0u << ITS_CR1_OC_SHIFT) +#define ITS_CR1_OC_WB (0x1u << ITS_CR1_OC_SHIFT) +#define ITS_CR1_OC_WT (0x2u << ITS_CR1_OC_SHIFT) +#define ITS_CR1_SH_SHIFT 0 +#define ITS_CR1_SH_MASK (0x3u << ITS_CR1_SH_SHIFT) +#define ITS_CR1_SH_NS (0x0u << ITS_CR1_SH_SHIFT) +#define ITS_CR1_SH_OS (0x2u << ITS_CR1_SH_SHIFT) +#define ITS_CR1_SH_IS (0x3u << ITS_CR1_SH_SHIFT) +#define ITS_DT_BASER 0x00c0 +#define ITS_DT_BASER_ADDR_MASK 0x00fffffffffffff8ul +#define ITS_DT_BASER_ADDR_LIMIT 0x0100000000000000ul +#define ITS_DT_CFGR 0x00d0 +#define IRS_DT_CFGR_STRUCTURE_LINEAR (0x0 << 16) +#define IRS_DT_CFGR_STRUCTURE_2LVL (0x1 << 16) +#define ITS_DT_CFGR_L2SZ_SHIFT 6 +#define ITS_DT_CFGR_L2SZ_64K_VAL 0x2 +#define ITS_DT_CFGR_L2SZ_64K (0x2 << ITS_DT_CFGR_L2SZ_SHIFT) +#define ITS_DT_CFGR_L2SZ_16K_VAL 0x1 +#define ITS_DT_CFGR_L2SZ_16K (0x1 << ITS_DT_CFGR_L2SZ_SHIFT) +#define ITS_DT_CFGR_L2SZ_4K_VAL 0x0 +#define ITS_DT_CFGR_L2SZ_4K (0x0 << ITS_DT_CFGR_L2SZ_SHIFT) +#define IRS_DT_CFGR_DEVICE_ID_BITS_SHIFT 0 +#define ITS_DIDR 0x0100 +#define ITS_EIDR 0x0108 +#define ITS_INV_EVENTR 0x010c +#define ITS_INV_DEVICER 0x0110 +#define ITS_INV_DEVICER_I (0x1u << 31) +#define ITS_INV_DEVICER_EVENTID_BITS_SHIFT 1 +#define ITS_INV_DEVICER_EVENTID_BITS_MASK \ + (0x1ful << ITS_INV_DEVICER_EVENTID_BITS_SHIFT) +#define ITS_INV_DEVICER_L1 (0x1u << 0) +#define ITS_READ_EVENTR 0x0114 +#define ITS_READ_EVENT_DATAR 0x0118 +#define ITS_STATUSR 0x0120 +#define ITS_STATUSR_IDLE (0x1u << 0) +#define ITS_SYNCR 0x0140 +#define ITS_SYNC_STATUSR 0x0148 +#define ITS_GEN_EVENT_DIDR 0x0180 +#define ITS_GEN_EVENT_EIDR 0x0188 +#define ITS_GEN_EVENTR 0x018c +#define ITS_GEN_EVENT_STATUSR 0x0190 +#define ITS_MEC_IDR 0x01c0 +#define ITS_MEC_MECID_R 0x01c4 +#define ITS_MPAM_IDR 0x0200 +#define ITS_MPAM_PARTID_R 0x0204 +#define ITS_SWERR_STATUSR 0x0240 +#define ITS_SWERR_SYNDROMER0 0x0248 +#define ITS_SWERR_SYNDROMER1 0x0250 + +/* ITS Translate Frame */ +#define ITS_TRANSLATER 0x0000 +#define ITS_RL_TRANSLATER 0x0008 + +/* L1_DTE - Level 1 device table entry */ +#define L1_DTE_SIZE 8 +#define L1_DTE_SPAN_SHIFT 60 +#define L1_DTE_SPAN_MASK (0xful << L1_DTE_SPAN_SHIFT) +#define L1_DTE_L2_ADDR_MASK 0xfffffffffffff8 +#define L1_DTE_VALID (0x1ul << 0) + +/* L2_DTE - Level 2 device table entry */ +#define L2_DTE_SIZE 8 +#define L2_DTE_EVENTID_BITS_SHIFT 59 +#define L2_DTE_EVENTID_BITS_MASK (0x1ful << L2_DTE_EVENTID_BITS_SHIFT) +#define L2_DTE_ITT_STRUCTURE_SHIFT 58 +#define L2_DTE_ITT_STRUCTURE_MASK (0x1ul << L2_DTE_ITT_STRUCTURE_SHIFT) +#define L2_DTE_ITT_STRUCTURE_LINEAR (0x0ul << L2_DTE_ITT_STRUCTURE_SHIFT) +#define L2_DTE_ITT_STRUCTURE_2_LEVEL (0x1ul << L2_DTE_ITT_STRUCTURE_SHIFT) +#define L2_DTE_DSWE_SHIFT 57 +#define L2_DTE_DSWE (0x1 << L2_DTE_DSWE_SHIFT) +#define L2_DTE_ITT_ADDR_MASK 0x00fffffffffffff8 +#define L2_DTE_ITT_L2SZ_SHIFT 1 +#define L2_DTE_ITT_L2SZ_MASK (0x3ul << L2_DTE_ITT_L2SZ_SHIFT) +#define L2_DTE_ITT_L2SZ_4K (0x0ul << L2_DTE_ITT_L2SZ_SHIFT) +#define L2_DTE_ITT_L2SZ_16K (0x1ul << L2_DTE_ITT_L2SZ_SHIFT) +#define L2_DTE_ITT_L2SZ_64K (0x2ul << L2_DTE_ITT_L2SZ_SHIFT) +#define L2_DTE_VALID (0x1ul << 0) + +/* log2(number of entries in l2 table */ +#define L2_DTE_LOG2_ENTRIES(l2sz) (9 + (2 * l2sz)) +#define L2_DTE_ENTRIES(l2sz) (1ul << L2_DTE_LOG2_ENTRIES(l2sz)) + + +/* The maximum physical address we can use for the ITT */ +/* TODO: Move to use ITS_IDR0.PA_RANGE */ +#define ITT_MAX_ADDR 0x00ffffffffffffff + +/* L1_ITTE - Level 1 interrupt translation table entry */ +#define L1_ITTE_SIZE 8 +#define L1_ITTE_SPAN_SHIFT 60 +#define L1_ITTE_SPAN_MASK (0xful << L1_ITTE_SPAN_SHIFT) +#define L1_ITTE_L2_ADDR_MASK 0xfffffffffffff8 +#define L1_ITTE_VALID (0x1ul << 0) + +/* L2_ITTE - Level 2 interrupt translation table entry */ +#define L2_ITTE_SIZE 8 +#define L2_ITTE_VM_ID_SHIFT 32 +#define L2_ITTE_VM_ID_MASK (0xfffful << L2_ITT_VM_ID_SHIFT) +#define L2_ITTE_VALID (0x1ul << 31) +#define L2_ITTE_VIRTUAL (0x1ul << 30) +#define L2_ITTE_DAC_SHIFT 28 +#define L2_ITTE_DAC_MASK (0x3ul << L2_ITT_DAC_SHIFT) +#define L2_ITTE_LPI_ID_SHIFT 0 +#define L2_ITTE_LPI_ID_MASK (0xfffffful << L2_ITT_LPI_ID_SHIFT) + +/* LPI chunk owned by ITS device */ +struct lpi_chunk { + u_int lpi_base; + u_int lpi_free; /* First free LPI in set */ + u_int lpi_num; /* Total number of LPIs in chunk */ + u_int lpi_busy; /* Number of busy LPIs in chink */ +}; + +/* ITS device */ +struct its_dev { + TAILQ_ENTRY(its_dev) entry; + /* PCI device */ + device_t pci_dev; + /* Device ID (i.e. PCI device ID) */ + uint32_t devid; + /* List of assigned LPIs */ + struct lpi_chunk lpis; + /* Virtual address of ITT */ + /* XXX: Only a linear ITT for now */ + uint64_t *itt; +}; + +/* ITS device list */ +struct its_device_list { + struct mtx its_dev_lock; + TAILQ_HEAD(its_dev_list, its_dev) its_dev_list; + + uint64_t *its_dev_dte_base; + size_t its_dev_dte_l2size; + u_int its_dev_dte_l2bits; + bool its_dev_dte_2l; + + + vmem_t *its_dev_irq_alloc; + struct gicv5_its_irqsrc **its_irqs; +}; + +struct gicv5_its_irqsrc { + struct gicv5_base_irqsrc gi_isrc; + u_int gi_event_id; + struct its_dev *gi_its_dev; + TAILQ_ENTRY(gicv5_its_irqsrc) gi_link; +}; + +struct gicv5_its_translate_frame { + struct intr_pic *its_pic; + intptr_t its_xref; + bus_addr_t its_frame_paddr; +}; + +struct gicv5_its_softc { + struct its_device_list its_dl; + struct resource *its_cfg; + struct gicv5_its_translate_frame its_frame; + + struct gicv5_its_irqsrc **sc_irqs; + + cpuset_t its_cpus; + u_int its_irq_cpu; + TAILQ_HEAD(free_irqs, gicv5_its_irqsrc) sc_free_irqs; + + uint8_t its_parange; + + bool its_coherent; +}; + +static uint64_t *gicv5_its_dte_extend(struct gicv5_its_softc *, + struct its_device_list *, uint32_t); + +static device_attach_t gicv5_its_attach; + +static pic_disable_intr_t gicv5_its_disable_intr; +static pic_enable_intr_t gicv5_its_enable_intr; +static pic_map_intr_t gicv5_its_map_intr; +static pic_setup_intr_t gicv5_its_setup_intr; +static pic_post_filter_t gicv5_its_post_filter; +static pic_post_ithread_t gicv5_its_post_ithread; +static pic_pre_ithread_t gicv5_its_pre_ithread; +static pic_bind_intr_t gicv5_its_bind_intr; + +static msi_alloc_msi_t gicv5_its_alloc_msi; +static msi_release_msi_t gicv5_its_release_msi; +static msi_alloc_msix_t gicv5_its_alloc_msix; +static msi_release_msix_t gicv5_its_release_msix; +static msi_map_msi_t gicv5_its_map_msi; +#ifdef IOMMU +static msi_iommu_init_t gicv5_iommu_init; +static msi_iommu_deinit_t gicv5_iommu_deinit; +#endif + +static device_method_t gicv5_its_methods[] = { + /* Interrupt controller interface */ + DEVMETHOD(pic_disable_intr, gicv5_its_disable_intr), + DEVMETHOD(pic_enable_intr, gicv5_its_enable_intr), + DEVMETHOD(pic_map_intr, gicv5_its_map_intr), + DEVMETHOD(pic_setup_intr, gicv5_its_setup_intr), + DEVMETHOD(pic_post_filter, gicv5_its_post_filter), + DEVMETHOD(pic_post_ithread, gicv5_its_post_ithread), + DEVMETHOD(pic_pre_ithread, gicv5_its_pre_ithread), +#ifdef SMP + DEVMETHOD(pic_bind_intr, gicv5_its_bind_intr), +#endif + + /* MSI/MSI-X */ + DEVMETHOD(msi_alloc_msi, gicv5_its_alloc_msi), + DEVMETHOD(msi_release_msi, gicv5_its_release_msi), + DEVMETHOD(msi_alloc_msix, gicv5_its_alloc_msix), + DEVMETHOD(msi_release_msix, gicv5_its_release_msix), + DEVMETHOD(msi_map_msi, gicv5_its_map_msi), +#ifdef IOMMU + DEVMETHOD(msi_iommu_init, gicv5_iommu_init), + DEVMETHOD(msi_iommu_deinit, gicv5_iommu_deinit), +#endif + + /* End */ + DEVMETHOD_END +}; + +static DEFINE_CLASS_0(gic, gicv5_its_driver, gicv5_its_methods, + sizeof(struct gicv5_its_softc)); + +static void +its_write_cr0(struct gicv5_its_softc *sc, bool en) +{ + uint32_t val; + int timeout; + + val = en ? ITS_CR0_ITSEN : 0; + bus_write_4(sc->its_cfg, ITS_CR0, val); + + /* Timeout of ~10ms */ + timeout = 10000; + do { + val = bus_read_4(sc->its_cfg, ITS_CR0); + if ((val & ITS_CR0_IDLE) == ITS_CR0_IDLE) + return; + DELAY(1); + } while (--timeout > 0); + + panic("Timeout waiting for ITS CR0 becoming idle"); +} + +static void +its_wait_for_statusr(struct gicv5_its_softc *sc) +{ + uint32_t val; + int timeout; + + /* Timeout of ~10ms */ + timeout = 10000; + do { + val = bus_read_4(sc->its_cfg, ITS_STATUSR); + if ((val & ITS_STATUSR_IDLE) == ITS_STATUSR_IDLE) + return; + DELAY(1); + } while (--timeout > 0); + + panic("Timeout waiting for ITS STATUSR becoming idle"); +} + +static void +its_dcache_wbinv(struct gicv5_its_softc *sc, void *addr, size_t size) +{ + if (sc->its_coherent) + dsb(ishst); + else + cpu_dcache_wbinv_range(addr, size); +} + +/* TODO: See if we could merge its device code with GICv3 ITS */ +static void +its_device_list_init(struct its_device_list *dev_list) +{ + /* Protects access to the device list */ + mtx_init(&dev_list->its_dev_lock, "ITS device lock", NULL, MTX_SPIN); + TAILQ_INIT(&dev_list->its_dev_list); +} + +static struct its_dev * +its_device_find_locked(struct its_device_list *dev_list, device_t child) +{ + struct its_dev *its_dev; + + mtx_assert(&dev_list->its_dev_lock, MA_OWNED); + + TAILQ_FOREACH(its_dev, &dev_list->its_dev_list, entry) { + if (its_dev->pci_dev == child) + return (its_dev); + } + + return (NULL); +} + +static struct its_dev * +its_device_find(struct its_device_list *dev_list, device_t child) +{ + struct its_dev *its_dev; + + mtx_lock_spin(&dev_list->its_dev_lock); + its_dev = its_device_find_locked(dev_list, child); + mtx_unlock_spin(&dev_list->its_dev_lock); + + return (its_dev); +} + +static uint32_t +its_get_devid(device_t pci_dev) +{ + uintptr_t id; + + if (pci_get_id(pci_dev, PCI_ID_MSI, &id) != 0) + panic("%s: %s: Unable to get the MSI DeviceID", __func__, + device_get_nameunit(pci_dev)); + + return (id); +} + +static bool +its_device_itt_alloc_linear(struct gicv5_its_softc *sc, + struct its_dev *its_dev, u_int eventid_bits, uint64_t *dtep) +{ + size_t size; + + size = ((size_t)1 << eventid_bits) * L2_ITTE_SIZE; + MPASS(size <= PAGE_SIZE_4K); + + its_dev->itt = contigmalloc(size, M_DEVBUF, M_NOWAIT | M_ZERO, 0, + (1ul << sc->its_parange) - 1, max(size, PAGE_SIZE), 0); + if (its_dev->itt == NULL) + return (false); + its_dcache_wbinv(sc, its_dev->itt, size); + + *dtep = (uint64_t)eventid_bits << L2_DTE_EVENTID_BITS_SHIFT | + L2_DTE_ITT_STRUCTURE_LINEAR | vtophys(its_dev->itt) | + L2_DTE_ITT_L2SZ_4K | L2_DTE_VALID; + return (true); +} + +static bool +its_device_dte_update(struct gicv5_its_softc *sc, + struct its_device_list *dev_list, struct its_dev *its_dev, uint64_t dte) +{ + uint64_t *dtep; + + dtep = gicv5_its_dte_extend(sc, dev_list, its_dev->devid); + if (dtep == NULL) + return (false); + + MPASS(atomic_load_64(dtep) == 0); + atomic_store_64(dtep, dte); + its_dcache_wbinv(sc, dtep, sizeof(*dtep)); + return (true); +} + +static struct its_dev * +its_device_get(device_t dev, struct its_device_list *dev_list, device_t child, + u_int nvecs) +{ + struct gicv5_its_softc *sc; + struct its_dev *its_dev, *tmp_dev; + vmem_addr_t irq_base; + uint64_t dte; + u_int eventid_bits; + + its_dev = its_device_find(dev_list, child); + if (its_dev != NULL) + return (its_dev); + + its_dev = malloc(sizeof(*its_dev), M_DEVBUF, M_NOWAIT | M_ZERO); + if (its_dev == NULL) + return (NULL); + + its_dev->pci_dev = child; + its_dev->devid = its_get_devid(child); + + its_dev->lpis.lpi_busy = 0; + its_dev->lpis.lpi_num = nvecs; + its_dev->lpis.lpi_free = nvecs; + + sc = device_get_softc(dev); + if (gicv5_its_dte_extend(sc, dev_list, its_dev->devid) == NULL) { + free(its_dev, M_DEVBUF); + return (NULL); + } + + eventid_bits = order_base_2(nvecs); + if (!its_device_itt_alloc_linear(sc, its_dev, eventid_bits, &dte)) { + free(its_dev, M_DEVBUF); + return (NULL); + } + + if (vmem_alloc(dev_list->its_dev_irq_alloc, nvecs, + M_FIRSTFIT | M_NOWAIT, &irq_base) != 0) { + free(its_dev->itt, M_DEVBUF); + free(its_dev, M_DEVBUF); + return (NULL); + } + + mtx_lock_spin(&dev_list->its_dev_lock); + /* Recheck the ITS device hasn't been allocated */ + tmp_dev = its_device_find_locked(dev_list, child); + if (tmp_dev != NULL) { + mtx_unlock_spin(&dev_list->its_dev_lock); + /* Clean up the unused device */ + vmem_free(dev_list->its_dev_irq_alloc, its_dev->lpis.lpi_base, + nvecs); + free(its_dev->itt, M_DEVBUF); + free(its_dev, M_DEVBUF); + return (tmp_dev); + } + + /* + * Store with an atomic operation to ensure the Valid field is + * set with the other fields. + */ + if (!its_device_dte_update(sc, dev_list, its_dev, dte)) { + mtx_unlock_spin(&dev_list->its_dev_lock); + /* Clean up the unused device */ + vmem_free(dev_list->its_dev_irq_alloc, its_dev->lpis.lpi_base, + nvecs); + free(its_dev->itt, M_DEVBUF); + free(its_dev, M_DEVBUF); + return (NULL); + } + + its_dev->lpis.lpi_base = irq_base; + + TAILQ_INSERT_TAIL(&dev_list->its_dev_list, its_dev, entry); + + bus_write_8(sc->its_cfg, ITS_DIDR, its_dev->devid); + bus_write_4(sc->its_cfg, ITS_INV_DEVICER, ITS_INV_DEVICER_I | + (eventid_bits << ITS_INV_DEVICER_EVENTID_BITS_SHIFT)); + + its_wait_for_statusr(sc); + mtx_unlock_spin(&dev_list->its_dev_lock); + + return (its_dev); +} + + +static int +gicv5_its_intr(void *arg, uintptr_t irq) +{ + struct gicv5_its_softc *sc = arg; + struct gicv5_its_irqsrc *gi; + struct trapframe *tf; + + gi = sc->sc_irqs[irq]; + if (gi == NULL) + panic("%s: Invalid interrupt %ld", __func__, irq); + + tf = curthread->td_intr_frame; + intr_isrc_dispatch(&gi->gi_isrc.gbi_isrc, tf); + return (FILTER_HANDLED); +} + +static int +gicv5_its_select_cpu(device_t dev, struct intr_irqsrc *isrc) +{ + struct gicv5_its_softc *sc; + + sc = device_get_softc(dev); + if (CPU_EMPTY(&isrc->isrc_cpu)) { + sc->its_irq_cpu = intr_irq_next_cpu(sc->its_irq_cpu, + &sc->its_cpus); + CPU_SETOF(sc->its_irq_cpu, &isrc->isrc_cpu); + } + + return (0); +} + +static void +gicv5_its_dte_alloc(struct gicv5_its_softc *sc, size_t size) +{ + sc->its_dl.its_dev_dte_base = contigmalloc(size, M_DEVBUF, + M_WAITOK | M_ZERO, 0, (1ul << sc->its_parange) - 1, + size, 0); + its_dcache_wbinv(sc, sc->its_dl.its_dev_dte_base, size); +} + +static void +gicv5_its_dte_alloc_linear(struct gicv5_its_softc *sc, uint32_t *cfgrp, + u_int devid_bits) +{ + size_t size; + uint32_t cfgr; + u_int n; + + /* + * This is the alignment calculation from the ITS_DT_BASER definition. + */ + n = 2 + devid_bits; + size = 1ul << (n + 1); + + gicv5_its_dte_alloc(sc, size); + + sc->its_dl.its_dev_dte_2l = false; + + cfgr = IRS_DT_CFGR_STRUCTURE_LINEAR; + cfgr |= devid_bits << IRS_DT_CFGR_DEVICE_ID_BITS_SHIFT; + *cfgrp = cfgr; +} + +static void +gicv5_its_dte_alloc_2level(struct gicv5_its_softc *sc, uint32_t *cfgrp, + u_int devid_bits, u_int l2sz) +{ + size_t size; + uint32_t cfgr; + u_int n; + + /* + * This is the alignment calculation from the ITS_DT_BASER + * definition. + */ + n = MAX(2, devid_bits - L2_DTE_LOG2_ENTRIES(l2sz) + 2); + size = 1ul << (n + 1); + + gicv5_its_dte_alloc(sc, size); + + sc->its_dl.its_dev_dte_l2bits = L2_DTE_LOG2_ENTRIES(l2sz); + sc->its_dl.its_dev_dte_l2size = L2_DTE_ENTRIES(l2sz) * L2_DTE_SIZE; + sc->its_dl.its_dev_dte_2l = true; + + cfgr = IRS_DT_CFGR_STRUCTURE_2LVL; + cfgr |= l2sz << ITS_DT_CFGR_L2SZ_SHIFT; + cfgr |= devid_bits << IRS_DT_CFGR_DEVICE_ID_BITS_SHIFT; + *cfgrp = cfgr; +} + +static uint64_t * +gicv5_its_dte_extend(struct gicv5_its_softc *sc, + struct its_device_list *dev_list, uint32_t devid) +{ + uint64_t *l2_dtep; + size_t size; + uint64_t dte, new_dte; + u_int index; + + if (!dev_list->its_dev_dte_2l) + return (&dev_list->its_dev_dte_base[devid]); + + index = devid >> dev_list->its_dev_dte_l2bits; + size = dev_list->its_dev_dte_l2size; + + /* Check if there the l2 pointer is valid */ + dte = atomic_load_64(&dev_list->its_dev_dte_base[index]); + if ((dte & L1_DTE_VALID) != 0) { + l2_dtep = (uint64_t *)PHYS_TO_DMAP(dte & L1_DTE_L2_ADDR_MASK); + goto out; + } + + l2_dtep = contigmalloc(size, M_DEVBUF, M_NOWAIT | M_ZERO, 0, + (1ul << sc->its_parange) - 1, size, 0); + if (l2_dtep == NULL) + return (NULL); + + its_dcache_wbinv(sc, l2_dtep, size); + + new_dte = (uint64_t)dev_list->its_dev_dte_l2bits << L1_DTE_SPAN_SHIFT; + new_dte |= vtophys(l2_dtep); + new_dte |= L1_DTE_VALID; + while (!atomic_fcmpset_64(&dev_list->its_dev_dte_base[index], &dte, + new_dte)) { + if ((dte & L1_DTE_VALID) != 0) { + free(l2_dtep, M_DEVBUF); + l2_dtep = + (uint64_t *)PHYS_TO_DMAP(dte & L1_DTE_L2_ADDR_MASK); + goto out; + } + } + +out: + return (&l2_dtep[devid % (1 << dev_list->its_dev_dte_l2bits)]); +} + +static int +gicv5_its_attach(device_t dev) +{ + struct gicv5_its_softc *sc; + uint32_t cfgr, idr; + u_int devid_bits, l2sz, lpi_start, nlpis; + int error, rid; + bool two_levels; + + sc = device_get_softc(dev); + + lpi_start = gicv5_get_lpi_start(dev); + nlpis = gicv3_get_nirqs(dev); + + rid = 0; + sc->its_cfg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->its_cfg == NULL) { + device_printf(dev, "Unable to map config frame\n"); + return (ENXIO); + } + + switch (bus_read_4(sc->its_cfg, ITS_IDR0) & ITS_IDR0_PA_RANGE_MASK) { + default: + case ITS_IDR0_PA_RANGE_4G: + sc->its_parange = 32; + break; + case ITS_IDR0_PA_RANGE_64G: + sc->its_parange = 36; + break; + case ITS_IDR0_PA_RANGE_1T: + sc->its_parange = 40; + break; + case ITS_IDR0_PA_RANGE_4T: + sc->its_parange = 42; + break; + case ITS_IDR0_PA_RANGE_16T: + sc->its_parange = 44; + break; + case ITS_IDR0_PA_RANGE_256T: + sc->its_parange = 48; + break; + case ITS_IDR0_PA_RANGE_4P: + sc->its_parange = 52; + break; + case ITS_IDR0_PA_RANGE_64P: + sc->its_parange = 56; + break; + } + + idr = bus_read_4(sc->its_cfg, ITS_IDR1); + if ((idr & ITS_IDR1_ITT_LEVELS) != 0) + device_printf(dev, "2 level itt\n"); + if ((idr & ITS_IDR1_DT_LEVELS) != 0) + device_printf(dev, "2 level device table\n"); + if ((idr & (ITS_IDR1_ITT_LEVELS | ITS_IDR1_DT_LEVELS)) != 0) { + if ((idr & ITS_IDR1_L2SZ_64K_MASK) != 0) + device_printf(dev, "64K l2 size\n"); + if ((idr & ITS_IDR1_L2SZ_16K_MASK) != 0) + device_printf(dev, "16K l2 size\n"); + if ((idr & ITS_IDR1_L2SZ_4K_MASK) != 0) + device_printf(dev, "4K l2 size\n"); + if ((idr & ITS_IDR1_L2SZ_MASK) == 0) + device_printf(dev, "2 level tables, but no l2 size\n"); + } + + its_device_list_init(&sc->its_dl); + TAILQ_INIT(&sc->sc_free_irqs); + + error = bus_get_cpus(dev, LOCAL_CPUS, sizeof(sc->its_cpus), + &sc->its_cpus); + if (error != 0) { + device_printf(dev, "Failed to read CPU list\n"); + goto exit; + } + + if (sc->its_coherent) { + bus_write_4(sc->its_cfg, ITS_CR1, ITS_CR1_ITT_RA | + ITS_CR1_DT_RA | ITS_CR1_IC_WB | ITS_CR1_OC_WB | + ITS_CR1_SH_IS); + } else { + bus_write_4(sc->its_cfg, ITS_CR1, ITS_CR1_IC_NC | + ITS_CR1_OC_NC | ITS_CR1_SH_NS); + } + + two_levels = (idr & ITS_IDR1_DT_LEVELS) != 0; + + if (two_levels) { + if ((idr & ITS_IDR1_L2SZ_64K_MASK) != 0) + l2sz = ITS_DT_CFGR_L2SZ_64K_VAL; + else if ((idr & ITS_IDR1_L2SZ_16K_MASK) != 0) + l2sz = ITS_DT_CFGR_L2SZ_16K_VAL; + else + l2sz = ITS_DT_CFGR_L2SZ_4K_VAL; + } + + devid_bits = ITS_IDR1_DEVICEID_BITS_VAL(idr); + + /* + * Use 2 level tables if able, and the size is large enough for them + * to be worth it. This is based on the calculation in the GICv5 + * spec (ARM-AES-0070) 00EAC0 section 10.3.1.6 ITS_DT_CFGR. + */ + if (two_levels && devid_bits > (9 + (2 * l2sz))) + gicv5_its_dte_alloc_2level(sc, &cfgr, devid_bits, l2sz); + else + gicv5_its_dte_alloc_linear(sc, &cfgr, devid_bits); + + bus_write_4(sc->its_cfg, ITS_DT_CFGR, cfgr); + + bus_write_8(sc->its_cfg, ITS_DT_BASER, + vtophys(sc->its_dl.its_dev_dte_base)); + sc->its_dl.its_dev_irq_alloc = vmem_create(device_get_nameunit(dev), + lpi_start, nlpis, 1, 0, M_FIRSTFIT | M_WAITOK); + sc->sc_irqs = mallocarray(nlpis, sizeof(*sc->sc_irqs), M_DEVBUF, + M_WAITOK | M_ZERO); + + its_write_cr0(sc, true); + + /* Register this device as a interrupt controller */ + sc->its_frame.its_pic = intr_pic_register(dev, sc->its_frame.its_xref); + error = intr_pic_add_handler(device_get_parent(dev), + sc->its_frame.its_pic, gicv5_its_intr, sc, lpi_start, nlpis); + if (error != 0) { + device_printf(dev, "Failed to add PIC handler\n"); + goto exit; + } + + /* Register this device to handle MSI interrupts */ + error = intr_msi_register(dev, sc->its_frame.its_xref); + if (error != 0) { + device_printf(dev, "Failed to register for MSIs\n"); + goto exit; + } + + return (0); + +exit: + if (sc->its_frame.its_pic != NULL) + intr_pic_deregister(dev, sc->its_frame.its_xref); + free(sc->sc_irqs, M_DEVBUF); + if (sc->its_dl.its_dev_irq_alloc != NULL) + vmem_destroy(sc->its_dl.its_dev_irq_alloc); + mtx_destroy(&sc->its_dl.its_dev_lock); + bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->its_cfg); + return (error); +} + +static void +gicv5_its_disable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + return (PIC_DISABLE_INTR(device_get_parent(dev), isrc)); +} + +static void +gicv5_its_enable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + return (PIC_ENABLE_INTR(device_get_parent(dev), isrc)); +} + +static void +gicv5_its_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + PIC_PRE_ITHREAD(device_get_parent(dev), isrc); +} + +static void +gicv5_its_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + PIC_POST_ITHREAD(device_get_parent(dev), isrc); +} + +static void +gicv5_its_post_filter(device_t dev, struct intr_irqsrc *isrc) +{ + PIC_POST_FILTER(device_get_parent(dev), isrc); +} + +static int +gicv5_its_bind_intr(device_t dev, struct intr_irqsrc *isrc) +{ + gicv5_its_select_cpu(dev, isrc); + + return (PIC_BIND_INTR(device_get_parent(dev), isrc)); +} + +static int +gicv5_its_map_intr(device_t dev, struct intr_map_data *data, + struct intr_irqsrc **isrcp) +{ + /* + * This should never happen, we only call this function to map + * interrupts found before the controller driver is ready. + */ + panic("%s: Unable to map a MSI interrupt", __func__); +} + +static int +gicv5_its_setup_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + /* Bind the interrupt to a CPU */ + gicv5_its_bind_intr(dev, isrc); + + return (0); +} + +static struct gicv5_its_irqsrc * +gicv5_its_alloc_irqsrc(device_t dev, struct gicv5_its_softc *sc, + u_int event_id, u_int lpi) +{ + struct gicv5_its_irqsrc *girq = NULL; + + KASSERT(sc->sc_irqs[lpi] == NULL, + ("%s: LPI %u already allocated", __func__, lpi)); + mtx_lock_spin(&sc->its_dl.its_dev_lock); + if (!TAILQ_EMPTY(&sc->sc_free_irqs)) { + girq = TAILQ_FIRST(&sc->sc_free_irqs); + TAILQ_REMOVE(&sc->sc_free_irqs, girq, gi_link); + } + mtx_unlock_spin(&sc->its_dl.its_dev_lock); + if (girq == NULL) { + girq = malloc(sizeof(*girq), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (girq == NULL) + return (NULL); + girq->gi_isrc.gbi_space = GICv5_LPI; + girq->gi_isrc.gbi_ipi = false; + if (intr_isrc_register(&girq->gi_isrc.gbi_isrc, dev, 0, + "%s,%u", device_get_nameunit(dev), lpi) != 0) { + free(girq, M_DEVBUF); + return (NULL); + } + } + + gicv5_irs_extend_ist(device_get_parent(dev), dev, lpi); + + girq->gi_isrc.gbi_irq = lpi; + girq->gi_event_id = event_id; + sc->sc_irqs[lpi] = girq; + + return (girq); +} + +static void +gicv5_its_release_irqsrc(struct gicv5_its_softc *sc, + struct gicv5_its_irqsrc *girq) +{ + int error; + + error = intr_isrc_deregister(&girq->gi_isrc.gbi_isrc); + if (error != 0) + panic("Failed to deregister ITS irqsrc"); + + girq->gi_isrc.gbi_irq = -1; + girq->gi_event_id = -1; + girq->gi_its_dev = NULL; + + mtx_lock_spin(&sc->its_dl.its_dev_lock); *** 300 LINES SKIPPED *** From nobody Thu Jun 18 14:57:42 2026 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 4gh3jz1tJ1z6hM53 for ; Thu, 18 Jun 2026 14:57: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gh3jz12kwz43vt for ; Thu, 18 Jun 2026 14:57:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781794663; 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=Zr6+PSTW73FkLfYW/UvWx22o2RA2RiOlBkiad9+aM9Q=; b=bzSUxqvfGmZNmFLF23hOxnPr90dr5d3ip2ikDgcx9su4VLDc82UzAoTAE7uoVfTN5uQMz5 xOHx/lfuS1J0ZMJ9FX6jUvRQsQ4MFXjqdt+QQiK9AdPSOkNp5A0eU0c9OhueoRVmzs24MV EuAEOb5ihqZ1yhZXLs+zqB5P4iXJMOn6XLbIG6w2e3l0lDBchmoqWm9pEA6jpgG0D4YfPW +8xihIyo59Qk0aPVTlD1FsZRo7RjeCLTZcKPUQnK3TzTaN8on3oHSDlxWL/O4S4DSs/ZWN 2NMOrxD8pi1rEF7pq5JGTf57+kv+BRg6is/E1HzTxzqsV++pXlDsoe/VRyF4JQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781794663; a=rsa-sha256; cv=none; b=rmxkU1k/ufUAn25B45NizsLdONdb2uXmochKjNIzMUtwzHSJEYogb+fXd454tTLCV+12ny DPnX2d3lRswUwF7HD77IsQe2CqcJ4jdVNXR4ZuND/QyBIHiSTSi7orhNHT5hhu4YbTh/jH JHjpDbmzljqrEGNbJcDlVhymdJ2uNqYT7gicgUTDAEufoQr7/C1KiMfKSnOIO05dFKezec YB3F5Fpzljn6LK7WaIhU5QxDac0HMPTPx0kPYedYtZ4UAPGEOAMlRpON3N2s2ux6X2B/6k aoXultlrCneUfQKzevnWHj7H/ezuuHAU5n3leK7EppQ07PpVPrIqWTtBe07l1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781794663; 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=Zr6+PSTW73FkLfYW/UvWx22o2RA2RiOlBkiad9+aM9Q=; b=kmjQ/JtQ7sVImwqPaE5keJgGPrnjFXtowNaTcz/oTCvsq+yEa5g0pRWEbzfnRRPMmj7cOX xnxNwQipZFxaNBnm8kTf0rF5IwfuHoVb2VAnm+YrKjURqkhySs7HvyduHFYQIe9puorIbC tsgh15nK2NiOxA/8mGBFiVFQ9W8Oi6ewny0FmHMN6tk3xYIqqvISlFExbZqwZWToROR+D5 QNUbsslTcrD383htszyKjDHWfaTt0Y0kORLZPBXdtjHGNFYtdIYqEnbgBwGmjNqWGHh/f4 x0WCmIBaCvJ6LbORrNvqOBehVq5/+SEHTNj3W028Qe2OlhQ2rJCMzHaTPORgFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gh3jy70hZz138S for ; Thu, 18 Jun 2026 14:57:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f2ed by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Jun 2026 14:57:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: cbef29bde7ce - main - arm64: Add an initial GICv5 IWB driver 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cbef29bde7ce8f2bac4bff831a21e9e54ae51d20 Auto-Submitted: auto-generated Date: Thu, 18 Jun 2026 14:57:42 +0000 Message-Id: <6a340766.3f2ed.3bf209d0@gitrepo.freebsd.org> The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=cbef29bde7ce8f2bac4bff831a21e9e54ae51d20 commit cbef29bde7ce8f2bac4bff831a21e9e54ae51d20 Author: Andrew Turner AuthorDate: 2026-06-18 13:52:18 +0000 Commit: Andrew Turner CommitDate: 2026-06-18 14:56:53 +0000 arm64: Add an initial GICv5 IWB driver Add a driver to support the GICv5 interrupt wire bridge (IWB). The IWB translates the change in state of an input wire and sends a MSI to the interrupt translation service (ITS) to be translated to an LPI. Unlike other MSI sources each wire has a fixed Event ID value it will write in the MSI data. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D54252 --- sys/arm64/arm64/gicv5_iwb.c | 561 ++++++++++++++++++++++++++++++++++++++++++++ sys/conf/files.arm64 | 1 + 2 files changed, 562 insertions(+) diff --git a/sys/arm64/arm64/gicv5_iwb.c b/sys/arm64/arm64/gicv5_iwb.c new file mode 100644 index 000000000000..fa2ad370e626 --- /dev/null +++ b/sys/arm64/arm64/gicv5_iwb.c @@ -0,0 +1,561 @@ +/*- + * Copyright (c) 2025 Arm Ltd + * + * 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 "opt_acpi.h" +#include "opt_platform.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef FDT +#include +#include +#include +#include +#endif + +#include "pci_if.h" +#include "pic_if.h" + +#define IWB_IDR0 0x0000 +#define IDR0_IW_RANGE_SHIFT 0 +#define IDR0_IW_RANGE_MASK (0x7ffu << IDR0_IW_RANGE_SHIFT) +#define IDR0_IW_RANGE_IRQs(x) \ + ((((x) & IDR0_IW_RANGE_MASK) + 1) * 32) +#define IWB_IIDR 0x0040 +#define IWB_AIDR 0x0044 +#define IWB_CR0 0x0080 +#define CR0_IWBEN (0x1u << 0) +#define IWB_WENABLE_STATUSR 0x00C0 +#define WENABLE_STATUSR_IDLE (0x1u << 0) +#define IWB_WRESAMPLER 0x00C8 +#define IWB_WENABLER(irq) (0x2000 + (4 * ((irq) / 32))) +#define WENABLER_MASK(irq) (0x1u << ((irq) % 32)) +#define WENABLER_ENABLED(irq) (0x1u << ((irq) % 32)) +#define IWB_WTMR(irq) (0x4000 + (4 * ((irq) / 32))) +#define WTMR_MASK(irq) (0x1u << ((irq) % 32)) +#define WTMR_LEVEL(irq) (0x1u << ((irq) % 32)) + +struct gicv5_iwb_softc; + +struct gicv5_iwb_irqsrc { + struct intr_irqsrc gi_isrc; + uint32_t gi_irq; + enum intr_polarity gi_pol; + enum intr_trigger gi_trig; + struct resource *gi_res; /* Parent MSI interrupt resource */ + void *gi_cookie; + struct gicv5_iwb_softc *gi_sc; + int gi_rid; +}; + +struct gicv5_iwb_softc { + struct mtx sc_mtx; + device_t sc_dev; + struct resource *sc_mem; + struct intr_pic *sc_pic; + struct gicv5_iwb_irqsrc *sc_irqs; + int sc_mem_rid; + u_int sc_nirq; +}; + +static device_attach_t gicv5_iwb_attach; + +static pic_disable_intr_t gicv5_iwb_disable_intr; +static pic_enable_intr_t gicv5_iwb_enable_intr; +static pic_map_intr_t gicv5_iwb_map_intr; +static pic_setup_intr_t gicv5_iwb_setup_intr; +static pic_teardown_intr_t gicv5_iwb_teardown_intr; +static pic_post_filter_t gicv5_iwb_post_filter; +static pic_post_ithread_t gicv5_iwb_post_ithread; +static pic_pre_ithread_t gicv5_iwb_pre_ithread; + +static device_method_t gicv5_iwb_methods[] = { + /* Bus interface */ + DEVMETHOD(device_attach, gicv5_iwb_attach), + + /* Interrupt controller interface */ + DEVMETHOD(pic_disable_intr, gicv5_iwb_disable_intr), + DEVMETHOD(pic_enable_intr, gicv5_iwb_enable_intr), + DEVMETHOD(pic_map_intr, gicv5_iwb_map_intr), + DEVMETHOD(pic_setup_intr, gicv5_iwb_setup_intr), + DEVMETHOD(pic_teardown_intr, gicv5_iwb_teardown_intr), + DEVMETHOD(pic_post_filter, gicv5_iwb_post_filter), + DEVMETHOD(pic_post_ithread, gicv5_iwb_post_ithread), + DEVMETHOD(pic_pre_ithread, gicv5_iwb_pre_ithread), + + /* End */ + DEVMETHOD_END +}; + +static DEFINE_CLASS_0(iwb, gicv5_iwb_driver, gicv5_iwb_methods, + sizeof(struct gicv5_iwb_softc)); + +static void +gicv5_iwb_wait_for_wenabler(struct gicv5_iwb_softc *sc) +{ + uint32_t reg; + int timeout; + + mtx_assert(&sc->sc_mtx, MA_OWNED); + + /* Timeout of ~10ms */ + timeout = 10000; + do { + reg = bus_read_4(sc->sc_mem, IWB_WENABLE_STATUSR); + if ((reg & WENABLE_STATUSR_IDLE) != 0) + return; + DELAY(1); + } while (--timeout > 0); + + device_printf(sc->sc_dev, "IWB_WENABLE_STATUSR timeout\n"); +} + +static int +gicv5_iwb_intr(void *arg) +{ + struct gicv5_iwb_irqsrc *gi = arg; + struct trapframe *tf; + + tf = curthread->td_intr_frame; + if (intr_isrc_dispatch(&gi->gi_isrc, tf) != 0) { + device_t dev; + + dev = gi->gi_sc->sc_dev; + gicv5_iwb_disable_intr(dev, &gi->gi_isrc); + device_printf(dev, "Stray irq %u disabled\n", + gi->gi_irq); + } + + return (FILTER_HANDLED); +} + +static int +gicv5_iwb_attach(device_t dev) +{ + struct gicv5_iwb_softc *sc; + const char *name; + uint32_t cr0; + int count, error; + u_int i; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + mtx_init(&sc->sc_mtx, "GICv5 IWB lock", NULL, MTX_SPIN); + + sc->sc_mem_rid = 0; + sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->sc_mem_rid, RF_ACTIVE); + if (sc->sc_mem == NULL) + return (ENXIO); + + cr0 = bus_read_4(sc->sc_mem, IWB_CR0); + if ((cr0 & CR0_IWBEN) == 0) { + device_printf(dev, "IWB not enabled in firmware: %x\n", cr0); + bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_mem_rid, + sc->sc_mem); + return (ENXIO); + } + + sc->sc_nirq = IDR0_IW_RANGE_IRQs(bus_read_4(sc->sc_mem, IWB_IDR0)); + if (bootverbose) + device_printf(dev, "Found %u irqs\n", sc->sc_nirq); + + /* Disable all interrupts */ + for (int i = 0; i < sc->sc_nirq; i += 32) + bus_write_4(sc->sc_mem, IWB_WENABLER(i), 0); + mtx_lock_spin(&sc->sc_mtx); + gicv5_iwb_wait_for_wenabler(sc); + mtx_unlock_spin(&sc->sc_mtx); + + /* Allocate an MSI for each interrupt */ + count = sc->sc_nirq; + error = PCI_ALLOC_MSI(device_get_parent(dev), dev, &count); + if (error != 0) { + device_printf(dev, "Unable to allocate MSI interrupts\n"); + return (error); + } + + name = device_get_nameunit(dev); + sc->sc_irqs = mallocarray(sc->sc_nirq, sizeof(struct gicv5_iwb_irqsrc), + M_DEVBUF, M_ZERO | M_WAITOK); + for (i = 0; i < sc->sc_nirq; i++) { + sc->sc_irqs[i].gi_irq = i; + sc->sc_irqs[i].gi_sc = sc; + + sc->sc_irqs[i].gi_rid = i + 1; + sc->sc_irqs[i].gi_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_irqs[i].gi_rid, RF_ACTIVE); + if (sc->sc_irqs[i].gi_res == NULL) { + device_printf(dev, + "Unable to allocate MSI for wire %d\n", i); + error = ENXIO; + goto exit; + } + + error = bus_setup_intr(dev, sc->sc_irqs[i].gi_res, + INTR_TYPE_MISC | INTR_MPSAFE, gicv5_iwb_intr, NULL, + &sc->sc_irqs[i], &sc->sc_irqs[i].gi_cookie); + if (error != 0) { + device_printf(dev, "Unable to setup MSI for wire %d\n", + i); + goto exit_setup_intr; + } + + error = intr_isrc_register(&sc->sc_irqs[i].gi_isrc, dev, + 0, "%s,%u", name, i); + if (error != 0) { + device_printf(dev, "Unable to register wire %d\n", i); + goto exit_isrc; + } + } + + return (0); + +exit_isrc: + bus_teardown_intr(dev, sc->sc_irqs[i].gi_res, sc->sc_irqs[i].gi_cookie); +exit_setup_intr: + bus_release_resource(dev, SYS_RES_IRQ, + sc->sc_irqs[i].gi_rid, sc->sc_irqs[i].gi_res); +exit: + sc->sc_irqs[i].gi_res = NULL; + + for (u_int j = 0; j < i; j++) { + MPASS(sc->sc_irqs[j].gi_res != NULL); + + intr_isrc_deregister(&sc->sc_irqs[j].gi_isrc); + if (sc->sc_irqs[j].gi_cookie != NULL) + bus_teardown_intr(dev, sc->sc_irqs[j].gi_res, + sc->sc_irqs[j].gi_cookie); + bus_release_resource(dev, SYS_RES_IRQ, + sc->sc_irqs[j].gi_rid, sc->sc_irqs[j].gi_res); + } + + /* TODO: Implement in buses this could attach to */ + /*PCI_RELEASE_MSI(device_get_parent(dev), dev, count);*/ + + return (error); +} + +static void +gicv5_iwb_disable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct gicv5_iwb_irqsrc *gi = (struct gicv5_iwb_irqsrc *)isrc; + struct gicv5_iwb_softc *sc; + uint32_t reg; + u_int irq; + + sc = device_get_softc(dev); + irq = gi->gi_irq; + + mtx_lock_spin(&sc->sc_mtx); + reg = bus_read_4(sc->sc_mem, IWB_WENABLER(irq)); + reg &= ~WENABLER_ENABLED(irq); + bus_write_4(sc->sc_mem, IWB_WENABLER(irq), reg); + + gicv5_iwb_wait_for_wenabler(sc); + mtx_unlock_spin(&sc->sc_mtx); +} + +static void +gicv5_iwb_enable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct gicv5_iwb_irqsrc *gi = (struct gicv5_iwb_irqsrc *)isrc; + struct gicv5_iwb_softc *sc; + uint32_t reg; + u_int irq; + + sc = device_get_softc(dev); + irq = gi->gi_irq; + + mtx_lock_spin(&sc->sc_mtx); + reg = bus_read_4(sc->sc_mem, IWB_WENABLER(irq)); + reg |= WENABLER_ENABLED(irq); + bus_write_4(sc->sc_mem, IWB_WENABLER(irq), reg); + + gicv5_iwb_wait_for_wenabler(sc); + mtx_unlock_spin(&sc->sc_mtx); +} + +#ifdef FDT +static int +gicv5_iwb_map_fdt(device_t dev, u_int ncells, pcell_t *cells, u_int *irqp, + enum intr_polarity *polp, enum intr_trigger *trigp) +{ + if (ncells < 2) + return (EINVAL); + + /* + * The 1st cell contains the interrupt number + * The 2nd cell is the flags, encoded as follows: + * bits[3:0] trigger type and level flags + */ + *irqp = cells[0]; + + switch (cells[1] & FDT_INTR_MASK) { + case FDT_INTR_EDGE_RISING: + *trigp = INTR_TRIGGER_EDGE; + *polp = INTR_POLARITY_HIGH; + break; + case FDT_INTR_EDGE_FALLING: + *trigp = INTR_TRIGGER_EDGE; + *polp = INTR_POLARITY_LOW; + break; + case FDT_INTR_LEVEL_HIGH: + *trigp = INTR_TRIGGER_LEVEL; + *polp = INTR_POLARITY_HIGH; + break; + case FDT_INTR_LEVEL_LOW: + *trigp = INTR_TRIGGER_LEVEL; + *polp = INTR_POLARITY_LOW; + break; + default: + device_printf(dev, "unsupported trigger/polarity " + "configuration 0x%02x\n", cells[2]); + return (EINVAL); + } + + return (0); +} +#endif + +static int +do_gicv5_iwb_map_intr(device_t dev, struct intr_map_data *data, u_int *irqp, + enum intr_polarity *polp, enum intr_trigger *trigp) +{ + struct gicv5_iwb_softc *sc; + enum intr_polarity pol; + enum intr_trigger trig; +#ifdef FDT + struct intr_map_data_fdt *daf; +#endif + u_int irq; + + sc = device_get_softc(dev); + + switch (data->type) { +#ifdef FDT + case INTR_MAP_DATA_FDT: + daf = (struct intr_map_data_fdt *)data; + if (gicv5_iwb_map_fdt(dev, daf->ncells, daf->cells, &irq, &pol, + &trig) != 0) + return (EINVAL); + break; +#endif + default: + return (EINVAL); + } + + if (irq > sc->sc_nirq) + return (EINVAL); + + switch (pol) { + case INTR_POLARITY_CONFORM: + case INTR_POLARITY_LOW: + case INTR_POLARITY_HIGH: + break; + default: + return (EINVAL); + } + switch (trig) { + case INTR_TRIGGER_CONFORM: + case INTR_TRIGGER_EDGE: + case INTR_TRIGGER_LEVEL: + break; + default: + return (EINVAL); + } + + *irqp = irq; + if (polp != NULL) + *polp = pol; + if (trigp != NULL) + *trigp = trig; + return (0); +} + +static int +gicv5_iwb_map_intr(device_t dev, struct intr_map_data *data, + struct intr_irqsrc **isrcp) +{ + struct gicv5_iwb_softc *sc; + u_int irq; + int error; + + error = do_gicv5_iwb_map_intr(dev, data, &irq, NULL, NULL); + if (error == 0) { + sc = device_get_softc(dev); + *isrcp = &sc->sc_irqs[irq].gi_isrc; + } + return (error); +} + +static int +gicv5_iwb_setup_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + struct gicv5_iwb_irqsrc *gi = (struct gicv5_iwb_irqsrc *)isrc; + struct gicv5_iwb_softc *sc; + enum intr_trigger trig; + enum intr_polarity pol; + uint32_t reg; + u_int irq; + int error; + + if (data == NULL) + return (ENOTSUP); + + error = do_gicv5_iwb_map_intr(dev, data, &irq, &pol, &trig); + if (error != 0) + return (error); + + if (gi->gi_irq != irq || pol == INTR_POLARITY_CONFORM || + trig == INTR_TRIGGER_CONFORM) + return (EINVAL); + + /* Compare config if this is not first setup. */ + if (isrc->isrc_handlers != 0) { + if (pol != gi->gi_pol || trig != gi->gi_trig) + return (EINVAL); + else + return (0); + } + + sc = device_get_softc(dev); + + gi->gi_pol = pol; + gi->gi_trig = trig; + + mtx_lock_spin(&sc->sc_mtx); + reg = bus_read_4(sc->sc_mem, IWB_WTMR(irq)); + reg &= ~WTMR_MASK(irq); + if (trig == INTR_TRIGGER_LEVEL) + reg |= WTMR_LEVEL(irq); + bus_write_4(sc->sc_mem, IWB_WTMR(irq), reg); + mtx_unlock_spin(&sc->sc_mtx); + + return (0); +} + +static int +gicv5_iwb_teardown_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + return (0); +} + +static void +gicv5_iwb_post_filter(device_t dev, struct intr_irqsrc *isrc) +{ + /* Handled by the parent as we use a filter to dispatch */ +} + +static void +gicv5_iwb_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + gicv5_iwb_enable_intr(dev, isrc); +} + +static void +gicv5_iwb_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + gicv5_iwb_disable_intr(dev, isrc); +} + +#ifdef FDT +struct gicv5_iwb_fdt_softc { + struct gicv5_iwb_softc sc_base; +}; + +static device_probe_t gicv5_iwb_fdt_probe; +static device_attach_t gicv5_iwb_fdt_attach; + +static device_method_t gicv5_iwb_fdt_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, gicv5_iwb_fdt_probe), + DEVMETHOD(device_attach, gicv5_iwb_fdt_attach), + + /* End */ + DEVMETHOD_END +}; + +#define iwb_baseclasses iwbv5_fdt_baseclasses +DEFINE_CLASS_1(iwb, gicv5_iwb_fdt_driver, gicv5_iwb_fdt_methods, + sizeof(struct gicv5_iwb_fdt_softc), gicv5_iwb_driver); +#undef iwb_baseclasses + +/* This needs to be after the ITS as it sends MSI messages there */ +EARLY_DRIVER_MODULE(gicv5_iwb, simplebus, gicv5_iwb_fdt_driver, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); + +static int +gicv5_iwb_fdt_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "arm,gic-v5-iwb")) + return (ENXIO); + + device_set_desc(dev, "ARM GICv5 Interrupt Wire Bridge"); + return (BUS_PROBE_DEFAULT); +} + +static int +gicv5_iwb_fdt_attach(device_t dev) +{ + struct gicv5_iwb_fdt_softc *sc; + intptr_t xref; + phandle_t node; + int error; + + error = gicv5_iwb_attach(dev); + if (error != 0) + return (error); + + sc = device_get_softc(dev); + node = ofw_bus_get_node(dev); + xref = OF_xref_from_node(node); + sc->sc_base.sc_pic = intr_pic_register(dev, xref); + if (sc->sc_base.sc_pic == NULL) + return (ENXIO); + + OF_device_register_xref(xref, dev); + + return (0); +} +#endif /* FDT */ diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index a2244a9fe9b8..6a495d193890 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -62,6 +62,7 @@ arm64/arm64/gic_v3_fdt.c optional fdt arm64/arm64/gicv5.c standard arm64/arm64/gicv5_fdt.c optional fdt arm64/arm64/gicv5_its.c optional fdt +arm64/arm64/gicv5_iwb.c optional fdt arm64/arm64/hyp_stub.S standard arm64/arm64/identcpu.c standard arm64/arm64/kexec_support.c standard From nobody Thu Jun 18 15:47:04 2026 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 4gh4pw5Bzrz6hRqJ for ; Thu, 18 Jun 2026 15:47: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gh4pw391Yz3CBX for ; Thu, 18 Jun 2026 15:47:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781797624; 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=MchWMxe/xsZ/1qLkQZBE9M0kD3m140UlQdn8F/rptNU=; b=OeSbQexi1KVKuvGmJ7gX5rysYNiKEqw6LzKy5QjpuPAAqsBuklkfc2/6/yUlTJ9zitN92U dhGWoOnYhEXeoofYmsnzaLCvrcdmzAWLXeT9otWVzaO1KweLEQp9EQUJJJNAr25LrU5rUG esaNPq7I9x9egnVqBwezBOj650HfHFaxjon4lu+s44mIyi4KEqDgDbhHPiX2I+FkF+5NIZ wLkYFzvZXWO5JzkCrCHcwZwoZSQAkF+4R7Y8tTVpNE5OR0IYjkWnrrhZPuW5fwoWFogm3h zfN6my85cvnvMIDvMOCrFeRV8lsOmunrFYtDOu4i2+NuZq61fk3WXFA9ilZb9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781797624; a=rsa-sha256; cv=none; b=gpZJ3xjm72lNry1yh71xRQ4fJr4obj8Pgw5/VBzZT4fUTklNwJqgmvEWFdO6qr7Ab7eEh+ 5jcoSo/fSZhykHxqxbb9fDi8BO1Mvc0n5xj1bjZaHhu0R0cjbSyoaNvoD8nO87AHq/Ev2g +Wedf6mHkWfhQ7TbZp7BBcpdi9HcFnhE3gPIqnCxbIHgCP6KEv3mDBy+FDXehzYhhDAvtf UugLFBbCRHbndSw7da2Ga4S5wp5/7lJCXES6i+HqZ3A996baDdL4TG0akmfpjEXvpRRXY2 Xfq9SG5Aafr5u5eMUQgk8IrKyU9lmrsB8CjU2qSBtospqoy/OyaIOO3dU7WeZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781797624; 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=MchWMxe/xsZ/1qLkQZBE9M0kD3m140UlQdn8F/rptNU=; b=SPqSI2/XHQzwSQxytagrmp2+Zf17Fdl9NziEDK6hd5Xhdsz/KCOlOt5iAG8kBS9lIwFH3X 4bQ+VDP8hTnGijfM3BPS4MLqsteqFEmydMRJ6sAZOdKlo5dVmwUz8rMVzi7VcxoeZEaKMd lCs4PyWSNmoPizVAu4CY9eFc1rRNeMMl4YnvuWeTejq7B73ETImEuMQcbLmicOZCGR53Qj S2awf/zV1nFDApFR82vPZOlFG+chnFSAH+QyzBs6COb5IFBbwoJIEAJVEkwW4aDS5c6F3T 57SQpTco1wzsHbVlmtRarI7NwhF59fumFJIiqLpxrpGOUHstSOtgQvuY8tOFUQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gh4pw1z0Pz14nF for ; Thu, 18 Jun 2026 15:47:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 443d4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Jun 2026 15:47:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: b1af05406b51 - main - nfs_nfsdserv.c: Fix setting of birthtime for some ZFS pools 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b1af05406b5117d76f567056fba0a023a6374465 Auto-Submitted: auto-generated Date: Thu, 18 Jun 2026 15:47:04 +0000 Message-Id: <6a3412f8.443d4.2e248cb0@gitrepo.freebsd.org> The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=b1af05406b5117d76f567056fba0a023a6374465 commit b1af05406b5117d76f567056fba0a023a6374465 Author: Rick Macklem AuthorDate: 2026-06-18 15:45:27 +0000 Commit: Rick Macklem CommitDate: 2026-06-18 15:45:27 +0000 nfs_nfsdserv.c: Fix setting of birthtime for some ZFS pools Some ZFS pools do not support va_birthtime and will return EINVAL when a VOP_SETATTR() of it is attempted. The MacOS NFSv4 client sets va_birthtime (TimeCreate) in the same Setattr with ctime/mtime and other attributes after a new file is created. The EINVAL failure leaves these new files messed up (mode == 0). This patch pretends the setting of TimeCreate succeeded if ctime/mtime were also set in the same Setattr RPC, which resolves the problem for the MacOS client. If this fix is not sufficient, a new pathconf name to detect if a file system supports birthtime may be needed. PR: 296066 Tested by: Will MFC after: 2 weeks --- sys/fs/nfsserver/nfs_nfsdserv.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 9e5235f95ed1..fe7f0e217a74 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -579,6 +579,16 @@ nfsrvd_setattr(struct nfsrv_descript *nd, __unused int isdgram, NFSVNO_SETATTRVAL(&nva2, btime, nva.na_btime); nd->nd_repstat = nfsvno_setattr(vp, &nva2, nd->nd_cred, p, exp); + /* + * ZFS stores with early versions do not support va_birthtime + * and will reply EINVAL when setting is attempted. This + * breaks the MacOS NFSv4 client, so pretend it succeeded if + * ctime and/or mtime were set as well. + */ + if (nd->nd_repstat == EINVAL && + (NFSISSET_ATTRBIT(&retbits, NFSATTRBIT_TIMEACCESSSET) || + NFSISSET_ATTRBIT(&retbits, NFSATTRBIT_TIMEMODIFYSET))) + nd->nd_repstat = 0; if (!nd->nd_repstat) NFSSETBIT_ATTRBIT(&retbits, NFSATTRBIT_TIMECREATE); } From nobody Thu Jun 18 16:05:05 2026 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 4gh5Cj522Kz6hStT for ; Thu, 18 Jun 2026 16:05: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gh5Cj37cJz3DxZ for ; Thu, 18 Jun 2026 16:05:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781798705; 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; bh=fQ/KMKzPTrbec4RMNTiTeipZK/z3hsu9EfbWVQ5rv9w=; b=uURUfuzLeUkKkpPCOWCB838RwBKvmKt627nlMQyXR8lpdjYlFNR+BGnWZiPT+R6Br2glNL omTxjd06rOvNhr/H913EuhpVERX+hvNO9PVSG3Y6RzX+V/VVWJOf3PcLkWLiPfKQ2V0njf IIXob9ZizIo5rewFqGfBNReyRE8rwXIRbLZFtreqHuujo26Aeh9ykQjbG/MIH7Xg3K8wfv RIXlwPifsJ0iY3zDR0aDiI6UNVmpLGFS/vERmZJOlEpV7thZSRRz/cxvWn3KcjWNYskjsr bXEij5VjsJ8QETbbiVeiG2Nzg1kDib1TeAdi92NCD7ymIH5fDknuXBXozsE1/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781798705; a=rsa-sha256; cv=none; b=W6oT8/zz6xhkDINlwbDp4vVgCSan7B6diyTYQt1LRV6ZZ10opZgWd+mb7ei/44wDylhaui 3/AFMCOyAZSG+RMU5n8WsBdVk7w6spuHqt7dcyIdiuvCQtBeESaC4cNQnzdBht8QVGMkVD utIXhYGP+p4Im5UDBOqYMmcCccNJXX4fm7b8ITA444g1ITT0Bl38U4mg+huzU17jDC2iyn 2VdNq/ZeUsIjbILEENHJvKGJGiMQomcoMYNPqnsOloEJ3tvQB9IsCdAXCHRMOHklvqZ6Ak F0oSHttr1UJbGBIHkRQti+ZpkbA44CTBmdaG09RuME3a1ybD41MMnt8ayodY7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781798705; 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; bh=fQ/KMKzPTrbec4RMNTiTeipZK/z3hsu9EfbWVQ5rv9w=; b=Bs7ZPnKY5nWoZQg1/6/1ZmuIjSShae4RKCYVf276YEA2D+Jy1hroRsLvsKM0bPplyZiBGJ Lj8dVViSdPLE0onTKsH4bfZRa3+GG97l3uTy719BGfIohVUlgYMgewyLCcumZ4ryBJjVvm nW6jdYIi3aepIXVwhOgVlt7vfR+INmWQW20s8fn6n299U6Qy5d6Q9Iw8lPMaNQrLXNYjSC wP1Nw/nqG2jiCmFcUwZoRiqzCOKDuTVT+AjPvYsVltNx9cr66oUPS9IS+uYhNoP8MR6K/X Xg1bRsZ60C+o9oAOs+pjQSWOoExjDeEIeVMz8WF3zaL77zg4mTmPAYC9JsB2cQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gh5Cj1ynmz14Wg for ; Thu, 18 Jun 2026 16:05:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 45d9c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Jun 2026 16:05:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Sarah Walker From: Andrew Turner Subject: git: 8193fa3b8e1a - main - virtio_net: Use bus_dma for rxq/txq buffers 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8193fa3b8e1a9425bd8ac8b707cab565816b8584 Auto-Submitted: auto-generated Date: Thu, 18 Jun 2026 16:05:05 +0000 Message-Id: <6a341731.45d9c.36ae1fa9@gitrepo.freebsd.org> The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=8193fa3b8e1a9425bd8ac8b707cab565816b8584 commit 8193fa3b8e1a9425bd8ac8b707cab565816b8584 Author: Sarah Walker AuthorDate: 2026-02-16 14:19:13 +0000 Commit: Andrew Turner CommitDate: 2026-06-18 16:04:24 +0000 virtio_net: Use bus_dma for rxq/txq buffers While the majority of virtio platforms will be fully coherent, some may require cache maintenance or other specific device memory handling (eg for secure partitioning). Using bus_dma allows for these usecases. The virtio buffers are marked as coherent; this should ensure that sync calls are no-ops in the common cases. Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D55492 --- sys/dev/virtio/network/if_vtnet.c | 298 +++++++++++++++++++++++++++++++++-- sys/dev/virtio/network/if_vtnetvar.h | 10 ++ 2 files changed, 291 insertions(+), 17 deletions(-) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index ef01833b9e03..57cbdca0dbeb 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -96,6 +96,17 @@ #define VTNET_ETHER_ALIGN ETHER_ALIGN #endif +/* + * Worst case offset to ensure header doesn't share any cache lines with + * payload. + */ +#define VTNET_RX_BUFFER_HEADER_OFFSET 128 + +struct vtnet_rx_buffer_header { + bus_addr_t addr; + bus_dmamap_t dmap; +}; + static int vtnet_modevent(module_t, int, void *); static int vtnet_probe(device_t); @@ -384,6 +395,17 @@ MODULE_DEPEND(vtnet, netmap, 1, 1, 1); VIRTIO_SIMPLE_PNPINFO(vtnet, VIRTIO_ID_NETWORK, "VirtIO Networking Adapter"); +static struct vtnet_rx_buffer_header * +vtnet_mbuf_to_rx_buffer_header(struct vtnet_softc *sc, struct mbuf *m) +{ + if (VTNET_ETHER_ALIGN != 0 && sc->vtnet_hdr_size % 4 == 0) + return (struct vtnet_rx_buffer_header *)((uintptr_t)m->m_data - + VTNET_RX_BUFFER_HEADER_OFFSET - VTNET_ETHER_ALIGN); + else + return (struct vtnet_rx_buffer_header *)((uintptr_t)m->m_data - + VTNET_RX_BUFFER_HEADER_OFFSET); +} + static int vtnet_modevent(module_t mod __unused, int type, void *unused __unused) { @@ -457,6 +479,60 @@ vtnet_attach(device_t dev) goto fail; } + mtx_init(&sc->vtnet_rx_mtx, device_get_nameunit(dev), + "VirtIO Net RX lock", MTX_DEF); + + error = bus_dma_tag_create( + bus_get_dma_tag(dev), /* parent */ + 1, /* alignment */ + 0, /* boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MJUM9BYTES, /* max request size */ + 1, /* max # segments */ + MJUM9BYTES, /* maxsegsize - worst case */ + BUS_DMA_COHERENT, /* flags */ + busdma_lock_mutex, /* lockfunc */ + &sc->vtnet_rx_mtx, /* lockarg */ + &sc->vtnet_rx_dmat); + if (error) { + device_printf(dev, "cannot create bus_dma_tag\n"); + goto fail; + } + + mtx_init(&sc->vtnet_tx_mtx, device_get_nameunit(dev), + "VirtIO Net TX lock", MTX_DEF); + + error = bus_dma_tag_create( + bus_get_dma_tag(dev), /* parent */ + 1, /* alignment */ + 0, /* boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + sc->vtnet_tx_nsegs * MJUM9BYTES, /* max request size */ + sc->vtnet_tx_nsegs, /* max # segments */ + MJUM9BYTES, /* maxsegsize */ + BUS_DMA_COHERENT, /* flags */ + busdma_lock_mutex, /* lockfunc */ + &sc->vtnet_tx_mtx, /* lockarg */ + &sc->vtnet_tx_dmat); + if (error) { + device_printf(dev, "cannot create bus_dma_tag\n"); + goto fail; + } + +#ifdef __powerpc__ + /* + * Virtio uses physical addresses rather than bus addresses, so we + * need to ask busdma to skip the iommu physical->bus mapping. At + * present, this is only a thing on the powerpc architectures. + */ + bus_dma_tag_set_iommu(sc->vtnet_rx_dmat, NULL, NULL); + bus_dma_tag_set_iommu(sc->vtnet_tx_dmat, NULL, NULL); +#endif + error = vtnet_alloc_rx_filters(sc); if (error) { device_printf(dev, "cannot allocate Rx filters\n"); @@ -1545,6 +1621,11 @@ static struct mbuf * vtnet_rx_alloc_buf(struct vtnet_softc *sc, int nbufs, struct mbuf **m_tailp) { struct mbuf *m_head, *m_tail, *m; + struct vtnet_rx_buffer_header *vthdr; + bus_dma_segment_t segs[1]; + bus_dmamap_t dmap; + int nsegs; + int err; int i, size; m_head = NULL; @@ -1562,13 +1643,43 @@ vtnet_rx_alloc_buf(struct vtnet_softc *sc, int nbufs, struct mbuf **m_tailp) } m->m_len = size; + vthdr = (struct vtnet_rx_buffer_header *)m->m_data; + + /* Reserve space for header */ + m_adj(m, VTNET_RX_BUFFER_HEADER_OFFSET); + /* * Need to offset the mbuf if the header we're going to add * will misalign. */ - if (VTNET_ETHER_ALIGN != 0 && sc->vtnet_hdr_size % 4 == 0) { + if (VTNET_ETHER_ALIGN != 0 && sc->vtnet_hdr_size % 4 == 0) m_adj(m, VTNET_ETHER_ALIGN); + + err = bus_dmamap_create(sc->vtnet_rx_dmat, 0, &dmap); + if (err) { + printf("Failed to create dmamap, err :%d\n", + err); + m_freem(m); + return (NULL); + } + + nsegs = 0; + err = bus_dmamap_load_mbuf_sg(sc->vtnet_rx_dmat, dmap, m, segs, + &nsegs, BUS_DMA_NOWAIT); + if (err != 0) { + printf("Failed to map mbuf into DMA visible memory, err: %d\n", + err); + m_freem(m); + bus_dmamap_destroy(sc->vtnet_rx_dmat, dmap); + return (NULL); } + KASSERT(nsegs == 1, + ("%s: unexpected number of DMA segments for rx buffer: %d", + __func__, nsegs)); + + vthdr->addr = segs[0].ds_addr; + vthdr->dmap = dmap; + if (m_head != NULL) { m_tail->m_next = m; m_tail = m; @@ -1594,7 +1705,7 @@ vtnet_rxq_replace_lro_nomrg_buf(struct vtnet_rxq *rxq, struct mbuf *m0, int len, clustersz, nreplace, error; sc = rxq->vtnrx_sc; - clustersz = sc->vtnet_rx_clustersz; + clustersz = sc->vtnet_rx_clustersz - VTNET_RX_BUFFER_HEADER_OFFSET; /* * Need to offset the mbuf if the header we're going to add will * misalign, account for that here. @@ -1709,9 +1820,12 @@ vtnet_rxq_replace_buf(struct vtnet_rxq *rxq, struct mbuf *m, int len) static int vtnet_rxq_enqueue_buf(struct vtnet_rxq *rxq, struct mbuf *m) { + struct vtnet_rx_buffer_header *hdr; struct vtnet_softc *sc; struct sglist *sg; int header_inlined, error; + bus_addr_t paddr; + struct mbuf *mp; sc = rxq->vtnrx_sc; sg = rxq->vtnrx_sg; @@ -1724,28 +1838,38 @@ vtnet_rxq_enqueue_buf(struct vtnet_rxq *rxq, struct mbuf *m) header_inlined = vtnet_modern(sc) || (sc->vtnet_flags & VTNET_FLAG_MRG_RXBUFS) != 0; /* TODO: ANY_LAYOUT */ + hdr = vtnet_mbuf_to_rx_buffer_header(sc, m); + paddr = hdr->addr; + /* * Note: The mbuf has been already adjusted when we allocate it if we * have to do strict alignment. */ - if (header_inlined) - error = sglist_append_mbuf(sg, m); - else { - struct vtnet_rx_header *rxhdr = - mtod(m, struct vtnet_rx_header *); + if (header_inlined) { + error = sglist_append_phys(sg, paddr, m->m_len); + } else { MPASS(sc->vtnet_hdr_size == sizeof(struct virtio_net_hdr)); /* Append the header and remaining mbuf data. */ - error = sglist_append(sg, &rxhdr->vrh_hdr, sc->vtnet_hdr_size); + error = sglist_append_phys(sg, paddr, sc->vtnet_hdr_size); if (error) return (error); - error = sglist_append(sg, &rxhdr[1], + error = sglist_append_phys(sg, + paddr + sizeof(struct vtnet_rx_header), m->m_len - sizeof(struct vtnet_rx_header)); if (error) return (error); - if (m->m_next != NULL) - error = sglist_append_mbuf(sg, m->m_next); + mp = m->m_next; + while (mp) { + hdr = vtnet_mbuf_to_rx_buffer_header(sc, mp); + paddr = hdr->addr; + error = sglist_append_phys(sg, paddr, mp->m_len); + if (error) + return (error); + + mp = mp->m_next; + } } if (error) @@ -1931,6 +2055,7 @@ vtnet_rxq_merged_eof(struct vtnet_rxq *rxq, struct mbuf *m_head, int nbufs) m_tail = m_head; while (--nbufs > 0) { + struct vtnet_rx_buffer_header *vthdr; struct mbuf *m; uint32_t len; @@ -1940,6 +2065,10 @@ vtnet_rxq_merged_eof(struct vtnet_rxq *rxq, struct mbuf *m_head, int nbufs) goto fail; } + vthdr = vtnet_mbuf_to_rx_buffer_header(sc, m); + bus_dmamap_sync(sc->vtnet_rx_dmat, vthdr->dmap, + BUS_DMASYNC_POSTREAD); + if (vtnet_rxq_new_buf(rxq) != 0) { rxq->vtnrx_stats.vrxs_iqdrops++; vtnet_rxq_discard_buf(rxq, m); @@ -1948,6 +2077,9 @@ vtnet_rxq_merged_eof(struct vtnet_rxq *rxq, struct mbuf *m_head, int nbufs) goto fail; } + bus_dmamap_unload(sc->vtnet_rx_dmat, vthdr->dmap); + bus_dmamap_destroy(sc->vtnet_rx_dmat, vthdr->dmap); + if (m->m_len < len) len = m->m_len; @@ -2060,6 +2192,7 @@ static int vtnet_rxq_eof(struct vtnet_rxq *rxq) { struct virtio_net_hdr lhdr, *hdr; + struct vtnet_rx_buffer_header *vthdr; struct vtnet_softc *sc; if_t ifp; struct virtqueue *vq; @@ -2075,14 +2208,31 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) CURVNET_SET(if_getvnet(ifp)); while (count-- > 0) { - struct mbuf *m; + struct mbuf *m, *mp; uint32_t len, nbufs, adjsz; + uint32_t synced; m = virtqueue_dequeue(vq, &len); if (m == NULL) break; deq++; + mp = m; + + /* + * Sync all mbufs in this packet. There will only be a single + * mbuf unless LRO is in use. + */ + synced = 0; + while (mp && synced < len) { + vthdr = vtnet_mbuf_to_rx_buffer_header(sc, mp); + bus_dmamap_sync(sc->vtnet_rx_dmat, vthdr->dmap, + BUS_DMASYNC_POSTREAD); + + synced += mp->m_len; + mp = mp->m_next; + } + if (len < sc->vtnet_hdr_size + ETHER_HDR_LEN) { rxq->vtnrx_stats.vrxs_ierrors++; vtnet_rxq_discard_buf(rxq, m); @@ -2116,6 +2266,18 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) continue; } + mp = m; + synced = 0; + while (mp && synced < len) { + vthdr = vtnet_mbuf_to_rx_buffer_header(sc, mp); + + bus_dmamap_unload(sc->vtnet_rx_dmat, vthdr->dmap); + bus_dmamap_destroy(sc->vtnet_rx_dmat, vthdr->dmap); + + synced += mp->m_len; + mp = mp->m_next; + } + m->m_pkthdr.len = len; m->m_pkthdr.rcvif = ifp; m->m_pkthdr.csum_flags = 0; @@ -2342,6 +2504,14 @@ vtnet_txq_free_mbufs(struct vtnet_txq *txq) while ((txhdr = virtqueue_drain(vq, &last)) != NULL) { if (kring == NULL) { + bus_dmamap_unload(txq->vtntx_sc->vtnet_tx_dmat, + txhdr->dmap); + bus_dmamap_destroy(txq->vtntx_sc->vtnet_tx_dmat, + txhdr->dmap); + bus_dmamap_unload(txq->vtntx_sc->vtnet_tx_dmat, + txhdr->hdr_dmap); + bus_dmamap_destroy(txq->vtntx_sc->vtnet_tx_dmat, + txhdr->hdr_dmap); m_freem(txhdr->vth_mbuf); uma_zfree(vtnet_tx_header_zone, txhdr); } @@ -2511,15 +2681,36 @@ drop: return (NULL); } +static void +vtnet_txq_enqueue_callback(void *arg, bus_dma_segment_t *segs, + int nsegs, int error) +{ + vm_paddr_t *hdr_paddr; + + if (error != 0) + return; + + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + hdr_paddr = (vm_paddr_t *)arg; + *hdr_paddr = segs[0].ds_addr; +} + static int vtnet_txq_enqueue_buf(struct vtnet_txq *txq, struct mbuf **m_head, struct vtnet_tx_header *txhdr) { + bus_dma_segment_t segs[VTNET_TX_SEGS_MAX]; + int nsegs; struct vtnet_softc *sc; struct virtqueue *vq; struct sglist *sg; struct mbuf *m; int error; + vm_paddr_t hdr_paddr; + bus_dmamap_t hdr_dmap; + bus_dmamap_t dmap; + int i; sc = txq->vtntx_sc; vq = txq->vtntx_vq; @@ -2527,15 +2718,55 @@ vtnet_txq_enqueue_buf(struct vtnet_txq *txq, struct mbuf **m_head, m = *m_head; sglist_reset(sg); - error = sglist_append(sg, &txhdr->vth_uhdr, sc->vtnet_hdr_size); + + error = bus_dmamap_create(sc->vtnet_tx_dmat, 0, &hdr_dmap); + if (error) + goto fail; + + error = bus_dmamap_load(sc->vtnet_tx_dmat, hdr_dmap, &txhdr->vth_uhdr, + sc->vtnet_hdr_size, vtnet_txq_enqueue_callback, &hdr_paddr, + BUS_DMA_NOWAIT); + if (error) + goto fail_hdr_dmamap_destroy; + + error = sglist_append_phys(sg, hdr_paddr, sc->vtnet_hdr_size); if (error != 0 || sg->sg_nseg != 1) { KASSERT(0, ("%s: cannot add header to sglist error %d nseg %d", __func__, error, sg->sg_nseg)); - goto fail; + goto fail_hdr_dmamap_unload; } - error = sglist_append_mbuf(sg, m); + bus_dmamap_sync(sc->vtnet_tx_dmat, hdr_dmap, BUS_DMASYNC_PREWRITE); + + error = bus_dmamap_create(sc->vtnet_tx_dmat, 0, &dmap); + if (error) + goto fail_hdr_dmamap_unload; + + nsegs = 0; + error = bus_dmamap_load_mbuf_sg(sc->vtnet_tx_dmat, dmap, m, segs, + &nsegs, BUS_DMA_NOWAIT); + if (error != 0) + goto fail_dmamap_destroy; + KASSERT(nsegs <= sc->vtnet_tx_nsegs, + ("%s: unexpected number of DMA segments for tx buffer: %d (max %d)", + __func__, nsegs, sc->vtnet_tx_nsegs)); + + bus_dmamap_sync(sc->vtnet_tx_dmat, dmap, BUS_DMASYNC_PREWRITE); + + for (i = 0; i < nsegs && !error; i++) + error = sglist_append_phys(sg, segs[i].ds_addr, segs[i].ds_len); + if (error) { + sglist_reset(sg); + bus_dmamap_unload(sc->vtnet_tx_dmat, dmap); + + error = sglist_append_phys(sg, hdr_paddr, sc->vtnet_hdr_size); + if (error != 0 || sg->sg_nseg != 1) { + KASSERT(0, ("%s: cannot add header to sglist error %d nseg %d", + __func__, error, sg->sg_nseg)); + goto fail_dmamap_destroy; + } + m = m_defrag(m, M_NOWAIT); if (m == NULL) { sc->vtnet_stats.tx_defrag_failed++; @@ -2545,16 +2776,41 @@ vtnet_txq_enqueue_buf(struct vtnet_txq *txq, struct mbuf **m_head, *m_head = m; sc->vtnet_stats.tx_defragged++; - error = sglist_append_mbuf(sg, m); + nsegs = 0; + error = bus_dmamap_load_mbuf_sg(sc->vtnet_tx_dmat, dmap, m, + segs, &nsegs, BUS_DMA_NOWAIT); + if (error != 0) + goto fail_dmamap_destroy; + KASSERT(nsegs <= sc->vtnet_tx_nsegs, + ("%s: unexpected number of DMA segments for tx buffer: %d (max %d)", + __func__, nsegs, sc->vtnet_tx_nsegs)); + + bus_dmamap_sync(sc->vtnet_tx_dmat, dmap, BUS_DMASYNC_PREWRITE); + + for (i = 0; i < nsegs && !error; i++) + error = sglist_append_phys(sg, segs[i].ds_addr, + segs[i].ds_len); + if (error) - goto fail; + goto fail_dmamap_unload; } txhdr->vth_mbuf = m; + txhdr->dmap = dmap; + txhdr->hdr_dmap = hdr_dmap; + error = virtqueue_enqueue(vq, txhdr, sg, sg->sg_nseg, 0); return (error); +fail_dmamap_unload: + bus_dmamap_unload(sc->vtnet_tx_dmat, dmap); +fail_dmamap_destroy: + bus_dmamap_destroy(sc->vtnet_tx_dmat, dmap); +fail_hdr_dmamap_unload: + bus_dmamap_unload(sc->vtnet_tx_dmat, hdr_dmap); +fail_hdr_dmamap_destroy: + bus_dmamap_destroy(sc->vtnet_tx_dmat, hdr_dmap); fail: m_freem(*m_head); *m_head = NULL; @@ -2834,6 +3090,7 @@ vtnet_txq_tq_intr(void *xtxq, int pending __unused) static int vtnet_txq_eof(struct vtnet_txq *txq) { + struct vtnet_softc *sc; struct virtqueue *vq; struct vtnet_tx_header *txhdr; struct mbuf *m; @@ -2843,6 +3100,8 @@ vtnet_txq_eof(struct vtnet_txq *txq) deq = 0; VTNET_TXQ_LOCK_ASSERT(txq); + sc = txq->vtntx_sc; + while ((txhdr = virtqueue_dequeue(vq, NULL)) != NULL) { m = txhdr->vth_mbuf; deq++; @@ -2852,6 +3111,11 @@ vtnet_txq_eof(struct vtnet_txq *txq) if (m->m_flags & M_MCAST) txq->vtntx_stats.vtxs_omcasts++; + bus_dmamap_unload(sc->vtnet_tx_dmat, txhdr->dmap); + bus_dmamap_destroy(sc->vtnet_tx_dmat, txhdr->dmap); + bus_dmamap_unload(sc->vtnet_tx_dmat, txhdr->hdr_dmap); + bus_dmamap_destroy(sc->vtnet_tx_dmat, txhdr->hdr_dmap); + m_freem(m); uma_zfree(vtnet_tx_header_zone, txhdr); } diff --git a/sys/dev/virtio/network/if_vtnetvar.h b/sys/dev/virtio/network/if_vtnetvar.h index eb5e6784b07f..6cafe827d733 100644 --- a/sys/dev/virtio/network/if_vtnetvar.h +++ b/sys/dev/virtio/network/if_vtnetvar.h @@ -190,6 +190,12 @@ struct vtnet_softc { struct mtx vtnet_mtx; char vtnet_mtx_name[16]; uint8_t vtnet_hwaddr[ETHER_ADDR_LEN]; + + bus_dma_tag_t vtnet_rx_dmat; + struct mtx vtnet_rx_mtx; + + bus_dma_tag_t vtnet_tx_dmat; + struct mtx vtnet_tx_mtx; }; /* vtnet flag descriptions for use with printf(9) %b identifier. */ #define VTNET_FLAGS_BITS \ @@ -273,6 +279,10 @@ struct vtnet_tx_header { } vth_uhdr; struct mbuf *vth_mbuf; + + bus_dmamap_t dmap; + + bus_dmamap_t hdr_dmap; }; /* From nobody Thu Jun 18 16:05:06 2026 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 4gh5Ck6Nw4z6hTP5 for ; Thu, 18 Jun 2026 16:05: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gh5Ck4590z3F7M for ; Thu, 18 Jun 2026 16:05:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781798706; 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; bh=G2heKIwCdlxNUV2uyJ8qaZItfpOIDugpDVtQbBJr7QI=; b=fDZnfvUykFm909ox74dF8Tv7DpSd5KWDrxmoVp7XFx+e6/WMshV/aYoJ9HS7X+Mvb2m5dE 8aBepyG1zP8rF4AsMYT6nYfm/FpzvROqtBj46Bxtk/Qb3xVmrkppRRTxV8lS1bFHjePNSN ziaSD/ahF6AuB2sQ9aXw1WSpkejnYRmRW1ol2PVkkZcUiaSgKwtnZPkiZ03QZqipus2Gur kW1PcFklOwtFDkzt+uDzra97yJ5L1Xy/n2wVK9UmYNOGKRH5vgMAkw0vzhttWp8t+xbxqX CW8PA3F4clFoCim6LiJsiE+PpxWQ8KG5d/H++NjqtuxMr/JDAQBBpWQ1F4QLcA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781798706; a=rsa-sha256; cv=none; b=EiV0CJFIIe4e+n3LBChNcJHn+uLb0wIIIk0WYGHuLn76T33I44FoGyPWyIDVdxSGlQHBfU aZ5910VgJNaTpmzGo7ZOJBC0iC4qTMJ0m8pGwqpFh1eESxY7qTZxYK3SFjHWY4ZK1J3Syh Kw17eCtY5Vpe88+lNNj3cW2NlwGOrO+1JmVfd2AtLJLSs8T0N4zY4wdQNxUGLyokZVNH62 Tt1TbqxgJXmWo8C8yFGXIfPA1xRr6SkxddZTZudHx8NlOa+en1y66Roprw5JW8AUY0e9CR yzeiu+yBUATH3Q3nNkbt54Dkh3jl13K376tAWkUsFFibbVIRL0VmXIxnd9NuJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781798706; 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; bh=G2heKIwCdlxNUV2uyJ8qaZItfpOIDugpDVtQbBJr7QI=; b=c4z0zoC+aQbClvv+Eop5GbYD/FKVPDjota5yYDoxatk1YPSwpqB6MA+SdYSfYzsUMXre/a hpbSbgm2uVAr0Wq6ECzsue07BEPssGe+iqd0dZKzNK/hCig5NB2+bKvLSolaDJ+6jkiu+L PDMgafbHYbusDLPrwOKdC1zgNJli/JI4pVQc3pa6B9PKH53DIFsqUV0Fc32JrwiwZFyz9m oWrlOlsDyNrVaRQGDxqtdzT1JtB9RrmmBg/SZqklkBrlBGLqKwLQJvoAYeQVMwNBmBamy+ Ql64YQo2+L1zk1khm1LNp3ll0WX3XQCIf9MJtd0X4TaG8bFWdbZFBT8dlFAlJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gh5Ck2pZkz14dK for ; Thu, 18 Jun 2026 16:05:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 46636 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Jun 2026 16:05:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Sarah Walker From: Andrew Turner Subject: git: ea130fa32099 - main - virtio_net: Use bus_dma for command/ack buffers 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea130fa32099ea7e0c03702efdec28e745ea6ef1 Auto-Submitted: auto-generated Date: Thu, 18 Jun 2026 16:05:06 +0000 Message-Id: <6a341732.46636.51d9973c@gitrepo.freebsd.org> The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=ea130fa32099ea7e0c03702efdec28e745ea6ef1 commit ea130fa32099ea7e0c03702efdec28e745ea6ef1 Author: Sarah Walker AuthorDate: 2026-02-27 14:17:15 +0000 Commit: Andrew Turner CommitDate: 2026-06-18 16:04:24 +0000 virtio_net: Use bus_dma for command/ack buffers While the majority of virtio platforms will be fully coherent, some may require cache maintenance or other specific device memory handling (eg for secure partitioning). Using bus_dma allows for these usecases. The virtio buffers are marked as coherent; this should ensure that sync calls are no-ops in the common cases. Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D55564 --- sys/dev/virtio/network/if_vtnet.c | 350 ++++++++++++++++++++++++++++------- sys/dev/virtio/network/if_vtnetvar.h | 6 + 2 files changed, 291 insertions(+), 65 deletions(-) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index 57cbdca0dbeb..ad642052d06d 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -219,7 +219,7 @@ static void vtnet_init_locked(struct vtnet_softc *, int); static void vtnet_init(void *); static void vtnet_free_ctrl_vq(struct vtnet_softc *); -static void vtnet_exec_ctrl_cmd(struct vtnet_softc *, void *, +static int vtnet_exec_ctrl_cmd(struct vtnet_softc *, uint8_t *, struct sglist *, int, int); static int vtnet_ctrl_mac_cmd(struct vtnet_softc *, uint8_t *); static int vtnet_ctrl_guest_offloads(struct vtnet_softc *, uint64_t); @@ -523,14 +523,60 @@ vtnet_attach(device_t dev) goto fail; } + mtx_init(&sc->vtnet_hdr_mtx, device_get_nameunit(dev), + "VirtIO Net header lock", MTX_DEF); + + error = bus_dma_tag_create( + bus_get_dma_tag(dev), /* parent */ + sizeof(uint16_t), /* alignment */ + 0, /* boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + PAGE_SIZE, /* max request size */ + 1, /* max # segments */ + PAGE_SIZE, /* maxsegsize */ + BUS_DMA_COHERENT, /* flags */ + busdma_lock_mutex, /* lockfunc */ + &sc->vtnet_hdr_mtx, /* lockarg */ + &sc->vtnet_hdr_dmat); + if (error) { + device_printf(dev, "cannot create bus_dma_tag\n"); + goto fail; + } + + mtx_init(&sc->vtnet_ack_mtx, device_get_nameunit(dev), + "VirtIO Net ACK lock", MTX_DEF); + + error = bus_dma_tag_create( + bus_get_dma_tag(dev), /* parent */ + sizeof(uint8_t), /* alignment */ + 0, /* boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + sizeof(uint8_t), /* max request size */ + 1, /* max # segments */ + sizeof(uint8_t), /* maxsegsize */ + BUS_DMA_COHERENT, /* flags */ + busdma_lock_mutex, /* lockfunc */ + &sc->vtnet_ack_mtx, /* lockarg */ + &sc->vtnet_ack_dmat); + if (error) { + device_printf(dev, "cannot create bus_dma_tag\n"); + goto fail; + } + #ifdef __powerpc__ - /* - * Virtio uses physical addresses rather than bus addresses, so we - * need to ask busdma to skip the iommu physical->bus mapping. At - * present, this is only a thing on the powerpc architectures. - */ - bus_dma_tag_set_iommu(sc->vtnet_rx_dmat, NULL, NULL); - bus_dma_tag_set_iommu(sc->vtnet_tx_dmat, NULL, NULL); + /* + * Virtio uses physical addresses rather than bus addresses, so we + * need to ask busdma to skip the iommu physical->bus mapping. At + * present, this is only a thing on the powerpc architectures. + */ + bus_dma_tag_set_iommu(sc->vtnet_rx_dmat, NULL, NULL); + bus_dma_tag_set_iommu(sc->vtnet_tx_dmat, NULL, NULL); + bus_dma_tag_set_iommu(sc->vtnet_hdr_dmat, NULL, NULL); + bus_dma_tag_set_iommu(sc->vtnet_ack_dmat, NULL, NULL); #endif error = vtnet_alloc_rx_filters(sc); @@ -3774,10 +3820,43 @@ vtnet_free_ctrl_vq(struct vtnet_softc *sc) } static void -vtnet_exec_ctrl_cmd(struct vtnet_softc *sc, void *cookie, - struct sglist *sg, int readable, int writable) +vtnet_load_callback(void *arg, bus_dma_segment_t *segs, int nsegs, + int error) { + bus_addr_t *paddr; + + if (error != 0) + return; + + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + paddr = (bus_addr_t *)arg; + *paddr = segs[0].ds_addr; +} + +static int +vtnet_exec_ctrl_cmd(struct vtnet_softc *sc, uint8_t *ack, struct sglist *sg, + int readable, int writable) +{ + bus_dmamap_t ack_dmap; + bus_addr_t ack_paddr; struct virtqueue *vq; + int error; + + error = bus_dmamap_create(sc->vtnet_ack_dmat, 0, &ack_dmap); + if (error) + goto error_out; + + error = bus_dmamap_load(sc->vtnet_ack_dmat, ack_dmap, ack, + sizeof(uint8_t), vtnet_load_callback, &ack_paddr, BUS_DMA_NOWAIT); + if (error) + goto error_destroy; + + bus_dmamap_sync(sc->vtnet_ack_dmat, ack_dmap, BUS_DMASYNC_PREWRITE); + + error = sglist_append_phys(sg, ack_paddr, sizeof(uint8_t)); + if (error) + goto error_unload; vq = sc->vtnet_ctrl_vq; @@ -3785,152 +3864,237 @@ vtnet_exec_ctrl_cmd(struct vtnet_softc *sc, void *cookie, VTNET_CORE_LOCK_ASSERT(sc); if (!virtqueue_empty(vq)) - return; + goto error_unload; /* * Poll for the response, but the command is likely completed before * returning from the notify. */ - if (virtqueue_enqueue(vq, cookie, sg, readable, writable) == 0) { + if (virtqueue_enqueue(vq, (void *)ack, sg, readable, writable) == 0) { virtqueue_notify(vq); virtqueue_poll(vq, NULL); } + + bus_dmamap_sync(sc->vtnet_ack_dmat, ack_dmap, BUS_DMASYNC_POSTREAD); + +error_unload: + bus_dmamap_unload(sc->vtnet_ack_dmat, ack_dmap); +error_destroy: + bus_dmamap_destroy(sc->vtnet_ack_dmat, ack_dmap); +error_out: + return (error); } static int vtnet_ctrl_mac_cmd(struct vtnet_softc *sc, uint8_t *hwaddr) { struct sglist_seg segs[3]; + bus_dmamap_t hdr_dmap; + bus_addr_t hdr_paddr; struct sglist sg; struct { struct virtio_net_ctrl_hdr hdr __aligned(2); uint8_t pad1; uint8_t addr[ETHER_ADDR_LEN] __aligned(8); uint8_t pad2; - uint8_t ack; } s; + uint8_t ack; int error; - error = 0; + error = bus_dmamap_create(sc->vtnet_hdr_dmat, 0, &hdr_dmap); + if (error) + goto error_out; + + error = bus_dmamap_load(sc->vtnet_hdr_dmat, hdr_dmap, &s, + sizeof(s), vtnet_load_callback, &hdr_paddr, BUS_DMA_NOWAIT); + if (error) + goto error_destroy_hdr; + MPASS(sc->vtnet_flags & VTNET_FLAG_CTRL_MAC); s.hdr.class = VIRTIO_NET_CTRL_MAC; s.hdr.cmd = VIRTIO_NET_CTRL_MAC_ADDR_SET; bcopy(hwaddr, &s.addr[0], ETHER_ADDR_LEN); - s.ack = VIRTIO_NET_ERR; + ack = VIRTIO_NET_ERR; + bus_dmamap_sync(sc->vtnet_hdr_dmat, hdr_dmap, BUS_DMASYNC_PREWRITE); sglist_init(&sg, nitems(segs), segs); - error |= sglist_append(&sg, &s.hdr, sizeof(struct virtio_net_ctrl_hdr)); - error |= sglist_append(&sg, &s.addr[0], ETHER_ADDR_LEN); - error |= sglist_append(&sg, &s.ack, sizeof(uint8_t)); - MPASS(error == 0 && sg.sg_nseg == nitems(segs)); + error |= sglist_append_phys(&sg, hdr_paddr, + sizeof(struct virtio_net_ctrl_hdr)); + error |= sglist_append_phys(&sg, + hdr_paddr + ((uintptr_t)&s.addr - (uintptr_t)&s), + ETHER_ADDR_LEN); + MPASS(error == 0 && sg.sg_nseg == nitems(segs) - 1); if (error == 0) - vtnet_exec_ctrl_cmd(sc, &s.ack, &sg, sg.sg_nseg - 1, 1); + error = vtnet_exec_ctrl_cmd(sc, &ack, &sg, sg.sg_nseg, 1); + if (error == 0) + error = (ack == VIRTIO_NET_OK ? 0 : EIO); - return (s.ack == VIRTIO_NET_OK ? 0 : EIO); + bus_dmamap_unload(sc->vtnet_hdr_dmat, hdr_dmap); +error_destroy_hdr: + bus_dmamap_destroy(sc->vtnet_hdr_dmat, hdr_dmap); +error_out: + return (error); } static int vtnet_ctrl_guest_offloads(struct vtnet_softc *sc, uint64_t offloads) { struct sglist_seg segs[3]; + bus_dmamap_t hdr_dmap; + bus_addr_t hdr_paddr; struct sglist sg; struct { struct virtio_net_ctrl_hdr hdr __aligned(2); uint8_t pad1; uint64_t offloads __aligned(8); uint8_t pad2; - uint8_t ack; } s; + uint8_t ack; int error; - error = 0; + error = bus_dmamap_create(sc->vtnet_hdr_dmat, 0, &hdr_dmap); + if (error) + goto error_out; + + error = bus_dmamap_load(sc->vtnet_hdr_dmat, hdr_dmap, &s, + sizeof(s), vtnet_load_callback, &hdr_paddr, BUS_DMA_NOWAIT); + if (error) + goto error_destroy_hdr; + MPASS(sc->vtnet_features & VIRTIO_NET_F_CTRL_GUEST_OFFLOADS); s.hdr.class = VIRTIO_NET_CTRL_GUEST_OFFLOADS; s.hdr.cmd = VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET; s.offloads = vtnet_gtoh64(sc, offloads); - s.ack = VIRTIO_NET_ERR; + ack = VIRTIO_NET_ERR; + bus_dmamap_sync(sc->vtnet_hdr_dmat, hdr_dmap, BUS_DMASYNC_PREWRITE); sglist_init(&sg, nitems(segs), segs); - error |= sglist_append(&sg, &s.hdr, sizeof(struct virtio_net_ctrl_hdr)); - error |= sglist_append(&sg, &s.offloads, sizeof(uint64_t)); - error |= sglist_append(&sg, &s.ack, sizeof(uint8_t)); - MPASS(error == 0 && sg.sg_nseg == nitems(segs)); + error |= sglist_append_phys(&sg, hdr_paddr, + sizeof(struct virtio_net_ctrl_hdr)); + error |= sglist_append_phys(&sg, + hdr_paddr + ((uintptr_t)&s.offloads - (uintptr_t)&s), + sizeof(uint64_t)); + MPASS(error == 0 && sg.sg_nseg == nitems(segs) - 1); if (error == 0) - vtnet_exec_ctrl_cmd(sc, &s.ack, &sg, sg.sg_nseg - 1, 1); + error = vtnet_exec_ctrl_cmd(sc, &ack, &sg, sg.sg_nseg, 1); + if (error == 0) + error = (ack == VIRTIO_NET_OK ? 0 : EIO); - return (s.ack == VIRTIO_NET_OK ? 0 : EIO); + bus_dmamap_unload(sc->vtnet_hdr_dmat, hdr_dmap); +error_destroy_hdr: + bus_dmamap_destroy(sc->vtnet_hdr_dmat, hdr_dmap); +error_out: + return (error); } static int vtnet_ctrl_mq_cmd(struct vtnet_softc *sc, uint16_t npairs) { struct sglist_seg segs[3]; + bus_dmamap_t hdr_dmap; + bus_addr_t hdr_paddr; struct sglist sg; struct { struct virtio_net_ctrl_hdr hdr __aligned(2); uint8_t pad1; struct virtio_net_ctrl_mq mq __aligned(2); uint8_t pad2; - uint8_t ack; } s; + uint8_t ack; int error; - error = 0; + error = bus_dmamap_create(sc->vtnet_hdr_dmat, 0, &hdr_dmap); + if (error) + goto error_out; + + error = bus_dmamap_load(sc->vtnet_hdr_dmat, hdr_dmap, &s, + sizeof(s), vtnet_load_callback, &hdr_paddr, BUS_DMA_NOWAIT); + if (error) + goto error_destroy_hdr; + MPASS(sc->vtnet_flags & VTNET_FLAG_MQ); s.hdr.class = VIRTIO_NET_CTRL_MQ; s.hdr.cmd = VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET; s.mq.virtqueue_pairs = vtnet_gtoh16(sc, npairs); - s.ack = VIRTIO_NET_ERR; + ack = VIRTIO_NET_ERR; + bus_dmamap_sync(sc->vtnet_hdr_dmat, hdr_dmap, BUS_DMASYNC_PREWRITE); sglist_init(&sg, nitems(segs), segs); - error |= sglist_append(&sg, &s.hdr, sizeof(struct virtio_net_ctrl_hdr)); - error |= sglist_append(&sg, &s.mq, sizeof(struct virtio_net_ctrl_mq)); - error |= sglist_append(&sg, &s.ack, sizeof(uint8_t)); - MPASS(error == 0 && sg.sg_nseg == nitems(segs)); + error |= sglist_append_phys(&sg, hdr_paddr, + sizeof(struct virtio_net_ctrl_hdr)); + error |= sglist_append_phys(&sg, + hdr_paddr + ((uintptr_t)&s.mq - (uintptr_t)&s), + sizeof(struct virtio_net_ctrl_mq)); + MPASS(error == 0 && sg.sg_nseg == nitems(segs) - 1); if (error == 0) - vtnet_exec_ctrl_cmd(sc, &s.ack, &sg, sg.sg_nseg - 1, 1); + error = vtnet_exec_ctrl_cmd(sc, &ack, &sg, sg.sg_nseg, 1); + if (error == 0) + error = (ack == VIRTIO_NET_OK ? 0 : EIO); - return (s.ack == VIRTIO_NET_OK ? 0 : EIO); + bus_dmamap_unload(sc->vtnet_hdr_dmat, hdr_dmap); +error_destroy_hdr: + bus_dmamap_destroy(sc->vtnet_hdr_dmat, hdr_dmap); +error_out: + return (error); } static int vtnet_ctrl_rx_cmd(struct vtnet_softc *sc, uint8_t cmd, bool on) { struct sglist_seg segs[3]; + bus_dmamap_t hdr_dmap; + bus_addr_t hdr_paddr; struct sglist sg; struct { struct virtio_net_ctrl_hdr hdr __aligned(2); uint8_t pad1; uint8_t onoff; uint8_t pad2; - uint8_t ack; } s; + uint8_t ack; int error; - error = 0; + error = bus_dmamap_create(sc->vtnet_hdr_dmat, 0, &hdr_dmap); + if (error) + goto error_out; + + error = bus_dmamap_load(sc->vtnet_hdr_dmat, hdr_dmap, &s, + sizeof(s), vtnet_load_callback, &hdr_paddr, BUS_DMA_NOWAIT); + if (error) + goto error_destroy_hdr; + MPASS(sc->vtnet_flags & VTNET_FLAG_CTRL_RX); s.hdr.class = VIRTIO_NET_CTRL_RX; s.hdr.cmd = cmd; s.onoff = on; - s.ack = VIRTIO_NET_ERR; + ack = VIRTIO_NET_ERR; + bus_dmamap_sync(sc->vtnet_hdr_dmat, hdr_dmap, BUS_DMASYNC_PREWRITE); sglist_init(&sg, nitems(segs), segs); - error |= sglist_append(&sg, &s.hdr, sizeof(struct virtio_net_ctrl_hdr)); - error |= sglist_append(&sg, &s.onoff, sizeof(uint8_t)); - error |= sglist_append(&sg, &s.ack, sizeof(uint8_t)); - MPASS(error == 0 && sg.sg_nseg == nitems(segs)); + error |= sglist_append_phys(&sg, hdr_paddr, + sizeof(struct virtio_net_ctrl_hdr)); + error |= sglist_append_phys(&sg, + hdr_paddr + ((uintptr_t)&s.onoff - (uintptr_t)&s), + sizeof(uint8_t)); + MPASS(error == 0 && sg.sg_nseg == nitems(segs) - 1); if (error == 0) - vtnet_exec_ctrl_cmd(sc, &s.ack, &sg, sg.sg_nseg - 1, 1); + error = vtnet_exec_ctrl_cmd(sc, &ack, &sg, sg.sg_nseg, 1); + if (error == 0) + error = (ack == VIRTIO_NET_OK ? 0 : EIO); - return (s.ack == VIRTIO_NET_OK ? 0 : EIO); + bus_dmamap_unload(sc->vtnet_hdr_dmat, hdr_dmap); +error_destroy_hdr: + bus_dmamap_destroy(sc->vtnet_hdr_dmat, hdr_dmap); +error_out: + return (error); } static int @@ -4001,6 +4165,10 @@ vtnet_rx_filter_mac(struct vtnet_softc *sc) struct virtio_net_ctrl_hdr hdr __aligned(2); struct vtnet_mac_filter *filter; struct sglist_seg segs[4]; + bus_dmamap_t filter_dmap; + bus_addr_t filter_paddr; + bus_dmamap_t hdr_dmap; + bus_addr_t hdr_paddr; struct sglist sg; if_t ifp; bool promisc, allmulti; @@ -4040,6 +4208,25 @@ vtnet_rx_filter_mac(struct vtnet_softc *sc) if (promisc && allmulti) goto out; + error = bus_dmamap_create(sc->vtnet_hdr_dmat, 0, &hdr_dmap); + if (error) + goto out_error; + + error = bus_dmamap_load(sc->vtnet_hdr_dmat, hdr_dmap, &hdr, + sizeof(hdr), vtnet_load_callback, &hdr_paddr, BUS_DMA_NOWAIT); + if (error) + goto out_destroy_hdr; + + error = bus_dmamap_create(sc->vtnet_hdr_dmat, 0, &filter_dmap); + if (error) + goto out_unload_hdr; + + error = bus_dmamap_load(sc->vtnet_hdr_dmat, hdr_dmap, filter, + sizeof(*filter), vtnet_load_callback, &filter_paddr, + BUS_DMA_NOWAIT); + if (error) + goto out_destroy_filter; + filter->vmf_unicast.nentries = vtnet_gtoh32(sc, ucnt); filter->vmf_multicast.nentries = vtnet_gtoh32(sc, mcnt); @@ -4048,19 +4235,33 @@ vtnet_rx_filter_mac(struct vtnet_softc *sc) ack = VIRTIO_NET_ERR; sglist_init(&sg, nitems(segs), segs); - error |= sglist_append(&sg, &hdr, sizeof(struct virtio_net_ctrl_hdr)); - error |= sglist_append(&sg, &filter->vmf_unicast, + error |= sglist_append_phys(&sg, hdr_paddr, + sizeof(struct virtio_net_ctrl_hdr)); + error |= sglist_append_phys(&sg, + filter_paddr + ((uintptr_t)&filter->vmf_unicast - + (uintptr_t)filter), sizeof(uint32_t) + ucnt * ETHER_ADDR_LEN); - error |= sglist_append(&sg, &filter->vmf_multicast, + error |= sglist_append_phys(&sg, + filter_paddr + ((uintptr_t)&filter->vmf_multicast - + (uintptr_t)filter), sizeof(uint32_t) + mcnt * ETHER_ADDR_LEN); - error |= sglist_append(&sg, &ack, sizeof(uint8_t)); - MPASS(error == 0 && sg.sg_nseg == nitems(segs)); + MPASS(error == 0 && sg.sg_nseg == nitems(segs) - 1); if (error == 0) - vtnet_exec_ctrl_cmd(sc, &ack, &sg, sg.sg_nseg - 1, 1); - if (ack != VIRTIO_NET_OK) + error = vtnet_exec_ctrl_cmd(sc, &ack, &sg, sg.sg_nseg, 1); + if (error == 0) + error = (ack == VIRTIO_NET_OK ? 0 : EIO); + + bus_dmamap_unload(sc->vtnet_hdr_dmat, filter_dmap); +out_destroy_filter: + bus_dmamap_destroy(sc->vtnet_hdr_dmat, filter_dmap); +out_unload_hdr: + bus_dmamap_unload(sc->vtnet_hdr_dmat, hdr_dmap); +out_destroy_hdr: + bus_dmamap_destroy(sc->vtnet_hdr_dmat, hdr_dmap); +out_error: + if (error != 0) if_printf(ifp, "error setting host MAC filter table\n"); - out: if (promisc && vtnet_set_promisc(sc, true) != 0) if_printf(ifp, "cannot enable promiscuous mode\n"); @@ -4072,34 +4273,53 @@ static int vtnet_exec_vlan_filter(struct vtnet_softc *sc, int add, uint16_t tag) { struct sglist_seg segs[3]; + bus_dmamap_t hdr_dmap; + bus_addr_t hdr_paddr; struct sglist sg; struct { struct virtio_net_ctrl_hdr hdr __aligned(2); uint8_t pad1; uint16_t tag __aligned(2); uint8_t pad2; - uint8_t ack; } s; + uint8_t ack; int error; - error = 0; + error = bus_dmamap_create(sc->vtnet_hdr_dmat, 0, &hdr_dmap); + if (error) + goto error_out; + + error = bus_dmamap_load(sc->vtnet_hdr_dmat, hdr_dmap, &s, + sizeof(s), vtnet_load_callback, &hdr_paddr, BUS_DMA_NOWAIT); + if (error) + goto error_destroy_hdr; + MPASS(sc->vtnet_flags & VTNET_FLAG_VLAN_FILTER); s.hdr.class = VIRTIO_NET_CTRL_VLAN; s.hdr.cmd = add ? VIRTIO_NET_CTRL_VLAN_ADD : VIRTIO_NET_CTRL_VLAN_DEL; s.tag = vtnet_gtoh16(sc, tag); - s.ack = VIRTIO_NET_ERR; + ack = VIRTIO_NET_ERR; + bus_dmamap_sync(sc->vtnet_hdr_dmat, hdr_dmap, BUS_DMASYNC_PREWRITE); sglist_init(&sg, nitems(segs), segs); - error |= sglist_append(&sg, &s.hdr, sizeof(struct virtio_net_ctrl_hdr)); - error |= sglist_append(&sg, &s.tag, sizeof(uint16_t)); - error |= sglist_append(&sg, &s.ack, sizeof(uint8_t)); - MPASS(error == 0 && sg.sg_nseg == nitems(segs)); + error |= sglist_append_phys(&sg, hdr_paddr, + sizeof(struct virtio_net_ctrl_hdr)); + error |= sglist_append_phys(&sg, + hdr_paddr + ((uintptr_t)&s.tag - (uintptr_t)&s), + sizeof(uint16_t)); + MPASS(error == 0 && sg.sg_nseg == nitems(segs) - 1); if (error == 0) - vtnet_exec_ctrl_cmd(sc, &s.ack, &sg, sg.sg_nseg - 1, 1); + error = vtnet_exec_ctrl_cmd(sc, &ack, &sg, sg.sg_nseg, 1); + if (error == 0) + error = (ack == VIRTIO_NET_OK ? 0 : EIO); - return (s.ack == VIRTIO_NET_OK ? 0 : EIO); + bus_dmamap_unload(sc->vtnet_hdr_dmat, hdr_dmap); +error_destroy_hdr: + bus_dmamap_destroy(sc->vtnet_hdr_dmat, hdr_dmap); +error_out: + return (error); } static void diff --git a/sys/dev/virtio/network/if_vtnetvar.h b/sys/dev/virtio/network/if_vtnetvar.h index 6cafe827d733..e445bdf6d6cb 100644 --- a/sys/dev/virtio/network/if_vtnetvar.h +++ b/sys/dev/virtio/network/if_vtnetvar.h @@ -196,6 +196,12 @@ struct vtnet_softc { bus_dma_tag_t vtnet_tx_dmat; struct mtx vtnet_tx_mtx; + + bus_dma_tag_t vtnet_hdr_dmat; + struct mtx vtnet_hdr_mtx; + + bus_dma_tag_t vtnet_ack_dmat; + struct mtx vtnet_ack_mtx; }; /* vtnet flag descriptions for use with printf(9) %b identifier. */ #define VTNET_FLAGS_BITS \ From nobody Thu Jun 18 16:05:04 2026 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 4gh5Cn44LSz6hTQq for ; Thu, 18 Jun 2026 16:05: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gh5Cn2Yk7z3Dxb for ; Thu, 18 Jun 2026 16:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781798709; 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; bh=JxqGLgGS/EUEi4IeLJmpDkKd9LNQ+fRlKgb8BME6l8A=; b=O6VuvXboYuq624LQH06aI5wvOwZvncf/Xx8MSubsL9uWFQrUdzar+U3rAGYPx9iFnwcDW2 hbad/w7d8ZDDPWUyNJon5oL4qQbc+fvlM0WY/ycJm8jl7TnIPdKQ+u4ZTUJXqXPHX0f1gP c5lRxpe3kAGY33Qs2dC1jVSGx/mzWeKdHOE0zzSUC4+LE5rJGa1DS73bhUfDYcVAVfmT9G 8DjEiCA+nilY+XDW/bTJ6S15BIBrXY4g+j9Y6I4DBXe6MYfKNZerAWfalQhcxTkBdIyk+h i26LryvLae3cVpE90HdEoKCFb5vUF2uq/CtjsCtqm9mm2qxZ3RsaM1Hl938h1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781798709; a=rsa-sha256; cv=none; b=L66A0PeTL4dEIxHWX7/mW5e1GvFV/DI6gq30iMHv5YYkiJ1v5heFEfPBu+tvbAfzIlvmIr kj1kbn53LucJyqV/ZIJwL3to2QDgr1BdY14sdWCPBIAMolIUWUuGaMmXazOhOdpVPoshu0 u+gk3rAizj04booxxaqGiBHJjQuufNb7605tZqtF5g1WkbO6yMxit3XHjfAA8QGhgUy2+5 d/oHJFVdtjnl6FKPQ7nmgYkyjUc09njNP+wywnzN3XT17hip+QZZGgiV5tZhvY+IQWEiF/ fE8dzH9tRKU/a+AymmnRBnj3t68AlW5Z+IV8+mXRmmhofBDlNBYj4HMeUTBv4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781798709; 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; bh=JxqGLgGS/EUEi4IeLJmpDkKd9LNQ+fRlKgb8BME6l8A=; b=qmaIeUZZhSlC1DmrmW9wP3OSPTsUcFiWQLN3rU9u38cdfdM49OZwUS9C4Xp2AEYPb4vJKM Scz408FRD6GPHvyNR7QzeTaJeP/7xs0S3jBgWZF0K8TptipEPSyrkqfSzso5B4xJdwxFcZ IhXCiqc3qbyIB2dDitg9lA7XCfTEOEgxrW6Pq5AIEdAQ17H9d9mkqyHpz28qgl+UZsG7R1 QyIppbFR/1j8UYz3R2pMYNGoxJaSRGp02WUMhXG0Ltvajg/WFA0SpAUBYtpVGEkfowb7h6 NmmtsnwsKYxTO9ias6D7Ld0jURUyz/CsYlcn7V5W+XxZpo6iffF01XQY4d9weA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gh5Cn1L2Hz14Ky for ; Thu, 18 Jun 2026 16:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 44f42 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Jun 2026 16:05:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Sarah Walker From: Andrew Turner Subject: git: 8fdaa1b16367 - main - busdma_bounce: Allocate bounce buffers as unprotected 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8fdaa1b16367d809bca8d4d3ac5e08443353eac1 Auto-Submitted: auto-generated Date: Thu, 18 Jun 2026 16:05:04 +0000 Message-Id: <6a341730.44f42.5172a3d9@gitrepo.freebsd.org> The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=8fdaa1b16367d809bca8d4d3ac5e08443353eac1 commit 8fdaa1b16367d809bca8d4d3ac5e08443353eac1 Author: Sarah Walker AuthorDate: 2026-06-18 15:34:14 +0000 Commit: Andrew Turner CommitDate: 2026-06-18 16:04:23 +0000 busdma_bounce: Allocate bounce buffers as unprotected Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D56519 --- sys/kern/subr_busdma_bounce.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/subr_busdma_bounce.c b/sys/kern/subr_busdma_bounce.c index 2774128a1ae5..bf9524c6eee5 100644 --- a/sys/kern/subr_busdma_bounce.c +++ b/sys/kern/subr_busdma_bounce.c @@ -283,11 +283,11 @@ alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages) break; #ifdef dmat_domain bpage->vaddr = contigmalloc_domainset(PAGE_SIZE, - M_BOUNCE, DOMAINSET_PREF(bz->domain), M_NOWAIT, - 0ul, bz->lowaddr, PAGE_SIZE, 0); + M_BOUNCE, DOMAINSET_PREF(bz->domain), + M_NOWAIT | M_UNPROTECTED, 0ul, bz->lowaddr, PAGE_SIZE, 0); #else bpage->vaddr = contigmalloc(PAGE_SIZE, M_BOUNCE, - M_NOWAIT, 0ul, bz->lowaddr, PAGE_SIZE, 0); + M_NOWAIT | M_UNPROTECTED, 0ul, bz->lowaddr, PAGE_SIZE, 0); #endif if (bpage->vaddr == NULL) { free(bpage, M_BUSDMA); From nobody Thu Jun 18 16:19:38 2026 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 4gh5Xm6gC7z6hVCK for ; Thu, 18 Jun 2026 16:19:52 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-yw1-f182.google.com (mail-yw1-f182.google.com [209.85.128.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gh5Xm2YD1z3HcJ for ; Thu, 18 Jun 2026 16:19:52 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-yw1-f182.google.com with SMTP id 00721157ae682-7fedf0e99bbso14901647b3.3 for ; Thu, 18 Jun 2026 09:19:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781799591; x=1782404391; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=abtewuMhzxSnamoHv/a3iA+L//2yHHsFTlCh07ET7CI=; b=MZKqIV0hLHL2OzosSS92La9kSN8+C97t6TWY1JELvS8ZPGZRGKfiVB0MsFB+xvy6A/ AzrizC20YxrOyZuCotVLr+dqad6R6iRPn12w2q95O9GGwvZSDR6UE3o3/TiJhKfocEp9 m3D5+Im7VcwlTAUiEBO2aneybzlkhbjld5d65SAwfCGMGLXhnhmH947krLdyL4h6ia+g o2YE6lBAUV6t/owNgV6b2ur/u8awEOxmR6kcuNZwrzr/WOOzs2vdrPLya5unqHv/xLdz Hj0ecpbWiO/q5e1+tHaL8uiUSOK9O4bUzSfF92SoMxAEd/l/CpEk1UzZ/EmgeuSKgPd6 F+DQ== X-Forwarded-Encrypted: i=1; AFNElJ9wdE45MYOg2VxI1qjRw+pNLZwHtmPu9lMf2sDvL4CPlx4O9SlrneUBbLXQBPgilaSgFddUE8/O8d6eIEuwcd6eW5nx2w==@freebsd.org X-Gm-Message-State: AOJu0YyrASbZTzRxcfbetesPM2oczg8O24NtW0i08FIHm02pfKxnft14 Nns8E4CNjUNnO2XVcBfR4Kzyp4/Lcb3BAyz5bcspD/nn+qEnIoLHXHbq7RXQAXo7z04= X-Gm-Gg: AfdE7clDoWMKhcdc5ZX5GWMi5yycNL6Hj9ca011KElACo/NsFHD85LKQpbaFg9T9lv6 NUiyIZqHTqPpiI/wMTc+z4Ej07tq9KUH93cJ0JYXMbTPlq9kTxBEtezAtBUe3ws4k68iJ/OkEeT kPrJAYqHqgFjMoxgcJVGCsB2C+jF5Y4aMwJv0aRoYsVouQzzMKF76dglHpTSsBUg5RdVMYPyend gl0/1AFQci+PzrK874hUdmlTrJ1S7YoBLfsG1+Eh6mavHQgafM2bgbIm5didTZVeGp6oleklcqo F8pRx9lK3xSlf2/+eC1uUyzA6nJyW3XyPOFRI+zynaU6ElxhARKAMFHj/6EK2cNPmX/UOiY7PBk FbBypn/Ifsy5eCjxtfjGrivc78YSY5zTriyzIQ+2PDvs3FirfKoCLcORcGwDnXpVGMEI5/ljN80 DiFHDk2LWywH2RdOlRFTdCSfkbHIozMvg= X-Received: by 2002:a05:690c:18:b0:7c5:4c4e:a8a5 with SMTP id 00721157ae682-7fe5e0a55e9mr91789617b3.46.1781799590554; Thu, 18 Jun 2026 09:19:50 -0700 (PDT) Received: from smtpclient.apple ([50.202.154.70]) by smtp.gmail.com with ESMTPSA id 00721157ae682-7fcd00dbc0bsm72254297b3.8.2026.06.18.09.19.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2026 09:19:48 -0700 (PDT) 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3891.100.17.1.3\)) Subject: Re: git: ea130fa32099 - main - virtio_net: Use bus_dma for command/ack buffers From: Jessica Clarke In-Reply-To: <6a341732.46636.51d9973c@gitrepo.freebsd.org> Date: Thu, 18 Jun 2026 09:19:38 -0700 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , Sarah Walker Content-Transfer-Encoding: quoted-printable Message-Id: <5139DC0F-71BB-4B4E-8036-9B3685C38BA9@freebsd.org> References: <6a341732.46636.51d9973c@gitrepo.freebsd.org> To: Andrew Turner X-Mailer: Apple Mail (2.3891.100.17.1.3) 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: 4gh5Xm2YD1z3HcJ X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On 18 Jun 2026, at 09:05, Andrew Turner wrote: >=20 > The branch main has been updated by andrew: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dea130fa32099ea7e0c03702efdec28e7= 45ea6ef1 >=20 > commit ea130fa32099ea7e0c03702efdec28e745ea6ef1 > Author: Sarah Walker > AuthorDate: 2026-02-27 14:17:15 +0000 > Commit: Andrew Turner > CommitDate: 2026-06-18 16:04:24 +0000 >=20 > virtio_net: Use bus_dma for command/ack buffers >=20 > While the majority of virtio platforms will be fully coherent, some = may > require cache maintenance or other specific device memory handling = (eg for > secure partitioning). Using bus_dma allows for these usecases. >=20 > The virtio buffers are marked as coherent; this should ensure that = sync > calls are no-ops in the common cases. >=20 > Reviewed by: andrew > Sponsored by: Arm Ltd > Differential Revision: https://reviews.freebsd.org/D55564 > =E2=80=94-- > [...] > @@ -523,14 +523,60 @@ vtnet_attach(device_t dev) > goto fail; > } >=20 > + mtx_init(&sc->vtnet_hdr_mtx, device_get_nameunit(dev), > + "VirtIO Net header lock", MTX_DEF); > + > + error =3D bus_dma_tag_create( > + bus_get_dma_tag(dev), /* parent */ > + sizeof(uint16_t), /* alignment */ > + 0, /* boundary */ > + BUS_SPACE_MAXADDR, /* lowaddr */ > + BUS_SPACE_MAXADDR, /* highaddr */ > + NULL, NULL, /* filter, filterarg */ > + PAGE_SIZE, /* max request size */ > + 1, /* max # segments */ > + PAGE_SIZE, /* maxsegsize */ > + BUS_DMA_COHERENT, /* flags */ > + busdma_lock_mutex, /* lockfunc */ > + &sc->vtnet_hdr_mtx, /* lockarg */ > + &sc->vtnet_hdr_dmat); > + if (error) { > + device_printf(dev, "cannot create bus_dma_tag\n"); > + goto fail; > + } > + > + mtx_init(&sc->vtnet_ack_mtx, device_get_nameunit(dev), > + "VirtIO Net ACK lock", MTX_DEF); > + > + error =3D bus_dma_tag_create( > + bus_get_dma_tag(dev), /* parent */ > + sizeof(uint8_t), /* alignment */ > + 0, /* boundary */ > + BUS_SPACE_MAXADDR, /* lowaddr */ > + BUS_SPACE_MAXADDR, /* highaddr */ > + NULL, NULL, /* filter, filterarg */ > + sizeof(uint8_t), /* max request size */ > + 1, /* max # segments */ > + sizeof(uint8_t), /* maxsegsize */ > + BUS_DMA_COHERENT, /* flags */ > + busdma_lock_mutex, /* lockfunc */ > + &sc->vtnet_ack_mtx, /* lockarg */ > + &sc->vtnet_ack_dmat); > + if (error) { > + device_printf(dev, "cannot create bus_dma_tag\n"); > + goto fail; > + } > + > #ifdef __powerpc__ > - /* > - * Virtio uses physical addresses rather than bus addresses, so we > - * need to ask busdma to skip the iommu physical->bus mapping. At > - * present, this is only a thing on the powerpc architectures. > - */ > - bus_dma_tag_set_iommu(sc->vtnet_rx_dmat, NULL, NULL); > - bus_dma_tag_set_iommu(sc->vtnet_tx_dmat, NULL, NULL); > + /* > + * Virtio uses physical addresses rather than bus addresses, = so we > + * need to ask busdma to skip the iommu physical->bus = mapping. At > + * present, this is only a thing on the powerpc = architectures. > + */ > + bus_dma_tag_set_iommu(sc->vtnet_rx_dmat, NULL, NULL); > + bus_dma_tag_set_iommu(sc->vtnet_tx_dmat, NULL, NULL); > + bus_dma_tag_set_iommu(sc->vtnet_hdr_dmat, NULL, NULL); > + bus_dma_tag_set_iommu(sc->vtnet_ack_dmat, NULL, NULL); > #endif This block has been re-indented to use spaces not tabs. Jessica From nobody Thu Jun 18 20:14:25 2026 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 4ghBlW1gvMz6gdZF for ; Thu, 18 Jun 2026 20:14: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghBlV6frfz3tcX for ; Thu, 18 Jun 2026 20:14:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781813670; 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=MOIHW1Xyy87thK3TKRfA52+SZVttc1QITmjsZU8TEUw=; b=Q0Q0czwDHtfAxDfFettQw6rGHooHN1VrAmSrwQGVNOX/2VzJ7X9Ag5Y8BN7j5a99wDRdEw avqCVcymW/qLktzvAT9VDaV4dFt/SFIGq2dwlRODHVYdLgLzq7ZZIn7u8ovtXtAQszdHgj g42dR6NbFmWTZ5gB1h/S8GzUoKIfeQrt5l8qzTj5FEUwJx5vn3JJvWKGWE9lQv4jymlcsG 06nsPUpjLbBuD1/LygvqiC+G9AStwAnucf/759XmtD8J6danpWapXEFVUPtCt4/6Djv4yb WIt+mctYfiHSrfxluCb9p+UG3LsR3GAa7htTf5LTI/lh6qqC85/d5tsi1hnliA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781813670; a=rsa-sha256; cv=none; b=bGeWp7FSa0OmdB1y1pcZMAsXAGRh0cuXNTQKDRhUn/o1/9YuG1x51n3fAs/Y+hbxNlUCei UlPQA+ejaTTVxa/UUN2aymowtnHeQVOvprrXyX7L5YHR0O8u388zihaKXx5hcQurbhA+yF XLQbZpFCk1HuTZ+t9m7iwerVIKC7h9lmTOvDbq8RD/McGg3RZYv6oiB16tDIKCShTYfLz6 /Js+I06xd2wRmIKqnJ94VDWIRjCQifVY3ovXm/CkE+3cETfbY77DVitKMNoGE0bYF107z0 25OCFAKYAJHwXr/myaFRD9mNZ/B6tkuxp907/DEPM5c4oalvWC6wF6Fnrrsmhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781813670; 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=MOIHW1Xyy87thK3TKRfA52+SZVttc1QITmjsZU8TEUw=; b=MSc8FgrJUON9t2K3x7eedLLv+5R/9tUTX2R9t1FQe0mjB+KZmLFv7SePw/HVjMPPWozcoV zK5NoDQijRAH3DCtyqugG/2bRhoUEgUm490aC3XJebli2OevJVmWXJIJEyVZop+d5EAU5f /NYPJfbFd6tCBhWQLk7zXezJ8oDKgSqJhLq7CtEUcO2itC4bypH5RGtJYbrI2tFuTYELiF VvCXPV7Rori4TGTT8gHuwv7tsGneKiqhsouXicQUqVZf7oYs8c4zQFs77SH612YVBTAGUm MoFqHc+RgwTpwPQhVLO3UU5zXIrxekzrqQO048Z8Y/kKXy/Mmeb5E9J9dhIywg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghBlP5fYsz1CXZ for ; Thu, 18 Jun 2026 20:14:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 39586 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Jun 2026 20:14:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing Subject: git: 943bfad1097f - main - autofs: remove dead code 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 943bfad1097f3459f70ece6ecfd86e5d6d615a6e Auto-Submitted: auto-generated Date: Thu, 18 Jun 2026 20:14:25 +0000 Message-Id: <6a3451a1.39586.4fc74e93@gitrepo.freebsd.org> The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=943bfad1097f3459f70ece6ecfd86e5d6d615a6e commit 943bfad1097f3459f70ece6ecfd86e5d6d615a6e Author: Robert Wing AuthorDate: 2026-06-18 20:12:46 +0000 Commit: Robert Wing CommitDate: 2026-06-18 20:12:46 +0000 autofs: remove dead code log_set_peer_name() and log_set_peer_addr() were never used Differential Revision: https://reviews.freebsd.org/D57164 --- usr.sbin/autofs/common.h | 2 -- usr.sbin/autofs/log.c | 66 ++++-------------------------------------------- 2 files changed, 5 insertions(+), 63 deletions(-) diff --git a/usr.sbin/autofs/common.h b/usr.sbin/autofs/common.h index 5bd2abf5ef78..03ca4f8f577b 100644 --- a/usr.sbin/autofs/common.h +++ b/usr.sbin/autofs/common.h @@ -58,8 +58,6 @@ struct defined_value { }; void log_init(int level); -void log_set_peer_name(const char *name); -void log_set_peer_addr(const char *addr); void log_err(int, const char *, ...) __dead2 __printf0like(2, 3); void log_errx(int, const char *, ...) diff --git a/usr.sbin/autofs/log.c b/usr.sbin/autofs/log.c index 02a889bffbed..dcb9ae9a1fc2 100644 --- a/usr.sbin/autofs/log.c +++ b/usr.sbin/autofs/log.c @@ -41,8 +41,6 @@ #include "common.h" static int log_level = 0; -static char *peer_name = NULL; -static char *peer_addr = NULL; #define MSGBUF_LEN 1024 @@ -54,34 +52,6 @@ log_init(int level) openlog(getprogname(), LOG_NDELAY | LOG_PID, LOG_DAEMON); } -void -log_set_peer_name(const char *name) -{ - - /* - * XXX: Turn it into assertion? - */ - if (peer_name != NULL) - log_errx(1, "%s called twice", __func__); - if (peer_addr == NULL) - log_errx(1, "%s called before log_set_peer_addr", __func__); - - peer_name = checked_strdup(name); -} - -void -log_set_peer_addr(const char *addr) -{ - - /* - * XXX: Turn it into assertion? - */ - if (peer_addr != NULL) - log_errx(1, "%s called twice", __func__); - - peer_addr = checked_strdup(addr); -} - static void log_common(int priority, int log_errno, const char *fmt, va_list ap) { @@ -105,40 +75,14 @@ log_common(int priority, int log_errno, const char *fmt, va_list ap) } if (log_errno == -1) { - if (peer_name != NULL) { - fprintf(stderr, "%s: %s (%s): %s\n", getprogname(), - peer_addr, peer_name, msgbuf_strvised); - syslog(priority, "%s (%s): %s", - peer_addr, peer_name, msgbuf_strvised); - } else if (peer_addr != NULL) { - fprintf(stderr, "%s: %s: %s\n", getprogname(), - peer_addr, msgbuf_strvised); - syslog(priority, "%s: %s", - peer_addr, msgbuf_strvised); - } else { - fprintf(stderr, "%s: %s\n", getprogname(), msgbuf_strvised); - syslog(priority, "%s", msgbuf_strvised); - } - + fprintf(stderr, "%s: %s\n", getprogname(), msgbuf_strvised); + syslog(priority, "%s", msgbuf_strvised); } else { errstr = strerror(log_errno); - if (peer_name != NULL) { - fprintf(stderr, "%s: %s (%s): %s: %s\n", getprogname(), - peer_addr, peer_name, msgbuf_strvised, errstr); - syslog(priority, "%s (%s): %s: %s", - peer_addr, peer_name, msgbuf_strvised, errstr); - } else if (peer_addr != NULL) { - fprintf(stderr, "%s: %s: %s: %s\n", getprogname(), - peer_addr, msgbuf_strvised, errstr); - syslog(priority, "%s: %s: %s", - peer_addr, msgbuf_strvised, errstr); - } else { - fprintf(stderr, "%s: %s: %s\n", getprogname(), - msgbuf_strvised, errstr); - syslog(priority, "%s: %s", - msgbuf_strvised, errstr); - } + fprintf(stderr, "%s: %s: %s\n", + getprogname(), msgbuf_strvised, errstr); + syslog(priority, "%s: %s", msgbuf_strvised, errstr); } } From nobody Thu Jun 18 20:43:27 2026 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 4ghCNw1YY4z6gh8V for ; Thu, 18 Jun 2026 20:43:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghCNw0ktyz41HM for ; Thu, 18 Jun 2026 20:43:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781815408; 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=O/RlcrbKOAoUJV+4W3c9hOvru97nHgBqH2GVJA5bBIw=; b=T+gzi9j/yr+Lla7vUFglRSIKggFp1r27xpcoU8RM+oPmS0IaEL0owpt0GFzcATx9OaAAi+ lhT7uGzG+kuU5nIP5/OBJzcL8OkM3UKFfo3B+X2BZ8FKKHv57tedgxlPYuOmB6tZ9m9NLS tn4D6qLu0IOXexyd/JkTeab0BeyVd2MJRxJPpbQRYuEKmRCuBJKkMEN2u+6As1KK4UL+g/ iTJZGRqiwjW9slCMH3NfWLVTKWrLcv9mzmxa4/BcjPcm38ixJfwmvey9UY7WPCvdtbQTZU 1/N7XaiOJ0BEDDUTOUQ1MKEvAq0Fk+noLyGvFXJqiR7BhfjHHk9uhd1k42KGYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781815408; a=rsa-sha256; cv=none; b=H8ms9upWtjL9tMrhwy+g3zFgmoWImgyhgfSMijzGMW7/91jISKJO7n+vk5xddReOGNrQup lhzOElrPCLdwTlVp7vq8moawdlgPsefPUF3vuS6RGPQufz0jD898Mzb1ruQa0UU6ntBupG llf9fe+4oRA6iHX60Q2/N5CzJre426BYJ4TWaozsNPK/YGLunjsBVSBJ+9xg2qL7ikiX+a 9TBkb1aHn3Km2KPINu63XipaZL+rNBsNC/Xkq04NuN3HC7hj+qRbFmijZKDgUOYkdt08QX 5rUQT+TczMHspShqiYI/Zlbp8gBIO5R0VpUc6VU8kO29C0MwVKWfX0NV1YbmfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781815408; 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=O/RlcrbKOAoUJV+4W3c9hOvru97nHgBqH2GVJA5bBIw=; b=c4MKw9zO/+Hg7i6tZ9203bX7oYKps92nLHrBjaziHSFpwIq33IVhl6kHVHwCGj88H9lcc7 I+4X5KcknW//VOkEEtGiD37J9nisnJKkRP3av5jAsIfu9VN8Ww0DAr4YtnxDTxDwGdDdcW ob8PzVSDP8VLC7eZE+SDE1vLQzLz95IVcPBzz/YinH5o70SzqyyGATGYYixhKlucx2imrb LUuNsXkSPu8ulStEx6MEt0D4VPaD3iVOD1EHnI1qOuYW8IKhsLSmyKFYTMIGVFcGBV4nVi nagrfA1wXtN9weutVf1rE4Y/+NjbIEoTzHVspfZML1DS15yt1nsQ/JFsYtHgLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghCNv6PYMzSH for ; Thu, 18 Jun 2026 20:43:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3c59f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Jun 2026 20:43:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: ShengYi Hung Subject: git: 32da2f23ae4d - main - stand: Bulk operatio=?utf-8?Q?ns=C2=A0on?= each gfxfb_blt if shadow buffer enabled 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: aokblast X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 32da2f23ae4d18888d34682b0ddb49ec80c0bb26 Auto-Submitted: auto-generated Date: Thu, 18 Jun 2026 20:43:27 +0000 Message-Id: <6a34586f.3c59f.dba42af@gitrepo.freebsd.org> The branch main has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=32da2f23ae4d18888d34682b0ddb49ec80c0bb26 commit 32da2f23ae4d18888d34682b0ddb49ec80c0bb26 Author: ShengYi Hung AuthorDate: 2026-05-31 15:07:51 +0000 Commit: ShengYi Hung CommitDate: 2026-06-18 20:43:24 +0000 stand: Bulk operations on each gfxfb_blt if shadow buffer enabled Previously, gfxfb_blt flushed the framebuffer on every call. Since a single drawing operation may invoke gfxfb_blt multiple times, this can result in unnecessary flushes. Instead, write updates to the shadow buffer (when present) and mark the affected area as dirty. Flushing is deferred so multiple gfxfb_blt calls can be coalesced into a single update. As before, only the dirty region is flushed. This fixes the slow bootloader problem in some platforms. Reviewed by: imp, adrian, obiwac Tested by: obiwac, jrm MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57373 --- stand/common/gfx_fb.c | 225 ++++++++++++++++++++++++++++++++++++++++++----- stand/common/gfx_fb.h | 7 ++ stand/ficl/gfx_loader.c | 7 +- stand/liblua/gfx_utils.c | 3 +- 4 files changed, 216 insertions(+), 26 deletions(-) diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c index 103833070a21..7ed0cf6bdb39 100644 --- a/stand/common/gfx_fb.c +++ b/stand/common/gfx_fb.c @@ -816,6 +816,27 @@ gfxfb_blt_video_to_video(uint32_t SourceX, uint32_t SourceY, return (0); } +static void +gfx_shadow_mark_dirty(uint32_t x, uint32_t y, uint32_t w, uint32_t h) +{ + if (gfx_state.tg_dirty) { + if (x < gfx_state.tg_dirty_x1) + gfx_state.tg_dirty_x1 = x; + if (y < gfx_state.tg_dirty_y1) + gfx_state.tg_dirty_y1 = y; + if (x + w > gfx_state.tg_dirty_x2) + gfx_state.tg_dirty_x2 = x + w; + if (y + h > gfx_state.tg_dirty_y2) + gfx_state.tg_dirty_y2 = y + h; + } else { + gfx_state.tg_dirty = true; + gfx_state.tg_dirty_x1 = x; + gfx_state.tg_dirty_y1 = y; + gfx_state.tg_dirty_x2 = x + w; + gfx_state.tg_dirty_y2 = y + h; + } +} + static void gfxfb_shadow_fill(uint32_t *BltBuffer, uint32_t DestinationX, uint32_t DestinationY, @@ -846,6 +867,63 @@ gfxfb_shadow_fill(uint32_t *BltBuffer, gfx_state.tg_shadow_fb[off + x] = *BltBuffer; } } + + gfx_shadow_mark_dirty(DestinationX, DestinationY, Width, Height); +} + +/* + * Write a pixel buffer into the shadow framebuffer. + */ +static void +gfxfb_shadow_buf_write(void *BltBuffer, uint32_t SourceX, uint32_t SourceY, + uint32_t DestinationX, uint32_t DestinationY, + uint32_t Width, uint32_t Height, uint32_t Delta) +{ + uint32_t fbW = gfx_state.tg_fb.fb_width; + uint32_t sy, dy; + + if (Delta == 0) + Delta = Width * sizeof(*gfx_state.tg_shadow_fb); + + for (sy = SourceY, dy = DestinationY; sy < SourceY + Height; sy++, dy++) { + uint32_t *src = (uint32_t *)((uint8_t *)BltBuffer + sy * Delta) + + SourceX; + uint32_t *dst = gfx_state.tg_shadow_fb + dy * fbW + DestinationX; + + bcopy(src, dst, Width * sizeof(*gfx_state.tg_shadow_fb)); + } + + gfx_shadow_mark_dirty(DestinationX, DestinationY, Width, Height); +} + +/* + * Copy a region within the shadow framebuffer. + */ +static void +gfxfb_shadow_vid_to_vid(uint32_t SourceX, uint32_t SourceY, + uint32_t DestinationX, uint32_t DestinationY, + uint32_t Width, uint32_t Height) +{ + uint32_t fbW = gfx_state.tg_fb.fb_width; + uint32_t h = Height; + int step = 1; + uint32_t sy = SourceY, dy = DestinationY; + + if (dy * fbW + DestinationX > sy * fbW + SourceX) { + sy += Height - 1; + dy += Height - 1; + step = -1; + } + + while (Height-- > 0) { + bcopy(gfx_state.tg_shadow_fb + sy * fbW + SourceX, + gfx_state.tg_shadow_fb + dy * fbW + DestinationX, + Width * sizeof(*gfx_state.tg_shadow_fb)); + sy += step; + dy += step; + } + + gfx_shadow_mark_dirty(DestinationX, DestinationY, Width, h); } int @@ -855,6 +933,49 @@ gfxfb_blt(void *BltBuffer, GFXFB_BLT_OPERATION BltOperation, uint32_t Width, uint32_t Height, uint32_t Delta) { int rv; + + /* + * When a shadow framebuffer is present, redirect write operations into + * it regardless of the underlying display backend (EFI GOP or direct + * framebuffer). The real video is updated in bulk by gfx_fb_flush() + * once a logical output operation is complete. + * + * Reads (VideoToBltBuffer) are intentionally NOT redirected to shadow: + * the shadow only contains pixels that have been explicitly written + * through it, so unwritten regions (e.g. firmware content already on + * screen at boot) would return stale or uninitialised data. Instead, + * flush any pending shadow writes to video first so the + * backend-specific read below always sees the current framebuffer + * contents. + */ + if (gfx_state.tg_shadow_fb != NULL && + BltOperation == GfxFbBltVideoToBltBuffer) + gfx_fb_flush(); + + if (gfx_state.tg_shadow_fb != NULL && + BltOperation != GfxFbBltVideoToBltBuffer) { + switch (BltOperation) { + case GfxFbBltVideoFill: + gfxfb_shadow_fill(BltBuffer, DestinationX, DestinationY, + Width, Height); + break; + + case GfxFbBltBufferToVideo: + gfxfb_shadow_buf_write(BltBuffer, SourceX, SourceY, + DestinationX, DestinationY, Width, Height, Delta); + break; + + case GfxFbBltVideoToVideo: + gfxfb_shadow_vid_to_vid(SourceX, SourceY, + DestinationX, DestinationY, Width, Height); + break; + + default: + return (EINVAL); + } + return (0); + } + #if defined(EFI) EFI_STATUS status; EFI_GRAPHICS_OUTPUT_PROTOCOL *gop; @@ -874,8 +995,6 @@ gfxfb_blt(void *BltBuffer, GFXFB_BLT_OPERATION BltOperation, tpl = BS->RaiseTPL(TPL_NOTIFY); switch (BltOperation) { case GfxFbBltVideoFill: - gfxfb_shadow_fill(BltBuffer, DestinationX, - DestinationY, Width, Height); status = gop->Blt(gop, BltBuffer, EfiBltVideoFill, SourceX, SourceY, DestinationX, DestinationY, Width, Height, Delta); @@ -927,8 +1046,6 @@ gfxfb_blt(void *BltBuffer, GFXFB_BLT_OPERATION BltOperation, switch (BltOperation) { case GfxFbBltVideoFill: - gfxfb_shadow_fill(BltBuffer, DestinationX, DestinationY, - Width, Height); rv = gfxfb_blt_fill(BltBuffer, DestinationX, DestinationY, Width, Height); break; @@ -955,6 +1072,57 @@ gfxfb_blt(void *BltBuffer, GFXFB_BLT_OPERATION BltOperation, return (rv); } +/* + * Flush the dirty region of the shadow framebuffer to the real framebuffer. + * Must be called after each logical output operation when shadow fb is in use. + */ +void +gfx_fb_flush(void) +{ + uint32_t x, y, w, h, pitch; + + if (gfx_state.tg_shadow_fb == NULL || !gfx_state.tg_dirty || + gfx_state.tg_fb_type == FB_TEXT) + return; + + x = gfx_state.tg_dirty_x1; + y = gfx_state.tg_dirty_y1; + pitch = gfx_state.tg_fb.fb_width; + + if (x >= pitch || y >= gfx_state.tg_fb.fb_height) + goto done; + + w = gfx_state.tg_dirty_x2 - x; + h = gfx_state.tg_dirty_y2 - y; + + if (x + w > pitch) + w = pitch - x; + if (y + h > gfx_state.tg_fb.fb_height) + h = gfx_state.tg_fb.fb_height - y; + +#if defined(EFI) + if (gfx_state.tg_fb_type == FB_GOP && !ignore_gop_blt && + boot_services_active) { + EFI_GRAPHICS_OUTPUT_PROTOCOL *gop = gfx_state.tg_private; + EFI_TPL tpl; + + assert(gop != NULL); + tpl = BS->RaiseTPL(TPL_NOTIFY); + (void) gop->Blt(gop, + (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)gfx_state.tg_shadow_fb, + EfiBltBufferToVideo, x, y, x, y, w, h, + pitch * sizeof(*gfx_state.tg_shadow_fb)); + BS->RestoreTPL(tpl); + goto done; + } +#endif + (void) gfxfb_blt_buffer_to_video(gfx_state.tg_shadow_fb, + x, y, x, y, w, h, pitch * sizeof(*gfx_state.tg_shadow_fb)); + +done: + gfx_state.tg_dirty = false; +} + void gfx_bitblt_bitmap(teken_gfx_t *state, const uint8_t *glyph, const teken_attr_t *a, uint32_t alpha, bool cursor) @@ -1057,6 +1225,8 @@ gfx_fb_putchar(void *arg, const teken_pos_t *p, teken_char_t c, c = teken_get_cursor(&state->tg_teken); gfx_fb_cursor_draw(state, c, true); } + + gfx_fb_flush(); } void @@ -1096,6 +1266,7 @@ gfx_fb_fill(void *arg, const teken_rect_t *r, teken_char_t c, gfx_fb_cursor_draw(state, c, true); } + gfx_fb_flush(); TSEXIT(); } @@ -1132,6 +1303,7 @@ gfx_fb_cursor(void *arg, const teken_pos_t *p) if (state->tg_cursor_visible) { gfx_fb_cursor_draw(state, &state->tg_cursor, false); gfx_fb_cursor_draw(state, p, true); + gfx_fb_flush(); } } @@ -1158,6 +1330,7 @@ gfx_fb_param(void *arg, int cmd, unsigned int value) state->tg_cursor_visible = true; else state->tg_cursor_visible = false; + gfx_fb_flush(); break; default: /* Not yet implemented */ @@ -1205,7 +1378,7 @@ gfx_fb_copy_area(teken_gfx_t *state, const teken_rect_t *s, width *= (s->tr_end.tp_col - s->tr_begin.tp_col + 1); /* - * With no shadow fb, use video to video copy. + * With no shadow fb, use video to video copy directly. */ if (state->tg_shadow_fb == NULL) { (void) gfxfb_blt(NULL, GfxFbBltVideoToVideo, @@ -1218,14 +1391,19 @@ gfx_fb_copy_area(teken_gfx_t *state, const teken_rect_t *s, } /* - * With shadow fb, we need to copy data on both shadow and video, - * to preserve the consistency. We only read data from shadow fb. + * With shadow fb, copy within shadow only. Every region that could + * be the source of a copy was previously drawn through the shadow, so + * reading from it here is always valid. Mark the destination dirty so + * gfx_fb_flush() will push it to the real framebuffer. */ - step = 1; pitch = state->tg_fb.fb_width; bytes = width * sizeof (*state->tg_shadow_fb); + uint32_t dst_x = dx + state->tg_origin.tp_col; + uint32_t dst_y = dy + state->tg_origin.tp_row; + uint32_t dst_h = height; + /* * To handle overlapping areas, set up reverse copy here. */ @@ -1240,13 +1418,11 @@ gfx_fb_copy_area(teken_gfx_t *state, const teken_rect_t *s, uint32_t *destination = &state->tg_shadow_fb[dy * pitch + dx]; bcopy(source, destination, bytes); - (void) gfxfb_blt(destination, GfxFbBltBufferToVideo, - 0, 0, dx + state->tg_origin.tp_col, - dy + state->tg_origin.tp_row, width, 1, 0); - sy += step; dy += step; } + + gfx_shadow_mark_dirty(dst_x, dst_y, width, dst_h); } static void @@ -1345,6 +1521,8 @@ gfx_fb_copy(void *arg, const teken_rect_t *r, const teken_pos_t *p) c = teken_get_cursor(&state->tg_teken); gfx_fb_cursor_draw(state, c, true); } + + gfx_fb_flush(); } /* @@ -1434,23 +1612,22 @@ gfx_fb_cons_display(uint32_t x, uint32_t y, uint32_t width, uint32_t height, size_t size; /* - * If we do have shadow fb, we will use shadow to render data, - * and copy shadow to video. + * If we do have shadow fb, render into it only. The caller is + * responsible for flushing the dirty region to the real framebuffer + * via gfx_fb_flush() once a logical output operation is complete. */ if (gfx_state.tg_shadow_fb != NULL) { uint32_t pitch = gfx_state.tg_fb.fb_width; + uint32_t sy = y - gfx_state.tg_origin.tp_row; + uint32_t sx = x - gfx_state.tg_origin.tp_col; - /* Copy rectangle line by line. */ p = data; - for (uint32_t sy = 0; sy < height; sy++) { + for (uint32_t row = 0; row < height; row++) { buf = (void *)(gfx_state.tg_shadow_fb + - (y - gfx_state.tg_origin.tp_row) * pitch + - x - gfx_state.tg_origin.tp_col); - bitmap_cpy(buf, &p[sy * width], width); - (void) gfxfb_blt(buf, GfxFbBltBufferToVideo, - 0, 0, x, y, width, 1, 0); - y++; + (sy + row) * pitch + sx); + bitmap_cpy(buf, &p[row * width], width); } + gfx_shadow_mark_dirty(x, y, width, height); return; } @@ -1566,6 +1743,7 @@ gfx_fb_drawrect(uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, gfxfb_blt(&c, GfxFbBltVideoFill, 0, 0, x1, y1, 1, y2 - y1, 0); gfxfb_blt(&c, GfxFbBltVideoFill, 0, 0, x2, y1, 1, y2 - y1, 0); } + gfx_fb_flush(); } void @@ -1618,6 +1796,7 @@ gfx_fb_line(uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1, uint32_t wd) y0 += sy; } } + gfx_fb_flush(); } /* @@ -1690,6 +1869,7 @@ gfx_fb_bezier(uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1, uint32_t x2, } while (dy < dx); /* gradient negates -> algorithm fails */ } gfx_fb_line(x0, y0, x2, y2, width); + gfx_fb_flush(); } /* @@ -2042,6 +2222,7 @@ gfx_fb_putimage(png_t *png, uint32_t ux1, uint32_t uy1, uint32_t ux2, gfx_fb_cons_display(ux1, uy1, fwidth, fheight, data); free(data); + gfx_fb_flush(); return (0); } diff --git a/stand/common/gfx_fb.h b/stand/common/gfx_fb.h index d12bcd76b7fa..6c59915f5940 100644 --- a/stand/common/gfx_fb.h +++ b/stand/common/gfx_fb.h @@ -216,6 +216,12 @@ typedef struct teken_gfx { struct gen_fb tg_fb; uint32_t *tg_shadow_fb; /* units of 4 bytes */ size_t tg_shadow_sz; /* units of pages */ + /* Dirty rectangle for double-buffered flush */ + uint32_t tg_dirty_x1; + uint32_t tg_dirty_y1; + uint32_t tg_dirty_x2; + uint32_t tg_dirty_y2; + bool tg_dirty; teken_funcs_t *tg_functions; void *tg_private; } teken_gfx_t; @@ -264,6 +270,7 @@ bool is_same_pixel(struct text_pixel *, struct text_pixel *); bool gfx_get_edid_resolution(struct vesa_edid_info *, edid_res_list_t *); void gfx_framework_init(void); void gfx_fb_cons_display(uint32_t, uint32_t, uint32_t, uint32_t, void *); +void gfx_fb_flush(void); void gfx_fb_setpixel(uint32_t, uint32_t); void gfx_fb_drawrect(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); void gfx_term_drawrect(uint32_t, uint32_t, uint32_t, uint32_t); diff --git a/stand/ficl/gfx_loader.c b/stand/ficl/gfx_loader.c index 4ac69e3c9895..0351aedaa16d 100644 --- a/stand/ficl/gfx_loader.c +++ b/stand/ficl/gfx_loader.c @@ -156,9 +156,10 @@ ficl_fb_setpixel(FICL_VM *pVM) vmCheckStack(pVM, 2, 0); #endif - y = stackPopUNS(pVM->pStack); - x = stackPopUNS(pVM->pStack); - gfx_fb_setpixel(x, y); + y = stackPopUNS(pVM->pStack); + x = stackPopUNS(pVM->pStack); + gfx_fb_setpixel(x, y); + gfx_fb_flush(); } void diff --git a/stand/liblua/gfx_utils.c b/stand/liblua/gfx_utils.c index 301cd9cb8610..f6d10fd74cba 100644 --- a/stand/liblua/gfx_utils.c +++ b/stand/liblua/gfx_utils.c @@ -133,7 +133,8 @@ lua_fb_setpixel(lua_State *L) x = luaL_checknumber(L, 1); y = luaL_checknumber(L, 2); - gfx_fb_setpixel(x, y); + gfx_fb_setpixel(x, y); + gfx_fb_flush(); return 0; } From nobody Thu Jun 18 21:37:36 2026 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 4ghDbP1mgKz6gmcf for ; Thu, 18 Jun 2026 21:37: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghDbP0gjVz485J for ; Thu, 18 Jun 2026 21:37:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781818657; 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=kyKhi/4kcGBBwZZ4/h+MfSUIHyztrf0epOLxmgvK4Ro=; b=oapa343Yw0OjQs8a+mhwAqMBdtpwQLH3WHTbkBociR+9+x7m0Ax+zxML/0Qw8crGwLMZtq VhuD3NQRFbOgQH8emvap8g/zSnI3EuPxqsYVUppZvh6RlCD2XSob+NWpYwlgKv8PHnoLwn paAX5NWRCF+qkUmvtoCQfChIxsgthcHYxmUOlUZptE+M2r449pVGpSoW/g07ZQklqRnHpZ HcvlxdE4tvR+psT9Vb4h0DA6M9cFAygvn5BGdlX88dyFEgP2NMFMeLv7hpBd+W4U1CpnSl RPJUmNRQE1/VJsfseOCUZ7kAddyHgEm13xxMH6P8FiJFWInm2eCox5iEK2PSFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781818657; a=rsa-sha256; cv=none; b=JBlLfuPAo83ydIMaffJ2FZtRZelHje8kjxo3KawN+I3pYjzZ/TRDkYE2ZH0vY8Ua0TzRZL yZRiBKY94SNpmLAQjuLc3+QPSKG/7XsO6oJaDQEMsOAQGynUx5noiOO176ozdSO9/yO/Vm rKzJF9gbZQ1U9+VROxWlGkyGyVrbLq4oDWbDE5UKjqSZm9n8zImyPR1Onzyp8FzPV38EFv ZpgOT54aZ3HrBUGci5vaATUwIEgAE0c4QZmXgtecWtWz7poUHwAO11KwZwjvvKyZyrJZoB Ntwl46AMt5g0CoYhz3TdypjmPyx0Uz0kxhImeC2ZJtZZkOZi4Tmlm6FF7PtHJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781818657; 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=kyKhi/4kcGBBwZZ4/h+MfSUIHyztrf0epOLxmgvK4Ro=; b=eZ2Z68RbLxkv9uXWhpUe9velEdNtTDVK+55I8SYPytydbPykYvPZ1Pzau+4U6gudJDZGjF Eav9wisB9aPYrtH4GQxZ6DN84xRVFFfiE46uz4f86saPy9SmWtFOptPPyYqP3fPR1ioSeh 5ju3CHv/yeaqQeS2ZQ1uX86IlslmYTeNS6WkOWHH702e/eJp7Aks2PWEzzYfd7HTpyFzUf unCo24zfjtRFSEUJzWVVYEN4J9FHGMxtehsMFVkEe9aVoMKeuXBYHIpl6cBsFggxXFjWTy HwXA8RXcxUkcrz0L4apSUe9jX478uUovS/nd+8EKvsrf278AKKVhUcAYoNLrwg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghDbN678Jz1v0 for ; Thu, 18 Jun 2026 21:37:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 40e97 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Jun 2026 21:37:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Enji Cooper Subject: git: 92bdcb08113c - main - thunderbolt: do not enable in GENERIC 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 92bdcb08113c05ec18ad420a4d84dd858e7f5e64 Auto-Submitted: auto-generated Date: Thu, 18 Jun 2026 21:37:36 +0000 Message-Id: <6a346520.40e97.71ca33db@gitrepo.freebsd.org> The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=92bdcb08113c05ec18ad420a4d84dd858e7f5e64 commit 92bdcb08113c05ec18ad420a4d84dd858e7f5e64 Author: Enji Cooper AuthorDate: 2026-06-18 20:02:01 +0000 Commit: Enji Cooper CommitDate: 2026-06-18 21:37:27 +0000 thunderbolt: do not enable in GENERIC The thunderbolt implementation is not 100% complete and causes some suspend/resume issues. Comment out the device until it is better fleshed out and some of the core issues with it are resolved. MFC after: 1 week Requested by: obiwac Differential Revision: https://reviews.freebsd.org/D57650 --- sys/amd64/conf/GENERIC | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index f9cef6c71d67..3d4c27430fe0 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -343,7 +343,9 @@ device uhci # UHCI PCI->USB interface device ohci # OHCI PCI->USB interface device ehci # EHCI PCI->USB interface (USB 2.0) device xhci # XHCI PCI->USB interface (USB 3.0) -device thunderbolt # Thunderbolt PCI->USB interface (USB 4.0) +# Disabled for now since thunderbolt(4) breaks suspend/resume in some instances +# and the overall implementation isn't fully fleshed out yet. +#device thunderbolt # Thunderbolt PCI->USB interface (USB 4.0) device usb # USB Bus (required) device usbhid # USB HID Transport device hkbd # HID Keyboard From nobody Fri Jun 19 04:05:08 2026 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 4ghPBY2Hdhz6hPfq for ; Fri, 19 Jun 2026 04:05: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghPBY1dwmz3XFL for ; Fri, 19 Jun 2026 04:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781841909; 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=i5O9sXvPxGSqGp7JSPwSDjVykCjZ4ZVybZofh4gKaf4=; b=gxLoW8uleK/kbATAvwuR9mC47DOySEtyZmBHZ/TiMDtLByWf1c3KDNOaqHU0J6bIP00R3t v5/gfCGxQM9k0mKuaU75vCHwmE7JKcyZb6noO6iY/mm0TzGRXQgRhve6/EcpWqKAqytRRv vq9YO0UR2BPXqprGrbb6chhfJQF7w3LSZooD/WwK0Qi/HNuM1oQdghJLNrGsNjIA5TlF2h fwk77sRsfYd+r8BJicHh8ypkmz2wZNY1A/Jwt3Q5VEncWnZBeu8gd5ZGzHFv/CfCRk/h86 /hLzZqI/3DG2dz3kW1qt3/dKP+sN0T1oXKdXnI2kpaCNGs/rE1uwRIankZlz+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781841909; a=rsa-sha256; cv=none; b=s/6a8j6inxf789A1xjc66DeYh/5Ktt6mkzjiXbkBjS8U2MNeTrqBa9DagwH2ix3FhNbB61 Iz3VKriQ5LNxyzjdiO7aMcf5WCltb2+dxV2FW2hduQR+Sxyqz82L8ncbDHJ060IoU7d9mm 9h1lu28NN6BzkQZEA6JXwg95FV6rvs9iILQZxYg6W0GRZK/MvzkNYxaQM4gQzydmHzFNl4 lETiz6sbwQY5AxEOshaMrvnfQcZA25iyjiVj4rILGix7d1VAaYFcsb4xvUKNtCiABsN7Kj sCxDj0uMPluhdApeRNUBFYfmtpXG81vQSpq7INCh1J2pqCEp/O/9iiwv/546Mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781841909; 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=i5O9sXvPxGSqGp7JSPwSDjVykCjZ4ZVybZofh4gKaf4=; b=iZK9WhKkSEL/xd4GLYwQFp3k5M3ac4t184KxCpNvBOGLDZIVzGTBkDz5TmlqzKaq0KVw11 qZIEPfszx9uA3zmlcCj/QG8DzqudXhWhMh/THb/3tsAR121fUDn6u4pv9iFFr3LLBGUm7Q YDCkpB4i8V9fuMpQ1ZKTER1EWL4XXnJ4WgmTYQp4ZRh6T7RJ3+C+Gs4LhObX7LYPf8hG1t cmhN6Semt4hn2Gw6kPql8n9LxKaWfVcy9JfFCiDKcVU7oERRJ1/dF1quN/lIiyKtg6R4+x WCfNdulHqBgKK57BxI71qjbtYd5jDpkZOMnd/gVhIeV2tEmL72mb9y01kACoEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghPBX6zNCzDBy for ; Fri, 19 Jun 2026 04:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 19cc8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 04:05:08 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 9b16399225f8 - main - unix: implement basic SO_PASSRIGHTS functionality 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 9b16399225f8acfba675cf0a9312dd9eac563ce3 Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 04:05:08 +0000 Message-Id: <6a34bff4.19cc8.634a666@gitrepo.freebsd.org> The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=9b16399225f8acfba675cf0a9312dd9eac563ce3 commit 9b16399225f8acfba675cf0a9312dd9eac563ce3 Author: Kyle Evans AuthorDate: 2026-06-19 04:03:30 +0000 Commit: Kyle Evans CommitDate: 2026-06-19 04:03:30 +0000 unix: implement basic SO_PASSRIGHTS functionality With exception to sockopt functionality, implement the so_options flag in unix(4) itself. The general argument for the flag is that SCM_RIGHTS can be used maliciously for, e.g., a DoS that the receiving side can't avoid if it is expecting other control messages. This option gives the receiver a way to disable SCM_RIGHTS on the sender-side, surfacing an EPERM to them instead. This seems to match the semantics that Linux offers. If an SCM_RIGHTS was already sent before we disabled SO_PASSRIGHTS, then a subsequent recvmsg(2) will silently discard any in-flight files. This has the downside of punting a file with the potential to hang over to the deferred-close task, but perhaps usage of the option would discourage folks from attempting to take advantage of that possibility anyways. Various manpages updated to describe the new behavior. The ru_msgsnd accounting here might need to be re-evaluated: some error paths will increment it while others will not, and it isn't really clearly labelled. At some point in the operation enough work has been done that one could consider it enough resources to count, but it's not obvious that it should work this way. This change doesn't attempt to address that. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D57423 --- lib/libsys/getsockopt.2 | 3 ++- lib/libsys/send.2 | 14 +++++++++-- share/man/man4/unix.4 | 13 ++++++++++- sys/kern/uipc_usrreq.c | 62 +++++++++++++++++++++++++++++++++++++------------ sys/sys/socket.h | 1 + 5 files changed, 74 insertions(+), 19 deletions(-) diff --git a/lib/libsys/getsockopt.2 b/lib/libsys/getsockopt.2 index 85d94e014631..1cfbe6ee913a 100644 --- a/lib/libsys/getsockopt.2 +++ b/lib/libsys/getsockopt.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 21, 2026 +.Dd June 3, 2026 .Dt GETSOCKOPT 2 .Os .Sh NAME @@ -192,6 +192,7 @@ The following options are recognized in .It Dv SO_NO_OFFLOAD Ta "disables protocol offloads" .It Dv SO_NO_DDP Ta "disables direct data placement offload" .It Dv SO_SPLICE Ta "splice two sockets together" +.It Dv SO_PASSRIGHTS Ta "enables passing of SCM_RIGHTS over unix(4) sockets" .El .Pp .Dv SO_DEBUG diff --git a/lib/libsys/send.2 b/lib/libsys/send.2 index 678eef139f4a..3a66e0f30471 100644 --- a/lib/libsys/send.2 +++ b/lib/libsys/send.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 27, 2020 +.Dd June 3, 2026 .Dt SEND 2 .Os .Sh NAME @@ -250,6 +250,15 @@ The process using a socket was jailed and the source address specified in the IP header did not match the IP address bound to the prison. +.It Bq Er EPERM +The +.Fa msg +contained an +.Dv SCM_RIGHTS +control message, and the receiving +.Xr unix 4 +socket is configured to reject new +.Dv SCM_RIGHTS . .It Bq Er EPIPE The socket is unable to send anymore data .Dv ( SBS_CANTSENDMORE @@ -265,7 +274,8 @@ is not connected. .Xr select 2 , .Xr socket 2 , .Xr write 2 , -.Xr CMSG_DATA 3 +.Xr CMSG_DATA 3 , +.Xr unix 4 .Sh HISTORY The .Fn send diff --git a/share/man/man4/unix.4 b/share/man/man4/unix.4 index 2fdfde225b14..f83f9ddffea3 100644 --- a/share/man/man4/unix.4 +++ b/share/man/man4/unix.4 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 31, 2024 +.Dd June 3, 2026 .Dt UNIX 4 .Os .Sh NAME @@ -163,9 +163,20 @@ depending on whether is passed in the .Xr recvmsg 2 call. +.Pp Descriptors that are awaiting delivery, or that are purposely not received, are automatically closed by the system when the destination socket is closed. +The receiving socket can reject +.Dv SCM_RIGHTS +at the +.Xr sendmsg 2 +call with the socket option +.Dv SO_PASSRIGHTS , +which can be set with +.Xr setsockopt 2 +and tested with +.Xr getsockopt 2 . .Pp Credentials of the sending process can be transmitted explicitly using a control message of type diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index b28aed291895..ad6d546afa25 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -303,9 +303,10 @@ static void unp_scan(struct mbuf *, void (*)(struct filedescent **, int)); static void unp_discard(struct file *); static void unp_freerights(struct filedescent **, int); static int unp_internalize(struct mbuf *, struct mchain *, - struct thread *); + struct thread *, int *); static void unp_internalize_fp(struct file *); -static int unp_externalize(struct mbuf *, struct mbuf **, int); +static int unp_externalize(const struct socket *, struct mbuf *, + struct mbuf **, int); static int unp_externalize_fp(struct file *); static void unp_addsockcred(struct thread *, struct mchain *, int); static void unp_process_defers(void * __unused, int); @@ -527,6 +528,7 @@ common: UNP_PCB_LOCK_INIT(unp); unp->unp_socket = so; so->so_pcb = unp; + so->so_options |= SO_PASSRIGHTS; refcount_init(&unp->unp_refcount, 1); unp->unp_mode = ACCESSPERMS; @@ -1112,7 +1114,7 @@ uipc_sosend_stream_or_seqpacket(struct socket *so, struct sockaddr *addr, struct mchain mc, cmc; size_t resid, sent; bool nonblock, eor, aio; - int error; + int error, needsopts; MPASS((uio0 != NULL && m == NULL) || (m != NULL && uio0 == NULL)); MPASS(m == NULL || c == NULL); @@ -1128,9 +1130,11 @@ uipc_sosend_stream_or_seqpacket(struct socket *so, struct sockaddr *addr, cmc = MCHAIN_INITIALIZER(&cmc); sent = 0; aio = false; + needsopts = 0; if (m == NULL) { - if (c != NULL && (error = unp_internalize(c, &cmc, td))) + if (c != NULL && + (error = unp_internalize(c, &cmc, td, &needsopts))) goto out; /* * This function may read more data from the uio than it would @@ -1176,6 +1180,14 @@ uipc_sosend_stream_or_seqpacket(struct socket *so, struct sockaddr *addr, if (__predict_false((error = uipc_lock_peer(so, &unp2)) != 0)) goto out3; + /* Check for SO_PASS* flags */ + so2 = unp2->unp_socket; + if ((atomic_load_int(&so2->so_options) & needsopts) != needsopts) { + error = EPERM; + UNP_PCB_UNLOCK(unp2); + goto out3; + } + if (unp2->unp_flags & UNP_WANTCRED_MASK) { /* * Credentials are passed only once on SOCK_STREAM and @@ -1193,7 +1205,6 @@ uipc_sosend_stream_or_seqpacket(struct socket *so, struct sockaddr *addr, * observe the SBS_CANTRCVMORE and our sorele() will finalize peer's * socket destruction. */ - so2 = unp2->unp_socket; soref(so2); UNP_PCB_UNLOCK(unp2); sb = &so2->so_rcv; @@ -1560,7 +1571,7 @@ restart: * is fine that we need to perform pretty complex * operation here to reconstruct the buffer. */ - error = unp_externalize(control, controlp, flags); + error = unp_externalize(so, control, controlp, flags); control = m_free(control); if (__predict_false(error && control != NULL)) { struct mchain cmc; @@ -1959,11 +1970,11 @@ uipc_sosend_dgram(struct socket *so, struct sockaddr *addr, struct uio *uio, struct mbuf *f; u_int cc, ctl, mbcnt; u_int dcc __diagused, dctl __diagused, dmbcnt __diagused; - int error; + int error, needsopts; MPASS((uio != NULL && m == NULL) || (m != NULL && uio == NULL)); - error = 0; + error = needsopts = 0; f = NULL; if (__predict_false(flags & MSG_OOB)) { @@ -1983,7 +1994,8 @@ uipc_sosend_dgram(struct socket *so, struct sockaddr *addr, struct uio *uio, f = m_gethdr(M_WAITOK, MT_SONAME); cc = m->m_pkthdr.len; mbcnt = MSIZE + m->m_pkthdr.memlen; - if (c != NULL && (error = unp_internalize(c, &cmc, td))) + if (c != NULL && + (error = unp_internalize(c, &cmc, td, &needsopts))) goto out; } else { struct mchain mc; @@ -2049,6 +2061,13 @@ uipc_sosend_dgram(struct socket *so, struct sockaddr *addr, struct uio *uio, } } + /* Check for SO_PASS* flags */ + so2 = unp2->unp_socket; + if ((atomic_load_int(&so2->so_options) & needsopts) != needsopts) { + error = EPERM; + goto out4; + } + if (unp2->unp_flags & UNP_WANTCRED_MASK) unp_addsockcred(td, &cmc, unp2->unp_flags); if (unp->unp_addr != NULL) @@ -2117,7 +2136,6 @@ uipc_sosend_dgram(struct socket *so, struct sockaddr *addr, struct uio *uio, * would accumulate counters from all connected buffers potentially * having sb_ccc > sb_hiwat or sb_mbcnt > sb_mbmax. */ - so2 = unp2->unp_socket; sb = (addr == NULL) ? &so->so_snd : &so2->so_rcv; SOCK_RECVBUF_LOCK(so2); if (uipc_dgram_sbspace(sb, cc + ctl, mbcnt)) { @@ -2143,6 +2161,7 @@ uipc_sosend_dgram(struct socket *so, struct sockaddr *addr, struct uio *uio, } } +out4: if (addr != NULL) unp_disconnect(unp, unp2); else @@ -2345,7 +2364,7 @@ uipc_soreceive_dgram(struct socket *so, struct sockaddr **psa, struct uio *uio, * without MT_DATA mbufs. */ while (m != NULL && m->m_type == MT_CONTROL) { - error = unp_externalize(m, controlp, flags); + error = unp_externalize(so, m, controlp, flags); m = m_free(m); if (error != 0) { SOCK_IO_RECV_UNLOCK(so); @@ -3495,7 +3514,8 @@ restrict_rights(struct file *fp, struct thread *td) } static int -unp_externalize(struct mbuf *control, struct mbuf **controlp, int flags) +unp_externalize(const struct socket *so, struct mbuf *control, + struct mbuf **controlp, int flags) { struct thread *td = curthread; /* XXX */ struct cmsghdr *cm = mtod(control, struct cmsghdr *); @@ -3527,8 +3547,18 @@ unp_externalize(struct mbuf *control, struct mbuf **controlp, int flags) goto next; fdep = data; - /* If we're not outputting the descriptors free them. */ - if (error || controlp == NULL) { + /* + * If we're not outputting the descriptors, free them. + * + * In the case of having revoked SCM_PASSRIGHTS, the + * receiver must have toggled it before trying to + * receive control messages- we'll take that as a signal + * that they didn't want these, but they raced against + * the sender trying to pass files anyways. + */ + if (error || controlp == NULL || + (atomic_load_int(&so->so_options) & + SO_PASSRIGHTS) == 0) { unp_freerights(fdep, newfds); goto next; } @@ -3673,7 +3703,8 @@ unp_internalize_cleanup_rights(struct mbuf *control) } static int -unp_internalize(struct mbuf *control, struct mchain *mc, struct thread *td) +unp_internalize(struct mbuf *control, struct mchain *mc, struct thread *td, + int *needsopts) { struct proc *p; struct filedesc *fdesc; @@ -3729,6 +3760,7 @@ unp_internalize(struct mbuf *control, struct mchain *mc, struct thread *td) break; case SCM_RIGHTS: + *needsopts |= SO_PASSRIGHTS; oldfds = datalen / sizeof (int); if (oldfds == 0) continue; diff --git a/sys/sys/socket.h b/sys/sys/socket.h index 8477e122520a..d9c31d572b4f 100644 --- a/sys/sys/socket.h +++ b/sys/sys/socket.h @@ -147,6 +147,7 @@ typedef __uintptr_t uintptr_t; #define SO_NO_DDP 0x00008000 /* int; disable direct data placement */ #define SO_REUSEPORT_LB 0x00010000 /* int; reuse with load balancing */ #define SO_RERROR 0x00020000 /* int; keep track of receive errors */ +#define SO_PASSRIGHTS 0x00040000 /* int; unix(4) accepts SCM_RIGHTS */ /* * Additional options, not kept in so_options. From nobody Fri Jun 19 04:05:10 2026 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 4ghPBZ4kDMz6hPp5 for ; Fri, 19 Jun 2026 04:05: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghPBZ1pTbz3XNf for ; Fri, 19 Jun 2026 04:05:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781841910; 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=JugU/bRTg8T53JvMO4to6J55nsKrJN3SEevVroBLLCE=; b=gtlhRyO1iVAGb7WdWp21ZdXtF9hGvx2tByKy/LF8cYDmJcneVK1DOatvzhyx4wC5scsnZw /h38A5/PF2mgbcssTTcsIRAjJW6xhUf57dMPkS5UGsGLr2rXZvGlhSylYeUEqbPZ9t1Yuq eE0ERnBhYhByjYDeosNibxRx+8Icbns9a6QJzrSqwtLD99Zg9m3/Tpsv4ZopAVC6TfSFpc tdzsxr1IMQV99467eJsA1w12sG98h2cbpH77U51mD07xjrU9QvOhBlURh9QqHeYrByz2ac Gd0OWC5qVSjubBmBCpteaU8L1+iWwvEfKWJ/22RDcr4e+hLop18SDzyioG8bEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781841910; a=rsa-sha256; cv=none; b=o7uhV+qhi0TD+u5jTq3g6n6bRqWsZpj2J7+pK1DZDdp20l63aexFtT+9QiJiHMFUezXt5B XvdE2XNFpthC1P4MzFkj6xPOU4Beap+ZqooYwyXs55KXW1xbIkKdsGcq97stTrN0jg+7g6 ZCp8oMs7TA7cfQImPhETKU1gcWLIxuKOj7Zcl5RJnm6EVvRjmeJ7abP7UBqfNA4u0lgETf HqRIMqgQUa+b2T/C6WC8dIbYVMEmlcblZv16XumQtj6wrigoTMcqNmCsSSiklFaBiae1G2 Gp72XnNHx9XuQRZpgIwaipMoUbSIRO9JXl5cVwTBV672lFKYVC6U3H9qphyNaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781841910; 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=JugU/bRTg8T53JvMO4to6J55nsKrJN3SEevVroBLLCE=; b=Nm80oluaf56pdw8FWN8fM+imF07RCAgV+X0KrYTa34R9d6Iv7UB7V82u/1Kf+uFr4s77Jc hBEbDBCn1QfhA5PzE7Uj6Vq1BwIlW+bjdoNS0ZzV7G8wS8mGwDNqApxjGs4RrL1sFrxKfu fz+o1uDLSFEY3XgDEXaLkGEms7XlFQWuUfK8vvYIjDTHFyb4yT5CzHlFeOHqhCcBDpMIJ0 UDwtW4WBJVkkgNZpZ+hmvbkiFVlypSolZjetnDQBPlAGwCMo86rf1xJu4JeP8F2OaFGInt O055pQ5VOlT4y14wSZra55zUN467Nxcp6oYWP4/NxcXdvOYXhFunxLSdcPpWUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghPBZ09PGzD5n for ; Fri, 19 Jun 2026 04:05:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 180ee by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 04:05:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 0ae7df3708dd - main - sockets: plumb SO_PASSRIGHTS into *sockopt(2) 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 0ae7df3708dd97515a5bc2a068d25a733c9b2b10 Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 04:05:10 +0000 Message-Id: <6a34bff6.180ee.4c6f2af2@gitrepo.freebsd.org> The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=0ae7df3708dd97515a5bc2a068d25a733c9b2b10 commit 0ae7df3708dd97515a5bc2a068d25a733c9b2b10 Author: Kyle Evans AuthorDate: 2026-06-19 04:03:30 +0000 Commit: Kyle Evans CommitDate: 2026-06-19 04:03:30 +0000 sockets: plumb SO_PASSRIGHTS into *sockopt(2) This is a little different than the others in that it's not valid for anything but unix(4) sockets. New cases were added that jump into the more standard case out of a light preference for not taking advantage of case FALLTHROUGH with the additional logic- it doesn't scale very well for new cases added that might be slightly special, so we might as well just add the labels up-front. Reviewed by: glebius, markj Differential Revision: https://reviews.freebsd.org/D57424 --- sys/kern/uipc_socket.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 3debec547a80..c7a7fdd44aa0 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -3911,6 +3911,7 @@ sosetopt(struct socket *so, struct sockopt *sopt) case SO_NO_DDP: case SO_NO_OFFLOAD: case SO_RERROR: +stdopt: error = sooptcopyin(sopt, &optval, sizeof optval, sizeof optval); if (error) @@ -3923,6 +3924,14 @@ sosetopt(struct socket *so, struct sockopt *sopt) SOCK_UNLOCK(so); break; + case SO_PASSRIGHTS: + if (so->so_proto->pr_domain->dom_family != AF_LOCAL) { + error = EOPNOTSUPP; + goto bad; + } + + goto stdopt; + case SO_SETFIB: error = so->so_proto->pr_ctloutput(so, sopt); break; @@ -4162,11 +4171,20 @@ sogetopt(struct socket *so, struct sockopt *sopt) case SO_NO_DDP: case SO_NO_OFFLOAD: case SO_RERROR: +stdopt: optval = so->so_options & sopt->sopt_name; integer: error = sooptcopyout(sopt, &optval, sizeof optval); break; + case SO_PASSRIGHTS: + if (so->so_proto->pr_domain->dom_family != AF_LOCAL) { + error = EOPNOTSUPP; + goto bad; + } + + goto stdopt; + case SO_FIB: SOCK_LOCK(so); optval = so->so_fibnum; From nobody Fri Jun 19 04:05:11 2026 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 4ghPBb5B3Vz6hPrd for ; Fri, 19 Jun 2026 04:05: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghPBb2JBrz3XNg for ; Fri, 19 Jun 2026 04:05:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781841911; 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=w7LrrSvV5xP/pTpJfl4H5HcOaKdEMZxl/8gIuP6q8tI=; b=g3zGEK1DitJUiNzqmC6FkaG1G9g0tQ16J4nA+hL/YRe0f7g+N+gnn+6nCAN5VAsGF8qu8t O0Zca61WxucEV4kJDyL+6vXfbxbjrXajy5eF+1ajJCtiXu4lBrzWCU3EjU0RteJcDaLiQZ X3c3k17oTtYNBfHDAWXtLc5yDzqwwCYpE5FN1BjbFqA6FgBjZkeNlWfehq/0KTqa2wRjMH dnHMXsu+T13+AxL2zcyuy4bmZw5tpqf5ndcjsRCigOOIFYYn1yaQ3kmwz1DzooGVlz80Ap Nveef9iUSJe7ctpLYqUdgT0X7aZuv++hu3UQgRg/+4Qv6pyznWKl5PHezCKtRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781841911; a=rsa-sha256; cv=none; b=BSbxY0sbAOyN1GD3+CEPwFvIG1QabEYxrVj6qpNV2WrMYPB74nupU2FRyWfY4ZEqXltqxa m2mf0mJH5Yf0W5r+hR0ScBlr+sn6q3Wi+UU94EylJGEkFamXbsG8aGVeA/LbaZCxT4dQfG 0NMrvbLLo0YbwVySDbogH4sIbfTZTBZ2tNLHjgEa/lqfYmo92KIGJVyTYP6XdRLFEky++2 pd0DnWqicWK69UOmhnUDYYgLm2MY3+mG++nijHgSXCgROv52GFZx0h2zNJVb5butgMy9kw LguH45LAH9WUtvEKEjfuV8WWVKga7OJT32dOv5+0v/PkaDTf9a40tyV9pUvS9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781841911; 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=w7LrrSvV5xP/pTpJfl4H5HcOaKdEMZxl/8gIuP6q8tI=; b=yqOV8BoyMESpbLb62XUsj2yMbJ+OP4BNQvUI3wm1HbmCu43vTAhJraQ1svDblmlBGsrv+o 8m54H3U/ORwbnreBPUrWh+pY6Tq2HC0kIfim2lRf8ggRUesnB2per13pKWvqx4WHR7IyvX qwbZfgqh/i7xjiM/HRt357J7ZX3sidKEXVsD9VuQUP731I/4bqjL6WXO2CMsXClUWJ9n/3 jA4ZZA8A7gMuJLLiHiDo/Vw/y58E8PS+J6ZUjISX2K7cow+Z1a2LD5uMyaAMAXnHFKhPmy FLU9dC527vxf6kXsJsj3VenRJ7x/ppsxizk/KdXuLb63WEDBA8/Pgdfq5CpI4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghPBb11MSzD5p for ; Fri, 19 Jun 2026 04:05:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1c472 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 04:05:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 2f363febf8bf - main - tests: unix: pull a recvfd_payload_cmsg out of recvfd_payload 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 2f363febf8bf5c3e9ffad95b5998b461adc77c28 Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 04:05:11 +0000 Message-Id: <6a34bff7.1c472.d41582c@gitrepo.freebsd.org> The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=2f363febf8bf5c3e9ffad95b5998b461adc77c28 commit 2f363febf8bf5c3e9ffad95b5998b461adc77c28 Author: Kyle Evans AuthorDate: 2026-06-19 04:03:30 +0000 Commit: Kyle Evans CommitDate: 2026-06-19 04:03:30 +0000 tests: unix: pull a recvfd_payload_cmsg out of recvfd_payload This is almost a trivial factoring, but it's still a bit of boilerplate that we don't care to rewrite- the SO_PASSRIGHTS test will still receive some data, so the iovec construction still saves us a few lines. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D57544 --- tests/sys/kern/unix_passfd_test.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/tests/sys/kern/unix_passfd_test.c b/tests/sys/kern/unix_passfd_test.c index 66bb406ea14e..2ad40582d058 100644 --- a/tests/sys/kern/unix_passfd_test.c +++ b/tests/sys/kern/unix_passfd_test.c @@ -208,13 +208,27 @@ localcreds(int sockfd) return (val != 0); } +static ssize_t +recvfd_payload_cmsg(int sockfd, void *buf, size_t buflen, struct msghdr *msghdr, + int recvmsg_flags) +{ + struct iovec iovec; + + iovec.iov_base = buf; + iovec.iov_len = buflen; + + msghdr->msg_iov = &iovec; + msghdr->msg_iovlen = 1; + + return (recvmsg(sockfd, msghdr, recvmsg_flags)); +} + static ssize_t recvfd_payload(int sockfd, int *recv_fd, void *buf, size_t buflen, size_t cmsgsz, int recvmsg_flags) { struct cmsghdr *cmsghdr; struct msghdr msghdr; - struct iovec iovec; char *message; ssize_t len; bool foundcreds; @@ -226,13 +240,7 @@ recvfd_payload(int sockfd, int *recv_fd, void *buf, size_t buflen, msghdr.msg_control = message; msghdr.msg_controllen = cmsgsz; - iovec.iov_base = buf; - iovec.iov_len = buflen; - - msghdr.msg_iov = &iovec; - msghdr.msg_iovlen = 1; - - len = recvmsg(sockfd, &msghdr, recvmsg_flags); + len = recvfd_payload_cmsg(sockfd, buf, buflen, &msghdr, recvmsg_flags); ATF_REQUIRE_MSG(len != -1, "recvmsg failed: %s", strerror(errno)); cmsghdr = CMSG_FIRSTHDR(&msghdr); From nobody Fri Jun 19 04:05:12 2026 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 4ghPBc65KVz6hPp9 for ; Fri, 19 Jun 2026 04:05:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghPBc38R7z3X4G for ; Fri, 19 Jun 2026 04:05:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781841912; 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=CpIyDDPOB3GWbxjz25v8EuWIi31cNSDryjhRI6x8/48=; b=S9SOaO9y6+8S3SXIzqmu4tYf3guBKGGuLdC/hQUedg6CRJy0dn4RP74hU1W6mCqhqp0E3J Oe0GHVw8oE2LeZ3VcYxVb/XjqAv4w2YFbktrxwrXcstLVIPl1YlLFLhtYLqMbwUbUajDnp ZnJHIUru7kMMazre9VBl87CbzyWkvQwh8hCVMBuq+G2pWYY+T2/zWih+c1KpoxrNdOU6f+ noBrdQk8bMeBxRSP3k34oaK7Y7zXeQw2uWEZ9ePs7LwMAGOXz7Z6zhjn1F40OzEG7FkZjs 2lhtv4FEO6p1Uu4ISfWVylYTJzTsHjRUePKvWRNjQk8BmD3ZyrvKp7kNltZJ9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781841912; a=rsa-sha256; cv=none; b=tdTKqtWwqHB6aA/m1Mz2Yc1Ic7tdxVH94NKnzIytkYBdQ0dP48YmU7kJz710aZaE8mL7bI Q26iIcjoloV7nknv+uwC/SBosSvdDWxM8G896QekwvBsKJLHVUcQIymIpD1Kr2ab2+UQ8U 3AhOyGu5vFZhlK45h7elhHb2+WV5N6RfV+NdppmfvfvM2G+ASs/nUnnIFVWogUIPgSguav bkDor3lacP9rvmJe1G3dQ1rdHlAfZdePBehUfzti+IJ5kkVj5LjuwO2awJwjfBNoVuLZ9N IAqXxI5Epu1zQD0HqwnHcNP3x0yUKnrGLiGs1nPV0Eyz//fWxVH09R+3V2hK/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781841912; 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=CpIyDDPOB3GWbxjz25v8EuWIi31cNSDryjhRI6x8/48=; b=XkSN4A3Kp1o8MgjWbCMdkcOZGKFBGSz1H7782uHIHw6OXOrIHGJW4EyK/gjDCuWHfsFxl+ eqHEmMxQooYbVMRWWRrBh9kcKwComo7E4KbdNUlf6YeOoM3PW7v1W98b0bd/MCQh+xSuG1 49OK6X6OGjNfJs6DQn6P8MFGuBE+PynuBRwjRlzJE8oAx/AfPcmZomE5sD/lEkHTuFngd5 VDchE8cCi7tbHf3V9zuQUe52+kym666Yte173kp65uoQlxr41BaVoPmuD0BqqEr9o1Crg2 xQue3JKRrogwU+iIJcwUd+JcdNV2CKa3yxn3/HHgGqYlTc2Fa+HLQAZjg3f+bA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghPBc1g8FzD9S for ; Fri, 19 Jun 2026 04:05:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 194a9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 04:05:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: c08a86e0c6d9 - main - tests: unix: add SCM_RIGHTS tests for SO_PASSRIGHTS 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: c08a86e0c6d989c926c2777c978155dde7d0697a Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 04:05:12 +0000 Message-Id: <6a34bff8.194a9.4ceada7b@gitrepo.freebsd.org> The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=c08a86e0c6d989c926c2777c978155dde7d0697a commit c08a86e0c6d989c926c2777c978155dde7d0697a Author: Kyle Evans AuthorDate: 2026-06-19 04:03:30 +0000 Commit: Kyle Evans CommitDate: 2026-06-19 04:03:30 +0000 tests: unix: add SCM_RIGHTS tests for SO_PASSRIGHTS We test both the standard case where we want to reject any SCM_RIGHTS message, as well as the case where the kernel discards the unwanted file upon receipt. Reviewed by: glebius (previous version), markj Differential Revision: https://reviews.freebsd.org/D57426 --- tests/sys/kern/unix_passfd_test.c | 150 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) diff --git a/tests/sys/kern/unix_passfd_test.c b/tests/sys/kern/unix_passfd_test.c index 2ad40582d058..c600b0937b0d 100644 --- a/tests/sys/kern/unix_passfd_test.c +++ b/tests/sys/kern/unix_passfd_test.c @@ -208,6 +208,19 @@ localcreds(int sockfd) return (val != 0); } +static bool +passrights(int sockfd) +{ + socklen_t sz; + int rc, val; + + sz = sizeof(val); + rc = getsockopt(sockfd, SOL_SOCKET, SO_PASSRIGHTS, &val, &sz); + ATF_REQUIRE_MSG(rc != -1, "getsockopt(SO_PASSRIGHTS) failed: %s", + strerror(errno)); + return (val != 0); +} + static ssize_t recvfd_payload_cmsg(int sockfd, void *buf, size_t buflen, struct msghdr *msghdr, int recvmsg_flags) @@ -580,6 +593,140 @@ ATF_TC_BODY(send_overflow, tc) closesocketpair(fd); } +ATF_TC_WITHOUT_HEAD(send_rejected); +ATF_TC_BODY(send_rejected, tc) +{ + ssize_t len; + int fd[2], optval, putfd, rc; + char ch; + + domainsocketpair(fd); + ATF_REQUIRE_MSG(passrights(fd[0]), + "socketpair socket not initialized with SO_PASSRIGHTS"); + ATF_REQUIRE_MSG(passrights(fd[1]), + "socketpair socket not initialized with SO_PASSRIGHTS"); + + tempfile(&putfd); + + /* Toggle SO_PASSRIGHTS off on the receiver side. */ + optval = 0; + rc = setsockopt(fd[1], SOL_SOCKET, SO_PASSRIGHTS, &optval, + sizeof(optval)); + ATF_REQUIRE_MSG(rc != -1, "setsockopt(SO_PASSRIGHTS) failed: %s", + strerror(errno)); + /* Confirm that the sender-side didn't reflect that... */ + ATF_REQUIRE_MSG(passrights(fd[0]), + "setsockopt(SO_PASSRIGHTS) switched the sender"); + /* ... and that the receiver-side did. */ + ATF_REQUIRE_MSG(!passrights(fd[1]), + "setsockopt(SO_PASSRIGHTS) did not switch the receiver"); + + ch = 0; + len = sendfd_payload(fd[0], putfd, &ch, sizeof(ch)); + ATF_REQUIRE_MSG(len == -1, + "sending SCM_RIGHTS with SO_PASSRIGHTS disabled on peer did not fail"); + ATF_REQUIRE_MSG(errno == EPERM, + "bad SCM_RIGHTS failure: %s", strerror(errno)); + closesocketpair(fd); +} + +ATF_TC_WITHOUT_HEAD(send_rejected_late); +ATF_TC_BODY(send_rejected_late, tc) +{ + struct cmsghdr *cmsghdr; + struct msghdr msghdr; + ssize_t len; + char cmsgbuf[CMSG_SPACE(sizeof(int))]; + int fd[2], nfds, optval, putfd, rc; + char ch; +#define MAGIC_VAL 42 + + domainsocketpair(fd); + tempfile(&putfd); + + nfds = getnfds(); + + ch = MAGIC_VAL; + len = sendfd_payload(fd[0], putfd, &ch, sizeof(ch)); + ATF_REQUIRE_MSG(len == sizeof(ch), + "valid send of SCM_RIGHTS failed: %s", strerror(errno)); + + /* + * Toggle SO_PASSRIGHTS off on the receiver side. The subsequent recv + * should actually succeed, we just won't have an fd installed. + */ + optval = 0; + rc = setsockopt(fd[1], SOL_SOCKET, SO_PASSRIGHTS, &optval, + sizeof(optval)); + ATF_REQUIRE_MSG(rc != -1, "setsockopt(SO_PASSRIGHTS) failed: %s", + strerror(errno)); + + bzero(&msghdr, sizeof(msghdr)); + msghdr.msg_control = &cmsgbuf[0]; + msghdr.msg_controllen = sizeof(cmsgbuf); + + ch = 0; + len = recvfd_payload_cmsg(fd[1], &ch, sizeof(ch), &msghdr, 0); + /* We want to confirm that we still received the sent byte... */ + ATF_REQUIRE_MSG(len == sizeof(ch), "recvmsg should have returned data"); + ATF_REQUIRE_MSG(ch == MAGIC_VAL, "recvmsg returned garbage? %d", ch); + + /* ... and make sure we did not receive any descriptors! */ + cmsghdr = CMSG_FIRSTHDR(&msghdr); + ATF_REQUIRE_MSG(cmsghdr == NULL || cmsghdr->cmsg_type != SCM_RIGHTS, + "recvmsg unexpectedly received a descriptor"); + ATF_REQUIRE(getnfds() == nfds); + closesocketpair(fd); +} + +ATF_TC_WITHOUT_HEAD(send_rejected_noinherit); +ATF_TC_BODY(send_rejected_noinherit, tc) +{ + struct sockaddr_un sun; + int clsock, connsock, ls, optval, rc; + + ls = socket(AF_UNIX, SOCK_STREAM, 0); + ATF_REQUIRE(ls != -1); + + optval = 0; + rc = setsockopt(ls, SOL_SOCKET, SO_PASSRIGHTS, &optval, + sizeof(optval)); + ATF_REQUIRE_MSG(rc != -1, "setsockopt(SO_PASSRIGHTS) failed: %s", + strerror(errno)); + + memset(&sun, 0, sizeof(sun)); + sun.sun_len = sizeof(sun); + sun.sun_family = AF_UNIX; + snprintf(sun.sun_path, sizeof(sun.sun_path), "listen.sock"); + rc = bind(ls, (struct sockaddr *)&sun, sizeof(sun)); + ATF_REQUIRE_MSG(rc == 0, "bind failed: %s", strerror(errno)); + rc = listen(ls, 0); + ATF_REQUIRE_MSG(rc == 0, "listen failed: %s", strerror(errno)); + + ATF_REQUIRE_MSG(!passrights(ls), + "listening socket lost its SO_PASSRIGHTS setting"); + + connsock = socket(AF_UNIX, SOCK_STREAM, 0); + ATF_REQUIRE_MSG(connsock != -1, "connect failed: %s", strerror(errno)); + + rc = connect(connsock, (const struct sockaddr *)&sun, + sizeof(sun)); + ATF_REQUIRE_MSG(rc == 0, "connect failed: %s", strerror(errno)); + + /* + * Finally, accept(4) and confirm that the new socket has + * SO_PASSRIGHTS set. + */ + clsock = accept(ls, NULL, NULL); + ATF_REQUIRE_MSG(clsock >= 0, "accept failed: %s", strerror(errno)); + + ATF_REQUIRE_MSG(passrights(clsock), + "inherited socket should enable SO_PASSRIGHTS"); + close(clsock); + close(connsock); + close(ls); +} + /* * Make sure that we do not receive descriptors with MSG_PEEK. */ @@ -1236,6 +1383,9 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, send_and_shutdown); ATF_TP_ADD_TC(tp, send_a_lot); ATF_TP_ADD_TC(tp, send_overflow); + ATF_TP_ADD_TC(tp, send_rejected); + ATF_TP_ADD_TC(tp, send_rejected_late); + ATF_TP_ADD_TC(tp, send_rejected_noinherit); ATF_TP_ADD_TC(tp, peek); ATF_TP_ADD_TC(tp, two_files); ATF_TP_ADD_TC(tp, bundle); From nobody Fri Jun 19 04:05:13 2026 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 4ghPBf4QFFz6hPpG for ; Fri, 19 Jun 2026 04:05:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghPBd5P53z3XNq for ; Fri, 19 Jun 2026 04:05:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781841913; 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=SQ3m4EGQ9Z43wIVTQRsOjA/0mLCIFMML9sQPcU39wdc=; b=ipiM65gP4pEMgOMsQ4kua18oLcTvgJNqm+e0SmFG6vHWryVXWmUS0gg3Qj7X5dgV7AzHr6 GQQcWWkZQ3cVjqvWZOW4aTYGgTCLZGhb9q2jnbvFOmBC3KB4YCjUkvh7qom3jxS3tkfRbl Onqg3/OrmGdp6A2mFjeJ7MlNtjpfJVKZkMUM5Ovp97pNIgdO4DrjV/6DPW4iZg3nMeWAaQ xCQFhKuroekY+1KcYm2sTFiXI6PcZzxNpXSb2HiYlkt2DdpRTMTZTsFmbzdFlpbu0BFn2C mZNdmwT3teViUSYGK19HghCOFHGikR1ZLPbG+dZMone78mumMGR2kxLdyVCYVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781841913; a=rsa-sha256; cv=none; b=fWgnDu+GYrS1NodKDmIOvDtmhv0c5XkozG8EQ1ftN5Ua7jCHjTUmyuSRRY1yxFuff8+Hjs l3djaHnqI/8z52TygIAJp3HGW20RtEGUddg88FctHl7B3lFZPUED168N+kTi8uyROnpLaF dY0KjRq5Qnl12OFJ14sseXIH5h2LEAcx1EIY2sCzt1mebrVMFeSkoCYL96TcqooNh7jL7i 9siSpL9JDLm+I4S/ywIHg8v9SvN14L6Zh16URtQA2FJi6J26x3tbf5jKHWLLG6SvhpkgEu x9TQ6CR9P0q9pUgovdqph21Z3+Iv52dtXWt7iIX0hX+ku18C9ym/7NUHkfvhiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781841913; 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=SQ3m4EGQ9Z43wIVTQRsOjA/0mLCIFMML9sQPcU39wdc=; b=HcRk17iv7Vu7AQb5oYGIWrVflyxnxfjji96gCP3aIE60TMMYiywLhnI7HdFEFHE36xiSHL NGH0hqWR3gYssRRK1dMQwONV92w9Xh/Ana03VPbgQ1XXfvHLhzJqFZojQTMlgX6NtHKngP Ol9VRd+RtUm5ie9B8XOXrxvTycAKgs2J1lb8rn+9EM0cYBwExhFAV6nyhFN1DaW57GDHlH jQbJLYYQkPMOU6kkVSH/EnL2ssQt2kcCwAA6S3ljwfyhODW4YWe/QAhq4cxjPCFP+1LlFc wgJ8vd+PaU9SkhBejuiWyoNJU76yFipwGck1IBJPw4Qe3tZq/n1q6Z2GcHUUbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghPBd28BXzDC2 for ; Fri, 19 Jun 2026 04:05:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1a2a8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 04:05:13 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 59bd4840df03 - main - linux: implement SO_PASSRIGHTS 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 59bd4840df037a6898b4e9d917a530bce113f053 Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 04:05:13 +0000 Message-Id: <6a34bff9.1a2a8.59bfe20@gitrepo.freebsd.org> The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=59bd4840df037a6898b4e9d917a530bce113f053 commit 59bd4840df037a6898b4e9d917a530bce113f053 Author: Kyle Evans AuthorDate: 2026-06-19 04:03:30 +0000 Commit: Kyle Evans CommitDate: 2026-06-19 04:03:30 +0000 linux: implement SO_PASSRIGHTS We have a native version now, plumb it through to the Linuxolator. Reviewed by: glebius, markj Differential Revision: https://reviews.freebsd.org/D57427 --- sys/compat/linux/linux_socket.c | 2 ++ sys/compat/linux/linux_socket.h | 1 + 2 files changed, 3 insertions(+) diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 7b579958158a..9c94079e0e0f 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -569,6 +569,8 @@ linux_to_bsd_so_sockopt(int opt) return (SO_PROTOCOL); case LINUX_SO_DOMAIN: return (SO_DOMAIN); + case LINUX_SO_PASSRIGHTS: + return (SO_PASSRIGHTS); } return (-1); } diff --git a/sys/compat/linux/linux_socket.h b/sys/compat/linux/linux_socket.h index 47fc140259c5..0428a52ce7ea 100644 --- a/sys/compat/linux/linux_socket.h +++ b/sys/compat/linux/linux_socket.h @@ -195,6 +195,7 @@ int linux_accept(struct thread *td, struct linux_accept_args *args); #define LINUX_SO_PROTOCOL 38 #define LINUX_SO_DOMAIN 39 #define LINUX_SO_PEERGROUPS 59 +#define LINUX_SO_PASSRIGHTS 83 /* Socket-level control message types */ From nobody Fri Jun 19 04:05:14 2026 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 4ghPBg1Gs2z6hPm8 for ; Fri, 19 Jun 2026 04:05: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghPBf3qszz3XHs for ; Fri, 19 Jun 2026 04:05:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781841914; 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=4d+kojDTVljzsH7pqUjwRSQRRzyjXil3dIEK05K9bG8=; b=ON7s7UwRtbCT4ZeJsrID2d3SkLUWFmigKtgPVB9pS4+WhikGbY8I7nx8SpymILWheqNDW1 WJf4dzqUB5M1yHIXY+Xa9KhyWgSXVZ+YqUWJeO//Nw5MCiqmRnCtCQcB6LHxjMmp1MLsOY mz695gejZyGIGeKTTqFMdFdbNnxZtegsuyKXozn3gAlVy0HRY/eux9F5eN5R8wANzobKjg emzITr+syRuU6CtilXKRWEt/Tdwlw3igquAIvnXoqA1Vf05pYX8D++dvmWtSpK39QykwJA 28pbMKBRZ5Yr/zeP6RrENgtCDuAtkvREDXd7DmIfvg1Fd1dbldXQ5iaOdtlAYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781841914; a=rsa-sha256; cv=none; b=Hv+Vam9R8nmWabC+pn+dMPtGgAL5kx7R3Ds/9JzhAqM2Nf6Fg4XdilMZ1wRVZrTCSg/153 VP4XBsU0fRtK8powHn4mvW/tA5j0z0FmaH7SI0iPea0hiESmGmmQXLo4eSaWW/6oXJUJAE 5Jn89AXUeytL9csLPRV6f8n8WmVM71Wd0O9Iu9ShxLeUHvmi2Cuyd1yGLkCFw+V2XfGdfm Qch3UEX1PtxTpY+mXewkIDMNaowGAQRehW7QBhr+DeRacywbam8PsBAqjV0Pf7UNG3055M JtIYWMYmv+4yLA1+jK9h3pz78DAVKF26VptONhMwkZ5krKiFECKv0Y49QloAlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781841914; 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=4d+kojDTVljzsH7pqUjwRSQRRzyjXil3dIEK05K9bG8=; b=OszvX0h4Yi+JH8LmREkY0KnQtuaiyaF3tGmgqsitbApStU6hKhR4AeAqxqO4u9Mq7aWacS 6+xsaIfPHit+SyfBGW6LfE5W52imnGcN1wN6tI6ZzpH3jnsS6jxOjL4a5h2dxOZMn7N7uP qQfIToPAKmmxm2VFsMMZXGdk8VlXP6LkniOnrFe6fV4Iaol1GDT77zFwlLeV0cOD39bP/b qyDlkggjxN/xETqliAruuisoULQ3bKYpVMlALgKq59umLaIhM56b0YGmYOFSjWPL5QQanX XN8kchIyUFewnBUJhLynvXB66ID9YKb4XmSf//IZNsI0CH1g7MtDpYVGnvYfUQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghPBf2jN3zD0w for ; Fri, 19 Jun 2026 04:05:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1a398 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 04:05:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 8a3d28375450 - main - socket: remove tautological condition in so_unsplice() 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 8a3d28375450946e4b0de239c9239df54c22d298 Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 04:05:14 +0000 Message-Id: <6a34bffa.1a398.3a01a240@gitrepo.freebsd.org> The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8a3d28375450946e4b0de239c9239df54c22d298 commit 8a3d28375450946e4b0de239c9239df54c22d298 Author: Kyle Evans AuthorDate: 2026-06-19 04:03:30 +0000 Commit: Kyle Evans CommitDate: 2026-06-19 04:03:30 +0000 socket: remove tautological condition in so_unsplice() so2rele was introduced in 1000cc4a0d3 and it was necessary there, but the cleanup in a837d1fe49e0255 rendered it redundant if our own KASSERT is to be believed: we've asserted that `so2->so_splice_back == sp` and `sp` has been dereferenced above, so there's no condition left where we shouldn't release the socket reference at the end. Indeed, the change in so_splice() to NULL out sp->dst removes that possible state of a partially constructed splice: if sp->dst is set, it has been ref'd. Reviewed by: gallatin, markj Differential Revision: https://reviews.freebsd.org/D57558 --- sys/kern/uipc_socket.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index c7a7fdd44aa0..82a8ce8feb8c 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1805,7 +1805,7 @@ so_unsplice(struct socket *so, bool timeout) { struct socket *so2; struct so_splice *sp; - bool drain, so2rele; + bool drain; /* * First unset SB_SPLICED and hide the splice structure so that @@ -1850,7 +1850,6 @@ so_unsplice(struct socket *so, bool timeout) KASSERT(so2->so_splice_back == sp, ("%s: so_splice_back != sp", __func__)); so2->so_snd.sb_flags &= ~SB_SPLICED; - so2rele = so2->so_splice_back != NULL; so2->so_splice_back = NULL; SOCK_SENDBUF_UNLOCK(so2); SOCK_UNLOCK(so2); @@ -1896,8 +1895,7 @@ so_unsplice(struct socket *so, bool timeout) sorele(so); if (so2 != NULL) { sowwakeup(so2); - if (so2rele) - sorele(so2); + sorele(so2); } CURVNET_RESTORE(); so_splice_free(sp); From nobody Fri Jun 19 07:27:06 2026 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 4ghTgb1s9Bz6hkmf for ; Fri, 19 Jun 2026 07:27: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghTgb1Rg7z44Xj for ; Fri, 19 Jun 2026 07:27:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781854027; 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=RlKpbUam4VySz0OiV0azQR33BL4uEMACHTdMSQsDtkk=; b=D8tmvJ6RQ3JSWbdaJ+whqr0wnQGHQm1FqhnWUZvcyP3WKvjd2+2Hes5fsYqOdr1qe+luYU o8Mr/gTbrn3Khp8tdzWKcJ8mNqNYpyIwHVCmMVrbLuFndhNOVsb01oVIjMt9lXzbYqhXZN nkVYLunhOgSXxLyqZAVnq1oHl5QElH76rPIRhgThp4wzEBPCZvJG2ECTEB52Ea7YPVMMfV sV3h+EIX6w8KrHC+HedukJAhAqbzZ6ehu6kdbY6gGFGg5F5GZVnEj3SkMwFOVJQuO530Jd ETUK9HlPlSIXXb2R0VdNHsBhhQrEDr6maYs3GiDXkz8U04h0DodDnGVvRFgijg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781854027; a=rsa-sha256; cv=none; b=vfAZEjjH2NXW1PfwSDzsIuJb/QlO0tUqxNwAR/3VOLad7AC8vrawe6Is6yqO/G3xGE8rAY aGdXvAAKD6btn3MryzW1U5FdeqOUAhRJwaV9IxVi6ENf/zV468/EJwa84WST+euGJwxBu0 J46UrfVOBE7lyoq9wCSBHwcgwJtt8qGbeo7VZRzP2m3QkBq/SWe4CeGGX3FuZfEeDW2mmd EVhravsjAwPrg5n+v7owle7B1GI7uHN4h8OLrcgdVm9HeWE0Rrm7RV5OQZb5DtUqTAKbX2 pmED2BNFyQQ/y56eX79OGd+YGSwBmJbptkYvGl8CbM6qRgZZKlffajrlvhixcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781854027; 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=RlKpbUam4VySz0OiV0azQR33BL4uEMACHTdMSQsDtkk=; b=TCM0Q/y1kkgHcZxokuC0pyg2QqYg7S2tsTUxRHmnQ6Tjv4hW3VO0mzSfs0C7w2RGPX6Z1F 626MkAbuM4/W2r2u+My+gKN3zuvlwANDSZobTFOScf9Yq+by9MFALHJ5u03Li4GB4A2W2F IXq39EOFb4i0xbjNzm1MH/BeI+JbDlotJgF7IaSGQ+V2Jfil5e1/ibS1yQeVG+MXV05S0U TC5C2JLH5mASK2i5uLOsIcWbq9KS0PAsnzRGX2zlPlLRiyjNf3+aABrtRQ70ByX0WWUgC+ dYLGIWEPjakG47qOXktDrkfdYOAVLgl4J2m3/OvuIrShpARBGjoP2fPUu+dGVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghTgZ6r1czbpl for ; Fri, 19 Jun 2026 07:27:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38ed7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 07:27:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 4593470d1671 - main - ldns: Update to 1.9.1 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4593470d16714d83ac06a3ccc319f998a02ced07 Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 07:27:06 +0000 Message-Id: <6a34ef4a.38ed7.6dfd0bd3@gitrepo.freebsd.org> The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=4593470d16714d83ac06a3ccc319f998a02ced07 commit 4593470d16714d83ac06a3ccc319f998a02ced07 Merge: 8a3d28375450 026e5b88eb0c Author: Dag-Erling Smørgrav AuthorDate: 2026-06-19 07:24:23 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-06-19 07:25:42 +0000 ldns: Update to 1.9.1 Merge commit '026e5b88eb0cde54d9fc22b9a1ebc79ea0f67aec' contrib/ldns/Changelog | 4 ++++ contrib/ldns/config.guess | 17 +++++++++++------ contrib/ldns/config.sub | 11 ++++++----- contrib/ldns/configure | 28 +++++++++++++++------------- contrib/ldns/configure.ac | 10 ++++++---- contrib/ldns/ldns/config.h | 4 ++-- contrib/ldns/ldns/util.h | 4 ++-- 7 files changed, 46 insertions(+), 32 deletions(-) diff --cc contrib/ldns/configure index b731de6c2933,000000000000..7671ed9d2671 mode 100755,000000..100755 --- a/contrib/ldns/configure +++ b/contrib/ldns/configure @@@ -1,22164 -1,0 +1,22166 @@@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. - # Generated by GNU Autoconf 2.71 for ldns 1.9.0. ++# Generated by GNU Autoconf 2.71 for ldns 1.9.1. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else \$as_nop + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : + +else \$as_nop + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null +then : + as_have_required=yes +else $as_nop + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : + +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$as_shell as_have_required=yes + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : + break 2 +fi +fi + done;; + esac + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi + + + if test "x$CONFIG_SHELL" != x +then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + else + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and +$0: dns-team@nlnetlabs.nl about your system, including any +$0: error possibly output before this message. Then install +$0: a modern shell, or manually run the script under such a +$0: shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='ldns' +PACKAGE_TARNAME='libdns' - PACKAGE_VERSION='1.9.0' - PACKAGE_STRING='ldns 1.9.0' ++PACKAGE_VERSION='1.9.1' ++PACKAGE_STRING='ldns 1.9.1' +PACKAGE_BUGREPORT='dns-team@nlnetlabs.nl' +PACKAGE_URL='' + +ac_unique_file="packet.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_STDIO_H +# include +#endif +#ifdef HAVE_STDLIB_H +# include +#endif +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_c_list= +ac_func_c_list= +ac_subst_vars='LTLIBOBJS +CONFIG_FILES +ldns_build_config_have_attr_unused +ldns_build_config_have_attr_format +ldns_build_config_have_ssl +DEFAULT_CAPATH +DEFAULT_CAFILE +LDNS_TRUST_ANCHOR_FILE +WINDRES +ldns_build_config_have_b32_pton +ldns_build_config_have_b32_ntop +LIBOBJS +ldns_build_config_have_socklen_t +LIBPCAP_LIBS +include_unistd_h +include_systypes_h +include_inttypes_h +ldns_build_config_have_inttypes_h +include_sys_socket_h +LIBSSL_SSL_LIBS +LIBSSL_LIBS +LIBSSL_LDFLAGS +LIBSSL_CPPFLAGS +ldns_build_config_use_dane_ta_usage +ldns_build_config_use_dane_verify +ldns_build_config_use_dane +ldns_build_config_use_ed448 +ldns_build_config_use_ed25519 +ldns_build_config_use_dsa +RUNTIME_PATH +HAVE_SSL +libtool +CLEAN_P5_DNS_LDNS +UNINSTALL_P5_DNS_LDNS +INSTALL_P5_DNS_LDNS +TEST_P5_DNS_LDNS +P5_DNS_LDNS +PERL +PYLDNSXUNINST +PYLDNSXINST +PYLDNSUNINST +PYLDNSINST +PYLDNSX +PYTHON_X_CFLAGS +swig +PYLDNS +SWIG_LIB +SWIG +SWIGPY3 +PYTHON_EXTRA_LDFLAGS +PYTHON_EXTRA_LIBS +PYTHON_PLATFORM_SITE_PKG +PYTHON_SITE_PKG +PYTHON_LIBS +PYTHON_CPPFLAGS +PYTHON +PYTHON_VERSION +UNINSTALL_CONFIG_MANPAGE +UNINSTALL_CONFIG +INSTALL_CONFIG_MANPAGE +INSTALL_CONFIG +LINT_EXAMPLES +CLEAN_EXAMPLES +UNINSTALL_EXAMPLES +INSTALL_EXAMPLES +EXAMPLES +LINT_DRILL +CLEAN_DRILL +UNINSTALL_DRILL +INSTALL_DRILL +DRILL +doxygen +LINTFLAGS +SET_MAKE +DEPFLAG +LT_SYS_LIBRARY_PATH +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +AWK +RANLIB +STRIP +ac_ct_AR +AR +DLLTOOL +OBJDUMP +FILECMD +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBTOOL +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +VERSION_INFO +LDNS_VERSION_MICRO +LDNS_VERSION_MINOR +LDNS_VERSION_MAJOR +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_shared +enable_static +with_pic +enable_fast_install +with_aix_soname +with_gnu_ld +with_sysroot +enable_libtool_lock +with_drill +with_examples +enable_ldns_config +enable_stderr_msgs +enable_poll +with_pyldns +with_pyldnsx +with_p5_dns_ldns +with_ssl +enable_sha2 +enable_gost +enable_gost_anyway +enable_ecdsa +enable_dsa +enable_ed25519 +enable_ed448 +enable_dane +enable_dane_verify +enable_dane_ta_usage +enable_full_dane +enable_no_dane_ta_usage +enable_no_dane_verify +enable_draft_rrtypes +enable_rrtype_ninfo +enable_rrtype_rkey +enable_rrtype_openpgpkey +enable_rrtype_ta +enable_rrtype_avc +enable_rrtype_doa +enable_rrtype_amtrelay +enable_rrtype_svcb_https +enable_rrtype_resinfo +enable_rrtype_dsync +enable_rrtypes_cla_ipn +enable_rrtypes_hhit_brid +enable_rpath +with_xcode_sdk +with_trust_anchor +with_ca_file +with_ca_path +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +LT_SYS_LIBRARY_PATH +PYTHON_VERSION' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; *** 22453 LINES SKIPPED *** From nobody Fri Jun 19 07:27:08 2026 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 4ghTgd5lXZz6hkmn for ; Fri, 19 Jun 2026 07:27: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghTgd52M0z44YD for ; Fri, 19 Jun 2026 07:27:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781854029; 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=R87wysZX7/byQ1d1whIMCnAlhRpA1P4/MCV+KFJO4R0=; b=K+msKLycCC2j8DuIjR7wreHgz5ZztbcrC9Zn8RK4WEZSZBoTvqNfJQ+X7yRjW0DINYDSzH ooJWuftknc+FIIcY1AYULw5NTowTiepDF4L4YUSiNlwY0GHmVmaEzUcpfAALF0+TkrxrAQ tIzx5pc+OpkPR8VaKX/eeg8RycyTehREopL48ZfCZMH/N71wh+re54kVQEa3le5iESpSQ8 uWYRem/+Y9OPssw2kdeffL/3WFX3kuj9CkorARthI5dHHNuL4qwZVZlM7SQiemcp1tH031 9m1C9Vr6fmXmHEzGyYivzw0QXMf974NltQVPZOGYtO66ltdvz9uC2fyMfi+SxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781854029; a=rsa-sha256; cv=none; b=D8d8ovJHEo2bwVuFSUm4czRQ92x8Hy529oKKkTaOSELBxeL+d2e2dCsHrdZeZxUaeXhLuK GcKpAVNM+dzpEevK1N9QdGZ+89bUk5IQFHInUuhvVJqsrwIpL0sXx02nMA9DYMbKWvT36s kLtUp2K64L+pncAWFF8YGu+eH6bzMNNoLt3Tcnc5reFqVuzE3Y8rh1Tjs+EE0Y66VNWEhg 71sARNlIQUCYHuJhykgqor6bSMFo9EPIQBx6YyVXpu2HPk+tuX2zFHoLBSA0FKP4SiMvxm iWaM078VY9UR9SZsDNaRbGVxp+gx2Plk76kliSQHVr9wuDXPoZGiPg7Eoypwzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781854029; 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=R87wysZX7/byQ1d1whIMCnAlhRpA1P4/MCV+KFJO4R0=; b=BccITuxQCHKpgIG5+Bd6BJqGpYMkP+XEpqipMK3C7gYsADAl+GBoUFF5hlhvKfsFfvCeQu sDgWR6+v0DhgKg4sxpQRnCplk/U3XbY8A4iSXEsQNLjaSx4KzxhM9PFhifTrga40/QctqF B5SiOE35Wp5FWUxRdtZrrLTLa1csVCFsVyae/1uq4XsXMapN3SGpQe1H8zGnNR2qTr/R/+ Kp9E98p1ecNRPwPpwPMW2Pid2HQ+yJ2FjqsKrhIGIG5Dos2s21qhAkzW6cUgecExlk0wNE fXpXf/ngkS4JqePU3Ugiwl9Rn+StHIQUTRheGo+SWP3wOGZNAvcLAaYiZwtBng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghTgc4jvBzbGN for ; Fri, 19 Jun 2026 07:27:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 37f31 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 07:27:08 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 63442ceae5ed - main - lsnd: Update to 1.9.2 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 63442ceae5ed31ad45e401f5fe0010b824bc2b38 Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 07:27:08 +0000 Message-Id: <6a34ef4c.37f31.563d8dee@gitrepo.freebsd.org> The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=63442ceae5ed31ad45e401f5fe0010b824bc2b38 commit 63442ceae5ed31ad45e401f5fe0010b824bc2b38 Merge: 4593470d1671 3750aed65c1f Author: Dag-Erling Smørgrav AuthorDate: 2026-06-19 07:26:20 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-06-19 07:26:20 +0000 lsnd: Update to 1.9.2 Merge commit '3750aed65c1f5a610b44d29c92236ca119b62780' contrib/ldns/Changelog | 4 ++++ contrib/ldns/configure | 25 +++++++++++++------------ contrib/ldns/configure.ac | 7 ++++--- contrib/ldns/ldns/config.h | 4 ++-- contrib/ldns/ldns/util.h | 4 ++-- 5 files changed, 25 insertions(+), 19 deletions(-) diff --cc contrib/ldns/configure index 7671ed9d2671,000000000000..0667649dca8f mode 100755,000000..100755 --- a/contrib/ldns/configure +++ b/contrib/ldns/configure @@@ -1,22166 -1,0 +1,22167 @@@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. - # Generated by GNU Autoconf 2.71 for ldns 1.9.1. ++# Generated by GNU Autoconf 2.71 for ldns 1.9.2. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else \$as_nop + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : + +else \$as_nop + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null +then : + as_have_required=yes +else $as_nop + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : + +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$as_shell as_have_required=yes + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : + break 2 +fi +fi + done;; + esac + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi + + + if test "x$CONFIG_SHELL" != x +then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + else + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and +$0: dns-team@nlnetlabs.nl about your system, including any +$0: error possibly output before this message. Then install +$0: a modern shell, or manually run the script under such a +$0: shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='ldns' +PACKAGE_TARNAME='libdns' - PACKAGE_VERSION='1.9.1' - PACKAGE_STRING='ldns 1.9.1' ++PACKAGE_VERSION='1.9.2' ++PACKAGE_STRING='ldns 1.9.2' +PACKAGE_BUGREPORT='dns-team@nlnetlabs.nl' +PACKAGE_URL='' + +ac_unique_file="packet.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_STDIO_H +# include +#endif +#ifdef HAVE_STDLIB_H +# include +#endif +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_c_list= +ac_func_c_list= +ac_subst_vars='LTLIBOBJS +CONFIG_FILES +ldns_build_config_have_attr_unused +ldns_build_config_have_attr_format +ldns_build_config_have_ssl +DEFAULT_CAPATH +DEFAULT_CAFILE +LDNS_TRUST_ANCHOR_FILE +WINDRES +ldns_build_config_have_b32_pton +ldns_build_config_have_b32_ntop +LIBOBJS +ldns_build_config_have_socklen_t +LIBPCAP_LIBS +include_unistd_h +include_systypes_h +include_inttypes_h +ldns_build_config_have_inttypes_h +include_sys_socket_h +LIBSSL_SSL_LIBS +LIBSSL_LIBS +LIBSSL_LDFLAGS +LIBSSL_CPPFLAGS +ldns_build_config_use_dane_ta_usage +ldns_build_config_use_dane_verify +ldns_build_config_use_dane +ldns_build_config_use_ed448 +ldns_build_config_use_ed25519 +ldns_build_config_use_dsa +RUNTIME_PATH +HAVE_SSL +libtool +CLEAN_P5_DNS_LDNS +UNINSTALL_P5_DNS_LDNS +INSTALL_P5_DNS_LDNS +TEST_P5_DNS_LDNS +P5_DNS_LDNS +PERL +PYLDNSXUNINST +PYLDNSXINST +PYLDNSUNINST +PYLDNSINST +PYLDNSX +PYTHON_X_CFLAGS +swig +PYLDNS +SWIG_LIB +SWIG +SWIGPY3 +PYTHON_EXTRA_LDFLAGS +PYTHON_EXTRA_LIBS +PYTHON_PLATFORM_SITE_PKG +PYTHON_SITE_PKG +PYTHON_LIBS +PYTHON_CPPFLAGS +PYTHON +PYTHON_VERSION +UNINSTALL_CONFIG_MANPAGE +UNINSTALL_CONFIG +INSTALL_CONFIG_MANPAGE +INSTALL_CONFIG +LINT_EXAMPLES +CLEAN_EXAMPLES +UNINSTALL_EXAMPLES +INSTALL_EXAMPLES +EXAMPLES +LINT_DRILL +CLEAN_DRILL +UNINSTALL_DRILL +INSTALL_DRILL +DRILL +doxygen +LINTFLAGS +SET_MAKE +DEPFLAG +LT_SYS_LIBRARY_PATH +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +AWK +RANLIB +STRIP +ac_ct_AR +AR +DLLTOOL +OBJDUMP +FILECMD +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBTOOL +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +VERSION_INFO +LDNS_VERSION_MICRO +LDNS_VERSION_MINOR +LDNS_VERSION_MAJOR +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_shared +enable_static +with_pic +enable_fast_install +with_aix_soname +with_gnu_ld +with_sysroot +enable_libtool_lock +with_drill +with_examples +enable_ldns_config +enable_stderr_msgs +enable_poll +with_pyldns +with_pyldnsx +with_p5_dns_ldns +with_ssl +enable_sha2 +enable_gost +enable_gost_anyway +enable_ecdsa +enable_dsa +enable_ed25519 +enable_ed448 +enable_dane +enable_dane_verify +enable_dane_ta_usage +enable_full_dane +enable_no_dane_ta_usage +enable_no_dane_verify +enable_draft_rrtypes +enable_rrtype_ninfo +enable_rrtype_rkey +enable_rrtype_openpgpkey +enable_rrtype_ta +enable_rrtype_avc +enable_rrtype_doa +enable_rrtype_amtrelay +enable_rrtype_svcb_https +enable_rrtype_resinfo +enable_rrtype_dsync +enable_rrtypes_cla_ipn +enable_rrtypes_hhit_brid +enable_rpath +with_xcode_sdk +with_trust_anchor +with_ca_file +with_ca_path +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +LT_SYS_LIBRARY_PATH +PYTHON_VERSION' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; *** 22451 LINES SKIPPED *** From nobody Fri Jun 19 07:28:36 2026 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 4ghTjL33Brz6hkVg; Fri, 19 Jun 2026 07:28:38 +0000 (UTC) (envelope-from des@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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghTjL2JXVz45DN; Fri, 19 Jun 2026 07:28:38 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781854118; 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=RB944AC14pKjP/f1Ynm6nBUJZY2TcE2d1hDqxl9H6Ws=; b=wfvdnxWsHk30d4kgCyj9sm0VxCIA8jNpE9IHaCQmI+S9cHgo8WwZVaGz22DcrVIIu3VSA0 HchL/WeLBEvNrYvfOFFtj1eYxb7TQpUfOJ3jtcAm27gXzOGhi4hOZYJpBStYhGwUo0a/RP pLMH9c9buppqgxDuSQFkah0o8mcUPgxchrrU3+ghGhrWHc8mjdpAbyHqD/rRY3j09fq2h1 eGZx3Lkc5DLJXCttxxnp/OfLe8gQAwFOFNy29CkbMb0oU7nFnJN92/lAgSWNU4/+A4UIRA aPnD4Ur6A55OMtQF1cPIFQKmZpMm0zeUlRstMvCzXqicmiWB9lVWMOYuU5hByw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781854118; a=rsa-sha256; cv=none; b=LWNv4EpuatCIg39L2Z1N/p+Uvoh71g3+meT/93Z8RsnbhlBxH5cQWl0fxWsoN0VW/JO2/9 b0BjX1PYt+yBeIcrWYhfvBhsNTHFBlsRGDGsFeOR96fOg2bpCdG2kpHYorQXOW1wVq5+DE jk4ZEWUVEFk6tAphdrd4ZwvsP7bs4Ssdojy2tMzwhyxKoXVkAT5j3fvvdMTqRRIwqD195a tilGgvMWyk+l3fs5QueAFCs4vTXdsmwEJNiIn4ed7VlpQkUrP4Vo+05m5KpRHddTp+XVXk mEeLFVtRjbeY1UpPaSI84H8l/qZdV9DVchoN1i/OADwgB0qXLCBruDaTmvYqow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781854118; 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=RB944AC14pKjP/f1Ynm6nBUJZY2TcE2d1hDqxl9H6Ws=; b=JOCeOpl/CZ1ueBwdzKNWwaaAKbxSbddq2bzD3yfbNc0DfVxojNi/sVOLGTMtwbyrMMJdov y+ClCJQspPF6hJhuBrjVUfql1180kFxDQmtZEQI9yupBubhA2RsTZ7Bxn4kcCNSK1SppmZ wOAlZn2hyjsowyteBfl0elXBB2ZhdH/ffaL0jPvyZT7xK/NpDEoXXYww5d1krMBNDQuuy8 SoaSc1UXXZ4iDnntYSannGboPgiTFKgMyF2V8ZVlZDDT75ZLgwAgl5gsKsHk3voRsiJMV1 MyWrRmE7MIQXIQ284Rpi1BSE3eJmHK5B3IuQn9CM00yxDCRUUryX6GxpuPAdyw== Received: from ltc.des.dev (unknown [92.183.55.143]) (using TLSv1.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: des/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4ghTjK6zSzzk8p; Fri, 19 Jun 2026 07:28:37 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id 9B65E5040A; Fri, 19 Jun 2026 09:28:36 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: src-committers@FreeBSD.org Cc: dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 63442ceae5ed - main - lsnd: Update to 1.9.2 In-Reply-To: <6a34ef4c.37f31.563d8dee@gitrepo.freebsd.org> ("Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav=22's?= message of "Fri, 19 Jun 2026 07:27:08 +0000") References: <6a34ef4c.37f31.563d8dee@gitrepo.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Fri, 19 Jun 2026 09:28:36 +0200 Message-ID: <86tsqzugyj.fsf@ltc.des.dev> 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Dag-Erling Sm=C3=B8rgrav writes: > lsnd: Update to 1.9.2 >=20=20=20=20=20 > Merge commit '3750aed65c1f5a610b44d29c92236ca119b62780' I am terribly embarrassed by this typo. Unless you find it funny, in which case you're welcome. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Fri Jun 19 07:32:17 2026 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 4ghTnb12HQz6hl6W; Fri, 19 Jun 2026 07:32:19 +0000 (UTC) (envelope-from des@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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghTnb02qZz46sF; Fri, 19 Jun 2026 07:32:19 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781854339; 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=NW/tBD7hY6KnHvTnWt6LCMfUgwdSPJTAdn7lmO7VScI=; b=k97a2DlNO02kZtV28B2p5rR8BI0GneOWbaqOBLFov47vjtfLFVRm7p076TjP9i3tljgJgl lsCbm9k70n44HOsVLB2gKjbWq1mZeE9JX/X3XsnJn+9tzUFkXjgZEpTTYAw7UVDOlFSoYT Mv5ZMsBx3JRxqbfIAs18AfjCSTl7FOVGpLZ2ViuUnm5QOxMZK7nFi9lzFmHZS6zn+A1fwN JJKUnMUBN+Z4H7LGyQdtd0zMHPWRruMlTWaXf6I2angRQ+ppgjiu+zyv+dNqXhHDlE+biN Ed6Vk8oE9xGbe4utZXu8hXKwDeGPMU+W+9JgKcM5OoVhBvtP8jQP3YDUI1yXdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781854339; a=rsa-sha256; cv=none; b=PZjvaHQyPyDk4L8tlnq6lsyf3KqYffSdx61teJB0Gsa9tqqdN4jqsI8WDnS4evTPY9Rm7M 4S8wR64gwYZYKuopJifZPgY1/anAn2hHlit6rf1VDS95C4Zz0qd4bwgbio+EUBtSqkNEGK vNJhq2WSR85Dy9S/UMYuFC25COQP9gr8sXVpIq2lzdqB3MnY20+ualTxHzN8hkP9f7U38+ OtoslcC+ctJCwb/eQE92eXHd8s8V9Mo22jWu9IfWBRZsM2RKJedell5OK0BIr+NkcqXcPE jbdAR5SDGIV8iYquDJhbC9TQyJiclcNSDaoqVC5T1PgKKB/TmgpDhB3mUgmFLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781854339; 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=NW/tBD7hY6KnHvTnWt6LCMfUgwdSPJTAdn7lmO7VScI=; b=BpCxr7EAdwG7E+kFeVmGMPB/8saTZqXVY35S0qWDUJTRQqiBHofZNEtS4k/QDANDZntFFI GFCEMtEDJABoqWNP/hqHSEVSvj4fxV+8oyQx76S/rqUX/Nd5kKxrZQj+SmtRiu8kV3Gs4P Dq/6HAN1nqfKk/vJX2kSuhH9r8eRAc6NPqjKMEj6y0kkAs8/oEqg29/a9AVhNTrnYcJC6I MTnBXQIQnr5N4GHNLSYH5N0XC4J2supXKDeLl81fuJsZRaBX/RSJztMi+iZiGqjKtQ3qBR 8Gxp70B5LkxbJzPIYyeSAZekp9br+nzNursDU0ujsPpjPWhyJJjah0skzGwqBQ== Received: from ltc.des.dev (unknown [92.183.55.143]) (using TLSv1.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: des/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4ghTnZ5CGfzZKM; Fri, 19 Jun 2026 07:32:18 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id 4564050508; Fri, 19 Jun 2026 09:32:17 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: src-committers@FreeBSD.org Cc: dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 63442ceae5ed - main - lsnd: Update to 1.9.2 In-Reply-To: <86tsqzugyj.fsf@ltc.des.dev> ("Dag-Erling =?utf-8?Q?Sm=C3=B8r?= =?utf-8?Q?grav=22's?= message of "Fri, 19 Jun 2026 09:28:36 +0200") References: <6a34ef4c.37f31.563d8dee@gitrepo.freebsd.org> <86tsqzugyj.fsf@ltc.des.dev> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Fri, 19 Jun 2026 09:32:17 +0200 Message-ID: <86pl1nugse.fsf@ltc.des.dev> 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Dag-Erling Sm=C3=B8rgrav writes: > I am terribly embarrassed by this typo. Unless you find it funny, in > which case you're welcome. I should also have added that both updates (to 1.9.1 and 1.9.2) were nops because the code changes from 1.9.1 were already present in our tree and 1.9.2 had no code changes, so they only serve to reduce the diff to upstream. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Fri Jun 19 12:03:40 2026 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 4ghbpj1Dtcz6jBH6 for ; Fri, 19 Jun 2026 12:03:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghbph5sJJz3l2F for ; Fri, 19 Jun 2026 12:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781870620; 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=JxMgaEwjBOoT5zPcX56O72GeedlNOyyXCMygwlyEHas=; b=WcJqQgfoCuUguJx4u+Nq2bZRRt+0Qpfdwb//eXL+xiIH2E8Fn2xPINoHEqEnQ1NhUv6Rhb kyqlyOHNMV6Cxuy8BJrJAKZPx5rngUDPzpU65XzbYmo4yNeqyxeTJQa9MweJJKD62SCaBq 6twTlIiWNY0Wxe4Y0VKWgNL8o1vXyFxSXjF3963LYZ3FDJqiJajTX9fZ0fQLcrBzLjSmbs f6rLb915Er6DbgquNx5PZ4nCYSM5PC9uvzO73o8Z7xPWzh018coXIoPYVs3zPnooHUe4qn w8slQ0DF+g47GgsKihnpr8Nxn/CpVcBa5gtS0vWOMM+eWjj6vEmPEEIOmhxwLA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781870620; a=rsa-sha256; cv=none; b=jHW/GB/hfzHUnya7Xr0FO5QhqNvJQY8ZjZ0YW3JfK8b2obWN7lMmZznbwQgZp6nkKL5ARO R3wA/7J2BHtxF14YlV40SsWvgwO//3hBWf04IYxKh+V4mNLkoiB5CODUKJH8Ublz9C3TVA Z2z2jm1b4oso7Fwt+rnlH+sn6LgypeIgw42wQWF5gkWVKbdI44nC5P286acuoKbdPIW6In pjQghV7OiukAcBLI+VH31pkdq4UInKG3CQNjeyK+UfX8Gw/BFE3qMomkhA/f0aFUHM9dV5 0bPd+p+NToDuybBkbh/AVaX6b9Xhgc2Ry1AU0I2XF3V/MGPSWgTVcaq6mUUciQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781870620; 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=JxMgaEwjBOoT5zPcX56O72GeedlNOyyXCMygwlyEHas=; b=kxU7S1NQVP5hNs+RzKP4kQTWdSD6lUmrWxsn0E761yjWXcM9SFR6jz8ypsnIaAssputMft Qx+ZWhHgTpc5nTkQ5zKM63Ns4T5HRj0VpOYaEVGZKWvDDdlLQVfPpyALSzuoxQfL/+rNl4 VpAggIW0Sl7ajQG+WNcl4P11EODWXnm2EGtDohu6tDGlr1dQHk4NDtZfkx+raB0ucZXCeP b+SphVYR9f3+vUp0MbY+G2gyyJ55oU4NHjOFILaWGyYWSKSyksQ4clfoVDnCXWSlbwJQQ1 i1pWY2Rs6p97YkiELVSrCG+io/HJTYdYsfpTiyzORuAW4cPEMG6Gjc2yoQiIfw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghbph4X1NzlRw for ; Fri, 19 Jun 2026 12:03:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 253e6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 12:03:40 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 28ddd11d91f8 - main - bsnmpd/snmp_hostres: fix hrFSTable remoteMountPoint leak 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 28ddd11d91f860df9b9be485c5b0526c10b4aec1 Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 12:03:40 +0000 Message-Id: <6a35301c.253e6.fab3f87@gitrepo.freebsd.org> The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=28ddd11d91f860df9b9be485c5b0526c10b4aec1 commit 28ddd11d91f860df9b9be485c5b0526c10b4aec1 Author: Mariusz Zaborski AuthorDate: 2026-06-19 11:58:17 +0000 Commit: Mariusz Zaborski CommitDate: 2026-06-19 11:58:17 +0000 bsnmpd/snmp_hostres: fix hrFSTable remoteMountPoint leak Free the previous value before re-strdup'ing, and initialise remoteMountPoint to NULL in fs_entry_create() so the free() is safe on the newly-created path Observed via a dtrace leak snapshot on 15.0-RELEASE-p4: data leaked = 1983, count = 1683 libc.so.7`malloc+0xa8 snmp_hostres.so.6`fs_tbl_process_statfs_entry+0x276 snmp_hostres.so.6`refresh_storage_tbl+0x502 snmp_hostres.so.6`op_hrStorageTable+0x1a libbsnmp.so.7`0x2a2b1892ba3d libbsnmp.so.7`snmp_getbulk+0x37f Reviewed by: sjg, ngie Differential Revision: https://reviews.freebsd.org/D57604 --- usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c index bdc20d19a372..147522036bf9 100644 --- a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c +++ b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c @@ -205,6 +205,7 @@ fs_entry_create(const char *name) free(entry); return (NULL); } + entry->remoteMountPoint = NULL; entry->index = map->hrIndex; map->entry = entry; @@ -352,6 +353,9 @@ fs_tbl_process_statfs_entry(const struct statfs *fs_p, int32_t storage_idx) (entry = fs_entry_create(fs_p->f_mntonname)) != NULL) { entry->flags |= HR_FS_FOUND; + free(entry->remoteMountPoint); + entry->remoteMountPoint = NULL; + if (!(fs_p->f_flags & MNT_LOCAL)) { /* this is a remote mount */ entry->remoteMountPoint = strdup(fs_p->f_mntfromname); From nobody Fri Jun 19 14:06:07 2026 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 4ghfX00Dbrz6jNGn for ; Fri, 19 Jun 2026 14:06: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghfWz6RQdz40tR for ; Fri, 19 Jun 2026 14:06:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781877967; 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=WvhPh3jU8AaNV/DusaTvoWfYXHhMl5c44RduLqly02A=; b=VaqyClilJy1394UL4l0Ex2IahegaAXepbnK9hokIJ4zA7FnBFh+vp3ROLkOS/g/naOQOfP ChKQGLo9VvsBTZIzOSkpT0qWJ+CF++ZDj8UEBeA1OxB8Txa03hdwFLsTBt4My/UHMGUX+8 E4dSmxwmM0ZrwuMacEKVhzMyQpTAfwUfT5IC4rnfqDT+4hDropR+0pY+T7YXn60hH3CbF/ xYOTuj+tk+vKCBdfcnZyObhaJKKDemug61yvdlW7ybqQXFi1l3xJQiKBmokpN/YHadoZOD /Py/3I490nsb9+I6/jnbMw8UhzVZl7rqouYyxayGdEgpNBeXN2/BHFkYg5MbXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781877967; a=rsa-sha256; cv=none; b=aSEOwsXZjvoPsjyFNYWOykkPisivsUIyy/7cPgeOBJed3y5Zh/bxRzyoVmg1pfe+4keIFt JwPwrj3/TY9QgI93BW1HOMTnUyT6V9QXLNbeoqFPuw2FumRJyhQxUlbhV/2jnYS08G4Nh1 Mpse+4teE7q4Qi2hM0DhYKhHzhiEAjjuV6er09KbdKBR1IZzy6UhELZx4zfIe+Jj/p1YDA 5a1Qpm1fkqL/fC1tmBuAA933IjF4fAPiX0yNOdypWD1GC+EObchedWLSD6Qxo9AJdaW5gS KuD0Uh/j62HecTJnKzCBuJSCl43UBYn8lNWvDgaMC3+BbP1U0T7g6L+VxFOQZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781877967; 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=WvhPh3jU8AaNV/DusaTvoWfYXHhMl5c44RduLqly02A=; b=iAv3bCFResR6OgKWFUaSHuSK0NWOkODTM0OBtojEB5vtJQBpdcLc1qnonMjFHEQkloXbN6 SSYm2Zfwmzf8jTTq4IlXL+cSPF4xeeWIxMmPThT8ugymKenrHjkRYieaUhNZkK4XBNvdkF GfzlpZhWnKdClDaX22Ga9bhnKI2EpIHU8yFMoX3wj5r0U57QtEJtqaU9Ci0VvFBlgKeec8 Q2EiUU/awdsC2j1t8NOQRUzzNluzhCFxS/g5rF+r9DBXPA/Bme5B/0h9bdpF5IGvlKG6Vi 6x6KRhnZJOTgwwZS4ky1yrcoOGZdRyA1XK0/p2Je/1s1n1vHgPGmAzcMk62Klw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghfWz59xKzpSK for ; Fri, 19 Jun 2026 14:06:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3be4e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 14:06:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan Novk=?utf-8?Q?ovi=C4=87?= Subject: git: 1665954e508f - main - uart: Add support for the Intel XScale controller 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1665954e508f74588108e96c30b90d1a88807faa Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 14:06:07 +0000 Message-Id: <6a354ccf.3be4e.56c55cdd@gitrepo.freebsd.org> The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=1665954e508f74588108e96c30b90d1a88807faa commit 1665954e508f74588108e96c30b90d1a88807faa Author: Bojan Novković AuthorDate: 2026-06-18 02:03:55 +0000 Commit: Bojan Novković CommitDate: 2026-06-19 14:01:30 +0000 uart: Add support for the Intel XScale controller The ns8250 driver avoids clearing IER bit 0x10 to account for the split "receiver time-out interrupt enable" bit, but it never sets it in `ier_rxbits` even though a comment in `ns8250_init` implies so. Fix this by setting `IER_RXTMOUT` if we've matched an XScale uart. Differential Revision: https://reviews.freebsd.org/D57629 Reviewed by: imp MFC after: 2 weeks --- sys/dev/uart/uart_dev_ns8250.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c index d6940dc80005..60377c0a1e96 100644 --- a/sys/dev/uart/uart_dev_ns8250.c +++ b/sys/dev/uart/uart_dev_ns8250.c @@ -562,6 +562,7 @@ UART_ACPI_CLASS_AND_DEVICE(acpi_compat_data); static struct ofw_compat_data compat_data[] = { {"ns16550", (uintptr_t)&uart_ns8250_class}, {"ns16550a", (uintptr_t)&uart_ns8250_class}, + {"intel,xscale-uart", (uintptr_t)&uart_ns8250_class}, {NULL, (uintptr_t)NULL}, }; UART_FDT_CLASS_AND_DEVICE(compat_data); @@ -647,6 +648,12 @@ ns8250_bus_attach(struct uart_softc *sc) /* Get IER RX interrupt bits */ ivar = IER_EMSC | IER_ERLS | IER_ERXRDY; +#ifdef FDT + /* Intel XScale models won't work without IER_RXTMOUT set. */ + if (ofw_bus_is_compatible(sc->sc_dev, "intel,xscale-uart")) + ivar |= IER_RXTMOUT; +#endif + resource_int_value("uart", device_get_unit(sc->sc_dev), "ier_rxbits", &ivar); ns8250->ier_rxbits = (uint8_t)(ivar & 0xff); From nobody Fri Jun 19 14:22:26 2026 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 4ghftq2ZPDz6jPMN for ; Fri, 19 Jun 2026 14:22: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghftp3Fncz44My for ; Fri, 19 Jun 2026 14:22:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781878946; 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=RAZ/FvlRXUb/E3avuXhZgv8LePbUOVFytEnobpt47pU=; b=COHJ30vWj9Nag3hAOQqRRo6XyvzSLr8WniNBAX9pYm/P89mt2ZXLFypcMRj0PUp/9mX/sV APbguMD5TA3JVyLieM4fTFB/s+FunUHnMvHYHXLnUOEGUwq3+CxQMx9HUHMGrT52bRWa73 I9X8Lbgqjzoe2TMnCHJuniyoWXu/DF7lp8AzvHs94AwbKSw+Qt52NKFuAYlui4IOvmQtQ7 1QRKmgnT1IB+2d/hsXbu7JyF1DJmPGEpaUU9BG90iqD575V/LAwHbBETk14+mQS3dqUamN yFvIp4W/YqMan9O9kg8/FP9aso6elJea3qToXpre7+SM36VLiL1d03IPHtEthg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781878946; a=rsa-sha256; cv=none; b=vYQUSAYrjcbmWtK4EOkYDZvv03DnWwpV0iKHNt6f5uQQp0CF+lUk2Ff2P9oBTWx5jfOBUX lroZ2rTjLL2jsYc8v0eZWT2NnVYQWkwFjm6rUkDlGZmMg2MJBuvxOJsXk/HTXe84pXuYjh BmgCNqIMOj6ngUaMTWK9jbDlkSaLNNkUo+cefWwmBRof5YIGEDQdX822145Z8bk/w4dcX5 v0n+E04ng4AqgN09+icsAmV1xsIFa5AuxCY4xFgb1A/bPtMB/11X70S9A2H8NEu/N0ZE/w AS/kHd86IgYrz1EvnZUSQd89TQzPEVxRxkt14ry+5wcaHZDWDe3V/o+thV/ATw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781878946; 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=RAZ/FvlRXUb/E3avuXhZgv8LePbUOVFytEnobpt47pU=; b=hxCOHBxaS2OO/JBsLldauwD118a0CGfPIKhhKj1ypccpt3ylsPiiZ2VCGn+OCXmsKnEIwl OzPXVIyATRy7ntX0uF2EJbyFSsCvGk+V9ySvUUHk5aEMackk/32z9IoWO9kzKAhVE8FHZW CDThp4/f58DCV6Qysc4EnLWhTp0nR2W6xEjuqrZ1boIdqjBB7Ouda2Gg7exCi5OWkg8L8T CJEDVLrr475IjDs/IRwlXACSP0+bE+5k/EBZss17sNHZQsAOQdn7ofyxxwgfSbUTZG1+FH ihcpUHcwsOcbXldUy/VrSY4zVBE25NU6xo+AeizBo7LyMPnz9Vqu7Y3a77xPkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghftp1p8RzpFn for ; Fri, 19 Jun 2026 14:22:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3cea3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 14:22:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Aymeric Wibo Subject: git: dc24f31b67f5 - main - ctermid(3): Fix return values section 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: obiwac X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc24f31b67f5b0bac35cb93470f6f2d065d99f6f Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 14:22:26 +0000 Message-Id: <6a3550a2.3cea3.363b73d0@gitrepo.freebsd.org> The branch main has been updated by obiwac: URL: https://cgit.FreeBSD.org/src/commit/?id=dc24f31b67f5b0bac35cb93470f6f2d065d99f6f commit dc24f31b67f5b0bac35cb93470f6f2d065d99f6f Author: Aymeric Wibo AuthorDate: 2026-06-19 14:21:12 +0000 Commit: Aymeric Wibo CommitDate: 2026-06-19 14:21:16 +0000 ctermid(3): Fix return values section ctermid() doesn't, and has never, set errno. While here, add ctermid_r to the name section and align the parameter name in the source file. Reviewed by: bnovkov Approved by: bnovkov MFC after: 3 days Obtained from: https://github.com/apple-oss-distributions/libc Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D57396 --- lib/libc/gen/ctermid.3 | 25 +++++++++++++++---------- lib/libc/gen/ctermid.c | 14 +++++++------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/lib/libc/gen/ctermid.3 b/lib/libc/gen/ctermid.3 index 2a53412f1b29..daf59f32c157 100644 --- a/lib/libc/gen/ctermid.3 +++ b/lib/libc/gen/ctermid.3 @@ -25,11 +25,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 1, 2011 +.Dd June 2, 2026 .Dt CTERMID 3 .Os .Sh NAME -.Nm ctermid +.Nm ctermid , +.Nm ctermid_r .Nd generate terminal pathname .Sh LIBRARY .Lb libc @@ -78,14 +79,18 @@ If no suitable lookup of the controlling terminal name can be performed, this implementation returns .Ql /dev/tty . .Sh RETURN VALUES -Upon successful completion, a -.Pf non- Dv NULL -pointer is returned. -Otherwise, a -.Dv NULL -pointer is returned and the global variable -.Va errno -is set to indicate the error. +The +.Fn ctermid +function returns +.Fa buf +if it is +.Pf non- Dv NULL , +otherwise it returns the address of a static buffer. +The +.Fn ctermid_r +function always returns +.Fa buf , +even if it is the NULL pointer. .Sh ERRORS The current implementation detects no error conditions. .Sh SEE ALSO diff --git a/lib/libc/gen/ctermid.c b/lib/libc/gen/ctermid.c index fb117b3c8ded..1ca2401f0c1d 100644 --- a/lib/libc/gen/ctermid.c +++ b/lib/libc/gen/ctermid.c @@ -39,32 +39,32 @@ #define LEN_PATH_DEV (sizeof(_PATH_DEV) - 1) char * -__ssp_real(ctermid)(char *s) +__ssp_real(ctermid)(char *buf) { static char def[sizeof(_PATH_DEV) + SPECNAMELEN]; struct stat sb; size_t dlen; int sverrno; - if (s == NULL) { - s = def; + if (buf == NULL) { + buf = def; dlen = sizeof(def) - LEN_PATH_DEV; } else dlen = L_ctermid - LEN_PATH_DEV; - strcpy(s, _PATH_TTY); + strcpy(buf, _PATH_TTY); /* Attempt to perform a lookup of the actual TTY pathname. */ sverrno = errno; if (stat(_PATH_TTY, &sb) == 0 && S_ISCHR(sb.st_mode)) - (void)sysctlbyname("kern.devname", s + LEN_PATH_DEV, + (void)sysctlbyname("kern.devname", buf + LEN_PATH_DEV, &dlen, &sb.st_rdev, sizeof(sb.st_rdev)); errno = sverrno; return (s); } char * -__ssp_real(ctermid_r)(char *s) +__ssp_real(ctermid_r)(char *buf) { - return (s != NULL ? ctermid(s) : NULL); + return (buf != NULL ? ctermid(buf) : NULL); } From nobody Fri Jun 19 14:55:38 2026 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 4ghgd704JYz6jSTL for ; Fri, 19 Jun 2026 14:55: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghgd65y3Rz46VF for ; Fri, 19 Jun 2026 14:55:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781880938; 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=eBfxa2hl7kS0hScZHPP5u6rtjg6FWd+XafymCRQs6ms=; b=UZvP+tL+6sPdAqPL3HnnX3uUwmzDXKEsidQ4wsE7c3dGHa0TjAp0eNK5RXmpBWBNJva6vT 3Ac2Amz3aVLB4EJ+m3ERkkWv5+adZN+cwSo9BF+rVL1XLfK/I18yI9r6ZiAcln46X8lZpt BT/bO3lko/1zOtqHjhOlJkPOp5hBk4eEGoShHaJHsF0E2UPhB+c1Oh7MmGnm77jikZNwgf 97gx6B1nrrurt78OZxxLHDh5lDXM/CmhmAU+kzXoUh8MydlYlXB7np+rqcOwuoY8p8/ZiC QxWyqt+v+bZsOPgE330R9alpq81uvz9R8EiH57PGANQ+ajBaAcpxHoifUqlFsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781880938; a=rsa-sha256; cv=none; b=WCa6g3P6e2zXEZsKm3/aMeNuOqj64GPOkJRi//ptjvaqZcehOle6S0+7300h6o+QlfSTZo /RXB/zsp+JP/Zaaha/EZDn+8/vyCCwnr1yPTAQdNE425cJMcH8g2qI8AFTso9408LQNNkE AlHs+B8HqpEKHBbGhy+iDVhcUy31WsAT0Hk8uYMlYEb/8ES77+Gcu+sCGKnEhXQU4Sy9sq e7l6CBuRtvKli5w9CqfxvZE6VSGa/zW/N46PErUIL4l57XAfgrHDr/d1npWwewRkHvgkXy vJgvLXLajeAi6fSnKCcPeglHZTrpbyvK+GTtUgKcyhisPd/UOCqDL7fKC0JOUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781880938; 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=eBfxa2hl7kS0hScZHPP5u6rtjg6FWd+XafymCRQs6ms=; b=VOrxABluc9OYWDCOQHuk2tAgC1EQ8vWMV1UWznNNu5zD6yCcT8YXQ9zLspI/5097AzPcEI 295oGQov6tlSDcW0QO5Zs2ErlU+/xwZ4bgt/hSN4kNvX3BukeBprrlfg0ff2cnBC0UoFE/ boD66zR7S3qX0Vv+qlgkUnHOmNBuFmbZ9GIAxs4cRFhMFy5QyNiEhwHT6V22mKeFYvJMkv YeqvUA/UUXL2Tkd8pRPxClIEYii/XoApDtyz+ve3E3tTkC1CyThDijSulxlF111/wGfOGt bK9EJry3SG0umOI+eZFXN1XS0QLJ30LLpDjnmhqJnaxbMfU2n7slSCb96k+inA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghgd64cXZzqlL for ; Fri, 19 Jun 2026 14:55:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4057d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 14:55:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Aymeric Wibo Subject: git: d7c110658e0b - main - ctermid(3): Fix return 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: obiwac X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d7c110658e0b11fbe7a1f5d9f2b340d1985b9742 Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 14:55:38 +0000 Message-Id: <6a35586a.4057d.2f0077b5@gitrepo.freebsd.org> The branch main has been updated by obiwac: URL: https://cgit.FreeBSD.org/src/commit/?id=d7c110658e0b11fbe7a1f5d9f2b340d1985b9742 commit d7c110658e0b11fbe7a1f5d9f2b340d1985b9742 Author: Aymeric Wibo AuthorDate: 2026-06-19 14:53:42 +0000 Commit: Aymeric Wibo CommitDate: 2026-06-19 14:53:45 +0000 ctermid(3): Fix return Reported by: bnovkov Fixes: dc24f31b67f5 ("ctermid(3): Fix return values section") Sponsored by: Klara, Inc. --- lib/libc/gen/ctermid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/gen/ctermid.c b/lib/libc/gen/ctermid.c index 1ca2401f0c1d..add37be1aa1a 100644 --- a/lib/libc/gen/ctermid.c +++ b/lib/libc/gen/ctermid.c @@ -59,7 +59,7 @@ __ssp_real(ctermid)(char *buf) (void)sysctlbyname("kern.devname", buf + LEN_PATH_DEV, &dlen, &sb.st_rdev, sizeof(sb.st_rdev)); errno = sverrno; - return (s); + return (buf); } char * From nobody Fri Jun 19 15:39:57 2026 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 4ghhcF3wNHz6jWgg for ; Fri, 19 Jun 2026 15:39: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghhcF1t5Hz3Dn2 for ; Fri, 19 Jun 2026 15:39:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781883597; 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=TqUQKlPJKlAWvfBAwBdbQtMlAye7CMqYkOw6Nf+Dd4k=; b=Au5uAWVA/PkEvimsZk5AUEsX/p5ZcqdB+mErPZI9peFAiLZj9QQw3t66fgG1t3lZoMKUcS xRuIXAg+ic0cq1MtUbi27la31xnprGKbOnvSCVK9DZrVT6+QLzM5Gis1CAeea3WICwhfK4 1QcstnAAKmgU6ZMaV/Onu/W21yjAtNCDmq1ItdJTMH8vfEIyABPK2R7b6J572b6BRL2KiW jbIWtY49SCcDqtjkbS9kGJE4FuF2fwV1acbUz9lzyXY7kUD4Z2O2lvajcXmZlnqw0QMxHE OYZ8KUCZv71HwHUSfEgm5DRn5PdxrxG+Rept+G83b719SHcKzZI5QMgelgyy4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781883597; a=rsa-sha256; cv=none; b=wz5dVtashnqVRny8atP558qwWPDwRjJUFpLIzjW9l2RF9PY7FtMeQerErWy2+zsr2MgwIL vxJ8i7FJL7iE4Va1XH4NfAV9axwUoJWVTLM3lSFQKT6tWXURRByv2FOwO1DhLfGIy0w/7R qmByncevd+DhUKHQtOYNLgmwLBvz7IQLN2nPBRwBqGmX1iT58SppsyJIuBCVz0Emdm6Hh1 Uwo4g4Qh/NSC68qQ/qHzN3LWe2qE+cVUQfeskF/7UcMocuLAfsI8kyKzpZDzgBmjC0kvF6 CeMidpF9v97McXOzaK7RB/p2LuGhFEO6JMs7BD9aDuxcz7bJZsai5rnQAwMFLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781883597; 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=TqUQKlPJKlAWvfBAwBdbQtMlAye7CMqYkOw6Nf+Dd4k=; b=AlgWRwiDWok/7SM4cz6395PTew2WWah0NV9TRDFBH5f+yqT//KIa+xoKqzOeDImhGBhS9Z I5iJUetk3rGskOmLeQDriOYQJ0lMg7npp0IC4zx8gAFR5eHIo/p1ujwT4x2tBMc3dbmNxr LG1va2lxDl/RU7gkQujTk0im3iCRvxUxB0weWzxRgHB6wbZQgwBUfCp8WvQFc2R5aafQIJ pHYw9fCm6iuJaRqXSAXP4MYOif/wAkmU6H6pbv7aKK+TOfKxcMAqlBKkesV+zPMa6KM60K f4aj1YiTwqH7yAOU3+ql5YN3BPo3Fe/tIKYF2BjvjEsAPdlPFZ5N4UB1o9I1vg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghhcF0mx2zrXn for ; Fri, 19 Jun 2026 15:39:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 43ca4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 15:39:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 8fd4d1c0fff8 - main - tests: Add pjdfstest integration 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 8fd4d1c0fff8441b42dbab767810db7aeaf796c3 Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 15:39:57 +0000 Message-Id: <6a3562cd.43ca4.766b879c@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8fd4d1c0fff8441b42dbab767810db7aeaf796c3 commit 8fd4d1c0fff8441b42dbab767810db7aeaf796c3 Author: Mark Johnston AuthorDate: 2026-06-19 13:27:04 +0000 Commit: Mark Johnston CommitDate: 2026-06-19 15:20:51 +0000 tests: Add pjdfstest integration Use ATF to wrap the new reimplementation of pjdfstest that came out of GSOC 2022, now available in the ports tree as filesystems/pjdfstest. So far I added tests for UFS (with several different option combinations), tmpfs and ZFS, plus ZFS+nullfs. All of these create a memory disk, initialize the filesystem, and point the pjdfstest executable at it. In the future it would be good to add tests for at least NFS and p9fs. Reviewed by: asomers MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D56605 --- etc/mtree/BSD.tests.dist | 2 + tests/sys/fs/Makefile | 1 + tests/sys/fs/pjdfstest/Makefile | 12 ++++ tests/sys/fs/pjdfstest/tmpfs.sh | 60 +++++++++++++++++++ tests/sys/fs/pjdfstest/ufs.sh | 130 ++++++++++++++++++++++++++++++++++++++++ tests/sys/fs/pjdfstest/zfs.sh | 96 +++++++++++++++++++++++++++++ 6 files changed, 301 insertions(+) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index b6c415e9e789..3c3662c11502 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -834,6 +834,8 @@ fs fusefs .. + pjdfstest + .. tarfs .. tmpfs diff --git a/tests/sys/fs/Makefile b/tests/sys/fs/Makefile index 254394f43714..823a31a4dbbe 100644 --- a/tests/sys/fs/Makefile +++ b/tests/sys/fs/Makefile @@ -12,6 +12,7 @@ TESTSRC= ${SRCTOP}/contrib/netbsd-tests/fs .if ${COMPILER_FEATURES:Mc++14} && ${MK_GOOGLETEST} != "no" TESTS_SUBDIRS+= fusefs .endif +TESTS_SUBDIRS+= pjdfstest TESTS_SUBDIRS+= tarfs TESTS_SUBDIRS+= tmpfs TESTS_SUBDIRS+= unionfs diff --git a/tests/sys/fs/pjdfstest/Makefile b/tests/sys/fs/pjdfstest/Makefile new file mode 100644 index 000000000000..62e937198e34 --- /dev/null +++ b/tests/sys/fs/pjdfstest/Makefile @@ -0,0 +1,12 @@ +TESTSDIR= ${TESTSBASE}/sys/fs/pjdfstest + +PACKAGE= tests + +ATF_TESTS_SH+= tmpfs \ + ufs \ + zfs + +# Tests use an external resource. +TEST_METADATA.p9fs+= is_exclusive=true + +.include diff --git a/tests/sys/fs/pjdfstest/tmpfs.sh b/tests/sys/fs/pjdfstest/tmpfs.sh new file mode 100644 index 000000000000..cd56acbd04c6 --- /dev/null +++ b/tests/sys/fs/pjdfstest/tmpfs.sh @@ -0,0 +1,60 @@ +# +# Copyright (c) 2026 Mark Johnston +# +# SPDX-License-Identifier: BSD-2-Clause +# + +setup() +{ + cat <<__EOF__ > pjdfstest.toml +[features] +chflags = {} +posix_fallocate = {} +rename_ctime = {} +stat_st_birthtime = {} +utimensat = {} +utime_now = {} + +[settings] +naptime = 0.001 +__EOF__ + + atf_check mkdir mnt + atf_check mount -t tmpfs none mnt +} + +doit() +{ + atf_check -o ignore pjdfstest -c pjdfstest.toml -p mnt + atf_check umount mnt + atf_check rmdir mnt +} + +cleanup() +{ + if [ -d ./mnt ]; then + umount ./mnt + fi +} + +atf_test_case tmpfs cleanup +tmpfs_head() +{ + atf_set descr "Checks that pjdfstest passes on tmpfs" + atf_set require.progs pjdfstest + atf_set require.user root +} +tmpfs_body() +{ + setup + doit +} +tmpfs_cleanup() +{ + cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case tmpfs +} diff --git a/tests/sys/fs/pjdfstest/ufs.sh b/tests/sys/fs/pjdfstest/ufs.sh new file mode 100644 index 000000000000..4bba5698df00 --- /dev/null +++ b/tests/sys/fs/pjdfstest/ufs.sh @@ -0,0 +1,130 @@ +# +# Copyright (c) 2026 Mark Johnston +# +# SPDX-License-Identifier: BSD-2-Clause +# + +setup() +{ + local md + + atf_check -o save:md mdconfig -a -t swap -s 1g + md=/dev/$(cat md) + atf_check -o ignore -e ignore newfs -t $@ $md + + cat <<__EOF__ > pjdfstest.toml +[features] +chflags = {} +posix_fallocate = {} +rename_ctime = {} +stat_st_birthtime = {} +utimensat = {} +utime_now = {} + +[settings] +naptime = 0.001 +__EOF__ + + atf_check mkdir mnt + atf_check mount $md ./mnt +} + +doit() +{ + atf_check -o ignore pjdfstest -c pjdfstest.toml -p mnt + atf_check umount ./mnt + atf_check rmdir ./mnt +} + +cleanup() +{ + if [ -d ./mnt ]; then + umount ./mnt + fi + if [ -s md ]; then + mdconfig -d -u $(cat md) + fi +} + +atf_test_case ufs1 cleanup +ufs1_head() +{ + atf_set descr "Run pjdfstest on a UFS1 filesystem" + atf_set require.user root + atf_set require.progs pjdfstest +} +ufs1_body() +{ + setup -O 1 + # UFS1 doesn't have 64-bit timestamps or a birthtime field in the inode. + cat >> pjdfstest.toml <<__EOF__ +expected_failures = [ +"utimensat::birthtime", +"utimensat::y2038" +] +__EOF__ + doit +} +ufs1_cleanup() +{ + cleanup +} + +atf_test_case ufs2_nosu cleanup +ufs2_nosu_head() +{ + atf_set descr "Run pjdfstest on a UFS2 filesystem without soft updates" + atf_set require.user root + atf_set require.progs pjdfstest +} +ufs2_nosu_body() +{ + setup -O 2 -u + doit +} +ufs2_nosu_cleanup() +{ + cleanup +} + +atf_test_case ufs2_su cleanup +ufs2_su_head() +{ + atf_set descr "Run pjdfstest on a UFS2 filesystem with soft updates" + atf_set require.user root + atf_set require.progs pjdfstest +} +ufs2_su_body() +{ + setup -O 2 -U + doit +} +ufs2_su_cleanup() +{ + cleanup +} + +atf_test_case ufs2_suj cleanup +ufs2_suj_head() +{ + atf_set descr "Run pjdfstest on a UFS2 filesystem with soft updates journaling" + atf_set require.user root + atf_set require.progs pjdfstest +} +ufs2_suj_body() +{ + setup -O 2 -U -j + doit +} +ufs2_suj_cleanup() +{ + cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case ufs1 + atf_add_test_case ufs2_nosu + atf_add_test_case ufs2_su + atf_add_test_case ufs2_suj +} diff --git a/tests/sys/fs/pjdfstest/zfs.sh b/tests/sys/fs/pjdfstest/zfs.sh new file mode 100644 index 000000000000..44e539b7abd2 --- /dev/null +++ b/tests/sys/fs/pjdfstest/zfs.sh @@ -0,0 +1,96 @@ +# +# Copyright (c) 2026 Mark Johnston +# +# SPDX-License-Identifier: BSD-2-Clause +# + +setup() +{ + local disk pool + + truncate -s 1g disk + + cat <<__EOF__ > pjdfstest.toml +[features] +chflags = {} +rename_ctime = {} +stat_st_birthtime = {} +utimensat = {} +utime_now = {} + +[settings] +naptime = 0.001 +__EOF__ + + atf_check mkdir mnt + pool=pjdfstest$$ + atf_check zpool create -m $(pwd)/mnt $pool $(pwd)/disk + echo $pool > pool +} + +doit() +{ + local mp + + mp=${1:-mnt} + atf_check -o ignore pjdfstest -c pjdfstest.toml -p $mp + if [ "$mp" != "mnt" ]; then + atf_check umount $mp + atf_check rmdir $mp + fi + atf_check zpool destroy $(cat pool) + atf_check rm -f pool +} + +cleanup() +{ + if [ -s pool ]; then + zpool destroy $(cat pool) + fi +} + +atf_test_case zfs cleanup +zfs_head() +{ + atf_set descr "Checks that pjdfstest passes on zfs" + atf_set require.user root + atf_set require.progs pjdfstest +} +zfs_body() +{ + setup + doit +} +zfs_cleanup() +{ + cleanup +} + +atf_test_case zfs_nullfs cleanup +zfs_nullfs_head() +{ + atf_set descr "Checks that pjdfstest passes on zfs mounted via nullfs" + atf_set require.user root + atf_set require.progs pjdfstest +} +zfs_nullfs_body() +{ + setup + atf_check mkdir mnt2 + atf_check mount -t nullfs mnt mnt2 + doit mnt2 +} +zfs_nullfs_cleanup() +{ + if [ -d mnt2 ]; then + umount mnt2 + rmdir mnt2 + fi + cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case zfs + atf_add_test_case zfs_nullfs +} From nobody Fri Jun 19 15:50:03 2026 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 4ghhrG5wSXz6jX6V for ; Fri, 19 Jun 2026 15:50:22 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (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 4ghhr948tvz3GPv for ; Fri, 19 Jun 2026 15:50:17 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-6870ad8072eso2498674a12.0 for ; Fri, 19 Jun 2026 08:50:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781884216; cv=none; d=google.com; s=arc-20240605; b=TqxTa+mZkfbAe1t5yuj/ILK+JFJkSzriFFnLmlDKDmY+HWo7J6pBIjGXQxZqXoPyf/ YQOwhmZRM0Eqb1/dtC78YGuypGoVv23N05HReFOU2/xYu6AB6bGP2A2wUt08HUwgn5m2 PeZsS7QfxH422q9aVhwjz+EY5LIq4CtP8ah4mjP67y5p6Zeml64eskbzErK957qJcvzD 6pJr/jmVP3Z+nDOmHgZ2pmROFbexZWftKcJPoZNdRqPkPpAboHMjOmAsoTWCKi99fdDS eaAdsNO1GjS2ytWmS9j4rkMDYWNlTY4E8PPlGpVPuanO4row1kGujFAUimgGHcmsfz/j O8Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=VuREDS6mT1Juj/AICOw10jTR+bwg5wYwHo5LGdIv1Vg=; fh=8FUXm48zd3ApwH2PvskN+SB6xqKUlQMuziRolg4RNgQ=; b=eJu8Vsk6xlo7rdOQ52zpczoMO6LKIXmWt9pwVABIupXivBgIqihQuEXxVMfARljBqd SZfYrvq8nulI8sxvh9mID/1zK+uvj3/XMs+C+d7SlnIjAnYHlARdqDeIZwIr0gZTyUlf nyp1+PWBhgnHM16spxaiulvmeeBJV3iQDYuuaUtFN6YA3XzJAjKOZNsMQ8SBnHrrTfhd BeQYY1A6jAO6wr8SjNvHXFlPGe9XrXc1IwrXBw9a5HLmfvmQH1CA5zSlN2mpvF0j3/f5 o9uQHmk5lRwpOVv81lW0cjReTCTYil814jSDg+Zt9Gb92UgYfpNFWBVO58YwNembXt0d U4ZA==; darn=freebsd.org ARC-Authentication-Results: i=1; mx.google.com; arc=none X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781884216; x=1782489016; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=VuREDS6mT1Juj/AICOw10jTR+bwg5wYwHo5LGdIv1Vg=; b=lkTH6EYJOyMGCaBQWfxWL19cXMZbXBx+NVs0TnbjpBWkYNH8yWYelPo0HTHDrCPzMt K2nP+FeNynM/BC/dk5uKiG1jGbJJ0g8fCLA0qtIggV80Z4xPyVAnLKAwl+Y697QBfi0z pv7S9z7NIVmIJQhNEq40NmyTdbKFjPzEVs/mOQW7mBdxWEun4WxaQXGG0g/c08f8zjCq yYhq3zVRnbGnL4amWso8nI21F/cILPNypzsAXOkJn4I7hzXQTfm+oC7N/vPKc5gttFof n/IZtSgthJQSWrPfJV3y7YlAbv8Ddiqw43HZlRGd4/37uNN5loWTfn0nZVTm00bJXTr8 Aayg== X-Forwarded-Encrypted: i=1; AFNElJ+LUbte8GaCVBzgFJL72CrrqEbyZaTOwQdyTYHwsaOnbF+uzPFXeqdGtR82SqvIU90Y0v+Nw9idNWSiVytjzIuEZPmgVw==@freebsd.org X-Gm-Message-State: AOJu0Yy0Aa5mjSWpoS2JXI5dPOnvShW0zn3LKXVYWwSBIIdoEnKjWCT3 plN4niDBZOSPQxVRV8Vg2R/oTrjeGEyF6f/5JgnL4Z98KoeCA/9iksugVtll43SlIhkol1bPY94 imOK902zJyMjMyEtkAgbhFgUAdQPqvNE= X-Gm-Gg: AfdE7clemyvhKtoQNCv76KaJkCad3OipWygtq6G8xTdmfxlG55oKkU69KNpZKcUQVYD hqnK8oh6kBfw2guimqNk3uuJmJGovZuhw6R8NQfpIhy0he40136FZ92t7/JkjbhMxQCOw4jDIe+ WeP48YrcYC4trQ1hk/Qh/m+Hq3mGIBfBaCZBdI1WZbjYbyEiJWuRVv7vIe7XvA4WY4eF8XRIteW yvzoFLiKxadyi221PSAAcg3or0lv/9S+MMPILWjfyeOCjkUo8e8CUQdcu8xo3OveNO4O4OPO1vd B3JgQ8i7jDKvfEmGbinNroLbzTAga4yoIGxRluaboQ9JnWvaj1hKpp9kpA== X-Received: by 2002:a05:6402:434a:b0:697:6b05:a896 with SMTP id 4fb4d7f45d1cf-6976b05aa43mr860009a12.8.1781884215562; Fri, 19 Jun 2026 08:50:15 -0700 (PDT) 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 References: <6a3562cd.43ca4.766b879c@gitrepo.freebsd.org> In-Reply-To: <6a3562cd.43ca4.766b879c@gitrepo.freebsd.org> From: Alan Somers Date: Fri, 19 Jun 2026 09:50:03 -0600 X-Gm-Features: AVVi8CfrQKJbNo6xy_2-fXfeSE4qIIIRwNDWGfgWXidCY4_dIX6VNYSNLCswcFM Message-ID: Subject: Re: git: 8fd4d1c0fff8 - main - tests: Add pjdfstest integration To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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: 4ghhr948tvz3GPv X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Fri, Jun 19, 2026 at 9:40=E2=80=AFAM Mark Johnston w= rote: > > The branch main has been updated by markj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D8fd4d1c0fff8441b42dbab7678= 10db7aeaf796c3 > > commit 8fd4d1c0fff8441b42dbab767810db7aeaf796c3 > Author: Mark Johnston > AuthorDate: 2026-06-19 13:27:04 +0000 > Commit: Mark Johnston > CommitDate: 2026-06-19 15:20:51 +0000 > > tests: Add pjdfstest integration > > Use ATF to wrap the new reimplementation of pjdfstest that came out o= f > GSOC 2022, now available in the ports tree as filesystems/pjdfstest. > > So far I added tests for UFS (with several different option > combinations), tmpfs and ZFS, plus ZFS+nullfs. All of these create a > memory disk, initialize the filesystem, and point the pjdfstest > executable at it. > > In the future it would be good to add tests for at least NFS and p9fs= . > > Reviewed by: asomers > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D56605 Thanks for doing this. Also, please follow up by adding pjdfstest to https://github.com/freebsd/freebsd-ci/blob/main/scripts/build/build-test_im= age-head.sh , so these tests will be enabled in CI. From nobody Fri Jun 19 16:40:12 2026 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 4ghjxp6sMlz6jcKy; Fri, 19 Jun 2026 16:40:14 +0000 (UTC) (envelope-from markj@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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghjxp690xz3Pf7; Fri, 19 Jun 2026 16:40:14 +0000 (UTC) (envelope-from markj@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781887214; 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=U7oq1WjkBFQeOVLu4sjXk0ubHC8H4+ydfDHES5UPCQ8=; b=b6YvKYS4JJ/spHALFtvHZb41XT1f48PKsPh0qpFx747XnLkx1Gzxupsr/nujmLXYbXhfeP BysY6RLNPmfO5iiYZvdA1xYXHka1W5JfNcp1gbEFszUh/Cty51xGFkIrvDnWdGuz5jeYD0 lDyVps9skbnPSGzit+Fw8ZKzzTSv0jdxzIyUbCG5aByyVksiZ2OE7L6/iLAQClEG6eBSpy SwS0mrVJn7uzoETcQ7lsoPmpbvsO2/zFBAIiBexq+/Z5a+G4FiWqVWX6PmP1FaUqsXnTLN 5RE/l5/v+CyW5BNVrs9SNoIuKhxGk+I86qWmmgREyUDaQgNrF9u2p6oo4hwr0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781887214; a=rsa-sha256; cv=none; b=Ox2DiLbGVCmNu+AC4sQCPuvOQ2RB3NODCO2X9wK/xZYSlfIIb9DPsvM7jhlHsot2/EFyJZ ejBbATnz+OZYbLmWOaQ1VklQaVN7EygGU6g4CoboymtXxCDIZ19n+JH7vhfiXv29TZF9eB RJ7xaypmEh/YkZ3R5Qfb63AkL/4r85tqq97/ia3Dy+p8vzgqWOaJ/MxH1k2yFn07Q0G7ef 0GysgjV6D3OC5UfJQGQLD/2H3zsy3mmZL2AJUPmtHsn9JGU6GT1zFz5KnIxo8sKzWWcNU2 Vik6msDazeBhspoqgtyAtyJkTbeeE6dCTRRsgNrU2W8uYPTU65Dk7SYLa67Lbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781887214; 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=U7oq1WjkBFQeOVLu4sjXk0ubHC8H4+ydfDHES5UPCQ8=; b=dOkLfcr62I0jiX2uxBVEseJ71kW7plkAjtXTmmNasVbHG+q2/jXs6HStEYrViPC+gEwFlX hbohYNiRUPiYxZyQHmPPRiwBVhkCh1L1mFCJJ4GHXNxMbCgpeLt7dPfpJhLQpMOCW+yt20 nB0jYRpIAVWUtIbTzh+yrxjtWqD0jPYozvnvVhHEjnmapsDZP154CRh7850ZOwk2YQrX8y hXCMM+sMWYLiJUzPiLybCzjX0IZ/woF82V/DkRWxRsqtf+VmHZM+eNZr05oKRhQFaAtTbr YHLYYhN5EcXJpOFggaypATJtEOs67aQ/gXPQgwDRVMV1pV2+zXutgyg5lLkRxg== Received: from framework (unknown [216.191.123.185]) (using TLSv1.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: markj) by smtp.freebsd.org (Postfix) with ESMTPSA id 4ghjxp3WSWzw4n; Fri, 19 Jun 2026 16:40:14 +0000 (UTC) (envelope-from markj@freebsd.org) Date: Fri, 19 Jun 2026 12:40:12 -0400 From: Mark Johnston To: Alan Somers Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 8fd4d1c0fff8 - main - tests: Add pjdfstest integration Message-ID: References: <6a3562cd.43ca4.766b879c@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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Jun 19, 2026 at 09:50:03AM -0600, Alan Somers wrote: > On Fri, Jun 19, 2026 at 9:40 AM Mark Johnston wrote: > > > > The branch main has been updated by markj: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=8fd4d1c0fff8441b42dbab767810db7aeaf796c3 > > > > commit 8fd4d1c0fff8441b42dbab767810db7aeaf796c3 > > Author: Mark Johnston > > AuthorDate: 2026-06-19 13:27:04 +0000 > > Commit: Mark Johnston > > CommitDate: 2026-06-19 15:20:51 +0000 > > > > tests: Add pjdfstest integration > > > > Use ATF to wrap the new reimplementation of pjdfstest that came out of > > GSOC 2022, now available in the ports tree as filesystems/pjdfstest. > > > > So far I added tests for UFS (with several different option > > combinations), tmpfs and ZFS, plus ZFS+nullfs. All of these create a > > memory disk, initialize the filesystem, and point the pjdfstest > > executable at it. > > > > In the future it would be good to add tests for at least NFS and p9fs. > > > > Reviewed by: asomers > > MFC after: 2 weeks > > Differential Revision: https://reviews.freebsd.org/D56605 > > Thanks for doing this. Also, please follow up by adding pjdfstest to > https://github.com/freebsd/freebsd-ci/blob/main/scripts/build/build-test_image-head.sh > , so these tests will be enabled in CI. Sure, done: https://github.com/freebsd/freebsd-ci/pull/199 From nobody Fri Jun 19 19:01:31 2026 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 4ghn4x257vz6jqh4 for ; Fri, 19 Jun 2026 19:01: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghn4x0hsXz3krZ for ; Fri, 19 Jun 2026 19:01:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781895697; 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; bh=OnMCUBjFAjlE4UiWutHC98iN4WASvSBBC+xMQczQtDI=; b=jceLHHKFInWW9iZOZgoEZhQ4ije1u2JlF0J0XhwPQcUm1ub6o4sX6/PrqyA15Eun8zctlN r30/xVczIJxTDf7pWyyee8T8aYOUqU0lOItU8VBR4hV916fP+S3qd1F4ddnqWFJbEJ/75J Ky37rRu4a4IZ+lC+RsjpXkfpikaBFIzIWNdlfYbBNTxr1cEppUSK3XDajHwbSdr6ntS4A/ 1VL5WEx9z+FrNslfeGEraMlxvenq/NAg7T0V75G6KlgsavaUhJ28801885p0+RomDD0/7Z 9iG+dTlIwcj1OyT8idCAolUcwWrr9Xu6bjnTzHqB/VPVL4V5mIwWLtVSHUx54Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781895697; a=rsa-sha256; cv=none; b=hyHA6NcCuA+sB3QX8rW6LBxdOOvvNcukGdTWEpXKDyLdRRAQh/hwsi6VS+S3ASO0lQf1dI 3oPmAISJESW4Z/DiT84iO98qPFUgY4ZB4IdT/vnFzOjzeB/U/21q/0Xnez3byat3doTFlh adaoPvmVqcesr+62O/nBq1XUl1EyepfRAxbjFfL6UU9H87K8qwREZWpeYaTJxpwZSRziqZ PRsQq7eaJskCw3weVHie0DaCLHjDlCpuAm+gMl3KVRQaaiBYB6ZflYl9orhd3o/KjjeEVm SAtduY26UO3huBfuZA4YXS6mYpi3NaTN0h/NpeqoXN1Be6qzMmJ7c4kYR+4u+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781895697; 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; bh=OnMCUBjFAjlE4UiWutHC98iN4WASvSBBC+xMQczQtDI=; b=hMk72V8ed0jPGcDTS/IndJljeeJOAgMnH55NKRqEfme8+pHwAgNeXC7Ng0sONTkcUG2yGZ fYlovBD/jIFWRukJGCfJv6q7l8KgG+Zl639iv96j4/MzX7TY18BtNKCSwJtCVMX5/1L3p+ iNl9EN8xvTn0dXeCCShnxaaKLGc032tRCrRSsG17qJtiiNeCSMLGnSVVRKtqd0tL8sNt77 tY9n1oU/gFtPl+GKKsyWEhMFVZxcxUaJJojMRTNXli9UnJYyXe7IJAjtPJjmWYdX1VdOUr bksc2ONW7qU7WcczBuQ6YnLT7a+jurxpSGWDbh4WpjjEDVdnu/GN3zGp+7AmeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghn4w6Qq6zxm2 for ; Fri, 19 Jun 2026 19:01:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30bd8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 19:01:31 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Abdelkader Boudih From: Adrian Chadd Subject: git: 9919c1a8ebd7 - main - firewire: extract shared helpers from fwe and fwip 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 9919c1a8ebd7da0aa86c6475446a7af255ecb17a Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 19:01:31 +0000 Message-Id: <6a35920b.30bd8.75a87502@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=9919c1a8ebd7da0aa86c6475446a7af255ecb17a commit 9919c1a8ebd7da0aa86c6475446a7af255ecb17a Author: Abdelkader Boudih AuthorDate: 2026-06-19 19:01:12 +0000 Commit: Adrian Chadd CommitDate: 2026-06-19 19:01:12 +0000 firewire: extract shared helpers from fwe and fwip Add fw_net.h with common inline helpers used by both if_fwe and if_fwip: ISO chunk init, TX xfer allocation, xferlist free, send queue drain, and DEVICE_POLLING ioctl handling. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D57615 --- sys/dev/firewire/fw_net.h | 109 +++++++++++++++++++++++++++++++++++++++++++++ sys/dev/firewire/if_fwe.c | 56 +++++------------------ sys/dev/firewire/if_fwip.c | 62 +++++--------------------- 3 files changed, 130 insertions(+), 97 deletions(-) diff --git a/sys/dev/firewire/fw_net.h b/sys/dev/firewire/fw_net.h new file mode 100644 index 000000000000..84495a9bc0a9 --- /dev/null +++ b/sys/dev/firewire/fw_net.h @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2026 Abdelkader Boudih + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#ifndef _DEV_FIREWIRE_FW_NET_H_ +#define _DEV_FIREWIRE_FW_NET_H_ + +/* + * Allocate mbuf clusters for isochronous receive bulk transfers + * and insert them into the free queue. + */ +static __inline void +fw_net_init_iso_chunks(struct fw_xferq *xferq) +{ + struct mbuf *m; + int i; + + for (i = 0; i < xferq->bnchunk; i++) { + m = m_getcl(M_WAITOK, MT_DATA, M_PKTHDR); + xferq->bulkxfer[i].mbuf = m; + m->m_len = m->m_pkthdr.len = m->m_ext.ext_size; + STAILQ_INSERT_TAIL(&xferq->stfree, &xferq->bulkxfer[i], link); + } +} + +/* + * Allocate a single TX xfer with speed, callback, and softc pre-filled. + */ +static __inline struct fw_xfer * +fw_net_alloc_txfer(struct firewire_comm *fc, int speed, + void *sc, void (*hand)(struct fw_xfer *), + struct malloc_type *mtype) +{ + struct fw_xfer *xfer; + + xfer = fw_xfer_alloc(mtype); + if (xfer == NULL) + return (NULL); + xfer->send.spd = speed; + xfer->fc = fc; + xfer->sc = (caddr_t)sc; + xfer->hand = hand; + return (xfer); +} + +/* + * Free all xfers on a STAILQ list. + */ +#define FW_NET_FREE_XFERLIST(head) do { \ + struct fw_xfer *_xfer, *_next; \ + for (_xfer = STAILQ_FIRST(head); _xfer != NULL; \ + _xfer = _next) { \ + _next = STAILQ_NEXT(_xfer, link); \ + fw_xfer_free(_xfer); \ + } \ +} while (0) + +/* + * Drain the send queue, counting each dropped packet as an output error. + */ +static __inline void +fw_net_drain_sendq(if_t ifp) +{ + struct mbuf *m; + + do { + m = if_dequeue(ifp); + if (m != NULL) + m_freem(m); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + } while (m != NULL); +} + +/* + * Handle SIOCSIFCAP for DEVICE_POLLING. + * Returns 0 if handled (caller should return), -1 if not a polling request. + */ +#ifdef DEVICE_POLLING +static __inline int +fw_net_poll_ioctl(if_t ifp, struct ifreq *ifr, + struct firewire_comm *fc, poll_handler_t *poll_fn) +{ + int error; + + if (ifr->ifr_reqcap & IFCAP_POLLING && + !(if_getcapenable(ifp) & IFCAP_POLLING)) { + error = ether_poll_register(poll_fn, ifp); + if (error) + return (error); + /* Disable interrupts */ + fc->set_intr(fc, 0); + if_setcapenablebit(ifp, IFCAP_POLLING, 0); + return (0); + } + if (!(ifr->ifr_reqcap & IFCAP_POLLING) && + if_getcapenable(ifp) & IFCAP_POLLING) { + error = ether_poll_deregister(ifp); + /* Enable interrupts. */ + fc->set_intr(fc, 1); + if_setcapenablebit(ifp, 0, IFCAP_POLLING); + return (error); + } + return (-1); +} +#endif /* DEVICE_POLLING */ + +#endif /* !_DEV_FIREWIRE_FW_NET_H_ */ diff --git a/sys/dev/firewire/if_fwe.c b/sys/dev/firewire/if_fwe.c index 5d7299b4acf8..c8bfc439e166 100644 --- a/sys/dev/firewire/if_fwe.c +++ b/sys/dev/firewire/if_fwe.c @@ -62,6 +62,7 @@ #include #include #include +#include #define FWEDEBUG if (fwedebug) if_printf #define TX_MAX_QUEUE (FWMAXQUEUE - 1) @@ -206,7 +207,6 @@ fwe_stop(struct fwe_softc *fwe) struct firewire_comm *fc; struct fw_xferq *xferq; if_t ifp = fwe->eth_softc.ifp; - struct fw_xfer *xfer, *next; int i; fc = fwe->fd.fc; @@ -225,11 +225,7 @@ fwe_stop(struct fwe_softc *fwe) m_freem(xferq->bulkxfer[i].mbuf); free(xferq->bulkxfer, M_FWE); - for (xfer = STAILQ_FIRST(&fwe->xferlist); xfer != NULL; - xfer = next) { - next = STAILQ_NEXT(xfer, link); - fw_xfer_free(xfer); - } + FW_NET_FREE_XFERLIST(&fwe->xferlist); STAILQ_INIT(&fwe->xferlist); xferq->bulkxfer = NULL; @@ -272,7 +268,6 @@ fwe_init(void *arg) if_t ifp = fwe->eth_softc.ifp; struct fw_xferq *xferq; struct fw_xfer *xfer; - struct mbuf *m; int i; FWEDEBUG(ifp, "initializing\n"); @@ -307,22 +302,13 @@ fwe_init(void *arg) STAILQ_INIT(&xferq->stfree); STAILQ_INIT(&xferq->stdma); xferq->stproc = NULL; - for (i = 0; i < xferq->bnchunk; i++) { - m = m_getcl(M_WAITOK, MT_DATA, M_PKTHDR); - xferq->bulkxfer[i].mbuf = m; - m->m_len = m->m_pkthdr.len = m->m_ext.ext_size; - STAILQ_INSERT_TAIL(&xferq->stfree, - &xferq->bulkxfer[i], link); - } + fw_net_init_iso_chunks(xferq); STAILQ_INIT(&fwe->xferlist); for (i = 0; i < TX_MAX_QUEUE; i++) { - xfer = fw_xfer_alloc(M_FWE); + xfer = fw_net_alloc_txfer(fwe->fd.fc, tx_speed, + fwe, fwe_output_callback, M_FWE); if (xfer == NULL) break; - xfer->send.spd = tx_speed; - xfer->fc = fwe->fd.fc; - xfer->sc = (caddr_t)fwe; - xfer->hand = fwe_output_callback; STAILQ_INSERT_TAIL(&fwe->xferlist, xfer, link); } } else @@ -379,26 +365,11 @@ fwe_ioctl(if_t ifp, u_long cmd, caddr_t data) #ifdef DEVICE_POLLING { struct ifreq *ifr = (struct ifreq *) data; - struct firewire_comm *fc = fwe->fd.fc; - - if (ifr->ifr_reqcap & IFCAP_POLLING && - !(if_getcapenable(ifp) & IFCAP_POLLING)) { - error = ether_poll_register(fwe_poll, ifp); - if (error) - return (error); - /* Disable interrupts */ - fc->set_intr(fc, 0); - if_setcapenablebit(ifp, IFCAP_POLLING, 0); - return (error); - } - if (!(ifr->ifr_reqcap & IFCAP_POLLING) && - if_getcapenable(ifp) & IFCAP_POLLING) { - error = ether_poll_deregister(ifp); - /* Enable interrupts. */ - fc->set_intr(fc, 1); - if_setcapenablebit(ifp, 0, IFCAP_POLLING); + + error = fw_net_poll_ioctl(ifp, ifr, + fwe->fd.fc, fwe_poll); + if (error >= 0) return (error); - } } #endif /* DEVICE_POLLING */ break; @@ -448,17 +419,10 @@ fwe_start(if_t ifp) FWEDEBUG(ifp, "starting\n"); if (fwe->dma_ch < 0) { - struct mbuf *m = NULL; - FWEDEBUG(ifp, "not ready\n"); s = splimp(); - do { - m = if_dequeue(ifp); - if (m != NULL) - m_freem(m); - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - } while (m != NULL); + fw_net_drain_sendq(ifp); splx(s); return; diff --git a/sys/dev/firewire/if_fwip.c b/sys/dev/firewire/if_fwip.c index 42f0c6f53743..0f37ce6a8e41 100644 --- a/sys/dev/firewire/if_fwip.c +++ b/sys/dev/firewire/if_fwip.c @@ -65,6 +65,7 @@ #include #include #include +#include /* * We really need a mechanism for allocating regions in the FIFO @@ -206,7 +207,6 @@ fwip_stop(struct fwip_softc *fwip) struct firewire_comm *fc; struct fw_xferq *xferq; if_t ifp = fwip->fw_softc.fwip_ifp; - struct fw_xfer *xfer, *next; int i; fc = fwip->fd.fc; @@ -226,17 +226,8 @@ fwip_stop(struct fwip_softc *fwip) free(xferq->bulkxfer, M_FWIP); fw_bindremove(fc, &fwip->fwb); - for (xfer = STAILQ_FIRST(&fwip->fwb.xferlist); xfer != NULL; - xfer = next) { - next = STAILQ_NEXT(xfer, link); - fw_xfer_free(xfer); - } - - for (xfer = STAILQ_FIRST(&fwip->xferlist); xfer != NULL; - xfer = next) { - next = STAILQ_NEXT(xfer, link); - fw_xfer_free(xfer); - } + FW_NET_FREE_XFERLIST(&fwip->fwb.xferlist); + FW_NET_FREE_XFERLIST(&fwip->xferlist); STAILQ_INIT(&fwip->xferlist); xferq->bulkxfer = NULL; @@ -311,13 +302,7 @@ fwip_init(void *arg) STAILQ_INIT(&xferq->stfree); STAILQ_INIT(&xferq->stdma); xferq->stproc = NULL; - for (i = 0; i < xferq->bnchunk; i++) { - m = m_getcl(M_WAITOK, MT_DATA, M_PKTHDR); - xferq->bulkxfer[i].mbuf = m; - m->m_len = m->m_pkthdr.len = m->m_ext.ext_size; - STAILQ_INSERT_TAIL(&xferq->stfree, - &xferq->bulkxfer[i], link); - } + fw_net_init_iso_chunks(xferq); fwip->fwb.start = INET_FIFO; fwip->fwb.end = INET_FIFO + 16384; /* S3200 packet size */ @@ -341,13 +326,10 @@ fwip_init(void *arg) STAILQ_INIT(&fwip->xferlist); for (i = 0; i < TX_MAX_QUEUE; i++) { - xfer = fw_xfer_alloc(M_FWIP); + xfer = fw_net_alloc_txfer(fwip->fd.fc, tx_speed, + fwip, fwip_output_callback, M_FWIP); if (xfer == NULL) break; - xfer->send.spd = tx_speed; - xfer->fc = fwip->fd.fc; - xfer->sc = (caddr_t)fwip; - xfer->hand = fwip_output_callback; STAILQ_INSERT_TAIL(&fwip->xferlist, xfer, link); } } else @@ -394,26 +376,11 @@ fwip_ioctl(if_t ifp, u_long cmd, caddr_t data) #ifdef DEVICE_POLLING { struct ifreq *ifr = (struct ifreq *) data; - struct firewire_comm *fc = fwip->fd.fc; - - if (ifr->ifr_reqcap & IFCAP_POLLING && - !(if_getcapenable(ifp) & IFCAP_POLLING)) { - error = ether_poll_register(fwip_poll, ifp); - if (error) - return (error); - /* Disable interrupts */ - fc->set_intr(fc, 0); - if_setcapenablebit(ifp, IFCAP_POLLING, 0); - return (error); - } - if (!(ifr->ifr_reqcap & IFCAP_POLLING) && - if_getcapenable(ifp) & IFCAP_POLLING) { - error = ether_poll_deregister(ifp); - /* Enable interrupts. */ - fc->set_intr(fc, 1); - if_setcapenablebit(ifp, 0, IFCAP_POLLING); + + error = fw_net_poll_ioctl(ifp, ifr, + fwip->fd.fc, fwip_poll); + if (error >= 0) return (error); - } } #endif /* DEVICE_POLLING */ break; @@ -495,17 +462,10 @@ fwip_start(if_t ifp) FWIPDEBUG(ifp, "starting\n"); if (fwip->dma_ch < 0) { - struct mbuf *m = NULL; - FWIPDEBUG(ifp, "not ready\n"); s = splimp(); - do { - m = if_dequeue(ifp); - if (m != NULL) - m_freem(m); - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - } while (m != NULL); + fw_net_drain_sendq(ifp); splx(s); return; From nobody Fri Jun 19 19:45:50 2026 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 4ghp3z2ncMz6ghm0 for ; Fri, 19 Jun 2026 19:45: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghp3z23g6z3sq6 for ; Fri, 19 Jun 2026 19:45:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781898351; 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=ScBpSZq5XDROPypKbOueqZS5TvsyzYFlj7rO6KQZ9HY=; b=mDiWmPHDY3pOEQgjHJ9s/Wd23KG+Ha7vEMUcnO2bOJkVR0AgU/x1Vm+wo5bpy/4wv7ovur 9Ha8q3mPFm3xqA1pXdRwNB9LLlipkB+Vr0hOay7XVP5e8Ac4D6ALql3JNnqjr4F3A74RS6 k9FtBdXq2YEobsetnkVRWlAzUwbflujHQhBtvKk9kt/YUdf04+8AxQ7JRNgNYN9uM+nxc2 km3qm6wdF/9LXe7HLw+bqxZgWUov7RFw+fNTpiWHQy9aTt5ONrBqAUIWdRQsvsjhy282ni vC7VtdU8/XtGkOIbV00juFfClypTDLMgTbI9nzUDi9ohYhpPBpdxBGg6A+Jr7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781898351; a=rsa-sha256; cv=none; b=J5JrQGy5HCoy2XL2QMf1knGcVaZMwSVCjXvOtE9LQav8CZFyaTjUBDrUn2Csr+2YLh8DMx ea3YcLP1UWZAOeYfPQbZ/YxwK6uxPslDlHeBSpcGuWFPF+X0XS7T9Y4cbQmaCuhy7Lb8Q3 i3XHdiUxS5kPY7M75KPWs+vWi+tEoe95y1WH2fOSBN11QDibuR6d7rYIP9MJyUXsKBFGOU OrRl02S8hofuqxTsdJcCIRjlsXnc1nt5SXNi2w52pAd+5Bs96y63E7m4LMY2Exbi6q5sbV Q3rtOF/6LoDsIL5d6pB04GQSPMy3DQPRrpFH1hKt5Ph3GQpqikIEkoRZCWcoOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781898351; 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=ScBpSZq5XDROPypKbOueqZS5TvsyzYFlj7rO6KQZ9HY=; b=H1+qLoosRm4SZNzgOKjKm+XdPUiZ2x7UKfFW28YsBheeUSJfnbRF1/K9TWYF53XpUcBUiG XNNgs85DXRZqgrWEnqA71MYW/YaQa1PPuu9E9Xl3BLiyaoK5lsraPnD8arIz03IptEPZS2 qXX9IVoFqFY4UrYpPGkNjVdOeRUWTXMpd37P1p+ujOIK14s2UExXo9b7N1kaKGqfHhLYPG OSdMLMqRmLFZ/+4Z016JayWfxKXs5Hq4k2G7t5D8AmE9yW32IREdWbG6ta/Nk4bl8rtfZI bNiVtJuz3BAjF01bi76cNdOkkgHRf3fdi31oWN3d9CDAZvT2JcOTuRGwiEmoHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghp3z0fRkzyMN for ; Fri, 19 Jun 2026 19:45:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 37660 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 19:45:50 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: e91e8ebefadc - main - jail: call PR_METHOD_ATTACH again (with old jail) if the first call fails 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e91e8ebefadcce9d57c8ff945ff70050cbbe1ce1 Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 19:45:50 +0000 Message-Id: <6a359c6e.37660.6acee9df@gitrepo.freebsd.org> The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=e91e8ebefadcce9d57c8ff945ff70050cbbe1ce1 commit e91e8ebefadcce9d57c8ff945ff70050cbbe1ce1 Author: Jamie Gritton AuthorDate: 2026-06-19 19:45:27 +0000 Commit: Jamie Gritton CommitDate: 2026-06-19 19:45:27 +0000 jail: call PR_METHOD_ATTACH again (with old jail) if the first call fails jail_attach lets modules do attachment-specific work by calling osd_jail_call(PR_METHOD_ATTACH). If one of the modules returns an error, the call needs to be repeated with the thread's current prison, so possible earlier modules and undo any changes they may have made. MFC after: 5 days --- sys/kern/kern_jail.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index a8d44012db0f..9e6d72ac7157 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -3160,10 +3160,8 @@ do_jail_attach(struct thread *td, struct prison *pr, int drflags) /* Let modules do whatever they need to prepare for attaching. */ error = osd_jail_call(pr, PR_METHOD_ATTACH, td); - if (error) { - prison_deref(pr, drflags); - return (error); - } + if (error) + goto e_revert_osd; sx_unlock(&allprison_lock); drflags &= ~(PD_LIST_SLOCKED | PD_LIST_XLOCKED); @@ -3236,8 +3234,10 @@ do_jail_attach(struct thread *td, struct prison *pr, int drflags) VOP_UNLOCK(pr->pr_root); e_revert_osd: /* Tell modules this thread is still in its old jail after all. */ - sx_slock(&allprison_lock); - drflags |= PD_LIST_SLOCKED; + if (!(drflags & (PD_LIST_SLOCKED | PD_LIST_XLOCKED))) { + sx_slock(&allprison_lock); + drflags |= PD_LIST_SLOCKED; + } (void)osd_jail_call(td->td_ucred->cr_prison, PR_METHOD_ATTACH, td); prison_deref(pr, drflags); return (error); From nobody Fri Jun 19 20:10:15 2026 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 4ghpcF3lnYz6gkmF for ; Fri, 19 Jun 2026 20:10: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghpcF0c3yz3w5b for ; Fri, 19 Jun 2026 20:10:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781899821; 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; bh=oB6ZV8RxJnEuyZaPPdUjWhqjC11HSc1pA6j21FWeryY=; b=LyeUzNXbKZ+4SfT778cxfx83YzV8yzMzCw+VKu7ZYgF3c27SKz1vCuhuQFobLPpbc6z0vm fONrTs+VrKUhmjoCc+4iE4oXkaVO1235JKNzjzUB4Jy5Wm1gdLbsVxl/7qRBPizGVQ6jNk B18xs07O5J2Na/DHTSJZJT7R1fZPl7O5Du/CyaqIQnz24Dj1w0g0Lp5qGvMayk4u9oSoyN Hkz4e5q+xG3uOPpHU1uY2A9MqyFxr1GoY6iqMECtgwZ/CQGp8OC+ig9r9Gh0mwNDok1Z0K vwT4YZiFAfhhZ1KeYdo0MUL20Ul8lgO8Bef9kR5bIjPMqrUsPAePU6V9iJLzuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781899821; a=rsa-sha256; cv=none; b=PsgjYitlzX9miH/biXNYE4b6Jk+ynYAWOClP3lE95CJ23dyuWJE209YSdpRt2FOlLZzZNu emsLAIyZoW1fcFS+dqZpQhtN15gf3OXJVVyVZ5rs+0s3Sy51QDMekgl9J5XkCFccpSPuvB 8NtHc4Rh/gaTV0erbLoyH1Y0G7uKsyPo2NA0jU6ViQJCwKbA/fZErUjvsDnmVLuVOvFLVA XGZ5yAlJVNzwgLqgmADl4gTzcfoZDBufV3dPZGUOUGsitnQagSI9ns0c+EESx5Et9fYxuN YTvANa2RzXLF6IKppq6qfaUmBdh+SIoI7CU/t3leec4hRtzNW4wBr6QVK9W/YQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781899821; 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; bh=oB6ZV8RxJnEuyZaPPdUjWhqjC11HSc1pA6j21FWeryY=; b=kLgTBfsbAzdRMrT+kvsZ4O2gimxPAfu+8GI5sRGyUqg5kOuUqAA4WKPamG7N8oNdk6OrP9 amn1bffRAZB0kp+Y91ooa8txYLeqaeYVX3iPAEaYRvhXLFEWUMsbgBryMDGfEgKv4SE2q+ K4T19NrS0hSXABeUXEyb3vlYpWDijwkNg8Ck3l+VDMcCYP5SY+URfZLgZVc3ZWTxjNi4Fr 6uGU5Il4Y8U1g73UMWx28Y5M6mntQsb3W6odfqvcLmQ3jLfbICIbH7iyrDUCk5lKLXkd5b zzRagLva14v3JQQz4E2l/D3JV40JWJ5VF7g2q4k7cYNiu5a61vMYlsdyt0QWqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghpcD67nBz10p1 for ; Fri, 19 Jun 2026 20:10:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38cdd by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 20:10:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Artem Bunichev From: Alexander Ziaee Subject: git: b3dfd5d59c4a - main - rmdir.1: Document non-POSIX -v option 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b3dfd5d59c4a776abfa9b48babf08fb56e986dd7 Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 20:10:15 +0000 Message-Id: <6a35a227.38cdd.78bc26cb@gitrepo.freebsd.org> The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=b3dfd5d59c4a776abfa9b48babf08fb56e986dd7 commit b3dfd5d59c4a776abfa9b48babf08fb56e986dd7 Author: Artem Bunichev AuthorDate: 2026-06-19 19:57:19 +0000 Commit: Alexander Ziaee CommitDate: 2026-06-19 20:09:39 +0000 rmdir.1: Document non-POSIX -v option MFC after: 3 days Reviewed by: ziaee Differential Revision: https://reviews.freebsd.org/D57675 --- bin/rmdir/rmdir.1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/rmdir/rmdir.1 b/bin/rmdir/rmdir.1 index b43328110960..7364e9691cb8 100644 --- a/bin/rmdir/rmdir.1 +++ b/bin/rmdir/rmdir.1 @@ -29,7 +29,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 15, 2013 +.Dd June 19, 2026 .Dt RMDIR 1 .Os .Sh NAME @@ -104,6 +104,10 @@ The utility is expected to be .St -p1003.2 compatible. +.Pp +The +.Fl v +option is an extension to that specification. .Sh HISTORY A .Nm From nobody Fri Jun 19 20:17:48 2026 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 4ghpmt6L1Yz6gl75; Fri, 19 Jun 2026 20:17:50 +0000 (UTC) (envelope-from des@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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghpmt3TCjz3xy1; Fri, 19 Jun 2026 20:17:50 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781900270; 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=XtwNNBnrFiCc06FMZYGxj2ndN6wPe2Z9lUPvxqObhn8=; b=EsRvSLKKINY55TWTOhwoA48LoJC7J4EmxhSBJZgio4MwGo25DLHXHCrbWKd8OAO5zNc4Sg zD57MAJOK0bBzk2j7G8nU6BHFXaemGf0ZSNj/W1Vls5DUCG60l7xFCrcURV7vLXuVJqKqQ WUhYzNFsa3lc+nhwFqqgvLGrrAUs2Jfk2C5XbsSIEVnibMTxkaay8khAR5pTiV2hYnzbtr AKZH2VbvLTz9HZFg4k0vjLN16GzyMyi3Ko/98guKoZer+a0W/cS99ywNPxGDB9VWl7KGzz IJbhX7Kq7Ien89IgPuXr7cYLDLDMgxxQrDUoiVoIB7bQ3P+OJ/xBqV/g3K8+PA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781900270; a=rsa-sha256; cv=none; b=ScCHN/A+Qxb/ACg2J+rDTub2wWC3rqtL/GTkM991nhKZEKuvK2OQR+/dGJ1Lt8rS6ZmJg0 hE3rG6f9r/pOYDoF8kcXocrGMnH9lHA9+mOwvGHfrfYY/izzSCvrBzo930wyNNUfb8hQiR DhLHVeyHKDrszLx3J5PTYhLugwVq4paavV+y4Hu5R7Oe4BdPbJGuhRDGkbux/YBPHOC4rI d9jHZXj5ZmMR7fmCxBPHznNBmhPMjtM+zGwJ7caArkJWJoa7P+50m4AoE2lrqKaxQp5BNl 5FVCAqvnDdsjUerjJq5jWBr9KmKJYkhOljqYBJbtVObForAwGn858rsOnf/A0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781900270; 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=XtwNNBnrFiCc06FMZYGxj2ndN6wPe2Z9lUPvxqObhn8=; b=JzKs3Aq4UzTiZH4D5h94JmWJGZBhShTgbjGdoW4ecAjsulX35WPggut+kOyG4BJO1PlTcR 3n5QANAQbfgJiT7653zz0IG7T4dnJkNbVM+9XbVYWZn4KoTnD2Zw0JmQDCKYL7mqDg6Df4 qjERQx71Co6D37t5uQveAmxhmPcjm9ll1QT5eaK7PBxfZXadvLUgJFlP9Y+gmMezyszAK1 Y4SjN5WeWWRsAHjn7kzDbuJN9nHM+Y7cgjtdKsulwJHOnoPE8AaNkpa5qh7JZPaNLTcsmD X10sMhW35CbgdmGutz/DA/2FX1SwWdK8DbH/+XrkQgsG4FOv/n6GrLHF9Udp1w== Received: from ltc.des.dev (unknown [92.183.55.143]) (using TLSv1.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: des/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4ghpmt1bPmz11s7; Fri, 19 Jun 2026 20:17:50 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id D72685070B; Fri, 19 Jun 2026 22:17:48 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Alexander Ziaee Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org, Artem Bunichev Subject: Re: git: b3dfd5d59c4a - main - rmdir.1: Document non-POSIX -v option In-Reply-To: <6a35a227.38cdd.78bc26cb@gitrepo.freebsd.org> (Alexander Ziaee's message of "Fri, 19 Jun 2026 20:10:15 +0000") References: <6a35a227.38cdd.78bc26cb@gitrepo.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Fri, 19 Jun 2026 22:17:48 +0200 Message-ID: <865x3euvwz.fsf@ltc.des.dev> 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Alexander Ziaee writes: > @@ -104,6 +104,10 @@ The > utility is expected to be > .St -p1003.2 > compatible. > +.Pp > +The > +.Fl v > +option is an extension to that specification. This is not the wording we normally use for these cases. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Fri Jun 19 20:19:42 2026 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 4ghpq30394z6glK8 for ; Fri, 19 Jun 2026 20:19: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghpq24RJbz40TT for ; Fri, 19 Jun 2026 20:19:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781900382; 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=fHnaiwdUfV44jpA0sT6KjjMuUNmual6Kl8SDm9Q+/Ls=; b=hXejAmgRk3T9i7ueZlGMlSah7hJ19C0SG+IbPDe0hqpVB+WIGJ+9GfLsj0XehyUBcuzL7d j7LI69pCAjhzFHA7zv+1F8fWq7QXlr4U9ND9F+Ym2QvdTLDznyoWM93H5bb5afqRBKEFV6 Mu/uGsUvEqT/ADoS0x0OIER/r9HgC7MWk6W6zWD7TkqQ3CgyKtoMysNxVzgsYxYhS+P7sU VmQcDZpzej2pNgC3JkG19GhUhCE3qc5zWFqhtZSDU6efuqJmQoKYGi2mllvrziDOW4ZY65 YmrhfCK1cQEx05f648Lv9WJ8lOFoRlXk6jLAdKPr9R1VwVuBE6He4S9t+P7xkA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781900382; a=rsa-sha256; cv=none; b=EtIojiiU5RwtLu2O7EKIUwzOy6O32vpCXgcjKBkI0cjhrNyqE5d62ORzHDfeWq7XzJYHas xTwXX/WoqTP68PBCwheIcch3nuSav7xJFpCA1sBWXjcFRByujUWgFY5QQBInRZv1NJTaV3 OWQBh1QlKB/wCcS8YLe2rCzB9EVMXM2QfDkiJtZ83To7ye7d2af5SHnckD7pHORx7AJEFi 7huw/NX0FzWOxt4ucbkUgc3heIxhSidzpA2NXTxnM6JwwtUwt34asBPvApvjcQsAffJmzw GMy4ESrAL/TaPmyY3gaJQYg7cQo2bnLScP6iopeS0UTmSXvo9igdEMdii1/JvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781900382; 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=fHnaiwdUfV44jpA0sT6KjjMuUNmual6Kl8SDm9Q+/Ls=; b=DM4xReQXu+fPHdJb65XpJ64KEL6K3PSv14wnRVV4xRVwalJyUba4nFhvLI7LQnInzE2oZi 0026/Rwm7kuyZKMbW3MZCTD0hP5hn0NN3WQuF4rmThmBxAswK8M9Evn44f57CMk05Lu0aC m7KOmGdXjKZ876JVKzDHKTutdKSs2nfgJ0R9vydAvG2ANZ54QqTAihrPuYxDU/aN7O8yzp eAvA14+t78SwONrOCEAJ8TElsbSEnXw1D3ed8TaVZ3WzVSggGdyfVTaWIr48BthMJOqT4e QrHg5oGobq4gHKNL4Tf6IQfs2dqU62ZtzOG2JCmUSKpaTJtv8Xw36ypHp4/Z6Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghpq22Hswz10jH for ; Fri, 19 Jun 2026 20:19:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 39ec9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 20:19:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Aymeric Wibo Subject: git: 9fd0c7c520a4 - main - thunderbolt.4: Explain what driver does in manpage 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: obiwac X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9fd0c7c520a4427e1de5a8b733851deca561b79c Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 20:19:42 +0000 Message-Id: <6a35a45e.39ec9.5fdebe9f@gitrepo.freebsd.org> The branch main has been updated by obiwac: URL: https://cgit.FreeBSD.org/src/commit/?id=9fd0c7c520a4427e1de5a8b733851deca561b79c commit 9fd0c7c520a4427e1de5a8b733851deca561b79c Author: Aymeric Wibo AuthorDate: 2026-06-19 18:48:38 +0000 Commit: Aymeric Wibo CommitDate: 2026-06-19 20:18:45 +0000 thunderbolt.4: Explain what driver does in manpage Reviewed by: ziaee, ngie Approved by: ziaee Fixes: 2f7a796b590e ("thunderbolt.4: Initial manual for HW Relnotes") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57668 --- share/man/man4/thunderbolt.4 | 49 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/share/man/man4/thunderbolt.4 b/share/man/man4/thunderbolt.4 index fd7cb1f3f338..7d162614d7f7 100644 --- a/share/man/man4/thunderbolt.4 +++ b/share/man/man4/thunderbolt.4 @@ -1,22 +1,61 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2025 Alexander Ziaee +.\" Copyright (c) 2026 The FreeBSD Foundation .\" -.\" SPDX-License-Identifier: BSD-2-Clause +.\" Portions of this software were developed by Aymeric Wibo +.\" under sponsorship from the FreeBSD Foundation. .\" -.Dd October 2, 2025 +.Dd June 19, 2026 .Dt THUNDERBOLT 4 .Os .Sh NAME .Nm thunderbolt -.Nd USB4 controller driver +.Nd Thunderbolt / USB4 Native Host Interface driver .Sh SYNOPSIS .Cd device thunderbolt +.Sh DESCRIPTION +The +.Nm +driver attaches to the Thunderbolt and Generic USB4 Native Host Interface +.Pq NHI +found on Intel and AMD platforms. +The NHI is the host-side controller that manages communication with +Thunderbolt and USB4 routers. +.Pp +The driver initializes the NHI hardware and can read from and write to its +configuration space in order to suspend or resume it. +.Pp +.Em This driver does not provide working Thunderbolt or USB4 support . +The primary purpose of loading this driver is to allow the system +to assert ownership of the NHI device so that PCI power management +can place it into a low-power state. +On platforms that support S0ix +.Pq such as S0i3 , +an unsuspended NHI will block entry into the deepest idle states, and the NHI +is put in an active state by the pre-OS connection manager at boot. +Loading +.Nm +prevents that blockage. +Users who do not require S0ix idle states have no need to load this driver for +the time being. .Sh HARDWARE The .Nm -driver supports Thunderbolt 3 and USB4 controllers. +driver only attaches to generic USB4 controllers, that is devices matching PCI +class +.Dv PCIC_SERIALBUS , +subclass +.Dv PCIS_SERIALBUS_USB , +and programming interface +.Dv PCIP_SERIALBUS_USB_USB4 . .Sh HISTORY The .Nm driver appeared in -.Fx 15.0 . +.Fx 16.0 . +.Sh CAVEATS +This driver is under active development and is not feature-complete. +The interface and behaviour are subject to change without notice. +Do not rely on this driver for Thunderbolt or USB4 device connectivity. From nobody Fri Jun 19 20:22:54 2026 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 4ghptk4w4pz6gm9L for ; Fri, 19 Jun 2026 20:22: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghptk2krbz419x for ; Fri, 19 Jun 2026 20:22:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781900574; 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=buZBGD3V9C7nAUqvlevYccd5LULwri2D0EIkP60EULI=; b=ar9KDd9d2sGM/bkY7TjXyFs/WS3LXBpmHnRbFc3UkH9SeEpA1km+Xwra09wMxO7C67wK/m WKv++Ac2EniLu3nRubL8hzzwSeypqCkHrcGrlPECeSyhKS81U5U1x+IyW8pwAxaVz9HuF4 ZLe7dqihICEmQNJUe8oRNgEEWwc5YFBJtX+agOuXNKAwM6C+xwRaP7IlrHtTS6tdWFQe11 GC0G26vOoMYcfl/7+LFMZW1H74bWmF/e9zxKDo6jI0ypI20UFXOEJbFYT8++SYVSkka51f wxxoFKEm0LgQVx/MgkyFERuSvVtW2jXINNR64Gtzqfw+JZxz61eK680G9ieTwQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781900574; a=rsa-sha256; cv=none; b=CwTHt6WdXeBvCG2e0nnvpVQJH/vJ1oSgGQpzQrMgyJn7zdL1FCnHi8jSiCO3CZ6u6ZDimC COcVU7VpOlGXGdZ0JgV3WmtJSwrrdA6dVpi/3y2Jku0K47b0LpH2bi64Exx2F2lUjic82S CYeDYDmtFoBqY9ByyTaKS3TNcQKWg3zBIqfZlvEn1ILiWJqAmMvQPVNpXQfU4EnWmlXkNy sEmaVyeZuzivwV+ukaRXnYaEUW4yPtM+gnS12FLr3q/URFDGBZQGMQ7KICEF+U9+aTty67 xZ+RiqzQ9P3Ydo0BkcyQooSluqThlasuvhXIwla57jqISeB5+4IDLEK6+p8z6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781900574; 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=buZBGD3V9C7nAUqvlevYccd5LULwri2D0EIkP60EULI=; b=B71aqQswcSRU6MzfZvvO2i4BwM9/DgnTeINLgHuGxNGYZGwa5JXARoQvk70VeeJU9SF0FO Gjxve6eWBcwSYL8WIvl0Z45Qsgfu+r1ETFkcbArUCfJu5gTzsVtr0CZNeJ7IyPOPR1Coej fvZedSw5D3AHT55RETbo1eGyLR37g5JuFduMZNdcKQtJN8bgbnhIGt9DidcICPEEDIWjw7 b4RQX0KFkfLCiifEuOZyG58gpOE1RBFLJDFpijDSigxGDTU/6NQobjOZiwnAKHW5K8Gcf8 yZbCI7mdiFmsy612nA3vYaQQSBs3FqHAyJ/74K/bgvvZh1VR97IlkwMVhD9jDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghptk1DTjz116V for ; Fri, 19 Jun 2026 20:22:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3a726 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 20:22:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Simon J. Gerraty Subject: git: 389c124fecb0 - main - imgact_elf.c indicate that interpreter is an interpreter 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 389c124fecb04cf6ae2b0f8ab1047c19badec40c Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 20:22:54 +0000 Message-Id: <6a35a51e.3a726.5c6d84ad@gitrepo.freebsd.org> The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=389c124fecb04cf6ae2b0f8ab1047c19badec40c commit 389c124fecb04cf6ae2b0f8ab1047c19badec40c Author: Simon J. Gerraty AuthorDate: 2026-06-19 20:21:46 +0000 Commit: Simon J. Gerraty CommitDate: 2026-06-19 20:21:46 +0000 imgact_elf.c indicate that interpreter is an interpreter Use a value that do_execve will ignore since there's nothing there to do. With this we can set the 'indirect' flag on rtld, to prevent direct execution being used to bypass the 'indirect' flag on python3: root@vuefi:~ # /libexec/ld-elf32.so.1 /usr/bin/python3 -c 'print("pwned")' pwned root@vuefi:~ # veriexec -z enforce root@vuefi:~ # /libexec/ld-elf32.so.1 /usr/bin/python3 -c 'print("pwned")' /libexec/ld-elf32.so.1: Operation not permitted. root@vuefi:~ # load_file seems missnamed since it is only used by load_interp so rename it to load_interp_file. Reviewed by: imp Sponsored by: Hewlett Packard Enterprise Development LP Differential Revision: https://reviews.freebsd.org/D57649 --- sys/kern/imgact_elf.c | 11 ++++++----- sys/kern/kern_exec.c | 3 ++- sys/sys/imgact.h | 1 + 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 65e0e6089dca..a0dc96e74ed6 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -94,7 +94,7 @@ static int __elfN(check_header)(const Elf_Ehdr *hdr); static const Elf_Brandinfo *__elfN(get_brandinfo)(struct image_params *imgp, const Elf_Phdr *phdr, const char *interp, int32_t *osrel, uint32_t *fctl0); -static int __elfN(load_file)(struct thread *td, const char *file, u_long *addr, +static int __elfN(load_interp_file)(struct thread *td, const char *file, u_long *addr, u_long *entry); static int __elfN(load_section)(const struct image_params *imgp, vm_ooffset_t offset, caddr_t vmaddr, size_t memsz, size_t filsz, @@ -785,7 +785,7 @@ __elfN(load_sections)(const struct image_params *imgp, const Elf_Ehdr *hdr, * the entry point for the loaded file. */ static int -__elfN(load_file)(struct thread *td, const char *file, u_long *addr, +__elfN(load_interp_file)(struct thread *td, const char *file, u_long *addr, u_long *entry) { struct { @@ -823,7 +823,8 @@ __elfN(load_file)(struct thread *td, const char *file, u_long *addr, imgp->td = td; imgp->proc = td->td_proc; imgp->attr = attr; - + imgp->interpreted = IMGACT_INTERP_IGNORE; /* ignored by do_execve */ + NDINIT(nd, LOOKUP, ISOPEN | FOLLOW | LOCKSHARED | LOCKLEAF, UIO_SYSSPACE, file); if ((error = namei(nd)) != 0) { @@ -1092,13 +1093,13 @@ __elfN(load_interp)(struct image_params *imgp, const Elf_Brandinfo *brand_info, if (brand_info->interp_newpath != NULL && (brand_info->interp_path == NULL || strcmp(interp, brand_info->interp_path) == 0)) { - error = __elfN(load_file)(imgp->td, + error = __elfN(load_interp_file)(imgp->td, brand_info->interp_newpath, addr, entry); if (error == 0) return (0); } - error = __elfN(load_file)(imgp->td, interp, addr, entry); + error = __elfN(load_interp_file)(imgp->td, interp, addr, entry); if (error == 0) return (0); diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 8ea00543989e..de6d8b08cec3 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -678,7 +678,8 @@ interpret: * Special interpreter operation, cleanup and loop up to try to * activate the interpreter. */ - if (imgp->interpreted) { + if (imgp->interpreted != 0 && + imgp->interpreted != IMGACT_INTERP_IGNORE) { exec_unmap_first_page(imgp); /* * The text reference needs to be removed for scripts. diff --git a/sys/sys/imgact.h b/sys/sys/imgact.h index 51cda4406cad..f99b1273ee02 100644 --- a/sys/sys/imgact.h +++ b/sys/sys/imgact.h @@ -86,6 +86,7 @@ struct image_params { struct ucred *newcred; /* new credentials if changing */ #define IMGACT_SHELL 0x1 #define IMGACT_BINMISC 0x2 +#define IMGACT_INTERP_IGNORE 0x3 unsigned char interpreted; /* mask of interpreters that have run */ bool credential_setid; /* true if becoming setid */ bool vmspace_destroyed; /* we've blown away original vm space */ From nobody Fri Jun 19 20:30:15 2026 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 4ghq3C3tr2z6gmbR for ; Fri, 19 Jun 2026 20:30: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghq3C36P5z43g6 for ; Fri, 19 Jun 2026 20:30:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781901015; 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=XBMplmRigJN5nB/yYQe47NnKwvNkTe49wvVx9BJLjKw=; b=OIJWsAuz8qJmfIQrBpcqz0HxhbI1ov1goCkIllMmnjltdRbuwQB+gZ4jvrnhw7MFN2qcGB f5yM4ZDFAKAzYc4gl06U9hWs/62ZPM3joKNqCG9fMyr9as2miuxwp1yZBdf4OncpeYr8QX Yn7KiieKDU9xgRXmzyMjrvDYN41DIReVbnT5VwRFQnCRmPvH8T7Q7W1f7sU1t7YgeVVy8O wVSAPw6Nc+mNyg0924mSEzxTgOt811KehEd+C/mk7yWa/vxgSxmRtIJ5ki3diu+PbfU1H1 epem0F5PZUr859+Uzt8PlV/S4n1HC5+OKfnKOPPCRFHnJtLrZOeBSNnRgq4bPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781901015; a=rsa-sha256; cv=none; b=GlmKiVtM+o3CmawzxA7F7YRUSqFrFqrJBcxbksoXRtA5HgtC2AdBrrKTC0ZvT9EPW4XSkA M+Zd57M5bdxxEdbxmQ/JhmGLkgtrSz8BGqXOkCSrE/1hVRJCR6CUhcbpfR79NDPQ5Rl64J U7ysuD/CFG0ljUxgMVr8PPpPF1oXTuygLwNosqfGNJQeyPydvx61ucvrrVi62LDbtAN9IR 3v/xH9tVeuQfBwBdfoJKhd0KYsP4SDYrrvMe9jAJmJTIKaXb5JT6PZgabkkQ8TZk6kNwjy 5PhPjiVvD9PoQqS4QM1iO4PCZjrhDEFHjmYjoG04bl1CWJRWoPS1VOZ3LjC1kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781901015; 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=XBMplmRigJN5nB/yYQe47NnKwvNkTe49wvVx9BJLjKw=; b=NmJzVBgJIaR9XVZ7emy7JX93XqYGQg82XmX2KidfuBjpB19jg/Q3NZxHXlco1jR+uSrLWO +cvk9cI2DL7YBWRGFdyGWR4+L4egfFPGuufcUwxhGIaKxjOa07sst6xaU1jXfyhk3ik27A U3j50joF7bCnilGgdHIKj/5/sa6AIJmdR/6PBhWeYcrCpG48XxiJbx6a0ooOHqzi/OMQSp I+h7M2Wec7ubsRL0bc8EAMDaSVj68DJbjnv5i2GrBPHd6RXPcbgKVd6JNZU1UFizW+OCps ygpI2ohbzseX4wNxxLdGE5i+G+DP3ol9aYJg1B2oYTZxR8Rst7VAMuFlG4zy/Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghq3C1PFSz114R for ; Fri, 19 Jun 2026 20:30:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3a74f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 20:30:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Simon J. Gerraty Subject: git: 7386c0675c89 - main - Update dirdpes.mk et al 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 7386c0675c89b12cac1da8e16fc8fc32eb42ca07 Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 20:30:15 +0000 Message-Id: <6a35a6d7.3a74f.44022674@gitrepo.freebsd.org> The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=7386c0675c89b12cac1da8e16fc8fc32eb42ca07 commit 7386c0675c89b12cac1da8e16fc8fc32eb42ca07 Author: Simon J. Gerraty AuthorDate: 2026-06-19 20:29:25 +0000 Commit: Simon J. Gerraty CommitDate: 2026-06-19 20:29:25 +0000 Update dirdpes.mk et al Update to latest dirdeps related makefiles. dirdeps.mk tweaks useful for universe among other corner cases. also additional filtering for bogus paths ending in / gendirdeps.mk allow more debugging also additional filtering for bogus paths ending in / install-new.mk fix bug when isPOSIX_SHELL is true meta2deps.?? handle file names with spaces by ignoring them Reviewed by: stevek Differential Revision: https://reviews.freebsd.org/D57683 --- share/mk/dirdeps.mk | 28 +++++++++++++++++++--------- share/mk/gendirdeps.mk | 14 ++++++++++---- share/mk/install-new.mk | 4 ++-- share/mk/meta2deps.py | 25 ++++++++++++++++--------- share/mk/meta2deps.sh | 15 +++++++++++++-- 5 files changed, 60 insertions(+), 26 deletions(-) diff --git a/share/mk/dirdeps.mk b/share/mk/dirdeps.mk index b281d15ec346..abd3407eddf4 100644 --- a/share/mk/dirdeps.mk +++ b/share/mk/dirdeps.mk @@ -1,8 +1,8 @@ -# $Id: dirdeps.mk,v 1.175 2025/01/05 01:16:19 sjg Exp $ +# $Id: dirdeps.mk,v 1.178 2026/05/09 20:33:46 sjg Exp $ # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2010-2023, Simon J. Gerraty +# Copyright (c) 2010-2026, Simon J. Gerraty # Copyright (c) 2010-2018, Juniper Networks, Inc. # All rights reserved. # @@ -322,6 +322,12 @@ _debug_search = 1 .else _debug_search = 0 .endif +.if ${DEBUG_DIRDEPS:Mno*recurse} != "" +BUILD_DIRDEPS_RECURSE = no +.endif +.if ${DEBUG_DIRDEPS:M-V} != "" +_V_READ_DIRDEPS = yes +.endif # First off, we want to know what ${MACHINE} to build for. # This can be complicated if we are using a mixture of ${MACHINE} specific @@ -585,6 +591,11 @@ BUILD_DIRDEPS_MAKEFILE ?= BUILD_DIRDEPS_OVERRIDES ?= BUILD_DIRDEPS_TARGETS ?= ${.TARGETS} +# sometimes we temporarily want to block updating of DIRDEPS_CACHE +.if ${MK_UPDATE_DIRDEPS_CACHE:Uyes} == "no" && exists(${DIRDEPS_CACHE}) +STATIC_DIRDEPS_CACHE ?= ${DIRDEPS_CACHE} +.endif + .if ${DIRDEPS_CACHE} != ${STATIC_DIRDEPS_CACHE:Uno} && ${DIRDEPS_CACHE:M${SRCTOP}/*} == "" # export this for dirdeps-cache-update.mk DYNAMIC_DIRDEPS_CACHE := ${DIRDEPS_CACHE} @@ -715,12 +726,12 @@ DEP_DIRDEPS_BUILD_DIR_FILTER = u .endif # this is what we start with -__depdirs := ${DIRDEPS:${NSkipDir}:${DEP_DIRDEPS_FILTER:ts:}:C,//+,/,g:O:u:@d@${SRCTOP}/$d@} +__depdirs := ${DIRDEPS:${NSkipDir}:${DEP_DIRDEPS_FILTER:ts:}:C,//+,/,g:S,/$,,:O:u:@d@${SRCTOP}/$d@} # some entries may be qualified with . or . # we can tell the unqualified ones easily - because they exist __unqual_depdirs := ${__depdirs:@d@${exists($d):?$d:}@} -__qual_depdirs := ${__depdirs:${__unqual_depdirs:Uno:${M_ListToSkip}}} +__qual_depdirs := ${__depdirs:${__unqual_depdirs:Uno:${M_ListToSkip}}:C,/(\.[^.]*)$,\1,} .if ${DEP_RELDIR} == ${_DEP_RELDIR} # if it was called out - we likely need it. @@ -745,16 +756,13 @@ _build_dirs += \ ${_machines:Nhost*:@m@${__unqual_depdirs:@d@$d.$m@}@} # qualify everything now -.if ${_debug_reldir} -.info _build_dirs=${_build_dirs:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}} -.endif # make sure we do not mess with qualifying "host" entries _build_dirs := ${_build_dirs:M*.host*:${M_dep_qual_fixes.host:ts:}} \ ${_build_dirs:N*.host*:${M_dep_qual_fixes:ts:}} # some filters can only be applied now _build_dirs := ${_build_dirs:${DEP_DIRDEPS_BUILD_DIR_FILTER:ts:}:O:u} .if ${_debug_reldir} -.info _build_dirs=${_build_dirs:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}} +.info _build_dirs=${_build_dirs:S,^${SRCTOP}/,,:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}} .endif .endif # empty DIRDEPS @@ -791,7 +799,7 @@ dirdeps: ${_build_all_dirs} ${_build_all_dirs}: _DIRDEP_USE .if ${_debug_reldir} -.info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: needs: ${_build_dirs:S,^${SRCTOP}/,,:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}} +.info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: needs: ${_build_all_dirs:S,^${SRCTOP}/,,:${DEBUG_DIRDEPS_LIST_FILTER:U:N/:ts:}} .endif # this builds the dependency graph @@ -858,6 +866,7 @@ DIRDEPS_EXPORT_VARS = DEP_EXPORT_VARS = .endif +.if ${BUILD_DIRDEPS_RECURSE:Uyes} != "no" # Now find more dependencies - and recurse. .for d in ${_build_all_dirs} .if !target(_dirdeps_checked.$d) @@ -909,6 +918,7 @@ DIRDEPS = .endif .endif .endfor +.endif .endif # -V .endif # BUILD_DIRDEPS diff --git a/share/mk/gendirdeps.mk b/share/mk/gendirdeps.mk index ab1786f3603f..e5f536441a8d 100644 --- a/share/mk/gendirdeps.mk +++ b/share/mk/gendirdeps.mk @@ -1,8 +1,8 @@ -# $Id: gendirdeps.mk,v 1.54 2025/08/12 21:36:43 sjg Exp $ +# $Id: gendirdeps.mk,v 1.56 2026/06/19 18:57:57 sjg Exp $ # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2011-2025, Simon J. Gerraty +# Copyright (c) 2011-2026, Simon J. Gerraty # Copyright (c) 2010-2018, Juniper Networks, Inc. # All rights reserved. # @@ -87,6 +87,12 @@ _debug.gendirdeps = 0 all: +.if ${_debug.gendirdeps} +.if ${DEBUG_GENDIRDEPS:M-d*} +.MAKEFLAGS: ${DEBUG_GENDIRDEPS:M-d*} +.endif +.endif + _CURDIR ?= ${.CURDIR} _OBJDIR ?= ${.OBJDIR} _OBJTOP ?= ${OBJTOP} @@ -331,7 +337,7 @@ DIRDEPS += \ # what modifiers do we allow in GENDIRDEPS_FILTER GENDIRDEPS_FILTER_MASK += @CMNS -DIRDEPS := ${DIRDEPS:${GENDIRDEPS_FILTER:UNno:M[${GENDIRDEPS_FILTER_MASK:O:u:ts}]*:ts:}:C,//+,/,g:O:u} +DIRDEPS := ${DIRDEPS:${GENDIRDEPS_FILTER:UNno:M[${GENDIRDEPS_FILTER_MASK:O:u:ts}]*:ts:}:C,//+,/,g:S,/$,,:C,/(\.[^.]+)$,\1,:O:u} .if ${_debug.gendirdeps} .info ${RELDIR}: M2D_OBJROOTS=${M2D_OBJROOTS} @@ -353,7 +359,7 @@ src_dirdep_list = \ SRC_DIRDEPS = \ ${src_dirdep_list:N${RELDIR}:N${RELDIR}/*:C,(/h)/.*,,} -SRC_DIRDEPS := ${SRC_DIRDEPS:${GENDIRDEPS_SRC_FILTER:UN/*:ts:}:C,//+,/,g:O:u} +SRC_DIRDEPS := ${SRC_DIRDEPS:${GENDIRDEPS_SRC_FILTER:UN/*:ts:}:C,//+,/,g:S,/$,,:C,/(\.[^.]+)$,\1,:O:u} # if you want to capture SRC_DIRDEPS in .MAKE.DEPENDFILE put # SRC_DIRDEPS_FILE = ${_DEPENDFILE} diff --git a/share/mk/install-new.mk b/share/mk/install-new.mk index 2fb9725a7a47..001460439ca8 100644 --- a/share/mk/install-new.mk +++ b/share/mk/install-new.mk @@ -1,4 +1,4 @@ -# $Id: install-new.mk,v 1.9 2025/11/19 17:44:15 sjg Exp $ +# $Id: install-new.mk,v 1.10 2026/06/19 19:47:03 sjg Exp $ # # @(#) Copyright (c) 2009, Simon J. Gerraty # @@ -47,7 +47,7 @@ InstallNew= ${CmpCpMv}; InstallNew() { \ for new in "$$@"; do \ if test $$_t $$new; then \ if ${isPOSIX_SHELL:Ufalse}; then \ - target=$${new%.new}; \ + target=$${new%.new*}; \ else \ target=`expr $$new : '\(.*\).new'`; \ fi; \ diff --git a/share/mk/meta2deps.py b/share/mk/meta2deps.py index 77ed86397a0f..a5a64dba3290 100755 --- a/share/mk/meta2deps.py +++ b/share/mk/meta2deps.py @@ -39,7 +39,7 @@ We only pay attention to a subset of the information in the SPDX-License-Identifier: BSD-2-Clause RCSid: - $Id: meta2deps.py,v 1.54 2025/07/24 16:05:48 sjg Exp $ + $Id: meta2deps.py,v 1.56 2026/05/22 00:33:26 sjg Exp $ Copyright (c) 2011-2025, Simon J. Gerraty Copyright (c) 2011-2017, Juniper Networks, Inc. @@ -446,7 +446,7 @@ class MetaFile: version = 0 # unknown if name: - self.name = name; + self.name = name if file: f = file cwd = self.last_dir = self.cwd @@ -515,6 +515,12 @@ class MetaFile: if self.debug > 2: print('op={} elen={} wlen={} line="{}"'.format(w[0], elen, wlen, line.strip()), file=self.debug_out) if wlen != elen: + if wlen > elen and w[0] in 'CELMRW': + # It could just be spaces in pathname. + # More trouble than its worth, just skip it. + if self.debug > 0: + print('Skipping: wrong number of words: expected {} got {} in: {}'.format(elen, wlen, line), file=self.debug_out) + continue raise AssertionError('corrupted filemon data: wrong number of words: expected {} got {} in: {}'.format(elen, wlen, line)) pid = int(w[1]) @@ -669,7 +675,7 @@ class MetaFile: return if os.path.isdir(path): if op in 'RW': - self.last_dir = path; + self.last_dir = path if self.debug > 1: print("ldir=", self.last_dir, file=self.debug_out) return @@ -703,7 +709,7 @@ class MetaFile: self.seenit(dir) -def main(argv, klass=MetaFile, xopts='', xoptf=None): +def main(argv, klass=MetaFile, xopts='', xoptf=None, conf=None): """Simple driver for class MetaFile. Usage: @@ -743,11 +749,12 @@ def main(argv, klass=MetaFile, xopts='', xoptf=None): except: pass - conf = { - 'SRCTOPS': [], - 'OBJROOTS': [], - 'EXCLUDES': [], - } + if not conf: + conf = {} + + for k in ['EXCLUDES', 'OBJROOTS', 'SRCTOPS']: + if k not in conf: + conf[k] = [] conf['SB'] = os.getenv('SB', '') diff --git a/share/mk/meta2deps.sh b/share/mk/meta2deps.sh index 293ebdab6e7c..454b8eeb861c 100755 --- a/share/mk/meta2deps.sh +++ b/share/mk/meta2deps.sh @@ -77,7 +77,7 @@ # RCSid: -# $Id: meta2deps.sh,v 1.26 2025/12/08 17:34:02 sjg Exp $ +# $Id: meta2deps.sh,v 1.27 2026/05/22 00:33:26 sjg Exp $ # SPDX-License-Identifier: BSD-2-Clause # @@ -162,6 +162,10 @@ error() { exit 1 } +warning() { + echo "WARNING: $@" >&2 +} + meta2deps() { DPDEPS= SRCTOPS=$SRCTOP @@ -273,8 +277,15 @@ meta2deps() { ;; \#*) ;; # ok [LM],) error "missing path2 in: '$op $pid $path'";; - [LMX],*" "*) error "wrong number of words in: '$op $pid $path $path2'";; + [LMX],*" "*) + warning "wrong number of words in: '$op $pid $path $path2'" + continue + ;; *,|[LMX],*) ;; # ok + [CELMRW],*) + warning "wrong number of words in: '$op $pid $path $path2'" + continue + ;; *) error "wrong number of words in: '$op $pid $path $path2'";; esac # we track cwd and ldir (of interest) per pid From nobody Fri Jun 19 21:03:05 2026 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 4ghqnF4PzGz6gqwW; Fri, 19 Jun 2026 21:03:13 +0000 (UTC) (envelope-from ziaee@FreeBSD.org) Received: from mailtransmit05.runbox.com (mailtransmit05.runbox.com [IPv6:2a0c:5a00:149::26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghqnD6qCTz48P3; Fri, 19 Jun 2026 21:03:12 +0000 (UTC) (envelope-from ziaee@FreeBSD.org) Authentication-Results: mx1.freebsd.org; none Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit05.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1wagMk-00ACO1-Hq; Fri, 19 Jun 2026 23:03:06 +0200 Received: from [10.9.9.129] (helo=rmmprod07.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1wagMk-0003JK-2f; Fri, 19 Jun 2026 23:03:06 +0200 Received: from mail by rmmprod07.runbox with local (Exim 4.86_2) (envelope-from ) id 1wagMk-00012M-0O; Fri, 19 Jun 2026 23:03:06 +0200 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Received: from [Authenticated alias (960477)] by runbox.com with http (RMM6); Fri, 19 Jun 2026 21:03:05 GMT From: "Alexander Ziaee" To: "Dag-Erling Smørgrav" CC: "src-committers" , "dev-commits-src-all" , "dev-commits-src-main" , "Artem Bunichev" Subject: Re: git: b3dfd5d59c4a - main - rmdir.1: Document non-POSIX -v option Date: Fri, 19 Jun 2026 21:03:05 +0000 (UTC) X-RMM-Aliasid: 960477 X-Mailer: RMM6 In-Reply-To: <865x3euvwz.fsf@ltc.des.dev> Message-Id: X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:50304, ipnet:2a0c:5a00::/29, country:NO] X-Rspamd-Queue-Id: 4ghqnD6qCTz48P3 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On 2026-06-19 16:17 -04:00 EDT, "Dag-Erling Sm=C3=B8rgrav" wrote: > Alexander Ziaee writes: >> @@ -104,6 +104,10 @@ The >> utility is expected to be >> .St -p1003.2 >> compatible. >> +.Pp >> +The >> +.Fl v >> +option is an extension to that specification. >=20 > This is not the wording we normally use for these cases. We use in in rm(1), but we do not have a style guide and I am not aware of = a consistent pattern. What would you prefer? Best, Alex= From nobody Fri Jun 19 21:50:56 2026 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 4ghrrL6qhRz6gwsj; Fri, 19 Jun 2026 21:50:58 +0000 (UTC) (envelope-from des@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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghrrL3ltZz4FTl; Fri, 19 Jun 2026 21:50:58 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781905858; 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=JLy28XR4MZ1iWmkzSyoJRLqP1WlMOE74BtyRJjCfg9g=; b=AlLvBLHgcbWQM+Ow/5891Xl6NlB5D9CJddhA19ttaLwSNqoRQnokXHZbBxwWTFSIswGgwD sKO6Yg+TTiiyE8ytHMb8xVKZmGh6d+CZWzzPU6lG9KTK7gnNgNpXUfu0zRYMWHyQKPbSl7 ThGxmBOPaRSNbb93w7gWTSvANYhqg0bweI18aSRvmAilm2SLG544JiS6RWngA4Bk4Bg4Mr Nlv67z3XJqJAvQSlCfjS8XtDfVywAWdwQ5ekD8+vPREBw060KzS9PXlruF+eU5L9+0W/GI b1V2aaHZBI6N1BD0QgvhXVOeRq2WGObe7wY3Ik2c7aVn4ycmccphlLYDzdrTeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781905858; a=rsa-sha256; cv=none; b=i8IR70oCo29sjACBk7Txq7oTZgHldzt21L0akHcDv76tWMfZ7wuUPf8qMG7Q2WpouWjPnV uRO589FC16FGph70z6nreQYQtgU9hutd6JjBkJiaeEfmkANk383oKMn+dU3LGSiyMoAzCo jV7UPLQFbvhet9RykpfPIDWIPhWyQsLe4KF0deUUJZbpxgvUu2GXl9lX4C/2h8US3vDwe6 8fgBgxXT2xd7jxliBts3ki0r6IECL1sSS6yR88JUhp7QFeHqS2WmOMrLNp8biOlzhp/NdT 89pPwvgEpuZ+sFdJur30KCdeE5lb08OtJ7djoT0J2PVhC43Mbr/kwFadlMNSDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781905858; 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=JLy28XR4MZ1iWmkzSyoJRLqP1WlMOE74BtyRJjCfg9g=; b=T5JfjLmIUeGe0q0ExY4rTdftNWZp61sGOTg84JMXrmS8g+Eo9GcK2fyPh0FEGQXw5E+GbB eP5OUXTEE0ZbQER5UiMQkO8oglfynEMw/1ksDmgoe6XFXQuKtb/QRoYXtWag1fpwoMG98L yvXEI+VxEzbFy1xlr9rRVfhyZevND6w7jNVmTBPsoji+gCCegjop98pAxDqsdt4Xsm3ilo EJ7WCbgwAtCP9hW0fkOF+wgR2IjTrBx+D4NGuaF93k4FCgct2F065/H3QpVfyaq3TXTDhw eprsjNcW5oYIkhhpEmrBJKxXKmgVSra/CfHqkkgbTa1sDY3ucbsBabR0LHNW2g== Received: from ltc.des.dev (unknown [92.183.55.143]) (using TLSv1.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: des/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4ghrrL1THcz12ll; Fri, 19 Jun 2026 21:50:58 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id 6E4755060E; Fri, 19 Jun 2026 23:50:56 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "Alexander Ziaee" Cc: "src-committers" , "dev-commits-src-all" , "dev-commits-src-main" , "Artem Bunichev" Subject: Re: git: b3dfd5d59c4a - main - rmdir.1: Document non-POSIX -v option In-Reply-To: (Alexander Ziaee's message of "Fri, 19 Jun 2026 21:03:05 +0000 (UTC)") References: User-Agent: Gnus/5.13 (Gnus v5.13) Date: Fri, 19 Jun 2026 23:50:56 +0200 Message-ID: <86zf0qtd1b.fsf@ltc.des.dev> 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Alexander Ziaee writes: > Dag-Erling Sm=C3=B8rgrav writes: > > Alexander Ziaee writes: > > > +.Pp > > > +The > > > +.Fl v > > > +option is an extension to that specification. > > This is not the wording we normally use for these cases. > We use in in rm(1), but we do not have a style guide and I am not > aware of a consistent pattern. What would you prefer? Right, so I thought we'd standardized on The .Fl v option is a non-standard extension. but it's actually more varied than that, some pages say =E2=80=9Ca FreeBSD extension=E2=80=9D or =E2=80=9Ca BSD extension=E2=80=9D or even =E2=80=9Ca = GNU extension=E2=80=9D in cases where we copied GNU's homework, and some just say =E2=80=9Can extension=E2=80=9D.= We should clean that up. There is precedent for =E2=80=9Can extension to that specification=E2=80=9D= but only in pages where the previous sentence uses the word =E2=80=9Cspecification=E2= =80=9D. I would prefer not standardizing on a wording that relies on external context. Furthermore, rmdir(1) does not follow the standard pattern, so maybe we should start by fixing that: The .Nm utility is expected to conform to the .St -p1003.1-2008 specification. That's not the latest version of the standard, but we've made no effort to update our codebase for 1003.1-2024, so it's the most recent one we can plausibly claim conformance to (although in this particular case the standard hasn't changed so we can probably go ahead with 1003.1-2024). Finally, the SEE ALSO section should reference rmdir(2). DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Fri Jun 19 22:00:18 2026 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 4ghs370bSpz6gxkr for ; Fri, 19 Jun 2026 22:00: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghs3706Ngz4G4g for ; Fri, 19 Jun 2026 22:00:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781906419; 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=0tJkHgDZJzmdm/WvZ8ZwwQR9q/ds+bczUhdLFPK/7Ok=; b=RZfMePW8P5oDYkg/jS3PaOQKCaeOvQu1SOL9XE+eEM8+E7QNP11C/pQ2uT/tLUJhZLI2hi Ngx21BpjafKPEC8ukVlnXqhm2eDzl+jyiVMVR9pcCrAf0inp/+YJgoRIYitKih9EWLgA3K bBkJhs5gsDElzjn0zMYsOwg/zZJI3gwanJlXZ/PC3U7Kgu9qPWYJeOjXSzOpbppUzf6HEB AUGve6s71EssdtMc+kKuZDIWdlO45Rt+xttUkKLHYB6iVyy0He5aaAAcTx812lHHlxKarj Q4nqz0BbETBIo+dw/Qeq3r+/sFW73ZORKn7YLUSWRLx/dXrktYaKeI+nEsMBGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781906419; a=rsa-sha256; cv=none; b=W0Rj2RBJeYdj8I+yKcAZHvfQSDdr7sqmcGvOUXJUTSQCY1yMY4rL96jj40CGAz7uXus24l xYC1E0lxR+U729V1Y5f5etRLkUENg0CjN3EZcTEBjh0KXAfSizRewMA7DFZMB1FcQsT3xp gAub1B6Q717lTsRwKE7zETMPQMj8gKWwdDVuiXQ/VTKshUPjn0VQi3renYvAHDtBNeakIH XlY0vpMZgwIZXtfyuo8bAXe+yPO1lTrFuJYYQ+4qIyNyZkrca0Ft++FL4bGciXzlGzvKvr 6RwPd05ZWJw35AO1vDXop+415GLL2LOv93iq3ypT7zOz2IzC+NChgNjh8DQnzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781906419; 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=0tJkHgDZJzmdm/WvZ8ZwwQR9q/ds+bczUhdLFPK/7Ok=; b=qPL9G8ONGkWuwsbfIK+VuO02rNdFCXhju1uZYIqwosRPnz3VQbmL2DUDmFA7K23vjh84u0 QlZXYmyRhgPKzlyJGmGuBcRtk94g8mEq8u0JWWJoKWNcEJC+MyqyiabNoz5m34JM7z4tSz NXYm7kxDCKldfGiqwceb0T/Lmddl3LOFq7KS4+QCm5xOTCo1vWGy2yaCU8tcxtC25+/iuP vMdptW2q8EkB8UDz+GkRm7cA1kmIlptLoLkxuguu3DiaUFaaojeh2axy3tmABGtfC4axJJ u1unC9DJdd/OeF2VVbGEWOEVOrELRevtEudf/zDkY6w2RpAo3XIcI/2Xh4sjCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghs365sCzz13YV for ; Fri, 19 Jun 2026 22:00:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 44afb by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 19 Jun 2026 22:00:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Kubaj Subject: git: 255538cd9060 - main - powerpc64le: switch long double to IEEE binary128 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkubaj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 255538cd906045095d0c2113ae6c4731ce36c0cf Auto-Submitted: auto-generated Date: Fri, 19 Jun 2026 22:00:18 +0000 Message-Id: <6a35bbf2.44afb.6a2dde3e@gitrepo.freebsd.org> The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/src/commit/?id=255538cd906045095d0c2113ae6c4731ce36c0cf commit 255538cd906045095d0c2113ae6c4731ce36c0cf Author: Piotr Kubaj AuthorDate: 2026-06-15 15:37:26 +0000 Commit: Piotr Kubaj CommitDate: 2026-06-19 21:25:39 +0000 powerpc64le: switch long double to IEEE binary128 Change powerpc64le's long double from 64-bit double to IEEE 754 binary128 (quad, 113-bit mantissa), matching aarch64 and riscv64. Gated on FreeBSD 16 and powerpc64le only. Differential Revision: https://reviews.freebsd.org/D57388 Reviewed by: adrian Relnotes: yes --- UPDATING | 13 +++++ contrib/llvm-project/clang/lib/Basic/Targets/PPC.h | 7 ++- .../llvm-project/clang/lib/CodeGen/CGBuiltin.cpp | 6 ++- .../llvm-project/clang/lib/Driver/ToolChain.cpp | 4 ++ lib/clang/freebsd_cc_version.h | 2 +- lib/libc/powerpc64/Makefile.inc | 6 +++ lib/libc/powerpc64/_fpmath.h | 29 +++++++++-- lib/libc/powerpc64/gd_qnan.h | 6 +-- lib/libc/tests/gen/Makefile | 1 + lib/libc/tests/stdlib/Makefile | 1 + lib/libcompiler_rt/Makefile.inc | 59 ++++++++++++++++++++++ lib/libcompiler_rt/comparekf2.c | 43 ++++++++++++++++ lib/libcxxrt/Makefile | 12 ++++- lib/msun/powerpc/Makefile.inc | 7 +++ lib/msun/powerpc/Symbol_f128.map | 36 +++++++++++++ lib/msun/powerpc/ld128_compat.c | 43 ++++++++++++++++ lib/msun/src/s_nearbyint.c | 11 ++-- lib/msun/tests/Makefile | 1 + share/man/man7/arch.7 | 6 +-- sys/powerpc/include/float.h | 17 +++++++ sys/sys/param.h | 2 +- 21 files changed, 292 insertions(+), 20 deletions(-) diff --git a/UPDATING b/UPDATING index a83925a811a4..f164208e9553 100644 --- a/UPDATING +++ b/UPDATING @@ -27,9 +27,22 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 16.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20260620: + On powerpc64le, long double is now IEEE 754 binary128 (quad + precision, 113-bit mantissa) instead of 64-bit double. This is an + ABI-incompatible change with no symbol versioning: all C and C++ + code that passes, returns, or stores long double (or long double + complex) -- including printf/scanf "%Lf", strtold, and the libm + *l() routines -- must be rebuilt against the new world. Mixing old + and new objects that exchange long double values will silently + corrupt data. Rebuild all installed ports and any out-of-tree + software after upgrading. Big-endian powerpc and powerpc64 are + unaffected and keep 64-bit long double. + 20260521: Audio devices are now created with GID 43 / audio. You will need to add users who need access to audio devices to this group. + 20260512: "bsdinstall script" will now do a pkgbase installation by default. To revert to the legacy distset installation, set "DISTRIBUTIONS" in diff --git a/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h b/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h index 9f3a4cd2da71..5c47e0dca666 100644 --- a/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h +++ b/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h @@ -468,7 +468,12 @@ public: DataLayout += "-i64:64-i128:128-n32:64"; } - if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) { + if (Triple.isOSFreeBSD() && Triple.getArch() == llvm::Triple::ppc64le && + Triple.getOSMajorVersion() >= 16) { + LongDoubleWidth = LongDoubleAlign = 128; + LongDoubleFormat = &llvm::APFloat::IEEEquad(); + } else if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || + Triple.isMusl()) { LongDoubleWidth = LongDoubleAlign = 64; LongDoubleFormat = &llvm::APFloat::IEEEdouble(); } diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp index 5f2eb76e7bac..7cd155191861 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGBuiltin.cpp @@ -228,7 +228,10 @@ llvm::Constant *CodeGenModule::getBuiltinLibFunction(const FunctionDecl *FD, else { // TODO: This mutation should also be applied to other targets other than // PPC, after backend supports IEEE 128-bit style libcalls. - if (getTriple().isPPC64() && + // FreeBSD's powerpc64le has a single IEEE-128 long double format and uses + // the unsuffixed libm names, so skip the IEEE-128 libcall redirection + // there; other PPC64 IEEE-128 targets keep it. + if (getTriple().isPPC64() && !getTriple().isOSFreeBSD() && &getTarget().getLongDoubleFormat() == &llvm::APFloat::IEEEquad() && F128Builtins.contains(BuiltinID)) Name = F128Builtins[BuiltinID]; @@ -2601,6 +2604,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, // TODO: This mutation should also be applied to other targets other than PPC, // after backend supports IEEE 128-bit style libcalls. if (getTarget().getTriple().isPPC64() && + !getTarget().getTriple().isOSFreeBSD() && &getTarget().getLongDoubleFormat() == &llvm::APFloat::IEEEquad()) BuiltinID = mutateLongDoubleBuiltin(BuiltinID); diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChain.cpp b/contrib/llvm-project/clang/lib/Driver/ToolChain.cpp index 07a3ae925f96..1171b2abb590 100644 --- a/contrib/llvm-project/clang/lib/Driver/ToolChain.cpp +++ b/contrib/llvm-project/clang/lib/Driver/ToolChain.cpp @@ -193,6 +193,10 @@ bool ToolChain::useRelaxRelocations() const { } bool ToolChain::defaultToIEEELongDouble() const { + if (getTriple().isOSFreeBSD() && + getTriple().getArch() == llvm::Triple::ppc64le && + getTriple().getOSMajorVersion() >= 16) + return true; return PPC_LINUX_DEFAULT_IEEELONGDOUBLE && getTriple().isOSLinux(); } diff --git a/lib/clang/freebsd_cc_version.h b/lib/clang/freebsd_cc_version.h index cf525916fe29..584e3adfb3fd 100644 --- a/lib/clang/freebsd_cc_version.h +++ b/lib/clang/freebsd_cc_version.h @@ -1 +1 @@ -#define FREEBSD_CC_VERSION 1600001 +#define FREEBSD_CC_VERSION 1600002 diff --git a/lib/libc/powerpc64/Makefile.inc b/lib/libc/powerpc64/Makefile.inc index 734afe95f243..1289a48baa06 100644 --- a/lib/libc/powerpc64/Makefile.inc +++ b/lib/libc/powerpc64/Makefile.inc @@ -1,3 +1,9 @@ +.if ${MACHINE_ARCH} == "powerpc64le" +# Long double is IEEE binary128 +GDTOASRCS+=strtorQ.c +SRCS+=machdep_ldisQ.c +.else # Long double is 64-bits SRCS+=machdep_ldisd.c +.endif SYM_MAPS+=${LIBC_SRCTOP}/powerpc64/Symbol.map diff --git a/lib/libc/powerpc64/_fpmath.h b/lib/libc/powerpc64/_fpmath.h index 9bc7450aacaf..ad640cb3ad41 100644 --- a/lib/libc/powerpc64/_fpmath.h +++ b/lib/libc/powerpc64/_fpmath.h @@ -28,25 +28,43 @@ union IEEEl2bits { long double e; - struct { #if _BYTE_ORDER == _LITTLE_ENDIAN - unsigned int manl :32; - unsigned int manh :20; - unsigned int exp :11; + struct { + unsigned long manl :64; + unsigned long manh :48; + unsigned int exp :15; unsigned int sign :1; + } bits; + struct { + unsigned long manl :64; + unsigned long manh :48; + unsigned int expsign :16; + } xbits; #else /* _BYTE_ORDER == _LITTLE_ENDIAN */ + struct { unsigned int sign :1; unsigned int exp :11; unsigned int manh :20; unsigned int manl :32; -#endif } bits; +#endif }; #define mask_nbit_l(u) ((void)0) #define LDBL_IMPLICIT_NBIT #define LDBL_NBIT 0 +#if _BYTE_ORDER == _LITTLE_ENDIAN +#define LDBL_MANH_SIZE 48 +#define LDBL_MANL_SIZE 64 + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)((u).bits.manl >> 32); \ + (a)[2] = (uint32_t)(u).bits.manh; \ + (a)[3] = (uint32_t)((u).bits.manh >> 32); \ +} while(0) +#else /* _BYTE_ORDER == _LITTLE_ENDIAN */ #define LDBL_MANH_SIZE 20 #define LDBL_MANL_SIZE 32 @@ -54,3 +72,4 @@ union IEEEl2bits { (a)[0] = (uint32_t)(u).bits.manl; \ (a)[1] = (uint32_t)(u).bits.manh; \ } while(0) +#endif /* _BYTE_ORDER == _LITTLE_ENDIAN */ diff --git a/lib/libc/powerpc64/gd_qnan.h b/lib/libc/powerpc64/gd_qnan.h index 3e78a83adc71..37867d2015e5 100644 --- a/lib/libc/powerpc64/gd_qnan.h +++ b/lib/libc/powerpc64/gd_qnan.h @@ -10,13 +10,13 @@ #define d_QNAN0 0x0 #define d_QNAN1 0x7ff80000 #define ld_QNAN0 0x0 -#define ld_QNAN1 0x7ff80000 +#define ld_QNAN1 0x0 #define ld_QNAN2 0x0 -#define ld_QNAN3 0x0 +#define ld_QNAN3 0x7fff8000 #define ldus_QNAN0 0x0 #define ldus_QNAN1 0x0 #define ldus_QNAN2 0x0 -#define ldus_QNAN3 0x7ff8 +#define ldus_QNAN3 0x0 #define ldus_QNAN4 0x0 #else #define d_QNAN0 0x7ff80000 diff --git a/lib/libc/tests/gen/Makefile b/lib/libc/tests/gen/Makefile index 395171a86bac..f5d57275cb44 100644 --- a/lib/libc/tests/gen/Makefile +++ b/lib/libc/tests/gen/Makefile @@ -60,6 +60,7 @@ CFLAGS+= -DTEST_LONG_DOUBLE .if ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "i386" || \ + ${MACHINE_ARCH} == "powerpc64le" || \ ${MACHINE_CPUARCH} == "riscv" CFLAGS+= -D__HAVE_LONG_DOUBLE .endif diff --git a/lib/libc/tests/stdlib/Makefile b/lib/libc/tests/stdlib/Makefile index a714a8cab774..0dbe059e5264 100644 --- a/lib/libc/tests/stdlib/Makefile +++ b/lib/libc/tests/stdlib/Makefile @@ -30,6 +30,7 @@ CFLAGS+= -D__HAVE_FENV .if ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "i386" || \ + ${MACHINE_ARCH} == "powerpc64le" || \ ${MACHINE_CPUARCH} == "riscv" CFLAGS+= -D__HAVE_LONG_DOUBLE .endif diff --git a/lib/libcompiler_rt/Makefile.inc b/lib/libcompiler_rt/Makefile.inc index 57cfdee95541..187b1ebee76d 100644 --- a/lib/libcompiler_rt/Makefile.inc +++ b/lib/libcompiler_rt/Makefile.inc @@ -4,6 +4,12 @@ CRTARCH= ${MACHINE_CPUARCH:C/amd64/x86_64/:C/powerpc/ppc/} CRTSRC= ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins +.if ${MACHINE_ARCH} == "powerpc64le" +# Long double is IEEE binary128. Search the generic builtins first so the +# IEEE-128 sources win over the IBM double-double versions of the same file +# names in the ppc/ directory. +.PATH: ${CRTSRC} +.endif .PATH: ${CRTSRC}/${CRTARCH} .PATH: ${CRTSRC} @@ -207,6 +213,59 @@ SRCF+= trunctfhf2 SRCF+= trunctfsf2 .endif +# +# IEEE binary128 long double support for powerpc64le. PowerPC names the +# IEEE-128 soft-float builtins with a "kf" infix (KFmode) instead of the +# generic "tf" (see clang's PPCSystemLibrary in RuntimeLibcalls.td), so build +# the generic IEEE-128 sources but rename each exported symbol to its kf name. +# The .PATH reordering above makes these resolve to the generic implementations +# rather than the IBM double-double versions in ppc/. +# +.if ${MACHINE_ARCH} == "powerpc64le" +.for _f _old _new in \ + addtf3 __addtf3 __addkf3 \ + subtf3 __subtf3 __subkf3 \ + multf3 __multf3 __mulkf3 \ + divtf3 __divtf3 __divkf3 \ + powitf2 __powitf2 __powikf2 \ + extendsftf2 __extendsftf2 __extendsfkf2 \ + extenddftf2 __extenddftf2 __extenddfkf2 \ + trunctfsf2 __trunctfsf2 __trunckfsf2 \ + trunctfdf2 __trunctfdf2 __trunckfdf2 \ + fixtfsi __fixtfsi __fixkfsi \ + fixtfdi __fixtfdi __fixkfdi \ + fixtfti __fixtfti __fixkfti \ + fixunstfsi __fixunstfsi __fixunskfsi \ + fixunstfdi __fixunstfdi __fixunskfdi \ + fixunstfti __fixunstfti __fixunskfti \ + floatsitf __floatsitf __floatsikf \ + floatditf __floatditf __floatdikf \ + floattitf __floattitf __floattikf \ + floatunsitf __floatunsitf __floatunsikf \ + floatunditf __floatunditf __floatundikf \ + floatuntitf __floatuntitf __floatuntikf +SRCF+= ${_f} +CFLAGS.${_f}.c+= -D${_old}=${_new} +.endfor + +# subtf3.c implements __subtf3 as __addtf3(a, -b), so its hardcoded call to +# __addtf3 must also be renamed to resolve to the kf-named add. +CFLAGS.subtf3.c+= -D__addtf3=__addkf3 + +# Complex IEEE-128 multiply/divide keep the generic tf names: PowerPC does not +# override MUL_C128/DIV_C128, so clang emits __multc3/__divtc3 for IEEE-128. +SRCF+= divtc3 +SRCF+= multc3 + +# The kf comparisons cannot use a -D rename of comparetf2.c because its internal +# COMPILER_RT_ALIAS stringizes the (unrenamed) target name; provide them here. +# comparekf2.c is FreeBSD-local, so put its directory on .PATH: this fragment is +# also .include'd by libgcc_s/libgcc_eh, whose .CURDIR differs from ours. +.PATH: ${SRCTOP}/lib/libcompiler_rt +SRCS+= comparekf2.c +CFLAGS.comparekf2.c+= -I${CRTSRC} +.endif + # These are already shipped by libc.a on some architectures. .if ${MACHINE_CPUARCH} != "riscv" SRCF+= adddf3 diff --git a/lib/libcompiler_rt/comparekf2.c b/lib/libcompiler_rt/comparekf2.c new file mode 100644 index 000000000000..bee74911c5db --- /dev/null +++ b/lib/libcompiler_rt/comparekf2.c @@ -0,0 +1,43 @@ +//===-- comparekf2.c - IEEE-128 comparisons for powerpc64le -----*- 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 +// +//===----------------------------------------------------------------------===// +// +// PowerPC names the IEEE binary128 comparison soft-float routines with a "kf" +// infix instead of the generic "tf". The semantics are identical to the +// generic comparetf2.c routines; only the exported names differ. We provide +// them here because comparetf2.c cannot be reused via a -D rename: its libgcc +// compatibility aliases stringize the (unrenamed) target symbol name. +// +// __lekf2(a,b) returns -1 if a < b, 0 if a == b, 1 if a > b, 1 if NaN +// __gekf2(a,b) returns -1 if a < b, 0 if a == b, 1 if a > b, -1 if NaN +// __unordkf2(a,b) returns 1 if either operand is NaN, 0 otherwise +// +//===----------------------------------------------------------------------===// + +#define QUAD_PRECISION +#include "fp_lib.h" + +#if defined(CRT_HAS_TF_MODE) +#include "fp_compare_impl.inc" + +COMPILER_RT_ABI CMP_RESULT __eqkf2(fp_t a, fp_t b) { return __leXf2__(a, b); } + +COMPILER_RT_ABI CMP_RESULT __nekf2(fp_t a, fp_t b) { return __leXf2__(a, b); } + +COMPILER_RT_ABI CMP_RESULT __ltkf2(fp_t a, fp_t b) { return __leXf2__(a, b); } + +COMPILER_RT_ABI CMP_RESULT __lekf2(fp_t a, fp_t b) { return __leXf2__(a, b); } + +COMPILER_RT_ABI CMP_RESULT __gtkf2(fp_t a, fp_t b) { return __geXf2__(a, b); } + +COMPILER_RT_ABI CMP_RESULT __gekf2(fp_t a, fp_t b) { return __geXf2__(a, b); } + +COMPILER_RT_ABI CMP_RESULT __unordkf2(fp_t a, fp_t b) { + return __unordXf2__(a, b); +} + +#endif diff --git a/lib/libcxxrt/Makefile b/lib/libcxxrt/Makefile index 0f203b3a7cb1..4a61e84be79f 100644 --- a/lib/libcxxrt/Makefile +++ b/lib/libcxxrt/Makefile @@ -33,11 +33,19 @@ VERSION_MAP= Version-32.map VERSION_MAP= Version-64.map .endif +# On powerpc64le long double is IEEE binary128, which clang mangles as +# u9__ieee128 ("__ieee128" demangled) instead of the generic "long double" (e). +# Rewrite the typeinfo entries so the version script matches the emitted symbols. +LDBL_SED= +.if ${MACHINE_ARCH} == "powerpc64le" +LDBL_SED= -e 's/long double/__ieee128/g' +.endif + Version-32.map: Version.map - sed 's/%%NEW_DELETE_TYPE%%/int/' ${.ALLSRC} > ${.TARGET} + sed -e 's/%%NEW_DELETE_TYPE%%/int/' ${LDBL_SED} ${.ALLSRC} > ${.TARGET} Version-64.map: Version.map - sed 's/%%NEW_DELETE_TYPE%%/long/' ${.ALLSRC} > ${.TARGET} + sed -e 's/%%NEW_DELETE_TYPE%%/long/' ${LDBL_SED} ${.ALLSRC} > ${.TARGET} .endif .include diff --git a/lib/msun/powerpc/Makefile.inc b/lib/msun/powerpc/Makefile.inc index 2ae9bacdaab0..d0e6078e358c 100644 --- a/lib/msun/powerpc/Makefile.inc +++ b/lib/msun/powerpc/Makefile.inc @@ -1 +1,8 @@ +.if ${MACHINE_ARCH} == "powerpc64le" +LDBL_PREC = 113 +ARCH_SRCS = ld128_compat.c +CFLAGS.ld128_compat.c+= -fno-builtin +SYM_MAPS+= ${.CURDIR}/${ARCH_SUBDIR}/Symbol_f128.map +.else LDBL_PREC = 53 +.endif diff --git a/lib/msun/powerpc/Symbol_f128.map b/lib/msun/powerpc/Symbol_f128.map new file mode 100644 index 000000000000..d520bfaa0fab --- /dev/null +++ b/lib/msun/powerpc/Symbol_f128.map @@ -0,0 +1,36 @@ +/* + */ +FBSD_1.9 { + acosf128; + asinf128; + atanf128; + atan2f128; + ceilf128; + cosf128; + coshf128; + expf128; + exp2f128; + floorf128; + fmaf128; + fmaxf128; + fminf128; + fmodf128; + ldexpf128; + llroundf128; + logf128; + log10f128; + log2f128; + lroundf128; + modff128; + nearbyintf128; + powf128; + rintf128; + roundf128; + sincosf128; + sinf128; + sinhf128; + sqrtf128; + tanf128; + tanhf128; + truncf128; +}; diff --git a/lib/msun/powerpc/ld128_compat.c b/lib/msun/powerpc/ld128_compat.c new file mode 100644 index 000000000000..94d6bdc2f09b --- /dev/null +++ b/lib/msun/powerpc/ld128_compat.c @@ -0,0 +1,43 @@ +/* + * On powerpc64le, long double is IEEE binary128, which the compiler treats as + * _Float128. clang lowers long double libm calls to the f128-suffixed entry + * points (sinf128, powf128, ...) rather than the *l names. Provide those entry + * points as thin forwarders to the existing long double implementations. + * + * This file is compiled with -fno-builtin so the calls below are not themselves + * rewritten back to the f128 names, which would recurse infinitely. + */ +#include + +long double acosf128(long double x) { return acosl(x); } +long double asinf128(long double x) { return asinl(x); } +long double atanf128(long double x) { return atanl(x); } +long double atan2f128(long double y, long double x) { return atan2l(y, x); } +long double ceilf128(long double x) { return ceill(x); } +long double cosf128(long double x) { return cosl(x); } +long double coshf128(long double x) { return coshl(x); } +long double expf128(long double x) { return expl(x); } +long double exp2f128(long double x) { return exp2l(x); } +long double floorf128(long double x) { return floorl(x); } +long double fmaf128(long double x, long double y, long double z) { return fmal(x, y, z); } +long double fmaxf128(long double x, long double y) { return fmaxl(x, y); } +long double fminf128(long double x, long double y) { return fminl(x, y); } +long double fmodf128(long double x, long double y) { return fmodl(x, y); } +long double ldexpf128(long double x, int n) { return ldexpl(x, n); } +long long llroundf128(long double x) { return llroundl(x); } +long double logf128(long double x) { return logl(x); } +long double log10f128(long double x) { return log10l(x); } +long double log2f128(long double x) { return log2l(x); } +long lroundf128(long double x) { return lroundl(x); } +long double modff128(long double x, long double *iptr) { return modfl(x, iptr); } +long double nearbyintf128(long double x) { return nearbyintl(x); } +long double powf128(long double x, long double y) { return powl(x, y); } +long double rintf128(long double x) { return rintl(x); } +long double roundf128(long double x) { return roundl(x); } +void sincosf128(long double x, long double *s, long double *c) { sincosl(x, s, c); } +long double sinf128(long double x) { return sinl(x); } +long double sinhf128(long double x) { return sinhl(x); } +long double sqrtf128(long double x) { return sqrtl(x); } +long double tanf128(long double x) { return tanl(x); } +long double tanhf128(long double x) { return tanhl(x); } +long double truncf128(long double x) { return truncl(x); } diff --git a/lib/msun/src/s_nearbyint.c b/lib/msun/src/s_nearbyint.c index 3dcaf98b369a..6558ab0358b4 100644 --- a/lib/msun/src/s_nearbyint.c +++ b/lib/msun/src/s_nearbyint.c @@ -29,6 +29,8 @@ #include #include +#pragma STDC FENV_ACCESS ON + /* * We save and restore the floating-point environment to avoid raising * an inexact exception. We can get away with using fesetenv() @@ -36,9 +38,12 @@ * because the only exception defined for rint() is overflow, and * rounding can't overflow as long as emax >= p. * - * The volatile keyword is needed below because clang incorrectly assumes - * that rint won't raise any floating-point exceptions. Declaring ret volatile - * is sufficient to trick the compiler into doing the right thing. + * FENV_ACCESS ON is required so the compiler does not move the rounding + * (which it may inline as a hardware round-to-integer instruction) across + * the fegetenv()/fesetenv() calls. Without it, clang hoists the rounding + * before fegetenv() on the binary128 path, so the saved environment already + * carries the inexact flag and fesetenv() restores it, leaking the exception. + * The volatile keyword on ret is kept as a belt-and-suspenders guard. */ #define DECL(type, fn, rint) \ type \ diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile index d723e0aaf656..5d8537c74a0a 100644 --- a/lib/msun/tests/Makefile +++ b/lib/msun/tests/Makefile @@ -13,6 +13,7 @@ CFLAGS+= -I${TESTSRC:H}/libc/gen .if ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "i386" || \ + ${MACHINE_ARCH} == "powerpc64le" || \ ${MACHINE_CPUARCH} == "riscv" CFLAGS+= -D__HAVE_LONG_DOUBLE .endif diff --git a/share/man/man7/arch.7 b/share/man/man7/arch.7 index 05f657d14ee4..09aee577b340 100644 --- a/share/man/man7/arch.7 +++ b/share/man/man7/arch.7 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 5, 2026 +.Dd June 20, 2026 .Dt ARCH 7 .Os .Sh NAME @@ -235,7 +235,7 @@ Machine-dependent type sizes: .It i386 Ta 4 Ta 4 Ta 12 Ta 4 .It powerpc Ta 4 Ta 4 Ta 8 Ta 8 .It powerpc64 Ta 8 Ta 8 Ta 8 Ta 8 -.It powerpc64le Ta 8 Ta 8 Ta 8 Ta 8 +.It powerpc64le Ta 8 Ta 8 Ta 16 Ta 8 .It riscv64 Ta 8 Ta 8 Ta 16 Ta 8 .It riscv64c Ta 8 Ta 16 Ta 16 Ta 8 .El @@ -336,7 +336,7 @@ currently supports Sv39 and Sv48 and defaults to using Sv39. .It i386 Ta hard Ta hard, 80 bit .It powerpc Ta hard Ta hard, double precision .It powerpc64 Ta hard Ta hard, double precision -.It powerpc64le Ta hard Ta hard, double precision +.It powerpc64le Ta hard Ta soft, quad precision .It riscv64 Ta hard Ta hard, quad precision .It riscv64c Ta hard Ta hard, quad precision .El diff --git a/sys/powerpc/include/float.h b/sys/powerpc/include/float.h index 58ecbcfed74e..737d283ecf38 100644 --- a/sys/powerpc/include/float.h +++ b/sys/powerpc/include/float.h @@ -80,6 +80,22 @@ __END_DECLS #define DBL_HAS_SUBNORM 1 #endif /* __ISO_C_VISIBLE >= 2011 */ +#if __LDBL_MANT_DIG__ == 113 +#define LDBL_MANT_DIG 113 +#define LDBL_EPSILON 1.925929944387235853055977942584927319E-34L +#define LDBL_DIG 33 +#define LDBL_MIN_EXP (-16381) +#define LDBL_MIN 3.362103143112093506262677817321752603E-4932L +#define LDBL_MIN_10_EXP (-4931) +#define LDBL_MAX_EXP (+16384) +#define LDBL_MAX 1.189731495357231765085759326628007016E+4932L +#define LDBL_MAX_10_EXP (+4932) +#if __ISO_C_VISIBLE >= 2011 +#define LDBL_TRUE_MIN 6.475175119438025110924438958227646552E-4966L +#define LDBL_DECIMAL_DIG 36 +#define LDBL_HAS_SUBNORM 1 +#endif /* __ISO_C_VISIBLE >= 2011 */ +#else #define LDBL_MANT_DIG DBL_MANT_DIG #define LDBL_EPSILON ((long double)DBL_EPSILON) #define LDBL_DIG DBL_DIG @@ -94,5 +110,6 @@ __END_DECLS #define LDBL_DECIMAL_DIG DBL_DECIMAL_DIG #define LDBL_HAS_SUBNORM DBL_HAS_SUBNORM #endif /* __ISO_C_VISIBLE >= 2011 */ +#endif /* __LDBL_MANT_DIG__ == 113 */ #endif /* _MACHINE_FLOAT_H_ */ diff --git a/sys/sys/param.h b/sys/sys/param.h index 7c3d02f842f9..a708baf43727 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -74,7 +74,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1600018 +#define __FreeBSD_version 1600019 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Fri Jun 19 22:45:11 2026 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 4ght393JLdz6h28Y for ; Fri, 19 Jun 2026 22:45:25 +0000 (UTC) (envelope-from ziaee@FreeBSD.org) Received: from mailtransmit04.runbox.com (mailtransmit04.runbox.com [IPv6:2a0c:5a00:149::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ght390zCRz4KKh; Fri, 19 Jun 2026 22:45:25 +0000 (UTC) (envelope-from ziaee@FreeBSD.org) Authentication-Results: mx1.freebsd.org; none Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit04.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1wahxd-008jgr-Lk; Sat, 20 Jun 2026 00:45:17 +0200 Received: from [10.9.9.127] (helo=rmmprod05.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1wahxX-0002Cr-Ts; Sat, 20 Jun 2026 00:45:12 +0200 Received: from mail by rmmprod05.runbox with local (Exim 4.86_2) (envelope-from ) id 1wahxX-0008B3-Rs; Sat, 20 Jun 2026 00:45:11 +0200 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Received: from [Authenticated alias (960477)] by runbox.com with http (RMM6); Fri, 19 Jun 2026 22:45:11 GMT From: "Alexander Ziaee" To: "Dag-Erling Smørgrav" CC: "src-committers" , "dev-commits-src-all" , "dev-commits-src-main" , "Artem Bunichev" Subject: Re: git: b3dfd5d59c4a - main - rmdir.1: Document non-POSIX -v option Date: Fri, 19 Jun 2026 22:45:11 +0000 (UTC) X-RMM-Aliasid: 960477 X-Mailer: RMM6 In-Reply-To: <86zf0qtd1b.fsf@ltc.des.dev> Message-Id: X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:50304, ipnet:2a0c:5a00::/29, country:NO] X-Rspamd-Queue-Id: 4ght390zCRz4KKh X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On 2026-06-19 17:50 -04:00 EDT, "Dag-Erling Sm=C3=B8rgrav" wrote: > Alexander Ziaee writes: >> Dag-Erling Sm=C3=B8rgrav writes: >> > Alexander Ziaee writes: >> > > +.Pp >> > > +The >> > > +.Fl v >> > > +option is an extension to that specification. >> > This is not the wording we normally use for these cases. >> We use in in rm(1), but we do not have a style guide and I am not >> aware of a consistent pattern. What would you prefer? >=20 > Right, so I thought we'd standardized on >=20 > The > .Fl v > option is a non-standard extension. Oh, I forgot about that. > but it's actually more varied than that, some pages say =E2=80=9Ca FreeBSD > extension=E2=80=9D or =E2=80=9Ca BSD extension=E2=80=9D or even =E2=80=9C= a GNU extension=E2=80=9D in cases where > we copied GNU's homework, and some just say =E2=80=9Can extension=E2=80= =9D. We should > clean that up. >=20 > There is precedent for =E2=80=9Can extension to that specification=E2=80= =9D but only in > pages where the previous sentence uses the word =E2=80=9Cspecification=E2= =80=9D. I > would prefer not standardizing on a wording that relies on external > context. Okay, let's put this in mdoc(7) so I don't forget again and we have somethi= ng to point to. To that end I have proposed the following revision: https://reviews.freebsd.org/D57690 > Furthermore, rmdir(1) does not follow the standard pattern, so maybe we > should start by fixing that: >=20 > The > .Nm > utility is expected to conform to the > .St -p1003.1-2008 > specification. >=20 > That's not the latest version of the standard, but we've made no effort > to update our codebase for 1003.1-2024, so it's the most recent one we > can plausibly claim conformance to (although in this particular case the > standard hasn't changed so we can probably go ahead with 1003.1-2024). >=20 > Finally, the SEE ALSO section should reference rmdir(2). The proposed changed LGTM, feel free to commit (either 2008 or 2024) with `Reviewed by: ziaee`. Best, Alex= From nobody Sat Jun 20 00:24:50 2026 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 4ghwFt5dpQz6hFCD for ; Sat, 20 Jun 2026 00:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghwFt59Syz3Hyl for ; Sat, 20 Jun 2026 00:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781915090; 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; bh=WbhtU0M6N0LVuxEgBWR6WWG2jTCKdcf7a43/KjOkgNw=; b=PUnDBQ3KMO4OpP0c6jI4KZw0YIwzD6KT7t8Nz2l5asTGH+V27GEr956sJuwh4WiZCajM1R LBk1wg/cMfUl6DRc7LWij4IKAfP65Vfv/H/kJD6lJThdwyyX+d3kKCwbsGll2hhGgS5aKy A+XYSAmR41ILi/2zNTaKMR98OpHa1Ihk2GrVvy4v4UzSp3QAlKAYbfxK2shsGEtiPTsRXA Vl0k10kQt9H1D+5iKT6g2SHvC5+1HSRk6UXEYF82NRr7kJeJkSrTJExv4AbC0EkOVVAJ9p 6sqpsFtUz427hRwhYRwE/uXeryc3Q1XBQXiI/GCwjNjm987fWU5VLlaOIWOeuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781915090; a=rsa-sha256; cv=none; b=y4W29hMJNFygC3peVxixUl7Un9D3eQPt2aI2qtB1iDfbg9PeQIcg2cbdeG1ohXaVJMxhrF L7pnyle2Xzf7UcF2e/BHe0wcNU33XiBF/Uz/f5BkJC8ot0O8I0phRQfQDAJ18nnp6ydHa2 gzbuvQis3F1twXWRiumVoFT9B6Z1gv27HCIlvRkv/5dIJlZjHIU4lMMkm4MIc75hZ9u1i4 C+XHK6+gKhGQkD7hfg2L3fAiPChf/N9dnoxyfRQl0P0SX0pb/AQbUuu2x2hGqxDMcoFTSC J+vjICUgOrAW4oghPdfvmv15Cheax/C6D7m0k2+kORyZ8+fuGaWW733RfPku9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781915090; 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; bh=WbhtU0M6N0LVuxEgBWR6WWG2jTCKdcf7a43/KjOkgNw=; b=FoPEjBVbXWKZm0ajbo38qUKFqiFeIM/3ZTrW7MvE7UODQ2nWr5f49b4DoJgqPccY20rkgc c6EGNyEk8CjbxjVIe3SIX9+xd5BQy2GINU9H1xyHr05SpNXZnmFiPcK6svHr9zX9hCGU02 FHsZOrjCzvgfZgiyHN2p94AOU7wKYuhCxHVzdHRFbnGwBJrvw935plbFmIPUBkdjDNNA/4 NAwKqFUABWc73Jlh6RPGyog4BIp9HS4x9PW/wQH7N3GSMD8lVZVak3/kNQ6toOXfs08QPe zF8eyL8dyrZMZ71OJl2JGN5ZJp7APQGPPjd2Z+zwkFSvl0EptOpRVmh/gTcFDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghwFt3pKBz17CJ for ; Sat, 20 Jun 2026 00:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23cff by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 00:24:50 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Faraz Vahedi From: Warner Losh Subject: git: 85becdacf3b0 - main - libc: Add atomics C23 feature test macro 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 85becdacf3b043849b240eb1b1b2cde63add0690 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 00:24:50 +0000 Message-Id: <6a35ddd2.23cff.50d250e7@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=85becdacf3b043849b240eb1b1b2cde63add0690 commit 85becdacf3b043849b240eb1b1b2cde63add0690 Author: Faraz Vahedi AuthorDate: 2026-05-01 01:01:20 +0000 Commit: Warner Losh CommitDate: 2026-06-20 00:23:28 +0000 libc: Add atomics C23 feature test macro Signed-off-by: Faraz Vahedi Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2185 --- sys/sys/stdatomic.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/sys/stdatomic.h b/sys/sys/stdatomic.h index 67107f47e6b3..c3f9b217519c 100644 --- a/sys/sys/stdatomic.h +++ b/sys/sys/stdatomic.h @@ -27,8 +27,8 @@ * SUCH DAMAGE. */ -#ifndef _STDATOMIC_H_ -#define _STDATOMIC_H_ +#ifndef __STDC_VERSION_STDATOMIC_H__ +#define __STDC_VERSION_STDATOMIC_H__ 202311L #include #include @@ -421,4 +421,4 @@ atomic_flag_clear(volatile atomic_flag *__object) #undef __bool_locally_defined #endif -#endif /* !_STDATOMIC_H_ */ +#endif /* !__STDC_VERSION_STDATOMIC_H__ */ From nobody Sat Jun 20 00:24:51 2026 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 4ghwFw10mLz6hFJW for ; Sat, 20 Jun 2026 00:24: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghwFv5b6Kz3Hwd for ; Sat, 20 Jun 2026 00:24:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781915091; 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; bh=C9KK8OhgXVc7Nhz4VPFcCG514lMochSYl8RexjhT6EI=; b=C7VOgH5mM1N4bg9Y2RmnAwBr8zAE0NKcH7/AfxwMN7fg6owjW3ItFtYDsribJZLRpxibMz mFSHbVTlxeu+YtRocQ4VlSwAZe1AZx8089jD2Rj/VxOBkQ0hmmvrlaB3eMCd0gdQH4vqJx F3ZI4JRoNbz50UgLT78F5jsXfKv3g97AMOxcuLLcaBEDV3R6/XLx5LFGqD2DDBNJJ1aslM k6PnmQ682a0C1ij2lTNQWv4EEDnTqjeFDo3M+DeQRdqIkDKWUyJf97lP4QIvpKQW4ySrhB tpd4oPimEwHmYNA8biDtyEbhOOGQmZSlzWkWKZ4DWyd3CX0xyaGgyt6T+Jq45A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781915091; a=rsa-sha256; cv=none; b=AZU9st9e7K+U5qD9O/hMFa7QHKc45smxTXf7EhOc8rrdT4Ek2G+GkcxOpfy289tKdJ3Tlj BkaYl9/MeaDetAEOjo7l4F2FYysiz/8s6M9GQMLn2WK3xH9AcgKVTGQACmnGGGqKd1ZUqm 85GMLm8oRfcC9qGYTiW7zESjg2YxE7Q6DMJgugm3gIZ1kbmWuF2ToDNrRyUdhL1+NnFOmZ DqvT3n4ADQPzHqzBfHjQsVaZ4/aNryCfNoo//fEwkb+JtjgixZk+b/jeQHFiLDYb7Co8SS UkchEUQYsFu4da2cBv+4mxqovk2zJqtudokSFeGUcwSbzkIrXciNqCw0fFy0Zg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781915091; 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; bh=C9KK8OhgXVc7Nhz4VPFcCG514lMochSYl8RexjhT6EI=; b=mmaIJRtAQidaCPDHcoTkKyHpj8OfnlkNWbMRpkrb9TxuAG53ataOHg1KJaxtOILLo2G2af WmDAylUCr0Pth47T4GHXYyrdXlZ1x3KonecbRR74ZHidqQoY4u/LPdb2FoI1iYZ8mgVQOv jhsI89TXnSWg5ZFrVaL6yvVdAeNYVQx3TqMk2ytNyHhm5qMKje5+dTZRzqbQ69rb8vfDMP a104OeXYyMbVg7ufJ02ulFJOVddIsitkYDDEj8efXuK3EPoiwu+Nh23l32bRifZ0VRY66r VEYFUhRcgyJp47Bxc4F+sH0MOVakN4VdE7lZBVGlbYEKpGpHuzizyfs67Q+t6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghwFv4T77z16PL for ; Sat, 20 Jun 2026 00:24:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22963 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 00:24:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Faraz Vahedi From: Warner Losh Subject: git: 28cecfe27964 - main - libc: Restrict ATOMIC_VAR_INIT for C23 conformance 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 28cecfe27964fdb67497800f5dcd5d3e1033727f Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 00:24:51 +0000 Message-Id: <6a35ddd3.22963.721d614@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=28cecfe27964fdb67497800f5dcd5d3e1033727f commit 28cecfe27964fdb67497800f5dcd5d3e1033727f Author: Faraz Vahedi AuthorDate: 2026-05-01 14:34:44 +0000 Commit: Warner Losh CommitDate: 2026-06-20 00:23:28 +0000 libc: Restrict ATOMIC_VAR_INIT for C23 conformance Omit `ATOMIC_VAR_INIT` when targeting C23, where it has been removed. Retain it for earlier C standards and for C++ (as it still remains in C++23, albeit marked as deprecated since C17 and C++20.) Also separate `atomic_init` definitions from `ATOMIC_VAR_INIT` to avoid coupling with a deprecated initialisation mechanism. No functional change intended for `atomic_init`; this is purely a conformance and cleanup adjustment. Signed-off-by: Faraz Vahedi Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2185 --- sys/sys/stdatomic.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/sys/stdatomic.h b/sys/sys/stdatomic.h index c3f9b217519c..2d565ce991be 100644 --- a/sys/sys/stdatomic.h +++ b/sys/sys/stdatomic.h @@ -86,11 +86,17 @@ * 7.17.2 Initialization. */ +#if __ISO_C_VISIBLE < 2023 || defined(__cplusplus) #if defined(__CLANG_ATOMICS) #define ATOMIC_VAR_INIT(value) (value) -#define atomic_init(obj, value) __c11_atomic_init(obj, value) #else #define ATOMIC_VAR_INIT(value) { .__val = (value) } +#endif +#endif + +#if defined(__CLANG_ATOMICS) +#define atomic_init(obj, value) __c11_atomic_init(obj, value) +#else #define atomic_init(obj, value) ((void)((obj)->__val = (value))) #endif From nobody Sat Jun 20 00:24:52 2026 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 4ghwFx13fPz6hFCH for ; Sat, 20 Jun 2026 00:24: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghwFw60YYz3HgK for ; Sat, 20 Jun 2026 00:24:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781915092; 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; bh=nrUcY0mcb3L7vpEW6TxqwDOh/003awxr/M41Pdve2Cw=; b=DVKDAKEz9QGBHXziC/LodQC8Eb35i3hhSo+Qp87daO0yg3UUs+AV7k+2CmyfWBkMgKOXAH 5WxB8MGU5cU0buIcvE/Qdg/4Ez12OfU6RZ7LNqtx0tlHOBhRBbaKeXUAw78rLwCcjCJiKQ 0CY6/k0mZN2Dc447xvBaWcS+EuVVgRpuYuw//avUoCjQmJmuJEhPlxQFRXsd7N16PgavfB wGv//JXSN6G0WffWl3NY+gsYQgQxTMpIPO5STBT+vJpMQTrMlEnHww4VRWNV2yeRtpn5pF nh3uWPzpZ5VMKAksSiE9NaToynLRq+P8N7X5dBcYmfYvC63hE0Yw/Uk+r1rjYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781915092; a=rsa-sha256; cv=none; b=p/tpY+0A/RvCDvUF7SCefFblXICDsI06wu5eSlAS9LaWmV3l9WZCJm/8LRlmjXLd5/S1Zt qf1IUhi/tz2DFLiUUQkZwYvVMhs76SjVc+NuBU2F2RKrIdP1WNWajkFV51x0E3OhyfGE7x 3htejFw58eWX+bJYEK3qZfZXkYO6B3PezATPbcnN1LYcCPc39ezR6f26YT2oeSBC28rAwb 3Fr8cMcJdKF0RmBOzNZ77yX/k7HPYKBLHE1jatzGxplGsIgxH5ph2LKOYDrhOfV65u+9kM FaKtPT43w9dXBcdbExTnY9BwLh1TGiyjPjfVHGdD9FPOfn3dTldGUiSttkwq3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781915092; 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; bh=nrUcY0mcb3L7vpEW6TxqwDOh/003awxr/M41Pdve2Cw=; b=TEC92ehHp9jgwn9AXp5Q0zzFYyfqXb07nuLYkh4qvUjff3z36VHO/NHZwWtCtesNYirf12 T1tSGS8rpQXS2OArmfC/AbjhcYdWVvhS1nIW77fj8zEfGeuvkZeQCuctV8C+Em+f4g1iyr qCLIc8NPizr5DyiwawFbNUNpoqljjbC6DHeevJlcBOSiVQZF49Ji7sTEnyUul6/7b36Al9 BqdRLJs0DI/9jmovkc5Pi8RP3BXmoR78SSt16jCGlSRT/C4Xi8PFmyZRg+GhwQc1G8jpet LSl06HZ+ofpK9R4321x5aeeWx9tQf694m8h2XejSpDPahqR6OuVgJnb+zdJAWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghwFw52yvz1736 for ; Sat, 20 Jun 2026 00:24:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24ba1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 00:24:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Faraz Vahedi From: Warner Losh Subject: git: 9d87c1aac4a8 - main - libc: Add missing kill_dependency macro 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 9d87c1aac4a84ac5e82acf872f645a7202977204 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 00:24:52 +0000 Message-Id: <6a35ddd4.24ba1.2ad9343d@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9d87c1aac4a84ac5e82acf872f645a7202977204 commit 9d87c1aac4a84ac5e82acf872f645a7202977204 Author: Faraz Vahedi AuthorDate: 2026-05-01 15:41:49 +0000 Commit: Warner Losh CommitDate: 2026-06-20 00:23:28 +0000 libc: Add missing kill_dependency macro Add `kill_dependency` as specified by C11 §7.17.3.1. The macro is required to break dependency chains in expressions without affecting the value. No functional impact beyond providing the required, value-preserving definition. Signed-off-by: Faraz Vahedi Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2185 --- sys/sys/stdatomic.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/sys/stdatomic.h b/sys/sys/stdatomic.h index 2d565ce991be..e6eb46cd6ef3 100644 --- a/sys/sys/stdatomic.h +++ b/sys/sys/stdatomic.h @@ -141,6 +141,8 @@ typedef enum { memory_order_seq_cst = __ATOMIC_SEQ_CST } memory_order; +#define kill_dependency(y) (y) + /* * 7.17.4 Fences. */ From nobody Sat Jun 20 00:24:53 2026 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 4ghwFy2Xphz6hFFd for ; Sat, 20 Jun 2026 00:24:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghwFx6zr6z3Hnp for ; Sat, 20 Jun 2026 00:24:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781915094; 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; bh=LhWUSb8yJqF92UKxNN+Ec+IQm1zJ8wRvsGrAJttfMdY=; b=qVfTyhXPdw9cw9vu0hIyJHp8VXmfFA4w+TsrBxtm4FvK5ufjqR0fnbwPdwD6o5Mv69zNrg 2JBgklb7qeYIdOtbbqSKZoLbpYJVONamLMQb5ngRaiOVb2HQlNVn17RTdsO1LCgGKYQPyc FNC9yfSRKoJuieQTBkcYGo7Evbp+lUIThGtB3WnUKI0eKWIWj0dR+RQoy5h947gTas3H2a MPoobQ4NxNDv+9lectGTYyQli1Bh3hh6Fbw/ajKbWSPt81IEbHzZ4SeeB94W5MJuw72fUV FCOEjWrkmYHF0hlV29YeZHUOnKOljWTtPw525TKa8fIh9IdtZq5ujrSqTBOJjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781915094; a=rsa-sha256; cv=none; b=FmK/jFavZEzR/WN1mcrl7tDc/HfbeU2jLp6nGz60jbQV6mIotyfmuX66D4QgLLO9Yg5rbe Ir1nJ17CJazL4C+0bkQUMPzc1UmpBwZq2oCCLjf2OTl4CEokRx4EZwzL6typyA7ooTA4yh 4lCngR1ASo3clotyE82R06hvbUQfPCbhFt8L4G87rAd6n2gHlhEEOHTPH8xEHbXLpGplJb NBGqGNLJwLD2hK3TR793yHq/hXJwCRRgvUgmVBgCafBBWLuSx0KxRgDf0TRNGU3IDwinqO U9Ke83sMe00rFYzCR9uQ5pq/fKgHGVx7PCxedHd2+TViRW/r34zwTabzTbukzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781915094; 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; bh=LhWUSb8yJqF92UKxNN+Ec+IQm1zJ8wRvsGrAJttfMdY=; b=FY2Te6TL5Gv3U1lBJjFJojkWH5QmB8Zl0S5eIk5SXWbQkj168iTht8vbIDvX1R7x81Ulvk FA4XQC2MN8c4n9/Uvc1QpU4hK3lJoFzlnp+RuafKvPC7Gte/CZNrM1tA6ffwJog3/R2Ofv iZ8C+iJ0QhGaodxmCh4+P/myQsMoHdLE9HoC9aFthR0NK+4BatFTgZGna+tU3rUxyU3Aac EwQpFsHkBOoXsVEmvz5eY6ODCQk8oxOEzz+VoLqT1tKQgGUfX31LAxZaO+LXDNLdadmtiT dUv5MCG5qiYKpraaAO+pVetNRBT145pzjgtwoP4oUghrrjdA7yKzIV8/SoR+QA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghwFx5l6Jz174J for ; Sat, 20 Jun 2026 00:24:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2501e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 00:24:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Faraz Vahedi From: Warner Losh Subject: git: e17fddce8978 - main - libc: Reorganise memory_order enumeration constants 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: e17fddce8978efbc70fc473425bad59b111f4b16 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 00:24:53 +0000 Message-Id: <6a35ddd5.2501e.57e743ab@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e17fddce8978efbc70fc473425bad59b111f4b16 commit e17fddce8978efbc70fc473425bad59b111f4b16 Author: Faraz Vahedi AuthorDate: 2026-05-01 17:49:27 +0000 Commit: Warner Losh CommitDate: 2026-06-20 00:23:28 +0000 libc: Reorganise memory_order enumeration constants Place the `memory_order` enumeration constants alongside the corresponding typedef under the §7.17.3 heading. The previous layout separated the fallback constant definitions from the enum, which could obscure their relationship. These fallbacks exist only to provide values when the compiler does not supply the builtins. The removed comment encoded implementation-specific assumptions about compiler-provided definitions and implied a relationship between Clang/GCC macros and fallback values. In practice, the fallback definitions exist solely to ensure the enumerators are defined when compiler intrinsics are absent, and do not depend on any particular numeric mapping. No functional change; this is a mere structural and clarity improvement. Signed-off-by: Faraz Vahedi Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2185 --- sys/sys/stdatomic.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/sys/sys/stdatomic.h b/sys/sys/stdatomic.h index e6eb46cd6ef3..135001a1f82e 100644 --- a/sys/sys/stdatomic.h +++ b/sys/sys/stdatomic.h @@ -101,9 +101,10 @@ #endif /* - * Clang and recent GCC both provide predefined macros for the memory - * orderings. If we are using a compiler that doesn't define them, use the - * clang values - these will be ignored in the fallback path. + * 7.17.3 Order and consistency. + * + * The memory_order_* constants that denote the barrier behaviour of the + * atomic operations. */ #ifndef __ATOMIC_RELAXED @@ -125,13 +126,6 @@ #define __ATOMIC_SEQ_CST 5 #endif -/* - * 7.17.3 Order and consistency. - * - * The memory_order_* constants that denote the barrier behaviour of the - * atomic operations. - */ - typedef enum { memory_order_relaxed = __ATOMIC_RELAXED, memory_order_consume = __ATOMIC_CONSUME, From nobody Sat Jun 20 00:24:54 2026 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 4ghwFz4FDJz6hFLT for ; Sat, 20 Jun 2026 00:24:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghwFz1rf4z3J2C for ; Sat, 20 Jun 2026 00:24:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781915095; 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; bh=riuQ6EveyMjs1SNqEsxT76btP8g6fU+TniIV0WUIDic=; b=kM8SBl5vCpnZ7ymJwtCSR8AyfELFC/PqGw+++9EESJcnf46Kw8B8QgOMfUeWy+oXeSMJPE TfamCxSfg2SGT0/a1wFTnOMIctA7cbawwELLNsQOBtFCyMfi3OkloXPJ5B+aX9efChlEsr M/BTnwD2ENolJCs4Tgp6+4FNwdi64ML3ub/MSbRG/wHUpcDmbWe28hm4Ab9UjOvAhUaPLV rDnqJgzAEiMW5faXwK6/O58whx14Z88jyWL7srzZJhOMmp01hjX9175lw6YT/hCffvD9mw 98FN5UJw+dWaAYVaTHMJABhiBBWjtgJPhS2X8NhlaNIKSDcA3lpGhGOm7pRJHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781915095; a=rsa-sha256; cv=none; b=hDLN013m2CSV+s/otSzln4pjFv6AsAPLBz8/Ng07TmhrNiYHKmHTW3j5z416SCmOcg9IYx 96frSSFscOVpRKERruysSl1J2VgG6ExZiYq+dHLxBl40NEE0N+XzwJYZ1wMrvVgcFV/oQH DSpygYqfg/eyC2WhSoNbQbWpsZIDBS4bSTW4tmV6iX3FD5zGaHGMG2ER3MqWMG/zz4eef4 X5tQv+yD0MSZ+GleKhNpJgPCxFJ4Pyocraz2wohZt1IpLgNa/r3FVsj3IH0RxfAzPy9WFY 0K8opi6CWs7trwKdUqFwcQdDE9ZD31LMZ56tLFBnsoTlJBunsm2GQPxgkfbd7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781915095; 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; bh=riuQ6EveyMjs1SNqEsxT76btP8g6fU+TniIV0WUIDic=; b=sWMfptNKo7078gD8zjch3XhABTncbJyd0eUCDRsEdW3IVtPvolUfi7NF6LRv8TSVl/V2wM m+eaTm1tVfZZoljL0CDaq0INQI6f8nYWBKbaNMr1pG/jqgRfxVmyyPvRRDlE2KZkUikhFh D74TQT4Xc18DE6V3BCGxfWKGMgh53/ZWoL5K1JFRXNvWWZA7Q61u+qAsmwDnXuBzuV8K9K pjO0Dw11uCvf4kp0+FroJ1dth5mz+55aULBZwki5+pA0llb9EpqdkfUGrVC4YIgRciD3Hc dwjLX7pm+IwldYFbE7fFhHjRtIFYGPmA/hq3SctZ3UvqyA8NaP10OuZM43znpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghwFy6BmJz17CN for ; Sat, 20 Jun 2026 00:24:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24ba6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 00:24:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Faraz Vahedi From: Warner Losh Subject: git: cb88e7b8cdd6 - main - libc: Reorder atomic operations to match ISO C standard 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: cb88e7b8cdd6b4c707e47abee4ba8541d9fccea6 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 00:24:54 +0000 Message-Id: <6a35ddd6.24ba6.3aa94789@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=cb88e7b8cdd6b4c707e47abee4ba8541d9fccea6 commit cb88e7b8cdd6b4c707e47abee4ba8541d9fccea6 Author: Faraz Vahedi AuthorDate: 2026-05-02 03:40:27 +0000 Commit: Warner Losh CommitDate: 2026-06-20 00:23:29 +0000 libc: Reorder atomic operations to match ISO C standard Reorder definitions of specified generic operations on atomic types so they follow the sequence in ISO/IEC 9899:2024 §7.17.7: 1. `atomic_store` 2. `atomic_load` 3. `atomic_exchange` 4. `atomic_compare_exchange` 5. `atomic_fetch` This aligns the header layout with the standard, making it easier to cross-check against the normative text and maintain consistency with the rest of the header. The behaviour of the macros remains unchanged; this is purely a reorganisation and documentation improvement. Signed-off-by: Faraz Vahedi Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2185 --- sys/sys/stdatomic.h | 100 ++++++++++++++++++++++++++-------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/sys/sys/stdatomic.h b/sys/sys/stdatomic.h index 135001a1f82e..bbdd196515e0 100644 --- a/sys/sys/stdatomic.h +++ b/sys/sys/stdatomic.h @@ -242,6 +242,12 @@ typedef _Atomic(__uintmax_t) atomic_uintmax_t; */ #if defined(__CLANG_ATOMICS) +#define atomic_store_explicit(object, desired, order) \ + __c11_atomic_store(object, desired, order) +#define atomic_load_explicit(object, order) \ + __c11_atomic_load(object, order) +#define atomic_exchange_explicit(object, desired, order) \ + __c11_atomic_exchange(object, desired, order) #define atomic_compare_exchange_strong_explicit(object, expected, \ desired, success, failure) \ __c11_atomic_compare_exchange_strong(object, expected, desired, \ @@ -250,23 +256,23 @@ typedef _Atomic(__uintmax_t) atomic_uintmax_t; desired, success, failure) \ __c11_atomic_compare_exchange_weak(object, expected, desired, \ success, failure) -#define atomic_exchange_explicit(object, desired, order) \ - __c11_atomic_exchange(object, desired, order) #define atomic_fetch_add_explicit(object, operand, order) \ __c11_atomic_fetch_add(object, operand, order) -#define atomic_fetch_and_explicit(object, operand, order) \ - __c11_atomic_fetch_and(object, operand, order) -#define atomic_fetch_or_explicit(object, operand, order) \ - __c11_atomic_fetch_or(object, operand, order) #define atomic_fetch_sub_explicit(object, operand, order) \ __c11_atomic_fetch_sub(object, operand, order) +#define atomic_fetch_or_explicit(object, operand, order) \ + __c11_atomic_fetch_or(object, operand, order) #define atomic_fetch_xor_explicit(object, operand, order) \ __c11_atomic_fetch_xor(object, operand, order) -#define atomic_load_explicit(object, order) \ - __c11_atomic_load(object, order) -#define atomic_store_explicit(object, desired, order) \ - __c11_atomic_store(object, desired, order) +#define atomic_fetch_and_explicit(object, operand, order) \ + __c11_atomic_fetch_and(object, operand, order) #elif defined(__GNUC_ATOMICS) +#define atomic_store_explicit(object, desired, order) \ + __atomic_store_n(object, desired, order) +#define atomic_load_explicit(object, order) \ + __atomic_load_n(object, order) +#define atomic_exchange_explicit(object, desired, order) \ + __atomic_exchange_n(object, desired, order) #define atomic_compare_exchange_strong_explicit(object, expected, \ desired, success, failure) \ __atomic_compare_exchange_n(object, expected, \ @@ -275,37 +281,23 @@ typedef _Atomic(__uintmax_t) atomic_uintmax_t; desired, success, failure) \ __atomic_compare_exchange_n(object, expected, \ desired, 1, success, failure) -#define atomic_exchange_explicit(object, desired, order) \ - __atomic_exchange_n(object, desired, order) #define atomic_fetch_add_explicit(object, operand, order) \ __atomic_fetch_add(object, operand, order) -#define atomic_fetch_and_explicit(object, operand, order) \ - __atomic_fetch_and(object, operand, order) -#define atomic_fetch_or_explicit(object, operand, order) \ - __atomic_fetch_or(object, operand, order) #define atomic_fetch_sub_explicit(object, operand, order) \ __atomic_fetch_sub(object, operand, order) +#define atomic_fetch_or_explicit(object, operand, order) \ + __atomic_fetch_or(object, operand, order) #define atomic_fetch_xor_explicit(object, operand, order) \ __atomic_fetch_xor(object, operand, order) -#define atomic_load_explicit(object, order) \ - __atomic_load_n(object, order) -#define atomic_store_explicit(object, desired, order) \ - __atomic_store_n(object, desired, order) +#define atomic_fetch_and_explicit(object, operand, order) \ + __atomic_fetch_and(object, operand, order) #else #define __atomic_apply_stride(object, operand) \ (((__typeof__((object)->__val))0) + (operand)) -#define atomic_compare_exchange_strong_explicit(object, expected, \ - desired, success, failure) __extension__ ({ \ - __typeof__(expected) __ep = (expected); \ - __typeof__(*__ep) __e = *__ep; \ - (void)(success); (void)(failure); \ - (_Bool)((*__ep = __sync_val_compare_and_swap(&(object)->__val, \ - __e, desired)) == __e); \ -}) -#define atomic_compare_exchange_weak_explicit(object, expected, \ - desired, success, failure) \ - atomic_compare_exchange_strong_explicit(object, expected, \ - desired, success, failure) +#define atomic_store_explicit(object, desired, order) \ + ((void)atomic_exchange_explicit(object, desired, order)) +#define atomic_load_explicit(object, order) \ + ((void)(order), __sync_fetch_and_add(&(object)->__val, 0)) #if __has_builtin(__sync_swap) /* Clang provides a full-barrier atomic exchange - use it if available. */ #define atomic_exchange_explicit(object, desired, order) \ @@ -324,23 +316,31 @@ __extension__ ({ \ __sync_synchronize(); \ __sync_lock_test_and_set(&(__o)->__val, __d); \ }) +#define atomic_compare_exchange_strong_explicit(object, expected, \ + desired, success, failure) __extension__ ({ \ + __typeof__(expected) __ep = (expected); \ + __typeof__(*__ep) __e = *__ep; \ + (void)(success); (void)(failure); \ + (_Bool)((*__ep = __sync_val_compare_and_swap(&(object)->__val, \ + __e, desired)) == __e); \ +}) +#define atomic_compare_exchange_weak_explicit(object, expected, \ + desired, success, failure) \ + atomic_compare_exchange_strong_explicit(object, expected, \ + desired, success, failure) #endif #define atomic_fetch_add_explicit(object, operand, order) \ ((void)(order), __sync_fetch_and_add(&(object)->__val, \ __atomic_apply_stride(object, operand))) -#define atomic_fetch_and_explicit(object, operand, order) \ - ((void)(order), __sync_fetch_and_and(&(object)->__val, operand)) -#define atomic_fetch_or_explicit(object, operand, order) \ - ((void)(order), __sync_fetch_and_or(&(object)->__val, operand)) #define atomic_fetch_sub_explicit(object, operand, order) \ ((void)(order), __sync_fetch_and_sub(&(object)->__val, \ __atomic_apply_stride(object, operand))) +#define atomic_fetch_or_explicit(object, operand, order) \ + ((void)(order), __sync_fetch_and_or(&(object)->__val, operand)) #define atomic_fetch_xor_explicit(object, operand, order) \ ((void)(order), __sync_fetch_and_xor(&(object)->__val, operand)) -#define atomic_load_explicit(object, order) \ - ((void)(order), __sync_fetch_and_add(&(object)->__val, 0)) -#define atomic_store_explicit(object, desired, order) \ - ((void)atomic_exchange_explicit(object, desired, order)) +#define atomic_fetch_and_explicit(object, operand, order) \ + ((void)(order), __sync_fetch_and_and(&(object)->__val, operand)) #endif /* @@ -351,28 +351,28 @@ __extension__ ({ \ */ #ifndef _KERNEL +#define atomic_store(object, desired) \ + atomic_store_explicit(object, desired, memory_order_seq_cst) +#define atomic_load(object) \ + atomic_load_explicit(object, memory_order_seq_cst) +#define atomic_exchange(object, desired) \ + atomic_exchange_explicit(object, desired, memory_order_seq_cst) #define atomic_compare_exchange_strong(object, expected, desired) \ atomic_compare_exchange_strong_explicit(object, expected, \ desired, memory_order_seq_cst, memory_order_seq_cst) #define atomic_compare_exchange_weak(object, expected, desired) \ atomic_compare_exchange_weak_explicit(object, expected, \ desired, memory_order_seq_cst, memory_order_seq_cst) -#define atomic_exchange(object, desired) \ - atomic_exchange_explicit(object, desired, memory_order_seq_cst) #define atomic_fetch_add(object, operand) \ atomic_fetch_add_explicit(object, operand, memory_order_seq_cst) -#define atomic_fetch_and(object, operand) \ - atomic_fetch_and_explicit(object, operand, memory_order_seq_cst) -#define atomic_fetch_or(object, operand) \ - atomic_fetch_or_explicit(object, operand, memory_order_seq_cst) #define atomic_fetch_sub(object, operand) \ atomic_fetch_sub_explicit(object, operand, memory_order_seq_cst) +#define atomic_fetch_or(object, operand) \ + atomic_fetch_or_explicit(object, operand, memory_order_seq_cst) #define atomic_fetch_xor(object, operand) \ atomic_fetch_xor_explicit(object, operand, memory_order_seq_cst) -#define atomic_load(object) \ - atomic_load_explicit(object, memory_order_seq_cst) -#define atomic_store(object, desired) \ - atomic_store_explicit(object, desired, memory_order_seq_cst) +#define atomic_fetch_and(object, operand) \ + atomic_fetch_and_explicit(object, operand, memory_order_seq_cst) #endif /* !_KERNEL */ /* From nobody Sat Jun 20 00:24:49 2026 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 4ghwFz2HyPz6hFTX for ; Sat, 20 Jun 2026 00:24:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghwFz0Q5Bz3HlZ for ; Sat, 20 Jun 2026 00:24:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781915095; 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; bh=KGwlRcxXmr/oaFuUBvxIrF2HjH6FKP9Th2rR1D7MoZs=; b=VrXuDHxiSaiH+QJBfOWp08xqzYmTZWozC4RpsbrQMOYkE3MghaOc1xsMh/GEvblrM4Z1fx nNSP8oZzkCL7+iBgASMyl2HCmDo/GUeBPTEx5xIlsvOgDelybEBIhAdZHevpDfQSUqt6J9 ejZHtLEKjRfjMqMPzLDzodflGkMHnAaKlMP0jMTMRhBeLr3FC0GSG79qM5Lh6/UORo7eEl pn19uSQkoQq38OjyCyF48rnfCZWSJEhi8IFSUwVq1Q3cdI4IV8xeYwV3Q15VFyOm8LwWD7 TJEtIfxVRcQpMawvfe4+BHJRVw9RXtzpQOOoBWE41ItmvAefN927+6hHHZllXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781915095; a=rsa-sha256; cv=none; b=cSoyvH2xvY+P7lwjooZEINqW+CobkQf4GZgFixdJKlYY9lS0jOA+52nQWTXgyO2ynasdTT zVu65Z59/kxRBR3tc2A1rQEbNGe2N2sfOYDesjHHiPpaPzGwpn/hQNsEq7lGv3O01ufx7t Uf0rtB5Ap/9Ok2pCjmuEt46tvaX7NyndmaCka6CVDT0SpUNPAfaJ3nyxsr60KSxAkZw3eS XFWs8k67Ia/AwwykMApEmZHirbEaA93OYRk4+Z5a8au35ztiC3JyKlDGWRmYOgx3EznLWZ M3oGbijZrsu/pwfvbhjJ2H8yGf3kv+o/VN4z7482QksSCtwxbekh64BK8/VbcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781915095; 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; bh=KGwlRcxXmr/oaFuUBvxIrF2HjH6FKP9Th2rR1D7MoZs=; b=FuBAO1LCohoY+LGGAvwGKbYJTa1gdfSbRQhogz7Sx515bVajfMdhwfILqSZHzXKIUxon6R 1BFhrBwccQb0SC4Z9Y5znkmDxQ36bLEQve1FLydrcK7YEJNEwHuCPyKB4iE26mBdTQcVsi h8J/JYFV1eq3BRMEgTzasLa0qaXRtdj1wu+oRtgq1HRTEzMkXWWKGJ/GWwBzO77rKm2GJT ILNZ/sEMOeQOJS8SI3SGG34XntvFxBP62n1bfMpSgT06xQ27vgpS4dkpf/k/Ah7NsW2sxP 3VaLP8MFsmiHVPvqVrHan8ubf1/hf1cq5qOOvddHIC5XE2pqMHSgMIa9cZG5rA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghwFy3K6Kz1737 for ; Sat, 20 Jun 2026 00:24:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24c12 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 00:24:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Lambert Lim From: Warner Losh Subject: git: 4b146555d39d - main - rtw88: Fix typo in portability glue 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 4b146555d39d9fb826bf4524df9e00eb8dad2bfe Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 00:24:49 +0000 Message-Id: <6a35ddd1.24c12.398e4124@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4b146555d39d9fb826bf4524df9e00eb8dad2bfe commit 4b146555d39d9fb826bf4524df9e00eb8dad2bfe Author: Lambert Lim AuthorDate: 2026-06-05 09:00:20 +0000 Commit: Warner Losh CommitDate: 2026-06-20 00:23:28 +0000 rtw88: Fix typo in portability glue Fix typo in if statement for compiling rtw88 against a Linux target. Signed-off-by: Lambert Lim Reviewed by: imp,ziaee Pull Request: https://github.com/freebsd/freebsd-src/pull/2262 --- sys/contrib/dev/rtw88/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/dev/rtw88/main.c b/sys/contrib/dev/rtw88/main.c index 43d537d0daba..a5760694a57a 100644 --- a/sys/contrib/dev/rtw88/main.c +++ b/sys/contrib/dev/rtw88/main.c @@ -112,7 +112,7 @@ static struct ieee80211_channel rtw_channeltable_5g[] = { RTW88_DEF_CHAN_5G(5805, 161), RTW88_DEF_CHAN_5G_NO_HT40MINUS(5825, 165), }; -#elif deifned(__linux__) +#elif defined(__linux__) static struct ieee80211_channel rtw_channeltable_2g[] = { {.center_freq = 2412, .hw_value = 1,}, {.center_freq = 2417, .hw_value = 2,}, From nobody Sat Jun 20 00:24:55 2026 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 4ghwG11Hqmz6hFJh for ; Sat, 20 Jun 2026 00:24: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghwG01NWSz3J0P for ; Sat, 20 Jun 2026 00:24:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781915096; 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; bh=fbi5PV/U9RektkKEpSGiF8GlNkruOYypc6Q1BIHY7NM=; b=TxngLYJttwGO7s0COZaaSVQcuAkGGVAkub1vCoW0RAMUzeGv5CCydlinflRSbHYL3hBJpL 6poUcFnf+K0hv7tPGWscEt5HY4h57BIbcC1fBqSKR7nWefxdBLmniVgB8sCKK4QCrktNMu XxyiGKD4bki0Rrg9U1nit2hpUhBtZemPU4ScV7ZmUvyhmz6ArttannKKGlmw8E+M+7ImnI SBgTfeuIT08Fss3OXBk13GOkPdn8i+yau4Bh4JRIwpnNDR4xepRD7IEdkHVusB2DTksdKy bm5e8ri5GrvGsqzdNuyQlGImyLhYJQT/5/QjVgqMqYyM49+4Dzmw8ReBQutEcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781915096; a=rsa-sha256; cv=none; b=AdMFr67L2yzMcQ4H10N4qWzjcVlFfI/P9sRLFuHwxvnY3luFF+VEKpaCSq3WZKfbOU5YMA TD5LpSf3fRzhkahZFU9vCPnbPlvhtku5YWZ7x38NhJKqPazz6GRqCpuThpJI0vbPzeYw2r mxhc2eeOfw5QNVF1qsjaWRiUgVED2oJ6uMQXMlUBzP/fY4ZIMcPhwR1xBgT9S9tc+ZzLdq 6oRujXc4Sffom1n/hnk/BRp/Xqu87as5qClnKXvYQqMTg3xtAphgsl2NKSRZ124SA4uUvk OAZf47IEQEPMnkpCIacHZFa/1DwKWauvUVWyaF1UM/gMZevPohEdEXDgKx+kTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781915096; 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; bh=fbi5PV/U9RektkKEpSGiF8GlNkruOYypc6Q1BIHY7NM=; b=x2Z2CXQB8iJRRZBSZ9lyNu+lpb//q0u9xGMNAwhJHzVLDBKXTxTnaT5dS5vrxASArChfTS 0vaCwfEVvtRdT0PCbYaJVwaBICffM/LPnxobEluIpOsw8dz3km1EeXXtHr7aDsvZlliYN0 g7WerFers6Qe2fEC/2MJGmkpva8be4xuk6SU4UiKikxCj1SxckHpSERVdw33JTPI+JNQ8n wk6jWENOsHkoCh24Y69W5C+xwB3mSxTfWahfAFeHi9Ik0TXHMacHEVL/Bti1o2MK0NwlTv GadvzQ1rrOcLpI4HPdQCjQfMO94XM34bnLqlvSnIYQuaP0L5TIJEsASzVhlrZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghwFz70pdz1739 for ; Sat, 20 Jun 2026 00:24:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25928 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 00:24:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Faraz Vahedi From: Warner Losh Subject: git: 640ddf857129 - main - libc: Enforce lock-free atomic_flag and C23-safe initialisation 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 640ddf8571291ab2965de85f67e6065a4d7efbf8 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 00:24:55 +0000 Message-Id: <6a35ddd7.25928.6937188a@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=640ddf8571291ab2965de85f67e6065a4d7efbf8 commit 640ddf8571291ab2965de85f67e6065a4d7efbf8 Author: Faraz Vahedi AuthorDate: 2026-05-07 10:25:56 +0000 Commit: Warner Losh CommitDate: 2026-06-20 00:23:29 +0000 libc: Enforce lock-free atomic_flag and C23-safe initialisation Select the `atomic_flag` backing type according to the C standard requirements that `atomic_flag` operations be lock-free. C11 §7.17.1.5 defines `atomic_flag` as: > a structure type representing a lock-free, primitive atomic flag and §7.17.8.2 further requires: > Operations on an object of type atomic_flag shall be lock free Therefore: - Prefer `atomic_bool` when `ATOMIC_BOOL_LOCK_FREE == 2` - Fall back to `atomic_uchar` when `ATOMIC_CHAR_LOCK_FREE == 2` - Trigger a translation failure if neither type is lock-free Adjust `ATOMIC_FLAG_INIT` for C23 initialisation rules: - Use `{ ATOMIC_VAR_INIT(0) }` in pre-C23 modes - Use `{ 0 }` in C23 and later Preserve `atomic_flag_test_and_set_explicit()` semantics by normalising the exchanged value with `!= 0`, ensuring consistent boolean results regardless of whether the underlying representation is `atomic_bool` or `atomic_uchar`. Signed-off-by: Faraz Vahedi Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2185 --- sys/sys/stdatomic.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/sys/stdatomic.h b/sys/sys/stdatomic.h index bbdd196515e0..3e4bdd505418 100644 --- a/sys/sys/stdatomic.h +++ b/sys/sys/stdatomic.h @@ -377,21 +377,29 @@ __extension__ ({ \ /* * 7.17.8 Atomic flag type and operations. - * - * XXX: Assume atomic_bool can be used as an atomic_flag. Is there some - * kind of compiler built-in type we could use? */ typedef struct { +#if ATOMIC_BOOL_LOCK_FREE == 2 atomic_bool __flag; +#elif ATOMIC_CHAR_LOCK_FREE == 2 + atomic_uchar __flag; +#else +#error "atomic_flag is required to be lock-free" +#endif } atomic_flag; +#if __ISO_C_VISIBLE < 2023 #define ATOMIC_FLAG_INIT { ATOMIC_VAR_INIT(0) } +#else +#define ATOMIC_FLAG_INIT { 0 } +#endif static __inline _Bool atomic_flag_test_and_set_explicit(volatile atomic_flag *__object, memory_order __order) { - return (atomic_exchange_explicit(&__object->__flag, 1, __order)); + + return (atomic_exchange_explicit(&__object->__flag, 1, __order) != 0); } static __inline void From nobody Sat Jun 20 00:24:58 2026 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 4ghwG25dYRz6hFCb for ; Sat, 20 Jun 2026 00:24: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghwG22RPlz3J0v for ; Sat, 20 Jun 2026 00:24:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781915098; 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; bh=9EHuLzbfWTlMRRFSvgV9k5N9uNBzCMYSAtO9AIktWRY=; b=oRd2mI8uw2j5A7TWwY/k22J5xm5kfvcNe4mx8l0eu13281jsjPbq7ObErbYtUkiBumLqC7 6XZ+sD4GV6zNxAsIrCo0QGUmsYEMxKlaDUkpiz9d5lkIkDIp/V7OUuTBQrmapld3VOHjON 4dDXusnwcDkHFSQEvp/3AT6MeY1PxgriifYpQBC2aVAQw5bqzYSNsdTduilJXD+q99f7NL 8AeUsSrrKO8U81OU89aRffSXz5MRWgAyiNG1uA7ZwJs5lA7QRK5NRNF/JeK70oyonKKnfq y+W8CsBQu0xdOFn06Nkoz6LOqBFsBkY33pageJ44+fRTZRbQZ/KXN4wgbBLT/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781915098; a=rsa-sha256; cv=none; b=T+jbWyJHB7enPGdCdbz9HSDC+F6h6E+lw9jEFrmCaJ7vKW+iJI1Y0nG6QQjd7Vbv5PeLCZ gCkse1afu4qc5Wsocs5MF0ta5M9FIMz5fuy1F3d6+q85WhoUFx3S+VvMVd1N+HJBJqNmcS 7HOxvyWxjUX8wn3KguEA8lSFNJqUbABcIImWCIwf2XAPKZXby3TlltFcTHMLcOvZwzpeq+ AIFoB5ZvI1nvgBPkjE6eRb12McOH4WMGxhxZ6E5QuHKQwpe9Fq2oS8lLgp+acYPvBRFDng O4D6sMwUTnhTYIXnZv6tBTBG/C0LXoPT5vPoA+A3nF7220W0ByTE2C7wsibfxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781915098; 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; bh=9EHuLzbfWTlMRRFSvgV9k5N9uNBzCMYSAtO9AIktWRY=; b=mUzqKDfCuznkmv01ZQJeb4fO1LDNHi2z4mJmZUNmFWrotSC0LR8F/K1Y75FQQo7Ek02vKu Y0NMPPxLVcDCKedmkpzscROfL5Quben1+RO7RbfdlmV0GTo2YZLSswnH/cFUyshKa9rqu4 Bvg2nxc23vuDJ2PvFNLpP2YprzVwnENQIK13vIkiRaMfBVBXc3/xo0MRG1nmDEjdd72kyn 75kTHwcMZmYoMO9LevbAu2CDJ2P4Yjd0aYhgI3L0yAvtzCEoK33YhaYSTdt7Q3PZSMpjXb jYe/XolF2WnWf6aNmjm/2095VvtvdqNSkxWUfgDWRuvNPXTyz1GYEoyR2A5SAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghwG21KTgz173C for ; Sat, 20 Jun 2026 00:24:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23d56 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 00:24:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Faraz Vahedi From: Warner Losh Subject: git: 26bf9fc3a402 - main - libc: Fix GCC pointer semantics for atomic_fetch_add/sub 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 26bf9fc3a40275a7aca0ce1809751a90c84b643a Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 00:24:58 +0000 Message-Id: <6a35ddda.23d56.711c33d6@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=26bf9fc3a40275a7aca0ce1809751a90c84b643a commit 26bf9fc3a40275a7aca0ce1809751a90c84b643a Author: Faraz Vahedi AuthorDate: 2026-05-08 02:54:23 +0000 Commit: Warner Losh CommitDate: 2026-06-20 00:23:29 +0000 libc: Fix GCC pointer semantics for atomic_fetch_add/sub Correct the GCC implementation of `atomic_fetch_add_explicit()` and `atomic_fetch_sub_explicit()` for atomic pointer types. The previous implementation passed the operand directly to the builtins. For pointer objects, this could result in raw byte-wise address arithmetic rather than the required C atomic pointer semantics, where the operand is interpreted as a `ptrdiff_t` element count. As a result, operations such as `atomic_fetch_sub_explicit(&p, 2, ...)` could produce an incorrect post-operation pointer value. Fix this by applying pointer scaling in the GCC path before invoking the builtin, mirroring the existing legacy fallback implementation. Pointer operands are now scaled by the size of the pointed-to type, while integer atomic behaviour remains unchanged. Signed-off-by: Faraz Vahedi Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2185 --- sys/sys/stdatomic.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/sys/stdatomic.h b/sys/sys/stdatomic.h index c0cbb7f785b5..a3d1f2cd4aeb 100644 --- a/sys/sys/stdatomic.h +++ b/sys/sys/stdatomic.h @@ -270,6 +270,8 @@ typedef _Atomic(__uintmax_t) atomic_uintmax_t; #define atomic_fetch_and_explicit(object, operand, order) \ __c11_atomic_fetch_and(object, operand, order) #elif defined(__GNUC_ATOMICS) +#define __atomic_apply_stride(object, operand) \ + (((__typeof__(*(object)))0) + (operand)) #define atomic_store_explicit(object, desired, order) \ __atomic_store_n(object, desired, order) #define atomic_load_explicit(object, order) \ @@ -285,9 +287,11 @@ typedef _Atomic(__uintmax_t) atomic_uintmax_t; __atomic_compare_exchange_n(object, expected, \ desired, 1, success, failure) #define atomic_fetch_add_explicit(object, operand, order) \ - __atomic_fetch_add(object, operand, order) + __atomic_fetch_add(object, \ + __atomic_apply_stride(object, operand), order) #define atomic_fetch_sub_explicit(object, operand, order) \ - __atomic_fetch_sub(object, operand, order) + __atomic_fetch_sub(object, \ + __atomic_apply_stride(object, operand), order) #define atomic_fetch_or_explicit(object, operand, order) \ __atomic_fetch_or(object, operand, order) #define atomic_fetch_xor_explicit(object, operand, order) \ From nobody Sat Jun 20 00:24:57 2026 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 4ghwG13ktHz6hFRb for ; Sat, 20 Jun 2026 00:24: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghwG11jLGz3HpT for ; Sat, 20 Jun 2026 00:24:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781915097; 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; bh=iXGncXR89A0jz1TzgXM+fZrEXIX4n4AeDkcoA9yHLV8=; b=gLdUZeUCmIqKrMr14kZ6iomeVNLpDZxGiTh+1TlJcuhrRy+Q1xr2zEACJJPSXBL7BTMXVP AT00ZGCLi0QsWAhl5kNKwKT2wGHo9oILGXwvZkhdN0+Mm36DF5wM0CynUyy9do/dEvyBy9 MbQre5TWX92bAY0MmGemV5lGV3eGZ/B151hBhsLsqyo5E+0uO9BEUv3ESx8tDtMAF7IryP EReYD4N3CW3YVTWRx8TiBtGGmPnGT1vYNqt+MDLJsW8zuoe1szz0eHWu3m/3JZFGAx2+Is UGWPelRARl6aIHh9IgvN3vOgT6D5pHl+OUx8Z0CZ45G6FEEZrIHizfXYU/BNqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781915097; a=rsa-sha256; cv=none; b=hy3xl5WmYOffAxnptEcZwSjYW7qPv+JmNgH9RqATgLXiKZVvtrZYHvi/yq7wMCHjmRGINh 3J7qPr8mStdJK2vgkMYLD09JAW+UkcUuoPLdrLKG2IS04FRsjy5hS+ocRoWP6J22Zrby1q Bqxak3EiAnqVR3JHptIk4KGPb/d57pDp2l2Uo4417nT0DLFCt2MHf5Ntj0pSf7zHRQw2gH BjyuBOoDZzqeH14VcCkpdwVojaBpnX6yGd3K9QZhFASkL56jUC+0UZtgJ+LmJs/Rm0P/qw 9G2keZUmBvBYjbPbueJ2u+EQh8gj0gZqwoKEEJAWOWT9Qud0xuvkRB2jjyVajQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781915097; 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; bh=iXGncXR89A0jz1TzgXM+fZrEXIX4n4AeDkcoA9yHLV8=; b=bxj3xlL+MHQM1gZnw7zv0oPoDuo9CUQ3vbyt7fRW+LkUrAGywtD1v+lCgESvr6xs8Y+1SF AlBmAh7QPSZk+mjteLmrRk6AYVIZo+euDvU2EKo/Ck3eWuYc3dDbShoka3pvV8beaT0XAD CfoFrg37n0p7FKHE09Az9oXn9boG3D9PlshdAev9XvgXCLgN1u67YamyPPbHZ+pBum930l NkTE2y5Ak+TkwDXqI99jmBbw5g5c1RGG2ixw0tfrFSZBQPJiRmNxElVhGHT9dhUANYnNUg iBD/5iiIruLUVpLwypyhjpLDQAFAULUyPYBxGPafKTM5+2uhAbdjG+2C/Sh/VQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghwG10VrPz17Pm for ; Sat, 20 Jun 2026 00:24:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2538f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 00:24:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Faraz Vahedi From: Warner Losh Subject: git: 54ac231419cf - main - libc: Fix atomic_init for GCC atomic objects 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 54ac231419cf09557d2f5826b1539e83db552410 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 00:24:57 +0000 Message-Id: <6a35ddd9.2538f.5104dbc7@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=54ac231419cf09557d2f5826b1539e83db552410 commit 54ac231419cf09557d2f5826b1539e83db552410 Author: Faraz Vahedi AuthorDate: 2026-05-07 23:00:47 +0000 Commit: Warner Losh CommitDate: 2026-06-20 00:23:29 +0000 libc: Fix atomic_init for GCC atomic objects Add a dedicated `__GNUC_ATOMICS` path that initialises via `atomic_store_explicit(obj, value, memory_order_relaxed)`. This ensures the required initialisation semantics without assuming any particular object representation. Previously, `atomic_init` on GCC fell through to the legacy `__val` member path intended only for old struct-backed atomic objects. For current atomic objects, this caused the following compilation error: > error: request for member '__val' in something not a structure or union As a result, valid code such as `atomic_init(&x, 1)` failed to compile when using GCC. This fix restores compatibility with standard-conforming callers while other code paths remain unchanged. Signed-off-by: Faraz Vahedi Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2185 --- sys/sys/stdatomic.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/sys/stdatomic.h b/sys/sys/stdatomic.h index 3e4bdd505418..c0cbb7f785b5 100644 --- a/sys/sys/stdatomic.h +++ b/sys/sys/stdatomic.h @@ -96,6 +96,9 @@ #if defined(__CLANG_ATOMICS) #define atomic_init(obj, value) __c11_atomic_init(obj, value) +#elif defined(__GNUC_ATOMICS) +#define atomic_init(obj, value) atomic_store_explicit(obj, \ + value, __ATOMIC_RELAXED) #else #define atomic_init(obj, value) ((void)((obj)->__val = (value))) #endif From nobody Sat Jun 20 00:24:59 2026 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 4ghwG41K0vz6hFJm for ; Sat, 20 Jun 2026 00:25: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghwG35Rx4z3J5K for ; Sat, 20 Jun 2026 00: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=1781915099; 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; bh=zD16KWpC8+esWcmEzUfkOSRYBwR41RysdEtRp6uFUdk=; b=QLShWVUegVn94/WiliHvUkBNKToOwW9+clFLI+SzcaOMpVQAnLT4jyc2tRVmUfW9XdUVFs IOsZTAPmx2Peo9jsFiqI8sL2u8mT09W1aetErvFI9bk6DU5UK0WW8+W51QbD94agiA4ICg 3gVFsnyoVZLtMH9ms45kcoIX0Zo2AKUpJAM4tuynNPhjNZLFFWUxeZIWQBz4g7JkSJiXxB O01anO+UpMStE/CT7wYwqNuYbMSaGDvPzZtoiNh+9RcL3igfDC1NDAG7X7swUnQoFMc25s G1nOHLxOxewGfExIDJmKhc05Cw3jcxRHC3o8WhrDdXB5yGsqlpsy42Dbh/jK3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781915099; a=rsa-sha256; cv=none; b=Sqm12s4Cco7gM/mnNOaTVSN2tXVrlBQK7POQkzp80acSmVS5QsHHM8awpPohjLh/eyhAxy Ti0fIbMgxf7+H6zItvAzzKhixL6vlRHxxLYDHUiHkZvXay5+q4OJJ05r+CQDOepbvC3p2h 4Jdu/CuuZsM+UXfYyGWKd1IRBjhaE8HHda3AkxF0UzxAcsug6zKWbdqmeyqWLXTVVKT7iU pBR20U04NvLZeVIzmvG+tcCy4jsNyBVTE+4YmtE6FyNekWS+x1NTdSmo1Jl7X5nIaQ19pR /vnlNkyNSgmteMSxk6Q5ki1A3Xnhr/7CYfkARA+W+z9pDmJm3k6qcEA5/Mx7Pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781915099; 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; bh=zD16KWpC8+esWcmEzUfkOSRYBwR41RysdEtRp6uFUdk=; b=F3qpdfbqqqXEnPzEMh2ymhwD0f6Snujf0h7Q/KbUavciP9kJjYD+hocYrJfZPkWXYlytpH 9srrxCIh+6MiEfbQO/wikAI69UaXXyakYRMwhmCqLZA8JwYI+BYqHvnUuTwX+fPE1aPEul CcD+jjqrkqUCJOaDY5Sk6rHxBEFcLEZsgKhq01hy4nmTjzDSzux710hn6eE5MwdNw8aHvL c1vd2G9RbQaQibY3trA1OdXgKHiX+pSWpE/iGgRWbn0k5k226wq4GgvA+mt9GXGAIZvMHP tMbREkPAFvpPLkIgwv3fW9Pp94VOHrti1/saVceYstck2wqG6UZFrQBK82ptSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghwG327MHz173D for ; Sat, 20 Jun 2026 00:24:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 252d9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 00:24:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Faraz Vahedi From: Warner Losh Subject: git: 0f8941fedce6 - main - tools/regression: Expand stdatomic conformance 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 0f8941fedce6c622f0fa71464b7790225aefa3e6 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 00:24:59 +0000 Message-Id: <6a35dddb.252d9.3f9a03bb@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0f8941fedce6c622f0fa71464b7790225aefa3e6 commit 0f8941fedce6c622f0fa71464b7790225aefa3e6 Author: Faraz Vahedi AuthorDate: 2026-05-08 11:40:02 +0000 Commit: Warner Losh CommitDate: 2026-06-20 00:23:29 +0000 tools/regression: Expand stdatomic conformance tests Extend the existing test utility to cover recent stdatomic changes and improve validation of interface semantics, compile-time assertions, and behavioural conformance. Signed-off-by: Faraz Vahedi Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2185 --- tools/regression/include/stdatomic/logic.c | 109 +++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/tools/regression/include/stdatomic/logic.c b/tools/regression/include/stdatomic/logic.c index e5534851417d..46ac85c57b0c 100644 --- a/tools/regression/include/stdatomic/logic.c +++ b/tools/regression/include/stdatomic/logic.c @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include #include @@ -42,8 +44,111 @@ * especially useful for the smaller integer types, as it may be the * case that these operations are implemented by processing entire words * (e.g. on MIPS). + * + * Before the randomised loop, a small surface check exercises lock-free + * macros, fences, atomic_flag, atomic_bool, pointer fetch_add/fetch_sub + * stride, kill_dependency, atomic_is_lock_free, and when available + * ATOMIC_VAR_INIT / ATOMIC_FLAG_INIT (pre-C23). */ +#define CHECK_LOCK_FREE(name) \ + _Static_assert((name) == 0 || (name) == 1 || (name) == 2, \ + #name " out of range") + +CHECK_LOCK_FREE(ATOMIC_BOOL_LOCK_FREE); +CHECK_LOCK_FREE(ATOMIC_CHAR_LOCK_FREE); +CHECK_LOCK_FREE(ATOMIC_SHORT_LOCK_FREE); +CHECK_LOCK_FREE(ATOMIC_INT_LOCK_FREE); +CHECK_LOCK_FREE(ATOMIC_LONG_LOCK_FREE); +CHECK_LOCK_FREE(ATOMIC_LLONG_LOCK_FREE); +CHECK_LOCK_FREE(ATOMIC_POINTER_LOCK_FREE); +#ifdef ATOMIC_CHAR8_T_LOCK_FREE +CHECK_LOCK_FREE(ATOMIC_CHAR8_T_LOCK_FREE); +#endif +#ifdef ATOMIC_CHAR16_T_LOCK_FREE +CHECK_LOCK_FREE(ATOMIC_CHAR16_T_LOCK_FREE); +#endif +#ifdef ATOMIC_CHAR32_T_LOCK_FREE +CHECK_LOCK_FREE(ATOMIC_CHAR32_T_LOCK_FREE); +#endif +#ifdef ATOMIC_WCHAR_T_LOCK_FREE +CHECK_LOCK_FREE(ATOMIC_WCHAR_T_LOCK_FREE); +#endif + +#if defined(__STDC_VERSION_STDATOMIC_H__) +_Static_assert(__STDC_VERSION_STDATOMIC_H__ == 202311L, + "__STDC_VERSION_STDATOMIC_H__"); +#endif + +static void +test_surface(void) +{ + atomic_flag f = ATOMIC_FLAG_INIT; + atomic_int probe; + atomic_bool b; + _Atomic(int *) ap; + int arr[4]; + int dep; + static const memory_order k_orders[] = { + memory_order_relaxed, + memory_order_consume, + memory_order_acquire, + memory_order_release, + memory_order_acq_rel, + memory_order_seq_cst, + }; + size_t k; + + dep = kill_dependency(123); + assert(dep == 123); + + atomic_init(&probe, 0); + assert(atomic_is_lock_free(&probe) == + atomic_is_lock_free((atomic_int *)NULL)); + + for (k = 0; k < sizeof(k_orders) / sizeof(k_orders[0]); k++) { + atomic_thread_fence(k_orders[k]); + atomic_signal_fence(k_orders[k]); + } + + assert(atomic_flag_test_and_set_explicit(&f, + memory_order_seq_cst) == 0); + assert(atomic_flag_test_and_set_explicit(&f, + memory_order_acquire) != 0); + atomic_flag_clear_explicit(&f, memory_order_relaxed); + + atomic_init(&b, false); + atomic_store_explicit(&b, true, memory_order_relaxed); + assert(atomic_load_explicit(&b, memory_order_relaxed) == true); + + memset(arr, 0, sizeof(arr)); + atomic_init(&ap, &arr[3]); + atomic_fetch_sub_explicit(&ap, 2, memory_order_relaxed); + assert(ap == &arr[1]); + atomic_fetch_add_explicit(&ap, 1, memory_order_relaxed); + assert(ap == &arr[2]); +} + +#ifdef ATOMIC_VAR_INIT +static void +test_atomic_var_init(void) +{ + atomic_int x = ATOMIC_VAR_INIT(42); + + assert(atomic_load_explicit(&x, memory_order_relaxed) == 42); + atomic_store_explicit(&x, 7, memory_order_relaxed); + assert(atomic_load_explicit(&x, memory_order_relaxed) == 7); + + { + atomic_flag f = ATOMIC_FLAG_INIT; + + assert(atomic_flag_test_and_set_explicit(&f, + memory_order_seq_cst) == 0); + atomic_flag_clear_explicit(&f, memory_order_relaxed); + } +} +#endif + static inline intmax_t rndnum(void) { @@ -111,6 +216,10 @@ main(void) { int i; + test_surface(); +#ifdef ATOMIC_VAR_INIT + test_atomic_var_init(); +#endif for (i = 0; i < 1000; i++) { TEST_TYPE(int8_t); TEST_TYPE(uint8_t); From nobody Sat Jun 20 01:45:38 2026 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 4ghy37240Hz6hPtL for ; Sat, 20 Jun 2026 01:45: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ghy371QCfz3c79 for ; Sat, 20 Jun 2026 01:45:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781919939; 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=4bncwANcK0wadtrJcQHXhx+WvV09zGiaefyFRPb/YoI=; b=qjzENgAcVxCZlwaNit0EAgO1RbLOW/DF5e6H5TvBF8SJnXIZpzcwRL/lzVMEy5XR8qMkTJ e+I/JF8Gu5dsdPQrhjRrCfSmzpK5O5Yr9uW8P75g1a2SADvOw3v2HziryVjNQu1wIhpTlp zfx4S9hrUGw4XqrsXUXtCEWKoadfoXkvpYhw5Se973C8wyc4ajN8WEVDxr+2hfBURWxNFt FsaAF2BxkOw72KAmjh8S71IigmToLGeQ2isF6SiShIUWADXvZOnjbCPaGnd9IWrJSPQuKg 9d8pWHXj7TYnmUd5P8FtG8v+aYt5NOAVkMJVaosrI0sTiqbnCAVHbViMK56ANg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781919939; a=rsa-sha256; cv=none; b=o4XoFGsiWeLEFLmLoMN65PdWVW6IRI1CljoqYT4kOt46ujrKkr3z8E6vyaQ6BTtHy8S6sF pHIjxJbZgVuKxhIoPPdJz7lvwbvog1ZMKkgS8P5/P3X6jE9ZdomgK146xKfY7MSS68KxQa fZ8l3RRMNGEBdlYJNBZ4fsFnBk4qglwQ/BjnhtvqOtWVKJ0MTgORLYZfY8Bpm182A/5zLq VZYA/c3hRvZ9ynuC1m0f3cGU0BJ2jz5B3kz6DXX2RUGAbflxlnFmOY2cfGylVp1ykHiJUz qsSFsCERsn/U1+9jKy1G2oRNXrG1m3uaOEoM+mShc4Uo0LXySQjG0lMUPnirlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781919939; 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=4bncwANcK0wadtrJcQHXhx+WvV09zGiaefyFRPb/YoI=; b=OjcZlw/OrI8uegKcZQmnURceMuIuSex5QZLwHIWqSxdqZPm7+7gcseut32Ruu2khQs2V+p QenIyyptJbOezwWHwWAv4QZ53BdIdlw7LCxKpqFp9foLRH379wt+H+oMwoSbeKfhAOXRiC Xtmv8rO4fsw/xFP2DwuXfw4TqpXCHtc7d+/r1OJPRx4ZlDUHBIuQN7MMe8R2iymWGTNBAL adoKnziA4n3GjL1qwjFTW28ajogbT7Umf6iMOrHCn4kJY6Lp+J4AFSBMT3ruXD5Foeh88k yG3OZYfwfCdSx8MJxcH7gIkj0dI6xG2tpryYN4Z9UqmTj5IADK6Vs0jXmnMy6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ghy366pVGz19Ry for ; Sat, 20 Jun 2026 01:45:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3616f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 01:45:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Tetlow Subject: git: 22d66952555c - main - ifmcstat: Fixup getopt args to match reality. 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 22d66952555c86a5b7d1d499b48906c3a5f4c13d Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 01:45:38 +0000 Message-Id: <6a35f0c2.3616f.7462da56@gitrepo.freebsd.org> The branch main has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=22d66952555c86a5b7d1d499b48906c3a5f4c13d commit 22d66952555c86a5b7d1d499b48906c3a5f4c13d Author: Gordon Tetlow AuthorDate: 2026-06-20 01:39:50 +0000 Commit: Gordon Tetlow CommitDate: 2026-06-20 01:39:50 +0000 ifmcstat: Fixup getopt args to match reality. Reviewed by: emaste Fixes: ad0e698e642e ("ifmcstat: remove libkvm(3) code") Event: BSDCan 2026 --- usr.sbin/ifmcstat/ifmcstat.8 | 3 --- usr.sbin/ifmcstat/ifmcstat.c | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/usr.sbin/ifmcstat/ifmcstat.8 b/usr.sbin/ifmcstat/ifmcstat.8 index c885aac936e3..6ddb991072da 100644 --- a/usr.sbin/ifmcstat/ifmcstat.8 +++ b/usr.sbin/ifmcstat/ifmcstat.8 @@ -39,9 +39,6 @@ .Op Fl i Ar interface .Op Fl f Ar address-family .Op Fl v -.Op Fl K -.Op Fl M Ar core -.Op Fl N Ar system .\" .Sh DESCRIPTION The diff --git a/usr.sbin/ifmcstat/ifmcstat.c b/usr.sbin/ifmcstat/ifmcstat.c index 72f5ad765dad..f9745bb1064c 100644 --- a/usr.sbin/ifmcstat/ifmcstat.c +++ b/usr.sbin/ifmcstat/ifmcstat.c @@ -127,7 +127,7 @@ usage() exit(EX_USAGE); } -static const char *options = "i:f:vM:N:"; +static const char *options = "i:f:v"; int main(int argc, char **argv) From nobody Sat Jun 20 10:55:20 2026 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 4gjBFj10HSz6jKJD; Sat, 20 Jun 2026 10:55:37 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjBFh4JV7z3Try; Sat, 20 Jun 2026 10:55:36 +0000 (UTC) (envelope-from kib@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 65KAtKEY043165; Sat, 20 Jun 2026 13:55:23 +0300 (EEST) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 65KAtKEY043165 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 65KAtK41043164; Sat, 20 Jun 2026 13:55:20 +0300 (EEST) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Sat, 20 Jun 2026 13:55:20 +0300 From: Konstantin Belousov To: Warner Losh , alc@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Faraz Vahedi Subject: Re: git: 9d87c1aac4a8 - main - libc: Add missing kill_dependency macro Message-ID: References: <6a35ddd4.24ba1.2ad9343d@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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6a35ddd4.24ba1.2ad9343d@gitrepo.freebsd.org> X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=4.0.2 X-Spam-Checker-Version: SpamAssassin 4.0.2 (2025-08-27) on tom.home X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4gjBFh4JV7z3Try X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Sat, Jun 20, 2026 at 12:24:52AM +0000, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=9d87c1aac4a84ac5e82acf872f645a7202977204 > > commit 9d87c1aac4a84ac5e82acf872f645a7202977204 > Author: Faraz Vahedi > AuthorDate: 2026-05-01 15:41:49 +0000 > Commit: Warner Losh > CommitDate: 2026-06-20 00:23:28 +0000 > > libc: Add missing kill_dependency macro > > Add `kill_dependency` as specified by C11 §7.17.3.1. > > The macro is required to break dependency chains in > expressions without affecting the value. > > No functional impact beyond providing the required, > value-preserving definition. > > Signed-off-by: Faraz Vahedi > Reviewed by: imp > Pull Request: https://github.com/freebsd/freebsd-src/pull/2185 > --- > sys/sys/stdatomic.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/sys/sys/stdatomic.h b/sys/sys/stdatomic.h > index 2d565ce991be..e6eb46cd6ef3 100644 > --- a/sys/sys/stdatomic.h > +++ b/sys/sys/stdatomic.h > @@ -141,6 +141,8 @@ typedef enum { > memory_order_seq_cst = __ATOMIC_SEQ_CST > } memory_order; > > +#define kill_dependency(y) (y) > + GCC at least with the version 16 uses a different definition for the kill_dependency(), which might have some side effects for the gcc optimizers: #define kill_dependency(Y) \ __extension__ \ ({ \ __auto_type __kill_dependency_tmp = (Y); \ __kill_dependency_tmp; \ }) Since the semantic for kill_dependency() is believed to be not well defined, I think we should provide gcc-compliant definition at least for gcc. From nobody Sat Jun 20 11:53:53 2026 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 4gjCXx3RmSz6jQ3Y for ; Sat, 20 Jun 2026 11:53: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjCXx1p0Sz3bKL for ; Sat, 20 Jun 2026 11:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781956433; 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=O+Qqvbg34XUKmnEA1g54q7xrrzMjFAIvcpDr5l518fs=; b=JClHypPHW2eL34HJ9YIaAgvJ5R+IVcFJ7iGEpR3/Xn6nHazQaPG4x6yS/IENyAj/We0q+4 kbGZ818WOG2SjhyM3xJimhGp7J4bmuHDRY/0CM1DcUDbvqlowK+hL2IeJ0SDAiJyt6kmho T5gZ1HWodoC+OGgXVhbVtXkbxHY856ot1SIRmD8vWJLhc+MfR7WQ3f5UfP5y+uFy41PHjV CdP75nHHYcyAX3AWmjNC2xATyYgdCKU5PwtQENwSnNJcrbP+0RKF6pxsaXyev3FIOpHD0x NHUt2XfhXZtmXVcMDfYs9feyKlzH6dp/vgYKgjq9el99EiSSJKO+Phi5C6whjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781956433; a=rsa-sha256; cv=none; b=DVc0yhBmXl5r/whSEmRxXAo9/46x/YXGF2YC0OZIxaaNReVe6v3MYSg/B9o46slrQxlMRc fZDPMEqU1ZHQjJ1q05ANlBbF+Bx9+BtqCtveGD6lJX3pjBBc+mU245wOtQ8Y4PecIuUvgp CYU+R64CngFDrm2l4GBPs+Tz6nvVfQg+efjvREEgDantskXSPiMJKgHYLiiu8Z3XOK5f62 P2bdkReIFwUvgNg8JBXzFIlOppbWY9v1trsPcJvK35HBW4jJinzEbwfaiGJfyJlcUqF6yK Vr5LxmqbHmtu/ndqNB8SEJDf6orvUFId/u7E0vcAxNm0MxGGm/2FX5AxRa+RHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781956433; 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=O+Qqvbg34XUKmnEA1g54q7xrrzMjFAIvcpDr5l518fs=; b=DJZ206Mkf/1iOMpWvfP6nHFVdEhl4tDI4lgiuIuPakt7qb2GBJqa4QcFxWwW3bliXTTJWj W7fJd3UwNbFogctODSHDr5CKXvD3FHC7hq+hbI6jZe4hhl9o/r4eMP7bK5Kax9+e3/wKOy 359tS4z9cZ0mpV9fUce4DbxvtiI9V9yc8yJI4LMJQJkJF+aW7elmRJqYmJQcs8a41ws2WD 4Fx8sPFiDtyjD7+vC1dc42g1Oktg0NB5v0cDmfUQLYrMIbug6WF3rMKSVLPZhKelZLokrY WtDIEOzDKn5FvVWs2OlS4r+jVutjR1IPwdFy0OZv/4U2rF2R5OqGq7UEVp1tnQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjCXx0TDwzDZT for ; Sat, 20 Jun 2026 11:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 255b0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 11:53:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron Subject: git: 4831a8d792d4 - main - sys: Add `isgraph()` to 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4831a8d792d4ac2cbf4d49d9d220947fb53e2e86 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 11:53:53 +0000 Message-Id: <6a367f51.255b0.19486359@gitrepo.freebsd.org> The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=4831a8d792d4ac2cbf4d49d9d220947fb53e2e86 commit 4831a8d792d4ac2cbf4d49d9d220947fb53e2e86 Author: Jean-Sébastien Pédron AuthorDate: 2026-06-12 14:39:21 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2026-06-20 10:34:20 +0000 sys: Add `isgraph()` to Quote from https://pubs.opengroup.org/onlinepubs/7908799/xbd/locale.html: "graph": Define characters to be classified as printable characters, not including the space character. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57578 --- sys/sys/ctype.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/sys/ctype.h b/sys/sys/ctype.h index effb549b40f8..2e5827cc02f9 100644 --- a/sys/sys/ctype.h +++ b/sys/sys/ctype.h @@ -87,6 +87,12 @@ isprint(int c) return (c >= ' ' && c <= '~'); } +static __inline int +isgraph(int c) +{ + return (c != ' ' && isprint(c)); +} + static __inline int toupper(int c) { From nobody Sat Jun 20 11:53:54 2026 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 4gjCXy3qGyz6jQ3Z for ; Sat, 20 Jun 2026 11:53: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjCXy2fnNz3bgj for ; Sat, 20 Jun 2026 11:53:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781956434; 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=SkIw6sJa//R1/CYfFj7gdx96gKjifRTwAJuUKqVD2pk=; b=QxX808yySQL1R4/qGniHEHXh+xuNhPdrXm0pYyCyvlT6KG7FlR7xz2YRbimsmw/wyKPU3d ezLmMMCVQjWYd+T2lHAFGm8uoY7TvjcNNXYBrhofuSgd2mjXM6JaTkkk9xKfpqIV4ySPvN ANFNE1eIR88eZAno+23Dh0pUcSwJLZ0RkVNEt7rKyIonUqTdqSZwNSi+nxqvTpQDA0CZj4 AvjdyL4bWKW+fIcdevqD5dMILc0zCHHPP40gmdukDdqf5AjRELjGKvTma7QbA+w01MRukQ 78SNcp9QUpzW48tHSfnyARSaHTNBZfdPMJCs1us8PX2M820AzIxGYo0Hj5x/PA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781956434; a=rsa-sha256; cv=none; b=cqZHVON+JxUvSK+pPb0A29UBnhJ50u4AEEKH/r3XmOz6gAHuFxI6XuPUGTHPCsSvXK4ag7 m8y37qZJidEbT/E+86gmp3PUDvgXSTUEVrUYpS3dbuC/DmYyQfchRWrrkfKHEUG2QCtxMa qZi13dTnTPxNnltZC9KikTIlIMPHLDoT1cGy+6M4hznrj7mO/W8mcdgs97XR07oaob9PUA LJ+QSYgJmHsOHvMZ9rhWyXpr2U5pXj9TMtKEyf0rVYdg2IylLPycMe+xr0uprKkczF3SAQ xg7fLsb3bFPGUiFklfnLinXlAEiMVGgkADYuT1JV+5panO0qYewdjZW/Sa0wxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781956434; 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=SkIw6sJa//R1/CYfFj7gdx96gKjifRTwAJuUKqVD2pk=; b=WPtybN5nkEJy31Z8dtTmd+MnstY/Ax+I3/uc7hbP3dcDsQkFSZli/5oE7+zlvRsQyBO5q9 0jVEcHwRq+jV1Fb7i0qKmyKiFsqXIX4IFQC7kmjKeq0w86o5xboDbwobTFmKYN2Xx14XhG fr70dEKOzSJMmTYw3G0B8pejOVsXhgg/1BenNGZPicJAcuiLk94jLLK9OQPRrfW/iABhGN MqpbtwDm1aROdn5tBupnM1NDSMmFEJJV4vgNu9MaiTFzfIJ08fr2uSPj86UF28226J5eb6 sXAV6cu3BDNrXcls5VzhojfqBNvuira+HBC8YwD8zzcLzDCMiC7B7YqvCgNvZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjCXy1P0mzDPV for ; Sat, 20 Jun 2026 11:53:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26292 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 11:53:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron Subject: git: 294553b022b1 - main - linuxkpi: Define `__ATTR_RO_MODE()` and `__ATTR_RW_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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 294553b022b1e775111365094a70041934d98501 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 11:53:54 +0000 Message-Id: <6a367f52.26292.318c88f8@gitrepo.freebsd.org> The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=294553b022b1e775111365094a70041934d98501 commit 294553b022b1e775111365094a70041934d98501 Author: Jean-Sébastien Pédron AuthorDate: 2026-06-12 10:44:36 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2026-06-20 10:34:45 +0000 linuxkpi: Define `__ATTR_RO_MODE()` and `__ATTR_RW_MODE()` They are the same as their `__ATTR_RO()` and `_ATTR_RW()` equivalents but they take the file mode as an extra argument. We now use these new macros to redefine `__ATTR_RO()` and `__ATTR_RW()` on top of them. The amdgpu DRM driver started to use `__ATTR_RW_MODE()` in Linux 6.13. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57574 --- sys/compat/linuxkpi/common/include/linux/sysfs.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/sysfs.h b/sys/compat/linuxkpi/common/include/linux/sysfs.h index 7c8c4e2e32b9..4aea46d6b120 100644 --- a/sys/compat/linuxkpi/common/include/linux/sysfs.h +++ b/sys/compat/linuxkpi/common/include/linux/sysfs.h @@ -64,12 +64,15 @@ struct attribute_group { .attr = { .name = __stringify(_name), .mode = _mode }, \ .show = _show, .store = _store, \ } -#define __ATTR_RO(_name) { \ - .attr = { .name = __stringify(_name), .mode = 0444 }, \ +#define __ATTR_RO_MODE(_name, _mode) { \ + .attr = { .name = __stringify(_name), .mode = _mode }, \ .show = _name##_show, \ } +#define __ATTR_RO(_name) __ATTR_RO_MODE(_name, 0444) #define __ATTR_WO(_name) __ATTR(_name, 0200, NULL, _name##_store) -#define __ATTR_RW(_name) __ATTR(_name, 0644, _name##_show, _name##_store) +#define __ATTR_RW_MODE(_name, _mode) \ + __ATTR(_name, _mode, _name##_show, _name##_store) +#define __ATTR_RW(_name) __ATTR_RW_MODE(_name, 0644) #define __ATTR_NULL { .attr = { .name = NULL } } #define ATTRIBUTE_GROUPS(_name) \ From nobody Sat Jun 20 11:53:55 2026 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 4gjCXz4C4nz6jPpN for ; Sat, 20 Jun 2026 11:53: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjCXz3Q8fz3bb8 for ; Sat, 20 Jun 2026 11:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781956435; 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=R+QQHyAoLXx1TPJW7+VccAgF0k7EdwzaGZS1I80EL1U=; b=Ug5FfHvpnVI5Mx5sVuMq3jpD7yI80hkVTtS0TwHacpH7ljq5fKN5ef5v5TcMk/p3CO6t17 2/y+GY76irPDeAblOj0bCyD9Ez19QVxpFW9BP6R9B/sf/KkGFGfTT9nPPVwjGjCPyzHYj/ w5LF7Ks1tF/9V4xkvufirlxm8AHDS1g9IYOOtQ3OUkZDukFSjwvLY70RnZcKcSBVpRm22k s5+Wu6brRDPo1PCNjPpvBLl2LnUf5PkvlhwKROGbH+MIUXO9t9iYAuIF2LS6/v58VwVxcK scfFg4TLcRRFlMZj12WGyADGYiE+BsohURQUqr6lVEi53WwcksJrAxmt09eH7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781956435; a=rsa-sha256; cv=none; b=LMr/RQoC5eqexwkGQdpq1oLAEiJPl6S56uvEaWSVQHRC0FB/88M8LqBLxObokWfxA8tFe2 mXtkKhmYQD9pO8txS5h5OYV0Qg85glMgSheJa1VVT3v9HsM0b3x3YCnRdT418RQ3PvsGrz RBEoc603HEjT2yJ2ZGpYJAUD2w/pLHHAsohWFnGfrBh03l2ygIYIN7tO9ezepLDpXaEiGJ 1yKalu4q2qqmhZn2WE1BQubttSOAaLOsK8ul+/db7PY7k4Mx7mh4xEHovfqxKcHk+s4Al8 6wVdyBLGvuJe1mI+2ARu1h+GJK8MQ7CIQZEjXXLXsxHeGkeYgLyILmHthLSsgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781956435; 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=R+QQHyAoLXx1TPJW7+VccAgF0k7EdwzaGZS1I80EL1U=; b=TDmYBSgqPTuct2TdL+mFWT21M+MqPeYd7a/D4IftbxPEuf9sHndAL2Si3i4/qjwBQWsmgB dGWuH4MS3iwkA8MtolgtDv05YlSxbX3B8eXZGhL6yibyZQNqbxnQnZFZxnbrJRIocxFrmP pAznT9Y7zcvWMEK+OyKLtzd+gsfgd2ssCHsv3g/KRF5bIpot7Ki25neoewHVsG0n4f4Cba lDvtb0WF9UVCevDoJHW2jnUh1YiNd1F+YPkWBTn7zH+51JzD5sXmaW/XNQuzpThtEqBbb1 6rBBtrzSdULzPEWx3Xc9H++ZARiaVttMTs9ypMhs6eykQrMM2sWuTUnQAHFUVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjCXz2KsCzDWh for ; Sat, 20 Jun 2026 11:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26351 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 11:53:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron Subject: git: 53baadc2f615 - main - linuxkpi: Define a bunch of constants in 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 53baadc2f6154d738f935a9dcc26648d2b3d89fd Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 11:53:55 +0000 Message-Id: <6a367f53.26351.5cd434fa@gitrepo.freebsd.org> The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=53baadc2f6154d738f935a9dcc26648d2b3d89fd commit 53baadc2f6154d738f935a9dcc26648d2b3d89fd Author: Jean-Sébastien Pédron AuthorDate: 2026-06-12 13:58:06 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2026-06-20 10:35:08 +0000 linuxkpi: Define a bunch of constants in `ACPI_VIDEO_NOTIFY_PROBE` was already defined. Let's define the whole set once and for all. The amdgpu DRM driver started to use `ACPI_VIDEO_DISPLAY_LCD` in Linux 6.13. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57575 --- sys/compat/linuxkpi/common/include/acpi/video.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/acpi/video.h b/sys/compat/linuxkpi/common/include/acpi/video.h index fd2ffd6764d0..64c222bc2429 100644 --- a/sys/compat/linuxkpi/common/include/acpi/video.h +++ b/sys/compat/linuxkpi/common/include/acpi/video.h @@ -34,7 +34,25 @@ #define ACPI_VIDEO_CLASS "video" -#define ACPI_VIDEO_NOTIFY_PROBE 0x81 +#define ACPI_VIDEO_DISPLAY_CRT 1 +#define ACPI_VIDEO_DISPLAY_TV 2 +#define ACPI_VIDEO_DISPLAY_DVI 3 +#define ACPI_VIDEO_DISPLAY_LCD 4 + +#define ACPI_VIDEO_DISPLAY_LEGACY_MONITOR 0x0100 +#define ACPI_VIDEO_DISPLAY_LEGACY_PANEL 0x0110 +#define ACPI_VIDEO_DISPLAY_LEGACY_TV 0x0200 + +#define ACPI_VIDEO_NOTIFY_SWITCH 0x80 +#define ACPI_VIDEO_NOTIFY_PROBE 0x81 +#define ACPI_VIDEO_NOTIFY_CYCLE 0x82 +#define ACPI_VIDEO_NOTIFY_NEXT_OUTPUT 0x83 +#define ACPI_VIDEO_NOTIFY_PREV_OUTPUT 0x84 +#define ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS 0x85 +#define ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS 0x86 +#define ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS 0x87 +#define ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS 0x88 +#define ACPI_VIDEO_NOTIFY_DISPLAY_OFF 0x89 static inline int acpi_video_register(void) From nobody Sat Jun 20 11:53:56 2026 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 4gjCY074bGz6jQ3h for ; Sat, 20 Jun 2026 11:53: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjCY057Zzz3bKW for ; Sat, 20 Jun 2026 11:53:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781956436; 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=eDZqFL5k2EvrBJYEUG8PR71weQScSsXQa4R7NRt+g2Y=; b=VMiN5M8g/itJ+mSEsnJ1A6TMZJ+XgjMai30BceLVkSf/pcWdxbBArRJ+B4vhJObr3han+J LHE/myEFsuuV58tXdnsjOcZyAEIDJPTB00nUypbbqXjHb9gKV1GxPV4j6Wr5SSdVPKU8qt c5iGnCKQO47b+Lindb37zzpKNUBM9k+vrKItJ7hBJ/FFk/ysQJncZtzQxvQdlBKCbsXVkJ E9guMDSvlBqly2IjTg7S7ODT7GYARs2HyQp2/BPCehRWmsfg+c8ANE80tFuiSMN6jSvjXT 7fgrF7XC0QQA7k2NOO877bPJmruZSipdCc/DEVi15aW4ULB4zDvHMOY+oxAmnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781956436; a=rsa-sha256; cv=none; b=V6vMrN5R9vFtl3A8fXwRp3xok07mqEJ8VkIbbmkMIGkjAUpAyUQ27fUZ29LlpW4Pg6sumZ jRgESdLbHB8btECLc34CjWFRfu3mBhcwoktWp6mTydtXaZ8WgQpUTC/PGdMLIt7hJxESuC Ds6VIo4muHKG2kDSmwQYpvukYOSgdYSah8BSMMjGDNuogCRM53y9lOmaOzQyHc15X24kss SIYAbz219P/ORHX7Y///oMHvbbQppKGruWFoRP4fT8Ym7wgQNX2aIODGHNAXYg75PNqxJ2 wcuHJK1bHxAJ+agA+exv780HTDUjnkgPv+JpB0nHPgnp5exSPeqExYondRTkAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781956436; 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=eDZqFL5k2EvrBJYEUG8PR71weQScSsXQa4R7NRt+g2Y=; b=qUydxvjKqTJNUax4JI8qlksN8KTisAXeA4bMHXha0NLJQfROvE9RCqQXC0GG3/RoYe/OE1 kYwY6lpKTTcpZyqq6zbXyLZuye0Va6fy41pMp/BEU7WSlBv5idU0wdb7ybBKjvFtWB3uf+ NED518uZ40PFzMStMHzdWIOqgQOX8pKasx8apK6liPfsa0CKU03jB4dvtb4YHgF74suwtP 3ELeX4u/kjIQ6iGXmslg0miEuxC3goVlwHWlhb7n33+dQ7nrQFlWzrKmnRZC3Mztb13QWJ st6DVXSXvjBuJPhz+juEZvpHrGOtXcB3FkfjGA3kfqjKvD5iesb4TFl42zsTqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjCY03CCtzTZ5 for ; Sat, 20 Jun 2026 11:53:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26355 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 11:53:56 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron Subject: git: 2e10a6bd5627 - main - linuxkpi: Add `pm_resume_via_firmware()` 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2e10a6bd562768256f38078b84d95da30e1e2aa1 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 11:53:56 +0000 Message-Id: <6a367f54.26355.40d16262@gitrepo.freebsd.org> The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=2e10a6bd562768256f38078b84d95da30e1e2aa1 commit 2e10a6bd562768256f38078b84d95da30e1e2aa1 Author: Jean-Sébastien Pédron AuthorDate: 2026-06-12 17:00:31 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2026-06-20 10:35:25 +0000 linuxkpi: Add `pm_resume_via_firmware()` This function is unimplemented, always return false. While here, fix the return type of `pm_suspend_via_firmware()`: it should be a boolean, not an integer. The amdgpu DRM driver started to use `pm_resume_via_firmware()` in Linux 6.13. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57580 --- sys/compat/linuxkpi/common/include/linux/suspend.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/suspend.h b/sys/compat/linuxkpi/common/include/linux/suspend.h index 3a8bec392437..b5447a28aebb 100644 --- a/sys/compat/linuxkpi/common/include/linux/suspend.h +++ b/sys/compat/linuxkpi/common/include/linux/suspend.h @@ -27,10 +27,16 @@ extern suspend_state_t pm_suspend_target_state; #define PM_RESTORE_PREPARE 0x0005 #define PM_POST_RESTORE 0x0006 -static inline int +static inline bool pm_suspend_via_firmware(void) { - return (0); + return (false); +} + +static inline bool +pm_resume_via_firmware(void) +{ + return (false); } static inline int From nobody Sat Jun 20 11:53:57 2026 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 4gjCY20Py4z6jQ0l for ; Sat, 20 Jun 2026 11:53: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjCY15914z3bGv for ; Sat, 20 Jun 2026 11:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781956437; 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=CTMMKVLFUsZz8YOxhSfcA/IhUDzC7R77LS6pBg+ODRM=; b=JhOjuuPDePl6KZ65JIRg0tepCdMrWO8G2EDU/dvBhaC0m1M6U63r+gPDtapQZ+zUYnwRC/ kE7QeV7wAJCV8KzhJX200NJFXT5fxWhC6xhd6WYsaNuDnggKisgzCqWWlsjpvcB4mNhkdB I/CcLdgV3DHQhdnwQX3Pre1iokBK3DiUC+u5Dgu+/uOMbAEH4Z636UW9zhtawM+HEKzBrj 5FqHd0QXabvGdr7nw5XC0jlHVFiTqTMt6gd3Z9ku7fk6yKHn5ygvNMtUKDbHjQlE2OJfyR MM2r5MCjRnUjupxJcrPkJOmCmD7rfvzDM6pj25N+g9O6YRW8l7jV0RMgD0sbHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781956437; a=rsa-sha256; cv=none; b=mco20B4fTluEp6zio4/6Xdegj129uhxQteIkyAvsO+UgOqw1ieRt2SzZYNSvUX4rs8Fbfp Bb4WhAZh0bUC88Bl9wSRxGhRKqHoT4Dt7ZhVjl75kmVK+JoyL4I3ZRzbcqVNnjjj4kbhNs 9CFaNrP5+Jdpq3Js5bdNMnQdTIOgAWqR7i5b0uAM6LsOZ+hg9r85fvBi+BZKbAf3eKGkgV +t/Hj9/Tps/EN44Hs7FyMRkZs+nt1niZz6QJxBmSljoa08mwiI4ftogYasp69ItbcDSxd2 4JP0Lo9jRIYm00Lwrv9O+rkMDA3FoQtvknbuM/HRM9exqKELHtWBdRt/5al9gg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781956437; 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=CTMMKVLFUsZz8YOxhSfcA/IhUDzC7R77LS6pBg+ODRM=; b=tVgKG10NigRD4V+wKJPwDj/ro7j8PCfLvc9ccfH5Pvv/gDIAVz8/imHD41koPrWYb37izk UHj7tuRB+f2gFKDhf5ReXyYQ86dMUP8TXTRn4784XFEdYoIzcJON8hLAGH0DzjgVeAJV/I nWi3x8scVwAeHTdYnz/fsSOV5t7+HKzY5r0ZcsS2gUL7HP6w1r5D21JbOZ7bRzVj3GTpPQ qBAfdl7w3OAFoSwKiqv+5BJM/rm2l6E3kzX63mFvs4/UgKG85E8cOgpbfsIJwjqM9Wgpk5 oL+OpAyRE4niPlDgy5XDrHlJiMWRZwehYL+AnG91IR/Xz3YrjHqIebm5M2mxOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjCY143qdzDWj for ; Sat, 20 Jun 2026 11:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2701c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 11:53:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron Subject: git: 50aa145171bc - main - linuxkpi: Add 'fd_empty()` 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 50aa145171bc88edde8cf3b7eb13dbbf88a3f8a7 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 11:53:57 +0000 Message-Id: <6a367f55.2701c.46757761@gitrepo.freebsd.org> The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=50aa145171bc88edde8cf3b7eb13dbbf88a3f8a7 commit 50aa145171bc88edde8cf3b7eb13dbbf88a3f8a7 Author: Jean-Sébastien Pédron AuthorDate: 2026-06-12 17:55:34 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2026-06-20 10:35:37 +0000 linuxkpi: Add 'fd_empty()` The DRM drivers generic code started to use it in Linux 6.13. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57582 --- sys/compat/linuxkpi/common/include/linux/file.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/file.h b/sys/compat/linuxkpi/common/include/linux/file.h index 4d8f8fba7fab..13eecfa6a2b0 100644 --- a/sys/compat/linuxkpi/common/include/linux/file.h +++ b/sys/compat/linuxkpi/common/include/linux/file.h @@ -186,6 +186,12 @@ static inline struct fd fdget(unsigned int fd) #define fd_file(fd) ((fd).linux_file) +static inline bool +fd_empty(struct fd fd) +{ + return (fd_file(fd) == NULL); +} + #define file linux_file #define fget(...) linux_fget(__VA_ARGS__) From nobody Sat Jun 20 11:53:58 2026 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 4gjCY31PDnz6jQ7G for ; Sat, 20 Jun 2026 11:53: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjCY26BMHz3bH1 for ; Sat, 20 Jun 2026 11:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781956438; 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=XHLwpi+o59DMBUMyyjNDmF1bcl6iKDfsrDXEf13xcxA=; b=tm/W9sFpMHu2tabLpO8lvw3arYBz5PbdU/dDCxYm4MmJfGtugWFZDnj/C7kQU1ObIf9U1y 7ql2rVosoOdwljXBaFGKo9DUp3cEcV752m4hH4opWqwQKhUCJxxQJH+c4nMaSMe8L9SPyD cEhVi5+kygSg0eCHpCu0VFS9k8AO8OMYbKoSmAmg55lRmWFrx/MXHElsXFJxECny6Er9Kz GkMK0I9BMkMmS0SU46KHa3JJF5k9AbpfmqJggL11qoR8HNwLT2h6+Px+h+Wcw1wAlo6rK7 vyNInums1BVQRNLDZ5mucNHXCpEyIeUrt3g8EI1mxDby+X026DUmkwNEz2NrbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781956438; a=rsa-sha256; cv=none; b=GZkLPUuBJP15KHmDt0odBQhfg/igiMYSe8zN+QOnyIDnLZjkkc/wrx7VOOou4es+p8/LS7 SUxqSLXnAUhMDPa+KsQts416GhEz85SqJYB3gmwlY7fW6zvo411AW5BSnPBHd2BTBXLMPs SLGRkeyE+2tfAoKEEynACAyh46tZIM79RufedM7WNYutXYBtd3z4VVTQa+dpt7xUyMWBhi t1BYk1m/iuiQ2T29fy3rxQlZd6L561sZF9k1TKMY/tUEt0Rx9iMc/dY0in+dRs7dvNlSfY zPQNbROdRomCV4IRTTWPT+MKqZcZ3//52EjB27VYdQE4JXVEzCosQ5qTvR76Aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781956438; 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=XHLwpi+o59DMBUMyyjNDmF1bcl6iKDfsrDXEf13xcxA=; b=Tf4B8cDSiVxcVcJBYZHdjFdz9ZjzoldgEW0B36kM3g408IzNpHMV/X5uPe6c6C1BxjrDsh PlutRxi8C0c1ZomOPxKMtG/VnM9UobbIoTxfL4OL41jjrEB7gTQxRPoBHkMbGkLrFygpX9 MnzM4UUqQkjDtsUxw1HfOOEIwAH0G9HRUvA8oyC6goHPFdLKOZYZIcP1k6E541ZpuECoOQ 4gg4145V+lUNK8+r8MovGbUFGDJ2TPKFprDveWEjIocc+nCA091D2qskjNFOFHc4kj+Lqi UegCoBDjJJUT+e/2c96fqfCgBD9jUJuk+XGvanOacBalIDWR9MVQ7fMCy7w0LA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjCY252ZgzDWl for ; Sat, 20 Jun 2026 11:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26aa7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 11:53:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron Subject: git: af187b20cdb0 - main - linuxkpi: Define `COUNT_ARGS()` and `CONCATENATE()` 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: af187b20cdb00b89a39dfea1a8eef41ce5c134aa Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 11:53:58 +0000 Message-Id: <6a367f56.26aa7.ff138e4@gitrepo.freebsd.org> The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=af187b20cdb00b89a39dfea1a8eef41ce5c134aa commit af187b20cdb00b89a39dfea1a8eef41ce5c134aa Author: Jean-Sébastien Pédron AuthorDate: 2026-06-12 20:21:12 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2026-06-20 10:35:51 +0000 linuxkpi: Define `COUNT_ARGS()` and `CONCATENATE()` `COUNT_ARGS()` counts the number of arguments it is passed. The implementation is heavily inspired from the one of `CTR()`. `CONCATENATE()` is an alias for `__CONCAT()`. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57584 --- sys/compat/linuxkpi/common/include/linux/args.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/args.h b/sys/compat/linuxkpi/common/include/linux/args.h new file mode 100644 index 000000000000..74c9e43345db --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/args.h @@ -0,0 +1,17 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2026 The FreeBSD Foundation + */ + +#ifndef _LINUXKPI_LINUX_ARGS_H_ +#define _LINUXKPI_LINUX_ARGS_H_ + +#define __COUNT_ARGS(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, __count, ...) \ + __count +#define COUNT_ARGS(X...) \ + __COUNT_ARGS(, ##X, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) + +#define CONCATENATE(a, b) __CONCAT(a, b) + +#endif /* _LINUXKPI_LINUX_ARGS_H_ */ From nobody Sat Jun 20 11:53:59 2026 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 4gjCY425PCz6jQ3v for ; Sat, 20 Jun 2026 11:54: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjCY40Bk1z3bZF for ; Sat, 20 Jun 2026 11:54:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781956440; 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=/ZnqR7zJ86hFY4Pn9mwRnTrQNK+gRQzio219CDWU4P0=; b=Kj1YQaoAaq0Bpkhn1huDTkOdzxWzVXjVpthEgDQAX9aAV6MvWOvH3Sk6dPM64IHfFr8PAa KxKekKg+mQjLM4e+xrDgCntlBPb2hXXsoyI3GSyKKrbe+A3XeMzzC5maMSTVakDVxtSPnV /44nVCAEiFQpS/immMTc5pWDtl5P6plpWu04k2mnNpFtXJfmVAIwgbzjmsGAk3ThhupgQQ 3/QKJZ4D0JBoafZIBqYNcPe+6XQUoxia3nRiUFJo6GheQFf9jlvnTTDzeYtsAa6w1f4mq7 tFI7mzeyFwrNdyEPh0RSFSSPWP5jKhf4VA+Jx9xaxAiR0J0oe7n/YU0atsuorA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781956440; a=rsa-sha256; cv=none; b=PjEOqUfNu2WqMTdjNOyZRtrByx2kOiftJIYjhMX8RA1RgWua0oofgGHQgblMZBqoANGEu9 MzMLFTvetK+lwZ7fNze+m/bCqSldnRQuhV4J/jEzg0S82IWnc4s3A/MTpbVfB7AUvWjvRl vZFMA4Y/iLLqyVmdW9JlwqyU3ajG4Cl/fG/nUEjyZdnw0DfE+cJGvvEXZY2cJbIrOG8EXZ Qowm4kxksDNhmMyNAK6YzDPpbUyQhFE2a2v0Yt5oFXX1AD12pYFiGsjLcXph7CIM0TeVJs vfFsHveFxSlt6T4r3bFpO7gTT9GvDJqWBEhld0b3huZlthrHwZji/Hju9h8GpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781956440; 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=/ZnqR7zJ86hFY4Pn9mwRnTrQNK+gRQzio219CDWU4P0=; b=hD/Eb1+oNV6KHQstD+xUkfIyte+w3FlYV0MMAdTZns/4cQCyig22Q6rkjcWPckLZ8OA+YW Ua9Zrh9nXQewudFVcC7nTdMwY8qk0plFmMWeJYbhtF+cfnuUMEjsQ40SPWUEvMEUOXpf36 urJF90Hm7KHW9tEQjjq7i2G4sCB71/kSIJBnMPkVdfAI5vjSYWGsdYCSECL6a7ZaJDrCIt IQzrO9HeQ1vI3OGmxPCoTrjeRj4fhYqfe7Uh0tJrk/ARtbnB508IzVaDuamLKQrHavhkJ8 6v8KBxwH/Dh+pyj+M7bX6Dqe/z0hUqdfLD/ptLCOTDErlAcnbztSGKjluluyqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjCY363SpzTXK for ; Sat, 20 Jun 2026 11:53:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26120 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 11:53:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron Subject: git: c27779e0a954 - main - linuxkpi: Change `strscpy()` and `strscpy_pad()` to make their `len` argument optional 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c27779e0a9546e8b2bfde74b5c9cbf08bbed000e Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 11:53:59 +0000 Message-Id: <6a367f57.26120.3eb287a9@gitrepo.freebsd.org> The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=c27779e0a9546e8b2bfde74b5c9cbf08bbed000e commit c27779e0a9546e8b2bfde74b5c9cbf08bbed000e Author: Jean-Sébastien Pédron AuthorDate: 2026-06-12 20:22:51 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2026-06-20 10:36:04 +0000 linuxkpi: Change `strscpy()` and `strscpy_pad()` to make their `len` argument optional The previous implementation always took the `len` but now, it is optional and defaults to the size of `dst`. The DRM drivers started to use `strscpy()` without the `len` in Linux 6.13. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57585 --- sys/compat/linuxkpi/common/include/linux/string.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/string.h b/sys/compat/linuxkpi/common/include/linux/string.h index b195dcc8fe9b..8a4da9e19c94 100644 --- a/sys/compat/linuxkpi/common/include/linux/string.h +++ b/sys/compat/linuxkpi/common/include/linux/string.h @@ -31,6 +31,7 @@ #include +#include #include #include #include @@ -245,7 +246,7 @@ strreplace(char *str, char old, char new) } static inline ssize_t -strscpy(char* dst, const char* src, size_t len) +sized_strscpy(char* dst, const char* src, size_t len) { size_t i; @@ -260,8 +261,13 @@ strscpy(char* dst, const char* src, size_t len) return (-E2BIG); } +#define __strscpy0(dst, src, ...) sized_strscpy(dst, src, sizeof(dst)) +#define __strscpy1(dst, src, len) sized_strscpy(dst, src, len) +#define strscpy(dst, src, ...) \ + CONCATENATE(__strscpy, COUNT_ARGS(__VA_ARGS__))(dst, src, __VA_ARGS__) + static inline ssize_t -strscpy_pad(char* dst, const char* src, size_t len) +sized_strscpy_pad(char* dst, const char* src, size_t len) { bzero(dst, len); @@ -269,6 +275,11 @@ strscpy_pad(char* dst, const char* src, size_t len) return (strscpy(dst, src, len)); } +#define __strscpy_pad0(dst, src, ...) sized_strscpy_pad(dst, src, sizeof(dst)) +#define __strscpy_pad1(dst, src, len) sized_strscpy_pad(dst, src, len) +#define strscpy_pad(dst, src, ...) \ + CONCATENATE(__strscpy_pad, COUNT_ARGS(__VA_ARGS__))(dst, src, __VA_ARGS__) + static inline char * strnchr(const char *cp, size_t n, int ch) { From nobody Sat Jun 20 12:06:11 2026 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 4gjCqZ5TCBz6jR1Z for ; Sat, 20 Jun 2026 12:06:34 +0000 (UTC) (envelope-from kfv@kfv.io) Received: from outbound.ci.icloud.com (ci-2007i-snip4-5.eps.apple.com [57.103.88.88]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjCqZ3PK7z3gxm for ; Sat, 20 Jun 2026 12:06:29 +0000 (UTC) (envelope-from kfv@kfv.io) Authentication-Results: mx1.freebsd.org; none Received: from outbound.ci.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-central-1k-60-percent-4 (Postfix) with ESMTPS id B64D118000A3; Sat, 20 Jun 2026 12:06:26 +0000 (UTC) X-ICL-Out-Info: HUtFAUMHWwJACUgATUQeDx5WFlZNRAJCTQBLHVwGUxxBDEwdXABdEhVdRVgLQStZFk9WWgIXDVZNUh5FQ14EEgJaRQVNXw5eHwQXRhlVBEceXVZQBBkCURxWDVdDVARfUEkMQVBsWgBHF0gdXRlZb1BdHA4GUR0cGVZYXgRTVg5JeEoCWw5ZdF0JOgZeGl8BQApVC1h2Ux9FDk8LWXUtczYBPHYtXA1EXlAXDU1DEkIVBBtGHkMEXy9dF14MXgU= Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kfv.io; s=sig1; t=1781957188; x=1784549188; bh=z1KRE0J9If93G5zisVPsGBMBdXbP1NhwyG0y7XmymgI=; h=Content-Type:Mime-Version:Subject:From:Date:Message-Id:To:x-icloud-hme; b=bqkzIPJUpDJvbgbxrSpIwkEsZjeCzsr3StvbGsLpvrSPfhJuZE+cWUpdwAouux1ICHDJ3PlR6nqdigfvuYj5u1j9wYZMQmjCuOHwPSkCY4JBLxdzKrBBIv9O8SOibBlRSrf4e+qpbS9lYTsPHLfUXNm1o4xvaQR0EJ34WGQL7auqDWIs9l6UdrH9ec1RmahSqQicFVUT3RDPCCyVEtESLG87+LcjY0QD4ayx/r5q+OefZ4j2566eysGaJgJpfLkwYiGH4k1xn3uUZfhJCCCrSSONNm0OnRR00B4jtgjm6Exn0SgsgJlD87eQlxyK9xr3GEOyad1ClLTQBOOKTRVAeg== mail-alias-created-date: 1649693719123 Received: from smtpclient.apple (unknown [17.57.156.36]) by p00-icloudmta-asmtp-us-central-1k-60-percent-4 (Postfix) with ESMTPSA id 59E03180020B; Sat, 20 Jun 2026 12:06:24 +0000 (UTC) Content-Type: multipart/signed; boundary="Apple-Mail=_8E74979E-CFE2-486B-AA7F-2094DD1CEB6C"; protocol="application/pgp-signature"; micalg=pgp-sha256 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.100.1.1.5\)) Subject: Re: git: 9d87c1aac4a8 - main - libc: Add missing kill_dependency macro From: Faraz Vahedi In-Reply-To: Date: Sat, 20 Jun 2026 15:36:11 +0330 Cc: Warner Losh , alc@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-Id: <9A21692F-0B53-4303-85A8-57784BFAF8DE@kfv.io> References: <6a35ddd4.24ba1.2ad9343d@gitrepo.freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.3864.100.1.1.5) X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjIwMDEyMCBTYWx0ZWRfX6ubbPqgmULR9 Y2Nv7LiIR4Hz6c1zeqdQxXKNOz9muhN6z0gsxfqkJIrj2PMe9+LPdALPa6OlSBPswaQG+Vz3v1J 7GuXnfs/e0a76wPmb1Gjb1kgPn/0XqLfwsjC6yvpmSJgi1xmkO3YT/qviK3N7+SyrSxmfAcICi4 IHyAXFzf/oCgX7VpTAxgQG7oRcjbYvLPuQYRhcBrtD2MKsAm81UFBud22KC0RXaf/leo/2IBMnb NrQuyernlYX0VWyYM+1/sMxv6V/c+ro5i3jKr+zIp0OEllcGl/fL9qoHhRlXfE0Dm0KqTqgLBUC DYQftRip5vnQ6cAtmu9 X-Proofpoint-ORIG-GUID: 4gbUBpikMxdQO6SYNli9jFeUoJylRaBh X-Proofpoint-GUID: 4gbUBpikMxdQO6SYNli9jFeUoJylRaBh X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:714, ipnet:57.103.88.0/22, country:US] X-Rspamd-Queue-Id: 4gjCqZ3PK7z3gxm X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated --Apple-Mail=_8E74979E-CFE2-486B-AA7F-2094DD1CEB6C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hey, Thanks for the report. > GCC at least with the version 16 uses a different definition for the > kill_dependency(), which might have some side effects for the gcc > optimizers: >=20 > #define kill_dependency(Y) \ > __extension__ \ > ({ \ > __auto_type __kill_dependency_tmp =3D (Y); \ > __kill_dependency_tmp; \ > }) >=20 > Since the semantic for kill_dependency() is believed to be not well > defined, I think we should provide gcc-compliant definition at least > for gcc. I=E2=80=99ll check and take care of it shortly. Will keep you posted. Cheers, Faraz=20= --Apple-Mail=_8E74979E-CFE2-486B-AA7F-2094DD1CEB6C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEnunneCmADnpNx8ZMLdpU9MVz/74FAmo2gjMACgkQLdpU9MVz /75zQQ/+NRYSx3gK16jJV72Lcr4ajCFu7gx2e3h2111f0UKesM2Wid1ZHtmWgxra Ms/cdVIZ2WED6AaHuG3VLMpRalXrPq55EX2xw01KTaz7uXz9q7sipHMl/+7CcIk4 mcikWwO22OctqXjPGJSBWls7dkTLdfEXQikDZW1sLOMu3w4kU5f95bjr0OgOjQZS sh4Va59a7bE3+bZC3l45mzK7CcsDsFl42FeZwx+iwmLfvt5r2e/yPPa6Uy8k54Tn /iCw9jELGvec80ti0Gqo5Vw9amVd7libsKmI5Bl5CEEez5oQTF46hriBW1iBVyHg dwvTVwnS5R7Gf97LVBUyYPsDhSXb7y57vsP4cadVRTrvwEHOk+bHPusPYVBQN+d+ T5aa8ZRBogTvmacD8X4dORm4063M/TE3lmJKQYu9NkCVV4Rm+xsZqH6El/B1Tomt Geq4nQo1OZEPxr5SEBGb53ZRVuwtNToIkECxo8cSInRpe+6g84qY2PzeWKE/9NsV awI6AMPO+W7suYpTspoV95w7HEZ2fDtziG2HKZQqSytthpYPqG0vGLbkHhAkOUoZ ESKeKOWut1qJ/OnSBUMDlnj+SRopjEvnjQ2rCZPWeKENkxzp144tLJwd1NkQf1FI hQFvR8tz1JgW5nGpXC2ozXkztrBT+tZ/70B9Hzcvc1v5HnidLx0= =DV+X -----END PGP SIGNATURE----- --Apple-Mail=_8E74979E-CFE2-486B-AA7F-2094DD1CEB6C-- From nobody Sat Jun 20 13:58:04 2026 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 4gjGJF1kLvz6jbyJ for ; Sat, 20 Jun 2026 13:58: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjGJF0w9bz3vBv for ; Sat, 20 Jun 2026 13:58:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781963885; 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=5VTpTblwTzRAu5DjzKkhC3ihhecoOl3hV52uo363YEM=; b=Y49haU16FmewVjtVO4KpTCPX8uPvcQMvf4+2kfWE9H+MODuPOzpTIeiEmoMUgOAaiYdX85 2qF4v91AYXqqEVzi/nCiFy+LchOJOPgyLR00twLyFp7yCXncuBaW0IHuhe7o3NwQS4wy4k v+NNgh7hyjCdww1PhRANIqM7G3lo4+x/jD0lsCGY2UCDWwhpxhMDM86txPQepI6tG+iCUW slPZeHWt0h+OKgUO9lNI22gk/Z6BvBmEGSWVGJSYnRRwmyEq8R/NTBq22QAq7VWcoc+/R6 8gEianvnTfICKms/fgpzQwwOciZJb8av67qnSnrp7EKWAkH9buUricH5J6+EDg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781963885; a=rsa-sha256; cv=none; b=DXkIzl9tuvmaza8dTPi9EvT1TH3GWH5E+i39IW0ytFsxWuJundyKGAp9IYDYxI3/lJLIOc DtfK4r7z2WMwOVRx0RmXhfNRTquuObBk26jWX8Hwr0rqEIceVgtgaNYYUvDvE3X8up95P1 zjNuFrMBTU/cq/MAHxCf4SOKECMW7NhsISDJzdtqIksPJP7sp7mFWQGDvQUVYPvdHgr3La xo09payB0RsvNFa0/U7C8i0P/Dc/5wfCVGmgunipjTl5Vt3yvj4Q/ZcCpYLVlHvpgMUF8P zbZDalJUTCQOy2KJkczlYC6M6fHN8migfOxRMi06yLcaKEKY/ARp89GnFj3OcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781963885; 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=5VTpTblwTzRAu5DjzKkhC3ihhecoOl3hV52uo363YEM=; b=SmJEcTc2LSOt4M87sh5TWxStuMb8x8NxtNE31SUERLmWXWa40gc3kRJ4QaeY4W4zJlt0xF d0WXUaOjKF4k/L5WRGjhNSTIHH+eEMuiCJ32mqKxip3kYHH4KLUl5R9ssJVLw6JVjG6j0p wswEmTzVGlmbVgNLxfcaV5w4KySMvO8RfYXzItLaKo79yJDvRNhv0PwIa2P2PP6kV1T7lU WFypXE8w/rNiv0TL8BO0OWSRqhKQspgHKoQmOApUQVh23T69TXbOZIOnqggPct/L6iTzSa oU7xIhCkXkko40P/2RpFP8hEU+FaDg/nwzF4Egz/3DC8LIRKKovW3x1sP25L4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjGJD5qNdzZMQ for ; Sat, 20 Jun 2026 13:58:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3b1b0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 13:58:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 57fefbee1f95 - main - rights(4): fix our representation of the unused 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 57fefbee1f959d0c65376dbdad309d01c182d710 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 13:58:04 +0000 Message-Id: <6a369c6c.3b1b0.5c51110c@gitrepo.freebsd.org> The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=57fefbee1f959d0c65376dbdad309d01c182d710 commit 57fefbee1f959d0c65376dbdad309d01c182d710 Author: Kyle Evans AuthorDate: 2026-06-20 13:55:26 +0000 Commit: Kyle Evans CommitDate: 2026-06-20 13:56:04 +0000 rights(4): fix our representation of the unused bits The current format seems to be a little confusing, and the version of it for index 0 was broken by the below-referenced commit. Break our UNUSED macros out into one per unused bit to enumerate the entirety of the space and make it easier to claim an unused one. Fixes: b165e9e3ea4e327fc ("Add fchroot(2)") Reviewed by: oshogbo (previous version), kib, markj Differential Revision: https://reviews.freebsd.org/D57505 --- sys/sys/capsicum.h | 64 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 56 insertions(+), 8 deletions(-) diff --git a/sys/sys/capsicum.h b/sys/sys/capsicum.h index 3847c4c73e75..9ef2f0d48d38 100644 --- a/sys/sys/capsicum.h +++ b/sys/sys/capsicum.h @@ -51,6 +51,13 @@ #define CAPRIGHT(idx, bit) ((1ULL << (57 + (idx))) | (bit)) +/* + * The top 7 bits are reserved in all indices. + * Index 0 - 2 bit array size + 5 bit array element + * Index N - 2 bits of 0 + 5 bit array element + */ +#define CAP_RESERVED 0xFE00000000000000ULL + /* * Possible rights on capabilities. * @@ -212,12 +219,23 @@ CAP_GETSOCKOPT | CAP_LISTEN | CAP_PEELOFF | CAP_RECV | CAP_SEND | \ CAP_SETSOCKOPT | CAP_SHUTDOWN) +#define CAP_UNUSED0_45 CAPRIGHT(0, 0x0000100000000000ULL) +#define CAP_UNUSED0_46 CAPRIGHT(0, 0x0000200000000000ULL) +#define CAP_UNUSED0_47 CAPRIGHT(0, 0x0000400000000000ULL) +#define CAP_UNUSED0_48 CAPRIGHT(0, 0x0000800000000000ULL) +#define CAP_UNUSED0_49 CAPRIGHT(0, 0x0001000000000000ULL) +#define CAP_UNUSED0_50 CAPRIGHT(0, 0x0002000000000000ULL) +#define CAP_UNUSED0_51 CAPRIGHT(0, 0x0004000000000000ULL) +#define CAP_UNUSED0_52 CAPRIGHT(0, 0x0008000000000000ULL) +#define CAP_UNUSED0_53 CAPRIGHT(0, 0x0010000000000000ULL) +#define CAP_UNUSED0_54 CAPRIGHT(0, 0x0020000000000000ULL) +#define CAP_UNUSED0_55 CAPRIGHT(0, 0x0040000000000000ULL) +#define CAP_UNUSED0_56 CAPRIGHT(0, 0x0080000000000000ULL) +#define CAP_UNUSED0_57 CAPRIGHT(0, 0x0100000000000000ULL) + /* All used bits for index 0. */ #define CAP_ALL0 CAPRIGHT(0, 0x00000FFFFFFFFFFFULL) -/* Available bits for index 0. */ -#define CAP_UNUSED0_57 CAPRIGHT(0, 0x0100000000000000ULL) - /* INDEX 1 */ /* Mandatory Access Control. */ @@ -283,14 +301,44 @@ #define CAP_INOTIFY_ADD CAPRIGHT(1, 0x0000000000200000ULL) #define CAP_INOTIFY_RM CAPRIGHT(1, 0x0000000000400000ULL) +#define CAP_UNUSED1_24 CAPRIGHT(1, 0x0000000000800000ULL) +#define CAP_UNUSED1_25 CAPRIGHT(1, 0x0000000001000000ULL) +#define CAP_UNUSED1_26 CAPRIGHT(1, 0x0000000002000000ULL) +#define CAP_UNUSED1_27 CAPRIGHT(1, 0x0000000004000000ULL) +#define CAP_UNUSED1_28 CAPRIGHT(1, 0x0000000008000000ULL) +#define CAP_UNUSED1_29 CAPRIGHT(1, 0x0000000010000000ULL) +#define CAP_UNUSED1_30 CAPRIGHT(1, 0x0000000020000000ULL) +#define CAP_UNUSED1_31 CAPRIGHT(1, 0x0000000040000000ULL) +#define CAP_UNUSED1_32 CAPRIGHT(1, 0x0000000080000000ULL) +#define CAP_UNUSED1_33 CAPRIGHT(1, 0x0000000100000000ULL) +#define CAP_UNUSED1_34 CAPRIGHT(1, 0x0000000200000000ULL) +#define CAP_UNUSED1_35 CAPRIGHT(1, 0x0000000400000000ULL) +#define CAP_UNUSED1_36 CAPRIGHT(1, 0x0000000800000000ULL) +#define CAP_UNUSED1_37 CAPRIGHT(1, 0x0000001000000000ULL) +#define CAP_UNUSED1_38 CAPRIGHT(1, 0x0000002000000000ULL) +#define CAP_UNUSED1_39 CAPRIGHT(1, 0x0000004000000000ULL) +#define CAP_UNUSED1_40 CAPRIGHT(1, 0x0000008000000000ULL) +#define CAP_UNUSED1_41 CAPRIGHT(1, 0x0000010000000000ULL) +#define CAP_UNUSED1_42 CAPRIGHT(1, 0x0000020000000000ULL) +#define CAP_UNUSED1_43 CAPRIGHT(1, 0x0000040000000000ULL) +#define CAP_UNUSED1_44 CAPRIGHT(1, 0x0000080000000000ULL) +#define CAP_UNUSED1_45 CAPRIGHT(1, 0x0000100000000000ULL) +#define CAP_UNUSED1_46 CAPRIGHT(1, 0x0000200000000000ULL) +#define CAP_UNUSED1_47 CAPRIGHT(1, 0x0000400000000000ULL) +#define CAP_UNUSED1_48 CAPRIGHT(1, 0x0000800000000000ULL) +#define CAP_UNUSED1_49 CAPRIGHT(1, 0x0001000000000000ULL) +#define CAP_UNUSED1_50 CAPRIGHT(1, 0x0002000000000000ULL) +#define CAP_UNUSED1_51 CAPRIGHT(1, 0x0004000000000000ULL) +#define CAP_UNUSED1_52 CAPRIGHT(1, 0x0008000000000000ULL) +#define CAP_UNUSED1_53 CAPRIGHT(1, 0x0010000000000000ULL) +#define CAP_UNUSED1_54 CAPRIGHT(1, 0x0020000000000000ULL) +#define CAP_UNUSED1_55 CAPRIGHT(1, 0x0040000000000000ULL) +#define CAP_UNUSED1_56 CAPRIGHT(1, 0x0080000000000000ULL) +#define CAP_UNUSED1_57 CAPRIGHT(1, 0x0100000000000000ULL) + /* All used bits for index 1. */ #define CAP_ALL1 CAPRIGHT(1, 0x00000000007FFFFFULL) -/* Available bits for index 1. */ -#define CAP_UNUSED1_22 CAPRIGHT(1, 0x0000000000800000ULL) -/* ... */ -#define CAP_UNUSED1_57 CAPRIGHT(1, 0x0100000000000000ULL) - /* Backward compatibility. */ #define CAP_POLL_EVENT CAP_EVENT From nobody Sat Jun 20 13:58:05 2026 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 4gjGJG1hF8z6jbyK for ; Sat, 20 Jun 2026 13:58: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjGJF6npTz3v9C for ; Sat, 20 Jun 2026 13:58:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781963886; 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=uQ4sH/IkqCEmEMwBb7I9sDMX1qHyBa3QKjc1kyPziF8=; b=yKDb0tqp5UfVhWqbxUuqPKt/9wT4zg3UNT0eMPXjZ6ZjPmNmY0EMwAqbrK+CdRA21hwV4R 2dHVkkGNkMVcgU9+r1sBvSLbcvkWuKN2sKy9N/0uraoCGJbkbVEaS0fHDlIvAAtICDV6Ba +948kPMu6OPkZowtp2Jf0VlF/yYpEUl8L0oDyzIT4shzA7cFwAFqAP+Kvua/Ygyfy4UT7N pT7bLl11OTXAlIIbeEiMgfBaTV2LoEt6/L5P4f06r8+w0CEuDR2e4ZNVtxy9jMIeU3aq8+ GexWnoWWfAyzBvPwmUR9WlNskC1c2eV23NO1337cQWeT0ArVPisDqYGWVCpsgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781963885; a=rsa-sha256; cv=none; b=vS1NsFoBEBh6mQZ03+j+k0y6WcHaYV1LBkCW+FKqPDSbFiwukU1uvhfsaVkqrW8UwGrpgY cEwmJJKgCBU9dzMiG2ynKfZmgTz9W2ikKhH8H6sh+H26PtPJye5mMN6AH6AioZN3SQq58w YozmvoZhJHmzaYicMzznemJmEoNMXVrp1VRAM57oFex4mcc+vqYK5ANq9nsYlZv2+3Vpg2 EGFCrFFPUOgS1p7KplGTZmwnyiSq7+1YMb7125xd0v7CP3aa8aHPa4rhjX3vPZguQK5nXr UBhyEbEcJ6Z3v3RNHaANGIvmDmA7jUkxDjEzcpWsv/avvajF7onNXPWe2MrlbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781963885; 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=uQ4sH/IkqCEmEMwBb7I9sDMX1qHyBa3QKjc1kyPziF8=; b=Q1DYfUO2ewVvdWqmFUWXTigjQHrl5BrQl1o49W43JXSfDLBXa6DtR+IVIOvoocSGsRaGRR MR2lMaNq1rF1cEAhn+NIeFOvAix4zKVZxXw7bypu3q+yvTKyZBEGn8Mou9JSTuAKdPTOHe b0OP2dA7sjB1yR3RHZ6jBkipmHGE9VpbMqlvB1jLsw/juZDbIWSY7AaPRLHxvC4YUBCl4N v8gH1BiFAzL6aZmOqEDPibVeSB53vpsicFfGCDDUZ3Okj17WPhNj76JPg1UI8v3e7O4BWV AbuidnALzT40ZIs29HoV88Gqyb6W8FFBlkOwwzo4O3SCAISl47T/6uJtXEtcjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjGJF52QrzYxP for ; Sat, 20 Jun 2026 13:58:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3b5f2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 13:58:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 8ed580b1d381 - main - adjtime(2): document that delta can be NULL 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 8ed580b1d3811e73e25db3d8a9fd235156c65387 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 13:58:05 +0000 Message-Id: <6a369c6d.3b5f2.5d2168ef@gitrepo.freebsd.org> The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8ed580b1d3811e73e25db3d8a9fd235156c65387 commit 8ed580b1d3811e73e25db3d8a9fd235156c65387 Author: Kyle Evans AuthorDate: 2026-06-20 13:55:26 +0000 Commit: Kyle Evans CommitDate: 2026-06-20 13:57:45 +0000 adjtime(2): document that delta can be NULL The current verbiage somewhat indicates that always adjusts the time, which hasn't been true as far back as I had the energy to `git blame`. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D57676 --- lib/libsys/adjtime.2 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/libsys/adjtime.2 b/lib/libsys/adjtime.2 index ee8befe09ca9..ad2467d5ef61 100644 --- a/lib/libsys/adjtime.2 +++ b/lib/libsys/adjtime.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 13, 2021 +.Dd June 19, 2026 .Dt ADJTIME 2 .Os .Sh NAME @@ -46,6 +46,7 @@ makes small adjustments to the system time, as returned by advancing or retarding it by the time specified by the timeval .Fa delta . +.Pp If .Fa delta is negative, the clock is @@ -55,6 +56,13 @@ If .Fa delta is positive, a larger increment than normal is used. +.Fa delta +may also be a +.Dv NULL +pointer to fetch +.Fa olddelta +without making any adjustment. +.Pp The skew used to perform the correction is generally a fraction of one percent. Thus, the time is always a monotonically increasing function. @@ -65,7 +73,9 @@ may not be finished when is called again. If .Fa olddelta -is not a null pointer, +is not a +.Dv NULL +pointer, the structure pointed to will contain, upon return, the number of microseconds still to be corrected from the earlier call. From nobody Sat Jun 20 13:59:52 2026 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 4gjGLl5CjYz6jc28 for ; Sat, 20 Jun 2026 14:00:15 +0000 (UTC) (envelope-from kfv@kfv.io) Received: from outbound.mr.icloud.com (mr-2002a-snip4-11.eps.apple.com [57.103.68.193]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjGLk6t1fz3vlG for ; Sat, 20 Jun 2026 14:00:14 +0000 (UTC) (envelope-from kfv@kfv.io) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=kfv.io header.s=sig1 header.b=dlNe69eA; dmarc=pass (policy=none) header.from=kfv.io; spf=pass (mx1.freebsd.org: domain of kfv@kfv.io designates 57.103.68.193 as permitted sender) smtp.mailfrom=kfv@kfv.io Received: from outbound.mr.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-2a-100-percent-1 (Postfix) with ESMTPS id F037D1800195; Sat, 20 Jun 2026 14:00:08 +0000 (UTC) X-ICL-Out-Info: HUtFAUMHWwJACUgATUQeDx5WFlZNRAJCTQFNHVQHRQBADlYBWQFLVxQEE1UbdwBUBhcRXE1RDw8bXw4dBFhLQBMEThMFUgddTVYNRw9YHlwUFxVBQ14IXh9MHB0OWAYSAE0KDjYGWQVeCVYDQwU2EhRdRVgLQUVbHxkVWgkKVwFDfEBxK3RfHzV4TAVAA1pzRxQ6BllxRgMxeDx3XnRaCzQAPXMGUR0cGVZGExlOG1dNWg1AGVgGbRRWFVIEWQ== Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kfv.io; s=sig1; t=1781964013; x=1784556013; bh=pMjOydHDos4iX2dLKIloWqomLEy800pqznKdmVovEYQ=; h=Content-Type:Mime-Version:Subject:From:Date:Message-Id:To:x-icloud-hme; b=dlNe69eA0sWNiwGJpnbpSoXwAyLMhWtoIBHRjAI7Td4nm5O01ew5xW8pmUALUUGL9l07hyPkX9tVtEY9ziaU+Wat8DTgTkXxYsosKW/DJnz66jvWwcR1v07ZzJVR/M2o0mRfG6DUkpDhXh5F6N21DdCo5UH0BpfbWW8zG7Er9TCN089Mr5jBGga67SPZ45dYmNnOEYJOMLIzXLYRRF9VpqtXQqp3LRlZbm0VSI9ukuMNA6OF8hPxI4lpcFDbGBaAgME0y+PfGQ+khQtXhC0N2CBuH3YVymeXNw6egArtsu6XP+J7NSkYR3blUVpBkrA9erK8GFzKJGIQrZ6p0tOl+Q== mail-alias-created-date: 1649693719123 Received: from smtpclient.apple (unknown [17.57.152.38]) by p00-icloudmta-asmtp-us-west-2a-100-percent-1 (Postfix) with ESMTPSA id 3359D180010E; Sat, 20 Jun 2026 14:00:05 +0000 (UTC) Content-Type: multipart/signed; boundary="Apple-Mail=_F61365DD-5FB9-4E26-B25C-5F98D5D57DC8"; protocol="application/pgp-signature"; micalg=pgp-sha256 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.100.1.1.5\)) Subject: Re: git: 9d87c1aac4a8 - main - libc: Add missing kill_dependency macro From: Faraz Vahedi In-Reply-To: <9A21692F-0B53-4303-85A8-57784BFAF8DE@kfv.io> Date: Sat, 20 Jun 2026 17:29:52 +0330 Cc: Warner Losh , alc@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-Id: <33E8BFC4-EA46-41A7-B54F-1AADD3C19D9E@kfv.io> References: <6a35ddd4.24ba1.2ad9343d@gitrepo.freebsd.org> <9A21692F-0B53-4303-85A8-57784BFAF8DE@kfv.io> To: Konstantin Belousov X-Mailer: Apple Mail (2.3864.100.1.1.5) X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjIwMDE0MCBTYWx0ZWRfXyAn0uwX+Ouo4 NGnU4iTjeH0CjeyAbsdabFWr0WAJWbmTidBlFnQ/VT3Q+axs23QkmAblReuXO4/LiQDhvGeh3OO y9wGGsfg1MnK4JVL2jBdtt3kwHYTqRttw4nCfpLDqfKsMzE8y2n8fFMz3YtS+4qmt2LIJZNe1SY GgWxtUdRL4lSSUMQpMROAIfvMuFJIuGvdTBn72qjCm7XDX3wdcMEkJATzodHrLFw8cWc+N9pdH0 rIg2ywQlG/a0+sH1utmNSfwNnc8be2cOWV41D+zdr8LGi/qPdsiTW1e9wPZIctbkcYtLon5dM+G Fwh3P9MVA4LoKgCv1Iv X-Proofpoint-ORIG-GUID: wMO7P5zzsGwvCwEfeUwiH33PEo40rQna X-Proofpoint-GUID: wMO7P5zzsGwvCwEfeUwiH33PEo40rQna X-Spamd-Result: default: False [-5.80 / 15.00]; SIGNED_PGP(-2.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; DMARC_POLICY_ALLOW(-0.50)[kfv.io,none]; MV_CASE(0.50)[]; R_DKIM_ALLOW(-0.20)[kfv.io:s=sig1]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; R_SPF_ALLOW(-0.20)[+ip4:57.103.64.0/18:c]; RWL_MAILSPIKE_GOOD(-0.10)[57.103.68.193:from]; RCVD_IN_DNSWL_LOW(-0.10)[57.103.68.193:from]; DKIM_TRACE(0.00)[kfv.io:+]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ARC_NA(0.00)[]; HAS_ATTACHMENT(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:714, ipnet:57.103.68.0/22, country:US]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RCPT_COUNT_FIVE(0.00)[6] X-Spamd-Bar: ----- X-Rspamd-Queue-Id: 4gjGLk6t1fz3vlG --Apple-Mail=_F61365DD-5FB9-4E26-B25C-5F98D5D57DC8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hey, I took another look and dug a bit deeper to make sure whether we should adopt GCC=E2=80=99s form here, and I still think we should stick = with the current one. First, although I still need to investigate further, I doubt it adds any optimisation benefits, nor would omitting it incur a penalty. More importantly, what we currently have fully conforms to the =C2=A77.17.3.1 and is therefore in its most portable form. There is also ongoing work (e.g. N3607) to retire `memory_order_consume` and obsolete `kill_dependency`, with the proposed wording being that the macro =E2=80=9Chas no other effect than its result=E2=80=9D, which = is essentially just `(y)`, right? So presumably Clang's own `` uses `(y)` for the same sort of reasons. However, I=E2=80=99m happy to discuss it further, and please do correct = me if you have data suggesting otherwise. In the meantime, I=E2=80=99ll do = a bit more research and will keep you posted if I find anything else. Cheers, Faraz --Apple-Mail=_F61365DD-5FB9-4E26-B25C-5F98D5D57DC8 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEnunneCmADnpNx8ZMLdpU9MVz/74FAmo2nNgACgkQLdpU9MVz /76VpRAA08gJfK7ivNX981HwH3NNngrPCWxGvZ9ZwoAXX7Lp7h7PfB3CwF7WlwD6 1zxbPbrpf2ffY8yBrKzLLZUuak7m8yg7CfJZz4On8xzPpslkNNEm+ZG5cqyx3y+r VYTl0/EWwGdMLZ8OMctlxuVvQ1+WtcEQ/TEy7UR1/ul+rQED2pKZltG6sUJFv41U hB2ZyMOabTSkHUOXYntXwL7DgRyvpaox8gbppqCxbjksMk91lGnfoMX6qdIWN1wm seqzXbMFwHSR9QWuvfigi1yrzXY1oyfCg1txE/iJ1iezPYVNvFUzLxc8AcnY/utK 0jLPqqTGnh4u9Tn8bHQ1bJJTpyC/uUTED7fR4GIpuqsBG5H1st9CtZvnaAH+qmp5 wosbxmVYvveO0PEqrmhho9d4jdZ3sNdQPTsu9iCOdPd1JBk9Pi+BZnLwWOdwkyD8 0vP1cLYNsn2ZL87pujbc99HUwVZ004wdAJpOzjLcfxF26v9Fgj10mF61AN0QLHcw DtrxI+0v4MUk7rqY7fZrt43GNtk3gbW+DgIwahtMIqU+d/lVAJKfTuyaVHrORvJ1 czmVY1MJlpYvrkzEbY/P5sjg4/w2DlkCcZVlo+EhkYTK4vBOk5oFs2IUVbXlcliU 7Z1Wa33KdDZQ7Zl6pqARykaMhwCnT6SKzghLi31IQU/Px1w3+wE= =dPrj -----END PGP SIGNATURE----- --Apple-Mail=_F61365DD-5FB9-4E26-B25C-5F98D5D57DC8-- From nobody Sat Jun 20 14:13:09 2026 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 4gjGdd2yBSz6jd47 for ; Sat, 20 Jun 2026 14:13: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjGdd217pz3yKV for ; Sat, 20 Jun 2026 14:13:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781964789; 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=HoZD2+oAjIr6LQM6BhOSEusVmghp91lkghSXF7mfsSU=; b=hvJTFBJrxN1cq3DkbHLD0rmR1uCQuqnz+pROqXqg6w2VkDjcEjn5agaNIEMryZsXblJqJL lYSTVNBJT7FL8IH4oZynftwpLB36tPtDpB/I7Z8DfwIUHnyTYjQc7UH3bscGMbPSjwmq93 Et8bTIpSCjPovaKvzP6GDAKgpKW2rOjRwR8vK1jpfOr5ttYAuMYk+t1c9QnR6mCMDU+3+0 sGX2CBmIaN2303tLehhScaFeFnyr8lYo5HxyRduUedLRQWdl6durQrDyb4nUggC8DGq1sh nc1/fQHWV6wp3r5hudn2F4e24B4M6ztjsx74LdLs0QKqI5PnJ1uTvZsg7T7+Hw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781964789; a=rsa-sha256; cv=none; b=EawcVDpmBllrusljnHnHn4Zj8UCNBln4nwboB8ndT2se1MUoDfTh6ThzwSmgmNGbKBOujM S//aKiyYQitb3v9z8L2HsYtLrPhy5c7X1s/totH+EPv6I7uY2QnmA6xKL9/IuPX4P9E3nA gbWlCYJpe22RqlvLjuhgRfVudyWJuRdW3bUPwr9CNWl1avXjjb8SNg6ukcJ20I/SJWpGXX YL5SZ1Z2Lgj+YqE7vONe8cAYAe++xSIXgRLvqJX5YnsqROVji8XPz/FPPF2SmYlWM5v2gu PXm7HrAMhas1epo9gnMYQ2yvVTBWi+/NJFV5G0kcNiN1dFvjdcrbFadbmq7qtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781964789; 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=HoZD2+oAjIr6LQM6BhOSEusVmghp91lkghSXF7mfsSU=; b=IXOeVr7pfrO24I09mhiIaJbtqlOIY2wQquMDD84lyIQp7zb3Abhwwh60a+rOUdEPAfg33e bOc55fcdxlAXoP+2N8lZoKbLHqpiGkiFyXG6m75jJy+LvRDn0zDxjPYOsdOoLo6uUdxvRs 4P159Pj8SIPhO6/tQxsoctX0DWphq8AVRrHVSFhNnsGQ602uRd8/gsQfokIykb/7+SCfun +AqsaRMGHbpzzoImVaczuRK+TVdqVS13dgibDkNXz7WzXp+gA+HruK+hwmhZUq5Q4P+gj8 vXtoCFpFU/uFPt7dCxgu3mZ4jNnhF0qYhBH4m8OJm360F4RGXOOHOv+UTOD09Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjGdd0hLZzZt3 for ; Sat, 20 Jun 2026 14:13:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3c35b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 14:13:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: f7b71f832c99 - main - if_ovpn: Fix a lock leak in an error path 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: f7b71f832c990da0bf203095f02405df665529d0 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 14:13:09 +0000 Message-Id: <6a369ff5.3c35b.97f2cab@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f7b71f832c990da0bf203095f02405df665529d0 commit f7b71f832c990da0bf203095f02405df665529d0 Author: Mark Johnston AuthorDate: 2026-06-20 14:12:19 +0000 Commit: Mark Johnston CommitDate: 2026-06-20 14:12:19 +0000 if_ovpn: Fix a lock leak in an error path Reviewed by: kp MFC after: 1 week Fixes: 04a7134c1e92 ("if_ovpn: fix use-after-free of mbuf") Differential Revision: https://reviews.freebsd.org/D57696 --- sys/net/if_ovpn.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index 7c416055e939..b4796fb95589 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -2517,6 +2517,7 @@ ovpn_udp_input(struct mbuf *m, int off, struct inpcb *inp, m = m_unshare(m, M_NOWAIT); if (m == NULL) { + OVPN_RUNLOCK(sc); OVPN_COUNTER_ADD(sc, nomem_data_pkts_in, 1); if_inc_counter(sc->ifp, IFCOUNTER_IERRORS, 1); return (true); From nobody Sat Jun 20 14:17:22 2026 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 4gjGkV2HzNz6jdV1 for ; Sat, 20 Jun 2026 14:17:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjGkV1fQcz40gg for ; Sat, 20 Jun 2026 14:17:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781965042; 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=PPUWGtzzF4cyM90aYWAo5p9St/vuwtmrKlRvwbf+Mnk=; b=J6MRIcTF8WIPuTDU/AGGXh6eu/g7Af53GT96LrK320QvrbPd/6qEYMYM/XyWpQ+aWdVa2T jYW1Y+SpNXZn5EDqN0PGkY+fIfSrxaeAha2Fw/BANsShWQclFlgCOo3zM0xWZAGsybfTIu QU7SUrN1sQri6V7vndFbEguo+pyDdfuUFDTLfPIGwHaFPnbAGEpv+jqIVKTcVsihWidn4m YZX70kzVyxc9v4lyB+Hs4F8sFwda3PjRQ5gwgLa5k9N1UB6xKGCYLi21BkzeKGogqMekp/ MYyGEUPiTruDJrSkhB2JsWD2jMeY5gE+n+mhksTO3+zGz+SNHCecuJ+NQET2hA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781965042; a=rsa-sha256; cv=none; b=uQjVKkmiiABN64B0zrsK+2GjRvoBfvSLXqSF0quRXqFL6u3FcCOUtPeG8y1VyMgad+55xE 70u5Ld0SDlyjatajW9jdbVUMlHzEY89qDqyfF3gYaG3UwAMOaOObIFDq5BDs36e47XNLWa HB4I/0Q1DsUmJNJYT724M5NN/3nuxax3XCacBaL3hvxyvJVTjuJ45oedUHwk43GIDiq0MW sv/okeRzu9l8KJ48WxIQiUwIq2RZDvoaX5e1fJf7jCTfmiJtVVnffSix196HBC66ASoswT rbAmmBbqFoA2NwZNiCqwRRVxn54KaCWipfbpH2iVg29rDejIGUGie2OcdmHSWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781965042; 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=PPUWGtzzF4cyM90aYWAo5p9St/vuwtmrKlRvwbf+Mnk=; b=Swdbm1QolxKg6+g5rYvJQNPeTfYtS0FhN4dOMa4jiLSJOsNW4nOmjfhi8jHcicDBVl1C01 YDcx2ftOQBEcdNk2vFRio65FtQjRcnGDNpTAsak4XpjWiX6xIYwiE3QoDFp7P6zODytxU+ ruRDBcymamowfrQ9n6DT4YVuWiZi5kuWfsJnLoZ6juqbzCKK9esHLg6Pyf7eooRtHVTUWW DAg0eQb9vFT19tvq7Es9gxqUTaswLeghqZjYA80GSSKtoEJ6OraeFJvplgWKHSMxbyKIZT uG/2rhvyu6661LrGAKOyWoGSYG3DZXb5/pF+KzfaJyczy68EjsEbjRRog0bKOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjGkV0TjdzZcP for ; Sat, 20 Jun 2026 14:17:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3bfca by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 14:17:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 43fb5b33b00f - main - efirt(9): in verbose mode, announce the attachment and fw spec version 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 43fb5b33b00f3b66ec03ab3e0ea002afd16cb7b3 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 14:17:22 +0000 Message-Id: <6a36a0f2.3bfca.5f3f5527@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=43fb5b33b00f3b66ec03ab3e0ea002afd16cb7b3 commit 43fb5b33b00f3b66ec03ab3e0ea002afd16cb7b3 Author: Konstantin Belousov AuthorDate: 2026-06-20 13:52:09 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-20 14:17:07 +0000 efirt(9): in verbose mode, announce the attachment and fw spec version Reviewed by: emaste, imp Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57710 --- sys/dev/efidev/efirt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/dev/efidev/efirt.c b/sys/dev/efidev/efirt.c index c3ac120c6611..2e9a917de1f0 100644 --- a/sys/dev/efidev/efirt.c +++ b/sys/dev/efidev/efirt.c @@ -234,6 +234,8 @@ efi_init(void) return (ENXIO); } + rtdm = efi_phys_to_kva((uintptr_t)efi_runtime); + #if defined(__aarch64__) || defined(__amd64__) /* * Some UEFI implementations have multiple implementations of the @@ -243,7 +245,6 @@ efi_init(void) * with an old loader.efi, check if the RS->GetTime function is within * the EFI map, and fail to attach if not. */ - rtdm = efi_phys_to_kva((uintptr_t)efi_runtime); if (rtdm == NULL || !efi_is_in_map(map, ndesc, efihdr->descriptor_size, (vm_offset_t)rtdm->rt_gettime)) { if (bootverbose) @@ -255,6 +256,12 @@ efi_init(void) } #endif + if (bootverbose) { + printf("EFI runtime driver, fw spec %d.%d.%d\n", + rtdm->rt_hdr.th_rev >> 16, + (rtdm->rt_hdr.th_rev >> 4) & 0xf, + rtdm->rt_hdr.th_rev & 0xf); + } /* * We use SHUTDOWN_PRI_LAST - 1 to trigger after IPMI, but before ACPI. */ From nobody Sat Jun 20 14:20:29 2026 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 4gjGp72syLz6jdNF; Sat, 20 Jun 2026 14:20:31 +0000 (UTC) (envelope-from markj@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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjGp71xtWz41gg; Sat, 20 Jun 2026 14:20:31 +0000 (UTC) (envelope-from markj@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781965231; 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=VInDpPrwNA6shVDRDlzEBeNQBHKDtTTL3fHj3fbLCLI=; b=Z+P7joPGzLECzmWl86Zz786jUwEZMFcWr3jJdXLgwqJeTPMnjiw9M55mMrpS/tgwBw+O+I tegumYD5wgozRyspL4Oj+S6C1OGL2dTd5H6T7U8kZw3tjZZg7Lb01qVkiWcuxoGbWk61lX I1zflgLKCOL6BAQy186a9F0oU+sPCxw5StdOvXosprBGUfEoAr4n4cs4TP+1wxKYKb6zpk k3WISnWUp9q3aNIukX9pRL+SbXYV+f/M2nUeAeX2eXXOZiEETbimZAIky1RywwkAauXCh8 8OFJ0L4ddFKJ5yrKYroRnLSiq9dBE9NWAWiFaSz84MiY+bkTN3+tnqdjMc+JrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781965231; a=rsa-sha256; cv=none; b=Okbt5TzKDcal4McvgyLXubutF8vRqGGpvFARwo12SL/duPEM3lSrQR9228QrWawdTnLtBC L4UXCPKTOskToNon2VqATpzGezdWU/eBVISvRNajwVR2EfHnDf681JNCSktpMaOaq1XxDL K/QJA3Vp2TplBr6MC8rjWDYIopFiKkxcUh2dYh46w+rItngJvgFVywoycGbdeaz/h57g42 IZW5jTPwsFpRGCVhjbRYg+/E3nAqKFRpf0GGTz2AXMeh2VmZ+5gVlOsp1ZGPZVxl/mSoP5 r1iDrTu5uduWzLVYNEdTh2ogSKdx/46WMBJnHy5zE09/i+o0+WkWik1UIGB5hw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781965231; 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=VInDpPrwNA6shVDRDlzEBeNQBHKDtTTL3fHj3fbLCLI=; b=o5E1UCYhlUaRI7AxvPuDujYLT7Y0i7vwr7llo2r4CbndYsJ1kGq/a9Q9BJ+Ys9l4jKnykg 5i8Zvut9RJC6U/HfrXBcKe+bnRgW7ZRM3tWPUqwjbot8ZL+MUHBClPGlBYHch+lj5wz161 wQHO1T5PqW6+Adsbgi+sy5GJ3uNI7KOfucham32KCq1LabHzFfXHLW3n0BSJzrA5jCL4oj /0hNWYaiS59emoeJxHNUsBn8xdw8DzFFA9S8YbUMlji/6d9CvNNq/dL/N1L374oobGaBOL lx156ohG+sIMRDnkL3S6GaFkL05CxLsvZh/hQUqGak0ZVTXJ9GdQxQRBrl81Yg== Received: from framework (unknown [216.191.123.185]) (using TLSv1.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: markj) by smtp.freebsd.org (Postfix) with ESMTPSA id 4gjGp66kBVz9jP; Sat, 20 Jun 2026 14:20:30 +0000 (UTC) (envelope-from markj@freebsd.org) Date: Sat, 20 Jun 2026 10:20:29 -0400 From: Mark Johnston To: Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 949804c81909 - main - nvme: Use newbus to ask if a device is storage Message-ID: References: <6a32b7af.3e162.34185707@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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6a32b7af.3e162.34185707@gitrepo.freebsd.org> On Wed, Jun 17, 2026 at 03:05:19PM +0000, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=949804c819096b40210e0b0729e54ba10b79c2e8 > > commit 949804c819096b40210e0b0729e54ba10b79c2e8 > Author: Warner Losh > AuthorDate: 2026-06-17 15:03:31 +0000 > Commit: Warner Losh > CommitDate: 2026-06-17 15:03:31 +0000 > > nvme: Use newbus to ask if a device is storage > > As NVMe is in more places, it has a variety of attachments. On non PCI > busses, we assume we're a storage device. For PCI, we look at the > interface ID. Add newbus glue to make this happen. > > Sponsored by: Netflix > Discussed with: jhb > Reviewed by: adrian > Differential Revision: https://reviews.freebsd.org/D56994 > --- > sys/dev/nvme/nvme_if.m | 15 +++++++++++++++ > sys/dev/nvme/nvme_pci.c | 15 +++++++++++++++ > sys/dev/nvme/nvme_sim.c | 3 +++ > 3 files changed, 33 insertions(+) > > diff --git a/sys/dev/nvme/nvme_if.m b/sys/dev/nvme/nvme_if.m > index 5a06ff112f4c..9705aeb7ce0b 100644 > --- a/sys/dev/nvme/nvme_if.m > +++ b/sys/dev/nvme/nvme_if.m > @@ -12,6 +12,14 @@ HEADER { > #include "dev/nvme/nvme_private.h" > }; > > +CODE { > + static bool > + default_is_storage_device(device_t dev) > + { > + return (true); > + } > +} > + After this commit I see a warning during buildkernel of a GENERIC kernel: nvme_if.c:21:1: warning: unused function 'default_is_storage_device' [-Wunused-function] From nobody Sat Jun 20 14:29:02 2026 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 4gjGzz1JMfz6jf8n for ; Sat, 20 Jun 2026 14:29:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjGzz0bsMz43Gg for ; Sat, 20 Jun 2026 14:29:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781965743; 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=GmuouH9J6aoTPFGG1WnHZKSvW+0qtlwn1+dXs1wV9Zk=; b=eM7DuBJdoNBCYH+IbMk7TEJEJcIj6pVSwbefnqEjPHUdVToSVJwroMye/ey/nC1m9lr1/M B7S11T2zyDkHHoD6GT1QkCYBBBWV211wsbvb1G11exI8QHL/lZehoo5Ht0fpPm11a+KrUo uIS4+0kBGNuuSapGIY1y4NVVn0w5ICt5l9rkwhl/LKk/EFKo0JdDxcVCUAMF2kJwA4Qt3M 1MpEjj4uJGr2jWDwl8zADSXgBvv3NnoP9lHQLOFHGYEMh3ok6snEHM0SOJETFOK8iJYyqV NaT1VHGiVnU4rA66Un2DGLdOA0un+ZfsM6dVkZHPw01Om8GjaWh/jP4Yg69Rhw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781965743; a=rsa-sha256; cv=none; b=OO/pQUsSuH5tY+/GUA0nvYRMCKK1XRELiQDWyBgo+A6mYasbdB6q6UiWlZid7QOkufmwqJ sWiRzJhaUvAYBSSSmaVo75pTbzoc2huGCz9xUnGUiaHnEjaqUw2eg96gNv2tcsJ2OX6627 xBK8brJUfVx3piEk8ZFVa1ALgnK45TGmVOAj8FDnLz0UHqbYRmQ5QvIKSmeurX/W+pg6my QQqiScUw1I+AbmJEG7skLi0EoofMAnoq950kRQ3+4298eg6fA4WZ8HjZpBH89nrKR7C5al zgviI2wa0qKXkO2xsOfu0KIPmhibKgBUa1O1BrxuBMSHyQ1t8b+40m/anTl4fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781965743; 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=GmuouH9J6aoTPFGG1WnHZKSvW+0qtlwn1+dXs1wV9Zk=; b=mMqj4hQZptf8y60NObZgDCCmEgs6N+a3agGF1Lxsm/GOVrQta4ryN+iA4OeJBIGfkuDGOz 2D7akOByAlKgAdEOxWkRnUve903fF/B4LZ2MZqKgkEBWe2lPdnEM0+WrQ5i+RSXdg5szq0 dOgwj/jn8yQR9qQxGtN9MyKyn95DYsPzsc+alx3EMQnqe857AJj2qKgDQiVd/ZSO+cs4mv QT1MJ2rPKxp6cpBCY7tMXWNCA3Mu9hbduJhuqd/xdgj1CVkHn/S4m/+U/NKfDQIJmshsj6 jkebuhKpI7Q0sTVlWZ267IUv4UvFrWPXEBXcFc56aOpsYLVtLTpC3WuqqkHY+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjGzy6cvQzZxl for ; Sat, 20 Jun 2026 14:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3e4a6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 14:29:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan Novk=?utf-8?Q?ovi=C4=87?= Subject: git: f879eb3febb6 - main - libc/dbm: Differentiate between uninitialized and end-of-db cursors 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f879eb3febb6c294d684e8e7fecd5cc396ec5a28 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 14:29:02 +0000 Message-Id: <6a36a3ae.3e4a6.b87c159@gitrepo.freebsd.org> The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=f879eb3febb6c294d684e8e7fecd5cc396ec5a28 commit f879eb3febb6c294d684e8e7fecd5cc396ec5a28 Author: Bojan Novković AuthorDate: 2026-06-19 15:24:05 +0000 Commit: Bojan Novković CommitDate: 2026-06-20 14:27:44 +0000 libc/dbm: Differentiate between uninitialized and end-of-db cursors Commit `3a686b851f8f` fixed a `dbm_nextkey` edge case when using the function after reaching the end of the database, but it inadvertently broke the following `R_NEXT` behaviour: "If the cursor is not yet set, this is the same as the R_FIRST flag." Fix this by adding a new cursor constant that allows us to differentiate between an unset cursor and a cursor that overflowed. Reported by: ae Fixes: 3a686b851f8f Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D57670 Reviewed by: markj --- lib/libc/db/hash/hash.c | 12 ++++++++---- lib/libc/tests/db/dbm_nextkey_test.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c index 88a3ffeab828..b025a2310e8f 100644 --- a/lib/libc/db/hash/hash.c +++ b/lib/libc/db/hash/hash.c @@ -81,6 +81,10 @@ static void swap_header_copy(HASHHDR *, HASHHDR *); #define ERROR (-1) #define ABNORMAL (1) +/* Cursor status */ +#define CURSOR_NOT_SET -1 +#define CURSOR_OVERFLOW -2 + #ifdef HASH_STATISTICS int hash_accesses, hash_collisions, hash_expansions, hash_overflows; #endif @@ -180,7 +184,7 @@ __hash_open(const char *file, int flags, int mode, hashp->new_file = new_table; hashp->save_file = file && (flags & O_RDWR); - hashp->cbucket = -1; + hashp->cbucket = CURSOR_NOT_SET; if (!(dbp = (DB *)malloc(sizeof(DB)))) { save_errno = errno; hdestroy(hashp); @@ -711,11 +715,11 @@ hash_seq(const DB *dbp, DBT *key, DBT *data, u_int32_t flag) #ifdef HASH_STATISTICS hash_accesses++; #endif - if (flag == R_FIRST) { + if (flag == R_FIRST || hashp->cbucket == CURSOR_NOT_SET) { hashp->cbucket = 0; hashp->cndx = 1; hashp->cpage = NULL; - } else if (hashp->cbucket < 0) { /* R_NEXT */ + } else if (hashp->cbucket <= CURSOR_OVERFLOW) { return (ABNORMAL); } next_bucket: @@ -734,7 +738,7 @@ next_bucket: } hashp->cbucket = bucket; if ((u_int32_t)hashp->cbucket > hashp->MAX_BUCKET) { - hashp->cbucket = -1; + hashp->cbucket = CURSOR_OVERFLOW; return (ABNORMAL); } } else { diff --git a/lib/libc/tests/db/dbm_nextkey_test.c b/lib/libc/tests/db/dbm_nextkey_test.c index 67b745efb196..993cec8d7f85 100644 --- a/lib/libc/tests/db/dbm_nextkey_test.c +++ b/lib/libc/tests/db/dbm_nextkey_test.c @@ -45,9 +45,42 @@ ATF_TC_BODY(dbm_nextkey_test, tc) dbm_close(db); } +ATF_TC(dbm_nextkey_cursor_test); +ATF_TC_HEAD(dbm_nextkey_cursor_test, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Check that dbm_nextkey acts as if R_FIRST was passed if the cursor is not set"); +} + +ATF_TC_BODY(dbm_nextkey_cursor_test, tc) +{ + DBM *db; + datum key, data; + + data.dptr = "bar"; + data.dsize = strlen("bar"); + key.dptr = "foo"; + key.dsize = strlen("foo"); + + db = dbm_open(path, O_RDWR | O_CREAT, 0755); + ATF_CHECK(db != NULL); + ATF_REQUIRE(atf_utils_file_exists(dbname)); + ATF_REQUIRE(dbm_store(db, key, data, DBM_INSERT) != -1); + dbm_close(db); + + db = dbm_open(path, O_RDWR | O_CREAT, 0755); + ATF_CHECK(db != NULL); + ATF_REQUIRE(atf_utils_file_exists(dbname)); + key = dbm_nextkey(db); + ATF_REQUIRE(key.dptr != NULL); + + dbm_close(db); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, dbm_nextkey_test); + ATF_TP_ADD_TC(tp, dbm_nextkey_cursor_test); return (atf_no_error()); } From nobody Sat Jun 20 14:31:05 2026 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 4gjH2Z0VXFz6jfL2; Sat, 20 Jun 2026 14:31:18 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjH2Y3y2jz43Xn; Sat, 20 Jun 2026 14:31:17 +0000 (UTC) (envelope-from kib@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 65KEV50u053234; Sat, 20 Jun 2026 17:31:09 +0300 (EEST) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 65KEV50u053234 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 65KEV5xJ053233; Sat, 20 Jun 2026 17:31:05 +0300 (EEST) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Sat, 20 Jun 2026 17:31:05 +0300 From: Konstantin Belousov To: Faraz Vahedi Cc: Warner Losh , alc@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 9d87c1aac4a8 - main - libc: Add missing kill_dependency macro Message-ID: References: <6a35ddd4.24ba1.2ad9343d@gitrepo.freebsd.org> <9A21692F-0B53-4303-85A8-57784BFAF8DE@kfv.io> <33E8BFC4-EA46-41A7-B54F-1AADD3C19D9E@kfv.io> 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <33E8BFC4-EA46-41A7-B54F-1AADD3C19D9E@kfv.io> X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=4.0.2 X-Spam-Checker-Version: SpamAssassin 4.0.2 (2025-08-27) on tom.home X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4gjH2Y3y2jz43Xn X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Sat, Jun 20, 2026 at 05:29:52PM +0330, Faraz Vahedi wrote: > Hey, > > I took another look and dug a bit deeper to make sure whether we > should adopt GCC’s form here, and I still think we should stick with > the current one. > > First, although I still need to investigate further, I doubt it adds any > optimisation benefits, nor would omitting it incur a penalty. No, it is not about benefits, my note is that the gcc implementation might disable some optimizations that are important for gcc case. > > More importantly, what we currently have fully conforms to the > §7.17.3.1 and is therefore in its most portable form. There is also > ongoing work (e.g. N3607) to retire `memory_order_consume` and > obsolete `kill_dependency`, with the proposed wording being that > the macro “has no other effect than its result”, which is essentially > just `(y)`, right? So presumably Clang's own `` uses > `(y)` for the same sort of reasons. Yes, this is what I referred to as 'no clear semantic' in my initial mail. What consitues a dependency chain, is up to the compiler. If clang does not have the concept (?) internalized, then the current implementation is fine. But if gcc gives some subtle meaning to consume, its implementation of assigning to the temporal might have some reasons. > > However, I’m happy to discuss it further, and please do correct me > if you have data suggesting otherwise. In the meantime, I’ll do a bit > more research and will keep you posted if I find anything else. > > Cheers, > Faraz > From nobody Sat Jun 20 16:07:08 2026 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 4gjK9B31M3z6jnHP; Sat, 20 Jun 2026 16:07:10 +0000 (UTC) (envelope-from des@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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjK9B0sT1z3HdV; Sat, 20 Jun 2026 16:07:10 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781971630; 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=xtUxOmc7YwzKyJS4Dvt7KKA64r7aRevqclktv6/z3pU=; b=l+S1/MURBrdt1jOxaSOHphlD+mWZIaww4QLIW8r7Ps9O8yIvQGxszPuhX07Hp0iPqBsoKE PHeYfXI+T5ZPhsHyzsLkETqG2sDVZIugdePgWR26BT5mw6Ghf1SHhj4i70F6pMQqYXhv45 eZ39AmAZhpE3qhz8dq7E1t24zEJj0qNG7WjTHp8HXv1fLAiKdCBVH/4E63qH4dhHtJUD5q 4QEY3uKDgqUxADIKE9NWbfYTpwb9uFM9YPt6otsO2z3zniIN4YhwKA1Grlzr9jcITJI5aR obHJjh8rD/tVq05gsnY/W129bfUuYm3x19ueqoNMOEb5DT2e/+dbPZ892aqmGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781971630; a=rsa-sha256; cv=none; b=qnm6P03u4EPFuZru9sBG+75td4Jn+4XwilOaSi9Ub2DInoC+cSLGFd46I+/t24W266YsTa hO6Rk6kgf0KKq3YKexant/n6ey5hGkHh0sS1sSRRov3Nv1oHr/89yTmfAQ2u4iM7Ll7xHv zdJU8tp3Vectv+AOvH+urF7SCuGb5OU44dhDboLJ5ay8UyLuyZTlEGEx0N7QUWGlb4oSF5 J6T5av0cVIgzjArvN2eZiVvAH2avJYJQM8m4riVIcbZY/MHGBZk51kFCQiUMRL3wDE6l++ O7MqGjMF1P7KCADlTgvuk72Vd4ugoscN2zp0pHl0RENfsCL2O1y4wV9yIYCuoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781971630; 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=xtUxOmc7YwzKyJS4Dvt7KKA64r7aRevqclktv6/z3pU=; b=fT/U+jlEwT1TO6pKtSiNtzVWp+7eGDlzLTh2qXF723IXVnFTe08F6HCjbPJsDl/znbGA3o hMoWm9VvDLREMDdUXX1GAyQ3ukpR7cYrJM06+ynay6V/HxmJsfxHt9/j3sBktvTsKpuub2 5XbwbVxcnoJ9T4hQWCP9rm8//I/icMi7s6QrZ7Dz9hHoU+7vkbUvU84tJbjo7dgVeyHSjX K5r5f65ALYJZkQb6qOwol/qQB5dBd5gpoPVxAUQflsoAWLQeBRLnBXk3YSVgerMTfs5rzW I5nub+c2jckc4bh1pOP9ZuGGGMAZeG8TDsjr0kkqQfao3QKkb9nDlPZtgbY9bw== Received: from ltc.des.dev (unknown [92.183.55.143]) (using TLSv1.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: des/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4gjK995cK1zCtq; Sat, 20 Jun 2026 16:07:09 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id 4896950710; Sat, 20 Jun 2026 18:07:08 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Mark Johnston Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 949804c81909 - main - nvme: Use newbus to ask if a device is storage In-Reply-To: (Mark Johnston's message of "Sat, 20 Jun 2026 10:20:29 -0400") References: <6a32b7af.3e162.34185707@gitrepo.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Sat, 20 Jun 2026 18:07:08 +0200 Message-ID: <86qzm1tcur.fsf@ltc.des.dev> 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mark Johnston writes: > Warner Losh writes: > > + static bool > > + default_is_storage_device(device_t dev) > > + { > > + return (true); > > + } > After this commit I see a warning during buildkernel of a GENERIC > kernel: > > nvme_if.c:21:1: warning: unused function 'default_is_storage_device' [-Wu= nused-function] Easily fixed by changing `static bool` to `static inline bool`. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Sat Jun 20 17:40:23 2026 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 4gjMDm1kDnz6hDFd for ; Sat, 20 Jun 2026 17:40:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjMDm0sDvz3Y1x for ; Sat, 20 Jun 2026 17:40:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781977224; 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=V+thDtDCmenX9B+FMBvxXVZlvCpCl2HHwtAI4CS0lYA=; b=LjLflllFsCS967qAdie1TX+W1EWTZNTMV71K2311ESLz8/q6JUHx8F4F3+ahxC3pi3un+k tMYcdDtu6HTRmwsz6pN0HglL3RZNvEuizHbDgl+mtYjNxdvqdz4OsEAGcgqp76aALb+W9p Ro1WdcBDUijNhCX02qq/QqpUg8v+hIC1Lu4x3B56afmvWBaxoKJf4CX9UM5vBS6n6oR0T4 zwMcNUy6BfRkX9uCOGZ90D0Neuei1A11AA7gARuHl8QX69lnESPE77bHhu7Xo64vEaXf+A CpJwBBa/TcjhWUQfl5dMR3tON2HCL3OYURc6PacM7MR5TM/WdWs4RQmP4UpR/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781977224; a=rsa-sha256; cv=none; b=j/fon79vXIOm5eINE9tuEaMbU/Ns3boE5BOr7cu1AHjOeX3qsw08PduMXR9qWwo+a8OiiR ewe2jjLYf4Jusa5e00IgU842DZHXeR6oRoioQADQBQG7LVc29wG3nPxUkIfbSMMzu+2FtH HHGIKxKy12D23aFjwLctk9bISk97LE0lb5u70tKXgUsx5PJjcodlH4xJ5w5klkyvY2wbIy +z4yEJEnCi23bcEafSq37VgG8tDaXZFCaslAxgwErk2/MoAj4mwTE1NFBzpJMh47fWyvWa Q5UUDdtLMMjc8mtKF77zoB8vg4/vt7g4TJlDw5jBwWvQE2DNYaAnOL2jVY4rkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781977224; 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=V+thDtDCmenX9B+FMBvxXVZlvCpCl2HHwtAI4CS0lYA=; b=mnjdv1fdzg6kliYaXvj/fdON/v2oMrlaBwqWaOucUYeBg89heoxH/3ZyJCwhCRTwPsbEgH rkw6ghYMTwHQSN9XcQ/Pp0PXuHALOJvkOZixoChoPvnrQJGqSGEXQWJgxl4xi/JtG0VFu0 VllX7PG9EvC2oSJ3t5U9eThotjxPvM7flsqCXgR2moPITS74Na1Y1sEGYS9zzz25hC/3AI oLBahTxuShCC0Vq9e1OTHhIsZle4l/uHNBdoDEAYtBmo4TNuyrR7eLS1E5628BfddxMZ+L tr6UzVmuduzf9LW6dhcaQYOzJla4zMXD3QJ7GKSxyU89YrpY7G1WSnHTYXvR8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjMDl6x2GzhMZ for ; Sat, 20 Jun 2026 17:40:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23a4e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 17:40:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: f70a687bb071 - main - sound: Retire SD_F_VPC and related settings 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f70a687bb071cdee60dc7420d75fa1dd122af51a Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 17:40:23 +0000 Message-Id: <6a36d087.23a4e.54451ed4@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=f70a687bb071cdee60dc7420d75fa1dd122af51a commit f70a687bb071cdee60dc7420d75fa1dd122af51a Author: Christos Margiolis AuthorDate: 2026-06-20 17:32:21 +0000 Commit: Christos Margiolis CommitDate: 2026-06-20 17:32:21 +0000 sound: Retire SD_F_VPC and related settings VPC is enabled by default, and the only way to turn it off is through a loader hint. That being said, there is no benefit to turning it off in the first place, because VPC provides more fine-grained volume control, as well as access to the SNDCTL_DSP_[SET|GET][REC|PLAY]VOL ioctls and dsp_ioctl_channel(). Sponsored by: The FreeBSD Foundation MFC after: 1 week --- share/man/man4/pcm.4 | 22 +--------------------- sys/dev/sound/pcm/dsp.c | 2 +- sys/dev/sound/pcm/feeder_chain.c | 4 ++-- sys/dev/sound/pcm/sound.c | 4 ---- sys/dev/sound/pcm/sound.h | 4 ++-- 5 files changed, 6 insertions(+), 30 deletions(-) diff --git a/share/man/man4/pcm.4 b/share/man/man4/pcm.4 index cda27d734b74..fe5af8301cfe 100644 --- a/share/man/man4/pcm.4 +++ b/share/man/man4/pcm.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 17, 2026 +.Dd June 20, 2026 .Dt SOUND 4 .Os .Sh NAME @@ -212,26 +212,6 @@ application, without touching the master .Nm volume. This is sometimes referred to as Volume Per Channel (VPC). -The VPC feature is enabled by default. -.Ss Loader Tunables -The following loader tunables are used to set driver configuration at the -.Xr loader 8 -prompt before booting the kernel, or they can be stored in -.Pa /boot/loader.conf -in order to automatically set them before booting the kernel. -It is also possible to use -.Xr kenv 1 -to change these tunables before loading the -.Nm -driver. -The following tunables can not be changed during runtime using -.Xr sysctl 8 . -.Bl -tag -width indent -.It Va hint.pcm.%d.vpc -Set to 1 or 0 to explicitly enable (1) or disable (0) the VPC feature. -This tunable is undefined by default. -VPC is however enabled by default. -.El .Ss Runtime Configuration There are a number of .Xr sysctl 8 diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 7f05da62a173..df9e241881c0 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -542,7 +542,7 @@ dsp_ioctl_channel(struct dsp_cdevpriv *priv, struct pcm_channel *ch, int j, left, right, center, mute; d = priv->sc; - if (!PCM_REGISTERED(d) || !(pcm_getflags(d->dev) & SD_F_VPC)) + if (!PCM_REGISTERED(d)) return (-1); PCM_UNLOCKASSERT(d); diff --git a/sys/dev/sound/pcm/feeder_chain.c b/sys/dev/sound/pcm/feeder_chain.c index 35bb12a062ec..1dbdf2fcc0e4 100644 --- a/sys/dev/sound/pcm/feeder_chain.c +++ b/sys/dev/sound/pcm/feeder_chain.c @@ -714,8 +714,8 @@ feeder_chain(struct pcm_channel *c) cdesc.dummy = 1; if ((softfmt & AFMT_CONVERTIBLE) && - (((d->flags & SD_F_VPC) && !(c->flags & CHN_F_HAS_VCHAN)) || - (!(d->flags & SD_F_VPC) && (d->flags & SD_F_SOFTPCMVOL) && + (!(c->flags & CHN_F_HAS_VCHAN) || + ((d->flags & SD_F_SOFTPCMVOL) && !(c->flags & CHN_F_VIRTUAL)))) cdesc.use_volume = 1; diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 235142eb5209..101b38367873 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -355,10 +355,6 @@ pcm_init(device_t dev, void *devinfo) cv_init(&d->cv, device_get_nameunit(dev)); i = 0; - if (resource_int_value(device_get_name(dev), device_get_unit(dev), - "vpc", &i) != 0 || i != 0) - d->flags |= SD_F_VPC; - if (resource_int_value(device_get_name(dev), device_get_unit(dev), "bitperfect", &i) == 0 && i != 0) d->flags |= SD_F_BITPERFECT; diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 4d527d69086a..60beee69d1a5 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -104,7 +104,7 @@ struct snd_mixer; #define SD_F_MPSAFE 0x00000010 #define SD_F_REGISTERED 0x00000020 #define SD_F_BITPERFECT 0x00000040 -#define SD_F_VPC 0x00000080 /* volume-per-channel */ +/* unused 0x00000080 */ /* unused 0x00000100 */ #define SD_F_EQ_ENABLED 0x00000200 /* EQ enabled */ /* unused 0x00000400 */ @@ -120,7 +120,7 @@ struct snd_mixer; "\005MPSAFE" \ "\006REGISTERED" \ "\007BITPERFECT" \ - "\010VPC" \ + /* "\010 */ \ /* "\011 */ \ "\012EQ_ENABLED" \ /* "\013 */ \ From nobody Sat Jun 20 17:48:03 2026 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 4gjMPb6yNxz6hDvv for ; Sat, 20 Jun 2026 17:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjMPb6DtMz3Yjc for ; Sat, 20 Jun 2026 17:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781977683; 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=P6/xL9bXZrky6uvtT22J6uwGCLFZgAYOKFTi723rkA4=; b=K+rDAId3aQje9oRBxVoJPWLiu8AcYUeXy/9DXxxgDFvaWJ6qU13Rfeq/+QBNzsp06luz9V wNpoQuIlxEgcEjQ3EcDfeQotQwAxybQSWRHA0i1lyop3+9eCLhDGIvaxfviKDTnmkxr4ZV gVXXzvL57zJQFYMVcO+zljt7VknOpAdS95QAkJGDO+DV6z3groEqn+tpBGWUx7yIAYPm7S 54g+sIMMdjyD/sp83gQuE1I5dM2crhj5itz3hQKBuoU/ryqXcHhF589rxcbYaiCdw9iwHt pU5z+KM7vkjKRwZoKj6aOCPQqG3bkxBZBPrWnyQtE5AWghG6NqsNmxnw+ZDSbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781977683; a=rsa-sha256; cv=none; b=tr+ylPBM+EBe5xPZROv/1EE5p7UDmoQRX0JQRi1NkJuP7DURRjSJgXfy17AT88VGxF03Gf o1hfNEiGlQkS1/BUnvct7pABN8DAHqLM0PUt+yiMpRX4iXmxS3ueav84HEuKdsDhZaV2OT 9MYXfP2c+1DLwBsyxSAsUJ80PryWOkdEZtP+p/4j8iyFu8YNIOfRB7UeEq4MdX4TX3+cHT uchHu6tJCnir0yR11OBFCL0GYCCMevnb1yvhL4Wq/VGR9Hi7ma91ZD3Ivm468NF0B0fs9l +cWWsAncpAbjbIzGz2x48h2KYeBMCIKO5IDWKIYyS99jbFj2gVWV/d3+9I50mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781977683; 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=P6/xL9bXZrky6uvtT22J6uwGCLFZgAYOKFTi723rkA4=; b=mjvDTXS1+WV3qul+Ea+mWK2SchgP/mjqIoUab3F89edeM8Eh/7jx8o/cv7tts4jiFADIgF izwNvG/E1oce1QhBUO3gF+6UCdd50hIlFL5DBiNNlryxw+KvNZiMRN2noatL/rM5vC2Qf+ /CTqmrjH0mp2rPWwkgLBPF1yTw++Fh7wBBO85aDRkEJTh/voPmnEZd4CKhsAhUC9s9WuYr tlLFIcTiAFVN5So+VoQwl8S9KVplIwwq2u8355Rh9ma3jD09arxMv4PR/PbfTdMVGAKRqd FGjUSJXoGt8iQvtE6GLcN3op6qdaWUMbJGDcMDKHCxfT1Lp31O7VG5hfJp8+Xg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjMPb4dPkzghv for ; Sat, 20 Jun 2026 17:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23333 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 17:48:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 64b805d52eec - main - nvme: Move default is_storage method to nvme_private.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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 64b805d52eec795c6436def24cec508404b5bfdc Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 17:48:03 +0000 Message-Id: <6a36d253.23333.4a7b848@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=64b805d52eec795c6436def24cec508404b5bfdc commit 64b805d52eec795c6436def24cec508404b5bfdc Author: Warner Losh AuthorDate: 2026-06-20 17:44:27 +0000 Commit: Warner Losh CommitDate: 2026-06-20 17:46:37 +0000 nvme: Move default is_storage method to nvme_private.h Since CODE entries wind up in the nvme_if.c file, we got warnings when it wasn't used (which is always). Move it into nvme_private and change its name to nvme_is_storage_default to put it into the nvme_ namespace. Fixes: 949804c81909 Sponsored by: Netflix --- sys/dev/nvme/nvme_if.m | 10 +--------- sys/dev/nvme/nvme_private.h | 6 ++++++ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/sys/dev/nvme/nvme_if.m b/sys/dev/nvme/nvme_if.m index 9705aeb7ce0b..4484c1da9dce 100644 --- a/sys/dev/nvme/nvme_if.m +++ b/sys/dev/nvme/nvme_if.m @@ -12,14 +12,6 @@ HEADER { #include "dev/nvme/nvme_private.h" }; -CODE { - static bool - default_is_storage_device(device_t dev) - { - return (true); - } -} - # # A new namespace is now available # @@ -67,4 +59,4 @@ METHOD int handle_aen { # METHOD bool is_storage_device { device_t dev; -} default default_is_storage_device; +} default nvme_is_storage_device_default; diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h index f5918a04be72..ec941f31779c 100644 --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -591,4 +591,10 @@ void nvme_ctrlr_poll(struct nvme_controller *ctrlr); int nvme_ctrlr_suspend(struct nvme_controller *ctrlr); int nvme_ctrlr_resume(struct nvme_controller *ctrlr); +static inline bool +nvme_is_storage_device_default(device_t dev) +{ + return (true); +} + #endif /* __NVME_PRIVATE_H__ */ From nobody Sat Jun 20 18:15:34 2026 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 4gjN1L4NVXz6hHWB for ; Sat, 20 Jun 2026 18:15: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjN1L3DKsz3jwP for ; Sat, 20 Jun 2026 18:15:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781979334; 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=svHD/mpXb20Wt9Vx23/cTDPxuw4KkZNQmssZrsLh6qw=; b=UEIa3JpC4p3DAaeGXgIBaUZyw0oT6zJh6Sk/XD21B9qqgKdBbrAB4WePhIqnxj22HxwmSI X93HLY/hSFpnCyFzQZm03c+nDx0SoV9CU6uR8xZ0Y5teKBbg0IPXDJBOhfjamOIUfPPmwT PdlV45+nN/CouXqerk54TfuG7Xut4nzNF26VvV1yxby8mqKOtw+ve1ys8Ros75/M+zc6xR 5iKPvG/943s2KOOi1AIHdM7FV0Gu9cUn7rLBGslN0MFAgl/OVgzoyUgVHNCTaHXxvNXIjU MSrwIetznKMRDtvUJc7OOgce8moOupel4+ETtuUaHnXlj0NfZzkSzaLMYay4VA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781979334; a=rsa-sha256; cv=none; b=RLAauK2E60D7OV/7BprVA9VtGLgO5eDz/1A4doXgmx2RCvHX/Xp0xPrXjJsE+wKjPGzrGR Rln928Wg6kxCMS1uQdXo4ChQuGTWSlQwZAjcr3x37w4239W2kZGZWbhcsSQwYVCpqSep1U yPM6WHM3+rgAUpYMJY3rfCyg6OP+Os3hdbJjrHNTHbAUxBdjtsXmJBQ55STO0puf17OAkv ILd4PVznylR04eCLC8Lfi8rxSvtnM6evJmeEKYqoaxiwVInRRa2difSSUK8bG+qjZMFG9x tQx1Jma/Vvh2UDW/W6sBUrirvaZlIu+vqxsxsZ429miKghUlz3ng1sQqGQX75Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781979334; 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=svHD/mpXb20Wt9Vx23/cTDPxuw4KkZNQmssZrsLh6qw=; b=xerIdt2ynGZZR57LwjNP3yn/87GFX9cwSbl0hh35hd17SnH/gRCtA27NCVG65LMD66HOVb ieBT7aS9XU9Ra8GE/JvFjUnqtaFqzJdx5Q2Yo32NPdh64dlqCcWI0lCIWsj1GSbZ7C3FtN jGxdfmwp0/mdNmRk/j5yvhwl2sT+48H57xrcVNshyvx7m1ffjPUUqqiapIbvTHpTckfQe2 o7M5MchHr5C5MLVlnzxNBlwp/If01Vll6hOxbVgk5hC+YAaU5KrCvRHOVqQ6s1BRNLvDPN XpBTiMVz74nxcSWEAm7XFGKBKy7O0FhyJ1plnGMH7eKq09UjLQTSf1Jp9wtVaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjN1L254mzhmh for ; Sat, 20 Jun 2026 18:15:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2668f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 18:15:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Tetlow Subject: git: 3a4e049c3814 - main - efitable: Fixup getopt args to reflect guid use. 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a4e049c38143980e472b2926abde3c7549530c4 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 18:15:34 +0000 Message-Id: <6a36d8c6.2668f.7b0a6c4d@gitrepo.freebsd.org> The branch main has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=3a4e049c38143980e472b2926abde3c7549530c4 commit 3a4e049c38143980e472b2926abde3c7549530c4 Author: Gordon Tetlow AuthorDate: 2026-06-20 02:59:49 +0000 Commit: Gordon Tetlow CommitDate: 2026-06-20 18:14:56 +0000 efitable: Fixup getopt args to reflect guid use. Correct the manpage to reflect the preference for GUID vs UUID. Take the long version of --guid for the -g option. Sort the argument list while we are touching it. Reviewed by: imp MFC after: 1 week MFC to: stable/15 Event: BSDCan 2026 Differential Revision: https://reviews.freebsd.org/D57695 --- usr.sbin/efitable/efitable.8 | 6 +++--- usr.sbin/efitable/efitable.c | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/usr.sbin/efitable/efitable.8 b/usr.sbin/efitable/efitable.8 index 52949abcb853..f0785d3ba7cf 100644 --- a/usr.sbin/efitable/efitable.8 +++ b/usr.sbin/efitable/efitable.8 @@ -32,7 +32,7 @@ .Nd dump UEFI tables .Sh SYNOPSIS .Nm -.Op Fl u Ar uuid | Fl t Ar name +.Op Fl g Ar guid | Fl t Ar name .Op Fl -libxo .Sh DESCRIPTION This program prints data from @@ -49,6 +49,8 @@ in a selection of different human and machine readable formats. See .Xr xo_options 7 for details on command line arguments. +.It Fl g Ar guid | Fl -guid Ar guid +Specify the GUID of the table to print. .It Fl t Ar name | Fl -table Ar name Specify the name of the table to print. Currently supported tables: @@ -61,8 +63,6 @@ EFI Memory Attributes Table .It Cm prop EFI Properties Table .El -.It Fl u Ar uuid | Fl -uuid Ar uuid -Specify the UUID of the table to print. .El .Sh HISTORY The diff --git a/usr.sbin/efitable/efitable.c b/usr.sbin/efitable/efitable.c index a506b4dea311..b9e3d424398a 100644 --- a/usr.sbin/efitable/efitable.c +++ b/usr.sbin/efitable/efitable.c @@ -75,8 +75,9 @@ main(int argc, char **argv) bool table_set = false; bool uuid_set = false; struct option longopts[] = { - { "uuid", required_argument, NULL, 'u' }, + { "guid", required_argument, NULL, 'g' }, { "table", required_argument, NULL, 't' }, + { "uuid", required_argument, NULL, 'u' }, { NULL, 0, NULL, 0 } }; From nobody Sat Jun 20 18:16:54 2026 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 4gjN2t6ksPz6hGwq for ; Sat, 20 Jun 2026 18:16: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjN2t4LCtz3kQg for ; Sat, 20 Jun 2026 18:16:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781979414; 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=5Xrq+MMJ+mLcRBHNqBSsUZo38PBpl+pOKT+GgmZ820g=; b=C+FC+an4faPwfR8TtPYQZuNN/lX8x9Btvyxz8kMZGeloEAK8TClTl7DXzBCkRdGXKW+26c HJKXTqemldtQA5zH0LFBz5247y+g89/lrofBXK02SjuYafgl2y4AH02P999w3wUjv2ygpD AKklfwN6OP2mUdqD8Y9F1w/VmQ37O5sMfv6KcFUU81cDflIpVHupAr71HjD9NaeaJ6nxtk jEbpIMfvgXiM72ViP8QuM/1Bji5kUjE7CUl3iMAY7n4HxvYhiSvTp1p0j5niXNDmypXflg p+xLlOERPAxqXg4XAF0fiG1ZhviTYibOf5CTy45gdMAx2/Wa477tKZfUGd5Tlg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781979414; a=rsa-sha256; cv=none; b=eHb6e3H1g6HXUuk0riidKymxmp/SH5UzjlQo3k6Ceh9Hkrx+WFZ93tewJ28omcnVAqyPq7 h7NbsbUhNLvqSS9Cia/ub3I0MWsCsKcxxyqx6fvq8NU0f34og1DQOGFTHf7nNByCG+5l04 i13QSDa/O/VD5yRCsh4M6/G5j6q3K0Scs4+mIaby2SKIqOEkUnPv8xMDAHyycreoKnIMYN EkUrsrUQgMuHAp9O22IEWCYd/Htd3nwsuoOSt2VzeIxs6Y0TJSY5LfK/tjk0JQhij9LvXx TKtsM6iP5hnjjgkvMnxMtRluqojDYusRiwEykmFmw9FY8E85n05lpsHTwGGHLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781979414; 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=5Xrq+MMJ+mLcRBHNqBSsUZo38PBpl+pOKT+GgmZ820g=; b=ULQnO9d8h5NF+KhfiHGS3fyNi4IlqaKdd9IG74aMtOVOkKatbT/AVIZsLuDvVHK3WW1Ehq u3JkcWakx43KWUXGOo7JL5nrcZ12c0bR8vgo0Zp8/Gab34IO+NtLyuEwFHINQQYX1VZXhn 6BZ28grqPRZbvnK5k4LuXb+UOxSwRQYvTdiaW8vi0YfXrMesf+RGDHTSBL20Khm2ZT73T4 s/2/Qpw/4slsN74BK4wfVgvLW4p151Xq7MT2kTmC+qaS3ReVbeQ9N/GoueU5txEpx4P2m4 v9DNT5x4AGjeeLD1kr8W73ZssTcUMgxXaK/7KNqJ8Jz8fZ842ELMieTASm2VPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjN2t369nzhmk for ; Sat, 20 Jun 2026 18:16:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25be0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 18:16:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 8edcb37dd075 - main - efirt(9): carefully destroy efi_lock 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 8edcb37dd0753dc7e50044d9ccf0e991392a3d84 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 18:16:54 +0000 Message-Id: <6a36d916.25be0.681263a9@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8edcb37dd0753dc7e50044d9ccf0e991392a3d84 commit 8edcb37dd0753dc7e50044d9ccf0e991392a3d84 Author: Konstantin Belousov AuthorDate: 2026-06-20 12:20:38 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-20 18:16:37 +0000 efirt(9): carefully destroy efi_lock efi_init() might return error after initializing the mutex, in which case MOD_UNLOAD() is not processed, and the mutex is not destroyed. Similarly, efi_uninit() skips any processing if efi_runtime was left as NULL, leaving mutex not destroyed. Initialize the mutex in MOD_LOAD case, and destroy in MOD_UNLOAD, also handling errors. Reviewed by: imp Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57704 --- sys/dev/efidev/efirt.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/dev/efidev/efirt.c b/sys/dev/efidev/efirt.c index 2e9a917de1f0..590d98030741 100644 --- a/sys/dev/efidev/efirt.c +++ b/sys/dev/efidev/efirt.c @@ -29,7 +29,6 @@ * SUCH DAMAGE. */ -#include #include "opt_acpi.h" #include @@ -184,7 +183,6 @@ efi_init(void) TUNABLE_INT_FETCH("efi.rt.disabled", &rt_disabled); if (rt_disabled == 1) return (0); - mtx_init(&efi_lock, "efi", NULL, MTX_DEF); if (efi_systbl_phys == 0) { if (bootverbose) @@ -285,8 +283,6 @@ efi_uninit(void) efi_systbl = NULL; efi_cfgtbl = NULL; efi_runtime = NULL; - - mtx_destroy(&efi_lock); } static int @@ -858,13 +854,19 @@ const struct efi_ops *active_efi_ops = &efi_ops; static int efirt_modevents(module_t m, int event, void *arg __unused) { + int error; switch (event) { case MOD_LOAD: - return (efi_init()); + mtx_init(&efi_lock, "efi", NULL, MTX_DEF); + error = efi_init(); + if (error != 0) + mtx_destroy(&efi_lock); + return (error); case MOD_UNLOAD: efi_uninit(); + mtx_destroy(&efi_lock); return (0); case MOD_SHUTDOWN: From nobody Sat Jun 20 18:45:44 2026 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 4gjNhG26GTz6hLVw for ; Sat, 20 Jun 2026 18:45:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjNhG0Lr2z3p6m for ; Sat, 20 Jun 2026 18:45:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781981150; 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=2G/oWEoG2shw0pgjm+dleZIU00ZFPWZkRJkTXyok4Wc=; b=OiXhEUF7Hfw2No3DcUa0gGuWs7DArLg39nfRwg17aE+sofII3QughcOtjYwSnmqBMWWbPc j5h0N1GoFxTyxJWEj3KHDsvS5icJsyD+E/OwM/r/bqcH3M8sqabnew/rO2QpowYq/S0JaA /1PfmREFolJNQTTCDMOwgC6vVxt5h/e/nZWjIQVsDX3PDSHPaVcaLyCxutAybizDMmSa0H Pc2TYHvZvOzeY3JTjjB34rSRCqvPxFWbmCA7DhhEDEkRZ1j0h2wUpeL0I7nSJBqwZZKOvb 1AVtRHE01JwBb9KPnf7Oq1PZ660OkH/4Tp82sMmCdvV05VghtXAkVK6mXrB9fA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781981150; a=rsa-sha256; cv=none; b=JHlet9G8caTR1Smvbs0zl1tGwP0usDsiHHMESa3oNS77ges2/D5xmXwIZMBs7hMkZyUQh+ yXxpkyXbTGBgUJNI4rYTIZo9ctMC2NuuyOm7Y5PC92l9Mr0ibXkyeRmV0QKkz/1LEgxmgm fBvsCa9vhWlfNxXCfEeWIyjCLtiMszNwJQ/iFc+IwFqwEVXBRstF0/3CulLOkSuZVmILyl zRQ4EulLngXLXJ7i7+Nt5dmdHVXl8WnL2S/Mwt+HzjbBC9KP5fIVcyojgpCNeCnDB8DXNv AbiPalrCVbodh8/8e9qT50Chz0ZerNJlgFxleYwd+ii3w6Y7HDNXJaW+ENMGzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781981150; 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=2G/oWEoG2shw0pgjm+dleZIU00ZFPWZkRJkTXyok4Wc=; b=kWNdhhfgiJocZ+pysKa67StNgMi6gIgcp4ebS4wEUOaYO1xQ3rU5p3/DUC+ujVd/Q99USe gVQDfLi7jbJuhlbTAS/LT6ca65Y2FBiM8FHKvWnsUyx7TjcLil5Jw/u9ntRhoP9mq3QG9w UawzFjihpOKHLXWU9ub82qAKSpR3OoOrpEE+ic3vUwueOSw8RkUeKSIQUKsWOU+rmCHBL4 8yKcEwXEiwjFunwymwGY1F9oeIPeIxYjxZ2zP8kRqLzTbsN9uRfuNq/E9AmbsgQKjRh2WB p8MwXxE623xvXCu4nRR/btqasicLI4+BMTXri00HMZGHz8Q+ZRWNQzWFDOLGLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjNhF6CTjzjbv for ; Sat, 20 Jun 2026 18:45:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30369 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 18:45:44 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: d8e8f9251975 - main - pNFSd: Add a directory of newly created files for the pNFSd 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d8e8f9251975b68fe9c73e39074e0f211ec2145e Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 18:45:44 +0000 Message-Id: <6a36dfd8.30369.18992bfe@gitrepo.freebsd.org> The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=d8e8f9251975b68fe9c73e39074e0f211ec2145e commit d8e8f9251975b68fe9c73e39074e0f211ec2145e Author: Rick Macklem AuthorDate: 2026-06-20 18:43:45 +0000 Commit: Rick Macklem CommitDate: 2026-06-20 18:43:45 +0000 pNFSd: Add a directory of newly created files for the pNFSd When an NFSv4.1/4.2 server is configured as a pNFS server, new file creation (via Open/Create from an NFS client) is slow, due to the fact that the NFS server (MDS) must do RPCs against the DS(s). This patch precreates files in a directory called ".pnfshide/numfiles", so that the NFS server can just rename them for the Open/Create. A kernel process called a "replenisher" creates more files in ".pnfshide/numfiles" as required. (At this point, the MDS must still do Setattr RPC(s) on the DS(s), but that will change when the pNFS server is converted to the loosely coupled configuration. This patch only affects the pNFS server and only if the directory .pnfshide/numfiles exists in the exported file system. Reviewed by: kib Discussed with: markj Differential Revision: https://reviews.freebsd.org/D57554 --- sys/fs/nfsserver/nfs_nfsdport.c | 621 +++++++++++++++++++++++++++++++++++++--- sys/kern/vfs_mount.c | 34 +++ 2 files changed, 623 insertions(+), 32 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 5927146c78d6..ca8c9575bf59 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -114,6 +115,8 @@ VNET_DEFINE_STATIC(bool, nfsrv_mntinited) = false; static int nfssvc_srvcall(struct thread *, struct nfssvc_args *, struct ucred *); static void nfsvno_updateds(struct vnode *, struct ucred *, struct thread *); +static void nfsvno_pnfsreplenish(void *); +static int nfsvno_pnfsusenumfile(struct nameidata *, struct vattr *); int nfsrv_enable_crossmntpt = 1; static int nfs_commit_blks; @@ -197,6 +200,19 @@ VNET_DECLARE(int, nfsd_enable_stringtouid); SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_stringtouid, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nfsd_enable_stringtouid), 0, "Enable nfsd to accept numeric owner_names"); +/* + * vfs.nfsd.pnfsswitchforw and vfs.nfsd.pnfsnumfilemiss are writable so that + * statistics can be reset. + */ +static uint64_t nfsrv_pnfsswitchforw = 0; +SYSCTL_U64(_vfs_nfsd, OID_AUTO, pnfsswitchforw, CTLFLAG_RW, + &nfsrv_pnfsswitchforw, 0, "Number of times replenish switches to forward"); +static uint64_t nfsrv_pnfsnumfilemiss = 0; +SYSCTL_U64(_vfs_nfsd, OID_AUTO, pnfsnumfilemiss, CTLFLAG_RW, + &nfsrv_pnfsnumfilemiss, 0, "Number of numfile misses"); +static u_int nfsrv_pnfsforwcnt = 5; +SYSCTL_UINT(_vfs_nfsd, OID_AUTO, pnfsreplenishforwcnt, CTLFLAG_RW, + &nfsrv_pnfsforwcnt, 0, "Forward replenish cnt before switch to back"); static int nfsrv_pnfsgetdsattr = 1; SYSCTL_INT(_vfs_nfsd, OID_AUTO, pnfsgetdsattr, CTLFLAG_RW, &nfsrv_pnfsgetdsattr, 0, "When set getattr gets DS attributes via RPC"); @@ -231,6 +247,34 @@ SYSCTL_PROC(_vfs_nfsd, OID_AUTO, dsdirsize, CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(nfsrv_dsdirsize), sysctl_dsdirsize, "IU", "Number of dsN subdirs on the DS servers"); +/* + * nfsrv_pnfsmaxnumfiles can only be decreased when the nfsd is not + * running. It can be increased when the nfsd is running, but the + * additional numfiles should have been precreated in .pnfshide/numfiles + * for all file systems before it is increased. + */ +static u_int nfsrv_pnfsmaxnumfiles = 1000; +static int +sysctl_pnfsmaxnumfiles(SYSCTL_HANDLER_ARGS) +{ + int error, new_maxnumfiles; + + new_maxnumfiles = nfsrv_pnfsmaxnumfiles; + error = sysctl_handle_int(oidp, &new_maxnumfiles, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + if (new_maxnumfiles < nfsrv_pnfsmaxnumfiles && newnfs_numnfsd != 0) + return (EBUSY); + if (new_maxnumfiles > 10000 || new_maxnumfiles < 100) + return (EINVAL); + nfsrv_pnfsmaxnumfiles = new_maxnumfiles; + return (0); +} +SYSCTL_PROC(_vfs_nfsd, OID_AUTO, pnfsmaxnumfiles, + CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, + sizeof(nfsrv_pnfsmaxnumfiles), sysctl_pnfsmaxnumfiles, + "IU", "Maximum number of entries in .pnfshide/numfiles"); + /* * nfs_srvmaxio can only be increased and only when the nfsd threads are * not running. The setting must be a power of 2, with the current limit of @@ -1285,20 +1329,32 @@ nfsvno_createsub(struct nfsrv_descript *nd, struct nameidata *ndp, error = nd->nd_repstat; if (!error && ndp->ni_vp == NULL) { if (nvap->na_type == VREG || nvap->na_type == VSOCK) { - error = VOP_CREATE(ndp->ni_dvp, - &ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr); - /* For a pNFS server, create the data file on a DS. */ - if (error == 0 && nvap->na_type == VREG) { + error = ENOENT; + if (nvap->na_type == VREG && + !TAILQ_EMPTY(&nfsrv_devidhead)) + error = nfsvno_pnfsusenumfile(ndp, + &nvap->na_vattr); + if (error == ENOENT) { + error = VOP_CREATE(ndp->ni_dvp, + &ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr); /* - * Create a data file on a DS for a pNFS server. - * This function just returns if not - * running a pNFS DS or the creation fails. + * For a pNFS server, create the data file + * on a DS. */ - nfsrv_pnfscreate(ndp->ni_vp, &nvap->na_vattr, - nd->nd_cred, p); + if (error == 0 && nvap->na_type == VREG) { + /* + * Create a data file on a DS for a + * pNFS server. + * This function just returns if not + * running a pNFS DS or the creation + * fails. + */ + nfsrv_pnfscreate(ndp->ni_vp, + &nvap->na_vattr, nd->nd_cred, p); + } + VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? + &ndp->ni_vp : NULL, false); } - VOP_VPUT_PAIR(ndp->ni_dvp, error == 0 ? &ndp->ni_vp : - NULL, false); nfsvno_relpathbuf(ndp); if (!error) { if (*exclusive_flagp) { @@ -2030,6 +2086,486 @@ nfsvno_statfs(struct vnode *vp, struct statfs *sf) return (error); } +/* + * Replenish the numfiles in .pnfshide/numfiles directory. + * These files are used for the pNFS server when an Open/Create needs a + * new regular file. By creating them here asynchronously, we can avoid + * the delay of doing do for Open/Create, since creation requires RPCs to + * the DSs be done. + * (A) - When the sleep times out, work backwards creating + * one new numfile for each cycle. + * (Use a timeout of 10msec for now.) + * (B) - When the sleep returns 0, this indicates that a + * nfsd thread didn't find a numfiles. For this case + * be more agressive and create numfiles going forward. + * (Use a timeout of 1msec for now.) + * Runs as a kernel process. + */ +static char pnfshide_name[] = ".pnfshide"; +static char numfiles_name[] = "numfiles"; + +static void +nfsvno_pnfsreplenish(void *arg) +{ + struct componentname cn; + struct vattr va; + char name[11]; + struct timespec ts; + struct mount *mp = (struct mount *)arg, *temp_mp; + struct ucred *cred; + struct vnode *numfiledvp, *vp; + struct netexport *nep; + uint64_t prevcnt; + time_t prevsec; + u_int cnt, last_back, next_back, next_forw, prevrate[4]; + int averate, error, i, timo; + bool back, use_same_num; + + cred = curthread->td_ucred; + if (cred->cr_uid != 0) + printf("nfsvno_pnfsreplenish: not root\n"); + + /* + * Do a lookup for ".pnfshide" in the root dir + * of the file system. + */ + cn.cn_nameiop = LOOKUP; + cn.cn_lkflags = LK_SHARED; + cn.cn_flags = ISLASTCN | NOFOLLOW | LOCKLEAF | NOCROSSMOUNT; + cn.cn_cred = cred; + cn.cn_nameptr = pnfshide_name; + cn.cn_namelen = sizeof(pnfshide_name) - 1; + vp = NULL; + numfiledvp = NULL; + error = vn_lock(mp->mnt_rootvnode, LK_SHARED); + if (error == 0) { + error = VOP_LOOKUP(mp->mnt_rootvnode, &vp, &cn); + VOP_UNLOCK(mp->mnt_rootvnode); + } + + /* + * Do a lookup for "numfiles" in the ".pnfshide" dir + * of the file system. + */ + if (error == 0) { + cn.cn_nameiop = LOOKUP; + cn.cn_lkflags = LK_SHARED; + cn.cn_flags = ISLASTCN | NOFOLLOW | LOCKLEAF | NOCROSSMOUNT; + cn.cn_cred = cred; + cn.cn_nameptr = numfiles_name; + cn.cn_namelen = sizeof(numfiles_name) - 1; + error = VOP_LOOKUP(vp, &numfiledvp, &cn); + vput(vp); + if (error == 0) + VOP_UNLOCK(numfiledvp); + } + lockmgr(&mp->mnt_explock, LK_SHARED, NULL); + nep = mp->mnt_export; + if (nep != NULL) + (void)vfs_netexport_acquire(nep); + lockmgr(&mp->mnt_explock, LK_RELEASE, NULL); + + /* + * The states for ne_pnfsnumfile are as follows: + * NULL - Initial state for normal operation. + * PNFSD_START - Transition state when the + * replenisher kernel process is starting up. + * non-NULL valid pointer - Points to the directory vnode for the + * "numfiles" directory. + * PNFSD_STOP - Transition state when the + * replenisher kernel process is shutting down. + * PNFSD_STOPPED - Replenisher kernel process has stopped and + * vrele()'d the "numfiles" directory vnode. + */ + if (error != 0 || nep == NULL) { + if (error == 0) + error = ENOENT; + goto out; + } + MNTEXP_LOCK(nep); + KASSERT(nep->ne_pnfsnumfile == PNFSD_START | + nep->ne_pnfsnumfile == PNFSD_STOP, + ("nfsvno_pnfsreplenish: ne_pnfsnumfile not PNFSD_START/STOP")); + if (nep->ne_pnfsnumfile == PNFSD_START) { + nep->ne_pnfsnumfile = numfiledvp; + wakeup(&nep->ne_pnfsnumfile); + } + MNTEXP_UNLOCK(nep); + + VATTR_NULL(&va); + va.va_mode = 0644; + va.va_type = VREG; + timo = hz / 1000; + if (timo == 0) + timo = 1; + cnt = 5; + back = false; + use_same_num = false; + prevcnt = 0; + for (i = 0; i < 4; i++) + prevrate[i] = 1; + prevsec = 0; + averate = 100; + last_back = next_back = next_forw = UINT_MAX; + + /* Loop around sleeping and then doing (A) or (B) */ + for (;;) { + /* Sample replenish rate once/sec. */ + getnanouptime(&ts); + if (ts.tv_sec != prevsec) { + /* Calculate a moving ave. of creates/sec. */ + prevsec = ts.tv_sec; + for (i = 0; i < 3; i++) + prevrate[i + 1] = prevrate[i]; + prevrate[0] = atomic_load_int(&nep->ne_pnfsnumcnt) - + prevcnt; + if (prevrate[0] < 1) + prevrate[0] = 1; + prevcnt = atomic_load_int(&nep->ne_pnfsnumcnt); + averate = prevrate[0] * 4 / 10 + prevrate[1] * 3 / 10 + + prevrate[2] * 2 / 10 + prevrate[3] / 10; + if (averate < 1) + averate = 1; + averate *= 2; + } + + if (cnt == 0) { + error = tsleep(&mp->mnt_export, PVFS, "pnfsrpl", timo); + if (error == ETIMEDOUT || error == EAGAIN) { + if (!back) + next_back = last_back; + back = true; + timo = hz / averate; + if (timo == 0) + timo = 1; + } else { + if (back) { + next_forw = UINT_MAX; + last_back = next_back; + } + back = false; + cnt = nfsrv_pnfsforwcnt; + timo = hz / 1000; + if (timo == 0) + timo = 1; + nfsrv_pnfsswitchforw++; + } + } + + /* Check for exports having gone away. */ + if (mp->mnt_export == NULL) + break; + /* And check for replenisher being stopped. */ + MNTEXP_LOCK(nep); + if (nep->ne_pnfsnumfile != PNFSD_START && + nep->ne_pnfsnumfile != PNFSD_STOP) { + KASSERT(numfiledvp == nep->ne_pnfsnumfile, + ("nfsvno_pnfsreplenish: numfiledvp changed")); + MNTEXP_UNLOCK(nep); + } else { + MNTEXP_UNLOCK(nep); + break; + } + + if (back) { + /* This is (A) in this function's comment above. */ + error = vn_start_write(numfiledvp, &temp_mp, V_NOWAIT); + if (error == 0) + error = vn_lock(numfiledvp, LK_EXCLUSIVE | + LK_NOWAIT); + if (error != 0 && temp_mp != NULL) + vn_finished_write(temp_mp); + if (error == EBUSY || error == EWOULDBLOCK) + continue; + if (error != 0) + break; + if (next_back == UINT_MAX) { + if (nep->ne_pnfsnextfile == 0) + next_back = nfsrv_pnfsmaxnumfiles - 1; + else + next_back = nep->ne_pnfsnextfile - 1; + } else if (!use_same_num) { + if (next_back == 0) + next_back = nfsrv_pnfsmaxnumfiles - 1; + else + next_back--; + } + snprintf(name, sizeof(name), "%d", next_back); + } else { + /* This is (B) in this function's comment, above. */ + vn_start_write(numfiledvp, &temp_mp, V_WAIT); + error = vn_lock(numfiledvp, LK_EXCLUSIVE); + if (error != 0 && temp_mp != NULL) + vn_finished_write(temp_mp); + if (error != 0) + break; + if (next_forw == UINT_MAX) + next_forw = nep->ne_pnfsnextfile; + else if (!use_same_num) + next_forw = (next_forw + 1) % + nfsrv_pnfsmaxnumfiles; + snprintf(name, sizeof(name), "%d", next_forw); + } + use_same_num = false; + + /* Do a lookup for the file. */ + cn.cn_nameiop = CREATE; + cn.cn_lkflags = LK_EXCLUSIVE; + cn.cn_flags = ISLASTCN | NOFOLLOW | LOCKLEAF | LOCKPARENT | + NOCROSSMOUNT | MAKEENTRY; + cn.cn_cred = cred; + cn.cn_nameptr = name; + cn.cn_namelen = strlen(name); + vref(numfiledvp); + error = VOP_LOOKUP(numfiledvp, &vp, &cn); + if (error == 0) { + VOP_VPUT_PAIR(numfiledvp, &vp, true); + if (temp_mp != NULL) + vn_finished_write(temp_mp); + if (back) { + last_back = next_back = UINT_MAX; + timo = hz / 10; + if (timo == 0) + timo = 1; + } else { + timo = hz / 100; + if (timo == 0) + timo = 1; + } + cnt = 0; + continue; + } else if (error != ENOENT && error != EJUSTRETURN) { + VOP_VPUT_PAIR(numfiledvp, NULL, true); + if (temp_mp != NULL) + vn_finished_write(temp_mp); + if (error == ERELOOKUP) { + use_same_num = true; + continue; + } + printf("nfsvno_pnfsreplenish: lookup failed %d\n", + error); + break; + } + + /* Create the numfile and its DS file(s). */ + error = VOP_CREATE(numfiledvp, &vp, &cn, &va); + if (error == 0) { + /* + * Create a data file on a DS for a pNFS + * server. This function just returns if + * not running a pNFS DS or the creation + * fails. + */ + nfsrv_pnfscreate(vp, &va, cred, curthread); + } else + printf("nfsvno_pnfsreplenish: vop_create failed %d\n", + error); + VOP_VPUT_PAIR(numfiledvp, error == 0 ? &vp : NULL, true); + if (temp_mp != NULL) + vn_finished_write(temp_mp); + cnt = cnt > 0 ? cnt - 1 : 0; + } +out: + if (numfiledvp != NULL) + vrele(numfiledvp); + if (nep != NULL) { + MNTEXP_LOCK(nep); + nep->ne_pnfsnumfile = PNFSD_STOPPED; + wakeup(&mp->mnt_explock); + MNTEXP_UNLOCK(nep); + vfs_netexport_release(nep); + } else + wakeup(&mp->mnt_explock); + kproc_exit(0); +} + +/* + * Do a lookup of a file in the .numfiles directory. + * If successful, use VOP_SETATTR() to set the uid/gid/mode and + * then VOP_LINK()/VOP_REMOVE() the num file. + * Return ENOENT to indicate that nfsvno_open() should fall back to + * doing VOP_CREATE(), other errors for failure. + * XXX This code probably is not correct for a stacked file + * system, but should never be used for that case. + */ +static int +nfsvno_pnfsusenumfile(struct nameidata *ndp, struct vattr *vap) +{ + struct componentname cn; + struct vattr va; + char name[11]; + gid_t gid; + struct ucred *cred, *savcred; + struct vnode *numfiledvp; + struct mount *mp; + struct netexport *nep; + u_int nextf; + int error; + + cred = newnfs_getcred(); + /* + * Not sure if this is necessary. If all VOP calls use + * cn_cred, it is not. + */ + savcred = curthread->td_ucred; + curthread->td_ucred = cred; + + /* + * If the replenish kernel process is not yet running, + * start it up now. + */ + numfiledvp = NULL; + ndp->ni_vp = NULL; + mp = ndp->ni_dvp->v_mount; + lockmgr(&mp->mnt_explock, LK_SHARED, NULL); + nep = mp->mnt_export; + if (nep == NULL) { + error = ENOENT; + lockmgr(&mp->mnt_explock, LK_RELEASE, NULL); + goto out; + } + (void)vfs_netexport_acquire(nep); + lockmgr(&mp->mnt_explock, LK_RELEASE, NULL); + MNTEXP_LOCK(nep); + if (nep->ne_pnfsnumfile == NULL) { + /* Mark kernel process startup in-progress. */ + nep->ne_pnfsnumfile = PNFSD_START; + MNTEXP_UNLOCK(nep); + + /* Create the replenish kernel process. */ + error = kproc_create(nfsvno_pnfsreplenish, mp, NULL, RFHIGHPID, + 0, "pnfsreplenish"); + if (error != 0) { + printf("nfsvno_pnfsusenumfile: replenish won't start" + " %d\n", error); + error = ENOENT; + goto out; + } + + /* And wait for it to set up ne_pnfsnumfile. */ + MNTEXP_LOCK(nep); + (void)msleep(&nep->ne_pnfsnumfile, MNTEXP_MTX(nep), PVFS, + "pnfsnumf", hz); + } + + if (nep->ne_pnfsnumfile == NULL || + nep->ne_pnfsnumfile == PNFSD_START || + nep->ne_pnfsnumfile == PNFSD_STOP) { + MNTEXP_UNLOCK(nep); + error = ENOENT; + goto out; + } else { + numfiledvp = nep->ne_pnfsnumfile; + MNTEXP_UNLOCK(nep); + /* + * Check to ensure the new file is not in ".pnfshide/numfiles". + */ + if (numfiledvp == ndp->ni_dvp) { + error = ENOENT; + numfiledvp = NULL; + goto out; + } + } + + error = vn_lock(numfiledvp, LK_EXCLUSIVE); + if (error != 0) { + error = ENOENT; + numfiledvp = NULL; + goto out; + } + vref(numfiledvp); + + /* Get the next filenum. */ + nextf = nep->ne_pnfsnextfile; + snprintf(name, sizeof(name), "%d", nextf); + + /* Now, look up the numbered file. */ + cn.cn_nameiop = DELETE; + cn.cn_lkflags = LK_EXCLUSIVE; + cn.cn_flags = ISLASTCN | NOFOLLOW | LOCKLEAF | LOCKPARENT | + NOCROSSMOUNT; + cn.cn_cred = cred; + cn.cn_nameptr = name; + cn.cn_namelen = strlen(name); + error = VOP_LOOKUP(numfiledvp, &ndp->ni_vp, &cn); + if (error != 0) { + nfsrv_pnfsnumfilemiss++; + VOP_UNLOCK(numfiledvp); + ndp->ni_vp = NULL; + if (error == ENOENT || error == EJUSTRETURN) + wakeup(&mp->mnt_export); + else + VOP_VPUT_PAIR(ndp->ni_dvp, NULL, true); + goto out; + } + + /* + * Set the new file's attributes to what VOP_CREATE() would + * have set them to. + */ + gid = GID_NOGROUP; + if (vap->va_gid == VNOVAL && + VOP_GETATTR(ndp->ni_dvp, &va, cred) == 0) + gid = va.va_gid; + VATTR_NULL(&va); + va.va_gid = gid; + va.va_uid = ndp->ni_cnd.cn_cred->cr_uid; + va.va_mode = vap->va_mode; + error = VOP_SETATTR(ndp->ni_vp, &va, cred); + if (error != 0) { + VOP_UNLOCK(numfiledvp); + VOP_VPUT_PAIR(ndp->ni_dvp, &ndp->ni_vp, true); + ndp->ni_vp = NULL; + printf("nfsvno_pnfsusenumfile: setattr failed %d\n", + error); + if (error == ENOENT) + error = ENXIO; + goto out; + } + + /* + * Link the numbered file to the name VOP_CREATE() would have + * created in the correct directory and then VOP_REMOVE() the + * numbered file. + * Use VOP_LINK()/VOP_REMOVE() so that the numbered file + * directory can remain locked. + */ + error = VOP_LINK(ndp->ni_dvp, ndp->ni_vp, &ndp->ni_cnd); + /* Remove the file in .numfiles. */ + if (error == 0) { + nep->ne_pnfsnextfile = (nextf + 1) % + nfsrv_pnfsmaxnumfiles; + error = VOP_REMOVE(numfiledvp, ndp->ni_vp, &cn); + if (error != 0) { + /* Shut down the numfiles stuff. */ + MNTEXP_LOCK(nep); + nep->ne_pnfsnumfile = PNFSD_STOP; + MNTEXP_UNLOCK(nep); + printf("nfsvno_pnfsusenumfile: remove failed " + "%d %s\n", error, name); + } + } + VOP_UNLOCK(numfiledvp); + if (error != 0) { + VOP_VPUT_PAIR(ndp->ni_dvp, &ndp->ni_vp, true); + ndp->ni_vp = NULL; + } else { + atomic_add_int(&nep->ne_pnfsnumcnt, 1); + VOP_VPUT_PAIR(ndp->ni_dvp, &ndp->ni_vp, false); + } + if (error == ENOENT) + error = ENXIO; + +out: + if (numfiledvp != NULL) + vrele(numfiledvp); + if (nep != NULL) + vfs_netexport_release(nep); + curthread->td_ucred = savcred; /* Reset the thread's cred. */ + NFSFREECRED(cred); + return (error); +} + /* * Do the vnode op stuff for Open. Similar to nfsvno_createsub(), but * must handle nfsrv_opencheck() calls after any other access checks. @@ -2048,6 +2584,7 @@ nfsvno_open(struct nfsrv_descript *nd, struct nameidata *ndp, struct thread *p = curthread; uint32_t oldrepstat; u_long savflags; + int error; if (ndp->ni_vp == NULL) { /* @@ -2062,30 +2599,50 @@ nfsvno_open(struct nfsrv_descript *nd, struct nameidata *ndp, } if (!nd->nd_repstat) { if (ndp->ni_vp == NULL) { - /* - * Most file systems ignore va_flags for - * VOP_CREATE(), however setting va_flags - * for VOP_CREATE() causes problems for ZFS. - * So disable them and let nfsrv_fixattr() - * do them, as required. - */ - savflags = nvap->na_flags; - nvap->na_flags = VNOVAL; - nd->nd_repstat = VOP_CREATE(ndp->ni_dvp, - &ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr); - /* For a pNFS server, create the data file on a DS. */ - if (nd->nd_repstat == 0) { + struct sockaddr_in *sin; + struct sockaddr_in6 *sin6; + bool try_pnfs; + + sin = (struct sockaddr_in *)nd->nd_nam; + sin6 = (struct sockaddr_in6 *)nd->nd_nam; + error = ENOENT; + try_pnfs = !TAILQ_EMPTY(&nfsrv_devidhead); + + if (try_pnfs && !(sin->sin_family == AF_INET && + IN_LOOPBACK(ntohl(sin->sin_addr.s_addr))) && + !(sin6->sin6_family == AF_INET6 && + IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr))) { + error = nfsvno_pnfsusenumfile(ndp, + &nvap->na_vattr); + if (error != ENOENT) + nd->nd_repstat = error; + } + if (error == ENOENT) { /* - * Create a data file on a DS for a pNFS server. - * This function just returns if not - * running a pNFS DS or the creation fails. + * Most file systems ignore va_flags for + * VOP_CREATE(), however setting va_flags + * for VOP_CREATE() causes problems for ZFS. + * So disable them and let nfsrv_fixattr() + * do them, as required. */ - nfsrv_pnfscreate(ndp->ni_vp, &nvap->na_vattr, - cred, p); + savflags = nvap->na_flags; + nvap->na_flags = VNOVAL; + nd->nd_repstat = VOP_CREATE(ndp->ni_dvp, + &ndp->ni_vp, &ndp->ni_cnd, &nvap->na_vattr); + if (try_pnfs && nd->nd_repstat == 0) { + /* + * Create a data file on a DS for a pNFS + * server. This function just returns if + * not running a pNFS DS or the creation + * fails. + */ + nfsrv_pnfscreate(ndp->ni_vp, + &nvap->na_vattr, cred, p); + } + VOP_VPUT_PAIR(ndp->ni_dvp, nd->nd_repstat == 0 ? + &ndp->ni_vp : NULL, false); + nvap->na_flags = savflags; } - nvap->na_flags = savflags; - VOP_VPUT_PAIR(ndp->ni_dvp, nd->nd_repstat == 0 ? - &ndp->ni_vp : NULL, false); nfsvno_relpathbuf(ndp); if (!nd->nd_repstat) { if (*exclusive_flagp != NFSV4_EXCLUSIVE_NONE) { diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 4d724a0f1c38..f123c59981c4 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -66,6 +66,10 @@ #include #include +#include +#include +#include + #include #include @@ -77,6 +81,7 @@ static int vfs_domount(struct thread *td, const char *fstype, char *fspath, uint64_t fsflags, bool only_export, bool jail_export, struct vfsoptlist **optlist); static void free_mntarg(struct mntarg *ma); +static void pnfsd_waitreplenish(struct mount *mp); static int usermount = 0; SYSCTL_INT(_vfs, OID_AUTO, usermount, CTLFLAG_RW, &usermount, 0, @@ -2386,6 +2391,10 @@ dounmount(struct mount *mp, uint64_t flags, struct thread *td) mp->mnt_flag &= ~MNT_ASYNC; mp->mnt_kern_flag &= ~MNTK_ASYNC; MNT_IUNLOCK(mp); + + /* Wait for any replenish kernel process to terminate. */ + pnfsd_waitreplenish(mp); + vfs_deallocate_syncvnode(mp); error = VFS_UNMOUNT(mp, flags); vn_finished_write(mp); @@ -3240,3 +3249,28 @@ resume_all_fs(void) } mtx_unlock(&mountlist_mtx); } + +static void +pnfsd_waitreplenish(struct mount *mp) +{ + struct netexport *nep; + + lockmgr(&mp->mnt_explock, LK_SHARED, NULL); + nep = mp->mnt_export; + if (nep != NULL) { + refcount_acquire(&nep->ne_ref); + lockmgr(&mp->mnt_explock, LK_RELEASE, NULL); + MNTEXP_LOCK(nep); + if (nep->ne_pnfsnumfile != NULL && + nep->ne_pnfsnumfile != PNFSD_STOPPED) { + nep->ne_pnfsnumfile = PNFSD_STOP; + wakeup(&mp->mnt_export); + while (nep->ne_pnfsnumfile != PNFSD_STOPPED) + (void)msleep(&mp->mnt_explock, MNTEXP_MTX(nep), + PVFS, "pnfsw", hz); + } + MNTEXP_UNLOCK(nep); + vfs_netexport_release(nep); + } else + lockmgr(&mp->mnt_explock, LK_RELEASE, NULL); +} From nobody Sat Jun 20 19:01:51 2026 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 4gjP2m05y5z6hN6w for ; Sat, 20 Jun 2026 19:01: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjP2l5wbhz3qlj for ; Sat, 20 Jun 2026 19:01:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982111; 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=AIYQYdQTuKzKpXTXUduq7qPeyVXmB4G5qn0KVOnuuMQ=; b=bolCNitoJARSaYsv2e2s3pcFbDKlJSD8OzO0yKa96FsT4tzRRboqpO5zmSsOX0TbsG2VkX BHIfOfUAMeGLHMvYC+rbPn+0xaCd6FxsWJlLstStLE+eBxo2AIPHylz6XvUNunN5V2fEZy Qs4PnaJHyH9X75qAUZC4VPzNQT87fOoPmOsKxnWpJk/qR8EBdEGwPT/2urfv4tVi28s7Fb YgwXUuOBTDWMh913p+rOOo9MVkbskQ+qvdsjObh7vR7dFfBek/E49sTZYbZaiROGjRusJ1 Bd15ZuVWgWESIY2M8x/CbXcPpS6YRrmXUI7YC2pkqbcTeLjIlOUffaKNzfry6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781982111; a=rsa-sha256; cv=none; b=dd8pMMrobfdW+n/Mwglh33yVwkakM05PLnoi0MMNmir/v3iMfFPHZEdtmms/HAlyu9cURF Jk2HqD0xtFdDb6c0yr//YKasjVF6gTjS+i5JB4ZuEPCjAqeIWYJh5gyUHy+mCspEWbC5aa FOgd5u0N1Myo7kQKy2gybFeJcOjOU+N6bYIpceOXl+b5gilvZO6KtL1e3ZDc3iv49kWes+ WMSD6XORb5HkqBPU3Ar8p1DTZw439xZ5vZZV/T/+0GADU7dvsl9ikD5RkqMrm729x5C34X A2JP6PIJ1GxWjOvYKt71LGqh+HOTJakGQo1KR7h6LyLjLD/p6QZcpCDnj55eZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982111; 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=AIYQYdQTuKzKpXTXUduq7qPeyVXmB4G5qn0KVOnuuMQ=; b=JWxHqYQ1NrxgYpzQSu6UXbRohu48GNmUr4/4UBO2moa3FJkkxv8wHuY6EOjKzHCHyNTmZQ G3DZzICQVJRU9UZniXD2+11+NNQpxlJxvrdt7SSMopcXT95fkFd/x2b9NOmZbubtuXsrC3 1fEkBJtgo5CDmRjzKyO+AYzvb/sPz0Fa5qUXKQcQj0aIF7+AqLyjmq6GYgBZfy8hWJSP07 mZMjGml9G/KPRS8ltmHTtHdmA9IYzJDaWJmfJh4OWo0Rk13A3x1dbIzGfda6mUIS617wNp 4iN77xoy3CodZgzbw5krnJ1ryCcJMSYSpSFOW1EEDwfn1YV76csMnUiWKG49Gw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjP2l50XFzjrq for ; Sat, 20 Jun 2026 19:01:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 32a3e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 19:01:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 09bb0b0d1396 - main - sh: Belatedly bump manual page date 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09bb0b0d13968163c7394e9168491b16607fc2e7 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 19:01:51 +0000 Message-Id: <6a36e39f.32a3e.765243dd@gitrepo.freebsd.org> The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=09bb0b0d13968163c7394e9168491b16607fc2e7 commit 09bb0b0d13968163c7394e9168491b16607fc2e7 Author: Dag-Erling Smørgrav AuthorDate: 2026-06-20 19:01:24 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-06-20 19:01:24 +0000 sh: Belatedly bump manual page date Fixes: 556e793d803e ("sh: Improve function documentation") --- bin/sh/sh.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index e76ddc80187a..a19aa7459896 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -41,7 +41,7 @@ .\" the referee document. The original Standard can be obtained online at .\" http://www.opengroup.org/unix/online.html. .\" -.Dd February 17, 2026 +.Dd June 16, 2026 .Dt SH 1 .Os .Sh NAME From nobody Sat Jun 20 19:05:33 2026 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 4gjP7168Kqz6hNMQ for ; Sat, 20 Jun 2026 19:05: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjP713gBVz3sVR for ; Sat, 20 Jun 2026 19:05:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982333; 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=H3qgXgi2EUR9AnhZM3rI1uwvLiqODeNuSnXvbInnqBw=; b=mrLm7p7H3RUL0VP9X/akB9kye0vShXMgAdZSHzYHtZualuM+Q+iTcL+fOdQWSoimOAbWKn UGl/0HDN3qiprzW8a+jsHzNJhI6PuDYhyWjtORFvp3HbOaZ8mulGNKWXS6wEaJlwaSHLVn P16/Nv2pqqwNZ5pYtjjb3Sy8mZB1W/fmXmu5C8Mox8tTSGYsb1nVMY3rkM+O8G7BcfvwfC gHz7WNivbLZqEiAZUOK+0cjpgXTQ0ubZfI/QXLKlflHgFtFpxFqTNhnM+VXQo0dsR6EgPQ vvLa8zt3W829F4EswL5cvm029cM47+FH+fhx9KMhWSe09N+Z42i1QDjMkiKl0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781982333; a=rsa-sha256; cv=none; b=cMjuPPr8WwHWYiZoe39zQnukqJtsexrg1B6DjRigdirr7+aByvCvOlpAnqrx/hEZBzCR9/ MyCbShAj/IO2YsX8qsJmWYDzL2DpF1K90clH6HawjpFj6jBiH+9al4KGhQO45WrpqrNdij OX9wnIxRhYwNkTfT8yCXekirgfpgPvzrQcfuP9NCeS8WUjiS2nK+wjZGs3ZS6066T1Xpqa cRkpJSqyhUDYGne9yAF+D8KCv0DyCuddXabbSW683rxvxtdejCwDKea+FUrDD6tjI+ENst icN0flTZ0eQ0TvJ8dqCRC+W96Yl0HZbqVCxgHzRNAgzl9xZr6P7+SsZF12UExQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982333; 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=H3qgXgi2EUR9AnhZM3rI1uwvLiqODeNuSnXvbInnqBw=; b=ynaFjtnZQtbrBF4TQF2m8BHpipEYM3/OD+pUbfOHXbgYfngEu6h4gO3IPoyX+B+g4sQOhm 3CvPYOlC2m3pHuzShSf5d5UUKbQxPFo6FdoWSjK3DYtz473GqJv3gC3iy7ad/DfkGFCU92 VoOPqgfMlSWmxVnF8x7pcelyuqX1jMWPRpk9s0Tk80FCglby8dk+QfpKQaNBIQftfZoxP5 rv3+m71yGuClbsjL6IRYKCTZEinM1CN43o6lJvnBQqoV2FkgwpsQhW59M3/dqaJGZe8+Jl Gss7m+twIJowloHOYQyZGYjNXPSG/G9sgpu+9fDAGAssSaZDhB2Qj1TgiqCCKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjP711tWxzkTn for ; Sat, 20 Jun 2026 19:05:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3361d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 19:05:33 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: bbb37ddf3669 - main - sound: Use and lock only the appropriate channel in dsp_mmap_single() 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bbb37ddf3669f77d78446b9f1e37f58c63dc0a1c Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 19:05:33 +0000 Message-Id: <6a36e47d.3361d.28199768@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=bbb37ddf3669f77d78446b9f1e37f58c63dc0a1c commit bbb37ddf3669f77d78446b9f1e37f58c63dc0a1c Author: Christos Margiolis AuthorDate: 2026-06-12 06:14:05 +0000 Commit: Christos Margiolis CommitDate: 2026-06-20 19:04:49 +0000 sound: Use and lock only the appropriate channel in dsp_mmap_single() dsp_mmap_single() mmaps one of the channels associated with a dsp_cdevpriv, based on the nprot argument. PROT_WRITE and PROT_READ|PROT_WRITE select the output channel for mmaping, and PROT_READ the input one. Instead of locking and modifying the flags of all dsp_cdevpriv channels, do it only for the one we actually use. While here, retire the now unused dsp_lock_chans() and dsp_unlock_chans(). Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, kib Pull-Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/30 --- sys/dev/sound/pcm/dsp.c | 57 +++++++++++++++---------------------------------- 1 file changed, 17 insertions(+), 40 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index df9e241881c0..337eb4e175b2 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -144,24 +144,6 @@ dsp_destroy_dev(device_t dev) destroy_dev(d->dsp_dev); } -static void -dsp_lock_chans(struct dsp_cdevpriv *priv, uint32_t prio) -{ - if (priv->rdch != NULL && DSP_F_READ(prio)) - CHN_LOCK(priv->rdch); - if (priv->wrch != NULL && DSP_F_WRITE(prio)) - CHN_LOCK(priv->wrch); -} - -static void -dsp_unlock_chans(struct dsp_cdevpriv *priv, uint32_t prio) -{ - if (priv->rdch != NULL && DSP_F_READ(prio)) - CHN_UNLOCK(priv->rdch); - if (priv->wrch != NULL && DSP_F_WRITE(prio)) - CHN_UNLOCK(priv->wrch); -} - static int dsp_chn_alloc(struct snddev_info *d, struct pcm_channel **ch, int direction, int flags, struct thread *td) @@ -1973,7 +1955,7 @@ dsp_mmap_single(struct cdev *cdev, vm_ooffset_t *offset, struct dsp_mmap_handle *handle; struct dsp_cdevpriv *priv; struct snddev_info *d; - struct pcm_channel *wrch, *rdch, *c; + struct pcm_channel *c; int err; if (*offset >= *offset + size) @@ -1987,11 +1969,6 @@ dsp_mmap_single(struct cdev *cdev, vm_ooffset_t *offset, SV_CURPROC_ABI() != SV_ABI_LINUX))) return (EINVAL); - /* - * PROT_READ (alone) selects the input buffer. - * PROT_WRITE (alone) selects the output buffer. - * PROT_WRITE|PROT_READ together select the output buffer. - */ if ((nprot & (PROT_READ | PROT_WRITE)) == 0) return (EINVAL); @@ -2003,27 +1980,27 @@ dsp_mmap_single(struct cdev *cdev, vm_ooffset_t *offset, PCM_GIANT_ENTER(d); - dsp_lock_chans(priv, FREAD | FWRITE); - wrch = priv->wrch; - rdch = priv->rdch; - - c = ((nprot & PROT_WRITE) != 0) ? wrch : rdch; - if (c == NULL || (c->flags & CHN_F_MMAP_INVALID) || - (*offset + size) > c->bufsoft->allocsize || - (wrch != NULL && (wrch->flags & CHN_F_MMAP_INVALID)) || - (rdch != NULL && (rdch->flags & CHN_F_MMAP_INVALID))) { - dsp_unlock_chans(priv, FREAD | FWRITE); + /* + * PROT_READ (alone) selects the input buffer. + * PROT_WRITE (alone) selects the output buffer. + * PROT_WRITE|PROT_READ together select the output buffer. + */ + c = ((nprot & PROT_WRITE) != 0) ? priv->wrch : priv->rdch; + if (c == NULL) { PCM_GIANT_EXIT(d); return (EINVAL); } - if (wrch != NULL) - wrch->flags |= CHN_F_MMAP; - if (rdch != NULL) - rdch->flags |= CHN_F_MMAP; - + CHN_LOCK(c); + if ((c->flags & CHN_F_MMAP_INVALID) || + *offset + size > c->bufsoft->allocsize) { + CHN_UNLOCK(c); + PCM_GIANT_EXIT(d); + return (EINVAL); + } + c->flags |= CHN_F_MMAP; *offset = (uintptr_t)sndbuf_getbufofs(c->bufsoft, *offset); - dsp_unlock_chans(priv, FREAD | FWRITE); + CHN_UNLOCK(c); handle = malloc(sizeof(*handle), M_DEVBUF, M_WAITOK); handle->cdev = cdev; From nobody Sat Jun 20 19:05:34 2026 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 4gjP725zk6z6hMvg for ; Sat, 20 Jun 2026 19:05: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjP723Tfwz3sWb for ; Sat, 20 Jun 2026 19:05:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982334; 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=L1CgR2tUKBHOdkSMMFKoyBgbLFAasDy36fbtG64NrUg=; b=VEgwQImrPZTjt/11tpzeDCfi4cUCIgBbtge7OqnnzvlHjG+27ETUJncHhn1TSU0ktEZkr9 x3wwLtfuMSRG8Nj+t3LTt4XXxSFptWwsG6jIp0ENeVtAydAx90S8LSmfcXYB0fxvqD4wYr k0m4MZZiYZtnSSVGGZwDI5FnGlv/Qf1hyFPtfwQcuDKAly/fXRm1rylzMGGiYkfUWdZT9g 4B2pkR1FAhsQAZkVecy9JME/2qlDlttneQnbYyVeU5yxmg2Rq+d1SDPsLIcNzuIkK8U0Nm TivB7TeMqUACygwJMNDGHVKMS087SqgUzl1YLbXRcCoyaiaYgNfNQINqIGFSoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781982334; a=rsa-sha256; cv=none; b=YCHkAFGR9NPV3o0t3Oq/cjU2F2G4xd3FovKx1KCvHBr5BNVM63HqCJIrEAXTEu3TM08/B0 2zLM51sCGlA8VDAhreTAnf+SfuDvFUJD2JkJ/9XpmuSrKNNrIwBQA4BT+7I/wS+z8lJaPP KVRciaQsRSpimANmuhy1fmrpHiA23qM2ItTBxMymuyhh/ojp28M2btlu/4rT6dBuWyPfa4 96f41WIjmwUMthg6qc7XGeWmYmpLX8FUE12utkLHV/oWFQ+idBsWgJU2k4gSG8rOKDYGJr SAH5Vy6axNtJOqM2stIpoXIsID30FkWS/mfDl2ZOoJKYcFzF3INdgWBa5GGwSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982334; 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=L1CgR2tUKBHOdkSMMFKoyBgbLFAasDy36fbtG64NrUg=; b=uqrSlPMPBhbhHrx4P2ILamQeM7mZNFnOicuLeS/CQlysudBw5tmdRc69DYrv6FwoM/grsO jifKIIkaEw8HxR1Y8IK+dd+l81WrUKKy7GSUYPR4EmRoOVPLJxWn+nsDRNs0kliLmcsBFP hGABOpgJsk2jkk2xwroXllUbetBLCcbgmtv0xlWCLbDvt2wMLqNqwvRFnTrUkmWYD+KnuH PxsMeUh7JQkVUbn0PKwO7SK+mnGlW2R629ClcETCN7S9697aAz8CHPtDCdpaY5JeychY69 C5XvudEDK38/+/SFsjK5UY96pQIMx6hmenSmGSyn8ZKoyJ/L2E9L+8OK4wAcbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjP722H7Hzk6K for ; Sat, 20 Jun 2026 19:05:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33518 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 19:05:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 0c8147ae3bc1 - main - sound: Re-arrange a calculation in dsp_mmap_single() 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0c8147ae3bc1c7db95098fcc92fc2e86111f59d3 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 19:05:34 +0000 Message-Id: <6a36e47e.33518.1c7fbf19@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=0c8147ae3bc1c7db95098fcc92fc2e86111f59d3 commit 0c8147ae3bc1c7db95098fcc92fc2e86111f59d3 Author: Christos Margiolis AuthorDate: 2026-06-12 06:14:57 +0000 Commit: Christos Margiolis CommitDate: 2026-06-20 19:04:50 +0000 sound: Re-arrange a calculation in dsp_mmap_single() This makes it easier to read. No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, kib Pull-Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/30 --- sys/dev/sound/pcm/dsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 337eb4e175b2..52c30f847f01 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -1993,7 +1993,7 @@ dsp_mmap_single(struct cdev *cdev, vm_ooffset_t *offset, CHN_LOCK(c); if ((c->flags & CHN_F_MMAP_INVALID) || - *offset + size > c->bufsoft->allocsize) { + c->bufsoft->allocsize < *offset + size) { CHN_UNLOCK(c); PCM_GIANT_EXIT(d); return (EINVAL); From nobody Sat Jun 20 19:05:35 2026 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 4gjP7422SCz6hNSS for ; Sat, 20 Jun 2026 19:05: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjP735Kzvz3sc5 for ; Sat, 20 Jun 2026 19:05:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982335; 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=y76S6BGDSjpj7W1osja0VuP2h7ymakKyA86dkzaLPtc=; b=UmhcQycE5WnmjkcAVtiyVbF6stfW+2nGh+zEWcx7S8fwPRqB9bx3WSNjGlJjKN9icVWlUo V88p391jgModPjmxarmOM3kU8h0ypp821vB0rldqQR6AR2iHntEAzN5ztpfX0GeOv6dIl8 pOt52c/N4RMp9pJa2K4S3uMUeouYbvdquDeD3gI3wxF9S8Gg+JWdK5XKj/y5j+c0Hxo9FD xV2YFQACapXFUxUrlY0zFSCtu192LAWKtmPkZh3+kC2cj8cv1L4/lQW/WyxzwimLO/Qj3w bS7p+pH517K68TzODrtq0jn/I00sct/28hyt4r5yFhCUq7t6+fuVR95YhnLZeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781982335; a=rsa-sha256; cv=none; b=Np4x59962CjefL7mi4NHFkMCiY7rrV0LdrD130evf2gIhVxDyPYUP+Lkm55aZZCjH2/Cdx djful4JIX2/Eru6+eBkSivgRsIV2EaIVqpHwkARHviSydQkOedmeyIK257q/CgJZppxNOL jxygjAgE6VkuUwcqCtIBf1d9fHvK2O1oE2FLDr72Y8DfIRlS+/S3AJm5SZ7P0HuJ3DjC2q VquHSmhjPlSQeHCr8QIC3sztOqKdymEmO/juaiIU3ZZG4ZXlQk2iWkO+n16iUfclyCy903 4oiI2tehrBOFF/C9R1OhYF8Fi1Nsg1obXG5v3PYSyAICkwU6/oMRYJNkjRvc4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982335; 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=y76S6BGDSjpj7W1osja0VuP2h7ymakKyA86dkzaLPtc=; b=xrYUH309xPfu+VoGYOcXlzOdsMj3+1nuAk9QRrSv0JWaklQWXhpq5r9Tw5nxpCo7vq6JRK aLOMV23/+cV0uoGKrffFTVsF9dOkuid3pSrJsMsTtcYH6Yv9cjy2g+NqR0Z5TBKnSoZ6tD PUJYNBNdnq7hbX2+OOhBUfcsZZP+rfVj1MnD+ex2+cZRG5tL8M5PT4RPU1Zl22koIMPvoC kHbdq1BtsZPdl+JB2aR0Et06QrpIoupVYrAqlPXh9+Z6Mja6tp9xakGtwZbVq1oWTYbaxc pBHGzazn/x14WLwYwKVkur6D7XDYgSGaD35zkV3YkqNQoJwYujxZ8M9+iRPgJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjP7336Sjzk6L for ; Sat, 20 Jun 2026 19:05:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 325eb by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 19:05:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 47efa8128268 - main - sound: Handle CHN_F_MMAP_INVALID after cdev_pager_allocate() 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47efa8128268c35ac8f0a552d7a7ce43cd1c5925 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 19:05:35 +0000 Message-Id: <6a36e47f.325eb.486a92f4@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=47efa8128268c35ac8f0a552d7a7ce43cd1c5925 commit 47efa8128268c35ac8f0a552d7a7ce43cd1c5925 Author: Christos Margiolis AuthorDate: 2026-06-12 06:19:07 +0000 Commit: Christos Margiolis CommitDate: 2026-06-20 19:04:50 +0000 sound: Handle CHN_F_MMAP_INVALID after cdev_pager_allocate() We drop the channel lock to execute cdev_pager_allocate(). By the time we pick up the lock again, CHN_F_MMAP_INVALID might be set, so make sure we fail and free the vm handle. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, kib Pull-Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/30 --- sys/dev/sound/pcm/dsp.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 52c30f847f01..8bb07d87fac9 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -1957,6 +1957,7 @@ dsp_mmap_single(struct cdev *cdev, vm_ooffset_t *offset, struct snddev_info *d; struct pcm_channel *c; int err; + bool dealloc; if (*offset >= *offset + size) return (EINVAL); @@ -2008,12 +2009,25 @@ dsp_mmap_single(struct cdev *cdev, vm_ooffset_t *offset, *object = cdev_pager_allocate(handle, OBJT_DEVICE, &dsp_dev_pager_ops, size, nprot, *offset, curthread->td_ucred); PCM_GIANT_LEAVE(d); - if (*object == NULL) { + if (*object != NULL) { + err = 0; + dealloc = false; + CHN_LOCK(c); + if (c->flags & CHN_F_MMAP_INVALID) { + c->flags &= ~CHN_F_MMAP; + err = EINVAL; + dealloc = true; + } + CHN_UNLOCK(c); + /* We use a helper bool to keep the channel locking simpler. */ + if (dealloc) + vm_object_deallocate(*object); + } else { free(handle, M_DEVBUF); - return (EINVAL); + err = ENOMEM; } - return (0); + return (err); } static const char *dsp_aliases[] = { From nobody Sat Jun 20 19:05:36 2026 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 4gjP746Sfhz6hNCX for ; Sat, 20 Jun 2026 19:05: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjP744cxXz3sfS for ; Sat, 20 Jun 2026 19:05:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982336; 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=QHRWJUj0YuRHOeAiab5iYLl/j8KQauiwpJeMDpQKNxo=; b=WQenhu2ClCtGDpaXuvPXShxyq28zV2xK6A7imkLJDeTicCgPttjZ2k99bynnzHyzJRX38P UJZUw3XgA7M09RWlh7a9sbMD9IoJxbXoLPbV5DmSgeukQPoqVFQMwGzfPNnrbqRbaUXM+3 eAYxtcEGY48lKXo5JjjkCoKmeE8HG5d/SklQagAb7oGdOt2SNsWtz4Ip9TzWk0EQVIFJ8J URHyZXletvAchh/5o/3kgrTeedK12ILWf0O2P3cFCHrVZDF0RFajAHbYVYUakvtw+1B8FD Gub/vi/C8nj4jbtCrSWvuXbi+FwFPHrfEm3ULzLLN5oqs4qvoJ38NfBZx8gp/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781982336; a=rsa-sha256; cv=none; b=hr6dwsCai4N1DfC0Y7S1lvipzOkRg6QLWVawa7/pzvjMR9rWahTHnJQ/2GPkfp/zzhCYFL 9C+oIeaJNzLs3jPJlpCCaHbnog3aHvKhzcpknU82+N1eihYYzAGun9PMt7efGDETE+72K3 TvSDsmNMHon+FnvY7B/s5gXFsUMWxY9+9w0OuE9bfV1r9kD4EwZC9KAnEp9U8jZdp+SVKS 1NLcTV6dyPJ6iub/L2W37PIVKXgIfUpCWd7L05oaCJJ8ssIhfdGRyKZVhaErN5SOv6R8hK p8aE1Qc6kPeU17mBIydepFGCEB6rH+j1gpSvKPRdHKg8RHCXnWgwTW+bE7QbSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982336; 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=QHRWJUj0YuRHOeAiab5iYLl/j8KQauiwpJeMDpQKNxo=; b=x+I6cgymtted81X2/pswW0d/r2Kb0KWu9Aq7K5VDPoZUI2JXpvEGS9RaZPd83uMDO4D1qa PdLSF90kaV6S5x5W5Hy0EH5CcXOQxdllhWSg3y6ZTIqh3ZHy9OuvRI78fEhZLFIxrSt1Nm R1x7sTLOojpQb7E1COIWRPgD7DhAMoC9qkAwgt+CbvwV8upa1dUbob6aaE4HDEXzfKztp/ lZiXgDmslqJ3yHoq1fT4jeLSbDvWCTgsUVV45glbSVYWlGgUReVG5tlovAE9mVyStD4LMT 8ft8w34qmTrmc5B/G99VTNYc8dT3fgD2l6Rh8MdpCq8gW2al0nu4dzHos/UZAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjP743TDHzkZ8 for ; Sat, 20 Jun 2026 19:05:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 318f5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 19:05:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 730eaf466493 - main - sound tests: Add PROT_EXEC rejection test 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 730eaf466493315c1d1164eb6b59b14766f49322 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 19:05:36 +0000 Message-Id: <6a36e480.318f5.79b60374@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=730eaf466493315c1d1164eb6b59b14766f49322 commit 730eaf466493315c1d1164eb6b59b14766f49322 Author: Christos Margiolis AuthorDate: 2026-06-12 06:20:26 +0000 Commit: Christos Margiolis CommitDate: 2026-06-20 19:04:50 +0000 sound tests: Add PROT_EXEC rejection test Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, kib Pull-Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/30 --- tests/sys/sound/mmap.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/sys/sound/mmap.c b/tests/sys/sound/mmap.c index b44b16e7f312..e83193db9bc1 100644 --- a/tests/sys/sound/mmap.c +++ b/tests/sys/sound/mmap.c @@ -102,10 +102,38 @@ ATF_TC_BODY(mmap_buffer_lifetime, tc) ATF_REQUIRE(munmap(buf, len) == 0); } +ATF_TC(mmap_reject_prot_exec); +ATF_TC_HEAD(mmap_reject_prot_exec, tc) +{ + atf_tc_set_md_var(tc, "descr", "mmap PROT_EXEC rejection test"); + atf_tc_set_md_var(tc, "require.kmods", "snd_dummy"); +} + +ATF_TC_BODY(mmap_reject_prot_exec, tc) +{ + uint8_t *buf; + size_t len; + int fd; + + fd = open("/dev/dsp.dummy", O_RDWR); + ATF_REQUIRE_MSG(fd >= 0, FMT_ERR("open")); + + len = 8; + + buf = mmap(NULL, len, PROT_READ | PROT_EXEC | PROT_EXEC, MAP_SHARED, + fd, 0); + ATF_REQUIRE_MSG(buf == MAP_FAILED, FMT_ERR("mmap")); + + munmap(buf, len); + + close(fd); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, mmap_offset_overflow); ATF_TP_ADD_TC(tp, mmap_buffer_lifetime); + ATF_TP_ADD_TC(tp, mmap_reject_prot_exec); return (atf_no_error()); } From nobody Sat Jun 20 19:10:35 2026 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 4gjPDr23P6z6hNlb for ; Sat, 20 Jun 2026 19:10: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjPDq68WTz3tpd for ; Sat, 20 Jun 2026 19:10:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982635; 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; bh=aDI1NjLv9HHi2voHrm2RRJPeXQygTrWusPvlqmwVt3g=; b=YzTPBvdTnfwnViQBOCmhEOxpQaUmspjJ1L4fcSvMrb1hKs6zZjkMkXAa/c86wMHb1fRb/g nmCm5Jl061+kPzB7leUfD8yxQZms/chc833bltykEaJTNps/IhRorkkzhRFG2ap7y6pAUR fG+DLwn0EP3iEp44d0Hb1iekP6Qrye2T/Tn4I1LNApUDB+vmBBQEMzh//TUV/QbPS6vZQq pw4zGf9xaeRZ1obgMRhi1NRCpwFwG5sUVAQEHC0Oy7BZOl9MjI5sOdeELcfhWI9LNPDROm BTk+BPLzU6SCv4pNF53VsMLt5DE7os6cI4WkIi2WDrpvFSJmItwfjuyrL05TuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781982635; a=rsa-sha256; cv=none; b=fEujnt/sntoudHPpHA7l1/rBwuySXiSnrRlG24eKmzeAomkH4a7u8h7EkQMgh55eWh3PTf ydmaLKhha18N6Gi/W+/zsCZrXwt63FkLlcgk1QgW1d67V3AmMTYIpCa78gf6oYJShpgUsy D5G+QJyyXyfmBrHe1fTmJ/oDU1boADIdS/ajL/kwMrdddelqXL7EWsp0SbVUVTDUpVOUbS yVaHWV/CRQVEG8dXyjRviySrMOCFoh5VTlN+7RCh0pPJ2WXElCiA5udd/lcokJmryMHT+u FvopuhhcjxI4T9Z5NI4BZ5iXb1mcTM5zp/+/i5z+ibSSPyCgoYQRUGTX0OdZ/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982635; 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; bh=aDI1NjLv9HHi2voHrm2RRJPeXQygTrWusPvlqmwVt3g=; b=qVx9rprf53xsmWilr0j3luWHFm5Kx9yUHIXag1qDI8c1mDMSGWXxWemPj67PLZtH7mRavc 84T48zbWUwaeImy/zNs/gVR+F5Ar1ZSLkrVxnu+MdGbMvuMdIwVBcAeBJWk8+bbRTcdV+v B2nyBceplaG0bl2nrIN3SsDke32RV+Giu0Y7b/o2y8R62vWLjfaYArtAdZ247Lb3x8yT06 vx/Wh39IckkKWV4p1sUf2icVDdUbHzhduTfAgOps3fVM/J1D781Q2UgiTqLUgdz4WHHqWF MPrihh9jy1BT/nD3B7S63A5lYsVGt4h8dzjwl8v5rYtTW0F+tuHbyGsJA0pnPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjPDq4GNPzk37 for ; Sat, 20 Jun 2026 19:10:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3440e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 19:10:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Nick Pricenull From: Adrian Chadd Subject: git: b065af196fdc - main - aq(4): interrupt model and queue-count correctness 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: b065af196fdcab18d36caae214c905467723b3f1 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 19:10:35 +0000 Message-Id: <6a36e5ab.3440e.adbf0b2@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=b065af196fdcab18d36caae214c905467723b3f1 commit b065af196fdcab18d36caae214c905467723b3f1 Author: Nick Pricenull AuthorDate: 2026-06-20 19:02:34 +0000 Commit: Adrian Chadd CommitDate: 2026-06-20 19:10:15 +0000 aq(4): interrupt model and queue-count correctness Rework the MSI-X and queue-count handling to use the standard iflib interrupt model and to keep every ring serviced. - Cap isc_n{tx,rx}qsets_max at the RSS indirection-table size (HW_ATL_RSS_INDIRECTION_QUEUES_MAX, 8) instead of HW_ATL_B0_RINGS_MAX. RSS only steers RX traffic to eight rings, so on hosts with more CPUs the surplus TX rings never make progress: iflib flowid-steers TCP flows across every TX ring, and a flow landing on a surplus ring has its segments queued but never transmitted, hanging the connection. - Add a TX-specific ifdi_tx_queue_intr_enable that reads tx_rings[txqid]->msix. It was wired to the RX handler, which indexes rx_rings[] with the qid; safe only while tx_rings_count == rx_rings_count, otherwise the lookup walks past rx_rings[] and feeds a garbage msix value into the IRQ mask register. - Fix three MSI-X / admin-IRQ bugs: the TX softirq was attached to rx_rings[i]->irq (overwriting the RX handle and leaving the TX handle uninitialized); the admin-IRQ failure path dereferenced rx_rings[rx_rings_count], one past the end; and aq_linkstat_isr cleared the admin interrupt by writing the raw vector number instead of BIT(vector). - Allocate one IFLIB_INTR_RXTX vector per RX/TX queue pair like every other in-tree iflib driver (em/ix/igc, vmxnet3) instead of an IFLIB_INTR_RX vector per RX ring plus a hand-wrapped IFLIB_INTR_TX softirq per TX ring. iflib's iflib_fast_intr_rxtx() then services TX completions on the shared vector through isc_txd_credits_update(). Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57434 --- sys/dev/aq/aq_hw.c | 37 +++++++++++++++++++++---------------- sys/dev/aq/aq_hw.h | 7 +++++++ sys/dev/aq/aq_irq.c | 2 +- sys/dev/aq/aq_main.c | 36 +++++++++++++++++++++++++++--------- 4 files changed, 56 insertions(+), 26 deletions(-) diff --git a/sys/dev/aq/aq_hw.c b/sys/dev/aq/aq_hw.c index 5a45e61041c3..3e3e4a9d2f47 100644 --- a/sys/dev/aq/aq_hw.c +++ b/sys/dev/aq/aq_hw.c @@ -394,6 +394,7 @@ aq_hw_qos_set(struct aq_hw *hw) { uint32_t tc = 0U; uint32_t buff_size = 0U; + uint32_t n_tcs; unsigned int i_priority = 0U; int err = 0; @@ -409,19 +410,23 @@ aq_hw_qos_set(struct aq_hw *hw) tps_tx_pkt_shed_desc_tc_arb_mode_set(hw, 0U); tps_tx_pkt_shed_data_arb_mode_set(hw, 0U); - tps_tx_pkt_shed_tc_data_max_credit_set(hw, 0xFFF, 0U); - tps_tx_pkt_shed_tc_data_weight_set(hw, 0x64, 0U); - tps_tx_pkt_shed_desc_tc_max_credit_set(hw, 0x50, 0U); - tps_tx_pkt_shed_desc_tc_weight_set(hw, 0x1E, 0U); - - /* Tx buf size */ - buff_size = AQ_HW_TXBUF_MAX; - - tpb_tx_pkt_buff_size_per_tc_set(hw, buff_size, tc); - tpb_tx_buff_hi_threshold_per_tc_set(hw, - (buff_size * (1024 / 32U) * 66U) / 100U, tc); - tpb_tx_buff_lo_threshold_per_tc_set(hw, - (buff_size * (1024 / 32U) * 50U) / 100U, tc); + /* One TC per active 8-ring group; share the buffer across them. */ + n_tcs = howmany(hw->tx_rings_count, HW_ATL_B0_RINGS_PER_TC); + n_tcs = MIN(MAX(n_tcs, 1U), HW_ATL_B0_TCS_MAX); + buff_size = AQ_HW_TXBUF_MAX / n_tcs; + + for (tc = 0; tc < n_tcs; tc++) { + tps_tx_pkt_shed_tc_data_max_credit_set(hw, 0xFFF, tc); + tps_tx_pkt_shed_tc_data_weight_set(hw, 0x64, tc); + tps_tx_pkt_shed_desc_tc_max_credit_set(hw, 0x50, tc); + tps_tx_pkt_shed_desc_tc_weight_set(hw, 0x1E, tc); + + tpb_tx_pkt_buff_size_per_tc_set(hw, buff_size, tc); + tpb_tx_buff_hi_threshold_per_tc_set(hw, + AQ_BUF_THRESHOLD(buff_size, 66U), tc); + tpb_tx_buff_lo_threshold_per_tc_set(hw, + AQ_BUF_THRESHOLD(buff_size, 50U), tc); + } /* QoS Rx buf size per TC */ tc = 0; @@ -429,13 +434,13 @@ aq_hw_qos_set(struct aq_hw *hw) rpb_rx_pkt_buff_size_per_tc_set(hw, buff_size, tc); rpb_rx_buff_hi_threshold_per_tc_set(hw, - (buff_size * (1024U / 32U) * 66U) / 100U, tc); + AQ_BUF_THRESHOLD(buff_size, 66U), tc); rpb_rx_buff_lo_threshold_per_tc_set(hw, - (buff_size * (1024U / 32U) * 50U) / 100U, tc); + AQ_BUF_THRESHOLD(buff_size, 50U), tc); /* QoS 802.1p priority -> TC mapping */ for (i_priority = 8U; i_priority--;) - rpf_rpb_user_priority_tc_map_set(hw, i_priority, 0U); + rpf_rpb_user_priority_tc_map_set(hw, i_priority, 0U); err = aq_hw_err_from_flags(hw); AQ_DBG_EXIT(err); diff --git a/sys/dev/aq/aq_hw.h b/sys/dev/aq/aq_hw.h index bdd79871fd76..dd214aa3673b 100644 --- a/sys/dev/aq/aq_hw.h +++ b/sys/dev/aq/aq_hw.h @@ -169,6 +169,8 @@ struct aq_hw { uint32_t mbox_addr; struct aq_hw_fw_mbox mbox; + + uint32_t tx_rings_count; }; #define aq_hw_s aq_hw @@ -185,6 +187,8 @@ struct aq_hw { #define HW_ATL_B0_MTU_JUMBO 16352U #define HW_ATL_B0_TSO_SIZE (160*1024) #define HW_ATL_B0_RINGS_MAX 32U +#define HW_ATL_B0_TCS_MAX 4U /* 4-TC mode */ +#define HW_ATL_B0_RINGS_PER_TC (HW_ATL_B0_RINGS_MAX / HW_ATL_B0_TCS_MAX) #define HW_ATL_B0_LRO_RXD_MAX 16U #define AQ_HW_FW_SM_RAM 0x2U @@ -208,6 +212,9 @@ struct aq_hw { #define AQ_HW_TXBUF_MAX 160U #define AQ_HW_RXBUF_MAX 320U +/* pct% of a kb-KB packet buffer, in 32-byte threshold units */ +#define AQ_BUF_THRESHOLD(kb, pct) ((kb) * (1024U / 32U) * (pct) / 100U) + #define L2_FILTER_ACTION_DISCARD (0x0) #define L2_FILTER_ACTION_HOST (0x1) diff --git a/sys/dev/aq/aq_irq.c b/sys/dev/aq/aq_irq.c index 6338a7777dee..21f319b87fbd 100644 --- a/sys/dev/aq/aq_irq.c +++ b/sys/dev/aq/aq_irq.c @@ -179,7 +179,7 @@ aq_linkstat_isr(void *arg) struct aq_hw *hw = &aq_dev->hw; /* clear interrupt status */ - itr_irq_status_clearlsw_set(hw, aq_dev->msix); + itr_irq_status_clearlsw_set(hw, BIT(aq_dev->msix)); iflib_admin_intr_deferred(aq_dev->ctx); diff --git a/sys/dev/aq/aq_main.c b/sys/dev/aq/aq_main.c index e893bb7f73b3..ebe8b13da795 100644 --- a/sys/dev/aq/aq_main.c +++ b/sys/dev/aq/aq_main.c @@ -182,6 +182,7 @@ static void aq_add_stats_sysctls(struct aq_dev *softc); static void aq_if_enable_intr(if_ctx_t ctx); static void aq_if_disable_intr(if_ctx_t ctx); static int aq_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t rxqid); +static int aq_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqid); static int aq_if_msix_intr_assign(if_ctx_t ctx, int msix); /* VLAN support */ @@ -253,7 +254,7 @@ static device_method_t aq_if_methods[] = { DEVMETHOD(ifdi_intr_enable, aq_if_enable_intr), DEVMETHOD(ifdi_intr_disable, aq_if_disable_intr), DEVMETHOD(ifdi_rx_queue_intr_enable, aq_if_rx_queue_intr_enable), - DEVMETHOD(ifdi_tx_queue_intr_enable, aq_if_rx_queue_intr_enable), + DEVMETHOD(ifdi_tx_queue_intr_enable, aq_if_tx_queue_intr_enable), DEVMETHOD(ifdi_msix_intr_assign, aq_if_msix_intr_assign), /* VLAN support */ @@ -411,7 +412,7 @@ aq_if_attach_pre(if_ctx_t ctx) scctx->isc_rxqsizes[0] = sizeof(aq_rx_desc_t) * scctx->isc_nrxd[0]; scctx->isc_ntxqsets_max = HW_ATL_B0_RINGS_MAX; - scctx->isc_nrxqsets_max = HW_ATL_B0_RINGS_MAX; + scctx->isc_nrxqsets_max = HW_ATL_RSS_INDIRECTION_QUEUES_MAX; /* iflib will map and release this bar */ scctx->isc_msix_bar = pci_msix_table_bar(softc->dev); @@ -667,6 +668,8 @@ aq_if_init(if_ctx_t ctx) softc = iflib_get_softc(ctx); hw = &softc->hw; + hw->tx_rings_count = softc->tx_rings_count; + err = aq_hw_init(&softc->hw, softc->hw.mac_addr, softc->msix, softc->scctx->isc_intr == IFLIB_INTR_MSIX); if (err != EOK) { @@ -965,6 +968,20 @@ aq_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t rxqid) return (0); } +static int +aq_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqid) +{ + struct aq_dev *softc = iflib_get_softc(ctx); + struct aq_hw *hw = &softc->hw; + + AQ_DBG_ENTER(); + + itr_irq_msk_setlsw_set(hw, BIT(softc->tx_rings[txqid]->msix)); + + AQ_DBG_EXIT(0); + return (0); +} + static int aq_if_msix_intr_assign(if_ctx_t ctx, int msix) { @@ -979,7 +996,7 @@ aq_if_msix_intr_assign(if_ctx_t ctx, int msix) for (i = 0; i < softc->rx_rings_count; i++, vector++) { snprintf(irq_name, sizeof(irq_name), "rxq%d", i); rc = iflib_irq_alloc_generic(ctx, &softc->rx_rings[i]->irq, - vector + 1, IFLIB_INTR_RX, aq_isr_rx, softc->rx_rings[i], + vector + 1, IFLIB_INTR_RXTX, aq_isr_rx, softc->rx_rings[i], softc->rx_rings[i]->index, irq_name); device_printf(softc->dev, "Assign IRQ %u to rx ring %u\n", vector, softc->rx_rings[i]->index); @@ -995,12 +1012,13 @@ aq_if_msix_intr_assign(if_ctx_t ctx, int msix) rx_vectors = vector; - for (i = 0; i < softc->tx_rings_count; i++, vector++) { + for (i = 0; i < softc->tx_rings_count; i++) { snprintf(irq_name, sizeof(irq_name), "txq%d", i); - iflib_softirq_alloc_generic(ctx, &softc->rx_rings[i]->irq, - IFLIB_INTR_TX, softc->tx_rings[i], i, irq_name); - - softc->tx_rings[i]->msix = (vector % softc->rx_rings_count); + softc->tx_rings[i]->msix = (i % softc->rx_rings_count); + iflib_softirq_alloc_generic(ctx, + &softc->rx_rings[softc->tx_rings[i]->msix]->irq, + IFLIB_INTR_TX, softc->tx_rings[i], + softc->tx_rings[i]->index, irq_name); device_printf(softc->dev, "Assign IRQ %u to tx ring %u\n", softc->tx_rings[i]->msix, softc->tx_rings[i]->index); } @@ -1013,7 +1031,7 @@ aq_if_msix_intr_assign(if_ctx_t ctx, int msix) if (rc) { device_printf(iflib_get_dev(ctx), "Failed to register admin handler"); - i = softc->rx_rings_count; + i = softc->rx_rings_count - 1; goto fail; } AQ_DBG_EXIT(0); From nobody Sat Jun 20 19:10:36 2026 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 4gjPDs0DM3z6hNnx for ; Sat, 20 Jun 2026 19:10: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjPDr61t6z3vBH for ; Sat, 20 Jun 2026 19:10:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982636; 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; bh=jNQMzyNHFRlQiwlQL4hlJVM6+/D1DCQzy1LJ+fK7wx8=; b=dy5BilD+V2GW9lQEnTyp6JO6/dRLPNYhorNz7KjzgKf+HbdjscFPJJxUTyZWdjlq5/NOub jXz+M9yNAK/cOwbhqp52+cn3ZWyid7QCQTwZO0YkE/x2SwO8aQ5CjYGAZplD10D3qGiOAe 51YsGxKyhhS2eEhnUWQXXZMcPhiS741d+U+AyqBjKQgvNWxRAlYgnMggWW767wJBW2R14w zZNSaHkCN0b0aN5cpUXhGEYzMseB9BGR0O3e1rPLv92owJ2V/QgCgdeD2NbQ0nn+sJW+jZ D1Nl5baEOv5ZgN7SGmvCKSKKR5iCQXmB0hMYlYsMVRGE1qenfLEci6y9wf0L7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781982636; a=rsa-sha256; cv=none; b=LDUvvyDc2/Pl1iOTJnXXrdeDSIYb6KI/20MlaFkXrw9SkRwRy5f3sRjW5s4KWALSJqfxDG ZAjpYBEck6wdDxnbUgnkcEtK9ju15eu4vg0IK+czTzQLmtaIkg3QEHGt5MtwLjvPn3OkTi eX1jDelAmK0l2wgb/5BEgoIMrPlNdyV68eFGbvlT6Vq+HV0lEue0SWeqjYz6aLreDA843t +zowShEKz0xDWB03VEisq2qN354kyNzVsdBKgISWkj7BDRh8EniJs6WRE0ZehaQzbuwbhQ OO8129Wb0nwVWC59eSwip6Qmmee8O1xtGs1+/ODdcvaKV+A1oO05sSFe8cN5nQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982636; 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; bh=jNQMzyNHFRlQiwlQL4hlJVM6+/D1DCQzy1LJ+fK7wx8=; b=fPEEm7L/KtIUXrrr17lDnbX1cvAxYO4UsowzXJgcQVhgLbAazEaY00XqQo3dKEBlVQFlfJ 0pZPQ3zuZb32svL7WBpYq8sU1PfTvlOnX53EXR/hW8kkQ6ZMVtqXYJwlOpBJ+9OGsKDON6 cRuPYO883WIjFrLuYY6qkNpUGHOI1NrNH9oFVyb7BSMmXnxJGeoK2bwabP96Vi8qihz2G3 eqH7c8rcZULegOuQeIwxgk3isGK/5LA0r7Z8ub6St9Jje8+tMIhgnQndyJRGHS2KAGwoTD J1t4V8dBi5CzoTvC2PaLsvDtkB+dEn1O4ABc4rr8M5DfBmaDx7K3QecaZ1xiWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjPDr4hrTzkZG for ; Sat, 20 Jun 2026 19:10:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 325f5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 19:10:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Nick Price From: Adrian Chadd Subject: git: 40accc7235c2 - main - aq(4): adopt native FreeBSD errno convention 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 40accc7235c2f0d2072f051099d183e7f21c2731 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 19:10:36 +0000 Message-Id: <6a36e5ac.325f5.1e209f2c@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=40accc7235c2f0d2072f051099d183e7f21c2731 commit 40accc7235c2f0d2072f051099d183e7f21c2731 Author: Nick Price AuthorDate: 2026-06-20 19:02:42 +0000 Commit: Adrian Chadd CommitDate: 2026-06-20 19:10:15 +0000 aq(4): adopt native FreeBSD errno convention Convert the driver's internal error-handling chain from the Linux negative-errno convention to FreeBSD positive errno everywhere. - All `return (-EXXX)` become `return (EXXX)`, `int err = -EXXX` loses the sign, and `if (err < 0)` checks become `if (err != 0)` across aq_fw.c, aq_fw1x.c, aq_fw2x.c and aq_hw.c. - mac_soft_reset_flb_ returns ETIMEDOUT/0 instead of a bool so it matches its RBL sibling. - The ETIME and EOK aliases in aq_common.h are removed; all sites use ETIMEDOUT and 0 directly, and the `rc = -rc` sign flips in aq_if_attach_pre are dropped. Turn AQ_HW_WAIT_FOR into a statement expression evaluating to 0 on success or ETIMEDOUT on timeout, assigned explicitly at all seven call sites, instead of silently assigning ETIMEDOUT to a variable named err in the caller scope. A statement expression rather than an inline function because every call must re-evaluate its condition each iteration -- one even assigns hw->mbox_addr as a side effect. Fix two correctness bugs surfaced by the conversion: - fw1x_get_stats gated its stats copy with `if (err >= 0)`, correct under negative errno but accepting every positive errno after the flip. Change to `if (err == 0)`. - fw2x_reset returned 0 regardless of capability-download failure, silently leaving fw_caps = 0. Return the real err. Harden aq_if_attach_pre: bit_alloc(4096, M_AQ, M_NOWAIT) was unchecked, so under OOM a later `ifconfig vlanN create` would NULL-deref the bitstring; check for NULL and fail with ENOMEM. The fail label's hardcoded `return (ENXIO)` becomes `return (rc)` so each error path reports its real errno. Remove the dead error checks in aq_hw_offload_set: the `if (err != 0) goto err_exit` blocks after the void tpo_/rpo_/tdm_ register-write helpers were unreachable (err is never set), and the real error capture is the aq_hw_err_from_flags call at the function tail. Drop the now-orphaned err_exit label. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57435 --- sys/dev/aq/aq_common.h | 17 ++++---------- sys/dev/aq/aq_fw.c | 32 ++++++++++++------------- sys/dev/aq/aq_fw1x.c | 24 +++++++++---------- sys/dev/aq/aq_fw2x.c | 34 +++++++++++++-------------- sys/dev/aq/aq_hw.c | 64 ++++++++++++++++++++++---------------------------- sys/dev/aq/aq_main.c | 21 ++++++++++------- 6 files changed, 91 insertions(+), 101 deletions(-) diff --git a/sys/dev/aq/aq_common.h b/sys/dev/aq/aq_common.h index f31567480ec0..6529f249ff62 100644 --- a/sys/dev/aq/aq_common.h +++ b/sys/dev/aq/aq_common.h @@ -38,9 +38,6 @@ #include -#define ETIME ETIMEDOUT -#define EOK 0 - #define BIT(nr) (1UL << (nr)) #define usec_delay(x) DELAY(x) @@ -50,16 +47,12 @@ #define msec_delay_irq(x) DELAY(x*1000) #endif -#define AQ_HW_WAIT_FOR(_B_, _US_, _N_) \ -do { \ - unsigned int i; \ - for (i = _N_; (!(_B_)) && i; --i) { \ +#define AQ_HW_WAIT_FOR(_B_, _US_, _N_) ({ \ + unsigned int _i; \ + for (_i = (_N_); !(_B_) && _i; --_i) \ usec_delay(_US_); \ - } \ - if (!i) { \ - err = -1; \ - } \ -} while (0) + (_i == 0) ? ETIMEDOUT : 0; \ +}) #define LOWORD(a) ((uint16_t)(a)) diff --git a/sys/dev/aq/aq_fw.c b/sys/dev/aq/aq_fw.c index 3ab5909882e1..487137e9c61e 100644 --- a/sys/dev/aq/aq_fw.c +++ b/sys/dev/aq/aq_fw.c @@ -112,7 +112,7 @@ aq_fw_reset(struct aq_hw* hw) if (k == 1000) { aq_log_error("Neither RBL nor FLB started"); - return (-EBUSY); + return (EBUSY); } hw->rbl_enabled = bootExitCode != 0; @@ -133,7 +133,7 @@ aq_fw_reset(struct aq_hw* hw) aq_fw_bootloader_mode mode = boot_mode_unknown; int err = mac_soft_reset_(hw, &mode); - if (err < 0) { + if (err != 0) { aq_log_error("MAC reset failed: %d", err); return (err); } @@ -151,12 +151,12 @@ aq_fw_reset(struct aq_hw* hw) case boot_mode_unknown: aq_log_error("F/W bootload error: unknown bootloader type"); - return (-ENOTSUP); + return (ENOTSUP); case boot_mode_rbl_host_bootload: #if AQ_CFG_HOST_BOOT_DISABLE aq_log_error("RBL> Host Bootload mode: this driver does not support Host Boot"); - return (-ENOTSUP); + return (ENOTSUP); #else trace(dbg_init, "RBL> Host Bootload mode"); break; @@ -168,7 +168,7 @@ aq_fw_reset(struct aq_hw* hw) */ aq_log_error("RBL> F/W Host Bootload not implemented"); - return (-ENOTSUP); + return (ENOTSUP); } int @@ -184,16 +184,16 @@ aq_fw_ops_init(struct aq_hw* hw) if (hw->fw_version.major_version == 1) { trace(dbg_init, "using F/W ops v1.x"); hw->fw_ops = &aq_fw1x_ops; - return (EOK); + return (0); } else if (hw->fw_version.major_version >= 2) { trace(dbg_init, "using F/W ops v2.x"); hw->fw_ops = &aq_fw2x_ops; - return (EOK); + return (0); } aq_log_error("aq_fw_ops_init(): invalid F/W version %#x", hw->fw_version.raw); - return (-ENOTSUP); + return (ENOTSUP); } @@ -260,7 +260,7 @@ mac_soft_reset_flb_(struct aq_hw* hw) if (flb_status == 0) { trace_error(dbg_init, "FLB> MAC kickstart failed: timed out"); - return (false); + return (ETIMEDOUT); } trace(dbg_init, "FLB> MAC kickstart done, %d ms", k); @@ -290,11 +290,11 @@ mac_soft_reset_flb_(struct aq_hw* hw) if (!restart_completed) { trace_error(dbg_init, "FLB> Global Soft Reset failed"); - return (false); + return (ETIMEDOUT); } trace(dbg_init, "FLB> F/W restart: %d ms", k * 10); - return (true); + return (0); } int @@ -331,7 +331,7 @@ mac_soft_reset_rbl_(struct aq_hw* hw, aq_fw_bootloader_mode* mode) if (rbl_status == 0 || rbl_status == 0xDEAD) { trace_error(dbg_init, "RBL> RBL restart failed: timeout"); - return (-EBUSY); + return (EBUSY); } if (rbl_status == RBL_STATUS_SUCCESS) { @@ -344,10 +344,10 @@ mac_soft_reset_rbl_(struct aq_hw* hw, aq_fw_bootloader_mode* mode) trace(dbg_init, "RBL> reset complete! [Host Bootload]"); } else { trace_error(dbg_init, "unknown RBL status 0x%x", rbl_status); - return (-EBUSY); + return (EBUSY); } - return (EOK); + return (0); } int @@ -355,12 +355,12 @@ wait_init_mac_firmware_(struct aq_hw* hw) { for (int i = 0; i < MAC_FW_START_TIMEOUT_MS; ++i) { if ((hw->fw_version.raw = AQ_READ_REG(hw, 0x18)) != 0) - return (EOK); + return (0); msec_delay(1); } trace_error(dbg_init, "timeout waiting for reg 0x18. MAC f/w NOT READY"); - return (-EBUSY); + return (EBUSY); } diff --git a/sys/dev/aq/aq_fw1x.c b/sys/dev/aq/aq_fw1x.c index 5a409eef15f4..f5458b174c3f 100644 --- a/sys/dev/aq/aq_fw1x.c +++ b/sys/dev/aq/aq_fw1x.c @@ -186,7 +186,7 @@ fw1x_reset(struct aq_hw* hal) * Compare transaction ID to initial value. * If it's different means f/w is alive. We're done. */ - return (EOK); + return (0); } /* @@ -197,7 +197,7 @@ fw1x_reset(struct aq_hw* hal) } trace_error(dbg_init, "F/W 1.x reset finalize timeout"); - return (-EBUSY); + return (EBUSY); } int @@ -213,7 +213,7 @@ fw1x_set_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state_e mode, AQ_WRITE_REG(hw, FW1X_MPI_CONTROL_ADR, state.val); - return (EOK); + return (0); } int @@ -250,15 +250,15 @@ fw1x_get_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state_e* mode, *fc = aq_fw_fc_none; - AQ_DBG_EXIT(EOK); - return (EOK); + AQ_DBG_EXIT(0); + return (0); } int fw1x_get_mac_addr(struct aq_hw* hw, uint8_t* mac) { - int err = -EFAULT; + int err = EFAULT; uint32_t mac_addr[2]; AQ_DBG_ENTER(); @@ -266,13 +266,13 @@ fw1x_get_mac_addr(struct aq_hw* hw, uint8_t* mac) uint32_t efuse_shadow_addr = AQ_READ_REG(hw, 0x374); if (efuse_shadow_addr == 0) { trace_error(dbg_init, "couldn't read eFUSE Shadow Address"); - AQ_DBG_EXIT(-EFAULT); - return (-EFAULT); + AQ_DBG_EXIT(EFAULT); + return (EFAULT); } err = aq_hw_fw_downld_dwords(hw, efuse_shadow_addr + (40 * 4), mac_addr, ARRAY_SIZE(mac_addr)); - if (err < 0) { + if (err != 0) { mac_addr[0] = 0; mac_addr[1] = 0; AQ_DBG_EXIT(err); @@ -287,8 +287,8 @@ fw1x_get_mac_addr(struct aq_hw* hw, uint8_t* mac) trace(dbg_init, "fw1x> eFUSE MAC addr -> %02x-%02x-%02x-%02x-%02x-%02x", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - AQ_DBG_EXIT(EOK); - return (EOK); + AQ_DBG_EXIT(0); + return (0); } int @@ -300,7 +300,7 @@ fw1x_get_stats(struct aq_hw* hw, struct aq_hw_stats_s* stats) err = aq_hw_fw_downld_dwords(hw, hw->mbox_addr, (uint32_t*)(void*)&hw->mbox, sizeof hw->mbox / sizeof(uint32_t)); - if (err >= 0) { + if (err == 0) { if (stats != &hw->mbox.stats) memcpy(stats, &hw->mbox.stats, sizeof *stats); diff --git a/sys/dev/aq/aq_fw2x.c b/sys/dev/aq/aq_fw2x.c index 004121242ac1..aee7d80d7013 100644 --- a/sys/dev/aq/aq_fw2x.c +++ b/sys/dev/aq/aq_fw2x.c @@ -240,7 +240,7 @@ fw2x_reset(struct aq_hw* hw) int err = aq_hw_fw_downld_dwords(hw, hw->mbox_addr + offsetof(fw2x_mailbox, caps), (uint32_t*)&caps, sizeof caps/sizeof(uint32_t)); - if (err == EOK) { + if (err == 0) { hw->fw_caps = caps.caps_lo | ((uint64_t)caps.caps_hi << 32); trace(dbg_init, "fw2x> F/W capabilities mask = %llx", @@ -250,8 +250,8 @@ fw2x_reset(struct aq_hw* hw) "fw2x> can't get F/W capabilities mask, error %d", err); } - AQ_DBG_EXIT(EOK); - return (EOK); + AQ_DBG_EXIT(err); + return (err); } @@ -310,12 +310,12 @@ fw2x_set_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state_e mode, default: trace_error(dbg_init, "fw2x> unknown MPI state %d", mode); - return (-EINVAL); + return (EINVAL); } set_mpi_ctrl_(hw, mpi_ctrl); - AQ_DBG_EXIT(EOK); - return (EOK); + AQ_DBG_EXIT(0); + return (0); } int @@ -355,14 +355,14 @@ fw2x_get_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state_e* mode, (32 + CAPS_HI_PAUSE); // AQ_DBG_EXIT(0); - return (EOK); + return (0); } int fw2x_get_mac_addr(struct aq_hw* hw, uint8_t* mac) { - int err = -EFAULT; + int err = EFAULT; uint32_t mac_addr[2]; AQ_DBG_ENTER(); @@ -370,13 +370,13 @@ fw2x_get_mac_addr(struct aq_hw* hw, uint8_t* mac) uint32_t efuse_shadow_addr = AQ_READ_REG(hw, 0x364); if (efuse_shadow_addr == 0) { trace_error(dbg_init, "couldn't read eFUSE Shadow Address"); - AQ_DBG_EXIT(-EFAULT); - return (-EFAULT); + AQ_DBG_EXIT(EFAULT); + return (EFAULT); } err = aq_hw_fw_downld_dwords(hw, efuse_shadow_addr + (40 * 4), mac_addr, ARRAY_SIZE(mac_addr)); - if (err < 0) { + if (err != 0) { mac_addr[0] = 0; mac_addr[1] = 0; AQ_DBG_EXIT(err); @@ -388,8 +388,8 @@ fw2x_get_mac_addr(struct aq_hw* hw, uint8_t* mac) memcpy(mac, (uint8_t*)mac_addr, ETHER_ADDR_LEN); - AQ_DBG_EXIT(EOK); - return (EOK); + AQ_DBG_EXIT(0); + return (0); } static inline void @@ -468,14 +468,14 @@ fw2x_get_stats(struct aq_hw* hw, struct aq_hw_stats_s* stats) if ((hw->fw_caps & FW2X_CAP_STATISTICS) == 0) { trace_warn(dbg_fw, "fw2x> statistics not supported by F/W"); - return (-ENOTSUP); + return (ENOTSUP); } // Tell F/W to update the statistics. if (!toggle_mpi_ctrl_and_wait_(hw, FW2X_CAP_STATISTICS, 1, 25)) { trace_error(dbg_fw, "fw2x> statistics update timeout"); - AQ_DBG_EXIT(-ETIME); - return (-ETIME); + AQ_DBG_EXIT(ETIMEDOUT); + return (ETIMEDOUT); } err = aq_hw_fw_downld_dwords(hw, @@ -484,7 +484,7 @@ fw2x_get_stats(struct aq_hw* hw, struct aq_hw_stats_s* stats) fw2x_stats_to_fw_stats_(stats, &fw2x_stats); - if (err != EOK) + if (err != 0) trace_error(dbg_fw, "fw2x> download statistics data FAILED, error %d", err); diff --git a/sys/dev/aq/aq_hw.c b/sys/dev/aq/aq_hw.c index 3e3e4a9d2f47..f3f47c7ecb1e 100644 --- a/sys/dev/aq/aq_hw.c +++ b/sys/dev/aq/aq_hw.c @@ -81,16 +81,16 @@ aq_hw_fw_downld_dwords(struct aq_hw *hw, uint32_t a, uint32_t *p, uint32_t cnt) int err = 0; // AQ_DBG_ENTER(); - AQ_HW_WAIT_FOR(reg_glb_cpu_sem_get(hw, AQ_HW_FW_SM_RAM) == 1U, 1U, + err = AQ_HW_WAIT_FOR(reg_glb_cpu_sem_get(hw, AQ_HW_FW_SM_RAM) == 1U, 1U, 10000U); - if (err < 0) { + if (err != 0) { bool is_locked; reg_glb_cpu_sem_set(hw, 1U, AQ_HW_FW_SM_RAM); is_locked = reg_glb_cpu_sem_get(hw, AQ_HW_FW_SM_RAM); if (!is_locked) { - err = -ETIME; + err = ETIMEDOUT; goto err_exit; } } @@ -101,10 +101,10 @@ aq_hw_fw_downld_dwords(struct aq_hw *hw, uint32_t a, uint32_t *p, uint32_t cnt) mif_mcp_up_mailbox_execute_operation_set(hw, 1); if (IS_CHIP_FEATURE(hw, REVISION_B1)) - AQ_HW_WAIT_FOR(a != mif_mcp_up_mailbox_addr_get(hw), + err = AQ_HW_WAIT_FOR(a != mif_mcp_up_mailbox_addr_get(hw), 1U, 1000U); else - AQ_HW_WAIT_FOR(!mif_mcp_up_mailbox_busy_get(hw), 1, + err = AQ_HW_WAIT_FOR(!mif_mcp_up_mailbox_busy_get(hw), 1, 1000U); *(p++) = mif_mcp_up_mailbox_data_get(hw); @@ -142,16 +142,16 @@ aq_hw_init_ucp(struct aq_hw *hw) hw->fw_version.raw = 0; err = aq_fw_reset(hw); - if (err != EOK) { + if (err != 0) { aq_log_error("aq_hw_init_ucp(): F/W reset failed, err %d", err); return (err); } aq_hw_chip_features_init(hw, &hw->chip_features); err = aq_fw_ops_init(hw); - if (err < 0) { + if (err != 0) { aq_log_error("could not initialize F/W ops, err %d", err); - return (-1); + return (err); } if (hw->fw_version.major_version == 1) { @@ -169,7 +169,7 @@ aq_hw_init_ucp(struct aq_hw *hw) } /* check 10 times by 1ms */ - AQ_HW_WAIT_FOR((hw->mbox_addr = AQ_READ_REG(hw, 0x360)) != 0, 400U, 20); + err = AQ_HW_WAIT_FOR((hw->mbox_addr = AQ_READ_REG(hw, 0x360)) != 0, 400U, 20); aq_hw_fw_version ver_expected = { .raw = AQ_CFG_FW_MIN_VER_EXPECTED }; if (!aq_hw_ver_match(&ver_expected, &hw->fw_version)) @@ -187,7 +187,7 @@ aq_hw_mpi_create(struct aq_hw *hw) AQ_DBG_ENTER(); err = aq_hw_init_ucp(hw); - if (err < 0) + if (err != 0) goto err_exit; err_exit: @@ -204,11 +204,11 @@ aq_hw_mpi_read_stats(struct aq_hw *hw, struct aq_hw_fw_mbox *pmbox) if (hw->fw_ops && hw->fw_ops->get_stats) { err = hw->fw_ops->get_stats(hw, &pmbox->stats); } else { - err = -ENOTSUP; + err = ENOTSUP; aq_log_error("get_stats() not supported by F/W"); } - if (err == EOK) { + if (err == 0) { pmbox->stats.dpc = reg_rx_dma_stat_counter7get(hw); pmbox->stats.cprc = stats_rx_lro_coalesced_pkt_count0_get(hw); } @@ -220,7 +220,7 @@ aq_hw_mpi_read_stats(struct aq_hw *hw, struct aq_hw_fw_mbox *pmbox) static int aq_hw_mpi_set(struct aq_hw *hw, enum aq_hw_fw_mpi_state_e state, uint32_t speed) { - int err = -ENOTSUP; + int err = ENOTSUP; AQ_DBG_ENTERA("speed %d", speed); if (hw->fw_ops && hw->fw_ops->set_mode) { @@ -242,7 +242,7 @@ aq_hw_set_link_speed(struct aq_hw *hw, uint32_t speed) int aq_hw_get_link_state(struct aq_hw *hw, uint32_t *link_speed, struct aq_hw_fc_info *fc_neg) { - int err = EOK; + int err = 0; // AQ_DBG_ENTER(); @@ -254,11 +254,11 @@ aq_hw_get_link_state(struct aq_hw *hw, uint32_t *link_speed, struct aq_hw_fc_inf err = hw->fw_ops->get_mode(hw, &mode, &speed, &fc); } else { aq_log_error("get_mode() not supported by F/W"); - AQ_DBG_EXIT(-ENOTSUP); - return (-ENOTSUP); + AQ_DBG_EXIT(ENOTSUP); + return (ENOTSUP); } - if (err < 0) { + if (err != 0) { aq_log_error("get_mode() failed, err %d", err); AQ_DBG_EXIT(err); return (err); @@ -298,7 +298,7 @@ aq_hw_get_link_state(struct aq_hw *hw, uint32_t *link_speed, struct aq_hw_fc_inf int aq_hw_get_mac_permanent(struct aq_hw *hw, uint8_t *mac) { - int err = -ENOTSUP; + int err = ENOTSUP; AQ_DBG_ENTER(); if (hw->fw_ops && hw->fw_ops->get_mac_addr) @@ -330,7 +330,7 @@ aq_hw_get_mac_permanent(struct aq_hw *hw, uint8_t *mac) h >>= 8; mac[0] = (uint8_t)(0xFFU & h); - err = EOK; + err = 0; } AQ_DBG_EXIT(err); @@ -366,15 +366,15 @@ aq_hw_reset(struct aq_hw *hw) AQ_DBG_ENTER(); err = aq_fw_reset(hw); - if (err < 0) + if (err != 0) goto err_exit; itr_irq_reg_res_dis_set(hw, 0); itr_res_irq_set(hw, 1); /* check 10 times by 1ms */ - AQ_HW_WAIT_FOR(itr_res_irq_get(hw) == 0, 1000, 10); - if (err < 0) { + err = AQ_HW_WAIT_FOR(itr_res_irq_get(hw) == 0, 1000, 10); + if (err != 0) { printf("atlantic: IRQ reset failed: %d", err); goto err_exit; } @@ -456,21 +456,14 @@ aq_hw_offload_set(struct aq_hw *hw) /* TX checksums offloads*/ tpo_ipv4header_crc_offload_en_set(hw, 1); tpo_tcp_udp_crc_offload_en_set(hw, 1); - if (err < 0) - goto err_exit; /* RX checksums offloads*/ rpo_ipv4header_crc_offload_en_set(hw, 1); rpo_tcp_udp_crc_offload_en_set(hw, 1); - if (err < 0) - goto err_exit; /* LSO offloads*/ tdm_large_send_offload_en_set(hw, 0xFFFFFFFFU); - if (err < 0) - goto err_exit; -/* LRO offloads */ { uint32_t i = 0; uint32_t val = (8U < HW_ATL_B0_LRO_RXD_MAX) ? 0x3U : @@ -505,7 +498,6 @@ aq_hw_offload_set(struct aq_hw *hw) err = aq_hw_err_from_flags(hw); -err_exit: AQ_DBG_EXIT(err); return (err); } @@ -606,7 +598,7 @@ aq_hw_mac_addr_set(struct aq_hw *hw, uint8_t *mac_addr, uint8_t index) AQ_DBG_ENTER(); if (!mac_addr) { - err = -EINVAL; + err = EINVAL; goto err_exit; } h = (mac_addr[0] << 8) | (mac_addr[1]); @@ -654,7 +646,7 @@ aq_hw_init(struct aq_hw *hw, uint8_t *mac_addr, uint8_t adm_irq, bool msix) aq_hw_qos_set(hw); err = aq_hw_err_from_flags(hw); - if (err < 0) + if (err != 0) goto err_exit; /* Interrupts */ @@ -835,9 +827,9 @@ aq_hw_rss_hash_set(struct aq_hw_s *self, rpf_rss_key_wr_data_set(self, key_data); rpf_rss_key_addr_set(self, addr); rpf_rss_key_wr_en_set(self, 1U); - AQ_HW_WAIT_FOR(rpf_rss_key_wr_en_get(self) == 0, + err = AQ_HW_WAIT_FOR(rpf_rss_key_wr_en_get(self) == 0, 1000U, 10U); - if (err < 0) + if (err != 0) goto err_exit; } @@ -899,9 +891,9 @@ aq_hw_rss_set(struct aq_hw_s *self, rpf_rss_redir_tbl_wr_data_set(self, bitary[i]); rpf_rss_redir_tbl_addr_set(self, i); rpf_rss_redir_wr_en_set(self, 1U); - AQ_HW_WAIT_FOR(rpf_rss_redir_wr_en_get(self) == 0, + err = AQ_HW_WAIT_FOR(rpf_rss_redir_wr_en_get(self) == 0, 1000U, 10U); - if (err < 0) + if (err != 0) goto err_exit; } diff --git a/sys/dev/aq/aq_main.c b/sys/dev/aq/aq_main.c index ebe8b13da795..fd278826bd2d 100644 --- a/sys/dev/aq/aq_main.c +++ b/sys/dev/aq/aq_main.c @@ -363,7 +363,7 @@ aq_if_attach_pre(if_ctx_t ctx) /* Look up ops and caps. */ rc = aq_hw_mpi_create(hw); - if (rc < 0) { + if (rc != 0) { AQ_DBG_ERROR(" %s: aq_hw_mpi_create fail err=%d", __func__, rc); goto fail; } @@ -375,10 +375,11 @@ aq_if_attach_pre(if_ctx_t ctx) aq_hw_reset(&softc->hw); aq_hw_capabilities(softc); - if (aq_hw_get_mac_permanent(hw, hw->mac_addr) < 0) { + rc = aq_hw_get_mac_permanent(hw, hw->mac_addr); + if (rc != 0) { AQ_DBG_ERROR("Unable to get mac addr from hw"); goto fail; - }; + } softc->admin_ticks = 0; @@ -417,7 +418,11 @@ aq_if_attach_pre(if_ctx_t ctx) /* iflib will map and release this bar */ scctx->isc_msix_bar = pci_msix_table_bar(softc->dev); - softc->vlan_tags = bit_alloc(4096, M_AQ, M_NOWAIT); + softc->vlan_tags = bit_alloc(4096, M_AQ, M_NOWAIT); + if (softc->vlan_tags == NULL) { + rc = ENOMEM; + goto fail; + } AQ_DBG_EXIT(rc); return (rc); @@ -428,7 +433,7 @@ fail: softc->mmio_rid, softc->mmio_res); AQ_DBG_EXIT(rc); - return (ENXIO); + return (rc); } @@ -672,7 +677,7 @@ aq_if_init(if_ctx_t ctx) err = aq_hw_init(&softc->hw, softc->hw.mac_addr, softc->msix, softc->scctx->isc_intr == IFLIB_INTR_MSIX); - if (err != EOK) { + if (err != 0) { device_printf(softc->dev, "atlantic: aq_hw_init: %d", err); } @@ -688,7 +693,7 @@ aq_if_init(if_ctx_t ctx) "atlantic: aq_ring_tx_init: %d", err); } err = aq_ring_tx_start(hw, ring); - if (err != EOK) { + if (err != 0) { device_printf(softc->dev, "atlantic: aq_ring_tx_start: %d", err); } @@ -701,7 +706,7 @@ aq_if_init(if_ctx_t ctx) "atlantic: aq_ring_rx_init: %d", err); } err = aq_ring_rx_start(hw, ring); - if (err != EOK) { + if (err != 0) { device_printf(softc->dev, "atlantic: aq_ring_rx_start: %d", err); } From nobody Sat Jun 20 19:10:37 2026 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 4gjPDt02R4z6hNg2 for ; Sat, 20 Jun 2026 19:10: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjPDs62bvz3v8b for ; Sat, 20 Jun 2026 19:10:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982637; 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; bh=tS1/gmvuaY4e3CKo2yVx2wutuRbwvTlO18KyN6+PjvI=; b=Cl4Jqe6cUkVcdFDTve2kLSpUZ/8xdXlKvQk3k+Eq9K9zf2HWoSvPxaiZzLJRSUenyXSxyj txIL9fS/75jnxADrOkGa//m+pViuUyZIv5UTFa5W94dkBAcKE/i44dEZ+yk+AB6y25Eh7+ 08ziN6DTZ6cEmrbWMCoQp2Vu7Ey2fXHG9qNoEHnuzZKU33VMnqSNLUvwVCpqz+pnJ0Ra4I s4PXixf0S9661K8CaqOTrzgRizxZc44l69ZoiO/fJFLctgXAXBy/YESM33TvTtaP11mEOP AFuJemmgpxEx+ByNw0niznUOYm9k7795xH3HACmgujnFMhAlaYVchgVTtjUfvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781982637; a=rsa-sha256; cv=none; b=diB3Ki7S2kqUA+tqQKXESXq3sjqa4AyKRmND04ZG9gFHmeJ8KOQpG2SpyVYehX/f+7PZzA DV3cTnhaD5Brv+M+3txldL9yFqoOUSgOC6zX0Lznh7TWQtyS+cR9BwnQgDEemyoiM4AcqJ RXNPeQfufCkM85BE7yYK6TS/XFtQIXfkeSx7Hko3S0zcv56VTTK7gN1nNMOcxpAuin3yVz yTW3qfMU4pL1PtWLT4ZGzUs64HeGYz5VKpl4A0txhJ6zgkiM3ZEX5DRZe5KuoxUcTQlcxZ Y6yfZ9Cj+AEAwhq9MtXN7VKbuxAL0Ci/JLXt2nZXGt1HwikyQObc1FP35yxe8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982637; 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; bh=tS1/gmvuaY4e3CKo2yVx2wutuRbwvTlO18KyN6+PjvI=; b=nIz0SHI1z71D0bRDBVf7uD+CJOHxLFlCHeWgPC0jS+9tmFSJEG+WA8vuSZu/AoOrlwc887 tJeQfUDcoNGn3oZCQe5OmlNH0r4O6WmpoGX4s0UGKaYpXbZdgFlsDtufbpfdWLfLO/8WAH rRjlYLZskm0HKgco+BSFqhI+j20GbRu9iu2hxbKWGty2TeGaX5BpJyQYG9nuPXIgT/wLXo CX/5h4UTxPTAqBhh4LTCxkn5e6Q01A0Dg+9+v3skz/DbCS4il16ti0njD59XC/32iCY0JO EOz/g6YJ22GsMqEiF/L4rlgKd83UcNTHUpapEwPAsDEcLMYtellk9aBVRc4VHw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjPDs56Q4zk6P for ; Sat, 20 Jun 2026 19:10:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 360c8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 19:10:37 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Nick Pricenull From: Adrian Chadd Subject: git: 619934a5c165 - main - aq(4): RX/TX and HW-path correctness and hardening 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 619934a5c165869604810ece91c2f2cb734fc3eb Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 19:10:37 +0000 Message-Id: <6a36e5ad.360c8.57e34874@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=619934a5c165869604810ece91c2f2cb734fc3eb commit 619934a5c165869604810ece91c2f2cb734fc3eb Author: Nick Pricenull AuthorDate: 2026-06-20 19:02:52 +0000 Commit: Adrian Chadd CommitDate: 2026-06-20 19:10:15 +0000 aq(4): RX/TX and HW-path correctness and hardening Independent correctness fixes, plus robustness against a non-responding device, malformed descriptor writeback, and torn MMIO reads, and the move to the FreeBSD bus_space(9) register abstraction. Correctness: - aq_hw_ver_match returned true if any of major/minor/build was >= expected; compare lexicographically so e.g. 2.0.1 is correctly seen as older than 2.1.0. - The VLAN hardware-filter iteration used the vlan tag directly as the bitstring index; use vlan_tag + 1 so the active-VLAN bookkeeping lines up with the table. - aq_initmedia only registered IFM_AUTO in full-duplex/pause variants, so a bare "ifconfig aq0 media autoselect" matched no entry and returned ENXIO. Add the bare IFM_ETHER|IFM_AUTO entry, matching ix/em/igc/ixv. - Convert the per-ring diagnostic counters to counter(9): per-CPU, tear-free, no atomics on the increment path, fixing a data race and a 32-bit torn read against the locklessly-read sysctls. Drop three counters that were never populated (jumbo_pkts, tx_drops, tx_queue_full). Hardening and modernization: - Implement aq_hw_err_from_flags (previously a stub returning 0 that left ~24 call sites as no-ops): detect a non-responding device in the register read path (all-ones, confirmed against reg 0x10) and latch a sticky AQ_HW_FLAG_ERR_UNPLUG -> ENXIO; aq_if_init clears it so a transient detection cannot permanently wedge the device. - Bound the RX fragment loop in aq_isc_rxd_pkt_get (EBADMSG once i reaches isc_rx_nsegments) so a malformed never-EOP stream cannot write past the fragment array. - Bound the TX completion count in aq_isc_txd_credits_update against the raw HW head pointer (reject head >= tx_size) so a glitched head cannot make iflib free still-in-flight TX mbufs. - Remove the dead hardware-RSC branch in aq_isc_rxd_available; it followed wb.next_desp, a raw device value used as an index, but RSC is never enabled so rsc_cnt is always 0. Advance sequentially like the other in-tree iflib drivers; this drops the last raw-hardware-pointer dereference in the RX path. - Flush MMIO after interrupt-status acks (AQ_HW_FLUSH) so the write lands before the vector is re-armed under auto-mask-clear; retry the high word in read64_ against a torn lo/hi pair; document the non-atomic IMR read-modify-write in itr_irq_map_en_{rx,tx}_set. - Replace the raw-pointer MMIO (the Linux readl/writel idiom) with bus_space(9): store the BAR tag and handle in struct aq_hw and route AQ_READ_REG/AQ_WRITE_REG through bus_space_read_4/write_4. No functional change on amd64. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57436 --- sys/dev/aq/aq_fw2x.c | 11 ++++++-- sys/dev/aq/aq_hw.c | 30 ++++++++++++++------ sys/dev/aq/aq_hw.h | 16 +++++++++-- sys/dev/aq/aq_irq.c | 6 ++-- sys/dev/aq/aq_main.c | 77 +++++++++++++++++++++++++++++++++++++++++---------- sys/dev/aq/aq_media.c | 2 +- sys/dev/aq/aq_ring.c | 35 +++++++++++++---------- sys/dev/aq/aq_ring.h | 19 ++++++------- 8 files changed, 139 insertions(+), 57 deletions(-) diff --git a/sys/dev/aq/aq_fw2x.c b/sys/dev/aq/aq_fw2x.c index aee7d80d7013..0a6d433a48fc 100644 --- a/sys/dev/aq/aq_fw2x.c +++ b/sys/dev/aq/aq_fw2x.c @@ -207,8 +207,15 @@ int fw2x_get_stats(struct aq_hw* hw, struct aq_hw_stats_s* stats); static uint64_t read64_(struct aq_hw* hw, uint32_t addr) { - uint64_t lo = AQ_READ_REG(hw, addr); - uint64_t hi = AQ_READ_REG(hw, addr + 4); + uint64_t lo, hi, hi2; + + hi = AQ_READ_REG(hw, addr + 4); + do { + hi2 = hi; + lo = AQ_READ_REG(hw, addr); + hi = AQ_READ_REG(hw, addr + 4); + } while (hi != hi2); + return (lo | (hi << 32)); } diff --git a/sys/dev/aq/aq_hw.c b/sys/dev/aq/aq_hw.c index f3f47c7ecb1e..882fdf1807f2 100644 --- a/sys/dev/aq/aq_hw.c +++ b/sys/dev/aq/aq_hw.c @@ -51,9 +51,24 @@ int aq_hw_err_from_flags(struct aq_hw *hw) { + if (atomic_load_acq_long(&hw->flags) & AQ_HW_FLAG_ERR_UNPLUG) + return (ENXIO); return (0); } +inline uint32_t +aq_hw_read_reg(struct aq_hw *hw, uint32_t reg) +{ + uint32_t val = le32toh(bus_space_read_4(hw->hw_tag, hw->hw_handle, reg)); + + if (__predict_false(val == 0xFFFFFFFFU) && + le32toh(bus_space_read_4(hw->hw_tag, hw->hw_handle, 0x10)) == + 0xFFFFFFFFU) + atomic_set_rel_long(&hw->flags, AQ_HW_FLAG_ERR_UNPLUG); + + return (val); +} + static void aq_hw_chip_features_init(struct aq_hw *hw, uint32_t *p) { @@ -123,14 +138,11 @@ aq_hw_ver_match(const aq_hw_fw_version* ver_expected, { AQ_DBG_ENTER(); - if (ver_actual->major_version >= ver_expected->major_version) - return (true); - if (ver_actual->minor_version >= ver_expected->minor_version) - return (true); - if (ver_actual->build_number >= ver_expected->build_number) - return (true); - - return (false); + if (ver_actual->major_version != ver_expected->major_version) + return (ver_actual->major_version > ver_expected->major_version); + if (ver_actual->minor_version != ver_expected->minor_version) + return (ver_actual->minor_version > ver_expected->minor_version); + return (ver_actual->build_number >= ver_expected->build_number); } static int @@ -660,7 +672,7 @@ aq_hw_init(struct aq_hw *hw, uint8_t *mac_addr, uint8_t adm_irq, bool msix) reg_gen_irq_map_set(hw, 0x80 | adm_irq, 3); - aq_hw_offload_set(hw); + err = aq_hw_offload_set(hw); err_exit: AQ_DBG_EXIT(err); diff --git a/sys/dev/aq/aq_hw.h b/sys/dev/aq/aq_hw.h index dd214aa3673b..f954f6055a4c 100644 --- a/sys/dev/aq/aq_hw.h +++ b/sys/dev/aq/aq_hw.h @@ -37,14 +37,21 @@ #include #include +#include #include +#include #include #include #include "aq_common.h" -#define AQ_WRITE_REG(hw, reg, value) writel(((hw)->hw_addr + (reg)), htole32(value)) +#define AQ_WRITE_REG(hw, reg, value) \ + bus_space_write_4((hw)->hw_tag, (hw)->hw_handle, (reg), htole32(value)) -#define AQ_READ_REG(hw, reg) le32toh(readl((hw)->hw_addr + reg)) +#define AQ_HW_FLAG_ERR_UNPLUG 0x1UL + +struct aq_hw; +extern uint32_t aq_hw_read_reg(struct aq_hw *hw, uint32_t reg); +#define AQ_READ_REG(hw, reg) aq_hw_read_reg((hw), (reg)) #define AQ_WRITE_REG_BIT(hw, reg, msk, shift, value) do { \ @@ -137,7 +144,8 @@ struct aq_hw_fc_info { struct aq_hw { void *aq_dev; - uint8_t *hw_addr; + bus_space_tag_t hw_tag; + bus_space_handle_t hw_handle; uint32_t regs_size; uint8_t mac_addr[ETHER_ADDR_LEN]; @@ -170,6 +178,8 @@ struct aq_hw { uint32_t mbox_addr; struct aq_hw_fw_mbox mbox; + u_long flags; + uint32_t tx_rings_count; }; diff --git a/sys/dev/aq/aq_irq.c b/sys/dev/aq/aq_irq.c index 21f319b87fbd..9f8138868eac 100644 --- a/sys/dev/aq/aq_irq.c +++ b/sys/dev/aq/aq_irq.c @@ -163,9 +163,9 @@ aq_isr_rx(void *arg) struct aq_dev *aq_dev = ring->dev; struct aq_hw *hw = &aq_dev->hw; - /* clear interrupt status */ itr_irq_status_clearlsw_set(hw, BIT(ring->msix)); - ring->stats.irq++; + AQ_HW_FLUSH(); + counter_u64_add(ring->stats.irq, 1); return (FILTER_SCHEDULE_THREAD); } @@ -178,8 +178,8 @@ aq_linkstat_isr(void *arg) aq_dev_t *aq_dev = arg; struct aq_hw *hw = &aq_dev->hw; - /* clear interrupt status */ itr_irq_status_clearlsw_set(hw, BIT(aq_dev->msix)); + AQ_HW_FLUSH(); iflib_admin_intr_deferred(aq_dev->ctx); diff --git a/sys/dev/aq/aq_main.c b/sys/dev/aq/aq_main.c index fd278826bd2d..c7701cc4f6d8 100644 --- a/sys/dev/aq/aq_main.c +++ b/sys/dev/aq/aq_main.c @@ -353,7 +353,8 @@ aq_if_attach_pre(if_ctx_t ctx) softc->mmio_tag = rman_get_bustag(softc->mmio_res); softc->mmio_handle = rman_get_bushandle(softc->mmio_res); softc->mmio_size = rman_get_size(softc->mmio_res); - softc->hw.hw_addr = (uint8_t*) softc->mmio_handle; + softc->hw.hw_tag = softc->mmio_tag; + softc->hw.hw_handle = softc->mmio_handle; hw = &softc->hw; hw->link_rate = aq_fw_speed_auto; hw->itr = -1; @@ -542,6 +543,42 @@ aq_if_resume(if_ctx_t ctx) return (0); } +_Static_assert(sizeof(struct aq_ring_stats) % sizeof(counter_u64_t) == 0, + "aq_ring_stats must contain only counter_u64_t fields"); + +static int +aq_ring_stats_alloc(struct aq_ring *ring) +{ + counter_u64_t *c = (counter_u64_t *)&ring->stats; + int i, n = sizeof(ring->stats) / sizeof(counter_u64_t); + + for (i = 0; i < n; i++) { + c[i] = counter_u64_alloc(M_NOWAIT); + if (c[i] == NULL) { + while (i-- > 0) { + counter_u64_free(c[i]); + c[i] = NULL; + } + return (ENOMEM); + } + } + return (0); +} + +static void +aq_ring_stats_free(struct aq_ring *ring) +{ + counter_u64_t *c = (counter_u64_t *)&ring->stats; + int i, n = sizeof(ring->stats) / sizeof(counter_u64_t); + + for (i = 0; i < n; i++) { + if (c[i] != NULL) { + counter_u64_free(c[i]); + c[i] = NULL; + } + } +} + /* Soft queue setup and teardown */ static int aq_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, @@ -571,6 +608,13 @@ aq_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, ring->dev = softc; softc->tx_rings_count++; + + rc = aq_ring_stats_alloc(ring); + if (rc != 0) { + device_printf(softc->dev, + "atlantic: tx_ring stats alloc fail\n"); + goto fail; + } } AQ_DBG_EXIT(rc); @@ -621,6 +665,13 @@ aq_if_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, } softc->rx_rings_count++; + + rc = aq_ring_stats_alloc(ring); + if (rc != 0) { + device_printf(softc->dev, + "atlantic: rx_ring stats alloc fail\n"); + goto fail; + } } AQ_DBG_EXIT(rc); @@ -643,6 +694,7 @@ aq_if_queues_free(if_ctx_t ctx) for (i = 0; i < softc->tx_rings_count; i++) { if (softc->tx_rings[i]) { + aq_ring_stats_free(softc->tx_rings[i]); free(softc->tx_rings[i], M_AQ); softc->tx_rings[i] = NULL; } @@ -650,6 +702,7 @@ aq_if_queues_free(if_ctx_t ctx) softc->tx_rings_count = 0; for (i = 0; i < softc->rx_rings_count; i++) { if (softc->rx_rings[i]){ + aq_ring_stats_free(softc->rx_rings[i]); free(softc->rx_rings[i], M_AQ); softc->rx_rings[i] = NULL; } @@ -673,6 +726,8 @@ aq_if_init(if_ctx_t ctx) softc = iflib_get_softc(ctx); hw = &softc->hw; + atomic_store_rel_long(&hw->flags, 0); + hw->tx_rings_count = softc->tx_rings_count; err = aq_hw_init(&softc->hw, softc->hw.mac_addr, softc->msix, @@ -1080,7 +1135,7 @@ aq_update_vlan_filters(struct aq_dev *softc) aq_vlans[i].location = i; aq_vlans[i].queue = 0xFF; aq_vlans[i].vlan_id = vlan_tag; - bit_pos = vlan_tag; + bit_pos = vlan_tag + 1; } else { aq_vlans[i].enable = false; } @@ -1319,14 +1374,10 @@ aq_add_stats_sysctls(struct aq_dev *softc) CTLFLAG_RD, NULL, "Queue Name"); queue_list = SYSCTL_CHILDREN(queue_node); - SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "tx_pkts", + SYSCTL_ADD_COUNTER_U64(ctx, queue_list, OID_AUTO, "tx_pkts", CTLFLAG_RD, &(ring->stats.tx_pkts), "TX Packets"); - SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "tx_bytes", + SYSCTL_ADD_COUNTER_U64(ctx, queue_list, OID_AUTO, "tx_bytes", CTLFLAG_RD, &(ring->stats.tx_bytes), "TX Octets"); - SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "tx_drops", - CTLFLAG_RD, &(ring->stats.tx_drops), "TX Drops"); - SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "tx_queue_full", - CTLFLAG_RD, &(ring->stats.tx_queue_full), "TX Queue Full"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "tx_head", CTLTYPE_UINT | CTLFLAG_RD, ring, 0, aq_sysctl_print_tx_head, "IU", "ring head pointer"); @@ -1342,15 +1393,13 @@ aq_add_stats_sysctls(struct aq_dev *softc) CTLFLAG_RD, NULL, "Queue Name"); queue_list = SYSCTL_CHILDREN(queue_node); - SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_pkts", + SYSCTL_ADD_COUNTER_U64(ctx, queue_list, OID_AUTO, "rx_pkts", CTLFLAG_RD, &(ring->stats.rx_pkts), "RX Packets"); - SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_bytes", + SYSCTL_ADD_COUNTER_U64(ctx, queue_list, OID_AUTO, "rx_bytes", CTLFLAG_RD, &(ring->stats.rx_bytes), "TX Octets"); - SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "jumbo_pkts", - CTLFLAG_RD, &(ring->stats.jumbo_pkts), "Jumbo Packets"); - SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_err", + SYSCTL_ADD_COUNTER_U64(ctx, queue_list, OID_AUTO, "rx_err", CTLFLAG_RD, &(ring->stats.rx_err), "RX Errors"); - SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "irq", + SYSCTL_ADD_COUNTER_U64(ctx, queue_list, OID_AUTO, "irq", CTLFLAG_RD, &(ring->stats.irq), "RX interrupts"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rx_head", CTLTYPE_UINT | CTLFLAG_RD, ring, 0, diff --git a/sys/dev/aq/aq_media.c b/sys/dev/aq/aq_media.c index f961f3bb5f0f..655b060e7bd2 100644 --- a/sys/dev/aq/aq_media.c +++ b/sys/dev/aq/aq_media.c @@ -203,7 +203,7 @@ aq_initmedia(aq_dev_t *aq_dev) // ifconfig eth0 none ifmedia_add(aq_dev->media, IFM_ETHER | IFM_NONE, 0, NULL); - // ifconfig eth0 auto + ifmedia_add(aq_dev->media, IFM_ETHER | IFM_AUTO, 0, NULL); aq_add_media_types(aq_dev, IFM_AUTO); if (AQ_HW_SUPPORT_SPEED(aq_dev, AQ_LINK_100M)) diff --git a/sys/dev/aq/aq_ring.c b/sys/dev/aq/aq_ring.c index 51014ae0a9d7..900061437ddb 100644 --- a/sys/dev/aq/aq_ring.c +++ b/sys/dev/aq/aq_ring.c @@ -292,16 +292,10 @@ aq_isc_rxd_available(void *arg, uint16_t rxqid, qidx_t idx, qidx_t budget) cnt++; } else { - /* LRO/Jumbo: wait for whole packet be in the ring */ - if (rx_desc[i].wb.rsc_cnt) { - i = rx_desc[i].wb.next_desp; - iter++; - continue; - } else { - iter++; - i = aq_next(i, ring->rx_size - 1); - continue; - } + /* Jumbo frame spans descriptors; advance. */ + iter++; + i = aq_next(i, ring->rx_size - 1); + continue; } } @@ -356,13 +350,19 @@ aq_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) i = 0; do { + if (i >= aq_dev->sctx->isc_rx_nsegments) { + counter_u64_add(ring->stats.rx_err, 1); + rc = (EBADMSG); + goto exit; + } + rx_desc = (aq_rx_desc_t *) &ring->rx_descs[cidx]; trace_aq_rx_descr(ring->index, cidx, (volatile uint64_t *)rx_desc); if ((rx_desc->wb.rx_stat & BIT(0)) != 0) { - ring->stats.rx_err++; + counter_u64_add(ring->stats.rx_err, 1); rc = (EBADMSG); goto exit; } @@ -397,8 +397,8 @@ aq_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) ri->iri_len = total_len; ri->iri_nfrags = i; - ring->stats.rx_bytes += total_len; - ring->stats.rx_pkts++; + counter_u64_add(ring->stats.rx_bytes, total_len); + counter_u64_add(ring->stats.rx_pkts, 1); exit: AQ_DBG_EXIT(rc); @@ -551,8 +551,8 @@ aq_isc_txd_encap(void *arg, if_pkt_info_t pi) trace_aq_tx_descr(ring->index, pidx, (volatile void*)txd); ring->tx_tail = pidx; - ring->stats.tx_pkts++; - ring->stats.tx_bytes += pay_len; + counter_u64_add(ring->stats.tx_pkts, 1); + counter_u64_add(ring->stats.tx_bytes, pay_len); pi->ipi_new_pidx = pidx; @@ -592,6 +592,11 @@ aq_isc_txd_credits_update(void *arg, uint16_t txqid, bool clear) head = tdm_tx_desc_head_ptr_get(&aq_dev->hw, ring->index); AQ_DBG_PRINT("swhead %d hwhead %d", ring->tx_head, head); + if (head >= ring->tx_size) { + /* Malformed HW head; report no completions. */ + goto done; + } + if (ring->tx_head == head) { avail = 0; // ring->tx_size; goto done; diff --git a/sys/dev/aq/aq_ring.h b/sys/dev/aq/aq_ring.h index 2d3740802213..2f33fbf75d55 100644 --- a/sys/dev/aq/aq_ring.h +++ b/sys/dev/aq/aq_ring.h @@ -35,6 +35,8 @@ #ifndef _AQ_RING_H_ #define _AQ_RING_H_ +#include + #include "aq_hw.h" #define REFILL_THRESHOLD 128 @@ -130,16 +132,13 @@ typedef volatile union { } __attribute__((__packed__)) aq_txc_desc_t; struct aq_ring_stats { - uint64_t rx_pkts; - uint64_t rx_bytes; - uint64_t jumbo_pkts; - uint64_t rx_err; - uint64_t irq; - - uint64_t tx_pkts; - uint64_t tx_bytes; - uint64_t tx_drops; - uint64_t tx_queue_full; + counter_u64_t rx_pkts; + counter_u64_t rx_bytes; + counter_u64_t rx_err; + counter_u64_t irq; + + counter_u64_t tx_pkts; + counter_u64_t tx_bytes; }; struct aq_dev; From nobody Sat Jun 20 19:10:38 2026 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 4gjPDv2qyvz6hNjL for ; Sat, 20 Jun 2026 19:10: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjPDt73Vqz3v8m for ; Sat, 20 Jun 2026 19:10:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982639; 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; bh=WWtoTvAy4USvNJyhyIIwEnEkxyI/4bPM11ZLYlSJVf8=; b=HWBVx6btM+39OunVLGey0s22jhJF7Ub6ENIsmK4FUGLWddPpB2ckHZDBHuYC6NY65K3VOO uaCe2+/FiSvZ8nIARBpoDPve5P3EF/6zePs1ED1ix1exv4tuGw75TnOkiw80A9CWeM5YXb ddGuu3EUvwk4IY8guj1aMAWecCUrPbODkLzfdZc8xqDYD3labbhf7qB39uLd+NXFFrJHaj KML9vLLm8gCN7f+zyNn7flydHSVEPXgFCHJ9vvbbAkfCcoWqR38n+OWQNlBub3HRG4Xb6u nGxt2dCgCdEPfJm9HUe3MXB0jEFFAelaDOerr1p5/NwgZPf109NkrLnvifkuzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781982639; a=rsa-sha256; cv=none; b=qOXrcoGbnDnRRsMy8N068hR7Wt1k2jKvNxnLoNFhVXJXtZ5ZSyGjgyO10ZcGiI3RaxtGjE 6Es/DLfPeFyLk5oAK63K01UetYxF0xkxKZsTj4YduoZT2JYf22dwV8/zS0An+CbyVUZOlN 3oGo1Ar0+3hKdtj5E9SyzG43VarPQ4RfaiUXiuH5ryD+kc3R5PVobXZpfIuT/fXZSJjNcp gWb8P8BeKSoZo64A2cKCWc0HnMvzW7KxN+pm2I6RmX6N25woKaxeFhezDN51InxbMTGDAI 1NGyuN4tdSAO+OrcpSBDk5irQ440xSfN1MlGXq0QxM8kOl0daQNCeJO+s+XYlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982639; 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; bh=WWtoTvAy4USvNJyhyIIwEnEkxyI/4bPM11ZLYlSJVf8=; b=IlbwGFUL5rJ/6KdQIoUciAK2Ya5eJSuHLOwtFzyNbGq5XwQ1NvSHMunvr+vjYBEID0OH/s xhxW+86aMMRa47xV3tSsrAL3aMoQNUNsw9s9R2iW2xDKZgpFquw/IyIe8aW7J/Uc4ITO2i KYtsVXq9fgu6YRvcol//ZaEtTdrRmL5UF81j3kKWmpm836AkUsALpkSzDuLmyuVnGwLqpJ nG930aTz3KYCoGUlqvSTfg1lxkTJh0oOVeN2uYfM1642qTRJ/FFgkSlRHwHHQXomaKM1lB dUv6YQnUVgpMNzqqq3LXh4OuenttWy88ZO6XA26VceZGe7wZ8RZtphuUiOfC6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjPDt5xh6zkSK for ; Sat, 20 Jun 2026 19:10:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 32a6a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 19:10:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Nick Price From: Adrian Chadd Subject: git: b64408358d7f - main - aq(4): enable jumbo frames, software LRO, and suspend/resume 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: b64408358d7f27a69b84d9fd1e23e239e8bd00fc Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 19:10:38 +0000 Message-Id: <6a36e5ae.32a6a.42d0e22b@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=b64408358d7f27a69b84d9fd1e23e239e8bd00fc commit b64408358d7f27a69b84d9fd1e23e239e8bd00fc Author: Nick Price AuthorDate: 2026-06-20 19:03:00 +0000 Commit: Adrian Chadd CommitDate: 2026-06-20 19:10:15 +0000 aq(4): enable jumbo frames, software LRO, and suspend/resume - Configure the RX buffer size from the interface MTU and enable jumbo frames up to 9000 bytes, replacing the fixed standard-frame setup. - Advertise IFCAP_LRO so iflib coalesces received TCP segments with its software tcp_lro(9), like every other in-tree iflib driver (ix/igc/em/vmxnet3); aq does no hardware LRO. iflib builds the per-RX-queue LRO context unconditionally, so the capability bit is all that is required; enabled by default via isc_capenable, toggle at runtime with ifconfig. - Add suspend/shutdown/resume handlers, replacing the unimplemented- function placeholders. aq_if_shutdown/aq_if_suspend stop the interface and deinitialize the hardware; aq_if_resume re-resets the F/W, re-reads the mailbox address and re-selects fw_ops via aq_hw_mpi_create() before iflib re-inits, because the runtime init path (aq_hw_init) reuses the cached mailbox/fw_ops and a D3 power cycle can clear them. iflib calls IFDI_RESUME unconditionally, so this also covers resuming while the interface was administratively down. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57437 --- sys/dev/aq/aq_main.c | 49 ++++++++++++++++++++++++++++++------------------- sys/dev/aq/aq_ring.c | 2 +- 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/sys/dev/aq/aq_main.c b/sys/dev/aq/aq_main.c index c7701cc4f6d8..e159ce7e72ff 100644 --- a/sys/dev/aq/aq_main.c +++ b/sys/dev/aq/aq_main.c @@ -392,8 +392,8 @@ aq_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_csum_flags = CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_TSO; #if __FreeBSD__ >= 12 scctx->isc_capabilities = IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_HWCSUM | - IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_VLAN_HWFILTER | IFCAP_VLAN_MTU | - IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM; + IFCAP_TSO | IFCAP_LRO | IFCAP_JUMBO_MTU | IFCAP_VLAN_HWFILTER | + IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM; scctx->isc_capenable = scctx->isc_capabilities; #else if_t ifp; @@ -408,6 +408,8 @@ aq_if_attach_pre(if_ctx_t ctx) HW_ATL_B0_TSO_SIZE - sizeof(struct ether_vlan_header); scctx->isc_tx_tso_segsize_max = HW_ATL_B0_MTU_JUMBO; scctx->isc_min_frame_size = 52; + scctx->isc_max_frame_size = ETHERMTU + ETHER_HDR_LEN + ETHER_CRC_LEN + + ETHER_VLAN_ENCAP_LEN; scctx->isc_txrx = &aq_txrx; scctx->isc_txqsizes[0] = sizeof(aq_tx_desc_t) * scctx->isc_ntxd[0]; @@ -512,21 +514,18 @@ aq_if_detach(if_ctx_t ctx) static int aq_if_shutdown(if_ctx_t ctx) { - - AQ_DBG_ENTER(); - - AQ_XXX_UNIMPLEMENTED_FUNCTION; - - AQ_DBG_EXIT(0); - return (0); + return (aq_if_suspend(ctx)); } static int aq_if_suspend(if_ctx_t ctx) { + struct aq_dev *softc = iflib_get_softc(ctx); + AQ_DBG_ENTER(); - AQ_XXX_UNIMPLEMENTED_FUNCTION; + aq_if_stop(ctx); + aq_hw_deinit(&softc->hw); AQ_DBG_EXIT(0); return (0); @@ -535,12 +534,13 @@ aq_if_suspend(if_ctx_t ctx) static int aq_if_resume(if_ctx_t ctx) { - AQ_DBG_ENTER(); - - AQ_XXX_UNIMPLEMENTED_FUNCTION; + struct aq_dev *softc = iflib_get_softc(ctx); + int err; - AQ_DBG_EXIT(0); - return (0); + AQ_DBG_ENTER(); + err = aq_hw_mpi_create(&softc->hw); + AQ_DBG_EXIT(err); + return (err); } _Static_assert(sizeof(struct aq_ring_stats) % sizeof(counter_u64_t) == 0, @@ -755,6 +755,7 @@ aq_if_init(if_ctx_t ctx) } for (i = 0; i < softc->rx_rings_count; i++) { struct aq_ring *ring = softc->rx_rings[i]; + ring->rx_max_frame_size = iflib_get_rx_mbuf_sz(ctx); err = aq_ring_rx_init(&softc->hw, ring); if (err) { device_printf(softc->dev, @@ -901,11 +902,21 @@ aq_if_multi_set(if_ctx_t ctx) static int aq_if_mtu_set(if_ctx_t ctx, uint32_t mtu) { - int err = 0; - AQ_DBG_ENTER(); + if_softc_ctx_t scctx = iflib_get_softc_ctx(ctx); + uint32_t max_frame; - AQ_DBG_EXIT(err); - return (err); + AQ_DBG_ENTERA("mtu %u", mtu); + + max_frame = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN; + if (max_frame > HW_ATL_B0_MTU_JUMBO) { + AQ_DBG_EXIT(EINVAL); + return (EINVAL); + } + + scctx->isc_max_frame_size = max_frame; + + AQ_DBG_EXIT(0); + return (0); } static void diff --git a/sys/dev/aq/aq_ring.c b/sys/dev/aq/aq_ring.c index 900061437ddb..9b7f6ae2bf0e 100644 --- a/sys/dev/aq/aq_ring.c +++ b/sys/dev/aq/aq_ring.c @@ -371,7 +371,7 @@ aq_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) len = ring->rx_max_frame_size; } else { total_len = le32toh(rx_desc->wb.pkt_len); - len = total_len & (ring->rx_max_frame_size - 1); + len = total_len - (size_t)i * ring->rx_max_frame_size; } ri->iri_frags[i].irf_flid = 0; ri->iri_frags[i].irf_idx = cidx; From nobody Sat Jun 20 19:10:34 2026 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 4gjPDw3WLVz6hNp9 for ; Sat, 20 Jun 2026 19:10: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjPDv5Ptmz3v43 for ; Sat, 20 Jun 2026 19:10:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982639; 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; bh=etUp6IikYdO2ILXpVAg5wtYjGEPPgLmxgeapc71tGdA=; b=Q3pXRbg1mO7YxLeGFyewgfUUE/fuzmwdUfm3kJrSQGqDWJDlnksqN5EGv+qmiHC6gRLYcx S+epxMrxglAs4RiKXI4/k35kJ5/+SmTLzQtrW7FA0V7Q/B98WHju+JhXq0m6/zmlzJmdU5 8hC2OtTUtyNedh46ltZmx1+zKpDTHVFatj2nlilCtEF/aG3AdsWRxUSlCbosK7uS3fkHs4 eZxbHz+WwyqkKw4HjcOTBiM/uPXUTQoBOod/2pAii2LXajy0GoX2BusT1w7EmKsY2q+kfx YjJam1Ws3xktKcrdE2rFlv7x1OrEqtxEn0DFPaKbTlx/RUlvh2yv7Nbuxeux7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781982639; a=rsa-sha256; cv=none; b=pIWxG4PGWVAL30Y2tgzessO5IPSxAws0y+SxKY7lh64HMNDE7rnG8UTrIBG5Mi0T0YyGBe E1OXLIpiVl5fR2xctSPNNZOSlm0W/rclHmKHjybR6VoW3w+pogoxTRUq+zLtaI5BhLwGAP itHrqKAQ2tZGD45mQEyqiplumnLg3ZEBIqO4k+G/5ZQeO/WdB4c7DtRgFP6cLy6ot61xX8 foYOtLHFcWorW5IDLolxNlqhXasgfq3yfjRz83xL6Z/qpBkT0PtnbOKe8/RiVnS9MAPUJH 29bvLbecvyylw9HCDBeG607cjq19lyu1gz1h14RR+xN+zGbs761opq2WP6ttiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982639; 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; bh=etUp6IikYdO2ILXpVAg5wtYjGEPPgLmxgeapc71tGdA=; b=v9n/1H3iApn6azZ5ZcF3TJOap0tl1X+n+7chjElt1JWMCrx6xz2XuSTVz5KPCeardUl/XP /a3wbCr87xvkjfLQ7h/ZNvzY9qFx0W0xMWJWJiLfKMR1g5AqPoYmxXe5N1g1fNyTsBkmol eB+0tW96PyPM/PaIb/z9oVJ/rWolTRA21i8nqZeRhuZsfcxxXzdEpr9RZj8lgntUjGv5jQ pIAjOPthK0vOLba28nxvCCGFF2/aw9QmSeEsYgJNqlUJEuS8ridbqolh/miyRm5gMarR18 /AA3/9EtH8GDYSo9JvxBDFS+S6kZKN0qQVP+Y1qihAyaYboIf4+wICjJwZkFJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjPDv4QDyzk6T for ; Sat, 20 Jun 2026 19:10:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3364c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 19:10:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Nick Price From: Adrian Chadd Subject: git: 57f5252ff8a1 - main - aq(4): Fix RSS indirection table OOB write and queue distribution 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 57f5252ff8a17aa837f677638cce5885b8a5fb3b Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 19:10:34 +0000 Message-Id: <6a36e5aa.3364c.1c16886e@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=57f5252ff8a17aa837f677638cce5885b8a5fb3b commit 57f5252ff8a17aa837f677638cce5885b8a5fb3b Author: Nick Price AuthorDate: 2026-06-20 19:02:22 +0000 Commit: Adrian Chadd CommitDate: 2026-06-20 19:10:15 +0000 aq(4): Fix RSS indirection table OOB write and queue distribution Two related fixes to `aq(4)`'s RSS indirection table handling: 1. Fix an out-of-bounds stack write in `aq_hw_rss_set()`. RSS table entries are 3 bits (8 queues max), but with more than 8 RX rings `rss_table[]` holds larger values; the 32-bit write then spills one `uint16_t` past `bitary[]` and corrupts the stack, so the NIC never links or the kernel panics. Mask each value to 3 bits and pack 16 bits at a time to keep the write in bounds. 2. Build the indirection table in `aq_if_attach_post()` with a modulo over `min(rx_rings_count, HW_ATL_RSS_INDIRECTION_QUEUES_MAX)` instead of `i & (rx_rings_count - 1)`, which assumed a power-of-two ring count. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57240 --- sys/dev/aq/aq_hw.c | 12 ++++++++++-- sys/dev/aq/aq_hw.h | 2 ++ sys/dev/aq/aq_main.c | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/sys/dev/aq/aq_hw.c b/sys/dev/aq/aq_hw.c index f73805a939cd..5a45e61041c3 100644 --- a/sys/dev/aq/aq_hw.c +++ b/sys/dev/aq/aq_hw.c @@ -878,8 +878,16 @@ aq_hw_rss_set(struct aq_hw_s *self, memset(bitary, 0, sizeof(bitary)); for (i = HW_ATL_RSS_INDIRECTION_TABLE_MAX; i--;) { - (*(uint32_t *)(bitary + ((i * 3U) / 16U))) |= - ((rss_table[i]) << ((i * 3U) & 0xFU)); + uint32_t bit_pos = i * HW_ATL_RSS_INDIRECTION_ENTRY_BITS; + uint32_t word = bit_pos / 16U; + uint32_t shift = bit_pos % 16U; + uint32_t field = (uint32_t)(rss_table[i] & + (HW_ATL_RSS_INDIRECTION_QUEUES_MAX - 1U)) << shift; + + bitary[word] |= (uint16_t)field; + if (shift + HW_ATL_RSS_INDIRECTION_ENTRY_BITS > 16U && + word + 1U < ARRAY_SIZE(bitary)) + bitary[word + 1U] |= (uint16_t)(field >> 16); } for (i = ARRAY_SIZE(bitary); i--;) { diff --git a/sys/dev/aq/aq_hw.h b/sys/dev/aq/aq_hw.h index a4d4dbb3a512..bdd79871fd76 100644 --- a/sys/dev/aq/aq_hw.h +++ b/sys/dev/aq/aq_hw.h @@ -197,6 +197,8 @@ struct aq_hw { #define HW_ATL_RSS_INDIRECTION_TABLE_MAX 64U #define HW_ATL_RSS_HASHKEY_SIZE 40U +#define HW_ATL_RSS_INDIRECTION_QUEUES_MAX 8U +#define HW_ATL_RSS_INDIRECTION_ENTRY_BITS 3U /* PCI core control register */ #define AQ_HW_PCI_REG_CONTROL_6_ADR 0x1014U diff --git a/sys/dev/aq/aq_main.c b/sys/dev/aq/aq_main.c index 2ed9bd050780..e893bb7f73b3 100644 --- a/sys/dev/aq/aq_main.c +++ b/sys/dev/aq/aq_main.c @@ -466,8 +466,9 @@ aq_if_attach_post(if_ctx_t ctx) aq_add_stats_sysctls(softc); /* RSS */ arc4rand(softc->rss_key, HW_ATL_RSS_HASHKEY_SIZE, 0); + uint32_t rss_qs = MIN(softc->rx_rings_count, HW_ATL_RSS_INDIRECTION_QUEUES_MAX); for (int i = ARRAY_SIZE(softc->rss_table); i--;){ - softc->rss_table[i] = i & (softc->rx_rings_count - 1); + softc->rss_table[i] = i % rss_qs; } exit: AQ_DBG_EXIT(rc); From nobody Sat Jun 20 19:10:39 2026 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 4gjPDw50x9z6hNg9 for ; Sat, 20 Jun 2026 19:10: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjPDw2lJJz3tvq for ; Sat, 20 Jun 2026 19:10:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982640; 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; bh=d59QYY+bGJCAp6AOvMBYjop7X9/9ZvrLY8HrIX8Z5qg=; b=Gvq+69wYUTcC+B0V+xr4KpMw6v0b4mXYI0Mq73eWAdItV2rtAIQXNfqQRwlkxs4AL/hoqh DNZs2h355y+VCSkXoqU4v8Jw86EvPoYh1YWBTtSx+kvVonPdp5UwG0AuBT+fgmsiGaDvmf oNoIGSHP71P10ZwRym9EqVFElsE3+339HQUEaQOVbZGJ6vgoELNsZN6HSrQX6hi3GVOOk9 1+kbkXahPXoKzmQl5AxIki8j2TbGAW0jqQZEuqVeMo/iIj1Q9/N/ssCWLlxl7ETWaVBJsJ QWfRR9gRVaIT2nPgX2fRQDfMRKU2BMJESTYqL7fBYcz/JwPtUt4OEK+ploACkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781982640; a=rsa-sha256; cv=none; b=Zl+EkWcbHhv5SysDK4AhzlwGHbi2jykXX3MobQYCfl/wQ6zxcXdZkauiItM3e00YGiarRF dMgDyI56JKl0JVyXddmUhCwthxM56KuUEPqAZ3dlmvMZySzKgoO59adg/eo9cmdp5Qk5/z S8+qhu6M/Xm7XHH41tBr8i+215c4HI4f4S8uKJDbGVG35GUQWa62pux0x9I/jibRbESMMc /GPGbwW54e482fnxmspjZGudwAr34DZo00x/5EveB1vq/Kx8XvBDZoKj2g6h4UCciZDqFp 3uEd4j4GVS/O0of4GyTNFo+dKMiciIdUOmSVYAiVbuIVKlMnJZWX8uvXcxiB3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982640; 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; bh=d59QYY+bGJCAp6AOvMBYjop7X9/9ZvrLY8HrIX8Z5qg=; b=H9to0J4+Ff+9W88J2kWb0Fopg1XKWJOvKNuCyoFzKvDqEyi521g04XMCu8jzK9/EFsFkk6 bTeG1jh3lAdAoL6ogVqi9F6KP4ZEkUg/nJUnehiAORPizPYPGQKzeoYUFo8x7yjP/DD3Cj uKAFGS2lOpW4uOuvF5DVczjnHd3jk/DDUEeZgmxc1G+eQsst0luxfSVBy70bPMkxx/W/hS pMaQu1LYAJwkKTwCxaPUrSlgRsKHRCijiicBdHsnJ9XQnWSY+ECD956kg3JwJYxaMqI2iy kV9weCFJxPigsBIxNVLE8VPcig7HaviNlsd99n452L7udc3wO0ThySHHVmh/Jw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjPDv6w2czkTs for ; Sat, 20 Jun 2026 19:10:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 34416 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 19:10:39 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Nick Price From: Adrian Chadd Subject: git: 5409e03a0ef1 - main - aq(4): modernize and de-Linuxify the vendor driver 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 5409e03a0ef1f2d71da94bedd433fbaa7b6b21f2 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 19:10:39 +0000 Message-Id: <6a36e5af.34416.2b6701db@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=5409e03a0ef1f2d71da94bedd433fbaa7b6b21f2 commit 5409e03a0ef1f2d71da94bedd433fbaa7b6b21f2 Author: Nick Price AuthorDate: 2026-06-20 19:03:09 +0000 Commit: Adrian Chadd CommitDate: 2026-06-20 19:10:16 +0000 aq(4): modernize and de-Linuxify the vendor driver Dead-code removal, device_printf(9) logging, style(9) de-Linuxification, const F/W-ops tables, and readability cleanups. No change for valid traffic. Dead code and logging: - Remove the sub-gigabit TSO-masking block in the link-state ISR: it cleared IFCAP_TSO from the static isc_capabilities record (read only at attach / SIOCSIFCAP, never on the datapath), so it never gated TSO and only corrupted the validation mask. The Atlantic has no sub-gigabit TSO erratum. - Tidy the RX buffer-size handling: drop the dead switch(MCLBYTES) in aq_if_rx_queues_alloc, rename rx_max_frame_size -> rx_buf_size, and bound the per-fragment length from the wb.pkt_len writeback (EBADMSG on underflow or a final fragment longer than the RX buffer). - Drop every __FreeBSD__/__FreeBSD_version branch (FreeBSD 14.0 baseline); the pre-13 arms used pre-opaque-if_t APIs since removed and one never built. - Route all log messages through device_printf(9) (MAC via %6D), adding a device_t to struct aq_hw; drop the dead AQ_XXX_UNIMPLEMENTED_FUNCTION and aq_log_error macros and the per-ring init console spam. - Minor: comma -> semicolon in aq_if_attach_pre; (uint64_t) -> (uint32_t) TX high-word cast; MODULE_VERSION(atlantic, 1); remove unused/duplicate #includes. style(9) and types: - Remove all typedef'd struct/enum/union types (aq_dev_t, the speed/fc/ debug enums, the volatile RX/TX descriptor types, the firmware-file types) in favor of bare tags; for the DMA descriptors the volatile qualifier moves to the pointer/use sites. Drop the _s/_e tag suffixes and the "#define aq_hw_s aq_hw" alias. Rename the OOP-style *self parameter to hw. Replace usec_delay/msec_delay/ARRAY_SIZE/LOWORD with FreeBSD equivalents (BIT kept). __attribute__((__packed__)) -> __packed. F/W-ops vtable: - Rename the leftover hal parameter to hw; make aq_fw1x_ops/aq_fw2x_ops const (read-only data); drop the always-true "fw_ops &&" and always-present dispatch guards (only led_control, absent in F/W 1.x, keeps its NULL check). Readability: - aq_isc_rxd_pkt_get: fold the four identical RX-error blocks into one rx_err: label. aq_isc_rxd_available: hoist the shared descriptor advance out of the EOP test and drop the redundant continue. aq_hw_offload_set: drop the dead "int err = 0". Fix a stale "10 ms" comment on a 50 ms DELAY and the redundant literal parentheses. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57438 --- sys/dev/aq/aq_common.h | 12 +--- sys/dev/aq/aq_dbg.c | 2 +- sys/dev/aq/aq_dbg.h | 11 ++-- sys/dev/aq/aq_device.h | 16 +++-- sys/dev/aq/aq_fw.c | 49 ++++++++------- sys/dev/aq/aq_fw.h | 20 +++---- sys/dev/aq/aq_fw1x.c | 56 +++++++++--------- sys/dev/aq/aq_fw2x.c | 80 ++++++++++++------------- sys/dev/aq/aq_hw.c | 157 ++++++++++++++++++++++--------------------------- sys/dev/aq/aq_hw.h | 42 ++++++------- sys/dev/aq/aq_hw_llh.c | 86 +++++++++++++-------------- sys/dev/aq/aq_irq.c | 17 +----- sys/dev/aq/aq_main.c | 104 ++++++-------------------------- sys/dev/aq/aq_media.c | 13 ++-- sys/dev/aq/aq_ring.c | 88 ++++++++++++--------------- sys/dev/aq/aq_ring.h | 26 ++++---- 16 files changed, 328 insertions(+), 451 deletions(-) diff --git a/sys/dev/aq/aq_common.h b/sys/dev/aq/aq_common.h index 6529f249ff62..5c497d071802 100644 --- a/sys/dev/aq/aq_common.h +++ b/sys/dev/aq/aq_common.h @@ -40,24 +40,14 @@ #define BIT(nr) (1UL << (nr)) -#define usec_delay(x) DELAY(x) - -#ifndef msec_delay -#define msec_delay(x) DELAY(x*1000) -#define msec_delay_irq(x) DELAY(x*1000) -#endif - #define AQ_HW_WAIT_FOR(_B_, _US_, _N_) ({ \ unsigned int _i; \ for (_i = (_N_); !(_B_) && _i; --_i) \ - usec_delay(_US_); \ + DELAY(_US_); \ (_i == 0) ? ETIMEDOUT : 0; \ }) -#define LOWORD(a) ((uint16_t)(a)) -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) - #define AQ_VER "0.0.5" #endif // _AQ_COMMON_H_ diff --git a/sys/dev/aq/aq_dbg.c b/sys/dev/aq/aq_dbg.c index bed29b3d0755..ec3954185749 100644 --- a/sys/dev/aq/aq_dbg.c +++ b/sys/dev/aq/aq_dbg.c @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include "aq_dbg.h" -const aq_debug_level dbg_level_ = lvl_detail; +const enum aq_debug_level dbg_level_ = lvl_detail; const uint32_t dbg_categories_ = dbg_init | dbg_config | dbg_fw; diff --git a/sys/dev/aq/aq_dbg.h b/sys/dev/aq/aq_dbg.h index d90a8599e085..280572e7d5da 100644 --- a/sys/dev/aq/aq_dbg.h +++ b/sys/dev/aq/aq_dbg.h @@ -88,15 +88,15 @@ Debug levels: #define AQ_DBG_DUMP_DESC(desc) #endif -typedef enum aq_debug_level +enum aq_debug_level { lvl_error = LOG_ERR, lvl_warn = LOG_WARNING, lvl_trace = LOG_NOTICE, lvl_detail = LOG_INFO, -} aq_debug_level; +}; -typedef enum aq_debug_category +enum aq_debug_category { dbg_init = 1, dbg_config = 1 << 1, @@ -104,12 +104,12 @@ typedef enum aq_debug_category dbg_rx = 1 << 3, dbg_intr = 1 << 4, dbg_fw = 1 << 5, -} aq_debug_category; +}; #define __FILENAME__ (__builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__) -extern const aq_debug_level dbg_level_; +extern const enum aq_debug_level dbg_level_; extern const uint32_t dbg_categories_; #define log_base_(_lvl, _fmt, args...) printf( "atlantic: " _fmt "\n", ##args) @@ -120,7 +120,6 @@ extern const uint32_t dbg_categories_; #define trace_base_(_lvl, _cat, _fmt, ...) do {} while (0) #endif // AQ_CFG_DEBUG_LVL > 0 -#define aq_log_error(_fmt, args...) log_base_(lvl_error, "[!] " _fmt, ##args) #define aq_log_warn(_fmt, args...) log_base_(lvl_warn, "/!\\ " _fmt, ##args) #define aq_log(_fmt, args...) log_base_(lvl_trace, _fmt, ##args) #define aq_log_detail(_fmt, args...) log_base_(lvl_detail, _fmt, ##args) diff --git a/sys/dev/aq/aq_device.h b/sys/dev/aq/aq_device.h index 64edbd138b3a..23785c1854c5 100644 --- a/sys/dev/aq/aq_device.h +++ b/sys/dev/aq/aq_device.h @@ -53,7 +53,7 @@ enum aq_media_type { #define AQ_LINK_ALL (AQ_LINK_100M | AQ_LINK_1G | AQ_LINK_2G5 | AQ_LINK_5G | \ AQ_LINK_10G ) -struct aq_stats_s { +struct aq_stats { uint64_t prc; uint64_t uprc; uint64_t mprc; @@ -77,7 +77,7 @@ struct aq_stats_s { uint64_t bbtc; }; -enum aq_dev_state_e { +enum aq_dev_state { AQ_DEV_STATE_UNLOAD, AQ_DEV_STATE_PCI_STOP, AQ_DEV_STATE_DOWN, @@ -126,8 +126,8 @@ struct aq_dev { bool linkup; int media_active; - struct aq_hw_stats_s last_stats; - struct aq_stats_s curr_stats; + struct aq_hw_stats last_stats; + struct aq_stats curr_stats; bitstr_t *vlan_tags; int mcnt; @@ -136,13 +136,11 @@ struct aq_dev { uint8_t rss_table[HW_ATL_RSS_INDIRECTION_TABLE_MAX]; }; -typedef struct aq_dev aq_dev_t; - -int aq_update_hw_stats(aq_dev_t *aq_dev); -void aq_initmedia(aq_dev_t *aq_dev); +int aq_update_hw_stats(struct aq_dev *aq_dev); +void aq_initmedia(struct aq_dev *aq_dev); int aq_linkstat_isr(void *arg); int aq_isr_rx(void *arg); -void aq_mediastatus_update(aq_dev_t *aq_dev, uint32_t link_speed, const struct aq_hw_fc_info *fc_neg); +void aq_mediastatus_update(struct aq_dev *aq_dev, uint32_t link_speed, const struct aq_hw_fc_info *fc_neg); void aq_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr); int aq_mediachange(struct ifnet *ifp); void aq_if_update_admin_status(if_ctx_t ctx); diff --git a/sys/dev/aq/aq_fw.c b/sys/dev/aq/aq_fw.c index 487137e9c61e..7f9496add875 100644 --- a/sys/dev/aq/aq_fw.c +++ b/sys/dev/aq/aq_fw.c @@ -48,18 +48,17 @@ __FBSDID("$FreeBSD$"); #include "aq_hw_llh_internal.h" #include "aq_fw.h" -#include "aq_common.h" #include "aq_dbg.h" -typedef enum aq_fw_bootloader_mode +enum aq_fw_bootloader_mode { boot_mode_unknown = 0, boot_mode_flb, boot_mode_rbl_flash, boot_mode_rbl_host_bootload, -} aq_fw_bootloader_mode; +}; #define AQ_CFG_HOST_BOOT_DISABLE 0 @@ -86,13 +85,13 @@ const uint32_t RBL_STATUS_HOST_BOOT = 0xf1a7; const uint32_t SCRATCHPAD_FW_LOADER_STATUS = (0x40 / sizeof(uint32_t)); -extern struct aq_firmware_ops aq_fw1x_ops; -extern struct aq_firmware_ops aq_fw2x_ops; +extern const struct aq_firmware_ops aq_fw1x_ops; +extern const struct aq_firmware_ops aq_fw2x_ops; -int mac_soft_reset_(struct aq_hw* hw, aq_fw_bootloader_mode* mode); +int mac_soft_reset_(struct aq_hw* hw, enum aq_fw_bootloader_mode* mode); int mac_soft_reset_flb_(struct aq_hw* hw); -int mac_soft_reset_rbl_(struct aq_hw* hw, aq_fw_bootloader_mode* mode); +int mac_soft_reset_rbl_(struct aq_hw* hw, enum aq_fw_bootloader_mode* mode); int wait_init_mac_firmware_(struct aq_hw* hw); @@ -111,7 +110,7 @@ aq_fw_reset(struct aq_hw* hw) } if (k == 1000) { - aq_log_error("Neither RBL nor FLB started"); + device_printf(hw->dev, "Neither RBL nor FLB started\n"); return (EBUSY); } @@ -131,10 +130,10 @@ aq_fw_reset(struct aq_hw* hw) return (0); } - aq_fw_bootloader_mode mode = boot_mode_unknown; + enum aq_fw_bootloader_mode mode = boot_mode_unknown; int err = mac_soft_reset_(hw, &mode); if (err != 0) { - aq_log_error("MAC reset failed: %d", err); + device_printf(hw->dev, "MAC reset failed: %d\n", err); return (err); } @@ -150,12 +149,12 @@ aq_fw_reset(struct aq_hw* hw) return wait_init_mac_firmware_(hw); case boot_mode_unknown: - aq_log_error("F/W bootload error: unknown bootloader type"); + device_printf(hw->dev, "F/W bootload error: unknown bootloader type\n"); return (ENOTSUP); case boot_mode_rbl_host_bootload: #if AQ_CFG_HOST_BOOT_DISABLE - aq_log_error("RBL> Host Bootload mode: this driver does not support Host Boot"); + device_printf(hw->dev, "RBL> Host Bootload mode: this driver does not support Host Boot\n"); return (ENOTSUP); #else trace(dbg_init, "RBL> Host Bootload mode"); @@ -166,7 +165,7 @@ aq_fw_reset(struct aq_hw* hw) /* * #todo: Host Boot */ - aq_log_error("RBL> F/W Host Bootload not implemented"); + device_printf(hw->dev, "RBL> F/W Host Bootload not implemented\n"); return (ENOTSUP); } @@ -191,14 +190,14 @@ aq_fw_ops_init(struct aq_hw* hw) return (0); } - aq_log_error("aq_fw_ops_init(): invalid F/W version %#x", + device_printf(hw->dev, "aq_fw_ops_init(): invalid F/W version %#x\n", hw->fw_version.raw); return (ENOTSUP); } int -mac_soft_reset_(struct aq_hw* hw, aq_fw_bootloader_mode* mode /*= nullptr*/) +mac_soft_reset_(struct aq_hw* hw, enum aq_fw_bootloader_mode* mode /*= nullptr*/) { if (hw->rbl_enabled) { return mac_soft_reset_rbl_(hw, mode); @@ -218,7 +217,7 @@ mac_soft_reset_flb_(struct aq_hw* hw) reg_global_ctl2_set(hw, 0x40e1); // Let Felicity hardware complete SMBUS transaction before Global // software reset. - msec_delay(50); + DELAY((50) * 1000); /* * If SPI burst transaction was interrupted(before running the script), @@ -228,7 +227,7 @@ mac_soft_reset_flb_(struct aq_hw* hw) reg_glb_nvr_provisioning2_set(hw, 0xa0); reg_glb_nvr_interface1_set(hw, 0x9f); reg_glb_nvr_interface1_set(hw, 0x809f); - msec_delay(50); + DELAY((50) * 1000); reg_glb_standard_ctl1_set(hw, (reg_glb_standard_ctl1_get(hw) & ~glb_reg_res_dis_msk) | glb_soft_res_msk); @@ -242,7 +241,7 @@ mac_soft_reset_flb_(struct aq_hw* hw) * For the case SPI burst transaction was interrupted (by MCP reset * above), wait until it is completed by hardware. */ - msec_delay(50); // Sleep for 10 ms. + DELAY(50 * 1000); /* MAC Kickstart */ if (!hw->fast_start_enabled) { @@ -254,7 +253,7 @@ mac_soft_reset_flb_(struct aq_hw* hw) flb_status = reg_glb_daisy_chain_status1_get(hw) & 0x10; if (flb_status != 0) break; - msec_delay(10); // Sleep for 10 ms. + DELAY(10 * 1000); } if (flb_status == 0) { @@ -268,7 +267,7 @@ mac_soft_reset_flb_(struct aq_hw* hw) reg_global_ctl2_set(hw, 0x80e0); // Let Felicity hardware complete SMBUS transaction before // Global software reset. - msec_delay(50); + DELAY((50) * 1000); } reg_glb_cpu_sem_set(hw, 1, 0); @@ -285,7 +284,7 @@ mac_soft_reset_flb_(struct aq_hw* hw) restart_completed = reg_glb_fw_image_id1_get(hw) != 0; if (restart_completed) break; - msec_delay(10); + DELAY((10) * 1000); } if (!restart_completed) { @@ -298,7 +297,7 @@ mac_soft_reset_flb_(struct aq_hw* hw) } int -mac_soft_reset_rbl_(struct aq_hw* hw, aq_fw_bootloader_mode* mode) +mac_soft_reset_rbl_(struct aq_hw* hw, enum aq_fw_bootloader_mode* mode) { trace(dbg_init, "RBL> MAC reset STARTED!"); @@ -322,11 +321,11 @@ mac_soft_reset_rbl_(struct aq_hw* hw, aq_fw_bootloader_mode* mode) // Wait for RBL to finish boot process. uint16_t rbl_status = 0; for (int k = 0; k < RBL_TIMEOUT_MS; ++k) { - rbl_status = LOWORD(reg_glb_cpu_no_reset_scratchpad_get(hw, NO_RESET_SCRATCHPAD_RBL_STATUS)); + rbl_status = ((uint16_t)(reg_glb_cpu_no_reset_scratchpad_get(hw, NO_RESET_SCRATCHPAD_RBL_STATUS))); if (rbl_status != 0 && rbl_status != 0xDEAD) break; - msec_delay(1); + DELAY((1) * 1000); } if (rbl_status == 0 || rbl_status == 0xDEAD) { @@ -357,7 +356,7 @@ wait_init_mac_firmware_(struct aq_hw* hw) if ((hw->fw_version.raw = AQ_READ_REG(hw, 0x18)) != 0) return (0); - msec_delay(1); + DELAY((1) * 1000); } trace_error(dbg_init, diff --git a/sys/dev/aq/aq_fw.h b/sys/dev/aq/aq_fw.h index ea2c37b6c92c..9195c91d6b5f 100644 --- a/sys/dev/aq/aq_fw.h +++ b/sys/dev/aq/aq_fw.h @@ -36,7 +36,7 @@ struct aq_hw; -typedef enum aq_fw_link_speed +enum aq_fw_link_speed { aq_fw_none = 0, aq_fw_100M = (1 << 0), @@ -44,30 +44,30 @@ typedef enum aq_fw_link_speed aq_fw_2G5 = (1 << 2), aq_fw_5G = (1 << 3), aq_fw_10G = (1 << 4), -} aq_fw_link_speed_t; +}; -typedef enum aq_fw_link_fc +enum aq_fw_link_fc { aq_fw_fc_none = 0, aq_fw_fc_ENABLE_RX = BIT(0), aq_fw_fc_ENABLE_TX = BIT(1), aq_fw_fc_ENABLE_ALL = aq_fw_fc_ENABLE_RX | aq_fw_fc_ENABLE_TX, -} aq_fw_link_fc_t; +}; #define aq_fw_speed_auto \ (aq_fw_100M | aq_fw_1G | aq_fw_2G5 | aq_fw_5G | aq_fw_10G) struct aq_firmware_ops { - int (*reset)(struct aq_hw* hal); + int (*reset)(struct aq_hw* hw); - int (*set_mode)(struct aq_hw* hal, enum aq_hw_fw_mpi_state_e mode, aq_fw_link_speed_t speed); - int (*get_mode)(struct aq_hw* hal, enum aq_hw_fw_mpi_state_e* mode, aq_fw_link_speed_t* speed, aq_fw_link_fc_t* fc); + int (*set_mode)(struct aq_hw* hw, enum aq_hw_fw_mpi_state mode, enum aq_fw_link_speed speed); + int (*get_mode)(struct aq_hw* hw, enum aq_hw_fw_mpi_state* mode, enum aq_fw_link_speed* speed, enum aq_fw_link_fc* fc); - int (*get_mac_addr)(struct aq_hw* hal, uint8_t* mac_addr); - int (*get_stats)(struct aq_hw* hal, struct aq_hw_stats_s* stats); + int (*get_mac_addr)(struct aq_hw* hw, uint8_t* mac_addr); + int (*get_stats)(struct aq_hw* hw, struct aq_hw_stats* stats); - int (*led_control)(struct aq_hw* hal, uint32_t mode); + int (*led_control)(struct aq_hw* hw, uint32_t mode); }; diff --git a/sys/dev/aq/aq_fw1x.c b/sys/dev/aq/aq_fw1x.c index f5458b174c3f..731370e94f3e 100644 --- a/sys/dev/aq/aq_fw1x.c +++ b/sys/dev/aq/aq_fw1x.c @@ -49,14 +49,14 @@ __FBSDID("$FreeBSD$"); #define FW1X_MPI_STATE_ADR 0x36C -typedef enum fw1x_mode { +enum fw1x_mode { FW1X_MPI_DEINIT = 0, FW1X_MPI_RESERVED = 1, FW1X_MPI_INIT = 2, FW1X_MPI_POWER = 4, -} fw1x_mode; +}; -typedef enum aq_fw1x_rate { +enum aq_fw1x_rate { FW1X_RATE_10G = 1 << 0, FW1X_RATE_5G = 1 << 1, FW1X_RATE_5GSR = 1 << 2, @@ -64,9 +64,9 @@ typedef enum aq_fw1x_rate { FW1X_RATE_1G = 1 << 4, FW1X_RATE_100M = 1 << 5, FW1X_RATE_INVALID = 1 << 6, -} aq_fw1x_rate; +}; -typedef union fw1x_state_reg { +union fw1x_state_reg { uint32_t val; struct { uint8_t mode; @@ -77,20 +77,20 @@ typedef union fw1x_state_reg { uint8_t reserved3 : 2; uint8_t downshift : 4; }; -} fw1x_state_reg; +}; int fw1x_reset(struct aq_hw* hw); -int fw1x_set_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state_e mode, - aq_fw_link_speed_t speed); -int fw1x_get_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state_e* mode, - aq_fw_link_speed_t* speed, aq_fw_link_fc_t* fc); +int fw1x_set_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state mode, + enum aq_fw_link_speed speed); +int fw1x_get_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state* mode, + enum aq_fw_link_speed* speed, enum aq_fw_link_fc* fc); int fw1x_get_mac_addr(struct aq_hw* hw, uint8_t* mac_addr); -int fw1x_get_stats(struct aq_hw* hw, struct aq_hw_stats_s* stats); +int fw1x_get_stats(struct aq_hw* hw, struct aq_hw_stats* stats); -static fw1x_mode -mpi_mode_to_fw1x_(enum aq_hw_fw_mpi_state_e mode) +static enum fw1x_mode +mpi_mode_to_fw1x_(enum aq_hw_fw_mpi_state mode) { switch (mode) { case MPI_DEINIT: @@ -113,7 +113,7 @@ mpi_mode_to_fw1x_(enum aq_hw_fw_mpi_state_e mode) return (FW1X_MPI_RESERVED); } -static aq_fw1x_rate +static enum aq_fw1x_rate link_speed_mask_to_fw1x_(uint32_t /*aq_fw_link_speed*/ speed) { uint32_t rate = 0; @@ -134,11 +134,11 @@ link_speed_mask_to_fw1x_(uint32_t /*aq_fw_link_speed*/ speed) if (speed & aq_fw_100M) rate |= FW1X_RATE_100M; - return ((aq_fw1x_rate)rate); + return ((enum aq_fw1x_rate)rate); } -static aq_fw_link_speed_t -fw1x_rate_to_link_speed_(aq_fw1x_rate rate) +static enum aq_fw_link_speed +fw1x_rate_to_link_speed_(enum aq_fw1x_rate rate) { switch (rate) { case FW1X_RATE_10G: @@ -164,7 +164,7 @@ fw1x_rate_to_link_speed_(aq_fw1x_rate rate) } int -fw1x_reset(struct aq_hw* hal) +fw1x_reset(struct aq_hw* hw) { uint32_t tid0 = ~0u; /*< Initial value of MBOX transactionId. */ struct aq_hw_fw_mbox mbox; @@ -173,7 +173,7 @@ fw1x_reset(struct aq_hw* hal) for (int i = 0; i < retryCount; ++i) { // Read the beginning of Statistics structure to capture the // Transaction ID. - aq_hw_fw_downld_dwords(hal, hal->mbox_addr, (uint32_t*)&mbox, + aq_hw_fw_downld_dwords(hw, hw->mbox_addr, (uint32_t*)&mbox, (uint32_t)((char*)&mbox.stats - (char*)&mbox) / sizeof(uint32_t)); // Successfully read the stats. @@ -193,7 +193,7 @@ fw1x_reset(struct aq_hw* hal) * Transaction ID value haven't changed since last time. * Try reading the stats again. */ - usec_delay(10); + DELAY(10); } trace_error(dbg_init, "F/W 1.x reset finalize timeout"); @@ -201,8 +201,8 @@ fw1x_reset(struct aq_hw* hal) } int -fw1x_set_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state_e mode, - aq_fw_link_speed_t speed) +fw1x_set_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state mode, + enum aq_fw_link_speed speed) { union fw1x_state_reg state = {0}; state.mode = mpi_mode_to_fw1x_(mode); @@ -217,15 +217,15 @@ fw1x_set_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state_e mode, } int -fw1x_get_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state_e* mode, - aq_fw_link_speed_t* speed, aq_fw_link_fc_t* fc) +fw1x_get_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state* mode, + enum aq_fw_link_speed* speed, enum aq_fw_link_fc* fc) { union fw1x_state_reg state = { .val = AQ_READ_REG(hw, AQ_HW_MPI_STATE_ADR) }; trace(dbg_init, "fw1x> get_mode(): 0x36c -> %x, 0x368 -> %x", state.val, AQ_READ_REG(hw, AQ_HW_MPI_CONTROL_ADR)); - enum aq_hw_fw_mpi_state_e md = MPI_DEINIT; + enum aq_hw_fw_mpi_state md = MPI_DEINIT; switch (state.mode) { case FW1X_MPI_DEINIT: @@ -271,7 +271,7 @@ fw1x_get_mac_addr(struct aq_hw* hw, uint8_t* mac) } err = aq_hw_fw_downld_dwords(hw, efuse_shadow_addr + (40 * 4), - mac_addr, ARRAY_SIZE(mac_addr)); + mac_addr, nitems(mac_addr)); if (err != 0) { mac_addr[0] = 0; mac_addr[1] = 0; @@ -292,7 +292,7 @@ fw1x_get_mac_addr(struct aq_hw* hw, uint8_t* mac) } int -fw1x_get_stats(struct aq_hw* hw, struct aq_hw_stats_s* stats) +fw1x_get_stats(struct aq_hw* hw, struct aq_hw_stats* stats) { int err = 0; @@ -311,7 +311,7 @@ fw1x_get_stats(struct aq_hw* hw, struct aq_hw_stats_s* stats) return (err); } -struct aq_firmware_ops aq_fw1x_ops = +const struct aq_firmware_ops aq_fw1x_ops = { .reset = fw1x_reset, diff --git a/sys/dev/aq/aq_fw2x.c b/sys/dev/aq/aq_fw2x.c index 0a6d433a48fc..04935e9368d4 100644 --- a/sys/dev/aq/aq_fw2x.c +++ b/sys/dev/aq/aq_fw2x.c @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #include "aq_dbg.h" -typedef enum { +enum fw2x_caps_lo { CAPS_LO_10BASET_HD = 0x00, CAPS_LO_10BASET_FD, CAPS_LO_100BASETX_HD, @@ -64,9 +64,9 @@ typedef enum { CAPS_LO_2P5GBASET_FD, CAPS_LO_5GBASET_FD, CAPS_LO_10GBASET_FD, -} fw2x_caps_lo; +}; -typedef enum { +enum fw2x_caps_hi { CAPS_HI_RESERVED1 = 0x00, CAPS_HI_10BASET_EEE, CAPS_HI_RESERVED2, @@ -99,19 +99,19 @@ typedef enum { CAPS_HI_WOL_TIMER, CAPS_HI_STATISTICS, CAPS_HI_TRANSACTION_ID, -} fw2x_caps_hi; +}; -typedef enum aq_fw2x_rate +enum aq_fw2x_rate { FW2X_RATE_100M = 0x20, FW2X_RATE_1G = 0x100, FW2X_RATE_2G5 = 0x200, FW2X_RATE_5G = 0x400, FW2X_RATE_10G = 0x800, -} aq_fw2x_rate; +}; -typedef struct fw2x_msm_statistics +struct fw2x_msm_statistics { uint32_t uprc; uint32_t mprc; @@ -129,36 +129,36 @@ typedef struct fw2x_msm_statistics uint32_t ubtc; uint32_t ptc; uint32_t prc; -} fw2x_msm_statistics; +}; -typedef struct fw2x_phy_cable_diag_data +struct fw2x_phy_cable_diag_data { uint32_t lane_data[4]; -} fw2x_phy_cable_diag_data; +}; -typedef struct fw2x_capabilities { +struct fw2x_capabilities { uint32_t caps_lo; uint32_t caps_hi; -} fw2x_capabilities; +}; -typedef struct fw2x_mailbox // struct fwHostInterface +struct fw2x_mailbox // struct fwHostInterface { uint32_t version; uint32_t transaction_id; int32_t error; - fw2x_msm_statistics msm; // msmStatistics_t msm; + struct fw2x_msm_statistics msm; // msmStatistics_t msm; uint16_t phy_h_bit; uint16_t phy_fault_code; int16_t phy_temperature; uint8_t cable_len; uint8_t reserved1; - fw2x_phy_cable_diag_data diag_data; + struct fw2x_phy_cable_diag_data diag_data; uint32_t reserved[8]; - fw2x_capabilities caps; + struct fw2x_capabilities caps; /* ... */ -} fw2x_mailbox; +}; // EEE caps @@ -195,13 +195,13 @@ typedef struct fw2x_mailbox // struct fwHostInterface // Firmware v2-3.x specific functions. int fw2x_reset(struct aq_hw* hw); -int fw2x_set_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state_e mode, - aq_fw_link_speed_t speed); -int fw2x_get_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state_e* mode, - aq_fw_link_speed_t* speed, aq_fw_link_fc_t* fc); +int fw2x_set_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state mode, + enum aq_fw_link_speed speed); +int fw2x_get_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state* mode, + enum aq_fw_link_speed* speed, enum aq_fw_link_fc* fc); int fw2x_get_mac_addr(struct aq_hw* hw, uint8_t* mac); -int fw2x_get_stats(struct aq_hw* hw, struct aq_hw_stats_s* stats); +int fw2x_get_stats(struct aq_hw* hw, struct aq_hw_stats* stats); static uint64_t @@ -242,10 +242,10 @@ set_mpi_ctrl_(struct aq_hw* hw, uint64_t value) int fw2x_reset(struct aq_hw* hw) { - fw2x_capabilities caps = {0}; + struct fw2x_capabilities caps = {0}; AQ_DBG_ENTER(); int err = aq_hw_fw_downld_dwords(hw, - hw->mbox_addr + offsetof(fw2x_mailbox, caps), + hw->mbox_addr + offsetof(struct fw2x_mailbox, caps), (uint32_t*)&caps, sizeof caps/sizeof(uint32_t)); if (err == 0) { hw->fw_caps = caps.caps_lo | ((uint64_t)caps.caps_hi << 32); @@ -262,7 +262,7 @@ fw2x_reset(struct aq_hw* hw) } -static aq_fw2x_rate +static enum aq_fw2x_rate link_speed_mask_to_fw2x_(uint32_t speed) { uint32_t rate = 0; @@ -284,13 +284,13 @@ link_speed_mask_to_fw2x_(uint32_t speed) rate |= FW2X_RATE_100M; AQ_DBG_EXIT(rate); - return ((aq_fw2x_rate)rate); + return ((enum aq_fw2x_rate)rate); } int -fw2x_set_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state_e mode, - aq_fw_link_speed_t speed) +fw2x_set_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state mode, + enum aq_fw_link_speed speed) { uint64_t mpi_ctrl = get_mpi_ctrl_(hw); @@ -326,8 +326,8 @@ fw2x_set_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state_e mode, } int -fw2x_get_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state_e* mode, - aq_fw_link_speed_t* link_speed, aq_fw_link_fc_t* fc) +fw2x_get_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state* mode, + enum aq_fw_link_speed* link_speed, enum aq_fw_link_fc* fc) { uint64_t mpi_state = get_mpi_state_(hw); uint32_t rates = mpi_state & FW2X_RATE_MASK; @@ -342,7 +342,7 @@ fw2x_get_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state_e* mode, *mode = MPI_DEINIT; } - aq_fw_link_speed_t speed = aq_fw_none; + enum aq_fw_link_speed speed = aq_fw_none; if (rates & FW2X_RATE_10G) speed = aq_fw_10G; @@ -382,7 +382,7 @@ fw2x_get_mac_addr(struct aq_hw* hw, uint8_t* mac) } err = aq_hw_fw_downld_dwords(hw, efuse_shadow_addr + (40 * 4), mac_addr, - ARRAY_SIZE(mac_addr)); + nitems(mac_addr)); if (err != 0) { mac_addr[0] = 0; mac_addr[1] = 0; @@ -400,8 +400,8 @@ fw2x_get_mac_addr(struct aq_hw* hw, uint8_t* mac) } static inline void -fw2x_stats_to_fw_stats_(struct aq_hw_stats_s* dst, - const fw2x_msm_statistics* src) +fw2x_stats_to_fw_stats_(struct aq_hw_stats* dst, + const struct fw2x_msm_statistics* src) { dst->uprc = src->uprc; dst->mprc = src->mprc; @@ -454,7 +454,7 @@ toggle_mpi_ctrl_and_wait_(struct aq_hw* hw, uint64_t mask, uint32_t timeout_ms, // AQ_DBG_EXIT(true); return (true); } - msec_delay(timeout_ms); + DELAY((timeout_ms) * 1000); } trace_detail(dbg_fw, @@ -466,10 +466,10 @@ toggle_mpi_ctrl_and_wait_(struct aq_hw* hw, uint64_t mask, uint32_t timeout_ms, int -fw2x_get_stats(struct aq_hw* hw, struct aq_hw_stats_s* stats) +fw2x_get_stats(struct aq_hw* hw, struct aq_hw_stats* stats) { int err = 0; - fw2x_msm_statistics fw2x_stats = {0}; + struct fw2x_msm_statistics fw2x_stats = {0}; // AQ_DBG_ENTER(); @@ -486,7 +486,7 @@ fw2x_get_stats(struct aq_hw* hw, struct aq_hw_stats_s* stats) } err = aq_hw_fw_downld_dwords(hw, - hw->mbox_addr + offsetof(fw2x_mailbox, msm), + hw->mbox_addr + offsetof(struct fw2x_mailbox, msm), (uint32_t*)&fw2x_stats, sizeof fw2x_stats/sizeof(uint32_t)); fw2x_stats_to_fw_stats_(stats, &fw2x_stats); @@ -506,7 +506,7 @@ fw2x_led_control(struct aq_hw* hw, uint32_t onoff) AQ_DBG_ENTER(); - aq_hw_fw_version ver_expected = { .raw = FW2X_FW_MIN_VER_LED}; + struct aq_hw_fw_version ver_expected = { .raw = FW2X_FW_MIN_VER_LED}; if (aq_hw_ver_match(&ver_expected, &hw->fw_version)) AQ_WRITE_REG(hw, FW2X_MPI_LED_ADDR, (onoff) ? ((FW2X_LED_BLINK) | (FW2X_LED_BLINK << 2) | (FW2X_LED_BLINK << 4)): @@ -516,7 +516,7 @@ fw2x_led_control(struct aq_hw* hw, uint32_t onoff) return (err); } -struct aq_firmware_ops aq_fw2x_ops = +const struct aq_firmware_ops aq_fw2x_ops = { .reset = fw2x_reset, diff --git a/sys/dev/aq/aq_hw.c b/sys/dev/aq/aq_hw.c index 882fdf1807f2..da07c876b959 100644 --- a/sys/dev/aq/aq_hw.c +++ b/sys/dev/aq/aq_hw.c @@ -37,7 +37,6 @@ #include #include #include -#include #include "aq_hw.h" #include "aq_dbg.h" @@ -133,8 +132,8 @@ err_exit: } int -aq_hw_ver_match(const aq_hw_fw_version* ver_expected, - const aq_hw_fw_version* ver_actual) +aq_hw_ver_match(const struct aq_hw_fw_version* ver_expected, + const struct aq_hw_fw_version* ver_actual) { AQ_DBG_ENTER(); @@ -155,14 +154,14 @@ aq_hw_init_ucp(struct aq_hw *hw) err = aq_fw_reset(hw); if (err != 0) { - aq_log_error("aq_hw_init_ucp(): F/W reset failed, err %d", err); + device_printf(hw->dev, "aq_hw_init_ucp(): F/W reset failed, err %d\n", err); return (err); } aq_hw_chip_features_init(hw, &hw->chip_features); err = aq_fw_ops_init(hw); if (err != 0) { - aq_log_error("could not initialize F/W ops, err %d", err); + device_printf(hw->dev, "could not initialize F/W ops, err %d\n", err); return (err); } @@ -183,9 +182,9 @@ aq_hw_init_ucp(struct aq_hw *hw) /* check 10 times by 1ms */ err = AQ_HW_WAIT_FOR((hw->mbox_addr = AQ_READ_REG(hw, 0x360)) != 0, 400U, 20); - aq_hw_fw_version ver_expected = { .raw = AQ_CFG_FW_MIN_VER_EXPECTED }; + struct aq_hw_fw_version ver_expected = { .raw = AQ_CFG_FW_MIN_VER_EXPECTED }; if (!aq_hw_ver_match(&ver_expected, &hw->fw_version)) - aq_log_error("atlantic: aq_hw_init_ucp(), wrong FW version: expected:%x actual:%x", + device_printf(hw->dev, "aq_hw_init_ucp(), wrong FW version: expected:%x actual:%x\n", AQ_CFG_FW_MIN_VER_EXPECTED, hw->fw_version.raw); AQ_DBG_EXIT(err); @@ -210,15 +209,10 @@ err_exit: int aq_hw_mpi_read_stats(struct aq_hw *hw, struct aq_hw_fw_mbox *pmbox) { - int err = 0; + int err; // AQ_DBG_ENTER(); - if (hw->fw_ops && hw->fw_ops->get_stats) { - err = hw->fw_ops->get_stats(hw, &pmbox->stats); - } else { - err = ENOTSUP; - aq_log_error("get_stats() not supported by F/W"); - } + err = hw->fw_ops->get_stats(hw, &pmbox->stats); if (err == 0) { pmbox->stats.dpc = reg_rx_dma_stat_counter7get(hw); @@ -230,16 +224,12 @@ aq_hw_mpi_read_stats(struct aq_hw *hw, struct aq_hw_fw_mbox *pmbox) } static int -aq_hw_mpi_set(struct aq_hw *hw, enum aq_hw_fw_mpi_state_e state, uint32_t speed) +aq_hw_mpi_set(struct aq_hw *hw, enum aq_hw_fw_mpi_state state, uint32_t speed) { - int err = ENOTSUP; + int err; AQ_DBG_ENTERA("speed %d", speed); - if (hw->fw_ops && hw->fw_ops->set_mode) { - err = hw->fw_ops->set_mode(hw, state, speed); - } else { - aq_log_error("set_mode() not supported by F/W"); - } + err = hw->fw_ops->set_mode(hw, state, speed); AQ_DBG_EXIT(err); return (err); @@ -258,20 +248,14 @@ aq_hw_get_link_state(struct aq_hw *hw, uint32_t *link_speed, struct aq_hw_fc_inf // AQ_DBG_ENTER(); - enum aq_hw_fw_mpi_state_e mode; - aq_fw_link_speed_t speed = aq_fw_none; - aq_fw_link_fc_t fc; + enum aq_hw_fw_mpi_state mode; + enum aq_fw_link_speed speed = aq_fw_none; + enum aq_fw_link_fc fc; - if (hw->fw_ops && hw->fw_ops->get_mode) { - err = hw->fw_ops->get_mode(hw, &mode, &speed, &fc); - } else { - aq_log_error("get_mode() not supported by F/W"); - AQ_DBG_EXIT(ENOTSUP); - return (ENOTSUP); - } + err = hw->fw_ops->get_mode(hw, &mode, &speed, &fc); *** 1502 LINES SKIPPED *** From nobody Sat Jun 20 19:10:41 2026 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 4gjPDx6yPvz6hNm4 for ; Sat, 20 Jun 2026 19:10:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjPDx1rKjz3vCX for ; Sat, 20 Jun 2026 19:10:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982641; 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; bh=QRON3HXA4s/3S2XOZz9FDer7xnnUuK20NEwC0YFlJrU=; b=Ohib76JU2goPtP+X7p9qglXy7U8GFJSl8XoG4ZbcLEZyDJkWdnQ9Ak0Hn2GO8dTFdWfpXN 1T8auQBbTXnGom5V+A3/QakIYGbq5DS0rOYJQRA9aKoHN1sysei508Kv0Q2EzitjdIw13/ wfFmyWIJVXAY/miB48ISdbWzm4nmrC7CNTsCVzpAKyL+oFAgu3DbFpkGgbkCrJieyDHHdN In1FRph8VXYFPhsTCfj/51AG8zEmZociSL0laOcfOVoXDdylSLSEvIEiTj5Kb+agiYNnUN KYgZ5F2Eeuiutm24Wek1OvOx05QrTEu5M/YzeOi3bcD4Ok5MoQFKb5lXqyLrQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781982641; a=rsa-sha256; cv=none; b=rZfMIgg2zDqhTwWFe2eCEysMq+U+tzwXTl5c8A59VEKTeukYAksYXjkDaUWdEB/z1Im7VI H1tsf8JtrzfliiFzS6iEftKYkwcj7a7o+6rQRY7Kq7BELlGUHlfCJpsj7PRBrEvSbn1DAi y/7KFuPBxPXCH/8s4i2Slqr0Ta3UYEX31MA3zhReEmZhjRe0JFKlOSKjnEH/1PZicjHaHZ GKR1Rpw07L31OBc3snW9m77Bo0LGZJkKbUCMgYpsHyi+fdbIYgubTxfSAsW7J9/xoCM2rO tUjzhPIpjUn2BVpE/vTgYWA04s5Xv7c8Hz+suATPBX6EYEdKYEwpGRJYeSBuWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982641; 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; bh=QRON3HXA4s/3S2XOZz9FDer7xnnUuK20NEwC0YFlJrU=; b=DL6n+rCGJt9Ijxr+4QjI2eggPLScPp21nNp3e/ODdilQTRJ+z51jNiQJ93dglaAOk5LdGv FpPt2+smmA+SFhZStJvYnktpBsEbt2XrZH8eQR1msb9SecN16geBUDA+dGuiU40VO+bCby n/2Iu3/VhuKM6wW377QkDci5C4ystzAFXR5WfcmnX/dC73ecGFqMDQk4k0vb2nlSFsKaW+ 9IF6VrOs0+7Y+lPsXKI91ItkHqYxR4xocVWZJMk1iIn5+6LRxHlsusnPsdcscw/dAAWeBT xMbm4v5yNNpi3eRPknubegLMT1a8Ppg84d15EKvKlrSY4veXG7WaRStUs5r32Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjPDx0dgzzkNw for ; Sat, 20 Jun 2026 19:10:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 343ca by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 19:10:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Nick Price From: Adrian Chadd Subject: git: a10151fa662c - main - aq(4): take F/W statistics off the iflib core lock (kick-and-read) 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: a10151fa662c1d370861154e2f83e88a20be149c Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 19:10:41 +0000 Message-Id: <6a36e5b1.343ca.2e38d973@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=a10151fa662c1d370861154e2f83e88a20be149c commit a10151fa662c1d370861154e2f83e88a20be149c Author: Nick Price AuthorDate: 2026-06-20 19:03:18 +0000 Commit: Adrian Chadd CommitDate: 2026-06-20 19:10:16 +0000 aq(4): take F/W statistics off the iflib core lock (kick-and-read) The once-per-second statistics refresh ran the whole F/W-mailbox transaction under iflib's CTX (sx) lock: fw2x_get_stats toggled the MPI STATISTICS control bit and busy-polled the state register for the acknowledgement (up to ~25 ms) before downloading the counters, so a slow F/W response blocked datapath reconfigure / ioctls for the duration. The per-cast and error counters have no direct-register source -- the reference Linux atlantic driver and our port both read them out of the F/W mailbox, and the MSM registers the chip exposes are never used for the periodic counters. So rather than poll, adopt the kick-and-read shape the iflib peer with the same constraint uses (vmxnet3): consume the snapshot the F/W produced for the *previous* request, then toggle the bit to request the next one -- no wait. The F/W finished that previous refresh ~1 s ago, so the download needs no poll, and the toggle write stays serialized against set_mode by the CTX lock exactly as before. This removes the 25 ms poll (and the toggle_mpi_ctrl_and_wait_ helper) from under the lock; only the fast 16-dword download remains. Cost: the counters lag one 1 s cycle, invisible for monitoring, and a torn read is already rejected by aq_update_hw_stats' monotonic-delta check. Validated on AQC107: a fixed 500 MiB RX transfer advances good_octets_rcvd by 549.6 MB -- 500 MiB plus the ~4.8% Ethernet framing overhead -- with rx_err=0 and traffic at line rate. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57439 --- sys/dev/aq/aq_fw2x.c | 61 ++++++---------------------------------------------- 1 file changed, 7 insertions(+), 54 deletions(-) diff --git a/sys/dev/aq/aq_fw2x.c b/sys/dev/aq/aq_fw2x.c index 04935e9368d4..339644d0c8e1 100644 --- a/sys/dev/aq/aq_fw2x.c +++ b/sys/dev/aq/aq_fw2x.c @@ -422,69 +422,19 @@ fw2x_stats_to_fw_stats_(struct aq_hw_stats* dst, } -static bool -toggle_mpi_ctrl_and_wait_(struct aq_hw* hw, uint64_t mask, uint32_t timeout_ms, - uint32_t try_count) -{ - uint64_t ctrl = get_mpi_ctrl_(hw); - uint64_t state = get_mpi_state_(hw); - - // AQ_DBG_ENTER(); - // First, check that control and state values are consistent - if ((ctrl & mask) != (state & mask)) { - trace_warn(dbg_fw, - "fw2x> MPI control (%#llx) and state (%#llx) are not consistent for mask %#llx!", - (unsigned long long)ctrl, (unsigned long long)state, - (unsigned long long)mask); - AQ_DBG_EXIT(false); - return (false); - } - - // Invert bits (toggle) in control register - ctrl ^= mask; - set_mpi_ctrl_(hw, ctrl); - - // Clear all bits except masked - ctrl &= mask; - - // Wait for FW reflecting change in state register - while (try_count-- != 0) { - if ((get_mpi_state_(hw) & mask) == ctrl) - { -// AQ_DBG_EXIT(true); - return (true); - } - DELAY((timeout_ms) * 1000); - } - - trace_detail(dbg_fw, - "f/w2x> timeout while waiting for response in state register for bit %#llx!", - (unsigned long long)mask); - // AQ_DBG_EXIT(false); - return (false); -} - - int fw2x_get_stats(struct aq_hw* hw, struct aq_hw_stats* stats) { - int err = 0; struct fw2x_msm_statistics fw2x_stats = {0}; - -// AQ_DBG_ENTER(); + uint64_t mpi_ctrl; + int err; if ((hw->fw_caps & FW2X_CAP_STATISTICS) == 0) { trace_warn(dbg_fw, "fw2x> statistics not supported by F/W"); return (ENOTSUP); } - // Tell F/W to update the statistics. - if (!toggle_mpi_ctrl_and_wait_(hw, FW2X_CAP_STATISTICS, 1, 25)) { - trace_error(dbg_fw, "fw2x> statistics update timeout"); - AQ_DBG_EXIT(ETIMEDOUT); - return (ETIMEDOUT); - } - + /* Kick-and-read: take the F/W's previous snapshot, request the next. */ err = aq_hw_fw_downld_dwords(hw, hw->mbox_addr + offsetof(struct fw2x_mailbox, msm), (uint32_t*)&fw2x_stats, sizeof fw2x_stats/sizeof(uint32_t)); @@ -495,7 +445,10 @@ fw2x_get_stats(struct aq_hw* hw, struct aq_hw_stats* stats) trace_error(dbg_fw, "fw2x> download statistics data FAILED, error %d", err); -// AQ_DBG_EXIT(err); + mpi_ctrl = get_mpi_ctrl_(hw); + mpi_ctrl ^= FW2X_CAP_STATISTICS; + set_mpi_ctrl_(hw, mpi_ctrl); + return (err); } From nobody Sat Jun 20 19:10:43 2026 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 4gjPDz5LKtz6hNrx for ; Sat, 20 Jun 2026 19:10: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjPDz2pPkz3vCx for ; Sat, 20 Jun 2026 19:10:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982643; 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; bh=lv19Tm26iduCmbXllAazpI8lbMyUY7l6lPLlwPmSY9w=; b=K7Tquw8csLJLEV8oT3eEuymWbzFPQy/mbqkBr74xkDyBVLkrcGyuy14F12r7xtNiNncvTY LXe9f9dW4GBkmHRVzADs2mUKXr+n4HNF03l7fMKbvzBqd8U+0YS9tZmEXL+HZk+IIsBViX SIahHCmtwkA8KrbD1hfRfIrYInDONPxWH5gkvdB26r/NGaxJ0f3juXgErRjpGBbqnV+knB 3nIWf3ODVELvxq7EqiIloimmf6+1uJMpurKSz+nIUlSNo856qjKJf49syFkxzPwMzuyypV i1Ii1NcjJv8wC9jKPxbNd2LpdmHjFXlT7GkgjnNzFMhbE9bI1dwlosU52iwm6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781982643; a=rsa-sha256; cv=none; b=QhJILqkjucAfGiZvQfsl6TcYneLzPeZcI9CS9lBd9gGi3en//HBO0VsBH9JUlPt2A1wesE Z9qz8JQubS4tByRBoDefGmujMFJPxpd5LRkRa6k1Y+S395jrA8z/cjpFPl12v33pRxkkAj 7aYn//X8KP4PYN/+XSYCr9wvGxxLOGMSO3H+dO7WlgpKnWpk4TBcUOHHrwzEbajLj93yLD cs6CQFQHAOdMaGqZgFVvKHiWshj/1qnVAfy1rP33CuYGMmRtGY333d7l9A9SOZY7VT5QzB Y2WzzB6qKhT2QmPUej5+3rMMgCMX47dingenC42qaeZ0DOG5W4s9XeKXevMQZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982643; 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; bh=lv19Tm26iduCmbXllAazpI8lbMyUY7l6lPLlwPmSY9w=; b=dk3BV/AmLty90Wix6A6GsdIIQsUNXKKwphFadP4gQ0wzPJBPeslH0xXcrAMnUO8lOxnNf7 dIYvERYQ0plvOcvxhYcodyquWOQgkwD74tOshi9mEaakZXvF+66IQWJLH+LZwDSsAa1Ly3 D+0qzbAtYW67or8VrNILowsUHRD2lLdIgmx2OQtDoH/MsMHF5AlVry75uu/4vDOMo1HZJ7 ztTgfJKAuCUVTVuHMbRDr+rJZBU53Pk1P3Iy/Clt2W7OsfQL0JnLThmzY8McE3oMopSOiZ 7fFX7jRoUG5oY0YSzPAoO0ZiVYm9SZkIPIssmaL54sryV8AKfHD/VRNk6Hzhqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjPDz1syKzk6Z for ; Sat, 20 Jun 2026 19:10:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 333cd by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 19:10:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Nick Price From: Adrian Chadd Subject: git: e44579e23430 - main - aq(4): naming and exposure 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: e44579e23430ff2084b03c9b3d486f05e617e04f Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 19:10:43 +0000 Message-Id: <6a36e5b3.333cd.2e8b4bff@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=e44579e23430ff2084b03c9b3d486f05e617e04f commit e44579e23430ff2084b03c9b3d486f05e617e04f Author: Nick Price AuthorDate: 2026-06-20 19:03:37 +0000 Commit: Adrian Chadd CommitDate: 2026-06-20 19:10:16 +0000 aq(4): naming and exposure Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57656 --- sys/dev/aq/aq_fw.c | 40 ++++++++++++++++++---------------------- sys/dev/aq/aq_fw.h | 2 ++ sys/dev/aq/aq_fw1x.c | 32 ++++++++++++++++---------------- sys/dev/aq/aq_fw2x.c | 52 ++++++++++++++++++++++++++-------------------------- sys/dev/aq/aq_main.c | 2 +- 5 files changed, 63 insertions(+), 65 deletions(-) diff --git a/sys/dev/aq/aq_fw.c b/sys/dev/aq/aq_fw.c index 7f9496add875..72751c81b773 100644 --- a/sys/dev/aq/aq_fw.c +++ b/sys/dev/aq/aq_fw.c @@ -85,14 +85,10 @@ const uint32_t RBL_STATUS_HOST_BOOT = 0xf1a7; const uint32_t SCRATCHPAD_FW_LOADER_STATUS = (0x40 / sizeof(uint32_t)); -extern const struct aq_firmware_ops aq_fw1x_ops; -extern const struct aq_firmware_ops aq_fw2x_ops; - - -int mac_soft_reset_(struct aq_hw* hw, enum aq_fw_bootloader_mode* mode); -int mac_soft_reset_flb_(struct aq_hw* hw); -int mac_soft_reset_rbl_(struct aq_hw* hw, enum aq_fw_bootloader_mode* mode); -int wait_init_mac_firmware_(struct aq_hw* hw); +static int mac_soft_reset(struct aq_hw* hw, enum aq_fw_bootloader_mode* mode); +static int mac_soft_reset_flb(struct aq_hw* hw); +static int mac_soft_reset_rbl(struct aq_hw* hw, enum aq_fw_bootloader_mode* mode); +static int wait_init_mac_firmware(struct aq_hw* hw); int @@ -124,14 +120,14 @@ aq_fw_reset(struct aq_hw* hw) * 2) Driver may skip reset sequence and save time. */ if (hw->fast_start_enabled && !ver) { - int err = wait_init_mac_firmware_(hw); + int err = wait_init_mac_firmware(hw); /* Skip reset as it just completed */ if (!err) return (0); } enum aq_fw_bootloader_mode mode = boot_mode_unknown; - int err = mac_soft_reset_(hw, &mode); + int err = mac_soft_reset(hw, &mode); if (err != 0) { device_printf(hw->dev, "MAC reset failed: %d\n", err); return (err); @@ -141,12 +137,12 @@ aq_fw_reset(struct aq_hw* hw) case boot_mode_flb: aq_log("FLB> F/W successfully loaded from flash."); hw->flash_present = true; - return wait_init_mac_firmware_(hw); + return wait_init_mac_firmware(hw); case boot_mode_rbl_flash: aq_log("RBL> F/W loaded from flash. Host Bootload disabled."); hw->flash_present = true; - return wait_init_mac_firmware_(hw); + return wait_init_mac_firmware(hw); case boot_mode_unknown: device_printf(hw->dev, "F/W bootload error: unknown bootloader type\n"); @@ -196,21 +192,21 @@ aq_fw_ops_init(struct aq_hw* hw) } -int -mac_soft_reset_(struct aq_hw* hw, enum aq_fw_bootloader_mode* mode /*= nullptr*/) +static int +mac_soft_reset(struct aq_hw* hw, enum aq_fw_bootloader_mode* mode /*= nullptr*/) { if (hw->rbl_enabled) { - return mac_soft_reset_rbl_(hw, mode); + return mac_soft_reset_rbl(hw, mode); } else { if (mode) *mode = boot_mode_flb; - return mac_soft_reset_flb_(hw); + return mac_soft_reset_flb(hw); } } -int -mac_soft_reset_flb_(struct aq_hw* hw) +static int +mac_soft_reset_flb(struct aq_hw* hw) { int k; @@ -296,8 +292,8 @@ mac_soft_reset_flb_(struct aq_hw* hw) return (0); } -int -mac_soft_reset_rbl_(struct aq_hw* hw, enum aq_fw_bootloader_mode* mode) +static int +mac_soft_reset_rbl(struct aq_hw* hw, enum aq_fw_bootloader_mode* mode) { trace(dbg_init, "RBL> MAC reset STARTED!"); @@ -349,8 +345,8 @@ mac_soft_reset_rbl_(struct aq_hw* hw, enum aq_fw_bootloader_mode* mode) return (0); } -int -wait_init_mac_firmware_(struct aq_hw* hw) +static int +wait_init_mac_firmware(struct aq_hw* hw) { for (int i = 0; i < MAC_FW_START_TIMEOUT_MS; ++i) { if ((hw->fw_version.raw = AQ_READ_REG(hw, 0x18)) != 0) diff --git a/sys/dev/aq/aq_fw.h b/sys/dev/aq/aq_fw.h index 9195c91d6b5f..be6661db7d57 100644 --- a/sys/dev/aq/aq_fw.h +++ b/sys/dev/aq/aq_fw.h @@ -70,6 +70,8 @@ struct aq_firmware_ops int (*led_control)(struct aq_hw* hw, uint32_t mode); }; +extern const struct aq_firmware_ops aq_fw1x_ops; +extern const struct aq_firmware_ops aq_fw2x_ops; int aq_fw_reset(struct aq_hw* hw); int aq_fw_ops_init(struct aq_hw* hw); diff --git a/sys/dev/aq/aq_fw1x.c b/sys/dev/aq/aq_fw1x.c index 731370e94f3e..72b7f0456ddb 100644 --- a/sys/dev/aq/aq_fw1x.c +++ b/sys/dev/aq/aq_fw1x.c @@ -79,18 +79,18 @@ union fw1x_state_reg { }; }; -int fw1x_reset(struct aq_hw* hw); +static int fw1x_reset(struct aq_hw* hw); -int fw1x_set_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state mode, +static int fw1x_set_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state mode, enum aq_fw_link_speed speed); -int fw1x_get_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state* mode, +static int fw1x_get_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state* mode, enum aq_fw_link_speed* speed, enum aq_fw_link_fc* fc); -int fw1x_get_mac_addr(struct aq_hw* hw, uint8_t* mac_addr); -int fw1x_get_stats(struct aq_hw* hw, struct aq_hw_stats* stats); +static int fw1x_get_mac_addr(struct aq_hw* hw, uint8_t* mac_addr); +static int fw1x_get_stats(struct aq_hw* hw, struct aq_hw_stats* stats); static enum fw1x_mode -mpi_mode_to_fw1x_(enum aq_hw_fw_mpi_state mode) +mpi_mode_to_fw1x(enum aq_hw_fw_mpi_state mode) { switch (mode) { case MPI_DEINIT: @@ -114,7 +114,7 @@ mpi_mode_to_fw1x_(enum aq_hw_fw_mpi_state mode) } static enum aq_fw1x_rate -link_speed_mask_to_fw1x_(uint32_t /*aq_fw_link_speed*/ speed) +link_speed_mask_to_fw1x(uint32_t /*aq_fw_link_speed*/ speed) { uint32_t rate = 0; if (speed & aq_fw_10G) @@ -138,7 +138,7 @@ link_speed_mask_to_fw1x_(uint32_t /*aq_fw_link_speed*/ speed) } static enum aq_fw_link_speed -fw1x_rate_to_link_speed_(enum aq_fw1x_rate rate) +fw1x_rate_to_link_speed(enum aq_fw1x_rate rate) { switch (rate) { case FW1X_RATE_10G: @@ -163,7 +163,7 @@ fw1x_rate_to_link_speed_(enum aq_fw1x_rate rate) return (aq_fw_none); } -int +static int fw1x_reset(struct aq_hw* hw) { uint32_t tid0 = ~0u; /*< Initial value of MBOX transactionId. */ @@ -200,13 +200,13 @@ fw1x_reset(struct aq_hw* hw) return (EBUSY); } -int +static int fw1x_set_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state mode, enum aq_fw_link_speed speed) { union fw1x_state_reg state = {0}; - state.mode = mpi_mode_to_fw1x_(mode); - state.speed = link_speed_mask_to_fw1x_(speed); + state.mode = mpi_mode_to_fw1x(mode); + state.speed = link_speed_mask_to_fw1x(speed); trace(dbg_init, "fw1x> set mode %d, rate mask = %#x; raw = %#x", state.mode, state.speed, state.val); @@ -216,7 +216,7 @@ fw1x_set_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state mode, return (0); } -int +static int fw1x_get_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state* mode, enum aq_fw_link_speed* speed, enum aq_fw_link_fc* fc) { @@ -246,7 +246,7 @@ fw1x_get_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state* mode, *mode = md; if (speed) - *speed = fw1x_rate_to_link_speed_(state.speed); + *speed = fw1x_rate_to_link_speed(state.speed); *fc = aq_fw_fc_none; @@ -255,7 +255,7 @@ fw1x_get_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state* mode, } -int +static int fw1x_get_mac_addr(struct aq_hw* hw, uint8_t* mac) { int err = EFAULT; @@ -291,7 +291,7 @@ fw1x_get_mac_addr(struct aq_hw* hw, uint8_t* mac) return (0); } -int +static int fw1x_get_stats(struct aq_hw* hw, struct aq_hw_stats* stats) { int err = 0; diff --git a/sys/dev/aq/aq_fw2x.c b/sys/dev/aq/aq_fw2x.c index 339644d0c8e1..bf18f43fd548 100644 --- a/sys/dev/aq/aq_fw2x.c +++ b/sys/dev/aq/aq_fw2x.c @@ -193,19 +193,19 @@ struct fw2x_mailbox // struct fwHostInterface #define FW2X_LED_DEFAULT 0x0U // Firmware v2-3.x specific functions. -int fw2x_reset(struct aq_hw* hw); +static int fw2x_reset(struct aq_hw* hw); -int fw2x_set_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state mode, +static int fw2x_set_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state mode, enum aq_fw_link_speed speed); -int fw2x_get_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state* mode, +static int fw2x_get_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state* mode, enum aq_fw_link_speed* speed, enum aq_fw_link_fc* fc); -int fw2x_get_mac_addr(struct aq_hw* hw, uint8_t* mac); -int fw2x_get_stats(struct aq_hw* hw, struct aq_hw_stats* stats); +static int fw2x_get_mac_addr(struct aq_hw* hw, uint8_t* mac); +static int fw2x_get_stats(struct aq_hw* hw, struct aq_hw_stats* stats); static uint64_t -read64_(struct aq_hw* hw, uint32_t addr) +read64(struct aq_hw* hw, uint32_t addr) { uint64_t lo, hi, hi2; @@ -220,26 +220,26 @@ read64_(struct aq_hw* hw, uint32_t addr) } static uint64_t -get_mpi_ctrl_(struct aq_hw* hw) +get_mpi_ctrl(struct aq_hw* hw) { - return read64_(hw, FW2X_MPI_CONTROL_ADDR); + return read64(hw, FW2X_MPI_CONTROL_ADDR); } static uint64_t -get_mpi_state_(struct aq_hw* hw) +get_mpi_state(struct aq_hw* hw) { - return read64_(hw, FW2X_MPI_STATE_ADDR); + return read64(hw, FW2X_MPI_STATE_ADDR); } static void -set_mpi_ctrl_(struct aq_hw* hw, uint64_t value) +set_mpi_ctrl(struct aq_hw* hw, uint64_t value) { AQ_WRITE_REG(hw, FW2X_MPI_CONTROL_ADDR, (uint32_t)value); AQ_WRITE_REG(hw, FW2X_MPI_CONTROL_ADDR + 4, (uint32_t)(value >> 32)); } -int +static int fw2x_reset(struct aq_hw* hw) { struct fw2x_capabilities caps = {0}; @@ -263,7 +263,7 @@ fw2x_reset(struct aq_hw* hw) static enum aq_fw2x_rate -link_speed_mask_to_fw2x_(uint32_t speed) +link_speed_mask_to_fw2x(uint32_t speed) { uint32_t rate = 0; @@ -288,17 +288,17 @@ link_speed_mask_to_fw2x_(uint32_t speed) } -int +static int fw2x_set_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state mode, enum aq_fw_link_speed speed) { - uint64_t mpi_ctrl = get_mpi_ctrl_(hw); + uint64_t mpi_ctrl = get_mpi_ctrl(hw); AQ_DBG_ENTERA("speed=%d", speed); switch (mode) { case MPI_INIT: mpi_ctrl &= ~FW2X_RATE_MASK; - mpi_ctrl |= link_speed_mask_to_fw2x_(speed); + mpi_ctrl |= link_speed_mask_to_fw2x(speed); mpi_ctrl &= ~FW2X_CAP_LINK_DROP; #if 0 // #todo #flowcontrol #pause #eee if (pHal->pCfg->eee) @@ -320,22 +320,22 @@ fw2x_set_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state mode, return (EINVAL); } - set_mpi_ctrl_(hw, mpi_ctrl); + set_mpi_ctrl(hw, mpi_ctrl); AQ_DBG_EXIT(0); return (0); } -int +static int fw2x_get_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state* mode, enum aq_fw_link_speed* link_speed, enum aq_fw_link_fc* fc) { - uint64_t mpi_state = get_mpi_state_(hw); + uint64_t mpi_state = get_mpi_state(hw); uint32_t rates = mpi_state & FW2X_RATE_MASK; // AQ_DBG_ENTER(); if (mode) { - uint64_t mpi_ctrl = get_mpi_ctrl_(hw); + uint64_t mpi_ctrl = get_mpi_ctrl(hw); if (mpi_ctrl & FW2X_RATE_MASK) *mode = MPI_INIT; else @@ -366,7 +366,7 @@ fw2x_get_mode(struct aq_hw* hw, enum aq_hw_fw_mpi_state* mode, } -int +static int fw2x_get_mac_addr(struct aq_hw* hw, uint8_t* mac) { int err = EFAULT; @@ -400,7 +400,7 @@ fw2x_get_mac_addr(struct aq_hw* hw, uint8_t* mac) } static inline void -fw2x_stats_to_fw_stats_(struct aq_hw_stats* dst, +fw2x_stats_to_fw_stats(struct aq_hw_stats* dst, const struct fw2x_msm_statistics* src) { dst->uprc = src->uprc; @@ -422,7 +422,7 @@ fw2x_stats_to_fw_stats_(struct aq_hw_stats* dst, } -int +static int fw2x_get_stats(struct aq_hw* hw, struct aq_hw_stats* stats) { struct fw2x_msm_statistics fw2x_stats = {0}; @@ -439,15 +439,15 @@ fw2x_get_stats(struct aq_hw* hw, struct aq_hw_stats* stats) hw->mbox_addr + offsetof(struct fw2x_mailbox, msm), (uint32_t*)&fw2x_stats, sizeof fw2x_stats/sizeof(uint32_t)); - fw2x_stats_to_fw_stats_(stats, &fw2x_stats); + fw2x_stats_to_fw_stats(stats, &fw2x_stats); if (err != 0) trace_error(dbg_fw, "fw2x> download statistics data FAILED, error %d", err); - mpi_ctrl = get_mpi_ctrl_(hw); + mpi_ctrl = get_mpi_ctrl(hw); mpi_ctrl ^= FW2X_CAP_STATISTICS; - set_mpi_ctrl_(hw, mpi_ctrl); + set_mpi_ctrl(hw, mpi_ctrl); return (err); } diff --git a/sys/dev/aq/aq_main.c b/sys/dev/aq/aq_main.c index e1b294012b27..d4f687fee8f1 100644 --- a/sys/dev/aq/aq_main.c +++ b/sys/dev/aq/aq_main.c @@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_AQ, "aq", "Aquantia"); -char aq_driver_version[] = AQ_VER; +static const char aq_driver_version[] = AQ_VER; #define AQUANTIA_VENDOR_ID 0x1D6A From nobody Sat Jun 20 19:10:42 2026 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 4gjPDy5M2wz6hNv6 for ; Sat, 20 Jun 2026 19:10: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjPDy2wWHz3v4l for ; Sat, 20 Jun 2026 19:10:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982642; 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; bh=TvpEWHyLoGUlH94LQmlamAJR5+Xwl2CaIsJf8/pHmQ0=; b=Dd+pdzw5xWWBM3mFuYpON9FZSFCybu664GrgDSKp8xZOqcpH9bucnigk2IArOfdo6YoWu7 Yn3vaHvMk0q87Kzq93L7QYZ6hWO+8rw+WucneC0e1J6dG14li02KTquCQ8izeChB/Bn/Vd C7tUQHZHzfny+8UMOJH53quxJ05vHoUgenD32OiPKTtuBPP6GlOF3j0Ju6p1GmgjqrhLU5 D8YzF/wDFcFRpSJxmc1sErsl9AaApKpeIvO9bi5XGnqOtUPkKtJ1VbPAJ8KakRf8ob+bGz LgNwTOEdgYa99ECK8mxrKbTTngvjgNRl8Qte1qcrXW0avHrJiIZAny0uBWcmsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781982642; a=rsa-sha256; cv=none; b=a+Ld6TIIFB2S3Sz+HOCqxKKpBIjKzs+L7f3fiPlMUqrl+hDCdKOLo5sKE8cn9Zfh3jo+vg Q5GrQsKB4XzcERa5y+fQ+MtOZMCRSyoOTHRp87UONKBXd419k8LYmsiu+ELCuvZxqvv16v /JNZytx9PZUsDbYahme56qnnVyqt5SAnFpr2lbdbTmTZRaZmE/B6UpAqXUCJTA7Yl4PTH7 BteNgMydP3D7baB936oXsiR3gQh7bbIteHN2tiejFw/+CNP5sNPjeyHZXltsrINfFAdevV kEQ9nGwqDFtKWteQOKBqp6qOjmMobsfDfAppFEfwyrm0GZrj0gofxWKe+Y+Uzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781982642; 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; bh=TvpEWHyLoGUlH94LQmlamAJR5+Xwl2CaIsJf8/pHmQ0=; b=H4oTNBpxXw0Vqtn0QY4c6ENvl83i+cboZ3oQ9+AEXbyO8gE8a9rYUbi1SQSKEVi0YovABG ASfD1FC0b3/gIme6M1ZX6nb9RK/84ru+H2Z3TcNqB3IjzLJxFKoV1lEnNSCFDdtIDTrJc2 y9uK3RZem/V5YkH8UirjPhO1WVxloAZ4iKDMQhL8/CUohM62KYyyPxy0thaupSod8uwJRM NV/8ERfI3nhko1SwI7pF712ZYNpFBezIvxbF24wNMnYG+wh00uLLo5iokQ+yyB5JFre2X0 FKJkIL+3RP4pFOQ+ay5GROuY75fujouwtnTH6ukvk76V+4PBV0SgerqaE2NJTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjPDy1RG7zk39 for ; Sat, 20 Jun 2026 19:10:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 334bd by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 19:10:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Nick Price From: Adrian Chadd Subject: git: 76d0a25be397 - main - aq(4): add a runtime dev.aq.N.debug trace control 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 76d0a25be3976634631bab975f4c2ddbc98f72a2 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 19:10:42 +0000 Message-Id: <6a36e5b2.334bd.6852a26a@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=76d0a25be3976634631bab975f4c2ddbc98f72a2 commit 76d0a25be3976634631bab975f4c2ddbc98f72a2 Author: Nick Price AuthorDate: 2026-06-20 19:03:28 +0000 Commit: Adrian Chadd CommitDate: 2026-06-20 19:10:16 +0000 aq(4): add a runtime dev.aq.N.debug trace control The trace_* family (trace/trace_error/trace_warn/trace_detail, used in the F/W and init/config paths) was gated behind the compile-time AQ_CFG_DEBUG_LVL, which is 0, so the dbg_level_/dbg_categories_ runtime variables were dead and tracing could only be enabled by recompiling. Decouple trace_base_ from AQ_CFG_DEBUG_LVL so it is always compiled and gated purely at runtime on dbg_level_/dbg_categories_, make those two variables writable (no longer const, default level 0 = off), and expose them as dev.aq.N.debug (verbosity) and dev.aq.N.debug_categories (subsystem mask) sysctls. The datapath-heavy AQ_DBG_ENTER/PRINT/DUMP macros and the trace_aq_*_descr descriptor dumps stay behind AQ_CFG_DEBUG_LVL (still 0), so the per-packet paths are untouched -- trace_* is only used off the datapath. The two variables are global (the trace macros reference them directly), so the per-device sysctls share one backing store, which is fine for a debug knob. Validated on AQC107: dev.aq.0.debug defaults to 0 with no trace output; setting it to 6 emits the F/W init/reset/capabilities traces on the next F/W operation; setting it back to 0 silences them; traffic unaffected at line rate, rx_err=0. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57440 --- sys/dev/aq/aq_dbg.c | 4 ++-- sys/dev/aq/aq_dbg.h | 10 +++------- sys/dev/aq/aq_main.c | 8 ++++++++ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/sys/dev/aq/aq_dbg.c b/sys/dev/aq/aq_dbg.c index ec3954185749..86e8fb9cc82a 100644 --- a/sys/dev/aq/aq_dbg.c +++ b/sys/dev/aq/aq_dbg.c @@ -45,8 +45,8 @@ __FBSDID("$FreeBSD$"); #include "aq_dbg.h" -const enum aq_debug_level dbg_level_ = lvl_detail; -const uint32_t dbg_categories_ = dbg_init | dbg_config | dbg_fw; +int dbg_level_ = 0; +uint32_t dbg_categories_ = dbg_init | dbg_config | dbg_tx | dbg_rx | dbg_intr | dbg_fw; diff --git a/sys/dev/aq/aq_dbg.h b/sys/dev/aq/aq_dbg.h index 280572e7d5da..7b546d4f3d78 100644 --- a/sys/dev/aq/aq_dbg.h +++ b/sys/dev/aq/aq_dbg.h @@ -109,16 +109,12 @@ enum aq_debug_category #define __FILENAME__ (__builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__) -extern const enum aq_debug_level dbg_level_; -extern const uint32_t dbg_categories_; +extern int dbg_level_; +extern uint32_t dbg_categories_; #define log_base_(_lvl, _fmt, args...) printf( "atlantic: " _fmt "\n", ##args) -#if AQ_CFG_DEBUG_LVL > 0 -#define trace_base_(_lvl, _cat, _fmt, args...) do { if (dbg_level_ >= _lvl && (_cat & dbg_categories_)) { printf( "atlantic: " _fmt " @%s,%d\n", ##args, __FILENAME__, __LINE__); }} while (0) -#else -#define trace_base_(_lvl, _cat, _fmt, ...) do {} while (0) -#endif // AQ_CFG_DEBUG_LVL > 0 +#define trace_base_(_lvl, _cat, _fmt, args...) do { if (dbg_level_ >= (_lvl) && ((_cat) & dbg_categories_)) { printf( "atlantic: " _fmt " @%s,%d\n", ##args, __FILENAME__, __LINE__); }} while (0) #define aq_log_warn(_fmt, args...) log_base_(lvl_warn, "/!\\ " _fmt, ##args) #define aq_log(_fmt, args...) log_base_(lvl_trace, _fmt, ##args) diff --git a/sys/dev/aq/aq_main.c b/sys/dev/aq/aq_main.c index ecb7e66e5b15..e1b294012b27 100644 --- a/sys/dev/aq/aq_main.c +++ b/sys/dev/aq/aq_main.c @@ -1311,6 +1311,14 @@ aq_add_stats_sysctls(struct aq_dev *softc) CTLTYPE_STRING | CTLFLAG_RD, softc, 0, aq_sysctl_print_rss_config, "A", "Prints RSS Configuration"); + /* Runtime trace controls (global) */ + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "debug", + CTLFLAG_RW, &dbg_level_, 0, + "Trace verbosity: 0=off, 3=err, 4=+warn, 5=+trace, 6=+detail"); + SYSCTL_ADD_U32(ctx, child, OID_AUTO, "debug_categories", + CTLFLAG_RW, &dbg_categories_, 0, + "Trace category mask: init=1 config=2 tx=4 rx=8 intr=16 fw=32"); + /* Driver Statistics */ for (int i = 0; i < softc->tx_rings_count; i++) { struct aq_ring *ring = softc->tx_rings[i]; From nobody Sat Jun 20 20:20:50 2026 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 4gjQpN1rL3z6hWdJ for ; Sat, 20 Jun 2026 20:21:16 +0000 (UTC) (envelope-from kfv@kfv.io) Received: from outbound.pv.icloud.com (pv-2005h-snip4-11.eps.apple.com [57.103.66.251]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjQpM67YSz48kJ for ; Sat, 20 Jun 2026 20:21:10 +0000 (UTC) (envelope-from kfv@kfv.io) Authentication-Results: mx1.freebsd.org; none Received: from outbound.pv.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-1a-20-percent-2 (Postfix) with ESMTPS id 8CFC91800139; Sat, 20 Jun 2026 20:21:07 +0000 (UTC) X-ICL-Out-Info: HUtFAUMHWwJACUgBTUQeDx5WFlZNRAJCTQxWB1gZWgpEF0kCXxcOVk1SHkUtXA1EXlAXEwtTVlkWT1ZaAhcZUU0PWFsIWwQPH0wMUQJCBVZeSQ4dBFQHXQVdVlACWktCBEtFaFwFXBxAF0gdX2pLVhQEE1UbGQJdUFQRV1ALLQFEeEBwKHJGd0N6TR5ZDl8AXQBNB14aXQtID0EALw8td0d4OFgLQUVbHwdYRxRHDg8TTAtHAlo0Vh9UGVoD Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kfv.io; s=sig1; t=1781986868; x=1784578868; bh=bFetJ//ya6/PRNJPFoff4KMDKG3PPsnQmNua/rSUinc=; h=Content-Type:Mime-Version:Subject:From:Date:Message-Id:To:x-icloud-hme; b=esYtqzE9SJuTkDkUrnOQ3wPWCyXGhTSFQR+jf8qtpQxV5RyHJfNvwyq5QF1BeJPrE2HkJlfj1KcHDA4Gf2OTmmK/oakFog/59GbVf4tkcqKNcOoZjoTyyByB33U8h+w0SqIImyFoYuENGl7WkcU5S/2XiteXUkNOre1wTT401ckLN0a9Q52kVjG9hMYn2XnKAfu1xKh2qHzTmbpvEcSVyVxnDkS6ZoRsbzQWRhLLztVTRIBaI1uDWfph9Ntki6fNV2xoShN4Fe/JD7Q0f/4ETkl/IgW1mBke36QmRXgdv3wSzghLReFBH5RsKmMXRK51gktKcI2/+ZapnJVa8hFufA== mail-alias-created-date: 1649693719123 Received: from smtpclient.apple (unknown [17.56.9.36]) by p00-icloudmta-asmtp-us-west-1a-20-percent-2 (Postfix) with ESMTPSA id 4859218000AB; Sat, 20 Jun 2026 20:21:05 +0000 (UTC) Content-Type: multipart/signed; boundary="Apple-Mail=_12EB41E5-E607-42BD-B3ED-414C950725DB"; protocol="application/pgp-signature"; micalg=pgp-sha256 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.100.1.1.5\)) Subject: Re: git: 9d87c1aac4a8 - main - libc: Add missing kill_dependency macro From: Faraz Vahedi In-Reply-To: Date: Sat, 20 Jun 2026 23:50:50 +0330 Cc: Warner Losh , alc@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-Id: References: <6a35ddd4.24ba1.2ad9343d@gitrepo.freebsd.org> <9A21692F-0B53-4303-85A8-57784BFAF8DE@kfv.io> <33E8BFC4-EA46-41A7-B54F-1AADD3C19D9E@kfv.io> To: Konstantin Belousov X-Mailer: Apple Mail (2.3864.100.1.1.5) X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjIwMDIwOCBTYWx0ZWRfXwoTPiqLspFSf zdQO92BQGGyRXZ7Q/32QQENcnNSh5S7P8uUY4penQMUa63B5o//OmwBE1Uzco2Oim4tQZOTuafM M5Kfdr9QVLeZrHlHmSex3kU08o54KS2T1kvxnvjoWwEQF3XLp6M64UvSxnU75j8QFSdNGPcJ9Un sLRK/yjnNb9ikfTHzlSoU5dmenIR5EUwjSLwxJ4Tz7vRRABchClcFHYCV3D4yaMeslOCjkElm83 suyZMHkMVblwLM7EZB6zBB6X8uYL5thb4YgtbGhmAjcGZeacEd+G6oPLHTzO1wgFhwU8NpJBe1b 9N0VrE1BSzsY8fbIukL X-Proofpoint-GUID: 1cxhcpMksVUJLpTuMQJkJG5VLZ2B-zVP X-Proofpoint-ORIG-GUID: 1cxhcpMksVUJLpTuMQJkJG5VLZ2B-zVP X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:714, ipnet:57.103.64.0/22, country:US] X-Rspamd-Queue-Id: 4gjQpM67YSz48kJ X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated --Apple-Mail=_12EB41E5-E607-42BD-B3ED-414C950725DB Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Hey, I see. I dug further into related proposals and the reasons why no compiler today has implemented true data dependency tracking and that they all basically map and promote consume to acquire. The kill_dependency is also basically a no-op, and both compilers optimise them identically. I did a few tests on my AArch64 box and that's how I'm convinced, so I believe keeping the current form could be ideal as it fully conforms to the standard and we're assured that at least any conforming compiler would support it just fine and there's no extension or non-standard tweak in it. On the other hand, although adding a separate branch with the GCC style is possible, I don't think that'd add any value but visual complications. Either way, whether dependency tracking changes drastically or this very approach becomes obsolete, keeping our header as-is seems safe for now. Again, I should admit that despite my enthusiasm for compilers and long-time personal studies of that field, I am by no means an expert and can be wrong, or at least miss some corner cases I'm not aware of, so please educate me if so. Yours, Faraz --Apple-Mail=_12EB41E5-E607-42BD-B3ED-414C950725DB Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEnunneCmADnpNx8ZMLdpU9MVz/74FAmo29iIACgkQLdpU9MVz /77ITQ//bwuyEXtUgm6NEt+6EH1RYbq+74ojfwKrasPBtZWpN28gKdVAvw5hgFsN BgRBlWOT+HjgkCS9gOmSpOH4Y398zrK5UyJ5RWFYOBsIuYk/LCJb8fviVVVeOKtV 0ZltFiohciVpslulIL4qCwJNhfdGmM5+/Wu90qyiypxgJrxoGmF/2WbKUecmHq+K b8GGm517HRHOn9lTIjZKw15519XE1c8xW/xJhPSWL7eOZTJKkBDO2O1zpFgcH4I9 EdXImyfIWVIVThRsP23KVLEN1iguxhYHwgoZHHIg/8m2ofqJAcpdeskGqKJYgS42 W/1yrPhuPOnHGOw4h9SSHthRNqWoEc1d/DHVpKgx3fkPmZVzQGKsJ8MI3jRNqpiu TCOe3V9XW1FSK7A18iQycNtv5zxePeUVHmMfgWkc4kqDsxtpn73LV7aVo3ZZrDWx BjS+dqWvlB0j1p9m1RYrgRQjQtzhJxIGDdjNUlVsaJ4EZEoCqWzPPiW/Xd4M2Ua/ 6RS74wC9T3tjqsA73wga2H80huDz0hsEo4e/mtGjXoHD7GrgnoHPBiQGHfbTzidV MKRdGOYhyqz82eOSnw6CitynK+tR3FKNexYospU4gdJy/R/6lmcKI3BfeUCt6+TI eg45Hd3ud2yX/QNO23fmi8oYeXVClvcUXtQubmyU2DAl87EXRbk= =SvuQ -----END PGP SIGNATURE----- --Apple-Mail=_12EB41E5-E607-42BD-B3ED-414C950725DB-- From nobody Sat Jun 20 20:34:59 2026 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 4gjR6K1jz2z6hXx9 for ; Sat, 20 Jun 2026 20:35: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjR6K0wNKz4CQQ for ; Sat, 20 Jun 2026 20:35:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781987705; 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; bh=vB9L+dokXRaoZahYyVW4CyshvmJzKG0R96aFB8tIhTo=; b=C0fv7AuINWKWd20rchinf/0TlRiYysTgGCDWbI+827yr0fgYKBmxxT26vCCbP8hWA4W0nT sHUvTArkI6kOPpR+fbcokKf2IkeNJQO9u5isaNlyjkd/Y0ahSTM8eROBtaQaNbTG7s48Bw +vlCFnZKN0JuTby83nU/qs5KvofzWQi0V5YZCNpxoORMlGmCXS65gbwU+aJU13PHvM9dF7 UTQoJ0IpyFWG1QYDB9+4vc/XDi7F5hAG/pfKIMBzvgSvD6ejJpN1xILkkz5RfztLARU1uG V1vEVHKp8GXPv4G1mymEaLUwz6Dr5AKKhESfEVmcWKQhU7evJQN8KkY8pGNBeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781987705; a=rsa-sha256; cv=none; b=OECxN07TsY9ri8pJ8gBea92t0THoeWrcX8uxf7n4hjfhD5GikelaUFnwtWedSHOg8xlE7v Ul+I6MXX4MpjLO1Mo3Rz1Nf8Tk7kP6T/Rgc4oGXsKa38l9KbW44HxgFXfCF08qDMBTydPB djaNRpz+N+HtAR5bR2R/5ibnOAqp9S2LxrCqlwLJh8ye46BnIwcAI+kwvg6RYI4CTUW92Q QC0A5RO3DP/ITeiRndhYqNBqmfA03rsaldPAFKKSoxTBkn91zhqlpbvCanahlbifadLrG2 PEVrR66Rzv6XWGfkOPMKt/hh+X1MH9RHydJy5YAbzK7wgfCMO80e+lvwxGNlRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781987705; 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; bh=vB9L+dokXRaoZahYyVW4CyshvmJzKG0R96aFB8tIhTo=; b=uFgeUEY1u1XbP4F9ZH4ERu3UYcB0UVAwLVniTHi0WVRKAfpecs29ZL1I/fO8qveVJzO/QH NrBTAWvenS8PRg7LtfPoUZV/p+k3y/HFGUEyIPZITjp6ZS2upEHHnVyfn+0/3ZAewhyAsJ gnih0xx2wKwx/AYkyFkHQmEmR5FAxKaG8Z/ul6aQf3oYsk1xh+Uc4BUme6A6OWTzX3xVMg UnQXb0noVlTxkFYGWIzGajQ+kbiJuzurjTXicTlMPogKHiafyeaqSbJ4WvgmClwe6K0JGZ YCnejQiXT18Jc2XWdvtMDvPybfN2LoAFUwsEH9MAkQi+RaNkBLOYOXY2cFvRWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjR6J70sKzn0l for ; Sat, 20 Jun 2026 20:35:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d314 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 20:34:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Andre Albsmeier From: Michael Osipov Subject: git: 6a7c8c922455 - main - periodic/security: Introduce $security_status_loginfail_ignore for 800.loginfail 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a7c8c92245562cfd9b900dedacab99a13d5ca86 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 20:34:59 +0000 Message-Id: <6a36f973.3d314.2580ec4c@gitrepo.freebsd.org> The branch main has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=6a7c8c92245562cfd9b900dedacab99a13d5ca86 commit 6a7c8c92245562cfd9b900dedacab99a13d5ca86 Author: Andre Albsmeier AuthorDate: 2026-06-19 13:50:00 +0000 Commit: Michael Osipov CommitDate: 2026-06-20 20:34:30 +0000 periodic/security: Introduce $security_status_loginfail_ignore for 800.loginfail Introduce a new variable "security_status_loginfail_ignore" to filter unwanted login failure messages from the daily security checks. Co-authored-by: Michael Osipov Co-authored-by: Joseph Mingrone PR: 295191 Reviewed by: jrm MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D57671 --- share/man/man5/periodic.conf.5 | 6 +++++- usr.sbin/periodic/etc/security/800.loginfail | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/share/man/man5/periodic.conf.5 b/share/man/man5/periodic.conf.5 index 8910895d9b89..568493154558 100644 --- a/share/man/man5/periodic.conf.5 +++ b/share/man/man5/periodic.conf.5 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 9, 2024 +.Dd June 19, 2026 .Dt PERIODIC.CONF 5 .Os .Sh NAME @@ -1036,6 +1036,10 @@ Set to either .Dq Li monthly or .Dq Li NO . +.It Va security_status_loginfail_ignore +.Pq Vt str +Set to an extended regular expression to filter out unwanted messages. +By default, no messages are filtered. .It Va security_status_tcpwrap_enable .Pq Vt bool Set to diff --git a/usr.sbin/periodic/etc/security/800.loginfail b/usr.sbin/periodic/etc/security/800.loginfail index 91564185b653..562201439794 100755 --- a/usr.sbin/periodic/etc/security/800.loginfail +++ b/usr.sbin/periodic/etc/security/800.loginfail @@ -65,6 +65,7 @@ then echo "" echo "${host} login failures:" n=$(catmsgs | egrep -ia "${prefix}.*\b(fail(ures?|ed)?|invalid|bad|illegal|auth.*error)\b" | + grep -Eva "${security_status_loginfail_ignore-^\$}" | tee /dev/stderr | wc -l) [ $n -gt 0 ] && rc=1 || rc=0 fi From nobody Sat Jun 20 20:58:58 2026 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 4gjRdv1fk3z6hb5V for ; Sat, 20 Jun 2026 20:58: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjRdv0sZvz4Fk5 for ; Sat, 20 Jun 2026 20:58:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781989139; 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=oMx0F+fOFiR6lUrorvuIYFYkQdz1iS3zG98HE/KwXpI=; b=lrv5ZqfsH8+2aTbquoFJIxi6HsqtdoZVECIn1OgnNuth3FFECvUWW2MHRQVTMY5RNmUrjF xEx6FAalvFyj1cJec9uDpPALfoQB/6d89zvOA5/inafQUTrQTAywSbzv2ZGBORsmmDUkfe gdlttgevlYRsDYrPdXlOS+qa4g6M+b4/Nyw5hVvXZVnQuPFcIaLINlKVgYWbIdOmQRDD3L pXKI/mTuJo8FbL5wi7J5nCZ+2IHnsRde58FV1kPxuiB/GbAm7dOkjbxa5LWo+pRdAL5Tn+ DjvP7bQsJ7MYKM9kmlqUHsX6H/m5edVMxMOpHGoVB5UMPrXp6YNC29NvHottLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781989139; a=rsa-sha256; cv=none; b=rkjOvF/NlAiIfstb3w4xeCnLf6Oj9WPOAClSH0g35aIJFjlGZ7Gn1M+bsEpysN2mENpq/4 xKp+mDuNzUDQdcVteWEaf06Vrk/1S2Kv+K+Vb5aioCXt+IDdznGTxEWHHI/a8eKcRfT2cI iSc7CVlzdeFKL2LjK8bU4K8Ug+ABSaflYGU8FEnGZCVHP0a0OzQ4TY0xvVrBfLMV6rW9+b CXUPlL0sRwcqZHpXH6vw/yb0QkqNlD/QbwLD3Ez4FDLAldNsth2LovyteRYfbY32wftQsL dRXhBE1Pn+T/fecGP5K2g1gZL4lLdBtZZFDeth8/DdUiQesa+RGUc8WD6B5jhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781989139; 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=oMx0F+fOFiR6lUrorvuIYFYkQdz1iS3zG98HE/KwXpI=; b=Usf+/S6K+wAHGaiwrEGcwSnsvFldiP9SLjFiNrqpoEisjI+ptnKN9qeEbKxt7Ruoi9ovNb UDrl3kWBbT4EkazP26pBp2AvHH/AJgyA2opHbTu/uCB0BYxtBXbk9JOAE+3bqKEIe7H3M0 NxKE196ht/1ZR+OFgZiEOT2TKPPfbxOs5XRmUhSlN3sKPNVFqfoTJr187K9ujlHYj6YaPJ 5sMCAm7wPm1NJElLAjaT/baKmKhL4XGZTbpXJjlBm4C8FKXT7ZGuGSJswfP6Z7ZIAvmlKs gg6Kdoc5AXepNew1rxCHs8aHDVhz7zFVsjNeXgGhkVrqDiiU64uLW6rC+7dnNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjRdt6SbYzmrh for ; Sat, 20 Jun 2026 20:58:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d44d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 20 Jun 2026 20:58:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: eafa181d51f7 - main - da: Put the SYNC CACHE probing behind bootverbose 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: eafa181d51f712f189ae4558014d8d00de7c5624 Auto-Submitted: auto-generated Date: Sat, 20 Jun 2026 20:58:58 +0000 Message-Id: <6a36ff12.3d44d.4c850abb@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=eafa181d51f712f189ae4558014d8d00de7c5624 commit eafa181d51f712f189ae4558014d8d00de7c5624 Author: Warner Losh AuthorDate: 2026-06-20 20:53:32 +0000 Commit: Warner Losh CommitDate: 2026-06-20 20:57:24 +0000 da: Put the SYNC CACHE probing behind bootverbose These have turned out to be too noisy, so put them behind bootverbose Event: BSDCan 2026 (noticed during UFS demo) Sponsored by: Netflix MFC After: 2 weeks --- sys/cam/scsi/scsi_da.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 3f18817030c1..7b47beeeccdd 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -5461,24 +5461,27 @@ dadone_probecache(struct cam_periph *periph, union ccb *done_ccb) */ if (sense_hdr->data_length + 1 < sense_hdr->blk_desc_len + sizeof(*cache_page)) { - xpt_print(done_ccb->ccb_h.path, - "CACHE PAGE TOO SHORT data len %d desc len %d\n", - sense_hdr->data_length, - sense_hdr->blk_desc_len); + if (bootverbose) + xpt_print(done_ccb->ccb_h.path, + "CACHE PAGE TOO SHORT data len %d desc len %d\n", + sense_hdr->data_length, + sense_hdr->blk_desc_len); goto bad; } if ((cache_page->page_code & ~SMS_PAGE_CTRL_MASK) != SMS_CACHE_PAGE) { - xpt_print(done_ccb->ccb_h.path, - "Bad cache page %#x\n", - cache_page->page_code); + if (bootverbose) + xpt_print(done_ccb->ccb_h.path, + "Bad cache page %#x\n", + cache_page->page_code); goto bad; } if (cache_page->page_length != sizeof(*cache_page) - offsetof(struct scsi_caching_page, flags1)) { - xpt_print(done_ccb->ccb_h.path, - "CACHE PAGE length bogus %#x\n", - cache_page->page_length); + if (bootverbose) + xpt_print(done_ccb->ccb_h.path, + "CACHE PAGE length bogus %#x\n", + cache_page->page_length); goto bad; } /* @@ -5495,7 +5498,8 @@ dadone_probecache(struct cam_periph *periph, union ccb *done_ccb) */ if (softc->quirks & DA_Q_NO_SYNC_CACHE && cache_page->flags1 & SCP_WCE) - xpt_print(done_ccb->ccb_h.path, + if (bootverbose) + xpt_print(done_ccb->ccb_h.path, "Devices quirked NO_SYNC_CACHE, but WCE=1 enabling write cache.\n"); } else { int error, error_code, sense_key, asc, ascq; @@ -5536,8 +5540,9 @@ dadone_probecache(struct cam_periph *periph, union ccb *done_ccb) /*getcount_only*/0); } } - xpt_print(done_ccb->ccb_h.path, - "MODE SENSE for CACHE page command failed.\n"); + if (bootverbose) + xpt_print(done_ccb->ccb_h.path, + "MODE SENSE for CACHE page command failed.\n"); /* * There's no cache page, the command wasn't @@ -5549,10 +5554,12 @@ dadone_probecache(struct cam_periph *periph, union ccb *done_ccb) */ if (mark_bad) { bad: - xpt_print(done_ccb->ccb_h.path, + if (bootverbose) + xpt_print(done_ccb->ccb_h.path, "Mode page 8 missing, disabling SYNCHRONIZE CACHE\n"); if (softc->quirks & DA_Q_NO_SYNC_CACHE) - xpt_print(done_ccb->ccb_h.path, + if (bootverbose) + xpt_print(done_ccb->ccb_h.path, "Devices already quirked for NO_SYNC_CACHE, maybe remove quirk table\n"); softc->quirks |= DA_Q_NO_SYNC_CACHE; softc->disk->d_flags &= ~DISKFLAG_CANFLUSHCACHE; From nobody Sun Jun 21 00:09:19 2026 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 4gjWsW6D9vz6htvX for ; Sun, 21 Jun 2026 00:09:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjWsW5Z2rz3KSK for ; Sun, 21 Jun 2026 00:09:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782000559; 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=2IoyyG+BXrnR1Fwq2anR59noEDxJgXU2czXSwQqgl1c=; b=XBptugP1be1YsLfhlQH7FPQR7R/kH6hw7U51yJEVesMVa2kASIAgPkedYvURvRYrziT5I8 9BjJgMFAwBb0naI02uNrqWXm67m0+Ygf8tzAF87hGY6ZKwu4EPlLpU2g5sCSB/hi63FcQ7 XihLWhV3mmlZfLQJFunpXRdKjT+bgRlL/24BrbDm9VGI4uS5h3UMMHTJsFUhlOk81QWn6L FUyZ4iEfa9qRUVVvfgWpiACpEJcngU29u4EIpJJ2KI92ZyGjSy55B0t1W/FEaXpJmvyDWF +91DxGDaqqzo0V82zk6ubOaapjfoVKAxUJxQehygDR0oi1EKUEAJ4JXV11JHxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782000559; a=rsa-sha256; cv=none; b=EtEerX/PNvFtvR1z329VQvaLBCgEH/PExq5WSjakSUGMbAcnqTPLIB6M0UGEkK4lrpSFw5 hABV5mVHS9mP3t/O4HDgpfEpVS828quD8iw+5wT5j4MU1ROWJdEx3nIREOvlk96e3f7ekD pUVetPhx2/VvunI+NmkiFiNjFcInWduBACyD2/ISrFU8sViMSxZYvTyMpTU7MFFZSlja+f Y5vMhgIB+Rif7yGvproNntFh7ct1XaEdBdDDXUN+gyFX5hZBindko8zMbKnjffPjIGkPG0 /VjtuCd6V77FOnqX6gnFrZSCRqX43EN6pnmGGnqT5Z4u3n+fW9kQxuY1069xkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782000559; 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=2IoyyG+BXrnR1Fwq2anR59noEDxJgXU2czXSwQqgl1c=; b=bNYCWy2wtf9VF030D9oLEzQLwcXI3zXesCj15OHPrG9BgeeFthfu6SllFbbmnRxyAbLPw8 YZ6T1LZYWUIuZKNaZkDl6AyEGomgOCpnZBYq4fplE5p5IpyUPhtkTe85M0LcbdEVml3Bej JanL0OfzLb8PF6mFNRz5PjNHe67w5BBHwsrLz1FSt6vX3iadwxE2/XqmdjTBZkt7gGpzcZ 2Lo8jKzNv+6jJeDJyFCbjk7CsMoWouiEx8aecEiGzo+PGlq4NWafTnfZVgKEtkAeUlD61w 2kgU8+wHo9kYi7Fo+JBgSdzRmiP1FaMmUU/LgSrzBbmtoGOdyVA7Xnxrfiu4sg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjWsW3rs0zsqF for ; Sun, 21 Jun 2026 00:09:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23dfd by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 00:09:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 61152df00aee - main - nfs_nfsdport.c: Do unnecessary initializations to quiet gcc 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 61152df00aee248bec2ef267c092b6004e25f6d6 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 00:09:19 +0000 Message-Id: <6a372baf.23dfd.15699499@gitrepo.freebsd.org> The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=61152df00aee248bec2ef267c092b6004e25f6d6 commit 61152df00aee248bec2ef267c092b6004e25f6d6 Author: Rick Macklem AuthorDate: 2026-06-21 00:06:45 +0000 Commit: Rick Macklem CommitDate: 2026-06-21 00:06:45 +0000 nfs_nfsdport.c: Do unnecessary initializations to quiet gcc Fixes: d8e8f9251975 ("pNFSd: Add a directory of newly created files for the pNFSd") --- sys/fs/nfsserver/nfs_nfsdport.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index ca8c9575bf59..16b74f0cded8 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -3137,6 +3137,7 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdgram, long pathval; bool has_caseinsensitive, has_hiddensystem, has_namedattr, xattrsupp; + NFSZERO_ATTRBIT(&savbits); /* Shut up gcc. */ if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); goto out; @@ -5303,7 +5304,7 @@ static void nfsrv_pnfscreate(struct vnode *vp, struct vattr *vap, struct ucred *cred, NFSPROC_T *p) { - struct nfsrvdscreate *dsc, *tdsc; + struct nfsrvdscreate *dsc, *tdsc = NULL; /* Shut up gcc. */ struct nfsdevice *ds, *tds, *fds; struct mount *mp; struct pnfsdsfile *pf, *tpf; @@ -5677,7 +5678,7 @@ nfsrv_pnfsremove(struct vnode **dvpp, int dsfilecnt, char *fname, fhandle_t *fhp, NFSPROC_T *p) { struct ucred *tcred; - struct nfsrvdsremove *dsrm, *tdsrm; + struct nfsrvdsremove *dsrm, *tdsrm = NULL; /* Shut up gcc. */ struct nfsdevice *ds; struct nfsmount *nmp; struct vnode **tdvpp; @@ -6057,10 +6058,10 @@ nfsrv_dsgetsockmnt(struct vnode *vp, int lktype, char *buf, int *buflenp, char **devid, char *fnamep, struct vnode **nvpp, struct nfsmount **newnmpp, struct nfsmount *curnmp, int *ippos, int *dsdirp) { - struct vnode *dvp, *nvp = NULL, **tdvpp; + struct vnode *dvp, *nvp = NULL, **tdvpp = NULL; /* Shut up gcc. */ struct mount *mp; struct nfsmount *nmp, *newnmp; - fhandle_t *tfhp; + fhandle_t *tfhp = NULL; /* Shut up gcc. */ struct sockaddr *sad; struct sockaddr_in *sin; struct nfsdevice *ds, *tds, *fndds; @@ -7375,7 +7376,7 @@ nfsrv_setattrdsrpc(fhandle_t *fhp, struct vnode *vp, struct ucred *cred, NFSPROC_T *p, struct nfsmount **nmp, int mirrorcnt, int stripecnt, struct nfsvattr *nap, int *failposp) { - struct nfsrvsetattrdsdorpc *drpc, *tdrpc; + struct nfsrvsetattrdsdorpc *drpc, *tdrpc = NULL; /* Shut up gcc. */ fhandle_t *tfhp; struct nfsmount **tnmp; struct nfsvattr na; @@ -7642,7 +7643,7 @@ nfsrv_getattrdsrpc(fhandle_t *fhp, struct vnode *vp, struct ucred *cred, NFSPROC_T *p, struct nfsmount **nmp, int stripecnt, struct nfsvattr *nap, int *failposp) { - struct nfsrvgetattrdsdorpc *drpc, *tdrpc; + struct nfsrvgetattrdsdorpc *drpc, *tdrpc = NULL; /* Shut up gcc. */ fhandle_t *tfhp; struct nfsmount **tnmp; int error, i, ret, timo; From nobody Sun Jun 21 02:07:17 2026 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 4gjZTd4vlhz6hcDK for ; Sun, 21 Jun 2026 02:07: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjZTd1v4Qz3Wxy for ; Sun, 21 Jun 2026 02:07:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782007637; 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=oRtGMc1oWGdI0RAKiAyEqxH59NiL0CFiNRNAbKhLhF8=; b=wKPNb3a18VloRacCvGdgIiQZvrid6JDrqqX+fOl5y6sQsx5QUfX59ti++lQCBDnRbZQ4rM neSfVeFjl56A0snAuQXdkNNcAueXu9YZrEqay0M2ctKh52PEcEmDtCBeA1zqwSCHQnFotb 1xwnJ9oGTCytu8xFaJ2k4IzT5ri4nlOSxknQ+tN1xwgFam3rqUvGpe7jrEwdUwHQgtE0ej XEiQDmrDSeAkfDzSPL78g+/0okeV7ornPWidhduI+JE4DHuxLd1y+pdxac7srX1eaZfhgG siYT69VLeq3PwB1ycL7RTK0i8Ut2sXV+xGMsXmm1/82AwBHh9EFnVoIfYgwNTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782007637; a=rsa-sha256; cv=none; b=DVAntliVj3cf7uU5rx4rss41zKan80fzDfRA85zGz4v62xQUZI2FsVixHTWQ7IuMcIClAa 8NPjhCF6SQKbdvbJ9N4yLsQpBpneJwetci4m+EluBd09/5I8nKLRpSLmnJoUxXrAYupPPI tCIDOgmnaW/+zsH000RIfT0D+5Ho54OIx3W0fYC6q9bbInYA7Yrvd/gkIOnUq08MDgETGk 1fTP0e6FbaPoy3v6KbchwFjW6VlxxF7i69pL8P/x1f9rn8B1s7HbesG4souluiuhHKEuy9 W7HqISw70qEXtzrMVhd+s/hS5caCy7LQpFHWbTeBNfS3tlDuSHtq8noHaBDY4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782007637; 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=oRtGMc1oWGdI0RAKiAyEqxH59NiL0CFiNRNAbKhLhF8=; b=r1gbGkRE/LlFJlL4TOQNMjPFDPn8B2LmoTTgofFxnT2cdfR6NUS1yCeZ8x2tTkv20y4uka h1bKAGjO5aHw+BmrSfsTmPtlM3LZqLOhks5FPVuj8cOSWzC/5VmL4kyjacbCG/lj2KwQEz 3jERbDXuCRF7nucZij3JAS91Q0K1Nug+LkE44qd7xnawC1wz3WnynykqmK75Zf49iUwh6q jQ/cbtJIbp/r1TRH6rWRK/JDwZ4EzcBjdooB6X/IXeyljkGUsnIKIbWbI+QZmOHTqFIf26 qdKHE54djqIn2hIQBaIZqa9bO+g5O8vHYM9kZ6kHeVjxy9jjY8XtsmVEDKcV8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjZTd0VJpzx5d for ; Sun, 21 Jun 2026 02:07:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 37ef3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 02:07:17 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Siva Mahadevan Subject: git: 52ad4f883489 - main - lib/msun/tests: re-enable nan_test on riscv 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: siva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 52ad4f883489f73e7a876f5cf296bb5a7dc696a2 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 02:07:17 +0000 Message-Id: <6a374755.37ef3.51a2a64f@gitrepo.freebsd.org> The branch main has been updated by siva: URL: https://cgit.FreeBSD.org/src/commit/?id=52ad4f883489f73e7a876f5cf296bb5a7dc696a2 commit 52ad4f883489f73e7a876f5cf296bb5a7dc696a2 Author: Siva Mahadevan AuthorDate: 2026-06-15 22:27:52 +0000 Commit: Siva Mahadevan CommitDate: 2026-06-21 02:03:27 +0000 lib/msun/tests: re-enable nan_test on riscv Commit 1e25cda7f06923d05e28dac8eb1c1c428a5c92dc fixed it. MFC after: 3 days Sponsored by: The FreeBSD Foundation --- lib/msun/tests/nan_test.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/msun/tests/nan_test.c b/lib/msun/tests/nan_test.c index 3dcea3f9e402..32c5c39af0c1 100644 --- a/lib/msun/tests/nan_test.c +++ b/lib/msun/tests/nan_test.c @@ -105,9 +105,6 @@ testnan(const char *nan_format) ATF_TC_WITHOUT_HEAD(nan); ATF_TC_BODY(nan, tc) { -#if defined(__riscv) - atf_tc_expect_fail("https://bugs.freebsd.org/290099"); -#endif /* Die if a signalling NaN is returned */ feenableexcept(FE_INVALID); From nobody Sun Jun 21 02:22:15 2026 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 4gjZqG14g2z6hdjD for ; Sun, 21 Jun 2026 02:22:34 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-yw1-x1133.google.com (mail-yw1-x1133.google.com [IPv6:2607:f8b0:4864:20::1133]) (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 4gjZqF4ZGFz3YFV for ; Sun, 21 Jun 2026 02:22:33 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-7dbcb505578so34777007b3.3 for ; Sat, 20 Jun 2026 19:22:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1782008548; cv=none; d=google.com; s=arc-20240605; b=SJ9Z1lR+gq8gpD37rvKn26iJIfDrkxrwsRb4xQdVGdrbPE1BGsafWDDE8WCnjbWCz5 pONfFmGNeJ5eVY+uzFSl6Www1Hs1wRp+uFtSeUrUNR7aWH1gji4+I8u9UgPmUavDpU4n AOxaXYVuyVCiuLj9lK7hFdqn6aeSzl+F68jIE987mjc86NNarzJ/jgaWm67CU5kjujaI KzwkEsB3ciTOodtrsgIBE6C9WdipGvrF/EDIrAgb1HF1onDaB7+y2JP+JVPihA9xUMSX 0x87/7C+DAjQMdKCGwpo3ugtGuIf4nOYsr35G4eAV94Mms37YofiQEvH+jqQ2ql/GFaU qjJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=uVLdVvhNwr35ePORbyr5OsdKrQBtXnjdBe1Xwo/qIjI=; fh=KNCuxsTXvPi4VcHaLgj0s3Xx1xhXeVeqb+Qu9wo5mDU=; b=CNfeq39lFvOSMm8m0wDs3f2hNWHk2eee9aKWv8CcC6sRPow6n/ecDwk4lfVyZwzsiI Gxw4qBKL5pLjDNzRERXrRBgoN3zesNIi0f/8MfdZ/fHV1pQVJAnNDMR6DJvC6/+fSOB2 a0xgNPN0ws7BIRK7jK96Ia+OIKL9mItsDzzJ6Q8UA7vO5eOwrnFtnaU/ZNe/4D5szqs4 fsDK0Zfr4PGf2FQVtFtZV+QxoijF1VzJtEjmoHNhaW2jxJmQ4O9qP6vOZ26ykFOCWvz/ o3Rv0rGGYCM9gIF2XvtG43n66hyHpjwyWgOFqxNx0itwuH4HhtadeXLX1ek+BQKcyL2S 1gnw==; darn=freebsd.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782008548; x=1782613348; 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=uVLdVvhNwr35ePORbyr5OsdKrQBtXnjdBe1Xwo/qIjI=; b=CbI0kfHxzWXYo9RikOU6Y2jrnkyzIpbq0e0Cq/GGPcKrBT5t3eGKFTXexiBblVfx9I 6EjwZ4DUagFGjwQ1juwr7ND4CymPuCjmW2DjahDsy+wMWMldPQ1+BqTF99VV9kfnenTj I/EeEvAeIeGloSfBkT97NNs5mwToTW2jEwnz8Dh5NqeJffYBKdE00cqoXzAp70NCieQM WhnAWTrMqQzHEze8EAEZ0luQVWqp6NcVl7XS6qOYDAohzDGc0Foiv3UpGPJg3h7zJydc m+AiWi9B8rCbrKQX9QTIAM8hRGxV/JN246JwVtupwDHYo9my/8misp+3pSxX0j4Cflly pTlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782008548; x=1782613348; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=uVLdVvhNwr35ePORbyr5OsdKrQBtXnjdBe1Xwo/qIjI=; b=Z+vLk4Cz/TMFJupahDHrims2yS66WHK6scXIIuJ93ijsqgvSqxP5qV3MN3BrXmysBM Z+GxuZZYpzsdRO0MemMW9Y6jgg88H+WJIppETPDlsqFWe1o/tMgs4DHA9Hj/xVmN8Koh taNxVLZLRnFEgeICcIs6DSI1HtY3ziPWPY33rLdlVbNs/gtB6Nq8ZJNvtyvdYUY/vryf HeRbve3gI6uGDNiZFoGzn4WOPFII0f3Nj6KAEjTDiPvpd6WWcp2DJhCEQlDopdH/895n 60m6sgwKOAYK55XXZYh68QEOLZItapxHSex90TR0uX1JPz/ES9K6OgiF7PqXIaQO/33J Aurw== X-Forwarded-Encrypted: i=1; AHgh+Rr4By9bWlbpYCkhxafYTatGFt0uDt9Iw+OdJmmAcQDRFXYVlyiWpQFsDbS05bEJLFkbxXobMnvxHhArHxywVwdm09tZfw==@freebsd.org X-Gm-Message-State: AOJu0YyVU4OwJ/MB1LQfvMFFC7KQzKlmPSGWHxC3nXl8j65lsmtQw8IM eosfvOKc51Ir3JzL7NavX0qnOtpawAsgTe2egC7/PaW8J8nr9EqRleKNbYkZaCPfvqR9Rz6fEqB wS2bOg4gQHxNf72HLmR3JtVZkVp/l7YQweQ== X-Gm-Gg: AfdE7cnk1RbMKqF3Yvr5Yso5+WppB0sdiscyYHjXiD6fhOg+ab2pFe3/NLiHZkPmfWN m2goEOovXt63XtxCX5/pNpwTjuCYC4dZhTDAp2Z7gGIWRdMf2zN/qlWgCqfmR2xA1dalnxQz8v5 +KTrPCwqYVOBuFrkicGuA7h4QtXE7Inl/Qhf4qTgMn+WV2gZtrULq9/gIZzMUdqjvsT2uPZLA1f Zapau9Gv4KclNF61sHLnNkGOnv6QnrcAjBECygyAt0G7TSqHydsOj8Z3U9vQflNn3Dw8L2/8j3G XrgETpm3wQwK X-Received: by 2002:a05:690e:169b:b0:660:406f:61b6 with SMTP id 956f58d0204a3-662ffdec8efmr7693269d50.42.1782008547716; Sat, 20 Jun 2026 19:22:27 -0700 (PDT) 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 References: <6a36e480.318f5.79b60374@gitrepo.freebsd.org> In-Reply-To: <6a36e480.318f5.79b60374@gitrepo.freebsd.org> From: Oliver Pinter Date: Sun, 21 Jun 2026 04:22:15 +0200 X-Gm-Features: AVVi8CfHtyIuAs6S2vxiSfCfCZoTEgyRdlpAK5ZtN_cSWNrC5D5-Dw1bu1OMa5E Message-ID: Subject: Re: git: 730eaf466493 - main - sound tests: Add PROT_EXEC rejection test To: Christos Margiolis Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000007932780654ba329d" X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4gjZqF4ZGFz3YFV X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated --0000000000007932780654ba329d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Jun 20, 2026 at 9:06=E2=80=AFPM Christos Margiolis wrote: > > The branch main has been updated by christos: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D730eaf466493315c1d1164eb6b59b1476= 6f49322 > > commit 730eaf466493315c1d1164eb6b59b14766f49322 > Author: Christos Margiolis > AuthorDate: 2026-06-12 06:20:26 +0000 > Commit: Christos Margiolis > CommitDate: 2026-06-20 19:04:50 +0000 > > sound tests: Add PROT_EXEC rejection test > > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Reviewed by: markj, kib > Pull-Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/30 > --- > tests/sys/sound/mmap.c | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > > diff --git a/tests/sys/sound/mmap.c b/tests/sys/sound/mmap.c > index b44b16e7f312..e83193db9bc1 100644 > --- a/tests/sys/sound/mmap.c > +++ b/tests/sys/sound/mmap.c > @@ -102,10 +102,38 @@ ATF_TC_BODY(mmap_buffer_lifetime, tc) > ATF_REQUIRE(munmap(buf, len) =3D=3D 0); > } > > +ATF_TC(mmap_reject_prot_exec); > +ATF_TC_HEAD(mmap_reject_prot_exec, tc) > +{ > + atf_tc_set_md_var(tc, "descr", "mmap PROT_EXEC rejection test"); > + atf_tc_set_md_var(tc, "require.kmods", "snd_dummy"); > +} > + > +ATF_TC_BODY(mmap_reject_prot_exec, tc) > +{ > + uint8_t *buf; > + size_t len; > + int fd; > + > + fd =3D open("/dev/dsp.dummy", O_RDWR); > + ATF_REQUIRE_MSG(fd >=3D 0, FMT_ERR("open")); > + > + len =3D 8; > + > + buf =3D mmap(NULL, len, PROT_READ | *PROT_EXEC | PROT_EXEC*, MAP_SHARED, There is PROT_EXEC twice. > + fd, 0); > + ATF_REQUIRE_MSG(buf =3D=3D MAP_FAILED, FMT_ERR("mmap")); > + > + munmap(buf, len); > + > + close(fd); > +} > + > ATF_TP_ADD_TCS(tp) > { > ATF_TP_ADD_TC(tp, mmap_offset_overflow); > ATF_TP_ADD_TC(tp, mmap_buffer_lifetime); > + ATF_TP_ADD_TC(tp, mmap_reject_prot_exec); > > return (atf_no_error()); > } > --0000000000007932780654ba329d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sat, Jun 20, 2026 at 9:06=E2=80=AFPM Christos M= argiolis <christos@freebsd.org> wrote:
>
> The branch main has been updated by christos:=
>
> URL:
https://cgit.FreeBSD.org/src/comm= it/?id=3D730eaf466493315c1d1164eb6b59b14766f49322
>
> commi= t 730eaf466493315c1d1164eb6b59b14766f49322
> Author: =C2=A0 =C2=A0 Ch= ristos Margiolis <christos@FreeBSD.org>
> AuthorDate: 2026-06-1= 2 06:20:26 +0000
> Commit: =C2=A0 =C2=A0 Christos Margiolis <chris= tos@FreeBSD.org>
> CommitDate: 2026-06-20 19:04:50 +0000
>> =C2=A0 =C2=A0 sound tests: Add PROT_EXEC rejection test
>
&= gt; =C2=A0 =C2=A0 Sponsored by: =C2=A0 The FreeBSD Foundation
> =C2= =A0 =C2=A0 MFC after: =C2=A0 =C2=A0 =C2=A01 week
> =C2=A0 =C2=A0 Revi= ewed by: =C2=A0 =C2=A0markj, kib
> =C2=A0 =C2=A0 Pull-Request: =C2=A0= https://ron-d= ev.freebsd.org/FreeBSD/src/pulls/30
> ---
> =C2=A0tests/sys= /sound/mmap.c | 28 ++++++++++++++++++++++++++++
> =C2=A01 file change= d, 28 insertions(+)
>
> diff --git a/tests/sys/sound/mmap.c b/t= ests/sys/sound/mmap.c
> index b44b16e7f312..e83193db9bc1 100644
&g= t; --- a/tests/sys/sound/mmap.c
> +++ b/tests/sys/sound/mmap.c
>= ; @@ -102,10 +102,38 @@ ATF_TC_BODY(mmap_buffer_lifetime, tc)
> =C2= =A0 =C2=A0 =C2=A0 =C2=A0 ATF_REQUIRE(munmap(buf, len) =3D=3D 0);
> = =C2=A0}
>
> +ATF_TC(mmap_reject_prot_exec);
> +ATF_TC_HEA= D(mmap_reject_prot_exec, tc)
> +{
> + =C2=A0 =C2=A0 =C2=A0 atf_= tc_set_md_var(tc, "descr", "mmap PROT_EXEC rejection test&qu= ot;);
> + =C2=A0 =C2=A0 =C2=A0 atf_tc_set_md_var(tc, "require.km= ods", "snd_dummy");
> +}
> +
> +ATF_TC_BOD= Y(mmap_reject_prot_exec, tc)
> +{
> + =C2=A0 =C2=A0 =C2=A0 uint= 8_t *buf;
> + =C2=A0 =C2=A0 =C2=A0 size_t len;
> + =C2=A0 =C2= =A0 =C2=A0 int fd;
> +
> + =C2=A0 =C2=A0 =C2=A0 fd =3D open(&qu= ot;/dev/dsp.dummy", O_RDWR);
> + =C2=A0 =C2=A0 =C2=A0 ATF_REQUIR= E_MSG(fd >=3D 0, FMT_ERR("open"));
> +
> + =C2=A0 = =C2=A0 =C2=A0 len =3D 8;
> +
> + =C2=A0 =C2=A0 =C2=A0 buf =3D m= map(NULL, len, PROT_READ | PROT_EXEC | PROT_EXEC, MAP_SHARED,
There is PROT_EXEC twice.

> + =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 fd, 0);
> + =C2=A0 =C2=A0 =C2=A0 ATF_REQUIRE_MSG= (buf =3D=3D MAP_FAILED, FMT_ERR("mmap"));
> +
> + =C2= =A0 =C2=A0 =C2=A0 munmap(buf, len);
> +
> + =C2=A0 =C2=A0 =C2= =A0 close(fd);
> +}
> +
> =C2=A0ATF_TP_ADD_TCS(tp)
>= ; =C2=A0{
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 ATF_TP_ADD_TC(tp, mmap_offset= _overflow);
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 ATF_TP_ADD_TC(tp, mmap_buff= er_lifetime);
> + =C2=A0 =C2=A0 =C2=A0 ATF_TP_ADD_TC(tp, mmap_reject_= prot_exec);
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (atf_no_erro= r());
> =C2=A0}
>
--0000000000007932780654ba329d-- From nobody Sun Jun 21 02:55:09 2026 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 4gjbXs74cpz6hhQH for ; Sun, 21 Jun 2026 02:55: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjbXs3XNvz3cDw for ; Sun, 21 Jun 2026 02:55:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782010509; 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=M0VdusJmaGBMpUyCpyBYsfwlLtk36xQrlhR5zrACFmI=; b=itK5yCq5oxQcwQLej+Je/WxxYi3VAFyGs0wJby9ffu989nwEWS13mzSPlHNCqtcHtSMkms REPBXeB/wWk2lDLDbdRu0nkctoS2gF1Zdl7QbRUW7M4PUqlanz7g19NTLpP+TIBWMeRr8M 4mrTnIMXyaQPXXKVMypRViyd9uwpOSQxeX8EsWvDidQ93jiMaQuGXPh4Nw5DOHZgblFpK1 ZSYr5CGHzQtV4ddv+fgzn7OHYT1Aic7DoABBaennU7tqnAjbR1zbYmuA4R4rUmPOk5NdD4 XGU2FVDibtFoUn7aOl/S0HFloO+arrcFwl+qh5Icw929zwCrtNOneChcwiy5Cg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782010509; a=rsa-sha256; cv=none; b=ysgaF2EHuLvPlLR0XyWVEavuMx4hVr+KPh4WRo02XUO84JCRvuZAl6QVJ0cIPsKQwnIxvZ SV3SdY70a5H1HylC7Km1/DXvz5ZXIk6UebwiceoUkY9jFWE5aSHfE8zarFie7CIXRHuXPg G8Sw/pWdzpV52v6Y3gAtLk2BI5XNOFBExCHCeV+bkiG8O7zlHQ9qcHTlTcSlxlWmGdQMvN kOGXRupmMxcR9ZpqLTjmHF31qlyPXO7mKKUYvfl67CliBHcAebY9QjyOtrJjWVBSvD9wsb go8I74NRZJtW3qMCGvFlUmw93a5h20O774XmgP6T3Kzcz6zasJJwGZsJSo32Rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782010509; 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=M0VdusJmaGBMpUyCpyBYsfwlLtk36xQrlhR5zrACFmI=; b=GVxeiT5eO9BmJbsS+nJwiIguDsYcMoN5WjXT1YLTbfqPqk8qoQ/IRerhusfoRG5SgQWDZ/ XIIsWQgm0x+7rF9kDEelzz+BAXm7kbaI1MuStNzuAFmK11OXEU8Go0UhDjAUgUw4yznCsU YDTflsmGoxvfVb15jbX3iFOC9/hVCeUwj2pYEkOJqHUtoYy9efW576G0ATZacoaV3/0rqm 7nq8vEWN1kYs1N4Ml6eoS0Xt0JXPvsPD9Cc4jN8Y8Z69k4zTt4XWrnatJ5wIKBzH9Bf+tD fx7y6H92qUlZzt5yj+zQntEvFuA4FIntzz/jwLqvl/ohzcuC7lqMLB100uocEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjbXs2DbWzyLx for ; Sun, 21 Jun 2026 02:55:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d59e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 02:55:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: fa515f60fce0 - main - nfs_nfsdport.c: One more unnecessary initialization for gcc 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa515f60fce0edd09d0b1078852ec06b1cd0a74c Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 02:55:09 +0000 Message-Id: <6a37528d.3d59e.2f337910@gitrepo.freebsd.org> The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=fa515f60fce0edd09d0b1078852ec06b1cd0a74c commit fa515f60fce0edd09d0b1078852ec06b1cd0a74c Author: Rick Macklem AuthorDate: 2026-06-21 02:53:06 +0000 Commit: Rick Macklem CommitDate: 2026-06-21 02:53:06 +0000 nfs_nfsdport.c: One more unnecessary initialization for gcc Fixes: d8e8f9251975 ("pNFSd: Add a directory of newly created files for the pNFSd") --- sys/fs/nfsserver/nfs_nfsdport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 16b74f0cded8..5c8c03d9571d 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -6798,7 +6798,7 @@ nfsrv_writedsrpc(fhandle_t *fhp, off_t off, int len, struct ucred *cred, int stripecnt, uint64_t stripesiz, struct mbuf **mpp, char *cp, int *failposp) { - struct nfsrvwritedsdorpc *drpc, *tdrpc; + struct nfsrvwritedsdorpc *drpc, *tdrpc = NULL; /* Shut up gcc. */ struct nfsvattr na; struct mbuf *m; fhandle_t *tfhp; From nobody Sun Jun 21 05:29:51 2026 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 4gjfzN1Y0Gz6hygp for ; Sun, 21 Jun 2026 05:29: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjfzM5kShz3qy8 for ; Sun, 21 Jun 2026 05:29:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782019791; 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=HB9ZCgCMVnnZe4gKy6rHEdc9SIkYtJDBI4NIBdCI4hg=; b=ZauGgwJG3G1uxkiySK2gFYX1TyoA3CL9STpR0T51YV+eOFKxB65a+NWxe8+w7oJOxSbyH/ iZpTbymWfUaZ/4nmtzy41r+WvJdzw3JBlWpUnOjxTZwgaAGSTpg4O53YaJ0yTipQqs30nf vqBTDaZPNoPl60WyvR3Rcy43lsjOjc7DMfVv9BLdo37Vtl53E61Bid8l1Q47II84P43McX 9kfFrIEIulp/2tHFowBlakSiJmYUHv+Bi9Tq9jxG5HOMXlZgYDzYBMzsV/s8dr0UuUJjxm xHlkxTOL4MvwVC1ZgYBXBRLRo/itM52wfZEeTY2XXRevcnt0EUzhDCl9Y93OFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782019791; a=rsa-sha256; cv=none; b=qU+yNfcm2nnE6WUNSm07/aRyn2l33izyjkbZQccQBNIAp8VpamPcf12LJubmO6SjeNzCNL CPPR6SrXlovUxfdxIkT275pHzVOQ4onjALmr9+sJhAId1CaGj41Cs5EcK4I82zAF6FVMiQ 1GBHqJHpAYVMZlDEoAIyFN8g++1gySq0hM3YGl+/WYYYVkCDmHGsSTCRbPFa+l4GTrvszn z3Z/4vZopWNedVqafKg+eo4Iuz3ZvEymYjAD/tVWc0q8LwsTC17RipjdghbvTH7RyoXE5d x5RC5LVYg0SZA0vjLFj+KO5xOX1xT5cUNptFJmJX1te2lzz+22MKwPuvVSrmBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782019791; 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=HB9ZCgCMVnnZe4gKy6rHEdc9SIkYtJDBI4NIBdCI4hg=; b=l0Z6SHZ0e/YMzBT2rgQdPFIN9Vq3XJKykeYADxFRBhm2+Y5B4JFxXE6RVwofyLoUn7eXsP j0PD/WsrDvsrlerAqU1Fg1aUOP5dDIDWY0i7CmRloW8kP0ElhJwjfmG3xMzw0TPgQ0udbh TatVkj2HFeed6kmm49IMRbMJVq72uPd6P0n+i0DEgVYRjw/2zv+afayUgfkFrpp+Y97XoZ WJG8D0S/Dlmol6wN/qrKrMnA8DdtFk2JkS24AVW6V2b/zs/cxupHcya3l4T7LeqHpV4N6y szWvxSBd3Wo8WJ452BxqIQICtU7XJUkcVVymce+hHE+rfTlWrKZGBIYZ3QJu8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjfzM4XrFz13Md for ; Sun, 21 Jun 2026 05:29:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25854 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 05:29:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Devin Teske Subject: git: a4ed783cee2a - main - ig4: unconditionally un-idle the controller core on resume 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dteske X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a4ed783cee2a10629db7a6c254712f96bd820288 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 05:29:51 +0000 Message-Id: <6a3776cf.25854.233f603c@gitrepo.freebsd.org> The branch main has been updated by dteske: URL: https://cgit.FreeBSD.org/src/commit/?id=a4ed783cee2a10629db7a6c254712f96bd820288 commit a4ed783cee2a10629db7a6c254712f96bd820288 Author: Devin Teske AuthorDate: 2026-06-19 17:24:58 +0000 Commit: Devin Teske CommitDate: 2026-06-21 05:28:47 +0000 ig4: unconditionally un-idle the controller core on resume On controllers with the LPSS "additional registers" (Skylake and later, IG4_HAS_ADDREGS), ig4iic_suspend() places the controller in the device idle state (IG4_DEVICE_IDLE) and asserts core reset. While idle the DesignWare core is power-gated: its register bank reads back as zero and writes are dropped until the core is taken out of the idle state again. ig4iic_set_config(), called from ig4iic_resume(), only performs that un-idle handshake when it observes IG4_RESTORE_REQUIRED set in DEVIDLE_CTRL. Some platforms (e.g. Intel Alder Lake-P) do not raise that status across suspend-to-idle (S0ix). The core is then left gated: set_config()'s register writes have no effect, it nevertheless returns success, and every subsequent transfer fails with IIC_ETIMEOUT, leaving child I2C-HID devices (touchpad, touchscreen) dead after resume. Give ig4iic_set_config() a force_restore argument and pass it from ig4iic_resume() so the un-idle handshake runs unconditionally for IG4_HAS_ADDREGS controllers, regardless of the RESTORE_REQUIRED status. This keeps the handshake and its reset/restore sequence in one place instead of duplicating it in the resume path. The DesignWare core's register bank stays inaccessible (reads back as zero) until it leaves reset, which happens when ig4iic_set_config() deasserts the core reset. Rather than waiting a fixed, guessed interval, poll the fixed component-type signature (IG4_REG_COMP_TYPE == IG4_COMP_TYPE) immediately after that deassert and continue as soon as the core is ready. On Alder Lake-P the core is ready with no measurable delay; the bounded poll keeps this correct on slower parts, and warns if the core never leaves reset. While integrating these I2C-HID touch devices, also raise hid(4)'s MAXLOCCNT from 2048 to 4096: the report-descriptor parser truncates any variable main item whose usage count exceeds MAXLOCCNT, silently dropping the trailing report fields. Some contemporary touch devices declare variable items with more than 2048 entries, so part of their input reports was being discarded. Reviewed by: adrian MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D57673 --- sys/dev/hid/hid.c | 2 +- sys/dev/ichiic/ig4_iic.c | 52 ++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 47 insertions(+), 7 deletions(-) diff --git a/sys/dev/hid/hid.c b/sys/dev/hid/hid.c index 453c37d806fc..c07343fc057f 100644 --- a/sys/dev/hid/hid.c +++ b/sys/dev/hid/hid.c @@ -66,7 +66,7 @@ hid_test_quirk_t *hid_test_quirk_p = &hid_test_quirk_w; #define MAXUSAGE 64 #define MAXPUSH 4 #define MAXID 16 -#define MAXLOCCNT 2048 +#define MAXLOCCNT 4096 struct hid_pos_data { uint32_t rid; diff --git a/sys/dev/ichiic/ig4_iic.c b/sys/dev/ichiic/ig4_iic.c index cd88b28a2d52..161a940c5e7a 100644 --- a/sys/dev/ichiic/ig4_iic.c +++ b/sys/dev/ichiic/ig4_iic.c @@ -134,7 +134,7 @@ static const struct ig4_hw ig4iic_hw[] = { }, }; -static int ig4iic_set_config(ig4iic_softc_t *sc, bool reset); +static int ig4iic_set_config(ig4iic_softc_t *sc, bool reset, bool force_restore); static driver_filter_t ig4iic_intr; static void ig4iic_dump(ig4iic_softc_t *sc); @@ -661,7 +661,7 @@ ig4iic_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) ig4iic_xfer_abort(sc) != 0) { device_printf(sc->dev, "Failed to abort " "transfer. Do the controller reset.\n"); - ig4iic_set_config(sc, true); + ig4iic_set_config(sc, true, false); } else { while (reg_read(sc, IG4_REG_I2C_STA) & IG4_STATUS_RX_NOTEMPTY) @@ -910,12 +910,23 @@ ig4iic_get_config(ig4iic_softc_t *sc) } static int -ig4iic_set_config(ig4iic_softc_t *sc, bool reset) +ig4iic_set_config(ig4iic_softc_t *sc, bool reset, bool force_restore) { uint32_t v; + int i; + /* + * Take the LPSS DesignWare core out of the "device idle" state. While + * idle the core is power-gated: its register bank reads back as zero and + * writes are dropped. Normally we perform this un-idle handshake only + * when IG4_RESTORE_REQUIRED is observed in DEVIDLE_CTRL, but some + * platforms (e.g. Intel Alder Lake-P) do not raise that status across + * suspend-to-idle (S0ix). Callers that know the core was idled (the + * resume path) pass force_restore to perform the handshake regardless. + */ v = reg_read(sc, IG4_REG_DEVIDLE_CTRL); - if (IG4_HAS_ADDREGS(sc->version) && (v & IG4_RESTORE_REQUIRED)) { + if (IG4_HAS_ADDREGS(sc->version) && + (force_restore || (v & IG4_RESTORE_REQUIRED))) { reg_write(sc, IG4_REG_DEVIDLE_CTRL, IG4_DEVICE_IDLE | IG4_RESTORE_REQUIRED); reg_write(sc, IG4_REG_DEVIDLE_CTRL, 0); pause("i2crst", 1); @@ -928,6 +939,23 @@ ig4iic_set_config(ig4iic_softc_t *sc, bool reset) } else if (IG4_HAS_ADDREGS(sc->version) && reset) { reg_write(sc, IG4_REG_RESETS_SKL, IG4_RESETS_ASSERT_SKL); reg_write(sc, IG4_REG_RESETS_SKL, IG4_RESETS_DEASSERT_SKL); + /* + * The DesignWare core's register bank is inaccessible (reads + * back as zero) until it leaves reset. Poll the fixed + * component-type signature so we proceed exactly when the core + * is ready, rather than waiting a fixed, guessed interval. + */ + for (i = 0; i < 100; i++) { + if (reg_read(sc, IG4_REG_COMP_TYPE) == IG4_COMP_TYPE) + break; + DELAY(10); + } + if (i == 100) { + device_printf(sc->dev, "WARNING: I2C controller core " + "did not leave reset (COMP_TYPE 0x%08x); device " + "may be unusable\n", + reg_read(sc, IG4_REG_COMP_TYPE)); + } } if (sc->version == IG4_ATOM) @@ -1037,7 +1065,7 @@ ig4iic_attach(ig4iic_softc_t *sc) ig4iic_get_config(sc); - error = ig4iic_set_config(sc, IG4_HAS_ADDREGS(sc->version)); + error = ig4iic_set_config(sc, IG4_HAS_ADDREGS(sc->version), false); if (error) goto done; ig4iic_get_fifo(sc); @@ -1130,7 +1158,19 @@ int ig4iic_resume(ig4iic_softc_t *sc) int error; sx_xlock(&sc->call_lock); - if (ig4iic_set_config(sc, IG4_HAS_ADDREGS(sc->version))) + + /* + * ig4iic_suspend() leaves the controller power-gated in the LPSS + * "device idle" state. Force the un-idle/restore handshake in + * ig4iic_set_config() so the DesignWare core is reliably restored + * before reconfiguration: some platforms (e.g. Intel Alder Lake-P) do + * not raise IG4_RESTORE_REQUIRED across suspend-to-idle (S0ix), and + * without the forced handshake the core stays gated, set_config()'s + * writes are dropped, and every subsequent transfer fails with + * IIC_ETIMEOUT, leaving child I2C-HID devices (touchpad, touchscreen) + * dead after resume. + */ + if (ig4iic_set_config(sc, IG4_HAS_ADDREGS(sc->version), true)) device_printf(sc->dev, "controller error during resume\n"); sx_xunlock(&sc->call_lock); From nobody Sun Jun 21 10:13:50 2026 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 4gjnHQ67Wmz6jR97; Sun, 21 Jun 2026 10:14:10 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjnHP660cz3H05; Sun, 21 Jun 2026 10:14:09 +0000 (UTC) (envelope-from kib@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 65LADpY8093473; Sun, 21 Jun 2026 13:13:54 +0300 (EEST) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 65LADpY8093473 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 65LADoR6093472; Sun, 21 Jun 2026 13:13:50 +0300 (EEST) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Sun, 21 Jun 2026 13:13:50 +0300 From: Konstantin Belousov To: Faraz Vahedi Cc: Warner Losh , alc@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 9d87c1aac4a8 - main - libc: Add missing kill_dependency macro Message-ID: References: <6a35ddd4.24ba1.2ad9343d@gitrepo.freebsd.org> <9A21692F-0B53-4303-85A8-57784BFAF8DE@kfv.io> <33E8BFC4-EA46-41A7-B54F-1AADD3C19D9E@kfv.io> 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=4.0.2 X-Spam-Checker-Version: SpamAssassin 4.0.2 (2025-08-27) on tom.home X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4gjnHP660cz3H05 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Sat, Jun 20, 2026 at 11:50:50PM +0330, Faraz Vahedi wrote: > Hey, > > I see. I dug further into related proposals and the reasons why no > compiler today has implemented true data dependency tracking > and that they all basically map and promote consume to acquire. > The kill_dependency is also basically a no-op, and both compilers > optimise them identically. I did a few tests on my AArch64 box and > that's how I'm convinced, so I believe keeping the current form > could be ideal as it fully conforms to the standard and we're assured > that at least any conforming compiler would support it just fine and > there's no extension or non-standard tweak in it. On the other hand, > although adding a separate branch with the GCC style is possible, I > don't think that'd add any value but visual complications. > > Either way, whether dependency tracking changes drastically or this > very approach becomes obsolete, keeping our header as-is seems > safe for now. I am fine with it then. My concern was in subtle breakage of the code compiled with gcc. Thanks. > > Again, I should admit that despite my enthusiasm for compilers and > long-time personal studies of that field, I am by no means an expert > and can be wrong, or at least miss some corner cases I'm not aware > of, so please educate me if so. > > Yours, > Faraz From nobody Sun Jun 21 10:35:01 2026 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 4gjnlr20Cnz6jSss for ; Sun, 21 Jun 2026 10:35:20 +0000 (UTC) (envelope-from eduardo@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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjnlr0fYBz3NX4 for ; Sun, 21 Jun 2026 10:35:20 +0000 (UTC) (envelope-from eduardo@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782038120; 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=7KEPxjUrLDZEXT1Q4DvKGVcNPZaR8mDq2JQhL0gV1s8=; b=SxV05Dmho2I8z/geXyUpqIhu9EkBvMAzhNpQecIBbFs0Wn3j8I0u4UXuvVmdN63lbm8x7i E/GHUC4gcJebirZZMZm07cU+nq10W7sYZUYvFW422V3CC7lBnh7z1VhFTlgSeSLcO+/SCR xoLNP5/QMDxsAs8yYovvGWuCtlDoFPxKvNO+zeUrvx7ankvJ1Wj8fgt7YH+gvq+QH5kTN2 8Zv0lPPh5AX/9unnx1erpnY3pxJ2pkzklfOgur3Ji8ZTypagFDpOIYX1ynQYKrjk2Lekug vFkju6Y0AlLgXZSnG6zgtr85ZbMJJXsvixA/ZcPdDAfyGx3kldeh3GtUjUraNQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782038120; a=rsa-sha256; cv=none; b=EAee48Uiqt7vUnBb8Cf3Ebgp+wFnK5E5g+81g+1o/Tz/ggZH9TyOivw/oRylg1Hl49XioQ ALLKCn9htG7s0wJv6sVmP0UegwpJVIvkNR8n2zlLC88AlrDA+G4DfqkilLMK60NIABsMRW xxZ1PYsUiOXajkK4yfTyjUZxrfS5A0xYgf5mJxdEr1dfGn1xPipeBGbg3HFeIP4X1l1+tA fH3Tx+fkUWUYBGBp9qkw6ZGSO7p1yMuUsrDg/h8+iBPV16yGqMLgW4TCLeQiQYQU2VcAMr myhhN/pD2ICxMZgleWz42HV1XoNPIqrwL7fpx+qxgnA10cSRa7f3EMKBcjV7bw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782038120; 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=7KEPxjUrLDZEXT1Q4DvKGVcNPZaR8mDq2JQhL0gV1s8=; b=K+0ba1lPhuShGRDOFp7BEAof+h/jQA1FTG6I1fD9EzXNKzxhESvalhHBnzenk1RIrRUtEG jxThQlBcUaDTQp72oYvZIdFFIt9GnR5V/r/Qy7ccSqMN4sZ1MrvVjXoSBwpVF1VHE3/Bnj GpytYov5hM4N2KJBsmt66L30K+qnRzjASFFvmu788iopTFxysKWhKLI3UJi+k2JhIvwkOl q/A7mHdL6PASxL22GdWa65/Nhvy4snlULwUfR5HtjN98xUOd0H0tM2vdKOTDmV72qEhyNk p7w8OiDJotyVNt3ZUMXK++dAUKslIN3vPGAgiw78Z6ZT3VrtqzqBAAs3DQBAQg== Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.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)) (Authenticated sender: eduardo) by smtp.freebsd.org (Postfix) with ESMTPSA id 4gjnlq4Tzxzt26 for ; Sun, 21 Jun 2026 10:35:19 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-5ad544cde93so373550e87.3 for ; Sun, 21 Jun 2026 03:35:19 -0700 (PDT) X-Forwarded-Encrypted: i=1; AFNElJ+p/irQN3zVcBU1DqmNbgWOhQ6YSVC0dg2GgTh/LYkcAV3pVojxGLThYma60LTOLi5TrEfU+pjo9IfFqfR7mdFxEZkHaQ==@freebsd.org X-Gm-Message-State: AOJu0YypJV/wbLv8ycMTqhHnP+djWxTN6Xb6bnXls3/Wzpw6MePQTfyH LHw6pj61DdQkWqEmbI16vDPTppfAWS8lLpjt91wfPHKPu3hcGdH5jZd7cyNm7nbZzQG//n8NRTy xPPERz8gEYISiBgiqoBspBW+8nAi3cGw= X-Received: by 2002:a05:651c:220e:b0:396:8491:3135 with SMTP id 38308e7fff4ca-3998a21cd16mr11135031fa.1.1782038113069; Sun, 21 Jun 2026 03:35:13 -0700 (PDT) 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 References: <6a35ddd3.22963.721d614@gitrepo.freebsd.org> In-Reply-To: <6a35ddd3.22963.721d614@gitrepo.freebsd.org> From: Nuno Teixeira Date: Sun, 21 Jun 2026 11:35:01 +0100 X-Gmail-Original-Message-ID: X-Gm-Features: AVVi8CcRe9IkLHl788leqhm6MNddnICUtbUKvA7AJqZcVfdjjd-1zUupr0P_dRU Message-ID: Subject: Re: git: 28cecfe27964 - main - libc: Restrict ATOMIC_VAR_INIT for C23 conformance To: Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Faraz Vahedi Content-Type: multipart/alternative; boundary="000000000000b4af980654c114d2" --000000000000b4af980654c114d2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, (poudriere-devel build at main-n286792-eafa181d51f7: Sat Jun 20) I've found that ports-mgmt/portfmt started failing with: ... FAILED: [code=3D1] /wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/_build/portscan/st= atus.o cc -std=3Dgnu11 -O2 -g -W -Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wno-unused-parameter -flto=3Dthin -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -Wno-strict-prototypes -DPORTFMT_SUBPACKAGES=3D0 -MD -MF /wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/_build/portscan/st= atus.o.d -I/wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/_build -I/wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6 -c -o /wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/_build/portscan/st= atus.o /wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/portscan/status.c /wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/portscan/status.c:= 59:38: warning: call to undeclared function 'ATOMIC_VAR_INIT'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59 | static atomic_int status_requested =3D ATOMIC_VAR_INIT(0); | ^ /wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/portscan/status.c:= 59:38: error: initializer element is not a compile-time constant 59 | static atomic_int status_requested =3D ATOMIC_VAR_INIT(0); | ^~~~~~~~~~~~~~~~~~ /wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/portscan/status.c:= 60:32: error: initializer element is not a compile-time constant 60 | static atomic_size_t scanned =3D ATOMIC_VAR_INIT(0); | ^~~~~~~~~~~~~~~~~~ 1 warning and 2 errors generated. ... Same for devel/qt6-base: ... FAILED: [code=3D1] src/corelib/CMakeFiles/Core.dir/io/forkfd_qt.c.o /usr/bin/cc -DBACKTRACE_HEADER=3D\"execinfo.h\" -DCore_EXPORTS -DQT_ASCII_CAST_WARNINGS -DQT_BUILDING_QT -DQT_BUILD_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_LEAN_HEADERS=3D1 - DQT_MOC_COMPAT -DQT_NO_CAST_TO_ASCII -DQT_NO_CONTEXTLESS_CONNECT -DQT_NO_DEBUG -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_QASCONST -DQT_NO_QEXCHANGE -DQT_NO_QPAI R -DQT_NO_QSNPRINTF -DQT_NO_SINGLE_ARGUMENT_QHASH_OVERLOAD=3D1 -DQT_NO_STD_FORMAT_SUPPORT -DQT_NO_USING_NAMESPACE -DQT_TYPESAFE_FLAGS -DQT_USE_NODISCARD_FILE_OPEN -DQT_USE_QSTRINGBUILDER -D_LARGEFILE64_SOURCE -D_LA RGEFILE_SOURCE -D_LIBCPP_HARDENING_MODE=3D_LIBCPP_HARDENING_MODE_FAST -I/wrkdirs/usr/ports/devel/qt6-base/work/.build/src/corelib/Core_autogen/in= clude -I/wrkdirs/usr/ports/devel/qt6-base/work/.build/include -I/wrkd irs/usr/ports/devel/qt6-base/work/.build/include/QtCore -I/wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/c= orelib -I/wrkdirs/usr/ports/devel/qt6-base/work/.build/src/corelib -I/wrkdirs/usr /ports/devel/qt6-base/work/.build/src/corelib/global -I/wrkdirs/usr/ports/devel/qt6-base/work/.build/src/corelib/kernel -I/wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/c= orelib/../3rdpart y/tinycbor/src -I/wrkdirs/usr/ports/devel/qt6-base/work/.build/include/QtCore/6.11.1 -I/wrkdirs/usr/ports/devel/qt6-base/work/.build/include/QtCore/6.11.1/QtCor= e -I/wrkdirs/usr/ports/devel/qt6-base/work/qtbase-ev erywhere-src-6.11.1/src/corelib/../3rdparty/forkfd -I/wrkdirs/usr/ports/devel/qt6-base/work/.build/src/corelib/.rcc -I/wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/mkspe= cs/freebsd-clang -isy stem /usr/local/include -isystem /usr/local/include/glib-2.0 -isystem /usr/local/lib/glib-2.0/include -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -pipe -fstack-protector-strong -fno-strict-aliasing -DNDEBUG -O3 -std=3Dgnu11 -fPIC -fvisibility=3Dhidden -Wall -Wextra -pthre= ad -fcf-protection=3Dfull -ftrivial-auto-var-init=3Dpattern -fstack-protector-strong -fexceptions -MD -MT src/corelib/CMakeFiles/Core.dir/io/fork fd_qt.c.o -MF src/corelib/CMakeFiles/Core.dir/io/forkfd_qt.c.o.d -o src/corelib/CMakeFiles/Core.dir/io/forkfd_qt.c.o -c /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/cor= elib/io/forkfd_qt .c In file included from /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/cor= elib/io/forkfd_qt.c:16: /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/cor= elib/io/../../3rdparty/forkfd/forkfd.c:162:39: warning: call to undeclared function 'ATOMIC_VAR_INIT'; ISO C99 and later do not support i mplicit function declarations [-Wimplicit-function-declaration] 162 | static ffd_atomic_int forkfd_status =3D FFD_ATOMIC_INIT(0); | ^ /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/cor= elib/io/../../3rdparty/forkfd/forkfd_c11.h:54:37: note: expanded from macro 'FFD_ATOMIC_INIT' 54 | #define FFD_ATOMIC_INIT(val) ATOMIC_VAR_INIT(val) | ^ In file included from /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/cor= elib/io/forkfd_qt.c:16: /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/cor= elib/io/../../3rdparty/forkfd/forkfd.c:162:39: error: initializer element is not a compile-time constant 162 | static ffd_atomic_int forkfd_status =3D FFD_ATOMIC_INIT(0); | ^~~~~~~~~~~~~~~~~~ /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/cor= elib/io/../../3rdparty/forkfd/forkfd_c11.h:54:37: note: expanded from macro 'FFD_ATOMIC_INIT' 54 | #define FFD_ATOMIC_INIT(val) ATOMIC_VAR_INIT(val) | ^~~~~~~~~~~~~~~~~~~~ In file included from /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/cor= elib/io/forkfd_qt.c:16: In file included from /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/cor= elib/io/../../3rdparty/forkfd/forkfd.c:930: /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/cor= elib/io/../../3rdparty/forkfd/forkfd_freebsd.c:45:45: error: initializer element is not a compile-time constant 45 | static ffd_atomic_int system_forkfd_state =3D FFD_ATOMIC_INIT(1); | ^~~~~~~~~~~~~~~~~~ /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/cor= elib/io/../../3rdparty/forkfd/forkfd_c11.h:54:37: note: expanded from macro 'FFD_ATOMIC_INIT' 54 | #define FFD_ATOMIC_INIT(val) ATOMIC_VAR_INIT(val) | ^~~~~~~~~~~~~~~~~~~~ 1 warning and 2 errors generated. ... Thanks, Warner Losh escreveu (s=C3=A1bado, 20/06/2026 =C3=A0(s) 0= 1:25): > The branch main has been updated by imp: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D28cecfe27964fdb67497800f5dcd5d3= e1033727f > > commit 28cecfe27964fdb67497800f5dcd5d3e1033727f > Author: Faraz Vahedi > AuthorDate: 2026-05-01 14:34:44 +0000 > Commit: Warner Losh > CommitDate: 2026-06-20 00:23:28 +0000 > > libc: Restrict ATOMIC_VAR_INIT for C23 conformance > > Omit `ATOMIC_VAR_INIT` when targeting C23, where it has been removed. > Retain it for earlier C standards and for C++ (as it still remains in > C++23, albeit marked as deprecated since C17 and C++20.) > > Also separate `atomic_init` definitions from `ATOMIC_VAR_INIT` to > avoid coupling with a deprecated initialisation mechanism. > > No functional change intended for `atomic_init`; this is purely a > conformance and cleanup adjustment. > > Signed-off-by: Faraz Vahedi > Reviewed by: imp > Pull Request: https://github.com/freebsd/freebsd-src/pull/2185 > --- > sys/sys/stdatomic.h | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/sys/sys/stdatomic.h b/sys/sys/stdatomic.h > index c3f9b217519c..2d565ce991be 100644 > --- a/sys/sys/stdatomic.h > +++ b/sys/sys/stdatomic.h > @@ -86,11 +86,17 @@ > * 7.17.2 Initialization. > */ > > +#if __ISO_C_VISIBLE < 2023 || defined(__cplusplus) > #if defined(__CLANG_ATOMICS) > #define ATOMIC_VAR_INIT(value) (value) > -#define atomic_init(obj, value) __c11_atomic_init(obj, > value) > #else > #define ATOMIC_VAR_INIT(value) { .__val =3D (value) } > +#endif > +#endif > + > +#if defined(__CLANG_ATOMICS) > +#define atomic_init(obj, value) __c11_atomic_init(obj, > value) > +#else > #define atomic_init(obj, value) ((void)((obj)->__val =3D > (value))) > #endif > > > --=20 Nuno Teixeira FreeBSD UNIX: Web: https://FreeBSD.org --000000000000b4af980654c114d2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

(poudriere-devel b= uild at=C2=A0main-n286792-eafa181d51f7: Sat Jun 20)

I&#= 39;ve found that ports-mgmt/portfmt started failing with:
...
FAILED:= [code=3D1] /wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/_build= /portscan/status.o
cc -std=3Dgnu11 -O2 -g -W -Wall -Wextra -Wmissing-pro= totypes -Wstrict-prototypes -Wwrite-strings -Wno-unused-parameter -flto=3Dt= hin -O2 -pipe =C2=A0-fstack-protector-strong -fno-strict-aliasing =C2=A0-Wn= o-strict-prototypes =C2=A0-DPORTFMT_SUBPACKAGES=3D0 -MD -MF /wrkdirs/usr/po= rts/ports-mgmt/portfmt/work/portfmt-1.1.6/_build/portscan/status.o.d -I/wrk= dirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/_build -I/wrkdirs/usr/= ports/ports-mgmt/portfmt/work/portfmt-1.1.6 -c -o /wrkdirs/usr/ports/ports-= mgmt/portfmt/work/portfmt-1.1.6/_build/portscan/status.o /wrkdirs/usr/ports= /ports-mgmt/portfmt/work/portfmt-1.1.6/portscan/status.c
/wrkdirs/usr/po= rts/ports-mgmt/portfmt/work/portfmt-1.1.6/portscan/status.c:59:38: warning:= call to undeclared function 'ATOMIC_VAR_INIT'; ISO C99 and later d= o not support implicit function declarations [-Wimplicit-function-declarati= on]
=C2=A0 =C2=A059 | static atomic_int status_requested =3D ATOMIC_VAR_= INIT(0);
=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0^
/wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt= -1.1.6/portscan/status.c:59:38: error: initializer element is not a compile= -time constant
=C2=A0 =C2=A059 | static atomic_int status_requested =3D = ATOMIC_VAR_INIT(0);
=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/por= ts-mgmt/portfmt/work/portfmt-1.1.6/portscan/status.c:60:32: error: initiali= zer element is not a compile-time constant
=C2=A0 =C2=A060 | static atom= ic_size_t scanned =3D ATOMIC_VAR_INIT(0);
=C2=A0 =C2=A0 =C2=A0 | =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^~~~~~~~~~~~~~~~~~
1 warning and 2 errors= generated.
...

Same for devel/qt6-base:

...
FAIL= ED: [code=3D1] src/corelib/CMakeFiles/Core.dir/io/forkfd_qt.c.o
/usr/bin= /cc -DBACKTRACE_HEADER=3D\"execinfo.h\" -DCore_EXPORTS -DQT_ASCII= _CAST_WARNINGS -DQT_BUILDING_QT -DQT_BUILD_CORE_LIB -DQT_DEPRECATED_WARNING= S -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_LEAN_HEADERS=3D1 -
DQT= _MOC_COMPAT -DQT_NO_CAST_TO_ASCII -DQT_NO_CONTEXTLESS_CONNECT -DQT_NO_DEBUG= -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS= _IN_CONNECT -DQT_NO_QASCONST -DQT_NO_QEXCHANGE -DQT_NO_QPAI
R -DQT_NO_QS= NPRINTF -DQT_NO_SINGLE_ARGUMENT_QHASH_OVERLOAD=3D1 -DQT_NO_STD_FORMAT_SUPPO= RT -DQT_NO_USING_NAMESPACE -DQT_TYPESAFE_FLAGS -DQT_USE_NODISCARD_FILE_OPEN= -DQT_USE_QSTRINGBUILDER -D_LARGEFILE64_SOURCE -D_LA
RGEFILE_SOURCE -D_L= IBCPP_HARDENING_MODE=3D_LIBCPP_HARDENING_MODE_FAST -I/wrkdirs/usr/ports/dev= el/qt6-base/work/.build/src/corelib/Core_autogen/include -I/wrkdirs/usr/por= ts/devel/qt6-base/work/.build/include -I/wrkd
irs/usr/ports/devel/qt6-ba= se/work/.build/include/QtCore -I/wrkdirs/usr/ports/devel/qt6-base/work/qtba= se-everywhere-src-6.11.1/src/corelib -I/wrkdirs/usr/ports/devel/qt6-base/wo= rk/.build/src/corelib -I/wrkdirs/usr
/ports/devel/qt6-base/work/.build/s= rc/corelib/global -I/wrkdirs/usr/ports/devel/qt6-base/work/.build/src/corel= ib/kernel -I/wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.= 11.1/src/corelib/../3rdpart
y/tinycbor/src -I/wrkdirs/usr/ports/devel/qt= 6-base/work/.build/include/QtCore/6.11.1 -I/wrkdirs/usr/ports/devel/qt6-bas= e/work/.build/include/QtCore/6.11.1/QtCore -I/wrkdirs/usr/ports/devel/qt6-b= ase/work/qtbase-ev
erywhere-src-6.11.1/src/corelib/../3rdparty/forkfd -I= /wrkdirs/usr/ports/devel/qt6-base/work/.build/src/corelib/.rcc -I/wrkdirs/u= sr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/mkspecs/freebsd-c= lang -isy
stem /usr/local/include -isystem /usr/local/include/glib-2.0 -= isystem /usr/local/lib/glib-2.0/include -O2 -pipe =C2=A0-fstack-protector-s= trong -fno-strict-aliasing -pipe =C2=A0-fstack-protector-strong -fno-strict= -aliasing
=C2=A0-DNDEBUG -O3 -std=3Dgnu11 -fPIC -fvisibility=3Dhidden -W= all -Wextra -pthread -fcf-protection=3Dfull -ftrivial-auto-var-init=3Dpatte= rn -fstack-protector-strong -fexceptions -MD -MT src/corelib/CMakeFiles/Cor= e.dir/io/fork
fd_qt.c.o -MF src/corelib/CMakeFiles/Core.dir/io/forkfd_qt= .c.o.d -o src/corelib/CMakeFiles/Core.dir/io/forkfd_qt.c.o -c /wrkdirs/usr/= ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/corelib/io/forkf= d_qt
.c
In file included from /wrkdirs/usr/ports/devel/qt6-base/work/= qtbase-everywhere-src-6.11.1/src/corelib/io/forkfd_qt.c:16:
/wrkdirs/usr= /ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/corelib/io/../.= ./3rdparty/forkfd/forkfd.c:162:39: warning: call to undeclared function = 9;ATOMIC_VAR_INIT'; ISO C99 and later do not support i
mplicit funct= ion declarations [-Wimplicit-function-declaration]
=C2=A0 162 | static f= fd_atomic_int forkfd_status =3D FFD_ATOMIC_INIT(0);
=C2=A0 =C2=A0 =C2=A0= | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^
/wrkdir= s/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/corelib/io= /../../3rdparty/forkfd/forkfd_c11.h:54:37: note: expanded from macro 'F= FD_ATOMIC_INIT'
=C2=A0 =C2=A054 | #define FFD_ATOMIC_INIT(val) =C2= =A0 =C2=A0 =C2=A0 =C2=A0ATOMIC_VAR_INIT(val)
=C2=A0 =C2=A0 =C2=A0 | =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^
In file included from= /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/co= relib/io/forkfd_qt.c:16:
/wrkdirs/usr/ports/devel/qt6-base/work/qtbase-e= verywhere-src-6.11.1/src/corelib/io/../../3rdparty/forkfd/forkfd.c:162:39: = error: initializer element is not a compile-time constant
=C2=A0 162 | s= tatic ffd_atomic_int forkfd_status =3D FFD_ATOMIC_INIT(0);
=C2=A0 =C2=A0= =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~~= ~~~~~~~~~~~~~
/wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-s= rc-6.11.1/src/corelib/io/../../3rdparty/forkfd/forkfd_c11.h:54:37: note: ex= panded from macro 'FFD_ATOMIC_INIT'
=C2=A0 =C2=A054 | #define FF= D_ATOMIC_INIT(val) =C2=A0 =C2=A0 =C2=A0 =C2=A0ATOMIC_VAR_INIT(val)
=C2= =A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~= ~~~~~~~~~~~~~~~~
In file included from /wrkdirs/usr/ports/devel/qt6-base= /work/qtbase-everywhere-src-6.11.1/src/corelib/io/forkfd_qt.c:16:
In fil= e included from /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-sr= c-6.11.1/src/corelib/io/../../3rdparty/forkfd/forkfd.c:930:
/wrkdirs/usr= /ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/corelib/io/../.= ./3rdparty/forkfd/forkfd_freebsd.c:45:45: error: initializer element is not= a compile-time constant
=C2=A0 =C2=A045 | static ffd_atomic_int system_= forkfd_state =3D FFD_ATOMIC_INIT(1);
=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~~= ~~~~~~~~~~~~~
/wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-s= rc-6.11.1/src/corelib/io/../../3rdparty/forkfd/forkfd_c11.h:54:37: note: ex= panded from macro 'FFD_ATOMIC_INIT'
=C2=A0 =C2=A054 | #define FF= D_ATOMIC_INIT(val) =C2=A0 =C2=A0 =C2=A0 =C2=A0ATOMIC_VAR_INIT(val)
=C2= =A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~= ~~~~~~~~~~~~~~~~
1 warning and 2 errors generated.
...

T= hanks,

Warner Losh <imp@freebsd.org> escreveu (s=C3=A1bado, 20/06/2026 =C3=A0(s) 0= 1:25):
The branc= h main has been updated by imp:

URL: https://cgit.= FreeBSD.org/src/commit/?id=3D28cecfe27964fdb67497800f5dcd5d3e1033727f
commit 28cecfe27964fdb67497800f5dcd5d3e1033727f
Author:=C2=A0 =C2=A0 =C2=A0Faraz Vahedi <kfv@kfv.io>
AuthorDate: 2026-05-01 14:34:44 +0000
Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
CommitDate: 2026-06-20 00:23:28 +0000

=C2=A0 =C2=A0 libc: Restrict ATOMIC_VAR_INIT for C23 conformance

=C2=A0 =C2=A0 Omit `ATOMIC_VAR_INIT` when targeting C23, where it has been = removed.
=C2=A0 =C2=A0 Retain it for earlier C standards and for C++ (as it still re= mains in
=C2=A0 =C2=A0 C++23, albeit marked as deprecated since C17 and C++20.)

=C2=A0 =C2=A0 Also separate `atomic_init` definitions from `ATOMIC_VAR_INIT= ` to
=C2=A0 =C2=A0 avoid coupling with a deprecated initialisation mechanism.
=C2=A0 =C2=A0 No functional change intended for `atomic_init`; this is pure= ly a
=C2=A0 =C2=A0 conformance and cleanup adjustment.

=C2=A0 =C2=A0 Signed-off-by: Faraz Vahedi <kfv@kfv.io>
=C2=A0 =C2=A0 Reviewed by: imp
=C2=A0 =C2=A0 Pull Request: https://github.com/freeb= sd/freebsd-src/pull/2185
---
=C2=A0sys/sys/stdatomic.h | 8 +++++++-
=C2=A01 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sys/sys/stdatomic.h b/sys/sys/stdatomic.h
index c3f9b217519c..2d565ce991be 100644
--- a/sys/sys/stdatomic.h
+++ b/sys/sys/stdatomic.h
@@ -86,11 +86,17 @@
=C2=A0 * 7.17.2 Initialization.
=C2=A0 */

+#if __ISO_C_VISIBLE < 2023 || defined(__cplusplus)
=C2=A0#if defined(__CLANG_ATOMICS)
=C2=A0#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 ATOMIC_VAR_INIT(value)=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 (value)
-#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 atomic_init(obj, value)=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0__c11_atomic_init(obj, value)
=C2=A0#else
=C2=A0#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 ATOMIC_VAR_INIT(value)=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 { .__val =3D (value) }
+#endif
+#endif
+
+#if defined(__CLANG_ATOMICS)
+#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 atomic_init(obj, value)=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0__c11_atomic_init(obj, value)
+#else
=C2=A0#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 atomic_init(obj, value)=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0((void)((obj)->__val =3D (value)))
=C2=A0#endif




--
Nuno Teixeira
=
FreeBSD UNIX:=C2=A0 <eduardo@FreeBSD.org>=C2=A0 =C2=A0Web:=C2=A0 https://Fr= eeBSD.org
--000000000000b4af980654c114d2-- From nobody Sun Jun 21 11:47:58 2026 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 4gjqMf6Yx6z6jZgb for ; Sun, 21 Jun 2026 11:47: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjqMf55Pqz3W6k for ; Sun, 21 Jun 2026 11:47:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042478; 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=sVV/udRgXuYx7WkiS78C0EO/Yz7aT6GEG6pJE/Ryfw4=; b=sB1TLrkzkTt4aiUGUGMm37YOUyw+ub7gozK90IWs0E6UIxYRx5B9t9MwEpn1lVbnmEK5bK NrjVyW+h2omkvTquWD5iwThwzlESiKR5EsOg0GDGa7aOQo5DDNLUPIweZhsShHjeBUyG7C SKjOekb3mdQbFDORZ3mjf+NymTGM6ags4+Mw7PX71fzqoq/3g5JOW5+9ZpOyxUfAV7qkFs twjVlJ9zZYNp8FHzpbvfauOoFmm/SxAEiPoCVIW+I0p+x2rgPR2UIdHJdBnpGewqaQcE6+ b9sswn6xV29BmfKTW2fFcd1uP+7jiOT3f10sgKzS636fRaE4Swa4JdbClN+zow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782042478; a=rsa-sha256; cv=none; b=FuFuVUEPI+cEg9q6heb+GDhY8ybsX5PwiwTUKjUBjSwroQxnj8FG6VXVX0vBOlxGSx41Qv dd7YA46dHlNhRI4+3Ej4txM+x6NpX461ZhgfPh1lgOAe7zWHU5xujRBr92xUziDJr/2ilH Uqe1CrBcwaS1mTdcx5R1yVaruZhi4hj4eat/gDxn0n5xzSmrBIC0Hso6L00ccZY+EJgEeM ko5NoOviQqaVrSRwMgjr2reSD+DQ6NogDB1y7qDF7rxhjeWJlFfQY/vqxxKZN01NdxgFIB q/6pq83eaz0wP2Q4DGS7HkJsZhjG85kl+wTfjIrwW54DXO0rcs6lrheHGmuayQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042478; 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=sVV/udRgXuYx7WkiS78C0EO/Yz7aT6GEG6pJE/Ryfw4=; b=mEQoanHMWN9z9kaffJXmpfLCzZ174tylW77HseTsUGc5TsFw63cmyKrGawwAHAaqsYMmqF DUgVsxZnmFoXDLttYnrEWRfMSkMOmh1FtZODMzAnn+xWeCVVWqltHSRKtdyZJhBHdhJMMI 3UDTdpLEyac13eXjgkc7iksCgYTcVnOeq3ndCQ/GsrB4NvXBD06xJpeDQPbjXrRadwDMeB duHGFfCWBx7nAB8SHYuizfXh7WQidHFg6fXtGzzfFGI+gNMz3h4mPI+xNAmw67xFjZeFON 2FBWE45X8Pi3HqF7s2Xjw303Lq4Fbdhs/bEsJ5kpCrlmc59axmuyMIV/V7P9Nw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjqMf3kdCz1FJK for ; Sun, 21 Jun 2026 11:47:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 254f5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 11:47:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e1a84b7708c2 - main - execve_block(): a mechanism for mutual exclusion with execve() on the process 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: e1a84b7708c2514769625c2af6c5034694013b6a Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 11:47:58 +0000 Message-Id: <6a37cf6e.254f5.1a6b2154@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e1a84b7708c2514769625c2af6c5034694013b6a commit e1a84b7708c2514769625c2af6c5034694013b6a Author: Konstantin Belousov AuthorDate: 2026-05-26 17:36:20 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-21 11:46:52 +0000 execve_block(): a mechanism for mutual exclusion with execve() on the process A consumer of execve_block(9) is synchorized with the execution of execve(2) family of syscalls, ensuring that execve_block region is mutually exclusive with the execve processing. Either execve_block() or execve() would sleep until other finishes. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497 --- sys/kern/kern_exec.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++-- sys/kern/kern_exit.c | 1 + sys/kern/kern_thread.c | 4 +-- sys/sys/imgact.h | 3 +++ sys/sys/proc.h | 3 ++- 5 files changed, 75 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index de6d8b08cec3..7c25dc60960d 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -385,6 +385,62 @@ execve_nosetid(struct image_params *imgp) } } +/* + * Returns true if the execblock was obtained, in this case the + * process lock is kept. Returns false if the execblock was not + * obtained, but the function slept and the lock was dropped. + */ +bool +execve_block(struct thread *td, struct proc *p) +{ + PROC_LOCK_ASSERT(p, MA_OWNED); + MPASS(td == curthread); + MPASS(p != td->td_proc || (p->p_flag & P_INEXEC) == 0); + + if (p != td->td_proc && (p->p_flag & P_INEXEC) != 0) { + p->p_flag |= P_INEXEC_WAIT; + msleep(&p->p_execblock, &p->p_mtx, PDROP, "inexec", 0); + return (false); + } + MPASS(p->p_execblock < UINT_MAX); + p->p_execblock++; + return (true); +} + +/* + * Might drop the process lock internally, callers must re-check the + * invariants afterward. + */ +void +execve_block_wait(struct thread *td, struct proc *p) +{ + bool first; + + PROC_ASSERT_HELD(p); + PROC_LOCK_ASSERT(p, MA_OWNED); + + for (first = true;; first = false) { + if (!first) + PROC_LOCK(p); + if (execve_block(td, p)) + return; + } +} + +void +execve_unblock(struct thread *td, struct proc *p) +{ + PROC_LOCK_ASSERT(p, MA_OWNED); + MPASS(td == curthread); + + MPASS(p->p_execblock > 0); + p->p_execblock--; + if (p->p_execblock == 0 && (p->p_flag & P_INEXEC_WAIT) != 0) { + p->p_flag &= ~P_INEXEC_WAIT; + wakeup(&p->p_execblock); + } +} + /* * In-kernel implementation of execve(). All arguments are assumed to be * userspace pointers from the passed thread. @@ -440,6 +496,10 @@ do_execve(struct thread *td, struct image_args *args, struct mac *mac_p, PROC_LOCK(p); KASSERT((p->p_flag & P_INEXEC) == 0, ("%s(): process already has P_INEXEC flag", __func__)); + while (p->p_execblock != 0) { + p->p_flag |= P_INEXEC_WAIT; + msleep(&p->p_execblock, &p->p_mtx, 0, "exeblk", 0); + } p->p_flag |= P_INEXEC; PROC_UNLOCK(p); @@ -911,7 +971,10 @@ interpret: * as we're now a bona fide freshly-execed process. */ KNOTE_LOCKED(p->p_klist, NOTE_EXEC); - p->p_flag &= ~P_INEXEC; + MPASS(p->p_execblock == 0); + if ((p->p_flag & P_INEXEC_WAIT) != 0) + wakeup(&p->p_execblock); + p->p_flag &= ~(P_INEXEC | P_INEXEC_WAIT); /* clear "fork but no exec" flag, as we _are_ execing */ p->p_acflag &= ~AFORK; @@ -1007,7 +1070,9 @@ exec_fail_dealloc: exec_fail: /* we're done here, clear P_INEXEC */ PROC_LOCK(p); - p->p_flag &= ~P_INEXEC; + if ((p->p_flag & P_INEXEC_WAIT) != 0) + wakeup(&p->p_execblock); + p->p_flag &= ~(P_INEXEC | P_INEXEC_WAIT); PROC_UNLOCK(p); SDT_PROBE1(proc, , , exec__failure, error); diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 2f94386c9101..8f9007752b3b 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -365,6 +365,7 @@ exit1(struct thread *td, int rval, int signo) while (p->p_lock > 0) msleep(&p->p_lock, &p->p_mtx, PWAIT, "exithold", 0); + MPASS(p->p_execblock == 0); PROC_UNLOCK(p); /* Drain the limit callout while we don't have the proc locked */ callout_drain(&p->p_limco); diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 15a327e66c7d..28c6dcff0ceb 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -100,7 +100,7 @@ _Static_assert(offsetof(struct proc, p_pid) == 0xc4, "struct proc KBI p_pid"); _Static_assert(offsetof(struct proc, p_filemon) == 0x3c8, "struct proc KBI p_filemon"); -_Static_assert(offsetof(struct proc, p_comm) == 0x3e0, +_Static_assert(offsetof(struct proc, p_comm) == 0x3e4, "struct proc KBI p_comm"); _Static_assert(offsetof(struct proc, p_emuldata) == 0x4d0, "struct proc KBI p_emuldata"); @@ -120,7 +120,7 @@ _Static_assert(offsetof(struct proc, p_pid) == 0x78, "struct proc KBI p_pid"); _Static_assert(offsetof(struct proc, p_filemon) == 0x270, "struct proc KBI p_filemon"); -_Static_assert(offsetof(struct proc, p_comm) == 0x284, +_Static_assert(offsetof(struct proc, p_comm) == 0x288, "struct proc KBI p_comm"); _Static_assert(offsetof(struct proc, p_emuldata) == 0x318, "struct proc KBI p_emuldata"); diff --git a/sys/sys/imgact.h b/sys/sys/imgact.h index f99b1273ee02..dbb76a1d9b93 100644 --- a/sys/sys/imgact.h +++ b/sys/sys/imgact.h @@ -124,6 +124,9 @@ int exec_shell_imgact(struct image_params *); int exec_copyin_args(struct image_args *, const char *, char **, char **); int pre_execve(struct thread *td, struct vmspace **oldvmspace); void post_execve(struct thread *td, int error, struct vmspace *oldvmspace); +bool execve_block(struct thread *td, struct proc *p); +void execve_block_wait(struct thread *td, struct proc *p); +void execve_unblock(struct thread *td, struct proc *p); #endif #endif /* !_SYS_IMGACT_H_ */ diff --git a/sys/sys/proc.h b/sys/sys/proc.h index ff6e944a5ad2..20389c728f37 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -724,6 +724,7 @@ struct proc { int p_pendingexits; /* (c) Count of pending thread exits. */ struct filemon *p_filemon; /* (c) filemon-specific data. */ int p_pdeathsig; /* (c) Signal from parent on exit. */ + u_int p_execblock; /* (c) Blockers for execve. */ /* End area that is zeroed on creation. */ #define p_endzero p_magic @@ -852,7 +853,7 @@ struct proc { #define P_STATCHILD 0x08000000 /* Child process stopped or exited. */ #define P_INMEM 0x10000000 /* Loaded into memory, always set. */ #define P_ASYNC_EXIT 0x20000000 /* XXX */ -#define P_UNUSED2 0x40000000 /* --available-- */ +#define P_INEXEC_WAIT 0x40000000 /* Waiters for P_INEXEC/p_execblock */ #define P_PPTRACE 0x80000000 /* PT_TRACEME by vforked child. */ #define P_STOPPED (P_STOPPED_SIG|P_STOPPED_SINGLE|P_STOPPED_TRACE) From nobody Sun Jun 21 11:47:59 2026 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 4gjqMh0CY6z6jZYM for ; Sun, 21 Jun 2026 11:48: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjqMg5Dqwz3WFt for ; Sun, 21 Jun 2026 11:47:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042479; 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=8lvGAMqr1pl2635YQdSn8QihDd3LAZCp8BKzRZtfB34=; b=SnD0UZPJnEbdnS4sbvBMQev9u1v6ISDQTc4F5FmMevVlSvjF8sJswCfG6+o7FhwCDoc2IT gGouWLQk+ZCAur19UdqFB1VanalWax+BtT+sBtVD1FElrqHbKJnpFPvGlsrOpHV94l78Fo D1/jKs68mTzE4zp12f/+gLUr6Pjvg5jbIkCySejOI2VqmK283GitUn2b8ihARI2jQeXQRx pt8KWPmmjDx5baNqs2/mO7ngxbnpXm8yjEuRZOz7cwiHwbVAUE5c3I/eiVDODzJDKOmpKv Tal4KJp8n4da51AckyQKDq8jzLtA29ZVmire4uAw0cYnKEmd7wBi5whtvOkLSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782042479; a=rsa-sha256; cv=none; b=gHFytIWuSDdu11k/oa1GPmBMMlrFUqGiolZzQvtbs/DAf355yN4lqyibckHU2RmHuQjGfP 2Ei/tTeLUhm8dqoNKArXnXUY/pyHFL3eT4TmXTs6SThf4IZRCYEWiBp9KAnmgLHdverdIM IomoFaTqmPc91j94EeHcMyf27aESJJIPdqCrCzD2Jw+xtUvlrV3zt0GlqU6RwCEVjL5mPy 6pFCEwz1pXoZzjP2IRfrrhguW2mYOofTBJuq7V42OH5+TEDb1tTZ/xJcJJft+FVcYTkMpR oS/qzKC+/HqB8UCBHleEuLaVkdrt1QGOo+S7akXHlQc4HbD1cBddmGe1dZoReA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042479; 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=8lvGAMqr1pl2635YQdSn8QihDd3LAZCp8BKzRZtfB34=; b=VYJLk2cp6suxWlnSUSU9u7MZ+IGq6+WpT9dMpQZsOlR8dSFNYrV0uWI273IkhERd+h29VX Ov9v7umg8MlBdaRicOdOUKo68FFSlwUaW2/Fabevx0EVmM4vfdvM5z/LxuyZbS+eCxxPzh WYOebUI5LvXx+fUhlrgbz3wqyreS+Bo2y28QpuAwyFTaOPIcpAQNU4nSj5mCrKVQB3WRy2 Ae71Q/8ClR5HRpZHhVRQ7UIJ2tw3x/duddh7rIZ8+TD6sB9IAGv1cgDyZXZgrSfnigJEL8 Y6hEuRztsX7GVJHo96/KkAR6C+YBFWLRISAT7npHDLzeUdvG1gmIVDXV0HqSjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjqMg457Rz1Df9 for ; Sun, 21 Jun 2026 11:47:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 269ac by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 11:47:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 450fe67d19eb - main - execve_block_pass(9): a helper to wait for the execblock to pass 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 450fe67d19eb2ea8e27109214ff21064fdcf808c Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 11:47:59 +0000 Message-Id: <6a37cf6f.269ac.41f3bc1f@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=450fe67d19eb2ea8e27109214ff21064fdcf808c commit 450fe67d19eb2ea8e27109214ff21064fdcf808c Author: Konstantin Belousov AuthorDate: 2026-06-17 19:06:50 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-21 11:46:52 +0000 execve_block_pass(9): a helper to wait for the execblock to pass Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497 --- sys/kern/kern_exec.c | 20 ++++++++++++++++---- sys/sys/imgact.h | 1 + 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 7c25dc60960d..15570eee4c37 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -441,6 +441,21 @@ execve_unblock(struct thread *td, struct proc *p) } } +void +execve_block_pass(struct thread *td) +{ + struct proc *p; + + MPASS(td == curthread); + p = td->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + + while (p->p_execblock != 0) { + p->p_flag |= P_INEXEC_WAIT; + msleep(&p->p_execblock, &p->p_mtx, 0, "exeblk", 0); + } +} + /* * In-kernel implementation of execve(). All arguments are assumed to be * userspace pointers from the passed thread. @@ -496,10 +511,7 @@ do_execve(struct thread *td, struct image_args *args, struct mac *mac_p, PROC_LOCK(p); KASSERT((p->p_flag & P_INEXEC) == 0, ("%s(): process already has P_INEXEC flag", __func__)); - while (p->p_execblock != 0) { - p->p_flag |= P_INEXEC_WAIT; - msleep(&p->p_execblock, &p->p_mtx, 0, "exeblk", 0); - } + execve_block_pass(td); p->p_flag |= P_INEXEC; PROC_UNLOCK(p); diff --git a/sys/sys/imgact.h b/sys/sys/imgact.h index dbb76a1d9b93..bf0453beec1f 100644 --- a/sys/sys/imgact.h +++ b/sys/sys/imgact.h @@ -127,6 +127,7 @@ void post_execve(struct thread *td, int error, struct vmspace *oldvmspace); bool execve_block(struct thread *td, struct proc *p); void execve_block_wait(struct thread *td, struct proc *p); void execve_unblock(struct thread *td, struct proc *p); +void execve_block_pass(struct thread *td); #endif #endif /* !_SYS_IMGACT_H_ */ From nobody Sun Jun 21 11:48:00 2026 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 4gjqMj2ZVcz6jZGv for ; Sun, 21 Jun 2026 11:48: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjqMh69qHz3WHw for ; Sun, 21 Jun 2026 11:48:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042480; 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=rfTqqrdlo/AZ42QbSqbdN2EEDsRf3rwDVqX8QJRa9PE=; b=NiKxZ036TdewNb7RwiznEcsB5FSbiW2J98mJKpF1AnXy3dvfhv53FokrknkNY0FM2vOT1I GQZdpxF7YCSbYK/HP/+4tDThkC6xlIAVw51N31ID/S0HrRyzKlYxpBtHy+e7N0DSNBwTLs Dsbo26epciYlPovhwZVn+22G7NmzfDHeZCnhVyNizHgwfSQNGJBxKKzuWBnPYjPOECendj +vnx6CRGku1sg4eFDlzqi/g/yWkxVp07dFQrBkXj1L6yP02r8UfqagDctZ0BbNxCs3H9Q9 aB4GLKfFeEETTmE36bFtH1In+F8Mn1UsjfA6dqGwJYbZ6hGuZPzU0cQvlIS5cQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782042480; a=rsa-sha256; cv=none; b=mtJoKpcij/PeoZL9LKF2Z5fMfJgBFTJBZA7Vrwnjfps3C9M4OxKzLZSngDV3IZlzWT7EA7 GDEjBtc2WHNmmTn7EmADziu0tLC8VP/DsW4MuvcoY47qd+aTbVnX9yqz8XUYgjYfgh5dl9 i0B8TwHfcZtAwzG2JaAZgZsCgPmIemVU6IOyC6MtHYf7c/3jM9lHvoZyy4g2eK57QKhmv8 Ir40Pj+G1/M1mRWO7SL92zGImgM2+0aREJy3Bq7waUcrp6fCtZYeG7RKeE1XsRPKYimYqv lSqLnOMA/8d+kSwPHySln8EtLEMG4TFko22XdFGchEIpFYFSgD3STjb9Ns1oiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042480; 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=rfTqqrdlo/AZ42QbSqbdN2EEDsRf3rwDVqX8QJRa9PE=; b=a/RMKh+zxRZ6QH/Ngwxmz+vooVktBekSQfGGJiVbajzLNxsBwHmK1l9/mbRWoK7gr2XsiG FUkuBpFhREu7jzOtawKtyrV0SGLdtoBkQ8aIe9WnIj3w+aakulKti9qkd6wSfdc6LIwOSG TyLLEkdyD/CrMTI9qhiFIlRrlfgEU5T56Ev3mTNIvKzWK2wlloI2btddRJIhqxu04F7jEm 2bnH9kx6ra4ION30ZSpoDDQuuRNshgd5+qhTVOf/6E2mgibaI60VLi1VDnLxrXY6UL3v7u JHqwxZo3pJkFWwqxmHIly81iTYvbEP4gudJ1vxd2rfdSXe36KWMHGL97nrsN1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjqMh4y1tz1FG0 for ; Sun, 21 Jun 2026 11:48:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24274 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 11:48:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e1b0d051bbf7 - main - proc: Allow to make proc_rwmem() operate on a consistent address space 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: e1b0d051bbf7e4e730470cbd6622f71a639834c3 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 11:48:00 +0000 Message-Id: <6a37cf70.24274.1e80d1a4@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e1b0d051bbf7e4e730470cbd6622f71a639834c3 commit e1b0d051bbf7e4e730470cbd6622f71a639834c3 Author: Konstantin Belousov AuthorDate: 2026-06-07 17:57:06 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-21 11:46:52 +0000 proc: Allow to make proc_rwmem() operate on a consistent address space Provide proc_vmspace_ref() to safely obtain the reference to the target process vmspace, optionally - requiring that the target cannot execve(2) and thus cannot change its vmspace until vmspace in unreferenced - requiring the check of permissions of the caller after the vmspace reference is obtained, since the process lock might have been dropped in the process. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497 --- sys/fs/cuse/cuse.c | 4 +- sys/fs/procfs/procfs_mem.c | 2 +- sys/kern/kern_prot.c | 10 ++-- sys/kern/sys_process.c | 127 ++++++++++++++++++++++++++++++++++++++------- sys/sys/ptrace.h | 15 +++++- 5 files changed, 129 insertions(+), 29 deletions(-) diff --git a/sys/fs/cuse/cuse.c b/sys/fs/cuse/cuse.c index b914b2d5017c..8f67c4b5572b 100644 --- a/sys/fs/cuse/cuse.c +++ b/sys/fs/cuse/cuse.c @@ -916,7 +916,7 @@ cuse_proc2proc_copy(struct proc *proc_s, vm_offset_t data_s, }; PHOLD(proc_s); - error = proc_rwmem(proc_s, &uio); + error = proc_rwmem(proc_s, &uio, 0); PRELE(proc_s); } else if (proc_cur == proc_s) { @@ -935,7 +935,7 @@ cuse_proc2proc_copy(struct proc *proc_s, vm_offset_t data_s, }; PHOLD(proc_d); - error = proc_rwmem(proc_d, &uio); + error = proc_rwmem(proc_d, &uio, 0); PRELE(proc_d); } else { error = EINVAL; diff --git a/sys/fs/procfs/procfs_mem.c b/sys/fs/procfs/procfs_mem.c index 0020b8f8a8d8..824fcd33b2ef 100644 --- a/sys/fs/procfs/procfs_mem.c +++ b/sys/fs/procfs/procfs_mem.c @@ -64,7 +64,7 @@ procfs_doprocmem(PFS_FILL_ARGS) error = p_candebug(td, p); PROC_UNLOCK(p); if (error == 0) - error = proc_rwmem(p, uio); + error = proc_rwmem(p, uio, 0); return (error); } diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index c8dc05f0ebbd..47744f6b07fe 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -2360,11 +2360,11 @@ p_candebug(struct thread *td, struct proc *p) } /* - * Can't trace a process that's currently exec'ing. - * - * XXX: Note, this is not a security policy decision, it's a - * basic correctness/functionality decision. Therefore, this check - * should be moved to the caller's of p_candebug(). + * Can't trace a process that's currently exec'ing. Otherwise + * the process vmspace might change, and the target might be + * loading a setugid image. The execve_block(9) and + * proc_vmspace_ref(9) allow to get the stable credentials and + * vmspace reference. */ if ((p->p_flag & P_INEXEC) != 0) return (EBUSY); diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 5effc6fbe2d7..81cff03250a9 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -367,25 +368,93 @@ proc_sstep(struct thread *td) return (ptrace_single_step(td)); } +static int +proc_vmspace_check_access(struct thread *td, struct proc *p, int flags) +{ + PROC_ASSERT_HELD(p); + if ((flags & PRVM_CHECK_DEBUG) != 0) + return (p_candebug(td, p)); + if ((flags & PRVM_CHECK_VISIBILITY) != 0) + return (p_cansee(td, p)); + return (0); +} + int -proc_rwmem(struct proc *p, struct uio *uio) +proc_vmspace_ref(struct thread *td, struct proc *p, int flags, + struct vmspace **vmp) +{ + struct vmspace *vm; + int error; + + MPASS((flags & ~(PRVM_BLOCK_EXEC | PRVM_CHECK_VISIBILITY | + PRVM_CHECK_DEBUG)) == 0); + MPASS((flags & (PRVM_CHECK_VISIBILITY | PRVM_CHECK_DEBUG)) != + (PRVM_CHECK_VISIBILITY | PRVM_CHECK_DEBUG)); + + PROC_LOCK(p); + if (p != td->td_proc) { + PROC_ASSERT_HELD(p); + + /* + * Make sure that the vmspace doesn't switch out from + * under us. + */ + if ((flags & PRVM_BLOCK_EXEC) != 0) { + for (;;) { + if (!execve_block(td, p)) { + PROC_LOCK(p); + continue; + } + error = proc_vmspace_check_access(td, p, flags); + if (error != 0) { + execve_unblock(td, p); + PROC_UNLOCK(p); + return (error); + } + break; + } + } else { + error = proc_vmspace_check_access(td, p, flags); + if (error != 0) { + PROC_UNLOCK(p); + return (error); + } + } + } + vm = vmspace_acquire_ref(p); + if (vm == NULL) { + if (p != td->td_proc && (flags & PRVM_BLOCK_EXEC) != 0) + execve_unblock(td, p); + PROC_UNLOCK(p); + return (ESRCH); + } + PROC_UNLOCK(p); + *vmp = vm; + return (0); +} + +void +proc_vmspace_unref(struct thread *td, struct proc *p, int flags, + struct vmspace *vm) +{ + vmspace_free(vm); + if (p != td->td_proc && (flags & PRVM_BLOCK_EXEC) != 0) { + PROC_LOCK(p); + PROC_ASSERT_HELD(p); + execve_unblock(td, p); + PROC_UNLOCK(p); + } +} + +static int +vmspace_rwmem(struct vmspace *vm, struct uio *uio) { vm_map_t map; vm_offset_t pageno; /* page number */ vm_prot_t reqprot; int error, fault_flags, page_offset, writing; - /* - * Make sure that the process' vmspace remains live. - */ - if (p != curproc) - PROC_ASSERT_HELD(p); - PROC_LOCK_ASSERT(p, MA_NOTOWNED); - - /* - * The map we want... - */ - map = &p->p_vmspace->vm_map; + map = &vm->vm_map; /* * If we are writing, then we request vm_fault() to create a private @@ -399,7 +468,7 @@ proc_rwmem(struct proc *p, struct uio *uio) if (writing) { error = priv_check(curthread, PRIV_PROC_MEM_WRITE); if (error != 0) - return (error); + goto out; } /* @@ -457,16 +526,34 @@ proc_rwmem(struct proc *p, struct uio *uio) } while (error == 0 && uio->uio_resid > 0); +out: return (error); } -static ssize_t -proc_iop(struct thread *td, struct proc *p, vm_offset_t va, void *buf, +int +proc_rwmem(struct proc *p, struct uio *uio, int flags) +{ + struct vmspace *vm; + struct thread *td; + int error; + + td = curthread; + error = proc_vmspace_ref(td, p, flags, &vm); + if (error != 0) + return (error); + error = vmspace_rwmem(vm, uio); + proc_vmspace_unref(td, p, flags, vm); + return (error); +} + +ssize_t +vmspace_iop(struct thread *td, struct vmspace *vm, vm_offset_t va, void *buf, size_t len, enum uio_rw rw) { struct iovec iov; struct uio uio; ssize_t slen; + int error; MPASS(len < SSIZE_MAX); slen = (ssize_t)len; @@ -480,8 +567,8 @@ proc_iop(struct thread *td, struct proc *p, vm_offset_t va, void *buf, uio.uio_segflg = UIO_SYSSPACE; uio.uio_rw = rw; uio.uio_td = td; - proc_rwmem(p, &uio); - if (uio.uio_resid == slen) + error = vmspace_rwmem(vm, &uio); + if (error != 0 || uio.uio_resid == slen) return (-1); return (slen - uio.uio_resid); } @@ -491,7 +578,7 @@ proc_readmem(struct thread *td, struct proc *p, vm_offset_t va, void *buf, size_t len) { - return (proc_iop(td, p, va, buf, len, UIO_READ)); + return (vmspace_iop(td, p->p_vmspace, va, buf, len, UIO_READ)); } ssize_t @@ -499,7 +586,7 @@ proc_writemem(struct thread *td, struct proc *p, vm_offset_t va, void *buf, size_t len) { - return (proc_iop(td, p, va, buf, len, UIO_WRITE)); + return (vmspace_iop(td, p->p_vmspace, va, buf, len, UIO_WRITE)); } static int @@ -1492,7 +1579,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) goto out; } PROC_UNLOCK(p); - error = proc_rwmem(p, &uio); + error = proc_rwmem(p, &uio, 0); piod->piod_len -= uio.uio_resid; PROC_LOCK(p); break; diff --git a/sys/sys/ptrace.h b/sys/sys/ptrace.h index cdde142d0487..2ef52b22044c 100644 --- a/sys/sys/ptrace.h +++ b/sys/sys/ptrace.h @@ -247,7 +247,20 @@ int proc_write_fpregs(struct thread *_td, struct fpreg *_fpreg); int proc_read_dbregs(struct thread *_td, struct dbreg *_dbreg); int proc_write_dbregs(struct thread *_td, struct dbreg *_dbreg); int proc_sstep(struct thread *_td); -int proc_rwmem(struct proc *_p, struct uio *_uio); + +#define PRVM_BLOCK_EXEC 0x00000001 +#define PRVM_CHECK_VISIBILITY 0x00000002 +#define PRVM_CHECK_DEBUG 0x00000004 + +#include +struct vmspace; +int proc_vmspace_ref(struct thread *_td, struct proc *_p, int _flags, + struct vmspace **_vmp); +void proc_vmspace_unref(struct thread *_td, struct proc *_p, int _flags, + struct vmspace *_vm); +ssize_t vmspace_iop(struct thread *td, struct vmspace *vm, vm_offset_t va, + void *buf, size_t len, enum uio_rw rw); +int proc_rwmem(struct proc *_p, struct uio *_uio, int _flags); ssize_t proc_readmem(struct thread *_td, struct proc *_p, vm_offset_t _va, void *_buf, size_t _len); ssize_t proc_writemem(struct thread *_td, struct proc *_p, vm_offset_t _va, From nobody Sun Jun 21 11:48:01 2026 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 4gjqMk3glQz6jZSp for ; Sun, 21 Jun 2026 11:48:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjqMj6yFNz3WCS for ; Sun, 21 Jun 2026 11:48:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042482; 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=cO/1kNwjzwzfp8Ya6Ws+qKbRWeWN2ccwoftX0Dw4opo=; b=Chz4SiDKTuLImj0fNR2wl+G3Jk1VqtuhR/LlZueVqCxzlBE4Am4q1Mcgz5ru753yCldTh2 rmOX6+cGdW7hkwqNTGz8y+H/GNubvaTl3Ex8tDX8AIHWfXInDfjSkRyK6I0GbeVYVBkxMY jsn+ypuW/Nf4BDWFJE/oQZfCmmK+aVuiIC1Z/5cQeLes3jIAtq68Yus/nSHjZ5QoqDysTI c8/STTz+/gqje/yZi0nCPyL+tpfh6eOBeNAjj7JfcLwaZPWK0jT7BSi0QUem9eo4Jx5CBg Y4uNQJhflsjp4qA7eo30QHYw0z8qu1+46gBTwBKhtvM8IWtMQrYK3L2czJlr+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782042482; a=rsa-sha256; cv=none; b=M0+BI0uraNRWLaphtcFO+YbPNQdA5mtFgmlHA5ZUaDjjxc2URCg0tZ+nYkycI0UUen0TRl 73takj/SlgkB2/z1WU2r6hjTHUIai1qjCcALdcHX/hLH/Jrsb4GPCdbi/z2aNtTdnnFY2p SMjHJaAXkA0N0EayVO1PNVe/+8RWpUdAkJtQndlQXtLhs2amOfjCwn7BRTW92wNfh3rD2P aD99JoCalCDhD/fYs4xgW9kXB8B0EseaZtPV0+oUFc8i5D06K+9bdPZNmw7Yh/geBJTjMJ timFCnABwjx4OAOs+92TpjiCskD3HyHq/KWo/Yz9vDxwEOQ7eVKOzwmaNE0YWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042482; 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=cO/1kNwjzwzfp8Ya6Ws+qKbRWeWN2ccwoftX0Dw4opo=; b=l70VtKhNnv4GddHiZPjvNA83x2s+Pss7+XUeutrZpQnJtUA7axLiT3YHodUsq46s1JUhSo kno+aEvsbtreZdBNztdeKhMrTFWjNHfI/GHX9Yv+XkdPBAyzuQF8dzqro5BnnRNseH02Q5 0jEFnT9bcsKZ60uNA7cMV6WeoMP/1kQP8UGQuHYZBjbzI69v6ryQP/P4k0CE9iWUeGAD/j 1Fy/I0GwRBCyOatlY2dg2EJsAWvJv4BaYk0MdlmnsOsH3GrK+uf3uLywqQhyIXYPBRNFQM kyV5COKu9Qx9vT7TJkr/eIPG+0boWmD5lmadt1juWM77sJBHdIF9edtJAXozIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjqMj5nK6z1F5N for ; Sun, 21 Jun 2026 11:48:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 254f9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 11:48:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: a22c044cce41 - main - kern_proc.c: ensure stability of the vmspace we read the strings from 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: a22c044cce41864a32af6b8281a3c416a2664d7f Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 11:48:01 +0000 Message-Id: <6a37cf71.254f9.70fa0246@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a22c044cce41864a32af6b8281a3c416a2664d7f commit a22c044cce41864a32af6b8281a3c416a2664d7f Author: Konstantin Belousov AuthorDate: 2026-06-07 19:12:54 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-21 11:46:52 +0000 kern_proc.c: ensure stability of the vmspace we read the strings from Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497 --- sys/kern/kern_proc.c | 60 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 68845e5aa679..2481823c97af 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -1837,8 +1837,8 @@ pargs_drop(struct pargs *pa) } static int -proc_read_string(struct thread *td, struct proc *p, const char *sptr, char *buf, - size_t len) +proc_read_string(struct thread *td, struct vmspace *vm, const char *sptr, + char *buf, size_t len) { ssize_t n; @@ -1847,7 +1847,7 @@ proc_read_string(struct thread *td, struct proc *p, const char *sptr, char *buf, * and is aligned at the end of the page, and the following page is not * mapped. */ - n = proc_readmem(td, p, (vm_offset_t)sptr, buf, len); + n = vmspace_iop(td, vm, (vm_offset_t)sptr, buf, len, UIO_READ); if (n <= 0) return (ENOMEM); return (0); @@ -1863,8 +1863,8 @@ enum proc_vector_type { #ifdef COMPAT_FREEBSD32 static int -get_proc_vector32(struct thread *td, struct proc *p, char ***proc_vectorp, - size_t *vsizep, enum proc_vector_type type) +get_proc_vector32(struct thread *td, struct proc *p, struct vmspace *vm, + char ***proc_vectorp, size_t *vsizep, enum proc_vector_type type) { struct freebsd32_ps_strings pss; Elf32_Auxinfo aux; @@ -1875,8 +1875,8 @@ get_proc_vector32(struct thread *td, struct proc *p, char ***proc_vectorp, int i, error; error = 0; - if (proc_readmem(td, p, PROC_PS_STRINGS(p), &pss, sizeof(pss)) != - sizeof(pss)) + if (vmspace_iop(td, vm, PROC_PS_STRINGS(p), &pss, sizeof(pss), + UIO_READ) != sizeof(pss)) return (ENOMEM); switch (type) { case PROC_ARG: @@ -1899,8 +1899,8 @@ get_proc_vector32(struct thread *td, struct proc *p, char ***proc_vectorp, if (vptr % 4 != 0) return (ENOEXEC); for (ptr = vptr, i = 0; i < PROC_AUXV_MAX; i++) { - if (proc_readmem(td, p, ptr, &aux, sizeof(aux)) != - sizeof(aux)) + if (vmspace_iop(td, vm, ptr, &aux, sizeof(aux), + UIO_READ) != sizeof(aux)) return (ENOMEM); if (aux.a_type == AT_NULL) break; @@ -1916,7 +1916,7 @@ get_proc_vector32(struct thread *td, struct proc *p, char ***proc_vectorp, return (EINVAL); } proc_vector32 = malloc(size, M_TEMP, M_WAITOK); - if (proc_readmem(td, p, vptr, proc_vector32, size) != size) { + if (vmspace_iop(td, vm, vptr, proc_vector32, size, UIO_READ) != size) { error = ENOMEM; goto done; } @@ -1937,8 +1937,8 @@ done: #endif static int -get_proc_vector(struct thread *td, struct proc *p, char ***proc_vectorp, - size_t *vsizep, enum proc_vector_type type) +get_proc_vector(struct thread *td, struct proc *p, struct vmspace *vm, + char ***proc_vectorp, size_t *vsizep, enum proc_vector_type type) { struct ps_strings pss; Elf_Auxinfo aux; @@ -1948,11 +1948,13 @@ get_proc_vector(struct thread *td, struct proc *p, char ***proc_vectorp, int i; #ifdef COMPAT_FREEBSD32 - if (SV_PROC_FLAG(p, SV_ILP32) != 0) - return (get_proc_vector32(td, p, proc_vectorp, vsizep, type)); + if (SV_PROC_FLAG(p, SV_ILP32) != 0) { + return (get_proc_vector32(td, p, vm, proc_vectorp, + vsizep, type)); + } #endif - if (proc_readmem(td, p, PROC_PS_STRINGS(p), &pss, sizeof(pss)) != - sizeof(pss)) + if (vmspace_iop(td, vm, PROC_PS_STRINGS(p), &pss, sizeof(pss), + UIO_READ) != sizeof(pss)) return (ENOMEM); switch (type) { case PROC_ARG: @@ -1990,8 +1992,8 @@ get_proc_vector(struct thread *td, struct proc *p, char ***proc_vectorp, * to the allocated proc_vector. */ for (ptr = vptr, i = 0; i < PROC_AUXV_MAX; i++) { - if (proc_readmem(td, p, ptr, &aux, sizeof(aux)) != - sizeof(aux)) + if (vmspace_iop(td, vm, ptr, &aux, sizeof(aux), + UIO_READ) != sizeof(aux)) return (ENOMEM); if (aux.a_type == AT_NULL) break; @@ -2013,7 +2015,7 @@ get_proc_vector(struct thread *td, struct proc *p, char ***proc_vectorp, return (EINVAL); /* In case we are built without INVARIANTS. */ } proc_vector = malloc(size, M_TEMP, M_WAITOK); - if (proc_readmem(td, p, vptr, proc_vector, size) != size) { + if (vmspace_iop(td, vm, vptr, proc_vector, size, UIO_READ) != size) { free(proc_vector, M_TEMP); return (ENOMEM); } @@ -2029,6 +2031,7 @@ static int get_ps_strings(struct thread *td, struct proc *p, struct sbuf *sb, enum proc_vector_type type) { + struct vmspace *vm; size_t done, len, nchr, vsize; int error, i; char **proc_vector, *sptr; @@ -2041,9 +2044,14 @@ get_ps_strings(struct thread *td, struct proc *p, struct sbuf *sb, */ nchr = 2 * (PATH_MAX + ARG_MAX); - error = get_proc_vector(td, p, &proc_vector, &vsize, type); + error = proc_vmspace_ref(td, p, PRVM_BLOCK_EXEC | + PRVM_CHECK_VISIBILITY, &vm); if (error != 0) return (error); + + error = get_proc_vector(td, p, vm, &proc_vector, &vsize, type); + if (error != 0) + goto out; for (done = 0, i = 0; i < (int)vsize && done < nchr; i++) { /* * The program may have scribbled into its argv array, e.g. to @@ -2053,7 +2061,7 @@ get_ps_strings(struct thread *td, struct proc *p, struct sbuf *sb, if (proc_vector[i] == NULL) break; for (sptr = proc_vector[i]; ; sptr += GET_PS_STRINGS_CHUNK_SZ) { - error = proc_read_string(td, p, sptr, pss_string, + error = proc_read_string(td, vm, sptr, pss_string, sizeof(pss_string)); if (error != 0) goto done; @@ -2070,6 +2078,8 @@ get_ps_strings(struct thread *td, struct proc *p, struct sbuf *sb, } done: free(proc_vector, M_TEMP); +out: + proc_vmspace_unref(td, p, PRVM_BLOCK_EXEC | PRVM_CHECK_VISIBILITY, vm); return (error); } @@ -2090,11 +2100,17 @@ proc_getenvv(struct thread *td, struct proc *p, struct sbuf *sb) int proc_getauxv(struct thread *td, struct proc *p, struct sbuf *sb) { + struct vmspace *vm; size_t vsize, size; char **auxv; int error; - error = get_proc_vector(td, p, &auxv, &vsize, PROC_AUX); + error = proc_vmspace_ref(td, p, PRVM_BLOCK_EXEC | PRVM_CHECK_DEBUG, + &vm); + if (error != 0) + return (error); + error = get_proc_vector(td, p, vm, &auxv, &vsize, PROC_AUX); + proc_vmspace_unref(td, p, PRVM_BLOCK_EXEC | PRVM_CHECK_DEBUG, vm); if (error == 0) { #ifdef COMPAT_FREEBSD32 if (SV_PROC_FLAG(p, SV_ILP32) != 0) From nobody Sun Jun 21 11:48:04 2026 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 4gjqMm3ZCMz6jZW5 for ; Sun, 21 Jun 2026 11:48: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjqMm1dFZz3W2p for ; Sun, 21 Jun 2026 11:48:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042484; 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=l9uhf+EprbKPMJkFECYILfDFG41Bgm92MZ4MrKId/Qs=; b=u7reo9o9rihoewULJK9x0baAFW0sds8ihNs5pKr01s1s68OzYjS2JkRyZweFr+BT5xJ7JK G+SqTOtz8jQejLaJHRFNl4Lf/MrClIJOBr3f4TnC/gRGVZeOWuq6G8z18LyNJtmz5+f0mA qB4GgMvUuzf/jYEhOJiNA3C2Clq+Vi1/cC+HkO/wvSDD3vIQeAPzce8nktLm/iMRtnUKpk BxqWxRNlbX5oQ7KJac/gnX1LuwrNysHeYRuQ4e5wuLz4vTUugjHPYHB7f++BOw9ek3r3pV HfPbHVVODNO4516f/ojfbaKF+1rQyYpt+wl+DArXlMHRSPwdFZ5rsbH9qN84IA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782042484; a=rsa-sha256; cv=none; b=n5fFp6WC9MsEgRLca9OJyvRhH1I4zp+jYjyREh37gSuSXhpAzBcbFKkugPfcmOgRZvD97r NfRtvedbiQe2qvEsOikNYOv+MXBfZhOpYk3Hfh9MEPko+OzOCngFmVKwmObdmu3xsejWTC fRD00kbXCk8jo7kPRsfqn38aVDqw9s1FSRnRaMpc9PtQ2ORjrAagC+v7GVZ8ofHQoZiikt 2qSpqcq+WQTVuVTUJaiztBxuQ5eQNWQKs+O/V1VueauXDASrTLbyKsNvcf9nRX+v1UuFyi fw0ke6pxF5zdynTVDuEj7+0R5E0mDI5AEjqXyw2G7fDINpPOxLvFxVBzT7luCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042484; 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=l9uhf+EprbKPMJkFECYILfDFG41Bgm92MZ4MrKId/Qs=; b=MEhBveEKV5hHNnAPD5BfLsiR/hsN3DQxDAq7I5AxcKVNcyBSOwNj2G0vd1bD4FFMNEhemq 5RsGMEBTzr01UN3eoouHECi21kPDuffsFAPMZUTWqErCufXmfQepqsBycEl38C2FHgbcZb 37COZAL6qsZL8D+EuZmAtboBNE/fqJQWbR8lTxoGohq3aTjdAt3icTg29zFV8Qnihkx/k9 6BOktz6Dm2YKkx5PHxK8YCseG1/i8DtlSNxDZQXF9XzoUop68JvrOtzYrWqXmkiIhZPolf gwE6hxqTFR5NTl3ix7cz35p+s1jxIq6f3QCkH64SSV2Vpwghj44V6cEwT7n31w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjqMm09q2z1DfC for ; Sun, 21 Jun 2026 11:48:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25061 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 11:48:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 31fa677e4af0 - main - kern_proc.c: ensure stability of the vmspace for sysctl kern.proc.vm_layout 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 31fa677e4af00b795bf671847b4dc72960c90f14 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 11:48:04 +0000 Message-Id: <6a37cf74.25061.46828b52@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=31fa677e4af00b795bf671847b4dc72960c90f14 commit 31fa677e4af00b795bf671847b4dc72960c90f14 Author: Konstantin Belousov AuthorDate: 2026-06-14 23:49:20 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-21 11:46:53 +0000 kern_proc.c: ensure stability of the vmspace for sysctl kern.proc.vm_layout Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497 --- sys/kern/kern_proc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 1fff6e5629ea..a42d528cc9c1 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -3290,6 +3290,7 @@ sysctl_kern_proc_vm_layout(SYSCTL_HANDLER_ARGS) { struct kinfo_vm_layout kvm; struct proc *p; + struct thread *td; struct vmspace *vmspace; int error, *name; @@ -3297,6 +3298,7 @@ sysctl_kern_proc_vm_layout(SYSCTL_HANDLER_ARGS) if ((u_int)arg2 != 1) return (EINVAL); + td = curthread; error = pget((pid_t)name[0], PGET_CANDEBUG, &p); if (error != 0) return (error); @@ -3308,8 +3310,13 @@ sysctl_kern_proc_vm_layout(SYSCTL_HANDLER_ARGS) } } #endif - vmspace = vmspace_acquire_ref(p); + _PHOLD(p); PROC_UNLOCK(p); + error = proc_vmspace_ref(td, p, PRVM_CHECK_DEBUG, &vmspace); + if (error != 0) { + PRELE(p); + return (error); + } memset(&kvm, 0, sizeof(kvm)); kvm.kvm_min_user_addr = vm_map_min(&vmspace->vm_map); @@ -3361,7 +3368,8 @@ sysctl_kern_proc_vm_layout(SYSCTL_HANDLER_ARGS) #ifdef COMPAT_FREEBSD32 out: #endif - vmspace_free(vmspace); + proc_vmspace_unref(td, p, PRVM_CHECK_DEBUG, vmspace); + PRELE(p); return (error); } From nobody Sun Jun 21 11:48:02 2026 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 4gjqMl66vRz6jZ9p for ; Sun, 21 Jun 2026 11:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjqMl0rYhz3W6n for ; Sun, 21 Jun 2026 11:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042483; 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=n26TjW6PHdfi31ufU31apcnhjxKJn9bvoONfvAalXMY=; b=v4Yshj0FkWo7SPntnWYKG3KLsFhtG3R6/JURCstXgMEGGHQQgqsBB8VdmgUxl808KQcFzN IcBUp3G01+Tl/21TJYjPy6W87uJGSK4YHWoKR0JBaC6KnqODCcmQa2nyc136kL2YoHjbd8 b12pdAkDNx/Q1NSACFsp+OJCH3hrLPjbM3dKpJ4PHEJDipKmTnUqeIHm5wmr1dRhZrtY1o mawCrVUpoShAwGW6XfOjbAafEs6J0ryXZMAnV5x43MgycijBhZN8XUOeVg1TOIKFsH3npO gDM0BZJ6vePXtft2t/cwFQOdxwkrXpVf/yiW1W2BaDCsBsB1bWodeSOcT6I9dA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782042483; a=rsa-sha256; cv=none; b=LVuRDxMsq0GB/viox3zYBZKjnkSrJPpn6BOHNEu+08WRYZMyGKpLR9q19ZMKwYQ66oniWf pBhrK0sSO0E/dhPKXkHNjFTcUV1fcdr9zloazMd1xIWoIiC63+fZWkL7rKzN2vuYXYNcRv AXua7mj5VcRx+hvA3caNOTegO6vR5BlZSZ3qk8XKqrxJ0BW+9H5wtN7M3pO20tGtWojnAR he22qm4rymYZBpR/gSKJ5GU5q3Kp3s4j2VeuJ5i8glxP+YM7pj2VFdr/o5+bztPu2b4p1d faYeR2pnXEdV2bkZl2e0Sujy1px9ksfLO0lf1iVt2TENyBCGeYAfkHQYGpqAUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042483; 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=n26TjW6PHdfi31ufU31apcnhjxKJn9bvoONfvAalXMY=; b=t9/utJdwCWvvTstBpaog+3n4J5D8TzfTpJCWwN7320GTx+AilrnY7Bl+1fXGmboXyyF4sI hEuOgjEkalxoUETIFBA+Y05acUZjE358JqWEsnLvaqdfmt5GmkHD4vkrkJ+LFYCN006kry khHn9R7wwOIfrI2g0pUvKW+aY9gZOD/eGHvYIhgEP5KMs90rKrY1rpVRZ43A8HOEZAwh3v 2w4xZbElB6Ka5SCspNYNUW+XkmNLOcV+1tmEX8ZL2xoWBbygq8nIJBMXk3+LELeMtiiFqf /nwDB2Xts4AlJNIA/GDuNAr5Lz3O/W+UviWg4OGNGZjzhuPiw0hFk9M1nmj39w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjqMk6ch2z1FG1 for ; Sun, 21 Jun 2026 11:48:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26855 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 11:48:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 5fe6e08d2db5 - main - kern_proc.c: ensure stability of the vmspace for sysctl kern.proc.vmmap 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 5fe6e08d2db56b530f0df2903ef24cfabab7b8ea Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 11:48:02 +0000 Message-Id: <6a37cf72.26855.6d7816dd@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5fe6e08d2db56b530f0df2903ef24cfabab7b8ea commit 5fe6e08d2db56b530f0df2903ef24cfabab7b8ea Author: Konstantin Belousov AuthorDate: 2026-06-14 23:49:20 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-21 11:46:52 +0000 kern_proc.c: ensure stability of the vmspace for sysctl kern.proc.vmmap Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497 --- sys/kern/kern_proc.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 2481823c97af..1fff6e5629ea 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -2423,6 +2423,7 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_ARGS) int error, *name; struct vnode *vp; struct proc *p; + struct thread *td; vm_map_t map; struct vmspace *vm; @@ -2431,11 +2432,12 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_ARGS) return (EINVAL); name = (int *)arg1; + td = curthread; error = pget((pid_t)name[0], PGET_WANTREAD, &p); if (error != 0) return (error); - vm = vmspace_acquire_ref(p); - if (vm == NULL) { + error = proc_vmspace_ref(td, p, PRVM_CHECK_DEBUG, &vm); + if (error != 0) { PRELE(p); return (ESRCH); } @@ -2547,7 +2549,7 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_ARGS) } } vm_map_unlock_read(map); - vmspace_free(vm); + proc_vmspace_unref(td, p, PRVM_CHECK_DEBUG, vm); PRELE(p); free(kve, M_TEMP); return (error); @@ -2642,6 +2644,7 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) struct ucred *cred; struct vnode *vp; struct vmspace *vm; + struct thread *td; vm_offset_t addr; unsigned int last_timestamp; int error; @@ -2653,10 +2656,11 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) _PHOLD(p); PROC_UNLOCK(p); - vm = vmspace_acquire_ref(p); - if (vm == NULL) { + td = curthread; + error = proc_vmspace_ref(td, p, PRVM_CHECK_DEBUG, &vm); + if (error != 0) { PRELE(p); - return (ESRCH); + return (error); } kve = malloc(sizeof(*kve), M_TEMP, M_WAITOK | M_ZERO); @@ -2760,7 +2764,7 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) if (vp != NULL) { vn_fullpath(vp, &fullpath, &freepath); kve->kve_vn_type = vntype_to_kinfo(vp->v_type); - cred = curthread->td_ucred; + cred = td->td_ucred; vn_lock(vp, LK_SHARED | LK_RETRY); if (VOP_GETATTR(vp, &va, cred) == 0) { kve->kve_vn_fileid = va.va_fileid; @@ -2816,7 +2820,7 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) } } vm_map_unlock_read(map); - vmspace_free(vm); + proc_vmspace_unref(td, p, PRVM_CHECK_DEBUG, vm); PRELE(p); free(kve, M_TEMP); return (error); From nobody Sun Jun 21 11:48:05 2026 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 4gjqMn4VDzz6jZh2 for ; Sun, 21 Jun 2026 11:48: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjqMn28p7z3W70 for ; Sun, 21 Jun 2026 11:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042485; 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=PmHYAnJStQIa1uTTMaM48B+CxLAw4WGcZOM0PWfQbNA=; b=WFzOLVA1nFC3RNLcm2ofoBUtyLET9H4z7s1voQDW3OEmXz/vcO37wRPRUQfr1+mOvlkvdj zd/hXYwIDLBXGsFR5G2pqqu4lbNfmzecrJ9IJ4Dd8qijnzd2mVgKOGKLPig6tVeDQlwuD7 cQt2iucoFsTVB4RD9dvH9afYM5Rs0YRWtGj7m7OUd1iFE7VlseLztoALrBzJjPQujJY2pr 6e1m4aNeZTCTQGPOSrGBDSGfjn5+ZSHmdTR3+mxkPIhgokfizdJZJw1w2uIr3NLOC706eV XstFfM0tk+8mrfR1ZuhjH7KPWCOxVPzjcjSRKM/jvJ5R4xviTd1ep3R3CJd4PA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782042485; a=rsa-sha256; cv=none; b=jjrMtFe0nAL54eq3HZkm6UAo/fgzbeB4iXv4PPq6KoRTvvSYl5fCqMfDhF9oy/272gE1OM bZopg0RhcHfJRDnJFtv062OcH00cQkqCI/rzoi0GwEFmNTlSSos2kPYfVjFUZJI/qbKi/v tva5LP0QnC6KTXnGnC+PWnUnt5ynO3sC30Pd01wIwg0pwdTenTDA3zISo6p2JRp6UTesNb hJahKtqDONUb5+8a5N1X7/UyerSnHJvjsiIiUNFoKv7QAOrP7yJVWw2P/zatfv0wgECD9f 8WcF3iC9/NI2kQnx4zZRRlfOsEUX2lQsy4mOxYDmUt/2hXhxI6orm6zTav+nrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042485; 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=PmHYAnJStQIa1uTTMaM48B+CxLAw4WGcZOM0PWfQbNA=; b=a1hu8q6s1F3YYZo/GIZdaS/naMeb0YXwApM04gjdeA4KhjLfL5YodKcEwYo2n64BHBrGq7 /wDOpkZ+ozw56joH+JKMveWJ0m11KFxcammrxcN8T29x3MfzCuaJExhn1F/XEUFAjeKNcq sUcvhxM8tnbWVy42N1r4jivuMOa1aKkEWBpo38M2NWjjDInvrPqMOfNLo3s5zwRU87EhmB E9jbH20GnYb3qfzLfQl8uaIiUo54842VH2CsctQagv/iwnP4aWYSKe8Ybga0DHrbgtrhlU Tf9Pee6yduLoiPN7lEmMagzxuxY7BGQl4dP7S9ZpJPE/z2s1GDkmGAY0WrulLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjqMn0yjPz1F5P for ; Sun, 21 Jun 2026 11:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26859 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 11:48:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 80626f34ee98 - main - kern_proc.c: make kern.proc.osrel atomic 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 80626f34ee985671bb8c60ee986b89587b7a1511 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 11:48:05 +0000 Message-Id: <6a37cf75.26859.23f760df@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=80626f34ee985671bb8c60ee986b89587b7a1511 commit 80626f34ee985671bb8c60ee986b89587b7a1511 Author: Konstantin Belousov AuthorDate: 2026-06-15 17:28:15 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-21 11:46:53 +0000 kern_proc.c: make kern.proc.osrel atomic Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497 --- sys/kern/kern_proc.c | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index a42d528cc9c1..17b4effde030 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -3121,39 +3121,38 @@ sysctl_kern_proc_osrel(SYSCTL_HANDLER_ARGS) int *name = (int *)arg1; u_int namelen = arg2; struct proc *p; - int flags, error, osrel; + int flags, error, old_osrel, osrel; if (namelen != 1) return (EINVAL); - if (req->newptr != NULL && req->newlen != sizeof(osrel)) - return (EINVAL); - - flags = PGET_HOLD | PGET_NOTWEXIT; - if (req->newptr != NULL) + flags = PGET_NOTWEXIT; + if (req->newptr != NULL) { + if (req->newlen != sizeof(osrel)) + return (EINVAL); + error = SYSCTL_IN(req, &osrel, sizeof(osrel)); + if (error != 0) + return (error); + if (osrel < 0) + return (EINVAL); flags |= PGET_CANDEBUG; - else + } else { flags |= PGET_CANSEE; + } error = pget((pid_t)name[0], flags, &p); if (error != 0) return (error); - - error = SYSCTL_OUT(req, &p->p_osrel, sizeof(p->p_osrel)); - if (error != 0) - goto errout; - - if (req->newptr != NULL) { - error = SYSCTL_IN(req, &osrel, sizeof(osrel)); - if (error != 0) - goto errout; - if (osrel < 0) { - error = EINVAL; - goto errout; - } - p->p_osrel = osrel; + if ((p->p_flag & P_INEXEC) != 0) { + error = EBUSY; + } else { + old_osrel = p->p_osrel; + if (req->newptr != NULL) + p->p_osrel = osrel; } -errout: - PRELE(p); + PROC_UNLOCK(p); + + if (error == 0) + error = SYSCTL_OUT(req, &old_osrel, sizeof(old_osrel)); return (error); } From nobody Sun Jun 21 11:48:06 2026 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 4gjqMq27Pkz6jZ9w for ; Sun, 21 Jun 2026 11:48: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjqMp3470z3WLY for ; Sun, 21 Jun 2026 11:48:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042486; 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=/SLUDeCRMdA6h2vLMIqTgqgHP05yCxmX9S8EijBdvlc=; b=MlyxoCwTO90mh52x72lSIY0I/ooBGxuqquSuz9rvbmPbvXvC26p1TL8EwxgDIawekkf4i1 Uy/qdjdnwyfHi3l500AjhXa32oYA4wifXbziMWVREGBkl9Ew9wL9mNdUE1YJQms506atqj N/Lo5JUJQNhpPh+gQDA4TXmJz12lscyN2jvCm9UAqBHWfzXEmPrL+zJBJbgsN7sUFEeOlk a5lL61GQfDqGnLgqsmdKZp6OB/swGa0PhVi63gVNiDFKNyM77yKqHTyVZPmomId0vH63VP cR3aYSX8aYXGIH0P72cVlrS76g8pMipoOHqfmZ+Hq3s3tQKiqGSKHCxv0uXIaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782042486; a=rsa-sha256; cv=none; b=CBY9yjiLokaHCt62YTKYxo/ggwpYdkvn4Emo2Cu8r1KDjE+K7j9OaV/AJ4KlOFfqJpUIXH 3FrcfydSivGt8CZXqrbdsXouMa/abDzprzOVvWFOarCi4WAnxTWS9e/s+m9Zec5AMbfFIp l4hTriOIkp/fdfFTXKNn1n8oYjsh0OuEilRO6bajTIHDUJOPEeKq4C3yOp2DrRN+t5hiFv 1UDuiEKEDP3+zg6Q14dZixO/MFVdpcqEg5YKnX3dQD2dAzj1EsuGB76C35NAX7qpFO3UZK FeXGgQOhgnouCixlURxAQm7bIke54XMdW7xWKq2J1aDp6CRJNHUC/VhqLgsNAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042486; 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=/SLUDeCRMdA6h2vLMIqTgqgHP05yCxmX9S8EijBdvlc=; b=MJANqhweO+XIEA5cPlqvzmfxtqQWod+DjxbM28fp5/HCJau0FlavEzIV2Ao+R7tTbpFzH0 9O2Yb3Fy+TikwTqwzaFNXJs0Kpafbq2UVsbElsPPQNNIPQ0GS0mAkljy01KStUhneC8+Wz XMThkHudKYhu3EkZi2MDw/7AD+GVeAQ+miVbFv0mode39bKBTbNhGTrsx46zDGBB8bAoXp XCsaFbOKA7q2e6C66IZSXVo6o7I65LbO49BgyqGiK2+wnzoUY+Vn9C65XEfHdMVN+g27/j KgczNEf8qd1rNRhfIXQMaa3nkXH6WKxY/lKeVpZaMgI6Nd1bBPdQsoAJG/7f1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjqMp1pCdz1FJN for ; Sun, 21 Jun 2026 11:48:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2623f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 11:48:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 8b5abd9027b8 - main - kern_proc.c: disallow execve around sysctl kern.proc.kstacks 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 8b5abd9027b8b1f6290c756730ee3adebed007f4 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 11:48:06 +0000 Message-Id: <6a37cf76.2623f.37b2cbf4@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8b5abd9027b8b1f6290c756730ee3adebed007f4 commit 8b5abd9027b8b1f6290c756730ee3adebed007f4 Author: Konstantin Belousov AuthorDate: 2026-06-15 17:57:47 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-21 11:46:53 +0000 kern_proc.c: disallow execve around sysctl kern.proc.kstacks Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: htts://reviews.freebsd.org/D57497 --- sys/kern/kern_proc.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 17b4effde030..f69a65f9d5a1 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -2859,7 +2860,7 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) struct kinfo_kstack *kkstp; int error, i, *name, numthreads; lwpid_t *lwpidarray; - struct thread *td; + struct thread *td, *ctd; struct stack *st; struct sbuf sb; struct proc *p; @@ -2870,7 +2871,8 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) return (EINVAL); name = (int *)arg1; - error = pget((pid_t)name[0], PGET_NOTINEXEC | PGET_WANTREAD, &p); + ctd = curthread; + error = pget((pid_t)name[0], PGET_WANTREAD, &p); if (error != 0) return (error); @@ -2879,6 +2881,14 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) lwpidarray = NULL; PROC_LOCK(p); + execve_block_wait(ctd, p); + error = p_candebug(ctd, p); + if (error != 0) { + execve_unblock(ctd, p); + _PRELE(p); + PROC_UNLOCK(p); + return (error); + } do { if (lwpidarray != NULL) { free(lwpidarray, M_TEMP); @@ -2891,15 +2901,6 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) PROC_LOCK(p); } while (numthreads < p->p_numthreads); - /* - * XXXRW: During the below loop, execve(2) and countless other sorts - * of changes could have taken place. Should we check to see if the - * vmspace has been replaced, or the like, in order to prevent - * giving a snapshot that spans, say, execve(2), with some threads - * before and some after? Among other things, the credentials could - * have changed, in which case the right to extract debug info might - * no longer be assured. - */ i = 0; FOREACH_THREAD_IN_PROC(p, td) { KASSERT(i < numthreads, @@ -2932,7 +2933,10 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) if (error) break; } - PRELE(p); + PROC_LOCK(p); + execve_unblock(ctd, p); + _PRELE(p); + PROC_UNLOCK(p); if (lwpidarray != NULL) free(lwpidarray, M_TEMP); stack_destroy(st); From nobody Sun Jun 21 11:48:07 2026 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 4gjqMr1bd4z6jZYY for ; Sun, 21 Jun 2026 11:48: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjqMq3tV8z3WNw for ; Sun, 21 Jun 2026 11:48:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042487; 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=Y5c4zEotbBoxr790KpHi1/op4PB8Tbt9SrhEiCPBtq0=; b=aSEDh10ZlnWp+9Q1qLD5VKffxsGtoweumh9MuHr/PJKQrTA4oJsfRu6/sTce2oCjNyl3Z6 i4S8WYZ/K/SugEFLNGUfORVxcgsKGxr3xzzHuTOxe1MwdlRwaVLz76H8EPq6MkGMRdFO5y pmiv4j5WQXosOkE5nBTWAqwnsvFqxNq8ap+t2I1TGhY6zdCblSu5ijhkFDLmksBsm0DS+3 SAJJ64P3+YIr8VcNZVVau6NKnJHgFBUBmf548TULxhzTPknQmf0zWICu2q42VJNWRTw9b/ F4SY9E5NSaFrF5dNl5vRxvOU4ARQPsW/8873e594QKn3rkVz6whMUt/O0bxmcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782042487; a=rsa-sha256; cv=none; b=uzaQVzPsTuh3ytkC4r1GmdqMJ7R0r/cANOZwXq9kdHwt+o1UAK6EWROt3ytIZonMcSdWuj S/FHuYRv9AkBGMTmq5MuBYg8L5JkJpSnn3Gj+/mu80KdNh2cP545fET8Qez6Z8+Mksb8QK CqsRe6YL4musQURMX2OFt/5FpznrDIdSHEq0AmNcP1ypQr+yiWTQ1Q/Y850wCmAu1UYA5L 2iU36jxKsWqnTw5PUqmkpx9rlEFiT1+flVcDf8eVzF7WRBpEeYLbRlJZ8PoWYBuZGW5AHQ Ae6WfB12mvuS4KT6+ehMMGsJzg2+E/GVBtnMK16NkxWdoNfSo02OW3M1h5onUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042487; 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=Y5c4zEotbBoxr790KpHi1/op4PB8Tbt9SrhEiCPBtq0=; b=wwbk4kHpMqrZc/cIXEYKu6NJcaAPluFmS5Fut7S2R0rnP2eNYXuHVhNSRpLiG18m2gIY1c lhlPnLwyymLBpYa3EKZADEyFkLcEnKahUd8sDgkwZXJQWVCklc1WohBD8gVS8aTc0hM6tA djaqC+HpIo/lZfxpC9pR2nnz7olx9WenUlgKJqKW8+9hP8BaSQ3p/NKIDhmkrMVoh3e37D K1HE3TUVkcsWsCOFmJYR6yEiX/skYQEX6eNLOLkIigbwuJosP6JvIC+9P+Qc5PIKUm1pnt kFnCHatUM9e+lY8VLxOC/znl4AEDnYYLG9AfehoXU8L6fVO75Uzw49FrVk7Eyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjqMq2clbz1Dbr for ; Sun, 21 Jun 2026 11:48:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2685d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 11:48:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 5a91fa5a7656 - main - kern_proc.c: disallow execve around sysctl kern.proc.rlimit 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 5a91fa5a7656c99e527fe7e6f6bf6bd9e85ab589 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 11:48:07 +0000 Message-Id: <6a37cf77.2685d.41a88015@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5a91fa5a7656c99e527fe7e6f6bf6bd9e85ab589 commit 5a91fa5a7656c99e527fe7e6f6bf6bd9e85ab589 Author: Konstantin Belousov AuthorDate: 2026-06-16 04:30:10 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-21 11:46:53 +0000 kern_proc.c: disallow execve around sysctl kern.proc.rlimit Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: htts://reviews.freebsd.org/D57497 --- sys/kern/kern_proc.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index f69a65f9d5a1..41e5b6594981 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -2992,8 +2992,9 @@ sysctl_kern_proc_rlimit(SYSCTL_HANDLER_ARGS) u_int namelen = arg2; struct rlimit rlim; struct proc *p; + struct thread *td; u_int which; - int flags, error; + int error; if (namelen != 2) return (EINVAL); @@ -3005,23 +3006,24 @@ sysctl_kern_proc_rlimit(SYSCTL_HANDLER_ARGS) if (req->newptr != NULL && req->newlen != sizeof(rlim)) return (EINVAL); - flags = PGET_HOLD | PGET_NOTWEXIT; - if (req->newptr != NULL) - flags |= PGET_CANDEBUG; - else - flags |= PGET_CANSEE; - error = pget((pid_t)name[0], flags, &p); + td = curthread; + error = pget((pid_t)name[0], PGET_NOTWEXIT, &p); if (error != 0) return (error); + _PHOLD(p); + execve_block_wait(td, p); + error = req->newptr != NULL ? p_candebug(td, p) : p_cansee(td, p); + if (error != 0) + goto errout1; /* * Retrieve limit. */ if (req->oldptr != NULL) { - PROC_LOCK(p); lim_rlimit_proc(p, which, &rlim); - PROC_UNLOCK(p); } + PROC_UNLOCK(p); + error = SYSCTL_OUT(req, &rlim, sizeof(rlim)); if (error != 0) goto errout; @@ -3036,7 +3038,11 @@ sysctl_kern_proc_rlimit(SYSCTL_HANDLER_ARGS) } errout: - PRELE(p); + PROC_LOCK(p); +errout1: + _PRELE(p); + execve_unblock(td, p); + PROC_UNLOCK(p); return (error); } From nobody Sun Jun 21 11:48:09 2026 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 4gjqMt1l7nz6jZHL for ; Sun, 21 Jun 2026 11:48: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjqMs5gX6z3W7Y for ; Sun, 21 Jun 2026 11:48:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042489; 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=L+yXkI9ENZYRimcsnq7Kcsb8Qm99vlPeFhPkEbvQVKc=; b=A74+rSq9Axd1jKrlmIpOP+3z81WfrDClTiB91wgXhAXOIRQFKQEUTHq/FThs6cihshF8vx fDwWcX95tkM1hVKAqVxWUZgCLtWkpRRCRUduxS5w4YfL1/+beFmmgMs5JdCQbY6buwMio3 SnrQGOSFzhLc2eOGfjHo2pvmu6YqIpyVjYEyLmvsRLoJbm8klfzTtDdUF+kI7q2+aC7kwQ hPVHbNVUKJYCGdahrpf7vmfnS1lYS2Z15/iLf5Q5j+UmdXfVNqqsG2VfHLHGzc3ik/egLW pf19Ry0baxRoKRBq9aarWglYy17wZg014w/5W1eRsojhJiKwR6Y7KURM3cctLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782042489; a=rsa-sha256; cv=none; b=kTkp18ZR7iCaxGNWRMFWmUQ1NcaHUrSL4jdukB4Gbd+9xStxd0kBOEM5y/BPy4hyR6o65B S11s7xhxxUPICs+YfjYYPLfYQ59vbAy2foZ2K/aCdZ1Iq9wFwnYtzTm2HNrXsmFvGYPwPi Bvmtt4ZoQ0fMkmBmtvYjQ0/c8ZK4vt9hYfkFvGdgtADBOfPBSjx2mduH9IcsxDqf3qiyQ9 hdhb1FDUpMwIUqWWhEv7yrBJrxeF4kNhoxtmo0kdGy9LQRB6mZbRGDJp17btTZt4lJpkxX x99uVjdyelXTazPwiCQlYkK2hT+VjkmUm7eH7Ke3+XAgmvbHL0Sh0koo9q5LeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042489; 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=L+yXkI9ENZYRimcsnq7Kcsb8Qm99vlPeFhPkEbvQVKc=; b=ehZ4IBhi1XV1H1cmL0lmPf5S4800vGj6XyWaOAC5ovuOLlcT76OO7feW9CnUiZfh1Nksol Ugo/fqKwgY6B+GFXfs3FxIsbk3BXLEqZpGjUeBCkHIq2aylwWExCRaIheqxOw2CPF1+68I 9GIdtRDKICsFtSzbV5yrksxo3Sc2LKWLzLR+3Y/DoW24D6RhxZ132NcEwNvy2JjesIRFpH KGSWg7Vz+V9fiIPX2B24uFefvp7bmwZlf1HHFjNSV/8/l9+SAmTDpy14H+osKmOYDRC7DV tFK96uEIyB7odsIwnmahevEU+hxB1+UrBAAwmC6e0Sgr5Qd4jFKCUYm7MsL3yQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjqMs4R1fz1Dbs for ; Sun, 21 Jun 2026 11:48:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26861 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 11:48:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 836749817036 - main - kern_resource.c: disallow execve around sysctl kern.proc.rlimitusage 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 836749817036b90b60af0584fa21f2d9dbd60ff7 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 11:48:09 +0000 Message-Id: <6a37cf79.26861.38dd2ba8@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=836749817036b90b60af0584fa21f2d9dbd60ff7 commit 836749817036b90b60af0584fa21f2d9dbd60ff7 Author: Konstantin Belousov AuthorDate: 2026-06-16 04:34:16 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-21 11:46:53 +0000 kern_resource.c: disallow execve around sysctl kern.proc.rlimitusage Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: htts://reviews.freebsd.org/D57497 --- sys/kern/kern_resource.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 95c4e7d5eead..044e95fa64a0 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -823,11 +824,11 @@ sys_getrlimit(struct thread *td, struct getrlimit_args *uap) } static int -getrlimitusage_one(struct proc *p, u_int which, int flags, rlim_t *res) +getrlimitusage_one(struct proc *p, struct vmspace *vm, u_int which, int flags, + rlim_t *res) { struct thread *td; struct uidinfo *ui; - struct vmspace *vm; uid_t uid; int error; @@ -838,7 +839,6 @@ getrlimitusage_one(struct proc *p, u_int which, int flags, rlim_t *res) PROC_UNLOCK(p); ui = uifind(uid); - vm = vmspace_acquire_ref(p); switch (which) { case RLIMIT_CPU: @@ -919,7 +919,6 @@ getrlimitusage_one(struct proc *p, u_int which, int flags, rlim_t *res) break; } - vmspace_free(vm); uifree(ui); return (error); } @@ -927,12 +926,15 @@ getrlimitusage_one(struct proc *p, u_int which, int flags, rlim_t *res) int sys_getrlimitusage(struct thread *td, struct getrlimitusage_args *uap) { + struct proc *p; rlim_t res; int error; if ((uap->flags & ~(GETRLIMITUSAGE_EUID)) != 0) return (EINVAL); - error = getrlimitusage_one(curproc, uap->which, uap->flags, &res); + p = curproc; + error = getrlimitusage_one(p, p->p_vmspace, uap->which, uap->flags, + &res); if (error == 0) error = copyout(&res, uap->res, sizeof(res)); return (error); @@ -1797,6 +1799,8 @@ sysctl_kern_proc_rlimit_usage(SYSCTL_HANDLER_ARGS) { rlim_t resval[RLIM_NLIMITS]; struct proc *p; + struct thread *td; + struct vmspace *vm; size_t len; int error, *name, i; @@ -1806,15 +1810,20 @@ sysctl_kern_proc_rlimit_usage(SYSCTL_HANDLER_ARGS) if (req->newptr != NULL) return (EINVAL); - error = pget((pid_t)name[0], PGET_WANTREAD, &p); + td = curthread; + error = pget((pid_t)name[0], PGET_HOLD | PGET_NOTWEXIT, &p); if (error != 0) return (error); + error = proc_vmspace_ref(td, p, PRVM_BLOCK_EXEC | + PRVM_CHECK_VISIBILITY, &vm); + if (error != 0) + goto out; if ((u_int)arg2 == 1) { len = sizeof(resval); memset(resval, 0, sizeof(resval)); for (i = 0; i < RLIM_NLIMITS; i++) { - error = getrlimitusage_one(p, (unsigned)i, 0, + error = getrlimitusage_one(p, vm, (unsigned)i, 0, &resval[i]); if (error == ENXIO) { resval[i] = -1; @@ -1825,7 +1834,7 @@ sysctl_kern_proc_rlimit_usage(SYSCTL_HANDLER_ARGS) } } else { len = sizeof(resval[0]); - error = getrlimitusage_one(p, (unsigned)name[1], 0, + error = getrlimitusage_one(p, vm, (unsigned)name[1], 0, &resval[0]); if (error == ENXIO) { resval[0] = -1; @@ -1834,6 +1843,8 @@ sysctl_kern_proc_rlimit_usage(SYSCTL_HANDLER_ARGS) } if (error == 0) error = SYSCTL_OUT(req, resval, len); + proc_vmspace_unref(td, p, PRVM_BLOCK_EXEC | PRVM_CHECK_VISIBILITY, vm); +out: PRELE(p); return (error); } From nobody Sun Jun 21 11:48:08 2026 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 4gjqMs5g2Jz6jZbl for ; Sun, 21 Jun 2026 11:48: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjqMr5Jsbz3WCy for ; Sun, 21 Jun 2026 11:48:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042488; 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=07Ntv1OwOz5fKbxGvL6AFX7VkgbnGs/pr5L1PUbZtk8=; b=Nkv3VqkC0HtBxdVPxOfgd7S29RjnQ61gqZdh9BwygGOu9BeDWtGbKJ9pmMca/g61+zN52m pw/mPtB81jI1Pa0O8+gA+bZYSEXV5KyP+Dr0SgaqvQELyVPmhWyEsuoayUwEd8z4lATycS O7YPMP4MhyI2sDKdiGRPwskBZZBMcqrgvfrBeqsXZUFCw6qFjr55shDel2foFDS55HfHm9 ePXGVsfQs51FIIiHZceTQV77CqWsoSRgOA0oD6bFxLg8lzhGd7gDc+c+Jm6UYBziRRu5/6 NnyaQGMWLIsH/UJn35nltFPlwCU2Fw8dBPt3KJPOcvFlO2FOrEaue+EIAmgCgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782042488; a=rsa-sha256; cv=none; b=h39sCsT2B8rv46EYBcaEwPiW5S7/v68gFmADEjuMi5gOdd76uD5vxB2ptY2YsZYG/BvBsI MhAjITOCBP5Uz0TIqhA6NrS4Nygev0I265LOMNMaCGy7dL4PzKHnTLuNKwWu/GC36oEe4M vonxXan32ct6auNQUtV+sBN3LzZnpFGhvNUTG8DiP2OT+Glc/i24lWP6VkSjpqRopFsLL4 Vcl7GxJtkABGe4shmAYpRkCocYkdWm/uWw0GKoqX9MYdVfwh+Ff+X4dCnDs4qR1GsDXdfA EekiHXEYh+oVm2yQoGEaTtJTeNgpKiWdt1qk/+mKJaQ1rpvjrhcWyDTqw2AG1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042488; 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=07Ntv1OwOz5fKbxGvL6AFX7VkgbnGs/pr5L1PUbZtk8=; b=k/kCtU2OQ4j3qO20oWrq4YWCbw91s+3RZ8FHdeWZobI9cx+6fEXAVTOvLNFJiMc7Y/Lehh yRHTTMx4sWbwSM5a8elT0rvdecqLrXJpkPpb2yHMy9oH4jHjZAMDXYibPaP0vQPzy+VNha MnW2rzCg0BoYYOHiPESd0Cp9sWWNnYyANAs6Wwn+Qni/bIi7wgrQifcUQnK77b+c2p1tOc Y7jtKvnnyCPCEgrdtw0Yv72aHeYHCsROVgXTlL+RanDJMaX3btp1Jlh3oNs5nlZgIRZOFQ VMyzywBthhMm05W6g4fnK3HpXjP84+qlBI3lYW3vg04w/7ui/w/hEvYjKwBFsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjqMr3c05z1DV6 for ; Sun, 21 Jun 2026 11:48:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 266e4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 11:48:08 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 79b384bd8fdf - main - kern_event: block the target process from execing for sysctl kern.proc.kqueue 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 79b384bd8fdff4869ce4799edb0342ff5c25b6fa Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 11:48:08 +0000 Message-Id: <6a37cf78.266e4.1ed32855@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=79b384bd8fdff4869ce4799edb0342ff5c25b6fa commit 79b384bd8fdff4869ce4799edb0342ff5c25b6fa Author: Konstantin Belousov AuthorDate: 2026-06-16 03:48:29 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-21 11:46:53 +0000 kern_event: block the target process from execing for sysctl kern.proc.kqueue Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497 --- sys/kern/kern_event.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 8c7a0949f024..01bd22fbefd1 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -3381,10 +3382,6 @@ sysctl_kern_proc_kqueue(SYSCTL_HANDLER_ARGS) if ((u_int)arg2 > 2 || (u_int)arg2 == 0) return (EINVAL); - error = pget((pid_t)name[0], PGET_HOLD | PGET_CANDEBUG, &p); - if (error != 0) - return (error); - td = curthread; #ifdef COMPAT_FREEBSD32 compat32 = SV_CURPROC_FLAG(SV_ILP32); @@ -3392,6 +3389,17 @@ sysctl_kern_proc_kqueue(SYSCTL_HANDLER_ARGS) compat32 = false; #endif + error = pget((pid_t)name[0], PGET_NOTWEXIT, &p); + if (error != 0) + return (error); + + _PHOLD(p); + execve_block_wait(td, p); + error = p_candebug(td, p); + if (error != 0) + goto out1; + PROC_UNLOCK(p); + s = sbuf_new_for_sysctl(&sm, NULL, 0, req); if (s == NULL) { error = ENOMEM; @@ -3412,7 +3420,11 @@ sysctl_kern_proc_kqueue(SYSCTL_HANDLER_ARGS) sbuf_delete(s); out: - PRELE(p); + PROC_LOCK(p); +out1: + execve_unblock(td, p); + _PRELE(p); + PROC_UNLOCK(p); return (error); } From nobody Sun Jun 21 11:48:12 2026 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 4gjqMx44v6z6jZWX for ; Sun, 21 Jun 2026 11:48: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjqMx0Kv0z3WMn for ; Sun, 21 Jun 2026 11:48:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042493; 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=iwuxb6B7XT1HZLcQd3EBr7Lrn2JO1fdIIrXHYcCm0yg=; b=Z5DQgWf1prilHPHfcqjLcy3JGKyja73ZDBn4ih9r+g7tOBXhuhhcCzAOnnriEKs4xRBO5z F/gWoxYLbHtPofMHpocmACZSDl4YCMPuVX2Gqna7tiBARtAsJzS6Es6oc7FoVi6vGVAn3l xY51xUou+Uhj4RwraBi/olk0PuTO9DMqrSWeoTX2PgGqjzipntWNVXlsgSCQoHp8aiySO1 EEE/B2VeEPBnX/NYnHyW0xCKEGm9YZHrpu9YJo7WIp6JPBuOIzn4UinDtqussgveTiXcuc BRRoKzG0WuP7hom25q33jvtOCk+Ix8X+VbCgUGSeBqxV1JZc0j/19P5uWcnMXQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782042493; a=rsa-sha256; cv=none; b=JXuVxjtEcyMuiQ2yNWRVKPxXHNkEqQ+BTyG2Jhr1Bj/QcAbjs6bnaFJ+/oNSedlGWBaM/L 0n45jO6OHZrd7f4QVmm/fpBO/tarR5eFnX+Hv09xKbJREJ5GyFuWKrbuNBrw+cZXQgvInm +h0vNKI/a6oo8wRWuNYMJT7AVA1AMuamsRVxY0bP0jX12gauRY9oXsCRRskrYjk4Rdw86M OCqzYbYeDmcCwHwZTANA/phpcr16X7Yq3uozOJ0/LJIuJhD3xZ7rZb8z3P+zBLGlJI5BaK p+1KzBCmdvgEq0HDsYvbKHJ0rfBOwiMGBCrOAlTOFf3XZjRqffkUWAkvKinaDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042493; 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=iwuxb6B7XT1HZLcQd3EBr7Lrn2JO1fdIIrXHYcCm0yg=; b=A6VckJVufY9AbOg2QVnd9/Up+dMLb9KKHvqKJYzwtH/7hw7SOZDm0htHziS6s3TuKj6HPC TZhGmziz0z9OjKbTpF7ILaWS9dR7VRX+285BUpV9gtmFqJ8MRMnUWJpdEoDYLrsjSF2m6Q RsG+AB604YfHfXTeI7HMDvCP4cQCFjhNIuCgSZp4a0xa6mmhxpjdKWOkzLpqgAhwHbmiJB 9CDf84ZHkWVvViiFWxxhILrW3QEv/tCK284iDtFSpxmdmEe1ftn9M3XslFOq0W+ZPLAYc4 Jys+ASI1okXRhVv2GsLFfcsmAPlrxaD/TlfKXSv6Kxb7ccd+C50KKZxWbrK0iA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjqMw6WNBz1Dbt for ; Sun, 21 Jun 2026 11:48:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25065 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 11:48:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 4c0a0909f928 - main - pfs_readdir(): block the target process from execing 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 4c0a0909f928baac982b7de4bfa5b5ca7de5291a Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 11:48:12 +0000 Message-Id: <6a37cf7c.25065.431b3335@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4c0a0909f928baac982b7de4bfa5b5ca7de5291a commit 4c0a0909f928baac982b7de4bfa5b5ca7de5291a Author: Konstantin Belousov AuthorDate: 2026-06-07 19:32:20 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-21 11:46:53 +0000 pfs_readdir(): block the target process from execing Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497 --- sys/fs/pseudofs/pseudofs_vnops.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/fs/pseudofs/pseudofs_vnops.c b/sys/fs/pseudofs/pseudofs_vnops.c index a30b5e4f551d..d14ed15f3329 100644 --- a/sys/fs/pseudofs/pseudofs_vnops.c +++ b/sys/fs/pseudofs/pseudofs_vnops.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -132,6 +133,7 @@ static int pfs_lookup_proc(pid_t pid, struct proc **p) { struct proc *proc; + struct thread *td; proc = pfind(pid); if (proc == NULL) @@ -141,8 +143,10 @@ pfs_lookup_proc(pid_t pid, struct proc **p) return (0); } _PHOLD(proc); - PROC_UNLOCK(proc); + td = curthread; + execve_block_wait(td, proc); *p = proc; + PROC_UNLOCK(proc); return (1); } @@ -846,6 +850,7 @@ pfs_readdir(struct vop_readdir_args *va) struct pfs_node *pd = pvd->pvd_pn; pid_t pid = pvd->pvd_pid; struct proc *p, *proc; + struct thread *td; struct pfs_node *pn; struct uio *uio; struct pfsentry *pfsent, *pfsent2; @@ -891,11 +896,13 @@ pfs_readdir(struct vop_readdir_args *va) KASSERT(pid == NO_PID || proc != NULL, ("%s(): no process for pid %lu", __func__, (unsigned long)pid)); + td = curthread; if (pid != NO_PID) { PROC_LOCK(proc); /* check if the directory is visible to the caller */ if (!pfs_visible_proc(curthread, pd, proc)) { + execve_unblock(td, proc); _PRELE(proc); PROC_UNLOCK(proc); pfs_unlock(pd); @@ -955,6 +962,7 @@ pfs_readdir(struct vop_readdir_args *va) resid -= PFS_DELEN; } if (proc != NULL) { + execve_unblock(td, proc); _PRELE(proc); PROC_UNLOCK(proc); } From nobody Sun Jun 21 11:48:10 2026 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 4gjqMv1jhZz6jZT7 for ; Sun, 21 Jun 2026 11:48: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjqMt6ppFz3WK4 for ; Sun, 21 Jun 2026 11:48:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042491; 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=4QogDk7wSMQ8ClyGUB9M0azvfE6rj9gbFWoVhUdLq0w=; b=A4gusHcCc7TyxPn6OobzoAe9LKk+VXpxMtMYkStYfD/BxLXJXBWNtdAfItYo78P6W/Adut BocfFQprQonhZaKHPaprJW3HLZtyj4ujJETKstOsZ85fupyV0CGda0HlC0vghkye/G90t+ 0Tp7ERGLZIeuBb0DtKoAy4JFpgz7i/MYl7O8kbDOpzj8vmML/X5wLalaJAm8gRGL0Y0ZSi HdLL7ZOLMiAsN+NU/nB2dB3SjWuOeTXNnfUXdUHUUUmgBUNA/5GPrW+ef3uPbUW/hOF4nE Hrgnl7X3tBmdnvuEMMWw43li9lJVHCYXxS4QKWcRvB4uHOvyjrjHyYdyOChJNQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782042491; a=rsa-sha256; cv=none; b=CG6cklydHjdZkLureI8dqs/JRgCpMBEid+I9x+pRPTPPbmuQAzEOo1GakRoDTxqto9K9dF 3s/Ju9MUSgeSxdVctNWhNiliFz3bi2OMVNConhjMS1LytFJwPXwEua9mbtOOFlgVcT1pRu HUKCuLIjYkQbVgIfQRWcSS+DMHcSKjgg6pnqWpWFSg6QXN6EC4oSIr5VDzmRwhfESCdYTB WWh40+1FZP7fyiVG9Dmj/+ztS1FNZDL1jq7BU6sqQU4r+jRf00xmjDlpGVcmO9WpwDWBeX M4Wa2eA6rv4REG+Y9a7/mCpPa5b0gl6wOWcxQjvBd4GU+GvuEF5J9XtUxXyxiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042491; 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=4QogDk7wSMQ8ClyGUB9M0azvfE6rj9gbFWoVhUdLq0w=; b=iRTX+ZIKIkPW1fh21QBJxxhfnF62YFFlHuWZTrnkkSCGIAQB6zGeufUdz1D3UG8hHIBU0Y UqAzWrXAR5D/uQs/1M8tF0j/AYapc6L2liFR/2QyWVH8JhpsPZmNLTA3L1kvmZGxCNvN95 F56vbJ+AJ4BGUqorWnH9+Q7nftR2Q9Q2dj6z8GceG24cDSLmurXKKigKlqDE+8DXzU+Ju0 E997qVkP+/MDEEhcaYwk6GCXGsKBXoNG2KV9f28AkeAZQ0o+bXiElZYDhgCgvAw73qdHEM H+02VmPelBafinIEIF/MUvJ1jnMNOM1wss1iWFTtPGYltAz/oTXRQixqide4iw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjqMt5HrBz1FJQ for ; Sun, 21 Jun 2026 11:48:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26fa3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 11:48:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 6a572920f251 - main - kern_procctl(PROC_WX_MAPPINGS_PERMIT): ensure stability of the target vmspace 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 6a572920f251ac8ac6a80a55d4d039736ea7dd65 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 11:48:10 +0000 Message-Id: <6a37cf7a.26fa3.6cecfd92@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6a572920f251ac8ac6a80a55d4d039736ea7dd65 commit 6a572920f251ac8ac6a80a55d4d039736ea7dd65 Author: Konstantin Belousov AuthorDate: 2026-06-15 13:32:47 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-21 11:46:53 +0000 kern_procctl(PROC_WX_MAPPINGS_PERMIT): ensure stability of the target vmspace Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497 --- sys/kern/kern_procctl.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index c8d14aa2f2f6..581b24f21d3c 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -877,22 +878,27 @@ wxmap_ctl(struct thread *td, struct proc *p, void *data) { struct vmspace *vm; vm_map_t map; - int state; + int error, state; PROC_LOCK_ASSERT(p, MA_OWNED); state = *(int *)data; + error = 0; switch (state) { case PROC_WX_MAPPINGS_PERMIT: - p->p_flag2 |= P2_WXORX_DISABLE; PROC_UNLOCK(p); - vm = vmspace_acquire_ref(p); - if (vm != NULL) { + error = proc_vmspace_ref(td, p, PRVM_BLOCK_EXEC | + PRVM_CHECK_DEBUG, &vm); + if (error == 0) { map = &vm->vm_map; vm_map_lock(map); map->flags &= ~MAP_WXORX; vm_map_unlock(map); - vmspace_free(vm); + PROC_LOCK(p); + p->p_flag2 |= P2_WXORX_DISABLE; + PROC_UNLOCK(p); + proc_vmspace_unref(td, p, PRVM_BLOCK_EXEC | + PRVM_CHECK_DEBUG, vm); } PROC_LOCK(p); break; @@ -900,10 +906,11 @@ wxmap_ctl(struct thread *td, struct proc *p, void *data) p->p_flag2 |= P2_WXORX_ENABLE_EXEC; break; default: - return (EINVAL); + error = EINVAL; + break; } - return (0); + return (error); } static int From nobody Sun Jun 21 11:48:11 2026 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 4gjqMx1l4jz6jZT9 for ; Sun, 21 Jun 2026 11:48: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjqMw037Qz3WKD for ; Sun, 21 Jun 2026 11:48:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042492; 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=jPdFKrOeV19h1J42on5xm5TN63NzSwqVrk+9Q/37ECs=; b=PNbTGi4F6A3bN5mozCFhCp/ATg43JeJDzTBH4pnTgLKPZaUK6Wt+6uIopZajb/OrIexiGJ e9QgRKzmAFUy/9lgD8vbxG+JAzVpucEH97WPzlYi01laigmD0LQH34g1NpNpXRjjcLWZ00 5lLm1I8uMmEwGChYgZCxNzjMSoflbbTIxoooYiOWOpGEciVnHOfVfK2xOapSErnaHWX38j tt9z2jti6we/Lsv2IfmjPghdQQ4/VMPWS6WXoOC4ebXuB973JXBEaVQkxN1u1vOoNuO80V Ee+PKANaOe6lwmytAlpXC6lqDImcHD/E1eIlgyNh/2+bo9LF/6SPb3yLNQU2SQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782042492; a=rsa-sha256; cv=none; b=ycWAWMhlHAlj2yIYJI/7yWf40PxLxcPVU2gf6cXVin/Oolr6DZaBx3L18HLwUTbg72ikQg xr/+pvD5Ie2W/0KPaAgNOuckydp5T/SX9ZhED/yUGD+GhdthApiIr4KYvA7BIHsYjoLlW5 Eb93JmvIe+vgRn0S8QPm5F4wLrowC0akL7g2E7uOQn5bnqSBtz9KGrf6MznFcFzxv10lNG MhCiqlta24nVD5Gl/jbiV4K6cy6+xs4TmazqqRLQ5ZwIM4CVGDi81cHIXVkgmz3jU5gFqJ B/lk+r0UIQG5y7iA/qReDzKyIEXJNYbtOOv5QwPJknK4+Gq47KCANz9Z1f11aA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042492; 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=jPdFKrOeV19h1J42on5xm5TN63NzSwqVrk+9Q/37ECs=; b=TCNnWmVQdEJb8TEnG8yjy9lo8XjTd2BPz/hvfNwxSIlCo3KtjkuzM9mNje95u27T4HES1H 7dxtNT8gavqajWNMZyJ12q/abGNlpeJYTtFE53vA44b0DmQK1moNNc5moOyWWbtCRvNWVP bJf6MbcnPoDKWBY6PTZ4Xxar24HT0ZL1boi+VBkNdjDyH0BmfM0msQ9pjqVS1P0Pe0m3Ss fFbrxh9EDNvpW2XMcQMEDyo3yVKSskCR0t29+DrVMOABATkm4tz1fdpBKrXJxvcvthgSyI 7VRDTjp5mx6fxL0IhPhHzlh14h+2UFl19YSUdHVfh5f8rEXLfgLBIANjlgyQ8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjqMv65fqz1Dsv for ; Sun, 21 Jun 2026 11:48:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2664f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 11:48:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e41c28e67fac - main - linux_prlimit(): block execve for the target 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: e41c28e67fac9cd22a85b160c5c9d0477ed03600 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 11:48:11 +0000 Message-Id: <6a37cf7b.2664f.391e677@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e41c28e67fac9cd22a85b160c5c9d0477ed03600 commit e41c28e67fac9cd22a85b160c5c9d0477ed03600 Author: Konstantin Belousov AuthorDate: 2026-06-07 19:21:40 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-21 11:46:53 +0000 linux_prlimit(): block execve for the target Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497 --- sys/compat/linux/linux_misc.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index c863e1db8b02..3aecc0106aaa 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -2038,6 +2038,7 @@ linux_prlimit64(struct thread *td, struct linux_prlimit64_args *args) u_int which; int flags; int error; + bool exec_blocked; if (args->new == NULL && args->old != NULL) { if (linux_get_dummy_limit(td, args->resource, &rlim)) { @@ -2065,6 +2066,7 @@ linux_prlimit64(struct thread *td, struct linux_prlimit64_args *args) return (error); } + exec_blocked = false; flags = PGET_HOLD | PGET_NOTWEXIT; if (args->new != NULL) flags |= PGET_CANDEBUG; @@ -2077,6 +2079,14 @@ linux_prlimit64(struct thread *td, struct linux_prlimit64_args *args) error = pget(args->pid, flags, &p); if (error != 0) return (error); + exec_blocked = true; + PROC_LOCK(p); + execve_block_wait(td, p); + error = args->new != NULL ? p_candebug(td, p) : + p_cansee(td, p); + PROC_UNLOCK(p); + if (error != 0) + goto out; } if (args->old != NULL) { PROC_LOCK(p); @@ -2099,6 +2109,11 @@ linux_prlimit64(struct thread *td, struct linux_prlimit64_args *args) error = kern_proc_setrlimit(td, p, which, &nrlim); out: + if (exec_blocked) { + PROC_LOCK(p); + execve_unblock(td, p); + PROC_UNLOCK(p); + } PRELE(p); return (error); } From nobody Sun Jun 21 11:48:14 2026 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 4gjqMz4Jjgz6jZBJ for ; Sun, 21 Jun 2026 11:48: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjqMy2s4Mz3WDX for ; Sun, 21 Jun 2026 11:48:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042494; 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=y4/8gy2A1CF4hp8F1/Ibgj+oIMyCOIWV8uE06J+vJrM=; b=Qw1ijzNGg2WwPFnWIuIAfUtzXa3omdVZkDLljLq0WM4D6mBh8p3XDBvb0KpchFaEjs/yuz 9N74o2wE7uBtbpzqSbxl3YntwS1cVnaWhyygDk1jl8LO4t8NtWCJq051Q3O9qZBDV6Jbq7 3tbIB+iMpAFhAyup2KXtj/X92R7gf+/iceOxn6CjNvB5DJg8k1TfxByfIeqWYM82NNL9Dr Loz20e2OCEaSjTdSupFWVFD8aRURCjmiNhif4hg2vGwSYbs25N8S1J8TPCZXuUAsimxsuk JX5Wt8x91dNLJ8rkeboMQXilTk+azAFvRr9X/R/POKVGMLcieICb1tsfD/8IhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782042494; a=rsa-sha256; cv=none; b=o+hSnbF9NSMSqjZ1jXR7zP3zy9+5cZ1tvo/wD23nVaV/KhTldtEQrYYm1uDYE1rEgrpIq8 UwFm7kpwbOQOyGcEAAeyTVByrKq/mSSQrk+nZE955tlQ1iJBKINVc+saWcTBLxsYv5MEC5 /42EB7hoeO0DwIwoSXGsPZV48gVDWirAKsNffpZNpb+1OQYjqSQBkDJrQXNptpGzEs/tMT +c+Lbx2hAI8BNhbRux/vyOW4qyfUc5CwfhSjK6eEzIXCP113HEmvo6oso3sUVU3qnv/OS1 C+tOvFhoZeK/Ns/K5MOJMOELUlBgCmmIkJcVTXY5LmxBYL7DHKlpZBoMppFsEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042494; 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=y4/8gy2A1CF4hp8F1/Ibgj+oIMyCOIWV8uE06J+vJrM=; b=pTkLJiLuK3lfPO9QVDPMcUoZmExpka6bS3VgFiIfEO2IGKL806zTVVO7bO6dET8hI8pafS C+2sBQXZdJWe7KKLR0AzotWtz7qiPTOTQUkw8P2C1WRk3rgv1Dp77cvyE7TLjz260O/wAM xtnEe3xeDP/IcC7e0h8d3ohA0s+Elg/KWszvdtlFuNKB36UbWc/ifc+UVqIyfArHDE0iRw 0rP80nzsjzD7PtWF5n2UxvYQeGLhmIV9vV1KzxxOXFiWlAiCC1HocJ7oxJOFlG9LD/rpgz +9VdZIBnQ0a4YInta8J1OhUD55BzFvTCG8LJmIWaPUcGSaNx37WkTippjH2ZKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjqMy0Fb5z1F5S for ; Sun, 21 Jun 2026 11:48:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 265ea by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 11:48:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: a4993bac4135 - main - pseudofs: ensure that the target process vmspace is stable for VOP_READ/WRITE 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: a4993bac41350e85bc9affb862d2974a1a09bb5e Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 11:48:14 +0000 Message-Id: <6a37cf7e.265ea.6dbf7d41@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a4993bac41350e85bc9affb862d2974a1a09bb5e commit a4993bac41350e85bc9affb862d2974a1a09bb5e Author: Konstantin Belousov AuthorDate: 2026-06-07 19:39:42 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-21 11:46:53 +0000 pseudofs: ensure that the target process vmspace is stable for VOP_READ/WRITE Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497 --- sys/fs/pseudofs/pseudofs_vnops.c | 59 ++++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 18 deletions(-) diff --git a/sys/fs/pseudofs/pseudofs_vnops.c b/sys/fs/pseudofs/pseudofs_vnops.c index d14ed15f3329..229f762914bc 100644 --- a/sys/fs/pseudofs/pseudofs_vnops.c +++ b/sys/fs/pseudofs/pseudofs_vnops.c @@ -676,6 +676,7 @@ pfs_read(struct vop_read_args *va) struct pfs_node *pn = pvd->pvd_pn; struct uio *uio = va->a_uio; struct proc *proc; + struct thread *td; struct sbuf *sb = NULL; int error, locked; off_t buflen, buflim; @@ -694,21 +695,30 @@ pfs_read(struct vop_read_args *va) if (pn->pn_fill == NULL) PFS_RETURN (EIO); + td = curthread; + /* * This is necessary because either process' privileges may * have changed since the open() call. */ - if (!pfs_visible(curthread, pn, pvd->pvd_pid, &proc)) + if (!pfs_visible(td, pn, pvd->pvd_pid, &proc)) PFS_RETURN (EIO); - if (proc != NULL) { - _PHOLD(proc); - PROC_UNLOCK(proc); - } vhold(vn); locked = VOP_ISLOCKED(vn); VOP_UNLOCK(vn); + if (proc != NULL) { + _PHOLD(proc); + execve_block_wait(td, proc); + if (!pfs_visible_proc(td, pn, proc)) { + PROC_UNLOCK(proc); + error = EIO; + goto ret; + } + PROC_UNLOCK(proc); + } + if (pn->pn_flags & PFS_RAWRD) { PFS_TRACE(("%zd resid", uio->uio_resid)); error = pn_fill(curthread, proc, pn, NULL, uio); @@ -778,8 +788,12 @@ pfs_read(struct vop_read_args *va) ret: vn_lock(vn, locked | LK_RETRY); vdrop(vn); - if (proc != NULL) - PRELE(proc); + if (proc != NULL) { + PROC_LOCK(proc); + execve_unblock(td, proc); + _PRELE(proc); + PROC_UNLOCK(proc); + } PFS_RETURN (error); } @@ -1087,6 +1101,7 @@ pfs_write(struct vop_write_args *va) struct pfs_node *pn = pvd->pvd_pn; struct uio *uio = va->a_uio; struct proc *proc; + struct thread *td; struct sbuf sb; int error; @@ -1106,36 +1121,44 @@ pfs_write(struct vop_write_args *va) if (uio->uio_resid > PFS_MAXBUFSIZ) PFS_RETURN (EIO); + td = curthread; + /* * This is necessary because either process' privileges may * have changed since the open() call. */ - if (!pfs_visible(curthread, pn, pvd->pvd_pid, &proc)) + if (!pfs_visible(td, pn, pvd->pvd_pid, &proc)) PFS_RETURN (EIO); if (proc != NULL) { _PHOLD(proc); + execve_block_wait(td, proc); + if (!pfs_visible_proc(td, pn, proc)) { + PROC_UNLOCK(proc); + error = EIO; + goto out; + } PROC_UNLOCK(proc); } if (pn->pn_flags & PFS_RAWWR) { error = pn_fill(curthread, proc, pn, NULL, uio); - if (proc != NULL) - PRELE(proc); - PFS_RETURN (error); + goto out; } sbuf_uionew(&sb, uio, &error); - if (error) { - if (proc != NULL) - PRELE(proc); - PFS_RETURN (error); - } + if (error != 0) + goto out; error = pn_fill(curthread, proc, pn, &sb, uio); sbuf_delete(&sb); - if (proc != NULL) - PRELE(proc); +out: + if (proc != NULL) { + PROC_LOCK(proc); + execve_unblock(td, proc); + _PRELE(proc); + PROC_UNLOCK(proc); + } PFS_RETURN (error); } From nobody Sun Jun 21 11:48:15 2026 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 4gjqMz4TKXz6jZhH for ; Sun, 21 Jun 2026 11:48: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjqMz23R3z3WHb for ; Sun, 21 Jun 2026 11:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042495; 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=xxD/8MiJYr2qyyDpbhdRIDcJbYnFhTezFXSsICp4hIM=; b=KdQq6S1HM31N22T2FeE7SNjA+caecJTyhEcgEFWjDJPFxBZ3zzF6hx6Cdl2oxTdH04CDmT C/Av2uxA3wMXL/bsGxybYZX2FkCsFirO2K6uZgMG1aAZJ4w3+iBitkaX+js5NLZDteV6s3 7fPjOe1alJmP/I2SHOo4wV71RrXEpYRFPSBnZHdI26x457KNsu4Mzsd7D6YGURCoOtCRO/ Plqnp3FjU/gG31JWgFnM/NLZEVJs3oBx+wIFsV0MKudIwSzBMiHC7eR8H6R1DW1GLQK+WW 2iOn4RREGnn3DAJRI59/KV4kJjk8D+qW+DKVMCi/MsfQa1FcOH0MRqTTdryp0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782042495; a=rsa-sha256; cv=none; b=WulqH9z5ZXacatM0pJu9gJwgLmmUfyhHieIo7qmrHbGBbuYn6IrfZK24jfSxQrrj6Hrkis 0SmzFTzbaFwkSCDZGqeTOazW28NDE+Sn7C6tlbdSsvCS7p/f1wJTl6H7S38oUcmhA2F2t8 YsZ5+nPzPl0+DAEMEmHAnAqnc06/fN6KRFO39GSbiyE4A2rXw8XfcPnj6fgXcO9+PsoaiT RkJ4llJ3PdrPMDvHb9jZxeD0umHLamYqrSCUzlfJeOA10iggTobkgQ9t/U4Er34VIjuzQ1 JE7Qy1B/e6aDAD71jw+azRWFnC3jux7lx/AqT5nFl08SPai4pJYYsXpLjkZDNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042495; 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=xxD/8MiJYr2qyyDpbhdRIDcJbYnFhTezFXSsICp4hIM=; b=lo5TIP9ZjSreBuUk7Eobh5mwuYGQLF+EK/BACYN6uDWylR1btV2dEcI5xQEX2rtIjq2QP2 6f9FhM5CwKJQNnK0GsdRVretGxStC8WesZ9gfJD+qtePJnCPGToMeO1I8IQlMCFEf/yN5P wf0NX3xind9e2QaNJotW++WvcMHZqgyukIEagwghni89KMPj/yg+AqnmzeQsPFVZZ/S4gX D/JOV7vBCjwxNLskPsEYXUOBo/QL3z0kZwgGqUnqigHQuoEk0kM3HKhNpInXd946Kd8Od2 EYm0lJTAIBKpwQsRrGcY7LfFniOYddPO5xjOr8bJhxjdbtJdV7rcE2xOwQ8gSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjqMz15Zsz1FJS for ; Sun, 21 Jun 2026 11:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 252e0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 11:48:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 5db31f1b47b5 - main - procfs, linprocfs: ensure target process vmspace stability 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 5db31f1b47b586a5091eb41fc957236f28b78dba Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 11:48:15 +0000 Message-Id: <6a37cf7f.252e0.5c0b3698@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5db31f1b47b586a5091eb41fc957236f28b78dba commit 5db31f1b47b586a5091eb41fc957236f28b78dba Author: Konstantin Belousov AuthorDate: 2026-06-07 18:48:59 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-21 11:46:54 +0000 procfs, linprocfs: ensure target process vmspace stability Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497 --- sys/compat/linprocfs/linprocfs.c | 16 +++++----------- sys/fs/procfs/procfs_map.c | 17 +++++++---------- sys/fs/procfs/procfs_mem.c | 6 +----- 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index a0deea73d19c..b0e6a3a15bea 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -1311,19 +1311,13 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) struct vattr vat; bool private; - PROC_LOCK(p); - error = p_candebug(td, p); - PROC_UNLOCK(p); - if (error) - return (error); - if (uio->uio_rw != UIO_READ) return (EOPNOTSUPP); - error = 0; - vm = vmspace_acquire_ref(p); - if (vm == NULL) - return (ESRCH); + error = proc_vmspace_ref(td, p, PRVM_BLOCK_EXEC | PRVM_CHECK_DEBUG, + &vm); + if (error != 0) + return (error); if (SV_CURPROC_FLAG(SV_LP64)) l_map_str = l64_map_str; @@ -1421,7 +1415,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) } } vm_map_unlock_read(map); - vmspace_free(vm); + proc_vmspace_unref(td, p, PRVM_CHECK_DEBUG | PRVM_BLOCK_EXEC, vm); return (error); } diff --git a/sys/fs/procfs/procfs_map.c b/sys/fs/procfs/procfs_map.c index d4913a7b0f1d..1ed785f1ad90 100644 --- a/sys/fs/procfs/procfs_map.c +++ b/sys/fs/procfs/procfs_map.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -93,15 +94,14 @@ procfs_doprocmap(PFS_FILL_ARGS) bool wrap32; #endif - PROC_LOCK(p); - error = p_candebug(td, p); - PROC_UNLOCK(p); - if (error) - return (error); - if (uio->uio_rw != UIO_READ) return (EOPNOTSUPP); + error = proc_vmspace_ref(td, p, PRVM_BLOCK_EXEC | PRVM_CHECK_DEBUG, + &vm); + if (error != 0) + return (error); + #ifdef COMPAT_FREEBSD32 wrap32 = false; if (SV_CURPROC_FLAG(SV_ILP32)) { @@ -111,9 +111,6 @@ procfs_doprocmap(PFS_FILL_ARGS) } #endif - vm = vmspace_acquire_ref(p); - if (vm == NULL) - return (ESRCH); map = &vm->vm_map; vm_map_lock_read(map); VM_MAP_ENTRY_FOREACH(entry, map) { @@ -238,6 +235,6 @@ procfs_doprocmap(PFS_FILL_ARGS) } } vm_map_unlock_read(map); - vmspace_free(vm); + proc_vmspace_unref(td, p, PRVM_BLOCK_EXEC | PRVM_CHECK_DEBUG, vm); return (error); } diff --git a/sys/fs/procfs/procfs_mem.c b/sys/fs/procfs/procfs_mem.c index 824fcd33b2ef..eb692c32923b 100644 --- a/sys/fs/procfs/procfs_mem.c +++ b/sys/fs/procfs/procfs_mem.c @@ -60,11 +60,7 @@ procfs_doprocmem(PFS_FILL_ARGS) if (uio->uio_resid == 0) return (0); - PROC_LOCK(p); - error = p_candebug(td, p); - PROC_UNLOCK(p); - if (error == 0) - error = proc_rwmem(p, uio, 0); + error = proc_rwmem(p, uio, PRVM_CHECK_DEBUG | PRVM_BLOCK_EXEC); return (error); } From nobody Sun Jun 21 11:48:16 2026 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 4gjqN05m7xz6jZk4 for ; Sun, 21 Jun 2026 11:48: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjqN02qL3z3WBr for ; Sun, 21 Jun 2026 11:48:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042496; 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=oBx3b49lpFZGRmgqr0M2vfkiObp1tpPzfMwsXewy5a4=; b=kKAbMtMLGTUxcJx0ZBo0+d6u65Re7DQhOoseH0sTqFOF4x9iq7gNzwJO5vSnqw3XPxNZUd zLOvagzibYRIUaOn9GXp+oxcl0FAQeH/VbAcqv0LU6lV0M0ayk0OmUz+ITRkjim89WdIIO qutmvupVvqleAn0LY/p+veoRLU734U27hWT4GCAUmDyyQhUpCsNnz9JTOnbH4A3Vn1Dqz5 1/r3sLt3IvlRS3FvSNnPm7xL7l32qQIlcuG+iebZqt6UH/yOpokxWUaW4klfXAHwm7vDtf pE3ePjvtqgFemlwrpig2P+2p72Ncd1lwfQvAXLeRSiwXR587DViAIsCybQt7Dw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782042496; a=rsa-sha256; cv=none; b=YI3Oda3WeyeSuh3rdMoVsGAl9qkaW4afSlvGM5mHQnCJXW2e+ZCA7l86M29okQKaibEeGK S/4qEcD2QWMnZJ8udPBWLhemj3gd+G1/5cIccS8Js3nvO8LgM8BoAIwQU2J9Ruf5dLVsno JoeykSqq7FchhXQeNhBOHEJipNhbkAIKNKu6rqa3M+Kl32M0oT8IIq078D3vl2BsOe9Hj8 0b2j4/SxSq3D76yzgMLFSdS+WvSysEIy5xhjTbN96VgDoxia6sVM9sXA8eQfqONo6MX7V/ VVUROcCQxzQRAR2dNb/EPgKn4cDGJBB2lv2ZStSP8O1qBwR195C9uC10OeVZhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782042496; 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=oBx3b49lpFZGRmgqr0M2vfkiObp1tpPzfMwsXewy5a4=; b=r1n/U2U9NxYx1ChvM1YW0t0ue/mHtiFf7Wf+zwW+HKDwo4aDooItBw3UoMfEuRjaWE9r+P 2HkJWttqzht7zgK2wkunHwd1FnQ37U5cd/B3aGBlnVLIzCtR28XWa0ECBq1MU/1MnV+m/o kD2XK0xoYomD9foIusQdk7yw+tNoOT86og+0/clDiULjg502wV6mJptiqR6Uhkk84NNzab mfqLmpPF/Xkc9tcDnREcECIpnsOxYfiKk7GHg7R5YRZ0eiNjX5IXR1Kh6GuHLADNoYyaDA e4cckHpQi8FTUJiA7XjuZHNOgtK8Elej4FekAx8RKLB87NHHaueqdICwwvIp4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjqN01rzqz1DV7 for ; Sun, 21 Jun 2026 11:48:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 250bd by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 11:48:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: d0384f50dad2 - main - sys_set*id(9): wait for the execblocks to pass 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: d0384f50dad25d3358d76f7556969ea1d515ba68 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 11:48:16 +0000 Message-Id: <6a37cf80.250bd.6c385fb@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d0384f50dad25d3358d76f7556969ea1d515ba68 commit d0384f50dad25d3358d76f7556969ea1d515ba68 Author: Konstantin Belousov AuthorDate: 2026-06-17 19:07:22 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-21 11:46:54 +0000 sys_set*id(9): wait for the execblocks to pass to ensure stability of the process uid/gids during the p_cansee()/p_candebug()-protected regions. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497 --- sys/kern/kern_prot.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 47744f6b07fe..a223a7720844 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -1021,6 +1022,8 @@ sys_seteuid(struct thread *td, struct seteuid_args *uap) newcred = crget(); euip = uifind(euid); PROC_LOCK(p); + execve_block_pass(td); + /* * Copy credentials so other references do not see our changes. */ @@ -1075,6 +1078,7 @@ sys_setgid(struct thread *td, struct setgid_args *uap) AUDIT_ARG_GID(gid); newcred = crget(); PROC_LOCK(p); + execve_block_pass(td); oldcred = crcopysafe(p, newcred); #ifdef MAC @@ -1173,6 +1177,7 @@ sys_setegid(struct thread *td, struct setegid_args *uap) AUDIT_ARG_EGID(egid); newcred = crget(); PROC_LOCK(p); + execve_block_pass(td); oldcred = crcopysafe(p, newcred); #ifdef MAC @@ -1304,6 +1309,7 @@ kern_setgroups(struct thread *td, int *ngrpp, gid_t *groups) newcred = crget(); crextend(newcred, ngrp); PROC_LOCK(p); + execve_block_pass(td); oldcred = crcopysafe(p, newcred); #ifdef MAC @@ -1360,6 +1366,7 @@ sys_setreuid(struct thread *td, struct setreuid_args *uap) euip = uifind(euid); ruip = uifind(ruid); PROC_LOCK(p); + execve_block_pass(td); oldcred = crcopysafe(p, newcred); #ifdef MAC @@ -1439,6 +1446,7 @@ sys_setregid(struct thread *td, struct setregid_args *uap) AUDIT_ARG_RGID(rgid); newcred = crget(); PROC_LOCK(p); + execve_block_pass(td); oldcred = crcopysafe(p, newcred); #ifdef MAC @@ -1509,6 +1517,7 @@ sys_setresuid(struct thread *td, struct setresuid_args *uap) euip = uifind(euid); ruip = uifind(ruid); PROC_LOCK(p); + execve_block_pass(td); oldcred = crcopysafe(p, newcred); #ifdef MAC @@ -1600,6 +1609,7 @@ sys_setresgid(struct thread *td, struct setresgid_args *uap) AUDIT_ARG_SGID(sgid); newcred = crget(); PROC_LOCK(p); + execve_block_pass(td); oldcred = crcopysafe(p, newcred); #ifdef MAC From nobody Sun Jun 21 12:17:41 2026 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 4gjr1y2Prtz6jcNd for ; Sun, 21 Jun 2026 12: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjr1y04wfz3ghy for ; Sun, 21 Jun 2026 12: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=1782044262; 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=K6izN1aY49VCENRhdfzqiOdtgZjqhdhyXMqWHfg6/KY=; b=sp4gZabwNCsTWh/eFjyx+vx0S0xyOCi0zH0Ts205bQFvnb/MjPqUIQ5phcj+IPvpj/l7Zk U31emPYcn2dqvQa/qR3HI6EHxAFnbxz3IJf01VOis+sjtWvK/NGxWGxwKeLv+csFy4HeCA KevraAI9WJPQl93AnewdKyXTfsGAw+00Xj0the8RDIAX4AGuYcEbHEmTAMYrzZ+OCEJm8y MzI7mIzBJAg0585zxBzpc+2ll3O3LWTlBuv0CnB92nZ4S/MIovVBKUj3bF0Ca0YxeqxmGn 7TyY3sn7LxLPmG2+q9E9NQTxpUQJDILJ9cPGMOG+pTGA9ud6gCJe6hS7k4pEEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782044262; a=rsa-sha256; cv=none; b=coo6Uj+T3SXu71zOh/3DkVcgJpeKA56UNIZHOh15EzX0g7RZQq7dAEwZ8v/Y1VH/GWOPi7 o14FSxkymgmcm/P0Lnq37uG8O5KIJBloKcMqdhpYzDJX/uF5bPmpamUHA/SYX2gW2lJmmz MyeralcgbbZDZGEJCm1bPatF7LXP4z42Tx/dAvDDdX920aCJtiHApZnI1Zoun4ZMaO3lkY dNXtx8mZ3fuojblXEnh9fDCjtw9bWB73IN087dl001ttDREVz3AwuVBrm7YKnv5M47RWiE Pmf2J05xPdr/TPvu+zBO8+molbOh7SSj9OdsXO5a5sQR5nbtBm42gNj2iH7Pmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782044262; 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=K6izN1aY49VCENRhdfzqiOdtgZjqhdhyXMqWHfg6/KY=; b=PFIxJuRnYNv29msbwZRN0CdBpIySU2s7CjrJlcJA8Ftq7zP1EebZ2PZtFEBDjmUx3o4J+T jWspw18diWCXiwmWgneoAz8nG5s5Jn3PdDG4zokDV8rJWggaMxa7db4+8SDI4QLuQCT0Fp gVztbN9rGP7phsrb7Gpz9WiDWmg6IzTDOXJnoeBpxJmZ9TS81wNqYrceSmpz+xpdqm+6DK Bk2dd1tvoF93hiz81P2KQ7m8FLMalqc1YyunA1e/y1ki/mHmPMgNDIW7D0E2FrHeQVvOwU RV8YnqVQiDw4a1fiDiF7ZcIGvTHX3ctXpF5sdQHqEZsIx66lOiPtge7eoQq0uA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjr1x65m2z1G5c for ; Sun, 21 Jun 2026 12:17:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 303b6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 12:17:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: c7e5802ab6e6 - main - amd64: do not restore fsbase/gsbase for 32bit processes 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: c7e5802ab6e6230a5782a09c914585d055eb5223 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 12:17:41 +0000 Message-Id: <6a37d665.303b6.7db6c140@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c7e5802ab6e6230a5782a09c914585d055eb5223 commit c7e5802ab6e6230a5782a09c914585d055eb5223 Author: Konstantin Belousov AuthorDate: 2026-06-16 21:44:00 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-21 12:17:11 +0000 amd64: do not restore fsbase/gsbase for 32bit processes There is no WRFSBASE and WRGSBASE 32bit variants at all. As such, the fsbase and gsbase must always be equal to the bases in the corresponding segment descriptor, same as on real i386. If a 32bit program reloads either %fs or %gs using setcontext(9) or sigreturn(9), restoring bases from the syscall entry time is wrong. In all other cases, hardware already does the right action when the segment register is loaded, and the bases for the ufssel/ugssel in GDT are updated on the context switch. Reviewed by: markj (previous version) Tested by: terehovv@mail.ru Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57611 --- sys/amd64/amd64/exception.S | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/sys/amd64/amd64/exception.S b/sys/amd64/amd64/exception.S index 5ff75fb65740..4d58e07caf4b 100644 --- a/sys/amd64/amd64/exception.S +++ b/sys/amd64/amd64/exception.S @@ -1161,12 +1161,15 @@ do_segs: .globl ld_fs ld_fs: movw %ax,%fs + testl $PCB_32BIT,PCB_FLAGS(%r8) + jnz after_ld_fsbase movl $MSR_FSBASE,%ecx movl PCB_FSBASE(%r8),%eax movl PCB_FSBASE+4(%r8),%edx .globl ld_fsbase ld_fsbase: wrmsr +after_ld_fsbase: /* Restore %gs and gsbase */ movw TF_GS(%rsp),%si pushfq @@ -1179,6 +1182,8 @@ ld_fsbase: .globl ld_gs ld_gs: movw %si,%gs + testl $PCB_32BIT,PCB_FLAGS(%r8) + jnz ld_gsbase_32 /* Restore kernel %gs base */ movl %r12d,%eax movl %r13d,%edx @@ -1194,6 +1199,8 @@ ld_gs: .globl ld_gsbase ld_gsbase: wrmsr /* May trap if non-canonical, but only for TLS. */ + +after_ld_gsbase: .globl ld_es ld_es: movw TF_ES(%rsp),%es @@ -1241,6 +1248,30 @@ ld_regs: doreti_iret: iretq + /* + * 32bit gsbase path. + * The KGSBASE is not loaded from the pcb_gsbase, instead we move + * the GSBASE value into KGSBASE right after loading user %gs, then + * restore kernel gsbase. + */ +ld_gsbase_32: + /* Read the user gsbase into %r14d:%r15d. */ + movl $MSR_GSBASE,%ecx + rdmsr + movl %eax,%r14d + movl %edx,%r15d + /* Restore kernel %gs base */ + movl %r12d,%eax + movl %r13d,%edx + wrmsr + popfq + /* Load the user gsbase into KGSBASE. */ + movl $MSR_KGSBASE,%ecx + movl %r14d,%eax + movl %r15d,%edx + wrmsr + jmp after_ld_gsbase + set_segs: movw $KUDSEL,%ax movw %ax,TF_DS(%rsp) From nobody Sun Jun 21 12:19:22 2026 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 4gjr3t49bgz6jcpf for ; Sun, 21 Jun 2026 12:19:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjr3t3L0Xz3hYL for ; Sun, 21 Jun 2026 12:19:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782044362; 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=beOU15iOvsd5//7Y/+rUzHz82gxvgm7HbQEh0NK4ZvU=; b=mDxMYEUVLnCiiG2dXGE6EUoLySmvwsqk/wMrx/eXVVIHg01bW7LnKqnxmqu2unNBBoOkGd CcX50qdfzdsEySlhah0XFIVh5dz/ZfgMJkEUTKR2umqNNdJm6HhLNsYIx7muJc1WDaOWeg MB6SNyyvbTg0vPy72pgmh387Vr8CZXarYYD/wbMTIklIqQLB0x3y52Vl7llavhXiIz2COy 3CketA4PLxzSBecUhLdDoG4GddEVJH3CcpTdwk9uWg6vIkQGDAg73LZjfKymCftBL9uC/1 npLMJt/N8qyuS73JmYVA2BIwiaZ7rQDI/Qbqr/r3nrVmNXEn6Zoq5mq0nwFcAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782044362; a=rsa-sha256; cv=none; b=yynTZVtkzer8IRJ1ahqDe6Dbyiv81M+9bV4fdjkVNxi12v0wvenwv+jpagXMngVXhkkrpP 6QrwsNkqtLDXEA49fjg4JlUM/D7J39YwBVpqyBLgNRQ9x3bf5Ty5cWYXigcLYEE3UkzwVx K4ve4tv9InLDXdpj3s+dK/aAsfR2o9U44C5S0MQVvsKcwgeoJVFHsPOYff5U4u3vGlSHrM +/1WH1oQOpdQWQP3CXmeMo9eLrll57eUqJF3HNKuPiDt5NE0Cc/Uvt1iKcHGA6AuSuI1N9 V4qQxd3Z1/IxErDh5NHO/QQanymjX2pGcPdpYc557uI3Pw5TWy0YmcPArFYaxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782044362; 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=beOU15iOvsd5//7Y/+rUzHz82gxvgm7HbQEh0NK4ZvU=; b=fIJ7a750XU6cIDVGWWugBM6qUrUrzTaUwYOOyU0zBpFbmGqHoB8FJv9RH0KJJE4bJgaC4l PRknzJW+NeSKBSzSSvFWvucBYMPe7GZAghNrKenyRIK8+h9RanZu42YbiBUmuEC5GC9Rnd FDJXwgnVa+oXXUNrvdhHbmP/r2W1ki3c35NyBV+dY3WUM/jrvexUVGo0PmK9XfgHdHNXg+ cyBJAQBRe5Gv4qvkvmX7j7AkJP375VAX1arttnxIySslAg348o+jI28xBDxic6VJZiU1rW zLDVisjkvqeItTyEncN4ExzmOoZ8dlkKTrhOuv7ElTOE73p82ZUE0K0uLYoDTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjr3t2327z1G0v for ; Sun, 21 Jun 2026 12:19:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3121f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 12:19:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: f6b3bd1f3384 - main - sound tests: Remove trailing PROT_EXEC 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f6b3bd1f3384d262b893af123f3fc2df21c5b9ee Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 12:19:22 +0000 Message-Id: <6a37d6ca.3121f.7eee33c3@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=f6b3bd1f3384d262b893af123f3fc2df21c5b9ee commit f6b3bd1f3384d262b893af123f3fc2df21c5b9ee Author: Christos Margiolis AuthorDate: 2026-06-21 12:17:39 +0000 Commit: Christos Margiolis CommitDate: 2026-06-21 12:19:14 +0000 sound tests: Remove trailing PROT_EXEC Fixes: 730eaf466493 ("sound tests: Add PROT_EXEC rejection test") Reported by: Oliver Pinter Sponsored by: The FreeBSD Foundation MFC after: 6 days --- tests/sys/sound/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/sound/mmap.c b/tests/sys/sound/mmap.c index e83193db9bc1..6ebfd2f7dec5 100644 --- a/tests/sys/sound/mmap.c +++ b/tests/sys/sound/mmap.c @@ -120,7 +120,7 @@ ATF_TC_BODY(mmap_reject_prot_exec, tc) len = 8; - buf = mmap(NULL, len, PROT_READ | PROT_EXEC | PROT_EXEC, MAP_SHARED, + buf = mmap(NULL, len, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_SHARED, fd, 0); ATF_REQUIRE_MSG(buf == MAP_FAILED, FMT_ERR("mmap")); From nobody Sun Jun 21 12:19:55 2026 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 4gjrDH2bsSz6jdGl; Sun, 21 Jun 2026 12:26:39 +0000 (UTC) (envelope-from christos@freebsd.org) Received: from margiolis.net (mail.margiolis.net [95.179.159.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjrDG0n8Lz3jh2; Sun, 21 Jun 2026 12:26:38 +0000 (UTC) (envelope-from christos@freebsd.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=margiolis.net header.s=default header.b=CKoJQAJ9; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=freebsd.org (policy=none); spf=softfail (mx1.freebsd.org: 95.179.159.8 is neither permitted nor denied by domain of christos@freebsd.org) smtp.mailfrom=christos@freebsd.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=default; bh=BYftHkdg3HOl kYxTprUn/4qRA3B+xvQuL9OXR/km41U=; h=in-reply-to:references:to:from: subject:cc:date; d=margiolis.net; b=CKoJQAJ9NnfwbYHHFQ1JdWdUY3F5gbdmaN p5NZ2wnu2gGMIRR3SPE/WwBSlJcrbt/FQUdfeNhQQrdmnUoF74yxdUJE60SGFw/WsU9LU6 dN248Sfim0nEDmFag+O/2en94CTaA9MtK7aCycvf8kNVF2PhkJrImcb/jqhc7a+90mc= Received: from localhost (31-217-175-123.cgn.acro.cosmote.net [31.217.175.123]) by margiolis.net (OpenSMTPD) with ESMTPSA id e044945c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 21 Jun 2026 06:19:56 -0600 (MDT) 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sun, 21 Jun 2026 15:19:55 +0300 Message-Id: Cc: , , Subject: Re: git: 730eaf466493 - main - sound tests: Add PROT_EXEC rejection test From: "Christos Margiolis" To: "Oliver Pinter" X-Mailer: aerc 0.21.0 References: <6a36e480.318f5.79b60374@gitrepo.freebsd.org> In-Reply-To: X-Spamd-Result: default: False [2.31 / 15.00]; SPAM_FLAG(5.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.986]; MV_CASE(0.50)[]; R_DKIM_ALLOW(-0.20)[margiolis.net:s=default]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : No valid SPF, DKIM not aligned (relaxed),none]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[margiolis.net:+]; RECEIVED_HELO_LOCALHOST(0.00)[]; ARC_NA(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; GREYLIST(0.00)[pass,body]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[christos]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; TAGGED_RCPT(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:20473, ipnet:95.179.144.0/20, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[] X-Spamd-Bar: ++ X-Rspamd-Queue-Id: 4gjrDG0n8Lz3jh2 On Sun Jun 21, 2026 at 5:22 AM EEST, Oliver Pinter wrote: > On Sat, Jun 20, 2026 at 9:06=E2=80=AFPM Christos Margiolis > wrote: >> >> The branch main has been updated by christos: >> >> URL: > https://cgit.FreeBSD.org/src/commit/?id=3D730eaf466493315c1d1164eb6b59b14= 766f49322 >> >> commit 730eaf466493315c1d1164eb6b59b14766f49322 >> Author: Christos Margiolis >> AuthorDate: 2026-06-12 06:20:26 +0000 >> Commit: Christos Margiolis >> CommitDate: 2026-06-20 19:04:50 +0000 >> >> sound tests: Add PROT_EXEC rejection test >> >> Sponsored by: The FreeBSD Foundation >> MFC after: 1 week >> Reviewed by: markj, kib >> Pull-Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/30 > There is PROT_EXEC twice. https://cgit.freebsd.org/src/commit/?id=3Df6b3bd1f3384d262b893af123f3fc2df2= 1c5b9ee Christos From nobody Sun Jun 21 14:19:57 2026 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 4gjtl232s8z6jp09 for ; Sun, 21 Jun 2026 14:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjtl20d3Lz3vpt for ; Sun, 21 Jun 2026 14:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782051598; 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=M4ser9NWUDI2YjmwElpYlXCEMV23hgv8ik+fVYNClS8=; b=QDZ6hHWtF9rua84iVK+i938vxqmeWumtnRcLJ9LN1sDNXxnQxsLQV0lbOMoemhTxghd1Vn RYXr3eDAwrQcMZOBFo8PyRgW0wQRBBBqz5ku/uoCoBKaqx6SVQ04/cRkhboPmdOGhMLLQp pAxVjNXGkBXFxRn0qPfGU2P8ERulNdukMjjDVec/JsrgY/zjGGfzKjSZHDnh5AOUoLbrIf oZrV2ZwxA/KgLay53JPANoV7RgUYFVCAcxN/I2csNPwGkdFOJ544H8x79NYy4V+zjh4su9 AZ3CqqpaWV/Sdoq/tmOsEkAsMVSwNkq+5tduA6+C3LXEKog8a3PWiCMnXT8C/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782051598; a=rsa-sha256; cv=none; b=vPG4223azepXAunQRZUYxQLjA34Tg57zzh3mUYwyujRu9yxfaEOtWb2xGfoQU23Qie9grN i3bJEopDQnyES9c4DIQdisn/EBlgnyBWGfLWX9ZNhFBfSleiW8Gu1bX7+MRzbjDLILtUcN YEcYdE0FhxqyvjwOCp1FzkudrmpwoUWMxKkR1T/Ec9uF1q2dYsDqr+igwI38JjlZ+IRtlP LXJZ5QR/6ki7XNRcdCn4iMox//GH/YMPo507SWs0QBc0pwcD/3RgvGAONwotnmBEs3mJbR CoCC5YHkb8ko4s93Y1/mo5ynA9g+gJFyNbHo1lT8Z3j5AZBXDqxb5Vca2zAPww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782051598; 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=M4ser9NWUDI2YjmwElpYlXCEMV23hgv8ik+fVYNClS8=; b=BXe9Tef1+eO4c3/LzBfpzKswa6q57LS4lAVTR2lKnXjeevY3NbCZIwhqfsQKrUG/IUPtjn AhfjMlzrFN+ZwnCoerlyyYC+YRJS2TIwMbFKSEruRvG3mMO8o3mTG/s88OklKQaCj6B0B0 1m7JT01ow8YVJOdH8bvhwM11JGnO2oRyciwnXXkIJBKG0veSljppvo49mnxZmnBcQfglAV QxDfTDdVpS9eTLYXYLc8xbr8Mu2qpo5nwoCXgN2XgwBAwCJJIG+VqO4qglX/W1bKMesY6X IdyLOi5tGRE9pchW1TcuN2SkSgo0YkHvbXIH9YaDLaGK/SkERPsEdDolu+F3KQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjtl16DKWz1JR5 for ; Sun, 21 Jun 2026 14:19:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3e817 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 14:19:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: f5fce0bcc370 - main - kern_exec.c: explicitly include sys/limits.h for UINT_MAX 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: f5fce0bcc370a9700249e64901eabf2e0be4ecb0 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 14:19:57 +0000 Message-Id: <6a37f30d.3e817.243c20a@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f5fce0bcc370a9700249e64901eabf2e0be4ecb0 commit f5fce0bcc370a9700249e64901eabf2e0be4ecb0 Author: Konstantin Belousov AuthorDate: 2026-06-21 14:17:41 +0000 Commit: Konstantin Belousov CommitDate: 2026-06-21 14:19:20 +0000 kern_exec.c: explicitly include sys/limits.h for UINT_MAX While there, remove unneeded manual inclusion of sys/cdefs.h. Fixes: e1a84b7708c2 ("execve_block(): a mechanism for mutual exclusion with execve() on the process") Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/kern/kern_exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 15570eee4c37..f19c62cd16e3 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -26,7 +26,6 @@ * SUCH DAMAGE. */ -#include #include "opt_capsicum.h" #include "opt_hwpmc_hooks.h" #include "opt_hwt_hooks.h" @@ -46,6 +45,7 @@ #include #include #include +#include #include #include #include From nobody Sun Jun 21 14:45:07 2026 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 4gjvJ34417z6h719 for ; Sun, 21 Jun 2026 14:45: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjvJ33PSrz3xs0 for ; Sun, 21 Jun 2026 14:45:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782053107; 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=WEMX9rav+XIZxrWETT7HO+z2QvdqVZ4Gdjlt34gv5Nc=; b=Yj2KnyNXKaTEGO3FxCFHTQGcIkk2cu6RdIphBaNdAQ3l2jdboGhirSMtSGDmY3hwVkVHAB tSFUAT6O2FBZFQ8oQsoI/cTC+w51qR7hNSRLaFUCr4d2w8XE4cvP6QmGw0o9UWttbDiNlR IGMwIRMmRItTRVsSWbs7f4cR+o2Izhe2JLMk3aRRg52k1bll9vQKPGyFdC4H4t0l04h0R0 6gY457xxAyLHuCO4LB6h6D80jxBR5l8MXQnzQNqzUmyajGXiSdEKldgza1KEYpsw6cskGH NNwnJuO0VWQDk76GW9pyNBZeuxVok4cDAQNznGai2l2phR9o/f/bp5t3xB5jMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782053107; a=rsa-sha256; cv=none; b=DIfJ5Ma3/dV/g2Shmk6UHyeRuOH4VtRCatjwJRYPV0Ikf8vMPqEV/P4iZlfGwoXpUVHUTD n9hdX/EyksXr0wP2A/+4hEqoNm+3hhvQ4bSw84S75fZSmaxns4JvzBy4f5GH0UgGGNralP g7RJXZSs68MFL0T91/fKtB5d2mv6lTsfBeZAe1SYCwTOTI5uIUAnYz3YzdBTg+CFR9bcr8 ceuLYI9kcz7QafqmOMiPqkAXSInJvOm3oWwj90lDK0FA6/mfp5FqCIlt4a7LEy/iviypSr EnT3xdXabSxKiYC4Wndb3+yXHx+m4bEDKbz57PwZFd4vgjJ1PIY84Jc4nHP6Jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782053107; 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=WEMX9rav+XIZxrWETT7HO+z2QvdqVZ4Gdjlt34gv5Nc=; b=WwC8vJjT9yqd20dcGOuBsLpJHVfJRNi6Hwc2s0E+SgpbLXzVQzWB5NEvBZC1FJGZUkJ/Ba 1HmJ38+I6Q+Psv7i8CqZdayXm8eYA6pdmac4h8hCrxe0Sy/i/w6vVAo8kaW0i1NVkrhLZx a4Ut6vOC7n99srzCbes4+M+W0grG5S1s3rJ+dviR+2mhUVEA8F16e+g24sbGQfpksklIya hBEvAU3RytNGlzIWoklKWNOaDe7hSjn6y+ooD30U+cdjjyHz9UuIlV+FzqtMUMImZioFZ6 9C2W0rgWi172R3mY+q/T+U/Wck4j3sTOfLsmpuhHevSs2z44DBbnCtiyxOW6vg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjvJ32RzYz1Kt2 for ; Sun, 21 Jun 2026 14:45:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4158d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 14:45:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: c57fab60daeb - main - nfs_nfsdstate.c: Another unnecessary initialization for gcc 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c57fab60daeb2e7a97700699128897a496fdfd6a Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 14:45:07 +0000 Message-Id: <6a37f8f3.4158d.3d4a44a3@gitrepo.freebsd.org> The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=c57fab60daeb2e7a97700699128897a496fdfd6a commit c57fab60daeb2e7a97700699128897a496fdfd6a Author: Rick Macklem AuthorDate: 2026-06-21 14:42:19 +0000 Commit: Rick Macklem CommitDate: 2026-06-21 14:42:19 +0000 nfs_nfsdstate.c: Another unnecessary initialization for gcc This code hasn't changed in a long time, so I don't know why this showed up now? --- sys/fs/nfsserver/nfs_nfsdstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 965fdcc01ebe..102af9bb2951 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -1829,7 +1829,7 @@ nfsrv_lockctrl(vnode_t vp, struct nfsstate **new_stpp, int specialid = 0; struct nfslockfile *lfp; struct nfslock *other_lop = NULL; - struct nfsstate *stp, *lckstp = NULL; + struct nfsstate *stp = NULL, *lckstp = NULL; /* Shut up gcc. */ struct nfsclient *clp = NULL; u_int32_t bits; int error = 0, haslock = 0, ret, reterr; From nobody Sun Jun 21 16:14:39 2026 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 4gjxHN3rtQz6hH5l for ; Sun, 21 Jun 2026 16:14: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjxHN0nsXz49TW for ; Sun, 21 Jun 2026 16:14:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782058480; 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=dR3QN13DSTqFURR2KAhRgIfztQnKPrA6cbDhQfIApus=; b=xYPMkceufHgU8gNnB0gDZVuKI3Hf2jRoaCMpEux3KSbCX6uScmdmUcng2F8j3a5AYSRi+A A6/OlGrTm/ZJD7jmQzGQiZKRPSvdDXb2KHrfBq5NGCuoDRC9TpmQFvlqn1G4h/0Ocix/s/ 1g+BOzluETi8hoFdsABHUjmY1qKKtxXVvwRnPz4iuKjF3OsM2wSkR7DudpXxOtClILcFyM hS8GCWRcblAr2Ac1Hdx2M7KaF6unXPImGXeOaqBv6hbr+ZY8ecr3ldrf+V8xehQEj1Amo/ 50cHH2MXqwxiOOCVY2/9Z4UVADkCj+vlMluZLzbtxXAZd4PeqQjmZAsK+HuezA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782058480; a=rsa-sha256; cv=none; b=jQ8RBRbJZC2uf310xxbks2JTRrmHCfVU41QwnvrIeETaYWxiZfWgLQoEJbuIFkVC2ffGNT 9MLHa+639C6Khut8M5VTbytoMinANQORHKAmFuUo7+0UqXWwYxo0sE+71GF9srCLnSKUPK BkBPE6scI32WLcGu1SLzhvCUBnCs1qUsO/m3G5tRT4DyU3wsqrM6ZiIkQY6IFIYf73aK7d 6jJI/8uffcHULT92sXpbuqjBB7JTawwRVxpUpQmDN5QZ3dO0ia9SCNcwx2u123cOKhFmLL li8cAMh7gJVUi0SOfwM0Jc9wXaovBSrL4CNJav+pZqoPLdJ/rINrQaLtoc8WVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782058480; 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=dR3QN13DSTqFURR2KAhRgIfztQnKPrA6cbDhQfIApus=; b=lUtqhLG+0X0FZ+SE5Pzo8OlcZq73jKtR3dD4tVNQbQIKUA0CHC87iUzFFoRHp2FMId8SGy WF1yOn+fjm1v6Wsd17vYeNUvKeLE8K6Djr9lVQ94YJu2mpyGMppCfQYah0D0GWTixJKHf+ NbblyZA3GMh9sJ+RJHoKDAi+jsAGATp0MZDnJpgQN3SLk/t3li0QxY4bLuyYSs7zOoBXhz xgKl5TDIvtBdbqHr4wR/YsyVZB7QeXZoYjoBgo+CmPyn+5z0cyq5+LHPL4EU7tFx3GN5wG vqP3m8lvo1mArxMnDQHFeT4yM9YUveRE6TKwxg1uGDnFTX04JCrYECEIxluakQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjxHM6QDLz1N2M for ; Sun, 21 Jun 2026 16:14:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1a3a0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 16:14:39 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: fc9b28879e89 - main - uiomove_*: centralize the copy function selection 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: fc9b28879e8935cc830b83d8a36d85b9b98b276a Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 16:14:39 +0000 Message-Id: <6a380def.1a3a0.21375365@gitrepo.freebsd.org> The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=fc9b28879e8935cc830b83d8a36d85b9b98b276a commit fc9b28879e8935cc830b83d8a36d85b9b98b276a Author: Brooks Davis AuthorDate: 2026-06-21 15:47:53 +0000 Commit: Brooks Davis CommitDate: 2026-06-21 16:13:27 +0000 uiomove_*: centralize the copy function selection Add a uiomove_step() for the central set of switch statements which choose between userspace and kernel and if data is going to or from the iovec. Refactor uiomove_fromphys loops to unconditionally free per-iteration resources and drop gotos. While here, switch from bcopy to memcpy. Reviewed by: kib Suggested by: emaste Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D57688 --- sys/amd64/amd64/uio_machdep.c | 34 ++------------------ sys/arm/arm/uio_machdep.c | 33 ++------------------ sys/arm64/arm64/uio_machdep.c | 36 ++-------------------- sys/i386/i386/uio_machdep.c | 33 ++------------------ sys/kern/subr_uio.c | 65 ++++++++++++++++++++++----------------- sys/powerpc/powerpc/uio_machdep.c | 33 ++------------------ sys/riscv/riscv/uio_machdep.c | 36 ++-------------------- sys/sys/uio.h | 1 + 8 files changed, 56 insertions(+), 215 deletions(-) diff --git a/sys/amd64/amd64/uio_machdep.c b/sys/amd64/amd64/uio_machdep.c index 11e6ad2b1da9..9fdfc898172b 100644 --- a/sys/amd64/amd64/uio_machdep.c +++ b/sys/amd64/amd64/uio_machdep.c @@ -96,38 +96,14 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) &ma[offset >> PAGE_SHIFT], &vaddr, 1, true); cp = (char *)vaddr + page_offset; } - switch (uio->uio_segflg) { - case UIO_USERSPACE: - maybe_yield(); - switch (uio->uio_rw) { - case UIO_READ: - error = copyout(cp, iov->iov_base, cnt); - break; - case UIO_WRITE: - error = copyin(iov->iov_base, cp, cnt); - break; - } - if (error) - goto out; - break; - case UIO_SYSSPACE: - switch (uio->uio_rw) { - case UIO_READ: - bcopy(cp, iov->iov_base, cnt); - break; - case UIO_WRITE: - bcopy(iov->iov_base, cp, cnt); - break; - } - break; - case UIO_NOCOPY: - break; - } + error = uiomove_step(cp, iov->iov_base, cnt, uio); if (__predict_false(mapped)) { pmap_unmap_io_transient(&ma[offset >> PAGE_SHIFT], &vaddr, 1, true); mapped = false; } + if (error != 0) + break; iov->iov_base = (char *)iov->iov_base + cnt; iov->iov_len -= cnt; uio->uio_resid -= cnt; @@ -135,10 +111,6 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) offset += cnt; n -= cnt; } -out: - if (__predict_false(mapped)) - pmap_unmap_io_transient(&ma[offset >> PAGE_SHIFT], &vaddr, 1, - true); if (save == 0) td->td_pflags &= ~TDP_DEADLKTREAT; return (error); diff --git a/sys/arm/arm/uio_machdep.c b/sys/arm/arm/uio_machdep.c index 6b8e4352e06f..7df6104b25fc 100644 --- a/sys/arm/arm/uio_machdep.c +++ b/sys/arm/arm/uio_machdep.c @@ -91,36 +91,10 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) cnt = min(cnt, PAGE_SIZE - page_offset); sf = sf_buf_alloc(ma[offset >> PAGE_SHIFT], 0); cp = (char*)sf_buf_kva(sf) + page_offset; - switch (uio->uio_segflg) { - case UIO_USERSPACE: - maybe_yield(); - switch (uio->uio_rw) { - case UIO_READ: - error = copyout(cp, iov->iov_base, cnt); - break; - case UIO_WRITE: - error = copyin(iov->iov_base, cp, cnt); - break; - } - if (error) { - sf_buf_free(sf); - goto out; - } - break; - case UIO_SYSSPACE: - switch (uio->uio_rw) { - case UIO_READ: - bcopy(cp, iov->iov_base, cnt); - break; - case UIO_WRITE: - bcopy(iov->iov_base, cp, cnt); - break; - } - break; - case UIO_NOCOPY: - break; - } + error = uiomove_step(cp, iov->iov_base, cnt, uio); sf_buf_free(sf); + if (error != 0) + break; iov->iov_base = (char *)iov->iov_base + cnt; iov->iov_len -= cnt; uio->uio_resid -= cnt; @@ -128,7 +102,6 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) offset += cnt; n -= cnt; } -out: if (save == 0) td->td_pflags &= ~TDP_DEADLKTREAT; return (error); diff --git a/sys/arm64/arm64/uio_machdep.c b/sys/arm64/arm64/uio_machdep.c index 976055a69491..77f596498c45 100644 --- a/sys/arm64/arm64/uio_machdep.c +++ b/sys/arm64/arm64/uio_machdep.c @@ -92,38 +92,14 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) &ma[offset >> PAGE_SHIFT], &vaddr, 1, true); cp = (char *)vaddr + page_offset; } - switch (uio->uio_segflg) { - case UIO_USERSPACE: - maybe_yield(); - switch (uio->uio_rw) { - case UIO_READ: - error = copyout(cp, iov->iov_base, cnt); - break; - case UIO_WRITE: - error = copyin(iov->iov_base, cp, cnt); - break; - } - if (error) - goto out; - break; - case UIO_SYSSPACE: - switch (uio->uio_rw) { - case UIO_READ: - bcopy(cp, iov->iov_base, cnt); - break; - case UIO_WRITE: - bcopy(iov->iov_base, cp, cnt); - break; - } - break; - case UIO_NOCOPY: - break; - } + error = uiomove_step(cp, iov->iov_base, cnt, uio); if (__predict_false(mapped)) { pmap_unmap_io_transient(&ma[offset >> PAGE_SHIFT], &vaddr, 1, true); mapped = false; } + if (error != 0) + break; iov->iov_base = (char *)iov->iov_base + cnt; iov->iov_len -= cnt; uio->uio_resid -= cnt; @@ -131,12 +107,6 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) offset += cnt; n -= cnt; } -out: - if (__predict_false(mapped)) { - panic("ARM64TODO: uiomove_fromphys"); - pmap_unmap_io_transient(&ma[offset >> PAGE_SHIFT], &vaddr, 1, - true); - } if (save == 0) td->td_pflags &= ~TDP_DEADLKTREAT; return (error); diff --git a/sys/i386/i386/uio_machdep.c b/sys/i386/i386/uio_machdep.c index b41460aef5b4..674de877d2a1 100644 --- a/sys/i386/i386/uio_machdep.c +++ b/sys/i386/i386/uio_machdep.c @@ -91,38 +91,11 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) sched_pin(); sf = sf_buf_alloc(ma[offset >> PAGE_SHIFT], SFB_CPUPRIVATE); cp = (char *)sf_buf_kva(sf) + page_offset; - switch (uio->uio_segflg) { - case UIO_USERSPACE: - maybe_yield(); - switch (uio->uio_rw) { - case UIO_READ: - error = copyout(cp, iov->iov_base, cnt); - break; - case UIO_WRITE: - error = copyin(iov->iov_base, cp, cnt); - break; - } - if (error) { - sf_buf_free(sf); - sched_unpin(); - goto out; - } - break; - case UIO_SYSSPACE: - switch (uio->uio_rw) { - case UIO_READ: - bcopy(cp, iov->iov_base, cnt); - break; - case UIO_WRITE: - bcopy(iov->iov_base, cp, cnt); - break; - } - break; - case UIO_NOCOPY: - break; - } + error = uiomove_step(cp, iov->iov_base, cnt, uio); sf_buf_free(sf); sched_unpin(); + if (error != 0) + break; iov->iov_base = (char *)iov->iov_base + cnt; iov->iov_len -= cnt; uio->uio_resid -= cnt; diff --git a/sys/kern/subr_uio.c b/sys/kern/subr_uio.c index fa5865fbe938..fea1395a7f77 100644 --- a/sys/kern/subr_uio.c +++ b/sys/kern/subr_uio.c @@ -200,6 +200,40 @@ uiomove_nofault(void *cp, int n, struct uio *uio) return (uiomove_faultflag(cp, n, uio, 1)); } +int +uiomove_step(void *cp, void *base, size_t len, struct uio *uio) +{ + int error = 0; + + switch (uio->uio_segflg) { + case UIO_USERSPACE: + maybe_yield(); + switch (uio->uio_rw) { + case UIO_READ: + error = copyout(cp, base, len); + break; + case UIO_WRITE: + error = copyin(base, cp, len); + break; + } + break; + case UIO_SYSSPACE: + switch (uio->uio_rw) { + case UIO_READ: + memcpy(base, cp, len); + break; + case UIO_WRITE: + memcpy(cp, base, len); + break; + } + break; + case UIO_NOCOPY: + break; + } + + return (error); +} + static int uiomove_faultflag(void *cp, int n, struct uio *uio, int nofault) { @@ -246,34 +280,9 @@ uiomove_faultflag(void *cp, int n, struct uio *uio, int nofault) if (cnt > n) cnt = n; - switch (uio->uio_segflg) { - case UIO_USERSPACE: - maybe_yield(); - switch (uio->uio_rw) { - case UIO_READ: - error = copyout(cp, iov->iov_base, cnt); - break; - case UIO_WRITE: - error = copyin(iov->iov_base, cp, cnt); - break; - } - if (error) - goto out; - break; - - case UIO_SYSSPACE: - switch (uio->uio_rw) { - case UIO_READ: - bcopy(cp, iov->iov_base, cnt); - break; - case UIO_WRITE: - bcopy(iov->iov_base, cp, cnt); - break; - } - break; - case UIO_NOCOPY: - break; - } + error = uiomove_step(cp, iov->iov_base, cnt, uio); + if (error != 0) + goto out; iov->iov_base = (char *)iov->iov_base + cnt; iov->iov_len -= cnt; uio->uio_resid -= cnt; diff --git a/sys/powerpc/powerpc/uio_machdep.c b/sys/powerpc/powerpc/uio_machdep.c index 63911963279a..05d06a95f544 100644 --- a/sys/powerpc/powerpc/uio_machdep.c +++ b/sys/powerpc/powerpc/uio_machdep.c @@ -97,36 +97,10 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) sf = sf_buf_alloc(m, 0); cp = (char*)sf_buf_kva(sf) + page_offset; - switch (uio->uio_segflg) { - case UIO_USERSPACE: - maybe_yield(); - switch (uio->uio_rw) { - case UIO_READ: - error = copyout(cp, iov->iov_base, cnt); - break; - case UIO_WRITE: - error = copyin(iov->iov_base, cp, cnt); - break; - } - if (error) { - sf_buf_free(sf); - goto out; - } - break; - case UIO_SYSSPACE: - switch (uio->uio_rw) { - case UIO_READ: - bcopy(cp, iov->iov_base, cnt); - break; - case UIO_WRITE: - bcopy(iov->iov_base, cp, cnt); - break; - } - break; - case UIO_NOCOPY: - break; - } + error = uiomove_step(cp, iov->iov_base, cnt, uio); sf_buf_free(sf); + if (error != 0) + break; iov->iov_base = (char *)iov->iov_base + cnt; iov->iov_len -= cnt; uio->uio_resid -= cnt; @@ -134,7 +108,6 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) offset += cnt; n -= cnt; } -out: if (save == 0) td->td_pflags &= ~TDP_DEADLKTREAT; return (error); diff --git a/sys/riscv/riscv/uio_machdep.c b/sys/riscv/riscv/uio_machdep.c index f171feb1a4bd..77f596498c45 100644 --- a/sys/riscv/riscv/uio_machdep.c +++ b/sys/riscv/riscv/uio_machdep.c @@ -92,38 +92,14 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) &ma[offset >> PAGE_SHIFT], &vaddr, 1, true); cp = (char *)vaddr + page_offset; } - switch (uio->uio_segflg) { - case UIO_USERSPACE: - maybe_yield(); - switch (uio->uio_rw) { - case UIO_READ: - error = copyout(cp, iov->iov_base, cnt); - break; - case UIO_WRITE: - error = copyin(iov->iov_base, cp, cnt); - break; - } - if (error) - goto out; - break; - case UIO_SYSSPACE: - switch (uio->uio_rw) { - case UIO_READ: - bcopy(cp, iov->iov_base, cnt); - break; - case UIO_WRITE: - bcopy(iov->iov_base, cp, cnt); - break; - } - break; - case UIO_NOCOPY: - break; - } + error = uiomove_step(cp, iov->iov_base, cnt, uio); if (__predict_false(mapped)) { pmap_unmap_io_transient(&ma[offset >> PAGE_SHIFT], &vaddr, 1, true); mapped = false; } + if (error != 0) + break; iov->iov_base = (char *)iov->iov_base + cnt; iov->iov_len -= cnt; uio->uio_resid -= cnt; @@ -131,12 +107,6 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) offset += cnt; n -= cnt; } -out: - if (__predict_false(mapped)) { - panic("TODO 3"); - pmap_unmap_io_transient(&ma[offset >> PAGE_SHIFT], &vaddr, 1, - true); - } if (save == 0) td->td_pflags &= ~TDP_DEADLKTREAT; return (error); diff --git a/sys/sys/uio.h b/sys/sys/uio.h index 58bb7b13b253..217f65365cb0 100644 --- a/sys/sys/uio.h +++ b/sys/sys/uio.h @@ -98,6 +98,7 @@ int uiomove_fromphys(struct vm_page *ma[], vm_offset_t offset, int n, struct uio *uio); int uiomove_nofault(void *cp, int n, struct uio *uio); int uiomove_object(struct vm_object *obj, off_t obj_size, struct uio *uio); +int uiomove_step(void *cp, void *base, size_t cnt, struct uio *uio); #else /* !_KERNEL */ From nobody Sun Jun 21 16:14:38 2026 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 4gjxHM0W4sz6hH5g for ; Sun, 21 Jun 2026 16:14: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjxHL6hYkz49TV for ; Sun, 21 Jun 2026 16:14:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782058479; 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=ccJy8fdCRMSMjEsBWtIfSGSyGCSFfqQUMU4/SgzftgQ=; b=WZ+rs4eOzJjC+rIzvZbZYMrtmx/H+HlnKlqTCmNr23JfQUTXOk7q7T4jmwL+17CA7m+MJV jC/4ihsGQenPhmRNFH+WXy2DqI4hzASNvc4SfVaM/JEuXl+Gqgl//+Mu34JRlpIz38licR W7bbl7Oy/+v5Ht1UhkytYIQ0m0jKZwTR7eBghpph9m5InsRoF5jm6Z18gXAgOKOc7V2cPX PXSY8eOI1xM5kBkeTGDKFmiq8An19erjyeIG4pjEloVwRsP3tFseXTKZ1U13GHHQOIlsJz S7mhZD6gDWD69MEA1CPFUd/UXd+SQfJDV45MmB486Nrb9q07tiCjsPq7zznwNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782058479; a=rsa-sha256; cv=none; b=pWBMAAUMz5RgT2e2tYCNOsHxM0R/fBxptoHdi8xMIDhSv9qXHB5NHVeVCDlc/BmpeSGdpV oBUnR51Xf1cb7ILZOGU4DoM28zGseqEosya9CINSCfLXXgFuKbC5ic4XMv0h7zlee//7st +saNGCiQMXkB/58IgAfmN64tyyvSImYVSfyQRsT/Xa3J4w4TFIp4YHBqHGYfPvGuInkAEg RECzoVmvXqOL3MyWDJypATfCEzawVONZ0+1OpKVKLVleSZLenkSgTtQdu2b/zRfHbKADn8 y8WRxd3/3HySNxbasBiYWMkI9EX3O1nuhmae4qD/YeUQTAQ1f9BR2g2QI+SsVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782058479; 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=ccJy8fdCRMSMjEsBWtIfSGSyGCSFfqQUMU4/SgzftgQ=; b=OpEmSGxo3FpPbUz+h0cgMq7JOjLiNQncreaeFgR4eJdWz+/60idFetNsxrSvNMoRXF4BGX EgeGT1i/KHg33GTHAn5TYtIMfVTUx0/RCsEGRIrxqimHqmBVRRdMI3jalWU8akNpqVChFB Fcd4bXkZbWMF2Yo0V8lCU6GxeMHkq6fqOUWGoQN2AZi9tzz6foVERftbsvJE21925CexRX Enz+U+1Xq3xusQAciLQNRK/tM2dRw5+KL7FC/pBbXifM4J2qnH+ZHXTZE531dquko11W/T HIcYO8opwQ75eK1yIPs8DPIia0z1eOWzcmWq7S/O4Us+/DDagm8NKNUnZweRdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjxHL5X6Wz1Mpg for ; Sun, 21 Jun 2026 16:14:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 18a6f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 16:14:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 2ee2ef607f60 - main - pmap: prefer memcpy over bcopy 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 2ee2ef607f6087757efd62b814cbf2400ef58ef2 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 16:14:38 +0000 Message-Id: <6a380dee.18a6f.3dabc4ef@gitrepo.freebsd.org> The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=2ee2ef607f6087757efd62b814cbf2400ef58ef2 commit 2ee2ef607f6087757efd62b814cbf2400ef58ef2 Author: Brooks Davis AuthorDate: 2026-06-21 15:47:23 +0000 Commit: Brooks Davis CommitDate: 2026-06-21 16:08:12 +0000 pmap: prefer memcpy over bcopy Alter pmap_copy_page(s) to use memcpy rather than the deprecated bcopy. We'll be adding non-provenance preserving versions for CHERI support and would like to avoid introducing variants of deprecated APIs just to maintain symmetry. Reviewed by: kib Suggested by: emaste Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D57687 --- sys/amd64/amd64/pmap.c | 2 +- sys/arm/arm/pmap-v6.c | 10 +++++----- sys/arm64/arm64/pmap.c | 4 ++-- sys/riscv/riscv/pmap.c | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 691fac8c89b4..b37700a53aec 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -8317,7 +8317,7 @@ pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[], mapped = pmap_map_io_transient(pages, vaddr, 2, false); a_cp = (char *)vaddr[0] + a_pg_offset; b_cp = (char *)vaddr[1] + b_pg_offset; - bcopy(a_cp, b_cp, cnt); + memcpy(b_cp, a_cp, cnt); if (__predict_false(mapped)) pmap_unmap_io_transient(pages, vaddr, 2, false); a_offset += cnt; diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c index 2b0ebebefaec..5fcfc663e292 100644 --- a/sys/arm/arm/pmap-v6.c +++ b/sys/arm/arm/pmap-v6.c @@ -2194,7 +2194,7 @@ pte1_copy_nosync(pt1_entry_t *spte1p, pt1_entry_t *dpte1p, vm_offset_t sva, idx = pte1_index(sva); count = (pte1_index(eva) - idx + 1) * sizeof(pt1_entry_t); - bcopy(spte1p + idx, dpte1p + idx, count); + memcpy(dpte1p + idx, spte1p + idx, count); } static __inline void @@ -2205,7 +2205,7 @@ pt2tab_copy_nosync(pt2_entry_t *spte2p, pt2_entry_t *dpte2p, vm_offset_t sva, idx = pt2tab_index(sva); count = (pt2tab_index(eva) - idx + 1) * sizeof(pt2_entry_t); - bcopy(spte2p + idx, dpte2p + idx, count); + memcpy(dpte2p + idx, spte2p + idx, count); } /* @@ -5926,7 +5926,7 @@ pmap_zero_page_area(vm_page_t m, int off, int size) /* * pmap_copy_page copies the specified (machine independent) * page by mapping the page into virtual memory and using - * bcopy to copy the page, one machine dependent page at a + * memcpy to copy the page, one machine dependent page at a * time. */ void @@ -5948,7 +5948,7 @@ pmap_copy_page(vm_page_t src, vm_page_t dst) PTE2_AP_KR | PTE2_NM, vm_page_pte2_attr(src))); pte2_store(cmap2_pte2p, PTE2_KERN_NG(VM_PAGE_TO_PHYS(dst), PTE2_AP_KRW, vm_page_pte2_attr(dst))); - bcopy(pc->pc_cmap1_addr, pc->pc_cmap2_addr, PAGE_SIZE); + memcpy(pc->pc_cmap2_addr, pc->pc_cmap1_addr, PAGE_SIZE); pte2_clear(cmap1_pte2p); tlb_flush((vm_offset_t)pc->pc_cmap1_addr); pte2_clear(cmap2_pte2p); @@ -5994,7 +5994,7 @@ pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[], tlb_flush_local((vm_offset_t)pc->pc_cmap2_addr); a_cp = pc->pc_cmap1_addr + a_pg_offset; b_cp = pc->pc_cmap2_addr + b_pg_offset; - bcopy(a_cp, b_cp, cnt); + memcpy(b_cp, a_cp, cnt); a_offset += cnt; b_offset += cnt; xfersize -= cnt; diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 2eabdef6d27c..2ef639965deb 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -6988,7 +6988,7 @@ pmap_zero_page_area(vm_page_t m, int off, int size) /* * pmap_copy_page copies the specified (machine independent) * page by mapping the page into virtual memory and using - * bcopy to copy the page, one machine dependent page at a + * memcpy to copy the page, one machine dependent page at a * time. */ void @@ -7043,7 +7043,7 @@ pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[], } else { b_cp = (char *)PHYS_TO_DMAP(p_b) + b_pg_offset; } - bcopy(a_cp, b_cp, cnt); + memcpy(b_cp, a_cp, cnt); a_offset += cnt; b_offset += cnt; xfersize -= cnt; diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 1f3fd8c24b81..0461400f2a7c 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -4055,7 +4055,7 @@ pmap_zero_page_area(vm_page_t m, int off, int size) /* * pmap_copy_page copies the specified (machine independent) * page by mapping the page into virtual memory and using - * bcopy to copy the page, one machine dependent page at a + * memcpy to copy the page, one machine dependent page at a * time. */ void @@ -4098,7 +4098,7 @@ pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[], } else { b_cp = (char *)PHYS_TO_DMAP(p_b) + b_pg_offset; } - bcopy(a_cp, b_cp, cnt); + memcpy(b_cp, a_cp, cnt); a_offset += cnt; b_offset += cnt; xfersize -= cnt; From nobody Sun Jun 21 16:14:40 2026 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 4gjxHP5l4Rz6hH8J for ; Sun, 21 Jun 2026 16:14:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjxHP1MVbz49MJ for ; Sun, 21 Jun 2026 16:14:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782058481; 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=uj9y2wsGlK5QXmCawCVO9RAO3h8g69GLQv5kflrIOAg=; b=VYvCOehQocIkkD+ONywH8BJ1NAoB0nUWg4q525IdGgXRR2KQScoqHdWeW2Rykc/Ffaw4mo CEz4gu9Bgkq7V3ee7tXI8o+CjNJ88ZAdw+sBCh7jEdlRzMRoGVctQDFtO2W88UX5cFyFSE E9RxxonocbdOxkD2VfUqKJEpA94/2McaZw8UZA3dNDT6V4QBAMgIsgBDflR8cvIzDZB7pX bMkmi+Q6Zcfcbr4Q1hDyNviLhkXNlQ/aVb7IdF8ceKc5vjsI3AsaBP1yT+jbNdGhL5Fqj4 JRIPky/SvxdsfMhja560jwBUwHRTkVgKfn1jbrYMg4/2EbpamEC/4nSkO7zLqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782058481; a=rsa-sha256; cv=none; b=h5SE1enLcdhKjboXwecCRAHBtN5PWXSfmcLUyuNhQ+StSiepTqMZGoj1MirIBsAHG+JUhv 657J8RgIKG91yITa/K3mY5TSXrsj1Yo8KlRyZT5BrlIwxs5PwRPrOEbWM5tBjLPvYAVhCq xrIqRtNyQXHOQGEL6WxD1w0hZi5neYlq3mgvKO2GUzF6msqiKwCnrD5gxD/zpsehtIrg5s 1OkSlLBwCqg5TapLbgzHPm/k9xfPEnq5j1sIEFLMkrckcn/YcCsjrwNi5gj2Pb3advVBNT qzUP2Bs0OUb9gazYBAnrrXz2KvHZRWM4EkHVZlASobCtCKr3Cnbu01uFkqR+8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782058481; 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=uj9y2wsGlK5QXmCawCVO9RAO3h8g69GLQv5kflrIOAg=; b=lJ07DIqENNVAfLsJjFSA81V8o9SvwBxTqBOcnno39+P9D412ycTRFiryWrM7Zm/EFzzS9W 1wGqvr+mvuVJc8ddrHwmWVu0DYqqCxSqtLjbfd/NkncFHjEi2zHouUQmIM9QUroyWMW+H2 IF1YOCWXgMvcDWFTpFI8YMY7fRNqYpDggj9x5mfGLb933lpurrjtKzROcVCVWhEv+odnKc bEktvYp6gpNqN9tpVQ9CfmegYrKcCrO2vd8s4VGtP2MTKmt4rBMfkEbQ8OeTekQQ0yxys2 SkIMTmSU+outXohiknJ9sxlpfmQAhu5eSx9OTAVrQcn8St7nBVQGARRP/I93Rw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjxHN746cz1MRv for ; Sun, 21 Jun 2026 16:14:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 18e2a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 16:14:40 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 8b47939b9522 - main - uipc_socket: prefer memcpy to bcopy 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 8b47939b952248e68c3ee64b8577c636bc90ca53 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 16:14:40 +0000 Message-Id: <6a380df0.18e2a.156ad40c@gitrepo.freebsd.org> The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=8b47939b952248e68c3ee64b8577c636bc90ca53 commit 8b47939b952248e68c3ee64b8577c636bc90ca53 Author: Brooks Davis AuthorDate: 2026-06-21 15:48:33 +0000 Commit: Brooks Davis CommitDate: 2026-06-21 16:13:31 +0000 uipc_socket: prefer memcpy to bcopy Reviewed by: kib, emaste Suggested by: emaste Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D57689 --- sys/kern/uipc_socket.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 82a8ce8feb8c..47de87c1887c 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -3827,7 +3827,7 @@ sooptcopyin(struct sockopt *sopt, void *buf, size_t len, size_t minlen) if (sopt->sopt_td != NULL) return (copyin(sopt->sopt_val, buf, valsize)); - bcopy(sopt->sopt_val, buf, valsize); + memcpy(buf, sopt->sopt_val, valsize); return (0); } @@ -4118,7 +4118,7 @@ sooptcopyout(struct sockopt *sopt, const void *buf, size_t len) if (sopt->sopt_td != NULL) error = copyout(buf, sopt->sopt_val, valsize); else - bcopy(buf, sopt->sopt_val, valsize); + memcpy(sopt->sopt_val, buf, valsize); } return (error); } @@ -4429,7 +4429,7 @@ soopt_mcopyin(struct sockopt *sopt, struct mbuf *m) return(error); } } else - bcopy(sopt->sopt_val, mtod(m, char *), m->m_len); + memcpy(mtod(m, char *), sopt->sopt_val, m->m_len); sopt->sopt_valsize -= m->m_len; sopt->sopt_val = (char *)sopt->sopt_val + m->m_len; m = m->m_next; @@ -4458,7 +4458,7 @@ soopt_mcopyout(struct sockopt *sopt, struct mbuf *m) return(error); } } else - bcopy(mtod(m, char *), sopt->sopt_val, m->m_len); + memcpy(sopt->sopt_val, mtod(m, char *), m->m_len); sopt->sopt_valsize -= m->m_len; sopt->sopt_val = (char *)sopt->sopt_val + m->m_len; valsize += m->m_len; @@ -4929,7 +4929,7 @@ sodupsockaddr(const struct sockaddr *sa, int mflags) sa2 = malloc(sa->sa_len, M_SONAME, mflags); if (sa2) - bcopy(sa, sa2, sa->sa_len); + memcpy(sa2, sa, sa->sa_len); return sa2; } From nobody Sun Jun 21 16:50:02 2026 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 4gjy4B271rz6hLC4 for ; Sun, 21 Jun 2026 16:50:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjy4B1Prcz3JZC for ; Sun, 21 Jun 2026 16:50:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782060602; 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=79kHFsfRT10fNhUfz3UM+C592Mw9LZclgH8+dSBtE4o=; b=MjNHgucVsOkihkdQgCS8ZnegM/7HCIlJ6BQgYK7eIgfKAAbnsHrhKqeDdmNnL9PD7lvFmE /8Z/oMc5eVNnr2716GIif8g0tdizQAYR38qMC+UfDUkvNrsDKU8JSmPP6icpV/FFuN2Tlm T0CEjwVexILrmPXjUFjIJIBM53o012guNXchI+WCJ6c2lD5rkP2kLCXmVaciVfYqWc97jI EsPLndqlGjuZjAryNObWrsQj1be5YkC66RgamtFM2h5bW5jOVyVq+8LLPqfebxcBVcBBvN w4cRICxiD4T1d8bbVjy/9CBj3iXZz19vbOJKiQQKsflUoAKyr/wJynGfEbX09g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782060602; a=rsa-sha256; cv=none; b=fg3H/Z/nFF5y2MQur6KYwvnUTHHRx0ZW9yVrJ/8D1aUh+2uHmqpRhSW5InRsZbLmyeVSp2 6ZMeJL8/MIrdwxRSnnlhv5EX6dRuuLbvtUxOPDrI0CX2pDEr2xm5aonq1rHzWZPw2B/j7V wD/HwDqwVj2ECiP9BpzYYUDzFYvx6LWKBso2B99NsSiO8MsIrPbblcnn7VWqRME76Sa9as 4uTC6pGdiFkRrDaInQgdTW+DPwllepqIOZOGGvX9XZVyMBILT2x1JFwrbHxqj2RjzncDAI cs19gEYMjy1wphdBiQpuL6kPUCvyfWHKkRqTaGXctBMg4LX8rB5GAM3Z9YkZbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782060602; 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=79kHFsfRT10fNhUfz3UM+C592Mw9LZclgH8+dSBtE4o=; b=gHIGqvzSGOsHEBqHogrv3kL92Mhja+xls0SHJRUcTQPbHh3IOUxrsLUua/7dph9vH18odr LY4g4YKm+A1evI4ZP9VxXCvmdapMq0BkGgx7bolkYrmHoYuROwObAbjNEpc96qHez8V+j1 ohTVLwMl2il+vmJie1+O8gMbnDopfRnjfloSQHwO1mKvoMbRby01NUYaLH2Q2mQqdY6Hrh wNxFs0MXJWtrsH6cxe4WCbHYE3/K12N343THUcKRPZXxDSje2JmTQchOPyNjouc5QOpauX JgDccvOol7HqlzCM4AT94RZyUrNjgh/JkIKljGhRgdoNFp96s066nosWi7A4nA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjy4B0NxXz1Nwt for ; Sun, 21 Jun 2026 16:50:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1c25b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 16:50:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 015b890e28b8 - main - mem*.3: stop refering to strings 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: 015b890e28b87f182212230de35c9b061ff71258 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 16:50:02 +0000 Message-Id: <6a38163a.1c25b.3b655320@gitrepo.freebsd.org> The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=015b890e28b87f182212230de35c9b061ff71258 commit 015b890e28b87f182212230de35c9b061ff71258 Author: Brooks Davis AuthorDate: 2026-06-21 16:43:48 +0000 Commit: Brooks Davis CommitDate: 2026-06-21 16:48:49 +0000 mem*.3: stop refering to strings POSIX and the C standard now refer to objects and sequences rather than confusingly revering to strings. Also update bcopy(3) and bzero(3). Reviewed by: emaste Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D57680 --- lib/libc/string/bcopy.3 | 10 +++++----- lib/libc/string/bzero.3 | 6 +++--- lib/libc/string/memccpy.3 | 12 ++++++------ lib/libc/string/memcpy.3 | 8 ++++---- lib/libc/string/memmem.3 | 8 ++++---- lib/libc/string/memmove.3 | 10 +++++----- lib/libc/string/memset.3 | 6 +++--- 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/lib/libc/string/bcopy.3 b/lib/libc/string/bcopy.3 index 230ca2eea89a..48c21fbdde06 100644 --- a/lib/libc/string/bcopy.3 +++ b/lib/libc/string/bcopy.3 @@ -28,12 +28,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 24, 2015 +.Dd June 21, 2026 .Dt BCOPY 3 .Os .Sh NAME .Nm bcopy -.Nd copy byte string +.Nd copy bytes in memory .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -46,11 +46,11 @@ The function copies .Fa len -bytes from string +bytes from object .Fa src -to string +to object .Fa dst . -The two strings may overlap. +The two objects may overlap. If .Fa len is zero, no bytes are copied. diff --git a/lib/libc/string/bzero.3 b/lib/libc/string/bzero.3 index 2c791c497d8c..054031660a0d 100644 --- a/lib/libc/string/bzero.3 +++ b/lib/libc/string/bzero.3 @@ -28,13 +28,13 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 24, 2015 +.Dd June 21, 2026 .Dt BZERO 3 .Os .Sh NAME .Nm bzero , .Nm explicit_bzero -.Nd write zeroes to a byte string +.Nd write zeroes to memory .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -49,7 +49,7 @@ The function writes .Fa len -zero bytes to the string +zero bytes to the object .Fa b . If .Fa len diff --git a/lib/libc/string/memccpy.3 b/lib/libc/string/memccpy.3 index 0d35a68fce67..5a4305afb743 100644 --- a/lib/libc/string/memccpy.3 +++ b/lib/libc/string/memccpy.3 @@ -25,12 +25,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 5, 2023 +.Dd June 21, 2026 .Dt MEMCCPY 3 .Os .Sh NAME .Nm memccpy -.Nd copy string until character found +.Nd copy bytes until character found .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -46,19 +46,19 @@ The .Fn memccpy function -copies bytes from string +copies bytes from object .Fa src -to string +to object .Fa dst . If the character .Fa c (as converted to an .Vt "unsigned char" ) -occurs in the string +occurs in the object .Fa src , the copy stops and a pointer to the byte after the copy of .Fa c -in the string +in the object .Fa dst is returned. Otherwise, diff --git a/lib/libc/string/memcpy.3 b/lib/libc/string/memcpy.3 index c1cf93af1cdc..5dfa18b9e67f 100644 --- a/lib/libc/string/memcpy.3 +++ b/lib/libc/string/memcpy.3 @@ -29,12 +29,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 18, 2023 +.Dd June 21, 2026 .Dt MEMCPY 3 .Os .Sh NAME .Nm memcpy -.Nd copy byte string +.Nd copy bytes in memory .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -51,9 +51,9 @@ and functions copy .Fa len -bytes from string +bytes from object .Fa src -to string +to object .Fa dst . If .Fa src diff --git a/lib/libc/string/memmem.3 b/lib/libc/string/memmem.3 index e301a0bd1e0f..8e8aa6dafa99 100644 --- a/lib/libc/string/memmem.3 +++ b/lib/libc/string/memmem.3 @@ -24,12 +24,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 29, 2023 +.Dd June 21, 2026 .Dt MEMMEM 3 .Os .Sh NAME .Nm memmem -.Nd "locate a byte substring in a byte string" +.Nd "locate a byte subsequence in a byte sequence" .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -43,9 +43,9 @@ The .Fn memmem function -locates the first occurrence of the byte string +locates the first occurrence of the byte sequence .Fa little -in the byte string +in the byte sequence .Fa big . .Sh RETURN VALUES If diff --git a/lib/libc/string/memmove.3 b/lib/libc/string/memmove.3 index 4fd190610388..b92b611b9ff5 100644 --- a/lib/libc/string/memmove.3 +++ b/lib/libc/string/memmove.3 @@ -29,12 +29,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 4, 1993 +.Dd June 21, 2026 .Dt MEMMOVE 3 .Os .Sh NAME .Nm memmove -.Nd copy byte string +.Nd copy bytes in memory .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -47,11 +47,11 @@ The function copies .Fa len -bytes from string +bytes from object .Fa src -to string +to object .Fa dst . -The two strings may overlap; +The two objects may overlap; the copy is always done in a non-destructive manner. .Sh RETURN VALUES The diff --git a/lib/libc/string/memset.3 b/lib/libc/string/memset.3 index f6ab9dacb516..b9e09169cc38 100644 --- a/lib/libc/string/memset.3 +++ b/lib/libc/string/memset.3 @@ -29,12 +29,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 24, 2024 +.Dd June 21, 2026 .Dt MEMSET 3 .Os .Sh NAME .Nm memset -.Nd write a byte to byte string +.Nd set bytes in memory .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -56,7 +56,7 @@ bytes of value .Fa c (converted to an .Vt "unsigned char" ) -to the string +to the object .Fa dest . Undefined behaviour from .Fn memset , From nobody Sun Jun 21 17:46:59 2026 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 4gjzL95Blwz6hRDf for ; Sun, 21 Jun 2026 17:47:13 +0000 (UTC) (envelope-from eduardo@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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjzL90TY5z3PHc for ; Sun, 21 Jun 2026 17:47:13 +0000 (UTC) (envelope-from eduardo@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782064033; 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=DAOThxMseHjtrfRE7ZccdTepQRpUs9LJPt3d0VtfsYA=; b=obvnWkBrefU5sRNnGf+4haaMyxthtM45t2FIbuM5lgajx0jZiLWT/rwVPnI73Ka3ejT4tI md1M8oZpEoKD9cA5JE/T+uaPb3zAEvbh+uRat4k9u3Kv/+6GDjDFu22RjTkYAxKmg6O4Mi hiI6+G6IsoG1O6pEwu7sf6346Blig0uQ/ZhsjQ/HxhMf9cn5IYXQhDiFhkpYaJ7RjVO7jh swf8MVTRs9DwDaYUQv8HpH0opN+3h7s9cax0Y25DhSqNVr0HxyQOGkE1eXzEJ7v/PKcGOY DshzCmnO38yI4jRkvCtnajPDG31AcSDjIBVPubSMEk81uF1UoktW5j+DwRf1pA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782064033; a=rsa-sha256; cv=none; b=NjaBQKSYpMyRGguvNedMxEw1ZXjSG1xBeQdaaJpc+x1nxxyjrbQ4xu/Reozf2pOCoGEa1U kvd3trY1B4REljfFNxf1iKrZopmUNJUo3nuqtPmk1aSKpCKayooNGpcaKk68cAhR6Y8Nev Z5mFXwJz4ukDy2W+o7/vcDgEQPhdB206MKugD1IcexB+3VeycgqBkLEL9L+gj29ENlixKr tOWm7SSjnDRbzbJdnD9HcXA7wQtI+e7q4F9snf6YYn9+NVmdNNXPJY+SHL2KlIrJffGKbU PL3evRz5TnaJb2HPikr8T0fsHhz7ogBWDtjea/AM58EJseasvrjSMCs9q2dVYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782064033; 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=DAOThxMseHjtrfRE7ZccdTepQRpUs9LJPt3d0VtfsYA=; b=Fn5Mgb9Zb3QU3pvJYaHMc1l37g25KKZE8a6d7XqjrriUemPT2UZyXN17ld464Q1cgBalb6 c+EGdkkvoHBmuUGUpdwUlbtpDXbSxh1PegpSnFuB7XfqwiSG+s9LIPDXWcusIRVPmuxCo5 GAwdWJXCchTlegFbR6v8UJo2bhseI+c8IyLGqcNk0UJeC2bf5pmhR5jEuH3AoCS8lfERBr s5GsRABYeoFukG2sS0Xi7vpPqyrAlojQEKnLpqAkC8CIqS68nQE4wjASrNtZ4i6F0Dc5M9 +lOop6Ss14t/z9CAT6MIvtCSo586PW5FeLhlYFUyujiN7LRXwnVuv5KsTzeVVw== Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (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)) (Authenticated sender: eduardo) by smtp.freebsd.org (Postfix) with ESMTPSA id 4gjzL85cmYz12yv for ; Sun, 21 Jun 2026 17:47:12 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-3967701fc3cso7057001fa.0 for ; Sun, 21 Jun 2026 10:47:12 -0700 (PDT) X-Forwarded-Encrypted: i=1; AFNElJ/r0gLXZm6/476WFXtZMR3X/Ge7Y7wyFeso+n5UgC1jzBVIEFU0U1UMZbw59yPEZvx5K8TNzJgD9vh1zh9y/Y0bsoPwLw==@freebsd.org X-Gm-Message-State: AOJu0YznnfF+yH5vCOsAeh+68CcOyI4QyFBeQOkNzDLjAn1EcgegufLA jw7KZ7uDkxIvY3z7bRObigNSUwQzJ/O2pPAT6vE437kFfqolz2Z8JoWSbOUZdipcC8eodw0Lakv DQEqp8bUWfgD6mPyP1yST17TSW/tCfU0= X-Received: by 2002:a05:6512:3e1f:b0:5ad:491b:facd with SMTP id 2adb3069b0e04-5ad562e2105mr1544478e87.3.1782064031044; Sun, 21 Jun 2026 10:47:11 -0700 (PDT) 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 References: <6a35ddd3.22963.721d614@gitrepo.freebsd.org> In-Reply-To: From: Nuno Teixeira Date: Sun, 21 Jun 2026 18:46:59 +0100 X-Gmail-Original-Message-ID: X-Gm-Features: AVVi8Cc4RdN3pvjC_98LX37QqjnOBnYSIg3dJjd-UENPr6qQMSYNq8BhcE4Od4g Message-ID: Subject: Re: git: 28cecfe27964 - main - libc: Restrict ATOMIC_VAR_INIT for C23 conformance To: Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Faraz Vahedi Content-Type: multipart/alternative; boundary="0000000000008998e30654c71d0d" --0000000000008998e30654c71d0d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable (...) and I forgot: audio/cmus: ... checking for program cc... /usr/bin/cc checking for C11 (with atomics support)... no configure failed. =3D=3D=3D> Script "configure" failed unexpectedly. Please report the problem to eduardo@FreeBSD.org [maintainer] and attach th= e "/wrkdirs/usr/ports/audio/cmus/work/cmus-2.12.0/config.log" including the output of the failure of your make command. Also, it might be a good idea t= o provide an overview of all packages installed on your system (e.g. a /usr/local/sbin/pkg-static info -g -Ea). *** Error code 1 ... https://pkg-status.freebsd.org/beefy24/data/main-amd64-default/p0cd7b5a3f54= a_sa4ed783cee2/logs/cmus-2.12.0_3.log https://pkg-status.freebsd.org/beefy24/data/main-amd64-default/p0cd7b5a3f54= a_sa4ed783cee2/logs/qt6-base-6.11.1.log Any clues how to unbreak on ports side? Thanks, Nuno Teixeira escreveu (domingo, 21/06/2026 =C3=A0(s) 11:35): > Hello, > > (poudriere-devel build at main-n286792-eafa181d51f7: Sat Jun 20) > > I've found that ports-mgmt/portfmt started failing with: > ... > FAILED: [code=3D1] > /wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/_build/portscan/= status.o > cc -std=3Dgnu11 -O2 -g -W -Wall -Wextra -Wmissing-prototypes > -Wstrict-prototypes -Wwrite-strings -Wno-unused-parameter -flto=3Dthin -O= 2 > -pipe -fstack-protector-strong -fno-strict-aliasing > -Wno-strict-prototypes -DPORTFMT_SUBPACKAGES=3D0 -MD -MF > /wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/_build/portscan/= status.o.d > -I/wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/_build > -I/wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6 -c -o > /wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/_build/portscan/= status.o > /wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/portscan/status.= c > /wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/portscan/status.= c:59:38: > warning: call to undeclared function 'ATOMIC_VAR_INIT'; ISO C99 and later > do not support implicit function declarations > [-Wimplicit-function-declaration] > 59 | static atomic_int status_requested =3D ATOMIC_VAR_INIT(0); > | ^ > /wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/portscan/status.= c:59:38: > error: initializer element is not a compile-time constant > 59 | static atomic_int status_requested =3D ATOMIC_VAR_INIT(0); > | ^~~~~~~~~~~~~~~~~~ > /wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/portscan/status.= c:60:32: > error: initializer element is not a compile-time constant > 60 | static atomic_size_t scanned =3D ATOMIC_VAR_INIT(0); > | ^~~~~~~~~~~~~~~~~~ > 1 warning and 2 errors generated. > ... > > Same for devel/qt6-base: > > ... > FAILED: [code=3D1] src/corelib/CMakeFiles/Core.dir/io/forkfd_qt.c.o > /usr/bin/cc -DBACKTRACE_HEADER=3D\"execinfo.h\" -DCore_EXPORTS > -DQT_ASCII_CAST_WARNINGS -DQT_BUILDING_QT -DQT_BUILD_CORE_LIB > -DQT_DEPRECATED_WARNINGS -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH > -DQT_LEAN_HEADERS=3D1 - > DQT_MOC_COMPAT -DQT_NO_CAST_TO_ASCII -DQT_NO_CONTEXTLESS_CONNECT > -DQT_NO_DEBUG -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS > -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_QASCONST -DQT_NO_QEXCHAN= GE > -DQT_NO_QPAI > R -DQT_NO_QSNPRINTF -DQT_NO_SINGLE_ARGUMENT_QHASH_OVERLOAD=3D1 > -DQT_NO_STD_FORMAT_SUPPORT -DQT_NO_USING_NAMESPACE -DQT_TYPESAFE_FLAGS > -DQT_USE_NODISCARD_FILE_OPEN -DQT_USE_QSTRINGBUILDER -D_LARGEFILE64_SOURC= E > -D_LA > RGEFILE_SOURCE -D_LIBCPP_HARDENING_MODE=3D_LIBCPP_HARDENING_MODE_FAST > -I/wrkdirs/usr/ports/devel/qt6-base/work/.build/src/corelib/Core_autogen/= include > -I/wrkdirs/usr/ports/devel/qt6-base/work/.build/include -I/wrkd > irs/usr/ports/devel/qt6-base/work/.build/include/QtCore > -I/wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src= /corelib > -I/wrkdirs/usr/ports/devel/qt6-base/work/.build/src/corelib -I/wrkdirs/us= r > /ports/devel/qt6-base/work/.build/src/corelib/global > -I/wrkdirs/usr/ports/devel/qt6-base/work/.build/src/corelib/kernel > -I/wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src= /corelib/../3rdpart > y/tinycbor/src > -I/wrkdirs/usr/ports/devel/qt6-base/work/.build/include/QtCore/6.11.1 > -I/wrkdirs/usr/ports/devel/qt6-base/work/.build/include/QtCore/6.11.1/QtC= ore > -I/wrkdirs/usr/ports/devel/qt6-base/work/qtbase-ev > erywhere-src-6.11.1/src/corelib/../3rdparty/forkfd > -I/wrkdirs/usr/ports/devel/qt6-base/work/.build/src/corelib/.rcc > -I/wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/mks= pecs/freebsd-clang > -isy > stem /usr/local/include -isystem /usr/local/include/glib-2.0 -isystem > /usr/local/lib/glib-2.0/include -O2 -pipe -fstack-protector-strong > -fno-strict-aliasing -pipe -fstack-protector-strong -fno-strict-aliasing > -DNDEBUG -O3 -std=3Dgnu11 -fPIC -fvisibility=3Dhidden -Wall -Wextra -pth= read > -fcf-protection=3Dfull -ftrivial-auto-var-init=3Dpattern > -fstack-protector-strong -fexceptions -MD -MT > src/corelib/CMakeFiles/Core.dir/io/fork > fd_qt.c.o -MF src/corelib/CMakeFiles/Core.dir/io/forkfd_qt.c.o.d -o > src/corelib/CMakeFiles/Core.dir/io/forkfd_qt.c.o -c > /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/c= orelib/io/forkfd_qt > .c > In file included from > /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/c= orelib/io/forkfd_qt.c:16: > /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/c= orelib/io/../../3rdparty/forkfd/forkfd.c:162:39: > warning: call to undeclared function 'ATOMIC_VAR_INIT'; ISO C99 and later > do not support i > mplicit function declarations [-Wimplicit-function-declaration] > 162 | static ffd_atomic_int forkfd_status =3D FFD_ATOMIC_INIT(0); > | ^ > /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/c= orelib/io/../../3rdparty/forkfd/forkfd_c11.h:54:37: > note: expanded from macro 'FFD_ATOMIC_INIT' > 54 | #define FFD_ATOMIC_INIT(val) ATOMIC_VAR_INIT(val) > | ^ > In file included from > /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/c= orelib/io/forkfd_qt.c:16: > /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/c= orelib/io/../../3rdparty/forkfd/forkfd.c:162:39: > error: initializer element is not a compile-time constant > 162 | static ffd_atomic_int forkfd_status =3D FFD_ATOMIC_INIT(0); > | ^~~~~~~~~~~~~~~~~~ > /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/c= orelib/io/../../3rdparty/forkfd/forkfd_c11.h:54:37: > note: expanded from macro 'FFD_ATOMIC_INIT' > 54 | #define FFD_ATOMIC_INIT(val) ATOMIC_VAR_INIT(val) > | ^~~~~~~~~~~~~~~~~~~~ > In file included from > /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/c= orelib/io/forkfd_qt.c:16: > In file included from > /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/c= orelib/io/../../3rdparty/forkfd/forkfd.c:930: > /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/c= orelib/io/../../3rdparty/forkfd/forkfd_freebsd.c:45:45: > error: initializer element is not a compile-time constant > 45 | static ffd_atomic_int system_forkfd_state =3D FFD_ATOMIC_INIT(1); > | ^~~~~~~~~~~~~~~~~~ > /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/c= orelib/io/../../3rdparty/forkfd/forkfd_c11.h:54:37: > note: expanded from macro 'FFD_ATOMIC_INIT' > 54 | #define FFD_ATOMIC_INIT(val) ATOMIC_VAR_INIT(val) > | ^~~~~~~~~~~~~~~~~~~~ > 1 warning and 2 errors generated. > ... > > Thanks, > > Warner Losh escreveu (s=C3=A1bado, 20/06/2026 =C3=A0(s)= 01:25): > >> The branch main has been updated by imp: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=3D28cecfe27964fdb67497800f5dcd5d= 3e1033727f >> >> commit 28cecfe27964fdb67497800f5dcd5d3e1033727f >> Author: Faraz Vahedi >> AuthorDate: 2026-05-01 14:34:44 +0000 >> Commit: Warner Losh >> CommitDate: 2026-06-20 00:23:28 +0000 >> >> libc: Restrict ATOMIC_VAR_INIT for C23 conformance >> >> Omit `ATOMIC_VAR_INIT` when targeting C23, where it has been removed= . >> Retain it for earlier C standards and for C++ (as it still remains i= n >> C++23, albeit marked as deprecated since C17 and C++20.) >> >> Also separate `atomic_init` definitions from `ATOMIC_VAR_INIT` to >> avoid coupling with a deprecated initialisation mechanism. >> >> No functional change intended for `atomic_init`; this is purely a >> conformance and cleanup adjustment. >> >> Signed-off-by: Faraz Vahedi >> Reviewed by: imp >> Pull Request: https://github.com/freebsd/freebsd-src/pull/2185 >> --- >> sys/sys/stdatomic.h | 8 +++++++- >> 1 file changed, 7 insertions(+), 1 deletion(-) >> >> diff --git a/sys/sys/stdatomic.h b/sys/sys/stdatomic.h >> index c3f9b217519c..2d565ce991be 100644 >> --- a/sys/sys/stdatomic.h >> +++ b/sys/sys/stdatomic.h >> @@ -86,11 +86,17 @@ >> * 7.17.2 Initialization. >> */ >> >> +#if __ISO_C_VISIBLE < 2023 || defined(__cplusplus) >> #if defined(__CLANG_ATOMICS) >> #define ATOMIC_VAR_INIT(value) (value) >> -#define atomic_init(obj, value) __c11_atomic_init(obj, >> value) >> #else >> #define ATOMIC_VAR_INIT(value) { .__val =3D (value) } >> +#endif >> +#endif >> + >> +#if defined(__CLANG_ATOMICS) >> +#define atomic_init(obj, value) __c11_atomic_init(obj, >> value) >> +#else >> #define atomic_init(obj, value) ((void)((obj)->__val =3D >> (value))) >> #endif >> >> >> > > -- > Nuno Teixeira > FreeBSD UNIX: Web: https://FreeBSD.org > --=20 Nuno Teixeira FreeBSD UNIX: Web: https://FreeBSD.org --0000000000008998e30654c71d0d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
(...)
and I forgot:

a= udio/cmus:

...
checking for program cc... /usr/bin/cc
checking= for C11 (with atomics support)... no
configure failed.
=3D=3D=3D>= =C2=A0Script "configure" failed unexpectedly.
Please report t= he problem to eduardo@FreeBSD.org [maintainer] and attach the
"/wrk= dirs/usr/ports/audio/cmus/work/cmus-2.12.0/config.log" including theoutput of the failure of your make command. Also, it might be a good idea= to
provide an overview of all packages installed on your system (e.g. a=
/usr/local/sbin/pkg-static info -g -Ea).
*** Error code 1
...
An= y clues how to unbreak on ports side?

Thanks,
<= br>



Nuno Teixeira <eduardo@freebsd.org> escreveu (domingo, 21/06/2= 026 =C3=A0(s) 11:35):
Hello,

(poudriere-d= evel build at=C2=A0main-n286792-eafa181d51f7: Sat Jun 20)

I've found that ports-mgmt/portfmt started failing with:
...
F= AILED: [code=3D1] /wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/= _build/portscan/status.o
cc -std=3Dgnu11 -O2 -g -W -Wall -Wextra -Wmissi= ng-prototypes -Wstrict-prototypes -Wwrite-strings -Wno-unused-parameter -fl= to=3Dthin -O2 -pipe =C2=A0-fstack-protector-strong -fno-strict-aliasing =C2= =A0-Wno-strict-prototypes =C2=A0-DPORTFMT_SUBPACKAGES=3D0 -MD -MF /wrkdirs/= usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/_build/portscan/status.o.d = -I/wrkdirs/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/_build -I/wrkdir= s/usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6 -c -o /wrkdirs/usr/ports/= ports-mgmt/portfmt/work/portfmt-1.1.6/_build/portscan/status.o /wrkdirs/usr= /ports/ports-mgmt/portfmt/work/portfmt-1.1.6/portscan/status.c
/wrkdirs/= usr/ports/ports-mgmt/portfmt/work/portfmt-1.1.6/portscan/status.c:59:38: wa= rning: call to undeclared function 'ATOMIC_VAR_INIT'; ISO C99 and l= ater do not support implicit function declarations [-Wimplicit-function-dec= laration]
=C2=A0 =C2=A059 | static atomic_int status_requested =3D ATOMI= C_VAR_INIT(0);
=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0^
/wrkdirs/usr/ports/ports-mgmt/portfmt/work/por= tfmt-1.1.6/portscan/status.c:59:38: error: initializer element is not a com= pile-time constant
=C2=A0 =C2=A059 | static atomic_int status_requested = =3D ATOMIC_VAR_INIT(0);
=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/= ports-mgmt/portfmt/work/portfmt-1.1.6/portscan/status.c:60:32: error: initi= alizer element is not a compile-time constant
=C2=A0 =C2=A060 | static a= tomic_size_t scanned =3D ATOMIC_VAR_INIT(0);
=C2=A0 =C2=A0 =C2=A0 | =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^~~~~~~~~~~~~~~~~~
1 warning and 2 err= ors generated.
...

Same for devel/qt6-base:

...
F= AILED: [code=3D1] src/corelib/CMakeFiles/Core.dir/io/forkfd_qt.c.o
/usr/= bin/cc -DBACKTRACE_HEADER=3D\"execinfo.h\" -DCore_EXPORTS -DQT_AS= CII_CAST_WARNINGS -DQT_BUILDING_QT -DQT_BUILD_CORE_LIB -DQT_DEPRECATED_WARN= INGS -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_LEAN_HEADERS=3D1 -
= DQT_MOC_COMPAT -DQT_NO_CAST_TO_ASCII -DQT_NO_CONTEXTLESS_CONNECT -DQT_NO_DE= BUG -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSI= ONS_IN_CONNECT -DQT_NO_QASCONST -DQT_NO_QEXCHANGE -DQT_NO_QPAI
R -DQT_NO= _QSNPRINTF -DQT_NO_SINGLE_ARGUMENT_QHASH_OVERLOAD=3D1 -DQT_NO_STD_FORMAT_SU= PPORT -DQT_NO_USING_NAMESPACE -DQT_TYPESAFE_FLAGS -DQT_USE_NODISCARD_FILE_O= PEN -DQT_USE_QSTRINGBUILDER -D_LARGEFILE64_SOURCE -D_LA
RGEFILE_SOURCE -= D_LIBCPP_HARDENING_MODE=3D_LIBCPP_HARDENING_MODE_FAST -I/wrkdirs/usr/ports/= devel/qt6-base/work/.build/src/corelib/Core_autogen/include -I/wrkdirs/usr/= ports/devel/qt6-base/work/.build/include -I/wrkd
irs/usr/ports/devel/qt6= -base/work/.build/include/QtCore -I/wrkdirs/usr/ports/devel/qt6-base/work/q= tbase-everywhere-src-6.11.1/src/corelib -I/wrkdirs/usr/ports/devel/qt6-base= /work/.build/src/corelib -I/wrkdirs/usr
/ports/devel/qt6-base/work/.buil= d/src/corelib/global -I/wrkdirs/usr/ports/devel/qt6-base/work/.build/src/co= relib/kernel -I/wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src= -6.11.1/src/corelib/../3rdpart
y/tinycbor/src -I/wrkdirs/usr/ports/devel= /qt6-base/work/.build/include/QtCore/6.11.1 -I/wrkdirs/usr/ports/devel/qt6-= base/work/.build/include/QtCore/6.11.1/QtCore -I/wrkdirs/usr/ports/devel/qt= 6-base/work/qtbase-ev
erywhere-src-6.11.1/src/corelib/../3rdparty/forkfd= -I/wrkdirs/usr/ports/devel/qt6-base/work/.build/src/corelib/.rcc -I/wrkdir= s/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/mkspecs/freebs= d-clang -isy
stem /usr/local/include -isystem /usr/local/include/glib-2.= 0 -isystem /usr/local/lib/glib-2.0/include -O2 -pipe =C2=A0-fstack-protecto= r-strong -fno-strict-aliasing -pipe =C2=A0-fstack-protector-strong -fno-str= ict-aliasing
=C2=A0-DNDEBUG -O3 -std=3Dgnu11 -fPIC -fvisibility=3Dhidden= -Wall -Wextra -pthread -fcf-protection=3Dfull -ftrivial-auto-var-init=3Dpa= ttern -fstack-protector-strong -fexceptions -MD -MT src/corelib/CMakeFiles/= Core.dir/io/fork
fd_qt.c.o -MF src/corelib/CMakeFiles/Core.dir/io/forkfd= _qt.c.o.d -o src/corelib/CMakeFiles/Core.dir/io/forkfd_qt.c.o -c /wrkdirs/u= sr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/corelib/io/fo= rkfd_qt
.c
In file included from /wrkdirs/usr/ports/devel/qt6-base/wo= rk/qtbase-everywhere-src-6.11.1/src/corelib/io/forkfd_qt.c:16:
/wrkdirs/= usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/corelib/io/.= ./../3rdparty/forkfd/forkfd.c:162:39: warning: call to undeclared function = 'ATOMIC_VAR_INIT'; ISO C99 and later do not support i
mplicit fu= nction declarations [-Wimplicit-function-declaration]
=C2=A0 162 | stati= c ffd_atomic_int forkfd_status =3D FFD_ATOMIC_INIT(0);
=C2=A0 =C2=A0 =C2= =A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^
/wrkdi= rs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/corelib/i= o/../../3rdparty/forkfd/forkfd_c11.h:54:37: note: expanded from macro '= FFD_ATOMIC_INIT'
=C2=A0 =C2=A054 | #define FFD_ATOMIC_INIT(val) =C2= =A0 =C2=A0 =C2=A0 =C2=A0ATOMIC_VAR_INIT(val)
=C2=A0 =C2=A0 =C2=A0 | =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^
In file included from= /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/co= relib/io/forkfd_qt.c:16:
/wrkdirs/usr/ports/devel/qt6-base/work/qtbase-e= verywhere-src-6.11.1/src/corelib/io/../../3rdparty/forkfd/forkfd.c:162:39: = error: initializer element is not a compile-time constant
=C2=A0 162 | s= tatic ffd_atomic_int forkfd_status =3D FFD_ATOMIC_INIT(0);
=C2=A0 =C2=A0= =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~~= ~~~~~~~~~~~~~
/wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-s= rc-6.11.1/src/corelib/io/../../3rdparty/forkfd/forkfd_c11.h:54:37: note: ex= panded from macro 'FFD_ATOMIC_INIT'
=C2=A0 =C2=A054 | #define FF= D_ATOMIC_INIT(val) =C2=A0 =C2=A0 =C2=A0 =C2=A0ATOMIC_VAR_INIT(val)
=C2= =A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~= ~~~~~~~~~~~~~~~~
In file included from /wrkdirs/usr/ports/devel/qt6-base= /work/qtbase-everywhere-src-6.11.1/src/corelib/io/forkfd_qt.c:16:
In fil= e included from /wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-sr= c-6.11.1/src/corelib/io/../../3rdparty/forkfd/forkfd.c:930:
/wrkdirs/usr= /ports/devel/qt6-base/work/qtbase-everywhere-src-6.11.1/src/corelib/io/../.= ./3rdparty/forkfd/forkfd_freebsd.c:45:45: error: initializer element is not= a compile-time constant
=C2=A0 =C2=A045 | static ffd_atomic_int system_= forkfd_state =3D FFD_ATOMIC_INIT(1);
=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~~= ~~~~~~~~~~~~~
/wrkdirs/usr/ports/devel/qt6-base/work/qtbase-everywhere-s= rc-6.11.1/src/corelib/io/../../3rdparty/forkfd/forkfd_c11.h:54:37: note: ex= panded from macro 'FFD_ATOMIC_INIT'
=C2=A0 =C2=A054 | #define FF= D_ATOMIC_INIT(val) =C2=A0 =C2=A0 =C2=A0 =C2=A0ATOMIC_VAR_INIT(val)
=C2= =A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^~~~= ~~~~~~~~~~~~~~~~
1 warning and 2 errors generated.
...

T= hanks,

Warner Losh <= imp@freebsd.org> escreveu (s=C3=A1bado, 20/06/2026 =C3=A0(s) 01:25):=
The branch main= has been updated by imp:

URL: https://cgit.= FreeBSD.org/src/commit/?id=3D28cecfe27964fdb67497800f5dcd5d3e1033727f
commit 28cecfe27964fdb67497800f5dcd5d3e1033727f
Author:=C2=A0 =C2=A0 =C2=A0Faraz Vahedi <kfv@kfv.io>
AuthorDate: 2026-05-01 14:34:44 +0000
Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
CommitDate: 2026-06-20 00:23:28 +0000

=C2=A0 =C2=A0 libc: Restrict ATOMIC_VAR_INIT for C23 conformance

=C2=A0 =C2=A0 Omit `ATOMIC_VAR_INIT` when targeting C23, where it has been = removed.
=C2=A0 =C2=A0 Retain it for earlier C standards and for C++ (as it still re= mains in
=C2=A0 =C2=A0 C++23, albeit marked as deprecated since C17 and C++20.)

=C2=A0 =C2=A0 Also separate `atomic_init` definitions from `ATOMIC_VAR_INIT= ` to
=C2=A0 =C2=A0 avoid coupling with a deprecated initialisation mechanism.
=C2=A0 =C2=A0 No functional change intended for `atomic_init`; this is pure= ly a
=C2=A0 =C2=A0 conformance and cleanup adjustment.

=C2=A0 =C2=A0 Signed-off-by: Faraz Vahedi <kfv@kfv.io>
=C2=A0 =C2=A0 Reviewed by: imp
=C2=A0 =C2=A0 Pull Request: https://github.com/freeb= sd/freebsd-src/pull/2185
---
=C2=A0sys/sys/stdatomic.h | 8 +++++++-
=C2=A01 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sys/sys/stdatomic.h b/sys/sys/stdatomic.h
index c3f9b217519c..2d565ce991be 100644
--- a/sys/sys/stdatomic.h
+++ b/sys/sys/stdatomic.h
@@ -86,11 +86,17 @@
=C2=A0 * 7.17.2 Initialization.
=C2=A0 */

+#if __ISO_C_VISIBLE < 2023 || defined(__cplusplus)
=C2=A0#if defined(__CLANG_ATOMICS)
=C2=A0#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 ATOMIC_VAR_INIT(value)=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 (value)
-#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 atomic_init(obj, value)=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0__c11_atomic_init(obj, value)
=C2=A0#else
=C2=A0#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 ATOMIC_VAR_INIT(value)=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 { .__val =3D (value) }
+#endif
+#endif
+
+#if defined(__CLANG_ATOMICS)
+#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 atomic_init(obj, value)=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0__c11_atomic_init(obj, value)
+#else
=C2=A0#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 atomic_init(obj, value)=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0((void)((obj)->__val =3D (value)))
=C2=A0#endif




--
Nuno Teixeira
=
FreeBSD UNIX:=C2=A0 <eduardo@FreeBSD.org>=C2=A0 =C2=A0Web:=C2=A0 https://Fr= eeBSD.org


--
Nuno Teixeira
=
FreeBSD UNIX:=C2=A0 <eduardo@FreeBSD.org>=C2=A0 =C2=A0Web:=C2=A0 https://Fr= eeBSD.org
--0000000000008998e30654c71d0d-- From nobody Sun Jun 21 17:54:46 2026 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 4gjzW034Gmz6hS66 for ; Sun, 21 Jun 2026 17:54: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjzVv0k84z3QjY for ; Sun, 21 Jun 2026 17:54:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782064487; 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=gLVIsuXnFXVQ30G5hklLRZQSY5TjO8t+h8VQjLhZKc8=; b=UvP+95o22d6rCNVBZdQpup/SRf8zf13c8AOeNsZdovXkW2kEUaRPGe+LxQ4ZhFtLObmq91 mEfIaBCBpOaE0zaX4f4VUjHHevaFm68rb6k84qobf26AruKmnHrkiz5o4TxLUsudU7EkUY ivKmpDgxQYFMIl4UNt2N0giqUi9dG43keOny1ehzlG8lVqhWLOo67BPUvCEEMyTIl8kNQm dBPRRuk6tcYC+WAU1OUa5bwH+qzzyFlMJIQEWVVWA6lAVR1/6r+BcYScYk7PhVGbxaBps0 I6eQPkfiParJzL8+OCctTEQqqdy1yqGMwZK6/TRxi0abaitVU0usP06CtfYr+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782064487; a=rsa-sha256; cv=none; b=w8YPpgIutborcTIisT6V84CMVVKaEwel9C8P5ZWM6Cxg2WmK5r5jw56bpSMOgnP4JyRUxp GmiVgtS8W4lmaI5FhcmICXJrekr5iMag/FKIxvsEMYSV6YQci2uUfLcrdXkr6CWRjbam50 K0aq4oeguh8D2jgRK6Sh2O/upKMpKGe0/zGN6bD1tIkgVcAMeZ3YLfyEiLnB5av1gdVu64 kLpE7ZX8EhI4nzJWG242xg+gIO4KBP6bbuJI2UsMncl9xb6TtwD+rHB9pOdFyunDUHH+uX AKLm2yU8fYzokcxdNC2Pe+pThk6jMytivrb0J3yNvvM4fEoSXdGENDr99WhUbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782064487; 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=gLVIsuXnFXVQ30G5hklLRZQSY5TjO8t+h8VQjLhZKc8=; b=iGde8ZGyWMaFOHpEaiEearNFlAPh7Zb4wvcIM/eaXR9yNq1e1NcksEJMWHRVG6is2lnACC KwIhQgoWyuC+k6VgYrobvLQFwkBMk+UTTHn43AylpaToTLh6fumBRZJApzXS0YQCddA1u3 jJrO05A8W8Mp0TS9h8E+hwQ/tNPSg1nyvjTcsSDNh5jj4CfXhzlwe2u0LDXbClgFqP/Zlk XLnrcFVJrsnt1eyiceW9PyAQU33EGZ1iQWyLO2C8KIJQt1y0iPs7PSMslv2um7PG3OxoxC SfI+GICFE8HkC4s2oj0aIHWHnorJLk4s84rgJgixH7+vKvOV+Ns2VCzWmtUm+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gjzVt6jSCz1QmQ for ; Sun, 21 Jun 2026 17:54:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 253b6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 17:54:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 704db3fe9840 - main - Source upgrade doc: etcupdate no longer needs -B 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 704db3fe9840ee3e51b080b7c35defd1a74c0c2d Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 17:54:46 +0000 Message-Id: <6a382566.253b6.237e9a5e@gitrepo.freebsd.org> The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=704db3fe9840ee3e51b080b7c35defd1a74c0c2d commit 704db3fe9840ee3e51b080b7c35defd1a74c0c2d Author: Alexander Ziaee AuthorDate: 2026-06-21 17:54:12 +0000 Commit: Alexander Ziaee CommitDate: 2026-06-21 17:54:17 +0000 Source upgrade doc: etcupdate no longer needs -B Note: We confusingly have the instructions to build the system in the build manual, the UPDATING file, and the Makefile. These will get out of sync and will be harmful when they do. Fixes: ddf6fad0295a ("etcupdate: Make nobuild the default") Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D57644 --- Makefile | 2 +- UPDATING | 4 ++-- share/man/man7/build.7 | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 00c454b38147..25bdc4922e90 100644 --- a/Makefile +++ b/Makefile @@ -85,7 +85,7 @@ # 5. `reboot' (in single user mode: boot -s from the loader prompt). # 6. `etcupdate -p' # 7. `make installworld' -# 8. `etcupdate -B' +# 8. `etcupdate' # 9. `make delete-old' # 10. `reboot' # 11. `make delete-old-libs' (in case no 3rd party program uses them anymore) diff --git a/UPDATING b/UPDATING index f164208e9553..e9ed0d97727a 100644 --- a/UPDATING +++ b/UPDATING @@ -2571,7 +2571,7 @@ COMMON ITEMS: [3] etcupdate -p [5] make installworld - etcupdate -B [4] + etcupdate [4] make delete-old [6] @@ -2609,7 +2609,7 @@ COMMON ITEMS: [3] etcupdate -p [5] make installworld - etcupdate -B [4] + etcupdate [4] make delete-old [6] diff --git a/share/man/man7/build.7 b/share/man/man7/build.7 index 23980875eaaa..9db04f12c15a 100644 --- a/share/man/man7/build.7 +++ b/share/man/man7/build.7 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 20, 2026 +.Dd June 18, 2026 .Dt BUILD 7 .Os .Sh NAME @@ -1045,7 +1045,7 @@ After verifying that you do not need them, delete old files: cd /usr/src etcupdate -p make installworld -etcupdate -B +etcupdate make delete-old shutdown -r now .Ed From nobody Sun Jun 21 18:06:21 2026 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 4gjzmH6V6zz6hSk0; Sun, 21 Jun 2026 18:06:23 +0000 (UTC) (envelope-from des@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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjzmH5tvYz3Rmh; Sun, 21 Jun 2026 18:06:23 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782065183; 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=s5O8IlMjuB+UK32mfwP/CkIXpz7BFu3ohtdaLm2s9V4=; b=nqKR7qqb9inKiVZXcFIkeNaoiPKXVBaFb+ovFT+v80MpB6W6ac6Wq7psWPlIGDa8r8vVlu eB6b2E4D6Yt++xPo0fpOMHVZVOEUWJYRN+5dVvfocDt6qll7kEQSGlNAglhYuIQ6kDad1Z dsLg9NjgBxlKQEvnqoNgL2PZGEpjenE6lvs26aWm5pUO1d/MSIiNgR+AvH5m7NOfJAT6th RcN6cVYIOc4Myn3HmZHci2dyxaHvZBLx0qEafGDs2KaUcMjZ0/EgAjzDeVhZaH2nvnXFZ3 fqWUaOkODAYFbw4cEAOY9HIJZqms2sZEEXD2NkbY6fejIHCzIB1jq6DbZSDViw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782065183; a=rsa-sha256; cv=none; b=czaYc3b/CdKRN6MMEsy9wqIt6hLgaVC7YribO4Ii1sGwdNcefTXWiGN7QFKy9uEwu9XD1H hVHZPu2BC3r8T3wDpFL4jxPmM99qCvtKNFdjtS1utv9W8SSZF8swePKIjaEb5mLn2OPCj3 ZrhXFl9aaB9Wu7U/qMpSXrbZL4NyDX9mOmOCZbeQPtvZzyafrcU26Kejcj8easH7LlJNWo 1jRAmwCMNLCDSw+h8Vr6UPSgNWx/L73hiN5du7bFDunDIzLJEBiueG5WPqogrLU8T8s6AM +WEYa4g1ErVaTmCS8n/S7tdD8N41uLBrQDay8HOUawZka6NvwwCrcOugG1KHJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782065183; 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=s5O8IlMjuB+UK32mfwP/CkIXpz7BFu3ohtdaLm2s9V4=; b=DQKSz3p9ZFMtAL9mPIcia69B47gfjNh3/SQBsm6rcYx2BEnji6ysaVopQCN44BJB12uDZe QHY4iCU4rrYaLw3vAlWWQZtFqdjXmItGUhGrABtC7cEmACpEfw8X1LHt/cKwWVeXmfAMgu SiQHKQKpJ0S99rPqVBD5XvgmVNomIrdRPDpYbw7DggITKNZNCGfwYu4zA1WBGAHBAzStru UsXjI4kFHPJ6YLrvob8kqT4AiE4bQd6xJNIGrRMiFOgZcZhFmDXipHvb6TSOVk185yXjFR SuzzIrX2hK5zl0IZR5a16XKVUexZ03RMlPxwJaHBOJXDl7ukGxFpwXoW6+fc/w== Received: from ltc.des.dev (unknown [92.183.55.143]) (using TLSv1.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: des/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4gjzmH3sGPz13P8; Sun, 21 Jun 2026 18:06:23 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id C69B650516; Sun, 21 Jun 2026 20:06:21 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Nuno Teixeira Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Faraz Vahedi Subject: Re: git: 28cecfe27964 - main - libc: Restrict ATOMIC_VAR_INIT for C23 conformance In-Reply-To: (Nuno Teixeira's message of "Sun, 21 Jun 2026 18:46:59 +0100") References: <6a35ddd3.22963.721d614@gitrepo.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Sun, 21 Jun 2026 20:06:21 +0200 Message-ID: <86o6h3sr8i.fsf@ltc.des.dev> 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Nuno Teixeira writes: > [various atomics-related breakage] Please test https://reviews.freebsd.org/D57724 DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Sun Jun 21 18:11:19 2026 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 4gjzt82hKDz6hTCx for ; Sun, 21 Jun 2026 18:11:28 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic303-25.consmr.mail.gq1.yahoo.com (sonic303-25.consmr.mail.gq1.yahoo.com [98.137.64.206]) (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) by mx1.freebsd.org (Postfix) with ESMTPS id 4gjzt65DP7z3Srm for ; Sun, 21 Jun 2026 18:11:26 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=AHCBDoSk; dmarc=pass (policy=reject) header.from=yahoo.com; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.64.206 as permitted sender) smtp.mailfrom=marklmi@yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1782065482; bh=KLe18R9m4n79obhhqkUW2w+9bpBFwOjmXL0Aj0GpeAI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=AHCBDoSkcEcMx4kPm/QsO78J7f4AaGI1QccZxM2fja/oDhe8512aODvfFSahemdMi/twnzKGbFTG3BZ64TzPvgD4SQRF/zcJ9iqDwgpSTf/fqGYzmCrF6KzvlJtZ1K1vD3AzFDUKDfXQ1dJfxZ0qtyt+lJ4pbQmpGpCvO6j9YkCtgeOqM2g9qf0g8XYYrd/+V8nDR9vF9oRMoswK90mkd4WmJuh3oCsFWhj0PS25mu8emaAUzrAF+Go1lyqiOo9cE3tmwOZExQqryfviHZuH+7d4XbDyh6hZdDdBW/e7pz8n8FbeJ9/bDLOvViyQmO5ScUJTIL6AqBx+2bq3RgrsnA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1782065482; bh=n8zYXocbU9fqUm5tdPmgHJO8lqVmE4Ctj/cEEN2EWDc=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=NMOiFBHKRRt77+072oHb4OzrL8k8BaPW+Qts79RghVg2jb0hJMQaOe9b2mlQpWBKo/kOrF6L7pnz1TPccBZRfJlPHKACzI0vS1unO6OPPPP6wr0LevrUMjW4HLVcY8QWcZur6WcuqYw3LYYfaMI+BkG7msKitgzzxvgeIU0J2N9wYXDW/NHiRd31E9a2hyCweQdcQ/UzI8Cyn4q2Jotir1FPRHMwQuoIj87VkIr9aw96pPn7/VBO/HFsusAzmSI2czJLb0fhAiWT8ANz85gxAUX3yY4ov8NkxKovuE6M1ZIYEMdx2gAT0Q/x0xzDGqIbYbqpDt5E+CAVy9V+FjH+XA== X-YMail-OSG: hzFdc_IVM1n3cxh5IFM4OPVqcOIBU6HtTuEtwPIMaeVNRw6qxFTBBhQLAYmyQHT B9am3QWR3FeZpIlAfBDjx0N0cciQ0LulyqqftXHthbDIbebW_SH.JwJBJ0JHbzsSD6PbK67xxMBL vPJyMSqagE_VoLwzs4QfjOi6fET_ZqJUfZBcj.c0fYjafBarrEJAtOVGcSXbi3x2EEFmlO0bLF4H _iE2rzW3iQbjTTvDSuycl_pd5ZzA1A29mzRyTlbZrvHyy.JFUyr76o6qJHd7_4ZWASsI5uB4NEqA kiLF.OIWm9FyujjQOZscie4l91huin4BPQkL5na8JRfZNzeC0Um87R7oRSeTuy4OzxYJ.Rh9WsyV Jh.Oq2hEn4OrNRxW8iMxP9K19R5Xm8yWNROGRChKUQfZFksHJOnKnae4wbj1HSZF.uRBRPr_sXLx otGQ0kMiaqFs.Msku.mODVKVhfn4JfOHaV8PklO.ze56Ah7ME53L1lIWBbItTrZJ77Ebyp6IMo7W _AK0PyQY0sWHypwMVFJrRu0qj_KOkMEeer5WqduQ7OUABNPqLLZndF6GzExt4uULiw9jKc1btQep VcmQFSjkESUM9fIOxD7Ar.WB2keHBkx007nFeQ8tmRm7duflQVN_vLK6sTScIJq3NP8bBaLoKBU3 Gmfd3FowLMePsZlrPXzQWEm4njpZVNck8EjUPlGFJ3W0HprIzpA6e1YctFeSvYoAc5yqMXUqxGhI 7IyZdOztmOjj.bmSxhab_2VzNapU29D3p4Ux_jMH662AHX7Zn7UI4QttrYS6KAtJMgqaqO2WT93S ZrZw.eWtk4Sqg6Zd6LUAG5UzaONB5lEJGcq4MUqgbxHnDKw6cLHRtd3QR_AKU4XoIN8FXw3HDziG pjFfibWD_xWEn2B0KlJ4VZAQUl3Ecv4mzXmJmSRkwynST1.tPSUA9AJa0DvvxL95UpmSC9npoSVT lkEO4YnfKQpziHZGuvzH9xtjOHlSdT1ndrImINuKlbcoxFjIrvpmFq3271BobN2CfiFdXDvYU_uk N3Atl7nWvJgluFc2w1rs7tv4RtzajGMaUkNMeoU0jx9dLya38ULwdw2HIdRb6qxiFsmGJXNd.OB4 xn42qeJWOalVg5QM_PMtNvLQgCFfJBD2YyMXyA6ZWN5fh9IgyGKxMwoH6XFsbaErhGuMkMMrP.Ez _Z5F2cDIfOLzlF7FYwHZZjb1A_hY7LzvSKINIesHtItZjG7tLYXkoaUAt138gA20Yaro3vfgdP.e dqNres5KufedQ9Yoo0bi1HRenXDrim1PFOl2za9vkIArTXid6MPJXLG62fU5n6_vkzOEU3JCOMaE ZcLyKG2EoyQf4NjxxsvpJEBr1rvrpRm469kJyggRIos08KEhx6uTGhp.6zg5YzBcSvhS3E6lMTG1 fxEeVi1DBD2b9KY3D0dM77dKq_lXvtDcVfierydfBGCCJ7Ht4IlNq33RXcYitR.MU99snRHnnsrj .HkwjdwbeERC_WAZY.twKXa_xQj_XvKyRWPZndeTg_vLWMBSuPl1x1XDiOUfvVvZvuIRXONtw2tu 39qk4pfa0kfLxiN6Rik6GeQkHQqj2pJzYidDRHogcJpprz38HqfM4E58HRQ5lyrZRBMSLQcR2MR3 hbVNkERi1KSHwnHV_qVx49LIHPyrrZZi1Js1wzHdjjoEO7JrpqMUd2o2PxM76bBWVlXAm4.VBfN. N18J_zFiiUGdTWaQLmNxdUAupy03zpLn9sBewiaXw81wdaWgSLANiAQcSTdR2EDpZTlHdMUuY0Vk 3k9rPll8pKleIcGjAd2u1rJOeRxCdC0nftTd0PccSwfCuA_JABs59JvZnBjiv3kLBX8uIlkmUahr QIKhW8f0a1cvA4SZG_i6MnSqGhVudbiO8dqH.Y_Skswe.gULyAN.miS2reXxzO6I1QIg7exD5ZLE 55JhcRnb5fRVjI4QRCTHNeSC6sAVP4Fd76FBKsWZlkAnqUsmYq3q0iWWVPFw94BYBE_tIXea21u9 xV.c6lWYAHiwG7wJephZAQEcL6c8W3P56PraQuVcNOhhXbNUf37nyNPLbBIV9BB3E4zjrz3tKm37 EHu42TGq1gez04v0orDZkdnskNQGwoEtN0Whzq1mMuQYrzeRgJiQ2GTOcRZXa.yGPhRYWvdQxcVf Mzz5J9n7uu0QZN.niZKtjLx7tuZCcH5pNviiijgTnMa.vNj8rZD2KawxuKBKyYea89Ohgz9dcGX_ AyFBhjYS3TnSMh7CIIuIs4.YN0KG5cTUUCEt7usOTIz014mDlQAH96o9McUHi.nQcM4sjoVjvdqm fYWSsMKCV0rbt2rhnVmufU516t.JMHeq51BztgsVIm2GKSCrtjnJHUEA- X-Sonic-MF: X-Sonic-ID: f1d1970a-d6f5-4bd6-bf62-daae4bf2adbf Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.gq1.yahoo.com with HTTP; Sun, 21 Jun 2026 18:11:22 +0000 Received: by hermes--production-gq1-7bb7df5c46-bdzch (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID e0c4ecb5dcb57e2976ca6f5730ceb02b; Sun, 21 Jun 2026 18:11:20 +0000 (UTC) Message-ID: <4e902fcf-e79c-47b5-a51f-4881c09f7528@yahoo.com> Date: Sun, 21 Jun 2026 11:11:19 -0700 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 28cecfe27964 - main - libc: Restrict ATOMIC_VAR_INIT for C23 conformance To: Warner Losh , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Faraz Vahedi , Nuno Teixeira References: <6a35ddd3.22963.721d614@gitrepo.freebsd.org> Content-Language: en-US From: Mark Millard In-Reply-To: <6a35ddd3.22963.721d614@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Mailer: WebService/1.1.26016 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-Spamd-Result: default: False [-3.54 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.54)[-0.544]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; FROM_HAS_DN(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RCVD_IN_DNSWL_NONE(0.00)[98.137.64.206:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MLMMJ_DEST(0.00)[dev-commits-src-main@FreeBSD.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.64.206:from]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_FIVE(0.00)[6] X-Spamd-Bar: --- X-Rspamd-Queue-Id: 4gjzt65DP7z3Srm On 6/19/26 17:24, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=28cecfe27964fdb67497800f5dcd5d3e1033727f > > commit 28cecfe27964fdb67497800f5dcd5d3e1033727f > Author: Faraz Vahedi > AuthorDate: 2026-05-01 14:34:44 +0000 > Commit: Warner Losh > CommitDate: 2026-06-20 00:23:28 +0000 > > libc: Restrict ATOMIC_VAR_INIT for C23 conformance > > Omit `ATOMIC_VAR_INIT` when targeting C23, where it has been removed. > Retain it for earlier C standards and for C++ (as it still remains in > C++23, albeit marked as deprecated since C17 and C++20.) > > Also separate `atomic_init` definitions from `ATOMIC_VAR_INIT` to > avoid coupling with a deprecated initialisation mechanism. > > No functional change intended for `atomic_init`; this is purely a > conformance and cleanup adjustment. > > Signed-off-by: Faraz Vahedi > Reviewed by: imp > Pull Request: https://github.com/freebsd/freebsd-src/pull/2185 > --- > sys/sys/stdatomic.h | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/sys/sys/stdatomic.h b/sys/sys/stdatomic.h > index c3f9b217519c..2d565ce991be 100644 > --- a/sys/sys/stdatomic.h > +++ b/sys/sys/stdatomic.h > @@ -86,11 +86,17 @@ > * 7.17.2 Initialization. > */ > > +#if __ISO_C_VISIBLE < 2023 || defined(__cplusplus) > #if defined(__CLANG_ATOMICS) > #define ATOMIC_VAR_INIT(value) (value) > -#define atomic_init(obj, value) __c11_atomic_init(obj, value) > #else > #define ATOMIC_VAR_INIT(value) { .__val = (value) } > +#endif > +#endif > + > +#if defined(__CLANG_ATOMICS) > +#define atomic_init(obj, value) __c11_atomic_init(obj, value) > +#else > #define atomic_init(obj, value) ((void)((obj)->__val = (value))) > #endif > > > I expect that the problem reports for port package build failures are tied to src/sys/sys/_visible.h : . . . #elif defined(_C23_SOURCE) /* Localism to specify strict C23 env. */ #define __POSIX_VISIBLE 0 #define __XSI_VISIBLE 0 #define __BSD_VISIBLE 0 #define __ISO_C_VISIBLE 2023 #define __EXT1_VISIBLE 0 #else /* Default environment: show everything. */ #define __POSIX_VISIBLE 202405 #define __XSI_VISIBLE 800 #define __BSD_VISIBLE 1 #define __ISO_C_VISIBLE 2023 #define __EXT1_VISIBLE 1 #endif #endif /* _POSIX_C_SOURCE */ The "show everything" note is wrong now, as C23 removes at least ATOMIC_VAR_INIT . A real "show everything" would require more logic, such as still keeping ATOMIC_VAR_INIT for __BSD_VISIBLE also being 1 or some such (may be inventing a new configuration macro for, say, __ISO_C_BUT_WITHOUT_SOME_REMOVALS). -- === Mark Millard marklmi at yahoo.com From nobody Sun Jun 21 19:20:13 2026 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 4gk1PT62yhz6hbnP for ; Sun, 21 Jun 2026 19:20: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gk1PT4kTNz3bHR for ; Sun, 21 Jun 2026 19:20:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782069613; 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=ji+uSJVv90WbIWyfu3FwfOqMVXIe0W+quu+wNTn7u8Y=; b=u3Y6lhjaSnH4UmaN6XK3TW3SkZAtLtgmhRrMCaiHQLsuRvtCv7CcC8kSXUbAC9ZSGfxeZ2 XtWYJHI2kNnTV+4KsvmLPoIzUkqOtxoY6klfDmEIoLeaan1048jY4im1HnCTMRaG7Jzr3F VQnmdY82nr6PwY1HeOBrPCuRTHEKK7LzSphqYBc0Qg/89E8cTP6fae6fiKtehbRlwA+1rC 5Ww9YvYiaZVEPGvbryA+yfFP+x9pnouqK1d6qC0EMiLMmOWOfgCsCt1aLeKPo7dwhRlJew dVB4CUsGsw9ptPEks7iV9yq7LGUDcu/duNZH9kIOmfk5e6Mlqfo5rSfTQ/nHDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782069613; a=rsa-sha256; cv=none; b=TbuRHBQPn77D/gQVoJTZNZAv8V4KlB/WJ7KsFcwO7dEb0Kz1rQOlNhvVGllSlYhgR0OCSn mneJuxg4lvjxr/xN4t3g9F1la3Wh7bmArqDq/bpF8b7hbBWnQSnELBI8gcI/T2bz3bGG/z PSzJUPmcNHZpMBzukyPwcYeYbpKKSB/fFAb8hcvYUrcf7wf40tS1PX0pLmolRGxScsacp/ LtsGVNjsE4fWIyOEpBvT7/YRsew1/S8o7jIu3//csjYAGcSNElsCXjTwFqKZmJbNXIIPjX QEYSfEORRDW/in5oKgK+f8/FX1HR1uV2kmZyHkfDHkhba0vwtCsDL2BvZL6q0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782069613; 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=ji+uSJVv90WbIWyfu3FwfOqMVXIe0W+quu+wNTn7u8Y=; b=AsqdQa5Ip4C+/wq/B/1ursuTRhpDdRU5BykXtnL1KNZbtUU9lH4H9Hpmqp3rgs3FZV85Da N59GfJyWBGARQ21bafrkLmmrhizkxoNLVGhJ1xxyiHxMpBSnpMJ1vuP4gq+AkM4/XqwQI4 eN/bgRLz98lhv4hGSZCVXVPrn4KRyiFUxYmQ1evIktG097XStoc4s5eA0Leejb2dRahqBO CdPVGw7bBTo7yt8c+qVFrQ4x0O1oUIWKZQItTUx3GTwr7iMkTR5FbLGzeV38H+EEC6GaIF I2frrwvtNiB16HTkdGHwCKkrlVvjIM+17NLOQA2iw1TJmA9TNPP3eInHUIfb+g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gk1PT2z2vzDd for ; Sun, 21 Jun 2026 19:20:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3662e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 19:20:13 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Simon J. Gerraty Subject: git: c37839dc7b6a - main - meta.autodep.mk remove extra } 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: c37839dc7b6a4d5f2c4d5bddda6595782a83dae4 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 19:20:13 +0000 Message-Id: <6a38396d.3662e.4ff9fa08@gitrepo.freebsd.org> The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=c37839dc7b6a4d5f2c4d5bddda6595782a83dae4 commit c37839dc7b6a4d5f2c4d5bddda6595782a83dae4 Author: Simon J. Gerraty AuthorDate: 2026-06-21 19:19:29 +0000 Commit: Simon J. Gerraty CommitDate: 2026-06-21 19:19:29 +0000 meta.autodep.mk remove extra } remove extra } from GENDIRDEPS_ENV more debug output for gendirdeps.mk Reviewed by: stevek Differential Revision: https://reviews.freebsd.org/D57727 --- share/mk/gendirdeps.mk | 14 +++++++++++--- share/mk/meta.autodep.mk | 6 +++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/share/mk/gendirdeps.mk b/share/mk/gendirdeps.mk index e5f536441a8d..ad964e062205 100644 --- a/share/mk/gendirdeps.mk +++ b/share/mk/gendirdeps.mk @@ -1,4 +1,4 @@ -# $Id: gendirdeps.mk,v 1.56 2026/06/19 18:57:57 sjg Exp $ +# $Id: gendirdeps.mk,v 1.57 2026/06/21 19:04:57 sjg Exp $ # SPDX-License-Identifier: BSD-2-Clause # @@ -163,10 +163,12 @@ META2DEPS := ${META2DEPS} .if ${_debug.gendirdeps} && ${DEBUG_GENDIRDEPS:Mmeta2d*} != "" _time = time +_set_x = set -x; _sh_x = sh -x _py_d = -ddd .else _time = +_set_x = _sh_x = _py_d = .endif @@ -244,7 +246,11 @@ x != echo; for m in $$_meta_files; do echo $$m; done > meta.list _meta_files_arg:= ${_meta_files} .endif -dir_list != cd ${_OBJDIR} && \ +.if ${_debug.gendirdeps} +.info ${RELDIR}: _meta_files_arg='${_meta_files_arg}' +.endif + +dir_list != cd ${_OBJDIR} && ${_set_x} \ ${META2DEPS_CMD} MACHINE=${MACHINE} \ SRCTOP=${SRCTOP} RELDIR=${RELDIR} CURDIR=${_CURDIR} \ ${META2DEPS_ARGS} \ @@ -256,6 +262,9 @@ dir_list != cd ${_OBJDIR} && \ .warning Skipping ${_DEPENDFILE:S,${SRCTOP}/,,} # we are not going to update anything .else +.if ${_debug.gendirdeps} +.info ${RELDIR}: raw_dir_list='${dir_list}' +.endif dpadd_dir_list= .if !empty(DPADD) _nonlibs := ${DPADD:T:Nlib*:N*include} @@ -276,7 +285,6 @@ ddeps != cat ${ddep_list:O:u} | ${META2DEPS_FILTER} ${_skip_gendirdeps} \ sed ${GENDIRDEPS_SEDCMDS} .if ${_debug.gendirdeps} -.info ${RELDIR}: raw_dir_list='${dir_list}' .info ${RELDIR}: ddeps='${ddeps}' .endif dir_list += ${ddeps} diff --git a/share/mk/meta.autodep.mk b/share/mk/meta.autodep.mk index 2120c0892475..a4d43f19fec1 100644 --- a/share/mk/meta.autodep.mk +++ b/share/mk/meta.autodep.mk @@ -1,4 +1,4 @@ -# $Id: meta.autodep.mk,v 1.71 2025/08/09 22:42:24 sjg Exp $ +# $Id: meta.autodep.mk,v 1.73 2026/06/21 19:01:21 sjg Exp $ # # @(#) Copyright (c) 2010-2025, Simon J. Gerraty # @@ -275,7 +275,7 @@ META_FILES = ${.MAKE.META.FILES:N.depend*} # objects in subdirs META_FILE_FILTER += S,${_OBJDIR}/,,:O:u # we have to defer evaluation until the target script runs -GENDIRDEPS_ENV += META_FILES="${META_FILES:${META_FILE_FILTER:O:u:ts:}}}" +GENDIRDEPS_ENV += META_FILES="${META_FILES:${META_FILE_FILTER:O:u:ts:}}" .if ${_debug.autodep} .info ${_DEPENDFILE:S,${SRCTOP}/,,}: ${_depend} ${.PARSEDIR}/gendirdeps.mk ${META2DEPS} xtras=${META_XTRAS} @@ -305,7 +305,7 @@ GENDIRDEPS_ENV += MAKESYSPATH=${_makesyspath} GENDIRDEPS_ENV += MAKESYSPATH=${.SYSPATH:ts:} .endif -${_DEPENDFILE}: ${_depend} ${.PARSEDIR}/gendirdeps.mk ${META2DEPS} $${.MAKE.META.CREATED} +${_DEPENDFILE}: .NOMETA ${_depend} ${.PARSEDIR}/gendirdeps.mk ${META2DEPS} $${.MAKE.META.CREATED} @echo Checking $@: ${.OODATE:T:[1..8]} @(cd . && ${GENDIRDEPS_ENV} \ SKIP_GENDIRDEPS='${SKIP_GENDIRDEPS:O:u}' \ From nobody Sun Jun 21 19:51:27 2026 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 4gk25c4mlyz6hfb4 for ; Sun, 21 Jun 2026 19:51: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gk25c42WRz3jZw for ; Sun, 21 Jun 2026 19:51:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782071492; 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=8WObFonUIoYMvS23utZXvjhK9686Fo/0/KC/KQWcLu4=; b=Qx1J3X9ymGxygPbr3Cg7td6vsdPpKa2uu3yqIxnvNQmDhn2eBgKLdhrJFgNEU8kqzcaOjv vnSl3e6pPXqbfKySYGgUWt9dMPT/7MXFVeT4B7Q+zWv3R4KSf0YjQ+cLn/fqOai+Uasrf5 BeNAK77TxwNOjIGXdEj8rjZXKnFWu5DH1POD0csnS9x5XnYZS6pJ4vTgBa8LlwpuaNVxcm T9N9U0vItdTDmT2RcfOY/c+RTYq/De4luHkNqgUrFUtjFdIqTTIG2iR8z6/0yRYXBHSvLZ Ommb//MIaWXxsDI+sJbaWmKIypA2WS8nhugU10UctDztyXid08cjouQBx0qG/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782071492; a=rsa-sha256; cv=none; b=eRKy1ARKq132YJ07HozVFyEp9Im94b+afmy7+duREK1VaQ7elW8d41ci85aUUYcqkkVK3k 6U66Y9tdtEhOPgYMVndifh4iB0ERy3e4oTVKXiZ7fYhVGJkexz3kqW3NkBIAcmkG/w/q4O EjCTdy8jvdYWikmkcvxf6oDaS7Hpzht+WTzxXC483PCXsqiI2bW31MO30uurDQyVKptM65 9fd/rONaVgR8sqKgvHJeM/+YE+/b2jhlTYDWleDg5M2TnD6NgsAs3ggcifG+G0kBWB1158 3SMzjnqNUw7Iy04ctkyG8gImiG6Yob7DjvRi6i6fCwQjmPOt8/H9PwtVRqv2eA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782071492; 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=8WObFonUIoYMvS23utZXvjhK9686Fo/0/KC/KQWcLu4=; b=rglPrW30hLHmtP0H8A+IslcLqKT6/deDnwu9Tf+naG2Q2HfzXdR+STqyF+7yuiNwYE/YYU cmUnjP+2uwMmNDSIuO3OYsT8AVQYfkY+UytXn4oHZoI04WSfhxnP8mQNACNdQpzcl6LdTu GnkqHCFHhv+REVSfZXrHOdCrrdscACmCZyM5mORj3cQtZ4Ekgd8QICUgrTzY+vRkxqgDQn bPe9vYdX0S9aQB+lkLZ9mIYZyAQgudf79V2mqfYxz1+756EN1BGqoJbltJFtzzfqiyXxQ9 lchlTQPaJn66KzZGIHk3O+vGR5bYjcIrTsiuV67hTajPkTVHfXZBjErABV3NZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gk25c2bXbzJb for ; Sun, 21 Jun 2026 19:51:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3a644 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 19:51:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 4c860db34a1b - main - libc: Fix ATOMIC_VAR_INIT visibility 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4c860db34a1b8cff79e7f0d5184423221613e8e1 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 19:51:27 +0000 Message-Id: <6a3840bf.3a644.372aa883@gitrepo.freebsd.org> The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=4c860db34a1b8cff79e7f0d5184423221613e8e1 commit 4c860db34a1b8cff79e7f0d5184423221613e8e1 Author: Dag-Erling Smørgrav AuthorDate: 2026-06-21 19:51:14 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-06-21 19:51:14 +0000 libc: Fix ATOMIC_VAR_INIT visibility Fixes: 28cecfe27964 ("libc: Restrict ATOMIC_VAR_INIT for C23 conformance") Reviewed by: fuz, imp Differential Revision: https://reviews.freebsd.org/D57724 --- sys/sys/stdatomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/stdatomic.h b/sys/sys/stdatomic.h index a3d1f2cd4aeb..24be02e247a3 100644 --- a/sys/sys/stdatomic.h +++ b/sys/sys/stdatomic.h @@ -86,7 +86,7 @@ * 7.17.2 Initialization. */ -#if __ISO_C_VISIBLE < 2023 || defined(__cplusplus) +#if __BSD_VISIBLE || __ISO_C_VISIBLE < 2023 || defined(__cplusplus) #if defined(__CLANG_ATOMICS) #define ATOMIC_VAR_INIT(value) (value) #else From nobody Sun Jun 21 21:48:12 2026 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 4gk4hJ5LDxz6hrbS; Sun, 21 Jun 2026 21:48:16 +0000 (UTC) (envelope-from tijl@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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gk4hJ4LTPz4109; Sun, 21 Jun 2026 21:48:16 +0000 (UTC) (envelope-from tijl@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782078496; 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=U5q6SRGR3l4TW4InuUPf5oWm2aim30zMpLMGBGQPMZc=; b=tOBqnBNqaGwvL5G1zw18he2ZJ04jEJbq8t8wcSsM0pQN/NFhDM9XsIHJlzOHlFPEhHqE58 8jZsR46xJuXUy6ogpf7DTj47jAI606yfO149FaIUK1j1MMvAhnHoQe2BjAOKVXTrIWfDqX vol93CSJ89Ejrd3C3BohidouGfzF4VNsQipXpwyNEzB/O2gex2f19Tb23BPB/gPoLv1jT2 tA96LDcU9Xn/TLeeUMdLkHnzUrjjbF0jgR3SaGvUF/LvPG8bBICkQhyTkgN4ryhQgAduG8 pclB4P4vBn3Cr+fep9+ACe1Elu+c5DyP/lvgjKnYMpCmDdGr994TMQ42yzfufA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782078496; a=rsa-sha256; cv=none; b=GIJ6LYAn9PmmVrCrSEl3hvjGa/4lBCbaYgr+88SdS/fcmuHHlXihbhNCw54KtO0AtlghtR JL19e0cTkUrQLIjiIzLIqbQmbCVtpeQvJIZJD1igw6Vnjf3xfSCF/yWG3wyl+gbfb9mg8d 4G9O4Kx5TN7uALrMR0JPYDlQpYuwcGVbBEg+KsCIKapO5oST0i8V0CsPqgTD3nz1rttNJg gCGBUYjL5uHep2PK8pMbOwq22dTIOsyKa5cDWRevi9M91dSurrOXOJ7TdfBdKOujUwCj8a ND1BKcZQQ8pyRfDnQuJwY/PL73sCi2I+MVJtn6PoMz84zm7MBgwCvxJ+5Iot0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782078496; 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=U5q6SRGR3l4TW4InuUPf5oWm2aim30zMpLMGBGQPMZc=; b=j2gfhXjP9FTy2khvSQSz2I40E9j7uInWKjQjfZWJnc9P6UrF235h+h51l/dC9V94fvrg69 mVO4xPF5/DSewg19JSI5BuMfjR8p6XY2QGlwruv+YMkJnvFcsn1iWkWZSUAcle20T4TRHZ MEs81cVe2CHCazYAwfH93xP0tXTIcm1pErXbG/Z3e3icNVFzCe+buIDAhVcQYAjyqPLnVf 7EmziHOmQmI/LlBk9UXHDhLyRneXorGvHskIcBSlGj1ZufmpIwLrxV0IjGhFzzFtLDFyzD ScxuqV9KoiFAhBypX6nNO0DlOdiJOnjB5Hhy5FfcECQp9NG/18ISGkaFeZfbUw== Received: from hal.tijl.coosemans.org (unknown [IPv6:2a02:a03f:8941:cb00:bd62:68b4:6301:20d7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) 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 4gk4hH3prxz17C1; Sun, 21 Jun 2026 21:48:15 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Date: Sun, 21 Jun 2026 23:48:12 +0200 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Konstantin Belousov Cc: Faraz Vahedi , Warner Losh , alc@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 9d87c1aac4a8 - main - libc: Add missing kill_dependency macro Message-ID: <20260621234812.08eb82dc@hal.tijl.coosemans.org> In-Reply-To: References: <6a35ddd4.24ba1.2ad9343d@gitrepo.freebsd.org> <9A21692F-0B53-4303-85A8-57784BFAF8DE@kfv.io> <33E8BFC4-EA46-41A7-B54F-1AADD3C19D9E@kfv.io> 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sun, 21 Jun 2026 13:13:50 +0300 Konstantin Belousov wrote: > On Sat, Jun 20, 2026 at 11:50:50PM +0330, Faraz Vahedi wrote: >> Hey, >> >> I see. I dug further into related proposals and the reasons why no >> compiler today has implemented true data dependency tracking >> and that they all basically map and promote consume to acquire. >> The kill_dependency is also basically a no-op, and both compilers >> optimise them identically. I did a few tests on my AArch64 box and >> that's how I'm convinced, so I believe keeping the current form >> could be ideal as it fully conforms to the standard and we're assured >> that at least any conforming compiler would support it just fine and >> there's no extension or non-standard tweak in it. On the other hand, >> although adding a separate branch with the GCC style is possible, I >> don't think that'd add any value but visual complications. >> >> Either way, whether dependency tracking changes drastically or this >> very approach becomes obsolete, keeping our header as-is seems >> safe for now. > I am fine with it then. My concern was in subtle breakage of the > code compiled with gcc. I think the GCC definition just enforces that Y and kill_dependency(Y) are expressions so things like the following produce an error. if kill_dependency(foo); From nobody Sun Jun 21 22:07:03 2026 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 4gk56013xNz6ht9p for ; Sun, 21 Jun 2026 22:07: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gk56007pZz43Jn for ; Sun, 21 Jun 2026 22:07:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782079624; 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=D57ApTjrCJiGHh9ZdF6PBlfBzhwrKylSM6AaZvWvt70=; b=v4ICFZ0HLBpbu3akxmv/gMXhay/7kHX8cDvCg4ZnmKMvJ6+YQsX4Y6ruzyyGpHHd+N1Osc V9rDi05qh5FgNviXk+2LjwOzV2uUQXDi8j3Q4DIvEzbnx+jomioRGFj+xkzo0dAwq/s3kO lHW7LqjSuLP8sTqdez20RxGKXfb8CZt2ByNzRK8DzXf1DGVJTme2q6YImBRoUsLt0KO11y 1pzaUydZW4ePF7fCyEuU/xqMUVuiJC1GYXO0srnbzJWnSzZEG504OOTYe6DGG5YJNOe5gi 7uA4Q1WP7Tx/5IH4yShh0b19g8+ppzsVpC7hAMjGfclSExkyas2CxiXukslDKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782079624; a=rsa-sha256; cv=none; b=swD2MmXQWixvgSy5lbMU+A8/RDUL+Am0s/UPOLZzsaxFi0bjejG+Fvg7W2SsbVn1l8ZAvT CpyEJCsKVf5F3ihHpUcg73+OG/U1Y5VhMn7wrpDOrNx7ACcUs887sCdPbThd/iyCGRaIuo G5yhfxUaXOoTSoZ2zHzlNvOcUle0KEgpONsoVUHZtTgbZZyb7REV3ingjI1rZM3Onb1o8z AMwwFsGo+LTGVglsO+DXU2FFryeaDBbs7RV8zPx7ZU+FBYLTQnE71XN8zxl7NZviZmFtzO OboygtDqNBox26BtQrKOjYgrKUM4O3pVgV2OuW40AXnBLFS6N7lRv6B030uvDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782079624; 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=D57ApTjrCJiGHh9ZdF6PBlfBzhwrKylSM6AaZvWvt70=; b=wfGq4e/Kslxr5GsH9Wn3POvKXtdoAFF4SXPu+5/tEFH+WIs3QQomlziInwABNsJzBaoYo1 EoY2e6OXoe98CPbqv1YxkltOCJf5qZotpP6edQrCPgl+hzYOi5zRaqhDaVUoes81X2ZbEk McDPlVxSpA+0D+yf1Y3qn1fTvU+mvDJ3dIjVYeXwz2Xi4hqrNxC0KchAf9Ql7O2kXfx5Dl u0bFcIfhvHOCPBFJiqDERBDy8T3iIC2ND3wEqqaiGJFXot/oy61OMSgnfHu6byGWWkccHz sQtnbUVjMAm0/mH7P5Sp6He31OUSp8Lu5K2+jOsI9uE3ezxPXO3ZYO9QSes96g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gk55z674pz4XG for ; Sun, 21 Jun 2026 22:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1f663 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 22:07:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 9006774e46df - main - powerpc/booke: Extend TID register bits to the max 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9006774e46dfe0859500ce18e1691c75846a884d Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 22:07:03 +0000 Message-Id: <6a386087.1f663.78ed0d0c@gitrepo.freebsd.org> The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=9006774e46dfe0859500ce18e1691c75846a884d commit 9006774e46dfe0859500ce18e1691c75846a884d Author: Justin Hibbits AuthorDate: 2026-06-21 20:28:55 +0000 Commit: Justin Hibbits CommitDate: 2026-06-21 21:23:57 +0000 powerpc/booke: Extend TID register bits to the max Some Book-E cores (at least e6500) can have much larger PID fields, up to 14 bits. Extend the PID mask space to the full space, and future changes may take advantage of this extended space. --- sys/powerpc/booke/trap_subr.S | 2 +- sys/powerpc/include/tlb.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/powerpc/booke/trap_subr.S b/sys/powerpc/booke/trap_subr.S index 789e746dba3e..cb4d99e6fffb 100644 --- a/sys/powerpc/booke/trap_subr.S +++ b/sys/powerpc/booke/trap_subr.S @@ -712,7 +712,7 @@ search_kernel_pmap: /* Force kernel tid, set TID to 0 in MAS1. */ li %r21, 0 - rlwimi %r28, %r21, 0, 8, 15 /* clear TID bits */ + rlwimi %r28, %r21, 0, 2, 15 /* clear TID bits */ tlb_miss_handle: /* This may result in nested tlb miss. */ diff --git a/sys/powerpc/include/tlb.h b/sys/powerpc/include/tlb.h index 33d31efab604..2a460251e292 100644 --- a/sys/powerpc/include/tlb.h +++ b/sys/powerpc/include/tlb.h @@ -46,7 +46,7 @@ #define MAS1_VALID 0x80000000 #define MAS1_IPROT 0x40000000 -#define MAS1_TID_MASK 0x00FF0000 +#define MAS1_TID_MASK 0x3FFF0000 #define MAS1_TID_SHIFT 16 #define MAS1_TS_MASK 0x00001000 #define MAS1_TS_SHIFT 12 From nobody Sun Jun 21 22:07:04 2026 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 4gk5612zc8z6htCj for ; Sun, 21 Jun 2026 22:07: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gk5610Gvnz42xp for ; Sun, 21 Jun 2026 22:07:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782079625; 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=mBwWhpNB493eQJiWSIVkjELI23IiLDG7NVmHDyCk5Jg=; b=S0mwEic7jpuHE6P6ogehpgXEVlrwkvzeB5phcXBsLYSzUsjq4mh73TTh3qYUe6nmfjDiUU iteOiru0NZS5gQtVRZCP7x55Tv7UUVJcj0lgXU2A9BqcwO9GINSWAPVQgcIYkJutoOI7iv UXV6xHaLKjuJs7gVhRch+FkPfis0vY9r6UknHqwi3ECwGgsp25Tyl5Q1Yrsns3Dwct8gaG /kgeMhkhE3NqhoEEtBnTlj9r8ANyk0DUmhSW1gPZvIecf4z4g0J54eTW/sEUlBk1JFY0Wd WLtq67eW2om+56RquoUWepvJIG45kNpOKURLlfXJ7OHo5vsJk3p/8O6K0M7Y+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782079625; a=rsa-sha256; cv=none; b=ycq3Qy6uruKuuqJsvgKWiRLOzmddMw+26hD9ktmh5jDczeVO7Ub7rXa2m+DNqSb48C1P3b H6jcuCkt1CPEao3aCCqwZiXYFMPb32SgGa0WCL7TYogdcN9Wv7m3/PHL48k86/4KdMi67J raSwm5qZxOqR529hgu40pml/DQS0FOS77lOJpYv8VGMdSLZxJAQLVk2C6/xbAe/rhc4OkT KMlw4GO6TEeA/c47kyb0iYHO4dNrueX5Ex134EE+0akKLFF3ufcJMeuwmsz42SUiWm3YG+ J3ynx41xCJaH9uGxM5CzYZOWkmfsFEwtAn6DKTzmxXsFk2X6ygdXbGfGYJX+Tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782079625; 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=mBwWhpNB493eQJiWSIVkjELI23IiLDG7NVmHDyCk5Jg=; b=iMZzhWnLVDoDEXJvc5eO6hNTFtoituoONMRB32Wv6NJ6tOB48HLh8o7RTpg6ZSeC+j3OHn qW76/a/YeGt3GypZMF+yF9f1RK4tVILaY4lC4N6edTQfKDTomgiDRqDgOS133HYscW2kyo QmYSb5ZGfZXoKu3HN72uCscPhAw2Y4mLmSLZ4LZ9P6lmW9VqBtM9QZR+LWjgznJVXCqWSY vZE0CkX6pYuP9mwU4q7lln2Qh/bBqpK9vZhEBvPfHI6ck8z6qghC0oBm852T64KJ0MfMjN IEwBDy/jqayFRmzev3qS2og5kDKCfI0BXoygYWcOfCj+F8FqMXpzHLp+gUvCLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gk5606SFJz4ll for ; Sun, 21 Jun 2026 22:07:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 20d3b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 22:07:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 9faeaac936ae - main - powerpc/pmap: Use variable-sized TID 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9faeaac936aea78f9b5ce1a8ad3d27e2632d4e37 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 22:07:04 +0000 Message-Id: <6a386088.20d3b.d76b1bd@gitrepo.freebsd.org> The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=9faeaac936aea78f9b5ce1a8ad3d27e2632d4e37 commit 9faeaac936aea78f9b5ce1a8ad3d27e2632d4e37 Author: Justin Hibbits AuthorDate: 2025-12-17 03:20:55 +0000 Commit: Justin Hibbits CommitDate: 2026-06-21 21:24:03 +0000 powerpc/pmap: Use variable-sized TID e6500 core supports 14-bit TIDs (16384), while all earlier cores support only 8 bit TIDs. Dynamically allocate the tidbusy array at bootstrap time so that it stays in the TLB1, but is sized appropriately for the core. With MAXCPU of 32, a e6500 tidbusy would be (8 * 32 * 16384), or 4MB for this array, while e5500 would use (8 * 32 * 256), or 64kB. --- sys/powerpc/booke/pmap.c | 52 ++++++++++++++++++++++++++++++++++++++++------- sys/powerpc/include/spr.h | 2 ++ 2 files changed, 47 insertions(+), 7 deletions(-) diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c index 625d57940c01..310d38d5c450 100644 --- a/sys/powerpc/booke/pmap.c +++ b/sys/powerpc/booke/pmap.c @@ -87,6 +87,7 @@ #include #include #include +#include #include #include #include @@ -204,8 +205,10 @@ extern int elf32_nxstack; /* TLB and TID handling */ /**************************************************************************/ -/* Translation ID busy table */ -static volatile pmap_t tidbusy[MAXCPU][TID_MAX + 1]; +/* Translation ID busy table (dynamically allocated) */ +static __inline void tid_set_busy(int cpu, int tid, pmap_t pmap); +static volatile pmap_t *tidbusy; +uint32_t tid_max; /* * TLB0 capabilities (entry, way numbers etc.). These can vary between e500 @@ -637,6 +640,7 @@ mmu_booke_bootstrap(vm_offset_t start, vm_offset_t kernelend) vm_size_t kstack0_sz; vm_paddr_t kstack0_phys; vm_offset_t kstack0; + uint32_t tid_bits; void *dpcpu; debugf("mmu_booke_bootstrap: entered\n"); @@ -660,6 +664,18 @@ mmu_booke_bootstrap(vm_offset_t start, vm_offset_t kernelend) /* Read TLB0 size and associativity. */ tlb0_get_tlbconf(); + /* + * Calculate the max TID from the hardware. Allow overriding with a + * tunable. The tunable should be a power of 2. + */ + tid_bits = ((mfspr(SPR_MMUCFG) & MMUCFG_PIDSIZE_M) >> MMUCFG_PIDSIZE_S); + TUNABLE_INT_FETCH("machdep.tid_max", &tid_max); + if (tid_max <= 0) + tid_max = INT_MAX; + else + tid_max = 1 << ilog2(tid_max); + tid_max = min((1 << tid_bits), tid_max) - 1; + /* * Align kernel start and end address (kernel image). * Note that kernel end does not necessarily relate to kernsize. @@ -668,6 +684,11 @@ mmu_booke_bootstrap(vm_offset_t start, vm_offset_t kernelend) data_start = round_page(kernelend); data_end = data_start; + tidbusy = (void *)data_end; + printf("tidbusy at %p\n", tidbusy); + printf("tidmax = %d\n", tid_max); + data_end += round_page(sizeof(pmap_t) * MAXCPU * (tid_max + 1)); + /* Allocate the dynamic per-cpu area. */ dpcpu = (void *)data_end; data_end += DPCPU_SIZE; @@ -913,7 +934,7 @@ mmu_booke_bootstrap(vm_offset_t start, vm_offset_t kernelend) kernel_pmap->pm_tid[i] = TID_KERNEL; /* Initialize each CPU's tidbusy entry 0 with kernel_pmap */ - tidbusy[i][TID_KERNEL] = kernel_pmap; + tid_set_busy(i, TID_KERNEL, kernel_pmap); } /* Mark kernel_pmap active on all CPUs */ @@ -2460,6 +2481,22 @@ mmu_booke_page_array_startup(long pages) /* TID handling */ /**************************************************************************/ +static __inline void +tid_set_busy(int cpu, int tid, pmap_t pmap) +{ + tidbusy[cpu * (tid_max + 1) + tid] = pmap; + if (pmap == NULL) + pmap->pm_tid[cpu] = TID_NONE; + else + pmap->pm_tid[cpu] = tid; +} + +static __inline pmap_t +tid_get_busy(int cpu, int tid) +{ + return (tidbusy[cpu * (tid_max + 1) + tid]); +} + /* * Allocate a TID. If necessary, steal one from someone else. * The new TID is flushed from the TLB before returning. @@ -2477,21 +2514,22 @@ tid_alloc(pmap_t pmap) thiscpu = PCPU_GET(cpuid); tid = PCPU_GET(booke.tid_next); - if (tid > TID_MAX) + /* tid_max is always a power-of-2-minus-1, so check for overflow. */ + if ((tid & ~tid_max) != 0) tid = TID_MIN; PCPU_SET(booke.tid_next, tid + 1); /* If we are stealing TID then clear the relevant pmap's field */ - if (tidbusy[thiscpu][tid] != NULL) { + if (tid_get_busy(thiscpu, tid) != NULL) { CTR2(KTR_PMAP, "%s: warning: stealing tid %d", __func__, tid); - tidbusy[thiscpu][tid]->pm_tid[thiscpu] = TID_NONE; + tid_set_busy(thiscpu, tid, NULL); /* Flush all entries from TLB0 matching this TID. */ tid_flush(tid); } - tidbusy[thiscpu][tid] = pmap; + tid_set_busy(thiscpu, tid, pmap); pmap->pm_tid[thiscpu] = tid; __asm __volatile("msync; isync"); diff --git a/sys/powerpc/include/spr.h b/sys/powerpc/include/spr.h index afa1692bed75..40911a7c293d 100644 --- a/sys/powerpc/include/spr.h +++ b/sys/powerpc/include/spr.h @@ -868,6 +868,8 @@ #define BUCSR_BBFI 0x00000200 /* Branch Buffer Flash Invalidate */ #define SPR_MMUCFG 0x3f7 /* ..8 MMU Configuration Register */ +#define MMUCFG_LPIDSIZE_M 0x0F000000 +#define MMUCFG_LPIDSIZE_S 24 #define MMUCFG_PIDSIZE_M 0x000007c0 #define MMUCFG_PIDSIZE_S 6 #define MMUCFG_MAVN_M 0x00000003 From nobody Sun Jun 21 22:07:06 2026 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 4gk5622PMHz6htJ8 for ; Sun, 21 Jun 2026 22:07: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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gk56217l4z43Jp for ; Sun, 21 Jun 2026 22:07:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782079626; 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=TtUFOmfqWy//oMKlw6UpoI9Fve45UDyXbfR3kbtdUa8=; b=f6bp8o+6goC1VG9lh+IQNHkLptAkHYX6zH5oVsisxGIiq5mclZBkS+0kJ1/AWJEPEGUhdi wxOBefL4Pi7EScgFAXDjPEWM4ohlICZbF9pCc7HT2BKS4CAdy3XGDcb1iv4fHLGlzAI4wM 5tKTl+M+IlonrgSvubE3us3DJ0kMXN4Mi3hQXpCNcp5jqRRjl51AzxpaCSUSkkbiyJXbSY 90uSIwgniMCFs8mdiqyJyZFC1jxERTter3yT5hgCg7oTP8rxBBl1okXlT98N78MCn+wK39 s6bRTMwEC6ofCv4OUDm9i+lA5tW41gbQ92VaVjd37knR+kn+ifiR3aqgZQoZ1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782079626; a=rsa-sha256; cv=none; b=ZBnbgIsGsFREoC4+d1B1lSVCJRVayWzHOJFriCa0yT4UMclKYZIvtQwkkSAk7MGKA8Wa2q haridovWmuxlIF1cAo5gGrJiF6xtMpCrEG88DMBcZHs+E45qf60ku9IisadJbFmIDTh5yS dzXpXppPCXflj+6h4uQg5GvjHs98S7EOmo7Ow1kEMy8xZW7iDGLXWjDfmfkPweQWFjNwrR V9ZKu6dnNzUOOYiBTtdPLuU8GBOndDDi4uoRacoU59lpozF64U965mwSNqd0r912+vqD0a QCyLso0uyYOgUtSAnyodDGJR9ViJNVA5b/yeRs94xQoskLGsAxHzZnvRtHzQ1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782079626; 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=TtUFOmfqWy//oMKlw6UpoI9Fve45UDyXbfR3kbtdUa8=; b=fJJAS73PqiZX0niJZgMet5vjY2HdAj3zdU8xRcnSs+FvCZ30g8aLPLUSgFV8trCv2Dyuo5 0sE/NMt0mOETBwaFHMH2ZrBwJcCtfOZWXnFqPwt5NL5zC7XB9ptpEm50IY/vZ/Ap+DyApS JXJ+lmOR0D4zZksc+ntQOtpJar+3MsYOG2Q/vyvnwwOO5PAXTvprOWFj+JhVGehQA0roMK h/9BoAafyw+rQ24o+k46UplddeLYFrtr83DgoquST7w+OuhTvUDUavybeNnSVoU8ZlNWo3 2LFlxI4CPEILJIt/y/NFayy2iTiCR7u+RXKm+19r1n8i4sDV4rqPHLfbUNg0Ng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gk56208k5z4LV for ; Sun, 21 Jun 2026 22:07:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2110f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 22:07:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: b3249ed3a6ed - main - powerpc/booke: Save watchdog context to "critical" save area 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b3249ed3a6edb993b9acea6358c103d591afb08b Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 22:07:06 +0000 Message-Id: <6a38608a.2110f.18e79c36@gitrepo.freebsd.org> The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=b3249ed3a6edb993b9acea6358c103d591afb08b commit b3249ed3a6edb993b9acea6358c103d591afb08b Author: Justin Hibbits AuthorDate: 2026-06-21 21:58:44 +0000 Commit: Justin Hibbits CommitDate: 2026-06-21 22:00:34 +0000 powerpc/booke: Save watchdog context to "critical" save area Watchdog interrupt is a "critical" interrupt, so save the correct registers (CSSRn, into critical save area). --- sys/powerpc/booke/trap_subr.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/powerpc/booke/trap_subr.S b/sys/powerpc/booke/trap_subr.S index cb4d99e6fffb..4bfd2118fb8f 100644 --- a/sys/powerpc/booke/trap_subr.S +++ b/sys/powerpc/booke/trap_subr.S @@ -613,8 +613,8 @@ INTERRUPT(int_fixed_interval_timer) * Watchdog interrupt ****************************************************************************/ INTERRUPT(int_watchdog) - STANDARD_PROLOG(SPR_SPRG1, PC_TEMPSAVE, SPR_SRR0, SPR_SRR1) - FRAME_SETUP(SPR_SPRG1, PC_TEMPSAVE, EXC_WDOG) + STANDARD_CRIT_PROLOG(SPR_SPRG1, PC_BOOKE_CRITSAVE, SPR_CSRR0, SPR_CSRR1) + FRAME_SETUP(SPR_SPRG1, PC_BOOKE_CRITSAVE, EXC_WDOG) b trap_common From nobody Sun Jun 21 22:23:32 2026 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 4gk5TK0RLDz6hvZ3 for ; Sun, 21 Jun 2026 22:23:49 +0000 (UTC) (envelope-from kfv@kfv.io) Received: from outbound.qs.icloud.com (qs-2007a-snip4-11.eps.apple.com [57.103.84.141]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4gk5TJ2gKjz45rr for ; Sun, 21 Jun 2026 22:23:48 +0000 (UTC) (envelope-from kfv@kfv.io) Authentication-Results: mx1.freebsd.org; none Received: from outbound.qs.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-east-2d-20-percent-0 (Postfix) with ESMTPS id 04DBA18000AD; Sun, 21 Jun 2026 22:23:46 +0000 (UTC) X-ICL-Out-Info: HUtFAUMHWwJACUgATUQeDx5WFlZNRAJCTQ1OHVwBXxxHAVYCXQRLVxQEE1UbdwBUBhcRXE1RDw8bXw4dBFhLQBMETxMFUgddTVYNRw9YHlwUFwlAQ14IXh9MHB0OWAYSAE0KDjYGWQVeCVYDQwU2EhRdRVgLQUVbHxkVWgkKVwtEfE11WwZYH0MASwNAA10GMhQ5cFwHRgZJDUsBXgcoAEALTXMGUR0cGVZGExlOG1dNWg1AGVgGbRRWFVIEWQ== Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kfv.io; s=sig1; t=1782080627; x=1784672627; bh=9xLNq4WTZisfg/QcLIWf+9skWlXhvH/IszYVlQ0s1Xo=; h=Content-Type:Mime-Version:Subject:From:Date:Message-Id:To:x-icloud-hme; b=bVykuuKbhWzjWYqYoAwSCBA82uc79CKFz2fef0rZGcsoboZSSfmwyt72yRmw+oxnJRFEwZEvn+EeqBBMcf51dFHcrIxwVGX1EMb3OlV96tjTa6IPsGqZwv9t44ET70RNgFXbkDJso1FIMVQ8nt9T+hPUSRHRCf1ySJNmPgdlqEBc54oX4YM5iqoUXaoICEzeVax/mmTZSgT5zNufHW2p4cu1aROJgvnExlSc7sqMfWi2uWulDBHgImJVAy9xzdg86qTMOrb3Bw4vexHgm/7OXVO+si8OZUrwTE2owat4xtsjiOStGEfjwI9/bElfxBdiNYqwlzmv0vYINrWzGRCC9w== mail-alias-created-date: 1649693719123 Received: from smtpclient.apple (unknown [17.57.155.37]) by p00-icloudmta-asmtp-us-east-2d-20-percent-0 (Postfix) with ESMTPSA id 24CDF18000B5; Sun, 21 Jun 2026 22:23:44 +0000 (UTC) Content-Type: multipart/signed; boundary="Apple-Mail=_08F512C1-75C5-4EDD-89B5-12DCBEBD9632"; protocol="application/pgp-signature"; micalg=pgp-sha256 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.100.1.1.5\)) Subject: Re: git: 28cecfe27964 - main - libc: Restrict ATOMIC_VAR_INIT for C23 conformance From: Faraz Vahedi In-Reply-To: Date: Mon, 22 Jun 2026 01:53:32 +0330 Cc: Mark Millard , Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Nuno Teixeira Message-Id: <94E5F613-3930-464B-AC10-4943230C2025@kfv.io> References: <6a35ddd3.22963.721d614@gitrepo.freebsd.org> <4e902fcf-e79c-47b5-a51f-4881c09f7528@yahoo.com> To: Warner Losh X-Mailer: Apple Mail (2.3864.100.1.1.5) X-Proofpoint-ORIG-GUID: vRDH40jpTKbc5x1oRg01mmeGAOC3MHV0 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjIxMDIyOSBTYWx0ZWRfX0pMQF0FkfZK6 PCmeKM29fgX7unIKi3BlLy3man4JYT8NwuFkz3p/km9cQhyZHHFHVvI+56vlV/HwTWpX+Ezvogt ZukSmO2G0uHa4x6L1tn7B8rKT7wpNzKMBQyHh3QvN6D8rOnA8faBV9c/UN8S7vPl0y+QgCiiegJ i6IOsb7nfGqEMuBVvz0P1IsEiH+aC4m7oWssgeRIHlgGVf06vAvaonxfHMbbpimhE7QIglhTa0l athTfJmY/YIcCrsMzK5NB+o7NOdEDh878MMgGhQh3G41sdYADj4XJ6VzefsWCyc45HNSE8znl4d 655GrxFGkq6UUQ838AI X-Proofpoint-GUID: vRDH40jpTKbc5x1oRg01mmeGAOC3MHV0 X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:714, ipnet:57.103.84.0/22, country:US] X-Rspamd-Queue-Id: 4gk5TJ2gKjz45rr X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated --Apple-Mail=_08F512C1-75C5-4EDD-89B5-12DCBEBD9632 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Hello everyone, My sincere apologies for replying so late and for missing the thread. D57724 looks reasonable, but I would probably just change the gate from __ISO_C_VISIBLE to __STDC_VERSION__. I think that is what I should have done in the first place. That would make more sense for obsolete language constructs, I believe. This way, __ISO_C_VISIBLE is kept solely for API visibility, and strict rules of a specific language mode are checked against the exact mode in use, rather than what API interfaces we have decided to expose. So exposure is not constrained, just determined independently. I think this is the subtle distinction I failed to keep in mind while I was working on the patch. Please let me know what you all think, and again, please accept my apologies for missing both the thread and the review of D57724. Cheers, Faraz P.S. As a minor follow-up, it may be worth revisiting whether gating via __STDC_VERSION__ < 202311L would be preferable to the recently committed __BSD_VISIBLE condition, as it aligns more directly with language standard level rather than exposure of the platform-specific interfaces. --Apple-Mail=_08F512C1-75C5-4EDD-89B5-12DCBEBD9632 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEnunneCmADnpNx8ZMLdpU9MVz/74FAmo4ZGQACgkQLdpU9MVz /76V+hAAxv/sZni8vGTpnrt/K3uulchyTbtzQ9eJsxn0P6MxE8bIsZ4ZdGJtlvU1 H+YphK5cbSn2nXI2xDoog8SgyTkciRen6sYVqEY4Llg100S9yuIsQfdgRtzSn3FX UF+9ZENXKIP/KeIWs30wXl4kxH58TVx48gbGto9hLTcI0RTnSLeh4UQc1ATc82bm 4WSAJv5DgPMG/3mmDQ3NuOiUQNwtbz2vOa0+2ZAKszgJmdJATJEClHEjkt3f4iac aMcKAyddvJ/YBGsuKOPjwGXgyeit6ZpYZoTRInJq++4kFl8OXQv3h7YFMTERCCV1 2sA1Sw0nLM97fEPFs2LXUsn2PBOX+19gHNj63of55Z72gUBmFH+/YaOLsNZXAlCL jljNvxPfMtRYEIQ+RtxgWnzGOJd1lCIVM3+r/jOulLvGRhJLaEwXguYHJeOFzIoH fPoz+hofoMoWxkoDHp42KlDO2XyBDJF5f6rhaAmP8zJ0ckOHYF7LdFC8q3b8GNab oxXqWM4Sq7sJQTk4TQfwPAViEX7K5WHiuCWMG9y0DuUtuAj4Gukw06DUARCczHIg JcxVmh8FbBkAgW+zDNFcr4ITwwSh51TQ+Gp1Bxrr8oft2fwHI+l7JRedMQhwQEz8 I1FIstIlk0O5M+4l6Pd1hFky33elZ4pWX4VW+yTBtv/HhWj4yNs= =AuVf -----END PGP SIGNATURE----- --Apple-Mail=_08F512C1-75C5-4EDD-89B5-12DCBEBD9632-- From nobody Sun Jun 21 22:29:15 2026 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 4gk5bt4QSvz6hwDQ for ; Sun, 21 Jun 2026 22:29:30 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gk5bt0x8Cz46LW for ; Sun, 21 Jun 2026 22:29:30 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-49241a577d8so16184985e9.3 for ; Sun, 21 Jun 2026 15:29:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782080967; x=1782685767; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=aQ7tDvWbX6tPNtAE+zVnEkkL2SKJ2tDF1Lzyjs3cwQc=; b=UyYe0X1qlKzHhRgOme+n17yezFPpS63zTxbTg9o1Y1nQR4h/lue5mt6/h12HHLehyg +DGQJQb9FFSdlvrYq+ZtBYxfGV9ojKNLmKfciXXNZlePwxgv1oWaSKwVpFuvbstHmhfW /dFEx7CZk0FpdH4HPocYnsRKuIFoV2YlsWromeUPD8xmPcjB60b86IgQ4w4UEzFaK7YR 5OcYV2EvuFinH+FdbElC3Vuvk0B8/wx1//90WDbM3KofN1tRpRnP2VtxhvtDxRjVUmaN P9kDEwoDU++GF1QDaOuufaNw2bv2IbN9XlcEsdY5ewwQdIYICTZdui68JSQtCoDH8J6v ySpg== X-Forwarded-Encrypted: i=1; AFNElJ/l6ezsc0bIH0MIWo0FB8qdPWFTo5LKWquTfGy+6QptAEQb8MMdTb1V+IH0I6tmtMF+aoErByLzphDSnt8nORoMDLqnww==@freebsd.org X-Gm-Message-State: AOJu0Yw2M6BEHfCwj7rTi/EFaRuoKfE2RCB8lUWAsAU8RQbCYBBtrpDf QfUb8+Wkg196iRzlXW3zGmE5lUECs+sbLGeUbH6qeESLDfDSo2rLr3TKoQvUxCINBSs= X-Gm-Gg: AfdE7ck3zixu4MD3KEig9iAgXh2+DbA+W1RZYdsg/VZyfLLCWXJ0up4MJuzYwQ1GER5 DqicuStbBLr6IUmWN/e354qUkL2ElKKFK69dqQSdKWbHk4jcXXRvwiR66ksVA/lYP1G8Eb15wb8 BJ81//VkTJuivxk/7Wo+j+pNt3MokPCyXkQb68kR9o2BCInbfJvr+aBxpycFZ4rZdJd2ctf/Qp+ 6qnU6wjoKShu6YhmoP1rquIPMyOPa50XQ3iHmWrHoIhsU+RQmt4hIa9KxuuKqKp02sh+8Y70/f9 CEdPVB1ANW9ZesNsHv7YXEjKahE40aVwilad6VJ5u6BkrNa7vdzbwjaf2X3K/7ODSprKKOQQvLf s92m3Qt35lM0TqzTDgclvIoNOkRqZp+D8tvWfYqNasbMSfS2bQfzYAPLcFhktiGyNYGsj12d8BV HYUuMyTc6KU5oZvQPMPm1SyzEdxKjnhtIIp8BJ5qBe/kAxy5Ie/0Ciyab2EFo= X-Received: by 2002:a05:600c:5702:b0:492:3172:bcf0 with SMTP id 5b1f17b1804b1-49240e20dd5mr153883345e9.3.1782080967453; Sun, 21 Jun 2026 15:29:27 -0700 (PDT) Received: from smtpclient.apple (nat-184-161.net.cam.ac.uk. [131.111.184.161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4666712ce9asm19888931f8f.37.2026.06.21.15.29.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Jun 2026 15:29:26 -0700 (PDT) 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3891.100.17.1.3\)) Subject: Re: git: 28cecfe27964 - main - libc: Restrict ATOMIC_VAR_INIT for C23 conformance From: Jessica Clarke In-Reply-To: <94E5F613-3930-464B-AC10-4943230C2025@kfv.io> Date: Sun, 21 Jun 2026 23:29:15 +0100 Cc: Warner Losh , Mark Millard , Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Nuno Teixeira Content-Transfer-Encoding: 7bit Message-Id: <49991683-E7ED-4E47-B08A-EC78C4582E55@freebsd.org> References: <6a35ddd3.22963.721d614@gitrepo.freebsd.org> <4e902fcf-e79c-47b5-a51f-4881c09f7528@yahoo.com> <94E5F613-3930-464B-AC10-4943230C2025@kfv.io> To: Faraz Vahedi X-Mailer: Apple Mail (2.3891.100.17.1.3) 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: 4gk5bt0x8Cz46LW X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On 21 Jun 2026, at 23:23, Faraz Vahedi wrote: > Hello everyone, > > My sincere apologies for replying so late and for missing the thread. > > D57724 looks reasonable, but I would probably just change the gate > from __ISO_C_VISIBLE to __STDC_VERSION__. I think that is what > I should have done in the first place. That would make more sense for > obsolete language constructs, I believe. > > This way, __ISO_C_VISIBLE is kept solely for API visibility, and strict > rules of a specific language mode are checked against the exact mode > in use, rather than what API interfaces we have decided to expose. So > exposure is not constrained, just determined independently. I think this > is the subtle distinction I failed to keep in mind while I was working on > the patch. > > Please let me know what you all think, and again, please accept my > apologies for missing both the thread and the review of D57724. > > Cheers, > Faraz > > P.S. As a minor follow-up, it may be worth revisiting whether gating > via __STDC_VERSION__ < 202311L would be preferable to the > recently committed __BSD_VISIBLE condition, as it aligns more > directly with language standard level rather than exposure of the > platform-specific interfaces. If doing this, be careful; C89 does not define __STDC_VERSION__, it was only introduced in later versions to differentiate it from the original language version. Jessica From nobody Sun Jun 21 22:44:23 2026 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 4gk5xS5MQKz6hxSq for ; Sun, 21 Jun 2026 22:44:44 +0000 (UTC) (envelope-from kfv@kfv.io) Received: from outbound.ms.icloud.com (ms-2005g-snip4-6.eps.apple.com [57.103.72.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4gk5xS1h9Rz47yf for ; Sun, 21 Jun 2026 22:44:44 +0000 (UTC) (envelope-from kfv@kfv.io) Authentication-Results: mx1.freebsd.org; none Received: from outbound.ms.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-3a-60-percent-1 (Postfix) with ESMTPS id 9AD481800102; Sun, 21 Jun 2026 22:44:40 +0000 (UTC) X-ICL-Out-Info: HUtFAUMHWwJACUgATUQeDx5WFlZNRAJCTQ1OHVwBXxxHAVYCXQRLVxQEE1UbdwBUBhcRXE1RDw8bXw4dBFhLQBMEQBMFUgddTVYNRw9YHlwUFxVAQ14IXh9MHB0OWAYSAE0KDjYGWQVeCVYDQwU2EhRdRVgLQUVbHxkVWgkKV3REfD0BKQdZH0EMSgZAA1sKNBRBBSgDRgpICjwDLnFZdzIATnMGUR0cGVZGExlOG1dNWg1AGVgGbRRWFVIEWQ== Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kfv.io; s=sig1; t=1782081883; x=1784673883; bh=7wwcB4lJbXeEbObFDeYwzQ9En2uJTqGsmM2tHxKkcVo=; h=Content-Type:Mime-Version:Subject:From:Date:Message-Id:To:x-icloud-hme; b=NmVM4V8Zy+f7VAeF7Ecj+5L0F2ASNYPJkcNlNWr4Q8osJ6zM2lBLG04PfkVbZz3kO7vFVl5nLWXgnS/rOoZKbcPf4ZBox49tD7urGcs3jX5lQhNpiww0afFYQPMghnzFgFhTSu/TJxHk090TWFyJdq02hONMVggEnH4OeasolvzOt8eDJfYAldU2hFxCq1Qwac6FrDpc+vu0IBuZwi7lNB76V3bhfeA6WZKzF1ZHMe8J+3hQ1co/qO6hgc35h1uAMJjUbhvTp50VyaorcVwshxQtNh/h50iEpGNT+44MJJzcPizfvlG7uHA/kIAzxXKc1qePLNcyzd9BvY8nvYtvdg== mail-alias-created-date: 1649693719123 Received: from smtpclient.apple (unknown [17.57.154.37]) by p00-icloudmta-asmtp-us-west-3a-60-percent-1 (Postfix) with ESMTPSA id 57C051800108; Sun, 21 Jun 2026 22:44:37 +0000 (UTC) Content-Type: multipart/signed; boundary="Apple-Mail=_779CCC88-37A6-4657-92EA-4DFFC00C46D4"; protocol="application/pgp-signature"; micalg=pgp-sha256 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.100.1.1.5\)) Subject: Re: git: 28cecfe27964 - main - libc: Restrict ATOMIC_VAR_INIT for C23 conformance From: Faraz Vahedi In-Reply-To: <49991683-E7ED-4E47-B08A-EC78C4582E55@freebsd.org> Date: Mon, 22 Jun 2026 02:14:23 +0330 Cc: Warner Losh , Mark Millard , Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Nuno Teixeira Message-Id: References: <6a35ddd3.22963.721d614@gitrepo.freebsd.org> <4e902fcf-e79c-47b5-a51f-4881c09f7528@yahoo.com> <94E5F613-3930-464B-AC10-4943230C2025@kfv.io> <49991683-E7ED-4E47-B08A-EC78C4582E55@freebsd.org> To: Jessica Clarke X-Mailer: Apple Mail (2.3864.100.1.1.5) X-Proofpoint-GUID: CYWVK_3b1EnIDP-Rq-oCbpRqu57zkk7W X-Proofpoint-ORIG-GUID: CYWVK_3b1EnIDP-Rq-oCbpRqu57zkk7W X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjIxMDIzMyBTYWx0ZWRfXzYesW4Z7epWl Qbe/TdHxTm0BVx0n0KhJexrCLtPug9v8x9JQO5iQZQSrM8olHoDFM/Nll3s1vgQ/BXMUhDpDbRs ilibL/HtbuG+m1No//ozhLNdl6imw29jsBqUrqLHFAnxW3Ji79j4YsUBZ3BcR17fqY15gwogNDv k3OjHtfQmoc/KKOiuJo91AIRD1dLJY6w7HcpYXxN1Xl4owxhRvcKtLus9qX50m4pZIm/wg7f8XK 3jspVzHzHBe6UVmX7fhhxbOkHbxkW1GtzyzDGjSXYu1RAKwkHxj8LmvN9/lDZ4WNYFImNkQNAu+ J5tgco4Ub4VS6kHTSST X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:714, ipnet:57.103.72.0/22, country:US] X-Rspamd-Queue-Id: 4gk5xS1h9Rz47yf X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated --Apple-Mail=_779CCC88-37A6-4657-92EA-4DFFC00C46D4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > If doing this, be careful; C89 does not define __STDC_VERSION__, it = was > only introduced in later versions to differentiate it from the = original > language version. Neat point, thanks! I didn=E2=80=99t know that.= --Apple-Mail=_779CCC88-37A6-4657-92EA-4DFFC00C46D4 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEnunneCmADnpNx8ZMLdpU9MVz/74FAmo4aUcACgkQLdpU9MVz /77spA/+NtHVRt/X7X5RIAD2gDw2g4LkVeh3cI3dKemKSEgumsKvDY2bgauXGkoP MCS9MmC6uhVbwmcbfnkqhempeypvZ2rMrp4wzMNC8iImdnP8p2euvlpZ+7X4rKwe prDnttAni9NfG3B5KXVkUpYmY/jg7pC3o+lITuURVqXqryE09bwhJ7cu1Hb/Conv KjzBgvWcbEI1KNccS+vBpO3YFXBV3ABGx6JVGkW/oMs61jq8kTdVCrQqZVQbevoZ F7SymStGpL8JaQfETXD3/YCSE4dwk8oz7Dzp65IfLL1ZgaEIjUBVH/4M1AmRAIU1 eDnaQirXtBnmdfCJRwirxj58gIEtApS23xoVyIebHv0yB1eoDJl1fd3QBQkiRZD4 v3eXDkEhfKtRSl3WW89VIEnwvnT4+1rcYBQhKTvDeEuM94819oqnbd59yS2XUXUn P7D41hL0pVgnnP7sXmnbRh56+XkmMBEIE21pc0mCVjsOdxz/LqeR5SxD8kUWFzgS iofkRgoHe2gCcXxf7fsjsZTFqR3MRHH4eJFgvdoDaCmo1JsYfEjv5FKSQFLDzVnR xFSzSUKyJs47c5A0Z87Pp4DVd+6eneOWiL2jlupIb78k5ccKo4em4U18h/o6Lz9+ IYm9u8ubAGWoXKDiWBtv0PH0pDNnNLUbxgDttI9yEwBFx1Fu/80= =bu2W -----END PGP SIGNATURE----- --Apple-Mail=_779CCC88-37A6-4657-92EA-4DFFC00C46D4-- From nobody Sun Jun 21 22:59:40 2026 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 4gk6Gz56zWz6hyg4; Sun, 21 Jun 2026 22:59:55 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4gk6Gy2s9Lz3Bq5; Sun, 21 Jun 2026 22:59:54 +0000 (UTC) (envelope-from kib@freebsd.org) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=freebsd.org (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kib@freebsd.org) smtp.mailfrom=kib@freebsd.org Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 65LMxe6N023686; Mon, 22 Jun 2026 01:59:43 +0300 (EEST) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 65LMxe6N023686 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 65LMxeQQ023685; Mon, 22 Jun 2026 01:59:40 +0300 (EEST) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Mon, 22 Jun 2026 01:59:40 +0300 From: Konstantin Belousov To: Piotr Kubaj Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 255538cd9060 - main - powerpc64le: switch long double to IEEE binary128 Message-ID: References: <6a35bbf2.44afb.6a2dde3e@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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6a35bbf2.44afb.6a2dde3e@gitrepo.freebsd.org> X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=4.0.2 X-Spam-Checker-Version: SpamAssassin 4.0.2 (2025-08-27) on tom.home X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : No valid SPF, No valid DKIM,none]; ARC_NA(0.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MIME_TRACE(0.00)[0:+]; FREEFALL_USER(0.00)[kib]; TO_DN_SOME(0.00)[]; HAS_XAW(0.00)[]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_THREE(0.00)[4] X-Spamd-Bar: -- X-Rspamd-Queue-Id: 4gk6Gy2s9Lz3Bq5 On Fri, Jun 19, 2026 at 10:00:18PM +0000, Piotr Kubaj wrote: > The branch main has been updated by pkubaj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=255538cd906045095d0c2113ae6c4731ce36c0cf > > commit 255538cd906045095d0c2113ae6c4731ce36c0cf > Author: Piotr Kubaj > AuthorDate: 2026-06-15 15:37:26 +0000 > Commit: Piotr Kubaj > CommitDate: 2026-06-19 21:25:39 +0000 > > powerpc64le: switch long double to IEEE binary128 > > Change powerpc64le's long double from 64-bit double to IEEE 754 > binary128 (quad, 113-bit mantissa), matching aarch64 and riscv64. > > Gated on FreeBSD 16 and powerpc64le only. > > Differential Revision: https://reviews.freebsd.org/D57388 > Reviewed by: adrian > Relnotes: yes I get the following from tinderbox: ld.lld: error: version script assignment of 'CXXABI_1.3' to symbol 'typeinfo for long double const*' failed: symbol not defined ld.lld: error: version script assignment of 'CXXABI_1.3' to symbol 'typeinfo for long double' failed: symbol not defined ld.lld: error: version script assignment of 'CXXABI_1.3' to symbol 'typeinfo for long double*' failed: symbol not defined ld.lld: error: version script assignment of 'CXXABI_1.3' to symbol 'typeinfo name for long double const*' failed: symbol not defined ld.lld: error: version script assignment of 'CXXABI_1.3' to symbol 'typeinfo name for long double' failed: symbol not defined ld.lld: error: version script assignment of 'CXXABI_1.3' to symbol 'typeinfo name for long double*' failed: symbol not defined cc: error: linker command failed with exit code 1 (use -v to see invocation) --- libcxxrt.so.1.full --- *** [libcxxrt.so.1.full] Error code 1 From nobody Sun Jun 21 23:17:10 2026 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 4gk6ft4ddxz6j1Jb for ; Sun, 21 Jun 2026 23:17:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gk6ft3hyrz3D9x for ; Sun, 21 Jun 2026 23:17:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782083830; 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=XlWUFm43LZiYNS/g8WsD3w/TNbBXMyKJCEop9XqPwUY=; b=g/6kTrpXXs9XEelfgqOqKOqCBRPD1TUMecS9MY5RPNBYUx4skoVG3EyvBVoDp4v6ubqGUQ c5QOmcd85NBirJ7UkpQ+Y3TMA+lLzRcfvj9ti/C0CUEP1JfjzagLopg1X0L6yfOEUf5sRm yOMedo65/enR6Ss5xwz2ClJ9M8m3NkwM0pS8W+7cvhFcL/N6DaTCnZ1IYgJ2qCMtqcBR5h wlu/ewH9zuQcePcD1gm27OJsNBW9SW5mdc8UKtr8ZN+O7AR6KvUlfALS29kMgYpWUVVQub IGS1qiIurbVtuwVRSQ+c1s2W9L417A+pBvMSbYLCprNHBM++wRusl3505EI2kQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782083830; a=rsa-sha256; cv=none; b=cnYjfSbluZ4a6V4MSlyF/0RUbGOJ54t/vehpEuQ2E7ty+l0F1nDPKa8Hqyq7/69eCKSE3H i6DB7+JF3xOoNJ/vs2jy7Sr0FcJVOuTkxl8s5sCvjhv19ZvgfD6C0Qgp3ToUT122VgczKH RUv+GluCBraxx3BV5ITlkFLZbR09W/mczcSSNxuZIg3zQk7m/uWezd9iHx4Elk1OQyDOwM DJSD6EGzYdIxqTn2MXihxZevaN2OY33n6Sz5pxGOK5Qj3kBe2cA8Swdw8XOAI8ORsoovVv 9s+kqTpeP5OwIgR9eizKZrJ1wFmEs3XFnIE9Uqc67ZKuD8oRz3CG/voGvVC3Bw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782083830; 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=XlWUFm43LZiYNS/g8WsD3w/TNbBXMyKJCEop9XqPwUY=; b=VFglLL4CO9OgCZiq10cOjTAPJMfdotPO3OYlnbw5nvBYj0FhSdhUWpC3m3rPV/zwjQIRnR ALEy6/cHE6pLWtuDnCY1Pxmsr6CYsRi9Sv0lZ47RkvO5egUo5Q4nyOmIQ4GmESy/8ZnyTz 23PghkC3ha+Ij0+rRDyo2z+MXwF5sMLS8tLYr9TIFNiV/czk6Gl7+jIDHz5eNCOOyT5pwh UW3phy9HJWjLjZgoMLY0gCcBGpYmrac6g3aI3JYhM8Bjvfsu1uToupYGN4QX2cnJaZNm6e 8hdTM7sU+XkfCsco+7htXAn0UoMg+TmOSmHCGM9zI00C2iQnfMm23we07H0ghQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gk6ft2Y7yz6Rv for ; Sun, 21 Jun 2026 23:17:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 27e10 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 21 Jun 2026 23:17:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 455c354dd4db - main - gss_impl.c: Fix a nfsd hang when the kgssapi.ko is loaded, but no gssd 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 455c354dd4dbba9b9ec9c68e335ab3aa46dca438 Auto-Submitted: auto-generated Date: Sun, 21 Jun 2026 23:17:10 +0000 Message-Id: <6a3870f6.27e10.60055e9a@gitrepo.freebsd.org> The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=455c354dd4dbba9b9ec9c68e335ab3aa46dca438 commit 455c354dd4dbba9b9ec9c68e335ab3aa46dca438 Author: Rick Macklem AuthorDate: 2026-06-21 23:15:23 +0000 Commit: Rick Macklem CommitDate: 2026-06-21 23:15:23 +0000 gss_impl.c: Fix a nfsd hang when the kgssapi.ko is loaded, but no gssd After the conversion to using netlink, the kgssapi had no way of knowing if the gssd daemon was running. As such, a boot where the kgssapi is loaded, but the gssd is not enabled would hang the nfsd for a very long time. (Many timeouts at 300sec each.) This patch adds a Null RPC upcall with a 200msec timeout to check to see if the gssd is running. If the gssd is not running, the nfsd starts up (without Kerberos support) with only a 200msec delay.) Also, move the svc_svc_nl_create() and svc_reg() calls in gssd.c to before the daemon() call, so they are guaranteed to have been done before the nfsd(8) daemon is started by the rc scripts. PR: 295714 Reviewed by: glebius MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D57455 --- sys/kgssapi/gss_impl.c | 42 ++++++++++++++++++++++++++++++++++++++++-- usr.sbin/gssd/gssd.c | 22 +++++----------------- 2 files changed, 45 insertions(+), 19 deletions(-) diff --git a/sys/kgssapi/gss_impl.c b/sys/kgssapi/gss_impl.c index 97b85a034071..4c7147fc3879 100644 --- a/sys/kgssapi/gss_impl.c +++ b/sys/kgssapi/gss_impl.c @@ -57,6 +57,7 @@ static int kgss_load(void) { CLIENT *cl; + struct timeval nulltimo = {.tv_sec = 0, .tv_usec = 200000}; LIST_INIT(&kgss_mechs); @@ -65,13 +66,16 @@ kgss_load(void) /* * The transport default is no retries at all, since there could - * be no userland listener to our messages. We will retry for 5 + * be no userland listener to our messages. Initially, a short timeout + * is set, so that a Null RPC upcall will fail quickly if the daemon + * is not running. After the Null RPC succeeds, we will retry for 5 * minutes with 10 second interval. This will potentially cure hosts * with misconfigured startup, where kernel starts sending GSS queries * before userland had started up the gssd(8) daemon. + * The initial timeout of 200usec is for the Null RPC. */ clnt_control(cl, CLSET_RETRIES, &(int){30}); - clnt_control(cl, CLSET_TIMEOUT, &(struct timeval){.tv_sec = 300}); + clnt_control(cl, CLSET_TIMEOUT, &nulltimo); /* * We literally wait on gssd(8), let's see that in top(1). @@ -237,9 +241,43 @@ CLIENT * kgss_gssd_client(void) { CLIENT *cl; + struct rpc_callextra ext; + enum clnt_stat stat; + struct timeval rpctimo = {.tv_sec = 300, .tv_usec = 0}; + static time_t nextrpc = 0; + static bool done_upcall = false; mtx_lock(&kgss_gssd_lock); cl = kgss_gssd_handle; + if (!done_upcall) { + mtx_unlock(&kgss_gssd_lock); + /* + * Can only be NULL if client_nl_create() called from + * kgss_load() returns NULL. + */ + if (cl == NULL) + return (cl); + if (time_uptime < nextrpc) + return (NULL); + /* + * Do a Null RPC with a short timeout. If the RPC succeeds, + * the gssd daemon is running. If the Null RPC fails, don't + * again for 5sec. + */ + memset(&ext, 0, sizeof(ext)); + ext.rc_auth = authnone_create(); + stat = clnt_call_private(cl, &ext, NULLPROC, + (xdrproc_t)xdr_void, NULL, (xdrproc_t)xdr_void, NULL, + rpctimo); /* rpctimo is ignored by clnt_nl_call(). */ + AUTH_DESTROY(ext.rc_auth); + if (stat != RPC_SUCCESS) { + nextrpc = time_uptime + 5; + return (NULL); + } + CLNT_CONTROL(cl, CLSET_TIMEOUT, &rpctimo); + mtx_lock(&kgss_gssd_lock); + done_upcall = true; + } if (cl != NULL) CLNT_ACQUIRE(cl); mtx_unlock(&kgss_gssd_lock); diff --git a/usr.sbin/gssd/gssd.c b/usr.sbin/gssd/gssd.c index 54d2062dd29a..5a00dbdd7c97 100644 --- a/usr.sbin/gssd/gssd.c +++ b/usr.sbin/gssd/gssd.c @@ -167,6 +167,11 @@ main(int argc, char **argv) gssd_load_mech(); + if ((xprt = svc_nl_create("kgss")) == NULL) + errx(1, "Can't create transport for local gssd socket"); + if (!svc_reg(xprt, GSSD, GSSDVERS, gssd_1, NULL)) + errx(1, "Can't register service for local gssd socket"); + if (!debug_level) { if (daemon(0, 0) != 0) err(1, "Can't daemonize"); @@ -177,23 +182,6 @@ main(int argc, char **argv) signal(SIGTERM, gssd_terminate); signal(SIGPIPE, gssd_terminate); - if ((xprt = svc_nl_create("kgss")) == NULL) { - if (debug_level == 0) { - syslog(LOG_ERR, - "Can't create transport for local gssd socket"); - exit(1); - } - err(1, "Can't create transport for local gssd socket"); - } - if (!svc_reg(xprt, GSSD, GSSDVERS, gssd_1, NULL)) { - if (debug_level == 0) { - syslog(LOG_ERR, - "Can't register service for local gssd socket"); - exit(1); - } - err(1, "Can't register service for local gssd socket"); - } - LIST_INIT(&gss_resources); gss_next_id = 1; gss_start_time = time(0);